com.azure.resourcemanager.storage.fluent.models.LeaseContainerResponseInner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-storage Show documentation
Show all versions of azure-resourcemanager-storage Show documentation
This package contains Microsoft Azure Storage Management SDK.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.storage.fluent.models;
import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
/**
* Lease Container response schema.
*/
@Fluent
public final class LeaseContainerResponseInner implements JsonSerializable {
/*
* Returned unique lease ID that must be included with any request to delete the container, or to renew, change, or
* release the lease.
*/
private String leaseId;
/*
* Approximate time remaining in the lease period, in seconds.
*/
private String leaseTimeSeconds;
/**
* Creates an instance of LeaseContainerResponseInner class.
*/
public LeaseContainerResponseInner() {
}
/**
* Get the leaseId property: Returned unique lease ID that must be included with any request to delete the
* container, or to renew, change, or release the lease.
*
* @return the leaseId value.
*/
public String leaseId() {
return this.leaseId;
}
/**
* Set the leaseId property: Returned unique lease ID that must be included with any request to delete the
* container, or to renew, change, or release the lease.
*
* @param leaseId the leaseId value to set.
* @return the LeaseContainerResponseInner object itself.
*/
public LeaseContainerResponseInner withLeaseId(String leaseId) {
this.leaseId = leaseId;
return this;
}
/**
* Get the leaseTimeSeconds property: Approximate time remaining in the lease period, in seconds.
*
* @return the leaseTimeSeconds value.
*/
public String leaseTimeSeconds() {
return this.leaseTimeSeconds;
}
/**
* Set the leaseTimeSeconds property: Approximate time remaining in the lease period, in seconds.
*
* @param leaseTimeSeconds the leaseTimeSeconds value to set.
* @return the LeaseContainerResponseInner object itself.
*/
public LeaseContainerResponseInner withLeaseTimeSeconds(String leaseTimeSeconds) {
this.leaseTimeSeconds = leaseTimeSeconds;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("leaseId", this.leaseId);
jsonWriter.writeStringField("leaseTimeSeconds", this.leaseTimeSeconds);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of LeaseContainerResponseInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of LeaseContainerResponseInner 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 LeaseContainerResponseInner.
*/
public static LeaseContainerResponseInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
LeaseContainerResponseInner deserializedLeaseContainerResponseInner = new LeaseContainerResponseInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("leaseId".equals(fieldName)) {
deserializedLeaseContainerResponseInner.leaseId = reader.getString();
} else if ("leaseTimeSeconds".equals(fieldName)) {
deserializedLeaseContainerResponseInner.leaseTimeSeconds = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedLeaseContainerResponseInner;
});
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy