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

package com.azure.resourcemanager.networkcloud.models;

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

/** KubernetesLabel represents a single entry for a Kubernetes label or taint such as those used on a node or pod. */
@Fluent
public final class KubernetesLabel {
    /*
     * The name of the label or taint.
     */
    @JsonProperty(value = "key", required = true)
    private String key;

    /*
     * The value of the label or taint.
     */
    @JsonProperty(value = "value", required = true)
    private String value;

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

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

    /**
     * Set the key property: The name of the label or taint.
     *
     * @param key the key value to set.
     * @return the KubernetesLabel object itself.
     */
    public KubernetesLabel withKey(String key) {
        this.key = key;
        return this;
    }

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

    /**
     * Set the value property: The value of the label or taint.
     *
     * @param value the value value to set.
     * @return the KubernetesLabel object itself.
     */
    public KubernetesLabel withValue(String value) {
        this.value = value;
        return this;
    }

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

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