Class CalculatedMetric (0.59.0)

public final class CalculatedMetric extends GeneratedMessageV3 implements CalculatedMetricOrBuilder

A definition for a calculated metric.

Protobuf type google.analytics.admin.v1alpha.CalculatedMetric

Static Fields

CALCULATED_METRIC_ID_FIELD_NUMBER

public static final int CALCULATED_METRIC_ID_FIELD_NUMBER
Field Value
Type Description
int

DESCRIPTION_FIELD_NUMBER

public static final int DESCRIPTION_FIELD_NUMBER
Field Value
Type Description
int

DISPLAY_NAME_FIELD_NUMBER

public static final int DISPLAY_NAME_FIELD_NUMBER
Field Value
Type Description
int

FORMULA_FIELD_NUMBER

public static final int FORMULA_FIELD_NUMBER
Field Value
Type Description
int

INVALID_METRIC_REFERENCE_FIELD_NUMBER

public static final int INVALID_METRIC_REFERENCE_FIELD_NUMBER
Field Value
Type Description
int

METRIC_UNIT_FIELD_NUMBER

public static final int METRIC_UNIT_FIELD_NUMBER
Field Value
Type Description
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
Type Description
int

RESTRICTED_METRIC_TYPE_FIELD_NUMBER

public static final int RESTRICTED_METRIC_TYPE_FIELD_NUMBER
Field Value
Type Description
int

Static Methods

getDefaultInstance()

public static CalculatedMetric getDefaultInstance()
Returns
Type Description
CalculatedMetric

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
Type Description
Descriptor

newBuilder()

public static CalculatedMetric.Builder newBuilder()
Returns
Type Description
CalculatedMetric.Builder

newBuilder(CalculatedMetric prototype)

public static CalculatedMetric.Builder newBuilder(CalculatedMetric prototype)
Parameter
Name Description
prototype CalculatedMetric
Returns
Type Description
CalculatedMetric.Builder

parseDelimitedFrom(InputStream input)

public static CalculatedMetric parseDelimitedFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
CalculatedMetric
Exceptions
Type Description
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CalculatedMetric parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CalculatedMetric
Exceptions
Type Description
IOException

parseFrom(byte[] data)

public static CalculatedMetric parseFrom(byte[] data)
Parameter
Name Description
data byte[]
Returns
Type Description
CalculatedMetric
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static CalculatedMetric parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data byte[]
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CalculatedMetric
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data)

public static CalculatedMetric parseFrom(ByteString data)
Parameter
Name Description
data ByteString
Returns
Type Description
CalculatedMetric
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static CalculatedMetric parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteString
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CalculatedMetric
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static CalculatedMetric parseFrom(CodedInputStream input)
Parameter
Name Description
input CodedInputStream
Returns
Type Description
CalculatedMetric
Exceptions
Type Description
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static CalculatedMetric parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input CodedInputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CalculatedMetric
Exceptions
Type Description
IOException

parseFrom(InputStream input)

public static CalculatedMetric parseFrom(InputStream input)
Parameter
Name Description
input InputStream
Returns
Type Description
CalculatedMetric
Exceptions
Type Description
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CalculatedMetric parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
input InputStream
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CalculatedMetric
Exceptions
Type Description
IOException

parseFrom(ByteBuffer data)

public static CalculatedMetric parseFrom(ByteBuffer data)
Parameter
Name Description
data ByteBuffer
Returns
Type Description
CalculatedMetric
Exceptions
Type Description
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static CalculatedMetric parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
Name Description
data ByteBuffer
extensionRegistry ExtensionRegistryLite
Returns
Type Description
CalculatedMetric
Exceptions
Type Description
InvalidProtocolBufferException

parser()

public static Parser<CalculatedMetric> parser()
Returns
Type Description
Parser<CalculatedMetric>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
Name Description
obj Object
Returns
Type Description
boolean
Overrides

getCalculatedMetricId()

public String getCalculatedMetricId()

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}".

string calculated_metric_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The calculatedMetricId.

getCalculatedMetricIdBytes()

public ByteString getCalculatedMetricIdBytes()

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}".

string calculated_metric_id = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for calculatedMetricId.

getDefaultInstanceForType()

public CalculatedMetric getDefaultInstanceForType()
Returns
Type Description
CalculatedMetric

getDescription()

public String getDescription()

Optional. Description for this calculated metric. Max length of 4096 characters.

string description = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
String

The description.

getDescriptionBytes()

public ByteString getDescriptionBytes()

Optional. Description for this calculated metric. Max length of 4096 characters.

string description = 2 [(.google.api.field_behavior) = OPTIONAL];

Returns
Type Description
ByteString

The bytes for description.

getDisplayName()

public String getDisplayName()

Required. Display name for this calculated metric as shown in the Google Analytics UI. Max length 82 characters.

string display_name = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The displayName.

getDisplayNameBytes()

public ByteString getDisplayNameBytes()

Required. Display name for this calculated metric as shown in the Google Analytics UI. Max length 82 characters.

string display_name = 3 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for displayName.

getFormula()

public String getFormula()

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"

string formula = 7 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
String

The formula.

getFormulaBytes()

public ByteString getFormulaBytes()

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"

string formula = 7 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
ByteString

The bytes for formula.

getInvalidMetricReference()

public boolean getInvalidMetricReference()

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.

bool invalid_metric_reference = 9 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
boolean

The invalidMetricReference.

getMetricUnit()

public CalculatedMetric.MetricUnit getMetricUnit()

Required. The type for the calculated metric's value.

.google.analytics.admin.v1alpha.CalculatedMetric.MetricUnit metric_unit = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
CalculatedMetric.MetricUnit

The metricUnit.

getMetricUnitValue()

public int getMetricUnitValue()

Required. The type for the calculated metric's value.

.google.analytics.admin.v1alpha.CalculatedMetric.MetricUnit metric_unit = 5 [(.google.api.field_behavior) = REQUIRED];

Returns
Type Description
int

The enum numeric value on the wire for metricUnit.

getName()

public String getName()

Output only. Resource name for this CalculatedMetric. Format: 'properties/{property_id}/calculatedMetrics/{calculated_metric_id}'

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
String

The name.

getNameBytes()

public ByteString getNameBytes()

Output only. Resource name for this CalculatedMetric. Format: 'properties/{property_id}/calculatedMetrics/{calculated_metric_id}'

string name = 1 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
ByteString

The bytes for name.

getParserForType()

public Parser<CalculatedMetric> getParserForType()
Returns
Type Description
Parser<CalculatedMetric>
Overrides

getRestrictedMetricType(int index)

public CalculatedMetric.RestrictedMetricType getRestrictedMetricType(int index)

Output only. Types of restricted data that this metric contains.

repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int

The index of the element to return.

Returns
Type Description
CalculatedMetric.RestrictedMetricType

The restrictedMetricType at the given index.

getRestrictedMetricTypeCount()

public int getRestrictedMetricTypeCount()

Output only. Types of restricted data that this metric contains.

repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
int

The count of restrictedMetricType.

getRestrictedMetricTypeList()

public List<CalculatedMetric.RestrictedMetricType> getRestrictedMetricTypeList()

Output only. Types of restricted data that this metric contains.

repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<RestrictedMetricType>

A list containing the restrictedMetricType.

getRestrictedMetricTypeValue(int index)

public int getRestrictedMetricTypeValue(int index)

Output only. Types of restricted data that this metric contains.

repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Parameter
Name Description
index int

The index of the value to return.

Returns
Type Description
int

The enum numeric value on the wire of restrictedMetricType at the given index.

getRestrictedMetricTypeValueList()

public List<Integer> getRestrictedMetricTypeValueList()

Output only. Types of restricted data that this metric contains.

repeated .google.analytics.admin.v1alpha.CalculatedMetric.RestrictedMetricType restricted_metric_type = 6 [(.google.api.field_behavior) = OUTPUT_ONLY];

Returns
Type Description
List<Integer>

A list containing the enum numeric values on the wire for restrictedMetricType.

getSerializedSize()

public int getSerializedSize()
Returns
Type Description
int
Overrides

hashCode()

public int hashCode()
Returns
Type Description
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
Type Description
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
Type Description
boolean
Overrides

newBuilderForType()

public CalculatedMetric.Builder newBuilderForType()
Returns
Type Description
CalculatedMetric.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected CalculatedMetric.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
Name Description
parent BuilderParent
Returns
Type Description
CalculatedMetric.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
Name Description
unused UnusedPrivateParameter
Returns
Type Description
Object
Overrides

toBuilder()

public CalculatedMetric.Builder toBuilder()
Returns
Type Description
CalculatedMetric.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
Name Description
output CodedOutputStream
Overrides
Exceptions
Type Description
IOException