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

com.azure.resourcemanager.hybridcompute.fluent.models.MachineInstallPatchesResultInner Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for HybridCompute Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. The Hybrid Compute Management Client. Package tag package-preview-2024-07.

There is a newer version: 1.1.0-beta.1
Show 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.hybridcompute.fluent.models;

import com.azure.core.annotation.Immutable;
import com.azure.core.management.exception.ManagementError;
import com.azure.core.util.CoreUtils;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.hybridcompute.models.OsType;
import com.azure.resourcemanager.hybridcompute.models.PatchOperationStartedBy;
import com.azure.resourcemanager.hybridcompute.models.PatchOperationStatus;
import com.azure.resourcemanager.hybridcompute.models.PatchServiceUsed;
import com.azure.resourcemanager.hybridcompute.models.VMGuestPatchRebootStatus;
import java.io.IOException;
import java.time.OffsetDateTime;

/**
 * The result summary of an installation operation.
 */
@Immutable
public final class MachineInstallPatchesResultInner implements JsonSerializable {
    /*
     * The overall success or failure status of the operation. It remains "InProgress" until the operation completes. At
     * that point it will become "Failed", "Succeeded", "Unknown" or "CompletedWithWarnings."
     */
    private PatchOperationStatus status;

    /*
     * The activity ID of the operation that produced this result.
     */
    private String installationActivityId;

    /*
     * The reboot state of the VM following completion of the operation.
     */
    private VMGuestPatchRebootStatus rebootStatus;

    /*
     * Whether the operation ran out of time before it completed all its intended actions.
     */
    private Boolean maintenanceWindowExceeded;

    /*
     * The number of patches that were not installed due to the user blocking their installation.
     */
    private Integer excludedPatchCount;

    /*
     * The number of patches that were detected as available for install, but did not meet the operation's criteria.
     */
    private Integer notSelectedPatchCount;

    /*
     * The number of patches that were identified as meeting the installation criteria, but were not able to be
     * installed. Typically this happens when maintenanceWindowExceeded == true.
     */
    private Integer pendingPatchCount;

    /*
     * The number of patches successfully installed.
     */
    private Integer installedPatchCount;

    /*
     * The number of patches that could not be installed due to some issue. See errors for details.
     */
    private Integer failedPatchCount;

    /*
     * The UTC timestamp when the operation began.
     */
    private OffsetDateTime startDateTime;

    /*
     * The UTC timestamp when the operation finished.
     */
    private OffsetDateTime lastModifiedDateTime;

    /*
     * Indicates if operation was triggered by user or by platform.
     */
    private PatchOperationStartedBy startedBy;

    /*
     * Specifies the patch service used for the operation.
     */
    private PatchServiceUsed patchServiceUsed;

    /*
     * The operating system type of the machine.
     */
    private OsType osType;

    /*
     * The errors that were encountered during execution of the operation. The details array contains the list of them.
     */
    private ManagementError errorDetails;

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

    /**
     * Get the status property: The overall success or failure status of the operation. It remains "InProgress" until
     * the operation completes. At that point it will become "Failed", "Succeeded", "Unknown" or
     * "CompletedWithWarnings.".
     * 
     * @return the status value.
     */
    public PatchOperationStatus status() {
        return this.status;
    }

    /**
     * Get the installationActivityId property: The activity ID of the operation that produced this result.
     * 
     * @return the installationActivityId value.
     */
    public String installationActivityId() {
        return this.installationActivityId;
    }

    /**
     * Get the rebootStatus property: The reboot state of the VM following completion of the operation.
     * 
     * @return the rebootStatus value.
     */
    public VMGuestPatchRebootStatus rebootStatus() {
        return this.rebootStatus;
    }

    /**
     * Get the maintenanceWindowExceeded property: Whether the operation ran out of time before it completed all its
     * intended actions.
     * 
     * @return the maintenanceWindowExceeded value.
     */
    public Boolean maintenanceWindowExceeded() {
        return this.maintenanceWindowExceeded;
    }

    /**
     * Get the excludedPatchCount property: The number of patches that were not installed due to the user blocking their
     * installation.
     * 
     * @return the excludedPatchCount value.
     */
    public Integer excludedPatchCount() {
        return this.excludedPatchCount;
    }

    /**
     * Get the notSelectedPatchCount property: The number of patches that were detected as available for install, but
     * did not meet the operation's criteria.
     * 
     * @return the notSelectedPatchCount value.
     */
    public Integer notSelectedPatchCount() {
        return this.notSelectedPatchCount;
    }

    /**
     * Get the pendingPatchCount property: The number of patches that were identified as meeting the installation
     * criteria, but were not able to be installed. Typically this happens when maintenanceWindowExceeded == true.
     * 
     * @return the pendingPatchCount value.
     */
    public Integer pendingPatchCount() {
        return this.pendingPatchCount;
    }

    /**
     * Get the installedPatchCount property: The number of patches successfully installed.
     * 
     * @return the installedPatchCount value.
     */
    public Integer installedPatchCount() {
        return this.installedPatchCount;
    }

    /**
     * Get the failedPatchCount property: The number of patches that could not be installed due to some issue. See
     * errors for details.
     * 
     * @return the failedPatchCount value.
     */
    public Integer failedPatchCount() {
        return this.failedPatchCount;
    }

    /**
     * Get the startDateTime property: The UTC timestamp when the operation began.
     * 
     * @return the startDateTime value.
     */
    public OffsetDateTime startDateTime() {
        return this.startDateTime;
    }

    /**
     * Get the lastModifiedDateTime property: The UTC timestamp when the operation finished.
     * 
     * @return the lastModifiedDateTime value.
     */
    public OffsetDateTime lastModifiedDateTime() {
        return this.lastModifiedDateTime;
    }

    /**
     * Get the startedBy property: Indicates if operation was triggered by user or by platform.
     * 
     * @return the startedBy value.
     */
    public PatchOperationStartedBy startedBy() {
        return this.startedBy;
    }

    /**
     * Get the patchServiceUsed property: Specifies the patch service used for the operation.
     * 
     * @return the patchServiceUsed value.
     */
    public PatchServiceUsed patchServiceUsed() {
        return this.patchServiceUsed;
    }

    /**
     * Get the osType property: The operating system type of the machine.
     * 
     * @return the osType value.
     */
    public OsType osType() {
        return this.osType;
    }

    /**
     * Get the errorDetails property: The errors that were encountered during execution of the operation. The details
     * array contains the list of them.
     * 
     * @return the errorDetails value.
     */
    public ManagementError errorDetails() {
        return this.errorDetails;
    }

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

                if ("status".equals(fieldName)) {
                    deserializedMachineInstallPatchesResultInner.status
                        = PatchOperationStatus.fromString(reader.getString());
                } else if ("installationActivityId".equals(fieldName)) {
                    deserializedMachineInstallPatchesResultInner.installationActivityId = reader.getString();
                } else if ("rebootStatus".equals(fieldName)) {
                    deserializedMachineInstallPatchesResultInner.rebootStatus
                        = VMGuestPatchRebootStatus.fromString(reader.getString());
                } else if ("maintenanceWindowExceeded".equals(fieldName)) {
                    deserializedMachineInstallPatchesResultInner.maintenanceWindowExceeded
                        = reader.getNullable(JsonReader::getBoolean);
                } else if ("excludedPatchCount".equals(fieldName)) {
                    deserializedMachineInstallPatchesResultInner.excludedPatchCount
                        = reader.getNullable(JsonReader::getInt);
                } else if ("notSelectedPatchCount".equals(fieldName)) {
                    deserializedMachineInstallPatchesResultInner.notSelectedPatchCount
                        = reader.getNullable(JsonReader::getInt);
                } else if ("pendingPatchCount".equals(fieldName)) {
                    deserializedMachineInstallPatchesResultInner.pendingPatchCount
                        = reader.getNullable(JsonReader::getInt);
                } else if ("installedPatchCount".equals(fieldName)) {
                    deserializedMachineInstallPatchesResultInner.installedPatchCount
                        = reader.getNullable(JsonReader::getInt);
                } else if ("failedPatchCount".equals(fieldName)) {
                    deserializedMachineInstallPatchesResultInner.failedPatchCount
                        = reader.getNullable(JsonReader::getInt);
                } else if ("startDateTime".equals(fieldName)) {
                    deserializedMachineInstallPatchesResultInner.startDateTime = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("lastModifiedDateTime".equals(fieldName)) {
                    deserializedMachineInstallPatchesResultInner.lastModifiedDateTime = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("startedBy".equals(fieldName)) {
                    deserializedMachineInstallPatchesResultInner.startedBy
                        = PatchOperationStartedBy.fromString(reader.getString());
                } else if ("patchServiceUsed".equals(fieldName)) {
                    deserializedMachineInstallPatchesResultInner.patchServiceUsed
                        = PatchServiceUsed.fromString(reader.getString());
                } else if ("osType".equals(fieldName)) {
                    deserializedMachineInstallPatchesResultInner.osType = OsType.fromString(reader.getString());
                } else if ("errorDetails".equals(fieldName)) {
                    deserializedMachineInstallPatchesResultInner.errorDetails = ManagementError.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedMachineInstallPatchesResultInner;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy