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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.resourcemanager.security.models.AdditionalData;
import com.azure.resourcemanager.security.models.ResourceDetails;
import com.azure.resourcemanager.security.models.SubAssessmentStatus;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;

/** Security sub-assessment on a resource. */
@Fluent
public final class SecuritySubAssessmentInner extends ProxyResource {
    /*
     * Describes properties of an sub-assessment.
     */
    @JsonProperty(value = "properties")
    private SecuritySubAssessmentProperties innerProperties;

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

    /**
     * Get the innerProperties property: Describes properties of an sub-assessment.
     *
     * @return the innerProperties value.
     */
    private SecuritySubAssessmentProperties innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the id property: Vulnerability ID.
     *
     * @return the id value.
     */
    public String idPropertiesId() {
        return this.innerProperties() == null ? null : this.innerProperties().id();
    }

    /**
     * Get the displayName property: User friendly display name of the sub-assessment.
     *
     * @return the displayName value.
     */
    public String displayName() {
        return this.innerProperties() == null ? null : this.innerProperties().displayName();
    }

    /**
     * Get the status property: Status of the sub-assessment.
     *
     * @return the status value.
     */
    public SubAssessmentStatus status() {
        return this.innerProperties() == null ? null : this.innerProperties().status();
    }

    /**
     * Set the status property: Status of the sub-assessment.
     *
     * @param status the status value to set.
     * @return the SecuritySubAssessmentInner object itself.
     */
    public SecuritySubAssessmentInner withStatus(SubAssessmentStatus status) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecuritySubAssessmentProperties();
        }
        this.innerProperties().withStatus(status);
        return this;
    }

    /**
     * Get the remediation property: Information on how to remediate this sub-assessment.
     *
     * @return the remediation value.
     */
    public String remediation() {
        return this.innerProperties() == null ? null : this.innerProperties().remediation();
    }

    /**
     * Get the impact property: Description of the impact of this sub-assessment.
     *
     * @return the impact value.
     */
    public String impact() {
        return this.innerProperties() == null ? null : this.innerProperties().impact();
    }

    /**
     * Get the category property: Category of the sub-assessment.
     *
     * @return the category value.
     */
    public String category() {
        return this.innerProperties() == null ? null : this.innerProperties().category();
    }

    /**
     * Get the description property: Human readable description of the assessment status.
     *
     * @return the description value.
     */
    public String description() {
        return this.innerProperties() == null ? null : this.innerProperties().description();
    }

    /**
     * Get the timeGenerated property: The date and time the sub-assessment was generated.
     *
     * @return the timeGenerated value.
     */
    public OffsetDateTime timeGenerated() {
        return this.innerProperties() == null ? null : this.innerProperties().timeGenerated();
    }

    /**
     * Get the resourceDetails property: Details of the resource that was assessed.
     *
     * @return the resourceDetails value.
     */
    public ResourceDetails resourceDetails() {
        return this.innerProperties() == null ? null : this.innerProperties().resourceDetails();
    }

    /**
     * Set the resourceDetails property: Details of the resource that was assessed.
     *
     * @param resourceDetails the resourceDetails value to set.
     * @return the SecuritySubAssessmentInner object itself.
     */
    public SecuritySubAssessmentInner withResourceDetails(ResourceDetails resourceDetails) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecuritySubAssessmentProperties();
        }
        this.innerProperties().withResourceDetails(resourceDetails);
        return this;
    }

    /**
     * Get the additionalData property: Details of the sub-assessment.
     *
     * @return the additionalData value.
     */
    public AdditionalData additionalData() {
        return this.innerProperties() == null ? null : this.innerProperties().additionalData();
    }

    /**
     * Set the additionalData property: Details of the sub-assessment.
     *
     * @param additionalData the additionalData value to set.
     * @return the SecuritySubAssessmentInner object itself.
     */
    public SecuritySubAssessmentInner withAdditionalData(AdditionalData additionalData) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecuritySubAssessmentProperties();
        }
        this.innerProperties().withAdditionalData(additionalData);
        return this;
    }

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