// 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.Calls.Provider.h"

PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::Calls::Provider::PhoneCallOrigin>::python_type;
PyTypeObject* py::winrt_type<winrt::Windows::ApplicationModel::Calls::Provider::PhoneCallOriginManager>::python_type;

namespace py::cpp::Windows::ApplicationModel::Calls::Provider
{
    // ----- PhoneCallOrigin class --------------------
    constexpr const char* const _type_name_PhoneCallOrigin = "PhoneCallOrigin";

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

        Py_ssize_t arg_count = PyTuple_Size(args);
        if (arg_count == 0)
        {
            try
            {
                winrt::Windows::ApplicationModel::Calls::Provider::PhoneCallOrigin 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_PhoneCallOrigin(py::wrapper::Windows::ApplicationModel::Calls::Provider::PhoneCallOrigin* self)
    {
        auto hash_value = std::hash<winrt::Windows::Foundation::IInspectable>{}(self->obj);
        py::wrapped_instance(hash_value, nullptr);
        self->obj = nullptr;
    }

    static PyObject* PhoneCallOrigin_get_Location(py::wrapper::Windows::ApplicationModel::Calls::Provider::PhoneCallOrigin* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Location());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PhoneCallOrigin_put_Location(py::wrapper::Windows::ApplicationModel::Calls::Provider::PhoneCallOrigin* 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.Location(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* PhoneCallOrigin_get_CategoryDescription(py::wrapper::Windows::ApplicationModel::Calls::Provider::PhoneCallOrigin* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.CategoryDescription());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PhoneCallOrigin_put_CategoryDescription(py::wrapper::Windows::ApplicationModel::Calls::Provider::PhoneCallOrigin* 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.CategoryDescription(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* PhoneCallOrigin_get_Category(py::wrapper::Windows::ApplicationModel::Calls::Provider::PhoneCallOrigin* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.Category());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PhoneCallOrigin_put_Category(py::wrapper::Windows::ApplicationModel::Calls::Provider::PhoneCallOrigin* 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.Category(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* PhoneCallOrigin_get_DisplayName(py::wrapper::Windows::ApplicationModel::Calls::Provider::PhoneCallOrigin* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.DisplayName());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PhoneCallOrigin_put_DisplayName(py::wrapper::Windows::ApplicationModel::Calls::Provider::PhoneCallOrigin* 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.DisplayName(param0);
            return 0;
        }
        catch (...)
        {
            py::to_PyErr();
            return -1;
        }
    }

    static PyObject* PhoneCallOrigin_get_DisplayPicture(py::wrapper::Windows::ApplicationModel::Calls::Provider::PhoneCallOrigin* self, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(self->obj.DisplayPicture());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static int PhoneCallOrigin_put_DisplayPicture(py::wrapper::Windows::ApplicationModel::Calls::Provider::PhoneCallOrigin* 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::Windows::Storage::StorageFile>(arg);

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

    static PyObject* _from_PhoneCallOrigin(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::Calls::Provider::PhoneCallOrigin>());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

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

    static PyGetSetDef _getset_PhoneCallOrigin[] = {
        { "location", reinterpret_cast<getter>(PhoneCallOrigin_get_Location), reinterpret_cast<setter>(PhoneCallOrigin_put_Location), nullptr, nullptr },
        { "category_description", reinterpret_cast<getter>(PhoneCallOrigin_get_CategoryDescription), reinterpret_cast<setter>(PhoneCallOrigin_put_CategoryDescription), nullptr, nullptr },
        { "category", reinterpret_cast<getter>(PhoneCallOrigin_get_Category), reinterpret_cast<setter>(PhoneCallOrigin_put_Category), nullptr, nullptr },
        { "display_name", reinterpret_cast<getter>(PhoneCallOrigin_get_DisplayName), reinterpret_cast<setter>(PhoneCallOrigin_put_DisplayName), nullptr, nullptr },
        { "display_picture", reinterpret_cast<getter>(PhoneCallOrigin_get_DisplayPicture), reinterpret_cast<setter>(PhoneCallOrigin_put_DisplayPicture), nullptr, nullptr },
        { }
    };

    static PyType_Slot _type_slots_PhoneCallOrigin[] = 
    {
        { Py_tp_new, _new_PhoneCallOrigin },
        { Py_tp_dealloc, _dealloc_PhoneCallOrigin },
        { Py_tp_methods, _methods_PhoneCallOrigin },
        { Py_tp_getset, _getset_PhoneCallOrigin },
        { },
    };

    static PyType_Spec _type_spec_PhoneCallOrigin =
    {
        "_winsdk_Windows_ApplicationModel_Calls_Provider.PhoneCallOrigin",
        sizeof(py::wrapper::Windows::ApplicationModel::Calls::Provider::PhoneCallOrigin),
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PhoneCallOrigin
    };

    // ----- PhoneCallOriginManager class --------------------
    constexpr const char* const _type_name_PhoneCallOriginManager = "PhoneCallOriginManager";

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

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

        if (arg_count == 0)
        {
            try
            {
                return py::convert(winrt::Windows::ApplicationModel::Calls::Provider::PhoneCallOriginManager::RequestSetAsActiveCallOriginAppAsync());
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 2)
        {
            try
            {
                auto param0 = py::convert_to<winrt::guid>(args, 0);
                auto param1 = py::convert_to<winrt::Windows::ApplicationModel::Calls::Provider::PhoneCallOrigin>(args, 1);

                winrt::Windows::ApplicationModel::Calls::Provider::PhoneCallOriginManager::SetCallOrigin(param0, param1);
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

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

        if (arg_count == 0)
        {
            try
            {
                winrt::Windows::ApplicationModel::Calls::Provider::PhoneCallOriginManager::ShowPhoneCallOriginSettingsUI();
                Py_RETURN_NONE;
            }
            catch (...)
            {
                py::to_PyErr();
                return nullptr;
            }
        }
        else
        {
            py::set_invalid_arg_count_error(arg_count);
            return nullptr;
        }
    }

    static PyObject* PhoneCallOriginManager_get_IsCurrentAppActiveCallOriginApp(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(winrt::Windows::ApplicationModel::Calls::Provider::PhoneCallOriginManager::IsCurrentAppActiveCallOriginApp());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyObject* PhoneCallOriginManager_get_IsSupported(PyObject* /*unused*/, void* /*unused*/) noexcept
    {
        try
        {
            return py::convert(winrt::Windows::ApplicationModel::Calls::Provider::PhoneCallOriginManager::IsSupported());
        }
        catch (...)
        {
            py::to_PyErr();
            return nullptr;
        }
    }

    static PyMethodDef _methods_PhoneCallOriginManager[] = {
        { "request_set_as_active_call_origin_app_async", reinterpret_cast<PyCFunction>(PhoneCallOriginManager_RequestSetAsActiveCallOriginAppAsync), METH_VARARGS | METH_STATIC, nullptr },
        { "set_call_origin", reinterpret_cast<PyCFunction>(PhoneCallOriginManager_SetCallOrigin), METH_VARARGS | METH_STATIC, nullptr },
        { "show_phone_call_origin_settings_u_i", reinterpret_cast<PyCFunction>(PhoneCallOriginManager_ShowPhoneCallOriginSettingsUI), METH_VARARGS | METH_STATIC, nullptr },
        { "get_is_current_app_active_call_origin_app", reinterpret_cast<PyCFunction>(PhoneCallOriginManager_get_IsCurrentAppActiveCallOriginApp), METH_NOARGS | METH_STATIC, nullptr },
        { "get_is_supported", reinterpret_cast<PyCFunction>(PhoneCallOriginManager_get_IsSupported), METH_NOARGS | METH_STATIC, nullptr },
        { }
    };

    static PyGetSetDef _getset_PhoneCallOriginManager[] = {
        { }
    };

    static PyType_Slot _type_slots_PhoneCallOriginManager[] = 
    {
        { Py_tp_new, _new_PhoneCallOriginManager },
        { Py_tp_methods, _methods_PhoneCallOriginManager },
        { Py_tp_getset, _getset_PhoneCallOriginManager },
        { },
    };

    static PyType_Spec _type_spec_PhoneCallOriginManager =
    {
        "_winsdk_Windows_ApplicationModel_Calls_Provider.PhoneCallOriginManager",
        0,
        0,
        Py_TPFLAGS_DEFAULT,
        _type_slots_PhoneCallOriginManager
    };

    // ----- Windows.ApplicationModel.Calls.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::Calls::Provider::PhoneCallOrigin>::python_type = py::register_python_type(module, _type_name_PhoneCallOrigin, &_type_spec_PhoneCallOrigin, bases.get());
            py::winrt_type<winrt::Windows::ApplicationModel::Calls::Provider::PhoneCallOriginManager>::python_type = py::register_python_type(module, _type_name_PhoneCallOriginManager, &_type_spec_PhoneCallOriginManager, nullptr);

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

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

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

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

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