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

com.azure.resourcemanager.datafactory.models.SsisChildPackage 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;

/**
 * SSIS embedded child package.
 */
@Fluent
public final class SsisChildPackage implements JsonSerializable {
    /*
     * Path for embedded child package. Type: string (or Expression with resultType string).
     */
    private Object packagePath;

    /*
     * Name for embedded child package.
     */
    private String packageName;

    /*
     * Content for embedded child package. Type: string (or Expression with resultType string).
     */
    private Object packageContent;

    /*
     * Last modified date for embedded child package.
     */
    private String packageLastModifiedDate;

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

    /**
     * Get the packagePath property: Path for embedded child package. Type: string (or Expression with resultType
     * string).
     * 
     * @return the packagePath value.
     */
    public Object packagePath() {
        return this.packagePath;
    }

    /**
     * Set the packagePath property: Path for embedded child package. Type: string (or Expression with resultType
     * string).
     * 
     * @param packagePath the packagePath value to set.
     * @return the SsisChildPackage object itself.
     */
    public SsisChildPackage withPackagePath(Object packagePath) {
        this.packagePath = packagePath;
        return this;
    }

    /**
     * Get the packageName property: Name for embedded child package.
     * 
     * @return the packageName value.
     */
    public String packageName() {
        return this.packageName;
    }

    /**
     * Set the packageName property: Name for embedded child package.
     * 
     * @param packageName the packageName value to set.
     * @return the SsisChildPackage object itself.
     */
    public SsisChildPackage withPackageName(String packageName) {
        this.packageName = packageName;
        return this;
    }

    /**
     * Get the packageContent property: Content for embedded child package. Type: string (or Expression with resultType
     * string).
     * 
     * @return the packageContent value.
     */
    public Object packageContent() {
        return this.packageContent;
    }

    /**
     * Set the packageContent property: Content for embedded child package. Type: string (or Expression with resultType
     * string).
     * 
     * @param packageContent the packageContent value to set.
     * @return the SsisChildPackage object itself.
     */
    public SsisChildPackage withPackageContent(Object packageContent) {
        this.packageContent = packageContent;
        return this;
    }

    /**
     * Get the packageLastModifiedDate property: Last modified date for embedded child package.
     * 
     * @return the packageLastModifiedDate value.
     */
    public String packageLastModifiedDate() {
        return this.packageLastModifiedDate;
    }

    /**
     * Set the packageLastModifiedDate property: Last modified date for embedded child package.
     * 
     * @param packageLastModifiedDate the packageLastModifiedDate value to set.
     * @return the SsisChildPackage object itself.
     */
    public SsisChildPackage withPackageLastModifiedDate(String packageLastModifiedDate) {
        this.packageLastModifiedDate = packageLastModifiedDate;
        return this;
    }

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

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeUntypedField("packagePath", this.packagePath);
        jsonWriter.writeUntypedField("packageContent", this.packageContent);
        jsonWriter.writeStringField("packageName", this.packageName);
        jsonWriter.writeStringField("packageLastModifiedDate", this.packageLastModifiedDate);
        return jsonWriter.writeEndObject();
    }

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

                if ("packagePath".equals(fieldName)) {
                    deserializedSsisChildPackage.packagePath = reader.readUntyped();
                } else if ("packageContent".equals(fieldName)) {
                    deserializedSsisChildPackage.packageContent = reader.readUntyped();
                } else if ("packageName".equals(fieldName)) {
                    deserializedSsisChildPackage.packageName = reader.getString();
                } else if ("packageLastModifiedDate".equals(fieldName)) {
                    deserializedSsisChildPackage.packageLastModifiedDate = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedSsisChildPackage;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy