Update inventory item interface

Update the inventory item interface, setting
Present and PrettyName.

Change-Id: I6a0a8bd66a8427253706b2b1ee14dca919d0a809
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/presence/gpio_presence.hpp b/presence/gpio_presence.hpp
index 3faa7e1..47d2dc7 100644
--- a/presence/gpio_presence.hpp
+++ b/presence/gpio_presence.hpp
@@ -27,6 +27,17 @@
 class Presence
 {
 
+        using Property = std::string;
+        using Value = sdbusplus::message::variant<bool, std::string>;
+        // Association between property and its value
+        using PropertyMap = std::map<Property, Value>;
+        using Interface = std::string;
+        // Association between interface and the D-Bus property
+        using InterfaceMap = std::map<Interface, PropertyMap>;
+        using Object = sdbusplus::message::object_path;
+        // Association between object and the interface
+        using ObjectMap = std::map<Object, InterfaceMap>;
+
     public:
         Presence() = delete;
         ~Presence() = default;
@@ -37,6 +48,7 @@
 
         /** @brief Constructs Presence object.
          *
+         *  @param[in] bus       - D-Bus bus Object
          *  @param[in] inventory - Object path under inventory
                                    to display this inventory item
          *  @param[in] path      - Device path to read for GPIO pin state
@@ -44,10 +56,12 @@
          *  @param[in] key       - GPIO key to monitor
          *  @param[in] name      - Pretty name of the inventory item
          */
-        Presence(const std::string& inventory,
+        Presence(sdbusplus::bus::bus& bus,
+                 const std::string& inventory,
                  const std::string& path,
                  const unsigned int key,
                  const std::string& name) :
+            bus(bus),
             inventory(inventory),
             path(path),
             key(key),
@@ -60,6 +74,25 @@
 
     private:
         /**
+         * @brief Update the present property for the inventory item.
+         *
+         * @param[in] present - What the present property should be set to.
+         */
+        void updateInventory(bool present);
+
+        /**
+         * @brief Construct the inventory object map for the inventory item.
+         *
+         * @param[in] present - What the present property should be set to.
+         *
+         * @return The inventory object map to update inventory
+         */
+        ObjectMap getObjectMap(bool present);
+
+        /** @brief Connection for sdbusplus bus */
+        sdbusplus::bus::bus& bus;
+
+        /**
          * @brief Read the GPIO device to determine initial presence and set
          *        present property at D-Bus path.
          **/
@@ -91,6 +124,20 @@
         void initEvDev();
 };
 
+/**
+ * @brief Get the service name from the mapper for the
+ *        interface and path passed in.
+ *
+ * @param[in] path      - The D-Bus path name
+ * @param[in] interface - The D-Bus interface name
+ * @param[in] bus       - The D-Bus bus object
+ *
+ * @return The service name
+ */
+std::string getService(const std::string& path,
+                       const std::string& interface,
+                       sdbusplus::bus::bus& bus);
+
 } // namespace presence
 } // namespace gpio
 } // namespace phosphor