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

com.azure.resourcemanager.databoxedge.fluent.models.UpdateSummaryInner Maven / Gradle / Ivy

Go to download

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

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.databoxedge.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.databoxedge.models.ArmBaseModel;
import com.azure.resourcemanager.databoxedge.models.InstallRebootBehavior;
import com.azure.resourcemanager.databoxedge.models.UpdateOperation;
import java.io.IOException;
import java.time.OffsetDateTime;
import java.util.List;

/**
 * Details about ongoing updates and availability of updates on the device.
 */
@Fluent
public final class UpdateSummaryInner extends ArmBaseModel {
    /*
     * The device update information summary.
     */
    private UpdateSummaryProperties innerProperties;

    /*
     * The type of the resource.
     */
    private String type;

    /*
     * The name of the resource.
     */
    private String name;

    /*
     * Fully qualified resource Id for the resource.
     */
    private String id;

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

    /**
     * Get the innerProperties property: The device update information summary.
     * 
     * @return the innerProperties value.
     */
    private UpdateSummaryProperties innerProperties() {
        return this.innerProperties;
    }

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

    /**
     * Get the name property: The name of the resource.
     * 
     * @return the name value.
     */
    @Override
    public String name() {
        return this.name;
    }

    /**
     * Get the id property: Fully qualified resource Id for the resource.
     * 
     * @return the id value.
     */
    @Override
    public String id() {
        return this.id;
    }

    /**
     * Get the deviceVersionNumber property: The current version of the device in format: 1.2.17312.13.",.
     * 
     * @return the deviceVersionNumber value.
     */
    public String deviceVersionNumber() {
        return this.innerProperties() == null ? null : this.innerProperties().deviceVersionNumber();
    }

    /**
     * Set the deviceVersionNumber property: The current version of the device in format: 1.2.17312.13.",.
     * 
     * @param deviceVersionNumber the deviceVersionNumber value to set.
     * @return the UpdateSummaryInner object itself.
     */
    public UpdateSummaryInner withDeviceVersionNumber(String deviceVersionNumber) {
        if (this.innerProperties() == null) {
            this.innerProperties = new UpdateSummaryProperties();
        }
        this.innerProperties().withDeviceVersionNumber(deviceVersionNumber);
        return this;
    }

    /**
     * Get the friendlyDeviceVersionName property: The current version of the device in text format.
     * 
     * @return the friendlyDeviceVersionName value.
     */
    public String friendlyDeviceVersionName() {
        return this.innerProperties() == null ? null : this.innerProperties().friendlyDeviceVersionName();
    }

    /**
     * Set the friendlyDeviceVersionName property: The current version of the device in text format.
     * 
     * @param friendlyDeviceVersionName the friendlyDeviceVersionName value to set.
     * @return the UpdateSummaryInner object itself.
     */
    public UpdateSummaryInner withFriendlyDeviceVersionName(String friendlyDeviceVersionName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new UpdateSummaryProperties();
        }
        this.innerProperties().withFriendlyDeviceVersionName(friendlyDeviceVersionName);
        return this;
    }

    /**
     * Get the deviceLastScannedDateTime property: The last time when a scan was done on the device.
     * 
     * @return the deviceLastScannedDateTime value.
     */
    public OffsetDateTime deviceLastScannedDateTime() {
        return this.innerProperties() == null ? null : this.innerProperties().deviceLastScannedDateTime();
    }

    /**
     * Set the deviceLastScannedDateTime property: The last time when a scan was done on the device.
     * 
     * @param deviceLastScannedDateTime the deviceLastScannedDateTime value to set.
     * @return the UpdateSummaryInner object itself.
     */
    public UpdateSummaryInner withDeviceLastScannedDateTime(OffsetDateTime deviceLastScannedDateTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new UpdateSummaryProperties();
        }
        this.innerProperties().withDeviceLastScannedDateTime(deviceLastScannedDateTime);
        return this;
    }

    /**
     * Get the lastCompletedScanJobDateTime property: The time when the last scan job was completed
     * (success/cancelled/failed) on the appliance.
     * 
     * @return the lastCompletedScanJobDateTime value.
     */
    public OffsetDateTime lastCompletedScanJobDateTime() {
        return this.innerProperties() == null ? null : this.innerProperties().lastCompletedScanJobDateTime();
    }

    /**
     * Set the lastCompletedScanJobDateTime property: The time when the last scan job was completed
     * (success/cancelled/failed) on the appliance.
     * 
     * @param lastCompletedScanJobDateTime the lastCompletedScanJobDateTime value to set.
     * @return the UpdateSummaryInner object itself.
     */
    public UpdateSummaryInner withLastCompletedScanJobDateTime(OffsetDateTime lastCompletedScanJobDateTime) {
        if (this.innerProperties() == null) {
            this.innerProperties = new UpdateSummaryProperties();
        }
        this.innerProperties().withLastCompletedScanJobDateTime(lastCompletedScanJobDateTime);
        return this;
    }

    /**
     * Get the lastCompletedDownloadJobDateTime property: The time when the last Download job was completed
     * (success/cancelled/failed) on the appliance.
     * 
     * @return the lastCompletedDownloadJobDateTime value.
     */
    public OffsetDateTime lastCompletedDownloadJobDateTime() {
        return this.innerProperties() == null ? null : this.innerProperties().lastCompletedDownloadJobDateTime();
    }

    /**
     * Get the lastCompletedInstallJobDateTime property: The time when the last Install job was completed
     * (success/cancelled/failed) on the appliance.
     * 
     * @return the lastCompletedInstallJobDateTime value.
     */
    public OffsetDateTime lastCompletedInstallJobDateTime() {
        return this.innerProperties() == null ? null : this.innerProperties().lastCompletedInstallJobDateTime();
    }

    /**
     * Get the totalNumberOfUpdatesAvailable property: The number of updates available for the current device version as
     * per the last device scan.
     * 
     * @return the totalNumberOfUpdatesAvailable value.
     */
    public Integer totalNumberOfUpdatesAvailable() {
        return this.innerProperties() == null ? null : this.innerProperties().totalNumberOfUpdatesAvailable();
    }

    /**
     * Get the totalNumberOfUpdatesPendingDownload property: The total number of items pending download.
     * 
     * @return the totalNumberOfUpdatesPendingDownload value.
     */
    public Integer totalNumberOfUpdatesPendingDownload() {
        return this.innerProperties() == null ? null : this.innerProperties().totalNumberOfUpdatesPendingDownload();
    }

    /**
     * Get the totalNumberOfUpdatesPendingInstall property: The total number of items pending install.
     * 
     * @return the totalNumberOfUpdatesPendingInstall value.
     */
    public Integer totalNumberOfUpdatesPendingInstall() {
        return this.innerProperties() == null ? null : this.innerProperties().totalNumberOfUpdatesPendingInstall();
    }

    /**
     * Get the rebootBehavior property: Indicates if updates are available and at least one of the updates needs a
     * reboot.
     * 
     * @return the rebootBehavior value.
     */
    public InstallRebootBehavior rebootBehavior() {
        return this.innerProperties() == null ? null : this.innerProperties().rebootBehavior();
    }

    /**
     * Get the ongoingUpdateOperation property: The current update operation.
     * 
     * @return the ongoingUpdateOperation value.
     */
    public UpdateOperation ongoingUpdateOperation() {
        return this.innerProperties() == null ? null : this.innerProperties().ongoingUpdateOperation();
    }

    /**
     * Get the inProgressDownloadJobId property: The job ID of the download job in progress.
     * 
     * @return the inProgressDownloadJobId value.
     */
    public String inProgressDownloadJobId() {
        return this.innerProperties() == null ? null : this.innerProperties().inProgressDownloadJobId();
    }

    /**
     * Get the inProgressInstallJobId property: The job ID of the install job in progress.
     * 
     * @return the inProgressInstallJobId value.
     */
    public String inProgressInstallJobId() {
        return this.innerProperties() == null ? null : this.innerProperties().inProgressInstallJobId();
    }

    /**
     * Get the inProgressDownloadJobStartedDateTime property: The time when the currently running download (if any)
     * started.
     * 
     * @return the inProgressDownloadJobStartedDateTime value.
     */
    public OffsetDateTime inProgressDownloadJobStartedDateTime() {
        return this.innerProperties() == null ? null : this.innerProperties().inProgressDownloadJobStartedDateTime();
    }

    /**
     * Get the inProgressInstallJobStartedDateTime property: The time when the currently running install (if any)
     * started.
     * 
     * @return the inProgressInstallJobStartedDateTime value.
     */
    public OffsetDateTime inProgressInstallJobStartedDateTime() {
        return this.innerProperties() == null ? null : this.innerProperties().inProgressInstallJobStartedDateTime();
    }

    /**
     * Get the updateTitles property: The list of updates available for install.
     * 
     * @return the updateTitles value.
     */
    public List updateTitles() {
        return this.innerProperties() == null ? null : this.innerProperties().updateTitles();
    }

    /**
     * Get the totalUpdateSizeInBytes property: The total size of updates available for download in bytes.
     * 
     * @return the totalUpdateSizeInBytes value.
     */
    public Double totalUpdateSizeInBytes() {
        return this.innerProperties() == null ? null : this.innerProperties().totalUpdateSizeInBytes();
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeJsonField("properties", this.innerProperties);
        return jsonWriter.writeEndObject();
    }

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

                if ("id".equals(fieldName)) {
                    deserializedUpdateSummaryInner.id = reader.getString();
                } else if ("name".equals(fieldName)) {
                    deserializedUpdateSummaryInner.name = reader.getString();
                } else if ("type".equals(fieldName)) {
                    deserializedUpdateSummaryInner.type = reader.getString();
                } else if ("properties".equals(fieldName)) {
                    deserializedUpdateSummaryInner.innerProperties = UpdateSummaryProperties.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedUpdateSummaryInner;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy