![JAR search and dependency download from the Maven repository](/logo.png)
com.azure.resourcemanager.securityinsights.models.GraphQueries Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-securityinsights Show documentation
Show all versions of azure-resourcemanager-securityinsights Show documentation
This package contains Microsoft Azure SDK for SecurityInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2021-09.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.securityinsights.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 graph query to show the current data status.
*/
@Fluent
public class GraphQueries implements JsonSerializable {
/*
* the metric that the query is checking
*/
private String metricName;
/*
* The legend for the graph
*/
private String legend;
/*
* The base query for the graph
*/
private String baseQuery;
/**
* Creates an instance of GraphQueries class.
*/
public GraphQueries() {
}
/**
* Get the metricName property: the metric that the query is checking.
*
* @return the metricName value.
*/
public String metricName() {
return this.metricName;
}
/**
* Set the metricName property: the metric that the query is checking.
*
* @param metricName the metricName value to set.
* @return the GraphQueries object itself.
*/
public GraphQueries withMetricName(String metricName) {
this.metricName = metricName;
return this;
}
/**
* Get the legend property: The legend for the graph.
*
* @return the legend value.
*/
public String legend() {
return this.legend;
}
/**
* Set the legend property: The legend for the graph.
*
* @param legend the legend value to set.
* @return the GraphQueries object itself.
*/
public GraphQueries withLegend(String legend) {
this.legend = legend;
return this;
}
/**
* Get the baseQuery property: The base query for the graph.
*
* @return the baseQuery value.
*/
public String baseQuery() {
return this.baseQuery;
}
/**
* Set the baseQuery property: The base query for the graph.
*
* @param baseQuery the baseQuery value to set.
* @return the GraphQueries object itself.
*/
public GraphQueries withBaseQuery(String baseQuery) {
this.baseQuery = baseQuery;
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("metricName", this.metricName);
jsonWriter.writeStringField("legend", this.legend);
jsonWriter.writeStringField("baseQuery", this.baseQuery);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of GraphQueries from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of GraphQueries 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 GraphQueries.
*/
public static GraphQueries fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
GraphQueries deserializedGraphQueries = new GraphQueries();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("metricName".equals(fieldName)) {
deserializedGraphQueries.metricName = reader.getString();
} else if ("legend".equals(fieldName)) {
deserializedGraphQueries.legend = reader.getString();
} else if ("baseQuery".equals(fieldName)) {
deserializedGraphQueries.baseQuery = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedGraphQueries;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy