com.azure.resourcemanager.security.models.VmScannersBaseConfiguration 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.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonSerializable;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.util.Map;
/**
* Configuration for VM scanning.
*/
@Fluent
public final class VmScannersBaseConfiguration implements JsonSerializable {
/*
* The scanning mode for the VM scan.
*/
private ScanningMode scanningMode;
/*
* Tags that indicates that a resource should not be scanned
*/
private Map exclusionTags;
/**
* Creates an instance of VmScannersBaseConfiguration class.
*/
public VmScannersBaseConfiguration() {
}
/**
* Get the scanningMode property: The scanning mode for the VM scan.
*
* @return the scanningMode value.
*/
public ScanningMode scanningMode() {
return this.scanningMode;
}
/**
* Set the scanningMode property: The scanning mode for the VM scan.
*
* @param scanningMode the scanningMode value to set.
* @return the VmScannersBaseConfiguration object itself.
*/
public VmScannersBaseConfiguration withScanningMode(ScanningMode scanningMode) {
this.scanningMode = scanningMode;
return this;
}
/**
* Get the exclusionTags property: Tags that indicates that a resource should not be scanned.
*
* @return the exclusionTags value.
*/
public Map exclusionTags() {
return this.exclusionTags;
}
/**
* Set the exclusionTags property: Tags that indicates that a resource should not be scanned.
*
* @param exclusionTags the exclusionTags value to set.
* @return the VmScannersBaseConfiguration object itself.
*/
public VmScannersBaseConfiguration withExclusionTags(Map exclusionTags) {
this.exclusionTags = exclusionTags;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("scanningMode", this.scanningMode == null ? null : this.scanningMode.toString());
jsonWriter.writeMapField("exclusionTags", this.exclusionTags, (writer, element) -> writer.writeString(element));
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of VmScannersBaseConfiguration from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of VmScannersBaseConfiguration 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 VmScannersBaseConfiguration.
*/
public static VmScannersBaseConfiguration fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
VmScannersBaseConfiguration deserializedVmScannersBaseConfiguration = new VmScannersBaseConfiguration();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("scanningMode".equals(fieldName)) {
deserializedVmScannersBaseConfiguration.scanningMode = ScanningMode.fromString(reader.getString());
} else if ("exclusionTags".equals(fieldName)) {
Map exclusionTags = reader.readMap(reader1 -> reader1.getString());
deserializedVmScannersBaseConfiguration.exclusionTags = exclusionTags;
} else {
reader.skipChildren();
}
}
return deserializedVmScannersBaseConfiguration;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy