How to "Hide a Collection in viewport" but not "Disable in Viewport" via script in Python Hi Blender coders and artists.

I am updating one of my add-ons for Blender 2.8 and have run into some  issues finding the appropriate way to hide a collection that is added to my scene.

I want to deselect the eyeball on the toolbar with a python command in a script but I don't want to disable the collection in the view-port entirely as it is used as a collection in a particle system. 

I just want to deselect the eyeball circled in green below.

Anyone know the python API for this?
You can hide the active collection using the following code:

bpy.context.view_layer.active_layer_collection.hide_viewport = True


If you want to hide more than the active collection you will have to iterate through the children of layer_collection

collections = bpy.context.view_layer.layer_collection.children

for collection in collections:
    collection.hide_viewport = True


Be aware that bpy.data.collections and bpy.context.scene.collection also allow to access the collections and set hide_viewport. However, since these do not depend on the active view layer, they apply globally and therefore activate Disable in Viewports.