@@ -98,6 +98,16 @@ func (dr *DevicesResource) GetPostureAttributes(ctx context.Context, deviceID st
98
98
return body [DevicePostureAttributes ](dr , req )
99
99
}
100
100
101
+ // SetPostureAttribute sets the posture attribute of the device identified by deviceID.
102
+ func (dr * DevicesResource ) SetPostureAttribute (ctx context.Context , deviceID , attributeKey string , request DevicePostureAttributeRequest ) error {
103
+ req , err := dr .buildRequest (ctx , http .MethodPost , dr .buildURL ("device" , deviceID , "attributes" , attributeKey ), requestBody (request ))
104
+ if err != nil {
105
+ return err
106
+ }
107
+
108
+ return dr .do (req , nil )
109
+ }
110
+
101
111
// List lists every [Device] in the tailnet.
102
112
func (dr * DevicesResource ) List (ctx context.Context ) ([]Device , error ) {
103
113
req , err := dr .buildRequest (ctx , http .MethodGet , dr .buildTailnetURL ("devices" ))
@@ -136,7 +146,7 @@ func (dr *DevicesResource) Delete(ctx context.Context, deviceID string) error {
136
146
return dr .do (req , nil )
137
147
}
138
148
139
- // SetName updates the name of the device by deviceID.
149
+ // SetName updates the name of the device identified by deviceID.
140
150
func (dr * DevicesResource ) SetName (ctx context.Context , deviceID , name string ) error {
141
151
req , err := dr .buildRequest (ctx , http .MethodPost , dr .buildURL ("device" , deviceID , "name" ), requestBody (map [string ]string {
142
152
"name" : name ,
@@ -160,16 +170,6 @@ func (dr *DevicesResource) SetTags(ctx context.Context, deviceID string, tags []
160
170
return dr .do (req , nil )
161
171
}
162
172
163
- // SetPostureAttribute sets the posture attribute of the device identified by deviceID.
164
- func (dr * DevicesResource ) SetPostureAttribute (ctx context.Context , deviceID , attributeKey string , request DevicePostureAttributeRequest ) error {
165
- req , err := dr .buildRequest (ctx , http .MethodPost , dr .buildURL ("device" , deviceID , "attributes" , attributeKey ), requestBody (request ))
166
- if err != nil {
167
- return err
168
- }
169
-
170
- return dr .do (req , nil )
171
- }
172
-
173
173
// DeviceKey type represents the properties of the key of an individual device within
174
174
// the tailnet.
175
175
type DeviceKey struct {
0 commit comments