// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.connectedvmware.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.connectedvmware.models.AvailablePatchCountByClassification;
import com.azure.resourcemanager.connectedvmware.models.ErrorDetail;
import com.azure.resourcemanager.connectedvmware.models.OsTypeUM;
import com.azure.resourcemanager.connectedvmware.models.PatchOperationStartedBy;
import com.azure.resourcemanager.connectedvmware.models.PatchOperationStatus;
import com.azure.resourcemanager.connectedvmware.models.PatchServiceUsed;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Describes the properties of an AssessPatches result. */
@Fluent
public final class VirtualMachineAssessPatchesResultInner {
    /*
     * 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."
     */
    @JsonProperty(value = "status", access = JsonProperty.Access.WRITE_ONLY)
    private PatchOperationStatus status;

    /*
     * The activity ID of the operation that produced this result.
     */
    @JsonProperty(value = "assessmentActivityId", access = JsonProperty.Access.WRITE_ONLY)
    private String 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.
     */
    @JsonProperty(value = "rebootPending", access = JsonProperty.Access.WRITE_ONLY)
    private Boolean rebootPending;

    /*
     * Summarization of patches available for installation on the machine by classification.
     */
    @JsonProperty(value = "availablePatchCountByClassification")
    private AvailablePatchCountByClassification availablePatchCountByClassification;

    /*
     * The UTC timestamp when the operation began.
     */
    @JsonProperty(value = "startDateTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime startDateTime;

    /*
     * The UTC timestamp when the operation finished.
     */
    @JsonProperty(value = "lastModifiedDateTime", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime lastModifiedDateTime;

    /*
     * Indicates if operation was triggered by user or by platform.
     */
    @JsonProperty(value = "startedBy", access = JsonProperty.Access.WRITE_ONLY)
    private PatchOperationStartedBy startedBy;

    /*
     * Specifies the patch service used for the operation.
     */
    @JsonProperty(value = "patchServiceUsed", access = JsonProperty.Access.WRITE_ONLY)
    private PatchServiceUsed patchServiceUsed;

    /*
     * The operating system type of the machine.
     */
    @JsonProperty(value = "osType", access = JsonProperty.Access.WRITE_ONLY)
    private OsTypeUM osType;

    /*
     * Error details.
     *
     * The errors that were encountered during execution of the operation. The details array contains the list of them.
     */
    @JsonProperty(value = "errorDetails", access = JsonProperty.Access.WRITE_ONLY)
    private ErrorDetail errorDetails;

    /**
     * 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 String 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 VirtualMachineAssessPatchesResultInner object itself.
     */
    public VirtualMachineAssessPatchesResultInner 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 OsTypeUM osType() {
        return this.osType;
    }

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

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