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

/**
 * Identifies a metric, by describing the source which generated the
 * metric.
 *
 * Generated from protobuf message <code>google.dataflow.v1beta3.MetricStructuredName</code>
 */
class MetricStructuredName extends \Google\Protobuf\Internal\Message
{
    /**
     * Origin (namespace) of metric name. May be blank for user-define metrics;
     * will be "dataflow" for metrics defined by the Dataflow service or SDK.
     *
     * Generated from protobuf field <code>string origin = 1;</code>
     */
    private $origin = '';
    /**
     * Worker-defined metric name.
     *
     * Generated from protobuf field <code>string name = 2;</code>
     */
    private $name = '';
    /**
     * Zero or more labeled fields which identify the part of the job this
     * metric is associated with, such as the name of a step or collection.
     * For example, built-in counters associated with steps will have
     * context['step'] = <step-name>. Counters associated with PCollections
     * in the SDK will have context['pcollection'] = <pcollection-name>.
     *
     * Generated from protobuf field <code>map<string, string> context = 3;</code>
     */
    private $context;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $origin
     *           Origin (namespace) of metric name. May be blank for user-define metrics;
     *           will be "dataflow" for metrics defined by the Dataflow service or SDK.
     *     @type string $name
     *           Worker-defined metric name.
     *     @type array|\Google\Protobuf\Internal\MapField $context
     *           Zero or more labeled fields which identify the part of the job this
     *           metric is associated with, such as the name of a step or collection.
     *           For example, built-in counters associated with steps will have
     *           context['step'] = <step-name>. Counters associated with PCollections
     *           in the SDK will have context['pcollection'] = <pcollection-name>.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Dataflow\V1Beta3\Metrics::initOnce();
        parent::__construct($data);
    }

    /**
     * Origin (namespace) of metric name. May be blank for user-define metrics;
     * will be "dataflow" for metrics defined by the Dataflow service or SDK.
     *
     * Generated from protobuf field <code>string origin = 1;</code>
     * @return string
     */
    public function getOrigin()
    {
        return $this->origin;
    }

    /**
     * Origin (namespace) of metric name. May be blank for user-define metrics;
     * will be "dataflow" for metrics defined by the Dataflow service or SDK.
     *
     * Generated from protobuf field <code>string origin = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setOrigin($var)
    {
        GPBUtil::checkString($var, True);
        $this->origin = $var;

        return $this;
    }

    /**
     * Worker-defined metric name.
     *
     * Generated from protobuf field <code>string name = 2;</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }

    /**
     * Worker-defined metric name.
     *
     * Generated from protobuf field <code>string name = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;

        return $this;
    }

    /**
     * Zero or more labeled fields which identify the part of the job this
     * metric is associated with, such as the name of a step or collection.
     * For example, built-in counters associated with steps will have
     * context['step'] = <step-name>. Counters associated with PCollections
     * in the SDK will have context['pcollection'] = <pcollection-name>.
     *
     * Generated from protobuf field <code>map<string, string> context = 3;</code>
     * @return \Google\Protobuf\Internal\MapField
     */
    public function getContext()
    {
        return $this->context;
    }

    /**
     * Zero or more labeled fields which identify the part of the job this
     * metric is associated with, such as the name of a step or collection.
     * For example, built-in counters associated with steps will have
     * context['step'] = <step-name>. Counters associated with PCollections
     * in the SDK will have context['pcollection'] = <pcollection-name>.
     *
     * Generated from protobuf field <code>map<string, string> context = 3;</code>
     * @param array|\Google\Protobuf\Internal\MapField $var
     * @return $this
     */
    public function setContext($var)
    {
        $arr = GPBUtil::checkMapField($var, \Google\Protobuf\Internal\GPBType::STRING, \Google\Protobuf\Internal\GPBType::STRING);
        $this->context = $arr;

        return $this;
    }

}

