dissociateEntityFromThing method

Future<void> dissociateEntityFromThing({
  1. required EntityType entityType,
  2. required String thingName,
})

Dissociates a device entity from a concrete thing. The action takes only the type of the entity that you need to dissociate because only one entity of a particular type can be associated with a thing.

May throw InvalidRequestException. May throw ResourceNotFoundException. May throw InternalFailureException. May throw ThrottlingException.

Parameter entityType : The entity type from which to disassociate the thing.

Parameter thingName : The name of the thing to disassociate.

Implementation

Future<void> dissociateEntityFromThing({
  required EntityType entityType,
  required String thingName,
}) async {
  ArgumentError.checkNotNull(entityType, 'entityType');
  ArgumentError.checkNotNull(thingName, 'thingName');
  _s.validateStringLength(
    'thingName',
    thingName,
    1,
    128,
    isRequired: true,
  );
  final headers = <String, String>{
    'Content-Type': 'application/x-amz-json-1.1',
    'X-Amz-Target': 'IotThingsGraphFrontEndService.DissociateEntityFromThing'
  };
  await _protocol.send(
    method: 'POST',
    requestUri: '/',
    exceptionFnMap: _exceptionFns,
    // TODO queryParams
    headers: headers,
    payload: {
      'entityType': entityType.toValue(),
      'thingName': thingName,
    },
  );
}