Given a thing type name, deprecate it when undoDeprecate is False
    and undeprecate it when undoDeprecate is True.

    Returns {deprecated: true} if the thing type was deprecated and returns
    {deprecated: false} if the thing type was not deprecated.

    .. versionadded:: 2016.11.0

    CLI Example:

    .. code-block:: bash

        salt myminion boto_iot.deprecate_thing_type mythingtype

def deprecate_thing_type(thingTypeName, undoDeprecate=False,
    region=None, key=None, keyid=None, profile=None):
    '''
    Given a thing type name, deprecate it when undoDeprecate is False
    and undeprecate it when undoDeprecate is True.

    Returns {deprecated: true} if the thing type was deprecated and returns
    {deprecated: false} if the thing type was not deprecated.

    .. versionadded:: 2016.11.0

    CLI Example:

    .. code-block:: bash

        salt myminion boto_iot.deprecate_thing_type mythingtype

    '''

    try:
        conn = _get_conn(region=region, key=key, keyid=keyid, profile=profile)
        conn.deprecate_thing_type(
            thingTypeName=thingTypeName,
            undoDeprecate=undoDeprecate
        )
        deprecated = True if undoDeprecate is False else False
        return {'deprecated': deprecated}
    except ClientError as e:
        return {'deprecated': False, 'error': __utils__['boto3.get_error'](e)}