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.

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

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 {
  ArgumentError.checkNotNull(thingTypeName, 'thingTypeName');
  _s.validateStringLength(
    'thingTypeName',
    thingTypeName,
    1,
    128,
    isRequired: true,
  );
  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,
  );
}