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

package com.azure.resourcemanager.streamanalytics.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.streamanalytics.models.RefreshType;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;

/**
 * The properties that are associated with SQL DB input containing reference data. Required on PUT (CreateOrReplace)
 * requests.
 */
@Fluent
public final class AzureSqlReferenceInputDataSourceProperties {
    @JsonIgnore private final ClientLogger logger = new ClientLogger(AzureSqlReferenceInputDataSourceProperties.class);

    /*
     * This element is associated with the datasource element. This is the name
     * of the server that contains the database that will be written to.
     */
    @JsonProperty(value = "server")
    private String server;

    /*
     * This element is associated with the datasource element. This is the name
     * of the database that output will be written to.
     */
    @JsonProperty(value = "database")
    private String database;

    /*
     * This element is associated with the datasource element. This is the user
     * name that will be used to connect to the SQL Database instance.
     */
    @JsonProperty(value = "user")
    private String user;

    /*
     * This element is associated with the datasource element. This is the
     * password that will be used to connect to the SQL Database instance.
     */
    @JsonProperty(value = "password")
    private String password;

    /*
     * This element is associated with the datasource element. The name of the
     * table in the Azure SQL database..
     */
    @JsonProperty(value = "table")
    private String table;

    /*
     * Indicates the type of data refresh option.
     */
    @JsonProperty(value = "refreshType")
    private RefreshType refreshType;

    /*
     * This element is associated with the datasource element. This indicates
     * how frequently the data will be fetched from the database. It is of
     * DateTime format.
     */
    @JsonProperty(value = "refreshRate")
    private String refreshRate;

    /*
     * This element is associated with the datasource element. This query is
     * used to fetch data from the sql database.
     */
    @JsonProperty(value = "fullSnapshotQuery")
    private String fullSnapshotQuery;

    /*
     * This element is associated with the datasource element. This query is
     * used to fetch incremental changes from the SQL database. To use this
     * option, we recommend using temporal tables in Azure SQL Database.
     */
    @JsonProperty(value = "deltaSnapshotQuery")
    private String deltaSnapshotQuery;

    /**
     * Get the server property: This element is associated with the datasource element. This is the name of the server
     * that contains the database that will be written to.
     *
     * @return the server value.
     */
    public String server() {
        return this.server;
    }

    /**
     * Set the server property: This element is associated with the datasource element. This is the name of the server
     * that contains the database that will be written to.
     *
     * @param server the server value to set.
     * @return the AzureSqlReferenceInputDataSourceProperties object itself.
     */
    public AzureSqlReferenceInputDataSourceProperties withServer(String server) {
        this.server = server;
        return this;
    }

    /**
     * Get the database property: This element is associated with the datasource element. This is the name of the
     * database that output will be written to.
     *
     * @return the database value.
     */
    public String database() {
        return this.database;
    }

    /**
     * Set the database property: This element is associated with the datasource element. This is the name of the
     * database that output will be written to.
     *
     * @param database the database value to set.
     * @return the AzureSqlReferenceInputDataSourceProperties object itself.
     */
    public AzureSqlReferenceInputDataSourceProperties withDatabase(String database) {
        this.database = database;
        return this;
    }

    /**
     * Get the user property: This element is associated with the datasource element. This is the user name that will be
     * used to connect to the SQL Database instance.
     *
     * @return the user value.
     */
    public String user() {
        return this.user;
    }

    /**
     * Set the user property: This element is associated with the datasource element. This is the user name that will be
     * used to connect to the SQL Database instance.
     *
     * @param user the user value to set.
     * @return the AzureSqlReferenceInputDataSourceProperties object itself.
     */
    public AzureSqlReferenceInputDataSourceProperties withUser(String user) {
        this.user = user;
        return this;
    }

    /**
     * Get the password property: This element is associated with the datasource element. This is the password that will
     * be used to connect to the SQL Database instance.
     *
     * @return the password value.
     */
    public String password() {
        return this.password;
    }

    /**
     * Set the password property: This element is associated with the datasource element. This is the password that will
     * be used to connect to the SQL Database instance.
     *
     * @param password the password value to set.
     * @return the AzureSqlReferenceInputDataSourceProperties object itself.
     */
    public AzureSqlReferenceInputDataSourceProperties withPassword(String password) {
        this.password = password;
        return this;
    }

    /**
     * Get the table property: This element is associated with the datasource element. The name of the table in the
     * Azure SQL database..
     *
     * @return the table value.
     */
    public String table() {
        return this.table;
    }

    /**
     * Set the table property: This element is associated with the datasource element. The name of the table in the
     * Azure SQL database..
     *
     * @param table the table value to set.
     * @return the AzureSqlReferenceInputDataSourceProperties object itself.
     */
    public AzureSqlReferenceInputDataSourceProperties withTable(String table) {
        this.table = table;
        return this;
    }

    /**
     * Get the refreshType property: Indicates the type of data refresh option.
     *
     * @return the refreshType value.
     */
    public RefreshType refreshType() {
        return this.refreshType;
    }

    /**
     * Set the refreshType property: Indicates the type of data refresh option.
     *
     * @param refreshType the refreshType value to set.
     * @return the AzureSqlReferenceInputDataSourceProperties object itself.
     */
    public AzureSqlReferenceInputDataSourceProperties withRefreshType(RefreshType refreshType) {
        this.refreshType = refreshType;
        return this;
    }

    /**
     * Get the refreshRate property: This element is associated with the datasource element. This indicates how
     * frequently the data will be fetched from the database. It is of DateTime format.
     *
     * @return the refreshRate value.
     */
    public String refreshRate() {
        return this.refreshRate;
    }

    /**
     * Set the refreshRate property: This element is associated with the datasource element. This indicates how
     * frequently the data will be fetched from the database. It is of DateTime format.
     *
     * @param refreshRate the refreshRate value to set.
     * @return the AzureSqlReferenceInputDataSourceProperties object itself.
     */
    public AzureSqlReferenceInputDataSourceProperties withRefreshRate(String refreshRate) {
        this.refreshRate = refreshRate;
        return this;
    }

    /**
     * Get the fullSnapshotQuery property: This element is associated with the datasource element. This query is used to
     * fetch data from the sql database.
     *
     * @return the fullSnapshotQuery value.
     */
    public String fullSnapshotQuery() {
        return this.fullSnapshotQuery;
    }

    /**
     * Set the fullSnapshotQuery property: This element is associated with the datasource element. This query is used to
     * fetch data from the sql database.
     *
     * @param fullSnapshotQuery the fullSnapshotQuery value to set.
     * @return the AzureSqlReferenceInputDataSourceProperties object itself.
     */
    public AzureSqlReferenceInputDataSourceProperties withFullSnapshotQuery(String fullSnapshotQuery) {
        this.fullSnapshotQuery = fullSnapshotQuery;
        return this;
    }

    /**
     * Get the deltaSnapshotQuery property: This element is associated with the datasource element. This query is used
     * to fetch incremental changes from the SQL database. To use this option, we recommend using temporal tables in
     * Azure SQL Database.
     *
     * @return the deltaSnapshotQuery value.
     */
    public String deltaSnapshotQuery() {
        return this.deltaSnapshotQuery;
    }

    /**
     * Set the deltaSnapshotQuery property: This element is associated with the datasource element. This query is used
     * to fetch incremental changes from the SQL database. To use this option, we recommend using temporal tables in
     * Azure SQL Database.
     *
     * @param deltaSnapshotQuery the deltaSnapshotQuery value to set.
     * @return the AzureSqlReferenceInputDataSourceProperties object itself.
     */
    public AzureSqlReferenceInputDataSourceProperties withDeltaSnapshotQuery(String deltaSnapshotQuery) {
        this.deltaSnapshotQuery = deltaSnapshotQuery;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
    }
}
