putEventType method

Future<void> putEventType({
  1. required List<String> entityTypes,
  2. required List<String> eventVariables,
  3. required String name,
  4. String? description,
  5. List<String>? labels,
  6. List<Tag>? tags,
})

Creates or updates an event type. An event is a business activity that is evaluated for fraud risk. With Amazon Fraud Detector, you generate fraud predictions for events. An event type defines the structure for an event sent to Amazon Fraud Detector. This includes the variables sent as part of the event, the entity performing the event (such as a customer), and the labels that classify the event. Example event types include online payment transactions, account registrations, and authentications.

May throw ValidationException. May throw InternalServerException. May throw AccessDeniedException.

Parameter entityTypes : The entity type for the event type. Example entity types: customer, merchant, account.

Parameter eventVariables : The event type variables.

Parameter name : The name.

Parameter description : The description of the event type.

Parameter labels : The event type labels.

Parameter tags : A collection of key and value pairs.

Implementation

Future<void> putEventType({
  required List<String> entityTypes,
  required List<String> eventVariables,
  required String name,
  String? description,
  List<String>? labels,
  List<Tag>? tags,
}) async {
  ArgumentError.checkNotNull(entityTypes, 'entityTypes');
  ArgumentError.checkNotNull(eventVariables, 'eventVariables');
  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.PutEventType'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'entityTypes': entityTypes,
      'eventVariables': eventVariables,
      'name': name,
      if (description != null) 'description': description,
      if (labels != null) 'labels': labels,
      if (tags != null) 'tags': tags,
    },
  );
}