Class CalculatedMetric (0.50.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
TypeDescription
int

DESCRIPTION_FIELD_NUMBER

public static final int DESCRIPTION_FIELD_NUMBER
Field Value
TypeDescription
int

DISPLAY_NAME_FIELD_NUMBER

public static final int DISPLAY_NAME_FIELD_NUMBER
Field Value
TypeDescription
int

FORMULA_FIELD_NUMBER

public static final int FORMULA_FIELD_NUMBER
Field Value
TypeDescription
int

INVALID_METRIC_REFERENCE_FIELD_NUMBER

public static final int INVALID_METRIC_REFERENCE_FIELD_NUMBER
Field Value
TypeDescription
int

METRIC_UNIT_FIELD_NUMBER

public static final int METRIC_UNIT_FIELD_NUMBER
Field Value
TypeDescription
int

NAME_FIELD_NUMBER

public static final int NAME_FIELD_NUMBER
Field Value
TypeDescription
int

RESTRICTED_METRIC_TYPE_FIELD_NUMBER

public static final int RESTRICTED_METRIC_TYPE_FIELD_NUMBER
Field Value
TypeDescription
int

Static Methods

getDefaultInstance()

public static CalculatedMetric getDefaultInstance()
Returns
TypeDescription
CalculatedMetric

getDescriptor()

public static final Descriptors.Descriptor getDescriptor()
Returns
TypeDescription
Descriptor

newBuilder()

public static CalculatedMetric.Builder newBuilder()
Returns
TypeDescription
CalculatedMetric.Builder

newBuilder(CalculatedMetric prototype)

public static CalculatedMetric.Builder newBuilder(CalculatedMetric prototype)
Parameter
NameDescription
prototypeCalculatedMetric
Returns
TypeDescription
CalculatedMetric.Builder

parseDelimitedFrom(InputStream input)

public static CalculatedMetric parseDelimitedFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
CalculatedMetric
Exceptions
TypeDescription
IOException

parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CalculatedMetric parseDelimitedFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CalculatedMetric
Exceptions
TypeDescription
IOException

parseFrom(byte[] data)

public static CalculatedMetric parseFrom(byte[] data)
Parameter
NameDescription
databyte[]
Returns
TypeDescription
CalculatedMetric
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)

public static CalculatedMetric parseFrom(byte[] data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
databyte[]
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CalculatedMetric
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data)

public static CalculatedMetric parseFrom(ByteString data)
Parameter
NameDescription
dataByteString
Returns
TypeDescription
CalculatedMetric
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)

public static CalculatedMetric parseFrom(ByteString data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteString
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CalculatedMetric
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(CodedInputStream input)

public static CalculatedMetric parseFrom(CodedInputStream input)
Parameter
NameDescription
inputCodedInputStream
Returns
TypeDescription
CalculatedMetric
Exceptions
TypeDescription
IOException

parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)

public static CalculatedMetric parseFrom(CodedInputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputCodedInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CalculatedMetric
Exceptions
TypeDescription
IOException

parseFrom(InputStream input)

public static CalculatedMetric parseFrom(InputStream input)
Parameter
NameDescription
inputInputStream
Returns
TypeDescription
CalculatedMetric
Exceptions
TypeDescription
IOException

parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)

public static CalculatedMetric parseFrom(InputStream input, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
inputInputStream
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CalculatedMetric
Exceptions
TypeDescription
IOException

parseFrom(ByteBuffer data)

public static CalculatedMetric parseFrom(ByteBuffer data)
Parameter
NameDescription
dataByteBuffer
Returns
TypeDescription
CalculatedMetric
Exceptions
TypeDescription
InvalidProtocolBufferException

parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)

public static CalculatedMetric parseFrom(ByteBuffer data, ExtensionRegistryLite extensionRegistry)
Parameters
NameDescription
dataByteBuffer
extensionRegistryExtensionRegistryLite
Returns
TypeDescription
CalculatedMetric
Exceptions
TypeDescription
InvalidProtocolBufferException

parser()

public static Parser<CalculatedMetric> parser()
Returns
TypeDescription
Parser<CalculatedMetric>

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for calculatedMetricId.

getDefaultInstanceForType()

public CalculatedMetric getDefaultInstanceForType()
Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
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
TypeDescription
ByteString

The bytes for name.

getParserForType()

public Parser<CalculatedMetric> getParserForType()
Returns
TypeDescription
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
NameDescription
indexint

The index of the element to return.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
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
NameDescription
indexint

The index of the value to return.

Returns
TypeDescription
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
TypeDescription
List<Integer>

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

getSerializedSize()

public int getSerializedSize()
Returns
TypeDescription
int
Overrides

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

internalGetFieldAccessorTable()

protected GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
Returns
TypeDescription
FieldAccessorTable
Overrides

isInitialized()

public final boolean isInitialized()
Returns
TypeDescription
boolean
Overrides

newBuilderForType()

public CalculatedMetric.Builder newBuilderForType()
Returns
TypeDescription
CalculatedMetric.Builder

newBuilderForType(GeneratedMessageV3.BuilderParent parent)

protected CalculatedMetric.Builder newBuilderForType(GeneratedMessageV3.BuilderParent parent)
Parameter
NameDescription
parentBuilderParent
Returns
TypeDescription
CalculatedMetric.Builder
Overrides

newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)

protected Object newInstance(GeneratedMessageV3.UnusedPrivateParameter unused)
Parameter
NameDescription
unusedUnusedPrivateParameter
Returns
TypeDescription
Object
Overrides

toBuilder()

public CalculatedMetric.Builder toBuilder()
Returns
TypeDescription
CalculatedMetric.Builder

writeTo(CodedOutputStream output)

public void writeTo(CodedOutputStream output)
Parameter
NameDescription
outputCodedOutputStream
Overrides
Exceptions
TypeDescription
IOException