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

package com.azure.resourcemanager.securityinsights.models;

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

/** Support information for the content item. */
@Fluent
public final class MetadataSupport {
    /*
     * Type of support for content item
     */
    @JsonProperty(value = "tier", required = true)
    private SupportTier tier;

    /*
     * Name of the support contact. Company or person.
     */
    @JsonProperty(value = "name")
    private String name;

    /*
     * Email of support contact
     */
    @JsonProperty(value = "email")
    private String email;

    /*
     * Link for support help, like to support page to open a ticket etc.
     */
    @JsonProperty(value = "link")
    private String link;

    /**
     * Get the tier property: Type of support for content item.
     *
     * @return the tier value.
     */
    public SupportTier tier() {
        return this.tier;
    }

    /**
     * Set the tier property: Type of support for content item.
     *
     * @param tier the tier value to set.
     * @return the MetadataSupport object itself.
     */
    public MetadataSupport withTier(SupportTier tier) {
        this.tier = tier;
        return this;
    }

    /**
     * Get the name property: Name of the support contact. Company or person.
     *
     * @return the name value.
     */
    public String name() {
        return this.name;
    }

    /**
     * Set the name property: Name of the support contact. Company or person.
     *
     * @param name the name value to set.
     * @return the MetadataSupport object itself.
     */
    public MetadataSupport withName(String name) {
        this.name = name;
        return this;
    }

    /**
     * Get the email property: Email of support contact.
     *
     * @return the email value.
     */
    public String email() {
        return this.email;
    }

    /**
     * Set the email property: Email of support contact.
     *
     * @param email the email value to set.
     * @return the MetadataSupport object itself.
     */
    public MetadataSupport withEmail(String email) {
        this.email = email;
        return this;
    }

    /**
     * Get the link property: Link for support help, like to support page to open a ticket etc.
     *
     * @return the link value.
     */
    public String link() {
        return this.link;
    }

    /**
     * Set the link property: Link for support help, like to support page to open a ticket etc.
     *
     * @param link the link value to set.
     * @return the MetadataSupport object itself.
     */
    public MetadataSupport withLink(String link) {
        this.link = link;
        return this;
    }

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

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