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

com.azure.resourcemanager.hdinsight.models.ClusterGetProperties Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for HDInsight Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. HDInsight Management Client. Package tag package-2024-08-preview.

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.hdinsight.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 com.azure.resourcemanager.hdinsight.fluent.models.PrivateEndpointConnectionInner;
import java.io.IOException;
import java.util.List;

/**
 * The properties of cluster.
 */
@Fluent
public final class ClusterGetProperties implements JsonSerializable {
    /*
     * The version of the cluster.
     */
    private String clusterVersion;

    /*
     * The hdp version of the cluster.
     */
    private String clusterHdpVersion;

    /*
     * The type of operating system.
     */
    private OSType osType;

    /*
     * The cluster tier.
     */
    private Tier tier;

    /*
     * The cluster id.
     */
    private String clusterId;

    /*
     * The cluster definition.
     */
    private ClusterDefinition clusterDefinition;

    /*
     * The cluster kafka rest proxy configuration.
     */
    private KafkaRestProperties kafkaRestProperties;

    /*
     * The security profile.
     */
    private SecurityProfile securityProfile;

    /*
     * The compute profile.
     */
    private ComputeProfile computeProfile;

    /*
     * The provisioning state, which only appears in the response.
     */
    private HDInsightClusterProvisioningState provisioningState;

    /*
     * The date on which the cluster was created.
     */
    private String createdDate;

    /*
     * The state of the cluster.
     */
    private String clusterState;

    /*
     * The quota information.
     */
    private QuotaInfo quotaInfo;

    /*
     * The list of errors.
     */
    private List errors;

    /*
     * The list of connectivity endpoints.
     */
    private List connectivityEndpoints;

    /*
     * The disk encryption properties.
     */
    private DiskEncryptionProperties diskEncryptionProperties;

    /*
     * The encryption-in-transit properties.
     */
    private EncryptionInTransitProperties encryptionInTransitProperties;

    /*
     * The storage profile.
     */
    private StorageProfile storageProfile;

    /*
     * The minimal supported tls version.
     */
    private String minSupportedTlsVersion;

    /*
     * The excluded services config.
     */
    private ExcludedServicesConfig excludedServicesConfig;

    /*
     * The network properties.
     */
    private NetworkProperties networkProperties;

    /*
     * The compute isolation properties.
     */
    private ComputeIsolationProperties computeIsolationProperties;

    /*
     * The private link configurations.
     */
    private List privateLinkConfigurations;

    /*
     * The list of private endpoint connections.
     */
    private List privateEndpointConnections;

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

    /**
     * Get the clusterVersion property: The version of the cluster.
     * 
     * @return the clusterVersion value.
     */
    public String clusterVersion() {
        return this.clusterVersion;
    }

    /**
     * Set the clusterVersion property: The version of the cluster.
     * 
     * @param clusterVersion the clusterVersion value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties withClusterVersion(String clusterVersion) {
        this.clusterVersion = clusterVersion;
        return this;
    }

    /**
     * Get the clusterHdpVersion property: The hdp version of the cluster.
     * 
     * @return the clusterHdpVersion value.
     */
    public String clusterHdpVersion() {
        return this.clusterHdpVersion;
    }

    /**
     * Set the clusterHdpVersion property: The hdp version of the cluster.
     * 
     * @param clusterHdpVersion the clusterHdpVersion value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties withClusterHdpVersion(String clusterHdpVersion) {
        this.clusterHdpVersion = clusterHdpVersion;
        return this;
    }

    /**
     * Get the osType property: The type of operating system.
     * 
     * @return the osType value.
     */
    public OSType osType() {
        return this.osType;
    }

    /**
     * Set the osType property: The type of operating system.
     * 
     * @param osType the osType value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties withOsType(OSType osType) {
        this.osType = osType;
        return this;
    }

    /**
     * Get the tier property: The cluster tier.
     * 
     * @return the tier value.
     */
    public Tier tier() {
        return this.tier;
    }

    /**
     * Set the tier property: The cluster tier.
     * 
     * @param tier the tier value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties withTier(Tier tier) {
        this.tier = tier;
        return this;
    }

    /**
     * Get the clusterId property: The cluster id.
     * 
     * @return the clusterId value.
     */
    public String clusterId() {
        return this.clusterId;
    }

    /**
     * Set the clusterId property: The cluster id.
     * 
     * @param clusterId the clusterId value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties withClusterId(String clusterId) {
        this.clusterId = clusterId;
        return this;
    }

    /**
     * Get the clusterDefinition property: The cluster definition.
     * 
     * @return the clusterDefinition value.
     */
    public ClusterDefinition clusterDefinition() {
        return this.clusterDefinition;
    }

    /**
     * Set the clusterDefinition property: The cluster definition.
     * 
     * @param clusterDefinition the clusterDefinition value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties withClusterDefinition(ClusterDefinition clusterDefinition) {
        this.clusterDefinition = clusterDefinition;
        return this;
    }

    /**
     * Get the kafkaRestProperties property: The cluster kafka rest proxy configuration.
     * 
     * @return the kafkaRestProperties value.
     */
    public KafkaRestProperties kafkaRestProperties() {
        return this.kafkaRestProperties;
    }

    /**
     * Set the kafkaRestProperties property: The cluster kafka rest proxy configuration.
     * 
     * @param kafkaRestProperties the kafkaRestProperties value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties withKafkaRestProperties(KafkaRestProperties kafkaRestProperties) {
        this.kafkaRestProperties = kafkaRestProperties;
        return this;
    }

    /**
     * Get the securityProfile property: The security profile.
     * 
     * @return the securityProfile value.
     */
    public SecurityProfile securityProfile() {
        return this.securityProfile;
    }

    /**
     * Set the securityProfile property: The security profile.
     * 
     * @param securityProfile the securityProfile value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties withSecurityProfile(SecurityProfile securityProfile) {
        this.securityProfile = securityProfile;
        return this;
    }

    /**
     * Get the computeProfile property: The compute profile.
     * 
     * @return the computeProfile value.
     */
    public ComputeProfile computeProfile() {
        return this.computeProfile;
    }

    /**
     * Set the computeProfile property: The compute profile.
     * 
     * @param computeProfile the computeProfile value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties withComputeProfile(ComputeProfile computeProfile) {
        this.computeProfile = computeProfile;
        return this;
    }

    /**
     * Get the provisioningState property: The provisioning state, which only appears in the response.
     * 
     * @return the provisioningState value.
     */
    public HDInsightClusterProvisioningState provisioningState() {
        return this.provisioningState;
    }

    /**
     * Set the provisioningState property: The provisioning state, which only appears in the response.
     * 
     * @param provisioningState the provisioningState value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties withProvisioningState(HDInsightClusterProvisioningState provisioningState) {
        this.provisioningState = provisioningState;
        return this;
    }

    /**
     * Get the createdDate property: The date on which the cluster was created.
     * 
     * @return the createdDate value.
     */
    public String createdDate() {
        return this.createdDate;
    }

    /**
     * Set the createdDate property: The date on which the cluster was created.
     * 
     * @param createdDate the createdDate value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties withCreatedDate(String createdDate) {
        this.createdDate = createdDate;
        return this;
    }

    /**
     * Get the clusterState property: The state of the cluster.
     * 
     * @return the clusterState value.
     */
    public String clusterState() {
        return this.clusterState;
    }

    /**
     * Set the clusterState property: The state of the cluster.
     * 
     * @param clusterState the clusterState value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties withClusterState(String clusterState) {
        this.clusterState = clusterState;
        return this;
    }

    /**
     * Get the quotaInfo property: The quota information.
     * 
     * @return the quotaInfo value.
     */
    public QuotaInfo quotaInfo() {
        return this.quotaInfo;
    }

    /**
     * Set the quotaInfo property: The quota information.
     * 
     * @param quotaInfo the quotaInfo value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties withQuotaInfo(QuotaInfo quotaInfo) {
        this.quotaInfo = quotaInfo;
        return this;
    }

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

    /**
     * Set the errors property: The list of errors.
     * 
     * @param errors the errors value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties withErrors(List errors) {
        this.errors = errors;
        return this;
    }

    /**
     * Get the connectivityEndpoints property: The list of connectivity endpoints.
     * 
     * @return the connectivityEndpoints value.
     */
    public List connectivityEndpoints() {
        return this.connectivityEndpoints;
    }

    /**
     * Set the connectivityEndpoints property: The list of connectivity endpoints.
     * 
     * @param connectivityEndpoints the connectivityEndpoints value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties withConnectivityEndpoints(List connectivityEndpoints) {
        this.connectivityEndpoints = connectivityEndpoints;
        return this;
    }

    /**
     * Get the diskEncryptionProperties property: The disk encryption properties.
     * 
     * @return the diskEncryptionProperties value.
     */
    public DiskEncryptionProperties diskEncryptionProperties() {
        return this.diskEncryptionProperties;
    }

    /**
     * Set the diskEncryptionProperties property: The disk encryption properties.
     * 
     * @param diskEncryptionProperties the diskEncryptionProperties value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties withDiskEncryptionProperties(DiskEncryptionProperties diskEncryptionProperties) {
        this.diskEncryptionProperties = diskEncryptionProperties;
        return this;
    }

    /**
     * Get the encryptionInTransitProperties property: The encryption-in-transit properties.
     * 
     * @return the encryptionInTransitProperties value.
     */
    public EncryptionInTransitProperties encryptionInTransitProperties() {
        return this.encryptionInTransitProperties;
    }

    /**
     * Set the encryptionInTransitProperties property: The encryption-in-transit properties.
     * 
     * @param encryptionInTransitProperties the encryptionInTransitProperties value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties
        withEncryptionInTransitProperties(EncryptionInTransitProperties encryptionInTransitProperties) {
        this.encryptionInTransitProperties = encryptionInTransitProperties;
        return this;
    }

    /**
     * Get the storageProfile property: The storage profile.
     * 
     * @return the storageProfile value.
     */
    public StorageProfile storageProfile() {
        return this.storageProfile;
    }

    /**
     * Set the storageProfile property: The storage profile.
     * 
     * @param storageProfile the storageProfile value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties withStorageProfile(StorageProfile storageProfile) {
        this.storageProfile = storageProfile;
        return this;
    }

    /**
     * Get the minSupportedTlsVersion property: The minimal supported tls version.
     * 
     * @return the minSupportedTlsVersion value.
     */
    public String minSupportedTlsVersion() {
        return this.minSupportedTlsVersion;
    }

    /**
     * Set the minSupportedTlsVersion property: The minimal supported tls version.
     * 
     * @param minSupportedTlsVersion the minSupportedTlsVersion value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties withMinSupportedTlsVersion(String minSupportedTlsVersion) {
        this.minSupportedTlsVersion = minSupportedTlsVersion;
        return this;
    }

    /**
     * Get the excludedServicesConfig property: The excluded services config.
     * 
     * @return the excludedServicesConfig value.
     */
    public ExcludedServicesConfig excludedServicesConfig() {
        return this.excludedServicesConfig;
    }

    /**
     * Set the excludedServicesConfig property: The excluded services config.
     * 
     * @param excludedServicesConfig the excludedServicesConfig value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties withExcludedServicesConfig(ExcludedServicesConfig excludedServicesConfig) {
        this.excludedServicesConfig = excludedServicesConfig;
        return this;
    }

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

    /**
     * Set the networkProperties property: The network properties.
     * 
     * @param networkProperties the networkProperties value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties withNetworkProperties(NetworkProperties networkProperties) {
        this.networkProperties = networkProperties;
        return this;
    }

    /**
     * Get the computeIsolationProperties property: The compute isolation properties.
     * 
     * @return the computeIsolationProperties value.
     */
    public ComputeIsolationProperties computeIsolationProperties() {
        return this.computeIsolationProperties;
    }

    /**
     * Set the computeIsolationProperties property: The compute isolation properties.
     * 
     * @param computeIsolationProperties the computeIsolationProperties value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties withComputeIsolationProperties(ComputeIsolationProperties computeIsolationProperties) {
        this.computeIsolationProperties = computeIsolationProperties;
        return this;
    }

    /**
     * Get the privateLinkConfigurations property: The private link configurations.
     * 
     * @return the privateLinkConfigurations value.
     */
    public List privateLinkConfigurations() {
        return this.privateLinkConfigurations;
    }

    /**
     * Set the privateLinkConfigurations property: The private link configurations.
     * 
     * @param privateLinkConfigurations the privateLinkConfigurations value to set.
     * @return the ClusterGetProperties object itself.
     */
    public ClusterGetProperties
        withPrivateLinkConfigurations(List privateLinkConfigurations) {
        this.privateLinkConfigurations = privateLinkConfigurations;
        return this;
    }

    /**
     * Get the privateEndpointConnections property: The list of private endpoint connections.
     * 
     * @return the privateEndpointConnections value.
     */
    public List privateEndpointConnections() {
        return this.privateEndpointConnections;
    }

    /**
     * Validates the instance.
     * 
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (clusterDefinition() == null) {
            throw LOGGER.atError()
                .log(new IllegalArgumentException(
                    "Missing required property clusterDefinition in model ClusterGetProperties"));
        } else {
            clusterDefinition().validate();
        }
        if (kafkaRestProperties() != null) {
            kafkaRestProperties().validate();
        }
        if (securityProfile() != null) {
            securityProfile().validate();
        }
        if (computeProfile() != null) {
            computeProfile().validate();
        }
        if (quotaInfo() != null) {
            quotaInfo().validate();
        }
        if (errors() != null) {
            errors().forEach(e -> e.validate());
        }
        if (connectivityEndpoints() != null) {
            connectivityEndpoints().forEach(e -> e.validate());
        }
        if (diskEncryptionProperties() != null) {
            diskEncryptionProperties().validate();
        }
        if (encryptionInTransitProperties() != null) {
            encryptionInTransitProperties().validate();
        }
        if (storageProfile() != null) {
            storageProfile().validate();
        }
        if (excludedServicesConfig() != null) {
            excludedServicesConfig().validate();
        }
        if (networkProperties() != null) {
            networkProperties().validate();
        }
        if (computeIsolationProperties() != null) {
            computeIsolationProperties().validate();
        }
        if (privateLinkConfigurations() != null) {
            privateLinkConfigurations().forEach(e -> e.validate());
        }
        if (privateEndpointConnections() != null) {
            privateEndpointConnections().forEach(e -> e.validate());
        }
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeJsonField("clusterDefinition", this.clusterDefinition);
        jsonWriter.writeStringField("clusterVersion", this.clusterVersion);
        jsonWriter.writeStringField("clusterHdpVersion", this.clusterHdpVersion);
        jsonWriter.writeStringField("osType", this.osType == null ? null : this.osType.toString());
        jsonWriter.writeStringField("tier", this.tier == null ? null : this.tier.toString());
        jsonWriter.writeStringField("clusterId", this.clusterId);
        jsonWriter.writeJsonField("kafkaRestProperties", this.kafkaRestProperties);
        jsonWriter.writeJsonField("securityProfile", this.securityProfile);
        jsonWriter.writeJsonField("computeProfile", this.computeProfile);
        jsonWriter.writeStringField("provisioningState",
            this.provisioningState == null ? null : this.provisioningState.toString());
        jsonWriter.writeStringField("createdDate", this.createdDate);
        jsonWriter.writeStringField("clusterState", this.clusterState);
        jsonWriter.writeJsonField("quotaInfo", this.quotaInfo);
        jsonWriter.writeArrayField("errors", this.errors, (writer, element) -> writer.writeJson(element));
        jsonWriter.writeArrayField("connectivityEndpoints", this.connectivityEndpoints,
            (writer, element) -> writer.writeJson(element));
        jsonWriter.writeJsonField("diskEncryptionProperties", this.diskEncryptionProperties);
        jsonWriter.writeJsonField("encryptionInTransitProperties", this.encryptionInTransitProperties);
        jsonWriter.writeJsonField("storageProfile", this.storageProfile);
        jsonWriter.writeStringField("minSupportedTlsVersion", this.minSupportedTlsVersion);
        jsonWriter.writeJsonField("excludedServicesConfig", this.excludedServicesConfig);
        jsonWriter.writeJsonField("networkProperties", this.networkProperties);
        jsonWriter.writeJsonField("computeIsolationProperties", this.computeIsolationProperties);
        jsonWriter.writeArrayField("privateLinkConfigurations", this.privateLinkConfigurations,
            (writer, element) -> writer.writeJson(element));
        return jsonWriter.writeEndObject();
    }

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

                if ("clusterDefinition".equals(fieldName)) {
                    deserializedClusterGetProperties.clusterDefinition = ClusterDefinition.fromJson(reader);
                } else if ("clusterVersion".equals(fieldName)) {
                    deserializedClusterGetProperties.clusterVersion = reader.getString();
                } else if ("clusterHdpVersion".equals(fieldName)) {
                    deserializedClusterGetProperties.clusterHdpVersion = reader.getString();
                } else if ("osType".equals(fieldName)) {
                    deserializedClusterGetProperties.osType = OSType.fromString(reader.getString());
                } else if ("tier".equals(fieldName)) {
                    deserializedClusterGetProperties.tier = Tier.fromString(reader.getString());
                } else if ("clusterId".equals(fieldName)) {
                    deserializedClusterGetProperties.clusterId = reader.getString();
                } else if ("kafkaRestProperties".equals(fieldName)) {
                    deserializedClusterGetProperties.kafkaRestProperties = KafkaRestProperties.fromJson(reader);
                } else if ("securityProfile".equals(fieldName)) {
                    deserializedClusterGetProperties.securityProfile = SecurityProfile.fromJson(reader);
                } else if ("computeProfile".equals(fieldName)) {
                    deserializedClusterGetProperties.computeProfile = ComputeProfile.fromJson(reader);
                } else if ("provisioningState".equals(fieldName)) {
                    deserializedClusterGetProperties.provisioningState
                        = HDInsightClusterProvisioningState.fromString(reader.getString());
                } else if ("createdDate".equals(fieldName)) {
                    deserializedClusterGetProperties.createdDate = reader.getString();
                } else if ("clusterState".equals(fieldName)) {
                    deserializedClusterGetProperties.clusterState = reader.getString();
                } else if ("quotaInfo".equals(fieldName)) {
                    deserializedClusterGetProperties.quotaInfo = QuotaInfo.fromJson(reader);
                } else if ("errors".equals(fieldName)) {
                    List errors = reader.readArray(reader1 -> Errors.fromJson(reader1));
                    deserializedClusterGetProperties.errors = errors;
                } else if ("connectivityEndpoints".equals(fieldName)) {
                    List connectivityEndpoints
                        = reader.readArray(reader1 -> ConnectivityEndpoint.fromJson(reader1));
                    deserializedClusterGetProperties.connectivityEndpoints = connectivityEndpoints;
                } else if ("diskEncryptionProperties".equals(fieldName)) {
                    deserializedClusterGetProperties.diskEncryptionProperties
                        = DiskEncryptionProperties.fromJson(reader);
                } else if ("encryptionInTransitProperties".equals(fieldName)) {
                    deserializedClusterGetProperties.encryptionInTransitProperties
                        = EncryptionInTransitProperties.fromJson(reader);
                } else if ("storageProfile".equals(fieldName)) {
                    deserializedClusterGetProperties.storageProfile = StorageProfile.fromJson(reader);
                } else if ("minSupportedTlsVersion".equals(fieldName)) {
                    deserializedClusterGetProperties.minSupportedTlsVersion = reader.getString();
                } else if ("excludedServicesConfig".equals(fieldName)) {
                    deserializedClusterGetProperties.excludedServicesConfig = ExcludedServicesConfig.fromJson(reader);
                } else if ("networkProperties".equals(fieldName)) {
                    deserializedClusterGetProperties.networkProperties = NetworkProperties.fromJson(reader);
                } else if ("computeIsolationProperties".equals(fieldName)) {
                    deserializedClusterGetProperties.computeIsolationProperties
                        = ComputeIsolationProperties.fromJson(reader);
                } else if ("privateLinkConfigurations".equals(fieldName)) {
                    List privateLinkConfigurations
                        = reader.readArray(reader1 -> PrivateLinkConfiguration.fromJson(reader1));
                    deserializedClusterGetProperties.privateLinkConfigurations = privateLinkConfigurations;
                } else if ("privateEndpointConnections".equals(fieldName)) {
                    List privateEndpointConnections
                        = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1));
                    deserializedClusterGetProperties.privateEndpointConnections = privateEndpointConnections;
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedClusterGetProperties;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy