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

namespace Google\Cloud\VMMigration\V1;

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

/**
 * Node Affinity: the configuration of desired nodes onto which this Instance
 * could be scheduled. Based on
 * https://cloud.google.com/compute/docs/reference/rest/v1/instances/setScheduling
 *
 * Generated from protobuf message <code>google.cloud.vmmigration.v1.SchedulingNodeAffinity</code>
 */
class SchedulingNodeAffinity extends \Google\Protobuf\Internal\Message
{
    /**
     * The label key of Node resource to reference.
     *
     * Generated from protobuf field <code>string key = 1;</code>
     */
    private $key = '';
    /**
     * The operator to use for the node resources specified in the `values`
     * parameter.
     *
     * Generated from protobuf field <code>.google.cloud.vmmigration.v1.SchedulingNodeAffinity.Operator operator = 2;</code>
     */
    private $operator = 0;
    /**
     * Corresponds to the label values of Node resource.
     *
     * Generated from protobuf field <code>repeated string values = 3;</code>
     */
    private $values;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $key
     *           The label key of Node resource to reference.
     *     @type int $operator
     *           The operator to use for the node resources specified in the `values`
     *           parameter.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $values
     *           Corresponds to the label values of Node resource.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Vmmigration\V1\Vmmigration::initOnce();
        parent::__construct($data);
    }

    /**
     * The label key of Node resource to reference.
     *
     * Generated from protobuf field <code>string key = 1;</code>
     * @return string
     */
    public function getKey()
    {
        return $this->key;
    }

    /**
     * The label key of Node resource to reference.
     *
     * Generated from protobuf field <code>string key = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->key = $var;

        return $this;
    }

    /**
     * The operator to use for the node resources specified in the `values`
     * parameter.
     *
     * Generated from protobuf field <code>.google.cloud.vmmigration.v1.SchedulingNodeAffinity.Operator operator = 2;</code>
     * @return int
     */
    public function getOperator()
    {
        return $this->operator;
    }

    /**
     * The operator to use for the node resources specified in the `values`
     * parameter.
     *
     * Generated from protobuf field <code>.google.cloud.vmmigration.v1.SchedulingNodeAffinity.Operator operator = 2;</code>
     * @param int $var
     * @return $this
     */
    public function setOperator($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\VMMigration\V1\SchedulingNodeAffinity\Operator::class);
        $this->operator = $var;

        return $this;
    }

    /**
     * Corresponds to the label values of Node resource.
     *
     * Generated from protobuf field <code>repeated string values = 3;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getValues()
    {
        return $this->values;
    }

    /**
     * Corresponds to the label values of Node resource.
     *
     * Generated from protobuf field <code>repeated string values = 3;</code>
     * @param array<string>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setValues($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::STRING);
        $this->values = $arr;

        return $this;
    }

}

