def METHOD_NAME(filepath: str, channels: Channels) -> None:
    with open(filepath, 'w') as fh:
        # We should not be accessing internal attributes but
        # alternatives seems overkill since Channels is so simple.
        json.dump(channels._map, fh, indent=2)