removeThingFromThingGroup method

Future<void> removeThingFromThingGroup({
  1. String? thingArn,
  2. String? thingGroupArn,
  3. String? thingGroupName,
  4. String? thingName,
})

Remove the specified thing from the specified group.

You must specify either a thingGroupArn or a thingGroupName to identify the thing group and either a thingArn or a thingName to identify the thing to remove from the thing group.

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

Parameter thingArn : The ARN of the thing to remove from the group.

Parameter thingGroupArn : The group ARN.

Parameter thingGroupName : The group name.

Parameter thingName : The name of the thing to remove from the group.

Implementation

Future<void> removeThingFromThingGroup({
  String? thingArn,
  String? thingGroupArn,
  String? thingGroupName,
  String? thingName,
}) async {
  _s.validateStringLength(
    'thingGroupName',
    thingGroupName,
    1,
    128,
  );
  _s.validateStringLength(
    'thingName',
    thingName,
    1,
    128,
  );
  final $payload = <String, dynamic>{
    if (thingArn != null) 'thingArn': thingArn,
    if (thingGroupArn != null) 'thingGroupArn': thingGroupArn,
    if (thingGroupName != null) 'thingGroupName': thingGroupName,
    if (thingName != null) 'thingName': thingName,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'PUT',
    requestUri: '/thing-groups/removeThingFromThingGroup',
    exceptionFnMap: _exceptionFns,
  );
}