Class Plan

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

public final class Plan extends Object implements com.azure.json.JsonSerializable<Plan>
Specifies information about the marketplace image used to create the virtual machine. This element is only used for marketplace images. Before you can use a marketplace image from an API, you must enable the image for programmatic use. In the Azure portal, find the marketplace image that you want to use and then click **Want to deploy programmatically, Get Started ->**. Enter any required information and then click **Save**.
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    static Plan
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of Plan from the JsonReader.
    Get the name property: The plan ID.
    Get the product property: Specifies the product of the image from the marketplace.
    Get the promotionCode property: The promotion code.
    Get the publisher property: The publisher ID.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    Validates the instance.
    Set the name property: The plan ID.
    Set the product property: Specifies the product of the image from the marketplace.
    withPromotionCode(String promotionCode)
    Set the promotionCode property: The promotion code.
    withPublisher(String publisher)
    Set the publisher property: The publisher ID.

    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

    • Plan

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

    • name

      public String name()
      Get the name property: The plan ID.
      Returns:
      the name value.
    • withName

      public Plan withName(String name)
      Set the name property: The plan ID.
      Parameters:
      name - the name value to set.
      Returns:
      the Plan object itself.
    • publisher

      public String publisher()
      Get the publisher property: The publisher ID.
      Returns:
      the publisher value.
    • withPublisher

      public Plan withPublisher(String publisher)
      Set the publisher property: The publisher ID.
      Parameters:
      publisher - the publisher value to set.
      Returns:
      the Plan object itself.
    • product

      public String product()
      Get the product property: Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element.
      Returns:
      the product value.
    • withProduct

      public Plan withProduct(String product)
      Set the product property: Specifies the product of the image from the marketplace. This is the same value as Offer under the imageReference element.
      Parameters:
      product - the product value to set.
      Returns:
      the Plan object itself.
    • promotionCode

      public String promotionCode()
      Get the promotionCode property: The promotion code.
      Returns:
      the promotionCode value.
    • withPromotionCode

      public Plan withPromotionCode(String promotionCode)
      Set the promotionCode property: The promotion code.
      Parameters:
      promotionCode - the promotionCode value to set.
      Returns:
      the Plan 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<Plan>
      Throws:
      IOException
    • fromJson

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