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

com.azure.resourcemanager.hybridcompute.fluent.models.MachineAssessPatchesResultInner 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.Fluent;
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.AvailablePatchCountByClassification;
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 java.io.IOException;
import java.time.OffsetDateTime;
import java.util.UUID;

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

    /*
     * The activity ID of the operation that produced this result.
     */
    private UUID assessmentActivityId;

    /*
     * The overall reboot status of the VM. It will be true when partially installed patches require a reboot to
     * complete installation but the reboot has not yet occurred.
     */
    private Boolean rebootPending;

    /*
     * Summarization of patches available for installation on the machine by classification.
     */
    private AvailablePatchCountByClassification availablePatchCountByClassification;

    /*
     * 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 MachineAssessPatchesResultInner class.
     */
    public MachineAssessPatchesResultInner() {
    }

    /**
     * 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 "Unknown", "Failed", "Succeeded", or
     * "CompletedWithWarnings.".
     * 
     * @return the status value.
     */
    public PatchOperationStatus status() {
        return this.status;
    }

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

    /**
     * Get the rebootPending property: The overall reboot status of the VM. It will be true when partially installed
     * patches require a reboot to complete installation but the reboot has not yet occurred.
     * 
     * @return the rebootPending value.
     */
    public Boolean rebootPending() {
        return this.rebootPending;
    }

    /**
     * Get the availablePatchCountByClassification property: Summarization of patches available for installation on the
     * machine by classification.
     * 
     * @return the availablePatchCountByClassification value.
     */
    public AvailablePatchCountByClassification availablePatchCountByClassification() {
        return this.availablePatchCountByClassification;
    }

    /**
     * Set the availablePatchCountByClassification property: Summarization of patches available for installation on the
     * machine by classification.
     * 
     * @param availablePatchCountByClassification the availablePatchCountByClassification value to set.
     * @return the MachineAssessPatchesResultInner object itself.
     */
    public MachineAssessPatchesResultInner withAvailablePatchCountByClassification(
        AvailablePatchCountByClassification availablePatchCountByClassification) {
        this.availablePatchCountByClassification = availablePatchCountByClassification;
        return this;
    }

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

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

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

                if ("status".equals(fieldName)) {
                    deserializedMachineAssessPatchesResultInner.status
                        = PatchOperationStatus.fromString(reader.getString());
                } else if ("assessmentActivityId".equals(fieldName)) {
                    deserializedMachineAssessPatchesResultInner.assessmentActivityId
                        = reader.getNullable(nonNullReader -> UUID.fromString(nonNullReader.getString()));
                } else if ("rebootPending".equals(fieldName)) {
                    deserializedMachineAssessPatchesResultInner.rebootPending
                        = reader.getNullable(JsonReader::getBoolean);
                } else if ("availablePatchCountByClassification".equals(fieldName)) {
                    deserializedMachineAssessPatchesResultInner.availablePatchCountByClassification
                        = AvailablePatchCountByClassification.fromJson(reader);
                } else if ("startDateTime".equals(fieldName)) {
                    deserializedMachineAssessPatchesResultInner.startDateTime = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("lastModifiedDateTime".equals(fieldName)) {
                    deserializedMachineAssessPatchesResultInner.lastModifiedDateTime = reader
                        .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()));
                } else if ("startedBy".equals(fieldName)) {
                    deserializedMachineAssessPatchesResultInner.startedBy
                        = PatchOperationStartedBy.fromString(reader.getString());
                } else if ("patchServiceUsed".equals(fieldName)) {
                    deserializedMachineAssessPatchesResultInner.patchServiceUsed
                        = PatchServiceUsed.fromString(reader.getString());
                } else if ("osType".equals(fieldName)) {
                    deserializedMachineAssessPatchesResultInner.osType = OsType.fromString(reader.getString());
                } else if ("errorDetails".equals(fieldName)) {
                    deserializedMachineAssessPatchesResultInner.errorDetails = ManagementError.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedMachineAssessPatchesResultInner;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy