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

com.azure.resourcemanager.datafactory.models.DataFlowDebugPackage 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.List;
import java.util.Map;

/**
 * Request body structure for starting data flow debug session.
 */
@Fluent
public final class DataFlowDebugPackage implements JsonSerializable {
    /*
     * The ID of data flow debug session.
     */
    private String sessionId;

    /*
     * Data flow instance.
     */
    private DataFlowDebugResource dataFlow;

    /*
     * List of Data flows
     */
    private List dataFlows;

    /*
     * List of datasets.
     */
    private List datasets;

    /*
     * List of linked services.
     */
    private List linkedServices;

    /*
     * Staging info for debug session.
     */
    private DataFlowStagingInfo staging;

    /*
     * Data flow debug settings.
     */
    private DataFlowDebugPackageDebugSettings debugSettings;

    /*
     * Request body structure for starting data flow debug session.
     */
    private Map additionalProperties;

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

    /**
     * Get the sessionId property: The ID of data flow debug session.
     * 
     * @return the sessionId value.
     */
    public String sessionId() {
        return this.sessionId;
    }

    /**
     * Set the sessionId property: The ID of data flow debug session.
     * 
     * @param sessionId the sessionId value to set.
     * @return the DataFlowDebugPackage object itself.
     */
    public DataFlowDebugPackage withSessionId(String sessionId) {
        this.sessionId = sessionId;
        return this;
    }

    /**
     * Get the dataFlow property: Data flow instance.
     * 
     * @return the dataFlow value.
     */
    public DataFlowDebugResource dataFlow() {
        return this.dataFlow;
    }

    /**
     * Set the dataFlow property: Data flow instance.
     * 
     * @param dataFlow the dataFlow value to set.
     * @return the DataFlowDebugPackage object itself.
     */
    public DataFlowDebugPackage withDataFlow(DataFlowDebugResource dataFlow) {
        this.dataFlow = dataFlow;
        return this;
    }

    /**
     * Get the dataFlows property: List of Data flows.
     * 
     * @return the dataFlows value.
     */
    public List dataFlows() {
        return this.dataFlows;
    }

    /**
     * Set the dataFlows property: List of Data flows.
     * 
     * @param dataFlows the dataFlows value to set.
     * @return the DataFlowDebugPackage object itself.
     */
    public DataFlowDebugPackage withDataFlows(List dataFlows) {
        this.dataFlows = dataFlows;
        return this;
    }

    /**
     * Get the datasets property: List of datasets.
     * 
     * @return the datasets value.
     */
    public List datasets() {
        return this.datasets;
    }

    /**
     * Set the datasets property: List of datasets.
     * 
     * @param datasets the datasets value to set.
     * @return the DataFlowDebugPackage object itself.
     */
    public DataFlowDebugPackage withDatasets(List datasets) {
        this.datasets = datasets;
        return this;
    }

    /**
     * Get the linkedServices property: List of linked services.
     * 
     * @return the linkedServices value.
     */
    public List linkedServices() {
        return this.linkedServices;
    }

    /**
     * Set the linkedServices property: List of linked services.
     * 
     * @param linkedServices the linkedServices value to set.
     * @return the DataFlowDebugPackage object itself.
     */
    public DataFlowDebugPackage withLinkedServices(List linkedServices) {
        this.linkedServices = linkedServices;
        return this;
    }

    /**
     * Get the staging property: Staging info for debug session.
     * 
     * @return the staging value.
     */
    public DataFlowStagingInfo staging() {
        return this.staging;
    }

    /**
     * Set the staging property: Staging info for debug session.
     * 
     * @param staging the staging value to set.
     * @return the DataFlowDebugPackage object itself.
     */
    public DataFlowDebugPackage withStaging(DataFlowStagingInfo staging) {
        this.staging = staging;
        return this;
    }

    /**
     * Get the debugSettings property: Data flow debug settings.
     * 
     * @return the debugSettings value.
     */
    public DataFlowDebugPackageDebugSettings debugSettings() {
        return this.debugSettings;
    }

    /**
     * Set the debugSettings property: Data flow debug settings.
     * 
     * @param debugSettings the debugSettings value to set.
     * @return the DataFlowDebugPackage object itself.
     */
    public DataFlowDebugPackage withDebugSettings(DataFlowDebugPackageDebugSettings debugSettings) {
        this.debugSettings = debugSettings;
        return this;
    }

    /**
     * Get the additionalProperties property: Request body structure for starting data flow debug session.
     * 
     * @return the additionalProperties value.
     */
    public Map additionalProperties() {
        return this.additionalProperties;
    }

    /**
     * Set the additionalProperties property: Request body structure for starting data flow debug session.
     * 
     * @param additionalProperties the additionalProperties value to set.
     * @return the DataFlowDebugPackage object itself.
     */
    public DataFlowDebugPackage withAdditionalProperties(Map additionalProperties) {
        this.additionalProperties = additionalProperties;
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (dataFlow() != null) {
            dataFlow().validate();
        }
        if (dataFlows() != null) {
            dataFlows().forEach(e -> e.validate());
        }
        if (datasets() != null) {
            datasets().forEach(e -> e.validate());
        }
        if (linkedServices() != null) {
            linkedServices().forEach(e -> e.validate());
        }
        if (staging() != null) {
            staging().validate();
        }
        if (debugSettings() != null) {
            debugSettings().validate();
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("sessionId", this.sessionId);
        jsonWriter.writeJsonField("dataFlow", this.dataFlow);
        jsonWriter.writeArrayField("dataFlows", this.dataFlows, (writer, element) -> writer.writeJson(element));
        jsonWriter.writeArrayField("datasets", this.datasets, (writer, element) -> writer.writeJson(element));
        jsonWriter.writeArrayField("linkedServices", this.linkedServices,
            (writer, element) -> writer.writeJson(element));
        jsonWriter.writeJsonField("staging", this.staging);
        jsonWriter.writeJsonField("debugSettings", this.debugSettings);
        if (additionalProperties != null) {
            for (Map.Entry additionalProperty : additionalProperties.entrySet()) {
                jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue());
            }
        }
        return jsonWriter.writeEndObject();
    }

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

                if ("sessionId".equals(fieldName)) {
                    deserializedDataFlowDebugPackage.sessionId = reader.getString();
                } else if ("dataFlow".equals(fieldName)) {
                    deserializedDataFlowDebugPackage.dataFlow = DataFlowDebugResource.fromJson(reader);
                } else if ("dataFlows".equals(fieldName)) {
                    List dataFlows
                        = reader.readArray(reader1 -> DataFlowDebugResource.fromJson(reader1));
                    deserializedDataFlowDebugPackage.dataFlows = dataFlows;
                } else if ("datasets".equals(fieldName)) {
                    List datasets
                        = reader.readArray(reader1 -> DatasetDebugResource.fromJson(reader1));
                    deserializedDataFlowDebugPackage.datasets = datasets;
                } else if ("linkedServices".equals(fieldName)) {
                    List linkedServices
                        = reader.readArray(reader1 -> LinkedServiceDebugResource.fromJson(reader1));
                    deserializedDataFlowDebugPackage.linkedServices = linkedServices;
                } else if ("staging".equals(fieldName)) {
                    deserializedDataFlowDebugPackage.staging = DataFlowStagingInfo.fromJson(reader);
                } else if ("debugSettings".equals(fieldName)) {
                    deserializedDataFlowDebugPackage.debugSettings = DataFlowDebugPackageDebugSettings.fromJson(reader);
                } else {
                    if (additionalProperties == null) {
                        additionalProperties = new LinkedHashMap<>();
                    }

                    additionalProperties.put(fieldName, reader.readUntyped());
                }
            }
            deserializedDataFlowDebugPackage.additionalProperties = additionalProperties;

            return deserializedDataFlowDebugPackage;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy