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

#include "pybase.h"
#include "py.Windows.Services.Maps.OfflineMaps.h"

PyTypeObject* py::winrt_type<winrt::Windows::Services::Maps::OfflineMaps::OfflineMapPackage>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Services::Maps::OfflineMaps::OfflineMapPackageQueryResult>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::Services::Maps::OfflineMaps::OfflineMapPackageStartDownloadResult>::python_type;

namespace py::cpp::Windows::Services::Maps::OfflineMaps
{
    // ----- OfflineMapPackage class --------------------
    constexpr const char* const _type_name_OfflineMapPackage = "OfflineMapPackage";

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

    static void _dealloc_OfflineMapPackage(py::wrapper::Windows::Services::Maps::OfflineMaps::OfflineMapPackage* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

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

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

                return py::convert(winrt::Windows::Services::Maps::OfflineMaps::OfflineMapPackage::FindPackagesAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

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

                return py::convert(winrt::Windows::Services::Maps::OfflineMaps::OfflineMapPackage::FindPackagesInBoundingBoxAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

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

                return py::convert(winrt::Windows::Services::Maps::OfflineMaps::OfflineMapPackage::FindPackagesInGeocircleAsync(param0));
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* OfflineMapPackage_RequestStartDownloadAsync(py::wrapper::Windows::Services::Maps::OfflineMaps::OfflineMapPackage* self, PyObject* args) noexcept
    {
        Py_ssize_t arg_count = PyTuple_Size(args);

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

    static PyObject* OfflineMapPackage_get_DisplayName(py::wrapper::Windows::Services::Maps::OfflineMaps::OfflineMapPackage* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.DisplayName());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* OfflineMapPackage_get_EnclosingRegionName(py::wrapper::Windows::Services::Maps::OfflineMaps::OfflineMapPackage* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.EnclosingRegionName());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* OfflineMapPackage_get_EstimatedSizeInBytes(py::wrapper::Windows::Services::Maps::OfflineMaps::OfflineMapPackage* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.EstimatedSizeInBytes());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* OfflineMapPackage_get_Status(py::wrapper::Windows::Services::Maps::OfflineMaps::OfflineMapPackage* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Status());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* OfflineMapPackage_add_StatusChanged(py::wrapper::Windows::Services::Maps::OfflineMaps::OfflineMapPackage* self, PyObject* arg) noexcept
    {
        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Services::Maps::OfflineMaps::OfflineMapPackage, winrt::Windows::Foundation::IInspectable>>(arg);

            return py::convert(self->obj.StatusChanged(param0));
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* OfflineMapPackage_remove_StatusChanged(py::wrapper::Windows::Services::Maps::OfflineMaps::OfflineMapPackage* self, PyObject* arg) noexcept
    {
        try
        {
            auto param0 = py::convert_to<winrt::event_token>(arg);

            self->obj.StatusChanged(param0);
            Py_RETURN_NONE;
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_OfflineMapPackage(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::Services::Maps::OfflineMaps::OfflineMapPackage>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_OfflineMapPackage[] = {
        { "find_packages_async", reinterpret_cast<PyCFunction>(OfflineMapPackage_FindPackagesAsync), METH_VARARGS | METH_STATIC, nullptr },
        { "find_packages_in_bounding_box_async", reinterpret_cast<PyCFunction>(OfflineMapPackage_FindPackagesInBoundingBoxAsync), METH_VARARGS | METH_STATIC, nullptr },
        { "find_packages_in_geocircle_async", reinterpret_cast<PyCFunction>(OfflineMapPackage_FindPackagesInGeocircleAsync), METH_VARARGS | METH_STATIC, nullptr },
        { "request_start_download_async", reinterpret_cast<PyCFunction>(OfflineMapPackage_RequestStartDownloadAsync), METH_VARARGS, nullptr },
        { "add_status_changed", reinterpret_cast<PyCFunction>(OfflineMapPackage_add_StatusChanged), METH_O, nullptr },
        { "remove_status_changed", reinterpret_cast<PyCFunction>(OfflineMapPackage_remove_StatusChanged), METH_O, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_OfflineMapPackage), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_OfflineMapPackage[] = {
        { "display_name", reinterpret_cast<getter>(OfflineMapPackage_get_DisplayName), nullptr, nullptr, nullptr },
        { "enclosing_region_name", reinterpret_cast<getter>(OfflineMapPackage_get_EnclosingRegionName), nullptr, nullptr, nullptr },
        { "estimated_size_in_bytes", reinterpret_cast<getter>(OfflineMapPackage_get_EstimatedSizeInBytes), nullptr, nullptr, nullptr },
        { "status", reinterpret_cast<getter>(OfflineMapPackage_get_Status), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_OfflineMapPackage[] = 
    {
        { Py_tp_new, _new_OfflineMapPackage },
        { Py_tp_dealloc, _dealloc_OfflineMapPackage },
        { Py_tp_methods, _methods_OfflineMapPackage },
        { Py_tp_getset, _getset_OfflineMapPackage },
        { },
    };

    static PyType_Spec _type_spec_OfflineMapPackage =
    {
        "_winsdk_Windows_Services_Maps_OfflineMaps.OfflineMapPackage",
        sizeof(py::wrapper::Windows::Services::Maps::OfflineMaps::OfflineMapPackage),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_OfflineMapPackage
    };

    // ----- OfflineMapPackageQueryResult class --------------------
    constexpr const char* const _type_name_OfflineMapPackageQueryResult = "OfflineMapPackageQueryResult";

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

    static void _dealloc_OfflineMapPackageQueryResult(py::wrapper::Windows::Services::Maps::OfflineMaps::OfflineMapPackageQueryResult* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* OfflineMapPackageQueryResult_get_Packages(py::wrapper::Windows::Services::Maps::OfflineMaps::OfflineMapPackageQueryResult* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Packages());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* OfflineMapPackageQueryResult_get_Status(py::wrapper::Windows::Services::Maps::OfflineMaps::OfflineMapPackageQueryResult* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Status());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_OfflineMapPackageQueryResult(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::Services::Maps::OfflineMaps::OfflineMapPackageQueryResult>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyGetSetDef _getset_OfflineMapPackageQueryResult[] = {
        { "packages", reinterpret_cast<getter>(OfflineMapPackageQueryResult_get_Packages), nullptr, nullptr, nullptr },
        { "status", reinterpret_cast<getter>(OfflineMapPackageQueryResult_get_Status), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_OfflineMapPackageQueryResult[] = 
    {
        { Py_tp_new, _new_OfflineMapPackageQueryResult },
        { Py_tp_dealloc, _dealloc_OfflineMapPackageQueryResult },
        { Py_tp_methods, _methods_OfflineMapPackageQueryResult },
        { Py_tp_getset, _getset_OfflineMapPackageQueryResult },
        { },
    };

    static PyType_Spec _type_spec_OfflineMapPackageQueryResult =
    {
        "_winsdk_Windows_Services_Maps_OfflineMaps.OfflineMapPackageQueryResult",
        sizeof(py::wrapper::Windows::Services::Maps::OfflineMaps::OfflineMapPackageQueryResult),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_OfflineMapPackageQueryResult
    };

    // ----- OfflineMapPackageStartDownloadResult class --------------------
    constexpr const char* const _type_name_OfflineMapPackageStartDownloadResult = "OfflineMapPackageStartDownloadResult";

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

    static void _dealloc_OfflineMapPackageStartDownloadResult(py::wrapper::Windows::Services::Maps::OfflineMaps::OfflineMapPackageStartDownloadResult* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* OfflineMapPackageStartDownloadResult_get_Status(py::wrapper::Windows::Services::Maps::OfflineMaps::OfflineMapPackageStartDownloadResult* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Status());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* _from_OfflineMapPackageStartDownloadResult(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::Services::Maps::OfflineMaps::OfflineMapPackageStartDownloadResult>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

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

    static PyType_Slot _type_slots_OfflineMapPackageStartDownloadResult[] = 
    {
        { Py_tp_new, _new_OfflineMapPackageStartDownloadResult },
        { Py_tp_dealloc, _dealloc_OfflineMapPackageStartDownloadResult },
        { Py_tp_methods, _methods_OfflineMapPackageStartDownloadResult },
        { Py_tp_getset, _getset_OfflineMapPackageStartDownloadResult },
        { },
    };

    static PyType_Spec _type_spec_OfflineMapPackageStartDownloadResult =
    {
        "_winsdk_Windows_Services_Maps_OfflineMaps.OfflineMapPackageStartDownloadResult",
        sizeof(py::wrapper::Windows::Services::Maps::OfflineMaps::OfflineMapPackageStartDownloadResult),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_OfflineMapPackageStartDownloadResult
    };

    // ----- Windows.Services.Maps.OfflineMaps 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::Services::Maps::OfflineMaps::OfflineMapPackage>::python_type = py::register_python_type(module, _type_name_OfflineMapPackage, &_type_spec_OfflineMapPackage, bases.get());
            py::winrt_type<winrt::Windows::Services::Maps::OfflineMaps::OfflineMapPackageQueryResult>::python_type = py::register_python_type(module, _type_name_OfflineMapPackageQueryResult, &_type_spec_OfflineMapPackageQueryResult, bases.get());
            py::winrt_type<winrt::Windows::Services::Maps::OfflineMaps::OfflineMapPackageStartDownloadResult>::python_type = py::register_python_type(module, _type_name_OfflineMapPackageStartDownloadResult, &_type_spec_OfflineMapPackageStartDownloadResult, 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.Services.Maps.OfflineMaps");

    static PyModuleDef module_def
        = {PyModuleDef_HEAD_INIT,
           "_winsdk_Windows_Services_Maps_OfflineMaps",
           module_doc,
           0,
           nullptr,
           module_slots,
           nullptr,
           nullptr,
           nullptr};
} // py::cpp::Windows::Services::Maps::OfflineMaps

PyMODINIT_FUNC
PyInit__winsdk_Windows_Services_Maps_OfflineMaps (void) noexcept
{
    return PyModuleDef_Init(&py::cpp::Windows::Services::Maps::OfflineMaps::module_def);
}
