com.azure.resourcemanager.hybridcompute.fluent.models.OperationValueInner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-hybridcompute Show documentation
Show all versions of azure-resourcemanager-hybridcompute Show documentation
This package contains Microsoft Azure SDK for HybridCompute Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Hybrid Compute Management Client. Package tag package-preview-2024-05.
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.hybridcompute.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.hybridcompute.models.OperationValueDisplay;
import java.io.IOException;
/**
* Describes the properties of a Compute Operation value.
*/
@Fluent
public final class OperationValueInner implements JsonSerializable {
/*
* The origin of the compute operation.
*/
private String origin;
/*
* The name of the compute operation.
*/
private String name;
/*
* Display properties
*/
private OperationValueDisplay display;
/*
* This property indicates if the operation is an action or a data action
*/
private Boolean isDataAction;
/**
* Creates an instance of OperationValueInner class.
*/
public OperationValueInner() {
}
/**
* Get the origin property: The origin of the compute operation.
*
* @return the origin value.
*/
public String origin() {
return this.origin;
}
/**
* Get the name property: The name of the compute operation.
*
* @return the name value.
*/
public String name() {
return this.name;
}
/**
* Get the display property: Display properties.
*
* @return the display value.
*/
public OperationValueDisplay display() {
return this.display;
}
/**
* Set the display property: Display properties.
*
* @param display the display value to set.
* @return the OperationValueInner object itself.
*/
public OperationValueInner withDisplay(OperationValueDisplay display) {
this.display = display;
return this;
}
/**
* Get the isDataAction property: This property indicates if the operation is an action or a data action.
*
* @return the isDataAction value.
*/
public Boolean isDataAction() {
return this.isDataAction;
}
/**
* 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);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of OperationValueInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of OperationValueInner 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 OperationValueInner.
*/
public static OperationValueInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
OperationValueInner deserializedOperationValueInner = new OperationValueInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("origin".equals(fieldName)) {
deserializedOperationValueInner.origin = reader.getString();
} else if ("name".equals(fieldName)) {
deserializedOperationValueInner.name = reader.getString();
} else if ("display".equals(fieldName)) {
deserializedOperationValueInner.display = OperationValueDisplay.fromJson(reader);
} else if ("isDataAction".equals(fieldName)) {
deserializedOperationValueInner.isDataAction = reader.getNullable(JsonReader::getBoolean);
} else {
reader.skipChildren();
}
}
return deserializedOperationValueInner;
});
}
}