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

#include "pybase.h"
#include "py.Windows.ApplicationModel.DataTransfer.ShareTarget.h"


namespace py::cpp::Windows::ApplicationModel::DataTransfer::ShareTarget
{
    struct module_state
    {
        PyTypeObject* type_QuickLink;
        PyTypeObject* type_ShareOperation;
    };

    // ----- QuickLink class --------------------
    static constexpr const char* const type_name_QuickLink = "QuickLink";

    static PyObject* _new_QuickLink(PyTypeObject* type, PyObject* args, PyObject* kwds) noexcept
    {
        if (kwds != nullptr)
        {
            py::set_invalid_kwd_args_error();
            return nullptr;
        }

        auto arg_count = PyTuple_Size(args);
        if (arg_count == 0)
        {
            try
            {
                winrt::Windows::ApplicationModel::DataTransfer::ShareTarget::QuickLink instance{  };
                return py::wrap(instance, type);
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static void _dealloc_QuickLink(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::QuickLink* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* QuickLink_get_Title(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::QuickLink* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.DataTransfer.ShareTarget.QuickLink", L"Title"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static int QuickLink_put_Title(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::QuickLink* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.DataTransfer.ShareTarget.QuickLink", L"Title"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return -1;
        }

        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

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

    static PyObject* QuickLink_get_Thumbnail(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::QuickLink* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.DataTransfer.ShareTarget.QuickLink", L"Thumbnail"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static int QuickLink_put_Thumbnail(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::QuickLink* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.DataTransfer.ShareTarget.QuickLink", L"Thumbnail"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return -1;
        }

        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Storage::Streams::RandomAccessStreamReference>(arg);

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

    static PyObject* QuickLink_get_Id(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::QuickLink* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.DataTransfer.ShareTarget.QuickLink", L"Id"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static int QuickLink_put_Id(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::QuickLink* self, PyObject* arg, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.DataTransfer.ShareTarget.QuickLink", L"Id"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return -1;
        }

        if (arg == nullptr)
        {
            PyErr_SetString(PyExc_AttributeError, "can't delete attribute");
            return -1;
        }

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

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

    static PyObject* QuickLink_get_SupportedDataFormats(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::QuickLink* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.DataTransfer.ShareTarget.QuickLink", L"SupportedDataFormats"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* QuickLink_get_SupportedFileTypes(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::QuickLink* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.DataTransfer.ShareTarget.QuickLink", L"SupportedFileTypes"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* _assign_array_QuickLink(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::ApplicationModel::DataTransfer::ShareTarget::QuickLink>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_QuickLink(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::DataTransfer::ShareTarget::QuickLink>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_QuickLink[] = {
        { "_assign_array_", _assign_array_QuickLink, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_QuickLink), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_QuickLink[] = {
        { "title", reinterpret_cast<getter>(QuickLink_get_Title), reinterpret_cast<setter>(QuickLink_put_Title), nullptr, nullptr },
        { "thumbnail", reinterpret_cast<getter>(QuickLink_get_Thumbnail), reinterpret_cast<setter>(QuickLink_put_Thumbnail), nullptr, nullptr },
        { "id", reinterpret_cast<getter>(QuickLink_get_Id), reinterpret_cast<setter>(QuickLink_put_Id), nullptr, nullptr },
        { "supported_data_formats", reinterpret_cast<getter>(QuickLink_get_SupportedDataFormats), nullptr, nullptr, nullptr },
        { "supported_file_types", reinterpret_cast<getter>(QuickLink_get_SupportedFileTypes), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_QuickLink[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_QuickLink) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_QuickLink) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_QuickLink) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_QuickLink) },
        { },
    };

    static PyType_Spec type_spec_QuickLink =
    {
        "_winsdk_Windows_ApplicationModel_DataTransfer_ShareTarget.QuickLink",
        sizeof(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::QuickLink),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_QuickLink
    };

    // ----- ShareOperation class --------------------
    static constexpr const char* const type_name_ShareOperation = "ShareOperation";

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

    static void _dealloc_ShareOperation(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::ShareOperation* self) noexcept
    {
        auto tp = Py_TYPE(self);

        if (PyType_IS_GC(tp))
        {
            PyObject_GC_UnTrack(self);
        }

        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* ShareOperation_DismissUI(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::ShareOperation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.DataTransfer.ShareTarget.ShareOperation", L"DismissUI", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* ShareOperation_RemoveThisQuickLink(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::ShareOperation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.DataTransfer.ShareTarget.ShareOperation", L"RemoveThisQuickLink", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* ShareOperation_ReportCompleted(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::ShareOperation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.DataTransfer.ShareTarget.ShareOperation", L"ReportCompleted", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

            try
            {
                self->obj.ReportCompleted();
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.DataTransfer.ShareTarget.ShareOperation", L"ReportCompleted", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

            try
            {
                auto param0 = py::convert_to<winrt::Windows::ApplicationModel::DataTransfer::ShareTarget::QuickLink>(args, 0);

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

    static PyObject* ShareOperation_ReportDataRetrieved(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::ShareOperation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.DataTransfer.ShareTarget.ShareOperation", L"ReportDataRetrieved", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* ShareOperation_ReportError(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::ShareOperation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 1)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.DataTransfer.ShareTarget.ShareOperation", L"ReportError", 1))
            {
                py::set_arg_count_version_error(1);
                return nullptr;
            }

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

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

    static PyObject* ShareOperation_ReportStarted(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::ShareOperation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.DataTransfer.ShareTarget.ShareOperation", L"ReportStarted", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* ShareOperation_ReportSubmittedBackgroundTask(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::ShareOperation* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.ApplicationModel.DataTransfer.ShareTarget.ShareOperation", L"ReportSubmittedBackgroundTask", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* ShareOperation_get_Data(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::ShareOperation* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.DataTransfer.ShareTarget.ShareOperation", L"Data"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* ShareOperation_get_QuickLinkId(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::ShareOperation* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.DataTransfer.ShareTarget.ShareOperation", L"QuickLinkId"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* ShareOperation_get_Contacts(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::ShareOperation* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.ApplicationModel.DataTransfer.ShareTarget.ShareOperation", L"Contacts"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* _assign_array_ShareOperation(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::ApplicationModel::DataTransfer::ShareTarget::ShareOperation>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_ShareOperation(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::DataTransfer::ShareTarget::ShareOperation>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_ShareOperation[] = {
        { "dismiss_u_i", reinterpret_cast<PyCFunction>(ShareOperation_DismissUI), METH_VARARGS, nullptr },
        { "remove_this_quick_link", reinterpret_cast<PyCFunction>(ShareOperation_RemoveThisQuickLink), METH_VARARGS, nullptr },
        { "report_completed", reinterpret_cast<PyCFunction>(ShareOperation_ReportCompleted), METH_VARARGS, nullptr },
        { "report_data_retrieved", reinterpret_cast<PyCFunction>(ShareOperation_ReportDataRetrieved), METH_VARARGS, nullptr },
        { "report_error", reinterpret_cast<PyCFunction>(ShareOperation_ReportError), METH_VARARGS, nullptr },
        { "report_started", reinterpret_cast<PyCFunction>(ShareOperation_ReportStarted), METH_VARARGS, nullptr },
        { "report_submitted_background_task", reinterpret_cast<PyCFunction>(ShareOperation_ReportSubmittedBackgroundTask), METH_VARARGS, nullptr },
        { "_assign_array_", _assign_array_ShareOperation, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_ShareOperation), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_ShareOperation[] = {
        { "data", reinterpret_cast<getter>(ShareOperation_get_Data), nullptr, nullptr, nullptr },
        { "quick_link_id", reinterpret_cast<getter>(ShareOperation_get_QuickLinkId), nullptr, nullptr, nullptr },
        { "contacts", reinterpret_cast<getter>(ShareOperation_get_Contacts), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_ShareOperation[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_ShareOperation) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_ShareOperation) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_ShareOperation) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_ShareOperation) },
        { },
    };

    static PyType_Spec type_spec_ShareOperation =
    {
        "_winsdk_Windows_ApplicationModel_DataTransfer_ShareTarget.ShareOperation",
        sizeof(py::wrapper::Windows::ApplicationModel::DataTransfer::ShareTarget::ShareOperation),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_ShareOperation
    };

    // ----- Windows.ApplicationModel.DataTransfer.ShareTarget Initialization --------------------
    PyDoc_STRVAR(module_doc, "Windows::ApplicationModel::DataTransfer::ShareTarget");

    static PyMethodDef module_methods[] = {
        {}};


    static int module_traverse(PyObject* module, visitproc visit, void* arg) noexcept
    {
        auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));

        if (!state)
        {
            return 0;
        }

        Py_VISIT(state->type_QuickLink);
        Py_VISIT(state->type_ShareOperation);

        return 0;
    }

    static int module_clear(PyObject* module) noexcept
    {
        auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));

        if (!state)
        {
            return 0;
        }

        Py_CLEAR(state->type_QuickLink);
        Py_CLEAR(state->type_ShareOperation);

        return 0;
    }


    static PyModuleDef module_def
        = {PyModuleDef_HEAD_INIT,
           "_winsdk_Windows_ApplicationModel_DataTransfer_ShareTarget",
           module_doc,
           sizeof(module_state),
           module_methods,
           nullptr,
           module_traverse,
           module_clear,
           nullptr};

} // py::cpp::Windows::ApplicationModel::DataTransfer::ShareTarget

PyMODINIT_FUNC PyInit__winsdk_Windows_ApplicationModel_DataTransfer_ShareTarget(void) noexcept
{
    using namespace py::cpp::Windows::ApplicationModel::DataTransfer::ShareTarget;

    py::pyobj_handle module{PyModule_Create(&module_def)};

    if (!module)
    {
        return nullptr;
    }

    auto object_type = py::get_python_type<py::Object>();
    if (!object_type)
    {
        return nullptr;
    }

    py::pyobj_handle bases{PyTuple_Pack(1, object_type)};

    if (!bases)
    {
        return nullptr;
    }

    py::pyobj_handle collections_abc_module{PyImport_ImportModule("collections.abc")};

    if (!collections_abc_module)
    {
        return nullptr;
    }

    py::pyobj_handle sequence_type{PyObject_GetAttrString(collections_abc_module.get(), "Sequence")};

    if (!sequence_type)
    {
        return nullptr;
    }

    py::pyobj_handle sequence_bases{PyTuple_Pack(2, object_type, sequence_type.get())};

    if (!sequence_bases)
    {
        return nullptr;
    }

    py::pyobj_handle mutable_sequence_type{PyObject_GetAttrString(collections_abc_module.get(), "MutableSequence")};

    if (!mutable_sequence_type)
    {
        return nullptr;
    }

    py::pyobj_handle mutable_sequence_bases{PyTuple_Pack(2, object_type, mutable_sequence_type.get())};

    if (!mutable_sequence_bases)
    {
        return nullptr;
    }

    py::pyobj_handle mapping_type{PyObject_GetAttrString(collections_abc_module.get(), "Mapping")};

    if (!mapping_type)
    {
        return nullptr;
    }

    py::pyobj_handle mapping_bases{PyTuple_Pack(2, object_type, mapping_type.get())};

    if (!mapping_bases)
    {
        return nullptr;
    }

    py::pyobj_handle mutable_mapping_type{PyObject_GetAttrString(collections_abc_module.get(), "MutableMapping")};

    if (!mutable_mapping_type)
    {
        return nullptr;
    }

    py::pyobj_handle mutable_mapping_bases{PyTuple_Pack(2, object_type, mutable_mapping_type.get())};

    if (!mutable_mapping_bases)
    {
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module.get()));
    assert(state);

    state->type_QuickLink = py::register_python_type(module.get(), type_name_QuickLink, &type_spec_QuickLink, bases.get(), nullptr);
    if (!state->type_QuickLink)
    {
        return nullptr;
    }

    state->type_ShareOperation = py::register_python_type(module.get(), type_name_ShareOperation, &type_spec_ShareOperation, bases.get(), nullptr);
    if (!state->type_ShareOperation)
    {
        return nullptr;
    }


    return module.detach();
}

PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::DataTransfer::ShareTarget::QuickLink>::get_python_type() noexcept {
    using namespace py::cpp::Windows::ApplicationModel::DataTransfer::ShareTarget;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::ApplicationModel::DataTransfer::ShareTarget");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_QuickLink;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::ApplicationModel::DataTransfer::ShareTarget::QuickLink is not registered");
        return nullptr;
    }

    return python_type;
}

PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::DataTransfer::ShareTarget::ShareOperation>::get_python_type() noexcept {
    using namespace py::cpp::Windows::ApplicationModel::DataTransfer::ShareTarget;

    PyObject* module = PyState_FindModule(&module_def);

    if (!module) {
        PyErr_SetString(PyExc_RuntimeError, "could not find module for Windows::ApplicationModel::DataTransfer::ShareTarget");
        return nullptr;
    }

    auto state = reinterpret_cast<module_state*>(PyModule_GetState(module));
    assert(state);

    auto python_type = state->type_ShareOperation;

    if (!python_type) {
        PyErr_SetString(PyExc_RuntimeError, "type winrt::Windows::ApplicationModel::DataTransfer::ShareTarget::ShareOperation is not registered");
        return nullptr;
    }

    return python_type;
}
