createDynamicThingGroup method

Future<CreateDynamicThingGroupResponse> createDynamicThingGroup({
  1. required String queryString,
  2. required String thingGroupName,
  3. String? indexName,
  4. String? queryVersion,
  5. List<Tag>? tags,
  6. ThingGroupProperties? thingGroupProperties,
})

Creates a dynamic thing group.

Requires permission to access the CreateDynamicThingGroup action.

May throw InternalFailureException. May throw InvalidQueryException. May throw InvalidRequestException. May throw LimitExceededException. May throw ResourceAlreadyExistsException. May throw ResourceNotFoundException. May throw ThrottlingException.

Parameter queryString : The dynamic thing group search query string.

See Query Syntax for information about query string syntax.

Parameter thingGroupName : The dynamic thing group name to create.

Parameter indexName : The dynamic thing group index name.

Parameter queryVersion : The dynamic thing group query version.

Parameter tags : Metadata which can be used to manage the dynamic thing group.

Parameter thingGroupProperties : The dynamic thing group properties.

Implementation

Future<CreateDynamicThingGroupResponse> createDynamicThingGroup({
  required String queryString,
  required String thingGroupName,
  String? indexName,
  String? queryVersion,
  List<Tag>? tags,
  ThingGroupProperties? thingGroupProperties,
}) async {
  final $payload = <String, dynamic>{
    'queryString': queryString,
    if (indexName != null) 'indexName': indexName,
    if (queryVersion != null) 'queryVersion': queryVersion,
    if (tags != null) 'tags': tags,
    if (thingGroupProperties != null)
      'thingGroupProperties': thingGroupProperties,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/dynamic-thing-groups/${Uri.encodeComponent(thingGroupName)}',
    exceptionFnMap: _exceptionFns,
  );
  return CreateDynamicThingGroupResponse.fromJson(response);
}