com.azure.ai.metricsadvisor.implementation.models.AzureCosmosDBParameterPatch 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 AzureCosmosDBParameterPatch model.
*/
@Fluent
public final class AzureCosmosDBParameterPatch implements JsonSerializable {
/*
* The connection string of this Azure CosmosDB
*/
private String connectionString;
/*
* The statement to query this collection
*/
private String sqlQuery;
/*
* A database name in this Azure CosmosDB
*/
private String database;
/*
* A collection id in this database
*/
private String collectionId;
/**
* Creates an instance of AzureCosmosDBParameterPatch class.
*/
public AzureCosmosDBParameterPatch() {
}
/**
* Get the connectionString property: The connection string of this Azure CosmosDB.
*
* @return the connectionString value.
*/
public String getConnectionString() {
return this.connectionString;
}
/**
* Set the connectionString property: The connection string of this Azure CosmosDB.
*
* @param connectionString the connectionString value to set.
* @return the AzureCosmosDBParameterPatch object itself.
*/
public AzureCosmosDBParameterPatch setConnectionString(String connectionString) {
this.connectionString = connectionString;
return this;
}
/**
* Get the sqlQuery property: The statement to query this collection.
*
* @return the sqlQuery value.
*/
public String getSqlQuery() {
return this.sqlQuery;
}
/**
* Set the sqlQuery property: The statement to query this collection.
*
* @param sqlQuery the sqlQuery value to set.
* @return the AzureCosmosDBParameterPatch object itself.
*/
public AzureCosmosDBParameterPatch setSqlQuery(String sqlQuery) {
this.sqlQuery = sqlQuery;
return this;
}
/**
* Get the database property: A database name in this Azure CosmosDB.
*
* @return the database value.
*/
public String getDatabase() {
return this.database;
}
/**
* Set the database property: A database name in this Azure CosmosDB.
*
* @param database the database value to set.
* @return the AzureCosmosDBParameterPatch object itself.
*/
public AzureCosmosDBParameterPatch setDatabase(String database) {
this.database = database;
return this;
}
/**
* Get the collectionId property: A collection id in this database.
*
* @return the collectionId value.
*/
public String getCollectionId() {
return this.collectionId;
}
/**
* Set the collectionId property: A collection id in this database.
*
* @param collectionId the collectionId value to set.
* @return the AzureCosmosDBParameterPatch object itself.
*/
public AzureCosmosDBParameterPatch setCollectionId(String collectionId) {
this.collectionId = collectionId;
return this;
}
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("connectionString", this.connectionString);
jsonWriter.writeStringField("sqlQuery", this.sqlQuery);
jsonWriter.writeStringField("database", this.database);
jsonWriter.writeStringField("collectionId", this.collectionId);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of AzureCosmosDBParameterPatch from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AzureCosmosDBParameterPatch 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 AzureCosmosDBParameterPatch.
*/
public static AzureCosmosDBParameterPatch fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
AzureCosmosDBParameterPatch deserializedAzureCosmosDBParameterPatch = new AzureCosmosDBParameterPatch();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("connectionString".equals(fieldName)) {
deserializedAzureCosmosDBParameterPatch.connectionString = reader.getString();
} else if ("sqlQuery".equals(fieldName)) {
deserializedAzureCosmosDBParameterPatch.sqlQuery = reader.getString();
} else if ("database".equals(fieldName)) {
deserializedAzureCosmosDBParameterPatch.database = reader.getString();
} else if ("collectionId".equals(fieldName)) {
deserializedAzureCosmosDBParameterPatch.collectionId = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedAzureCosmosDBParameterPatch;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy