// Path: src/com/github/tinselspoon/intellij/kubernetes/ResourceTypeKey.java
// public class ResourceTypeKey {
// 
//     /** The value of the "apiVersion" field, e.g. {@code batch/v1}. */
//     private final String apiVersion;
// 
//     /** The value of the "kind" field, e.g. {@code Job}. */
//     private final String kind;
// 
//     /**
//      * Default constructor.
//      *
//      * @param apiVersion the value of the "apiVersion" field, e.g. {@code batch/v1}.
//      * @param kind the value of the "kind" field, e.g. {@code Job}.
//      */
//     public ResourceTypeKey(final String apiVersion, final String kind) {
//         this.apiVersion = apiVersion;
//         this.kind = kind;
//     }
// 
//     @Override
//     public boolean equals(final Object o) {
//         if (this == o) {
//             return true;
//         }
//         if (o == null || getClass() != o.getClass()) {
//             return false;
//         }
//         final ResourceTypeKey that = (ResourceTypeKey) o;
//         return Objects.equals(apiVersion, that.apiVersion) && Objects.equals(kind, that.kind);
//     }
// 
//     /**
//      * Gets the value of the "apiVersion" field, e.g. {@code batch/v1}.
//      *
//      * @return the api version.
//      */
//     public String getApiVersion() {
//         return apiVersion;
//     }
// 
//     /**
//      * Gets the value of the "kind" field, e.g. {@code Job}.
//      *
//      * @return the kind.
//      */
//     public String getKind() {
//         return kind;
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(apiVersion, kind);
//     }
// }


import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import com.github.tinselspoon.intellij.kubernetes.ResourceTypeKey;
package com.github.tinselspoon.intellij.kubernetes.model;




/**
 * Provides information on the schema of Kubernetes resources.
 */
public class ModelProvider {

    /** Singleton instance. */
    public static final ModelProvider INSTANCE = new ModelProvider();

    private final ModelLoader modelLoader = new ModelLoader();

    /** The specs currently loaded. */
    private List<SwaggerSpec> specs;

    /** Singleton private constructor. */
    private ModelProvider() {
    }

    /**
     * Find the model that governs the property described by navigating from the base model of the {@link ResourceTypeKey} through the properties given in the {@code path}.
     *
     * @param resourceTypeKey the resource at which to begin the search.
     * @param path a series of properties to navigate through, may be empty to return the root model of the {@code ResourceTypeKey}.
     * @return the model, or {@code null} if one cannot be found.
     */
    @Nullable
// Path: src/com/github/tinselspoon/intellij/kubernetes/ResourceTypeKey.java
// public class ResourceTypeKey {
// 
//     /** The value of the "apiVersion" field, e.g. {@code batch/v1}. */
//     private final String apiVersion;
// 
//     /** The value of the "kind" field, e.g. {@code Job}. */
//     private final String kind;
// 
//     /**
//      * Default constructor.
//      *
//      * @param apiVersion the value of the "apiVersion" field, e.g. {@code batch/v1}.
//      * @param kind the value of the "kind" field, e.g. {@code Job}.
//      */
//     public ResourceTypeKey(final String apiVersion, final String kind) {
//         this.apiVersion = apiVersion;
//         this.kind = kind;
//     }
// 
//     @Override
//     public boolean equals(final Object o) {
//         if (this == o) {
//             return true;
//         }
//         if (o == null || getClass() != o.getClass()) {
//             return false;
//         }
//         final ResourceTypeKey that = (ResourceTypeKey) o;
//         return Objects.equals(apiVersion, that.apiVersion) && Objects.equals(kind, that.kind);
//     }
// 
//     /**
//      * Gets the value of the "apiVersion" field, e.g. {@code batch/v1}.
//      *
//      * @return the api version.
//      */
//     public String getApiVersion() {
//         return apiVersion;
//     }
// 
//     /**
//      * Gets the value of the "kind" field, e.g. {@code Job}.
//      *
//      * @return the kind.
//      */
//     public String getKind() {
//         return kind;
//     }
// 
//     @Override
//     public int hashCode() {
//         return Objects.hash(apiVersion, kind);
//     }
// }


// Path: src/com/github/tinselspoon/intellij/kubernetes/model/ModelProvider.java
import java.util.Collections;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import com.github.tinselspoon.intellij.kubernetes.ResourceTypeKey;

package com.github.tinselspoon.intellij.kubernetes.model;




/**
 * Provides information on the schema of Kubernetes resources.
 */
public class ModelProvider {

    /** Singleton instance. */
    public static final ModelProvider INSTANCE = new ModelProvider();

    private final ModelLoader modelLoader = new ModelLoader();

    /** The specs currently loaded. */
    private List<SwaggerSpec> specs;

    /** Singleton private constructor. */
    private ModelProvider() {
    }

    /**
     * Find the model that governs the property described by navigating from the base model of the {@link ResourceTypeKey} through the properties given in the {@code path}.
     *
     * @param resourceTypeKey the resource at which to begin the search.
     * @param path a series of properties to navigate through, may be empty to return the root model of the {@code ResourceTypeKey}.
     * @return the model, or {@code null} if one cannot be found.
     */
    @Nullable
    public Model findModel(final ResourceTypeKey resourceTypeKey, final List<String> path) {