addFacetToObject method

Future<void> addFacetToObject({
  1. required String directoryArn,
  2. required ObjectReference objectReference,
  3. required SchemaFacet schemaFacet,
  4. List<AttributeKeyAndValue>? objectAttributeList,
})

Adds a new Facet to an object. An object can have more than one facet applied on it.

May throw InternalServiceException. May throw InvalidArnException. May throw RetryableConflictException. May throw ValidationException. May throw LimitExceededException. May throw AccessDeniedException. May throw DirectoryNotEnabledException. May throw ResourceNotFoundException. May throw FacetValidationException.

Parameter directoryArn : The Amazon Resource Name (ARN) that is associated with the Directory where the object resides. For more information, see arns.

Parameter objectReference : A reference to the object you are adding the specified facet to.

Parameter schemaFacet : Identifiers for the facet that you are adding to the object. See SchemaFacet for details.

Parameter objectAttributeList : Attributes on the facet that you are adding to the object.

Implementation

Future<void> addFacetToObject({
  required String directoryArn,
  required ObjectReference objectReference,
  required SchemaFacet schemaFacet,
  List<AttributeKeyAndValue>? objectAttributeList,
}) async {
  ArgumentError.checkNotNull(directoryArn, 'directoryArn');
  ArgumentError.checkNotNull(objectReference, 'objectReference');
  ArgumentError.checkNotNull(schemaFacet, 'schemaFacet');
  final headers = <String, String>{
    'x-amz-data-partition': directoryArn.toString(),
  };
  final $payload = <String, dynamic>{
    'ObjectReference': objectReference,
    'SchemaFacet': schemaFacet,
    if (objectAttributeList != null)
      'ObjectAttributeList': objectAttributeList,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/amazonclouddirectory/2017-01-11/object/facets',
    headers: headers,
    exceptionFnMap: _exceptionFns,
  );
}