// 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;

/** Represents an incident label. */
@Fluent
public final class IncidentLabel {
    /*
     * The name of the label
     */
    @JsonProperty(value = "labelName", required = true)
    private String labelName;

    /*
     * The type of the label
     */
    @JsonProperty(value = "labelType", access = JsonProperty.Access.WRITE_ONLY)
    private IncidentLabelType labelType;

    /**
     * Get the labelName property: The name of the label.
     *
     * @return the labelName value.
     */
    public String labelName() {
        return this.labelName;
    }

    /**
     * Set the labelName property: The name of the label.
     *
     * @param labelName the labelName value to set.
     * @return the IncidentLabel object itself.
     */
    public IncidentLabel withLabelName(String labelName) {
        this.labelName = labelName;
        return this;
    }

    /**
     * Get the labelType property: The type of the label.
     *
     * @return the labelType value.
     */
    public IncidentLabelType labelType() {
        return this.labelType;
    }

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

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