// WARNING: Please don't edit this file. It was generated by Python/WinRT v1.0.0-beta.2

#include "pybase.h"
#include "py.Windows.ApplicationModel.Payments.Provider.h"

PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::Payments::Provider::PaymentAppCanMakePaymentTriggerDetails>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::Payments::Provider::PaymentAppManager>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::Payments::Provider::PaymentTransaction>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::Payments::Provider::PaymentTransactionAcceptResult>::python_type;

namespace py::cpp::Windows::ApplicationModel::Payments::Provider
{
    // ----- PaymentAppCanMakePaymentTriggerDetails class --------------------
    constexpr const char* const _type_name_PaymentAppCanMakePaymentTriggerDetails = "PaymentAppCanMakePaymentTriggerDetails";

    static PyObject* _new_PaymentAppCanMakePaymentTriggerDetails(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(_type_name_PaymentAppCanMakePaymentTriggerDetails);
        return nullptr;
    }

    static void _dealloc_PaymentAppCanMakePaymentTriggerDetails(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentAppCanMakePaymentTriggerDetails* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* PaymentAppCanMakePaymentTriggerDetails_ReportCanMakePaymentResult(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentAppCanMakePaymentTriggerDetails* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::ApplicationModel::Payments::PaymentCanMakePaymentResult>(args, 0);

                self->obj.ReportCanMakePaymentResult(param0);
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PaymentAppCanMakePaymentTriggerDetails_get_Request(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentAppCanMakePaymentTriggerDetails* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Request());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_PaymentAppCanMakePaymentTriggerDetails(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::ApplicationModel::Payments::Provider::PaymentAppCanMakePaymentTriggerDetails>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PaymentAppCanMakePaymentTriggerDetails[] = {
        { "report_can_make_payment_result", reinterpret_cast<PyCFunction>(PaymentAppCanMakePaymentTriggerDetails_ReportCanMakePaymentResult), METH_VARARGS, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PaymentAppCanMakePaymentTriggerDetails), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_PaymentAppCanMakePaymentTriggerDetails[] = {
        { "request", reinterpret_cast<getter>(PaymentAppCanMakePaymentTriggerDetails_get_Request), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_PaymentAppCanMakePaymentTriggerDetails[] = 
    {
        { Py_tp_new, _new_PaymentAppCanMakePaymentTriggerDetails },
        { Py_tp_dealloc, _dealloc_PaymentAppCanMakePaymentTriggerDetails },
        { Py_tp_methods, _methods_PaymentAppCanMakePaymentTriggerDetails },
        { Py_tp_getset, _getset_PaymentAppCanMakePaymentTriggerDetails },
        { },
    };

    static PyType_Spec _type_spec_PaymentAppCanMakePaymentTriggerDetails =
    {
        "_winsdk_Windows_ApplicationModel_Payments_Provider.PaymentAppCanMakePaymentTriggerDetails",
        sizeof(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentAppCanMakePaymentTriggerDetails),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PaymentAppCanMakePaymentTriggerDetails
    };

    // ----- PaymentAppManager class --------------------
    constexpr const char* const _type_name_PaymentAppManager = "PaymentAppManager";

    static PyObject* _new_PaymentAppManager(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(_type_name_PaymentAppManager);
        return nullptr;
    }

    static void _dealloc_PaymentAppManager(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentAppManager* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* PaymentAppManager_RegisterAsync(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentAppManager* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::Foundation::Collections::IIterable<winrt::hstring>>(args, 0);

                return py::convert(self->obj.RegisterAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PaymentAppManager_UnregisterAsync(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentAppManager* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                return py::convert(self->obj.UnregisterAsync());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PaymentAppManager_get_Current(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(winrt::Windows::ApplicationModel::Payments::Provider::PaymentAppManager::Current());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_PaymentAppManager(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::ApplicationModel::Payments::Provider::PaymentAppManager>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PaymentAppManager[] = {
        { "register_async", reinterpret_cast<PyCFunction>(PaymentAppManager_RegisterAsync), METH_VARARGS, nullptr },
        { "unregister_async", reinterpret_cast<PyCFunction>(PaymentAppManager_UnregisterAsync), METH_VARARGS, nullptr },
        { "get_current", reinterpret_cast<PyCFunction>(PaymentAppManager_get_Current), METH_NOARGS | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PaymentAppManager), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_PaymentAppManager[] = {
        { }
    };

    static PyType_Slot _type_slots_PaymentAppManager[] = 
    {
        { Py_tp_new, _new_PaymentAppManager },
        { Py_tp_dealloc, _dealloc_PaymentAppManager },
        { Py_tp_methods, _methods_PaymentAppManager },
        { Py_tp_getset, _getset_PaymentAppManager },
        { },
    };

    static PyType_Spec _type_spec_PaymentAppManager =
    {
        "_winsdk_Windows_ApplicationModel_Payments_Provider.PaymentAppManager",
        sizeof(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentAppManager),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PaymentAppManager
    };

    // ----- PaymentTransaction class --------------------
    constexpr const char* const _type_name_PaymentTransaction = "PaymentTransaction";

    static PyObject* _new_PaymentTransaction(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(_type_name_PaymentTransaction);
        return nullptr;
    }

    static void _dealloc_PaymentTransaction(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentTransaction* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* PaymentTransaction_AcceptAsync(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentTransaction* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::ApplicationModel::Payments::PaymentToken>(args, 0);

                return py::convert(self->obj.AcceptAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PaymentTransaction_FromIdAsync(PyObject* /*unused*/, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::hstring>(args, 0);

                return py::convert(winrt::Windows::ApplicationModel::Payments::Provider::PaymentTransaction::FromIdAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PaymentTransaction_Reject(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentTransaction* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            try
            {
                self->obj.Reject();
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PaymentTransaction_UpdateSelectedShippingOptionAsync(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentTransaction* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::ApplicationModel::Payments::PaymentShippingOption>(args, 0);

                return py::convert(self->obj.UpdateSelectedShippingOptionAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PaymentTransaction_UpdateShippingAddressAsync(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentTransaction* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            try
            {
                auto param0 = py::convert_to<winrt::Windows::ApplicationModel::Payments::PaymentAddress>(args, 0);

                return py::convert(self->obj.UpdateShippingAddressAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PaymentTransaction_get_PayerPhoneNumber(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentTransaction* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.PayerPhoneNumber());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PaymentTransaction_put_PayerPhoneNumber(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentTransaction* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_TypeError, "property delete not supported");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<winrt::hstring>(arg);

            self->obj.PayerPhoneNumber(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* PaymentTransaction_get_PayerName(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentTransaction* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.PayerName());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PaymentTransaction_put_PayerName(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentTransaction* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_TypeError, "property delete not supported");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<winrt::hstring>(arg);

            self->obj.PayerName(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* PaymentTransaction_get_PayerEmail(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentTransaction* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.PayerEmail());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PaymentTransaction_put_PayerEmail(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentTransaction* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_TypeError, "property delete not supported");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<winrt::hstring>(arg);

            self->obj.PayerEmail(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* PaymentTransaction_get_PaymentRequest(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentTransaction* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.PaymentRequest());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_PaymentTransaction(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::ApplicationModel::Payments::Provider::PaymentTransaction>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PaymentTransaction[] = {
        { "accept_async", reinterpret_cast<PyCFunction>(PaymentTransaction_AcceptAsync), METH_VARARGS, nullptr },
        { "from_id_async", reinterpret_cast<PyCFunction>(PaymentTransaction_FromIdAsync), METH_VARARGS | METH_STATIC, nullptr },
        { "reject", reinterpret_cast<PyCFunction>(PaymentTransaction_Reject), METH_VARARGS, nullptr },
        { "update_selected_shipping_option_async", reinterpret_cast<PyCFunction>(PaymentTransaction_UpdateSelectedShippingOptionAsync), METH_VARARGS, nullptr },
        { "update_shipping_address_async", reinterpret_cast<PyCFunction>(PaymentTransaction_UpdateShippingAddressAsync), METH_VARARGS, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_PaymentTransaction), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_PaymentTransaction[] = {
        { "payer_phone_number", reinterpret_cast<getter>(PaymentTransaction_get_PayerPhoneNumber), reinterpret_cast<setter>(PaymentTransaction_put_PayerPhoneNumber), nullptr, nullptr },
        { "payer_name", reinterpret_cast<getter>(PaymentTransaction_get_PayerName), reinterpret_cast<setter>(PaymentTransaction_put_PayerName), nullptr, nullptr },
        { "payer_email", reinterpret_cast<getter>(PaymentTransaction_get_PayerEmail), reinterpret_cast<setter>(PaymentTransaction_put_PayerEmail), nullptr, nullptr },
        { "payment_request", reinterpret_cast<getter>(PaymentTransaction_get_PaymentRequest), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_PaymentTransaction[] = 
    {
        { Py_tp_new, _new_PaymentTransaction },
        { Py_tp_dealloc, _dealloc_PaymentTransaction },
        { Py_tp_methods, _methods_PaymentTransaction },
        { Py_tp_getset, _getset_PaymentTransaction },
        { },
    };

    static PyType_Spec _type_spec_PaymentTransaction =
    {
        "_winsdk_Windows_ApplicationModel_Payments_Provider.PaymentTransaction",
        sizeof(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentTransaction),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PaymentTransaction
    };

    // ----- PaymentTransactionAcceptResult class --------------------
    constexpr const char* const _type_name_PaymentTransactionAcceptResult = "PaymentTransactionAcceptResult";

    static PyObject* _new_PaymentTransactionAcceptResult(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        py::set_invalid_activation_error(_type_name_PaymentTransactionAcceptResult);
        return nullptr;
    }

    static void _dealloc_PaymentTransactionAcceptResult(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentTransactionAcceptResult* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* PaymentTransactionAcceptResult_get_Status(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentTransactionAcceptResult* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Status());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_PaymentTransactionAcceptResult(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        try
        {
            auto return_value = py::convert_to<winrt::Windows::Foundation::IInspectable>(arg);
            return py::convert(return_value.as<winrt::Windows::ApplicationModel::Payments::Provider::PaymentTransactionAcceptResult>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PaymentTransactionAcceptResult[] = {
        { "_from", reinterpret_cast<PyCFunction>(_from_PaymentTransactionAcceptResult), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_PaymentTransactionAcceptResult[] = {
        { "status", reinterpret_cast<getter>(PaymentTransactionAcceptResult_get_Status), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_PaymentTransactionAcceptResult[] = 
    {
        { Py_tp_new, _new_PaymentTransactionAcceptResult },
        { Py_tp_dealloc, _dealloc_PaymentTransactionAcceptResult },
        { Py_tp_methods, _methods_PaymentTransactionAcceptResult },
        { Py_tp_getset, _getset_PaymentTransactionAcceptResult },
        { },
    };

    static PyType_Spec _type_spec_PaymentTransactionAcceptResult =
    {
        "_winsdk_Windows_ApplicationModel_Payments_Provider.PaymentTransactionAcceptResult",
        sizeof(py::wrapper::Windows::ApplicationModel::Payments::Provider::PaymentTransactionAcceptResult),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PaymentTransactionAcceptResult
    };

    // ----- Windows.ApplicationModel.Payments.Provider Initialization --------------------
    static int module_exec(PyObject* module) noexcept
    {
        try
        {
            py::pyobj_handle bases { PyTuple_Pack(1, py::winrt_type<py::Object>::python_type) };

            py::winrt_type<winrt::Windows::ApplicationModel::Payments::Provider::PaymentAppCanMakePaymentTriggerDetails>::python_type = py::register_python_type(module, _type_name_PaymentAppCanMakePaymentTriggerDetails, &_type_spec_PaymentAppCanMakePaymentTriggerDetails, bases.get());
            py::winrt_type<winrt::Windows::ApplicationModel::Payments::Provider::PaymentAppManager>::python_type = py::register_python_type(module, _type_name_PaymentAppManager, &_type_spec_PaymentAppManager, bases.get());
            py::winrt_type<winrt::Windows::ApplicationModel::Payments::Provider::PaymentTransaction>::python_type = py::register_python_type(module, _type_name_PaymentTransaction, &_type_spec_PaymentTransaction, bases.get());
            py::winrt_type<winrt::Windows::ApplicationModel::Payments::Provider::PaymentTransactionAcceptResult>::python_type = py::register_python_type(module, _type_name_PaymentTransactionAcceptResult, &_type_spec_PaymentTransactionAcceptResult, bases.get());

            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyModuleDef_Slot module_slots[] = {{Py_mod_exec, module_exec}, {}};

    PyDoc_STRVAR(module_doc, "Windows.ApplicationModel.Payments.Provider");

    static PyModuleDef module_def
        = {PyModuleDef_HEAD_INIT,
           "_winsdk_Windows_ApplicationModel_Payments_Provider",
           module_doc,
           0,
           nullptr,
           module_slots,
           nullptr,
           nullptr,
           nullptr};
} // py::cpp::Windows::ApplicationModel::Payments::Provider

PyMODINIT_FUNC
PyInit__winsdk_Windows_ApplicationModel_Payments_Provider (void) noexcept
{
    return PyModuleDef_Init(&py::cpp::Windows::ApplicationModel::Payments::Provider::module_def);
}
