forked from microsoft/wmi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAggregateEvent.go
110 lines (91 loc) · 2.62 KB
/
AggregateEvent.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
105
106
107
108
109
110
// Copyright 2019 (c) Microsoft Corporation.
// Licensed under the MIT license.
//
// Author:
// Auto Generated on 9/18/2020 using wmigen
// Source root
//////////////////////////////////////////////
package root
import (
"github.com/microsoft/wmi/pkg/base/query"
"github.com/microsoft/wmi/pkg/errors"
cim "github.com/microsoft/wmi/pkg/wmiinstance"
"reflect"
)
// __AggregateEvent struct
type __AggregateEvent struct {
*__IndicationRelated
//
NumberOfEvents uint32
//
Representative interface{}
}
func New__AggregateEventEx1(instance *cim.WmiInstance) (newInstance *__AggregateEvent, err error) {
tmp, err := New__IndicationRelatedEx1(instance)
if err != nil {
return
}
newInstance = &__AggregateEvent{
__IndicationRelated: tmp,
}
return
}
func New__AggregateEventEx6(hostName string,
wmiNamespace string,
userName string,
password string,
domainName string,
query *query.WmiQuery) (newInstance *__AggregateEvent, err error) {
tmp, err := New__IndicationRelatedEx6(hostName, wmiNamespace, userName, password, domainName, query)
if err != nil {
return
}
newInstance = &__AggregateEvent{
__IndicationRelated: tmp,
}
return
}
// SetNumberOfEvents sets the value of NumberOfEvents for the instance
func (instance *__AggregateEvent) SetPropertyNumberOfEvents(value uint32) (err error) {
return instance.SetProperty("NumberOfEvents", (value))
}
// GetNumberOfEvents gets the value of NumberOfEvents for the instance
func (instance *__AggregateEvent) GetPropertyNumberOfEvents() (value uint32, err error) {
retValue, err := instance.GetProperty("NumberOfEvents")
if err != nil {
return
}
if retValue == nil {
// Doesn't have any value. Return empty
return
}
valuetmp, ok := retValue.(uint32)
if !ok {
err = errors.Wrapf(errors.InvalidType, " uint32 is Invalid. Expected %s", reflect.TypeOf(retValue))
return
}
value = uint32(valuetmp)
return
}
// SetRepresentative sets the value of Representative for the instance
func (instance *__AggregateEvent) SetPropertyRepresentative(value interface{}) (err error) {
return instance.SetProperty("Representative", (value))
}
// GetRepresentative gets the value of Representative for the instance
func (instance *__AggregateEvent) GetPropertyRepresentative() (value interface{}, err error) {
retValue, err := instance.GetProperty("Representative")
if err != nil {
return
}
if retValue == nil {
// Doesn't have any value. Return empty
return
}
valuetmp, ok := retValue.(interface{})
if !ok {
err = errors.Wrapf(errors.InvalidType, " interface{} is Invalid. Expected %s", reflect.TypeOf(retValue))
return
}
value = interface{}(valuetmp)
return
}