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

namespace Google\Cloud\AIPlatform\V1\ModelEvaluationSlice\Slice\SliceSpec;

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

/**
 * Specification message containing the config for this SliceSpec.
 * When `kind` is selected as `value` and/or `range`, only a single slice
 * will be computed.
 * When `all_values` is present, a separate slice will be computed for
 * each possible label/value for the corresponding key in `config`.
 * Examples, with feature zip_code with values 12345, 23334, 88888 and
 * feature country with values "US", "Canada", "Mexico" in the dataset:
 * Example 1:
 *     {
 *       "zip_code": { "value": { "float_value": 12345.0 } }
 *     }
 * A single slice for any data with zip_code 12345 in the dataset.
 * Example 2:
 *     {
 *       "zip_code": { "range": { "low": 12345, "high": 20000 } }
 *     }
 * A single slice containing data where the zip_codes between 12345 and
 * 20000 For this example, data with the zip_code of 12345 will be in this
 * slice.
 * Example 3:
 *     {
 *       "zip_code": { "range": { "low": 10000, "high": 20000 } },
 *       "country": { "value": { "string_value": "US" } }
 *     }
 * A single slice containing data where the zip_codes between 10000 and
 * 20000 has the country "US". For this example, data with the zip_code of
 * 12345 and country "US" will be in this slice.
 * Example 4:
 *     { "country": {"all_values": { "value": true } } }
 * Three slices are computed, one for each unique country in the dataset.
 * Example 5:
 *     {
 *       "country": { "all_values": { "value": true } },
 *       "zip_code": { "value": { "float_value": 12345.0 } }
 *     }
 * Three slices are computed, one for each unique country in the dataset
 * where the zip_code is also 12345. For this example, data with zip_code
 * 12345 and country "US" will be in one slice, zip_code 12345 and country
 * "Canada" in another slice, and zip_code 12345 and country "Mexico" in
 * another slice, totaling 3 slices.
 *
 * Generated from protobuf message <code>google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.SliceConfig</code>
 */
class SliceConfig extends \Google\Protobuf\Internal\Message
{
    protected $kind;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\AIPlatform\V1\ModelEvaluationSlice\Slice\SliceSpec\Value $value
     *           A unique specific value for a given feature.
     *           Example: `{ "value": { "string_value": "12345" } }`
     *     @type \Google\Cloud\AIPlatform\V1\ModelEvaluationSlice\Slice\SliceSpec\Range $range
     *           A range of values for a numerical feature.
     *           Example: `{"range":{"low":10000.0,"high":50000.0}}`
     *           will capture 12345 and 23334 in the slice.
     *     @type \Google\Protobuf\BoolValue $all_values
     *           If all_values is set to true, then all possible labels of the keyed
     *           feature will have another slice computed.
     *           Example: `{"all_values":{"value":true}}`
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Aiplatform\V1\ModelEvaluationSlice::initOnce();
        parent::__construct($data);
    }

    /**
     * A unique specific value for a given feature.
     * Example: `{ "value": { "string_value": "12345" } }`
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value value = 1;</code>
     * @return \Google\Cloud\AIPlatform\V1\ModelEvaluationSlice\Slice\SliceSpec\Value|null
     */
    public function getValue()
    {
        return $this->readOneof(1);
    }

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

    /**
     * A unique specific value for a given feature.
     * Example: `{ "value": { "string_value": "12345" } }`
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Value value = 1;</code>
     * @param \Google\Cloud\AIPlatform\V1\ModelEvaluationSlice\Slice\SliceSpec\Value $var
     * @return $this
     */
    public function setValue($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\ModelEvaluationSlice\Slice\SliceSpec\Value::class);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * A range of values for a numerical feature.
     * Example: `{"range":{"low":10000.0,"high":50000.0}}`
     * will capture 12345 and 23334 in the slice.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range range = 2;</code>
     * @return \Google\Cloud\AIPlatform\V1\ModelEvaluationSlice\Slice\SliceSpec\Range|null
     */
    public function getRange()
    {
        return $this->readOneof(2);
    }

    public function hasRange()
    {
        return $this->hasOneof(2);
    }

    /**
     * A range of values for a numerical feature.
     * Example: `{"range":{"low":10000.0,"high":50000.0}}`
     * will capture 12345 and 23334 in the slice.
     *
     * Generated from protobuf field <code>.google.cloud.aiplatform.v1.ModelEvaluationSlice.Slice.SliceSpec.Range range = 2;</code>
     * @param \Google\Cloud\AIPlatform\V1\ModelEvaluationSlice\Slice\SliceSpec\Range $var
     * @return $this
     */
    public function setRange($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\AIPlatform\V1\ModelEvaluationSlice\Slice\SliceSpec\Range::class);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * If all_values is set to true, then all possible labels of the keyed
     * feature will have another slice computed.
     * Example: `{"all_values":{"value":true}}`
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue all_values = 3;</code>
     * @return \Google\Protobuf\BoolValue|null
     */
    public function getAllValues()
    {
        return $this->readOneof(3);
    }

    public function hasAllValues()
    {
        return $this->hasOneof(3);
    }

    /**
     * Returns the unboxed value from <code>getAllValues()</code>

     * If all_values is set to true, then all possible labels of the keyed
     * feature will have another slice computed.
     * Example: `{"all_values":{"value":true}}`
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue all_values = 3;</code>
     * @return bool|null
     */
    public function getAllValuesUnwrapped()
    {
        return $this->readWrapperValue("all_values");
    }

    /**
     * If all_values is set to true, then all possible labels of the keyed
     * feature will have another slice computed.
     * Example: `{"all_values":{"value":true}}`
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue all_values = 3;</code>
     * @param \Google\Protobuf\BoolValue $var
     * @return $this
     */
    public function setAllValues($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\BoolValue::class);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * Sets the field by wrapping a primitive type in a Google\Protobuf\BoolValue object.

     * If all_values is set to true, then all possible labels of the keyed
     * feature will have another slice computed.
     * Example: `{"all_values":{"value":true}}`
     *
     * Generated from protobuf field <code>.google.protobuf.BoolValue all_values = 3;</code>
     * @param bool|null $var
     * @return $this
     */
    public function setAllValuesUnwrapped($var)
    {
        $this->writeWrapperValue("all_values", $var);
        return $this;}

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

}

