<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/osconfig/v1/os_policy.proto

namespace Google\Cloud\OsConfig\V1\OSPolicy\Resource\PackageResource;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;

/**
 * An RPM package file. RPM packages only support INSTALLED state.
 *
 * Generated from protobuf message <code>google.cloud.osconfig.v1.OSPolicy.Resource.PackageResource.RPM</code>
 */
class RPM extends \Google\Protobuf\Internal\Message
{
    /**
     * Required. An rpm package.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.OSPolicy.Resource.File source = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $source = null;
    /**
     * Whether dependencies should also be installed.
     * - install when false: `rpm --upgrade --replacepkgs package.rpm`
     * - install when true: `yum -y install package.rpm` or
     * `zypper -y install package.rpm`
     *
     * Generated from protobuf field <code>bool pull_deps = 2;</code>
     */
    private $pull_deps = false;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\OsConfig\V1\OSPolicy\Resource\File $source
     *           Required. An rpm package.
     *     @type bool $pull_deps
     *           Whether dependencies should also be installed.
     *           - install when false: `rpm --upgrade --replacepkgs package.rpm`
     *           - install when true: `yum -y install package.rpm` or
     *           `zypper -y install package.rpm`
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Osconfig\V1\OsPolicy::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. An rpm package.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.OSPolicy.Resource.File source = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return \Google\Cloud\OsConfig\V1\OSPolicy\Resource\File|null
     */
    public function getSource()
    {
        return $this->source;
    }

    public function hasSource()
    {
        return isset($this->source);
    }

    public function clearSource()
    {
        unset($this->source);
    }

    /**
     * Required. An rpm package.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.OSPolicy.Resource.File source = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param \Google\Cloud\OsConfig\V1\OSPolicy\Resource\File $var
     * @return $this
     */
    public function setSource($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\OsConfig\V1\OSPolicy\Resource\File::class);
        $this->source = $var;

        return $this;
    }

    /**
     * Whether dependencies should also be installed.
     * - install when false: `rpm --upgrade --replacepkgs package.rpm`
     * - install when true: `yum -y install package.rpm` or
     * `zypper -y install package.rpm`
     *
     * Generated from protobuf field <code>bool pull_deps = 2;</code>
     * @return bool
     */
    public function getPullDeps()
    {
        return $this->pull_deps;
    }

    /**
     * Whether dependencies should also be installed.
     * - install when false: `rpm --upgrade --replacepkgs package.rpm`
     * - install when true: `yum -y install package.rpm` or
     * `zypper -y install package.rpm`
     *
     * Generated from protobuf field <code>bool pull_deps = 2;</code>
     * @param bool $var
     * @return $this
     */
    public function setPullDeps($var)
    {
        GPBUtil::checkBool($var);
        $this->pull_deps = $var;

        return $this;
    }

}


