com.azure.resourcemanager.security.models.SqlServerVulnerabilityProperties 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.models;
import com.azure.core.annotation.Immutable;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
/**
* Details of the resource that was assessed.
*/
@Immutable
public final class SqlServerVulnerabilityProperties extends AdditionalData {
/*
* Sub-assessment resource type
*/
private AssessedResourceType assessedResourceType = AssessedResourceType.SQL_SERVER_VULNERABILITY;
/*
* The resource type the sub assessment refers to in its resource details
*/
private String type;
/*
* The T-SQL query that runs on your SQL database to perform the particular check
*/
private String query;
/**
* Creates an instance of SqlServerVulnerabilityProperties class.
*/
public SqlServerVulnerabilityProperties() {
}
/**
* Get the assessedResourceType property: Sub-assessment resource type.
*
* @return the assessedResourceType value.
*/
@Override
public AssessedResourceType assessedResourceType() {
return this.assessedResourceType;
}
/**
* Get the type property: The resource type the sub assessment refers to in its resource details.
*
* @return the type value.
*/
public String type() {
return this.type;
}
/**
* Get the query property: The T-SQL query that runs on your SQL database to perform the particular check.
*
* @return the query value.
*/
public String query() {
return this.query;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
@Override
public void validate() {
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("assessedResourceType",
this.assessedResourceType == null ? null : this.assessedResourceType.toString());
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of SqlServerVulnerabilityProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of SqlServerVulnerabilityProperties 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 SqlServerVulnerabilityProperties.
*/
public static SqlServerVulnerabilityProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
SqlServerVulnerabilityProperties deserializedSqlServerVulnerabilityProperties
= new SqlServerVulnerabilityProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("assessedResourceType".equals(fieldName)) {
deserializedSqlServerVulnerabilityProperties.assessedResourceType
= AssessedResourceType.fromString(reader.getString());
} else if ("type".equals(fieldName)) {
deserializedSqlServerVulnerabilityProperties.type = reader.getString();
} else if ("query".equals(fieldName)) {
deserializedSqlServerVulnerabilityProperties.query = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedSqlServerVulnerabilityProperties;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy