createAgentStatus method
Creates an agent status for the specified Connect Customer instance.
May throw DuplicateResourceException.
May throw InternalServiceException.
May throw InvalidParameterException.
May throw InvalidRequestException.
May throw LimitExceededException.
May throw ResourceNotFoundException.
May throw ThrottlingException.
Parameter instanceId :
The identifier of the Connect Customer instance. You can find
the instance ID in the Amazon Resource Name (ARN) of the instance.
Parameter name :
The name of the status.
Parameter state :
The state of the status.
Parameter description :
The description of the status.
Parameter displayOrder :
The display order of the status.
Parameter tags :
The tags used to organize, track, or control access for this resource. For
example, { "Tags": {"key1":"value1", "key2":"value2"} }.
Implementation
Future<CreateAgentStatusResponse> createAgentStatus({
required String instanceId,
required String name,
required AgentStatusState state,
String? description,
int? displayOrder,
Map<String, String>? tags,
}) async {
_s.validateNumRange(
'displayOrder',
displayOrder,
1,
50,
);
final $payload = <String, dynamic>{
'Name': name,
'State': state.value,
if (description != null) 'Description': description,
if (displayOrder != null) 'DisplayOrder': displayOrder,
if (tags != null) 'Tags': tags,
};
final response = await _protocol.send(
payload: $payload,
method: 'PUT',
requestUri: '/agent-status/${Uri.encodeComponent(instanceId)}',
exceptionFnMap: _exceptionFns,
);
return CreateAgentStatusResponse.fromJson(response);
}