

Las traducciones son generadas a través de traducción automática. En caso de conflicto entre la traducción y la version original de inglés, prevalecerá la version en inglés.

# Descartar un tipo de objeto
<a name="deprecate-thing-type"></a>

Los tipos de objeto son inmutables. No se pueden cambiar una vez que están definidos. Sin embargo, puede descartar un tipo de objeto para evitar que los usuarios le asocien nuevos objetos. Todos los objetos que estén asociados al tipo de objeto permanecen igual, sin cambios.

Para descartar un tipo de objeto, utilice el comando **DeprecateThingType**:

```
$ aws iot deprecate-thing-type --thing-type-name "myThingType"
```

Puede utilizar el comando de **DescribeThingType** para ver el resultado:

```
$ aws iot describe-thing-type --thing-type-name "StopLight":
```

```
{
    "thingTypeName": "StopLight",
    "thingTypeProperties": {
        "searchableAttributes": [
            "wattage",
            "numOfLights",
            "model"
        ],
        "thingTypeDescription": "traffic light type",
    },
    "thingTypeMetadata": {
        "deprecated": true,
        "creationDate": 1468425854308,
        "deprecationDate": 1468446026349
    }
}
```

Descartar un tipo de objeto es una operación reversible. Puede anular un descarte utilizando la marca `--undo-deprecate` con el comando de la CLI **DeprecateThingType**:

```
$ aws iot deprecate-thing-type --thing-type-name "myThingType" --undo-deprecate
```

Puede utilizar el comando de la CLI **DescribeThingType** para ver el resultado:

```
$ aws iot describe-thing-type --thing-type-name "StopLight":
```

```
{
    "thingTypeName": "StopLight",
    "thingTypeArn": "arn:aws:iot:us-east-1:123456789012:thingtype/StopLight",
    "thingTypeId": "12345678abcdefgh12345678ijklmnop12345678"
    "thingTypeProperties": {
        "searchableAttributes": [
            "wattage",
            "numOfLights",
            "model"
        ],
        "thingTypeDescription": "traffic light type"
    },
    "thingTypeMetadata": {
        "deprecated": false,
        "creationDate": 1468425854308,
    }
}
```