ibm-platform-services 0.64.0__py3-none-any.whl → 0.66.0__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.
@@ -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.102.0-615ec964-20250307-203034
17
+ # IBM OpenAPI SDK Code Generator Version: 3.103.0-e8b84313-20250402-201816
18
18
 
19
19
  """
20
20
  IAM Policy Management API
@@ -137,9 +137,9 @@ class IamPolicyManagementV1(BaseService):
137
137
  :param str state: (optional) The state of the policy.
138
138
  * `active` - returns active policies
139
139
  * `deleted` - returns non-active policies.
140
- :param int limit: (optional) The number of documents to include in
140
+ :param int limit: (optional) The number of documents to include in the
141
141
  collection.
142
- :param str start: (optional) Page token that refers to the page of
142
+ :param str start: (optional) Page token that refers to the page of the
143
143
  collection to return.
144
144
  :param dict headers: A `dict` containing the request headers
145
145
  :return: A `DetailedResponse` containing the result, headers and HTTP status code.
@@ -254,7 +254,7 @@ class IamPolicyManagementV1(BaseService):
254
254
 
255
255
  :param str type: The policy type; either 'access' or 'authorization'.
256
256
  :param List[PolicySubject] subjects: The subjects associated with a policy.
257
- :param List[PolicyRole] roles: A set of role cloud resource names (CRNs)
257
+ :param List[PolicyRole] roles: A set of role Cloud Resource Names (CRNs)
258
258
  granted by the policy.
259
259
  :param List[PolicyResource] resources: The resources associated with a
260
260
  policy.
@@ -388,7 +388,7 @@ class IamPolicyManagementV1(BaseService):
388
388
  header.
389
389
  :param str type: The policy type; either 'access' or 'authorization'.
390
390
  :param List[PolicySubject] subjects: The subjects associated with a policy.
391
- :param List[PolicyRole] roles: A set of role cloud resource names (CRNs)
391
+ :param List[PolicyRole] roles: A set of role Cloud Resource Names (CRNs)
392
392
  granted by the policy.
393
393
  :param List[PolicyResource] resources: The resources associated with a
394
394
  policy.
@@ -713,13 +713,13 @@ class IamPolicyManagementV1(BaseService):
713
713
  the new role, but there must be at least one service-defined action to
714
714
  successfully create the new role.
715
715
 
716
- :param str display_name: The display name of the role that is shown in the
717
- console.
716
+ :param str display_name: The display the name of the role that is shown in
717
+ the console.
718
718
  :param List[str] actions: The actions of the role. For more information,
719
719
  see [IAM roles and
720
720
  actions](https://cloud.ibm.com/docs/account?topic=account-iam-service-roles-actions).
721
- :param str name: The name of the role that is used in the CRN. Can only be
722
- alphanumeric and has to be capitalized.
721
+ :param str name: The name of the role that is used in the CRN. This must be
722
+ alphanumeric and capitalized.
723
723
  :param str account_id: The account GUID.
724
724
  :param str service_name: The service name.
725
725
  :param str description: (optional) The description of the role.
@@ -809,8 +809,8 @@ class IamPolicyManagementV1(BaseService):
809
809
  :param str if_match: The revision number for updating a role and must match
810
810
  the ETag value of the existing role. The Etag can be retrieved using the
811
811
  GET /v2/roles/{role_id} API and looking at the ETag response header.
812
- :param str display_name: The display name of the role that is shown in the
813
- console.
812
+ :param str display_name: The display the name of the role that is shown in
813
+ the console.
814
814
  :param List[str] actions: The actions of the role. For more information,
815
815
  see [IAM roles and
816
816
  actions](https://cloud.ibm.com/docs/account?topic=account-iam-service-roles-actions).
@@ -1029,9 +1029,9 @@ class IamPolicyManagementV1(BaseService):
1029
1029
  :param str state: (optional) The state of the policy.
1030
1030
  * `active` - returns active policies
1031
1031
  * `deleted` - returns non-active policies.
1032
- :param int limit: (optional) The number of documents to include in
1032
+ :param int limit: (optional) The number of documents to include in the
1033
1033
  collection.
1034
- :param str start: (optional) Page token that refers to the page of
1034
+ :param str start: (optional) Page token that refers to the page of the
1035
1035
  collection to return.
1036
1036
  :param dict headers: A `dict` containing the request headers
1037
1037
  :return: A `DetailedResponse` containing the result, headers and HTTP status code.
@@ -1148,8 +1148,9 @@ class IamPolicyManagementV1(BaseService):
1148
1148
  'dateTimeLessThan', 'dateTimeLessThanOrEquals', 'dateTimeGreaterThan',
1149
1149
  'dateTimeGreaterThanOrEquals',
1150
1150
  'dayOfWeekEquals', 'dayOfWeekAnyOf'
1151
- ``` The pattern field that matches the rule is required when rule is provided. For
1152
- the business hour rule example above, the **`pattern`** is
1151
+ ```
1152
+ The pattern field that matches the rule is required when rule is provided. For the
1153
+ business hour rule example above, the **`pattern`** is
1153
1154
  **`"time-based-conditions:weekly"`**. For more information, see [Time-based
1154
1155
  conditions
1155
1156
  operators](/docs/account?topic=account-iam-condition-properties&interface=ui#policy-condition-properties)
@@ -1225,7 +1226,8 @@ class IamPolicyManagementV1(BaseService):
1225
1226
  locationvalues are supported by the service, they are validated against Global
1226
1227
  Catalog locations.
1227
1228
 
1228
- :param Control control: Specifies the type of access granted by the policy.
1229
+ :param Control control: Specifies the type of access that is granted by the
1230
+ policy.
1229
1231
  :param str type: The policy type; either 'access' or 'authorization'.
1230
1232
  :param str description: (optional) Description of the policy.
1231
1233
  :param V2PolicySubject subject: (optional) The subject attributes for whom
@@ -1450,7 +1452,8 @@ class IamPolicyManagementV1(BaseService):
1450
1452
  match the ETag value of the existing policy. The Etag can be retrieved
1451
1453
  using the GET /v2/policies/{id} API and looking at the ETag response
1452
1454
  header.
1453
- :param Control control: Specifies the type of access granted by the policy.
1455
+ :param Control control: Specifies the type of access that is granted by the
1456
+ policy.
1454
1457
  :param str type: The policy type; either 'access' or 'authorization'.
1455
1458
  :param str description: (optional) Description of the policy.
1456
1459
  :param V2PolicySubject subject: (optional) The subject attributes for whom
@@ -1677,9 +1680,9 @@ class IamPolicyManagementV1(BaseService):
1677
1680
  :param str policy_service_name: (optional) Service name, Optional.
1678
1681
  :param str policy_service_group_id: (optional) Service group id, Optional.
1679
1682
  :param str policy_type: (optional) Policy type, Optional.
1680
- :param int limit: (optional) The number of documents to include in
1683
+ :param int limit: (optional) The number of documents to include in the
1681
1684
  collection.
1682
- :param str start: (optional) Page token that refers to the page of
1685
+ :param str start: (optional) Page token that refers to the page of the
1683
1686
  collection to return.
1684
1687
  :param dict headers: A `dict` containing the request headers
1685
1688
  :return: A `DetailedResponse` containing the result, headers and HTTP status code.
@@ -1743,13 +1746,13 @@ class IamPolicyManagementV1(BaseService):
1743
1746
  Create a policy template. Policy templates define a policy without requiring a
1744
1747
  subject, and you can use them to grant access to multiple subjects.
1745
1748
 
1746
- :param str name: Required field when creating a new template. Otherwise
1747
- this field is optional. If the field is included it will change the name
1748
- value for all existing versions of the template.
1749
- :param str account_id: Enterprise account ID where this template will be
1749
+ :param str name: Required field when creating a new template. Otherwise,
1750
+ this field is optional. If the field is included, it changes the name value
1751
+ for all existing versions of the template.
1752
+ :param str account_id: Enterprise account ID where this template is
1750
1753
  created.
1751
1754
  :param TemplatePolicy policy: The core set of properties associated with
1752
- the template's policy objet.
1755
+ the template's policy object.
1753
1756
  :param str description: (optional) Description of the policy template. This
1754
1757
  is shown to users in the enterprise account. Use this to describe the
1755
1758
  purpose or context of the policy for enterprise users managing IAM
@@ -1933,10 +1936,10 @@ class IamPolicyManagementV1(BaseService):
1933
1936
 
1934
1937
  :param str policy_template_id: The policy template ID.
1935
1938
  :param TemplatePolicy policy: The core set of properties associated with
1936
- the template's policy objet.
1939
+ the template's policy object.
1937
1940
  :param str name: (optional) Required field when creating a new template.
1938
- Otherwise this field is optional. If the field is included it will change
1939
- the name value for all existing versions of the template.
1941
+ Otherwise, this field is optional. If the field is included, it changes the
1942
+ name value for all existing versions of the template.
1940
1943
  :param str description: (optional) Description of the policy template. This
1941
1944
  is shown to users in the enterprise account. Use this to describe the
1942
1945
  purpose or context of the policy for enterprise users managing IAM
@@ -2005,9 +2008,9 @@ class IamPolicyManagementV1(BaseService):
2005
2008
 
2006
2009
  :param str policy_template_id: The policy template ID.
2007
2010
  :param str state: (optional) The policy template state.
2008
- :param int limit: (optional) The number of documents to include in
2011
+ :param int limit: (optional) The number of documents to include in the
2009
2012
  collection.
2010
- :param str start: (optional) Page token that refers to the page of
2013
+ :param str start: (optional) Page token that refers to the page of the
2011
2014
  collection to return.
2012
2015
  :param dict headers: A `dict` containing the request headers
2013
2016
  :return: A `DetailedResponse` containing the result, headers and HTTP status code.
@@ -2075,10 +2078,10 @@ class IamPolicyManagementV1(BaseService):
2075
2078
  /v1/policy_templates/{policy_template_id}/versions/{version} API and
2076
2079
  looking at the ETag response header.
2077
2080
  :param TemplatePolicy policy: The core set of properties associated with
2078
- the template's policy objet.
2081
+ the template's policy object.
2079
2082
  :param str name: (optional) Required field when creating a new template.
2080
- Otherwise this field is optional. If the field is included it will change
2081
- the name value for all existing versions of the template.
2083
+ Otherwise, this field is optional. If the field is included, it changes the
2084
+ name value for all existing versions of the template.
2082
2085
  :param str description: (optional) Description of the policy template. This
2083
2086
  is shown to users in the enterprise account. Use this to describe the
2084
2087
  purpose or context of the policy for enterprise users managing IAM
@@ -2326,9 +2329,9 @@ class IamPolicyManagementV1(BaseService):
2326
2329
  * `zh-tw` - (Chinese, Taiwan).
2327
2330
  :param str template_id: (optional) Optional template id.
2328
2331
  :param str template_version: (optional) Optional policy template version.
2329
- :param int limit: (optional) The number of documents to include in
2332
+ :param int limit: (optional) The number of documents to include in the
2330
2333
  collection.
2331
- :param str start: (optional) Page token that refers to the page of
2334
+ :param str start: (optional) Page token that refers to the page of the
2332
2335
  collection to return.
2333
2336
  :param dict headers: A `dict` containing the request headers
2334
2337
  :return: A `DetailedResponse` containing the result, headers and HTTP status code.
@@ -2526,9 +2529,9 @@ class IamPolicyManagementV1(BaseService):
2526
2529
  :param str assignment_id: The policy template assignment ID.
2527
2530
  :param str version: specify version of response body format.
2528
2531
  :param str if_match: The revision number for updating a policy assignment
2529
- and must match the ETag value of the existing policy assignment. The Etag
2532
+ and must match the Etag value of the existing policy assignment. The Etag
2530
2533
  can be retrieved using the GET /v1/policy_assignments/{assignment_id} API
2531
- and looking at the ETag response header.
2534
+ and looking at the Etag response header.
2532
2535
  :param str template_version: The policy template version to update to.
2533
2536
  :param dict headers: A `dict` containing the request headers
2534
2537
  :return: A `DetailedResponse` containing the result, headers and HTTP status code.
@@ -2709,15 +2712,15 @@ class IamPolicyManagementV1(BaseService):
2709
2712
  Update the way identities within an external account are allowed to interact with
2710
2713
  the requested account by providing:
2711
2714
  * the `account_id` as a parameter
2712
- * the external account ID(s) and state for the specific identity in the request
2713
- body
2715
+ * one or more external account ID(s) and state for the specific identity in the
2716
+ request body
2714
2717
  External account identity interaction includes the following `identity_types`:
2715
- `user` (user identities defined as
2716
- [IBMid's](https://test.cloud.ibm.com/docs/account?topic=account-identity-overview#users-bestpract)),
2718
+ `user` (user identities that are defined as
2719
+ [IBMid's](https://cloud.ibm.com/docs/account?topic=account-identity-overview#users-bestpract)),
2717
2720
  `service_id` (defined as [IAM
2718
- ServiceIds](https://test.cloud.ibm.com/docs/account?topic=account-identity-overview#serviceid-bestpract)),
2721
+ ServiceIds](https://cloud.ibm.com/docs/account?topic=account-identity-overview#serviceid-bestpract)),
2719
2722
  `service` (defined by a service’s
2720
- [CRN](https://test.cloud.ibm.com/docs/account?topic=account-crn)). To update an
2723
+ [CRN](https://cloud.ibm.com/docs/account?topic=account-crn)). To update an
2721
2724
  Identity’s setting, the `state` and `external_allowed_accounts` fields are
2722
2725
  required.
2723
2726
  Different identity states are:
@@ -2726,9 +2729,9 @@ class IamPolicyManagementV1(BaseService):
2726
2729
  * "limited": An identity type is allowed to access resources in the account
2727
2730
  provided it has access policies on those resources AND it is associated with
2728
2731
  either the account the resources are in or one of the allowed accounts. This
2729
- setting leverages the "external_allowed_accounts" list.
2730
- * "monitor": Has no direct impact on an Identity’s access. Instead, it creates AT
2731
- events for access decisions as if the account were in a limited “state”.
2732
+ setting uses the "external_allowed_accounts" list.
2733
+ * "monitor": It has no direct impact on an Identity’s access. Instead, it creates
2734
+ AT events for access decisions as if the account were in a limited “state”.
2732
2735
  **Note**: The state "enabled" is a special case. In this case, access is given to
2733
2736
  all accounts and there is no need to specify a particular list. Therefore, when
2734
2737
  updating "state" to "enabled" for an identity type "external_allowed_accounts"
@@ -2736,10 +2739,10 @@ class IamPolicyManagementV1(BaseService):
2736
2739
 
2737
2740
  :param str account_id: The account GUID that the settings belong to.
2738
2741
  :param str if_match: The revision number for updating Access Management
2739
- Account Settings and must match the ETag value of the existing Access
2742
+ Account Settings and must match the Etag value of the existing Access
2740
2743
  Management Account Settings. The Etag can be retrieved using the GET
2741
2744
  /v1/accounts/{account_id}/settings/access_management API and looking at the
2742
- ETag response header.
2745
+ Etag response header.
2743
2746
  :param ExternalAccountIdentityInteractionPatch
2744
2747
  external_account_identity_interaction: (optional) Update to how external
2745
2748
  accounts can interact in relation to the requested account.
@@ -2803,243 +2806,2247 @@ class IamPolicyManagementV1(BaseService):
2803
2806
  response = self.send(request, **kwargs)
2804
2807
  return response
2805
2808
 
2809
+ #########################
2810
+ # Action Control Templates
2811
+ #########################
2806
2812
 
2807
- class ListPoliciesEnums:
2808
- """
2809
- Enums for list_policies parameters.
2810
- """
2811
-
2812
- class Type(str, Enum):
2813
- """
2814
- Optional type of policy.
2813
+ def list_action_control_templates(
2814
+ self,
2815
+ account_id: str,
2816
+ *,
2817
+ accept_language: Optional[str] = None,
2818
+ limit: Optional[int] = None,
2819
+ start: Optional[str] = None,
2820
+ **kwargs,
2821
+ ) -> DetailedResponse:
2815
2822
  """
2823
+ List action control templates by attributes.
2816
2824
 
2817
- ACCESS = 'access'
2818
- AUTHORIZATION = 'authorization'
2825
+ List action control templates and filter by attributes by using query parameters.
2826
+ The following attributes are supported:
2827
+ `account_id`
2828
+ `account_id` is a required query parameter. Only action control templates that
2829
+ have the specified attributes and that the caller has read access to are returned.
2830
+ If the caller does not have read access to any action control templates an empty
2831
+ array is returned.
2819
2832
 
2820
- class ServiceType(str, Enum):
2821
- """
2822
- Optional type of service.
2833
+ :param str account_id: The account GUID that the action control templates
2834
+ belong to.
2835
+ :param str accept_language: (optional) Language code for translations
2836
+ * `default` - English
2837
+ * `de` - German (Standard)
2838
+ * `en` - English
2839
+ * `es` - Spanish (Spain)
2840
+ * `fr` - French (Standard)
2841
+ * `it` - Italian (Standard)
2842
+ * `ja` - Japanese
2843
+ * `ko` - Korean
2844
+ * `pt-br` - Portuguese (Brazil)
2845
+ * `zh-cn` - Chinese (Simplified, PRC)
2846
+ * `zh-tw` - (Chinese, Taiwan).
2847
+ :param int limit: (optional) The number of documents to include in the
2848
+ collection.
2849
+ :param str start: (optional) Page token that refers to the page of the
2850
+ collection to return.
2851
+ :param dict headers: A `dict` containing the request headers
2852
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
2853
+ :rtype: DetailedResponse with `dict` result representing a `ActionControlTemplateCollection` object
2823
2854
  """
2824
2855
 
2825
- SERVICE = 'service'
2826
- PLATFORM_SERVICE = 'platform_service'
2856
+ if not account_id:
2857
+ raise ValueError('account_id must be provided')
2858
+ headers = {
2859
+ 'Accept-Language': accept_language,
2860
+ }
2861
+ sdk_headers = get_sdk_headers(
2862
+ service_name=self.DEFAULT_SERVICE_NAME,
2863
+ service_version='V1',
2864
+ operation_id='list_action_control_templates',
2865
+ )
2866
+ headers.update(sdk_headers)
2827
2867
 
2828
- class Sort(str, Enum):
2829
- """
2830
- Optional top level policy field to sort results. Ascending sort is default.
2831
- Descending sort available by prepending '-' to field. Example '-last_modified_at'.
2832
- """
2868
+ params = {
2869
+ 'account_id': account_id,
2870
+ 'limit': limit,
2871
+ 'start': start,
2872
+ }
2833
2873
 
2834
- ID = 'id'
2835
- TYPE = 'type'
2836
- HREF = 'href'
2837
- CREATED_AT = 'created_at'
2838
- CREATED_BY_ID = 'created_by_id'
2839
- LAST_MODIFIED_AT = 'last_modified_at'
2840
- LAST_MODIFIED_BY_ID = 'last_modified_by_id'
2841
- STATE = 'state'
2874
+ if 'headers' in kwargs:
2875
+ headers.update(kwargs.get('headers'))
2876
+ del kwargs['headers']
2877
+ headers['Accept'] = 'application/json'
2842
2878
 
2843
- class Format(str, Enum):
2844
- """
2845
- Include additional data per policy returned
2846
- * `include_last_permit` - returns details of when the policy last granted a permit
2847
- decision and the number of times it has done so
2848
- * `display` - returns the list of all actions included in each of the policy
2849
- roles.
2850
- """
2879
+ url = '/v1/action_control_templates'
2880
+ request = self.prepare_request(
2881
+ method='GET',
2882
+ url=url,
2883
+ headers=headers,
2884
+ params=params,
2885
+ )
2851
2886
 
2852
- INCLUDE_LAST_PERMIT = 'include_last_permit'
2853
- DISPLAY = 'display'
2887
+ response = self.send(request, **kwargs)
2888
+ return response
2854
2889
 
2855
- class State(str, Enum):
2856
- """
2857
- The state of the policy.
2858
- * `active` - returns active policies
2859
- * `deleted` - returns non-active policies.
2890
+ def create_action_control_template(
2891
+ self,
2892
+ name: str,
2893
+ account_id: str,
2894
+ *,
2895
+ description: Optional[str] = None,
2896
+ committed: Optional[bool] = None,
2897
+ action_control: Optional['TemplateActionControl'] = None,
2898
+ accept_language: Optional[str] = None,
2899
+ **kwargs,
2900
+ ) -> DetailedResponse:
2860
2901
  """
2902
+ Create an action control template.
2861
2903
 
2862
- ACTIVE = 'active'
2863
- DELETED = 'deleted'
2904
+ Create an action control template. Action control templates define a service
2905
+ action control.
2864
2906
 
2907
+ :param str name: Required field when creating a new template. Otherwise,
2908
+ this field is optional. If the field is included, it changes the name value
2909
+ for all existing versions of the template.
2910
+ :param str account_id: Enterprise account ID where this template is
2911
+ created.
2912
+ :param str description: (optional) Description of the action control
2913
+ template. This is shown to users in the enterprise account. Use this to
2914
+ describe the purpose or context of the action control for enterprise users
2915
+ managing IAM templates.
2916
+ :param bool committed: (optional) Committed status of the template. If
2917
+ committed is set to true, then the template version can no longer be
2918
+ updated.
2919
+ :param TemplateActionControl action_control: (optional) The action control
2920
+ properties that are created in an action resource when the template is
2921
+ assigned.
2922
+ :param str accept_language: (optional) Language code for translations
2923
+ * `default` - English
2924
+ * `de` - German (Standard)
2925
+ * `en` - English
2926
+ * `es` - Spanish (Spain)
2927
+ * `fr` - French (Standard)
2928
+ * `it` - Italian (Standard)
2929
+ * `ja` - Japanese
2930
+ * `ko` - Korean
2931
+ * `pt-br` - Portuguese (Brazil)
2932
+ * `zh-cn` - Chinese (Simplified, PRC)
2933
+ * `zh-tw` - (Chinese, Taiwan).
2934
+ :param dict headers: A `dict` containing the request headers
2935
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
2936
+ :rtype: DetailedResponse with `dict` result representing a `ActionControlTemplate` object
2937
+ """
2865
2938
 
2866
- class ListV2PoliciesEnums:
2867
- """
2868
- Enums for list_v2_policies parameters.
2869
- """
2939
+ if name is None:
2940
+ raise ValueError('name must be provided')
2941
+ if account_id is None:
2942
+ raise ValueError('account_id must be provided')
2943
+ if action_control is not None:
2944
+ action_control = convert_model(action_control)
2945
+ headers = {
2946
+ 'Accept-Language': accept_language,
2947
+ }
2948
+ sdk_headers = get_sdk_headers(
2949
+ service_name=self.DEFAULT_SERVICE_NAME,
2950
+ service_version='V1',
2951
+ operation_id='create_action_control_template',
2952
+ )
2953
+ headers.update(sdk_headers)
2870
2954
 
2871
- class Type(str, Enum):
2872
- """
2873
- Optional type of policy.
2874
- """
2955
+ data = {
2956
+ 'name': name,
2957
+ 'account_id': account_id,
2958
+ 'description': description,
2959
+ 'committed': committed,
2960
+ 'action_control': action_control,
2961
+ }
2962
+ data = {k: v for (k, v) in data.items() if v is not None}
2963
+ data = json.dumps(data)
2964
+ headers['content-type'] = 'application/json'
2875
2965
 
2876
- ACCESS = 'access'
2877
- AUTHORIZATION = 'authorization'
2966
+ if 'headers' in kwargs:
2967
+ headers.update(kwargs.get('headers'))
2968
+ del kwargs['headers']
2969
+ headers['Accept'] = 'application/json'
2878
2970
 
2879
- class ServiceType(str, Enum):
2880
- """
2881
- Optional type of service.
2882
- """
2971
+ url = '/v1/action_control_templates'
2972
+ request = self.prepare_request(
2973
+ method='POST',
2974
+ url=url,
2975
+ headers=headers,
2976
+ data=data,
2977
+ )
2883
2978
 
2884
- SERVICE = 'service'
2885
- PLATFORM_SERVICE = 'platform_service'
2979
+ response = self.send(request, **kwargs)
2980
+ return response
2886
2981
 
2887
- class Format(str, Enum):
2888
- """
2889
- Include additional data per policy returned
2890
- * `include_last_permit` - returns details of when the policy last granted a permit
2891
- decision and the number of times it has done so
2892
- * `display` - returns the list of all actions included in each of the policy roles
2893
- and translations for all relevant fields.
2982
+ def get_action_control_template(
2983
+ self,
2984
+ action_control_template_id: str,
2985
+ *,
2986
+ state: Optional[str] = None,
2987
+ **kwargs,
2988
+ ) -> DetailedResponse:
2894
2989
  """
2990
+ Retrieve the latest version of an action control template.
2895
2991
 
2896
- INCLUDE_LAST_PERMIT = 'include_last_permit'
2897
- DISPLAY = 'display'
2992
+ Retrieve the latest version of an action control template by providing an action
2993
+ control template ID.
2898
2994
 
2899
- class State(str, Enum):
2900
- """
2901
- The state of the policy.
2902
- * `active` - returns active policies
2903
- * `deleted` - returns non-active policies.
2995
+ :param str action_control_template_id: Action control template ID.
2996
+ :param str state: (optional) The action control template state.
2997
+ :param dict headers: A `dict` containing the request headers
2998
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
2999
+ :rtype: DetailedResponse with `dict` result representing a `ActionControlTemplate` object
2904
3000
  """
2905
3001
 
2906
- ACTIVE = 'active'
2907
- DELETED = 'deleted'
3002
+ if not action_control_template_id:
3003
+ raise ValueError('action_control_template_id must be provided')
3004
+ headers = {}
3005
+ sdk_headers = get_sdk_headers(
3006
+ service_name=self.DEFAULT_SERVICE_NAME,
3007
+ service_version='V1',
3008
+ operation_id='get_action_control_template',
3009
+ )
3010
+ headers.update(sdk_headers)
2908
3011
 
3012
+ params = {
3013
+ 'state': state,
3014
+ }
2909
3015
 
2910
- class GetV2PolicyEnums:
2911
- """
2912
- Enums for get_v2_policy parameters.
2913
- """
3016
+ if 'headers' in kwargs:
3017
+ headers.update(kwargs.get('headers'))
3018
+ del kwargs['headers']
3019
+ headers['Accept'] = 'application/json'
2914
3020
 
2915
- class Format(str, Enum):
2916
- """
2917
- Include additional data for policy returned
2918
- * `include_last_permit` - returns details of when the policy last granted a permit
2919
- decision and the number of times it has done so
2920
- * `display` - returns the list of all actions included in each of the policy roles
2921
- and translations for all relevant fields.
2922
- """
3021
+ path_param_keys = ['action_control_template_id']
3022
+ path_param_values = self.encode_path_vars(action_control_template_id)
3023
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
3024
+ url = '/v1/action_control_templates/{action_control_template_id}'.format(**path_param_dict)
3025
+ request = self.prepare_request(
3026
+ method='GET',
3027
+ url=url,
3028
+ headers=headers,
3029
+ params=params,
3030
+ )
2923
3031
 
2924
- INCLUDE_LAST_PERMIT = 'include_last_permit'
2925
- DISPLAY = 'display'
3032
+ response = self.send(request, **kwargs)
3033
+ return response
2926
3034
 
3035
+ def delete_action_control_template(
3036
+ self,
3037
+ action_control_template_id: str,
3038
+ **kwargs,
3039
+ ) -> DetailedResponse:
3040
+ """
3041
+ Delete an action control template.
2927
3042
 
2928
- class ListPolicyTemplatesEnums:
2929
- """
2930
- Enums for list_policy_templates parameters.
2931
- """
3043
+ Delete an action control template by providing the action control template ID.
3044
+ This deletes all versions of this template. An action control template can't be
3045
+ deleted if any version of the template is assigned to one or more child accounts.
3046
+ You must remove the action control assignments first.
2932
3047
 
2933
- class State(str, Enum):
2934
- """
2935
- The policy template state.
3048
+ :param str action_control_template_id: Action control template ID.
3049
+ :param dict headers: A `dict` containing the request headers
3050
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
3051
+ :rtype: DetailedResponse
2936
3052
  """
2937
3053
 
2938
- ACTIVE = 'active'
3054
+ if not action_control_template_id:
3055
+ raise ValueError('action_control_template_id must be provided')
3056
+ headers = {}
3057
+ sdk_headers = get_sdk_headers(
3058
+ service_name=self.DEFAULT_SERVICE_NAME,
3059
+ service_version='V1',
3060
+ operation_id='delete_action_control_template',
3061
+ )
3062
+ headers.update(sdk_headers)
3063
+
3064
+ if 'headers' in kwargs:
3065
+ headers.update(kwargs.get('headers'))
3066
+ del kwargs['headers']
3067
+
3068
+ path_param_keys = ['action_control_template_id']
3069
+ path_param_values = self.encode_path_vars(action_control_template_id)
3070
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
3071
+ url = '/v1/action_control_templates/{action_control_template_id}'.format(**path_param_dict)
3072
+ request = self.prepare_request(
3073
+ method='DELETE',
3074
+ url=url,
3075
+ headers=headers,
3076
+ )
3077
+
3078
+ response = self.send(request, **kwargs)
3079
+ return response
3080
+
3081
+ def create_action_control_template_version(
3082
+ self,
3083
+ action_control_template_id: str,
3084
+ *,
3085
+ name: Optional[str] = None,
3086
+ description: Optional[str] = None,
3087
+ action_control: Optional['TemplateActionControl'] = None,
3088
+ committed: Optional[bool] = None,
3089
+ **kwargs,
3090
+ ) -> DetailedResponse:
3091
+ """
3092
+ Create a new action control template version.
3093
+
3094
+ Create a new version of an action control template. Use this if you need to make
3095
+ updates to an action control template that is committed.
3096
+
3097
+ :param str action_control_template_id: The action control template ID.
3098
+ :param str name: (optional) Required field when creating a new template.
3099
+ Otherwise, this field is optional. If the field is included, it will change
3100
+ the name value for all existing versions of the template.
3101
+ :param str description: (optional) Description of the action control
3102
+ template. This is shown to users in the enterprise account. Use this to
3103
+ describe the purpose or context of the action control for enterprise users
3104
+ managing IAM templates.
3105
+ :param TemplateActionControl action_control: (optional) The action control
3106
+ properties that are created in an action resource when the template is
3107
+ assigned.
3108
+ :param bool committed: (optional) Committed status of the template version.
3109
+ If committed is set to true, then the template version can no longer be
3110
+ updated.
3111
+ :param dict headers: A `dict` containing the request headers
3112
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
3113
+ :rtype: DetailedResponse with `dict` result representing a `ActionControlTemplate` object
3114
+ """
3115
+
3116
+ if not action_control_template_id:
3117
+ raise ValueError('action_control_template_id must be provided')
3118
+ if action_control is not None:
3119
+ action_control = convert_model(action_control)
3120
+ headers = {}
3121
+ sdk_headers = get_sdk_headers(
3122
+ service_name=self.DEFAULT_SERVICE_NAME,
3123
+ service_version='V1',
3124
+ operation_id='create_action_control_template_version',
3125
+ )
3126
+ headers.update(sdk_headers)
3127
+
3128
+ data = {
3129
+ 'name': name,
3130
+ 'description': description,
3131
+ 'action_control': action_control,
3132
+ 'committed': committed,
3133
+ }
3134
+ data = {k: v for (k, v) in data.items() if v is not None}
3135
+ data = json.dumps(data)
3136
+ headers['content-type'] = 'application/json'
3137
+
3138
+ if 'headers' in kwargs:
3139
+ headers.update(kwargs.get('headers'))
3140
+ del kwargs['headers']
3141
+ headers['Accept'] = 'application/json'
3142
+
3143
+ path_param_keys = ['action_control_template_id']
3144
+ path_param_values = self.encode_path_vars(action_control_template_id)
3145
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
3146
+ url = '/v1/action_control_templates/{action_control_template_id}/versions'.format(**path_param_dict)
3147
+ request = self.prepare_request(
3148
+ method='POST',
3149
+ url=url,
3150
+ headers=headers,
3151
+ data=data,
3152
+ )
3153
+
3154
+ response = self.send(request, **kwargs)
3155
+ return response
3156
+
3157
+ def list_action_control_template_versions(
3158
+ self,
3159
+ action_control_template_id: str,
3160
+ *,
3161
+ state: Optional[str] = None,
3162
+ limit: Optional[int] = None,
3163
+ start: Optional[str] = None,
3164
+ **kwargs,
3165
+ ) -> DetailedResponse:
3166
+ """
3167
+ Retrieve action control template versions.
3168
+
3169
+ Retrieve the versions of an action control template by providing an action control
3170
+ template ID.
3171
+
3172
+ :param str action_control_template_id: The action control template ID.
3173
+ :param str state: (optional) Action control template state.
3174
+ :param int limit: (optional) The number of documents to include in the
3175
+ collection.
3176
+ :param str start: (optional) Page token that refers to the page of the
3177
+ collection to return.
3178
+ :param dict headers: A `dict` containing the request headers
3179
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
3180
+ :rtype: DetailedResponse with `dict` result representing a `ActionControlTemplateVersionsCollection` object
3181
+ """
3182
+
3183
+ if not action_control_template_id:
3184
+ raise ValueError('action_control_template_id must be provided')
3185
+ headers = {}
3186
+ sdk_headers = get_sdk_headers(
3187
+ service_name=self.DEFAULT_SERVICE_NAME,
3188
+ service_version='V1',
3189
+ operation_id='list_action_control_template_versions',
3190
+ )
3191
+ headers.update(sdk_headers)
3192
+
3193
+ params = {
3194
+ 'state': state,
3195
+ 'limit': limit,
3196
+ 'start': start,
3197
+ }
3198
+
3199
+ if 'headers' in kwargs:
3200
+ headers.update(kwargs.get('headers'))
3201
+ del kwargs['headers']
3202
+ headers['Accept'] = 'application/json'
3203
+
3204
+ path_param_keys = ['action_control_template_id']
3205
+ path_param_values = self.encode_path_vars(action_control_template_id)
3206
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
3207
+ url = '/v1/action_control_templates/{action_control_template_id}/versions'.format(**path_param_dict)
3208
+ request = self.prepare_request(
3209
+ method='GET',
3210
+ url=url,
3211
+ headers=headers,
3212
+ params=params,
3213
+ )
3214
+
3215
+ response = self.send(request, **kwargs)
3216
+ return response
3217
+
3218
+ def replace_action_control_template(
3219
+ self,
3220
+ action_control_template_id: str,
3221
+ version: str,
3222
+ if_match: str,
3223
+ *,
3224
+ name: Optional[str] = None,
3225
+ description: Optional[str] = None,
3226
+ action_control: Optional['TemplateActionControl'] = None,
3227
+ committed: Optional[bool] = None,
3228
+ **kwargs,
3229
+ ) -> DetailedResponse:
3230
+ """
3231
+ Update an action control template version.
3232
+
3233
+ Update a specific version of an action control template. You can use this only if
3234
+ the version isn't committed.
3235
+
3236
+ :param str action_control_template_id: Action control template ID.
3237
+ :param str version: Action control template version.
3238
+ :param str if_match: The revision number for updating an action control
3239
+ template version must match the Etag value of the existing action control
3240
+ template version. The Etag can be retrieved using the GET
3241
+ /v1/action_control_templates/{template_id}/versions/{version} API and
3242
+ looking at the Etag response header.
3243
+ :param str name: (optional) Required field when creating a new template.
3244
+ Otherwise, this field is optional. If the field is included, it will change
3245
+ the name value for all existing versions of the template.
3246
+ :param str description: (optional) Description of the action control
3247
+ template. This is shown to users in the enterprise account. Use this to
3248
+ describe the purpose or context of the action control for enterprise users
3249
+ managing IAM templates.
3250
+ :param TemplateActionControl action_control: (optional) The action control
3251
+ properties that are created in an action resource when the template is
3252
+ assigned.
3253
+ :param bool committed: (optional) Committed status of the template version.
3254
+ If committed is set to true, then the template version can no longer be
3255
+ updated.
3256
+ :param dict headers: A `dict` containing the request headers
3257
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
3258
+ :rtype: DetailedResponse with `dict` result representing a `ActionControlTemplate` object
3259
+ """
3260
+
3261
+ if not action_control_template_id:
3262
+ raise ValueError('action_control_template_id must be provided')
3263
+ if not version:
3264
+ raise ValueError('version must be provided')
3265
+ if not if_match:
3266
+ raise ValueError('if_match must be provided')
3267
+ if action_control is not None:
3268
+ action_control = convert_model(action_control)
3269
+ headers = {
3270
+ 'If-Match': if_match,
3271
+ }
3272
+ sdk_headers = get_sdk_headers(
3273
+ service_name=self.DEFAULT_SERVICE_NAME,
3274
+ service_version='V1',
3275
+ operation_id='replace_action_control_template',
3276
+ )
3277
+ headers.update(sdk_headers)
3278
+
3279
+ data = {
3280
+ 'name': name,
3281
+ 'description': description,
3282
+ 'action_control': action_control,
3283
+ 'committed': committed,
3284
+ }
3285
+ data = {k: v for (k, v) in data.items() if v is not None}
3286
+ data = json.dumps(data)
3287
+ headers['content-type'] = 'application/json'
3288
+
3289
+ if 'headers' in kwargs:
3290
+ headers.update(kwargs.get('headers'))
3291
+ del kwargs['headers']
3292
+ headers['Accept'] = 'application/json'
3293
+
3294
+ path_param_keys = ['action_control_template_id', 'version']
3295
+ path_param_values = self.encode_path_vars(action_control_template_id, version)
3296
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
3297
+ url = '/v1/action_control_templates/{action_control_template_id}/versions/{version}'.format(**path_param_dict)
3298
+ request = self.prepare_request(
3299
+ method='PUT',
3300
+ url=url,
3301
+ headers=headers,
3302
+ data=data,
3303
+ )
3304
+
3305
+ response = self.send(request, **kwargs)
3306
+ return response
3307
+
3308
+ def delete_action_control_template_version(
3309
+ self,
3310
+ action_control_template_id: str,
3311
+ version: str,
3312
+ **kwargs,
3313
+ ) -> DetailedResponse:
3314
+ """
3315
+ Delete an action control template version.
3316
+
3317
+ Delete a specific version of an action control template by providing an action
3318
+ control template ID and version number. You can't delete an action control
3319
+ template version that is assigned to one or more child accounts. You must remove
3320
+ the action control assignments first.
3321
+
3322
+ :param str action_control_template_id: Action control template ID.
3323
+ :param str version: Action control template version.
3324
+ :param dict headers: A `dict` containing the request headers
3325
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
3326
+ :rtype: DetailedResponse
3327
+ """
3328
+
3329
+ if not action_control_template_id:
3330
+ raise ValueError('action_control_template_id must be provided')
3331
+ if not version:
3332
+ raise ValueError('version must be provided')
3333
+ headers = {}
3334
+ sdk_headers = get_sdk_headers(
3335
+ service_name=self.DEFAULT_SERVICE_NAME,
3336
+ service_version='V1',
3337
+ operation_id='delete_action_control_template_version',
3338
+ )
3339
+ headers.update(sdk_headers)
3340
+
3341
+ if 'headers' in kwargs:
3342
+ headers.update(kwargs.get('headers'))
3343
+ del kwargs['headers']
3344
+
3345
+ path_param_keys = ['action_control_template_id', 'version']
3346
+ path_param_values = self.encode_path_vars(action_control_template_id, version)
3347
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
3348
+ url = '/v1/action_control_templates/{action_control_template_id}/versions/{version}'.format(**path_param_dict)
3349
+ request = self.prepare_request(
3350
+ method='DELETE',
3351
+ url=url,
3352
+ headers=headers,
3353
+ )
3354
+
3355
+ response = self.send(request, **kwargs)
3356
+ return response
3357
+
3358
+ def get_action_control_template_version(
3359
+ self,
3360
+ action_control_template_id: str,
3361
+ version: str,
3362
+ **kwargs,
3363
+ ) -> DetailedResponse:
3364
+ """
3365
+ Retrieve an action control template version.
3366
+
3367
+ Retrieve an action control template by providing an action control template ID and
3368
+ version number.
3369
+
3370
+ :param str action_control_template_id: Action control template ID.
3371
+ :param str version: Action control template version.
3372
+ :param dict headers: A `dict` containing the request headers
3373
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
3374
+ :rtype: DetailedResponse with `dict` result representing a `ActionControlTemplate` object
3375
+ """
3376
+
3377
+ if not action_control_template_id:
3378
+ raise ValueError('action_control_template_id must be provided')
3379
+ if not version:
3380
+ raise ValueError('version must be provided')
3381
+ headers = {}
3382
+ sdk_headers = get_sdk_headers(
3383
+ service_name=self.DEFAULT_SERVICE_NAME,
3384
+ service_version='V1',
3385
+ operation_id='get_action_control_template_version',
3386
+ )
3387
+ headers.update(sdk_headers)
3388
+
3389
+ if 'headers' in kwargs:
3390
+ headers.update(kwargs.get('headers'))
3391
+ del kwargs['headers']
3392
+ headers['Accept'] = 'application/json'
3393
+
3394
+ path_param_keys = ['action_control_template_id', 'version']
3395
+ path_param_values = self.encode_path_vars(action_control_template_id, version)
3396
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
3397
+ url = '/v1/action_control_templates/{action_control_template_id}/versions/{version}'.format(**path_param_dict)
3398
+ request = self.prepare_request(
3399
+ method='GET',
3400
+ url=url,
3401
+ headers=headers,
3402
+ )
3403
+
3404
+ response = self.send(request, **kwargs)
3405
+ return response
3406
+
3407
+ def commit_action_control_template(
3408
+ self,
3409
+ action_control_template_id: str,
3410
+ version: str,
3411
+ **kwargs,
3412
+ ) -> DetailedResponse:
3413
+ """
3414
+ Commit an action control template version.
3415
+
3416
+ Commit an action control template version. You cannot make any further changes to
3417
+ the action control template once it's committed. If you have to make updates after
3418
+ committing a version, create a new version.
3419
+
3420
+ :param str action_control_template_id: Action control template ID.
3421
+ :param str version: The action control template version.
3422
+ :param dict headers: A `dict` containing the request headers
3423
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
3424
+ :rtype: DetailedResponse
3425
+ """
3426
+
3427
+ if not action_control_template_id:
3428
+ raise ValueError('action_control_template_id must be provided')
3429
+ if not version:
3430
+ raise ValueError('version must be provided')
3431
+ headers = {}
3432
+ sdk_headers = get_sdk_headers(
3433
+ service_name=self.DEFAULT_SERVICE_NAME,
3434
+ service_version='V1',
3435
+ operation_id='commit_action_control_template',
3436
+ )
3437
+ headers.update(sdk_headers)
3438
+
3439
+ if 'headers' in kwargs:
3440
+ headers.update(kwargs.get('headers'))
3441
+ del kwargs['headers']
3442
+
3443
+ path_param_keys = ['action_control_template_id', 'version']
3444
+ path_param_values = self.encode_path_vars(action_control_template_id, version)
3445
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
3446
+ url = '/v1/action_control_templates/{action_control_template_id}/versions/{version}/commit'.format(
3447
+ **path_param_dict
3448
+ )
3449
+ request = self.prepare_request(
3450
+ method='POST',
3451
+ url=url,
3452
+ headers=headers,
3453
+ )
3454
+
3455
+ response = self.send(request, **kwargs)
3456
+ return response
3457
+
3458
+ #########################
3459
+ # Action Control Assignments
3460
+ #########################
3461
+
3462
+ def list_action_control_assignments(
3463
+ self,
3464
+ account_id: str,
3465
+ *,
3466
+ accept_language: Optional[str] = None,
3467
+ template_id: Optional[str] = None,
3468
+ template_version: Optional[str] = None,
3469
+ limit: Optional[int] = None,
3470
+ start: Optional[str] = None,
3471
+ **kwargs,
3472
+ ) -> DetailedResponse:
3473
+ """
3474
+ Get action control template assignments.
3475
+
3476
+ Get action control template assignments by attributes. The following attributes
3477
+ are supported:
3478
+ `account_id`, `template_id`, `template_version`, `sort`.
3479
+ `account_id` is a required query parameter. Only action control template
3480
+ assignments with the specified attributes and accessible by the caller are
3481
+ returned. If the caller does not have read access to any action control template
3482
+ assignments, an empty array is returned.
3483
+
3484
+ :param str account_id: The account GUID in which the action control
3485
+ assignment belongs to.
3486
+ :param str accept_language: (optional) Language code for translations
3487
+ * `default` - English
3488
+ * `de` - German (Standard)
3489
+ * `en` - English
3490
+ * `es` - Spanish (Spain)
3491
+ * `fr` - French (Standard)
3492
+ * `it` - Italian (Standard)
3493
+ * `ja` - Japanese
3494
+ * `ko` - Korean
3495
+ * `pt-br` - Portuguese (Brazil)
3496
+ * `zh-cn` - Chinese (Simplified, PRC)
3497
+ * `zh-tw` - (Chinese, Taiwan).
3498
+ :param str template_id: (optional) Optional template ID.
3499
+ :param str template_version: (optional) Optional action control template
3500
+ version.
3501
+ :param int limit: (optional) The number of documents to include in the
3502
+ collection.
3503
+ :param str start: (optional) Page token that refers to the page of the
3504
+ collection to return.
3505
+ :param dict headers: A `dict` containing the request headers
3506
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
3507
+ :rtype: DetailedResponse with `dict` result representing a `ActionControlAssignmentCollection` object
3508
+ """
3509
+
3510
+ if not account_id:
3511
+ raise ValueError('account_id must be provided')
3512
+ headers = {
3513
+ 'Accept-Language': accept_language,
3514
+ }
3515
+ sdk_headers = get_sdk_headers(
3516
+ service_name=self.DEFAULT_SERVICE_NAME,
3517
+ service_version='V1',
3518
+ operation_id='list_action_control_assignments',
3519
+ )
3520
+ headers.update(sdk_headers)
3521
+
3522
+ params = {
3523
+ 'account_id': account_id,
3524
+ 'template_id': template_id,
3525
+ 'template_version': template_version,
3526
+ 'limit': limit,
3527
+ 'start': start,
3528
+ }
3529
+
3530
+ if 'headers' in kwargs:
3531
+ headers.update(kwargs.get('headers'))
3532
+ del kwargs['headers']
3533
+ headers['Accept'] = 'application/json'
3534
+
3535
+ url = '/v1/action_control_assignments'
3536
+ request = self.prepare_request(
3537
+ method='GET',
3538
+ url=url,
3539
+ headers=headers,
3540
+ params=params,
3541
+ )
3542
+
3543
+ response = self.send(request, **kwargs)
3544
+ return response
3545
+
3546
+ def create_action_control_template_assignment(
3547
+ self,
3548
+ target: 'AssignmentTargetDetails',
3549
+ templates: List['ActionControlAssignmentTemplate'],
3550
+ *,
3551
+ accept_language: Optional[str] = None,
3552
+ **kwargs,
3553
+ ) -> DetailedResponse:
3554
+ """
3555
+ Create an action control template assignment.
3556
+
3557
+ Assign an action control template to child accounts and account groups. This
3558
+ creates the action control in the accounts and account groups that you specify.
3559
+
3560
+ :param AssignmentTargetDetails target: assignment target account and type.
3561
+ :param List[ActionControlAssignmentTemplate] templates: List of action
3562
+ control template details for action control assignment.
3563
+ :param str accept_language: (optional) Language code for translations
3564
+ * `default` - English
3565
+ * `de` - German (Standard)
3566
+ * `en` - English
3567
+ * `es` - Spanish (Spain)
3568
+ * `fr` - French (Standard)
3569
+ * `it` - Italian (Standard)
3570
+ * `ja` - Japanese
3571
+ * `ko` - Korean
3572
+ * `pt-br` - Portuguese (Brazil)
3573
+ * `zh-cn` - Chinese (Simplified, PRC)
3574
+ * `zh-tw` - (Chinese, Taiwan).
3575
+ :param dict headers: A `dict` containing the request headers
3576
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
3577
+ :rtype: DetailedResponse with `dict` result representing a `ActionControlAssignmentCollection` object
3578
+ """
3579
+
3580
+ if target is None:
3581
+ raise ValueError('target must be provided')
3582
+ if templates is None:
3583
+ raise ValueError('templates must be provided')
3584
+ target = convert_model(target)
3585
+ templates = [convert_model(x) for x in templates]
3586
+ headers = {
3587
+ 'Accept-Language': accept_language,
3588
+ }
3589
+ sdk_headers = get_sdk_headers(
3590
+ service_name=self.DEFAULT_SERVICE_NAME,
3591
+ service_version='V1',
3592
+ operation_id='create_action_control_template_assignment',
3593
+ )
3594
+ headers.update(sdk_headers)
3595
+
3596
+ data = {
3597
+ 'target': target,
3598
+ 'templates': templates,
3599
+ }
3600
+ data = {k: v for (k, v) in data.items() if v is not None}
3601
+ data = json.dumps(data)
3602
+ headers['content-type'] = 'application/json'
3603
+
3604
+ if 'headers' in kwargs:
3605
+ headers.update(kwargs.get('headers'))
3606
+ del kwargs['headers']
3607
+ headers['Accept'] = 'application/json'
3608
+
3609
+ url = '/v1/action_control_assignments'
3610
+ request = self.prepare_request(
3611
+ method='POST',
3612
+ url=url,
3613
+ headers=headers,
3614
+ data=data,
3615
+ )
3616
+
3617
+ response = self.send(request, **kwargs)
3618
+ return response
3619
+
3620
+ def get_action_control_assignment(
3621
+ self,
3622
+ assignment_id: str,
3623
+ **kwargs,
3624
+ ) -> DetailedResponse:
3625
+ """
3626
+ Retrieve an action control assignment.
3627
+
3628
+ Retrieve an action control template assignment by providing an action control
3629
+ assignment ID.
3630
+
3631
+ :param str assignment_id: Action control template assignment ID.
3632
+ :param dict headers: A `dict` containing the request headers
3633
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
3634
+ :rtype: DetailedResponse with `dict` result representing a `ActionControlAssignment` object
3635
+ """
3636
+
3637
+ if not assignment_id:
3638
+ raise ValueError('assignment_id must be provided')
3639
+ headers = {}
3640
+ sdk_headers = get_sdk_headers(
3641
+ service_name=self.DEFAULT_SERVICE_NAME,
3642
+ service_version='V1',
3643
+ operation_id='get_action_control_assignment',
3644
+ )
3645
+ headers.update(sdk_headers)
3646
+
3647
+ if 'headers' in kwargs:
3648
+ headers.update(kwargs.get('headers'))
3649
+ del kwargs['headers']
3650
+ headers['Accept'] = 'application/json'
3651
+
3652
+ path_param_keys = ['assignment_id']
3653
+ path_param_values = self.encode_path_vars(assignment_id)
3654
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
3655
+ url = '/v1/action_control_assignments/{assignment_id}'.format(**path_param_dict)
3656
+ request = self.prepare_request(
3657
+ method='GET',
3658
+ url=url,
3659
+ headers=headers,
3660
+ )
3661
+
3662
+ response = self.send(request, **kwargs)
3663
+ return response
3664
+
3665
+ def update_action_control_assignment(
3666
+ self,
3667
+ assignment_id: str,
3668
+ if_match: str,
3669
+ template_version: str,
3670
+ **kwargs,
3671
+ ) -> DetailedResponse:
3672
+ """
3673
+ Update an action control assignment.
3674
+
3675
+ Update an action control assignment by providing an action control assignment ID.
3676
+
3677
+ :param str assignment_id: Action control template assignment ID.
3678
+ :param str if_match: The revision number for updating an action control
3679
+ assignment and must match the Etag value of the existing action control
3680
+ assignment. The Etag can be retrieved using the GET
3681
+ /v1/action_control_assignments/{assignment_id} API and looking at the Etag
3682
+ response header.
3683
+ :param str template_version: The version number of the template used to
3684
+ identify different versions of same template.
3685
+ :param dict headers: A `dict` containing the request headers
3686
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
3687
+ :rtype: DetailedResponse with `dict` result representing a `ActionControlAssignment` object
3688
+ """
3689
+
3690
+ if not assignment_id:
3691
+ raise ValueError('assignment_id must be provided')
3692
+ if not if_match:
3693
+ raise ValueError('if_match must be provided')
3694
+ if template_version is None:
3695
+ raise ValueError('template_version must be provided')
3696
+ headers = {
3697
+ 'If-Match': if_match,
3698
+ }
3699
+ sdk_headers = get_sdk_headers(
3700
+ service_name=self.DEFAULT_SERVICE_NAME,
3701
+ service_version='V1',
3702
+ operation_id='update_action_control_assignment',
3703
+ )
3704
+ headers.update(sdk_headers)
3705
+
3706
+ data = {
3707
+ 'template_version': template_version,
3708
+ }
3709
+ data = {k: v for (k, v) in data.items() if v is not None}
3710
+ data = json.dumps(data)
3711
+ headers['content-type'] = 'application/json'
3712
+
3713
+ if 'headers' in kwargs:
3714
+ headers.update(kwargs.get('headers'))
3715
+ del kwargs['headers']
3716
+ headers['Accept'] = 'application/json'
3717
+
3718
+ path_param_keys = ['assignment_id']
3719
+ path_param_values = self.encode_path_vars(assignment_id)
3720
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
3721
+ url = '/v1/action_control_assignments/{assignment_id}'.format(**path_param_dict)
3722
+ request = self.prepare_request(
3723
+ method='PATCH',
3724
+ url=url,
3725
+ headers=headers,
3726
+ data=data,
3727
+ )
3728
+
3729
+ response = self.send(request, **kwargs)
3730
+ return response
3731
+
3732
+ def delete_action_control_assignment(
3733
+ self,
3734
+ assignment_id: str,
3735
+ **kwargs,
3736
+ ) -> DetailedResponse:
3737
+ """
3738
+ Remove an action control assignment.
3739
+
3740
+ Remove an action control template assignment by providing an action control
3741
+ assignment ID. You can't delete an action control assignment if the status is
3742
+ "in_progress".
3743
+
3744
+ :param str assignment_id: Action control template assignment ID.
3745
+ :param dict headers: A `dict` containing the request headers
3746
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
3747
+ :rtype: DetailedResponse
3748
+ """
3749
+
3750
+ if not assignment_id:
3751
+ raise ValueError('assignment_id must be provided')
3752
+ headers = {}
3753
+ sdk_headers = get_sdk_headers(
3754
+ service_name=self.DEFAULT_SERVICE_NAME,
3755
+ service_version='V1',
3756
+ operation_id='delete_action_control_assignment',
3757
+ )
3758
+ headers.update(sdk_headers)
3759
+
3760
+ if 'headers' in kwargs:
3761
+ headers.update(kwargs.get('headers'))
3762
+ del kwargs['headers']
3763
+
3764
+ path_param_keys = ['assignment_id']
3765
+ path_param_values = self.encode_path_vars(assignment_id)
3766
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
3767
+ url = '/v1/action_control_assignments/{assignment_id}'.format(**path_param_dict)
3768
+ request = self.prepare_request(
3769
+ method='DELETE',
3770
+ url=url,
3771
+ headers=headers,
3772
+ )
3773
+
3774
+ response = self.send(request, **kwargs)
3775
+ return response
3776
+
3777
+
3778
+ class ListPoliciesEnums:
3779
+ """
3780
+ Enums for list_policies parameters.
3781
+ """
3782
+
3783
+ class Type(str, Enum):
3784
+ """
3785
+ Optional type of policy.
3786
+ """
3787
+
3788
+ ACCESS = 'access'
3789
+ AUTHORIZATION = 'authorization'
3790
+
3791
+ class ServiceType(str, Enum):
3792
+ """
3793
+ Optional type of service.
3794
+ """
3795
+
3796
+ SERVICE = 'service'
3797
+ PLATFORM_SERVICE = 'platform_service'
3798
+
3799
+ class Sort(str, Enum):
3800
+ """
3801
+ Optional top level policy field to sort results. Ascending sort is default.
3802
+ Descending sort available by prepending '-' to field. Example '-last_modified_at'.
3803
+ """
3804
+
3805
+ ID = 'id'
3806
+ TYPE = 'type'
3807
+ HREF = 'href'
3808
+ CREATED_AT = 'created_at'
3809
+ CREATED_BY_ID = 'created_by_id'
3810
+ LAST_MODIFIED_AT = 'last_modified_at'
3811
+ LAST_MODIFIED_BY_ID = 'last_modified_by_id'
3812
+ STATE = 'state'
3813
+
3814
+ class Format(str, Enum):
3815
+ """
3816
+ Include additional data per policy returned
3817
+ * `include_last_permit` - returns details of when the policy last granted a permit
3818
+ decision and the number of times it has done so
3819
+ * `display` - returns the list of all actions included in each of the policy
3820
+ roles.
3821
+ """
3822
+
3823
+ INCLUDE_LAST_PERMIT = 'include_last_permit'
3824
+ DISPLAY = 'display'
3825
+
3826
+ class State(str, Enum):
3827
+ """
3828
+ The state of the policy.
3829
+ * `active` - returns active policies
3830
+ * `deleted` - returns non-active policies.
3831
+ """
3832
+
3833
+ ACTIVE = 'active'
3834
+ DELETED = 'deleted'
3835
+
3836
+
3837
+ class ListV2PoliciesEnums:
3838
+ """
3839
+ Enums for list_v2_policies parameters.
3840
+ """
3841
+
3842
+ class Type(str, Enum):
3843
+ """
3844
+ Optional type of policy.
3845
+ """
3846
+
3847
+ ACCESS = 'access'
3848
+ AUTHORIZATION = 'authorization'
3849
+
3850
+ class ServiceType(str, Enum):
3851
+ """
3852
+ Optional type of service.
3853
+ """
3854
+
3855
+ SERVICE = 'service'
3856
+ PLATFORM_SERVICE = 'platform_service'
3857
+
3858
+ class Format(str, Enum):
3859
+ """
3860
+ Include additional data per policy returned
3861
+ * `include_last_permit` - returns details of when the policy last granted a permit
3862
+ decision and the number of times it has done so
3863
+ * `display` - returns the list of all actions included in each of the policy roles
3864
+ and translations for all relevant fields.
3865
+ """
3866
+
3867
+ INCLUDE_LAST_PERMIT = 'include_last_permit'
3868
+ DISPLAY = 'display'
3869
+
3870
+ class State(str, Enum):
3871
+ """
3872
+ The state of the policy.
3873
+ * `active` - returns active policies
3874
+ * `deleted` - returns non-active policies.
3875
+ """
3876
+
3877
+ ACTIVE = 'active'
3878
+ DELETED = 'deleted'
3879
+
3880
+
3881
+ class GetV2PolicyEnums:
3882
+ """
3883
+ Enums for get_v2_policy parameters.
3884
+ """
3885
+
3886
+ class Format(str, Enum):
3887
+ """
3888
+ Include additional data for policy returned
3889
+ * `include_last_permit` - returns details of when the policy last granted a permit
3890
+ decision and the number of times it has done so
3891
+ * `display` - returns the list of all actions included in each of the policy roles
3892
+ and translations for all relevant fields.
3893
+ """
3894
+
3895
+ INCLUDE_LAST_PERMIT = 'include_last_permit'
3896
+ DISPLAY = 'display'
3897
+
3898
+
3899
+ class ListPolicyTemplatesEnums:
3900
+ """
3901
+ Enums for list_policy_templates parameters.
3902
+ """
3903
+
3904
+ class State(str, Enum):
3905
+ """
3906
+ The policy template state.
3907
+ """
3908
+
3909
+ ACTIVE = 'active'
3910
+ DELETED = 'deleted'
3911
+
3912
+ class PolicyServiceType(str, Enum):
3913
+ """
3914
+ Service type, Optional.
3915
+ """
3916
+
3917
+ SERVICE = 'service'
3918
+ PLATFORM_SERVICE = 'platform_service'
3919
+
3920
+ class PolicyType(str, Enum):
3921
+ """
3922
+ Policy type, Optional.
3923
+ """
3924
+
3925
+ ACCESS = 'access'
3926
+ AUTHORIZATION = 'authorization'
3927
+
3928
+
3929
+ class GetPolicyTemplateEnums:
3930
+ """
3931
+ Enums for get_policy_template parameters.
3932
+ """
3933
+
3934
+ class State(str, Enum):
3935
+ """
3936
+ The policy template state.
3937
+ """
3938
+
3939
+ ACTIVE = 'active'
3940
+ DELETED = 'deleted'
3941
+
3942
+
3943
+ class ListPolicyTemplateVersionsEnums:
3944
+ """
3945
+ Enums for list_policy_template_versions parameters.
3946
+ """
3947
+
3948
+ class State(str, Enum):
3949
+ """
3950
+ The policy template state.
3951
+ """
3952
+
3953
+ ACTIVE = 'active'
3954
+ DELETED = 'deleted'
3955
+
3956
+
3957
+ class GetActionControlTemplateEnums:
3958
+ """
3959
+ Enums for get_action_control_template parameters.
3960
+ """
3961
+
3962
+ class State(str, Enum):
3963
+ """
3964
+ The action control template state.
3965
+ """
3966
+
3967
+ ACTIVE = 'active'
3968
+ DELETED = 'deleted'
3969
+
3970
+
3971
+ class ListActionControlTemplateVersionsEnums:
3972
+ """
3973
+ Enums for list_action_control_template_versions parameters.
3974
+ """
3975
+
3976
+ class State(str, Enum):
3977
+ """
3978
+ Action control template state.
3979
+ """
3980
+
3981
+ ACTIVE = 'active'
2939
3982
  DELETED = 'deleted'
2940
3983
 
2941
- class PolicyServiceType(str, Enum):
2942
- """
2943
- Service type, Optional.
2944
- """
2945
3984
 
2946
- SERVICE = 'service'
2947
- PLATFORM_SERVICE = 'platform_service'
3985
+ ##############################################################################
3986
+ # Models
3987
+ ##############################################################################
3988
+
3989
+
3990
+ class AccountSettingsAccessManagement:
3991
+ """
3992
+ The Access Management Account Settings that are currently set for the requested
3993
+ account.
3994
+
3995
+ :param ExternalAccountIdentityInteraction external_account_identity_interaction:
3996
+ How external accounts can interact in relation to the requested account.
3997
+ """
3998
+
3999
+ def __init__(
4000
+ self,
4001
+ external_account_identity_interaction: 'ExternalAccountIdentityInteraction',
4002
+ ) -> None:
4003
+ """
4004
+ Initialize a AccountSettingsAccessManagement object.
4005
+
4006
+ :param ExternalAccountIdentityInteraction
4007
+ external_account_identity_interaction: How external accounts can interact
4008
+ in relation to the requested account.
4009
+ """
4010
+ self.external_account_identity_interaction = external_account_identity_interaction
4011
+
4012
+ @classmethod
4013
+ def from_dict(cls, _dict: Dict) -> 'AccountSettingsAccessManagement':
4014
+ """Initialize a AccountSettingsAccessManagement object from a json dictionary."""
4015
+ args = {}
4016
+ if (external_account_identity_interaction := _dict.get('external_account_identity_interaction')) is not None:
4017
+ args['external_account_identity_interaction'] = ExternalAccountIdentityInteraction.from_dict(
4018
+ external_account_identity_interaction
4019
+ )
4020
+ else:
4021
+ raise ValueError(
4022
+ 'Required property \'external_account_identity_interaction\' not present in AccountSettingsAccessManagement JSON'
4023
+ )
4024
+ return cls(**args)
4025
+
4026
+ @classmethod
4027
+ def _from_dict(cls, _dict):
4028
+ """Initialize a AccountSettingsAccessManagement object from a json dictionary."""
4029
+ return cls.from_dict(_dict)
4030
+
4031
+ def to_dict(self) -> Dict:
4032
+ """Return a json dictionary representing this model."""
4033
+ _dict = {}
4034
+ if (
4035
+ hasattr(self, 'external_account_identity_interaction')
4036
+ and self.external_account_identity_interaction is not None
4037
+ ):
4038
+ if isinstance(self.external_account_identity_interaction, dict):
4039
+ _dict['external_account_identity_interaction'] = self.external_account_identity_interaction
4040
+ else:
4041
+ _dict['external_account_identity_interaction'] = self.external_account_identity_interaction.to_dict()
4042
+ return _dict
4043
+
4044
+ def _to_dict(self):
4045
+ """Return a json dictionary representing this model."""
4046
+ return self.to_dict()
4047
+
4048
+ def __str__(self) -> str:
4049
+ """Return a `str` version of this AccountSettingsAccessManagement object."""
4050
+ return json.dumps(self.to_dict(), indent=2)
4051
+
4052
+ def __eq__(self, other: 'AccountSettingsAccessManagement') -> bool:
4053
+ """Return `true` when self and other are equal, false otherwise."""
4054
+ if not isinstance(other, self.__class__):
4055
+ return False
4056
+ return self.__dict__ == other.__dict__
4057
+
4058
+ def __ne__(self, other: 'AccountSettingsAccessManagement') -> bool:
4059
+ """Return `true` when self and other are not equal, false otherwise."""
4060
+ return not self == other
4061
+
4062
+
4063
+ class ActionControlAssignment:
4064
+ """
4065
+ The set of properties associated with the assigned action control template.
4066
+
4067
+ :param str id: (optional) Action control assignment ID.
4068
+ :param str account_id: (optional) The account GUID that the action control
4069
+ assignments belong to.
4070
+ :param str href: (optional) The href URL that links to the action control
4071
+ assignments API by action control assignment ID.
4072
+ :param datetime created_at: (optional) The UTC timestamp when the action control
4073
+ assignment was created.
4074
+ :param str created_by_id: (optional) The IAM ID of the entity that created the
4075
+ action control assignment.
4076
+ :param datetime last_modified_at: (optional) The UTC timestamp when the action
4077
+ control assignment was last modified.
4078
+ :param str last_modified_by_id: (optional) The IAM ID of the entity that last
4079
+ modified the action control assignment.
4080
+ :param str operation: (optional) The current operation of the action control
4081
+ assignment.
4082
+ :param List[ActionControlAssignmentResource] resources: (optional) Resources
4083
+ created when action control template is assigned.
4084
+ :param ActionControlAssignmentTemplate template: The action control template id
4085
+ and version that will be assigned.
4086
+ :param AssignmentTargetDetails target: assignment target account and type.
4087
+ :param str status: (optional) The action control assignment status.
4088
+ """
4089
+
4090
+ def __init__(
4091
+ self,
4092
+ template: 'ActionControlAssignmentTemplate',
4093
+ target: 'AssignmentTargetDetails',
4094
+ *,
4095
+ id: Optional[str] = None,
4096
+ account_id: Optional[str] = None,
4097
+ href: Optional[str] = None,
4098
+ created_at: Optional[datetime] = None,
4099
+ created_by_id: Optional[str] = None,
4100
+ last_modified_at: Optional[datetime] = None,
4101
+ last_modified_by_id: Optional[str] = None,
4102
+ operation: Optional[str] = None,
4103
+ resources: Optional[List['ActionControlAssignmentResource']] = None,
4104
+ status: Optional[str] = None,
4105
+ ) -> None:
4106
+ """
4107
+ Initialize a ActionControlAssignment object.
4108
+
4109
+ :param ActionControlAssignmentTemplate template: The action control
4110
+ template id and version that will be assigned.
4111
+ :param AssignmentTargetDetails target: assignment target account and type.
4112
+ """
4113
+ self.id = id
4114
+ self.account_id = account_id
4115
+ self.href = href
4116
+ self.created_at = created_at
4117
+ self.created_by_id = created_by_id
4118
+ self.last_modified_at = last_modified_at
4119
+ self.last_modified_by_id = last_modified_by_id
4120
+ self.operation = operation
4121
+ self.resources = resources
4122
+ self.template = template
4123
+ self.target = target
4124
+ self.status = status
4125
+
4126
+ @classmethod
4127
+ def from_dict(cls, _dict: Dict) -> 'ActionControlAssignment':
4128
+ """Initialize a ActionControlAssignment object from a json dictionary."""
4129
+ args = {}
4130
+ if (id := _dict.get('id')) is not None:
4131
+ args['id'] = id
4132
+ if (account_id := _dict.get('account_id')) is not None:
4133
+ args['account_id'] = account_id
4134
+ if (href := _dict.get('href')) is not None:
4135
+ args['href'] = href
4136
+ if (created_at := _dict.get('created_at')) is not None:
4137
+ args['created_at'] = string_to_datetime(created_at)
4138
+ if (created_by_id := _dict.get('created_by_id')) is not None:
4139
+ args['created_by_id'] = created_by_id
4140
+ if (last_modified_at := _dict.get('last_modified_at')) is not None:
4141
+ args['last_modified_at'] = string_to_datetime(last_modified_at)
4142
+ if (last_modified_by_id := _dict.get('last_modified_by_id')) is not None:
4143
+ args['last_modified_by_id'] = last_modified_by_id
4144
+ if (operation := _dict.get('operation')) is not None:
4145
+ args['operation'] = operation
4146
+ if (resources := _dict.get('resources')) is not None:
4147
+ args['resources'] = [ActionControlAssignmentResource.from_dict(v) for v in resources]
4148
+ if (template := _dict.get('template')) is not None:
4149
+ args['template'] = ActionControlAssignmentTemplate.from_dict(template)
4150
+ else:
4151
+ raise ValueError('Required property \'template\' not present in ActionControlAssignment JSON')
4152
+ if (target := _dict.get('target')) is not None:
4153
+ args['target'] = AssignmentTargetDetails.from_dict(target)
4154
+ else:
4155
+ raise ValueError('Required property \'target\' not present in ActionControlAssignment JSON')
4156
+ if (status := _dict.get('status')) is not None:
4157
+ args['status'] = status
4158
+ return cls(**args)
4159
+
4160
+ @classmethod
4161
+ def _from_dict(cls, _dict):
4162
+ """Initialize a ActionControlAssignment object from a json dictionary."""
4163
+ return cls.from_dict(_dict)
4164
+
4165
+ def to_dict(self) -> Dict:
4166
+ """Return a json dictionary representing this model."""
4167
+ _dict = {}
4168
+ if hasattr(self, 'id') and getattr(self, 'id') is not None:
4169
+ _dict['id'] = getattr(self, 'id')
4170
+ if hasattr(self, 'account_id') and getattr(self, 'account_id') is not None:
4171
+ _dict['account_id'] = getattr(self, 'account_id')
4172
+ if hasattr(self, 'href') and getattr(self, 'href') is not None:
4173
+ _dict['href'] = getattr(self, 'href')
4174
+ if hasattr(self, 'created_at') and getattr(self, 'created_at') is not None:
4175
+ _dict['created_at'] = datetime_to_string(getattr(self, 'created_at'))
4176
+ if hasattr(self, 'created_by_id') and getattr(self, 'created_by_id') is not None:
4177
+ _dict['created_by_id'] = getattr(self, 'created_by_id')
4178
+ if hasattr(self, 'last_modified_at') and getattr(self, 'last_modified_at') is not None:
4179
+ _dict['last_modified_at'] = datetime_to_string(getattr(self, 'last_modified_at'))
4180
+ if hasattr(self, 'last_modified_by_id') and getattr(self, 'last_modified_by_id') is not None:
4181
+ _dict['last_modified_by_id'] = getattr(self, 'last_modified_by_id')
4182
+ if hasattr(self, 'operation') and getattr(self, 'operation') is not None:
4183
+ _dict['operation'] = getattr(self, 'operation')
4184
+ if hasattr(self, 'resources') and getattr(self, 'resources') is not None:
4185
+ resources_list = []
4186
+ for v in getattr(self, 'resources'):
4187
+ if isinstance(v, dict):
4188
+ resources_list.append(v)
4189
+ else:
4190
+ resources_list.append(v.to_dict())
4191
+ _dict['resources'] = resources_list
4192
+ if hasattr(self, 'template') and self.template is not None:
4193
+ if isinstance(self.template, dict):
4194
+ _dict['template'] = self.template
4195
+ else:
4196
+ _dict['template'] = self.template.to_dict()
4197
+ if hasattr(self, 'target') and self.target is not None:
4198
+ if isinstance(self.target, dict):
4199
+ _dict['target'] = self.target
4200
+ else:
4201
+ _dict['target'] = self.target.to_dict()
4202
+ if hasattr(self, 'status') and getattr(self, 'status') is not None:
4203
+ _dict['status'] = getattr(self, 'status')
4204
+ return _dict
4205
+
4206
+ def _to_dict(self):
4207
+ """Return a json dictionary representing this model."""
4208
+ return self.to_dict()
4209
+
4210
+ def __str__(self) -> str:
4211
+ """Return a `str` version of this ActionControlAssignment object."""
4212
+ return json.dumps(self.to_dict(), indent=2)
4213
+
4214
+ def __eq__(self, other: 'ActionControlAssignment') -> bool:
4215
+ """Return `true` when self and other are equal, false otherwise."""
4216
+ if not isinstance(other, self.__class__):
4217
+ return False
4218
+ return self.__dict__ == other.__dict__
4219
+
4220
+ def __ne__(self, other: 'ActionControlAssignment') -> bool:
4221
+ """Return `true` when self and other are not equal, false otherwise."""
4222
+ return not self == other
4223
+
4224
+ class OperationEnum(str, Enum):
4225
+ """
4226
+ The current operation of the action control assignment.
4227
+ """
4228
+
4229
+ CREATE = 'create'
4230
+ APPLY = 'apply'
4231
+ UPDATE = 'update'
4232
+ REMOVE = 'remove'
4233
+
4234
+ class StatusEnum(str, Enum):
4235
+ """
4236
+ The action control assignment status.
4237
+ """
4238
+
4239
+ ACCEPTED = 'accepted'
4240
+ FAILURE = 'failure'
4241
+ IN_PROGRESS = 'in_progress'
4242
+ SUPERSEDED = 'superseded'
4243
+
4244
+
4245
+ class ActionControlAssignmentCollection:
4246
+ """
4247
+ A collection of action control assignments.
4248
+
4249
+ :param int limit: (optional) The number of documents to include per each page of
4250
+ the collection.
4251
+ :param First first: (optional) Details with linking href to first page of
4252
+ requested collection.
4253
+ :param Next next: (optional) Details with href linking to the following page of
4254
+ requested collection.
4255
+ :param Previous previous: (optional) Details with linking href to previous page
4256
+ of requested collection.
4257
+ :param List[ActionControlAssignment] assignments: List of action control
4258
+ assignments.
4259
+ """
4260
+
4261
+ def __init__(
4262
+ self,
4263
+ assignments: List['ActionControlAssignment'],
4264
+ *,
4265
+ limit: Optional[int] = None,
4266
+ first: Optional['First'] = None,
4267
+ next: Optional['Next'] = None,
4268
+ previous: Optional['Previous'] = None,
4269
+ ) -> None:
4270
+ """
4271
+ Initialize a ActionControlAssignmentCollection object.
4272
+
4273
+ :param List[ActionControlAssignment] assignments: List of action control
4274
+ assignments.
4275
+ :param int limit: (optional) The number of documents to include per each
4276
+ page of the collection.
4277
+ :param First first: (optional) Details with linking href to first page of
4278
+ requested collection.
4279
+ :param Next next: (optional) Details with href linking to the following
4280
+ page of requested collection.
4281
+ :param Previous previous: (optional) Details with linking href to previous
4282
+ page of requested collection.
4283
+ """
4284
+ self.limit = limit
4285
+ self.first = first
4286
+ self.next = next
4287
+ self.previous = previous
4288
+ self.assignments = assignments
4289
+
4290
+ @classmethod
4291
+ def from_dict(cls, _dict: Dict) -> 'ActionControlAssignmentCollection':
4292
+ """Initialize a ActionControlAssignmentCollection object from a json dictionary."""
4293
+ args = {}
4294
+ if (limit := _dict.get('limit')) is not None:
4295
+ args['limit'] = limit
4296
+ if (first := _dict.get('first')) is not None:
4297
+ args['first'] = First.from_dict(first)
4298
+ if (next := _dict.get('next')) is not None:
4299
+ args['next'] = Next.from_dict(next)
4300
+ if (previous := _dict.get('previous')) is not None:
4301
+ args['previous'] = Previous.from_dict(previous)
4302
+ if (assignments := _dict.get('assignments')) is not None:
4303
+ args['assignments'] = [ActionControlAssignment.from_dict(v) for v in assignments]
4304
+ else:
4305
+ raise ValueError('Required property \'assignments\' not present in ActionControlAssignmentCollection JSON')
4306
+ return cls(**args)
4307
+
4308
+ @classmethod
4309
+ def _from_dict(cls, _dict):
4310
+ """Initialize a ActionControlAssignmentCollection object from a json dictionary."""
4311
+ return cls.from_dict(_dict)
4312
+
4313
+ def to_dict(self) -> Dict:
4314
+ """Return a json dictionary representing this model."""
4315
+ _dict = {}
4316
+ if hasattr(self, 'limit') and self.limit is not None:
4317
+ _dict['limit'] = self.limit
4318
+ if hasattr(self, 'first') and self.first is not None:
4319
+ if isinstance(self.first, dict):
4320
+ _dict['first'] = self.first
4321
+ else:
4322
+ _dict['first'] = self.first.to_dict()
4323
+ if hasattr(self, 'next') and self.next is not None:
4324
+ if isinstance(self.next, dict):
4325
+ _dict['next'] = self.next
4326
+ else:
4327
+ _dict['next'] = self.next.to_dict()
4328
+ if hasattr(self, 'previous') and self.previous is not None:
4329
+ if isinstance(self.previous, dict):
4330
+ _dict['previous'] = self.previous
4331
+ else:
4332
+ _dict['previous'] = self.previous.to_dict()
4333
+ if hasattr(self, 'assignments') and self.assignments is not None:
4334
+ assignments_list = []
4335
+ for v in self.assignments:
4336
+ if isinstance(v, dict):
4337
+ assignments_list.append(v)
4338
+ else:
4339
+ assignments_list.append(v.to_dict())
4340
+ _dict['assignments'] = assignments_list
4341
+ return _dict
4342
+
4343
+ def _to_dict(self):
4344
+ """Return a json dictionary representing this model."""
4345
+ return self.to_dict()
4346
+
4347
+ def __str__(self) -> str:
4348
+ """Return a `str` version of this ActionControlAssignmentCollection object."""
4349
+ return json.dumps(self.to_dict(), indent=2)
4350
+
4351
+ def __eq__(self, other: 'ActionControlAssignmentCollection') -> bool:
4352
+ """Return `true` when self and other are equal, false otherwise."""
4353
+ if not isinstance(other, self.__class__):
4354
+ return False
4355
+ return self.__dict__ == other.__dict__
4356
+
4357
+ def __ne__(self, other: 'ActionControlAssignmentCollection') -> bool:
4358
+ """Return `true` when self and other are not equal, false otherwise."""
4359
+ return not self == other
4360
+
4361
+
4362
+ class ActionControlAssignmentResource:
4363
+ """
4364
+ The action control assignment resources and target where the template is assigned.
4365
+
4366
+ :param AssignmentTargetDetails target: assignment target account and type.
4367
+ :param ActionControlAssignmentResourceActionControl action_control: (optional)
4368
+ Set of properties of the assigned resource or error message if assignment
4369
+ failed.
4370
+ """
4371
+
4372
+ def __init__(
4373
+ self,
4374
+ target: 'AssignmentTargetDetails',
4375
+ *,
4376
+ action_control: Optional['ActionControlAssignmentResourceActionControl'] = None,
4377
+ ) -> None:
4378
+ """
4379
+ Initialize a ActionControlAssignmentResource object.
4380
+
4381
+ :param AssignmentTargetDetails target: assignment target account and type.
4382
+ :param ActionControlAssignmentResourceActionControl action_control:
4383
+ (optional) Set of properties of the assigned resource or error message if
4384
+ assignment failed.
4385
+ """
4386
+ self.target = target
4387
+ self.action_control = action_control
4388
+
4389
+ @classmethod
4390
+ def from_dict(cls, _dict: Dict) -> 'ActionControlAssignmentResource':
4391
+ """Initialize a ActionControlAssignmentResource object from a json dictionary."""
4392
+ args = {}
4393
+ if (target := _dict.get('target')) is not None:
4394
+ args['target'] = AssignmentTargetDetails.from_dict(target)
4395
+ else:
4396
+ raise ValueError('Required property \'target\' not present in ActionControlAssignmentResource JSON')
4397
+ if (action_control := _dict.get('action_control')) is not None:
4398
+ args['action_control'] = ActionControlAssignmentResourceActionControl.from_dict(action_control)
4399
+ return cls(**args)
4400
+
4401
+ @classmethod
4402
+ def _from_dict(cls, _dict):
4403
+ """Initialize a ActionControlAssignmentResource object from a json dictionary."""
4404
+ return cls.from_dict(_dict)
4405
+
4406
+ def to_dict(self) -> Dict:
4407
+ """Return a json dictionary representing this model."""
4408
+ _dict = {}
4409
+ if hasattr(self, 'target') and self.target is not None:
4410
+ if isinstance(self.target, dict):
4411
+ _dict['target'] = self.target
4412
+ else:
4413
+ _dict['target'] = self.target.to_dict()
4414
+ if hasattr(self, 'action_control') and self.action_control is not None:
4415
+ if isinstance(self.action_control, dict):
4416
+ _dict['action_control'] = self.action_control
4417
+ else:
4418
+ _dict['action_control'] = self.action_control.to_dict()
4419
+ return _dict
4420
+
4421
+ def _to_dict(self):
4422
+ """Return a json dictionary representing this model."""
4423
+ return self.to_dict()
4424
+
4425
+ def __str__(self) -> str:
4426
+ """Return a `str` version of this ActionControlAssignmentResource object."""
4427
+ return json.dumps(self.to_dict(), indent=2)
4428
+
4429
+ def __eq__(self, other: 'ActionControlAssignmentResource') -> bool:
4430
+ """Return `true` when self and other are equal, false otherwise."""
4431
+ if not isinstance(other, self.__class__):
4432
+ return False
4433
+ return self.__dict__ == other.__dict__
4434
+
4435
+ def __ne__(self, other: 'ActionControlAssignmentResource') -> bool:
4436
+ """Return `true` when self and other are not equal, false otherwise."""
4437
+ return not self == other
4438
+
4439
+
4440
+ class ActionControlAssignmentResourceActionControl:
4441
+ """
4442
+ Set of properties of the assigned resource or error message if assignment failed.
4443
+
4444
+ :param ActionControlAssignmentResourceCreated resource_created: (optional) On
4445
+ success, it includes the action control assigned.
4446
+ :param ErrorResponse error_message: (optional) The error response from API.
4447
+ """
4448
+
4449
+ def __init__(
4450
+ self,
4451
+ *,
4452
+ resource_created: Optional['ActionControlAssignmentResourceCreated'] = None,
4453
+ error_message: Optional['ErrorResponse'] = None,
4454
+ ) -> None:
4455
+ """
4456
+ Initialize a ActionControlAssignmentResourceActionControl object.
4457
+
4458
+ :param ActionControlAssignmentResourceCreated resource_created: (optional)
4459
+ On success, it includes the action control assigned.
4460
+ :param ErrorResponse error_message: (optional) The error response from API.
4461
+ """
4462
+ self.resource_created = resource_created
4463
+ self.error_message = error_message
4464
+
4465
+ @classmethod
4466
+ def from_dict(cls, _dict: Dict) -> 'ActionControlAssignmentResourceActionControl':
4467
+ """Initialize a ActionControlAssignmentResourceActionControl object from a json dictionary."""
4468
+ args = {}
4469
+ if (resource_created := _dict.get('resource_created')) is not None:
4470
+ args['resource_created'] = ActionControlAssignmentResourceCreated.from_dict(resource_created)
4471
+ if (error_message := _dict.get('error_message')) is not None:
4472
+ args['error_message'] = ErrorResponse.from_dict(error_message)
4473
+ return cls(**args)
4474
+
4475
+ @classmethod
4476
+ def _from_dict(cls, _dict):
4477
+ """Initialize a ActionControlAssignmentResourceActionControl object from a json dictionary."""
4478
+ return cls.from_dict(_dict)
4479
+
4480
+ def to_dict(self) -> Dict:
4481
+ """Return a json dictionary representing this model."""
4482
+ _dict = {}
4483
+ if hasattr(self, 'resource_created') and self.resource_created is not None:
4484
+ if isinstance(self.resource_created, dict):
4485
+ _dict['resource_created'] = self.resource_created
4486
+ else:
4487
+ _dict['resource_created'] = self.resource_created.to_dict()
4488
+ if hasattr(self, 'error_message') and self.error_message is not None:
4489
+ if isinstance(self.error_message, dict):
4490
+ _dict['error_message'] = self.error_message
4491
+ else:
4492
+ _dict['error_message'] = self.error_message.to_dict()
4493
+ return _dict
4494
+
4495
+ def _to_dict(self):
4496
+ """Return a json dictionary representing this model."""
4497
+ return self.to_dict()
4498
+
4499
+ def __str__(self) -> str:
4500
+ """Return a `str` version of this ActionControlAssignmentResourceActionControl object."""
4501
+ return json.dumps(self.to_dict(), indent=2)
4502
+
4503
+ def __eq__(self, other: 'ActionControlAssignmentResourceActionControl') -> bool:
4504
+ """Return `true` when self and other are equal, false otherwise."""
4505
+ if not isinstance(other, self.__class__):
4506
+ return False
4507
+ return self.__dict__ == other.__dict__
4508
+
4509
+ def __ne__(self, other: 'ActionControlAssignmentResourceActionControl') -> bool:
4510
+ """Return `true` when self and other are not equal, false otherwise."""
4511
+ return not self == other
4512
+
4513
+
4514
+ class ActionControlAssignmentResourceCreated:
4515
+ """
4516
+ On success, it includes the action control assigned.
4517
+
4518
+ :param str id: (optional) action control id.
4519
+ """
4520
+
4521
+ def __init__(
4522
+ self,
4523
+ *,
4524
+ id: Optional[str] = None,
4525
+ ) -> None:
4526
+ """
4527
+ Initialize a ActionControlAssignmentResourceCreated object.
4528
+
4529
+ :param str id: (optional) action control id.
4530
+ """
4531
+ self.id = id
4532
+
4533
+ @classmethod
4534
+ def from_dict(cls, _dict: Dict) -> 'ActionControlAssignmentResourceCreated':
4535
+ """Initialize a ActionControlAssignmentResourceCreated object from a json dictionary."""
4536
+ args = {}
4537
+ if (id := _dict.get('id')) is not None:
4538
+ args['id'] = id
4539
+ return cls(**args)
4540
+
4541
+ @classmethod
4542
+ def _from_dict(cls, _dict):
4543
+ """Initialize a ActionControlAssignmentResourceCreated object from a json dictionary."""
4544
+ return cls.from_dict(_dict)
4545
+
4546
+ def to_dict(self) -> Dict:
4547
+ """Return a json dictionary representing this model."""
4548
+ _dict = {}
4549
+ if hasattr(self, 'id') and self.id is not None:
4550
+ _dict['id'] = self.id
4551
+ return _dict
4552
+
4553
+ def _to_dict(self):
4554
+ """Return a json dictionary representing this model."""
4555
+ return self.to_dict()
4556
+
4557
+ def __str__(self) -> str:
4558
+ """Return a `str` version of this ActionControlAssignmentResourceCreated object."""
4559
+ return json.dumps(self.to_dict(), indent=2)
4560
+
4561
+ def __eq__(self, other: 'ActionControlAssignmentResourceCreated') -> bool:
4562
+ """Return `true` when self and other are equal, false otherwise."""
4563
+ if not isinstance(other, self.__class__):
4564
+ return False
4565
+ return self.__dict__ == other.__dict__
4566
+
4567
+ def __ne__(self, other: 'ActionControlAssignmentResourceCreated') -> bool:
4568
+ """Return `true` when self and other are not equal, false otherwise."""
4569
+ return not self == other
4570
+
2948
4571
 
2949
- class PolicyType(str, Enum):
4572
+ class ActionControlAssignmentTemplate:
4573
+ """
4574
+ The action control template id and version that will be assigned.
4575
+
4576
+ :param str id: Action control template ID.
4577
+ :param str version: Action control template version.
4578
+ """
4579
+
4580
+ def __init__(
4581
+ self,
4582
+ id: str,
4583
+ version: str,
4584
+ ) -> None:
2950
4585
  """
2951
- Policy type, Optional.
4586
+ Initialize a ActionControlAssignmentTemplate object.
4587
+
4588
+ :param str id: Action control template ID.
4589
+ :param str version: Action control template version.
2952
4590
  """
4591
+ self.id = id
4592
+ self.version = version
2953
4593
 
2954
- ACCESS = 'access'
2955
- AUTHORIZATION = 'authorization'
4594
+ @classmethod
4595
+ def from_dict(cls, _dict: Dict) -> 'ActionControlAssignmentTemplate':
4596
+ """Initialize a ActionControlAssignmentTemplate object from a json dictionary."""
4597
+ args = {}
4598
+ if (id := _dict.get('id')) is not None:
4599
+ args['id'] = id
4600
+ else:
4601
+ raise ValueError('Required property \'id\' not present in ActionControlAssignmentTemplate JSON')
4602
+ if (version := _dict.get('version')) is not None:
4603
+ args['version'] = version
4604
+ else:
4605
+ raise ValueError('Required property \'version\' not present in ActionControlAssignmentTemplate JSON')
4606
+ return cls(**args)
2956
4607
 
4608
+ @classmethod
4609
+ def _from_dict(cls, _dict):
4610
+ """Initialize a ActionControlAssignmentTemplate object from a json dictionary."""
4611
+ return cls.from_dict(_dict)
2957
4612
 
2958
- class GetPolicyTemplateEnums:
4613
+ def to_dict(self) -> Dict:
4614
+ """Return a json dictionary representing this model."""
4615
+ _dict = {}
4616
+ if hasattr(self, 'id') and self.id is not None:
4617
+ _dict['id'] = self.id
4618
+ if hasattr(self, 'version') and self.version is not None:
4619
+ _dict['version'] = self.version
4620
+ return _dict
4621
+
4622
+ def _to_dict(self):
4623
+ """Return a json dictionary representing this model."""
4624
+ return self.to_dict()
4625
+
4626
+ def __str__(self) -> str:
4627
+ """Return a `str` version of this ActionControlAssignmentTemplate object."""
4628
+ return json.dumps(self.to_dict(), indent=2)
4629
+
4630
+ def __eq__(self, other: 'ActionControlAssignmentTemplate') -> bool:
4631
+ """Return `true` when self and other are equal, false otherwise."""
4632
+ if not isinstance(other, self.__class__):
4633
+ return False
4634
+ return self.__dict__ == other.__dict__
4635
+
4636
+ def __ne__(self, other: 'ActionControlAssignmentTemplate') -> bool:
4637
+ """Return `true` when self and other are not equal, false otherwise."""
4638
+ return not self == other
4639
+
4640
+
4641
+ class ActionControlTemplate:
2959
4642
  """
2960
- Enums for get_policy_template parameters.
4643
+ The set of properties associated with the action control template.
4644
+
4645
+ :param str name: Required field when creating a new template. Otherwise, this
4646
+ field is optional. If the field is included, it changes the name value for all
4647
+ existing versions of the template.
4648
+ :param str description: Description of the action control template. This is
4649
+ shown to users in the enterprise account. Use this to describe the purpose or
4650
+ context of the action control for enterprise users managing IAM templates.
4651
+ :param str account_id: Enterprise account ID where this template is created.
4652
+ :param bool committed: (optional) Committed status of the template. If committed
4653
+ is set to true, then the template version can no longer be updated.
4654
+ :param TemplateActionControl action_control: (optional) The action control
4655
+ properties that are created in an action resource when the template is assigned.
4656
+ :param str id: (optional) The action control template ID.
4657
+ :param str href: (optional) The href URL that links to the action control
4658
+ templates API by action control template ID.
4659
+ :param datetime created_at: (optional) The UTC timestamp when the action control
4660
+ template was created.
4661
+ :param str created_by_id: (optional) The IAM ID of the entity that created the
4662
+ action control template.
4663
+ :param datetime last_modified_at: (optional) The UTC timestamp when the action
4664
+ control template was last modified.
4665
+ :param str last_modified_by_id: (optional) The IAM ID of the entity that last
4666
+ modified the action control template.
4667
+ :param str version: The version number of the template used to identify
4668
+ different versions of same template.
4669
+ :param str state: State of action control template.
2961
4670
  """
2962
4671
 
2963
- class State(str, Enum):
4672
+ def __init__(
4673
+ self,
4674
+ name: str,
4675
+ description: str,
4676
+ account_id: str,
4677
+ version: str,
4678
+ state: str,
4679
+ *,
4680
+ committed: Optional[bool] = None,
4681
+ action_control: Optional['TemplateActionControl'] = None,
4682
+ id: Optional[str] = None,
4683
+ href: Optional[str] = None,
4684
+ created_at: Optional[datetime] = None,
4685
+ created_by_id: Optional[str] = None,
4686
+ last_modified_at: Optional[datetime] = None,
4687
+ last_modified_by_id: Optional[str] = None,
4688
+ ) -> None:
2964
4689
  """
2965
- The policy template state.
4690
+ Initialize a ActionControlTemplate object.
4691
+
4692
+ :param str name: Required field when creating a new template. Otherwise,
4693
+ this field is optional. If the field is included, it changes the name value
4694
+ for all existing versions of the template.
4695
+ :param str description: Description of the action control template. This is
4696
+ shown to users in the enterprise account. Use this to describe the purpose
4697
+ or context of the action control for enterprise users managing IAM
4698
+ templates.
4699
+ :param str account_id: Enterprise account ID where this template is
4700
+ created.
4701
+ :param str version: The version number of the template used to identify
4702
+ different versions of same template.
4703
+ :param str state: State of action control template.
4704
+ :param bool committed: (optional) Committed status of the template. If
4705
+ committed is set to true, then the template version can no longer be
4706
+ updated.
4707
+ :param TemplateActionControl action_control: (optional) The action control
4708
+ properties that are created in an action resource when the template is
4709
+ assigned.
4710
+ """
4711
+ self.name = name
4712
+ self.description = description
4713
+ self.account_id = account_id
4714
+ self.committed = committed
4715
+ self.action_control = action_control
4716
+ self.id = id
4717
+ self.href = href
4718
+ self.created_at = created_at
4719
+ self.created_by_id = created_by_id
4720
+ self.last_modified_at = last_modified_at
4721
+ self.last_modified_by_id = last_modified_by_id
4722
+ self.version = version
4723
+ self.state = state
4724
+
4725
+ @classmethod
4726
+ def from_dict(cls, _dict: Dict) -> 'ActionControlTemplate':
4727
+ """Initialize a ActionControlTemplate object from a json dictionary."""
4728
+ args = {}
4729
+ if (name := _dict.get('name')) is not None:
4730
+ args['name'] = name
4731
+ else:
4732
+ raise ValueError('Required property \'name\' not present in ActionControlTemplate JSON')
4733
+ if (description := _dict.get('description')) is not None:
4734
+ args['description'] = description
4735
+ else:
4736
+ raise ValueError('Required property \'description\' not present in ActionControlTemplate JSON')
4737
+ if (account_id := _dict.get('account_id')) is not None:
4738
+ args['account_id'] = account_id
4739
+ else:
4740
+ raise ValueError('Required property \'account_id\' not present in ActionControlTemplate JSON')
4741
+ if (committed := _dict.get('committed')) is not None:
4742
+ args['committed'] = committed
4743
+ if (action_control := _dict.get('action_control')) is not None:
4744
+ args['action_control'] = TemplateActionControl.from_dict(action_control)
4745
+ if (id := _dict.get('id')) is not None:
4746
+ args['id'] = id
4747
+ if (href := _dict.get('href')) is not None:
4748
+ args['href'] = href
4749
+ if (created_at := _dict.get('created_at')) is not None:
4750
+ args['created_at'] = string_to_datetime(created_at)
4751
+ if (created_by_id := _dict.get('created_by_id')) is not None:
4752
+ args['created_by_id'] = created_by_id
4753
+ if (last_modified_at := _dict.get('last_modified_at')) is not None:
4754
+ args['last_modified_at'] = string_to_datetime(last_modified_at)
4755
+ if (last_modified_by_id := _dict.get('last_modified_by_id')) is not None:
4756
+ args['last_modified_by_id'] = last_modified_by_id
4757
+ if (version := _dict.get('version')) is not None:
4758
+ args['version'] = version
4759
+ else:
4760
+ raise ValueError('Required property \'version\' not present in ActionControlTemplate JSON')
4761
+ if (state := _dict.get('state')) is not None:
4762
+ args['state'] = state
4763
+ else:
4764
+ raise ValueError('Required property \'state\' not present in ActionControlTemplate JSON')
4765
+ return cls(**args)
4766
+
4767
+ @classmethod
4768
+ def _from_dict(cls, _dict):
4769
+ """Initialize a ActionControlTemplate object from a json dictionary."""
4770
+ return cls.from_dict(_dict)
4771
+
4772
+ def to_dict(self) -> Dict:
4773
+ """Return a json dictionary representing this model."""
4774
+ _dict = {}
4775
+ if hasattr(self, 'name') and self.name is not None:
4776
+ _dict['name'] = self.name
4777
+ if hasattr(self, 'description') and self.description is not None:
4778
+ _dict['description'] = self.description
4779
+ if hasattr(self, 'account_id') and self.account_id is not None:
4780
+ _dict['account_id'] = self.account_id
4781
+ if hasattr(self, 'committed') and self.committed is not None:
4782
+ _dict['committed'] = self.committed
4783
+ if hasattr(self, 'action_control') and self.action_control is not None:
4784
+ if isinstance(self.action_control, dict):
4785
+ _dict['action_control'] = self.action_control
4786
+ else:
4787
+ _dict['action_control'] = self.action_control.to_dict()
4788
+ if hasattr(self, 'id') and getattr(self, 'id') is not None:
4789
+ _dict['id'] = getattr(self, 'id')
4790
+ if hasattr(self, 'href') and getattr(self, 'href') is not None:
4791
+ _dict['href'] = getattr(self, 'href')
4792
+ if hasattr(self, 'created_at') and getattr(self, 'created_at') is not None:
4793
+ _dict['created_at'] = datetime_to_string(getattr(self, 'created_at'))
4794
+ if hasattr(self, 'created_by_id') and getattr(self, 'created_by_id') is not None:
4795
+ _dict['created_by_id'] = getattr(self, 'created_by_id')
4796
+ if hasattr(self, 'last_modified_at') and getattr(self, 'last_modified_at') is not None:
4797
+ _dict['last_modified_at'] = datetime_to_string(getattr(self, 'last_modified_at'))
4798
+ if hasattr(self, 'last_modified_by_id') and getattr(self, 'last_modified_by_id') is not None:
4799
+ _dict['last_modified_by_id'] = getattr(self, 'last_modified_by_id')
4800
+ if hasattr(self, 'version') and self.version is not None:
4801
+ _dict['version'] = self.version
4802
+ if hasattr(self, 'state') and self.state is not None:
4803
+ _dict['state'] = self.state
4804
+ return _dict
4805
+
4806
+ def _to_dict(self):
4807
+ """Return a json dictionary representing this model."""
4808
+ return self.to_dict()
4809
+
4810
+ def __str__(self) -> str:
4811
+ """Return a `str` version of this ActionControlTemplate object."""
4812
+ return json.dumps(self.to_dict(), indent=2)
4813
+
4814
+ def __eq__(self, other: 'ActionControlTemplate') -> bool:
4815
+ """Return `true` when self and other are equal, false otherwise."""
4816
+ if not isinstance(other, self.__class__):
4817
+ return False
4818
+ return self.__dict__ == other.__dict__
4819
+
4820
+ def __ne__(self, other: 'ActionControlTemplate') -> bool:
4821
+ """Return `true` when self and other are not equal, false otherwise."""
4822
+ return not self == other
4823
+
4824
+ class StateEnum(str, Enum):
4825
+ """
4826
+ State of action control template.
2966
4827
  """
2967
4828
 
2968
4829
  ACTIVE = 'active'
2969
4830
  DELETED = 'deleted'
2970
4831
 
2971
4832
 
2972
- class ListPolicyTemplateVersionsEnums:
4833
+ class ActionControlTemplateCollection:
2973
4834
  """
2974
- Enums for list_policy_template_versions parameters.
4835
+ A collection of action control templates.
4836
+
4837
+ :param int limit: (optional) The number of documents to include per each page of
4838
+ the collection.
4839
+ :param First first: (optional) Details with linking href to first page of
4840
+ requested collection.
4841
+ :param Next next: (optional) Details with href linking to the following page of
4842
+ requested collection.
4843
+ :param Previous previous: (optional) Details with linking href to previous page
4844
+ of requested collection.
4845
+ :param List[ActionControlTemplate] action_control_templates: List of action
4846
+ control templates.
2975
4847
  """
2976
4848
 
2977
- class State(str, Enum):
2978
- """
2979
- The policy template state.
2980
- """
4849
+ def __init__(
4850
+ self,
4851
+ action_control_templates: List['ActionControlTemplate'],
4852
+ *,
4853
+ limit: Optional[int] = None,
4854
+ first: Optional['First'] = None,
4855
+ next: Optional['Next'] = None,
4856
+ previous: Optional['Previous'] = None,
4857
+ ) -> None:
4858
+ """
4859
+ Initialize a ActionControlTemplateCollection object.
4860
+
4861
+ :param List[ActionControlTemplate] action_control_templates: List of action
4862
+ control templates.
4863
+ :param int limit: (optional) The number of documents to include per each
4864
+ page of the collection.
4865
+ :param First first: (optional) Details with linking href to first page of
4866
+ requested collection.
4867
+ :param Next next: (optional) Details with href linking to the following
4868
+ page of requested collection.
4869
+ :param Previous previous: (optional) Details with linking href to previous
4870
+ page of requested collection.
4871
+ """
4872
+ self.limit = limit
4873
+ self.first = first
4874
+ self.next = next
4875
+ self.previous = previous
4876
+ self.action_control_templates = action_control_templates
4877
+
4878
+ @classmethod
4879
+ def from_dict(cls, _dict: Dict) -> 'ActionControlTemplateCollection':
4880
+ """Initialize a ActionControlTemplateCollection object from a json dictionary."""
4881
+ args = {}
4882
+ if (limit := _dict.get('limit')) is not None:
4883
+ args['limit'] = limit
4884
+ if (first := _dict.get('first')) is not None:
4885
+ args['first'] = First.from_dict(first)
4886
+ if (next := _dict.get('next')) is not None:
4887
+ args['next'] = Next.from_dict(next)
4888
+ if (previous := _dict.get('previous')) is not None:
4889
+ args['previous'] = Previous.from_dict(previous)
4890
+ if (action_control_templates := _dict.get('action_control_templates')) is not None:
4891
+ args['action_control_templates'] = [ActionControlTemplate.from_dict(v) for v in action_control_templates]
4892
+ else:
4893
+ raise ValueError(
4894
+ 'Required property \'action_control_templates\' not present in ActionControlTemplateCollection JSON'
4895
+ )
4896
+ return cls(**args)
4897
+
4898
+ @classmethod
4899
+ def _from_dict(cls, _dict):
4900
+ """Initialize a ActionControlTemplateCollection object from a json dictionary."""
4901
+ return cls.from_dict(_dict)
4902
+
4903
+ def to_dict(self) -> Dict:
4904
+ """Return a json dictionary representing this model."""
4905
+ _dict = {}
4906
+ if hasattr(self, 'limit') and self.limit is not None:
4907
+ _dict['limit'] = self.limit
4908
+ if hasattr(self, 'first') and self.first is not None:
4909
+ if isinstance(self.first, dict):
4910
+ _dict['first'] = self.first
4911
+ else:
4912
+ _dict['first'] = self.first.to_dict()
4913
+ if hasattr(self, 'next') and self.next is not None:
4914
+ if isinstance(self.next, dict):
4915
+ _dict['next'] = self.next
4916
+ else:
4917
+ _dict['next'] = self.next.to_dict()
4918
+ if hasattr(self, 'previous') and self.previous is not None:
4919
+ if isinstance(self.previous, dict):
4920
+ _dict['previous'] = self.previous
4921
+ else:
4922
+ _dict['previous'] = self.previous.to_dict()
4923
+ if hasattr(self, 'action_control_templates') and self.action_control_templates is not None:
4924
+ action_control_templates_list = []
4925
+ for v in self.action_control_templates:
4926
+ if isinstance(v, dict):
4927
+ action_control_templates_list.append(v)
4928
+ else:
4929
+ action_control_templates_list.append(v.to_dict())
4930
+ _dict['action_control_templates'] = action_control_templates_list
4931
+ return _dict
4932
+
4933
+ def _to_dict(self):
4934
+ """Return a json dictionary representing this model."""
4935
+ return self.to_dict()
2981
4936
 
2982
- ACTIVE = 'active'
2983
- DELETED = 'deleted'
4937
+ def __str__(self) -> str:
4938
+ """Return a `str` version of this ActionControlTemplateCollection object."""
4939
+ return json.dumps(self.to_dict(), indent=2)
2984
4940
 
4941
+ def __eq__(self, other: 'ActionControlTemplateCollection') -> bool:
4942
+ """Return `true` when self and other are equal, false otherwise."""
4943
+ if not isinstance(other, self.__class__):
4944
+ return False
4945
+ return self.__dict__ == other.__dict__
2985
4946
 
2986
- ##############################################################################
2987
- # Models
2988
- ##############################################################################
4947
+ def __ne__(self, other: 'ActionControlTemplateCollection') -> bool:
4948
+ """Return `true` when self and other are not equal, false otherwise."""
4949
+ return not self == other
2989
4950
 
2990
4951
 
2991
- class AccountSettingsAccessManagement:
4952
+ class ActionControlTemplateVersionsCollection:
2992
4953
  """
2993
- The Access Management Account Settings that are currently set for the requested
2994
- account.
4954
+ A collection of versions for a specific action control template.
2995
4955
 
2996
- :param ExternalAccountIdentityInteraction external_account_identity_interaction:
2997
- How external accounts can interact in relation to the requested account.
4956
+ :param int limit: (optional) The number of documents to include per each page of
4957
+ the collection.
4958
+ :param First first: (optional) Details with linking href to first page of
4959
+ requested collection.
4960
+ :param Next next: (optional) Details with href linking to the following page of
4961
+ requested collection.
4962
+ :param Previous previous: (optional) Details with linking href to previous page
4963
+ of requested collection.
4964
+ :param List[ActionControlTemplate] versions: List of action control templates
4965
+ versions.
2998
4966
  """
2999
4967
 
3000
4968
  def __init__(
3001
4969
  self,
3002
- external_account_identity_interaction: 'ExternalAccountIdentityInteraction',
4970
+ versions: List['ActionControlTemplate'],
4971
+ *,
4972
+ limit: Optional[int] = None,
4973
+ first: Optional['First'] = None,
4974
+ next: Optional['Next'] = None,
4975
+ previous: Optional['Previous'] = None,
3003
4976
  ) -> None:
3004
4977
  """
3005
- Initialize a AccountSettingsAccessManagement object.
4978
+ Initialize a ActionControlTemplateVersionsCollection object.
3006
4979
 
3007
- :param ExternalAccountIdentityInteraction
3008
- external_account_identity_interaction: How external accounts can interact
3009
- in relation to the requested account.
4980
+ :param List[ActionControlTemplate] versions: List of action control
4981
+ templates versions.
4982
+ :param int limit: (optional) The number of documents to include per each
4983
+ page of the collection.
4984
+ :param First first: (optional) Details with linking href to first page of
4985
+ requested collection.
4986
+ :param Next next: (optional) Details with href linking to the following
4987
+ page of requested collection.
4988
+ :param Previous previous: (optional) Details with linking href to previous
4989
+ page of requested collection.
3010
4990
  """
3011
- self.external_account_identity_interaction = external_account_identity_interaction
4991
+ self.limit = limit
4992
+ self.first = first
4993
+ self.next = next
4994
+ self.previous = previous
4995
+ self.versions = versions
3012
4996
 
3013
4997
  @classmethod
3014
- def from_dict(cls, _dict: Dict) -> 'AccountSettingsAccessManagement':
3015
- """Initialize a AccountSettingsAccessManagement object from a json dictionary."""
4998
+ def from_dict(cls, _dict: Dict) -> 'ActionControlTemplateVersionsCollection':
4999
+ """Initialize a ActionControlTemplateVersionsCollection object from a json dictionary."""
3016
5000
  args = {}
3017
- if (external_account_identity_interaction := _dict.get('external_account_identity_interaction')) is not None:
3018
- args['external_account_identity_interaction'] = ExternalAccountIdentityInteraction.from_dict(
3019
- external_account_identity_interaction
3020
- )
5001
+ if (limit := _dict.get('limit')) is not None:
5002
+ args['limit'] = limit
5003
+ if (first := _dict.get('first')) is not None:
5004
+ args['first'] = First.from_dict(first)
5005
+ if (next := _dict.get('next')) is not None:
5006
+ args['next'] = Next.from_dict(next)
5007
+ if (previous := _dict.get('previous')) is not None:
5008
+ args['previous'] = Previous.from_dict(previous)
5009
+ if (versions := _dict.get('versions')) is not None:
5010
+ args['versions'] = [ActionControlTemplate.from_dict(v) for v in versions]
3021
5011
  else:
3022
5012
  raise ValueError(
3023
- 'Required property \'external_account_identity_interaction\' not present in AccountSettingsAccessManagement JSON'
5013
+ 'Required property \'versions\' not present in ActionControlTemplateVersionsCollection JSON'
3024
5014
  )
3025
5015
  return cls(**args)
3026
5016
 
3027
5017
  @classmethod
3028
5018
  def _from_dict(cls, _dict):
3029
- """Initialize a AccountSettingsAccessManagement object from a json dictionary."""
5019
+ """Initialize a ActionControlTemplateVersionsCollection object from a json dictionary."""
3030
5020
  return cls.from_dict(_dict)
3031
5021
 
3032
5022
  def to_dict(self) -> Dict:
3033
5023
  """Return a json dictionary representing this model."""
3034
5024
  _dict = {}
3035
- if (
3036
- hasattr(self, 'external_account_identity_interaction')
3037
- and self.external_account_identity_interaction is not None
3038
- ):
3039
- if isinstance(self.external_account_identity_interaction, dict):
3040
- _dict['external_account_identity_interaction'] = self.external_account_identity_interaction
5025
+ if hasattr(self, 'limit') and self.limit is not None:
5026
+ _dict['limit'] = self.limit
5027
+ if hasattr(self, 'first') and self.first is not None:
5028
+ if isinstance(self.first, dict):
5029
+ _dict['first'] = self.first
3041
5030
  else:
3042
- _dict['external_account_identity_interaction'] = self.external_account_identity_interaction.to_dict()
5031
+ _dict['first'] = self.first.to_dict()
5032
+ if hasattr(self, 'next') and self.next is not None:
5033
+ if isinstance(self.next, dict):
5034
+ _dict['next'] = self.next
5035
+ else:
5036
+ _dict['next'] = self.next.to_dict()
5037
+ if hasattr(self, 'previous') and self.previous is not None:
5038
+ if isinstance(self.previous, dict):
5039
+ _dict['previous'] = self.previous
5040
+ else:
5041
+ _dict['previous'] = self.previous.to_dict()
5042
+ if hasattr(self, 'versions') and self.versions is not None:
5043
+ versions_list = []
5044
+ for v in self.versions:
5045
+ if isinstance(v, dict):
5046
+ versions_list.append(v)
5047
+ else:
5048
+ versions_list.append(v.to_dict())
5049
+ _dict['versions'] = versions_list
3043
5050
  return _dict
3044
5051
 
3045
5052
  def _to_dict(self):
@@ -3047,25 +5054,25 @@ class AccountSettingsAccessManagement:
3047
5054
  return self.to_dict()
3048
5055
 
3049
5056
  def __str__(self) -> str:
3050
- """Return a `str` version of this AccountSettingsAccessManagement object."""
5057
+ """Return a `str` version of this ActionControlTemplateVersionsCollection object."""
3051
5058
  return json.dumps(self.to_dict(), indent=2)
3052
5059
 
3053
- def __eq__(self, other: 'AccountSettingsAccessManagement') -> bool:
5060
+ def __eq__(self, other: 'ActionControlTemplateVersionsCollection') -> bool:
3054
5061
  """Return `true` when self and other are equal, false otherwise."""
3055
5062
  if not isinstance(other, self.__class__):
3056
5063
  return False
3057
5064
  return self.__dict__ == other.__dict__
3058
5065
 
3059
- def __ne__(self, other: 'AccountSettingsAccessManagement') -> bool:
5066
+ def __ne__(self, other: 'ActionControlTemplateVersionsCollection') -> bool:
3060
5067
  """Return `true` when self and other are not equal, false otherwise."""
3061
5068
  return not self == other
3062
5069
 
3063
5070
 
3064
5071
  class AssignmentResourceCreated:
3065
5072
  """
3066
- On success, includes the policy assigned.
5073
+ On success, includes the policy that is assigned.
3067
5074
 
3068
- :param str id: (optional) policy id.
5075
+ :param str id: (optional) Policy id.
3069
5076
  """
3070
5077
 
3071
5078
  def __init__(
@@ -3076,7 +5083,7 @@ class AssignmentResourceCreated:
3076
5083
  """
3077
5084
  Initialize a AssignmentResourceCreated object.
3078
5085
 
3079
- :param str id: (optional) policy id.
5086
+ :param str id: (optional) Policy id.
3080
5087
  """
3081
5088
  self.id = id
3082
5089
 
@@ -3123,21 +5130,20 @@ class AssignmentTargetDetails:
3123
5130
  """
3124
5131
  assignment target account and type.
3125
5132
 
3126
- :param str type: (optional) Assignment target type.
3127
- :param str id: (optional) ID of the target account.
5133
+ :param str type: Assignment target type.
5134
+ :param str id: ID of the target account.
3128
5135
  """
3129
5136
 
3130
5137
  def __init__(
3131
5138
  self,
3132
- *,
3133
- type: Optional[str] = None,
3134
- id: Optional[str] = None,
5139
+ type: str,
5140
+ id: str,
3135
5141
  ) -> None:
3136
5142
  """
3137
5143
  Initialize a AssignmentTargetDetails object.
3138
5144
 
3139
- :param str type: (optional) Assignment target type.
3140
- :param str id: (optional) ID of the target account.
5145
+ :param str type: Assignment target type.
5146
+ :param str id: ID of the target account.
3141
5147
  """
3142
5148
  self.type = type
3143
5149
  self.id = id
@@ -3148,8 +5154,12 @@ class AssignmentTargetDetails:
3148
5154
  args = {}
3149
5155
  if (type := _dict.get('type')) is not None:
3150
5156
  args['type'] = type
5157
+ else:
5158
+ raise ValueError('Required property \'type\' not present in AssignmentTargetDetails JSON')
3151
5159
  if (id := _dict.get('id')) is not None:
3152
5160
  args['id'] = id
5161
+ else:
5162
+ raise ValueError('Required property \'id\' not present in AssignmentTargetDetails JSON')
3153
5163
  return cls(**args)
3154
5164
 
3155
5165
  @classmethod
@@ -3196,8 +5206,8 @@ class AssignmentTemplateDetails:
3196
5206
  """
3197
5207
  policy template details.
3198
5208
 
3199
- :param str id: (optional) policy template id.
3200
- :param str version: (optional) policy template version.
5209
+ :param str id: (optional) Policy template ID.
5210
+ :param str version: (optional) Policy template version.
3201
5211
  """
3202
5212
 
3203
5213
  def __init__(
@@ -3209,8 +5219,8 @@ class AssignmentTemplateDetails:
3209
5219
  """
3210
5220
  Initialize a AssignmentTemplateDetails object.
3211
5221
 
3212
- :param str id: (optional) policy template id.
3213
- :param str version: (optional) policy template version.
5222
+ :param str id: (optional) Policy template ID.
5223
+ :param str version: (optional) Policy template version.
3214
5224
  """
3215
5225
  self.id = id
3216
5226
  self.version = version
@@ -3263,8 +5273,8 @@ class ConflictsWith:
3263
5273
  Details of conflicting resource.
3264
5274
 
3265
5275
  :param str etag: (optional) The revision number of the resource.
3266
- :param str role: (optional) The conflicting role id.
3267
- :param str policy: (optional) The conflicting policy id.
5276
+ :param str role: (optional) The conflicting role of ID.
5277
+ :param str policy: (optional) The conflicting policy ID.
3268
5278
  """
3269
5279
 
3270
5280
  def __init__(
@@ -3278,8 +5288,8 @@ class ConflictsWith:
3278
5288
  Initialize a ConflictsWith object.
3279
5289
 
3280
5290
  :param str etag: (optional) The revision number of the resource.
3281
- :param str role: (optional) The conflicting role id.
3282
- :param str policy: (optional) The conflicting policy id.
5291
+ :param str role: (optional) The conflicting role of ID.
5292
+ :param str policy: (optional) The conflicting policy ID.
3283
5293
  """
3284
5294
  self.etag = etag
3285
5295
  self.role = role
@@ -3334,9 +5344,9 @@ class ConflictsWith:
3334
5344
 
3335
5345
  class Control:
3336
5346
  """
3337
- Specifies the type of access granted by the policy.
5347
+ Specifies the type of access that is granted by the policy.
3338
5348
 
3339
- :param Grant grant: Permission granted by the policy.
5349
+ :param Grant grant: Permission is granted by the policy.
3340
5350
  """
3341
5351
 
3342
5352
  def __init__(
@@ -3346,7 +5356,7 @@ class Control:
3346
5356
  """
3347
5357
  Initialize a Control object.
3348
5358
 
3349
- :param Grant grant: Permission granted by the policy.
5359
+ :param Grant grant: Permission is granted by the policy.
3350
5360
  """
3351
5361
  self.grant = grant
3352
5362
 
@@ -3418,7 +5428,7 @@ class CustomRole:
3418
5428
  An additional set of properties associated with a role.
3419
5429
 
3420
5430
  :param str id: (optional) The role ID. Composed of hexadecimal characters.
3421
- :param str display_name: The display name of the role that is shown in the
5431
+ :param str display_name: The display the name of the role that is shown in the
3422
5432
  console.
3423
5433
  :param str description: (optional) The description of the role.
3424
5434
  :param List[str] actions: The actions of the role. For more information, see
@@ -3426,19 +5436,19 @@ class CustomRole:
3426
5436
  actions](https://cloud.ibm.com/docs/account?topic=account-iam-service-roles-actions).
3427
5437
  :param str crn: (optional) The role Cloud Resource Name (CRN). Example CRN:
3428
5438
  'crn:v1:ibmcloud:public:iam-access-management::a/exampleAccountId::customRole:ExampleRoleName'.
3429
- :param str name: The name of the role that is used in the CRN. Can only be
3430
- alphanumeric and has to be capitalized.
5439
+ :param str name: The name of the role that is used in the CRN. This must be
5440
+ alphanumeric and capitalized.
3431
5441
  :param str account_id: The account GUID.
3432
5442
  :param str service_name: The service name.
3433
5443
  :param datetime created_at: (optional) The UTC timestamp when the role was
3434
5444
  created.
3435
- :param str created_by_id: (optional) The iam ID of the entity that created the
5445
+ :param str created_by_id: (optional) The IAM ID of the entity that created the
3436
5446
  role.
3437
5447
  :param datetime last_modified_at: (optional) The UTC timestamp when the role was
3438
5448
  last modified.
3439
- :param str last_modified_by_id: (optional) The iam ID of the entity that last
5449
+ :param str last_modified_by_id: (optional) The IAM ID of the entity that last
3440
5450
  modified the policy.
3441
- :param str href: (optional) The href link back to the role.
5451
+ :param str href: (optional) The href links back to the role.
3442
5452
  """
3443
5453
 
3444
5454
  def __init__(
@@ -3461,13 +5471,13 @@ class CustomRole:
3461
5471
  """
3462
5472
  Initialize a CustomRole object.
3463
5473
 
3464
- :param str display_name: The display name of the role that is shown in the
3465
- console.
5474
+ :param str display_name: The display the name of the role that is shown in
5475
+ the console.
3466
5476
  :param List[str] actions: The actions of the role. For more information,
3467
5477
  see [IAM roles and
3468
5478
  actions](https://cloud.ibm.com/docs/account?topic=account-iam-service-roles-actions).
3469
- :param str name: The name of the role that is used in the CRN. Can only be
3470
- alphanumeric and has to be capitalized.
5479
+ :param str name: The name of the role that is used in the CRN. This must be
5480
+ alphanumeric and capitalized.
3471
5481
  :param str account_id: The account GUID.
3472
5482
  :param str service_name: The service name.
3473
5483
  :param str description: (optional) The description of the role.
@@ -3590,10 +5600,10 @@ class EnrichedRoles:
3590
5600
 
3591
5601
  :param str role_id: The role Cloud Resource Name (CRN) granted by the policy.
3592
5602
  Example CRN: 'crn:v1:bluemix:public:iam::::role:Editor'.
3593
- :param str display_name: (optional) The service defined (or user defined if a
3594
- custom role) display name of the role.
3595
- :param str description: (optional) The service defined (or user defined if a
3596
- custom role) description of the role.
5603
+ :param str display_name: (optional) The display name of the role, either
5604
+ service-defined or user-defined for custom roles.
5605
+ :param str description: (optional) The role description, either service-defined
5606
+ or user-defined for custom roles.
3597
5607
  :param List[RoleAction] actions: The actions of the role. For more information,
3598
5608
  see [IAM roles and
3599
5609
  actions](https://cloud.ibm.com/docs/account?topic=account-iam-service-roles-actions).
@@ -3855,32 +5865,32 @@ class ErrorObject:
3855
5865
  POLICY_ASSIGNMENT_NOT_FOUND = 'policy_assignment_not_found'
3856
5866
  POLICY_ASSIGNMENT_CONFLICT_ERROR = 'policy_assignment_conflict_error'
3857
5867
  RESOURCE_NOT_FOUND = 'resource_not_found'
5868
+ ACTION_CONTROL_TEMPLATE_NOT_FOUND = 'action_control_template_not_found'
5869
+ ACTION_CONTROL_ASSIGNMENT_NOT_FOUND = 'action_control_assignment_not_found'
3858
5870
 
3859
5871
 
3860
5872
  class ErrorResponse:
3861
5873
  """
3862
5874
  The error response from API.
3863
5875
 
3864
- :param str trace: (optional) The unique transaction id for the request.
3865
- :param List[ErrorObject] errors: (optional) The errors encountered during the
3866
- response.
3867
- :param int status_code: (optional) The http error code of the response.
5876
+ :param str trace: The unique transaction ID for the request.
5877
+ :param List[ErrorObject] errors: The errors encountered during the response.
5878
+ :param int status_code: The HTTP error code of the response.
3868
5879
  """
3869
5880
 
3870
5881
  def __init__(
3871
5882
  self,
3872
- *,
3873
- trace: Optional[str] = None,
3874
- errors: Optional[List['ErrorObject']] = None,
3875
- status_code: Optional[int] = None,
5883
+ trace: str,
5884
+ errors: List['ErrorObject'],
5885
+ status_code: int,
3876
5886
  ) -> None:
3877
5887
  """
3878
5888
  Initialize a ErrorResponse object.
3879
5889
 
3880
- :param str trace: (optional) The unique transaction id for the request.
3881
- :param List[ErrorObject] errors: (optional) The errors encountered during
3882
- the response.
3883
- :param int status_code: (optional) The http error code of the response.
5890
+ :param str trace: The unique transaction ID for the request.
5891
+ :param List[ErrorObject] errors: The errors encountered during the
5892
+ response.
5893
+ :param int status_code: The HTTP error code of the response.
3884
5894
  """
3885
5895
  self.trace = trace
3886
5896
  self.errors = errors
@@ -3892,10 +5902,16 @@ class ErrorResponse:
3892
5902
  args = {}
3893
5903
  if (trace := _dict.get('trace')) is not None:
3894
5904
  args['trace'] = trace
5905
+ else:
5906
+ raise ValueError('Required property \'trace\' not present in ErrorResponse JSON')
3895
5907
  if (errors := _dict.get('errors')) is not None:
3896
5908
  args['errors'] = [ErrorObject.from_dict(v) for v in errors]
5909
+ else:
5910
+ raise ValueError('Required property \'errors\' not present in ErrorResponse JSON')
3897
5911
  if (status_code := _dict.get('status_code')) is not None:
3898
5912
  args['status_code'] = status_code
5913
+ else:
5914
+ raise ValueError('Required property \'status_code\' not present in ErrorResponse JSON')
3899
5915
  return cls(**args)
3900
5916
 
3901
5917
  @classmethod
@@ -4068,7 +6084,7 @@ class ExternalAccountIdentityInteractionPatch:
4068
6084
 
4069
6085
  class First:
4070
6086
  """
4071
- Details with href linking to first page of requested collection.
6087
+ Details with linking href to first page of requested collection.
4072
6088
 
4073
6089
  :param str href: (optional) The href linking to the page of requested
4074
6090
  collection.
@@ -4126,9 +6142,9 @@ class First:
4126
6142
 
4127
6143
  class Grant:
4128
6144
  """
4129
- Permission granted by the policy.
6145
+ Permission is granted by the policy.
4130
6146
 
4131
- :param List[Roles] roles: A set of role cloud resource names (CRNs) granted by
6147
+ :param List[Roles] roles: A set of role Cloud Resource Names (CRNs) granted by
4132
6148
  the policy.
4133
6149
  """
4134
6150
 
@@ -4139,7 +6155,7 @@ class Grant:
4139
6155
  """
4140
6156
  Initialize a Grant object.
4141
6157
 
4142
- :param List[Roles] roles: A set of role cloud resource names (CRNs) granted
6158
+ :param List[Roles] roles: A set of role Cloud Resource Names (CRNs) granted
4143
6159
  by the policy.
4144
6160
  """
4145
6161
  self.roles = roles
@@ -4605,11 +6621,12 @@ class NestedCondition:
4605
6621
 
4606
6622
  class Next:
4607
6623
  """
4608
- Details with href linking to following page of requested collection.
6624
+ Details with href linking to the following page of requested collection.
4609
6625
 
4610
6626
  :param str href: (optional) The href linking to the page of requested
4611
6627
  collection.
4612
- :param str start: (optional) Page token that refers to the page of collection.
6628
+ :param str start: (optional) Page token that refers to the page of the
6629
+ collection.
4613
6630
  """
4614
6631
 
4615
6632
  def __init__(
@@ -4621,7 +6638,7 @@ class Next:
4621
6638
  """
4622
6639
  Initialize a Next object.
4623
6640
 
4624
- :param str start: (optional) Page token that refers to the page of
6641
+ :param str start: (optional) Page token that refers to the page of the
4625
6642
  collection.
4626
6643
  """
4627
6644
  self.href = href
@@ -4678,17 +6695,17 @@ class Policy:
4678
6695
  :param str type: The policy type; either 'access' or 'authorization'.
4679
6696
  :param str description: (optional) Customer-defined description.
4680
6697
  :param List[PolicySubject] subjects: The subjects associated with a policy.
4681
- :param List[PolicyRole] roles: A set of role cloud resource names (CRNs) granted
6698
+ :param List[PolicyRole] roles: A set of role Cloud Resource Names (CRNs) granted
4682
6699
  by the policy.
4683
6700
  :param List[PolicyResource] resources: The resources associated with a policy.
4684
- :param str href: (optional) The href link back to the policy.
6701
+ :param str href: (optional) The href links back to the policy.
4685
6702
  :param datetime created_at: (optional) The UTC timestamp when the policy was
4686
6703
  created.
4687
- :param str created_by_id: (optional) The iam ID of the entity that created the
6704
+ :param str created_by_id: (optional) The IAM ID of the entity that created the
4688
6705
  policy.
4689
6706
  :param datetime last_modified_at: (optional) The UTC timestamp when the policy
4690
6707
  was last modified.
4691
- :param str last_modified_by_id: (optional) The iam ID of the entity that last
6708
+ :param str last_modified_by_id: (optional) The IAM ID of the entity that last
4692
6709
  modified the policy.
4693
6710
  :param str state: (optional) The policy state.
4694
6711
  """
@@ -4714,7 +6731,7 @@ class Policy:
4714
6731
 
4715
6732
  :param str type: The policy type; either 'access' or 'authorization'.
4716
6733
  :param List[PolicySubject] subjects: The subjects associated with a policy.
4717
- :param List[PolicyRole] roles: A set of role cloud resource names (CRNs)
6734
+ :param List[PolicyRole] roles: A set of role Cloud Resource Names (CRNs)
4718
6735
  granted by the policy.
4719
6736
  :param List[PolicyResource] resources: The resources associated with a
4720
6737
  policy.
@@ -4856,7 +6873,7 @@ class PolicyAssignmentResourcePolicy:
4856
6873
  Set of properties for the assigned resource.
4857
6874
 
4858
6875
  :param AssignmentResourceCreated resource_created: (optional) On success,
4859
- includes the policy assigned.
6876
+ includes the policy that is assigned.
4860
6877
  :param str status: (optional) policy status.
4861
6878
  :param ErrorResponse error_message: (optional) The error response from API.
4862
6879
  """
@@ -4872,7 +6889,7 @@ class PolicyAssignmentResourcePolicy:
4872
6889
  Initialize a PolicyAssignmentResourcePolicy object.
4873
6890
 
4874
6891
  :param AssignmentResourceCreated resource_created: (optional) On success,
4875
- includes the policy assigned.
6892
+ includes the policy that is assigned.
4876
6893
  :param str status: (optional) policy status.
4877
6894
  :param ErrorResponse error_message: (optional) The error response from API.
4878
6895
  """
@@ -5011,20 +7028,20 @@ class PolicyAssignmentV1:
5011
7028
  :param AssignmentTargetDetails target: assignment target account and type.
5012
7029
  :param str id: (optional) Policy assignment ID.
5013
7030
  :param str account_id: (optional) The account GUID that the policies assignments
5014
- belong to..
7031
+ belong to.
5015
7032
  :param str href: (optional) The href URL that links to the policies assignments
5016
7033
  API by policy assignment ID.
5017
7034
  :param datetime created_at: (optional) The UTC timestamp when the policy
5018
7035
  assignment was created.
5019
- :param str created_by_id: (optional) The iam ID of the entity that created the
7036
+ :param str created_by_id: (optional) The IAM ID of the entity that created the
5020
7037
  policy assignment.
5021
7038
  :param datetime last_modified_at: (optional) The UTC timestamp when the policy
5022
7039
  assignment was last modified.
5023
- :param str last_modified_by_id: (optional) The iam ID of the entity that last
7040
+ :param str last_modified_by_id: (optional) The IAM ID of the entity that last
5024
7041
  modified the policy assignment.
5025
7042
  :param List[PolicyAssignmentV1Resources] resources: Object for each account
5026
7043
  assigned.
5027
- :param PolicyAssignmentV1Subject subject: (optional) subject details of access
7044
+ :param PolicyAssignmentV1Subject subject: (optional) Subject details of access
5028
7045
  type assignment.
5029
7046
  :param AssignmentTemplateDetails template: policy template details.
5030
7047
  :param str status: The policy assignment status.
@@ -5054,7 +7071,7 @@ class PolicyAssignmentV1:
5054
7071
  assigned.
5055
7072
  :param AssignmentTemplateDetails template: policy template details.
5056
7073
  :param str status: The policy assignment status.
5057
- :param PolicyAssignmentV1Subject subject: (optional) subject details of
7074
+ :param PolicyAssignmentV1Subject subject: (optional) Subject details of
5058
7075
  access type assignment.
5059
7076
  """
5060
7077
  self.target = target
@@ -5190,29 +7207,62 @@ class PolicyAssignmentV1Collection:
5190
7207
  """
5191
7208
  Policy assignment response.
5192
7209
 
5193
- :param List[PolicyAssignmentV1] assignments: (optional) Response of policy
5194
- assignments.
7210
+ :param int limit: (optional) The number of documents to include per each page of
7211
+ the collection.
7212
+ :param First first: (optional) Details with linking href to first page of
7213
+ requested collection.
7214
+ :param Next next: (optional) Details with href linking to the following page of
7215
+ requested collection.
7216
+ :param Previous previous: (optional) Details with linking href to previous page
7217
+ of requested collection.
7218
+ :param List[PolicyAssignmentV1] assignments: Response of policy assignments.
5195
7219
  """
5196
7220
 
5197
7221
  def __init__(
5198
7222
  self,
7223
+ assignments: List['PolicyAssignmentV1'],
5199
7224
  *,
5200
- assignments: Optional[List['PolicyAssignmentV1']] = None,
7225
+ limit: Optional[int] = None,
7226
+ first: Optional['First'] = None,
7227
+ next: Optional['Next'] = None,
7228
+ previous: Optional['Previous'] = None,
5201
7229
  ) -> None:
5202
7230
  """
5203
7231
  Initialize a PolicyAssignmentV1Collection object.
5204
7232
 
5205
- :param List[PolicyAssignmentV1] assignments: (optional) Response of policy
7233
+ :param List[PolicyAssignmentV1] assignments: Response of policy
5206
7234
  assignments.
7235
+ :param int limit: (optional) The number of documents to include per each
7236
+ page of the collection.
7237
+ :param First first: (optional) Details with linking href to first page of
7238
+ requested collection.
7239
+ :param Next next: (optional) Details with href linking to the following
7240
+ page of requested collection.
7241
+ :param Previous previous: (optional) Details with linking href to previous
7242
+ page of requested collection.
5207
7243
  """
7244
+ self.limit = limit
7245
+ self.first = first
7246
+ self.next = next
7247
+ self.previous = previous
5208
7248
  self.assignments = assignments
5209
7249
 
5210
7250
  @classmethod
5211
7251
  def from_dict(cls, _dict: Dict) -> 'PolicyAssignmentV1Collection':
5212
7252
  """Initialize a PolicyAssignmentV1Collection object from a json dictionary."""
5213
7253
  args = {}
7254
+ if (limit := _dict.get('limit')) is not None:
7255
+ args['limit'] = limit
7256
+ if (first := _dict.get('first')) is not None:
7257
+ args['first'] = First.from_dict(first)
7258
+ if (next := _dict.get('next')) is not None:
7259
+ args['next'] = Next.from_dict(next)
7260
+ if (previous := _dict.get('previous')) is not None:
7261
+ args['previous'] = Previous.from_dict(previous)
5214
7262
  if (assignments := _dict.get('assignments')) is not None:
5215
7263
  args['assignments'] = [PolicyAssignmentV1.from_dict(v) for v in assignments]
7264
+ else:
7265
+ raise ValueError('Required property \'assignments\' not present in PolicyAssignmentV1Collection JSON')
5216
7266
  return cls(**args)
5217
7267
 
5218
7268
  @classmethod
@@ -5223,6 +7273,23 @@ class PolicyAssignmentV1Collection:
5223
7273
  def to_dict(self) -> Dict:
5224
7274
  """Return a json dictionary representing this model."""
5225
7275
  _dict = {}
7276
+ if hasattr(self, 'limit') and self.limit is not None:
7277
+ _dict['limit'] = self.limit
7278
+ if hasattr(self, 'first') and self.first is not None:
7279
+ if isinstance(self.first, dict):
7280
+ _dict['first'] = self.first
7281
+ else:
7282
+ _dict['first'] = self.first.to_dict()
7283
+ if hasattr(self, 'next') and self.next is not None:
7284
+ if isinstance(self.next, dict):
7285
+ _dict['next'] = self.next
7286
+ else:
7287
+ _dict['next'] = self.next.to_dict()
7288
+ if hasattr(self, 'previous') and self.previous is not None:
7289
+ if isinstance(self.previous, dict):
7290
+ _dict['previous'] = self.previous
7291
+ else:
7292
+ _dict['previous'] = self.previous.to_dict()
5226
7293
  if hasattr(self, 'assignments') and self.assignments is not None:
5227
7294
  assignments_list = []
5228
7295
  for v in self.assignments:
@@ -5330,7 +7397,7 @@ class PolicyAssignmentV1Resources:
5330
7397
 
5331
7398
  class PolicyAssignmentV1Subject:
5332
7399
  """
5333
- subject details of access type assignment.
7400
+ Subject details of access type assignment.
5334
7401
 
5335
7402
  :param str id: (optional) The unique identifier of the subject of the
5336
7403
  assignment.
@@ -5406,37 +7473,37 @@ class PolicyCollection:
5406
7473
  A collection of policies.
5407
7474
 
5408
7475
  :param int limit: (optional) The number of documents to include per each page of
5409
- collection.
5410
- :param First first: (optional) Details with href linking to first page of
7476
+ the collection.
7477
+ :param First first: (optional) Details with linking href to first page of
5411
7478
  requested collection.
5412
- :param Next next: (optional) Details with href linking to following page of
7479
+ :param Next next: (optional) Details with href linking to the following page of
5413
7480
  requested collection.
5414
- :param Previous previous: (optional) Details with href linking to previous page
7481
+ :param Previous previous: (optional) Details with linking href to previous page
5415
7482
  of requested collection.
5416
- :param List[PolicyTemplateMetaData] policies: (optional) List of policies.
7483
+ :param List[PolicyTemplateMetaData] policies: List of policies.
5417
7484
  """
5418
7485
 
5419
7486
  def __init__(
5420
7487
  self,
7488
+ policies: List['PolicyTemplateMetaData'],
5421
7489
  *,
5422
7490
  limit: Optional[int] = None,
5423
7491
  first: Optional['First'] = None,
5424
7492
  next: Optional['Next'] = None,
5425
7493
  previous: Optional['Previous'] = None,
5426
- policies: Optional[List['PolicyTemplateMetaData']] = None,
5427
7494
  ) -> None:
5428
7495
  """
5429
7496
  Initialize a PolicyCollection object.
5430
7497
 
7498
+ :param List[PolicyTemplateMetaData] policies: List of policies.
5431
7499
  :param int limit: (optional) The number of documents to include per each
5432
- page of collection.
5433
- :param First first: (optional) Details with href linking to first page of
5434
- requested collection.
5435
- :param Next next: (optional) Details with href linking to following page of
7500
+ page of the collection.
7501
+ :param First first: (optional) Details with linking href to first page of
5436
7502
  requested collection.
5437
- :param Previous previous: (optional) Details with href linking to previous
7503
+ :param Next next: (optional) Details with href linking to the following
7504
+ page of requested collection.
7505
+ :param Previous previous: (optional) Details with linking href to previous
5438
7506
  page of requested collection.
5439
- :param List[PolicyTemplateMetaData] policies: (optional) List of policies.
5440
7507
  """
5441
7508
  self.limit = limit
5442
7509
  self.first = first
@@ -5458,6 +7525,8 @@ class PolicyCollection:
5458
7525
  args['previous'] = Previous.from_dict(previous)
5459
7526
  if (policies := _dict.get('policies')) is not None:
5460
7527
  args['policies'] = [PolicyTemplateMetaData.from_dict(v) for v in policies]
7528
+ else:
7529
+ raise ValueError('Required property \'policies\' not present in PolicyCollection JSON')
5461
7530
  return cls(**args)
5462
7531
 
5463
7532
  @classmethod
@@ -5518,22 +7587,20 @@ class PolicyResource:
5518
7587
  """
5519
7588
  The attributes of the resource. Note that only one resource is allowed in a policy.
5520
7589
 
5521
- :param List[ResourceAttribute] attributes: (optional) List of resource
5522
- attributes.
7590
+ :param List[ResourceAttribute] attributes: List of resource attributes.
5523
7591
  :param List[ResourceTag] tags: (optional) List of access management tags.
5524
7592
  """
5525
7593
 
5526
7594
  def __init__(
5527
7595
  self,
7596
+ attributes: List['ResourceAttribute'],
5528
7597
  *,
5529
- attributes: Optional[List['ResourceAttribute']] = None,
5530
7598
  tags: Optional[List['ResourceTag']] = None,
5531
7599
  ) -> None:
5532
7600
  """
5533
7601
  Initialize a PolicyResource object.
5534
7602
 
5535
- :param List[ResourceAttribute] attributes: (optional) List of resource
5536
- attributes.
7603
+ :param List[ResourceAttribute] attributes: List of resource attributes.
5537
7604
  :param List[ResourceTag] tags: (optional) List of access management tags.
5538
7605
  """
5539
7606
  self.attributes = attributes
@@ -5545,6 +7612,8 @@ class PolicyResource:
5545
7612
  args = {}
5546
7613
  if (attributes := _dict.get('attributes')) is not None:
5547
7614
  args['attributes'] = [ResourceAttribute.from_dict(v) for v in attributes]
7615
+ else:
7616
+ raise ValueError('Required property \'attributes\' not present in PolicyResource JSON')
5548
7617
  if (tags := _dict.get('tags')) is not None:
5549
7618
  args['tags'] = [ResourceTag.from_dict(v) for v in tags]
5550
7619
  return cls(**args)
@@ -5675,19 +7744,17 @@ class PolicySubject:
5675
7744
  The subject attribute values that must match in order for this policy to apply in a
5676
7745
  permission decision.
5677
7746
 
5678
- :param List[SubjectAttribute] attributes: (optional) List of subject attributes.
7747
+ :param List[SubjectAttribute] attributes: List of subject attributes.
5679
7748
  """
5680
7749
 
5681
7750
  def __init__(
5682
7751
  self,
5683
- *,
5684
- attributes: Optional[List['SubjectAttribute']] = None,
7752
+ attributes: List['SubjectAttribute'],
5685
7753
  ) -> None:
5686
7754
  """
5687
7755
  Initialize a PolicySubject object.
5688
7756
 
5689
- :param List[SubjectAttribute] attributes: (optional) List of subject
5690
- attributes.
7757
+ :param List[SubjectAttribute] attributes: List of subject attributes.
5691
7758
  """
5692
7759
  self.attributes = attributes
5693
7760
 
@@ -5697,6 +7764,8 @@ class PolicySubject:
5697
7764
  args = {}
5698
7765
  if (attributes := _dict.get('attributes')) is not None:
5699
7766
  args['attributes'] = [SubjectAttribute.from_dict(v) for v in attributes]
7767
+ else:
7768
+ raise ValueError('Required property \'attributes\' not present in PolicySubject JSON')
5700
7769
  return cls(**args)
5701
7770
 
5702
7771
  @classmethod
@@ -5740,29 +7809,28 @@ class PolicyTemplate:
5740
7809
  """
5741
7810
  The core set of properties associated with the policy template.
5742
7811
 
5743
- :param str name: Required field when creating a new template. Otherwise this
5744
- field is optional. If the field is included it will change the name value for
5745
- all existing versions of the template.
7812
+ :param str name: Required field when creating a new template. Otherwise, this
7813
+ field is optional. If the field is included, it changes the name value for all
7814
+ existing versions of the template.
5746
7815
  :param str description: (optional) Description of the policy template. This is
5747
7816
  shown to users in the enterprise account. Use this to describe the purpose or
5748
7817
  context of the policy for enterprise users managing IAM templates.
5749
- :param str account_id: Enterprise account ID where this template will be
5750
- created.
7818
+ :param str account_id: Enterprise account ID where this template is created.
5751
7819
  :param str version: Template version.
5752
7820
  :param bool committed: (optional) Committed status of the template version.
5753
7821
  :param TemplatePolicy policy: The core set of properties associated with the
5754
- template's policy objet.
5755
- :param str state: (optional) State of policy template.
7822
+ template's policy object.
7823
+ :param str state: State of policy template.
5756
7824
  :param str id: (optional) The policy template ID.
5757
7825
  :param str href: (optional) The href URL that links to the policy templates API
5758
7826
  by policy template ID.
5759
7827
  :param datetime created_at: (optional) The UTC timestamp when the policy
5760
7828
  template was created.
5761
- :param str created_by_id: (optional) The iam ID of the entity that created the
7829
+ :param str created_by_id: (optional) The IAM ID of the entity that created the
5762
7830
  policy template.
5763
7831
  :param datetime last_modified_at: (optional) The UTC timestamp when the policy
5764
7832
  template was last modified.
5765
- :param str last_modified_by_id: (optional) The iam ID of the entity that last
7833
+ :param str last_modified_by_id: (optional) The IAM ID of the entity that last
5766
7834
  modified the policy template.
5767
7835
  """
5768
7836
 
@@ -5772,10 +7840,10 @@ class PolicyTemplate:
5772
7840
  account_id: str,
5773
7841
  version: str,
5774
7842
  policy: 'TemplatePolicy',
7843
+ state: str,
5775
7844
  *,
5776
7845
  description: Optional[str] = None,
5777
7846
  committed: Optional[bool] = None,
5778
- state: Optional[str] = None,
5779
7847
  id: Optional[str] = None,
5780
7848
  href: Optional[str] = None,
5781
7849
  created_at: Optional[datetime] = None,
@@ -5786,20 +7854,20 @@ class PolicyTemplate:
5786
7854
  """
5787
7855
  Initialize a PolicyTemplate object.
5788
7856
 
5789
- :param str name: Required field when creating a new template. Otherwise
5790
- this field is optional. If the field is included it will change the name
5791
- value for all existing versions of the template.
5792
- :param str account_id: Enterprise account ID where this template will be
7857
+ :param str name: Required field when creating a new template. Otherwise,
7858
+ this field is optional. If the field is included, it changes the name value
7859
+ for all existing versions of the template.
7860
+ :param str account_id: Enterprise account ID where this template is
5793
7861
  created.
5794
7862
  :param str version: Template version.
5795
7863
  :param TemplatePolicy policy: The core set of properties associated with
5796
- the template's policy objet.
7864
+ the template's policy object.
7865
+ :param str state: State of policy template.
5797
7866
  :param str description: (optional) Description of the policy template. This
5798
7867
  is shown to users in the enterprise account. Use this to describe the
5799
7868
  purpose or context of the policy for enterprise users managing IAM
5800
7869
  templates.
5801
7870
  :param bool committed: (optional) Committed status of the template version.
5802
- :param str state: (optional) State of policy template.
5803
7871
  """
5804
7872
  self.name = name
5805
7873
  self.description = description
@@ -5841,6 +7909,8 @@ class PolicyTemplate:
5841
7909
  raise ValueError('Required property \'policy\' not present in PolicyTemplate JSON')
5842
7910
  if (state := _dict.get('state')) is not None:
5843
7911
  args['state'] = state
7912
+ else:
7913
+ raise ValueError('Required property \'state\' not present in PolicyTemplate JSON')
5844
7914
  if (id := _dict.get('id')) is not None:
5845
7915
  args['id'] = id
5846
7916
  if (href := _dict.get('href')) is not None:
@@ -5926,39 +7996,39 @@ class PolicyTemplateAssignmentCollection:
5926
7996
  A collection of policies assignments.
5927
7997
 
5928
7998
  :param int limit: (optional) The number of documents to include per each page of
5929
- collection.
5930
- :param First first: (optional) Details with href linking to first page of
7999
+ the collection.
8000
+ :param First first: (optional) Details with linking href to first page of
5931
8001
  requested collection.
5932
- :param Next next: (optional) Details with href linking to following page of
8002
+ :param Next next: (optional) Details with href linking to the following page of
5933
8003
  requested collection.
5934
- :param Previous previous: (optional) Details with href linking to previous page
8004
+ :param Previous previous: (optional) Details with linking href to previous page
5935
8005
  of requested collection.
5936
- :param List[PolicyTemplateAssignmentItems] assignments: (optional) List of
5937
- policy assignments.
8006
+ :param List[PolicyTemplateAssignmentItems] assignments: List of policy
8007
+ assignments.
5938
8008
  """
5939
8009
 
5940
8010
  def __init__(
5941
8011
  self,
8012
+ assignments: List['PolicyTemplateAssignmentItems'],
5942
8013
  *,
5943
8014
  limit: Optional[int] = None,
5944
8015
  first: Optional['First'] = None,
5945
8016
  next: Optional['Next'] = None,
5946
8017
  previous: Optional['Previous'] = None,
5947
- assignments: Optional[List['PolicyTemplateAssignmentItems']] = None,
5948
8018
  ) -> None:
5949
8019
  """
5950
8020
  Initialize a PolicyTemplateAssignmentCollection object.
5951
8021
 
8022
+ :param List[PolicyTemplateAssignmentItems] assignments: List of policy
8023
+ assignments.
5952
8024
  :param int limit: (optional) The number of documents to include per each
5953
- page of collection.
5954
- :param First first: (optional) Details with href linking to first page of
8025
+ page of the collection.
8026
+ :param First first: (optional) Details with linking href to first page of
5955
8027
  requested collection.
5956
- :param Next next: (optional) Details with href linking to following page of
5957
- requested collection.
5958
- :param Previous previous: (optional) Details with href linking to previous
8028
+ :param Next next: (optional) Details with href linking to the following
8029
+ page of requested collection.
8030
+ :param Previous previous: (optional) Details with linking href to previous
5959
8031
  page of requested collection.
5960
- :param List[PolicyTemplateAssignmentItems] assignments: (optional) List of
5961
- policy assignments.
5962
8032
  """
5963
8033
  self.limit = limit
5964
8034
  self.first = first
@@ -5980,6 +8050,8 @@ class PolicyTemplateAssignmentCollection:
5980
8050
  args['previous'] = Previous.from_dict(previous)
5981
8051
  if (assignments := _dict.get('assignments')) is not None:
5982
8052
  args['assignments'] = assignments
8053
+ else:
8054
+ raise ValueError('Required property \'assignments\' not present in PolicyTemplateAssignmentCollection JSON')
5983
8055
  return cls(**args)
5984
8056
 
5985
8057
  @classmethod
@@ -6062,39 +8134,37 @@ class PolicyTemplateCollection:
6062
8134
  A collection of policy Templates.
6063
8135
 
6064
8136
  :param int limit: (optional) The number of documents to include per each page of
6065
- collection.
6066
- :param First first: (optional) Details with href linking to first page of
8137
+ the collection.
8138
+ :param First first: (optional) Details with linking href to first page of
6067
8139
  requested collection.
6068
- :param Next next: (optional) Details with href linking to following page of
8140
+ :param Next next: (optional) Details with href linking to the following page of
6069
8141
  requested collection.
6070
- :param Previous previous: (optional) Details with href linking to previous page
8142
+ :param Previous previous: (optional) Details with linking href to previous page
6071
8143
  of requested collection.
6072
- :param List[PolicyTemplate] policy_templates: (optional) List of policy
6073
- templates.
8144
+ :param List[PolicyTemplate] policy_templates: List of policy templates.
6074
8145
  """
6075
8146
 
6076
8147
  def __init__(
6077
8148
  self,
8149
+ policy_templates: List['PolicyTemplate'],
6078
8150
  *,
6079
8151
  limit: Optional[int] = None,
6080
8152
  first: Optional['First'] = None,
6081
8153
  next: Optional['Next'] = None,
6082
8154
  previous: Optional['Previous'] = None,
6083
- policy_templates: Optional[List['PolicyTemplate']] = None,
6084
8155
  ) -> None:
6085
8156
  """
6086
8157
  Initialize a PolicyTemplateCollection object.
6087
8158
 
8159
+ :param List[PolicyTemplate] policy_templates: List of policy templates.
6088
8160
  :param int limit: (optional) The number of documents to include per each
6089
- page of collection.
6090
- :param First first: (optional) Details with href linking to first page of
8161
+ page of the collection.
8162
+ :param First first: (optional) Details with linking href to first page of
6091
8163
  requested collection.
6092
- :param Next next: (optional) Details with href linking to following page of
6093
- requested collection.
6094
- :param Previous previous: (optional) Details with href linking to previous
8164
+ :param Next next: (optional) Details with href linking to the following
8165
+ page of requested collection.
8166
+ :param Previous previous: (optional) Details with linking href to previous
6095
8167
  page of requested collection.
6096
- :param List[PolicyTemplate] policy_templates: (optional) List of policy
6097
- templates.
6098
8168
  """
6099
8169
  self.limit = limit
6100
8170
  self.first = first
@@ -6116,6 +8186,8 @@ class PolicyTemplateCollection:
6116
8186
  args['previous'] = Previous.from_dict(previous)
6117
8187
  if (policy_templates := _dict.get('policy_templates')) is not None:
6118
8188
  args['policy_templates'] = [PolicyTemplate.from_dict(v) for v in policy_templates]
8189
+ else:
8190
+ raise ValueError('Required property \'policy_templates\' not present in PolicyTemplateCollection JSON')
6119
8191
  return cls(**args)
6120
8192
 
6121
8193
  @classmethod
@@ -6176,29 +8248,28 @@ class PolicyTemplateLimitData:
6176
8248
  """
6177
8249
  The core set of properties associated with the policy template.
6178
8250
 
6179
- :param str name: Required field when creating a new template. Otherwise this
6180
- field is optional. If the field is included it will change the name value for
6181
- all existing versions of the template.
8251
+ :param str name: Required field when creating a new template. Otherwise, this
8252
+ field is optional. If the field is included, it changes the name value for all
8253
+ existing versions of the template.
6182
8254
  :param str description: (optional) Description of the policy template. This is
6183
8255
  shown to users in the enterprise account. Use this to describe the purpose or
6184
8256
  context of the policy for enterprise users managing IAM templates.
6185
- :param str account_id: Enterprise account ID where this template will be
6186
- created.
8257
+ :param str account_id: Enterprise account ID where this template is created.
6187
8258
  :param str version: Template version.
6188
8259
  :param bool committed: (optional) Committed status of the template version.
6189
8260
  :param TemplatePolicy policy: The core set of properties associated with the
6190
- template's policy objet.
6191
- :param str state: (optional) State of policy template.
8261
+ template's policy object.
8262
+ :param str state: State of policy template.
6192
8263
  :param str id: (optional) The policy template ID.
6193
8264
  :param str href: (optional) The href URL that links to the policy templates API
6194
8265
  by policy template ID.
6195
8266
  :param datetime created_at: (optional) The UTC timestamp when the policy
6196
8267
  template was created.
6197
- :param str created_by_id: (optional) The iam ID of the entity that created the
8268
+ :param str created_by_id: (optional) The IAM ID of the entity that created the
6198
8269
  policy template.
6199
8270
  :param datetime last_modified_at: (optional) The UTC timestamp when the policy
6200
8271
  template was last modified.
6201
- :param str last_modified_by_id: (optional) The iam ID of the entity that last
8272
+ :param str last_modified_by_id: (optional) The IAM ID of the entity that last
6202
8273
  modified the policy template.
6203
8274
  :param TemplateCountData counts: (optional) policy template count details.
6204
8275
  """
@@ -6209,10 +8280,10 @@ class PolicyTemplateLimitData:
6209
8280
  account_id: str,
6210
8281
  version: str,
6211
8282
  policy: 'TemplatePolicy',
8283
+ state: str,
6212
8284
  *,
6213
8285
  description: Optional[str] = None,
6214
8286
  committed: Optional[bool] = None,
6215
- state: Optional[str] = None,
6216
8287
  id: Optional[str] = None,
6217
8288
  href: Optional[str] = None,
6218
8289
  created_at: Optional[datetime] = None,
@@ -6224,20 +8295,20 @@ class PolicyTemplateLimitData:
6224
8295
  """
6225
8296
  Initialize a PolicyTemplateLimitData object.
6226
8297
 
6227
- :param str name: Required field when creating a new template. Otherwise
6228
- this field is optional. If the field is included it will change the name
6229
- value for all existing versions of the template.
6230
- :param str account_id: Enterprise account ID where this template will be
8298
+ :param str name: Required field when creating a new template. Otherwise,
8299
+ this field is optional. If the field is included, it changes the name value
8300
+ for all existing versions of the template.
8301
+ :param str account_id: Enterprise account ID where this template is
6231
8302
  created.
6232
8303
  :param str version: Template version.
6233
8304
  :param TemplatePolicy policy: The core set of properties associated with
6234
- the template's policy objet.
8305
+ the template's policy object.
8306
+ :param str state: State of policy template.
6235
8307
  :param str description: (optional) Description of the policy template. This
6236
8308
  is shown to users in the enterprise account. Use this to describe the
6237
8309
  purpose or context of the policy for enterprise users managing IAM
6238
8310
  templates.
6239
8311
  :param bool committed: (optional) Committed status of the template version.
6240
- :param str state: (optional) State of policy template.
6241
8312
  :param TemplateCountData counts: (optional) policy template count details.
6242
8313
  """
6243
8314
  self.name = name
@@ -6281,6 +8352,8 @@ class PolicyTemplateLimitData:
6281
8352
  raise ValueError('Required property \'policy\' not present in PolicyTemplateLimitData JSON')
6282
8353
  if (state := _dict.get('state')) is not None:
6283
8354
  args['state'] = state
8355
+ else:
8356
+ raise ValueError('Required property \'state\' not present in PolicyTemplateLimitData JSON')
6284
8357
  if (id := _dict.get('id')) is not None:
6285
8358
  args['id'] = id
6286
8359
  if (href := _dict.get('href')) is not None:
@@ -6376,17 +8449,17 @@ class PolicyTemplateMetaData:
6376
8449
  :param str type: The policy type; either 'access' or 'authorization'.
6377
8450
  :param str description: (optional) Customer-defined description.
6378
8451
  :param List[PolicySubject] subjects: The subjects associated with a policy.
6379
- :param List[PolicyRole] roles: A set of role cloud resource names (CRNs) granted
8452
+ :param List[PolicyRole] roles: A set of role Cloud Resource Names (CRNs) granted
6380
8453
  by the policy.
6381
8454
  :param List[PolicyResource] resources: The resources associated with a policy.
6382
- :param str href: (optional) The href link back to the policy.
8455
+ :param str href: (optional) The href links back to the policy.
6383
8456
  :param datetime created_at: (optional) The UTC timestamp when the policy was
6384
8457
  created.
6385
- :param str created_by_id: (optional) The iam ID of the entity that created the
8458
+ :param str created_by_id: (optional) The IAM ID of the entity that created the
6386
8459
  policy.
6387
8460
  :param datetime last_modified_at: (optional) The UTC timestamp when the policy
6388
8461
  was last modified.
6389
- :param str last_modified_by_id: (optional) The iam ID of the entity that last
8462
+ :param str last_modified_by_id: (optional) The IAM ID of the entity that last
6390
8463
  modified the policy.
6391
8464
  :param str state: (optional) The policy state.
6392
8465
  :param TemplateMetadata template: (optional) The details of the IAM template
@@ -6417,7 +8490,7 @@ class PolicyTemplateMetaData:
6417
8490
 
6418
8491
  :param str type: The policy type; either 'access' or 'authorization'.
6419
8492
  :param List[PolicySubject] subjects: The subjects associated with a policy.
6420
- :param List[PolicyRole] roles: A set of role cloud resource names (CRNs)
8493
+ :param List[PolicyRole] roles: A set of role Cloud Resource Names (CRNs)
6421
8494
  granted by the policy.
6422
8495
  :param List[PolicyResource] resources: The resources associated with a
6423
8496
  policy.
@@ -6571,39 +8644,37 @@ class PolicyTemplateVersionsCollection:
6571
8644
  A collection of versions for a specific policy template.
6572
8645
 
6573
8646
  :param int limit: (optional) The number of documents to include per each page of
6574
- collection.
6575
- :param First first: (optional) Details with href linking to first page of
8647
+ the collection.
8648
+ :param First first: (optional) Details with linking href to first page of
6576
8649
  requested collection.
6577
- :param Next next: (optional) Details with href linking to following page of
8650
+ :param Next next: (optional) Details with href linking to the following page of
6578
8651
  requested collection.
6579
- :param Previous previous: (optional) Details with href linking to previous page
8652
+ :param Previous previous: (optional) Details with linking href to previous page
6580
8653
  of requested collection.
6581
- :param List[PolicyTemplate] versions: (optional) List of policy templates
6582
- versions.
8654
+ :param List[PolicyTemplate] versions: List of policy templates versions.
6583
8655
  """
6584
8656
 
6585
8657
  def __init__(
6586
8658
  self,
8659
+ versions: List['PolicyTemplate'],
6587
8660
  *,
6588
8661
  limit: Optional[int] = None,
6589
8662
  first: Optional['First'] = None,
6590
8663
  next: Optional['Next'] = None,
6591
8664
  previous: Optional['Previous'] = None,
6592
- versions: Optional[List['PolicyTemplate']] = None,
6593
8665
  ) -> None:
6594
8666
  """
6595
8667
  Initialize a PolicyTemplateVersionsCollection object.
6596
8668
 
8669
+ :param List[PolicyTemplate] versions: List of policy templates versions.
6597
8670
  :param int limit: (optional) The number of documents to include per each
6598
- page of collection.
6599
- :param First first: (optional) Details with href linking to first page of
8671
+ page of the collection.
8672
+ :param First first: (optional) Details with linking href to first page of
6600
8673
  requested collection.
6601
- :param Next next: (optional) Details with href linking to following page of
6602
- requested collection.
6603
- :param Previous previous: (optional) Details with href linking to previous
8674
+ :param Next next: (optional) Details with href linking to the following
8675
+ page of requested collection.
8676
+ :param Previous previous: (optional) Details with linking href to previous
6604
8677
  page of requested collection.
6605
- :param List[PolicyTemplate] versions: (optional) List of policy templates
6606
- versions.
6607
8678
  """
6608
8679
  self.limit = limit
6609
8680
  self.first = first
@@ -6625,6 +8696,8 @@ class PolicyTemplateVersionsCollection:
6625
8696
  args['previous'] = Previous.from_dict(previous)
6626
8697
  if (versions := _dict.get('versions')) is not None:
6627
8698
  args['versions'] = [PolicyTemplate.from_dict(v) for v in versions]
8699
+ else:
8700
+ raise ValueError('Required property \'versions\' not present in PolicyTemplateVersionsCollection JSON')
6628
8701
  return cls(**args)
6629
8702
 
6630
8703
  @classmethod
@@ -6683,11 +8756,12 @@ class PolicyTemplateVersionsCollection:
6683
8756
 
6684
8757
  class Previous:
6685
8758
  """
6686
- Details with href linking to previous page of requested collection.
8759
+ Details with linking href to previous page of requested collection.
6687
8760
 
6688
8761
  :param str href: (optional) The href linking to the page of requested
6689
8762
  collection.
6690
- :param str start: (optional) Page token that refers to the page of collection.
8763
+ :param str start: (optional) Page token that refers to the page of the
8764
+ collection.
6691
8765
  """
6692
8766
 
6693
8767
  def __init__(
@@ -6699,7 +8773,7 @@ class Previous:
6699
8773
  """
6700
8774
  Initialize a Previous object.
6701
8775
 
6702
- :param str start: (optional) Page token that refers to the page of
8776
+ :param str start: (optional) Page token that refers to the page of the
6703
8777
  collection.
6704
8778
  """
6705
8779
  self.href = href
@@ -6908,7 +8982,7 @@ class Role:
6908
8982
  """
6909
8983
  A role resource.
6910
8984
 
6911
- :param str display_name: The display name of the role that is shown in the
8985
+ :param str display_name: The display the name of the role that is shown in the
6912
8986
  console.
6913
8987
  :param str description: (optional) The description of the role.
6914
8988
  :param List[str] actions: The actions of the role. For more information, see
@@ -6929,8 +9003,8 @@ class Role:
6929
9003
  """
6930
9004
  Initialize a Role object.
6931
9005
 
6932
- :param str display_name: The display name of the role that is shown in the
6933
- console.
9006
+ :param str display_name: The display the name of the role that is shown in
9007
+ the console.
6934
9008
  :param List[str] actions: The actions of the role. For more information,
6935
9009
  see [IAM roles and
6936
9010
  actions](https://cloud.ibm.com/docs/account?topic=account-iam-service-roles-actions).
@@ -6998,11 +9072,11 @@ class Role:
6998
9072
 
6999
9073
  class RoleAction:
7000
9074
  """
7001
- An action that can be performed by the policy subject when assigned role.
9075
+ An action that can be performed by the policy subject when assigned a role.
7002
9076
 
7003
9077
  :param str id: Unique identifier for action with structure
7004
- service.resource.action e.g., cbr.rule.read.
7005
- :param str display_name: Service defined display name for action.
9078
+ service.resource.action. For example, cbr.rule.read.
9079
+ :param str display_name: Services defined display name for action.
7006
9080
  :param str description: Service defined description for action.
7007
9081
  """
7008
9082
 
@@ -7016,8 +9090,8 @@ class RoleAction:
7016
9090
  Initialize a RoleAction object.
7017
9091
 
7018
9092
  :param str id: Unique identifier for action with structure
7019
- service.resource.action e.g., cbr.rule.read.
7020
- :param str display_name: Service defined display name for action.
9093
+ service.resource.action. For example, cbr.rule.read.
9094
+ :param str display_name: Services defined display name for action.
7021
9095
  :param str description: Service defined description for action.
7022
9096
  """
7023
9097
  self.id = id
@@ -7081,24 +9155,23 @@ class RoleCollection:
7081
9155
  """
7082
9156
  A collection of roles returned by the 'list roles' operation.
7083
9157
 
7084
- :param List[CustomRole] custom_roles: (optional) List of custom roles.
7085
- :param List[Role] service_roles: (optional) List of service roles.
7086
- :param List[Role] system_roles: (optional) List of system roles.
9158
+ :param List[CustomRole] custom_roles: List of custom roles.
9159
+ :param List[Role] service_roles: List of service roles.
9160
+ :param List[Role] system_roles: List of system roles.
7087
9161
  """
7088
9162
 
7089
9163
  def __init__(
7090
9164
  self,
7091
- *,
7092
- custom_roles: Optional[List['CustomRole']] = None,
7093
- service_roles: Optional[List['Role']] = None,
7094
- system_roles: Optional[List['Role']] = None,
9165
+ custom_roles: List['CustomRole'],
9166
+ service_roles: List['Role'],
9167
+ system_roles: List['Role'],
7095
9168
  ) -> None:
7096
9169
  """
7097
9170
  Initialize a RoleCollection object.
7098
9171
 
7099
- :param List[CustomRole] custom_roles: (optional) List of custom roles.
7100
- :param List[Role] service_roles: (optional) List of service roles.
7101
- :param List[Role] system_roles: (optional) List of system roles.
9172
+ :param List[CustomRole] custom_roles: List of custom roles.
9173
+ :param List[Role] service_roles: List of service roles.
9174
+ :param List[Role] system_roles: List of system roles.
7102
9175
  """
7103
9176
  self.custom_roles = custom_roles
7104
9177
  self.service_roles = service_roles
@@ -7110,10 +9183,16 @@ class RoleCollection:
7110
9183
  args = {}
7111
9184
  if (custom_roles := _dict.get('custom_roles')) is not None:
7112
9185
  args['custom_roles'] = [CustomRole.from_dict(v) for v in custom_roles]
9186
+ else:
9187
+ raise ValueError('Required property \'custom_roles\' not present in RoleCollection JSON')
7113
9188
  if (service_roles := _dict.get('service_roles')) is not None:
7114
9189
  args['service_roles'] = [Role.from_dict(v) for v in service_roles]
9190
+ else:
9191
+ raise ValueError('Required property \'service_roles\' not present in RoleCollection JSON')
7115
9192
  if (system_roles := _dict.get('system_roles')) is not None:
7116
9193
  args['system_roles'] = [Role.from_dict(v) for v in system_roles]
9194
+ else:
9195
+ raise ValueError('Required property \'system_roles\' not present in RoleCollection JSON')
7117
9196
  return cls(**args)
7118
9197
 
7119
9198
  @classmethod
@@ -7232,13 +9311,15 @@ class Roles:
7232
9311
 
7233
9312
  class RuleAttribute:
7234
9313
  """
7235
- Rule that specifies additional access granted (e.g., time-based condition).
9314
+ Rule that specifies additional access that is granted (For example, time-based
9315
+ condition).
7236
9316
 
7237
9317
  :param str key: The name of an attribute.
7238
9318
  :param str operator: The operator of an attribute.
7239
9319
  :param object value: The value of a rule, resource, or subject attribute; can be
7240
- boolean or string for resource and subject attribute. Can be string or an array
7241
- of strings (e.g., array of days to permit access) for rule attribute.
9320
+ boolean or string for resource and subject attribute. Can be a string or an
9321
+ array of strings (for example, an array of days to permit access) for rule
9322
+ attribute.
7242
9323
  """
7243
9324
 
7244
9325
  def __init__(
@@ -7253,9 +9334,9 @@ class RuleAttribute:
7253
9334
  :param str key: The name of an attribute.
7254
9335
  :param str operator: The operator of an attribute.
7255
9336
  :param object value: The value of a rule, resource, or subject attribute;
7256
- can be boolean or string for resource and subject attribute. Can be string
7257
- or an array of strings (e.g., array of days to permit access) for rule
7258
- attribute.
9337
+ can be boolean or string for resource and subject attribute. Can be a
9338
+ string or an array of strings (for example, an array of days to permit
9339
+ access) for rule attribute.
7259
9340
  """
7260
9341
  self.key = key
7261
9342
  self.operator = operator
@@ -7403,7 +9484,86 @@ class SubjectAttribute:
7403
9484
  return False
7404
9485
  return self.__dict__ == other.__dict__
7405
9486
 
7406
- def __ne__(self, other: 'SubjectAttribute') -> bool:
9487
+ def __ne__(self, other: 'SubjectAttribute') -> bool:
9488
+ """Return `true` when self and other are not equal, false otherwise."""
9489
+ return not self == other
9490
+
9491
+
9492
+ class TemplateActionControl:
9493
+ """
9494
+ The action control properties that are created in an action resource when the template
9495
+ is assigned.
9496
+
9497
+ :param str service_name: The service name that the action control refers.
9498
+ :param str description: (optional) Description of the action control.
9499
+ :param List[str] actions: List of actions to control access.
9500
+ """
9501
+
9502
+ def __init__(
9503
+ self,
9504
+ service_name: str,
9505
+ actions: List[str],
9506
+ *,
9507
+ description: Optional[str] = None,
9508
+ ) -> None:
9509
+ """
9510
+ Initialize a TemplateActionControl object.
9511
+
9512
+ :param str service_name: The service name that the action control refers.
9513
+ :param List[str] actions: List of actions to control access.
9514
+ :param str description: (optional) Description of the action control.
9515
+ """
9516
+ self.service_name = service_name
9517
+ self.description = description
9518
+ self.actions = actions
9519
+
9520
+ @classmethod
9521
+ def from_dict(cls, _dict: Dict) -> 'TemplateActionControl':
9522
+ """Initialize a TemplateActionControl object from a json dictionary."""
9523
+ args = {}
9524
+ if (service_name := _dict.get('service_name')) is not None:
9525
+ args['service_name'] = service_name
9526
+ else:
9527
+ raise ValueError('Required property \'service_name\' not present in TemplateActionControl JSON')
9528
+ if (description := _dict.get('description')) is not None:
9529
+ args['description'] = description
9530
+ if (actions := _dict.get('actions')) is not None:
9531
+ args['actions'] = actions
9532
+ else:
9533
+ raise ValueError('Required property \'actions\' not present in TemplateActionControl JSON')
9534
+ return cls(**args)
9535
+
9536
+ @classmethod
9537
+ def _from_dict(cls, _dict):
9538
+ """Initialize a TemplateActionControl object from a json dictionary."""
9539
+ return cls.from_dict(_dict)
9540
+
9541
+ def to_dict(self) -> Dict:
9542
+ """Return a json dictionary representing this model."""
9543
+ _dict = {}
9544
+ if hasattr(self, 'service_name') and self.service_name is not None:
9545
+ _dict['service_name'] = self.service_name
9546
+ if hasattr(self, 'description') and self.description is not None:
9547
+ _dict['description'] = self.description
9548
+ if hasattr(self, 'actions') and self.actions is not None:
9549
+ _dict['actions'] = self.actions
9550
+ return _dict
9551
+
9552
+ def _to_dict(self):
9553
+ """Return a json dictionary representing this model."""
9554
+ return self.to_dict()
9555
+
9556
+ def __str__(self) -> str:
9557
+ """Return a `str` version of this TemplateActionControl object."""
9558
+ return json.dumps(self.to_dict(), indent=2)
9559
+
9560
+ def __eq__(self, other: 'TemplateActionControl') -> bool:
9561
+ """Return `true` when self and other are equal, false otherwise."""
9562
+ if not isinstance(other, self.__class__):
9563
+ return False
9564
+ return self.__dict__ == other.__dict__
9565
+
9566
+ def __ne__(self, other: 'TemplateActionControl') -> bool:
7407
9567
  """Return `true` when self and other are not equal, false otherwise."""
7408
9568
  return not self == other
7409
9569
 
@@ -7492,9 +9652,9 @@ class TemplateMetadata:
7492
9652
 
7493
9653
  :param str id: (optional) The policy template ID.
7494
9654
  :param str version: (optional) Template version.
7495
- :param str assignment_id: (optional) policy assignment id.
7496
- :param str root_id: (optional) orchestrator template id.
7497
- :param str root_version: (optional) orchestrator template version.
9655
+ :param str assignment_id: (optional) Policy assignment ID.
9656
+ :param str root_id: (optional) Orchestrator template ID.
9657
+ :param str root_version: (optional) Orchestrator template version.
7498
9658
  """
7499
9659
 
7500
9660
  def __init__(
@@ -7511,9 +9671,9 @@ class TemplateMetadata:
7511
9671
 
7512
9672
  :param str id: (optional) The policy template ID.
7513
9673
  :param str version: (optional) Template version.
7514
- :param str assignment_id: (optional) policy assignment id.
7515
- :param str root_id: (optional) orchestrator template id.
7516
- :param str root_version: (optional) orchestrator template version.
9674
+ :param str assignment_id: (optional) Policy assignment ID.
9675
+ :param str root_id: (optional) Orchestrator template ID.
9676
+ :param str root_version: (optional) Orchestrator template version.
7517
9677
  """
7518
9678
  self.id = id
7519
9679
  self.version = version
@@ -7578,7 +9738,7 @@ class TemplateMetadata:
7578
9738
 
7579
9739
  class TemplatePolicy:
7580
9740
  """
7581
- The core set of properties associated with the template's policy objet.
9741
+ The core set of properties associated with the template's policy object.
7582
9742
 
7583
9743
  :param str type: The policy type; either 'access' or 'authorization'.
7584
9744
  :param str description: (optional) Description of the policy. This is shown in
@@ -7593,8 +9753,8 @@ class TemplatePolicy:
7593
9753
  'time-based-conditions:weekly:custom-hours'.
7594
9754
  :param V2PolicyRule rule: (optional) Additional access conditions associated
7595
9755
  with the policy.
7596
- :param Control control: (optional) Specifies the type of access granted by the
7597
- policy.
9756
+ :param Control control: (optional) Specifies the type of access that is granted
9757
+ by the policy.
7598
9758
  """
7599
9759
 
7600
9760
  def __init__(
@@ -7624,8 +9784,8 @@ class TemplatePolicy:
7624
9784
  'time-based-conditions:weekly:custom-hours'.
7625
9785
  :param V2PolicyRule rule: (optional) Additional access conditions
7626
9786
  associated with the policy.
7627
- :param Control control: (optional) Specifies the type of access granted by
7628
- the policy.
9787
+ :param Control control: (optional) Specifies the type of access that is
9788
+ granted by the policy.
7629
9789
  """
7630
9790
  self.type = type
7631
9791
  self.description = description
@@ -7741,11 +9901,11 @@ class V2Policy:
7741
9901
  :param ControlResponse control:
7742
9902
  :param datetime created_at: (optional) The UTC timestamp when the policy was
7743
9903
  created.
7744
- :param str created_by_id: (optional) The iam ID of the entity that created the
9904
+ :param str created_by_id: (optional) The IAM ID of the entity that created the
7745
9905
  policy.
7746
9906
  :param datetime last_modified_at: (optional) The UTC timestamp when the policy
7747
9907
  was last modified.
7748
- :param str last_modified_by_id: (optional) The iam ID of the entity that last
9908
+ :param str last_modified_by_id: (optional) The IAM ID of the entity that last
7749
9909
  modified the policy.
7750
9910
  :param str state: The policy state, either 'deleted' or 'active'.
7751
9911
  :param str last_permit_at: (optional) The optional last permit time of policy,
@@ -7952,38 +10112,37 @@ class V2PolicyCollection:
7952
10112
  A collection of policies.
7953
10113
 
7954
10114
  :param int limit: (optional) The number of documents to include per each page of
7955
- collection.
7956
- :param First first: (optional) Details with href linking to first page of
10115
+ the collection.
10116
+ :param First first: (optional) Details with linking href to first page of
7957
10117
  requested collection.
7958
- :param Next next: (optional) Details with href linking to following page of
10118
+ :param Next next: (optional) Details with href linking to the following page of
7959
10119
  requested collection.
7960
- :param Previous previous: (optional) Details with href linking to previous page
10120
+ :param Previous previous: (optional) Details with linking href to previous page
7961
10121
  of requested collection.
7962
- :param List[V2PolicyTemplateMetaData] policies: (optional) List of policies.
10122
+ :param List[V2PolicyTemplateMetaData] policies: List of policies.
7963
10123
  """
7964
10124
 
7965
10125
  def __init__(
7966
10126
  self,
10127
+ policies: List['V2PolicyTemplateMetaData'],
7967
10128
  *,
7968
10129
  limit: Optional[int] = None,
7969
10130
  first: Optional['First'] = None,
7970
10131
  next: Optional['Next'] = None,
7971
10132
  previous: Optional['Previous'] = None,
7972
- policies: Optional[List['V2PolicyTemplateMetaData']] = None,
7973
10133
  ) -> None:
7974
10134
  """
7975
10135
  Initialize a V2PolicyCollection object.
7976
10136
 
10137
+ :param List[V2PolicyTemplateMetaData] policies: List of policies.
7977
10138
  :param int limit: (optional) The number of documents to include per each
7978
- page of collection.
7979
- :param First first: (optional) Details with href linking to first page of
7980
- requested collection.
7981
- :param Next next: (optional) Details with href linking to following page of
10139
+ page of the collection.
10140
+ :param First first: (optional) Details with linking href to first page of
7982
10141
  requested collection.
7983
- :param Previous previous: (optional) Details with href linking to previous
10142
+ :param Next next: (optional) Details with href linking to the following
10143
+ page of requested collection.
10144
+ :param Previous previous: (optional) Details with linking href to previous
7984
10145
  page of requested collection.
7985
- :param List[V2PolicyTemplateMetaData] policies: (optional) List of
7986
- policies.
7987
10146
  """
7988
10147
  self.limit = limit
7989
10148
  self.first = first
@@ -8005,6 +10164,8 @@ class V2PolicyCollection:
8005
10164
  args['previous'] = Previous.from_dict(previous)
8006
10165
  if (policies := _dict.get('policies')) is not None:
8007
10166
  args['policies'] = [V2PolicyTemplateMetaData.from_dict(v) for v in policies]
10167
+ else:
10168
+ raise ValueError('Required property \'policies\' not present in V2PolicyCollection JSON')
8008
10169
  return cls(**args)
8009
10170
 
8010
10171
  @classmethod
@@ -8152,8 +10313,9 @@ class V2PolicyResourceAttribute:
8152
10313
  :param str key: The name of a resource attribute.
8153
10314
  :param str operator: The operator of an attribute.
8154
10315
  :param object value: The value of a rule, resource, or subject attribute; can be
8155
- boolean or string for resource and subject attribute. Can be string or an array
8156
- of strings (e.g., array of days to permit access) for rule attribute.
10316
+ boolean or string for resource and subject attribute. Can be a string or an
10317
+ array of strings (for example, an array of days to permit access) for rule
10318
+ attribute.
8157
10319
  """
8158
10320
 
8159
10321
  def __init__(
@@ -8168,9 +10330,9 @@ class V2PolicyResourceAttribute:
8168
10330
  :param str key: The name of a resource attribute.
8169
10331
  :param str operator: The operator of an attribute.
8170
10332
  :param object value: The value of a rule, resource, or subject attribute;
8171
- can be boolean or string for resource and subject attribute. Can be string
8172
- or an array of strings (e.g., array of days to permit access) for rule
8173
- attribute.
10333
+ can be boolean or string for resource and subject attribute. Can be a
10334
+ string or an array of strings (for example, an array of days to permit
10335
+ access) for rule attribute.
8174
10336
  """
8175
10337
  self.key = key
8176
10338
  self.operator = operator
@@ -8351,7 +10513,7 @@ class V2PolicySubject:
8351
10513
  The subject attributes for whom the policy grants access.
8352
10514
 
8353
10515
  :param List[V2PolicySubjectAttribute] attributes: List of subject attributes
8354
- associated with policy/.
10516
+ associated with policy.
8355
10517
  """
8356
10518
 
8357
10519
  def __init__(
@@ -8362,7 +10524,7 @@ class V2PolicySubject:
8362
10524
  Initialize a V2PolicySubject object.
8363
10525
 
8364
10526
  :param List[V2PolicySubjectAttribute] attributes: List of subject
8365
- attributes associated with policy/.
10527
+ attributes associated with policy.
8366
10528
  """
8367
10529
  self.attributes = attributes
8368
10530
 
@@ -8417,11 +10579,13 @@ class V2PolicySubjectAttribute:
8417
10579
  """
8418
10580
  Subject attribute for whom the policy grants access.
8419
10581
 
8420
- :param str key: The name of a subject attribute, e.g., iam_id, access_group_id.
10582
+ :param str key: The name of a subject attribute. For example, iam_id,
10583
+ access_group_id.
8421
10584
  :param str operator: The operator of an attribute.
8422
10585
  :param object value: The value of a rule, resource, or subject attribute; can be
8423
- boolean or string for resource and subject attribute. Can be string or an array
8424
- of strings (e.g., array of days to permit access) for rule attribute.
10586
+ boolean or string for resource and subject attribute. Can be a string or an
10587
+ array of strings (for example, an array of days to permit access) for rule
10588
+ attribute.
8425
10589
  """
8426
10590
 
8427
10591
  def __init__(
@@ -8433,13 +10597,13 @@ class V2PolicySubjectAttribute:
8433
10597
  """
8434
10598
  Initialize a V2PolicySubjectAttribute object.
8435
10599
 
8436
- :param str key: The name of a subject attribute, e.g., iam_id,
10600
+ :param str key: The name of a subject attribute. For example, iam_id,
8437
10601
  access_group_id.
8438
10602
  :param str operator: The operator of an attribute.
8439
10603
  :param object value: The value of a rule, resource, or subject attribute;
8440
- can be boolean or string for resource and subject attribute. Can be string
8441
- or an array of strings (e.g., array of days to permit access) for rule
8442
- attribute.
10604
+ can be boolean or string for resource and subject attribute. Can be a
10605
+ string or an array of strings (for example, an array of days to permit
10606
+ access) for rule attribute.
8443
10607
  """
8444
10608
  self.key = key
8445
10609
  self.operator = operator
@@ -8527,11 +10691,11 @@ class V2PolicyTemplateMetaData:
8527
10691
  :param ControlResponse control:
8528
10692
  :param datetime created_at: (optional) The UTC timestamp when the policy was
8529
10693
  created.
8530
- :param str created_by_id: (optional) The iam ID of the entity that created the
10694
+ :param str created_by_id: (optional) The IAM ID of the entity that created the
8531
10695
  policy.
8532
10696
  :param datetime last_modified_at: (optional) The UTC timestamp when the policy
8533
10697
  was last modified.
8534
- :param str last_modified_by_id: (optional) The iam ID of the entity that last
10698
+ :param str last_modified_by_id: (optional) The IAM ID of the entity that last
8535
10699
  modified the policy.
8536
10700
  :param str state: The policy state, either 'deleted' or 'active'.
8537
10701
  :param str last_permit_at: (optional) The optional last permit time of policy,
@@ -8752,9 +10916,9 @@ class V2PolicyTemplateMetaData:
8752
10916
 
8753
10917
  class ControlResponseControl(ControlResponse):
8754
10918
  """
8755
- Specifies the type of access granted by the policy.
10919
+ Specifies the type of access that is granted by the policy.
8756
10920
 
8757
- :param Grant grant: Permission granted by the policy.
10921
+ :param Grant grant: Permission is granted by the policy.
8758
10922
  """
8759
10923
 
8760
10924
  def __init__(
@@ -8764,7 +10928,7 @@ class ControlResponseControl(ControlResponse):
8764
10928
  """
8765
10929
  Initialize a ControlResponseControl object.
8766
10930
 
8767
- :param Grant grant: Permission granted by the policy.
10931
+ :param Grant grant: Permission is granted by the policy.
8768
10932
  """
8769
10933
  # pylint: disable=super-init-not-called
8770
10934
  self.grant = grant
@@ -8815,7 +10979,8 @@ class ControlResponseControl(ControlResponse):
8815
10979
 
8816
10980
  class ControlResponseControlWithEnrichedRoles(ControlResponse):
8817
10981
  """
8818
- Specifies the type of access granted by the policy with additional role information.
10982
+ Specifies the type of access that is granted by the policy with additional role
10983
+ information.
8819
10984
 
8820
10985
  :param GrantWithEnrichedRoles grant: Permission granted by the policy with
8821
10986
  translated roles and additional role information.
@@ -8880,13 +11045,15 @@ class ControlResponseControlWithEnrichedRoles(ControlResponse):
8880
11045
 
8881
11046
  class NestedConditionRuleAttribute(NestedCondition):
8882
11047
  """
8883
- Rule that specifies additional access granted (e.g., time-based condition).
11048
+ Rule that specifies additional access that is granted (For example, time-based
11049
+ condition).
8884
11050
 
8885
11051
  :param str key: The name of an attribute.
8886
11052
  :param str operator: The operator of an attribute.
8887
11053
  :param object value: The value of a rule, resource, or subject attribute; can be
8888
- boolean or string for resource and subject attribute. Can be string or an array
8889
- of strings (e.g., array of days to permit access) for rule attribute.
11054
+ boolean or string for resource and subject attribute. Can be a string or an
11055
+ array of strings (for example, an array of days to permit access) for rule
11056
+ attribute.
8890
11057
  """
8891
11058
 
8892
11059
  def __init__(
@@ -8901,9 +11068,9 @@ class NestedConditionRuleAttribute(NestedCondition):
8901
11068
  :param str key: The name of an attribute.
8902
11069
  :param str operator: The operator of an attribute.
8903
11070
  :param object value: The value of a rule, resource, or subject attribute;
8904
- can be boolean or string for resource and subject attribute. Can be string
8905
- or an array of strings (e.g., array of days to permit access) for rule
8906
- attribute.
11071
+ can be boolean or string for resource and subject attribute. Can be a
11072
+ string or an array of strings (for example, an array of days to permit
11073
+ access) for rule attribute.
8907
11074
  """
8908
11075
  # pylint: disable=super-init-not-called
8909
11076
  self.key = key
@@ -8990,12 +11157,12 @@ class NestedConditionRuleAttribute(NestedCondition):
8990
11157
 
8991
11158
  class NestedConditionRuleWithConditions(NestedCondition):
8992
11159
  """
8993
- Rule that specifies additional access granted (e.g., time-based condition) accross
8994
- multiple conditions.
11160
+ Rule that specifies additional access that is granted (for example, time-based
11161
+ condition) accross multiple conditions.
8995
11162
 
8996
11163
  :param str operator: Operator to evaluate conditions.
8997
11164
  :param List[RuleAttribute] conditions: List of conditions associated with a
8998
- policy, e.g., time-based conditions that grant access over a certain time
11165
+ policy. For example, time-based conditions that grant access over a certain time
8999
11166
  period.
9000
11167
  """
9001
11168
 
@@ -9009,8 +11176,8 @@ class NestedConditionRuleWithConditions(NestedCondition):
9009
11176
 
9010
11177
  :param str operator: Operator to evaluate conditions.
9011
11178
  :param List[RuleAttribute] conditions: List of conditions associated with a
9012
- policy, e.g., time-based conditions that grant access over a certain time
9013
- period.
11179
+ policy. For example, time-based conditions that grant access over a certain
11180
+ time period.
9014
11181
  """
9015
11182
  # pylint: disable=super-init-not-called
9016
11183
  self.operator = operator
@@ -9081,38 +11248,40 @@ class PolicyTemplateAssignmentItemsPolicyAssignment(PolicyTemplateAssignmentItem
9081
11248
  """
9082
11249
  The set of properties associated with the policy template assignment.
9083
11250
 
9084
- :param str template_id: (optional) policy template id.
9085
- :param str template_version: (optional) policy template version.
11251
+ :param str template_id: policy template ID.
11252
+ :param str template_version: policy template version.
9086
11253
  :param str assignment_id: (optional) Passed in value to correlate with other
9087
11254
  assignments.
9088
- :param str target_type: (optional) Assignment target type.
9089
- :param str target: (optional) ID of the target account.
11255
+ :param str target_type: Assignment target type.
11256
+ :param str target: ID of the target account.
9090
11257
  :param str id: (optional) Policy assignment ID.
9091
11258
  :param str account_id: (optional) The account GUID that the policies assignments
9092
- belong to..
11259
+ belong to.
9093
11260
  :param str href: (optional) The href URL that links to the policies assignments
9094
11261
  API by policy assignment ID.
9095
11262
  :param datetime created_at: (optional) The UTC timestamp when the policy
9096
11263
  assignment was created.
9097
- :param str created_by_id: (optional) The iam ID of the entity that created the
11264
+ :param str created_by_id: (optional) The IAM ID of the entity that created the
9098
11265
  policy assignment.
9099
11266
  :param datetime last_modified_at: (optional) The UTC timestamp when the policy
9100
11267
  assignment was last modified.
9101
- :param str last_modified_by_id: (optional) The iam ID of the entity that last
11268
+ :param str last_modified_by_id: (optional) The IAM ID of the entity that last
9102
11269
  modified the policy assignment.
9103
- :param List[PolicyAssignmentResources] resources: (optional) Object for each
9104
- account assigned.
9105
- :param str status: (optional) The policy assignment status.
11270
+ :param List[PolicyAssignmentResources] resources: Object for each account
11271
+ assigned.
11272
+ :param str status: The policy assignment status.
9106
11273
  """
9107
11274
 
9108
11275
  def __init__(
9109
11276
  self,
11277
+ template_id: str,
11278
+ template_version: str,
11279
+ target_type: str,
11280
+ target: str,
11281
+ resources: List['PolicyAssignmentResources'],
11282
+ status: str,
9110
11283
  *,
9111
- template_id: Optional[str] = None,
9112
- template_version: Optional[str] = None,
9113
11284
  assignment_id: Optional[str] = None,
9114
- target_type: Optional[str] = None,
9115
- target: Optional[str] = None,
9116
11285
  id: Optional[str] = None,
9117
11286
  account_id: Optional[str] = None,
9118
11287
  href: Optional[str] = None,
@@ -9120,21 +11289,19 @@ class PolicyTemplateAssignmentItemsPolicyAssignment(PolicyTemplateAssignmentItem
9120
11289
  created_by_id: Optional[str] = None,
9121
11290
  last_modified_at: Optional[datetime] = None,
9122
11291
  last_modified_by_id: Optional[str] = None,
9123
- resources: Optional[List['PolicyAssignmentResources']] = None,
9124
- status: Optional[str] = None,
9125
11292
  ) -> None:
9126
11293
  """
9127
11294
  Initialize a PolicyTemplateAssignmentItemsPolicyAssignment object.
9128
11295
 
9129
- :param str template_id: (optional) policy template id.
9130
- :param str template_version: (optional) policy template version.
11296
+ :param str template_id: policy template ID.
11297
+ :param str template_version: policy template version.
11298
+ :param str target_type: Assignment target type.
11299
+ :param str target: ID of the target account.
11300
+ :param List[PolicyAssignmentResources] resources: Object for each account
11301
+ assigned.
11302
+ :param str status: The policy assignment status.
9131
11303
  :param str assignment_id: (optional) Passed in value to correlate with
9132
11304
  other assignments.
9133
- :param str target_type: (optional) Assignment target type.
9134
- :param str target: (optional) ID of the target account.
9135
- :param List[PolicyAssignmentResources] resources: (optional) Object for
9136
- each account assigned.
9137
- :param str status: (optional) The policy assignment status.
9138
11305
  """
9139
11306
  # pylint: disable=super-init-not-called
9140
11307
  self.template_id = template_id
@@ -9158,14 +11325,30 @@ class PolicyTemplateAssignmentItemsPolicyAssignment(PolicyTemplateAssignmentItem
9158
11325
  args = {}
9159
11326
  if (template_id := _dict.get('template_id')) is not None:
9160
11327
  args['template_id'] = template_id
11328
+ else:
11329
+ raise ValueError(
11330
+ 'Required property \'template_id\' not present in PolicyTemplateAssignmentItemsPolicyAssignment JSON'
11331
+ )
9161
11332
  if (template_version := _dict.get('template_version')) is not None:
9162
11333
  args['template_version'] = template_version
11334
+ else:
11335
+ raise ValueError(
11336
+ 'Required property \'template_version\' not present in PolicyTemplateAssignmentItemsPolicyAssignment JSON'
11337
+ )
9163
11338
  if (assignment_id := _dict.get('assignment_id')) is not None:
9164
11339
  args['assignment_id'] = assignment_id
9165
11340
  if (target_type := _dict.get('target_type')) is not None:
9166
11341
  args['target_type'] = target_type
11342
+ else:
11343
+ raise ValueError(
11344
+ 'Required property \'target_type\' not present in PolicyTemplateAssignmentItemsPolicyAssignment JSON'
11345
+ )
9167
11346
  if (target := _dict.get('target')) is not None:
9168
11347
  args['target'] = target
11348
+ else:
11349
+ raise ValueError(
11350
+ 'Required property \'target\' not present in PolicyTemplateAssignmentItemsPolicyAssignment JSON'
11351
+ )
9169
11352
  if (id := _dict.get('id')) is not None:
9170
11353
  args['id'] = id
9171
11354
  if (account_id := _dict.get('account_id')) is not None:
@@ -9182,8 +11365,16 @@ class PolicyTemplateAssignmentItemsPolicyAssignment(PolicyTemplateAssignmentItem
9182
11365
  args['last_modified_by_id'] = last_modified_by_id
9183
11366
  if (resources := _dict.get('resources')) is not None:
9184
11367
  args['resources'] = [PolicyAssignmentResources.from_dict(v) for v in resources]
11368
+ else:
11369
+ raise ValueError(
11370
+ 'Required property \'resources\' not present in PolicyTemplateAssignmentItemsPolicyAssignment JSON'
11371
+ )
9185
11372
  if (status := _dict.get('status')) is not None:
9186
11373
  args['status'] = status
11374
+ else:
11375
+ raise ValueError(
11376
+ 'Required property \'status\' not present in PolicyTemplateAssignmentItemsPolicyAssignment JSON'
11377
+ )
9187
11378
  return cls(**args)
9188
11379
 
9189
11380
  @classmethod
@@ -9254,6 +11445,8 @@ class PolicyTemplateAssignmentItemsPolicyAssignment(PolicyTemplateAssignmentItem
9254
11445
  """
9255
11446
 
9256
11447
  ACCOUNT = 'Account'
11448
+ ACCOUNTGROUP = 'AccountGroup'
11449
+ ENTERPRISE = 'Enterprise'
9257
11450
 
9258
11451
  class StatusEnum(str, Enum):
9259
11452
  """
@@ -9273,20 +11466,20 @@ class PolicyTemplateAssignmentItemsPolicyAssignmentV1(PolicyTemplateAssignmentIt
9273
11466
  :param AssignmentTargetDetails target: assignment target account and type.
9274
11467
  :param str id: (optional) Policy assignment ID.
9275
11468
  :param str account_id: (optional) The account GUID that the policies assignments
9276
- belong to..
11469
+ belong to.
9277
11470
  :param str href: (optional) The href URL that links to the policies assignments
9278
11471
  API by policy assignment ID.
9279
11472
  :param datetime created_at: (optional) The UTC timestamp when the policy
9280
11473
  assignment was created.
9281
- :param str created_by_id: (optional) The iam ID of the entity that created the
11474
+ :param str created_by_id: (optional) The IAM ID of the entity that created the
9282
11475
  policy assignment.
9283
11476
  :param datetime last_modified_at: (optional) The UTC timestamp when the policy
9284
11477
  assignment was last modified.
9285
- :param str last_modified_by_id: (optional) The iam ID of the entity that last
11478
+ :param str last_modified_by_id: (optional) The IAM ID of the entity that last
9286
11479
  modified the policy assignment.
9287
11480
  :param List[PolicyAssignmentV1Resources] resources: Object for each account
9288
11481
  assigned.
9289
- :param PolicyAssignmentV1Subject subject: (optional) subject details of access
11482
+ :param PolicyAssignmentV1Subject subject: (optional) Subject details of access
9290
11483
  type assignment.
9291
11484
  :param AssignmentTemplateDetails template: policy template details.
9292
11485
  :param str status: The policy assignment status.
@@ -9316,7 +11509,7 @@ class PolicyTemplateAssignmentItemsPolicyAssignmentV1(PolicyTemplateAssignmentIt
9316
11509
  assigned.
9317
11510
  :param AssignmentTemplateDetails template: policy template details.
9318
11511
  :param str status: The policy assignment status.
9319
- :param PolicyAssignmentV1Subject subject: (optional) subject details of
11512
+ :param PolicyAssignmentV1Subject subject: (optional) Subject details of
9320
11513
  access type assignment.
9321
11514
  """
9322
11515
  # pylint: disable=super-init-not-called
@@ -9459,13 +11652,15 @@ class PolicyTemplateAssignmentItemsPolicyAssignmentV1(PolicyTemplateAssignmentIt
9459
11652
 
9460
11653
  class V2PolicyRuleRuleAttribute(V2PolicyRule):
9461
11654
  """
9462
- Rule that specifies additional access granted (e.g., time-based condition).
11655
+ Rule that specifies additional access that is granted (For example, time-based
11656
+ condition).
9463
11657
 
9464
11658
  :param str key: The name of an attribute.
9465
11659
  :param str operator: The operator of an attribute.
9466
11660
  :param object value: The value of a rule, resource, or subject attribute; can be
9467
- boolean or string for resource and subject attribute. Can be string or an array
9468
- of strings (e.g., array of days to permit access) for rule attribute.
11661
+ boolean or string for resource and subject attribute. Can be a string or an
11662
+ array of strings (for example, an array of days to permit access) for rule
11663
+ attribute.
9469
11664
  """
9470
11665
 
9471
11666
  def __init__(
@@ -9480,9 +11675,9 @@ class V2PolicyRuleRuleAttribute(V2PolicyRule):
9480
11675
  :param str key: The name of an attribute.
9481
11676
  :param str operator: The operator of an attribute.
9482
11677
  :param object value: The value of a rule, resource, or subject attribute;
9483
- can be boolean or string for resource and subject attribute. Can be string
9484
- or an array of strings (e.g., array of days to permit access) for rule
9485
- attribute.
11678
+ can be boolean or string for resource and subject attribute. Can be a
11679
+ string or an array of strings (for example, an array of days to permit
11680
+ access) for rule attribute.
9486
11681
  """
9487
11682
  # pylint: disable=super-init-not-called
9488
11683
  self.key = key
@@ -9569,12 +11764,12 @@ class V2PolicyRuleRuleAttribute(V2PolicyRule):
9569
11764
 
9570
11765
  class V2PolicyRuleRuleWithNestedConditions(V2PolicyRule):
9571
11766
  """
9572
- Rule that specifies additional access granted (e.g., time-based condition) accross
9573
- multiple conditions.
11767
+ Rule that specifies additional access that is granted (for example, time-based
11768
+ condition) accross multiple conditions.
9574
11769
 
9575
11770
  :param str operator: Operator to evaluate conditions.
9576
11771
  :param List[NestedCondition] conditions: List of conditions associated with a
9577
- policy, e.g., time-based conditions that grant access over a certain time
11772
+ policy. For example, time-based conditions that grant access over a certain time
9578
11773
  period.
9579
11774
  """
9580
11775
 
@@ -9588,8 +11783,8 @@ class V2PolicyRuleRuleWithNestedConditions(V2PolicyRule):
9588
11783
 
9589
11784
  :param str operator: Operator to evaluate conditions.
9590
11785
  :param List[NestedCondition] conditions: List of conditions associated with
9591
- a policy, e.g., time-based conditions that grant access over a certain time
9592
- period.
11786
+ a policy. For example, time-based conditions that grant access over a
11787
+ certain time period.
9593
11788
  """
9594
11789
  # pylint: disable=super-init-not-called
9595
11790
  self.operator = operator
@@ -9719,7 +11914,7 @@ class PoliciesPager:
9719
11914
  :param str state: (optional) The state of the policy.
9720
11915
  * `active` - returns active policies
9721
11916
  * `deleted` - returns non-active policies.
9722
- :param int limit: (optional) The number of documents to include in
11917
+ :param int limit: (optional) The number of documents to include in the
9723
11918
  collection.
9724
11919
  """
9725
11920
  self._has_next = True
@@ -9860,7 +12055,7 @@ class V2PoliciesPager:
9860
12055
  :param str state: (optional) The state of the policy.
9861
12056
  * `active` - returns active policies
9862
12057
  * `deleted` - returns non-active policies.
9863
- :param int limit: (optional) The number of documents to include in
12058
+ :param int limit: (optional) The number of documents to include in the
9864
12059
  collection.
9865
12060
  """
9866
12061
  self._has_next = True
@@ -9975,7 +12170,7 @@ class PolicyTemplatesPager:
9975
12170
  :param str policy_service_name: (optional) Service name, Optional.
9976
12171
  :param str policy_service_group_id: (optional) Service group id, Optional.
9977
12172
  :param str policy_type: (optional) Policy type, Optional.
9978
- :param int limit: (optional) The number of documents to include in
12173
+ :param int limit: (optional) The number of documents to include in the
9979
12174
  collection.
9980
12175
  """
9981
12176
  self._has_next = True
@@ -10060,7 +12255,7 @@ class PolicyTemplateVersionsPager:
10060
12255
  Initialize a PolicyTemplateVersionsPager object.
10061
12256
  :param str policy_template_id: The policy template ID.
10062
12257
  :param str state: (optional) The policy template state.
10063
- :param int limit: (optional) The number of documents to include in
12258
+ :param int limit: (optional) The number of documents to include in the
10064
12259
  collection.
10065
12260
  """
10066
12261
  self._has_next = True
@@ -10150,7 +12345,7 @@ class PolicyAssignmentsPager:
10150
12345
  * `zh-tw` - (Chinese, Taiwan).
10151
12346
  :param str template_id: (optional) Optional template id.
10152
12347
  :param str template_version: (optional) Optional policy template version.
10153
- :param int limit: (optional) The number of documents to include in
12348
+ :param int limit: (optional) The number of documents to include in the
10154
12349
  collection.
10155
12350
  """
10156
12351
  self._has_next = True
@@ -10210,3 +12405,255 @@ class PolicyAssignmentsPager:
10210
12405
  next_page = self.get_next()
10211
12406
  results.extend(next_page)
10212
12407
  return results
12408
+
12409
+
12410
+ class ActionControlTemplatesPager:
12411
+ """
12412
+ ActionControlTemplatesPager can be used to simplify the use of the "list_action_control_templates" method.
12413
+ """
12414
+
12415
+ def __init__(
12416
+ self,
12417
+ *,
12418
+ client: IamPolicyManagementV1,
12419
+ account_id: str,
12420
+ accept_language: str = None,
12421
+ limit: int = None,
12422
+ ) -> None:
12423
+ """
12424
+ Initialize a ActionControlTemplatesPager object.
12425
+ :param str account_id: The account GUID that the action control templates
12426
+ belong to.
12427
+ :param str accept_language: (optional) Language code for translations
12428
+ * `default` - English
12429
+ * `de` - German (Standard)
12430
+ * `en` - English
12431
+ * `es` - Spanish (Spain)
12432
+ * `fr` - French (Standard)
12433
+ * `it` - Italian (Standard)
12434
+ * `ja` - Japanese
12435
+ * `ko` - Korean
12436
+ * `pt-br` - Portuguese (Brazil)
12437
+ * `zh-cn` - Chinese (Simplified, PRC)
12438
+ * `zh-tw` - (Chinese, Taiwan).
12439
+ :param int limit: (optional) The number of documents to include in the
12440
+ collection.
12441
+ """
12442
+ self._has_next = True
12443
+ self._client = client
12444
+ self._page_context = {'next': None}
12445
+ self._account_id = account_id
12446
+ self._accept_language = accept_language
12447
+ self._limit = limit
12448
+
12449
+ def has_next(self) -> bool:
12450
+ """
12451
+ Returns true if there are potentially more results to be retrieved.
12452
+ """
12453
+ return self._has_next
12454
+
12455
+ def get_next(self) -> List[dict]:
12456
+ """
12457
+ Returns the next page of results.
12458
+ :return: A List[dict], where each element is a dict that represents an instance of ActionControlTemplate.
12459
+ :rtype: List[dict]
12460
+ """
12461
+ if not self.has_next():
12462
+ raise StopIteration(message='No more results available')
12463
+
12464
+ result = self._client.list_action_control_templates(
12465
+ account_id=self._account_id,
12466
+ accept_language=self._accept_language,
12467
+ limit=self._limit,
12468
+ start=self._page_context.get('next'),
12469
+ ).get_result()
12470
+
12471
+ next = None
12472
+ next_page_link = result.get('next')
12473
+ if next_page_link is not None:
12474
+ next = next_page_link.get('start')
12475
+ self._page_context['next'] = next
12476
+ if next is None:
12477
+ self._has_next = False
12478
+
12479
+ return result.get('action_control_templates')
12480
+
12481
+ def get_all(self) -> List[dict]:
12482
+ """
12483
+ Returns all results by invoking get_next() repeatedly
12484
+ until all pages of results have been retrieved.
12485
+ :return: A List[dict], where each element is a dict that represents an instance of ActionControlTemplate.
12486
+ :rtype: List[dict]
12487
+ """
12488
+ results = []
12489
+ while self.has_next():
12490
+ next_page = self.get_next()
12491
+ results.extend(next_page)
12492
+ return results
12493
+
12494
+
12495
+ class ActionControlTemplateVersionsPager:
12496
+ """
12497
+ ActionControlTemplateVersionsPager can be used to simplify the use of the "list_action_control_template_versions" method.
12498
+ """
12499
+
12500
+ def __init__(
12501
+ self,
12502
+ *,
12503
+ client: IamPolicyManagementV1,
12504
+ action_control_template_id: str,
12505
+ state: str = None,
12506
+ limit: int = None,
12507
+ ) -> None:
12508
+ """
12509
+ Initialize a ActionControlTemplateVersionsPager object.
12510
+ :param str action_control_template_id: The action control template ID.
12511
+ :param str state: (optional) Action control template state.
12512
+ :param int limit: (optional) The number of documents to include in the
12513
+ collection.
12514
+ """
12515
+ self._has_next = True
12516
+ self._client = client
12517
+ self._page_context = {'next': None}
12518
+ self._action_control_template_id = action_control_template_id
12519
+ self._state = state
12520
+ self._limit = limit
12521
+
12522
+ def has_next(self) -> bool:
12523
+ """
12524
+ Returns true if there are potentially more results to be retrieved.
12525
+ """
12526
+ return self._has_next
12527
+
12528
+ def get_next(self) -> List[dict]:
12529
+ """
12530
+ Returns the next page of results.
12531
+ :return: A List[dict], where each element is a dict that represents an instance of ActionControlTemplate.
12532
+ :rtype: List[dict]
12533
+ """
12534
+ if not self.has_next():
12535
+ raise StopIteration(message='No more results available')
12536
+
12537
+ result = self._client.list_action_control_template_versions(
12538
+ action_control_template_id=self._action_control_template_id,
12539
+ state=self._state,
12540
+ limit=self._limit,
12541
+ start=self._page_context.get('next'),
12542
+ ).get_result()
12543
+
12544
+ next = None
12545
+ next_page_link = result.get('next')
12546
+ if next_page_link is not None:
12547
+ next = next_page_link.get('start')
12548
+ self._page_context['next'] = next
12549
+ if next is None:
12550
+ self._has_next = False
12551
+
12552
+ return result.get('versions')
12553
+
12554
+ def get_all(self) -> List[dict]:
12555
+ """
12556
+ Returns all results by invoking get_next() repeatedly
12557
+ until all pages of results have been retrieved.
12558
+ :return: A List[dict], where each element is a dict that represents an instance of ActionControlTemplate.
12559
+ :rtype: List[dict]
12560
+ """
12561
+ results = []
12562
+ while self.has_next():
12563
+ next_page = self.get_next()
12564
+ results.extend(next_page)
12565
+ return results
12566
+
12567
+
12568
+ class ActionControlAssignmentsPager:
12569
+ """
12570
+ ActionControlAssignmentsPager can be used to simplify the use of the "list_action_control_assignments" method.
12571
+ """
12572
+
12573
+ def __init__(
12574
+ self,
12575
+ *,
12576
+ client: IamPolicyManagementV1,
12577
+ account_id: str,
12578
+ accept_language: str = None,
12579
+ template_id: str = None,
12580
+ template_version: str = None,
12581
+ limit: int = None,
12582
+ ) -> None:
12583
+ """
12584
+ Initialize a ActionControlAssignmentsPager object.
12585
+ :param str account_id: The account GUID in which the action control
12586
+ assignment belongs to.
12587
+ :param str accept_language: (optional) Language code for translations
12588
+ * `default` - English
12589
+ * `de` - German (Standard)
12590
+ * `en` - English
12591
+ * `es` - Spanish (Spain)
12592
+ * `fr` - French (Standard)
12593
+ * `it` - Italian (Standard)
12594
+ * `ja` - Japanese
12595
+ * `ko` - Korean
12596
+ * `pt-br` - Portuguese (Brazil)
12597
+ * `zh-cn` - Chinese (Simplified, PRC)
12598
+ * `zh-tw` - (Chinese, Taiwan).
12599
+ :param str template_id: (optional) Optional template ID.
12600
+ :param str template_version: (optional) Optional action control template
12601
+ version.
12602
+ :param int limit: (optional) The number of documents to include in the
12603
+ collection.
12604
+ """
12605
+ self._has_next = True
12606
+ self._client = client
12607
+ self._page_context = {'next': None}
12608
+ self._account_id = account_id
12609
+ self._accept_language = accept_language
12610
+ self._template_id = template_id
12611
+ self._template_version = template_version
12612
+ self._limit = limit
12613
+
12614
+ def has_next(self) -> bool:
12615
+ """
12616
+ Returns true if there are potentially more results to be retrieved.
12617
+ """
12618
+ return self._has_next
12619
+
12620
+ def get_next(self) -> List[dict]:
12621
+ """
12622
+ Returns the next page of results.
12623
+ :return: A List[dict], where each element is a dict that represents an instance of ActionControlAssignment.
12624
+ :rtype: List[dict]
12625
+ """
12626
+ if not self.has_next():
12627
+ raise StopIteration(message='No more results available')
12628
+
12629
+ result = self._client.list_action_control_assignments(
12630
+ account_id=self._account_id,
12631
+ accept_language=self._accept_language,
12632
+ template_id=self._template_id,
12633
+ template_version=self._template_version,
12634
+ limit=self._limit,
12635
+ start=self._page_context.get('next'),
12636
+ ).get_result()
12637
+
12638
+ next = None
12639
+ next_page_link = result.get('next')
12640
+ if next_page_link is not None:
12641
+ next = next_page_link.get('start')
12642
+ self._page_context['next'] = next
12643
+ if next is None:
12644
+ self._has_next = False
12645
+
12646
+ return result.get('assignments')
12647
+
12648
+ def get_all(self) -> List[dict]:
12649
+ """
12650
+ Returns all results by invoking get_next() repeatedly
12651
+ until all pages of results have been retrieved.
12652
+ :return: A List[dict], where each element is a dict that represents an instance of ActionControlAssignment.
12653
+ :rtype: List[dict]
12654
+ """
12655
+ results = []
12656
+ while self.has_next():
12657
+ next_page = self.get_next()
12658
+ results.extend(next_page)
12659
+ return results