updateFacet method

Future<void> updateFacet({
  1. required String name,
  2. required String schemaArn,
  3. List<FacetAttributeUpdate>? attributeUpdates,
  4. ObjectType? objectType,
})

Does the following:

  1. Adds new Attributes, Rules, or ObjectTypes.
  2. Updates existing Attributes, Rules, or ObjectTypes.
  3. Deletes existing Attributes, Rules, or ObjectTypes.

May throw InternalServiceException. May throw InvalidArnException. May throw RetryableConflictException. May throw ValidationException. May throw LimitExceededException. May throw AccessDeniedException. May throw InvalidFacetUpdateException. May throw ResourceNotFoundException. May throw FacetNotFoundException. May throw InvalidRuleException.

Parameter name : The name of the facet.

Parameter schemaArn : The Amazon Resource Name (ARN) that is associated with the Facet. For more information, see arns.

Parameter attributeUpdates : List of attributes that need to be updated in a given schema Facet. Each attribute is followed by AttributeAction, which specifies the type of update operation to perform.

Parameter objectType : The object type that is associated with the facet. See CreateFacetRequest$ObjectType for more details.

Implementation

Future<void> updateFacet({
  required String name,
  required String schemaArn,
  List<FacetAttributeUpdate>? attributeUpdates,
  ObjectType? objectType,
}) async {
  ArgumentError.checkNotNull(name, 'name');
  _s.validateStringLength(
    'name',
    name,
    1,
    64,
    isRequired: true,
  );
  ArgumentError.checkNotNull(schemaArn, 'schemaArn');
  final headers = <String, String>{
    'x-amz-data-partition': schemaArn.toString(),
  };
  final $payload = <String, dynamic>{
    'Name': name,
    if (attributeUpdates != null) 'AttributeUpdates': attributeUpdates,
    if (objectType != null) 'ObjectType': objectType.toValue(),
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/amazonclouddirectory/2017-01-11/facet',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
}