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

package com.azure.resourcemanager.cognitiveservices.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.Map;

/** The object being used to update tags and sku of a resource, in general used for PATCH operations. */
@Fluent
public final class PatchResourceTagsAndSku extends PatchResourceTags {
    /*
     * The resource model definition representing SKU
     */
    @JsonProperty(value = "sku")
    private Sku sku;

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

    /**
     * Get the sku property: The resource model definition representing SKU.
     *
     * @return the sku value.
     */
    public Sku sku() {
        return this.sku;
    }

    /**
     * Set the sku property: The resource model definition representing SKU.
     *
     * @param sku the sku value to set.
     * @return the PatchResourceTagsAndSku object itself.
     */
    public PatchResourceTagsAndSku withSku(Sku sku) {
        this.sku = sku;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public PatchResourceTagsAndSku withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    @Override
    public void validate() {
        super.validate();
        if (sku() != null) {
            sku().validate();
        }
    }
}
