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

namespace Google\Cloud\ConfigDelivery\V1\FleetPackage;

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

/**
 * VariantSelector contains information for selecting a variant in
 * `ResourceBundle` to deploy to a target cluster.
 *
 * Generated from protobuf message <code>google.cloud.configdelivery.v1.FleetPackage.VariantSelector</code>
 */
class VariantSelector extends \Google\Protobuf\Internal\Message
{
    protected $strategy;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $variant_name_template
     *           Required. variant_name_template is a template that can refer to
     *           variables containing cluster membership metadata such as location,
     *           name, and labels to generate the name of the variant for a target
     *           cluster. The variable syntax is similar to the unix shell variables.
     *           Available variables are `${membership.name}`, `${membership.location}`,
     *           `${membership.project}` and `${membership.labels['label_name']}`.
     *           If you want to deploy a specific variant, say "default" to all the
     *           clusters, you can use "default" (string without any variables) as
     *           the variant_name_template.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Configdelivery\V1\ConfigDelivery::initOnce();
        parent::__construct($data);
    }

    /**
     * Required. variant_name_template is a template that can refer to
     * variables containing cluster membership metadata such as location,
     * name, and labels to generate the name of the variant for a target
     * cluster. The variable syntax is similar to the unix shell variables.
     * Available variables are `${membership.name}`, `${membership.location}`,
     * `${membership.project}` and `${membership.labels['label_name']}`.
     * If you want to deploy a specific variant, say "default" to all the
     * clusters, you can use "default" (string without any variables) as
     * the variant_name_template.
     *
     * Generated from protobuf field <code>string variant_name_template = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getVariantNameTemplate()
    {
        return $this->readOneof(1);
    }

    public function hasVariantNameTemplate()
    {
        return $this->hasOneof(1);
    }

    /**
     * Required. variant_name_template is a template that can refer to
     * variables containing cluster membership metadata such as location,
     * name, and labels to generate the name of the variant for a target
     * cluster. The variable syntax is similar to the unix shell variables.
     * Available variables are `${membership.name}`, `${membership.location}`,
     * `${membership.project}` and `${membership.labels['label_name']}`.
     * If you want to deploy a specific variant, say "default" to all the
     * clusters, you can use "default" (string without any variables) as
     * the variant_name_template.
     *
     * Generated from protobuf field <code>string variant_name_template = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setVariantNameTemplate($var)
    {
        GPBUtil::checkString($var, True);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getStrategy()
    {
        return $this->whichOneof("strategy");
    }

}


