updateAgent method
Updates the name of an agent.
May throw InvalidRequestException. May throw InternalException.
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 {
ArgumentError.checkNotNull(agentArn, 'agentArn');
_s.validateStringLength(
'agentArn',
agentArn,
0,
128,
isRequired: true,
);
_s.validateStringLength(
'name',
name,
1,
256,
);
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,
},
);
}