Class GalleryOSDiskImage

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

public final class GalleryOSDiskImage extends GalleryDiskImage
This is the OS disk image.
  • Constructor Details

    • GalleryOSDiskImage

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

    • sizeInGB

      public Integer sizeInGB()
      Get the sizeInGB property: This property indicates the size of the VHD to be created.
      Overrides:
      sizeInGB in class GalleryDiskImage
      Returns:
      the sizeInGB value.
    • withHostCaching

      public GalleryOSDiskImage withHostCaching(HostCaching hostCaching)
      Set the hostCaching property: The host caching of the disk. Valid values are 'None', 'ReadOnly', and 'ReadWrite'.
      Overrides:
      withHostCaching in class GalleryDiskImage
      Parameters:
      hostCaching - the hostCaching value to set.
      Returns:
      the GalleryDiskImage object itself.
    • withSource

      public GalleryOSDiskImage withSource(GalleryDiskImageSource source)
      Set the source property: The source for the disk image.
      Overrides:
      withSource in class GalleryDiskImage
      Parameters:
      source - the source value to set.
      Returns:
      the GalleryDiskImage object itself.
    • validate

      public void validate()
      Validates the instance.
      Overrides:
      validate in class GalleryDiskImage
      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<GalleryDiskImage>
      Overrides:
      toJson in class GalleryDiskImage
      Throws:
      IOException
    • fromJson

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