#pragma once

#include <sdbusplus/bus.hpp>
#include <xyz/openbmc_project/Logging/Entry/server.hpp>

namespace phosphor
{
namespace state
{
namespace manager
{
namespace utils
{

/** @brief Get service name from object path and interface
 *
 * @param[in] bus          - The Dbus bus object
 * @param[in] path         - The Dbus object path
 * @param[in] interface    - The Dbus interface
 *
 * @return The name of the service
 */
std::string getService(sdbusplus::bus::bus& bus, std::string path,
                       std::string interface);

/** @brief Get the value of input property
 *
 * @param[in] bus          - The Dbus bus object
 * @param[in] path         - The Dbus object path
 * @param[in] interface    - The Dbus interface
 * @param[in] property     - The property name to get
 *
 * @return The value of the property
 */
std::string getProperty(sdbusplus::bus::bus& bus, const std::string& path,
                        const std::string& interface,
                        const std::string& propertyName);

/** @brief Set the value of property
 *
 * @param[in] bus          - The Dbus bus object
 * @param[in] path         - The Dbus object path
 * @param[in] interface    - The Dbus interface
 * @param[in] property     - The property name to set
 * @param[in] value        - The value of property
 */
void setProperty(sdbusplus::bus::bus& bus, const std::string& path,
                 const std::string& interface, const std::string& property,
                 const std::string& value);

/** @brief Return the value of the input GPIO
 *
 * @param[in] gpioName          - The name of the GPIO to read
 *
 *  * @return The value of the gpio (0 or 1) or -1 on error
 */
int getGpioValue(const std::string& gpioName);

/** @brief Create an error log
 *
 * @param[in] bus          - The Dbus bus object
 * @param[in] errorMsg     - The error message
 * @param[in] errLevel     - The error level
 */
void createError(
    sdbusplus::bus::bus& bus, const std::string& errorMsg,
    sdbusplus::xyz::openbmc_project::Logging::server::Entry::Level errLevel);

} // namespace utils
} // namespace manager
} // namespace state
} // namespace phosphor
