Class GrantAccessData

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

public final class GrantAccessData extends Object implements com.azure.json.JsonSerializable<GrantAccessData>
Data used for requesting a SAS.
  • Constructor Details

    • GrantAccessData

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

    • access

      public AccessLevel access()
      Get the access property: The Access Level, accepted values include None, Read, Write.
      Returns:
      the access value.
    • withAccess

      public GrantAccessData withAccess(AccessLevel access)
      Set the access property: The Access Level, accepted values include None, Read, Write.
      Parameters:
      access - the access value to set.
      Returns:
      the GrantAccessData object itself.
    • durationInSeconds

      public int durationInSeconds()
      Get the durationInSeconds property: Time duration in seconds until the SAS access expires.
      Returns:
      the durationInSeconds value.
    • withDurationInSeconds

      public GrantAccessData withDurationInSeconds(int durationInSeconds)
      Set the durationInSeconds property: Time duration in seconds until the SAS access expires.
      Parameters:
      durationInSeconds - the durationInSeconds value to set.
      Returns:
      the GrantAccessData object itself.
    • getSecureVMGuestStateSas

      public Boolean getSecureVMGuestStateSas()
      Get the getSecureVMGuestStateSas property: Set this flag to true to get additional SAS for VM guest state.
      Returns:
      the getSecureVMGuestStateSas value.
    • withGetSecureVMGuestStateSas

      public GrantAccessData withGetSecureVMGuestStateSas(Boolean getSecureVMGuestStateSas)
      Set the getSecureVMGuestStateSas property: Set this flag to true to get additional SAS for VM guest state.
      Parameters:
      getSecureVMGuestStateSas - the getSecureVMGuestStateSas value to set.
      Returns:
      the GrantAccessData object itself.
    • fileFormat

      public FileFormat fileFormat()
      Get the fileFormat property: Used to specify the file format when making request for SAS on a VHDX file format snapshot.
      Returns:
      the fileFormat value.
    • withFileFormat

      public GrantAccessData withFileFormat(FileFormat fileFormat)
      Set the fileFormat property: Used to specify the file format when making request for SAS on a VHDX file format snapshot.
      Parameters:
      fileFormat - the fileFormat value to set.
      Returns:
      the GrantAccessData 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<GrantAccessData>
      Throws:
      IOException
    • fromJson

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