Class SasPolicy

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

public final class SasPolicy extends Object implements com.azure.json.JsonSerializable<SasPolicy>
SasPolicy assigned to the storage account.
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    Get the expirationAction property: The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated.
    static SasPolicy
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of SasPolicy from the JsonReader.
    Get the sasExpirationPeriod property: The SAS expiration period, DD.HH:MM:SS.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    Validates the instance.
    Set the expirationAction property: The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated.
    withSasExpirationPeriod(String sasExpirationPeriod)
    Set the sasExpirationPeriod property: The SAS expiration period, DD.HH:MM:SS.

    Methods inherited from class 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

    • SasPolicy

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

    • sasExpirationPeriod

      public String sasExpirationPeriod()
      Get the sasExpirationPeriod property: The SAS expiration period, DD.HH:MM:SS.
      Returns:
      the sasExpirationPeriod value.
    • withSasExpirationPeriod

      public SasPolicy withSasExpirationPeriod(String sasExpirationPeriod)
      Set the sasExpirationPeriod property: The SAS expiration period, DD.HH:MM:SS.
      Parameters:
      sasExpirationPeriod - the sasExpirationPeriod value to set.
      Returns:
      the SasPolicy object itself.
    • expirationAction

      public ExpirationAction expirationAction()
      Get the expirationAction property: The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period.
      Returns:
      the expirationAction value.
    • withExpirationAction

      public SasPolicy withExpirationAction(ExpirationAction expirationAction)
      Set the expirationAction property: The SAS Expiration Action defines the action to be performed when sasPolicy.sasExpirationPeriod is violated. The 'Log' action can be used for audit purposes and the 'Block' action can be used to block and deny the usage of SAS tokens that do not adhere to the sas policy expiration period.
      Parameters:
      expirationAction - the expirationAction value to set.
      Returns:
      the SasPolicy 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<SasPolicy>
      Throws:
      IOException
    • fromJson

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