// Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
// --------- Warning: This is a build system generated file. ----------
//

//! @file
//!
//! @brief This file was generated by <i>omni.bind</i>.

#include <omni/core/Interface.h>
#include <omni/core/OmniAttr.h>
#include <omni/core/ResultError.h>

#include <functional>
#include <type_traits>
#include <utility>

#ifndef OMNI_BIND_INCLUDE_INTERFACE_IMPL


/** Interface to handle performing telemetry related tasks.
 *
 *  This provides an abstraction over the lower level telemetry and structured logging systems
 *  and allows control over some common features of it.
 */
template <>
class omni::core::Generated<omni::telemetry::ITelemetry2_abi> : public omni::telemetry::ITelemetry2_abi
{
public:
    OMNI_PLUGIN_INTERFACE("omni::telemetry::ITelemetry2")

    /** Tests whether this session is running as a cloud session.
     *
     *  @returns `true` if this current session is detected as running on a cloud architecture.
     *           Returns `false` if this current session is running outside of a cloud system.
     *
     *  @remarks A cloud session is one that runs on a cloud service provider's system and streams
     *           to a user's machine.  The session runs on behalf of the given user using that
     *           user's privacy information.  When running on a cloud system, the user does not
     *           have direct access to the hardware.  Telemetry handling also differs since the
     *           telemetry transmitter process will not send data anywhere, but simply write to
     *           a log file that can be scraped when the session ends (or in parts during the
     *           session).
     */
    bool isCloudSession() noexcept;

    /** Retrieves the cloud session ID if running as a cloud session.
     *
     *  @returns A string representing the cloud session ID if running as a cloud session.
     *           Returns `nullptr` otherwise.  This will always return `nullptr` if the current
     *           run environment is anything other than @ref RunEnvironment::eCloud.
     *
     *  @remarks The cloud session ID will be a UUID style string that can be used to uniquely
     *           identify one session from another.  When not running as a cloud session, no
     *           string will be returned.  The caller must be able to properly and gracefully
     *           handle this potential failure case.
     */
    const char* getCloudSessionId() noexcept;

    /** Retrieves the current run environment.
     *
     *  @returns The current run environment if it has been detected yet.  If the run environment
     *           could not be determined yet, @ref RunEnvironment::eUndetermined will be returned
     *           instead.  Once a value other than @ref RunEnvironment::eUndetermined is returned,
     *           the run environment will not change for the remainder of the session and can be
     *           safely cached for quicker lookups later.
     */
    omni::telemetry::RunEnvironment getRunEnvironment() noexcept;

    /** Retrieves the customer ID for enterprise sessions.
     *
     *  @returns The loaded customer ID value if found.  This will be the same value that is
     *           listed as 'org-name' for a given customer on the NVIDIA Licensing Portal web
     *           page.  Returns `nullptr` if the customer ID value was either not found or this
     *           is not an enterprise session.
     */
    const char* getCustomerId() noexcept;
};

#endif

#ifndef OMNI_BIND_INCLUDE_INTERFACE_DECL

inline bool omni::core::Generated<omni::telemetry::ITelemetry2_abi>::isCloudSession() noexcept
{
    return isCloudSession_abi();
}

inline const char* omni::core::Generated<omni::telemetry::ITelemetry2_abi>::getCloudSessionId() noexcept
{
    return getCloudSessionId_abi();
}

inline omni::telemetry::RunEnvironment omni::core::Generated<omni::telemetry::ITelemetry2_abi>::getRunEnvironment() noexcept
{
    return getRunEnvironment_abi();
}

inline const char* omni::core::Generated<omni::telemetry::ITelemetry2_abi>::getCustomerId() noexcept
{
    return getCustomerId_abi();
}

#endif

#undef OMNI_BIND_INCLUDE_INTERFACE_DECL
#undef OMNI_BIND_INCLUDE_INTERFACE_IMPL
