// C++/WinRT v3.0.260818.1

// SPDX-License-Identifier: MIT OR Apache-2.0
// SPDX-FileCopyrightText: Copyright (c) Microsoft Corporation
//
// Generated using .winmd files from https://github.com/microsoft/windows-rs
//

#pragma once
#ifndef WINRT_Windows_AI_Agents_Mcp_H
#define WINRT_Windows_AI_Agents_Mcp_H
#ifndef WINRT_IMPORT_MODULE

#ifndef WINRT_IMPL_BUILD_MODULE
#include "winrt/base.h"
static_assert(winrt::check_version(CPPWINRT_VERSION, "3.0.260818.1"), "Mismatched C++/WinRT headers.");
#define CPPWINRT_VERSION "3.0.260818.1"
#include "winrt/Windows.AI.Agents.h"
#include "winrt/impl/Windows.AI.Agents.2.h"
#include "winrt/impl/Windows.Foundation.2.h"
#include "winrt/impl/Windows.Foundation.Collections.2.h"
#include "winrt/impl/Windows.UI.2.h"
#include "winrt/impl/Windows.AI.Agents.Mcp.2.h"
#endif // WINRT_IMPL_BUILD_MODULE
WINRT_EXPORT namespace winrt::impl
{
    template <typename D> auto consume_Windows_AI_Agents_Mcp_IMcpHttpConnectionResult<D>::Uri() const
    {
        void* value{};
        consume_general<winrt::Windows::AI::Agents::Mcp::IMcpHttpConnectionResult, D>(static_cast<D const*>(this), &abi_t<winrt::Windows::AI::Agents::Mcp::IMcpHttpConnectionResult>::get_Uri, &value);
        return winrt::Windows::Foundation::Uri{ value, take_ownership_from_abi };
    }
    template <typename D> auto consume_Windows_AI_Agents_Mcp_IMcpHttpConnectionResult<D>::Uri(winrt::Windows::Foundation::Uri const& value) const
    {
        consume_general<winrt::Windows::AI::Agents::Mcp::IMcpHttpConnectionResult, D>(static_cast<D const*>(this), &abi_t<winrt::Windows::AI::Agents::Mcp::IMcpHttpConnectionResult>::put_Uri, *(void**)(&value));
    }
    template <typename D> auto consume_Windows_AI_Agents_Mcp_IMcpHttpConnectionResult<D>::Headers() const
    {
        void* value{};
        consume_general<winrt::Windows::AI::Agents::Mcp::IMcpHttpConnectionResult, D>(static_cast<D const*>(this), &abi_t<winrt::Windows::AI::Agents::Mcp::IMcpHttpConnectionResult>::get_Headers, &value);
        return winrt::Windows::Foundation::Collections::ValueSet{ value, take_ownership_from_abi };
    }
    template <typename D> auto consume_Windows_AI_Agents_Mcp_IMcpNamedPipeConnectionServer<D>::Connect(winrt::Windows::AI::Agents::AgentContext const& hostContext, param::hstring const& pipeName, winrt::Windows::AI::Agents::Mcp::McpNamedPipeConnectionResult const& connectionResult) const
    {
        void* result{};
        consume_general<winrt::Windows::AI::Agents::Mcp::IMcpNamedPipeConnectionServer, D>(static_cast<D const*>(this), &abi_t<winrt::Windows::AI::Agents::Mcp::IMcpNamedPipeConnectionServer>::Connect, *(void**)(&hostContext), *(void**)(&pipeName), *(void**)(&connectionResult), &result);
        return winrt::Windows::AI::Agents::Mcp::McpNamedPipeConnectionResult{ result, take_ownership_from_abi };
    }
    template <typename D> auto consume_Windows_AI_Agents_Mcp_IMcpServerRegistry<D>::GetAgentInfos() const
    {
        std::uint32_t result_impl_size{};
        void** result{};
        consume_general<winrt::Windows::AI::Agents::Mcp::IMcpServerRegistry, D>(static_cast<D const*>(this), &abi_t<winrt::Windows::AI::Agents::Mcp::IMcpServerRegistry>::GetAgentInfos, &result_impl_size, &result);
        return com_array<winrt::Windows::AI::Agents::AgentInfo>{ result, result_impl_size, take_ownership_from_abi };
    }
    template <typename D> auto consume_Windows_AI_Agents_Mcp_IMcpServerRegistry<D>::GetMcpConnectionInfo(winrt::guid const& agentId, winrt::Windows::UI::WindowId const& ownerWindowId) const
    {
        void* result{};
        consume_general<winrt::Windows::AI::Agents::Mcp::IMcpServerRegistry, D>(static_cast<D const*>(this), &abi_t<winrt::Windows::AI::Agents::Mcp::IMcpServerRegistry>::GetMcpConnectionInfo, impl::bind_in(agentId), impl::bind_in(ownerWindowId), &result);
        return winrt::Windows::AI::Agents::Mcp::McpStdioConnectionInfo{ result, take_ownership_from_abi };
    }
    template <typename D> auto consume_Windows_AI_Agents_Mcp_IMcpServerRegistryStatics<D>::GetDefault() const
    {
        void* result{};
        consume_general<winrt::Windows::AI::Agents::Mcp::IMcpServerRegistryStatics, D>(static_cast<D const*>(this), &abi_t<winrt::Windows::AI::Agents::Mcp::IMcpServerRegistryStatics>::GetDefault, &result);
        return winrt::Windows::AI::Agents::Mcp::McpServerRegistry{ result, take_ownership_from_abi };
    }
    template <typename D> auto consume_Windows_AI_Agents_Mcp_IMcpSseConnectionServer<D>::Connect(winrt::Windows::AI::Agents::AgentContext const& hostContext, winrt::Windows::AI::Agents::Mcp::McpHttpConnectionResult const& connectionResult) const
    {
        void* result{};
        consume_general<winrt::Windows::AI::Agents::Mcp::IMcpSseConnectionServer, D>(static_cast<D const*>(this), &abi_t<winrt::Windows::AI::Agents::Mcp::IMcpSseConnectionServer>::Connect, *(void**)(&hostContext), *(void**)(&connectionResult), &result);
        return winrt::Windows::AI::Agents::Mcp::McpHttpConnectionResult{ result, take_ownership_from_abi };
    }
    template <typename D> auto consume_Windows_AI_Agents_Mcp_IMcpStdioConnectionInfo<D>::Command() const
    {
        void* value{};
        consume_general<winrt::Windows::AI::Agents::Mcp::IMcpStdioConnectionInfo, D>(static_cast<D const*>(this), &abi_t<winrt::Windows::AI::Agents::Mcp::IMcpStdioConnectionInfo>::get_Command, &value);
        return hstring{ value, take_ownership_from_abi };
    }
    template <typename D> auto consume_Windows_AI_Agents_Mcp_IMcpStdioConnectionInfo<D>::GetCommandArguments() const
    {
        std::uint32_t result_impl_size{};
        void** result{};
        consume_general<winrt::Windows::AI::Agents::Mcp::IMcpStdioConnectionInfo, D>(static_cast<D const*>(this), &abi_t<winrt::Windows::AI::Agents::Mcp::IMcpStdioConnectionInfo>::GetCommandArguments, &result_impl_size, &result);
        return com_array<hstring>{ result, result_impl_size, take_ownership_from_abi };
    }
    template <typename D> auto consume_Windows_AI_Agents_Mcp_IMcpStdioConnectionInfo<D>::Info() const
    {
        void* value{};
        consume_general<winrt::Windows::AI::Agents::Mcp::IMcpStdioConnectionInfo, D>(static_cast<D const*>(this), &abi_t<winrt::Windows::AI::Agents::Mcp::IMcpStdioConnectionInfo>::get_Info, &value);
        return winrt::Windows::AI::Agents::AgentInfo{ value, take_ownership_from_abi };
    }
#ifndef WINRT_LEAN_AND_MEAN
    template <typename D>
    struct produce<D, winrt::Windows::AI::Agents::Mcp::IMcpHttpConnectionResult> : produce_base<D, winrt::Windows::AI::Agents::Mcp::IMcpHttpConnectionResult>
    {
        std::int32_t __stdcall get_Uri(void** value) noexcept final try
        {
            clear_abi(value);
            typename D::abi_guard guard(this->shim());
            *value = detach_from<winrt::Windows::Foundation::Uri>(this->shim().Uri());
            return 0;
        }
        catch (...) { return to_hresult(); }
        std::int32_t __stdcall put_Uri(void* value) noexcept final try
        {
            typename D::abi_guard guard(this->shim());
            this->shim().Uri(*reinterpret_cast<winrt::Windows::Foundation::Uri const*>(&value));
            return 0;
        }
        catch (...) { return to_hresult(); }
        std::int32_t __stdcall get_Headers(void** value) noexcept final try
        {
            clear_abi(value);
            typename D::abi_guard guard(this->shim());
            *value = detach_from<winrt::Windows::Foundation::Collections::ValueSet>(this->shim().Headers());
            return 0;
        }
        catch (...) { return to_hresult(); }
    };
#endif // WINRT_LEAN_AND_MEAN
#ifndef WINRT_LEAN_AND_MEAN
    template <typename D>
    struct produce<D, winrt::Windows::AI::Agents::Mcp::IMcpNamedPipeConnectionResult> : produce_base<D, winrt::Windows::AI::Agents::Mcp::IMcpNamedPipeConnectionResult>
    {
    };
#endif // WINRT_LEAN_AND_MEAN
    template <typename D>
    struct produce<D, winrt::Windows::AI::Agents::Mcp::IMcpNamedPipeConnectionServer> : produce_base<D, winrt::Windows::AI::Agents::Mcp::IMcpNamedPipeConnectionServer>
    {
        std::int32_t __stdcall Connect(void* hostContext, void* pipeName, void* connectionResult, void** result) noexcept final try
        {
            clear_abi(result);
            typename D::abi_guard guard(this->shim());
            *result = detach_from<winrt::Windows::AI::Agents::Mcp::McpNamedPipeConnectionResult>(this->shim().Connect(*reinterpret_cast<winrt::Windows::AI::Agents::AgentContext const*>(&hostContext), *reinterpret_cast<hstring const*>(&pipeName), *reinterpret_cast<winrt::Windows::AI::Agents::Mcp::McpNamedPipeConnectionResult const*>(&connectionResult)));
            return 0;
        }
        catch (...) { return to_hresult(); }
    };
#ifndef WINRT_LEAN_AND_MEAN
    template <typename D>
    struct produce<D, winrt::Windows::AI::Agents::Mcp::IMcpServerRegistry> : produce_base<D, winrt::Windows::AI::Agents::Mcp::IMcpServerRegistry>
    {
        std::int32_t __stdcall GetAgentInfos(std::uint32_t* __resultSize, void*** result) noexcept final try
        {
            clear_abi(result);
            typename D::abi_guard guard(this->shim());
            std::tie(*__resultSize, *result) = detach_abi(this->shim().GetAgentInfos());
            return 0;
        }
        catch (...) { return to_hresult(); }
        std::int32_t __stdcall GetMcpConnectionInfo(winrt::guid agentId, struct struct_Windows_UI_WindowId ownerWindowId, void** result) noexcept final try
        {
            clear_abi(result);
            typename D::abi_guard guard(this->shim());
            *result = detach_from<winrt::Windows::AI::Agents::Mcp::McpStdioConnectionInfo>(this->shim().GetMcpConnectionInfo(*reinterpret_cast<winrt::guid const*>(&agentId), *reinterpret_cast<winrt::Windows::UI::WindowId const*>(&ownerWindowId)));
            return 0;
        }
        catch (...) { return to_hresult(); }
    };
#endif // WINRT_LEAN_AND_MEAN
#ifndef WINRT_LEAN_AND_MEAN
    template <typename D>
    struct produce<D, winrt::Windows::AI::Agents::Mcp::IMcpServerRegistryStatics> : produce_base<D, winrt::Windows::AI::Agents::Mcp::IMcpServerRegistryStatics>
    {
        std::int32_t __stdcall GetDefault(void** result) noexcept final try
        {
            clear_abi(result);
            typename D::abi_guard guard(this->shim());
            *result = detach_from<winrt::Windows::AI::Agents::Mcp::McpServerRegistry>(this->shim().GetDefault());
            return 0;
        }
        catch (...) { return to_hresult(); }
    };
#endif // WINRT_LEAN_AND_MEAN
    template <typename D>
    struct produce<D, winrt::Windows::AI::Agents::Mcp::IMcpSseConnectionServer> : produce_base<D, winrt::Windows::AI::Agents::Mcp::IMcpSseConnectionServer>
    {
        std::int32_t __stdcall Connect(void* hostContext, void* connectionResult, void** result) noexcept final try
        {
            clear_abi(result);
            typename D::abi_guard guard(this->shim());
            *result = detach_from<winrt::Windows::AI::Agents::Mcp::McpHttpConnectionResult>(this->shim().Connect(*reinterpret_cast<winrt::Windows::AI::Agents::AgentContext const*>(&hostContext), *reinterpret_cast<winrt::Windows::AI::Agents::Mcp::McpHttpConnectionResult const*>(&connectionResult)));
            return 0;
        }
        catch (...) { return to_hresult(); }
    };
#ifndef WINRT_LEAN_AND_MEAN
    template <typename D>
    struct produce<D, winrt::Windows::AI::Agents::Mcp::IMcpStdioConnectionInfo> : produce_base<D, winrt::Windows::AI::Agents::Mcp::IMcpStdioConnectionInfo>
    {
        std::int32_t __stdcall get_Command(void** value) noexcept final try
        {
            clear_abi(value);
            typename D::abi_guard guard(this->shim());
            *value = detach_from<hstring>(this->shim().Command());
            return 0;
        }
        catch (...) { return to_hresult(); }
        std::int32_t __stdcall GetCommandArguments(std::uint32_t* __resultSize, void*** result) noexcept final try
        {
            clear_abi(result);
            typename D::abi_guard guard(this->shim());
            std::tie(*__resultSize, *result) = detach_abi(this->shim().GetCommandArguments());
            return 0;
        }
        catch (...) { return to_hresult(); }
        std::int32_t __stdcall get_Info(void** value) noexcept final try
        {
            clear_abi(value);
            typename D::abi_guard guard(this->shim());
            *value = detach_from<winrt::Windows::AI::Agents::AgentInfo>(this->shim().Info());
            return 0;
        }
        catch (...) { return to_hresult(); }
    };
#endif // WINRT_LEAN_AND_MEAN
}
WINRT_EXPORT namespace winrt::Windows::AI::Agents::Mcp
{
    inline auto McpServerRegistry::GetDefault()
    {
        return impl::call_factory_cast<winrt::Windows::AI::Agents::Mcp::McpServerRegistry(*)(IMcpServerRegistryStatics const&), McpServerRegistry, IMcpServerRegistryStatics>([](IMcpServerRegistryStatics const& f) { return f.GetDefault(); });
    }
}
namespace std
{
#ifndef WINRT_LEAN_AND_MEAN
    template<> struct hash<winrt::Windows::AI::Agents::Mcp::IMcpHttpConnectionResult> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Windows::AI::Agents::Mcp::IMcpNamedPipeConnectionResult> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Windows::AI::Agents::Mcp::IMcpNamedPipeConnectionServer> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Windows::AI::Agents::Mcp::IMcpServerRegistry> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Windows::AI::Agents::Mcp::IMcpServerRegistryStatics> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Windows::AI::Agents::Mcp::IMcpSseConnectionServer> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Windows::AI::Agents::Mcp::IMcpStdioConnectionInfo> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Windows::AI::Agents::Mcp::McpHttpConnectionResult> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Windows::AI::Agents::Mcp::McpNamedPipeConnectionResult> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Windows::AI::Agents::Mcp::McpServerRegistry> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Windows::AI::Agents::Mcp::McpStdioConnectionInfo> : winrt::impl::hash_base {};
#endif // WINRT_LEAN_AND_MEAN
#ifdef __cpp_lib_format
#endif // __cpp_lib_format
}
#endif
#endif // WINRT_IMPORT_MODULE
