
com.azure.resourcemanager.datafactory.models.DocumentDbCollectionSink 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 Document Database Collection sink.
*/
@Fluent
public final class DocumentDbCollectionSink extends CopySink {
/*
* Copy sink type.
*/
private String type = "DocumentDbCollectionSink";
/*
* Nested properties separator. Default is . (dot). Type: string (or Expression with resultType string).
*/
private Object nestingSeparator;
/*
* Describes how to write data to Azure Cosmos DB. Type: string (or Expression with resultType string). Allowed
* values: insert and upsert.
*/
private Object writeBehavior;
/**
* Creates an instance of DocumentDbCollectionSink class.
*/
public DocumentDbCollectionSink() {
}
/**
* Get the type property: Copy sink type.
*
* @return the type value.
*/
@Override
public String type() {
return this.type;
}
/**
* Get the nestingSeparator property: Nested properties separator. Default is . (dot). Type: string (or Expression
* with resultType string).
*
* @return the nestingSeparator value.
*/
public Object nestingSeparator() {
return this.nestingSeparator;
}
/**
* Set the nestingSeparator property: Nested properties separator. Default is . (dot). Type: string (or Expression
* with resultType string).
*
* @param nestingSeparator the nestingSeparator value to set.
* @return the DocumentDbCollectionSink object itself.
*/
public DocumentDbCollectionSink withNestingSeparator(Object nestingSeparator) {
this.nestingSeparator = nestingSeparator;
return this;
}
/**
* Get the writeBehavior property: Describes how to write data to Azure Cosmos DB. Type: string (or Expression with
* resultType string). Allowed values: insert and upsert.
*
* @return the writeBehavior value.
*/
public Object writeBehavior() {
return this.writeBehavior;
}
/**
* Set the writeBehavior property: Describes how to write data to Azure Cosmos DB. Type: string (or Expression with
* resultType string). Allowed values: insert and upsert.
*
* @param writeBehavior the writeBehavior value to set.
* @return the DocumentDbCollectionSink object itself.
*/
public DocumentDbCollectionSink withWriteBehavior(Object writeBehavior) {
this.writeBehavior = writeBehavior;
return this;
}
/**
* {@inheritDoc}
*/
@Override
public DocumentDbCollectionSink withWriteBatchSize(Object writeBatchSize) {
super.withWriteBatchSize(writeBatchSize);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public DocumentDbCollectionSink withWriteBatchTimeout(Object writeBatchTimeout) {
super.withWriteBatchTimeout(writeBatchTimeout);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public DocumentDbCollectionSink withSinkRetryCount(Object sinkRetryCount) {
super.withSinkRetryCount(sinkRetryCount);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public DocumentDbCollectionSink withSinkRetryWait(Object sinkRetryWait) {
super.withSinkRetryWait(sinkRetryWait);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public DocumentDbCollectionSink withMaxConcurrentConnections(Object maxConcurrentConnections) {
super.withMaxConcurrentConnections(maxConcurrentConnections);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public DocumentDbCollectionSink 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("nestingSeparator", this.nestingSeparator);
jsonWriter.writeUntypedField("writeBehavior", this.writeBehavior);
if (additionalProperties() != null) {
for (Map.Entry additionalProperty : additionalProperties().entrySet()) {
jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue());
}
}
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of DocumentDbCollectionSink from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of DocumentDbCollectionSink 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 DocumentDbCollectionSink.
*/
public static DocumentDbCollectionSink fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
DocumentDbCollectionSink deserializedDocumentDbCollectionSink = new DocumentDbCollectionSink();
Map additionalProperties = null;
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("writeBatchSize".equals(fieldName)) {
deserializedDocumentDbCollectionSink.withWriteBatchSize(reader.readUntyped());
} else if ("writeBatchTimeout".equals(fieldName)) {
deserializedDocumentDbCollectionSink.withWriteBatchTimeout(reader.readUntyped());
} else if ("sinkRetryCount".equals(fieldName)) {
deserializedDocumentDbCollectionSink.withSinkRetryCount(reader.readUntyped());
} else if ("sinkRetryWait".equals(fieldName)) {
deserializedDocumentDbCollectionSink.withSinkRetryWait(reader.readUntyped());
} else if ("maxConcurrentConnections".equals(fieldName)) {
deserializedDocumentDbCollectionSink.withMaxConcurrentConnections(reader.readUntyped());
} else if ("disableMetricsCollection".equals(fieldName)) {
deserializedDocumentDbCollectionSink.withDisableMetricsCollection(reader.readUntyped());
} else if ("type".equals(fieldName)) {
deserializedDocumentDbCollectionSink.type = reader.getString();
} else if ("nestingSeparator".equals(fieldName)) {
deserializedDocumentDbCollectionSink.nestingSeparator = reader.readUntyped();
} else if ("writeBehavior".equals(fieldName)) {
deserializedDocumentDbCollectionSink.writeBehavior = reader.readUntyped();
} else {
if (additionalProperties == null) {
additionalProperties = new LinkedHashMap<>();
}
additionalProperties.put(fieldName, reader.readUntyped());
}
}
deserializedDocumentDbCollectionSink.withAdditionalProperties(additionalProperties);
return deserializedDocumentDbCollectionSink;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy