leak detection: add support for leak detectors

Add support for Leak Detectors alongwith appropriate association to
Inventory.Item.

Change-Id: I839446c3ecedfe88ed561b26bbe26b21bef35932
Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
diff --git a/gen/xyz/openbmc_project/State/Leak/Detector/meson.build b/gen/xyz/openbmc_project/State/Leak/Detector/meson.build
index 741c5d2..1eccd0c 100644
--- a/gen/xyz/openbmc_project/State/Leak/Detector/meson.build
+++ b/gen/xyz/openbmc_project/State/Leak/Detector/meson.build
@@ -1,8 +1,8 @@
 # Generated file; do not modify.
 generated_sources += custom_target(
     'xyz/openbmc_project/State/Leak/Detector__cpp'.underscorify(),
-    input: [ '../../../../../../yaml/xyz/openbmc_project/State/Leak/Detector.events.yaml',  ],
-    output: [ 'event.cpp', 'event.hpp',  ],
+    input: [ '../../../../../../yaml/xyz/openbmc_project/State/Leak/Detector.events.yaml', '../../../../../../yaml/xyz/openbmc_project/State/Leak/Detector.interface.yaml',  ],
+    output: [ 'event.cpp', 'event.hpp', 'common.hpp', 'server.cpp', 'server.hpp', 'aserver.hpp', 'client.hpp',  ],
     depend_files: sdbusplusplus_depfiles,
     command: [
         sdbuspp_gen_meson_prog, '--command', 'cpp',
diff --git a/gen/xyz/openbmc_project/State/Leak/meson.build b/gen/xyz/openbmc_project/State/Leak/meson.build
index 681bddb..ff45579 100644
--- a/gen/xyz/openbmc_project/State/Leak/meson.build
+++ b/gen/xyz/openbmc_project/State/Leak/meson.build
@@ -2,7 +2,7 @@
 subdir('Detector')
 generated_others += custom_target(
     'xyz/openbmc_project/State/Leak/Detector__markdown'.underscorify(),
-    input: [ '../../../../../yaml/xyz/openbmc_project/State/Leak/Detector.events.yaml',  ],
+    input: [ '../../../../../yaml/xyz/openbmc_project/State/Leak/Detector.events.yaml', '../../../../../yaml/xyz/openbmc_project/State/Leak/Detector.interface.yaml',  ],
     output: [ 'Detector.md' ],
     depend_files: sdbusplusplus_depfiles,
     command: [
diff --git a/yaml/xyz/openbmc_project/Inventory/Item.interface.yaml b/yaml/xyz/openbmc_project/Inventory/Item.interface.yaml
index 68d858f..7ece5b6 100644
--- a/yaml/xyz/openbmc_project/Inventory/Item.interface.yaml
+++ b/yaml/xyz/openbmc_project/Inventory/Item.interface.yaml
@@ -68,10 +68,13 @@
           Any inventory Item (usually Boards or Chassis) can optionally
           implement the 'monitored_by' association to provide a link to the
           chassis intrusion sensor that is monitoring its security state against
-          intrusion events.
+          intrusion events. Objects that implement Item can optionally implement
+          the 'monitored_by' association to provide links to one or more
+          detectors that monitors its state.
       reverse_name: monitoring
       required_endpoint_interfaces:
           - xyz.openbmc_project.Chassis.Intrusion
+          - xyz.openbmc_project.State.Leak.Detector
     - name: powered_by
       description: >
           Objects that implement Item can optionally implement the 'powered_by'
diff --git a/yaml/xyz/openbmc_project/State/Leak/Detector.interface.yaml b/yaml/xyz/openbmc_project/State/Leak/Detector.interface.yaml
new file mode 100644
index 0000000..0dcdc01
--- /dev/null
+++ b/yaml/xyz/openbmc_project/State/Leak/Detector.interface.yaml
@@ -0,0 +1,67 @@
+description: >
+    Implement to provide attributes for leak detector.
+
+properties:
+    - name: PrettyName
+      type: string
+      description: >
+          The human readable name of the leak detector.
+      flags:
+          - readonly
+    - name: State
+      type: enum[self.DetectorState]
+      description: >
+          The state of the leak detector.
+      flags:
+          - readonly
+    - name: Type
+      type: enum[self.DetectorType]
+      description: >
+          The type of the leak detector.
+
+enumerations:
+    - name: DetectorType
+      description: >
+          This indicates the type of leak detector as in Redfish LeakDetector
+          schema https://redfish.dmtf.org/schemas/v1/LeakDetector.v1_2_0.json.
+      values:
+          - name: LeakSensingCable
+            description: >
+                A leak sensing cable.
+          - name: Unknown
+            description: >
+                An unknown detector type
+    - name: DetectorState
+      description: >
+          This indicates the state of the leak detector
+      values:
+          - name: Normal
+            description: >
+                The state is normal as no leaks have been detected by the leak
+                detector.
+          - name: Abnormal
+            description: >
+                A leak has been detected by the leak detector, indicating an
+                abnormal leak state.
+          - name: Unknown
+            description: >
+                The state cannot be determined as the detector may be faulty.
+
+associations:
+    - name: monitoring
+      description: >
+          Leak detectors can optionally implement the 'monitoring' association
+          with the inventory item related to it.
+      reverse_name: monitored_by
+      required_endpoint_interfaces:
+          - xyz.openbmc_project.Inventory.Item
+
+paths:
+    - namespace: /xyz/openbmc_project/state/leak
+      description: >
+          The root path for state of all leak objects.
+      segments:
+          - name: Detector
+            description: >
+                The leak detector.
+            value: detector