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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaction()Get the action property: Specifies the lease action.Get the breakPeriod property: Optional.static LeaseContainerRequestfromJson(com.azure.json.JsonReader jsonReader) Reads an instance of LeaseContainerRequest from the JsonReader.Get the leaseDuration property: Required for acquire.leaseId()Get the leaseId property: Identifies the lease.Get the proposedLeaseId property: Optional for acquire, required for change.com.azure.json.JsonWritertoJson(com.azure.json.JsonWriter jsonWriter) voidvalidate()Validates the instance.Set the action property: Specifies the lease action.withBreakPeriod(Integer breakPeriod) Set the breakPeriod property: Optional.withLeaseDuration(Integer leaseDuration) Set the leaseDuration property: Required for acquire.withLeaseId(String leaseId) Set the leaseId property: Identifies the lease.withProposedLeaseId(String proposedLeaseId) Set the proposedLeaseId property: Optional for acquire, required for change.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.azure.json.JsonSerializable
toJson, toJson, toJsonBytes, toJsonString
-
Constructor Details
-
LeaseContainerRequest
public LeaseContainerRequest()Creates an instance of LeaseContainerRequest class.
-
-
Method Details
-
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
Get the leaseId property: Identifies the lease. Can be specified in any valid GUID string format.- Returns:
- the leaseId value.
-
withLeaseId
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
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
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
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
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
Get the proposedLeaseId property: Optional for acquire, required for change. Proposed lease ID, in a GUID string format.- Returns:
- the proposedLeaseId value.
-
withProposedLeaseId
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
- Specified by:
toJsonin interfacecom.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.
-