Class SamplingSettings

java.lang.Object
com.azure.resourcemanager.apimanagement.models.SamplingSettings
All Implemented Interfaces:
com.azure.json.JsonSerializable<SamplingSettings>

public final class SamplingSettings extends Object implements com.azure.json.JsonSerializable<SamplingSettings>
Sampling settings for Diagnostic.
  • Constructor Details

    • SamplingSettings

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

    • samplingType

      public SamplingType samplingType()
      Get the samplingType property: Sampling type.
      Returns:
      the samplingType value.
    • withSamplingType

      public SamplingSettings withSamplingType(SamplingType samplingType)
      Set the samplingType property: Sampling type.
      Parameters:
      samplingType - the samplingType value to set.
      Returns:
      the SamplingSettings object itself.
    • percentage

      public Double percentage()
      Get the percentage property: Rate of sampling for fixed-rate sampling.
      Returns:
      the percentage value.
    • withPercentage

      public SamplingSettings withPercentage(Double percentage)
      Set the percentage property: Rate of sampling for fixed-rate sampling.
      Parameters:
      percentage - the percentage value to set.
      Returns:
      the SamplingSettings 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<SamplingSettings>
      Throws:
      IOException
    • fromJson

      public static SamplingSettings fromJson(com.azure.json.JsonReader jsonReader) throws IOException
      Reads an instance of SamplingSettings from the JsonReader.
      Parameters:
      jsonReader - The JsonReader being read.
      Returns:
      An instance of SamplingSettings 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 SamplingSettings.