<?php

# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/analytics/admin/v1alpha/resources.proto
namespace Matomo\Dependencies\GoogleAnalyticsImporter\Google\Analytics\Admin\V1alpha;

use Matomo\Dependencies\GoogleAnalyticsImporter\Google\Protobuf\Internal\GPBType;
use Matomo\Dependencies\GoogleAnalyticsImporter\Google\Protobuf\Internal\RepeatedField;
use Matomo\Dependencies\GoogleAnalyticsImporter\Google\Protobuf\Internal\GPBUtil;
/**
 * A definition for a calculated metric.
 *
 * Generated from protobuf message <code>google.analytics.admin.v1alpha.CalculatedMetric</code>
 */
class CalculatedMetric extends \Matomo\Dependencies\GoogleAnalyticsImporter\Google\Protobuf\Internal\Message
{
    /**
     * Output only. Resource name for this CalculatedMetric.
     * Format: 'properties/{property_id}/calculatedMetrics/{calculated_metric_id}'
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $name = '';
    /**
     * Optional. Description for this calculated metric.
     * Max length of 4096 characters.
     *
     * Generated from protobuf field <code>string description = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     */
    private $description = '';
    /**
     * Required. Display name for this calculated metric as shown in the
     * Google Analytics UI. Max length 82 characters.
     *
     * Generated from protobuf field <code>string display_name = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $display_name = '';
    /**
     * Output only. The ID to use for the calculated metric. In the UI, this is
     * referred to as the "API name."
     * The calculated_metric_id is used when referencing this calculated metric
     * from external APIs. For example, "calcMetric:{calculated_metric_id}".
     *
     * Generated from protobuf field <code>string calculated_metric_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $calculated_metric_id = '';
    /**
     * Required. The type for the calculated metric's value.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.CalculatedMetric.MetricUnit metric_unit = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $metric_unit = 0;
    /**
     * Output only. Types of restricted data that this metric contains.
     *
     * Generated from protobuf field <code>repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $restricted_metric_type;
    /**
     * Required. The calculated metric's definition. Maximum number of unique
     * referenced custom metrics is 5. Formulas supports the following operations:
     * + (addition),  - (subtraction), - (negative),  * (multiplication), /
     * (division), () (parenthesis). Any valid real numbers are acceptable that
     * fit in a Long (64bit integer) or a Double (64 bit floating point number).
     * Example formula:
     *   "( customEvent:parameter_name + cartPurchaseQuantity ) / 2.0"
     *
     * Generated from protobuf field <code>string formula = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    private $formula = '';
    /**
     * Output only. If true, this calculated metric has a invalid metric
     * reference. Anything using a calculated metric with invalid_metric_reference
     * set to true may fail, produce warnings, or produce unexpected results.
     *
     * Generated from protobuf field <code>bool invalid_metric_reference = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    private $invalid_metric_reference = \false;
    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $name
     *           Output only. Resource name for this CalculatedMetric.
     *           Format: 'properties/{property_id}/calculatedMetrics/{calculated_metric_id}'
     *     @type string $description
     *           Optional. Description for this calculated metric.
     *           Max length of 4096 characters.
     *     @type string $display_name
     *           Required. Display name for this calculated metric as shown in the
     *           Google Analytics UI. Max length 82 characters.
     *     @type string $calculated_metric_id
     *           Output only. The ID to use for the calculated metric. In the UI, this is
     *           referred to as the "API name."
     *           The calculated_metric_id is used when referencing this calculated metric
     *           from external APIs. For example, "calcMetric:{calculated_metric_id}".
     *     @type int $metric_unit
     *           Required. The type for the calculated metric's value.
     *     @type array<int>|\Google\Protobuf\Internal\RepeatedField $restricted_metric_type
     *           Output only. Types of restricted data that this metric contains.
     *     @type string $formula
     *           Required. The calculated metric's definition. Maximum number of unique
     *           referenced custom metrics is 5. Formulas supports the following operations:
     *           + (addition),  - (subtraction), - (negative),  * (multiplication), /
     *           (division), () (parenthesis). Any valid real numbers are acceptable that
     *           fit in a Long (64bit integer) or a Double (64 bit floating point number).
     *           Example formula:
     *             "( customEvent:parameter_name + cartPurchaseQuantity ) / 2.0"
     *     @type bool $invalid_metric_reference
     *           Output only. If true, this calculated metric has a invalid metric
     *           reference. Anything using a calculated metric with invalid_metric_reference
     *           set to true may fail, produce warnings, or produce unexpected results.
     * }
     */
    public function __construct($data = NULL)
    {
        \Matomo\Dependencies\GoogleAnalyticsImporter\GPBMetadata\Google\Analytics\Admin\V1Alpha\Resources::initOnce();
        parent::__construct($data);
    }
    /**
     * Output only. Resource name for this CalculatedMetric.
     * Format: 'properties/{property_id}/calculatedMetrics/{calculated_metric_id}'
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }
    /**
     * Output only. Resource name for this CalculatedMetric.
     * Format: 'properties/{property_id}/calculatedMetrics/{calculated_metric_id}'
     *
     * Generated from protobuf field <code>string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setName($var)
    {
        GPBUtil::checkString($var, True);
        $this->name = $var;
        return $this;
    }
    /**
     * Optional. Description for this calculated metric.
     * Max length of 4096 characters.
     *
     * Generated from protobuf field <code>string description = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @return string
     */
    public function getDescription()
    {
        return $this->description;
    }
    /**
     * Optional. Description for this calculated metric.
     * Max length of 4096 characters.
     *
     * Generated from protobuf field <code>string description = 2 [(.google.api.field_behavior) = OPTIONAL];</code>
     * @param string $var
     * @return $this
     */
    public function setDescription($var)
    {
        GPBUtil::checkString($var, True);
        $this->description = $var;
        return $this;
    }
    /**
     * Required. Display name for this calculated metric as shown in the
     * Google Analytics UI. Max length 82 characters.
     *
     * Generated from protobuf field <code>string display_name = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getDisplayName()
    {
        return $this->display_name;
    }
    /**
     * Required. Display name for this calculated metric as shown in the
     * Google Analytics UI. Max length 82 characters.
     *
     * Generated from protobuf field <code>string display_name = 3 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setDisplayName($var)
    {
        GPBUtil::checkString($var, True);
        $this->display_name = $var;
        return $this;
    }
    /**
     * Output only. The ID to use for the calculated metric. In the UI, this is
     * referred to as the "API name."
     * The calculated_metric_id is used when referencing this calculated metric
     * from external APIs. For example, "calcMetric:{calculated_metric_id}".
     *
     * Generated from protobuf field <code>string calculated_metric_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getCalculatedMetricId()
    {
        return $this->calculated_metric_id;
    }
    /**
     * Output only. The ID to use for the calculated metric. In the UI, this is
     * referred to as the "API name."
     * The calculated_metric_id is used when referencing this calculated metric
     * from external APIs. For example, "calcMetric:{calculated_metric_id}".
     *
     * Generated from protobuf field <code>string calculated_metric_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setCalculatedMetricId($var)
    {
        GPBUtil::checkString($var, True);
        $this->calculated_metric_id = $var;
        return $this;
    }
    /**
     * Required. The type for the calculated metric's value.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.CalculatedMetric.MetricUnit metric_unit = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return int
     */
    public function getMetricUnit()
    {
        return $this->metric_unit;
    }
    /**
     * Required. The type for the calculated metric's value.
     *
     * Generated from protobuf field <code>.google.analytics.admin.v1alpha.CalculatedMetric.MetricUnit metric_unit = 5 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param int $var
     * @return $this
     */
    public function setMetricUnit($var)
    {
        GPBUtil::checkEnum($var, \Matomo\Dependencies\GoogleAnalyticsImporter\Google\Analytics\Admin\V1alpha\CalculatedMetric\MetricUnit::class);
        $this->metric_unit = $var;
        return $this;
    }
    /**
     * Output only. Types of restricted data that this metric contains.
     *
     * Generated from protobuf field <code>repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Internal\RepeatedField
     */
    public function getRestrictedMetricType()
    {
        return $this->restricted_metric_type;
    }
    /**
     * Output only. Types of restricted data that this metric contains.
     *
     * Generated from protobuf field <code>repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param array<int>|\Google\Protobuf\Internal\RepeatedField $var
     * @return $this
     */
    public function setRestrictedMetricType($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Matomo\Dependencies\GoogleAnalyticsImporter\Google\Protobuf\Internal\GPBType::ENUM, \Matomo\Dependencies\GoogleAnalyticsImporter\Google\Analytics\Admin\V1alpha\CalculatedMetric\RestrictedMetricType::class);
        $this->restricted_metric_type = $arr;
        return $this;
    }
    /**
     * Required. The calculated metric's definition. Maximum number of unique
     * referenced custom metrics is 5. Formulas supports the following operations:
     * + (addition),  - (subtraction), - (negative),  * (multiplication), /
     * (division), () (parenthesis). Any valid real numbers are acceptable that
     * fit in a Long (64bit integer) or a Double (64 bit floating point number).
     * Example formula:
     *   "( customEvent:parameter_name + cartPurchaseQuantity ) / 2.0"
     *
     * Generated from protobuf field <code>string formula = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getFormula()
    {
        return $this->formula;
    }
    /**
     * Required. The calculated metric's definition. Maximum number of unique
     * referenced custom metrics is 5. Formulas supports the following operations:
     * + (addition),  - (subtraction), - (negative),  * (multiplication), /
     * (division), () (parenthesis). Any valid real numbers are acceptable that
     * fit in a Long (64bit integer) or a Double (64 bit floating point number).
     * Example formula:
     *   "( customEvent:parameter_name + cartPurchaseQuantity ) / 2.0"
     *
     * Generated from protobuf field <code>string formula = 7 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setFormula($var)
    {
        GPBUtil::checkString($var, True);
        $this->formula = $var;
        return $this;
    }
    /**
     * Output only. If true, this calculated metric has a invalid metric
     * reference. Anything using a calculated metric with invalid_metric_reference
     * set to true may fail, produce warnings, or produce unexpected results.
     *
     * Generated from protobuf field <code>bool invalid_metric_reference = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return bool
     */
    public function getInvalidMetricReference()
    {
        return $this->invalid_metric_reference;
    }
    /**
     * Output only. If true, this calculated metric has a invalid metric
     * reference. Anything using a calculated metric with invalid_metric_reference
     * set to true may fail, produce warnings, or produce unexpected results.
     *
     * Generated from protobuf field <code>bool invalid_metric_reference = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param bool $var
     * @return $this
     */
    public function setInvalidMetricReference($var)
    {
        GPBUtil::checkBool($var);
        $this->invalid_metric_reference = $var;
        return $this;
    }
}
