putEntityType method

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

Creates or updates an entity type. An entity represents who is performing the event. As part of a fraud prediction, you pass the entity ID to indicate the specific entity who performed the event. An entity type classifies the entity. Example classifications include customer, merchant, or account.

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

Parameter name : The name of the entity type.

Parameter description : The description.

Parameter tags : A collection of key and value pairs.

Implementation

Future<void> putEntityType({
  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.PutEntityType'
  };
  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,
    },
  );
}