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

package com.azure.resourcemanager.devtestlabs.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.resourcemanager.devtestlabs.models.Event;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.time.OffsetDateTime;
import java.util.List;

/** Properties of a schedule. */
@Fluent
public final class NotificationChannelProperties {
    /*
     * The webhook URL to send notifications to.
     */
    @JsonProperty(value = "webHookUrl")
    private String webhookUrl;

    /*
     * The email recipient to send notifications to (can be a list of semi-colon separated email addresses).
     */
    @JsonProperty(value = "emailRecipient")
    private String emailRecipient;

    /*
     * The locale to use when sending a notification (fallback for unsupported languages is EN).
     */
    @JsonProperty(value = "notificationLocale")
    private String notificationLocale;

    /*
     * Description of notification.
     */
    @JsonProperty(value = "description")
    private String description;

    /*
     * The list of event for which this notification is enabled.
     */
    @JsonProperty(value = "events")
    private List<Event> events;

    /*
     * The creation date of the notification channel.
     */
    @JsonProperty(value = "createdDate", access = JsonProperty.Access.WRITE_ONLY)
    private OffsetDateTime createdDate;

    /*
     * The provisioning status of the resource.
     */
    @JsonProperty(value = "provisioningState", access = JsonProperty.Access.WRITE_ONLY)
    private String provisioningState;

    /*
     * The unique immutable identifier of a resource (Guid).
     */
    @JsonProperty(value = "uniqueIdentifier", access = JsonProperty.Access.WRITE_ONLY)
    private String uniqueIdentifier;

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

    /**
     * Get the webhookUrl property: The webhook URL to send notifications to.
     *
     * @return the webhookUrl value.
     */
    public String webhookUrl() {
        return this.webhookUrl;
    }

    /**
     * Set the webhookUrl property: The webhook URL to send notifications to.
     *
     * @param webhookUrl the webhookUrl value to set.
     * @return the NotificationChannelProperties object itself.
     */
    public NotificationChannelProperties withWebhookUrl(String webhookUrl) {
        this.webhookUrl = webhookUrl;
        return this;
    }

    /**
     * Get the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon
     * separated email addresses).
     *
     * @return the emailRecipient value.
     */
    public String emailRecipient() {
        return this.emailRecipient;
    }

    /**
     * Set the emailRecipient property: The email recipient to send notifications to (can be a list of semi-colon
     * separated email addresses).
     *
     * @param emailRecipient the emailRecipient value to set.
     * @return the NotificationChannelProperties object itself.
     */
    public NotificationChannelProperties withEmailRecipient(String emailRecipient) {
        this.emailRecipient = emailRecipient;
        return this;
    }

    /**
     * Get the notificationLocale property: The locale to use when sending a notification (fallback for unsupported
     * languages is EN).
     *
     * @return the notificationLocale value.
     */
    public String notificationLocale() {
        return this.notificationLocale;
    }

    /**
     * Set the notificationLocale property: The locale to use when sending a notification (fallback for unsupported
     * languages is EN).
     *
     * @param notificationLocale the notificationLocale value to set.
     * @return the NotificationChannelProperties object itself.
     */
    public NotificationChannelProperties withNotificationLocale(String notificationLocale) {
        this.notificationLocale = notificationLocale;
        return this;
    }

    /**
     * Get the description property: Description of notification.
     *
     * @return the description value.
     */
    public String description() {
        return this.description;
    }

    /**
     * Set the description property: Description of notification.
     *
     * @param description the description value to set.
     * @return the NotificationChannelProperties object itself.
     */
    public NotificationChannelProperties withDescription(String description) {
        this.description = description;
        return this;
    }

    /**
     * Get the events property: The list of event for which this notification is enabled.
     *
     * @return the events value.
     */
    public List<Event> events() {
        return this.events;
    }

    /**
     * Set the events property: The list of event for which this notification is enabled.
     *
     * @param events the events value to set.
     * @return the NotificationChannelProperties object itself.
     */
    public NotificationChannelProperties withEvents(List<Event> events) {
        this.events = events;
        return this;
    }

    /**
     * Get the createdDate property: The creation date of the notification channel.
     *
     * @return the createdDate value.
     */
    public OffsetDateTime createdDate() {
        return this.createdDate;
    }

    /**
     * Get the provisioningState property: The provisioning status of the resource.
     *
     * @return the provisioningState value.
     */
    public String provisioningState() {
        return this.provisioningState;
    }

    /**
     * Get the uniqueIdentifier property: The unique immutable identifier of a resource (Guid).
     *
     * @return the uniqueIdentifier value.
     */
    public String uniqueIdentifier() {
        return this.uniqueIdentifier;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (events() != null) {
            events().forEach(e -> e.validate());
        }
    }
}
