// WARNING: Please don't edit this file. It was generated by Python/WinRT v3.2.1

#pragma once

#include "pybase.h"
static_assert(winrt::check_version(PYWINRT_VERSION, "3.2.1"), "Mismatched Py/WinRT headers.");
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>

#include <winrt/Windows.ApplicationModel.Payments.h>

namespace py::proj::Windows::ApplicationModel::Payments
{
}

namespace py
{
    template<>
    inline constexpr const char* buffer_format<winrt::Windows::ApplicationModel::Payments::PaymentCanMakePaymentResultStatus> = "i";

    template<>
    inline constexpr const char* buffer_format<winrt::Windows::ApplicationModel::Payments::PaymentOptionPresence> = "i";

    template<>
    inline constexpr const char* buffer_format<winrt::Windows::ApplicationModel::Payments::PaymentRequestChangeKind> = "i";

    template<>
    inline constexpr const char* buffer_format<winrt::Windows::ApplicationModel::Payments::PaymentRequestCompletionStatus> = "i";

    template<>
    inline constexpr const char* buffer_format<winrt::Windows::ApplicationModel::Payments::PaymentRequestStatus> = "i";

    template<>
    inline constexpr const char* buffer_format<winrt::Windows::ApplicationModel::Payments::PaymentShippingType> = "i";


    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentCanMakePaymentResultStatus>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentCanMakePaymentResultStatus";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentCanMakePaymentResultStatus";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentOptionPresence>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentOptionPresence";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentOptionPresence";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentRequestChangeKind>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentRequestChangeKind";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentRequestChangeKind";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentRequestCompletionStatus>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentRequestCompletionStatus";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentRequestCompletionStatus";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentRequestStatus>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentRequestStatus";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentRequestStatus";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentShippingType>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentShippingType";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentShippingType";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentAddress>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentAddress";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentAddress";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentCanMakePaymentResult>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentCanMakePaymentResult";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentCanMakePaymentResult";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentCurrencyAmount>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentCurrencyAmount";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentCurrencyAmount";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentDetails>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentDetails";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentDetails";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentDetailsModifier>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentDetailsModifier";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentDetailsModifier";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentItem>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentItem";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentItem";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentMediator>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentMediator";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentMediator";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentMerchantInfo>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentMerchantInfo";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentMerchantInfo";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentMethodData>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentMethodData";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentMethodData";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentOptions>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentOptions";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentOptions";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentRequest>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentRequest";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentRequest";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentRequestChangedArgs>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentRequestChangedArgs";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentRequestChangedArgs";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentRequestChangedResult>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentRequestChangedResult";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentRequestChangedResult";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentRequestSubmitResult>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentRequestSubmitResult";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentRequestSubmitResult";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentResponse>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentResponse";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentResponse";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentShippingOption>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentShippingOption";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentShippingOption";
    };

    template<>
    struct py_type<winrt::Windows::ApplicationModel::Payments::PaymentToken>
    {
        static constexpr std::string_view qualified_name = "winrt.windows.applicationmodel.payments.PaymentToken";
        static constexpr const char* module_name = "winrt.windows.applicationmodel.payments";
        static constexpr const char* type_name = "PaymentToken";
    };
}

#if __has_include("py.Windows.Foundation.h")
#include "py.Windows.Foundation.h"
#endif

#if __has_include("py.Windows.Foundation.Collections.h")
#include "py.Windows.Foundation.Collections.h"
#endif

namespace py::impl::Windows::ApplicationModel::Payments
{
    struct PaymentRequestChangedHandler
    {
        static winrt::Windows::ApplicationModel::Payments::PaymentRequestChangedHandler get(PyObject* callable)
        {
            py::delegate_callable _delegate{ callable };

            return [delegate = std::move(_delegate)](winrt::Windows::ApplicationModel::Payments::PaymentRequest const& param0, winrt::Windows::ApplicationModel::Payments::PaymentRequestChangedArgs const& param1)
            {
                auto gil = py::ensure_gil();

                try
                {
                    py::pyobj_handle py_param0{py::convert(param0)};
                    if (!py_param0)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle py_param1{py::convert(param1)};
                    if (!py_param1)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle args{PyTuple_Pack(2, py_param0.get(), py_param1.get())};
                    if (!args)
                    {
                        throw python_exception();
                    }

                    py::pyobj_handle return_value{PyObject_CallObject(delegate.callable(), args.get())};
                    if (!return_value)
                    {
                        throw python_exception();
                    }
                }
                catch (python_exception)
                {
                    py::write_unraisable_and_throw();
                }
            };
        };
    };
}

namespace py::wrapper::Windows::ApplicationModel::Payments
{
    using PaymentAddress = py::winrt_wrapper<winrt::Windows::ApplicationModel::Payments::PaymentAddress>;
    using PaymentCanMakePaymentResult = py::winrt_wrapper<winrt::Windows::ApplicationModel::Payments::PaymentCanMakePaymentResult>;
    using PaymentCurrencyAmount = py::winrt_wrapper<winrt::Windows::ApplicationModel::Payments::PaymentCurrencyAmount>;
    using PaymentDetails = py::winrt_wrapper<winrt::Windows::ApplicationModel::Payments::PaymentDetails>;
    using PaymentDetailsModifier = py::winrt_wrapper<winrt::Windows::ApplicationModel::Payments::PaymentDetailsModifier>;
    using PaymentItem = py::winrt_wrapper<winrt::Windows::ApplicationModel::Payments::PaymentItem>;
    using PaymentMediator = py::winrt_wrapper<winrt::Windows::ApplicationModel::Payments::PaymentMediator>;
    using PaymentMerchantInfo = py::winrt_wrapper<winrt::Windows::ApplicationModel::Payments::PaymentMerchantInfo>;
    using PaymentMethodData = py::winrt_wrapper<winrt::Windows::ApplicationModel::Payments::PaymentMethodData>;
    using PaymentOptions = py::winrt_wrapper<winrt::Windows::ApplicationModel::Payments::PaymentOptions>;
    using PaymentRequest = py::winrt_wrapper<winrt::Windows::ApplicationModel::Payments::PaymentRequest>;
    using PaymentRequestChangedArgs = py::winrt_wrapper<winrt::Windows::ApplicationModel::Payments::PaymentRequestChangedArgs>;
    using PaymentRequestChangedResult = py::winrt_wrapper<winrt::Windows::ApplicationModel::Payments::PaymentRequestChangedResult>;
    using PaymentRequestSubmitResult = py::winrt_wrapper<winrt::Windows::ApplicationModel::Payments::PaymentRequestSubmitResult>;
    using PaymentResponse = py::winrt_wrapper<winrt::Windows::ApplicationModel::Payments::PaymentResponse>;
    using PaymentShippingOption = py::winrt_wrapper<winrt::Windows::ApplicationModel::Payments::PaymentShippingOption>;
    using PaymentToken = py::winrt_wrapper<winrt::Windows::ApplicationModel::Payments::PaymentToken>;
}

namespace py
{
    template <>
    struct delegate_python_type<winrt::Windows::ApplicationModel::Payments::PaymentRequestChangedHandler>
    {
        using type = py::impl::Windows::ApplicationModel::Payments::PaymentRequestChangedHandler;
    };

}
