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

namespace Google\Cloud\OsConfig\V1\PatchInstanceFilter;

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

/**
 * Targets a group of VM instances by using their [assigned
 * labels](https://cloud.google.com/compute/docs/labeling-resources). Labels
 * are key-value pairs. A `GroupLabel` is a combination of labels
 * that is used to target VMs for a patch job.
 * For example, a patch job can target VMs that have the following
 * `GroupLabel`: `{"env":"test", "app":"web"}`. This means that the patch job
 * is applied to VMs that have both the labels `env=test` and `app=web`.
 *
 * Generated from protobuf message <code>google.cloud.osconfig.v1.PatchInstanceFilter.GroupLabel</code>
 */
class GroupLabel extends \Google\Protobuf\Internal\Message
{
    /**
     * Compute Engine instance labels that must be present for a VM
     * instance to be targeted by this filter.
     *
     * Generated from protobuf field <code>map<string, string> labels = 1;</code>
     */
    private $labels;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type array|\Google\Protobuf\Internal\MapField $labels
     *           Compute Engine instance labels that must be present for a VM
     *           instance to be targeted by this filter.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Osconfig\V1\PatchJobs::initOnce();
        parent::__construct($data);
    }

    /**
     * Compute Engine instance labels that must be present for a VM
     * instance to be targeted by this filter.
     *
     * Generated from protobuf field <code>map<string, string> labels = 1;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getLabels()
    {
        return $this->labels;
    }

    /**
     * Compute Engine instance labels that must be present for a VM
     * instance to be targeted by this filter.
     *
     * Generated from protobuf field <code>map<string, string> labels = 1;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setLabels($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->labels = $arr;

        return $this;
    }

}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(GroupLabel::class, \Google\Cloud\OsConfig\V1\PatchInstanceFilter_GroupLabel::class);

