Struct google_api_proto::google::analytics::admin::v1alpha::CalculatedMetric
source · pub struct CalculatedMetric {
pub name: String,
pub description: String,
pub display_name: String,
pub calculated_metric_id: String,
pub metric_unit: i32,
pub restricted_metric_type: Vec<i32>,
pub formula: String,
pub invalid_metric_reference: bool,
}
Expand description
A definition for a calculated metric.
Fields§
§name: String
Output only. Resource name for this CalculatedMetric. Format: ‘properties/{property_id}/calculatedMetrics/{calculated_metric_id}’
description: String
Optional. Description for this calculated metric. Max length of 4096 characters.
display_name: String
Required. Display name for this calculated metric as shown in the Google Analytics UI. Max length 82 characters.
calculated_metric_id: String
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}”.
metric_unit: i32
Required. The type for the calculated metric’s value.
restricted_metric_type: Vec<i32>
Output only. Types of restricted data that this metric contains.
formula: String
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”
invalid_metric_reference: bool
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.
Implementations§
source§impl CalculatedMetric
impl CalculatedMetric
sourcepub fn metric_unit(&self) -> MetricUnit
pub fn metric_unit(&self) -> MetricUnit
Returns the enum value of metric_unit
, or the default if the field is set to an invalid enum value.
sourcepub fn set_metric_unit(&mut self, value: MetricUnit)
pub fn set_metric_unit(&mut self, value: MetricUnit)
Sets metric_unit
to the provided enum value.
sourcepub fn restricted_metric_type(
&self,
) -> FilterMap<Cloned<Iter<'_, i32>>, fn(_: i32) -> Option<RestrictedMetricType>>
pub fn restricted_metric_type( &self, ) -> FilterMap<Cloned<Iter<'_, i32>>, fn(_: i32) -> Option<RestrictedMetricType>>
Returns an iterator which yields the valid enum values contained in restricted_metric_type
.
sourcepub fn push_restricted_metric_type(&mut self, value: RestrictedMetricType)
pub fn push_restricted_metric_type(&mut self, value: RestrictedMetricType)
Appends the provided enum value to restricted_metric_type
.
Trait Implementations§
source§impl Clone for CalculatedMetric
impl Clone for CalculatedMetric
source§fn clone(&self) -> CalculatedMetric
fn clone(&self) -> CalculatedMetric
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CalculatedMetric
impl Debug for CalculatedMetric
source§impl Default for CalculatedMetric
impl Default for CalculatedMetric
source§impl Message for CalculatedMetric
impl Message for CalculatedMetric
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
. Read moresource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self
.source§impl PartialEq for CalculatedMetric
impl PartialEq for CalculatedMetric
source§fn eq(&self, other: &CalculatedMetric) -> bool
fn eq(&self, other: &CalculatedMetric) -> bool
self
and other
values to be equal, and is used
by ==
.impl StructuralPartialEq for CalculatedMetric
Auto Trait Implementations§
impl Freeze for CalculatedMetric
impl RefUnwindSafe for CalculatedMetric
impl Send for CalculatedMetric
impl Sync for CalculatedMetric
impl Unpin for CalculatedMetric
impl UnwindSafe for CalculatedMetric
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request