com.azure.resourcemanager.security.models.DefenderForStorageSettingProperties 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;
/**
* Defender for Storage resource properties.
*/
@Fluent
public final class DefenderForStorageSettingProperties
implements JsonSerializable {
/*
* Indicates whether Defender for Storage is enabled on this storage account.
*/
private Boolean isEnabled;
/*
* Properties of Malware Scanning.
*/
private MalwareScanningProperties malwareScanning;
/*
* Properties of Sensitive Data Discovery.
*/
private SensitiveDataDiscoveryProperties sensitiveDataDiscovery;
/*
* Indicates whether the settings defined for this storage account should override the settings defined for the
* subscription.
*/
private Boolean overrideSubscriptionLevelSettings;
/**
* Creates an instance of DefenderForStorageSettingProperties class.
*/
public DefenderForStorageSettingProperties() {
}
/**
* Get the isEnabled property: Indicates whether Defender for Storage is enabled on this storage account.
*
* @return the isEnabled value.
*/
public Boolean isEnabled() {
return this.isEnabled;
}
/**
* Set the isEnabled property: Indicates whether Defender for Storage is enabled on this storage account.
*
* @param isEnabled the isEnabled value to set.
* @return the DefenderForStorageSettingProperties object itself.
*/
public DefenderForStorageSettingProperties withIsEnabled(Boolean isEnabled) {
this.isEnabled = isEnabled;
return this;
}
/**
* Get the malwareScanning property: Properties of Malware Scanning.
*
* @return the malwareScanning value.
*/
public MalwareScanningProperties malwareScanning() {
return this.malwareScanning;
}
/**
* Set the malwareScanning property: Properties of Malware Scanning.
*
* @param malwareScanning the malwareScanning value to set.
* @return the DefenderForStorageSettingProperties object itself.
*/
public DefenderForStorageSettingProperties withMalwareScanning(MalwareScanningProperties malwareScanning) {
this.malwareScanning = malwareScanning;
return this;
}
/**
* Get the sensitiveDataDiscovery property: Properties of Sensitive Data Discovery.
*
* @return the sensitiveDataDiscovery value.
*/
public SensitiveDataDiscoveryProperties sensitiveDataDiscovery() {
return this.sensitiveDataDiscovery;
}
/**
* Set the sensitiveDataDiscovery property: Properties of Sensitive Data Discovery.
*
* @param sensitiveDataDiscovery the sensitiveDataDiscovery value to set.
* @return the DefenderForStorageSettingProperties object itself.
*/
public DefenderForStorageSettingProperties
withSensitiveDataDiscovery(SensitiveDataDiscoveryProperties sensitiveDataDiscovery) {
this.sensitiveDataDiscovery = sensitiveDataDiscovery;
return this;
}
/**
* Get the overrideSubscriptionLevelSettings property: Indicates whether the settings defined for this storage
* account should override the settings defined for the subscription.
*
* @return the overrideSubscriptionLevelSettings value.
*/
public Boolean overrideSubscriptionLevelSettings() {
return this.overrideSubscriptionLevelSettings;
}
/**
* Set the overrideSubscriptionLevelSettings property: Indicates whether the settings defined for this storage
* account should override the settings defined for the subscription.
*
* @param overrideSubscriptionLevelSettings the overrideSubscriptionLevelSettings value to set.
* @return the DefenderForStorageSettingProperties object itself.
*/
public DefenderForStorageSettingProperties
withOverrideSubscriptionLevelSettings(Boolean overrideSubscriptionLevelSettings) {
this.overrideSubscriptionLevelSettings = overrideSubscriptionLevelSettings;
return this;
}
/**
* Validates the instance.
*
* @throws IllegalArgumentException thrown if the instance is not valid.
*/
public void validate() {
if (malwareScanning() != null) {
malwareScanning().validate();
}
if (sensitiveDataDiscovery() != null) {
sensitiveDataDiscovery().validate();
}
}
/**
* {@inheritDoc}
*/
@Override
public JsonWriter toJson(JsonWriter jsonWriter) throws IOException {
jsonWriter.writeStartObject();
jsonWriter.writeBooleanField("isEnabled", this.isEnabled);
jsonWriter.writeJsonField("malwareScanning", this.malwareScanning);
jsonWriter.writeJsonField("sensitiveDataDiscovery", this.sensitiveDataDiscovery);
jsonWriter.writeBooleanField("overrideSubscriptionLevelSettings", this.overrideSubscriptionLevelSettings);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of DefenderForStorageSettingProperties from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of DefenderForStorageSettingProperties 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 DefenderForStorageSettingProperties.
*/
public static DefenderForStorageSettingProperties fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
DefenderForStorageSettingProperties deserializedDefenderForStorageSettingProperties
= new DefenderForStorageSettingProperties();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("isEnabled".equals(fieldName)) {
deserializedDefenderForStorageSettingProperties.isEnabled
= reader.getNullable(JsonReader::getBoolean);
} else if ("malwareScanning".equals(fieldName)) {
deserializedDefenderForStorageSettingProperties.malwareScanning
= MalwareScanningProperties.fromJson(reader);
} else if ("sensitiveDataDiscovery".equals(fieldName)) {
deserializedDefenderForStorageSettingProperties.sensitiveDataDiscovery
= SensitiveDataDiscoveryProperties.fromJson(reader);
} else if ("overrideSubscriptionLevelSettings".equals(fieldName)) {
deserializedDefenderForStorageSettingProperties.overrideSubscriptionLevelSettings
= reader.getNullable(JsonReader::getBoolean);
} else {
reader.skipChildren();
}
}
return deserializedDefenderForStorageSettingProperties;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy