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

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

// 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.AssessmentType;
import com.azure.resourcemanager.security.models.Categories;
import com.azure.resourcemanager.security.models.ImplementationEffort;
import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPartnerData;
import com.azure.resourcemanager.security.models.SecurityAssessmentMetadataPropertiesResponsePublishDates;
import com.azure.resourcemanager.security.models.Severity;
import com.azure.resourcemanager.security.models.Tactics;
import com.azure.resourcemanager.security.models.Techniques;
import com.azure.resourcemanager.security.models.Threats;
import com.azure.resourcemanager.security.models.UserImpact;
import java.io.IOException;
import java.util.List;

/**
 * Security assessment metadata response.
 */
@Fluent
public final class SecurityAssessmentMetadataResponseInner extends ProxyResource {
    /*
     * Describes properties of an assessment metadata response.
     */
    private SecurityAssessmentMetadataPropertiesResponse 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 SecurityAssessmentMetadataResponseInner class.
     */
    public SecurityAssessmentMetadataResponseInner() {
    }

    /**
     * Get the innerProperties property: Describes properties of an assessment metadata response.
     * 
     * @return the innerProperties value.
     */
    private SecurityAssessmentMetadataPropertiesResponse 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 publishDates property: The publishDates property.
     * 
     * @return the publishDates value.
     */
    public SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates() {
        return this.innerProperties() == null ? null : this.innerProperties().publishDates();
    }

    /**
     * Set the publishDates property: The publishDates property.
     * 
     * @param publishDates the publishDates value to set.
     * @return the SecurityAssessmentMetadataResponseInner object itself.
     */
    public SecurityAssessmentMetadataResponseInner
        withPublishDates(SecurityAssessmentMetadataPropertiesResponsePublishDates publishDates) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse();
        }
        this.innerProperties().withPublishDates(publishDates);
        return this;
    }

    /**
     * Get the plannedDeprecationDate property: The plannedDeprecationDate property.
     * 
     * @return the plannedDeprecationDate value.
     */
    public String plannedDeprecationDate() {
        return this.innerProperties() == null ? null : this.innerProperties().plannedDeprecationDate();
    }

    /**
     * Set the plannedDeprecationDate property: The plannedDeprecationDate property.
     * 
     * @param plannedDeprecationDate the plannedDeprecationDate value to set.
     * @return the SecurityAssessmentMetadataResponseInner object itself.
     */
    public SecurityAssessmentMetadataResponseInner withPlannedDeprecationDate(String plannedDeprecationDate) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse();
        }
        this.innerProperties().withPlannedDeprecationDate(plannedDeprecationDate);
        return this;
    }

    /**
     * Get the tactics property: The tactics property.
     * 
     * @return the tactics value.
     */
    public List tactics() {
        return this.innerProperties() == null ? null : this.innerProperties().tactics();
    }

    /**
     * Set the tactics property: The tactics property.
     * 
     * @param tactics the tactics value to set.
     * @return the SecurityAssessmentMetadataResponseInner object itself.
     */
    public SecurityAssessmentMetadataResponseInner withTactics(List tactics) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse();
        }
        this.innerProperties().withTactics(tactics);
        return this;
    }

    /**
     * Get the techniques property: The techniques property.
     * 
     * @return the techniques value.
     */
    public List techniques() {
        return this.innerProperties() == null ? null : this.innerProperties().techniques();
    }

    /**
     * Set the techniques property: The techniques property.
     * 
     * @param techniques the techniques value to set.
     * @return the SecurityAssessmentMetadataResponseInner object itself.
     */
    public SecurityAssessmentMetadataResponseInner withTechniques(List techniques) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse();
        }
        this.innerProperties().withTechniques(techniques);
        return this;
    }

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

    /**
     * Set the displayName property: User friendly display name of the assessment.
     * 
     * @param displayName the displayName value to set.
     * @return the SecurityAssessmentMetadataResponseInner object itself.
     */
    public SecurityAssessmentMetadataResponseInner withDisplayName(String displayName) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse();
        }
        this.innerProperties().withDisplayName(displayName);
        return this;
    }

    /**
     * Get the policyDefinitionId property: Azure resource ID of the policy definition that turns this assessment
     * calculation on.
     * 
     * @return the policyDefinitionId value.
     */
    public String policyDefinitionId() {
        return this.innerProperties() == null ? null : this.innerProperties().policyDefinitionId();
    }

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

    /**
     * Set the description property: Human readable description of the assessment.
     * 
     * @param description the description value to set.
     * @return the SecurityAssessmentMetadataResponseInner object itself.
     */
    public SecurityAssessmentMetadataResponseInner withDescription(String description) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse();
        }
        this.innerProperties().withDescription(description);
        return this;
    }

    /**
     * Get the remediationDescription property: Human readable description of what you should do to mitigate this
     * security issue.
     * 
     * @return the remediationDescription value.
     */
    public String remediationDescription() {
        return this.innerProperties() == null ? null : this.innerProperties().remediationDescription();
    }

    /**
     * Set the remediationDescription property: Human readable description of what you should do to mitigate this
     * security issue.
     * 
     * @param remediationDescription the remediationDescription value to set.
     * @return the SecurityAssessmentMetadataResponseInner object itself.
     */
    public SecurityAssessmentMetadataResponseInner withRemediationDescription(String remediationDescription) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse();
        }
        this.innerProperties().withRemediationDescription(remediationDescription);
        return this;
    }

    /**
     * Get the categories property: The categories property.
     * 
     * @return the categories value.
     */
    public List categories() {
        return this.innerProperties() == null ? null : this.innerProperties().categories();
    }

    /**
     * Set the categories property: The categories property.
     * 
     * @param categories the categories value to set.
     * @return the SecurityAssessmentMetadataResponseInner object itself.
     */
    public SecurityAssessmentMetadataResponseInner withCategories(List categories) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse();
        }
        this.innerProperties().withCategories(categories);
        return this;
    }

    /**
     * Get the severity property: The severity level of the assessment.
     * 
     * @return the severity value.
     */
    public Severity severity() {
        return this.innerProperties() == null ? null : this.innerProperties().severity();
    }

    /**
     * Set the severity property: The severity level of the assessment.
     * 
     * @param severity the severity value to set.
     * @return the SecurityAssessmentMetadataResponseInner object itself.
     */
    public SecurityAssessmentMetadataResponseInner withSeverity(Severity severity) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse();
        }
        this.innerProperties().withSeverity(severity);
        return this;
    }

    /**
     * Get the userImpact property: The user impact of the assessment.
     * 
     * @return the userImpact value.
     */
    public UserImpact userImpact() {
        return this.innerProperties() == null ? null : this.innerProperties().userImpact();
    }

    /**
     * Set the userImpact property: The user impact of the assessment.
     * 
     * @param userImpact the userImpact value to set.
     * @return the SecurityAssessmentMetadataResponseInner object itself.
     */
    public SecurityAssessmentMetadataResponseInner withUserImpact(UserImpact userImpact) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse();
        }
        this.innerProperties().withUserImpact(userImpact);
        return this;
    }

    /**
     * Get the implementationEffort property: The implementation effort required to remediate this assessment.
     * 
     * @return the implementationEffort value.
     */
    public ImplementationEffort implementationEffort() {
        return this.innerProperties() == null ? null : this.innerProperties().implementationEffort();
    }

    /**
     * Set the implementationEffort property: The implementation effort required to remediate this assessment.
     * 
     * @param implementationEffort the implementationEffort value to set.
     * @return the SecurityAssessmentMetadataResponseInner object itself.
     */
    public SecurityAssessmentMetadataResponseInner withImplementationEffort(ImplementationEffort implementationEffort) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse();
        }
        this.innerProperties().withImplementationEffort(implementationEffort);
        return this;
    }

    /**
     * Get the threats property: The threats property.
     * 
     * @return the threats value.
     */
    public List threats() {
        return this.innerProperties() == null ? null : this.innerProperties().threats();
    }

    /**
     * Set the threats property: The threats property.
     * 
     * @param threats the threats value to set.
     * @return the SecurityAssessmentMetadataResponseInner object itself.
     */
    public SecurityAssessmentMetadataResponseInner withThreats(List threats) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse();
        }
        this.innerProperties().withThreats(threats);
        return this;
    }

    /**
     * Get the preview property: True if this assessment is in preview release status.
     * 
     * @return the preview value.
     */
    public Boolean preview() {
        return this.innerProperties() == null ? null : this.innerProperties().preview();
    }

    /**
     * Set the preview property: True if this assessment is in preview release status.
     * 
     * @param preview the preview value to set.
     * @return the SecurityAssessmentMetadataResponseInner object itself.
     */
    public SecurityAssessmentMetadataResponseInner withPreview(Boolean preview) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse();
        }
        this.innerProperties().withPreview(preview);
        return this;
    }

    /**
     * Get the assessmentType property: BuiltIn if the assessment based on built-in Azure Policy definition, Custom if
     * the assessment based on custom Azure Policy definition.
     * 
     * @return the assessmentType value.
     */
    public AssessmentType assessmentType() {
        return this.innerProperties() == null ? null : this.innerProperties().assessmentType();
    }

    /**
     * Set the assessmentType property: BuiltIn if the assessment based on built-in Azure Policy definition, Custom if
     * the assessment based on custom Azure Policy definition.
     * 
     * @param assessmentType the assessmentType value to set.
     * @return the SecurityAssessmentMetadataResponseInner object itself.
     */
    public SecurityAssessmentMetadataResponseInner withAssessmentType(AssessmentType assessmentType) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse();
        }
        this.innerProperties().withAssessmentType(assessmentType);
        return this;
    }

    /**
     * Get the partnerData property: Describes the partner that created the assessment.
     * 
     * @return the partnerData value.
     */
    public SecurityAssessmentMetadataPartnerData partnerData() {
        return this.innerProperties() == null ? null : this.innerProperties().partnerData();
    }

    /**
     * Set the partnerData property: Describes the partner that created the assessment.
     * 
     * @param partnerData the partnerData value to set.
     * @return the SecurityAssessmentMetadataResponseInner object itself.
     */
    public SecurityAssessmentMetadataResponseInner withPartnerData(SecurityAssessmentMetadataPartnerData partnerData) {
        if (this.innerProperties() == null) {
            this.innerProperties = new SecurityAssessmentMetadataPropertiesResponse();
        }
        this.innerProperties().withPartnerData(partnerData);
        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 SecurityAssessmentMetadataResponseInner from the JsonReader.
     * 
     * @param jsonReader The JsonReader being read.
     * @return An instance of SecurityAssessmentMetadataResponseInner 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 SecurityAssessmentMetadataResponseInner.
     */
    public static SecurityAssessmentMetadataResponseInner fromJson(JsonReader jsonReader) throws IOException {
        return jsonReader.readObject(reader -> {
            SecurityAssessmentMetadataResponseInner deserializedSecurityAssessmentMetadataResponseInner
                = new SecurityAssessmentMetadataResponseInner();
            while (reader.nextToken() != JsonToken.END_OBJECT) {
                String fieldName = reader.getFieldName();
                reader.nextToken();

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

            return deserializedSecurityAssessmentMetadataResponseInner;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy