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

namespace Google\Cloud\OsConfig\V1\OSPolicyAssignment;

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

/**
 * Message representing label set.
 * * A label is a key value pair set for a VM.
 * * A LabelSet is a set of labels.
 * * Labels within a LabelSet are ANDed. In other words, a LabelSet is
 *   applicable for a VM only if it matches all the labels in the
 *   LabelSet.
 * * Example: A LabelSet with 2 labels: `env=prod` and `type=webserver` will
 *            only be applicable for those VMs with both labels
 *            present.
 *
 * Generated from protobuf message <code>google.cloud.osconfig.v1.OSPolicyAssignment.LabelSet</code>
 */
class LabelSet extends \Google\Protobuf\Internal\Message
{
    /**
     * Labels are identified by key/value pairs in this map.
     * A VM should contain all the key/value pairs specified in this
     * map to be selected.
     *
     * 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
     *           Labels are identified by key/value pairs in this map.
     *           A VM should contain all the key/value pairs specified in this
     *           map to be selected.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Osconfig\V1\OsPolicyAssignments::initOnce();
        parent::__construct($data);
    }

    /**
     * Labels are identified by key/value pairs in this map.
     * A VM should contain all the key/value pairs specified in this
     * map to be selected.
     *
     * Generated from protobuf field <code>map<string, string> labels = 1;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getLabels()
    {
        return $this->labels;
    }

    /**
     * Labels are identified by key/value pairs in this map.
     * A VM should contain all the key/value pairs specified in this
     * map to be selected.
     *
     * 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;
    }

}


