SqlConnection.java

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.analytics.synapse.artifacts.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.HashMap;
import java.util.Map;

/** The connection used to execute the SQL script. */
@Fluent
public final class SqlConnection {
    /*
     * The type of the connection.
     */
    @JsonProperty(value = "type")
    private SqlConnectionType type;

    /*
     * The identifier of the connection.
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * The associated SQL pool name (supported by SQL pool v3)
     */
    @JsonProperty(value = "poolName")
    private String poolName;

    /*
     * The associated database name (supported by SQL pool v3)
     */
    @JsonProperty(value = "databaseName")
    private String databaseName;

    /*
     * The connection used to execute the SQL script.
     */
    @JsonIgnore private Map<String, Object> additionalProperties;

    /**
     * Get the type property: The type of the connection.
     *
     * @return the type value.
     */
    public SqlConnectionType getType() {
        return this.type;
    }

    /**
     * Set the type property: The type of the connection.
     *
     * @param type the type value to set.
     * @return the SqlConnection object itself.
     */
    public SqlConnection setType(SqlConnectionType type) {
        this.type = type;
        return this;
    }

    /**
     * Get the name property: The identifier of the connection.
     *
     * @return the name value.
     */
    public String getName() {
        return this.name;
    }

    /**
     * Set the name property: The identifier of the connection.
     *
     * @param name the name value to set.
     * @return the SqlConnection object itself.
     */
    public SqlConnection setName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the poolName property: The associated SQL pool name (supported by SQL pool v3).
     *
     * @return the poolName value.
     */
    public String getPoolName() {
        return this.poolName;
    }

    /**
     * Set the poolName property: The associated SQL pool name (supported by SQL pool v3).
     *
     * @param poolName the poolName value to set.
     * @return the SqlConnection object itself.
     */
    public SqlConnection setPoolName(String poolName) {
        this.poolName = poolName;
        return this;
    }

    /**
     * Get the databaseName property: The associated database name (supported by SQL pool v3).
     *
     * @return the databaseName value.
     */
    public String getDatabaseName() {
        return this.databaseName;
    }

    /**
     * Set the databaseName property: The associated database name (supported by SQL pool v3).
     *
     * @param databaseName the databaseName value to set.
     * @return the SqlConnection object itself.
     */
    public SqlConnection setDatabaseName(String databaseName) {
        this.databaseName = databaseName;
        return this;
    }

    /**
     * Get the additionalProperties property: The connection used to execute the SQL script.
     *
     * @return the additionalProperties value.
     */
    @JsonAnyGetter
    public Map<String, Object> getAdditionalProperties() {
        return this.additionalProperties;
    }

    /**
     * Set the additionalProperties property: The connection used to execute the SQL script.
     *
     * @param additionalProperties the additionalProperties value to set.
     * @return the SqlConnection object itself.
     */
    public SqlConnection setAdditionalProperties(Map<String, Object> additionalProperties) {
        this.additionalProperties = additionalProperties;
        return this;
    }

    @JsonAnySetter
    void setAdditionalProperties(String key, Object value) {
        if (additionalProperties == null) {
            additionalProperties = new HashMap<>();
        }
        additionalProperties.put(key, value);
    }
}