createLabelGroup method
Creates a group of labels.
May throw AccessDeniedException.
May throw ConflictException.
May throw InternalServerException.
May throw ServiceQuotaExceededException.
May throw ThrottlingException.
May throw ValidationException.
Parameter labelGroupName :
Names a group of labels.
Data in this field will be retained for service usage. Follow best practices for the security of your data.
Parameter clientToken :
A unique identifier for the request to create a label group. If you do not
set the client request token, Lookout for Equipment generates one.
Parameter faultCodes :
The acceptable fault codes (indicating the type of anomaly associated with
the label) that can be used with this label group.
Data in this field will be retained for service usage. Follow best practices for the security of your data.
Parameter tags :
Tags that provide metadata about the label group you are creating.
Data in this field will be retained for service usage. Follow best practices for the security of your data.
Implementation
Future<CreateLabelGroupResponse> createLabelGroup({
required String labelGroupName,
String? clientToken,
List<String>? faultCodes,
List<Tag>? tags,
}) async {
final headers = <String, String>{
'Content-Type': 'application/x-amz-json-1.0',
'X-Amz-Target': 'AWSLookoutEquipmentFrontendService.CreateLabelGroup'
};
final jsonResponse = await _protocol.send(
method: 'POST',
requestUri: '/',
exceptionFnMap: _exceptionFns,
// TODO queryParams
headers: headers,
payload: {
'LabelGroupName': labelGroupName,
'ClientToken': clientToken ?? _s.generateIdempotencyToken(),
if (faultCodes != null) 'FaultCodes': faultCodes,
if (tags != null) 'Tags': tags,
},
);
return CreateLabelGroupResponse.fromJson(jsonResponse.body);
}