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 ValidationException. May throw InternalServerException. May throw AccessDeniedException.

Parameter name : The label name.

Parameter description : The label description.

Parameter tags :

Implementation

Future<void> putLabel({
  required String name,
  String? description,
  List<Tag>? tags,
}) async {
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    64,
    isRequired: true,
  );
  _s.validateStringLength(
    'description',
    description,
    1,
    128,
  );
  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,
    },
  );
}