com.azure.ai.metricsadvisor.implementation.models.AzureLogAnalyticsParameter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-ai-metricsadvisor Show documentation
Show all versions of azure-ai-metricsadvisor Show documentation
This package contains the Microsoft Azure Cognitive Services Metrics Advisor SDK.
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.ai.metricsadvisor.implementation.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 AzureLogAnalyticsParameter model.
*/
@Fluent
public final class AzureLogAnalyticsParameter implements JsonSerializable {
/*
* The tenant id of service principal that have access to this Log Analytics
*/
private String tenantId;
/*
* The client id of service principal that have access to this Log Analytics
*/
private String clientId;
/*
* The client secret of service principal that have access to this Log Analytics
*/
private String clientSecret;
/*
* The workspace id of this Log Analytics
*/
private String workspaceId;
/*
* The KQL (Kusto Query Language) query to fetch data from this Log Analytics
*/
private String query;
/**
* Creates an instance of AzureLogAnalyticsParameter class.
*/
public AzureLogAnalyticsParameter() {
}
/**
* Get the tenantId property: The tenant id of service principal that have access to this Log Analytics.
*
* @return the tenantId value.
*/
public String getTenantId() {
return this.tenantId;
}
/**
* Set the tenantId property: The tenant id of service principal that have access to this Log Analytics.
*
* @param tenantId the tenantId value to set.
* @return the AzureLogAnalyticsParameter object itself.
*/
public AzureLogAnalyticsParameter setTenantId(String tenantId) {
this.tenantId = tenantId;
return this;
}
/**
* Get the clientId property: The client id of service principal that have access to this Log Analytics.
*
* @return the clientId value.
*/
public String getClientId() {
return this.clientId;
}
/**
* Set the clientId property: The client id of service principal that have access to this Log Analytics.
*
* @param clientId the clientId value to set.
* @return the AzureLogAnalyticsParameter object itself.
*/
public AzureLogAnalyticsParameter setClientId(String clientId) {
this.clientId = clientId;
return this;
}
/**
* Get the clientSecret property: The client secret of service principal that have access to this Log Analytics.
*
* @return the clientSecret value.
*/
public String getClientSecret() {
return this.clientSecret;
}
/**
* Set the clientSecret property: The client secret of service principal that have access to this Log Analytics.
*
* @param clientSecret the clientSecret value to set.
* @return the AzureLogAnalyticsParameter object itself.
*/
public AzureLogAnalyticsParameter setClientSecret(String clientSecret) {
this.clientSecret = clientSecret;
return this;
}
/**
* Get the workspaceId property: The workspace id of this Log Analytics.
*
* @return the workspaceId value.
*/
public String getWorkspaceId() {
return this.workspaceId;
}
/**
* Set the workspaceId property: The workspace id of this Log Analytics.
*
* @param workspaceId the workspaceId value to set.
* @return the AzureLogAnalyticsParameter object itself.
*/
public AzureLogAnalyticsParameter setWorkspaceId(String workspaceId) {
this.workspaceId = workspaceId;
return this;
}
/**
* Get the query property: The KQL (Kusto Query Language) query to fetch data from this Log Analytics.
*
* @return the query value.
*/
public String getQuery() {
return this.query;
}
/**
* Set the query property: The KQL (Kusto Query Language) query to fetch data from this Log Analytics.
*
* @param query the query value to set.
* @return the AzureLogAnalyticsParameter object itself.
*/
public AzureLogAnalyticsParameter setQuery(String query) {
this.query = query;
return this;
}
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("workspaceId", this.workspaceId);
jsonWriter.writeStringField("query", this.query);
jsonWriter.writeStringField("tenantId", this.tenantId);
jsonWriter.writeStringField("clientId", this.clientId);
jsonWriter.writeStringField("clientSecret", this.clientSecret);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of AzureLogAnalyticsParameter from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AzureLogAnalyticsParameter if the JsonReader was pointing to an instance of it, or null if
* it was pointing to JSON null.
* @throws IllegalStateException If the deserialized JSON object was missing any required properties.
* @throws IOException If an error occurs while reading the AzureLogAnalyticsParameter.
*/
public static AzureLogAnalyticsParameter fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
AzureLogAnalyticsParameter deserializedAzureLogAnalyticsParameter = new AzureLogAnalyticsParameter();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("workspaceId".equals(fieldName)) {
deserializedAzureLogAnalyticsParameter.workspaceId = reader.getString();
} else if ("query".equals(fieldName)) {
deserializedAzureLogAnalyticsParameter.query = reader.getString();
} else if ("tenantId".equals(fieldName)) {
deserializedAzureLogAnalyticsParameter.tenantId = reader.getString();
} else if ("clientId".equals(fieldName)) {
deserializedAzureLogAnalyticsParameter.clientId = reader.getString();
} else if ("clientSecret".equals(fieldName)) {
deserializedAzureLogAnalyticsParameter.clientSecret = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedAzureLogAnalyticsParameter;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy