Class LeaseContainerRequest

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

public final class LeaseContainerRequest extends Object implements com.azure.json.JsonSerializable<LeaseContainerRequest>
Lease Container request schema.
  • Constructor Details

    • LeaseContainerRequest

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

    • action

      public LeaseContainerRequestAction action()
      Get the action property: Specifies the lease action. Can be one of the available actions.
      Returns:
      the action value.
    • withAction

      Set the action property: Specifies the lease action. Can be one of the available actions.
      Parameters:
      action - the action value to set.
      Returns:
      the LeaseContainerRequest object itself.
    • leaseId

      public String leaseId()
      Get the leaseId property: Identifies the lease. Can be specified in any valid GUID string format.
      Returns:
      the leaseId value.
    • withLeaseId

      public LeaseContainerRequest withLeaseId(String leaseId)
      Set the leaseId property: Identifies the lease. Can be specified in any valid GUID string format.
      Parameters:
      leaseId - the leaseId value to set.
      Returns:
      the LeaseContainerRequest object itself.
    • breakPeriod

      public Integer breakPeriod()
      Get the breakPeriod property: Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60.
      Returns:
      the breakPeriod value.
    • withBreakPeriod

      public LeaseContainerRequest withBreakPeriod(Integer breakPeriod)
      Set the breakPeriod property: Optional. For a break action, proposed duration the lease should continue before it is broken, in seconds, between 0 and 60.
      Parameters:
      breakPeriod - the breakPeriod value to set.
      Returns:
      the LeaseContainerRequest object itself.
    • leaseDuration

      public Integer leaseDuration()
      Get the leaseDuration property: Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires.
      Returns:
      the leaseDuration value.
    • withLeaseDuration

      public LeaseContainerRequest withLeaseDuration(Integer leaseDuration)
      Set the leaseDuration property: Required for acquire. Specifies the duration of the lease, in seconds, or negative one (-1) for a lease that never expires.
      Parameters:
      leaseDuration - the leaseDuration value to set.
      Returns:
      the LeaseContainerRequest object itself.
    • proposedLeaseId

      public String proposedLeaseId()
      Get the proposedLeaseId property: Optional for acquire, required for change. Proposed lease ID, in a GUID string format.
      Returns:
      the proposedLeaseId value.
    • withProposedLeaseId

      public LeaseContainerRequest withProposedLeaseId(String proposedLeaseId)
      Set the proposedLeaseId property: Optional for acquire, required for change. Proposed lease ID, in a GUID string format.
      Parameters:
      proposedLeaseId - the proposedLeaseId value to set.
      Returns:
      the LeaseContainerRequest 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<LeaseContainerRequest>
      Throws:
      IOException
    • fromJson

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