createApprovalTeam method
Creates a new approval team. For more information, see Approval team in the Multi-party approval User Guide.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter approvalStrategy :
An ApprovalStrategy object. Contains details for how the team
grants approval.
Parameter approvers :
An array of ApprovalTeamRequesterApprovers objects. Contains
details for the approvers in the team.
Parameter description :
Description for the team.
Parameter name :
Name of the team.
Parameter policies :
An array of PolicyReference objects. Contains a list of
policies that define the permissions for team resources.
Parameter clientToken :
Unique, case-sensitive identifier that you provide to ensure the
idempotency of the request. If not provided, the Amazon Web Services
populates this field.
When you make a mutating API request, the request typically returns a result before the operation's asynchronous workflows have completed. Operations might also time out or encounter other server issues before they complete, even though the request has already returned a result. This could make it difficult to determine whether the request succeeded or not, and could lead to multiple retries to ensure that the operation completes successfully. However, if the original request and the subsequent retries are successful, the operation is completed multiple times. This means that you might create more resources than you intended.
Idempotency ensures that an API request completes no more than one time. With an idempotent request, if the original request completes successfully, any subsequent retries complete successfully without performing any further actions.
Parameter tags :
Tags you want to attach to the team.
Implementation
Future<CreateApprovalTeamResponse> createApprovalTeam({
required ApprovalStrategy approvalStrategy,
required List<ApprovalTeamRequestApprover> approvers,
required String description,
required String name,
required List<PolicyReference> policies,
String? clientToken,
Map<String, String>? tags,
}) async {
final $payload = <String, dynamic>{
'ApprovalStrategy': approvalStrategy,
'Approvers': approvers,
'Description': description,
'Name': name,
'Policies': policies,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'POST',
requestUri: '/approval-teams',
exceptionFnMap: _exceptionFns,
);
return CreateApprovalTeamResponse.fromJson(response);
}