forked from stmcginnis/gofish
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathleakdetector.go
104 lines (94 loc) · 4.48 KB
/
leakdetector.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
//
// SPDX-License-Identifier: BSD-3-Clause
//
package redfish
import (
"encoding/json"
"github.com/stmcginnis/gofish/common"
)
type LeakDetectorType string
const (
// MoistureLeakDetectorType A moisture sensor.
MoistureLeakDetectorType LeakDetectorType = "Moisture"
// FloatSwitchLeakDetectorType A float switch.
FloatSwitchLeakDetectorType LeakDetectorType = "FloatSwitch"
)
// LeakDetector shall represent a state-based or digital-value leak detector for a Redfish implementation.
type LeakDetector struct {
common.Entity
// ODataContext is the odata context.
ODataContext string `json:"@odata.context"`
// ODataEtag is the odata etag.
ODataEtag string `json:"@odata.etag"`
// ODataType is the odata type.
ODataType string `json:"@odata.type"`
// Description provides a description of this resource.
Description string
// DetectorState shall contain the state of the leak detector.
DetectorState common.Health
// LeakDetectorType shall contain the reading type of the leak detection sensor.
LeakDetectorType LeakDetectorType
// Location shall indicate the location information for this leak detector.
Location common.Location
// Manufacturer shall contain the name of the organization responsible for producing the leak detector. This
// organization may be the entity from whom the leak detector is purchased, but this is not necessarily true.
Manufacturer string
// Model shall contain the name by which the manufacturer generally refers to the leak detector.
Model string
// Oem shall contain the OEM extensions. All values for properties that this object contains shall conform to the
// Redfish Specification-described requirements.
OEM json.RawMessage `json:"Oem"`
// PartNumber shall contain a part number assigned by the organization that is responsible for producing or
// manufacturing the leak detector.
PartNumber string
// PhysicalContext shall contain a description of the affected component or region within the equipment to which
// this leak detector applies.
PhysicalContext PhysicalContext
// PhysicalSubContext shall contain a description of the usage or sub-region within the equipment to which this
// leak detector applies. This property generally differentiates multiple leak detectors within the same
// PhysicalContext instance.
PhysicalSubContext PhysicalSubContext
// SKU shall contain the stock-keeping unit number for this leak detector.
SKU string
// SensingFrequency shall contain the time interval between readings of the physical leak detector.
SensingFrequency float64
// SerialNumber shall contain a manufacturer-allocated number that identifies the leak detector.
SerialNumber string
// SparePartNumber shall contain the spare part number of the leak detector.
SparePartNumber string
// Status shall contain any status or health properties of the resource.
Status common.Status
}
// GetLeakDetector will get a LeakDetector instance from the service.
func GetLeakDetector(c common.Client, uri string) (*LeakDetector, error) {
return common.GetObject[LeakDetector](c, uri)
}
// ListReferencedLeakDetectors gets the collection of LeakDetector from
// a provided reference.
func ListReferencedLeakDetectors(c common.Client, link string) ([]*LeakDetector, error) {
return common.GetCollectionObjects[LeakDetector](c, link)
}
// LeakDetectorArrayExcerpt shall represent a state-based or digital-value leak detector for a Redfish
// implementation.
type LeakDetectorArrayExcerpt struct {
// DataSourceURI shall contain a URI to the resource that provides the source of the excerpt contained within this
// copy.
DataSourceURI string
// DetectorState shall contain the state of the leak detector.
DetectorState common.Health
// PhysicalContext shall contain a description of the affected component or region within the equipment to which
// this leak detector applies.
PhysicalContext PhysicalContext
// PhysicalSubContext shall contain a description of the usage or sub-region within the equipment to which this
// leak detector applies. This property generally differentiates multiple leak detectors within the same
// PhysicalContext instance.
PhysicalSubContext PhysicalSubContext
}
// LeakDetectorExcerpt shall represent a state-based or digital-value leak detector for a Redfish implementation.
type LeakDetectorExcerpt struct {
// DataSourceURI shall contain a URI to the resource that provides the source of the excerpt contained within this
// copy.
DataSourceURI string
// DetectorState shall contain the state of the leak detector.
DetectorState common.Health
}