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

namespace Google\Cloud\Notebooks\V1beta1;

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

/**
 * Reservation Affinity for consuming Zonal reservation.
 *
 * Generated from protobuf message <code>google.cloud.notebooks.v1beta1.ReservationAffinity</code>
 */
class ReservationAffinity extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. Type of reservation to consume
     *
     * Generated from protobuf field <code>.google.cloud.notebooks.v1beta1.ReservationAffinity.Type consume_reservation_type = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $consume_reservation_type = 0;
    /**
     * Optional. Corresponds to the label key of reservation resource.
     *
     * Generated from protobuf field <code>string key = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $key = '';
    /**
     * Optional. Corresponds to the label values of reservation resource.
     *
     * Generated from protobuf field <code>repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $values;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $consume_reservation_type
     *           Optional. Type of reservation to consume
     *     @type string $key
     *           Optional. Corresponds to the label key of reservation resource.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $values
     *           Optional. Corresponds to the label values of reservation resource.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Notebooks\V1Beta1\Instance::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Type of reservation to consume
     *
     * Generated from protobuf field <code>.google.cloud.notebooks.v1beta1.ReservationAffinity.Type consume_reservation_type = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return int
     */
    public function getConsumeReservationType()
    {
        return $this->consume_reservation_type;
    }

    /**
     * Optional. Type of reservation to consume
     *
     * Generated from protobuf field <code>.google.cloud.notebooks.v1beta1.ReservationAffinity.Type consume_reservation_type = 1 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param int $var
     * @return $this
     */
    public function setConsumeReservationType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Notebooks\V1beta1\ReservationAffinity\Type::class);
        $this->consume_reservation_type = $var;

        return $this;
    }

    /**
     * Optional. Corresponds to the label key of reservation resource.
     *
     * Generated from protobuf field <code>string key = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getKey()
    {
        return $this->key;
    }

    /**
     * Optional. Corresponds to the label key of reservation resource.
     *
     * Generated from protobuf field <code>string key = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->key = $var;

        return $this;
    }

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

    /**
     * Optional. Corresponds to the label values of reservation resource.
     *
     * Generated from protobuf field <code>repeated string values = 3 [(.google.api.field_behavior) = OPTIONAL];</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;
    }

}

