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

#include "py.Windows.Media.Capture.Core.h"


namespace py::cpp::Windows::Media::Capture::Core
{
    // ----- VariablePhotoCapturedEventArgs class --------------------

    static PyObject* _new_VariablePhotoCapturedEventArgs(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Media::Capture::Core::VariablePhotoCapturedEventArgs>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Media::Capture::Core::VariablePhotoCapturedEventArgs>::type_name);
        return nullptr;
    }

    static void _dealloc_VariablePhotoCapturedEventArgs(py::wrapper::Windows::Media::Capture::Core::VariablePhotoCapturedEventArgs* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* VariablePhotoCapturedEventArgs_get_CaptureTimeOffset(py::wrapper::Windows::Media::Capture::Core::VariablePhotoCapturedEventArgs* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Core.VariablePhotoCapturedEventArgs", L"CaptureTimeOffset"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* VariablePhotoCapturedEventArgs_get_CapturedFrameControlValues(py::wrapper::Windows::Media::Capture::Core::VariablePhotoCapturedEventArgs* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Core.VariablePhotoCapturedEventArgs", L"CapturedFrameControlValues"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* VariablePhotoCapturedEventArgs_get_Frame(py::wrapper::Windows::Media::Capture::Core::VariablePhotoCapturedEventArgs* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Core.VariablePhotoCapturedEventArgs", L"Frame"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* VariablePhotoCapturedEventArgs_get_UsedFrameControllerIndex(py::wrapper::Windows::Media::Capture::Core::VariablePhotoCapturedEventArgs* self, void* /*unused*/) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsPropertyPresent(L"Windows.Media.Capture.Core.VariablePhotoCapturedEventArgs", L"UsedFrameControllerIndex"))
        {
            PyErr_SetString(PyExc_AttributeError, "property is not available in this version of Windows");
            return nullptr;
        }

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

    static PyObject* _assign_array_VariablePhotoCapturedEventArgs(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::Capture::Core::VariablePhotoCapturedEventArgs>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_VariablePhotoCapturedEventArgs(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::Media::Capture::Core::VariablePhotoCapturedEventArgs>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_VariablePhotoCapturedEventArgs[] = {
        { "_assign_array_", _assign_array_VariablePhotoCapturedEventArgs, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_VariablePhotoCapturedEventArgs), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_VariablePhotoCapturedEventArgs[] = {
        { "capture_time_offset", reinterpret_cast<getter>(VariablePhotoCapturedEventArgs_get_CaptureTimeOffset), nullptr, nullptr, nullptr },
        { "captured_frame_control_values", reinterpret_cast<getter>(VariablePhotoCapturedEventArgs_get_CapturedFrameControlValues), nullptr, nullptr, nullptr },
        { "frame", reinterpret_cast<getter>(VariablePhotoCapturedEventArgs_get_Frame), nullptr, nullptr, nullptr },
        { "used_frame_controller_index", reinterpret_cast<getter>(VariablePhotoCapturedEventArgs_get_UsedFrameControllerIndex), nullptr, nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_VariablePhotoCapturedEventArgs[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_VariablePhotoCapturedEventArgs) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_VariablePhotoCapturedEventArgs) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_VariablePhotoCapturedEventArgs) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_VariablePhotoCapturedEventArgs) },
        { },
    };

    static PyType_Spec type_spec_VariablePhotoCapturedEventArgs =
    {
        "winrt._winrt_windows_media_capture_core.VariablePhotoCapturedEventArgs",
        sizeof(py::wrapper::Windows::Media::Capture::Core::VariablePhotoCapturedEventArgs),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_VariablePhotoCapturedEventArgs
    };

    // ----- VariablePhotoSequenceCapture class --------------------

    static PyObject* _new_VariablePhotoSequenceCapture(PyTypeObject* /*unused*/, PyObject* /*unused*/, PyObject* /*unused*/) noexcept
    {
        static_assert(py::py_type<winrt::Windows::Media::Capture::Core::VariablePhotoSequenceCapture>::type_name);
        py::set_invalid_activation_error(py::py_type<winrt::Windows::Media::Capture::Core::VariablePhotoSequenceCapture>::type_name);
        return nullptr;
    }

    static void _dealloc_VariablePhotoSequenceCapture(py::wrapper::Windows::Media::Capture::Core::VariablePhotoSequenceCapture* self) noexcept
    {
        auto tp = Py_TYPE(self);
        std::destroy_at(&self->obj);
        tp->tp_free(self);
        Py_DECREF(tp);
    }

    static PyObject* VariablePhotoSequenceCapture_FinishAsync(py::wrapper::Windows::Media::Capture::Core::VariablePhotoSequenceCapture* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Core.VariablePhotoSequenceCapture", L"FinishAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* VariablePhotoSequenceCapture_StartAsync(py::wrapper::Windows::Media::Capture::Core::VariablePhotoSequenceCapture* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Core.VariablePhotoSequenceCapture", L"StartAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* VariablePhotoSequenceCapture_StopAsync(py::wrapper::Windows::Media::Capture::Core::VariablePhotoSequenceCapture* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Core.VariablePhotoSequenceCapture", L"StopAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* VariablePhotoSequenceCapture_UpdateSettingsAsync(py::wrapper::Windows::Media::Capture::Core::VariablePhotoSequenceCapture* self, PyObject* args) noexcept
    {
        auto arg_count = PyTuple_Size(args);

        if (arg_count == 0)
        {
            if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsMethodPresent(L"Windows.Media.Capture.Core.VariablePhotoSequenceCapture", L"UpdateSettingsAsync", 0))
            {
                py::set_arg_count_version_error(0);
                return nullptr;
            }

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

    static PyObject* VariablePhotoSequenceCapture_add_PhotoCaptured(py::wrapper::Windows::Media::Capture::Core::VariablePhotoSequenceCapture* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Media.Capture.Core.VariablePhotoSequenceCapture", L"PhotoCaptured"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Capture::Core::VariablePhotoSequenceCapture, winrt::Windows::Media::Capture::Core::VariablePhotoCapturedEventArgs>>(arg);

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

    static PyObject* VariablePhotoSequenceCapture_remove_PhotoCaptured(py::wrapper::Windows::Media::Capture::Core::VariablePhotoSequenceCapture* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Media.Capture.Core.VariablePhotoSequenceCapture", L"PhotoCaptured"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

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

    static PyObject* VariablePhotoSequenceCapture_add_Stopped(py::wrapper::Windows::Media::Capture::Core::VariablePhotoSequenceCapture* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Media.Capture.Core.VariablePhotoSequenceCapture", L"Stopped"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

        try
        {
            auto param0 = py::convert_to<winrt::Windows::Foundation::TypedEventHandler<winrt::Windows::Media::Capture::Core::VariablePhotoSequenceCapture, winrt::Windows::Foundation::IInspectable>>(arg);

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

    static PyObject* VariablePhotoSequenceCapture_remove_Stopped(py::wrapper::Windows::Media::Capture::Core::VariablePhotoSequenceCapture* self, PyObject* arg) noexcept
    {
        if (!winrt::Windows::Foundation::Metadata::ApiInformation::IsEventPresent(L"Windows.Media.Capture.Core.VariablePhotoSequenceCapture", L"Stopped"))
        {
            PyErr_SetString(PyExc_AttributeError, "event is not available in this version of Windows");
            return nullptr;
        }

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

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

    static PyObject* _assign_array_VariablePhotoSequenceCapture(PyObject* /*unused*/, PyObject* arg) noexcept
    {
        auto array = std::make_unique<py::ComArray<winrt::Windows::Media::Capture::Core::VariablePhotoSequenceCapture>>();
        if (!py::cpp::_winrt::Array_Assign(arg, std::move(array)))
        {
            return nullptr;
        }
        Py_RETURN_NONE;
    }

    static PyObject* _from_VariablePhotoSequenceCapture(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::Media::Capture::Core::VariablePhotoSequenceCapture>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_VariablePhotoSequenceCapture[] = {
        { "finish_async", reinterpret_cast<PyCFunction>(VariablePhotoSequenceCapture_FinishAsync), METH_VARARGS, nullptr },
        { "start_async", reinterpret_cast<PyCFunction>(VariablePhotoSequenceCapture_StartAsync), METH_VARARGS, nullptr },
        { "stop_async", reinterpret_cast<PyCFunction>(VariablePhotoSequenceCapture_StopAsync), METH_VARARGS, nullptr },
        { "update_settings_async", reinterpret_cast<PyCFunction>(VariablePhotoSequenceCapture_UpdateSettingsAsync), METH_VARARGS, nullptr },
        { "add_photo_captured", reinterpret_cast<PyCFunction>(VariablePhotoSequenceCapture_add_PhotoCaptured), METH_O, nullptr },
        { "remove_photo_captured", reinterpret_cast<PyCFunction>(VariablePhotoSequenceCapture_remove_PhotoCaptured), METH_O, nullptr },
        { "add_stopped", reinterpret_cast<PyCFunction>(VariablePhotoSequenceCapture_add_Stopped), METH_O, nullptr },
        { "remove_stopped", reinterpret_cast<PyCFunction>(VariablePhotoSequenceCapture_remove_Stopped), METH_O, nullptr },
        { "_assign_array_", _assign_array_VariablePhotoSequenceCapture, METH_O | METH_STATIC, nullptr },
        { "_from", reinterpret_cast<PyCFunction>(_from_VariablePhotoSequenceCapture), METH_O | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_VariablePhotoSequenceCapture[] = {
        { }
    };

    static PyType_Slot _type_slots_VariablePhotoSequenceCapture[] = 
    {
        { Py_tp_new, reinterpret_cast<void*>(_new_VariablePhotoSequenceCapture) },
        { Py_tp_dealloc, reinterpret_cast<void*>(_dealloc_VariablePhotoSequenceCapture) },
        { Py_tp_methods, reinterpret_cast<void*>(_methods_VariablePhotoSequenceCapture) },
        { Py_tp_getset, reinterpret_cast<void*>(_getset_VariablePhotoSequenceCapture) },
        { },
    };

    static PyType_Spec type_spec_VariablePhotoSequenceCapture =
    {
        "winrt._winrt_windows_media_capture_core.VariablePhotoSequenceCapture",
        sizeof(py::wrapper::Windows::Media::Capture::Core::VariablePhotoSequenceCapture),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_VariablePhotoSequenceCapture
    };

    // ----- Windows.Media.Capture.Core Initialization --------------------
    PyDoc_STRVAR(module_doc, "Windows::Media::Capture::Core");


    static PyModuleDef module_def
        = {PyModuleDef_HEAD_INIT,
           "_winrt_windows_media_capture_core",
           module_doc,
           0,
           nullptr,
           nullptr,
           nullptr,
           nullptr,
           nullptr};

} // py::cpp::Windows::Media::Capture::Core

PyMODINIT_FUNC PyInit__winrt_windows_media_capture_core(void) noexcept
{
    using namespace py::cpp::Windows::Media::Capture::Core;

    if (py::import_winrt_runtime() == -1)
    {
        return nullptr;
    }

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

    if (!module)
    {
        return nullptr;
    }

    auto object_type = py::get_object_type();
    if (!object_type)
    {
        return nullptr;
    }

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

    if (!object_bases)
    {
        return nullptr;
    }

    if (py::register_python_type(module.get(), &type_spec_VariablePhotoCapturedEventArgs, object_bases.get(), nullptr) == -1)
    {
        return nullptr;
    }

    if (py::register_python_type(module.get(), &type_spec_VariablePhotoSequenceCapture, object_bases.get(), nullptr) == -1)
    {
        return nullptr;
    }


    return module.detach();
}
