Class GeoFilter

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

public final class GeoFilter extends Object implements com.azure.json.JsonSerializable<GeoFilter>
Rules defining user's geo access within a CDN endpoint.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates an instance of GeoFilter class.
  • Method Summary

    Modifier and Type
    Method
    Description
    Get the action property: Action of the geo filter, i.e. allow or block access.
    Get the countryCodes property: Two letter country or region codes defining user country or region access in a geo filter, e.g.
    static GeoFilter
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of GeoFilter from the JsonReader.
    Get the relativePath property: Relative path applicable to geo filter.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    Validates the instance.
    Set the action property: Action of the geo filter, i.e. allow or block access.
    withCountryCodes(List<String> countryCodes)
    Set the countryCodes property: Two letter country or region codes defining user country or region access in a geo filter, e.g.
    withRelativePath(String relativePath)
    Set the relativePath property: Relative path applicable to geo filter.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.azure.json.JsonSerializable

    toJson, toJson, toJsonBytes, toJsonString
  • Constructor Details

    • GeoFilter

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

    • relativePath

      public String relativePath()
      Get the relativePath property: Relative path applicable to geo filter. (e.g. '/mypictures', '/mypicture/kitty.jpg', and etc.).
      Returns:
      the relativePath value.
    • withRelativePath

      public GeoFilter withRelativePath(String relativePath)
      Set the relativePath property: Relative path applicable to geo filter. (e.g. '/mypictures', '/mypicture/kitty.jpg', and etc.).
      Parameters:
      relativePath - the relativePath value to set.
      Returns:
      the GeoFilter object itself.
    • action

      public GeoFilterActions action()
      Get the action property: Action of the geo filter, i.e. allow or block access.
      Returns:
      the action value.
    • withAction

      public GeoFilter withAction(GeoFilterActions action)
      Set the action property: Action of the geo filter, i.e. allow or block access.
      Parameters:
      action - the action value to set.
      Returns:
      the GeoFilter object itself.
    • countryCodes

      public List<String> countryCodes()
      Get the countryCodes property: Two letter country or region codes defining user country or region access in a geo filter, e.g. AU, MX, US.
      Returns:
      the countryCodes value.
    • withCountryCodes

      public GeoFilter withCountryCodes(List<String> countryCodes)
      Set the countryCodes property: Two letter country or region codes defining user country or region access in a geo filter, e.g. AU, MX, US.
      Parameters:
      countryCodes - the countryCodes value to set.
      Returns:
      the GeoFilter 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<GeoFilter>
      Throws:
      IOException
    • fromJson

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