
com.azure.resourcemanager.datafactory.models.PolybaseSettings 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;
import java.util.LinkedHashMap;
import java.util.Map;
/**
* PolyBase settings.
*/
@Fluent
public final class PolybaseSettings implements JsonSerializable {
/*
* Reject type.
*/
private PolybaseSettingsRejectType rejectType;
/*
* Specifies the value or the percentage of rows that can be rejected before the query fails. Type: number (or
* Expression with resultType number), minimum: 0.
*/
private Object rejectValue;
/*
* Determines the number of rows to attempt to retrieve before the PolyBase recalculates the percentage of rejected
* rows. Type: integer (or Expression with resultType integer), minimum: 0.
*/
private Object rejectSampleValue;
/*
* Specifies how to handle missing values in delimited text files when PolyBase retrieves data from the text file.
* Type: boolean (or Expression with resultType boolean).
*/
private Object useTypeDefault;
/*
* PolyBase settings.
*/
private Map additionalProperties;
/**
* Creates an instance of PolybaseSettings class.
*/
public PolybaseSettings() {
}
/**
* Get the rejectType property: Reject type.
*
* @return the rejectType value.
*/
public PolybaseSettingsRejectType rejectType() {
return this.rejectType;
}
/**
* Set the rejectType property: Reject type.
*
* @param rejectType the rejectType value to set.
* @return the PolybaseSettings object itself.
*/
public PolybaseSettings withRejectType(PolybaseSettingsRejectType rejectType) {
this.rejectType = rejectType;
return this;
}
/**
* Get the rejectValue property: Specifies the value or the percentage of rows that can be rejected before the query
* fails. Type: number (or Expression with resultType number), minimum: 0.
*
* @return the rejectValue value.
*/
public Object rejectValue() {
return this.rejectValue;
}
/**
* Set the rejectValue property: Specifies the value or the percentage of rows that can be rejected before the query
* fails. Type: number (or Expression with resultType number), minimum: 0.
*
* @param rejectValue the rejectValue value to set.
* @return the PolybaseSettings object itself.
*/
public PolybaseSettings withRejectValue(Object rejectValue) {
this.rejectValue = rejectValue;
return this;
}
/**
* Get the rejectSampleValue property: Determines the number of rows to attempt to retrieve before the PolyBase
* recalculates the percentage of rejected rows. Type: integer (or Expression with resultType integer), minimum: 0.
*
* @return the rejectSampleValue value.
*/
public Object rejectSampleValue() {
return this.rejectSampleValue;
}
/**
* Set the rejectSampleValue property: Determines the number of rows to attempt to retrieve before the PolyBase
* recalculates the percentage of rejected rows. Type: integer (or Expression with resultType integer), minimum: 0.
*
* @param rejectSampleValue the rejectSampleValue value to set.
* @return the PolybaseSettings object itself.
*/
public PolybaseSettings withRejectSampleValue(Object rejectSampleValue) {
this.rejectSampleValue = rejectSampleValue;
return this;
}
/**
* Get the useTypeDefault property: Specifies how to handle missing values in delimited text files when PolyBase
* retrieves data from the text file. Type: boolean (or Expression with resultType boolean).
*
* @return the useTypeDefault value.
*/
public Object useTypeDefault() {
return this.useTypeDefault;
}
/**
* Set the useTypeDefault property: Specifies how to handle missing values in delimited text files when PolyBase
* retrieves data from the text file. Type: boolean (or Expression with resultType boolean).
*
* @param useTypeDefault the useTypeDefault value to set.
* @return the PolybaseSettings object itself.
*/
public PolybaseSettings withUseTypeDefault(Object useTypeDefault) {
this.useTypeDefault = useTypeDefault;
return this;
}
/**
* Get the additionalProperties property: PolyBase settings.
*
* @return the additionalProperties value.
*/
public Map additionalProperties() {
return this.additionalProperties;
}
/**
* Set the additionalProperties property: PolyBase settings.
*
* @param additionalProperties the additionalProperties value to set.
* @return the PolybaseSettings object itself.
*/
public PolybaseSettings withAdditionalProperties(Map additionalProperties) {
this.additionalProperties = additionalProperties;
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.writeStringField("rejectType", this.rejectType == null ? null : this.rejectType.toString());
jsonWriter.writeUntypedField("rejectValue", this.rejectValue);
jsonWriter.writeUntypedField("rejectSampleValue", this.rejectSampleValue);
jsonWriter.writeUntypedField("useTypeDefault", this.useTypeDefault);
if (additionalProperties != null) {
for (Map.Entry additionalProperty : additionalProperties.entrySet()) {
jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue());
}
}
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of PolybaseSettings from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of PolybaseSettings 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 PolybaseSettings.
*/
public static PolybaseSettings fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
PolybaseSettings deserializedPolybaseSettings = new PolybaseSettings();
Map additionalProperties = null;
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("rejectType".equals(fieldName)) {
deserializedPolybaseSettings.rejectType = PolybaseSettingsRejectType.fromString(reader.getString());
} else if ("rejectValue".equals(fieldName)) {
deserializedPolybaseSettings.rejectValue = reader.readUntyped();
} else if ("rejectSampleValue".equals(fieldName)) {
deserializedPolybaseSettings.rejectSampleValue = reader.readUntyped();
} else if ("useTypeDefault".equals(fieldName)) {
deserializedPolybaseSettings.useTypeDefault = reader.readUntyped();
} else {
if (additionalProperties == null) {
additionalProperties = new LinkedHashMap<>();
}
additionalProperties.put(fieldName, reader.readUntyped());
}
}
deserializedPolybaseSettings.additionalProperties = additionalProperties;
return deserializedPolybaseSettings;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy