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

com.azure.resourcemanager.datafactory.models.LakeHouseTableSink 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.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * A copy activity for Microsoft Fabric LakeHouse Table sink.
 */
@Fluent
public final class LakeHouseTableSink extends CopySink {
    /*
     * Copy sink type.
     */
    private String type = "LakeHouseTableSink";

    /*
     * The type of table action for LakeHouse Table sink. Possible values include: "None", "Append", "Overwrite".
     */
    private Object tableActionOption;

    /*
     * Create partitions in folder structure based on one or multiple columns. Each distinct column value (pair) will be
     * a new partition. Possible values include: "None", "PartitionByKey".
     */
    private Object partitionOption;

    /*
     * Specify the partition column names from sink columns. Type: array of objects (or Expression with resultType array
     * of objects).
     */
    private Object partitionNameList;

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

    /**
     * Get the type property: Copy sink type.
     * 
     * @return the type value.
     */
    @Override
    public String type() {
        return this.type;
    }

    /**
     * Get the tableActionOption property: The type of table action for LakeHouse Table sink. Possible values include:
     * "None", "Append", "Overwrite".
     * 
     * @return the tableActionOption value.
     */
    public Object tableActionOption() {
        return this.tableActionOption;
    }

    /**
     * Set the tableActionOption property: The type of table action for LakeHouse Table sink. Possible values include:
     * "None", "Append", "Overwrite".
     * 
     * @param tableActionOption the tableActionOption value to set.
     * @return the LakeHouseTableSink object itself.
     */
    public LakeHouseTableSink withTableActionOption(Object tableActionOption) {
        this.tableActionOption = tableActionOption;
        return this;
    }

    /**
     * Get the partitionOption property: Create partitions in folder structure based on one or multiple columns. Each
     * distinct column value (pair) will be a new partition. Possible values include: "None", "PartitionByKey".
     * 
     * @return the partitionOption value.
     */
    public Object partitionOption() {
        return this.partitionOption;
    }

    /**
     * Set the partitionOption property: Create partitions in folder structure based on one or multiple columns. Each
     * distinct column value (pair) will be a new partition. Possible values include: "None", "PartitionByKey".
     * 
     * @param partitionOption the partitionOption value to set.
     * @return the LakeHouseTableSink object itself.
     */
    public LakeHouseTableSink withPartitionOption(Object partitionOption) {
        this.partitionOption = partitionOption;
        return this;
    }

    /**
     * Get the partitionNameList property: Specify the partition column names from sink columns. Type: array of objects
     * (or Expression with resultType array of objects).
     * 
     * @return the partitionNameList value.
     */
    public Object partitionNameList() {
        return this.partitionNameList;
    }

    /**
     * Set the partitionNameList property: Specify the partition column names from sink columns. Type: array of objects
     * (or Expression with resultType array of objects).
     * 
     * @param partitionNameList the partitionNameList value to set.
     * @return the LakeHouseTableSink object itself.
     */
    public LakeHouseTableSink withPartitionNameList(Object partitionNameList) {
        this.partitionNameList = partitionNameList;
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public LakeHouseTableSink withWriteBatchSize(Object writeBatchSize) {
        super.withWriteBatchSize(writeBatchSize);
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public LakeHouseTableSink withWriteBatchTimeout(Object writeBatchTimeout) {
        super.withWriteBatchTimeout(writeBatchTimeout);
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public LakeHouseTableSink withSinkRetryCount(Object sinkRetryCount) {
        super.withSinkRetryCount(sinkRetryCount);
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public LakeHouseTableSink withSinkRetryWait(Object sinkRetryWait) {
        super.withSinkRetryWait(sinkRetryWait);
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public LakeHouseTableSink withMaxConcurrentConnections(Object maxConcurrentConnections) {
        super.withMaxConcurrentConnections(maxConcurrentConnections);
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public LakeHouseTableSink withDisableMetricsCollection(Object disableMetricsCollection) {
        super.withDisableMetricsCollection(disableMetricsCollection);
        return this;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeUntypedField("writeBatchSize", writeBatchSize());
        jsonWriter.writeUntypedField("writeBatchTimeout", writeBatchTimeout());
        jsonWriter.writeUntypedField("sinkRetryCount", sinkRetryCount());
        jsonWriter.writeUntypedField("sinkRetryWait", sinkRetryWait());
        jsonWriter.writeUntypedField("maxConcurrentConnections", maxConcurrentConnections());
        jsonWriter.writeUntypedField("disableMetricsCollection", disableMetricsCollection());
        jsonWriter.writeStringField("type", this.type);
        jsonWriter.writeUntypedField("tableActionOption", this.tableActionOption);
        jsonWriter.writeUntypedField("partitionOption", this.partitionOption);
        jsonWriter.writeUntypedField("partitionNameList", this.partitionNameList);
        if (additionalProperties() != null) {
            for (Map.Entry additionalProperty : additionalProperties().entrySet()) {
                jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue());
            }
        }
        return jsonWriter.writeEndObject();
    }

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

                if ("writeBatchSize".equals(fieldName)) {
                    deserializedLakeHouseTableSink.withWriteBatchSize(reader.readUntyped());
                } else if ("writeBatchTimeout".equals(fieldName)) {
                    deserializedLakeHouseTableSink.withWriteBatchTimeout(reader.readUntyped());
                } else if ("sinkRetryCount".equals(fieldName)) {
                    deserializedLakeHouseTableSink.withSinkRetryCount(reader.readUntyped());
                } else if ("sinkRetryWait".equals(fieldName)) {
                    deserializedLakeHouseTableSink.withSinkRetryWait(reader.readUntyped());
                } else if ("maxConcurrentConnections".equals(fieldName)) {
                    deserializedLakeHouseTableSink.withMaxConcurrentConnections(reader.readUntyped());
                } else if ("disableMetricsCollection".equals(fieldName)) {
                    deserializedLakeHouseTableSink.withDisableMetricsCollection(reader.readUntyped());
                } else if ("type".equals(fieldName)) {
                    deserializedLakeHouseTableSink.type = reader.getString();
                } else if ("tableActionOption".equals(fieldName)) {
                    deserializedLakeHouseTableSink.tableActionOption = reader.readUntyped();
                } else if ("partitionOption".equals(fieldName)) {
                    deserializedLakeHouseTableSink.partitionOption = reader.readUntyped();
                } else if ("partitionNameList".equals(fieldName)) {
                    deserializedLakeHouseTableSink.partitionNameList = reader.readUntyped();
                } else {
                    if (additionalProperties == null) {
                        additionalProperties = new LinkedHashMap<>();
                    }

                    additionalProperties.put(fieldName, reader.readUntyped());
                }
            }
            deserializedLakeHouseTableSink.withAdditionalProperties(additionalProperties);

            return deserializedLakeHouseTableSink;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy