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

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

import com.azure.core.annotation.Fluent;
import com.azure.core.util.logging.ClientLogger;
import com.azure.resourcemanager.apimanagement.models.RecipientsContractProperties;
import com.fasterxml.jackson.annotation.JsonProperty;

/** Notification Contract properties. */
@Fluent
public final class NotificationContractProperties {
    /*
     * Title of the Notification.
     */
    @JsonProperty(value = "title", required = true)
    private String title;

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

    /*
     * Recipient Parameter values.
     */
    @JsonProperty(value = "recipients")
    private RecipientsContractProperties recipients;

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

    /**
     * Get the title property: Title of the Notification.
     *
     * @return the title value.
     */
    public String title() {
        return this.title;
    }

    /**
     * Set the title property: Title of the Notification.
     *
     * @param title the title value to set.
     * @return the NotificationContractProperties object itself.
     */
    public NotificationContractProperties withTitle(String title) {
        this.title = title;
        return this;
    }

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

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

    /**
     * Get the recipients property: Recipient Parameter values.
     *
     * @return the recipients value.
     */
    public RecipientsContractProperties recipients() {
        return this.recipients;
    }

    /**
     * Set the recipients property: Recipient Parameter values.
     *
     * @param recipients the recipients value to set.
     * @return the NotificationContractProperties object itself.
     */
    public NotificationContractProperties withRecipients(RecipientsContractProperties recipients) {
        this.recipients = recipients;
        return this;
    }

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

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