// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.databox.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Notification preference for a job stage. */
@Fluent
public final class NotificationPreference {
    /*
     * Name of the stage.
     */
    @JsonProperty(value = "stageName", required = true)
    private NotificationStageName stageName;

    /*
     * Notification is required or not.
     */
    @JsonProperty(value = "sendNotification", required = true)
    private boolean sendNotification;

    /** Creates an instance of NotificationPreference class. */
    public NotificationPreference() {
    }

    /**
     * Get the stageName property: Name of the stage.
     *
     * @return the stageName value.
     */
    public NotificationStageName stageName() {
        return this.stageName;
    }

    /**
     * Set the stageName property: Name of the stage.
     *
     * @param stageName the stageName value to set.
     * @return the NotificationPreference object itself.
     */
    public NotificationPreference withStageName(NotificationStageName stageName) {
        this.stageName = stageName;
        return this;
    }

    /**
     * Get the sendNotification property: Notification is required or not.
     *
     * @return the sendNotification value.
     */
    public boolean sendNotification() {
        return this.sendNotification;
    }

    /**
     * Set the sendNotification property: Notification is required or not.
     *
     * @param sendNotification the sendNotification value to set.
     * @return the NotificationPreference object itself.
     */
    public NotificationPreference withSendNotification(boolean sendNotification) {
        this.sendNotification = sendNotification;
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (stageName() == null) {
            throw LOGGER
                .logExceptionAsError(
                    new IllegalArgumentException(
                        "Missing required property stageName in model NotificationPreference"));
        }
    }

    private static final ClientLogger LOGGER = new ClientLogger(NotificationPreference.class);
}
