Class ResourceRequests

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

public final class ResourceRequests extends Object implements com.azure.json.JsonSerializable<ResourceRequests>
The resource requests.
  • Constructor Summary

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

    Modifier and Type
    Method
    Description
    double
    cpu()
    Get the cpu property: The CPU request of this container instance.
    fromJson(com.azure.json.JsonReader jsonReader)
    Reads an instance of ResourceRequests from the JsonReader.
    gpu()
    Get the gpu property: The GPU request of this container instance.
    double
    Get the memoryInGB property: The memory request in GB of this container instance.
    com.azure.json.JsonWriter
    toJson(com.azure.json.JsonWriter jsonWriter)
    void
    Validates the instance.
    withCpu(double cpu)
    Set the cpu property: The CPU request of this container instance.
    Set the gpu property: The GPU request of this container instance.
    withMemoryInGB(double memoryInGB)
    Set the memoryInGB property: The memory request in GB of this container instance.

    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

    • ResourceRequests

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

    • memoryInGB

      public double memoryInGB()
      Get the memoryInGB property: The memory request in GB of this container instance.
      Returns:
      the memoryInGB value.
    • withMemoryInGB

      public ResourceRequests withMemoryInGB(double memoryInGB)
      Set the memoryInGB property: The memory request in GB of this container instance.
      Parameters:
      memoryInGB - the memoryInGB value to set.
      Returns:
      the ResourceRequests object itself.
    • cpu

      public double cpu()
      Get the cpu property: The CPU request of this container instance.
      Returns:
      the cpu value.
    • withCpu

      public ResourceRequests withCpu(double cpu)
      Set the cpu property: The CPU request of this container instance.
      Parameters:
      cpu - the cpu value to set.
      Returns:
      the ResourceRequests object itself.
    • gpu

      public GpuResource gpu()
      Get the gpu property: The GPU request of this container instance.
      Returns:
      the gpu value.
    • withGpu

      public ResourceRequests withGpu(GpuResource gpu)
      Set the gpu property: The GPU request of this container instance.
      Parameters:
      gpu - the gpu value to set.
      Returns:
      the ResourceRequests 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<ResourceRequests>
      Throws:
      IOException
    • fromJson

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