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

com.azure.resourcemanager.machinelearning.models.DataLakeAnalytics Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for Machine Learning Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. These APIs allow end users to operate on Azure Machine Learning Workspace resources. Package tag package-2024-04.

The newest version!
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.machinelearning.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.exception.ManagementError;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.List;

/**
 * A DataLakeAnalytics compute.
 */
@Fluent
public final class DataLakeAnalytics extends Compute {
    /*
     * The type of compute
     */
    private ComputeType computeType = ComputeType.DATA_LAKE_ANALYTICS;

    /*
     * The properties property.
     */
    private DataLakeAnalyticsSchemaProperties properties;

    /*
     * The provision state of the cluster. Valid values are Unknown, Updating, Provisioning, Succeeded, and Failed.
     */
    private ProvisioningState provisioningState;

    /*
     * The time at which the compute was created.
     */
    private OffsetDateTime createdOn;

    /*
     * The time at which the compute was last modified.
     */
    private OffsetDateTime modifiedOn;

    /*
     * Errors during provisioning
     */
    private List provisioningErrors;

    /*
     * Indicating whether the compute was provisioned by user and brought from outside if true, or machine learning
     * service provisioned it if false.
     */
    private Boolean isAttachedCompute;

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

    /**
     * Get the computeType property: The type of compute.
     * 
     * @return the computeType value.
     */
    @Override
    public ComputeType computeType() {
        return this.computeType;
    }

    /**
     * Get the properties property: The properties property.
     * 
     * @return the properties value.
     */
    public DataLakeAnalyticsSchemaProperties properties() {
        return this.properties;
    }

    /**
     * Set the properties property: The properties property.
     * 
     * @param properties the properties value to set.
     * @return the DataLakeAnalytics object itself.
     */
    public DataLakeAnalytics withProperties(DataLakeAnalyticsSchemaProperties properties) {
        this.properties = properties;
        return this;
    }

    /**
     * Get the provisioningState property: The provision state of the cluster. Valid values are Unknown, Updating,
     * Provisioning, Succeeded, and Failed.
     * 
     * @return the provisioningState value.
     */
    @Override
    public ProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the createdOn property: The time at which the compute was created.
     * 
     * @return the createdOn value.
     */
    @Override
    public OffsetDateTime createdOn() {
        return this.createdOn;
    }

    /**
     * Get the modifiedOn property: The time at which the compute was last modified.
     * 
     * @return the modifiedOn value.
     */
    @Override
    public OffsetDateTime modifiedOn() {
        return this.modifiedOn;
    }

    /**
     * Get the provisioningErrors property: Errors during provisioning.
     * 
     * @return the provisioningErrors value.
     */
    @Override
    public List provisioningErrors() {
        return this.provisioningErrors;
    }

    /**
     * Get the isAttachedCompute property: Indicating whether the compute was provisioned by user and brought from
     * outside if true, or machine learning service provisioned it if false.
     * 
     * @return the isAttachedCompute value.
     */
    @Override
    public Boolean isAttachedCompute() {
        return this.isAttachedCompute;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public DataLakeAnalytics withComputeLocation(String computeLocation) {
        super.withComputeLocation(computeLocation);
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public DataLakeAnalytics withDescription(String description) {
        super.withDescription(description);
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public DataLakeAnalytics withResourceId(String resourceId) {
        super.withResourceId(resourceId);
        return this;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public DataLakeAnalytics withDisableLocalAuth(Boolean disableLocalAuth) {
        super.withDisableLocalAuth(disableLocalAuth);
        return this;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (properties() != null) {
            properties().validate();
        }
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("computeLocation", computeLocation());
        jsonWriter.writeStringField("description", description());
        jsonWriter.writeStringField("resourceId", resourceId());
        jsonWriter.writeBooleanField("disableLocalAuth", disableLocalAuth());
        jsonWriter.writeStringField("computeType", this.computeType == null ? null : this.computeType.toString());
        jsonWriter.writeJsonField("properties", this.properties);
        return jsonWriter.writeEndObject();
    }

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

                if ("computeLocation".equals(fieldName)) {
                    deserializedDataLakeAnalytics.withComputeLocation(reader.getString());
                } else if ("provisioningState".equals(fieldName)) {
                    deserializedDataLakeAnalytics.provisioningState = ProvisioningState.fromString(reader.getString());
                } else if ("description".equals(fieldName)) {
                    deserializedDataLakeAnalytics.withDescription(reader.getString());
                } else if ("createdOn".equals(fieldName)) {
                    deserializedDataLakeAnalytics.createdOn = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("modifiedOn".equals(fieldName)) {
                    deserializedDataLakeAnalytics.modifiedOn = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("resourceId".equals(fieldName)) {
                    deserializedDataLakeAnalytics.withResourceId(reader.getString());
                } else if ("provisioningErrors".equals(fieldName)) {
                    List provisioningErrors
                        = reader.readArray(reader1 -> ManagementError.fromJson(reader1));
                    deserializedDataLakeAnalytics.provisioningErrors = provisioningErrors;
                } else if ("isAttachedCompute".equals(fieldName)) {
                    deserializedDataLakeAnalytics.isAttachedCompute = reader.getNullable(JsonReader::getBoolean);
                } else if ("disableLocalAuth".equals(fieldName)) {
                    deserializedDataLakeAnalytics.withDisableLocalAuth(reader.getNullable(JsonReader::getBoolean));
                } else if ("computeType".equals(fieldName)) {
                    deserializedDataLakeAnalytics.computeType = ComputeType.fromString(reader.getString());
                } else if ("properties".equals(fieldName)) {
                    deserializedDataLakeAnalytics.properties = DataLakeAnalyticsSchemaProperties.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedDataLakeAnalytics;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy