forked from microsoft/wmi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEventConsumer.go
141 lines (117 loc) · 3.37 KB
/
EventConsumer.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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
// 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"
)
// __EventConsumer struct
type __EventConsumer struct {
*__IndicationRelated
//
CreatorSID []uint8
//
MachineName string
//
MaximumQueueSize uint32
}
func New__EventConsumerEx1(instance *cim.WmiInstance) (newInstance *__EventConsumer, err error) {
tmp, err := New__IndicationRelatedEx1(instance)
if err != nil {
return
}
newInstance = &__EventConsumer{
__IndicationRelated: tmp,
}
return
}
func New__EventConsumerEx6(hostName string,
wmiNamespace string,
userName string,
password string,
domainName string,
query *query.WmiQuery) (newInstance *__EventConsumer, err error) {
tmp, err := New__IndicationRelatedEx6(hostName, wmiNamespace, userName, password, domainName, query)
if err != nil {
return
}
newInstance = &__EventConsumer{
__IndicationRelated: tmp,
}
return
}
// SetCreatorSID sets the value of CreatorSID for the instance
func (instance *__EventConsumer) SetPropertyCreatorSID(value []uint8) (err error) {
return instance.SetProperty("CreatorSID", (value))
}
// GetCreatorSID gets the value of CreatorSID for the instance
func (instance *__EventConsumer) GetPropertyCreatorSID() (value []uint8, err error) {
retValue, err := instance.GetProperty("CreatorSID")
if err != nil {
return
}
if retValue == nil {
// Doesn't have any value. Return empty
return
}
for _, interfaceValue := range retValue.([]interface{}) {
valuetmp, ok := interfaceValue.(uint8)
if !ok {
err = errors.Wrapf(errors.InvalidType, " uint8 is Invalid. Expected %s", reflect.TypeOf(interfaceValue))
return
}
value = append(value, uint8(valuetmp))
}
return
}
// SetMachineName sets the value of MachineName for the instance
func (instance *__EventConsumer) SetPropertyMachineName(value string) (err error) {
return instance.SetProperty("MachineName", (value))
}
// GetMachineName gets the value of MachineName for the instance
func (instance *__EventConsumer) GetPropertyMachineName() (value string, err error) {
retValue, err := instance.GetProperty("MachineName")
if err != nil {
return
}
if retValue == nil {
// Doesn't have any value. Return empty
return
}
valuetmp, ok := retValue.(string)
if !ok {
err = errors.Wrapf(errors.InvalidType, " string is Invalid. Expected %s", reflect.TypeOf(retValue))
return
}
value = string(valuetmp)
return
}
// SetMaximumQueueSize sets the value of MaximumQueueSize for the instance
func (instance *__EventConsumer) SetPropertyMaximumQueueSize(value uint32) (err error) {
return instance.SetProperty("MaximumQueueSize", (value))
}
// GetMaximumQueueSize gets the value of MaximumQueueSize for the instance
func (instance *__EventConsumer) GetPropertyMaximumQueueSize() (value uint32, err error) {
retValue, err := instance.GetProperty("MaximumQueueSize")
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
}