All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.azure.ai.metricsadvisor.implementation.models.AzureSQLConnectionStringParamPatch Maven / Gradle / Ivy

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 AzureSQLConnectionStringParamPatch model.
 */
@Fluent
public final class AzureSQLConnectionStringParamPatch implements JsonSerializable {
    /*
     * The connection string to access the Azure SQL.
     */
    private String connectionString;

    /**
     * Creates an instance of AzureSQLConnectionStringParamPatch class.
     */
    public AzureSQLConnectionStringParamPatch() {
    }

    /**
     * Get the connectionString property: The connection string to access the Azure SQL.
     * 
     * @return the connectionString value.
     */
    public String getConnectionString() {
        return this.connectionString;
    }

    /**
     * Set the connectionString property: The connection string to access the Azure SQL.
     * 
     * @param connectionString the connectionString value to set.
     * @return the AzureSQLConnectionStringParamPatch object itself.
     */
    public AzureSQLConnectionStringParamPatch setConnectionString(String connectionString) {
        this.connectionString = connectionString;
        return this;
    }

    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("connectionString", this.connectionString);
        return jsonWriter.writeEndObject();
    }

    /**
     * Reads an instance of AzureSQLConnectionStringParamPatch from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of AzureSQLConnectionStringParamPatch 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 AzureSQLConnectionStringParamPatch.
     */
    public static AzureSQLConnectionStringParamPatch fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            AzureSQLConnectionStringParamPatch deserializedAzureSQLConnectionStringParamPatch
                = new AzureSQLConnectionStringParamPatch();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("connectionString".equals(fieldName)) {
                    deserializedAzureSQLConnectionStringParamPatch.connectionString = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedAzureSQLConnectionStringParamPatch;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy