<?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;

/**
 * JobMetrics contains a collection of metrics describing the detailed progress
 * of a Dataflow job. Metrics correspond to user-defined and system-defined
 * metrics in the job.
 * This resource captures only the most recent values of each metric;
 * time-series data can be queried for them (under the same metric names)
 * from Cloud Monitoring.
 *
 * Generated from protobuf message <code>google.dataflow.v1beta3.JobMetrics</code>
 */
class JobMetrics extends \Google\Protobuf\Internal\Message
{
    /**
     * Timestamp as of which metric values are current.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp metric_time = 1;</code>
     */
    private $metric_time = null;
    /**
     * All metrics for this job.
     *
     * Generated from protobuf field <code>repeated .google.dataflow.v1beta3.MetricUpdate metrics = 2;</code>
     */
    private $metrics;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Protobuf\Timestamp $metric_time
     *           Timestamp as of which metric values are current.
     *     @type array<\Google\Cloud\Dataflow\V1beta3\MetricUpdate>|\Google\Protobuf\Internal\RepeatedField $metrics
     *           All metrics for this job.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Dataflow\V1Beta3\Metrics::initOnce();
        parent::__construct($data);
    }

    /**
     * Timestamp as of which metric values are current.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp metric_time = 1;</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getMetricTime()
    {
        return $this->metric_time;
    }

    public function hasMetricTime()
    {
        return isset($this->metric_time);
    }

    public function clearMetricTime()
    {
        unset($this->metric_time);
    }

    /**
     * Timestamp as of which metric values are current.
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp metric_time = 1;</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setMetricTime($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->metric_time = $var;

        return $this;
    }

    /**
     * All metrics for this job.
     *
     * Generated from protobuf field <code>repeated .google.dataflow.v1beta3.MetricUpdate metrics = 2;</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getMetrics()
    {
        return $this->metrics;
    }

    /**
     * All metrics for this job.
     *
     * Generated from protobuf field <code>repeated .google.dataflow.v1beta3.MetricUpdate metrics = 2;</code>
     * @param array<\Google\Cloud\Dataflow\V1beta3\MetricUpdate>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setMetrics($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\Dataflow\V1beta3\MetricUpdate::class);
        $this->metrics = $arr;

        return $this;
    }

}

