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

com.azure.resourcemanager.databoxedge.models.UpdateInstallProgress 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.databoxedge.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;

/**
 * Progress details during installation of updates.
 */
@Immutable
public final class UpdateInstallProgress implements JsonSerializable {
    /*
     * Percentage completed.
     */
    private Integer percentComplete;

    /*
     * Number of updates to install.
     */
    private Integer numberOfUpdatesToInstall;

    /*
     * Number of updates installed.
     */
    private Integer numberOfUpdatesInstalled;

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

    /**
     * Get the percentComplete property: Percentage completed.
     * 
     * @return the percentComplete value.
     */
    public Integer percentComplete() {
        return this.percentComplete;
    }

    /**
     * Get the numberOfUpdatesToInstall property: Number of updates to install.
     * 
     * @return the numberOfUpdatesToInstall value.
     */
    public Integer numberOfUpdatesToInstall() {
        return this.numberOfUpdatesToInstall;
    }

    /**
     * Get the numberOfUpdatesInstalled property: Number of updates installed.
     * 
     * @return the numberOfUpdatesInstalled value.
     */
    public Integer numberOfUpdatesInstalled() {
        return this.numberOfUpdatesInstalled;
    }

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

                if ("percentComplete".equals(fieldName)) {
                    deserializedUpdateInstallProgress.percentComplete = reader.getNullable(JsonReader::getInt);
                } else if ("numberOfUpdatesToInstall".equals(fieldName)) {
                    deserializedUpdateInstallProgress.numberOfUpdatesToInstall = reader.getNullable(JsonReader::getInt);
                } else if ("numberOfUpdatesInstalled".equals(fieldName)) {
                    deserializedUpdateInstallProgress.numberOfUpdatesInstalled = reader.getNullable(JsonReader::getInt);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedUpdateInstallProgress;
        });
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy