com.azure.resourcemanager.security.fluent.models.HealthReportInner 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.EnvironmentDetails;
import com.azure.resourcemanager.security.models.HealthDataClassification;
import com.azure.resourcemanager.security.models.Issue;
import com.azure.resourcemanager.security.models.ResourceDetailsAutoGenerated;
import com.azure.resourcemanager.security.models.StatusAutoGenerated;
import java.io.IOException;
import java.util.List;
import java.util.Map;
/**
* The health report resource.
*/
@Fluent
public final class HealthReportInner extends ProxyResource {
/*
* Properties of a health report
*/
private HealthReportProperties 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 HealthReportInner class.
*/
public HealthReportInner() {
}
/**
* Get the innerProperties property: Properties of a health report.
*
* @return the innerProperties value.
*/
private HealthReportProperties 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 resourceDetails property: The resource details of the health report.
*
* @return the resourceDetails value.
*/
public ResourceDetailsAutoGenerated resourceDetails() {
return this.innerProperties() == null ? null : this.innerProperties().resourceDetails();
}
/**
* Set the resourceDetails property: The resource details of the health report.
*
* @param resourceDetails the resourceDetails value to set.
* @return the HealthReportInner object itself.
*/
public HealthReportInner withResourceDetails(ResourceDetailsAutoGenerated resourceDetails) {
if (this.innerProperties() == null) {
this.innerProperties = new HealthReportProperties();
}
this.innerProperties().withResourceDetails(resourceDetails);
return this;
}
/**
* Get the environmentDetails property: The environment details of the resource.
*
* @return the environmentDetails value.
*/
public EnvironmentDetails environmentDetails() {
return this.innerProperties() == null ? null : this.innerProperties().environmentDetails();
}
/**
* Set the environmentDetails property: The environment details of the resource.
*
* @param environmentDetails the environmentDetails value to set.
* @return the HealthReportInner object itself.
*/
public HealthReportInner withEnvironmentDetails(EnvironmentDetails environmentDetails) {
if (this.innerProperties() == null) {
this.innerProperties = new HealthReportProperties();
}
this.innerProperties().withEnvironmentDetails(environmentDetails);
return this;
}
/**
* Get the healthDataClassification property: The classification of the health report.
*
* @return the healthDataClassification value.
*/
public HealthDataClassification healthDataClassification() {
return this.innerProperties() == null ? null : this.innerProperties().healthDataClassification();
}
/**
* Set the healthDataClassification property: The classification of the health report.
*
* @param healthDataClassification the healthDataClassification value to set.
* @return the HealthReportInner object itself.
*/
public HealthReportInner withHealthDataClassification(HealthDataClassification healthDataClassification) {
if (this.innerProperties() == null) {
this.innerProperties = new HealthReportProperties();
}
this.innerProperties().withHealthDataClassification(healthDataClassification);
return this;
}
/**
* Get the status property: The status of the health report.
*
* @return the status value.
*/
public StatusAutoGenerated status() {
return this.innerProperties() == null ? null : this.innerProperties().status();
}
/**
* Set the status property: The status of the health report.
*
* @param status the status value to set.
* @return the HealthReportInner object itself.
*/
public HealthReportInner withStatus(StatusAutoGenerated status) {
if (this.innerProperties() == null) {
this.innerProperties = new HealthReportProperties();
}
this.innerProperties().withStatus(status);
return this;
}
/**
* Get the affectedDefendersPlans property: The affected defenders plans by unhealthy report.
*
* @return the affectedDefendersPlans value.
*/
public List affectedDefendersPlans() {
return this.innerProperties() == null ? null : this.innerProperties().affectedDefendersPlans();
}
/**
* Set the affectedDefendersPlans property: The affected defenders plans by unhealthy report.
*
* @param affectedDefendersPlans the affectedDefendersPlans value to set.
* @return the HealthReportInner object itself.
*/
public HealthReportInner withAffectedDefendersPlans(List affectedDefendersPlans) {
if (this.innerProperties() == null) {
this.innerProperties = new HealthReportProperties();
}
this.innerProperties().withAffectedDefendersPlans(affectedDefendersPlans);
return this;
}
/**
* Get the affectedDefendersSubPlans property: The affected defenders sub plans by unhealthy report.
*
* @return the affectedDefendersSubPlans value.
*/
public List affectedDefendersSubPlans() {
return this.innerProperties() == null ? null : this.innerProperties().affectedDefendersSubPlans();
}
/**
* Set the affectedDefendersSubPlans property: The affected defenders sub plans by unhealthy report.
*
* @param affectedDefendersSubPlans the affectedDefendersSubPlans value to set.
* @return the HealthReportInner object itself.
*/
public HealthReportInner withAffectedDefendersSubPlans(List affectedDefendersSubPlans) {
if (this.innerProperties() == null) {
this.innerProperties = new HealthReportProperties();
}
this.innerProperties().withAffectedDefendersSubPlans(affectedDefendersSubPlans);
return this;
}
/**
* Get the reportAdditionalData property: Additional data for the given health report, this field can include more
* details on the resource and the health scenario.
*
* @return the reportAdditionalData value.
*/
public Map reportAdditionalData() {
return this.innerProperties() == null ? null : this.innerProperties().reportAdditionalData();
}
/**
* Get the issues property: A collection of the issues in the report.
*
* @return the issues value.
*/
public List issues() {
return this.innerProperties() == null ? null : this.innerProperties().issues();
}
/**
* Set the issues property: A collection of the issues in the report.
*
* @param issues the issues value to set.
* @return the HealthReportInner object itself.
*/
public HealthReportInner withIssues(List issues) {
if (this.innerProperties() == null) {
this.innerProperties = new HealthReportProperties();
}
this.innerProperties().withIssues(issues);
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 HealthReportInner from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of HealthReportInner 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 HealthReportInner.
*/
public static HealthReportInner fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
HealthReportInner deserializedHealthReportInner = new HealthReportInner();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("id".equals(fieldName)) {
deserializedHealthReportInner.id = reader.getString();
} else if ("name".equals(fieldName)) {
deserializedHealthReportInner.name = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedHealthReportInner.type = reader.getString();
} else if ("properties".equals(fieldName)) {
deserializedHealthReportInner.innerProperties = HealthReportProperties.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedHealthReportInner;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy