-
Notifications
You must be signed in to change notification settings - Fork 1
/
xavm_set_wan_access_type.go
31 lines (28 loc) · 1.03 KB
/
xavm_set_wan_access_type.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 wan
import (
"encoding/xml"
"github.com/nitram509/gofritz/pkg/soap"
"github.com/nitram509/gofritz/pkg/tr064model"
)
// XavmSetWANAccessType AUTO-GENERATED (do not edit) code from [wancommonifconfigSCPD],
// based on SOAP action 'X_AVM-DE_SetWANAccessType', Fritz!Box-System-Version 164.07.57
//
// [wancommonifconfigSCPD]: http://fritz.box:49000/wancommonifconfigSCPD.xml
func XavmSetWANAccessType(session *soap.SoapSession, accessType string) (tr064model.XavmSetWANAccessTypeResponse, error) {
fbAction, err := soap.NewSoapRequest(session).
ReqPath("/upnp/control/wancommonifconfig1").
Uri("urn:dslforum-org:service:WANCommonInterfaceConfig:1").
Action("X_AVM-DE_SetWANAccessType").
AddStringParam("NewAccessType", accessType).
Do()
if err != nil {
return tr064model.XavmSetWANAccessTypeResponse{}, err
}
bodyData := fbAction.Body.Data
result := tr064model.XavmSetWANAccessTypeResponse{}
err = xml.Unmarshal(bodyData, &result)
if err != nil {
return tr064model.XavmSetWANAccessTypeResponse{}, err
}
return result, nil
}