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

package com.azure.resourcemanager.azurearcdata.models;

import com.azure.core.annotation.Fluent;
import com.fasterxml.jackson.annotation.JsonAnyGetter;
import com.fasterxml.jackson.annotation.JsonAnySetter;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.HashMap;
import java.util.Map;

/** The raw kubernetes information. */
@Fluent
public final class SqlManagedInstanceK8SRaw {
    /*
     * The kubernetes spec information.
     */
    @JsonProperty(value = "spec")
    private SqlManagedInstanceK8SSpec spec;

    /*
     * The raw kubernetes information.
     */
    @JsonIgnore private Map<String, Object> additionalProperties;

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

    /**
     * Get the spec property: The kubernetes spec information.
     *
     * @return the spec value.
     */
    public SqlManagedInstanceK8SSpec spec() {
        return this.spec;
    }

    /**
     * Set the spec property: The kubernetes spec information.
     *
     * @param spec the spec value to set.
     * @return the SqlManagedInstanceK8SRaw object itself.
     */
    public SqlManagedInstanceK8SRaw withSpec(SqlManagedInstanceK8SSpec spec) {
        this.spec = spec;
        return this;
    }

    /**
     * Get the additionalProperties property: The raw kubernetes information.
     *
     * @return the additionalProperties value.
     */
    @JsonAnyGetter
    public Map<String, Object> additionalProperties() {
        return this.additionalProperties;
    }

    /**
     * Set the additionalProperties property: The raw kubernetes information.
     *
     * @param additionalProperties the additionalProperties value to set.
     * @return the SqlManagedInstanceK8SRaw object itself.
     */
    public SqlManagedInstanceK8SRaw withAdditionalProperties(Map<String, Object> additionalProperties) {
        this.additionalProperties = additionalProperties;
        return this;
    }

    @JsonAnySetter
    void withAdditionalProperties(String key, Object value) {
        if (additionalProperties == null) {
            additionalProperties = new HashMap<>();
        }
        additionalProperties.put(key, value);
    }

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