def METHOD_NAME(t_metrics, enabled, api, retention_policy):
    kwargs = {'enabled': enabled, 'include_apis': api, 'retention_policy': retention_policy}
    if not enabled:
        kwargs.pop('include_apis')
    return t_metrics(**kwargs)