com.azure.resourcemanager.security.fluent.models.CustomRecommendationInner 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.core.management.SystemData;
import com.azure.json.JsonReader;
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;
/**
* Custom Recommendation.
*/
@Fluent
public final class CustomRecommendationInner extends ProxyResource {
/*
* describes Custom Recommendation properties.
*/
private CustomRecommendationProperties innerProperties;
/*
* Azure Resource Manager metadata containing createdBy and modifiedBy information.
*/
private SystemData systemData;
/*
* 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 CustomRecommendationInner class.
*/
public CustomRecommendationInner() {
}
/**
* Get the innerProperties property: describes Custom Recommendation properties.
*
* @return the innerProperties value.
*/
private CustomRecommendationProperties innerProperties() {
return this.innerProperties;
}
/**
* Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information.
*
* @return the systemData value.
*/
public SystemData systemData() {
return this.systemData;
}
/**
* 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 query property: KQL query representing the Recommendation results required.
*
* @return the query value.
*/
public String query() {
return this.innerProperties() == null ? null : this.innerProperties().query();
}
/**
* Set the query property: KQL query representing the Recommendation results required.
*
* @param query the query value to set.
* @return the CustomRecommendationInner object itself.
*/
public CustomRecommendationInner withQuery(String query) {
if (this.innerProperties() == null) {
this.innerProperties = new CustomRecommendationProperties();
}
this.innerProperties().withQuery(query);
return this;
}
/**
* Get the cloudProviders property: List of all standard supported clouds.
*
* @return the cloudProviders value.
*/
public List cloudProviders() {
return this.innerProperties() == null ? null : this.innerProperties().cloudProviders();
}
/**
* Set the cloudProviders property: List of all standard supported clouds.
*
* @param cloudProviders the cloudProviders value to set.
* @return the CustomRecommendationInner object itself.
*/
public CustomRecommendationInner withCloudProviders(List cloudProviders) {
if (this.innerProperties() == null) {
this.innerProperties = new CustomRecommendationProperties();
}
this.innerProperties().withCloudProviders(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.innerProperties() == null ? null : this.innerProperties().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 CustomRecommendationInner object itself.
*/
public CustomRecommendationInner withSeverity(SeverityEnum severity) {
if (this.innerProperties() == null) {
this.innerProperties = new CustomRecommendationProperties();
}
this.innerProperties().withSeverity(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.innerProperties() == null ? null : this.innerProperties().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 CustomRecommendationInner object itself.
*/
public CustomRecommendationInner withSecurityIssue(SecurityIssue securityIssue) {
if (this.innerProperties() == null) {
this.innerProperties = new CustomRecommendationProperties();
}
this.innerProperties().withSecurityIssue(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.innerProperties() == null ? null : this.innerProperties().displayName();
}
/**
* Set the displayName property: The display name of the assessments generated by this Recommendation.
*
* @param displayName the displayName value to set.
* @return the CustomRecommendationInner object itself.
*/
public CustomRecommendationInner withDisplayName(String displayName) {
if (this.innerProperties() == null) {
this.innerProperties = new CustomRecommendationProperties();
}
this.innerProperties().withDisplayName(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.innerProperties() == null ? null : this.innerProperties().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 CustomRecommendationInner object itself.
*/
public CustomRecommendationInner withDescription(String description) {
if (this.innerProperties() == null) {
this.innerProperties = new CustomRecommendationProperties();
}
this.innerProperties().withDescription(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.innerProperties() == null ? null : this.innerProperties().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 CustomRecommendationInner object itself.
*/
public CustomRecommendationInner withRemediationDescription(String remediationDescription) {
if (this.innerProperties() == null) {
this.innerProperties = new CustomRecommendationProperties();
}
this.innerProperties().withRemediationDescription(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.innerProperties() == null ? null : this.innerProperties().assessmentKey();
}
/**
* 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 CustomRecommendationInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of CustomRecommendationInner 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 CustomRecommendationInner.
*/
public static CustomRecommendationInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
CustomRecommendationInner deserializedCustomRecommendationInner = new CustomRecommendationInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("id".equals(fieldName)) {
deserializedCustomRecommendationInner.id = reader.getString();
} else if ("name".equals(fieldName)) {
deserializedCustomRecommendationInner.name = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedCustomRecommendationInner.type = reader.getString();
} else if ("properties".equals(fieldName)) {
deserializedCustomRecommendationInner.innerProperties
= CustomRecommendationProperties.fromJson(reader);
} else if ("systemData".equals(fieldName)) {
deserializedCustomRecommendationInner.systemData = SystemData.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedCustomRecommendationInner;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy