-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathset_usp_my_fritz_enable.go
31 lines (28 loc) · 1.03 KB
/
set_usp_my_fritz_enable.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
package gateway
import (
"encoding/xml"
"github.com/nitram509/gofritz/pkg/soap"
"github.com/nitram509/gofritz/pkg/tr064model"
)
// SetUSPMyFRITZEnable AUTO-GENERATED (do not edit) code from [x_uspcontrollerSCPD],
// based on SOAP action 'SetUSPMyFRITZEnable', Fritz!Box-System-Version 164.08.00
//
// [x_uspcontrollerSCPD]: http://fritz.box:49000/x_uspcontrollerSCPD.xml
func SetUSPMyFRITZEnable(session *soap.SoapSession, uspMyFritzEnabled bool) (tr064model.SetUSPMyFRITZEnableResponse, error) {
fbAction, err := soap.NewSoapRequest(session).
ReqPath("/upnp/control/x_uspcontroller").
Uri("urn:dslforum-org:service:X_AVM-DE_USPController:1").
Action("SetUSPMyFRITZEnable").
AddBoolParam("NewUSPMyFRITZEnabled", uspMyFritzEnabled).
Do()
if err != nil {
return tr064model.SetUSPMyFRITZEnableResponse{}, err
}
bodyData := fbAction.Body.Data
result := tr064model.SetUSPMyFRITZEnableResponse{}
err = xml.Unmarshal(bodyData, &result)
if err != nil {
return tr064model.SetUSPMyFRITZEnableResponse{}, err
}
return result, nil
}