com.azure.resourcemanager.security.models.GovernanceEmailNotification 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;
/**
* The governance email weekly notification configuration.
*/
@Fluent
public final class GovernanceEmailNotification implements JsonSerializable {
/*
* Exclude manager from weekly email notification.
*/
private Boolean disableManagerEmailNotification;
/*
* Exclude owner from weekly email notification.
*/
private Boolean disableOwnerEmailNotification;
/**
* Creates an instance of GovernanceEmailNotification class.
*/
public GovernanceEmailNotification() {
}
/**
* Get the disableManagerEmailNotification property: Exclude manager from weekly email notification.
*
* @return the disableManagerEmailNotification value.
*/
public Boolean disableManagerEmailNotification() {
return this.disableManagerEmailNotification;
}
/**
* Set the disableManagerEmailNotification property: Exclude manager from weekly email notification.
*
* @param disableManagerEmailNotification the disableManagerEmailNotification value to set.
* @return the GovernanceEmailNotification object itself.
*/
public GovernanceEmailNotification withDisableManagerEmailNotification(Boolean disableManagerEmailNotification) {
this.disableManagerEmailNotification = disableManagerEmailNotification;
return this;
}
/**
* Get the disableOwnerEmailNotification property: Exclude owner from weekly email notification.
*
* @return the disableOwnerEmailNotification value.
*/
public Boolean disableOwnerEmailNotification() {
return this.disableOwnerEmailNotification;
}
/**
* Set the disableOwnerEmailNotification property: Exclude owner from weekly email notification.
*
* @param disableOwnerEmailNotification the disableOwnerEmailNotification value to set.
* @return the GovernanceEmailNotification object itself.
*/
public GovernanceEmailNotification withDisableOwnerEmailNotification(Boolean disableOwnerEmailNotification) {
this.disableOwnerEmailNotification = disableOwnerEmailNotification;
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.writeBooleanField("disableManagerEmailNotification", this.disableManagerEmailNotification);
jsonWriter.writeBooleanField("disableOwnerEmailNotification", this.disableOwnerEmailNotification);
return jsonWriter.writeEndObject();
}
/**
* Reads an instance of GovernanceEmailNotification from the JsonReader.
*
* @param jsonReader The JsonReader being read.
* @return An instance of GovernanceEmailNotification 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 GovernanceEmailNotification.
*/
public static GovernanceEmailNotification fromJson(JsonReader jsonReader) throws IOException {
return jsonReader.readObject(reader -> {
GovernanceEmailNotification deserializedGovernanceEmailNotification = new GovernanceEmailNotification();
while (reader.nextToken() != JsonToken.END_OBJECT) {
String fieldName = reader.getFieldName();
reader.nextToken();
if ("disableManagerEmailNotification".equals(fieldName)) {
deserializedGovernanceEmailNotification.disableManagerEmailNotification
= reader.getNullable(JsonReader::getBoolean);
} else if ("disableOwnerEmailNotification".equals(fieldName)) {
deserializedGovernanceEmailNotification.disableOwnerEmailNotification
= reader.getNullable(JsonReader::getBoolean);
} else {
reader.skipChildren();
}
}
return deserializedGovernanceEmailNotification;
});
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy