com.azure.resourcemanager.netapp.fluent.models.SubvolumePatchParams Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-netapp Show documentation
Show all versions of azure-resourcemanager-netapp Show documentation
This package contains Microsoft Azure SDK for NetAppFiles Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Microsoft NetApp Files Azure Resource Provider specification. Package tag package-2024-03.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.netapp.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;
/**
* Parameters with which a subvolume can be updated.
*/
@Fluent
public final class SubvolumePatchParams implements JsonSerializable {
/*
* Truncate subvolume to the provided size in bytes
*/
private Long size;
/*
* path to the subvolume
*/
private String path;
/**
* Creates an instance of SubvolumePatchParams class.
*/
public SubvolumePatchParams() {
}
/**
* Get the size property: Truncate subvolume to the provided size in bytes.
*
* @return the size value.
*/
public Long size() {
return this.size;
}
/**
* Set the size property: Truncate subvolume to the provided size in bytes.
*
* @param size the size value to set.
* @return the SubvolumePatchParams object itself.
*/
public SubvolumePatchParams withSize(Long size) {
this.size = size;
return this;
}
/**
* Get the path property: path to the subvolume.
*
* @return the path value.
*/
public String path() {
return this.path;
}
/**
* Set the path property: path to the subvolume.
*
* @param path the path value to set.
* @return the SubvolumePatchParams object itself.
*/
public SubvolumePatchParams withPath(String path) {
this.path = path;
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.writeNumberField("size", this.size);
jsonWriter.writeStringField("path", this.path);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of SubvolumePatchParams from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of SubvolumePatchParams 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 SubvolumePatchParams.
*/
public static SubvolumePatchParams fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
SubvolumePatchParams deserializedSubvolumePatchParams = new SubvolumePatchParams();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("size".equals(fieldName)) {
deserializedSubvolumePatchParams.size = reader.getNullable(JsonReader::getLong);
} else if ("path".equals(fieldName)) {
deserializedSubvolumePatchParams.path = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedSubvolumePatchParams;
});
}
}