Class MetricDefinitionInner

java.lang.Object
com.azure.resourcemanager.monitor.fluent.models.MetricDefinitionInner
All Implemented Interfaces:
com.azure.json.JsonSerializable<MetricDefinitionInner>

public final class MetricDefinitionInner extends Object implements com.azure.json.JsonSerializable<MetricDefinitionInner>
Metric definition class specifies the metadata for a metric.
  • Constructor Details

    • MetricDefinitionInner

      public MetricDefinitionInner()
      Creates an instance of MetricDefinitionInner class.
  • Method Details

    • isDimensionRequired

      public Boolean isDimensionRequired()
      Get the isDimensionRequired property: Flag to indicate whether the dimension is required.
      Returns:
      the isDimensionRequired value.
    • withIsDimensionRequired

      public MetricDefinitionInner withIsDimensionRequired(Boolean isDimensionRequired)
      Set the isDimensionRequired property: Flag to indicate whether the dimension is required.
      Parameters:
      isDimensionRequired - the isDimensionRequired value to set.
      Returns:
      the MetricDefinitionInner object itself.
    • resourceId

      public String resourceId()
      Get the resourceId property: the resource identifier of the resource that emitted the metric.
      Returns:
      the resourceId value.
    • withResourceId

      public MetricDefinitionInner withResourceId(String resourceId)
      Set the resourceId property: the resource identifier of the resource that emitted the metric.
      Parameters:
      resourceId - the resourceId value to set.
      Returns:
      the MetricDefinitionInner object itself.
    • namespace

      public String namespace()
      Get the namespace property: the namespace the metric belongs to.
      Returns:
      the namespace value.
    • withNamespace

      public MetricDefinitionInner withNamespace(String namespace)
      Set the namespace property: the namespace the metric belongs to.
      Parameters:
      namespace - the namespace value to set.
      Returns:
      the MetricDefinitionInner object itself.
    • name

      public LocalizableStringInner name()
      Get the name property: the name and the display name of the metric, i.e. it is a localizable string.
      Returns:
      the name value.
    • withName

      Set the name property: the name and the display name of the metric, i.e. it is a localizable string.
      Parameters:
      name - the name value to set.
      Returns:
      the MetricDefinitionInner object itself.
    • displayDescription

      public String displayDescription()
      Get the displayDescription property: Detailed description of this metric.
      Returns:
      the displayDescription value.
    • withDisplayDescription

      public MetricDefinitionInner withDisplayDescription(String displayDescription)
      Set the displayDescription property: Detailed description of this metric.
      Parameters:
      displayDescription - the displayDescription value to set.
      Returns:
      the MetricDefinitionInner object itself.
    • category

      public String category()
      Get the category property: Custom category name for this metric.
      Returns:
      the category value.
    • withCategory

      public MetricDefinitionInner withCategory(String category)
      Set the category property: Custom category name for this metric.
      Parameters:
      category - the category value to set.
      Returns:
      the MetricDefinitionInner object itself.
    • metricClass

      public MetricClass metricClass()
      Get the metricClass property: The class of the metric.
      Returns:
      the metricClass value.
    • withMetricClass

      public MetricDefinitionInner withMetricClass(MetricClass metricClass)
      Set the metricClass property: The class of the metric.
      Parameters:
      metricClass - the metricClass value to set.
      Returns:
      the MetricDefinitionInner object itself.
    • unit

      public Unit unit()
      Get the unit property: The unit of the metric.
      Returns:
      the unit value.
    • withUnit

      public MetricDefinitionInner withUnit(Unit unit)
      Set the unit property: The unit of the metric.
      Parameters:
      unit - the unit value to set.
      Returns:
      the MetricDefinitionInner object itself.
    • primaryAggregationType

      public AggregationType primaryAggregationType()
      Get the primaryAggregationType property: the primary aggregation type value defining how to use the values for display.
      Returns:
      the primaryAggregationType value.
    • withPrimaryAggregationType

      public MetricDefinitionInner withPrimaryAggregationType(AggregationType primaryAggregationType)
      Set the primaryAggregationType property: the primary aggregation type value defining how to use the values for display.
      Parameters:
      primaryAggregationType - the primaryAggregationType value to set.
      Returns:
      the MetricDefinitionInner object itself.
    • supportedAggregationTypes

      public List<AggregationType> supportedAggregationTypes()
      Get the supportedAggregationTypes property: the collection of what aggregation types are supported.
      Returns:
      the supportedAggregationTypes value.
    • withSupportedAggregationTypes

      public MetricDefinitionInner withSupportedAggregationTypes(List<AggregationType> supportedAggregationTypes)
      Set the supportedAggregationTypes property: the collection of what aggregation types are supported.
      Parameters:
      supportedAggregationTypes - the supportedAggregationTypes value to set.
      Returns:
      the MetricDefinitionInner object itself.
    • metricAvailabilities

      public List<MetricAvailability> metricAvailabilities()
      Get the metricAvailabilities property: the collection of what aggregation intervals are available to be queried.
      Returns:
      the metricAvailabilities value.
    • withMetricAvailabilities

      public MetricDefinitionInner withMetricAvailabilities(List<MetricAvailability> metricAvailabilities)
      Set the metricAvailabilities property: the collection of what aggregation intervals are available to be queried.
      Parameters:
      metricAvailabilities - the metricAvailabilities value to set.
      Returns:
      the MetricDefinitionInner object itself.
    • id

      public String id()
      Get the id property: the resource identifier of the metric definition.
      Returns:
      the id value.
    • withId

      public MetricDefinitionInner withId(String id)
      Set the id property: the resource identifier of the metric definition.
      Parameters:
      id - the id value to set.
      Returns:
      the MetricDefinitionInner object itself.
    • dimensions

      public List<LocalizableStringInner> dimensions()
      Get the dimensions property: the name and the display name of the dimension, i.e. it is a localizable string.
      Returns:
      the dimensions value.
    • withDimensions

      public MetricDefinitionInner withDimensions(List<LocalizableStringInner> dimensions)
      Set the dimensions property: the name and the display name of the dimension, i.e. it is a localizable string.
      Parameters:
      dimensions - the dimensions value to set.
      Returns:
      the MetricDefinitionInner object itself.
    • validate

      public void validate()
      Validates the instance.
      Throws:
      IllegalArgumentException - thrown if the instance is not valid.
    • toJson

      public com.azure.json.JsonWriter toJson(com.azure.json.JsonWriter jsonWriter) throws IOException
      Specified by:
      toJson in interface com.azure.json.JsonSerializable<MetricDefinitionInner>
      Throws:
      IOException
    • fromJson

      public static MetricDefinitionInner fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of MetricDefinitionInner from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of MetricDefinitionInner if the JsonReader was pointing to an instance of it, or null if it was pointing to JSON null.
      Throws:
      IOException - If an error occurs while reading the MetricDefinitionInner.