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

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

/**
 * PipelineExternalComputeScale properties for managed integration runtime.
 */
@Fluent
public final class PipelineExternalComputeScaleProperties
    implements JsonSerializable {
    /*
     * Time to live (in minutes) setting of integration runtime which will execute pipeline and external activity.
     */
    private Integer timeToLive;

    /*
     * Number of the pipeline nodes, which should be greater than 0 and less than 11.
     */
    private Integer numberOfPipelineNodes;

    /*
     * Number of the the external nodes, which should be greater than 0 and less than 11.
     */
    private Integer numberOfExternalNodes;

    /*
     * PipelineExternalComputeScale properties for managed integration runtime.
     */
    private Map additionalProperties;

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

    /**
     * Get the timeToLive property: Time to live (in minutes) setting of integration runtime which will execute pipeline
     * and external activity.
     * 
     * @return the timeToLive value.
     */
    public Integer timeToLive() {
        return this.timeToLive;
    }

    /**
     * Set the timeToLive property: Time to live (in minutes) setting of integration runtime which will execute pipeline
     * and external activity.
     * 
     * @param timeToLive the timeToLive value to set.
     * @return the PipelineExternalComputeScaleProperties object itself.
     */
    public PipelineExternalComputeScaleProperties withTimeToLive(Integer timeToLive) {
        this.timeToLive = timeToLive;
        return this;
    }

    /**
     * Get the numberOfPipelineNodes property: Number of the pipeline nodes, which should be greater than 0 and less
     * than 11.
     * 
     * @return the numberOfPipelineNodes value.
     */
    public Integer numberOfPipelineNodes() {
        return this.numberOfPipelineNodes;
    }

    /**
     * Set the numberOfPipelineNodes property: Number of the pipeline nodes, which should be greater than 0 and less
     * than 11.
     * 
     * @param numberOfPipelineNodes the numberOfPipelineNodes value to set.
     * @return the PipelineExternalComputeScaleProperties object itself.
     */
    public PipelineExternalComputeScaleProperties withNumberOfPipelineNodes(Integer numberOfPipelineNodes) {
        this.numberOfPipelineNodes = numberOfPipelineNodes;
        return this;
    }

    /**
     * Get the numberOfExternalNodes property: Number of the the external nodes, which should be greater than 0 and less
     * than 11.
     * 
     * @return the numberOfExternalNodes value.
     */
    public Integer numberOfExternalNodes() {
        return this.numberOfExternalNodes;
    }

    /**
     * Set the numberOfExternalNodes property: Number of the the external nodes, which should be greater than 0 and less
     * than 11.
     * 
     * @param numberOfExternalNodes the numberOfExternalNodes value to set.
     * @return the PipelineExternalComputeScaleProperties object itself.
     */
    public PipelineExternalComputeScaleProperties withNumberOfExternalNodes(Integer numberOfExternalNodes) {
        this.numberOfExternalNodes = numberOfExternalNodes;
        return this;
    }

    /**
     * Get the additionalProperties property: PipelineExternalComputeScale properties for managed integration runtime.
     * 
     * @return the additionalProperties value.
     */
    public Map additionalProperties() {
        return this.additionalProperties;
    }

    /**
     * Set the additionalProperties property: PipelineExternalComputeScale properties for managed integration runtime.
     * 
     * @param additionalProperties the additionalProperties value to set.
     * @return the PipelineExternalComputeScaleProperties object itself.
     */
    public PipelineExternalComputeScaleProperties 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.writeNumberField("timeToLive", this.timeToLive);
        jsonWriter.writeNumberField("numberOfPipelineNodes", this.numberOfPipelineNodes);
        jsonWriter.writeNumberField("numberOfExternalNodes", this.numberOfExternalNodes);
        if (additionalProperties != null) {
            for (Map.Entry additionalProperty : additionalProperties.entrySet()) {
                jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue());
            }
        }
        return jsonWriter.writeEndObject();
    }

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

                if ("timeToLive".equals(fieldName)) {
                    deserializedPipelineExternalComputeScaleProperties.timeToLive
                        = reader.getNullable(JsonReader::getInt);
                } else if ("numberOfPipelineNodes".equals(fieldName)) {
                    deserializedPipelineExternalComputeScaleProperties.numberOfPipelineNodes
                        = reader.getNullable(JsonReader::getInt);
                } else if ("numberOfExternalNodes".equals(fieldName)) {
                    deserializedPipelineExternalComputeScaleProperties.numberOfExternalNodes
                        = reader.getNullable(JsonReader::getInt);
                } else {
                    if (additionalProperties == null) {
                        additionalProperties = new LinkedHashMap<>();
                    }

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

            return deserializedPipelineExternalComputeScaleProperties;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy