putLabel method

Future<void> putLabel({
  1. required String name,
  2. String? description,
  3. List<Tag>? tags,
})

Creates or updates label. A label classifies an event as fraudulent or legitimate. Labels are associated with event types and used to train supervised machine learning models in Amazon Fraud Detector.

May throw AccessDeniedException. May throw ConflictException. May throw InternalServerException. May throw ThrottlingException. May throw ValidationException.

Parameter name : The label name.

Parameter description : The label description.

Parameter tags : A collection of key and value pairs.

Implementation

Future<void> putLabel({
  required String name,
  String? description,
  List<Tag>? tags,
}) async {
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'AWSHawksNestServiceFacade.PutLabel'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'name': name,
      if (description != null) 'description': description,
      if (tags != null) 'tags': tags,
    },
  );
}