leak detection: add support for detector groups

Add support for leak detector groups alongwith appropriate association
to the leak detectors. For more details on leak detector groups refer to
- https://redfish.dmtf.org/schemas/v1/LeakDetection.v1_1_0.json.

Change-Id: I6f31adf2d806ef4f0c7dade94432581f2b10c8a3
Signed-off-by: Jagpal Singh Gill <paligill@gmail.com>
diff --git a/gen/xyz/openbmc_project/State/Leak/DetectorGroup/meson.build b/gen/xyz/openbmc_project/State/Leak/DetectorGroup/meson.build
new file mode 100644
index 0000000..8029998
--- /dev/null
+++ b/gen/xyz/openbmc_project/State/Leak/DetectorGroup/meson.build
@@ -0,0 +1,35 @@
+# Generated file; do not modify.
+
+sdbusplus_current_path = 'xyz/openbmc_project/State/Leak/DetectorGroup'
+
+generated_sources += custom_target(
+    'xyz/openbmc_project/State/Leak/DetectorGroup__cpp'.underscorify(),
+    input: [
+        '../../../../../../yaml/xyz/openbmc_project/State/Leak/DetectorGroup.interface.yaml',
+    ],
+    output: [
+        'common.hpp',
+        'server.hpp',
+        'server.cpp',
+        'aserver.hpp',
+        'client.hpp',
+    ],
+    depend_files: sdbusplusplus_depfiles,
+    command: [
+        sdbuspp_gen_meson_prog, '--command', 'cpp',
+        '--output', meson.current_build_dir(),
+        '--tool', sdbusplusplus_prog,
+        '--directory', meson.current_source_dir() / '../../../../../../yaml',
+        'xyz/openbmc_project/State/Leak/DetectorGroup',
+    ],
+    install: should_generate_cpp,
+    install_dir: [
+        get_option('includedir') / sdbusplus_current_path,
+        get_option('includedir') / sdbusplus_current_path,
+        false,
+        get_option('includedir') / sdbusplus_current_path,
+        get_option('includedir') / sdbusplus_current_path,
+    ],
+    build_by_default: should_generate_cpp,
+)
+
diff --git a/gen/xyz/openbmc_project/State/Leak/meson.build b/gen/xyz/openbmc_project/State/Leak/meson.build
index b9faeb8..9413a82 100644
--- a/gen/xyz/openbmc_project/State/Leak/meson.build
+++ b/gen/xyz/openbmc_project/State/Leak/meson.build
@@ -1,5 +1,6 @@
 # Generated file; do not modify.
 subdir('Detector')
+subdir('DetectorGroup')
 
 sdbusplus_current_path = 'xyz/openbmc_project/State/Leak'
 
@@ -37,3 +38,20 @@
     build_by_default: should_generate_registry,
 )
 
+generated_markdown += custom_target(
+    'xyz/openbmc_project/State/Leak/DetectorGroup__markdown'.underscorify(),
+    input: [ '../../../../../yaml/xyz/openbmc_project/State/Leak/DetectorGroup.interface.yaml',  ],
+    output: [ 'DetectorGroup.md' ],
+    depend_files: sdbusplusplus_depfiles,
+    command: [
+        sdbuspp_gen_meson_prog, '--command', 'markdown',
+        '--output', meson.current_build_dir(),
+        '--tool', sdbusplusplus_prog,
+        '--directory', meson.current_source_dir() / '../../../../../yaml',
+        'xyz/openbmc_project/State/Leak/DetectorGroup',
+    ],
+    install: should_generate_markdown,
+    install_dir: [inst_markdown_dir / sdbusplus_current_path],
+    build_by_default: should_generate_markdown,
+)
+
diff --git a/yaml/xyz/openbmc_project/State/Leak/Detector.interface.yaml b/yaml/xyz/openbmc_project/State/Leak/Detector.interface.yaml
index 0dcdc01..d412192 100644
--- a/yaml/xyz/openbmc_project/State/Leak/Detector.interface.yaml
+++ b/yaml/xyz/openbmc_project/State/Leak/Detector.interface.yaml
@@ -55,6 +55,13 @@
       reverse_name: monitored_by
       required_endpoint_interfaces:
           - xyz.openbmc_project.Inventory.Item
+    - name: contained_by
+      description: >
+          Leak detectors can optionally implement the 'contained_by' association
+          with the detector group related to it.
+      reverse_name: containing
+      required_endpoint_interfaces:
+          - xyz.openbmc_project.State.Leak.DetectorGroup
 
 paths:
     - namespace: /xyz/openbmc_project/state/leak
diff --git a/yaml/xyz/openbmc_project/State/Leak/DetectorGroup.interface.yaml b/yaml/xyz/openbmc_project/State/Leak/DetectorGroup.interface.yaml
new file mode 100644
index 0000000..dd982f8
--- /dev/null
+++ b/yaml/xyz/openbmc_project/State/Leak/DetectorGroup.interface.yaml
@@ -0,0 +1,38 @@
+description: >
+    Implement to provide attributes for leak detector group. This group
+    represents a collection of leak detectors that reports a unified status.
+
+properties:
+    - name: PrettyName
+      type: string
+      description: >
+          The human readable name of the leak detector group.
+      flags:
+          - readonly
+    - name: State
+      type: enum[xyz.openbmc_project.State.Leak.Detector.DetectorState]
+      description: >
+          This is the overall status of the group, which is determined by
+          aggregating the state from all member leak detectors.
+      flags:
+          - readonly
+
+associations:
+    - name: containing
+      description: >
+          The leak detector group can optionally implement the 'containing'
+          association to provide one or more links to leak detectors which it
+          contains.
+      reverse_name: contained_by
+      required_endpoint_interfaces:
+          - xyz.openbmc_project.State.Leak.Detector
+
+paths:
+    - namespace: /xyz/openbmc_project/state/leak
+      description: >
+          The root path for state of all leak objects.
+      segments:
+          - name: DetectorGroup
+            description: >
+                The leak detector group.
+            value: detectorgroup