deleteAgent method

Future<void> deleteAgent({
  1. required String agentArn,
})

Deletes an agent. To specify which agent to delete, use the Amazon Resource Name (ARN) of the agent in your request. The operation disassociates the agent from your AWS account. However, it doesn't delete the agent virtual machine (VM) from your on-premises environment.

May throw InvalidRequestException. May throw InternalException.

Parameter agentArn : The Amazon Resource Name (ARN) of the agent to delete. Use the ListAgents operation to return a list of agents for your account and AWS Region.

Implementation

Future<void> deleteAgent({
  required String agentArn,
}) async {
  ArgumentError.checkNotNull(agentArn, 'agentArn');
  _s.validateStringLength(
    'agentArn',
    agentArn,
    0,
    128,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'FmrsService.DeleteAgent'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AgentArn': agentArn,
    },
  );
}