com.azure.resourcemanager.security.models.AlertSyncSettings 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 com.azure.resourcemanager.security.fluent.models.AlertSyncSettingProperties;
import com.azure.resourcemanager.security.fluent.models.SettingInner;
import java.io.IOException;
/**
* Represents an alert sync setting.
*/
@Fluent
public final class AlertSyncSettings extends SettingInner {
/*
* the kind of the settings string
*/
private SettingKind kind = SettingKind.ALERT_SYNC_SETTINGS;
/*
* Alert sync setting data
*/
private AlertSyncSettingProperties innerProperties;
/*
* The type of the resource.
*/
private String type;
/*
* The name of the resource.
*/
private String name;
/*
* Fully qualified resource Id for the resource.
*/
private String id;
/**
* Creates an instance of AlertSyncSettings class.
*/
public AlertSyncSettings() {
}
/**
* Get the kind property: the kind of the settings string.
*
* @return the kind value.
*/
@Override
public SettingKind kind() {
return this.kind;
}
/**
* Get the innerProperties property: Alert sync setting data.
*
* @return the innerProperties value.
*/
private AlertSyncSettingProperties innerProperties() {
return this.innerProperties;
}
/**
* Get the type property: The type of the resource.
*
* @return the type value.
*/
@Override
public String type() {
return this.type;
}
/**
* Get the name property: The name of the resource.
*
* @return the name value.
*/
@Override
public String name() {
return this.name;
}
/**
* Get the id property: Fully qualified resource Id for the resource.
*
* @return the id value.
*/
@Override
public String id() {
return this.id;
}
/**
* Get the enabled property: Is the alert sync setting enabled.
*
* @return the enabled value.
*/
public Boolean enabled() {
return this.innerProperties() == null ? null : this.innerProperties().enabled();
}
/**
* Set the enabled property: Is the alert sync setting enabled.
*
* @param enabled the enabled value to set.
* @return the AlertSyncSettings object itself.
*/
public AlertSyncSettings withEnabled(Boolean enabled) {
if (this.innerProperties() == null) {
this.innerProperties = new AlertSyncSettingProperties();
}
this.innerProperties().withEnabled(enabled);
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
@Override
public void validate() {
if (innerProperties() != null) {
innerProperties().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString());
jsonWriter.writeJsonField("properties", this.innerProperties);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of AlertSyncSettings from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of AlertSyncSettings 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 AlertSyncSettings.
*/
public static AlertSyncSettings fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
AlertSyncSettings deserializedAlertSyncSettings = new AlertSyncSettings();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("id".equals(fieldName)) {
deserializedAlertSyncSettings.id = reader.getString();
} else if ("name".equals(fieldName)) {
deserializedAlertSyncSettings.name = reader.getString();
} else if ("type".equals(fieldName)) {
deserializedAlertSyncSettings.type = reader.getString();
} else if ("kind".equals(fieldName)) {
deserializedAlertSyncSettings.kind = SettingKind.fromString(reader.getString());
} else if ("properties".equals(fieldName)) {
deserializedAlertSyncSettings.innerProperties = AlertSyncSettingProperties.fromJson(reader);
} else {
reader.skipChildren();
}
}
return deserializedAlertSyncSettings;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy