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

com.azure.resourcemanager.azurestackhci.models.LogCollectionError 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.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;

/**
 * Log Collection Error details of the cluster.
 */
@Immutable
public final class LogCollectionError implements JsonSerializable {
    /*
     * Error Code of the log collection
     */
    private String errorCode;

    /*
     * Error Message of the log collection
     */
    private String errorMessage;

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

    /**
     * Get the errorCode property: Error Code of the log collection.
     * 
     * @return the errorCode value.
     */
    public String errorCode() {
        return this.errorCode;
    }

    /**
     * Get the errorMessage property: Error Message of the log collection.
     * 
     * @return the errorMessage value.
     */
    public String errorMessage() {
        return this.errorMessage;
    }

    /**
     * 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();
        return jsonWriter.writeEndObject();
    }

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

                if ("errorCode".equals(fieldName)) {
                    deserializedLogCollectionError.errorCode = reader.getString();
                } else if ("errorMessage".equals(fieldName)) {
                    deserializedLogCollectionError.errorMessage = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedLogCollectionError;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy