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

com.azure.resourcemanager.security.fluent.models.CustomRecommendationProperties 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.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import com.azure.resourcemanager.security.models.RecommendationSupportedClouds;
import com.azure.resourcemanager.security.models.SecurityIssue;
import com.azure.resourcemanager.security.models.SeverityEnum;
import java.io.IOException;
import java.util.List;

/**
 * describes the Custom Recommendation properties.
 */
@Fluent
public final class CustomRecommendationProperties implements JsonSerializable {
    /*
     * KQL query representing the Recommendation results required.
     */
    private String query;

    /*
     * List of all standard supported clouds.
     */
    private List cloudProviders;

    /*
     * The severity to relate to the assessments generated by this Recommendation.
     */
    private SeverityEnum severity = SeverityEnum.LOW;

    /*
     * The severity to relate to the assessments generated by this Recommendation.
     */
    private SecurityIssue securityIssue = SecurityIssue.BEST_PRACTICES;

    /*
     * The display name of the assessments generated by this Recommendation.
     */
    private String displayName;

    /*
     * The description to relate to the assessments generated by this Recommendation.
     */
    private String description;

    /*
     * The remediation description to relate to the assessments generated by this Recommendation.
     */
    private String remediationDescription;

    /*
     * The assessment metadata key used when an assessment is generated for this Recommendation.
     */
    private String assessmentKey;

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

    /**
     * Get the query property: KQL query representing the Recommendation results required.
     * 
     * @return the query value.
     */
    public String query() {
        return this.query;
    }

    /**
     * Set the query property: KQL query representing the Recommendation results required.
     * 
     * @param query the query value to set.
     * @return the CustomRecommendationProperties object itself.
     */
    public CustomRecommendationProperties withQuery(String query) {
        this.query = query;
        return this;
    }

    /**
     * Get the cloudProviders property: List of all standard supported clouds.
     * 
     * @return the cloudProviders value.
     */
    public List cloudProviders() {
        return this.cloudProviders;
    }

    /**
     * Set the cloudProviders property: List of all standard supported clouds.
     * 
     * @param cloudProviders the cloudProviders value to set.
     * @return the CustomRecommendationProperties object itself.
     */
    public CustomRecommendationProperties withCloudProviders(List cloudProviders) {
        this.cloudProviders = cloudProviders;
        return this;
    }

    /**
     * Get the severity property: The severity to relate to the assessments generated by this Recommendation.
     * 
     * @return the severity value.
     */
    public SeverityEnum severity() {
        return this.severity;
    }

    /**
     * Set the severity property: The severity to relate to the assessments generated by this Recommendation.
     * 
     * @param severity the severity value to set.
     * @return the CustomRecommendationProperties object itself.
     */
    public CustomRecommendationProperties withSeverity(SeverityEnum severity) {
        this.severity = severity;
        return this;
    }

    /**
     * Get the securityIssue property: The severity to relate to the assessments generated by this Recommendation.
     * 
     * @return the securityIssue value.
     */
    public SecurityIssue securityIssue() {
        return this.securityIssue;
    }

    /**
     * Set the securityIssue property: The severity to relate to the assessments generated by this Recommendation.
     * 
     * @param securityIssue the securityIssue value to set.
     * @return the CustomRecommendationProperties object itself.
     */
    public CustomRecommendationProperties withSecurityIssue(SecurityIssue securityIssue) {
        this.securityIssue = securityIssue;
        return this;
    }

    /**
     * Get the displayName property: The display name of the assessments generated by this Recommendation.
     * 
     * @return the displayName value.
     */
    public String displayName() {
        return this.displayName;
    }

    /**
     * Set the displayName property: The display name of the assessments generated by this Recommendation.
     * 
     * @param displayName the displayName value to set.
     * @return the CustomRecommendationProperties object itself.
     */
    public CustomRecommendationProperties withDisplayName(String displayName) {
        this.displayName = displayName;
        return this;
    }

    /**
     * Get the description property: The description to relate to the assessments generated by this Recommendation.
     * 
     * @return the description value.
     */
    public String description() {
        return this.description;
    }

    /**
     * Set the description property: The description to relate to the assessments generated by this Recommendation.
     * 
     * @param description the description value to set.
     * @return the CustomRecommendationProperties object itself.
     */
    public CustomRecommendationProperties withDescription(String description) {
        this.description = description;
        return this;
    }

    /**
     * Get the remediationDescription property: The remediation description to relate to the assessments generated by
     * this Recommendation.
     * 
     * @return the remediationDescription value.
     */
    public String remediationDescription() {
        return this.remediationDescription;
    }

    /**
     * Set the remediationDescription property: The remediation description to relate to the assessments generated by
     * this Recommendation.
     * 
     * @param remediationDescription the remediationDescription value to set.
     * @return the CustomRecommendationProperties object itself.
     */
    public CustomRecommendationProperties withRemediationDescription(String remediationDescription) {
        this.remediationDescription = remediationDescription;
        return this;
    }

    /**
     * Get the assessmentKey property: The assessment metadata key used when an assessment is generated for this
     * Recommendation.
     * 
     * @return the assessmentKey value.
     */
    public String assessmentKey() {
        return this.assessmentKey;
    }

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

    /**
     * {@inheritDoc}
     */
    @Override
    public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
        jsonWriter.writeStartObject();
        jsonWriter.writeStringField("query", this.query);
        jsonWriter.writeArrayField("cloudProviders", this.cloudProviders,
            (writer, element) -> writer.writeString(element == null ? null : element.toString()));
        jsonWriter.writeStringField("severity", this.severity == null ? null : this.severity.toString());
        jsonWriter.writeStringField("securityIssue", this.securityIssue == null ? null : this.securityIssue.toString());
        jsonWriter.writeStringField("displayName", this.displayName);
        jsonWriter.writeStringField("description", this.description);
        jsonWriter.writeStringField("remediationDescription", this.remediationDescription);
        return jsonWriter.writeEndObject();
    }

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

                if ("query".equals(fieldName)) {
                    deserializedCustomRecommendationProperties.query = reader.getString();
                } else if ("cloudProviders".equals(fieldName)) {
                    List cloudProviders
                        = reader.readArray(reader1 -> RecommendationSupportedClouds.fromString(reader1.getString()));
                    deserializedCustomRecommendationProperties.cloudProviders = cloudProviders;
                } else if ("severity".equals(fieldName)) {
                    deserializedCustomRecommendationProperties.severity = SeverityEnum.fromString(reader.getString());
                } else if ("securityIssue".equals(fieldName)) {
                    deserializedCustomRecommendationProperties.securityIssue
                        = SecurityIssue.fromString(reader.getString());
                } else if ("displayName".equals(fieldName)) {
                    deserializedCustomRecommendationProperties.displayName = reader.getString();
                } else if ("description".equals(fieldName)) {
                    deserializedCustomRecommendationProperties.description = reader.getString();
                } else if ("remediationDescription".equals(fieldName)) {
                    deserializedCustomRecommendationProperties.remediationDescription = reader.getString();
                } else if ("assessmentKey".equals(fieldName)) {
                    deserializedCustomRecommendationProperties.assessmentKey = reader.getString();
                } else {
                    reader.skipChildren();
                }
            }

            return deserializedCustomRecommendationProperties;
        });
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy