// WARNING: Please don't edit this file. It was generated by C++/WinRT v2.0.240405.15

#pragma once
#ifndef WINRT_Microsoft_Windows_PushNotifications_H
#define WINRT_Microsoft_Windows_PushNotifications_H
#include "winrt/base.h"
static_assert(winrt::check_version(CPPWINRT_VERSION, "2.0.240405.15"), "Mismatched C++/WinRT headers.");
#define CPPWINRT_VERSION "2.0.240405.15"
#include "winrt/impl/Windows.ApplicationModel.Background.2.h"
#include "winrt/impl/Windows.Foundation.2.h"
#include "winrt/impl/Microsoft.Windows.PushNotifications.2.h"
namespace winrt::impl
{
    template <typename D> auto consume_Microsoft_Windows_PushNotifications_IPushNotificationChannel<D>::Uri() const
    {
        void* value{};
        check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationChannel)->get_Uri(&value));
        return winrt::Windows::Foundation::Uri{ value, take_ownership_from_abi };
    }
    template <typename D> auto consume_Microsoft_Windows_PushNotifications_IPushNotificationChannel<D>::ExpirationTime() const
    {
        winrt::Windows::Foundation::DateTime value{};
        check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationChannel)->get_ExpirationTime(put_abi(value)));
        return value;
    }
    template <typename D> auto consume_Microsoft_Windows_PushNotifications_IPushNotificationChannel<D>::Close() const
    {
        check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationChannel)->Close());
    }
    template <typename D> auto consume_Microsoft_Windows_PushNotifications_IPushNotificationCreateChannelResult<D>::Channel() const
    {
        void* value{};
        check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationCreateChannelResult)->get_Channel(&value));
        return winrt::Microsoft::Windows::PushNotifications::PushNotificationChannel{ value, take_ownership_from_abi };
    }
    template <typename D> auto consume_Microsoft_Windows_PushNotifications_IPushNotificationCreateChannelResult<D>::ExtendedError() const
    {
        winrt::hresult value{};
        check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationCreateChannelResult)->get_ExtendedError(put_abi(value)));
        return value;
    }
    template <typename D> auto consume_Microsoft_Windows_PushNotifications_IPushNotificationCreateChannelResult<D>::Status() const
    {
        winrt::Microsoft::Windows::PushNotifications::PushNotificationChannelStatus value{};
        check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationCreateChannelResult)->get_Status(reinterpret_cast<int32_t*>(&value)));
        return value;
    }
    template <typename D> auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager<D>::Register() const
    {
        check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager)->Register());
    }
    template <typename D> auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager<D>::Unregister() const
    {
        check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager)->Unregister());
    }
    template <typename D> auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager<D>::UnregisterAll() const
    {
        check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager)->UnregisterAll());
    }
    template <typename D> auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager<D>::CreateChannelAsync(winrt::guid const& remoteId) const
    {
        void* operation{};
        check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager)->CreateChannelAsync(impl::bind_in(remoteId), &operation));
        return winrt::Windows::Foundation::IAsyncOperationWithProgress<winrt::Microsoft::Windows::PushNotifications::PushNotificationCreateChannelResult, winrt::Microsoft::Windows::PushNotifications::PushNotificationCreateChannelStatus>{ operation, take_ownership_from_abi };
    }
    template <typename D> auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager<D>::PushReceived(winrt::Windows::Foundation::TypedEventHandler<winrt::Microsoft::Windows::PushNotifications::PushNotificationManager, winrt::Microsoft::Windows::PushNotifications::PushNotificationReceivedEventArgs> const& handler) const
    {
        winrt::event_token token{};
        check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager)->add_PushReceived(*(void**)(&handler), put_abi(token)));
        return token;
    }
    template <typename D> auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager<D>::PushReceived(auto_revoke_t, winrt::Windows::Foundation::TypedEventHandler<winrt::Microsoft::Windows::PushNotifications::PushNotificationManager, winrt::Microsoft::Windows::PushNotifications::PushNotificationReceivedEventArgs> const& handler) const
    {
        return impl::make_event_revoker<D, PushReceived_revoker>(this, PushReceived(handler));
    }
    template <typename D> auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManager<D>::PushReceived(winrt::event_token const& token) const noexcept
    {
        WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager)->remove_PushReceived(impl::bind_in(token));
    }
    template <typename D> auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManagerStatics<D>::IsSupported() const
    {
        bool result{};
        check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationManagerStatics)->IsSupported(&result));
        return result;
    }
    template <typename D> auto consume_Microsoft_Windows_PushNotifications_IPushNotificationManagerStatics<D>::Default() const
    {
        void* value{};
        check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationManagerStatics)->get_Default(&value));
        return winrt::Microsoft::Windows::PushNotifications::PushNotificationManager{ value, take_ownership_from_abi };
    }
    template <typename D> auto consume_Microsoft_Windows_PushNotifications_IPushNotificationReceivedEventArgs<D>::Payload() const
    {
        uint32_t value_impl_size{};
        uint8_t* value{};
        check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationReceivedEventArgs)->get_Payload(&value_impl_size, &value));
        return com_array<uint8_t>{ value, value_impl_size, take_ownership_from_abi };
    }
    template <typename D> auto consume_Microsoft_Windows_PushNotifications_IPushNotificationReceivedEventArgs<D>::GetDeferral() const
    {
        void* result{};
        check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationReceivedEventArgs)->GetDeferral(&result));
        return winrt::Windows::ApplicationModel::Background::BackgroundTaskDeferral{ result, take_ownership_from_abi };
    }
    template <typename D> auto consume_Microsoft_Windows_PushNotifications_IPushNotificationReceivedEventArgs<D>::Canceled(winrt::Windows::ApplicationModel::Background::BackgroundTaskCanceledEventHandler const& handler) const
    {
        winrt::event_token token{};
        check_hresult(WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationReceivedEventArgs)->add_Canceled(*(void**)(&handler), put_abi(token)));
        return token;
    }
    template <typename D> auto consume_Microsoft_Windows_PushNotifications_IPushNotificationReceivedEventArgs<D>::Canceled(auto_revoke_t, winrt::Windows::ApplicationModel::Background::BackgroundTaskCanceledEventHandler const& handler) const
    {
        return impl::make_event_revoker<D, Canceled_revoker>(this, Canceled(handler));
    }
    template <typename D> auto consume_Microsoft_Windows_PushNotifications_IPushNotificationReceivedEventArgs<D>::Canceled(winrt::event_token const& token) const noexcept
    {
        WINRT_IMPL_SHIM(winrt::Microsoft::Windows::PushNotifications::IPushNotificationReceivedEventArgs)->remove_Canceled(impl::bind_in(token));
    }
#ifndef WINRT_LEAN_AND_MEAN
    template <typename D>
    struct produce<D, winrt::Microsoft::Windows::PushNotifications::IPushNotificationChannel> : produce_base<D, winrt::Microsoft::Windows::PushNotifications::IPushNotificationChannel>
    {
        int32_t __stdcall get_Uri(void** value) noexcept final try
        {
            clear_abi(value);
            typename D::abi_guard guard(this->shim());
            *value = detach_from<winrt::Windows::Foundation::Uri>(this->shim().Uri());
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall get_ExpirationTime(int64_t* value) noexcept final try
        {
            zero_abi<winrt::Windows::Foundation::DateTime>(value);
            typename D::abi_guard guard(this->shim());
            *value = detach_from<winrt::Windows::Foundation::DateTime>(this->shim().ExpirationTime());
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall Close() noexcept final try
        {
            typename D::abi_guard guard(this->shim());
            this->shim().Close();
            return 0;
        }
        catch (...) { return to_hresult(); }
    };
#endif
#ifndef WINRT_LEAN_AND_MEAN
    template <typename D>
    struct produce<D, winrt::Microsoft::Windows::PushNotifications::IPushNotificationCreateChannelResult> : produce_base<D, winrt::Microsoft::Windows::PushNotifications::IPushNotificationCreateChannelResult>
    {
        int32_t __stdcall get_Channel(void** value) noexcept final try
        {
            clear_abi(value);
            typename D::abi_guard guard(this->shim());
            *value = detach_from<winrt::Microsoft::Windows::PushNotifications::PushNotificationChannel>(this->shim().Channel());
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall get_ExtendedError(winrt::hresult* value) noexcept final try
        {
            zero_abi<winrt::hresult>(value);
            typename D::abi_guard guard(this->shim());
            *value = detach_from<winrt::hresult>(this->shim().ExtendedError());
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall get_Status(int32_t* value) noexcept final try
        {
            typename D::abi_guard guard(this->shim());
            *value = detach_from<winrt::Microsoft::Windows::PushNotifications::PushNotificationChannelStatus>(this->shim().Status());
            return 0;
        }
        catch (...) { return to_hresult(); }
    };
#endif
#ifndef WINRT_LEAN_AND_MEAN
    template <typename D>
    struct produce<D, winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager> : produce_base<D, winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager>
    {
        int32_t __stdcall Register() noexcept final try
        {
            typename D::abi_guard guard(this->shim());
            this->shim().Register();
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall Unregister() noexcept final try
        {
            typename D::abi_guard guard(this->shim());
            this->shim().Unregister();
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall UnregisterAll() noexcept final try
        {
            typename D::abi_guard guard(this->shim());
            this->shim().UnregisterAll();
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall CreateChannelAsync(winrt::guid remoteId, void** operation) noexcept final try
        {
            clear_abi(operation);
            typename D::abi_guard guard(this->shim());
            *operation = detach_from<winrt::Windows::Foundation::IAsyncOperationWithProgress<winrt::Microsoft::Windows::PushNotifications::PushNotificationCreateChannelResult, winrt::Microsoft::Windows::PushNotifications::PushNotificationCreateChannelStatus>>(this->shim().CreateChannelAsync(*reinterpret_cast<winrt::guid const*>(&remoteId)));
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall add_PushReceived(void* handler, winrt::event_token* token) noexcept final try
        {
            zero_abi<winrt::event_token>(token);
            typename D::abi_guard guard(this->shim());
            *token = detach_from<winrt::event_token>(this->shim().PushReceived(*reinterpret_cast<winrt::Windows::Foundation::TypedEventHandler<winrt::Microsoft::Windows::PushNotifications::PushNotificationManager, winrt::Microsoft::Windows::PushNotifications::PushNotificationReceivedEventArgs> const*>(&handler)));
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall remove_PushReceived(winrt::event_token token) noexcept final
        {
            typename D::abi_guard guard(this->shim());
            this->shim().PushReceived(*reinterpret_cast<winrt::event_token const*>(&token));
            return 0;
        }
    };
#endif
#ifndef WINRT_LEAN_AND_MEAN
    template <typename D>
    struct produce<D, winrt::Microsoft::Windows::PushNotifications::IPushNotificationManagerStatics> : produce_base<D, winrt::Microsoft::Windows::PushNotifications::IPushNotificationManagerStatics>
    {
        int32_t __stdcall IsSupported(bool* result) noexcept final try
        {
            typename D::abi_guard guard(this->shim());
            *result = detach_from<bool>(this->shim().IsSupported());
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall get_Default(void** value) noexcept final try
        {
            clear_abi(value);
            typename D::abi_guard guard(this->shim());
            *value = detach_from<winrt::Microsoft::Windows::PushNotifications::PushNotificationManager>(this->shim().Default());
            return 0;
        }
        catch (...) { return to_hresult(); }
    };
#endif
#ifndef WINRT_LEAN_AND_MEAN
    template <typename D>
    struct produce<D, winrt::Microsoft::Windows::PushNotifications::IPushNotificationReceivedEventArgs> : produce_base<D, winrt::Microsoft::Windows::PushNotifications::IPushNotificationReceivedEventArgs>
    {
        int32_t __stdcall get_Payload(uint32_t* __valueSize, uint8_t** value) noexcept final try
        {
            clear_abi(value);
            typename D::abi_guard guard(this->shim());
            std::tie(*__valueSize, *value) = detach_abi(this->shim().Payload());
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall GetDeferral(void** result) noexcept final try
        {
            clear_abi(result);
            typename D::abi_guard guard(this->shim());
            *result = detach_from<winrt::Windows::ApplicationModel::Background::BackgroundTaskDeferral>(this->shim().GetDeferral());
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall add_Canceled(void* handler, winrt::event_token* token) noexcept final try
        {
            zero_abi<winrt::event_token>(token);
            typename D::abi_guard guard(this->shim());
            *token = detach_from<winrt::event_token>(this->shim().Canceled(*reinterpret_cast<winrt::Windows::ApplicationModel::Background::BackgroundTaskCanceledEventHandler const*>(&handler)));
            return 0;
        }
        catch (...) { return to_hresult(); }
        int32_t __stdcall remove_Canceled(winrt::event_token token) noexcept final
        {
            typename D::abi_guard guard(this->shim());
            this->shim().Canceled(*reinterpret_cast<winrt::event_token const*>(&token));
            return 0;
        }
    };
#endif
}
WINRT_EXPORT namespace winrt::Microsoft::Windows::PushNotifications
{
    inline auto PushNotificationManager::IsSupported()
    {
        return impl::call_factory_cast<bool(*)(IPushNotificationManagerStatics const&), PushNotificationManager, IPushNotificationManagerStatics>([](IPushNotificationManagerStatics const& f) { return f.IsSupported(); });
    }
    inline auto PushNotificationManager::Default()
    {
        return impl::call_factory_cast<winrt::Microsoft::Windows::PushNotifications::PushNotificationManager(*)(IPushNotificationManagerStatics const&), PushNotificationManager, IPushNotificationManagerStatics>([](IPushNotificationManagerStatics const& f) { return f.Default(); });
    }
}
namespace std
{
#ifndef WINRT_LEAN_AND_MEAN
    template<> struct hash<winrt::Microsoft::Windows::PushNotifications::IPushNotificationChannel> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Microsoft::Windows::PushNotifications::IPushNotificationCreateChannelResult> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Microsoft::Windows::PushNotifications::IPushNotificationManager> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Microsoft::Windows::PushNotifications::IPushNotificationManagerStatics> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Microsoft::Windows::PushNotifications::IPushNotificationReceivedEventArgs> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Microsoft::Windows::PushNotifications::PushNotificationChannel> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Microsoft::Windows::PushNotifications::PushNotificationCreateChannelResult> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Microsoft::Windows::PushNotifications::PushNotificationManager> : winrt::impl::hash_base {};
    template<> struct hash<winrt::Microsoft::Windows::PushNotifications::PushNotificationReceivedEventArgs> : winrt::impl::hash_base {};
#endif
#ifdef __cpp_lib_format
#endif
}
#endif
