<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/dataflow/v1beta3/metrics.proto

namespace Google\Cloud\Dataflow\V1beta3;

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

/**
 * Describes the state of a metric.
 *
 * Generated from protobuf message <code>google.dataflow.v1beta3.MetricUpdate</code>
 */
class MetricUpdate extends \Google\Protobuf\Internal\Message
{
    /**
     * Name of the metric.
     *
     * Generated from protobuf field <code>.google.dataflow.v1beta3.MetricStructuredName name = 1;</code>
     */
    private $name = null;
    /**
     * Metric aggregation kind.  The possible metric aggregation kinds are
     * "Sum", "Max", "Min", "Mean", "Set", "And", "Or", and "Distribution".
     * The specified aggregation kind is case-insensitive.
     * If omitted, this is not an aggregated value but instead
     * a single metric sample value.
     *
     * Generated from protobuf field <code>string kind = 2;</code>
     */
    private $kind = '';
    /**
     * True if this metric is reported as the total cumulative aggregate
     * value accumulated since the worker started working on this WorkItem.
     * By default this is false, indicating that this metric is reported
     * as a delta that is not associated with any WorkItem.
     *
     * Generated from protobuf field <code>bool cumulative = 3;</code>
     */
    private $cumulative = false;
    /**
     * Worker-computed aggregate value for aggregation kinds "Sum", "Max", "Min",
     * "And", and "Or".  The possible value types are Long, Double, and Boolean.
     *
     * Generated from protobuf field <code>.google.protobuf.Value scalar = 4;</code>
     */
    private $scalar = null;
    /**
     * Worker-computed aggregate value for the "Mean" aggregation kind.
     * This holds the sum of the aggregated values and is used in combination
     * with mean_count below to obtain the actual mean aggregate value.
     * The only possible value types are Long and Double.
     *
     * Generated from protobuf field <code>.google.protobuf.Value mean_sum = 5;</code>
     */
    private $mean_sum = null;
    /**
     * Worker-computed aggregate value for the "Mean" aggregation kind.
     * This holds the count of the aggregated values and is used in combination
     * with mean_sum above to obtain the actual mean aggregate value.
     * The only possible value type is Long.
     *
     * Generated from protobuf field <code>.google.protobuf.Value mean_count = 6;</code>
     */
    private $mean_count = null;
    /**
     * Worker-computed aggregate value for the "Set" aggregation kind.  The only
     * possible value type is a list of Values whose type can be Long, Double,
     * or String, according to the metric's type.  All Values in the list must
     * be of the same type.
     *
     * Generated from protobuf field <code>.google.protobuf.Value set = 7;</code>
     */
    private $set = null;
    /**
     * A struct value describing properties of a distribution of numeric values.
     *
     * Generated from protobuf field <code>.google.protobuf.Value distribution = 11;</code>
     */
    private $distribution = null;
    /**
     * A struct value describing properties of a Gauge.
     * Metrics of gauge type show the value of a metric across time, and is
     * aggregated based on the newest value.
     *
     * Generated from protobuf field <code>.google.protobuf.Value gauge = 12;</code>
     */
    private $gauge = null;
    /**
     * Worker-computed aggregate value for internal use by the Dataflow
     * service.
     *
     * Generated from protobuf field <code>.google.protobuf.Value internal = 8;</code>
     */
    private $internal = null;
    /**
     * Timestamp associated with the metric value. Optional when workers are
     * reporting work progress; it will be filled in responses from the
     * metrics API.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 9;</code>
     */
    private $update_time = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\Dataflow\V1beta3\MetricStructuredName $name
     *           Name of the metric.
     *     @type string $kind
     *           Metric aggregation kind.  The possible metric aggregation kinds are
     *           "Sum", "Max", "Min", "Mean", "Set", "And", "Or", and "Distribution".
     *           The specified aggregation kind is case-insensitive.
     *           If omitted, this is not an aggregated value but instead
     *           a single metric sample value.
     *     @type bool $cumulative
     *           True if this metric is reported as the total cumulative aggregate
     *           value accumulated since the worker started working on this WorkItem.
     *           By default this is false, indicating that this metric is reported
     *           as a delta that is not associated with any WorkItem.
     *     @type \Google\Protobuf\Value $scalar
     *           Worker-computed aggregate value for aggregation kinds "Sum", "Max", "Min",
     *           "And", and "Or".  The possible value types are Long, Double, and Boolean.
     *     @type \Google\Protobuf\Value $mean_sum
     *           Worker-computed aggregate value for the "Mean" aggregation kind.
     *           This holds the sum of the aggregated values and is used in combination
     *           with mean_count below to obtain the actual mean aggregate value.
     *           The only possible value types are Long and Double.
     *     @type \Google\Protobuf\Value $mean_count
     *           Worker-computed aggregate value for the "Mean" aggregation kind.
     *           This holds the count of the aggregated values and is used in combination
     *           with mean_sum above to obtain the actual mean aggregate value.
     *           The only possible value type is Long.
     *     @type \Google\Protobuf\Value $set
     *           Worker-computed aggregate value for the "Set" aggregation kind.  The only
     *           possible value type is a list of Values whose type can be Long, Double,
     *           or String, according to the metric's type.  All Values in the list must
     *           be of the same type.
     *     @type \Google\Protobuf\Value $distribution
     *           A struct value describing properties of a distribution of numeric values.
     *     @type \Google\Protobuf\Value $gauge
     *           A struct value describing properties of a Gauge.
     *           Metrics of gauge type show the value of a metric across time, and is
     *           aggregated based on the newest value.
     *     @type \Google\Protobuf\Value $internal
     *           Worker-computed aggregate value for internal use by the Dataflow
     *           service.
     *     @type \Google\Protobuf\Timestamp $update_time
     *           Timestamp associated with the metric value. Optional when workers are
     *           reporting work progress; it will be filled in responses from the
     *           metrics API.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Dataflow\V1Beta3\Metrics::initOnce();
        parent::__construct($data);
    }

    /**
     * Name of the metric.
     *
     * Generated from protobuf field <code>.google.dataflow.v1beta3.MetricStructuredName name = 1;</code>
     * @return \Google\Cloud\Dataflow\V1beta3\MetricStructuredName|null
     */
    public function getName()
    {
        return $this->name;
    }

    public function hasName()
    {
        return isset($this->name);
    }

    public function clearName()
    {
        unset($this->name);
    }

    /**
     * Name of the metric.
     *
     * Generated from protobuf field <code>.google.dataflow.v1beta3.MetricStructuredName name = 1;</code>
     * @param \Google\Cloud\Dataflow\V1beta3\MetricStructuredName $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkMessage($var, \Google\Cloud\Dataflow\V1beta3\MetricStructuredName::class);
        $this->name = $var;

        return $this;
    }

    /**
     * Metric aggregation kind.  The possible metric aggregation kinds are
     * "Sum", "Max", "Min", "Mean", "Set", "And", "Or", and "Distribution".
     * The specified aggregation kind is case-insensitive.
     * If omitted, this is not an aggregated value but instead
     * a single metric sample value.
     *
     * Generated from protobuf field <code>string kind = 2;</code>
     * @return string
     */
    public function getKind()
    {
        return $this->kind;
    }

    /**
     * Metric aggregation kind.  The possible metric aggregation kinds are
     * "Sum", "Max", "Min", "Mean", "Set", "And", "Or", and "Distribution".
     * The specified aggregation kind is case-insensitive.
     * If omitted, this is not an aggregated value but instead
     * a single metric sample value.
     *
     * Generated from protobuf field <code>string kind = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setKind($var)
    {
        GPBUtil::checkString($var, True);
        $this->kind = $var;

        return $this;
    }

    /**
     * True if this metric is reported as the total cumulative aggregate
     * value accumulated since the worker started working on this WorkItem.
     * By default this is false, indicating that this metric is reported
     * as a delta that is not associated with any WorkItem.
     *
     * Generated from protobuf field <code>bool cumulative = 3;</code>
     * @return bool
     */
    public function getCumulative()
    {
        return $this->cumulative;
    }

    /**
     * True if this metric is reported as the total cumulative aggregate
     * value accumulated since the worker started working on this WorkItem.
     * By default this is false, indicating that this metric is reported
     * as a delta that is not associated with any WorkItem.
     *
     * Generated from protobuf field <code>bool cumulative = 3;</code>
     * @param bool $var
     * @return $this
     */
    public function setCumulative($var)
    {
        GPBUtil::checkBool($var);
        $this->cumulative = $var;

        return $this;
    }

    /**
     * Worker-computed aggregate value for aggregation kinds "Sum", "Max", "Min",
     * "And", and "Or".  The possible value types are Long, Double, and Boolean.
     *
     * Generated from protobuf field <code>.google.protobuf.Value scalar = 4;</code>
     * @return \Google\Protobuf\Value|null
     */
    public function getScalar()
    {
        return $this->scalar;
    }

    public function hasScalar()
    {
        return isset($this->scalar);
    }

    public function clearScalar()
    {
        unset($this->scalar);
    }

    /**
     * Worker-computed aggregate value for aggregation kinds "Sum", "Max", "Min",
     * "And", and "Or".  The possible value types are Long, Double, and Boolean.
     *
     * Generated from protobuf field <code>.google.protobuf.Value scalar = 4;</code>
     * @param \Google\Protobuf\Value $var
     * @return $this
     */
    public function setScalar($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Value::class);
        $this->scalar = $var;

        return $this;
    }

    /**
     * Worker-computed aggregate value for the "Mean" aggregation kind.
     * This holds the sum of the aggregated values and is used in combination
     * with mean_count below to obtain the actual mean aggregate value.
     * The only possible value types are Long and Double.
     *
     * Generated from protobuf field <code>.google.protobuf.Value mean_sum = 5;</code>
     * @return \Google\Protobuf\Value|null
     */
    public function getMeanSum()
    {
        return $this->mean_sum;
    }

    public function hasMeanSum()
    {
        return isset($this->mean_sum);
    }

    public function clearMeanSum()
    {
        unset($this->mean_sum);
    }

    /**
     * Worker-computed aggregate value for the "Mean" aggregation kind.
     * This holds the sum of the aggregated values and is used in combination
     * with mean_count below to obtain the actual mean aggregate value.
     * The only possible value types are Long and Double.
     *
     * Generated from protobuf field <code>.google.protobuf.Value mean_sum = 5;</code>
     * @param \Google\Protobuf\Value $var
     * @return $this
     */
    public function setMeanSum($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Value::class);
        $this->mean_sum = $var;

        return $this;
    }

    /**
     * Worker-computed aggregate value for the "Mean" aggregation kind.
     * This holds the count of the aggregated values and is used in combination
     * with mean_sum above to obtain the actual mean aggregate value.
     * The only possible value type is Long.
     *
     * Generated from protobuf field <code>.google.protobuf.Value mean_count = 6;</code>
     * @return \Google\Protobuf\Value|null
     */
    public function getMeanCount()
    {
        return $this->mean_count;
    }

    public function hasMeanCount()
    {
        return isset($this->mean_count);
    }

    public function clearMeanCount()
    {
        unset($this->mean_count);
    }

    /**
     * Worker-computed aggregate value for the "Mean" aggregation kind.
     * This holds the count of the aggregated values and is used in combination
     * with mean_sum above to obtain the actual mean aggregate value.
     * The only possible value type is Long.
     *
     * Generated from protobuf field <code>.google.protobuf.Value mean_count = 6;</code>
     * @param \Google\Protobuf\Value $var
     * @return $this
     */
    public function setMeanCount($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Value::class);
        $this->mean_count = $var;

        return $this;
    }

    /**
     * Worker-computed aggregate value for the "Set" aggregation kind.  The only
     * possible value type is a list of Values whose type can be Long, Double,
     * or String, according to the metric's type.  All Values in the list must
     * be of the same type.
     *
     * Generated from protobuf field <code>.google.protobuf.Value set = 7;</code>
     * @return \Google\Protobuf\Value|null
     */
    public function getSet()
    {
        return $this->set;
    }

    public function hasSet()
    {
        return isset($this->set);
    }

    public function clearSet()
    {
        unset($this->set);
    }

    /**
     * Worker-computed aggregate value for the "Set" aggregation kind.  The only
     * possible value type is a list of Values whose type can be Long, Double,
     * or String, according to the metric's type.  All Values in the list must
     * be of the same type.
     *
     * Generated from protobuf field <code>.google.protobuf.Value set = 7;</code>
     * @param \Google\Protobuf\Value $var
     * @return $this
     */
    public function setSet($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Value::class);
        $this->set = $var;

        return $this;
    }

    /**
     * A struct value describing properties of a distribution of numeric values.
     *
     * Generated from protobuf field <code>.google.protobuf.Value distribution = 11;</code>
     * @return \Google\Protobuf\Value|null
     */
    public function getDistribution()
    {
        return $this->distribution;
    }

    public function hasDistribution()
    {
        return isset($this->distribution);
    }

    public function clearDistribution()
    {
        unset($this->distribution);
    }

    /**
     * A struct value describing properties of a distribution of numeric values.
     *
     * Generated from protobuf field <code>.google.protobuf.Value distribution = 11;</code>
     * @param \Google\Protobuf\Value $var
     * @return $this
     */
    public function setDistribution($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Value::class);
        $this->distribution = $var;

        return $this;
    }

    /**
     * A struct value describing properties of a Gauge.
     * Metrics of gauge type show the value of a metric across time, and is
     * aggregated based on the newest value.
     *
     * Generated from protobuf field <code>.google.protobuf.Value gauge = 12;</code>
     * @return \Google\Protobuf\Value|null
     */
    public function getGauge()
    {
        return $this->gauge;
    }

    public function hasGauge()
    {
        return isset($this->gauge);
    }

    public function clearGauge()
    {
        unset($this->gauge);
    }

    /**
     * A struct value describing properties of a Gauge.
     * Metrics of gauge type show the value of a metric across time, and is
     * aggregated based on the newest value.
     *
     * Generated from protobuf field <code>.google.protobuf.Value gauge = 12;</code>
     * @param \Google\Protobuf\Value $var
     * @return $this
     */
    public function setGauge($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Value::class);
        $this->gauge = $var;

        return $this;
    }

    /**
     * Worker-computed aggregate value for internal use by the Dataflow
     * service.
     *
     * Generated from protobuf field <code>.google.protobuf.Value internal = 8;</code>
     * @return \Google\Protobuf\Value|null
     */
    public function getInternal()
    {
        return $this->internal;
    }

    public function hasInternal()
    {
        return isset($this->internal);
    }

    public function clearInternal()
    {
        unset($this->internal);
    }

    /**
     * Worker-computed aggregate value for internal use by the Dataflow
     * service.
     *
     * Generated from protobuf field <code>.google.protobuf.Value internal = 8;</code>
     * @param \Google\Protobuf\Value $var
     * @return $this
     */
    public function setInternal($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Value::class);
        $this->internal = $var;

        return $this;
    }

    /**
     * Timestamp associated with the metric value. Optional when workers are
     * reporting work progress; it will be filled in responses from the
     * metrics API.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 9;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getUpdateTime()
    {
        return $this->update_time;
    }

    public function hasUpdateTime()
    {
        return isset($this->update_time);
    }

    public function clearUpdateTime()
    {
        unset($this->update_time);
    }

    /**
     * Timestamp associated with the metric value. Optional when workers are
     * reporting work progress; it will be filled in responses from the
     * metrics API.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp update_time = 9;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setUpdateTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->update_time = $var;

        return $this;
    }

}

