# 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.

# NOTE! THIS FILE IS AUTOMATICALLY GENERATED AND WILL BE OVERWRITTEN!
#
# IF YOU WANT TO MODIFY THIS FILE, YOU SHOULD MODIFY THE TEMPLATE
# `get_provider_info_TEMPLATE.py.jinja2` IN the `dev/breeze/src/airflow_breeze/templates` DIRECTORY


def get_provider_info():
    return {
        "package-name": "apache-airflow-providers-ydb",
        "name": "YDB",
        "description": "`YDB <https://ydb.tech/>`__\n",
        "integrations": [
            {
                "integration-name": "YDB",
                "external-doc-url": "https://ydb.tech/docs/en/",
                "how-to-guide": ["/docs/apache-airflow-providers-ydb/operators/ydb_operator_howto_guide.rst"],
                "logo": "/docs/integration-logos/ydb.png",
                "tags": ["software"],
            }
        ],
        "operators": [{"integration-name": "YDB", "python-modules": ["airflow.providers.ydb.operators.ydb"]}],
        "hooks": [{"integration-name": "YDB", "python-modules": ["airflow.providers.ydb.hooks.ydb"]}],
        "connection-types": [
            {
                "hook-class-name": "airflow.providers.ydb.hooks.ydb.YDBHook",
                "hook-name": "YDB",
                "connection-type": "ydb",
                "ui-field-behaviour": {
                    "hidden-fields": ["schema", "extra"],
                    "placeholders": {
                        "host": "eg. grpcs://my_host or ydb.serverless.yandexcloud.net or lb.etn9txxxx.ydb.mdb.yandexcloud.net",
                        "login": "root",
                        "password": "my_password",
                        "database": "e.g. /local or /ru-central1/b1gtl2kg13him37quoo6/etndqstq7ne4v68n6c9b",
                        "service_account_json": 'e.g. {"id": "...", "service_account_id": "...", "private_key": "..."}',
                        "token": "t1.9....AAQ",
                    },
                },
                "conn-fields": {
                    "database": {
                        "label": "Database name",
                        "schema": {"type": ["string", "null"]},
                        "description": "Required. YDB database name",
                    },
                    "service_account_json": {
                        "label": "Service account auth JSON",
                        "schema": {"type": ["string", "null"], "format": "password"},
                        "description": 'Service account auth JSON. Looks like {"id": "...", "service_account_id": "...", "private_key": "..."}. Will be used instead of IAM token and SA JSON file path field if specified.',
                    },
                    "service_account_json_path": {
                        "label": "Service account auth JSON file path",
                        "schema": {"type": ["string", "null"]},
                        "description": 'Service account auth JSON file path. File content looks like {"id": "...", "service_account_id": "...", "private_key": "..."}.',
                    },
                    "token": {
                        "label": "IAM token",
                        "schema": {"type": ["string", "null"], "format": "password"},
                        "description": "User account IAM token.",
                    },
                    "use_vm_metadata": {
                        "label": "Use VM metadata",
                        "schema": {"type": ["boolean", "null"], "default": False},
                        "description": "Optional. Whether to use VM metadata to retrieve IAM token",
                    },
                },
            }
        ],
    }
