forked from microsoft/wmi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNotifyStatus.go
81 lines (68 loc) · 1.79 KB
/
NotifyStatus.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
// 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/instance"
"github.com/microsoft/wmi/pkg/base/query"
"github.com/microsoft/wmi/pkg/errors"
cim "github.com/microsoft/wmi/pkg/wmiinstance"
"reflect"
)
// __NotifyStatus struct
type __NotifyStatus struct {
*cim.WmiInstance
//
StatusCode uint32
}
func New__NotifyStatusEx1(instance *cim.WmiInstance) (newInstance *__NotifyStatus, err error) {
tmp, err := instance, nil
if err != nil {
return
}
newInstance = &__NotifyStatus{
WmiInstance: tmp,
}
return
}
func New__NotifyStatusEx6(hostName string,
wmiNamespace string,
userName string,
password string,
domainName string,
query *query.WmiQuery) (newInstance *__NotifyStatus, err error) {
tmp, err := instance.GetWmiInstance(hostName, wmiNamespace, userName, password, domainName, query)
if err != nil {
return
}
newInstance = &__NotifyStatus{
WmiInstance: tmp,
}
return
}
// SetStatusCode sets the value of StatusCode for the instance
func (instance *__NotifyStatus) SetPropertyStatusCode(value uint32) (err error) {
return instance.SetProperty("StatusCode", (value))
}
// GetStatusCode gets the value of StatusCode for the instance
func (instance *__NotifyStatus) GetPropertyStatusCode() (value uint32, err error) {
retValue, err := instance.GetProperty("StatusCode")
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
}