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

com.azure.resourcemanager.security.fluent.models.SecuritySubAssessmentInner Maven / Gradle / Ivy

Go to download

This package contains Microsoft Azure SDK for Security Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API spec for Microsoft.Security (Azure Security Center) resource provider. Package tag package-composite-v3.

There is a newer version: 1.0.0
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.security.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.ProxyResource;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.security.models.AdditionalData;
import com.azure.resourcemanager.security.models.ResourceDetails;
import com.azure.resourcemanager.security.models.SubAssessmentStatus;
import java.io.IOException;
import java.time.OffsetDateTime;

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

    /*
     * The type of the resource.
     */
    private String type;

    /*
     * The name of the resource.
     */
    private String name;

    /*
     * Fully qualified resource Id for the resource.
     */
    private String id;

    /**
     * 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 type property: The type of the resource.
     * 
     * @return the type value.
     */
    @Override
    public String type() {
        return this.type;
    }

    /**
     * Get the name property: The name of the resource.
     * 
     * @return the name value.
     */
    @Override
    public String name() {
        return this.name;
    }

    /**
     * Get the id property: Fully qualified resource Id for the resource.
     * 
     * @return the id value.
     */
    @Override
    public String id() {
        return this.id;
    }

    /**
     * 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();
        }
    }

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

    /**
     * Reads an instance of SecuritySubAssessmentInner from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of SecuritySubAssessmentInner if the JsonReader was pointing to an instance of it, or null if
     * it was pointing to JSON null.
     * @throws IllegalStateException If the deserialized JSON object was missing any required properties.
     * @throws IOException If an error occurs while reading the SecuritySubAssessmentInner.
     */
    public static SecuritySubAssessmentInner fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            SecuritySubAssessmentInner deserializedSecuritySubAssessmentInner = new SecuritySubAssessmentInner();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

                if ("id".equals(fieldName)) {
                    deserializedSecuritySubAssessmentInner.id = reader.getString();
                } else if ("name".equals(fieldName)) {
                    deserializedSecuritySubAssessmentInner.name = reader.getString();
                } else if ("type".equals(fieldName)) {
                    deserializedSecuritySubAssessmentInner.type = reader.getString();
                } else if ("properties".equals(fieldName)) {
                    deserializedSecuritySubAssessmentInner.innerProperties
                        = SecuritySubAssessmentProperties.fromJson(reader);
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedSecuritySubAssessmentInner;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy