startPolicyGeneration method
- required PolicyGenerationDetails policyGenerationDetails,
- String? clientToken,
- CloudTrailDetails? cloudTrailDetails,
Starts the policy generation request.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter policyGenerationDetails :
Contains the ARN of the IAM entity (user or role) for which you are
generating a policy.
Parameter clientToken :
A unique, case-sensitive identifier that you provide to ensure the
idempotency of the request. Idempotency ensures that an API request
completes only once. With an idempotent request, if the original request
completes successfully, the subsequent retries with the same client token
return the result from the original successful request and they have no
additional effect.
If you do not specify a client token, one is automatically generated by the Amazon Web Services SDK.
Parameter cloudTrailDetails :
A CloudTrailDetails object that contains details about a
Trail that you want to analyze to generate policies.
Implementation
Future<StartPolicyGenerationResponse> startPolicyGeneration({
required PolicyGenerationDetails policyGenerationDetails,
String? clientToken,
CloudTrailDetails? cloudTrailDetails,
}) async {
final $payload = <String, dynamic>{
'policyGenerationDetails': policyGenerationDetails,
'clientToken': clientToken ?? _s.generateIdempotencyToken(),
if (cloudTrailDetails != null) 'cloudTrailDetails': cloudTrailDetails,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/policy/generation',
exceptionFnMap: _exceptionFns,
);
return StartPolicyGenerationResponse.fromJson(response);
}