updateAgentPermissions method

Future<UpdateAgentPermissionsResponse> updateAgentPermissions({
  1. required String agentId,
  2. required String awsAccountId,
  3. List<ResourcePermission>? grantPermissions,
  4. List<ResourcePermission>? revokePermissions,
})

Updates the resource permissions for an agent.

May throw AccessDeniedException. May throw ConflictException. May throw InternalFailureException. May throw InvalidParameterValueException. May throw LimitExceededException. May throw PreconditionNotMetException. May throw ResourceNotFoundException. May throw ThrottlingException. May throw UnsupportedUserEditionException.

Parameter agentId : The unique identifier for the agent.

Parameter awsAccountId : The ID of the Amazon Web Services account that contains the agent.

Parameter grantPermissions : The resource permissions that you want to grant on the agent.

Parameter revokePermissions : The resource permissions that you want to revoke from the agent.

Implementation

Future<UpdateAgentPermissionsResponse> updateAgentPermissions({
  required String agentId,
  required String awsAccountId,
  List<ResourcePermission>? grantPermissions,
  List<ResourcePermission>? revokePermissions,
}) async {
  final $payload = <String, dynamic>{
    if (grantPermissions != null) 'GrantPermissions': grantPermissions,
    if (revokePermissions != null) 'RevokePermissions': revokePermissions,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri:
        '/accounts/${Uri.encodeComponent(awsAccountId)}/agents/${Uri.encodeComponent(agentId)}/permissions',
    exceptionFnMap: _exceptionFns,
  );
  return UpdateAgentPermissionsResponse.fromJson(response);
}