// 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.resourcemanager.databoxedge.models.ArmBaseModel;
import com.azure.resourcemanager.databoxedge.models.InstallRebootBehavior;
import com.azure.resourcemanager.databoxedge.models.UpdateOperation;
import com.fasterxml.jackson.annotation.JsonProperty;
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.
     */
    @JsonProperty(value = "properties")
    private UpdateSummaryProperties innerProperties;

    /** 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 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<String> 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() {
        super.validate();
        if (innerProperties() != null) {
            innerProperties().validate();
        }
    }
}
