com.azure.resourcemanager.security.fluent.models.ServerVulnerabilityAssessmentsAzureSettingProperties Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-security Show documentation
Show all versions of azure-resourcemanager-security Show documentation
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.
// 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.util.logging.ClientLogger;
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.ServerVulnerabilityAssessmentsAzureSettingSelectedProvider;
import java.io.IOException;
/**
* Describes the vulnerability assessments setting properties on Azure servers in the defined scope.
*/
@Fluent
public final class ServerVulnerabilityAssessmentsAzureSettingProperties
implements JsonSerializable {
/*
* The selected vulnerability assessments provider on Azure servers in the defined scope.
*/
private ServerVulnerabilityAssessmentsAzureSettingSelectedProvider selectedProvider;
/**
* Creates an instance of ServerVulnerabilityAssessmentsAzureSettingProperties class.
*/
public ServerVulnerabilityAssessmentsAzureSettingProperties() {
}
/**
* Get the selectedProvider property: The selected vulnerability assessments provider on Azure servers in the
* defined scope.
*
* @return the selectedProvider value.
*/
public ServerVulnerabilityAssessmentsAzureSettingSelectedProvider selectedProvider() {
return this.selectedProvider;
}
/**
* Set the selectedProvider property: The selected vulnerability assessments provider on Azure servers in the
* defined scope.
*
* @param selectedProvider the selectedProvider value to set.
* @return the ServerVulnerabilityAssessmentsAzureSettingProperties object itself.
*/
public ServerVulnerabilityAssessmentsAzureSettingProperties
withSelectedProvider(ServerVulnerabilityAssessmentsAzureSettingSelectedProvider selectedProvider) {
this.selectedProvider = selectedProvider;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (selectedProvider() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property selectedProvider in model ServerVulnerabilityAssessmentsAzureSettingProperties"));
}
}
private static final ClientLogger LOGGER
= new ClientLogger(ServerVulnerabilityAssessmentsAzureSettingProperties.class);
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("selectedProvider",
this.selectedProvider == null ? null : this.selectedProvider.toString());
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of ServerVulnerabilityAssessmentsAzureSettingProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of ServerVulnerabilityAssessmentsAzureSettingProperties 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 ServerVulnerabilityAssessmentsAzureSettingProperties.
*/
public static ServerVulnerabilityAssessmentsAzureSettingProperties fromJson(JsonReader jsonReader)
throws IOException {
return jsonReader.readObject(reader -> {
ServerVulnerabilityAssessmentsAzureSettingProperties deserializedServerVulnerabilityAssessmentsAzureSettingProperties
= new ServerVulnerabilityAssessmentsAzureSettingProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("selectedProvider".equals(fieldName)) {
deserializedServerVulnerabilityAssessmentsAzureSettingProperties.selectedProvider
= ServerVulnerabilityAssessmentsAzureSettingSelectedProvider.fromString(reader.getString());
} else {
reader.skipChildren();
}
}
return deserializedServerVulnerabilityAssessmentsAzureSettingProperties;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy