-
Notifications
You must be signed in to change notification settings - Fork 1
/
set_avm_tam_enable.go
32 lines (29 loc) · 968 Bytes
/
set_avm_tam_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
32
package gateway
import (
"encoding/xml"
"github.com/nitram509/gofritz/pkg/soap"
"github.com/nitram509/gofritz/pkg/tr064model"
)
// SetAvmTamEnable AUTO-GENERATED (do not edit) code from [x_tamSCPD],
// based on SOAP action 'SetEnable', Fritz!Box-System-Version 164.07.57
//
// [x_tamSCPD]: http://fritz.box:49000/x_tamSCPD.xml
func SetAvmTamEnable(session *soap.SoapSession, index int, enable bool) (tr064model.SetAvmTamEnableResponse, error) {
fbAction, err := soap.NewSoapRequest(session).
ReqPath("/upnp/control/x_tam").
Uri("urn:dslforum-org:service:X_AVM-DE_TAM:1").
Action("SetEnable").
AddIntParam("NewIndex", index).
AddBoolParam("NewEnable", enable).
Do()
if err != nil {
return tr064model.SetAvmTamEnableResponse{}, err
}
bodyData := fbAction.Body.Data
result := tr064model.SetAvmTamEnableResponse{}
err = xml.Unmarshal(bodyData, &result)
if err != nil {
return tr064model.SetAvmTamEnableResponse{}, err
}
return result, nil
}