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

package com.azure.resourcemanager.providerhub.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;

/** Inner error containing list of errors. */
@Fluent
public class InnerError {
    /*
     * Specific error code than was provided by the containing error.
     */
    @JsonProperty(value = "code", access = JsonProperty.Access.WRITE_ONLY)
    private String code;

    /*
     * Object containing more specific information than the current object about the error.
     */
    @JsonProperty(value = "innerError", access = JsonProperty.Access.WRITE_ONLY)
    private Object innerError;

    /*
     * Inner error containing list of errors.
     */
    @JsonIgnore private Map<String, Object> additionalProperties;

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

    /**
     * Get the code property: Specific error code than was provided by the containing error.
     *
     * @return the code value.
     */
    public String code() {
        return this.code;
    }

    /**
     * Get the innerError property: Object containing more specific information than the current object about the error.
     *
     * @return the innerError value.
     */
    public Object innerError() {
        return this.innerError;
    }

    /**
     * Get the additionalProperties property: Inner error containing list of errors.
     *
     * @return the additionalProperties value.
     */
    @JsonAnyGetter
    public Map<String, Object> additionalProperties() {
        return this.additionalProperties;
    }

    /**
     * Set the additionalProperties property: Inner error containing list of errors.
     *
     * @param additionalProperties the additionalProperties value to set.
     * @return the InnerError object itself.
     */
    public InnerError 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() {
    }
}
