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

com.azure.resourcemanager.datafactory.models.SqlUpsertSettings Maven / Gradle / Ivy

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

package com.azure.resourcemanager.datafactory.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;

/**
 * Sql upsert option settings.
 */
@Fluent
public final class SqlUpsertSettings implements JsonSerializable {
    /*
     * Specifies whether to use temp db for upsert interim table. Type: boolean (or Expression with resultType boolean).
     */
    private Object useTempDB;

    /*
     * Schema name for interim table. Type: string (or Expression with resultType string).
     */
    private Object interimSchemaName;

    /*
     * Key column names for unique row identification. Type: array of strings (or Expression with resultType array of
     * strings).
     */
    private Object keys;

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

    /**
     * Get the useTempDB property: Specifies whether to use temp db for upsert interim table. Type: boolean (or
     * Expression with resultType boolean).
     * 
     * @return the useTempDB value.
     */
    public Object useTempDB() {
        return this.useTempDB;
    }

    /**
     * Set the useTempDB property: Specifies whether to use temp db for upsert interim table. Type: boolean (or
     * Expression with resultType boolean).
     * 
     * @param useTempDB the useTempDB value to set.
     * @return the SqlUpsertSettings object itself.
     */
    public SqlUpsertSettings withUseTempDB(Object useTempDB) {
        this.useTempDB = useTempDB;
        return this;
    }

    /**
     * Get the interimSchemaName property: Schema name for interim table. Type: string (or Expression with resultType
     * string).
     * 
     * @return the interimSchemaName value.
     */
    public Object interimSchemaName() {
        return this.interimSchemaName;
    }

    /**
     * Set the interimSchemaName property: Schema name for interim table. Type: string (or Expression with resultType
     * string).
     * 
     * @param interimSchemaName the interimSchemaName value to set.
     * @return the SqlUpsertSettings object itself.
     */
    public SqlUpsertSettings withInterimSchemaName(Object interimSchemaName) {
        this.interimSchemaName = interimSchemaName;
        return this;
    }

    /**
     * Get the keys property: Key column names for unique row identification. Type: array of strings (or Expression with
     * resultType array of strings).
     * 
     * @return the keys value.
     */
    public Object keys() {
        return this.keys;
    }

    /**
     * Set the keys property: Key column names for unique row identification. Type: array of strings (or Expression with
     * resultType array of strings).
     * 
     * @param keys the keys value to set.
     * @return the SqlUpsertSettings object itself.
     */
    public SqlUpsertSettings withKeys(Object keys) {
        this.keys = keys;
        return this;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeUntypedField("useTempDB", this.useTempDB);
        jsonWriter.writeUntypedField("interimSchemaName", this.interimSchemaName);
        jsonWriter.writeUntypedField("keys", this.keys);
        return jsonWriter.writeEndObject();
    }

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

                if ("useTempDB".equals(fieldName)) {
                    deserializedSqlUpsertSettings.useTempDB = reader.readUntyped();
                } else if ("interimSchemaName".equals(fieldName)) {
                    deserializedSqlUpsertSettings.interimSchemaName = reader.readUntyped();
                } else if ("keys".equals(fieldName)) {
                    deserializedSqlUpsertSettings.keys = reader.readUntyped();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedSqlUpsertSettings;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy