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

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

/**
 * Ssis environment reference.
 */
@Fluent
public final class SsisEnvironmentReference implements JsonSerializable {
    /*
     * Environment reference id.
     */
    private Long id;

    /*
     * Environment folder name.
     */
    private String environmentFolderName;

    /*
     * Environment name.
     */
    private String environmentName;

    /*
     * Reference type
     */
    private String referenceType;

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

    /**
     * Get the id property: Environment reference id.
     * 
     * @return the id value.
     */
    public Long id() {
        return this.id;
    }

    /**
     * Set the id property: Environment reference id.
     * 
     * @param id the id value to set.
     * @return the SsisEnvironmentReference object itself.
     */
    public SsisEnvironmentReference withId(Long id) {
        this.id = id;
        return this;
    }

    /**
     * Get the environmentFolderName property: Environment folder name.
     * 
     * @return the environmentFolderName value.
     */
    public String environmentFolderName() {
        return this.environmentFolderName;
    }

    /**
     * Set the environmentFolderName property: Environment folder name.
     * 
     * @param environmentFolderName the environmentFolderName value to set.
     * @return the SsisEnvironmentReference object itself.
     */
    public SsisEnvironmentReference withEnvironmentFolderName(String environmentFolderName) {
        this.environmentFolderName = environmentFolderName;
        return this;
    }

    /**
     * Get the environmentName property: Environment name.
     * 
     * @return the environmentName value.
     */
    public String environmentName() {
        return this.environmentName;
    }

    /**
     * Set the environmentName property: Environment name.
     * 
     * @param environmentName the environmentName value to set.
     * @return the SsisEnvironmentReference object itself.
     */
    public SsisEnvironmentReference withEnvironmentName(String environmentName) {
        this.environmentName = environmentName;
        return this;
    }

    /**
     * Get the referenceType property: Reference type.
     * 
     * @return the referenceType value.
     */
    public String referenceType() {
        return this.referenceType;
    }

    /**
     * Set the referenceType property: Reference type.
     * 
     * @param referenceType the referenceType value to set.
     * @return the SsisEnvironmentReference object itself.
     */
    public SsisEnvironmentReference withReferenceType(String referenceType) {
        this.referenceType = referenceType;
        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.writeNumberField("id", this.id);
        jsonWriter.writeStringField("environmentFolderName", this.environmentFolderName);
        jsonWriter.writeStringField("environmentName", this.environmentName);
        jsonWriter.writeStringField("referenceType", this.referenceType);
        return jsonWriter.writeEndObject();
    }

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

                if ("id".equals(fieldName)) {
                    deserializedSsisEnvironmentReference.id = reader.getNullable(JsonReader::getLong);
                } else if ("environmentFolderName".equals(fieldName)) {
                    deserializedSsisEnvironmentReference.environmentFolderName = reader.getString();
                } else if ("environmentName".equals(fieldName)) {
                    deserializedSsisEnvironmentReference.environmentName = reader.getString();
                } else if ("referenceType".equals(fieldName)) {
                    deserializedSsisEnvironmentReference.referenceType = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedSsisEnvironmentReference;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy