![JAR search and dependency download from the Maven repository](/logo.png)
com.azure.resourcemanager.securityinsights.models.FusionScenarioExclusionPattern Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of azure-resourcemanager-securityinsights Show documentation
Show all versions of azure-resourcemanager-securityinsights Show documentation
This package contains Microsoft Azure SDK for SecurityInsights Management SDK. For documentation on how to use this package, please see https://aka.ms/azsdk/java/mgmt. API spec for Microsoft.SecurityInsights (Azure Security Insights) resource provider. Package tag package-preview-2021-09.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.
package com.azure.resourcemanager.securityinsights.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 java.io.IOException;
/**
* Represents a Fusion scenario exclusion patterns in Fusion detection.
*/
@Fluent
public final class FusionScenarioExclusionPattern implements JsonSerializable {
/*
* Scenario exclusion pattern.
*/
private String exclusionPattern;
/*
* DateTime when scenario exclusion pattern is added in UTC.
*/
private String dateAddedInUtc;
/**
* Creates an instance of FusionScenarioExclusionPattern class.
*/
public FusionScenarioExclusionPattern() {
}
/**
* Get the exclusionPattern property: Scenario exclusion pattern.
*
* @return the exclusionPattern value.
*/
public String exclusionPattern() {
return this.exclusionPattern;
}
/**
* Set the exclusionPattern property: Scenario exclusion pattern.
*
* @param exclusionPattern the exclusionPattern value to set.
* @return the FusionScenarioExclusionPattern object itself.
*/
public FusionScenarioExclusionPattern withExclusionPattern(String exclusionPattern) {
this.exclusionPattern = exclusionPattern;
return this;
}
/**
* Get the dateAddedInUtc property: DateTime when scenario exclusion pattern is added in UTC.
*
* @return the dateAddedInUtc value.
*/
public String dateAddedInUtc() {
return this.dateAddedInUtc;
}
/**
* Set the dateAddedInUtc property: DateTime when scenario exclusion pattern is added in UTC.
*
* @param dateAddedInUtc the dateAddedInUtc value to set.
* @return the FusionScenarioExclusionPattern object itself.
*/
public FusionScenarioExclusionPattern withDateAddedInUtc(String dateAddedInUtc) {
this.dateAddedInUtc = dateAddedInUtc;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (exclusionPattern() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property exclusionPattern in model FusionScenarioExclusionPattern"));
}
if (dateAddedInUtc() == null) {
throw LOGGER.atError()
.log(new IllegalArgumentException(
"Missing required property dateAddedInUtc in model FusionScenarioExclusionPattern"));
}
}
private static final ClientLogger LOGGER = new ClientLogger(FusionScenarioExclusionPattern.class);
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("exclusionPattern", this.exclusionPattern);
jsonWriter.writeStringField("dateAddedInUTC", this.dateAddedInUtc);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of FusionScenarioExclusionPattern from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of FusionScenarioExclusionPattern 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 FusionScenarioExclusionPattern.
*/
public static FusionScenarioExclusionPattern fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
FusionScenarioExclusionPattern deserializedFusionScenarioExclusionPattern
= new FusionScenarioExclusionPattern();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("exclusionPattern".equals(fieldName)) {
deserializedFusionScenarioExclusionPattern.exclusionPattern = reader.getString();
} else if ("dateAddedInUTC".equals(fieldName)) {
deserializedFusionScenarioExclusionPattern.dateAddedInUtc = reader.getString();
} else {
reader.skipChildren();
}
}
return deserializedFusionScenarioExclusionPattern;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy