Access Bloom volume override in script

I’m trying to control Threshold/Intensity for the Bloom override on a Volume object from a script in 2019.3.10f1. Here’s what I’ve got:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;
using UnityEngine.Rendering.PostProcessing;

public class MainMenuFlicker: MonoBehaviour
{
    Volume volume;
    Bloom bloom;
    
    void Start()
    {
        volume = gameObject.GetComponent<Volume>();
        Bloom tmp;
        if (volume.profile.TryGet<Bloom>(out tmp))
        {
            bloom = tmp;
        }
    }
    
    void Update()
    {
        
    }
}

This gives me the error: Assets\Scripts\MainMenuFlicker.cs(16,28): error CS0311: The type 'UnityEngine.Rendering.PostProcessing.Bloom' cannot be used as type parameter 'T' in the generic type or method 'VolumeProfile.TryGet<T>(out T)'. There is no implicit reference conversion from 'UnityEngine.Rendering.PostProcessing.Bloom' to 'UnityEngine.Rendering.VolumeComponent'.

Looking around online, it seems like this part of the API is changing pretty rapidly (e.g. different required using statements), and I can’t figure out how to correctly TryGet the Bloom from my Volume.

I’ve seen a number of people get stuck with this and for good reason, it’s definitely a bug on the Unity Dev Teams end. One thing to not is that volumes stack, as such, you can simply put your bloom on a separate object and change its influence on your game screen through the weight parameter.

using UnityEngine;
using UnityEngine.Rendering;

public class VolumeWeightSin : MonoBehaviour
{
    Volume m_Volume;
    void Update()
    {
        if (m_Volume != null)
        {
            m_Volume.weight = Mathf.Sin(Time.realtimeSinceStartup);
        }
    }
}