/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.apache.flink.agents.api.resource;

/**
 * Hierarchical resource class names for pointing a resource implementation in {@link
 * ResourceDescriptor}.
 *
 * <p>Structure:
 *
 * <ul>
 *   <li>Java implementation: ResourceType.PROVIDER_RESOURCEKIND
 *   <li>Python implementation: ResourceType.Python.PROVIDER_RESOURCEKIND
 * </ul>
 *
 * <p>Example usage:
 *
 * <pre>{@code
 * // Java implementation
 * ResourceName.ChatModel.OLLAMA_CONNECTION
 * ResourceName.ChatModel.OPENAI_COMPLETIONS_SETUP
 *
 * // Python implementation
 * ResourceName.ChatModel.Python.OLLAMA_CONNECTION
 * }</pre>
 */
public final class ResourceName {

    private ResourceName() {}

    // ==================== ChatModel ====================
    public static final class ChatModel {

        // Anthropic
        public static final String ANTHROPIC_CONNECTION =
                "org.apache.flink.agents.integrations.chatmodels.anthropic.AnthropicChatModelConnection";
        public static final String ANTHROPIC_SETUP =
                "org.apache.flink.agents.integrations.chatmodels.anthropic.AnthropicChatModelSetup";

        // Azure
        public static final String AZURE_CONNECTION =
                "org.apache.flink.agents.integrations.chatmodels.azureai.AzureAIChatModelConnection";
        public static final String AZURE_SETUP =
                "org.apache.flink.agents.integrations.chatmodels.azureai.AzureAIChatModelSetup";

        // Bedrock
        public static final String BEDROCK_CONNECTION =
                "org.apache.flink.agents.integrations.chatmodels.bedrock.BedrockChatModelConnection";
        public static final String BEDROCK_SETUP =
                "org.apache.flink.agents.integrations.chatmodels.bedrock.BedrockChatModelSetup";

        // Ollama
        public static final String OLLAMA_CONNECTION =
                "org.apache.flink.agents.integrations.chatmodels.ollama.OllamaChatModelConnection";
        public static final String OLLAMA_SETUP =
                "org.apache.flink.agents.integrations.chatmodels.ollama.OllamaChatModelSetup";

        // OpenAI
        public static final String OPENAI_COMPLETIONS_CONNECTION =
                "org.apache.flink.agents.integrations.chatmodels.openai.OpenAICompletionsConnection";
        public static final String OPENAI_COMPLETIONS_SETUP =
                "org.apache.flink.agents.integrations.chatmodels.openai.OpenAICompletionsSetup";

        // OpenAI Responses API
        public static final String OPENAI_RESPONSES_CONNECTION =
                "org.apache.flink.agents.integrations.chatmodels.openai.OpenAIResponsesModelConnection";
        public static final String OPENAI_RESPONSES_SETUP =
                "org.apache.flink.agents.integrations.chatmodels.openai.OpenAIResponsesModelSetup";

        // Azure OpenAI
        public static final String AZURE_OPENAI_CONNECTION =
                "org.apache.flink.agents.integrations.chatmodels.openai.AzureOpenAIChatModelConnection";
        public static final String AZURE_OPENAI_SETUP =
                "org.apache.flink.agents.integrations.chatmodels.openai.AzureOpenAIChatModelSetup";

        // Python Wrapper
        public static final String PYTHON_WRAPPER_CONNECTION =
                "org.apache.flink.agents.api.chat.model.python.PythonChatModelConnection";
        public static final String PYTHON_WRAPPER_SETUP =
                "org.apache.flink.agents.api.chat.model.python.PythonChatModelSetup";

        /** Python implementations of ChatModel. */
        public static final class Python {

            // Anthropic
            public static final String ANTHROPIC_CONNECTION =
                    "flink_agents.integrations.chat_models.anthropic.anthropic_chat_model.AnthropicChatModelConnection";
            public static final String ANTHROPIC_SETUP =
                    "flink_agents.integrations.chat_models.anthropic.anthropic_chat_model.AnthropicChatModelSetup";

            // Azure OpenAI
            public static final String AZURE_OPENAI_CONNECTION =
                    "flink_agents.integrations.chat_models.azure.azure_openai_chat_model.AzureOpenAIChatModelConnection";
            public static final String AZURE_OPENAI_SETUP =
                    "flink_agents.integrations.chat_models.azure.azure_openai_chat_model.AzureOpenAIChatModelSetup";

            // Ollama
            public static final String OLLAMA_CONNECTION =
                    "flink_agents.integrations.chat_models.ollama_chat_model.OllamaChatModelConnection";
            public static final String OLLAMA_SETUP =
                    "flink_agents.integrations.chat_models.ollama_chat_model.OllamaChatModelSetup";

            // OpenAI
            public static final String OPENAI_COMPLETIONS_CONNECTION =
                    "flink_agents.integrations.chat_models.openai.openai_chat_model.OpenAIChatModelConnection";
            public static final String OPENAI_COMPLETIONS_SETUP =
                    "flink_agents.integrations.chat_models.openai.openai_chat_model.OpenAIChatModelSetup";

            // Tongyi
            public static final String TONGYI_CONNECTION =
                    "flink_agents.integrations.chat_models.tongyi_chat_model.TongyiChatModelConnection";
            public static final String TONGYI_SETUP =
                    "flink_agents.integrations.chat_models.tongyi_chat_model.TongyiChatModelSetup";

            private Python() {}
        }

        private ChatModel() {}
    }

    // ==================== EmbeddingModel ====================
    public static final class EmbeddingModel {

        // Ollama
        public static final String OLLAMA_CONNECTION =
                "org.apache.flink.agents.integrations.embeddingmodels.ollama.OllamaEmbeddingModelConnection";
        public static final String OLLAMA_SETUP =
                "org.apache.flink.agents.integrations.embeddingmodels.ollama.OllamaEmbeddingModelSetup";

        // Bedrock
        public static final String BEDROCK_CONNECTION =
                "org.apache.flink.agents.integrations.embeddingmodels.bedrock.BedrockEmbeddingModelConnection";
        public static final String BEDROCK_SETUP =
                "org.apache.flink.agents.integrations.embeddingmodels.bedrock.BedrockEmbeddingModelSetup";

        // Python Wrapper
        public static final String PYTHON_WRAPPER_CONNECTION =
                "org.apache.flink.agents.api.embedding.model.python.PythonEmbeddingModelConnection";
        public static final String PYTHON_WRAPPER_SETUP =
                "org.apache.flink.agents.api.embedding.model.python.PythonEmbeddingModelSetup";

        /** Python implementations of EmbeddingModel. */
        public static final class Python {

            // Ollama
            public static final String OLLAMA_CONNECTION =
                    "flink_agents.integrations.embedding_models.local.ollama_embedding_model.OllamaEmbeddingModelConnection";
            public static final String OLLAMA_SETUP =
                    "flink_agents.integrations.embedding_models.local.ollama_embedding_model.OllamaEmbeddingModelSetup";

            // OpenAI
            public static final String OPENAI_CONNECTION =
                    "flink_agents.integrations.embedding_models.openai_embedding_model.OpenAIEmbeddingModelConnection";
            public static final String OPENAI_SETUP =
                    "flink_agents.integrations.embedding_models.openai_embedding_model.OpenAIEmbeddingModelSetup";

            // Tongyi
            public static final String TONGYI_CONNECTION =
                    "flink_agents.integrations.embedding_models.tongyi_embedding_model.TongyiEmbeddingModelConnection";
            public static final String TONGYI_SETUP =
                    "flink_agents.integrations.embedding_models.tongyi_embedding_model.TongyiEmbeddingModelSetup";

            private Python() {}
        }

        private EmbeddingModel() {}
    }

    // ==================== VectorStore ====================
    public static final class VectorStore {

        // Elasticsearch
        public static final String ELASTICSEARCH_VECTOR_STORE =
                "org.apache.flink.agents.integrations.vectorstores.elasticsearch.ElasticsearchVectorStore";

        // Amazon OpenSearch (Serverless or Service domains)
        public static final String OPENSEARCH_VECTOR_STORE =
                "org.apache.flink.agents.integrations.vectorstores.opensearch.OpenSearchVectorStore";

        // Amazon S3 Vectors
        public static final String S3_VECTORS_VECTOR_STORE =
                "org.apache.flink.agents.integrations.vectorstores.s3vectors.S3VectorsVectorStore";

        // Milvus
        public static final String MILVUS_VECTOR_STORE =
                "org.apache.flink.agents.integrations.vectorstores.milvus.MilvusVectorStore";

        // Python Wrapper
        public static final String PYTHON_WRAPPER_VECTOR_STORE =
                "org.apache.flink.agents.api.vectorstores.python.PythonVectorStore";

        public static final String PYTHON_WRAPPER_COLLECTION_MANAGEABLE_VECTOR_STORE =
                "org.apache.flink.agents.api.vectorstores.python.PythonCollectionManageableVectorStore";

        /** Python implementations of VectorStore. */
        public static final class Python {

            // Chroma
            public static final String CHROMA_VECTOR_STORE =
                    "flink_agents.integrations.vector_stores.chroma.chroma_vector_store.ChromaVectorStore";

            // Mem0 (gateway to Mem0's native vector stores: pgvector, milvus, qdrant, redis, ...)
            public static final String MEM0_VECTOR_STORE =
                    "flink_agents.integrations.vector_stores.mem0.mem0_vector_store.Mem0VectorStore";

            private Python() {}
        }

        private VectorStore() {}
    }

    // ==================== MCP ====================
    public static final String MCP_SERVER = "DECIDE_IN_RUNTIME_MCPServer";
}
