def METHOD_NAME(
    cfg_element: model.NamedModelElement,
    cfg_factory: model.ConfigFactory,
) -> typing.Union[typing.Tuple[cfg_mgmt.revert_function, dict, model.NamedModelElement], None]:
    '''Rotates the credentials contained in the given config-element, using only config from the
    given factory (if necessary)
    Returns a triple of (callable, dict, NamedModelElement) if rotation for the given config-
    element is supported:
    - The callable is a function that reverts the rotation again.
    - The dict contains the meta-information about the rotation.
    - The returned NamedModelElement is the updated version of the element that was passed in.
    If rotation for the given element is not supported, `None` will be returned.
    '''
    type_name = cfg_element._type_name
    update_secret_function: typing.Callable[
        [model.NamedModelElement, model.ConfigFactory],
        typing.Tuple[cfg_mgmt.revert_function, dict, model.NamedModelElement]
    ] = None
    rotation_validation_function: typing.Callable[[model.NamedModelElement], None] = None
    if type_name == 'container_registry':
        if cfg_element.registry_type() == om.OciRegistryType.GCR:
            # service accounts require role "Service Account Key Admin"
            logger.info(f'rotating {cfg_element.name()} {type_name=}')
            update_secret_function = cmg.METHOD_NAME
        else:
            logger.warning(
                f'{cfg_element.registry_type()} is not (yet) supported for automated rotation'
            )
            return None
    elif type_name == 'gcp':
        update_secret_function = cmg.METHOD_NAME
    elif type_name == 'github':
        update_secret_function = cmgh.METHOD_NAME
    elif type_name == 'azure_service_principal':
        update_secret_function = cma.METHOD_NAME
    elif type_name == 'btp_service_binding':
        update_secret_function = cmb.METHOD_NAME
    elif type_name == 'btp_application_certificate':
        update_secret_function = cmbac.METHOD_NAME
    elif type_name == 'aws':
        rotation_validation_function = cmaws.validate_for_rotation
        update_secret_function = cmaws.METHOD_NAME
    elif type_name == 'alicloud':
        rotation_validation_function = cmali.validate_for_rotation
        update_secret_function = cmali.METHOD_NAME
    elif type_name == 'kubernetes':
        rotation_validation_function = cmk.validate_for_rotation
        update_secret_function = cmk.METHOD_NAME
    if not update_secret_function:
        logger.warning(f'{type_name=} is not (yet) supported for automated rotation')
        return None
    try:
        if rotation_validation_function:
            rotation_validation_function(cfg_element)
        return update_secret_function(
            cfg_element=cfg_element,
            cfg_factory=cfg_factory,
        )
    except cmm.ValidationError as e:
        logger.warning(
            f"Cannot rotate cfg-type '{type_name}' with name '{cfg_element.name()}': {e}"
        )
        return None
    except Exception as e:
        logger.warning(f'an error occured whilst trying to update secret for {cfg_element=}: {e}')
        raise