com.azure.resourcemanager.botservice.models.OperationDisplayInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-botservice Show documentation
Show all versions of azure-resourcemanager-botservice Show documentation
This package contains Microsoft Azure SDK for BotService Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Bot Service is a platform for creating smart conversational agents. Package tag package-2021-03-01.
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.botservice.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;
/**
* The operation supported by Bot Service Management.
*/
@Fluent
public final class OperationDisplayInfo implements JsonSerializable {
/*
* The description of the operation.
*/
private String description;
/*
* The action that users can perform, based on their permission level.
*/
private String operation;
/*
* Service provider: Microsoft Bot Service.
*/
private String provider;
/*
* Resource on which the operation is performed.
*/
private String resource;
/**
* Creates an instance of OperationDisplayInfo class.
*/
public OperationDisplayInfo() {
}
/**
* Get the description property: The description of the operation.
*
* @return the description value.
*/
public String description() {
return this.description;
}
/**
* Set the description property: The description of the operation.
*
* @param description the description value to set.
* @return the OperationDisplayInfo object itself.
*/
public OperationDisplayInfo withDescription(String description) {
this.description = description;
return this;
}
/**
* Get the operation property: The action that users can perform, based on their permission level.
*
* @return the operation value.
*/
public String operation() {
return this.operation;
}
/**
* Set the operation property: The action that users can perform, based on their permission level.
*
* @param operation the operation value to set.
* @return the OperationDisplayInfo object itself.
*/
public OperationDisplayInfo withOperation(String operation) {
this.operation = operation;
return this;
}
/**
* Get the provider property: Service provider: Microsoft Bot Service.
*
* @return the provider value.
*/
public String provider() {
return this.provider;
}
/**
* Set the provider property: Service provider: Microsoft Bot Service.
*
* @param provider the provider value to set.
* @return the OperationDisplayInfo object itself.
*/
public OperationDisplayInfo withProvider(String provider) {
this.provider = provider;
return this;
}
/**
* Get the resource property: Resource on which the operation is performed.
*
* @return the resource value.
*/
public String resource() {
return this.resource;
}
/**
* Set the resource property: Resource on which the operation is performed.
*
* @param resource the resource value to set.
* @return the OperationDisplayInfo object itself.
*/
public OperationDisplayInfo withResource(String resource) {
this.resource = resource;
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("description", this.description);
jsonWriter.writeStringField("operation", this.operation);
jsonWriter.writeStringField("provider", this.provider);
jsonWriter.writeStringField("resource", this.resource);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of OperationDisplayInfo from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of OperationDisplayInfo 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 OperationDisplayInfo.
*/
public static OperationDisplayInfo fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
OperationDisplayInfo deserializedOperationDisplayInfo = new OperationDisplayInfo();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("description".equals(fieldName)) {
deserializedOperationDisplayInfo.description = reader.getString();
} else if ("operation".equals(fieldName)) {
deserializedOperationDisplayInfo.operation = reader.getString();
} else if ("provider".equals(fieldName)) {
deserializedOperationDisplayInfo.provider = reader.getString();
} else if ("resource".equals(fieldName)) {
deserializedOperationDisplayInfo.resource = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedOperationDisplayInfo;
});
}
}