<?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;

/**
 * Apt patching is completed by executing `apt-get update && apt-get
 * upgrade`. Additional options can be set to control how this is executed.
 *
 * Generated from protobuf message <code>google.cloud.osconfig.v1.AptSettings</code>
 */
class AptSettings extends \Google\Protobuf\Internal\Message
{
    /**
     * By changing the type to DIST, the patching is performed
     * using `apt-get dist-upgrade` instead.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.AptSettings.Type type = 1;</code>
     */
    private $type = 0;
    /**
     * List of packages to exclude from update. These packages will be excluded
     *
     * Generated from protobuf field <code>repeated string excludes = 2;</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 cannot be specified with any other patch configuration
     * fields.
     *
     * Generated from protobuf field <code>repeated string exclusive_packages = 3;</code>
     */
    private $exclusive_packages;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $type
     *           By changing the type to DIST, the patching is performed
     *           using `apt-get dist-upgrade` instead.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $excludes
     *           List of packages to exclude from update. These packages will be excluded
     *     @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 cannot be specified with any other patch configuration
     *           fields.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Osconfig\V1\PatchJobs::initOnce();
        parent::__construct($data);
    }

    /**
     * By changing the type to DIST, the patching is performed
     * using `apt-get dist-upgrade` instead.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.AptSettings.Type type = 1;</code>
     * @return int
     */
    public function getType()
    {
        return $this->type;
    }

    /**
     * By changing the type to DIST, the patching is performed
     * using `apt-get dist-upgrade` instead.
     *
     * Generated from protobuf field <code>.google.cloud.osconfig.v1.AptSettings.Type type = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\OsConfig\V1\AptSettings\Type::class);
        $this->type = $var;

        return $this;
    }

    /**
     * List of packages to exclude from update. These packages will be excluded
     *
     * Generated from protobuf field <code>repeated string excludes = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getExcludes()
    {
        return $this->excludes;
    }

    /**
     * List of packages to exclude from update. These packages will be excluded
     *
     * Generated from protobuf field <code>repeated string excludes = 2;</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 cannot be specified with any other patch configuration
     * fields.
     *
     * Generated from protobuf field <code>repeated string exclusive_packages = 3;</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 cannot be specified with any other patch configuration
     * fields.
     *
     * Generated from protobuf field <code>repeated string exclusive_packages = 3;</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;
    }

}

