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

com.azure.resourcemanager.datafactory.models.DistcpSettings 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.core.util.logging.ClientLogger;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * Distcp settings.
 */
@Fluent
public final class DistcpSettings implements JsonSerializable {
    /*
     * Specifies the Yarn ResourceManager endpoint. Type: string (or Expression with resultType string).
     */
    private Object resourceManagerEndpoint;

    /*
     * Specifies an existing folder path which will be used to store temp Distcp command script. The script file is
     * generated by ADF and will be removed after Copy job finished. Type: string (or Expression with resultType
     * string).
     */
    private Object tempScriptPath;

    /*
     * Specifies the Distcp options. Type: string (or Expression with resultType string).
     */
    private Object distcpOptions;

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

    /**
     * Get the resourceManagerEndpoint property: Specifies the Yarn ResourceManager endpoint. Type: string (or
     * Expression with resultType string).
     * 
     * @return the resourceManagerEndpoint value.
     */
    public Object resourceManagerEndpoint() {
        return this.resourceManagerEndpoint;
    }

    /**
     * Set the resourceManagerEndpoint property: Specifies the Yarn ResourceManager endpoint. Type: string (or
     * Expression with resultType string).
     * 
     * @param resourceManagerEndpoint the resourceManagerEndpoint value to set.
     * @return the DistcpSettings object itself.
     */
    public DistcpSettings withResourceManagerEndpoint(Object resourceManagerEndpoint) {
        this.resourceManagerEndpoint = resourceManagerEndpoint;
        return this;
    }

    /**
     * Get the tempScriptPath property: Specifies an existing folder path which will be used to store temp Distcp
     * command script. The script file is generated by ADF and will be removed after Copy job finished. Type: string (or
     * Expression with resultType string).
     * 
     * @return the tempScriptPath value.
     */
    public Object tempScriptPath() {
        return this.tempScriptPath;
    }

    /**
     * Set the tempScriptPath property: Specifies an existing folder path which will be used to store temp Distcp
     * command script. The script file is generated by ADF and will be removed after Copy job finished. Type: string (or
     * Expression with resultType string).
     * 
     * @param tempScriptPath the tempScriptPath value to set.
     * @return the DistcpSettings object itself.
     */
    public DistcpSettings withTempScriptPath(Object tempScriptPath) {
        this.tempScriptPath = tempScriptPath;
        return this;
    }

    /**
     * Get the distcpOptions property: Specifies the Distcp options. Type: string (or Expression with resultType
     * string).
     * 
     * @return the distcpOptions value.
     */
    public Object distcpOptions() {
        return this.distcpOptions;
    }

    /**
     * Set the distcpOptions property: Specifies the Distcp options. Type: string (or Expression with resultType
     * string).
     * 
     * @param distcpOptions the distcpOptions value to set.
     * @return the DistcpSettings object itself.
     */
    public DistcpSettings withDistcpOptions(Object distcpOptions) {
        this.distcpOptions = distcpOptions;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (resourceManagerEndpoint() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property resourceManagerEndpoint in model DistcpSettings"));
        }
        if (tempScriptPath() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException("Missing required property tempScriptPath in model DistcpSettings"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(DistcpSettings.class);

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

    /**
     * Reads an instance of DistcpSettings from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of DistcpSettings if the JsonReader was pointing to an instance of it, or null if it was
     * pointing to JSON null.
     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
     * @throws IOException If an error occurs while reading the DistcpSettings.
     */
    public static DistcpSettings fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            DistcpSettings deserializedDistcpSettings = new DistcpSettings();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("resourceManagerEndpoint".equals(fieldName)) {
                    deserializedDistcpSettings.resourceManagerEndpoint = reader.readUntyped();
                } else if ("tempScriptPath".equals(fieldName)) {
                    deserializedDistcpSettings.tempScriptPath = reader.readUntyped();
                } else if ("distcpOptions".equals(fieldName)) {
                    deserializedDistcpSettings.distcpOptions = reader.readUntyped();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedDistcpSettings;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy