com.azure.resourcemanager.security.fluent.models.SecurityAssessmentResponseInner 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.AssessmentLinks;
import com.azure.resourcemanager.security.models.AssessmentStatusResponse;
import com.azure.resourcemanager.security.models.ResourceDetails;
import com.azure.resourcemanager.security.models.SecurityAssessmentPartnerData;
import java.io.IOException;
import java.util.Map;
/**
* Security assessment on a resource - response format.
*/
@Fluent
public final class SecurityAssessmentResponseInner extends ProxyResource {
/*
* Describes properties of an assessment.
*/
private SecurityAssessmentPropertiesResponse 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 SecurityAssessmentResponseInner class.
*/
public SecurityAssessmentResponseInner() {
}
/**
* Get the innerProperties property: Describes properties of an assessment.
*
* @return the innerProperties value.
*/
private SecurityAssessmentPropertiesResponse 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 status property: The result of the assessment.
*
* @return the status value.
*/
public AssessmentStatusResponse status() {
return this.innerProperties() == null ? null : this.innerProperties().status();
}
/**
* Set the status property: The result of the assessment.
*
* @param status the status value to set.
* @return the SecurityAssessmentResponseInner object itself.
*/
public SecurityAssessmentResponseInner withStatus(AssessmentStatusResponse status) {
if (this.innerProperties() == null) {
this.innerProperties = new SecurityAssessmentPropertiesResponse();
}
this.innerProperties().withStatus(status);
return this;
}
/**
* 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 SecurityAssessmentResponseInner object itself.
*/
public SecurityAssessmentResponseInner withResourceDetails(ResourceDetails resourceDetails) {
if (this.innerProperties() == null) {
this.innerProperties = new SecurityAssessmentPropertiesResponse();
}
this.innerProperties().withResourceDetails(resourceDetails);
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();
}
/**
* Get the additionalData property: Additional data regarding the assessment.
*
* @return the additionalData value.
*/
public Map additionalData() {
return this.innerProperties() == null ? null : this.innerProperties().additionalData();
}
/**
* Set the additionalData property: Additional data regarding the assessment.
*
* @param additionalData the additionalData value to set.
* @return the SecurityAssessmentResponseInner object itself.
*/
public SecurityAssessmentResponseInner withAdditionalData(Map additionalData) {
if (this.innerProperties() == null) {
this.innerProperties = new SecurityAssessmentPropertiesResponse();
}
this.innerProperties().withAdditionalData(additionalData);
return this;
}
/**
* Get the links property: Links relevant to the assessment.
*
* @return the links value.
*/
public AssessmentLinks links() {
return this.innerProperties() == null ? null : this.innerProperties().links();
}
/**
* Get the metadata property: Describes properties of an assessment metadata.
*
* @return the metadata value.
*/
public SecurityAssessmentMetadataProperties metadata() {
return this.innerProperties() == null ? null : this.innerProperties().metadata();
}
/**
* Set the metadata property: Describes properties of an assessment metadata.
*
* @param metadata the metadata value to set.
* @return the SecurityAssessmentResponseInner object itself.
*/
public SecurityAssessmentResponseInner withMetadata(SecurityAssessmentMetadataProperties metadata) {
if (this.innerProperties() == null) {
this.innerProperties = new SecurityAssessmentPropertiesResponse();
}
this.innerProperties().withMetadata(metadata);
return this;
}
/**
* Get the partnersData property: Data regarding 3rd party partner integration.
*
* @return the partnersData value.
*/
public SecurityAssessmentPartnerData partnersData() {
return this.innerProperties() == null ? null : this.innerProperties().partnersData();
}
/**
* Set the partnersData property: Data regarding 3rd party partner integration.
*
* @param partnersData the partnersData value to set.
* @return the SecurityAssessmentResponseInner object itself.
*/
public SecurityAssessmentResponseInner withPartnersData(SecurityAssessmentPartnerData partnersData) {
if (this.innerProperties() == null) {
this.innerProperties = new SecurityAssessmentPropertiesResponse();
}
this.innerProperties().withPartnersData(partnersData);
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 SecurityAssessmentResponseInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of SecurityAssessmentResponseInner 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 SecurityAssessmentResponseInner.
*/
public static SecurityAssessmentResponseInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
SecurityAssessmentResponseInner deserializedSecurityAssessmentResponseInner
= new SecurityAssessmentResponseInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("id".equals(fieldName)) {
deserializedSecurityAssessmentResponseInner.id = reader.getString();
} else if ("name".equals(fieldName)) {
deserializedSecurityAssessmentResponseInner.name = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedSecurityAssessmentResponseInner.type = reader.getString();
} else if ("properties".equals(fieldName)) {
deserializedSecurityAssessmentResponseInner.innerProperties
= SecurityAssessmentPropertiesResponse.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedSecurityAssessmentResponseInner;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy