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

public final class MetricInner extends Object implements com.azure.json.JsonSerializable<MetricInner>
The result data of a query.
  • Constructor Details

    • MetricInner

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

    • id

      public String id()
      Get the id property: the metric Id.
      Returns:
      the id value.
    • withId

      public MetricInner withId(String id)
      Set the id property: the metric Id.
      Parameters:
      id - the id value to set.
      Returns:
      the MetricInner object itself.
    • type

      public String type()
      Get the type property: the resource type of the metric resource.
      Returns:
      the type value.
    • withType

      public MetricInner withType(String type)
      Set the type property: the resource type of the metric resource.
      Parameters:
      type - the type value to set.
      Returns:
      the MetricInner object itself.
    • name

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

      public MetricInner withName(LocalizableStringInner name)
      Set the name property: the name and the display name of the metric, i.e. it is localizable string.
      Parameters:
      name - the name value to set.
      Returns:
      the MetricInner object itself.
    • displayDescription

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

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

      public String errorCode()
      Get the errorCode property: 'Success' or the error details on query failures for this metric.
      Returns:
      the errorCode value.
    • withErrorCode

      public MetricInner withErrorCode(String errorCode)
      Set the errorCode property: 'Success' or the error details on query failures for this metric.
      Parameters:
      errorCode - the errorCode value to set.
      Returns:
      the MetricInner object itself.
    • errorMessage

      public String errorMessage()
      Get the errorMessage property: Error message encountered querying this specific metric.
      Returns:
      the errorMessage value.
    • withErrorMessage

      public MetricInner withErrorMessage(String errorMessage)
      Set the errorMessage property: Error message encountered querying this specific metric.
      Parameters:
      errorMessage - the errorMessage value to set.
      Returns:
      the MetricInner object itself.
    • unit

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

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

      public List<TimeSeriesElement> timeseries()
      Get the timeseries property: the time series returned when a data query is performed.
      Returns:
      the timeseries value.
    • withTimeseries

      public MetricInner withTimeseries(List<TimeSeriesElement> timeseries)
      Set the timeseries property: the time series returned when a data query is performed.
      Parameters:
      timeseries - the timeseries value to set.
      Returns:
      the MetricInner 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<MetricInner>
      Throws:
      IOException
    • fromJson

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