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

namespace Google\Cloud\Container\V1;

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

/**
 * [ReservationAffinity](https://cloud.google.com/compute/docs/instances/reserving-zonal-resources)
 * is the configuration of desired reservation which instances could take
 * capacity from.
 *
 * Generated from protobuf message <code>google.container.v1.ReservationAffinity</code>
 */
class ReservationAffinity extends \Google\Protobuf\Internal\Message
{
    /**
     * Corresponds to the type of reservation consumption.
     *
     * Generated from protobuf field <code>.google.container.v1.ReservationAffinity.Type consume_reservation_type = 1;</code>
     */
    private $consume_reservation_type = 0;
    /**
     * Corresponds to the label key of a reservation resource. To target a
     * SPECIFIC_RESERVATION by name, specify
     * "compute.googleapis.com/reservation-name" as the key and specify the name
     * of your reservation as its value.
     *
     * Generated from protobuf field <code>string key = 2;</code>
     */
    private $key = '';
    /**
     * Corresponds to the label value(s) of reservation resource(s).
     *
     * Generated from protobuf field <code>repeated string values = 3;</code>
     */
    private $values;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $consume_reservation_type
     *           Corresponds to the type of reservation consumption.
     *     @type string $key
     *           Corresponds to the label key of a reservation resource. To target a
     *           SPECIFIC_RESERVATION by name, specify
     *           "compute.googleapis.com/reservation-name" as the key and specify the name
     *           of your reservation as its value.
     *     @type array<string>|\Google\Protobuf\Internal\RepeatedField $values
     *           Corresponds to the label value(s) of reservation resource(s).
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Container\V1\ClusterService::initOnce();
        parent::__construct($data);
    }

    /**
     * Corresponds to the type of reservation consumption.
     *
     * Generated from protobuf field <code>.google.container.v1.ReservationAffinity.Type consume_reservation_type = 1;</code>
     * @return int
     */
    public function getConsumeReservationType()
    {
        return $this->consume_reservation_type;
    }

    /**
     * Corresponds to the type of reservation consumption.
     *
     * Generated from protobuf field <code>.google.container.v1.ReservationAffinity.Type consume_reservation_type = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setConsumeReservationType($var)
    {
        GPBUtil::checkEnum($var, \Google\Cloud\Container\V1\ReservationAffinity\Type::class);
        $this->consume_reservation_type = $var;

        return $this;
    }

    /**
     * Corresponds to the label key of a reservation resource. To target a
     * SPECIFIC_RESERVATION by name, specify
     * "compute.googleapis.com/reservation-name" as the key and specify the name
     * of your reservation as its value.
     *
     * Generated from protobuf field <code>string key = 2;</code>
     * @return string
     */
    public function getKey()
    {
        return $this->key;
    }

    /**
     * Corresponds to the label key of a reservation resource. To target a
     * SPECIFIC_RESERVATION by name, specify
     * "compute.googleapis.com/reservation-name" as the key and specify the name
     * of your reservation as its value.
     *
     * Generated from protobuf field <code>string key = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->key = $var;

        return $this;
    }

    /**
     * Corresponds to the label value(s) of reservation resource(s).
     *
     * 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 value(s) of reservation resource(s).
     *
     * 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;
    }

}

