![JAR search and dependency download from the Maven repository](/logo.png)
com.azure.resourcemanager.desktopvirtualization.fluent.models.ResourceProviderOperationInner Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-desktopvirtualization Show documentation
Show all versions of azure-resourcemanager-desktopvirtualization Show documentation
This package contains Microsoft Azure SDK for DesktopVirtualization Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Package tag package-2024-04.
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.desktopvirtualization.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.desktopvirtualization.models.OperationProperties;
import com.azure.resourcemanager.desktopvirtualization.models.ResourceProviderOperationDisplay;
import java.io.IOException;
/**
* Supported operation of this resource provider.
*/
@Fluent
public final class ResourceProviderOperationInner implements JsonSerializable {
/*
* Operation name, in format of {provider}/{resource}/{operation}
*/
private String name;
/*
* Display metadata associated with the operation.
*/
private ResourceProviderOperationDisplay display;
/*
* Is a data action.
*/
private Boolean isDataAction;
/*
* Properties of the operation
*/
private OperationProperties properties;
/**
* Creates an instance of ResourceProviderOperationInner class.
*/
public ResourceProviderOperationInner() {
}
/**
* Get the name property: Operation name, in format of {provider}/{resource}/{operation}.
*
* @return the name value.
*/
public String name() {
return this.name;
}
/**
* Set the name property: Operation name, in format of {provider}/{resource}/{operation}.
*
* @param name the name value to set.
* @return the ResourceProviderOperationInner object itself.
*/
public ResourceProviderOperationInner withName(String name) {
this.name = name;
return this;
}
/**
* Get the display property: Display metadata associated with the operation.
*
* @return the display value.
*/
public ResourceProviderOperationDisplay display() {
return this.display;
}
/**
* Set the display property: Display metadata associated with the operation.
*
* @param display the display value to set.
* @return the ResourceProviderOperationInner object itself.
*/
public ResourceProviderOperationInner withDisplay(ResourceProviderOperationDisplay display) {
this.display = display;
return this;
}
/**
* Get the isDataAction property: Is a data action.
*
* @return the isDataAction value.
*/
public Boolean isDataAction() {
return this.isDataAction;
}
/**
* Set the isDataAction property: Is a data action.
*
* @param isDataAction the isDataAction value to set.
* @return the ResourceProviderOperationInner object itself.
*/
public ResourceProviderOperationInner withIsDataAction(Boolean isDataAction) {
this.isDataAction = isDataAction;
return this;
}
/**
* Get the properties property: Properties of the operation.
*
* @return the properties value.
*/
public OperationProperties properties() {
return this.properties;
}
/**
* Set the properties property: Properties of the operation.
*
* @param properties the properties value to set.
* @return the ResourceProviderOperationInner object itself.
*/
public ResourceProviderOperationInner withProperties(OperationProperties properties) {
this.properties = properties;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (display() != null) {
display().validate();
}
if (properties() != null) {
properties().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("name", this.name);
jsonWriter.writeJsonField("display", this.display);
jsonWriter.writeBooleanField("isDataAction", this.isDataAction);
jsonWriter.writeJsonField("properties", this.properties);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of ResourceProviderOperationInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ResourceProviderOperationInner 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 ResourceProviderOperationInner.
*/
public static ResourceProviderOperationInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
ResourceProviderOperationInner deserializedResourceProviderOperationInner
= new ResourceProviderOperationInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("name".equals(fieldName)) {
deserializedResourceProviderOperationInner.name = reader.getString();
} else if ("display".equals(fieldName)) {
deserializedResourceProviderOperationInner.display
= ResourceProviderOperationDisplay.fromJson(reader);
} else if ("isDataAction".equals(fieldName)) {
deserializedResourceProviderOperationInner.isDataAction
= reader.getNullable(JsonReader::getBoolean);
} else if ("properties".equals(fieldName)) {
deserializedResourceProviderOperationInner.properties = OperationProperties.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedResourceProviderOperationInner;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy