Class: Google::Apis::AnalyticsadminV1alpha::GoogleAnalyticsAdminV1alphaCalculatedMetric

Inherits:
Object
  • Object
show all
Includes:
Core::Hashable, Core::JsonObjectSupport
Defined in:
lib/google/apis/analyticsadmin_v1alpha/classes.rb,
lib/google/apis/analyticsadmin_v1alpha/representations.rb,
lib/google/apis/analyticsadmin_v1alpha/representations.rb

Overview

A definition for a calculated metric.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**args) ⇒ GoogleAnalyticsAdminV1alphaCalculatedMetric

Returns a new instance of GoogleAnalyticsAdminV1alphaCalculatedMetric.



1698
1699
1700
# File 'lib/google/apis/analyticsadmin_v1alpha/classes.rb', line 1698

def initialize(**args)
   update!(**args)
end

Instance Attribute Details

#calculated_metric_idString

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". Corresponds to the JSON property calculatedMetricId

Returns:

  • (String)


1650
1651
1652
# File 'lib/google/apis/analyticsadmin_v1alpha/classes.rb', line 1650

def calculated_metric_id
  @calculated_metric_id
end

#descriptionString

Optional. Description for this calculated metric. Max length of 4096 characters. Corresponds to the JSON property description

Returns:

  • (String)


1656
1657
1658
# File 'lib/google/apis/analyticsadmin_v1alpha/classes.rb', line 1656

def description
  @description
end

#display_nameString

Required. Display name for this calculated metric as shown in the Google Analytics UI. Max length 82 characters. Corresponds to the JSON property displayName

Returns:

  • (String)


1662
1663
1664
# File 'lib/google/apis/analyticsadmin_v1alpha/classes.rb', line 1662

def display_name
  @display_name
end

#formulaString

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" Corresponds to the JSON property formula

Returns:

  • (String)


1672
1673
1674
# File 'lib/google/apis/analyticsadmin_v1alpha/classes.rb', line 1672

def formula
  @formula
end

#invalid_metric_referenceBoolean Also known as: 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. Corresponds to the JSON property invalidMetricReference

Returns:

  • (Boolean)


1679
1680
1681
# File 'lib/google/apis/analyticsadmin_v1alpha/classes.rb', line 1679

def invalid_metric_reference
  @invalid_metric_reference
end

#metric_unitString

Required. The type for the calculated metric's value. Corresponds to the JSON property metricUnit

Returns:

  • (String)


1685
1686
1687
# File 'lib/google/apis/analyticsadmin_v1alpha/classes.rb', line 1685

def metric_unit
  @metric_unit
end

#nameString

Output only. Resource name for this CalculatedMetric. Format: 'properties/ property_id/calculatedMetrics/calculated_metric_id' Corresponds to the JSON property name

Returns:

  • (String)


1691
1692
1693
# File 'lib/google/apis/analyticsadmin_v1alpha/classes.rb', line 1691

def name
  @name
end

#restricted_metric_typeArray<String>

Output only. Types of restricted data that this metric contains. Corresponds to the JSON property restrictedMetricType

Returns:

  • (Array<String>)


1696
1697
1698
# File 'lib/google/apis/analyticsadmin_v1alpha/classes.rb', line 1696

def restricted_metric_type
  @restricted_metric_type
end

Instance Method Details

#update!(**args) ⇒ Object

Update properties of this object



1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
# File 'lib/google/apis/analyticsadmin_v1alpha/classes.rb', line 1703

def update!(**args)
  @calculated_metric_id = args[:calculated_metric_id] if args.key?(:calculated_metric_id)
  @description = args[:description] if args.key?(:description)
  @display_name = args[:display_name] if args.key?(:display_name)
  @formula = args[:formula] if args.key?(:formula)
  @invalid_metric_reference = args[:invalid_metric_reference] if args.key?(:invalid_metric_reference)
  @metric_unit = args[:metric_unit] if args.key?(:metric_unit)
  @name = args[:name] if args.key?(:name)
  @restricted_metric_type = args[:restricted_metric_type] if args.key?(:restricted_metric_type)
end