addThingToThingGroup method

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

Adds a thing to a thing group.

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

Parameter overrideDynamicGroups : Override dynamic thing groups with static thing groups when 10-group limit is reached. If a thing belongs to 10 thing groups, and one or more of those groups are dynamic thing groups, adding a thing to a static group removes the thing from the last dynamic group.

Parameter thingArn : The ARN of the thing to add to a group.

Parameter thingGroupArn : The ARN of the group to which you are adding a thing.

Parameter thingGroupName : The name of the group to which you are adding a thing.

Parameter thingName : The name of the thing to add to a group.

Implementation

Future<void> addThingToThingGroup({
  bool? overrideDynamicGroups,
  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 (overrideDynamicGroups != null)
      'overrideDynamicGroups': overrideDynamicGroups,
    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/addThingToThingGroup',
    exceptionFnMap: _exceptionFns,
  );
}