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

com.azure.resourcemanager.azurestackhci.models.Observability Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for AzureStackHci Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. Azure Stack HCI management service. 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.azurestackhci.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;

/**
 * The Observability of AzureStackHCI Cluster.
 */
@Fluent
public final class Observability implements JsonSerializable {
    /*
     * Enables telemetry data to be sent to Microsoft
     */
    private Boolean streamingDataClient;

    /*
     * Location of your cluster. The log and diagnostic data is sent to the appropriate diagnostics servers depending
     * upon where your cluster resides. Setting this to false results in all data sent to Microsoft to be stored outside
     * of the EU.
     */
    private Boolean euLocation;

    /*
     * When set to true, collects log data to facilitate quicker issue resolution.
     */
    private Boolean episodicDataUpload;

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

    /**
     * Get the streamingDataClient property: Enables telemetry data to be sent to Microsoft.
     * 
     * @return the streamingDataClient value.
     */
    public Boolean streamingDataClient() {
        return this.streamingDataClient;
    }

    /**
     * Set the streamingDataClient property: Enables telemetry data to be sent to Microsoft.
     * 
     * @param streamingDataClient the streamingDataClient value to set.
     * @return the Observability object itself.
     */
    public Observability withStreamingDataClient(Boolean streamingDataClient) {
        this.streamingDataClient = streamingDataClient;
        return this;
    }

    /**
     * Get the euLocation property: Location of your cluster. The log and diagnostic data is sent to the appropriate
     * diagnostics servers depending upon where your cluster resides. Setting this to false results in all data sent to
     * Microsoft to be stored outside of the EU.
     * 
     * @return the euLocation value.
     */
    public Boolean euLocation() {
        return this.euLocation;
    }

    /**
     * Set the euLocation property: Location of your cluster. The log and diagnostic data is sent to the appropriate
     * diagnostics servers depending upon where your cluster resides. Setting this to false results in all data sent to
     * Microsoft to be stored outside of the EU.
     * 
     * @param euLocation the euLocation value to set.
     * @return the Observability object itself.
     */
    public Observability withEuLocation(Boolean euLocation) {
        this.euLocation = euLocation;
        return this;
    }

    /**
     * Get the episodicDataUpload property: When set to true, collects log data to facilitate quicker issue resolution.
     * 
     * @return the episodicDataUpload value.
     */
    public Boolean episodicDataUpload() {
        return this.episodicDataUpload;
    }

    /**
     * Set the episodicDataUpload property: When set to true, collects log data to facilitate quicker issue resolution.
     * 
     * @param episodicDataUpload the episodicDataUpload value to set.
     * @return the Observability object itself.
     */
    public Observability withEpisodicDataUpload(Boolean episodicDataUpload) {
        this.episodicDataUpload = episodicDataUpload;
        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.writeBooleanField("streamingDataClient", this.streamingDataClient);
        jsonWriter.writeBooleanField("euLocation", this.euLocation);
        jsonWriter.writeBooleanField("episodicDataUpload", this.episodicDataUpload);
        return jsonWriter.writeEndObject();
    }

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

                if ("streamingDataClient".equals(fieldName)) {
                    deserializedObservability.streamingDataClient = reader.getNullable(JsonReader::getBoolean);
                } else if ("euLocation".equals(fieldName)) {
                    deserializedObservability.euLocation = reader.getNullable(JsonReader::getBoolean);
                } else if ("episodicDataUpload".equals(fieldName)) {
                    deserializedObservability.episodicDataUpload = reader.getNullable(JsonReader::getBoolean);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedObservability;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy