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 AccessDeniedException. May throw FacetNotFoundException. May throw FacetValidationException. May throw InternalServiceException. May throw InvalidArnException. May throw InvalidFacetUpdateException. May throw InvalidRuleException. May throw LimitExceededException. May throw ResourceNotFoundException. May throw RetryableConflictException. May throw ValidationException.

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 {
  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.value,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/amazonclouddirectory/2017-01-11/facet',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
}