com.azure.resourcemanager.security.models.AlertSimulatorBundlesRequestProperties 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.models;
import com.azure.core.annotation.Fluent;
import com.azure.json.JsonReader;
import com.azure.json.JsonToken;
import com.azure.json.JsonWriter;
import java.io.IOException;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/**
* Simulate alerts according to this bundles.
*/
@Fluent
public final class AlertSimulatorBundlesRequestProperties extends AlertSimulatorRequestProperties {
/*
* The kind of alert simulation.
*/
private Kind kind = Kind.BUNDLES;
/*
* Bundles list.
*/
private List bundles;
/**
* Creates an instance of AlertSimulatorBundlesRequestProperties class.
*/
public AlertSimulatorBundlesRequestProperties() {
}
/**
* Get the kind property: The kind of alert simulation.
*
* @return the kind value.
*/
@Override
public Kind kind() {
return this.kind;
}
/**
* Get the bundles property: Bundles list.
*
* @return the bundles value.
*/
public List bundles() {
return this.bundles;
}
/**
* Set the bundles property: Bundles list.
*
* @param bundles the bundles value to set.
* @return the AlertSimulatorBundlesRequestProperties object itself.
*/
public AlertSimulatorBundlesRequestProperties withBundles(List bundles) {
this.bundles = bundles;
return this;
}
/**
* 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("kind", this.kind == null ? null : this.kind.toString());
jsonWriter.writeArrayField("bundles", this.bundles,
(writer, element) -> writer.writeString(element == null ? null : element.toString()));
if (additionalProperties() != null) {
for (Map.Entry additionalProperty : additionalProperties().entrySet()) {
jsonWriter.writeUntypedField(additionalProperty.getKey(), additionalProperty.getValue());
}
}
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of AlertSimulatorBundlesRequestProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AlertSimulatorBundlesRequestProperties 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 AlertSimulatorBundlesRequestProperties.
*/
public static AlertSimulatorBundlesRequestProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
AlertSimulatorBundlesRequestProperties deserializedAlertSimulatorBundlesRequestProperties
= new AlertSimulatorBundlesRequestProperties();
Map additionalProperties = null;
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("kind".equals(fieldName)) {
deserializedAlertSimulatorBundlesRequestProperties.kind = Kind.fromString(reader.getString());
} else if ("bundles".equals(fieldName)) {
List bundles = reader.readArray(reader1 -> BundleType.fromString(reader1.getString()));
deserializedAlertSimulatorBundlesRequestProperties.bundles = bundles;
} else {
if (additionalProperties == null) {
additionalProperties = new LinkedHashMap<>();
}
additionalProperties.put(fieldName, reader.readUntyped());
}
}
deserializedAlertSimulatorBundlesRequestProperties.withAdditionalProperties(additionalProperties);
return deserializedAlertSimulatorBundlesRequestProperties;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy