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

namespace Google\Cloud\OsConfig\V1;

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

/**
 * Yum patching is performed by executing `yum update`. Additional options
 * can be set to control how this is executed.
 * Note that not all settings are supported on all platforms.
 *
 * Generated from protobuf message <code>google.cloud.osconfig.v1.YumSettings</code>
 */
class YumSettings extends \Google\Protobuf\Internal\Message
{
    /**
     * Adds the `--security` flag to `yum update`. Not supported on
     * all platforms.
     *
     * Generated from protobuf field <code>bool security = 1;</code>
     */
    private $security = false;
    /**
     * Will cause patch to run `yum update-minimal` instead.
     *
     * Generated from protobuf field <code>bool minimal = 2;</code>
     */
    private $minimal = false;
    /**
     * List of packages to exclude from update. These packages are excluded by
     * using the yum `--exclude` flag.
     *
     * Generated from protobuf field <code>repeated string excludes = 3;</code>
     */
    private $excludes;
    /**
     * An exclusive list of packages to be updated. These are the only packages
     * that will be updated. If these packages are not installed, they will be
     * ignored. This field must not be specified with any other patch
     * configuration fields.
     *
     * Generated from protobuf field <code>repeated string exclusive_packages = 4;</code>
     */
    private $exclusive_packages;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type bool $security
     *           Adds the `--security` flag to `yum update`. Not supported on
     *           all platforms.
     *     @type bool $minimal
     *           Will cause patch to run `yum update-minimal` instead.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $excludes
     *           List of packages to exclude from update. These packages are excluded by
     *           using the yum `--exclude` flag.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $exclusive_packages
     *           An exclusive list of packages to be updated. These are the only packages
     *           that will be updated. If these packages are not installed, they will be
     *           ignored. This field must not be specified with any other patch
     *           configuration fields.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Osconfig\V1\PatchJobs::initOnce();
        parent::__construct($data);
    }

    /**
     * Adds the `--security` flag to `yum update`. Not supported on
     * all platforms.
     *
     * Generated from protobuf field <code>bool security = 1;</code>
     * @return bool
     */
    public function getSecurity()
    {
        return $this->security;
    }

    /**
     * Adds the `--security` flag to `yum update`. Not supported on
     * all platforms.
     *
     * Generated from protobuf field <code>bool security = 1;</code>
     * @param bool $var
     * @return $this
     */
    public function setSecurity($var)
    {
        GPBUtil::checkBool($var);
        $this->security = $var;

        return $this;
    }

    /**
     * Will cause patch to run `yum update-minimal` instead.
     *
     * Generated from protobuf field <code>bool minimal = 2;</code>
     * @return bool
     */
    public function getMinimal()
    {
        return $this->minimal;
    }

    /**
     * Will cause patch to run `yum update-minimal` instead.
     *
     * Generated from protobuf field <code>bool minimal = 2;</code>
     * @param bool $var
     * @return $this
     */
    public function setMinimal($var)
    {
        GPBUtil::checkBool($var);
        $this->minimal = $var;

        return $this;
    }

    /**
     * List of packages to exclude from update. These packages are excluded by
     * using the yum `--exclude` flag.
     *
     * Generated from protobuf field <code>repeated string excludes = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getExcludes()
    {
        return $this->excludes;
    }

    /**
     * List of packages to exclude from update. These packages are excluded by
     * using the yum `--exclude` flag.
     *
     * Generated from protobuf field <code>repeated string excludes = 3;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setExcludes($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->excludes = $arr;

        return $this;
    }

    /**
     * An exclusive list of packages to be updated. These are the only packages
     * that will be updated. If these packages are not installed, they will be
     * ignored. This field must not be specified with any other patch
     * configuration fields.
     *
     * Generated from protobuf field <code>repeated string exclusive_packages = 4;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getExclusivePackages()
    {
        return $this->exclusive_packages;
    }

    /**
     * An exclusive list of packages to be updated. These are the only packages
     * that will be updated. If these packages are not installed, they will be
     * ignored. This field must not be specified with any other patch
     * configuration fields.
     *
     * Generated from protobuf field <code>repeated string exclusive_packages = 4;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setExclusivePackages($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->exclusive_packages = $arr;

        return $this;
    }

}

