def METHOD_NAME(thing_name):
    paginator = iot.get_paginator("list_thing_principals")
    list_certificates_iterator = paginator.paginate(
        thingName=thing_name
    )
    for response in list_certificates_iterator:
        for certificate_arn in response["principals"]:
            iot.detach_thing_principal(
                thingName=thing_name,
                principal=certificate_arn
            )
    iot.METHOD_NAME(thingName=thing_name)