/**
 * Code generation definitions for supported languages/libraries
 * Based on HTTPSnippet supported targets
 */ export const CodegenDefinitions = [
    // Shell
    {
        name: 'shell-curl',
        lang: 'shell',
        client: 'curl',
        caption: 'cURL',
        category: 'Shell'
    },
    {
        name: 'shell-httpie',
        lang: 'shell',
        client: 'httpie',
        caption: 'HTTPie',
        category: 'Shell'
    },
    {
        name: 'shell-wget',
        lang: 'shell',
        client: 'wget',
        caption: 'Wget',
        category: 'Shell'
    },
    // JavaScript
    {
        name: 'javascript-fetch',
        lang: 'javascript',
        client: 'fetch',
        caption: 'Fetch',
        category: 'JavaScript'
    },
    {
        name: 'javascript-axios',
        lang: 'javascript',
        client: 'axios',
        caption: 'Axios',
        category: 'JavaScript'
    },
    {
        name: 'javascript-jquery',
        lang: 'javascript',
        client: 'jquery',
        caption: 'jQuery',
        category: 'JavaScript'
    },
    {
        name: 'javascript-xhr',
        lang: 'javascript',
        client: 'xhr',
        caption: 'XMLHttpRequest',
        category: 'JavaScript'
    },
    // Node.js
    {
        name: 'node-fetch',
        lang: 'node',
        client: 'fetch',
        caption: 'Node Fetch',
        category: 'Node.js'
    },
    {
        name: 'node-axios',
        lang: 'node',
        client: 'axios',
        caption: 'Axios',
        category: 'Node.js'
    },
    {
        name: 'node-native',
        lang: 'node',
        client: 'native',
        caption: 'HTTP',
        category: 'Node.js'
    },
    // Python
    {
        name: 'python-requests',
        lang: 'python',
        client: 'requests',
        caption: 'Requests',
        category: 'Python'
    },
    {
        name: 'python-python3',
        lang: 'python',
        client: 'python3',
        caption: 'http.client',
        category: 'Python'
    },
    // Go
    {
        name: 'go-native',
        lang: 'go',
        client: 'native',
        caption: 'Native',
        category: 'Go'
    },
    // Java
    {
        name: 'java-okhttp',
        lang: 'java',
        client: 'okhttp',
        caption: 'OkHttp',
        category: 'Java'
    },
    {
        name: 'java-unirest',
        lang: 'java',
        client: 'unirest',
        caption: 'Unirest',
        category: 'Java'
    },
    // C#
    {
        name: 'csharp-httpclient',
        lang: 'csharp',
        client: 'httpclient',
        caption: 'HttpClient',
        category: 'C#'
    },
    {
        name: 'csharp-restsharp',
        lang: 'csharp',
        client: 'restsharp',
        caption: 'RestSharp',
        category: 'C#'
    },
    // Ruby
    {
        name: 'ruby-native',
        lang: 'ruby',
        client: 'native',
        caption: 'Net::HTTP',
        category: 'Ruby'
    },
    // PHP
    {
        name: 'php-curl',
        lang: 'php',
        client: 'curl',
        caption: 'cURL',
        category: 'PHP'
    },
    {
        name: 'php-guzzle',
        lang: 'php',
        client: 'guzzle',
        caption: 'Guzzle',
        category: 'PHP'
    },
    // Swift
    {
        name: 'swift-nsurlsession',
        lang: 'swift',
        client: 'nsurlsession',
        caption: 'URLSession',
        category: 'Swift'
    },
    // Kotlin
    {
        name: 'kotlin-okhttp',
        lang: 'kotlin',
        client: 'okhttp',
        caption: 'OkHttp',
        category: 'Kotlin'
    },
    // Rust
    {
        name: 'rust-reqwest',
        lang: 'rust',
        client: 'reqwest',
        caption: 'Reqwest',
        category: 'Rust'
    },
    // C
    {
        name: 'c-libcurl',
        lang: 'c',
        client: 'libcurl',
        caption: 'libcurl',
        category: 'C'
    },
    // PowerShell
    {
        name: 'powershell-webrequest',
        lang: 'powershell',
        client: 'webrequest',
        caption: 'Invoke-WebRequest',
        category: 'PowerShell'
    },
    {
        name: 'powershell-restmethod',
        lang: 'powershell',
        client: 'restmethod',
        caption: 'Invoke-RestMethod',
        category: 'PowerShell'
    },
    // Clojure
    {
        name: 'clojure-clj_http',
        lang: 'clojure',
        client: 'clj_http',
        caption: 'clj-http',
        category: 'Clojure'
    },
    // Objective-C
    {
        name: 'objc-nsurlsession',
        lang: 'objc',
        client: 'nsurlsession',
        caption: 'NSURLSession',
        category: 'Objective-C'
    },
    // OCaml
    {
        name: 'ocaml-cohttp',
        lang: 'ocaml',
        client: 'cohttp',
        caption: 'CoHTTP',
        category: 'OCaml'
    },
    // R
    {
        name: 'r-httr',
        lang: 'r',
        client: 'httr',
        caption: 'httr',
        category: 'R'
    },
    // HTTP
    {
        name: 'http-http1.1',
        lang: 'http',
        client: 'http1.1',
        caption: 'HTTP 1.1',
        category: 'Raw'
    }
];
/**
 * Get codegen definitions grouped by category
 */ export function getCodegenByCategory() {
    const grouped = {};
    for (const def of CodegenDefinitions){
        if (!grouped[def.category]) {
            grouped[def.category] = [];
        }
        grouped[def.category].push(def);
    }
    return grouped;
}
/**
 * Find a codegen definition by name
 */ export function findCodegenByName(name) {
    return CodegenDefinitions.find((def)=>def.name === name);
}
