Ensure thing type with passed properties is absent.

    .. versionadded:: 2016.11.0

    name
        The name of the state definition.

    thingTypeName
        Name of the thing type.

    region
        Region to connect to.

    key
        Secret key to be used.

    keyid
        Access key to be used.

    profile
        A dict with region, key and keyid, or a pillar key (string) that
        contains a dict with region, key and keyid.

def thing_type_absent(name, thingTypeName,
                  region=None, key=None, keyid=None, profile=None):
    '''
    Ensure thing type with passed properties is absent.

    .. versionadded:: 2016.11.0

    name
        The name of the state definition.

    thingTypeName
        Name of the thing type.

    region
        Region to connect to.

    key
        Secret key to be used.

    keyid
        Access key to be used.

    profile
        A dict with region, key and keyid, or a pillar key (string) that
        contains a dict with region, key and keyid.

    '''

    ret = {'name': thingTypeName,
           'result': True,
           'comment': '',
           'changes': {}
           }

    _describe = __salt__['boto_iot.describe_thing_type'](
        thingTypeName=thingTypeName,
        region=region, key=key, keyid=keyid, profile=profile
    )
    if 'error' in _describe:
        ret['result'] = False
        ret['comment'] = 'Failed to delete thing type: {0}.'.format(_describe['error']['message'])
        return ret

    if _describe and not _describe['thing_type']:
        ret['comment'] = 'Thing Type {0} does not exist.'.format(thingTypeName)
        return ret

    _existing_thing_type = _describe['thing_type']
    _thing_type_metadata = _existing_thing_type.get('thingTypeMetadata')
    _deprecated = _thing_type_metadata.get('deprecated', False)

    if __opts__['test']:
        if _deprecated:
            _change_desc = 'removed'
        else:
            _change_desc = 'deprecated and removed'
        ret['comment'] = 'Thing Type {0} is set to be {1}.'.format(thingTypeName, _change_desc)
        ret['result'] = None
        return ret

    # initialize a delete_wait_timer to be 5 minutes
    # AWS does not allow delete thing type until 5 minutes
    # after a thing type is marked deprecated.
    _delete_wait_timer = 300

    if _deprecated is False:
        _deprecate = __salt__['boto_iot.deprecate_thing_type'](
            thingTypeName=thingTypeName,
            undoDeprecate=False,
            region=region, key=key, keyid=keyid, profile=profile
        )
        if 'error' in _deprecate:
            ret['result'] = False
            ret['comment'] = 'Failed to deprecate thing type: {0}.'.format(_deprecate['error']['message'])
            return ret
    else:
        # grab the deprecation date string from _thing_type_metadata
        _deprecation_date_str = _thing_type_metadata.get('deprecationDate')
        if _deprecation_date_str:
            # see if we can wait less than 5 minutes
            _tz_index = _deprecation_date_str.find('+')
            if _tz_index != -1:
                _deprecation_date_str = _deprecation_date_str[:_tz_index]

            _deprecation_date = datetime.datetime.strptime(
                _deprecation_date_str,
                "%Y-%m-%d %H:%M:%S.%f"
            )

            _elapsed_time_delta = datetime.datetime.utcnow() - _deprecation_date
            if _elapsed_time_delta.seconds >= 300:
                _delete_wait_timer = 0
            else:
                _delete_wait_timer = 300 - _elapsed_time_delta.seconds

    # wait required 5 minutes since deprecation time
    if _delete_wait_timer:
        log.warning(
            'wait for %s seconds per AWS (5 minutes after deprecation time) '
            'before we can delete iot thing type', _delete_wait_timer
        )
        time.sleep(_delete_wait_timer)

    # delete thing type
    r = __salt__['boto_iot.delete_thing_type'](
            thingTypeName=thingTypeName,
            region=region, key=key, keyid=keyid, profile=profile
    )
    if not r['deleted']:
        ret['result'] = False
        ret['comment'] = 'Failed to delete thing type: {0}.'.format(r['error']['message'])
        return ret
    ret['changes']['old'] = _describe
    ret['changes']['new'] = {'thing_type': None}
    ret['comment'] = 'Thing Type {0} deleted.'.format(thingTypeName)
    return ret