# Class PackageResource (1.25.0)

1.25.0 (latest) 1.24.0 1.23.0 1.22.0 1.21.0 1.20.2 1.19.0 1.18.1 1.17.5 1.16.0 1.15.3 1.14.1 1.13.0 1.12.4 1.11.2 1.10.0 1.9.0 1.8.0 1.7.1 1.6.0 1.5.2 1.4.0 1.3.2 1.2.0 1.1.0 1.0.0 0.1.2

    PackageResource(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A resource that manages a system package.

This message has `oneof`_ fields (mutually exclusive fields).
For each oneof, at most one member field can be set at the same time.
Setting any member of the oneof automatically clears all other
members.

.. _oneof: <https://proto-plus-python.readthedocs.io/en/stable/fields.html#oneofs-mutually-exclusive-fields>

| ## Attributes ||
|---|---|
| **Name** | **Description** |
| `desired_state` | `https://docs.cloud.google.com/python/docs/reference/osconfig/latest/google.cloud.osconfig_v1alpha.types.OSPolicy.Resource.PackageResource.DesiredState` Required. The desired state the agent should maintain for this package. |
| `apt` | `https://docs.cloud.google.com/python/docs/reference/osconfig/latest/google.cloud.osconfig_v1alpha.types.OSPolicy.Resource.PackageResource.APT` A package managed by Apt. This field is a member of `oneof`_ `system_package`. |
| `deb` | `https://docs.cloud.google.com/python/docs/reference/osconfig/latest/google.cloud.osconfig_v1alpha.types.OSPolicy.Resource.PackageResource.Deb` A deb package file. This field is a member of `oneof`_ `system_package`. |
| `yum` | `https://docs.cloud.google.com/python/docs/reference/osconfig/latest/google.cloud.osconfig_v1alpha.types.OSPolicy.Resource.PackageResource.YUM` A package managed by YUM. This field is a member of `oneof`_ `system_package`. |
| `zypper` | `https://docs.cloud.google.com/python/docs/reference/osconfig/latest/google.cloud.osconfig_v1alpha.types.OSPolicy.Resource.PackageResource.Zypper` A package managed by Zypper. This field is a member of `oneof`_ `system_package`. |
| `rpm` | `https://docs.cloud.google.com/python/docs/reference/osconfig/latest/google.cloud.osconfig_v1alpha.types.OSPolicy.Resource.PackageResource.RPM` An rpm package file. This field is a member of `oneof`_ `system_package`. |
| `googet` | `https://docs.cloud.google.com/python/docs/reference/osconfig/latest/google.cloud.osconfig_v1alpha.types.OSPolicy.Resource.PackageResource.GooGet` A package managed by GooGet. This field is a member of `oneof`_ `system_package`. |
| `msi` | `https://docs.cloud.google.com/python/docs/reference/osconfig/latest/google.cloud.osconfig_v1alpha.types.OSPolicy.Resource.PackageResource.MSI` An MSI package. This field is a member of `oneof`_ `system_package`. |

## Classes

### APT

    APT(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A package managed by APT.

- install: `apt-get update && apt-get -y install [name]`
- remove: `apt-get -y remove [name]`

### Deb

    Deb(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A deb package file. dpkg packages only support INSTALLED
state.

### DesiredState

    DesiredState(value)

The desired state that the OS Config agent maintains on the
VM.

### GooGet

    GooGet(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A package managed by GooGet.

- install: `googet -noconfirm install package`
- remove: `googet -noconfirm remove package`

### MSI

    MSI(mapping=None, *, ignore_unknown_fields=False, **kwargs)

An MSI package. MSI packages only support INSTALLED state.

### RPM

    RPM(mapping=None, *, ignore_unknown_fields=False, **kwargs)

An RPM package file. RPM packages only support INSTALLED
state.

### YUM

    YUM(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A package managed by YUM.

- install: `yum -y install package`
- remove: `yum -y remove package`

### Zypper

    Zypper(mapping=None, *, ignore_unknown_fields=False, **kwargs)

A package managed by Zypper.

- install: `zypper -y install package`
- remove: `zypper -y rm package`