com.azure.resourcemanager.storagecache.fluent.models.UsageModelInner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-storagecache Show documentation
Show all versions of azure-resourcemanager-storagecache Show documentation
This package contains Microsoft Azure SDK for StorageCache Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Managed Lustre provides a fully managed Lustre® file system, integrated with Blob storage, for use on demand. These operations create and manage Azure Managed Lustre file systems. Package tag package-2024-03.
The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.storagecache.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 com.azure.resourcemanager.storagecache.models.UsageModelDisplay;
import java.io.IOException;
/**
* A usage model.
*/
@Fluent
public final class UsageModelInner implements JsonSerializable {
/*
* Localized information describing this usage model.
*/
private UsageModelDisplay display;
/*
* Non-localized keyword name for this usage model.
*/
private String modelName;
/*
* The type of Storage Target to which this model is applicable (only nfs3 as of this version).
*/
private String targetType;
/**
* Creates an instance of UsageModelInner class.
*/
public UsageModelInner() {
}
/**
* Get the display property: Localized information describing this usage model.
*
* @return the display value.
*/
public UsageModelDisplay display() {
return this.display;
}
/**
* Set the display property: Localized information describing this usage model.
*
* @param display the display value to set.
* @return the UsageModelInner object itself.
*/
public UsageModelInner withDisplay(UsageModelDisplay display) {
this.display = display;
return this;
}
/**
* Get the modelName property: Non-localized keyword name for this usage model.
*
* @return the modelName value.
*/
public String modelName() {
return this.modelName;
}
/**
* Set the modelName property: Non-localized keyword name for this usage model.
*
* @param modelName the modelName value to set.
* @return the UsageModelInner object itself.
*/
public UsageModelInner withModelName(String modelName) {
this.modelName = modelName;
return this;
}
/**
* Get the targetType property: The type of Storage Target to which this model is applicable (only nfs3 as of this
* version).
*
* @return the targetType value.
*/
public String targetType() {
return this.targetType;
}
/**
* Set the targetType property: The type of Storage Target to which this model is applicable (only nfs3 as of this
* version).
*
* @param targetType the targetType value to set.
* @return the UsageModelInner object itself.
*/
public UsageModelInner withTargetType(String targetType) {
this.targetType = targetType;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (display() != null) {
display().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeJsonField("display", this.display);
jsonWriter.writeStringField("modelName", this.modelName);
jsonWriter.writeStringField("targetType", this.targetType);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of UsageModelInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of UsageModelInner 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 UsageModelInner.
*/
public static UsageModelInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
UsageModelInner deserializedUsageModelInner = new UsageModelInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("display".equals(fieldName)) {
deserializedUsageModelInner.display = UsageModelDisplay.fromJson(reader);
} else if ("modelName".equals(fieldName)) {
deserializedUsageModelInner.modelName = reader.getString();
} else if ("targetType".equals(fieldName)) {
deserializedUsageModelInner.targetType = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedUsageModelInner;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy