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

namespace Google\Cloud\Dataproc\V1beta2;

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.dataproc.v1beta2.ReservationAffinity</code>
 */
class ReservationAffinity extends \Google\Protobuf\Internal\Message
{
    /**
     * Optional. Type of reservation to consume
     *
     * Generated from protobuf field <code>.google.cloud.dataproc.v1beta2.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 string[]|\Google\Protobuf\Internal\RepeatedField $values
     *           Optional. Corresponds to the label values of reservation resource.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Dataproc\V1Beta2\Clusters::initOnce();
        parent::__construct($data);
    }

    /**
     * Optional. Type of reservation to consume
     *
     * Generated from protobuf field <code>.google.cloud.dataproc.v1beta2.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.dataproc.v1beta2.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\Dataproc\V1beta2\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 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;
    }

}

