deprecateThingType method

Future<void> deprecateThingType({
  1. required String thingTypeName,
  2. bool? undoDeprecate,
})

Deprecates a thing type. You can not associate new things with deprecated thing type.

Requires permission to access the DeprecateThingType action.

May throw InternalFailureException. May throw InvalidRequestException. May throw ResourceNotFoundException. May throw ServiceUnavailableException. May throw ThrottlingException. May throw UnauthorizedException.

Parameter thingTypeName : The name of the thing type to deprecate.

Parameter undoDeprecate : Whether to undeprecate a deprecated thing type. If true, the thing type will not be deprecated anymore and you can associate it with things.

Implementation

Future<void> deprecateThingType({
  required String thingTypeName,
  bool? undoDeprecate,
}) async {
  final $payload = <String, dynamic>{
    if (undoDeprecate != null) 'undoDeprecate': undoDeprecate,
  };
  final response = await _protocol.send(
    payload: $payload,
    method: 'POST',
    requestUri:
        '/thing-types/${Uri.encodeComponent(thingTypeName)}/deprecate',
    exceptionFnMap: _exceptionFns,
  );
}