updateAgent method

Future<void> updateAgent({
  1. required String agentArn,
  2. String? name,
})

Updates the name of an DataSync agent.

May throw InternalException. May throw InvalidRequestException.

Parameter agentArn : The Amazon Resource Name (ARN) of the agent to update.

Parameter name : The name that you want to use to configure the agent.

Implementation

Future<void> updateAgent({
  required String agentArn,
  String? name,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'FmrsService.UpdateAgent'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'AgentArn': agentArn,
      if (name != null) 'Name': name,
    },
  );
}