updatePolicyStore method

Future<UpdatePolicyStoreOutput> updatePolicyStore({
  1. required String policyStoreId,
  2. required ValidationSettings validationSettings,
  3. DeletionProtection? deletionProtection,
  4. String? description,
})

Modifies the validation setting for a policy store.

May throw ConflictException. May throw ResourceNotFoundException.

Parameter policyStoreId : Specifies the ID of the policy store that you want to update

To specify a policy store, use its ID or alias name. When using an alias name, prefix it with policy-store-alias/. For example:

  • ID: PSEXAMPLEabcdefg111111
  • Alias name: policy-store-alias/example-policy-store
To view aliases, use ListPolicyStoreAliases.

Parameter validationSettings : A structure that defines the validation settings that want to enable for the policy store.

Parameter deletionProtection : Specifies whether the policy store can be deleted. If enabled, the policy store can't be deleted.

When you call UpdatePolicyStore, this parameter is unchanged unless explicitly included in the call.

Parameter description : Descriptive text that you can provide to help with identification of the current policy store.

Implementation

Future<UpdatePolicyStoreOutput> updatePolicyStore({
  required String policyStoreId,
  required ValidationSettings validationSettings,
  DeletionProtection? deletionProtection,
  String? description,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.0',
    'X-Amz-Target': 'VerifiedPermissions.UpdatePolicyStore'
  };
  final jsonResponse = await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'policyStoreId': policyStoreId,
      'validationSettings': validationSettings,
      if (deletionProtection != null)
        'deletionProtection': deletionProtection.value,
      if (description != null) 'description': description,
    },
  );

  return UpdatePolicyStoreOutput.fromJson(jsonResponse.body);
}