mirror of
https://github.com/kerberos-io/onvif.git
synced 2026-08-23 15:08:33 +00:00
Merge pull request #22 from jfsmig/fixes-ws-discovery-20220510
Misc. fixes in the WS discovery
This commit is contained in:
50
Device.go
50
Device.go
@@ -3,7 +3,6 @@ package onvif
|
||||
import (
|
||||
"encoding/xml"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@@ -108,50 +107,37 @@ func readResponse(resp *http.Response) string {
|
||||
}
|
||||
|
||||
//GetAvailableDevicesAtSpecificEthernetInterface ...
|
||||
func GetAvailableDevicesAtSpecificEthernetInterface(interfaceName string) []Device {
|
||||
/*
|
||||
Call an ws-discovery Probe Message to Discover NVT type Devices
|
||||
*/
|
||||
devices := wsdiscovery.SendProbe(interfaceName, nil, []string{"dn:" + NVT.String()}, map[string]string{"dn": "http://www.onvif.org/ver10/network/wsdl"})
|
||||
func GetAvailableDevicesAtSpecificEthernetInterface(interfaceName string) ([]Device, error) {
|
||||
// Call a ws-discovery Probe Message to Discover NVT type Devices
|
||||
devices, err := wsdiscovery.SendProbe(interfaceName, nil, []string{"dn:" + NVT.String()}, map[string]string{"dn": "http://www.onvif.org/ver10/network/wsdl"})
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
nvtDevicesSeen := make(map[string]bool)
|
||||
nvtDevices := make([]Device, 0)
|
||||
|
||||
for _, j := range devices {
|
||||
doc := etree.NewDocument()
|
||||
if err := doc.ReadFromString(j); err != nil {
|
||||
fmt.Errorf("%s", err.Error())
|
||||
return nil
|
||||
return nil, err
|
||||
}
|
||||
|
||||
endpoints := doc.Root().FindElements("./Body/ProbeMatches/ProbeMatch/XAddrs")
|
||||
for _, xaddr := range endpoints {
|
||||
for _, xaddr := range doc.Root().FindElements("./Body/ProbeMatches/ProbeMatch/XAddrs") {
|
||||
xaddr := strings.Split(strings.Split(xaddr.Text(), " ")[0], "/")[2]
|
||||
fmt.Println(xaddr)
|
||||
c := 0
|
||||
|
||||
for c = 0; c < len(nvtDevices); c++ {
|
||||
if nvtDevices[c].params.Xaddr == xaddr {
|
||||
fmt.Println(nvtDevices[c].params.Xaddr, "==", xaddr)
|
||||
break
|
||||
if !nvtDevicesSeen[xaddr] {
|
||||
dev, err := NewDevice(DeviceParams{Xaddr: strings.Split(xaddr, " ")[0]})
|
||||
if err != nil {
|
||||
// TODO(jfsmig) print a warning
|
||||
} else {
|
||||
nvtDevicesSeen[xaddr] = true
|
||||
nvtDevices = append(nvtDevices, *dev)
|
||||
}
|
||||
}
|
||||
|
||||
if c < len(nvtDevices) {
|
||||
continue
|
||||
}
|
||||
|
||||
dev, err := NewDevice(DeviceParams{Xaddr: strings.Split(xaddr, " ")[0]})
|
||||
|
||||
if err != nil {
|
||||
fmt.Println("Error", xaddr)
|
||||
fmt.Println(err)
|
||||
continue
|
||||
} else {
|
||||
nvtDevices = append(nvtDevices, *dev)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nvtDevices
|
||||
return nvtDevices, nil
|
||||
}
|
||||
|
||||
func (dev *Device) getSupportedServices(resp *http.Response) {
|
||||
|
||||
134
api/api.go
134
api/api.go
@@ -1,14 +1,17 @@
|
||||
package api
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
"path"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/juju/errors"
|
||||
"github.com/rs/zerolog"
|
||||
|
||||
"github.com/beevik/etree"
|
||||
"github.com/gin-gonic/gin"
|
||||
@@ -18,6 +21,18 @@ import (
|
||||
wsdiscovery "github.com/use-go/onvif/ws-discovery"
|
||||
)
|
||||
|
||||
var (
|
||||
// LoggerContext is the builder of a zerolog.Logger that is exposed to the application so that
|
||||
// options at the CLI might alter the formatting and the output of the logs.
|
||||
LoggerContext = zerolog.
|
||||
New(zerolog.ConsoleWriter{Out: os.Stderr, TimeFormat: time.RFC3339}).
|
||||
With().Timestamp()
|
||||
|
||||
// Logger is a zerolog logger, that can be safely used from any part of the application.
|
||||
// It gathers the format and the output.
|
||||
Logger = LoggerContext.Logger()
|
||||
)
|
||||
|
||||
func RunApi() {
|
||||
router := gin.Default()
|
||||
|
||||
@@ -32,7 +47,7 @@ func RunApi() {
|
||||
xaddr := c.GetHeader("xaddr")
|
||||
acceptedData, err := c.GetRawData()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
Logger.Debug().Err(err).Msg("Failed to get rawx data")
|
||||
}
|
||||
|
||||
message, err := callNecessaryMethod(serviceName, methodName, string(acceptedData), username, pass, xaddr)
|
||||
@@ -49,45 +64,45 @@ func RunApi() {
|
||||
|
||||
interfaceName := context.GetHeader("interface")
|
||||
|
||||
var response = "["
|
||||
devices := wsdiscovery.SendProbe(interfaceName, nil, []string{"dn:NetworkVideoTransmitter"}, map[string]string{"dn": "http://www.onvif.org/ver10/network/wsdl"})
|
||||
devices, err := wsdiscovery.SendProbe(interfaceName, nil, []string{"dn:NetworkVideoTransmitter"}, map[string]string{"dn": "http://www.onvif.org/ver10/network/wsdl"})
|
||||
if err != nil {
|
||||
context.String(http.StatusInternalServerError, "error")
|
||||
} else {
|
||||
response := "["
|
||||
|
||||
for _, j := range devices {
|
||||
doc := etree.NewDocument()
|
||||
if err := doc.ReadFromString(j); err != nil {
|
||||
context.XML(http.StatusBadRequest, err.Error())
|
||||
} else {
|
||||
for _, j := range devices {
|
||||
doc := etree.NewDocument()
|
||||
if err := doc.ReadFromString(j); err != nil {
|
||||
context.XML(http.StatusBadRequest, err.Error())
|
||||
} else {
|
||||
|
||||
endpoints := doc.Root().FindElements("./Body/ProbeMatches/ProbeMatch/XAddrs")
|
||||
scopes := doc.Root().FindElements("./Body/ProbeMatches/ProbeMatch/Scopes")
|
||||
endpoints := doc.Root().FindElements("./Body/ProbeMatches/ProbeMatch/XAddrs")
|
||||
scopes := doc.Root().FindElements("./Body/ProbeMatches/ProbeMatch/Scopes")
|
||||
|
||||
flag := false
|
||||
flag := false
|
||||
|
||||
for _, xaddr := range endpoints {
|
||||
xaddr := strings.Split(strings.Split(xaddr.Text(), " ")[0], "/")[2]
|
||||
if strings.Contains(response, xaddr) {
|
||||
flag = true
|
||||
for _, xaddr := range endpoints {
|
||||
xaddr := strings.Split(strings.Split(xaddr.Text(), " ")[0], "/")[2]
|
||||
if strings.Contains(response, xaddr) {
|
||||
flag = true
|
||||
break
|
||||
}
|
||||
response += "{"
|
||||
response += `"url":"` + xaddr + `",`
|
||||
}
|
||||
if flag {
|
||||
break
|
||||
}
|
||||
response += "{"
|
||||
response += `"url":"` + xaddr + `",`
|
||||
for _, scope := range scopes {
|
||||
re := regexp.MustCompile(`onvif:\/\/www\.onvif\.org\/name\/[A-Za-z0-9-]+`)
|
||||
match := re.FindStringSubmatch(scope.Text())
|
||||
response += `"name":"` + path.Base(match[0]) + `"`
|
||||
}
|
||||
response += "},"
|
||||
}
|
||||
if flag {
|
||||
break
|
||||
}
|
||||
for _, scope := range scopes {
|
||||
re := regexp.MustCompile(`onvif:\/\/www\.onvif\.org\/name\/[A-Za-z0-9-]+`)
|
||||
match := re.FindStringSubmatch(scope.Text())
|
||||
response += `"name":"` + path.Base(match[0]) + `"`
|
||||
}
|
||||
response += "},"
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
response = strings.TrimRight(response, ",")
|
||||
response += "]"
|
||||
if response != "" {
|
||||
response = strings.TrimRight(response, ",")
|
||||
response += "]"
|
||||
context.String(http.StatusOK, response)
|
||||
}
|
||||
})
|
||||
@@ -95,25 +110,6 @@ func RunApi() {
|
||||
router.Run()
|
||||
}
|
||||
|
||||
//func soapHandling(tp interface{}, tags* map[string]string) {
|
||||
// ifaceValue := reflect.ValueOf(tp).Elem()
|
||||
// typeOfStruct := ifaceValue.Type()
|
||||
// if ifaceValue.Kind() != reflect.Struct {
|
||||
// return
|
||||
// }
|
||||
// for i := 0; i < ifaceValue.NumField(); i++ {
|
||||
// field := ifaceValue.Field(i)
|
||||
// tg, err := typeOfStruct.FieldByName(typeOfStruct.Field(i).Name)
|
||||
// if err == false {
|
||||
// fmt.Println(err)
|
||||
// }
|
||||
// (*tags)[typeOfStruct.Field(i).Name] = string(tg.Tag)
|
||||
//
|
||||
// subStruct := reflect.New(reflect.TypeOf( field.Interface() ))
|
||||
// soapHandling(subStruct.Interface(), tags)
|
||||
// }
|
||||
//}
|
||||
|
||||
func callNecessaryMethod(serviceName, methodName, acceptedData, username, password, xaddr string) (string, error) {
|
||||
var methodStruct interface{}
|
||||
var err error
|
||||
@@ -129,17 +125,17 @@ func callNecessaryMethod(serviceName, methodName, acceptedData, username, passwo
|
||||
return "", errors.New("there is no such service")
|
||||
}
|
||||
if err != nil { //done
|
||||
return "", err
|
||||
return "", errors.Annotate(err, "getStructByName")
|
||||
}
|
||||
|
||||
resp, err := xmlAnalize(methodStruct, &acceptedData)
|
||||
if err != nil {
|
||||
return "", err
|
||||
return "", errors.Annotate(err, "xmlAnalize")
|
||||
}
|
||||
|
||||
endpoint, err := getEndpoint(serviceName, xaddr)
|
||||
if err != nil {
|
||||
return "", err
|
||||
return "", errors.Annotate(err, "getEndpoint")
|
||||
}
|
||||
|
||||
soap := gosoap.NewEmptySOAP()
|
||||
@@ -149,12 +145,12 @@ func callNecessaryMethod(serviceName, methodName, acceptedData, username, passwo
|
||||
|
||||
servResp, err := networking.SendSoap(new(http.Client), endpoint, soap.String())
|
||||
if err != nil {
|
||||
return "", err
|
||||
return "", errors.Annotate(err, "SendSoap")
|
||||
}
|
||||
|
||||
rsp, err := ioutil.ReadAll(servResp.Body)
|
||||
if err != nil {
|
||||
return "", err
|
||||
return "", errors.Annotate(err, "ReadAll")
|
||||
}
|
||||
|
||||
return string(rsp), nil
|
||||
@@ -163,7 +159,7 @@ func callNecessaryMethod(serviceName, methodName, acceptedData, username, passwo
|
||||
func getEndpoint(service, xaddr string) (string, error) {
|
||||
dev, err := onvif.NewDevice(onvif.DeviceParams{Xaddr: xaddr})
|
||||
if err != nil {
|
||||
return "", err
|
||||
return "", errors.Annotate(err, "NewDevice")
|
||||
}
|
||||
pkg := strings.ToLower(service)
|
||||
|
||||
@@ -193,7 +189,7 @@ func xmlAnalize(methodStruct interface{}, acceptedData *string) (*string, error)
|
||||
|
||||
doc := etree.NewDocument()
|
||||
if err := doc.ReadFromString(*acceptedData); err != nil {
|
||||
return nil, err
|
||||
return nil, errors.Annotate(err, "readFromString")
|
||||
}
|
||||
etr := doc.FindElements("./*")
|
||||
xmlUnmarshal(etr, &testunMarshal, &mas)
|
||||
@@ -207,7 +203,7 @@ func xmlAnalize(methodStruct interface{}, acceptedData *string) (*string, error)
|
||||
lst := (testunMarshal)[lstIndex]
|
||||
elemName, attr, value, err := xmlMaker(&lst, &test, lstIndex)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errors.Annotate(err, "xmlMarker")
|
||||
}
|
||||
|
||||
if mas[lstIndex] == "Push" && lstIndex == 0 { //done
|
||||
@@ -251,10 +247,10 @@ func xmlAnalize(methodStruct interface{}, acceptedData *string) (*string, error)
|
||||
|
||||
resp, err := document.WriteToString()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
return nil, errors.Annotate(err, "writeToString")
|
||||
}
|
||||
|
||||
return &resp, err
|
||||
return &resp, nil
|
||||
}
|
||||
|
||||
func xmlMaker(lst *[]interface{}, tags *[]map[string]string, lstIndex int) (string, map[string]string, string, error) {
|
||||
@@ -273,13 +269,13 @@ func xmlMaker(lst *[]interface{}, tags *[]map[string]string, lstIndex int) (stri
|
||||
if index == 0 && lstIndex == 0 {
|
||||
res, err := xmlProcessing(tg["XMLName"])
|
||||
if err != nil {
|
||||
return "", nil, "", err
|
||||
return "", nil, "", errors.Annotate(err, "xmlProcessing")
|
||||
}
|
||||
elemName = res
|
||||
} else if index == 0 {
|
||||
res, err := xmlProcessing(tg[conversion])
|
||||
if err != nil {
|
||||
return "", nil, "", err
|
||||
return "", nil, "", errors.Annotate(err, "xmlProcessing")
|
||||
}
|
||||
elemName = res
|
||||
} else {
|
||||
@@ -314,8 +310,6 @@ func xmlProcessing(tg string) (string, error) {
|
||||
} else {
|
||||
return str[1][0:omitAttr], nil
|
||||
}
|
||||
|
||||
return "", errors.New("something went wrong")
|
||||
}
|
||||
|
||||
func mapProcessing(mapVar []map[string]string) []map[string]string {
|
||||
@@ -343,9 +337,9 @@ func soapHandling(tp interface{}, tags *[]map[string]string) {
|
||||
}
|
||||
for i := 0; i < s.NumField(); i++ {
|
||||
f := s.Field(i)
|
||||
tmp, err := typeOfT.FieldByName(typeOfT.Field(i).Name)
|
||||
if err == false {
|
||||
fmt.Println(err)
|
||||
tmp, ok := typeOfT.FieldByName(typeOfT.Field(i).Name)
|
||||
if !ok {
|
||||
Logger.Debug().Str("field", typeOfT.Field(i).Name).Msg("reflection failed")
|
||||
}
|
||||
*tags = append(*tags, map[string]string{typeOfT.Field(i).Name: string(tmp.Tag)})
|
||||
subStruct := reflect.New(reflect.TypeOf(f.Interface()))
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
goonvif "github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/device"
|
||||
"github.com/use-go/onvif/gosoap"
|
||||
sdk "github.com/use-go/onvif/sdk/device"
|
||||
"github.com/use-go/onvif/xsd/onvif"
|
||||
)
|
||||
|
||||
@@ -17,15 +17,9 @@ const (
|
||||
password = "Supervisor"
|
||||
)
|
||||
|
||||
func readResponse(resp *http.Response) string {
|
||||
b, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
return string(b)
|
||||
}
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
|
||||
//Getting an camera instance
|
||||
dev, err := goonvif.NewDevice(goonvif.DeviceParams{
|
||||
Xaddr: "192.168.13.14:80",
|
||||
@@ -40,34 +34,34 @@ func main() {
|
||||
//Preparing commands
|
||||
systemDateAndTyme := device.GetSystemDateAndTime{}
|
||||
getCapabilities := device.GetCapabilities{Category: "All"}
|
||||
createUser := device.CreateUsers{User: onvif.User{
|
||||
Username: "TestUser",
|
||||
Password: "TestPassword",
|
||||
UserLevel: "User",
|
||||
},
|
||||
createUser := device.CreateUsers{
|
||||
User: onvif.User{
|
||||
Username: "TestUser",
|
||||
Password: "TestPassword",
|
||||
UserLevel: "User",
|
||||
},
|
||||
}
|
||||
|
||||
//Commands execution
|
||||
systemDateAndTymeResponse, err := dev.CallMethod(systemDateAndTyme)
|
||||
systemDateAndTymeResponse, err := sdk.Call_GetSystemDateAndTime(ctx, dev, systemDateAndTyme)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
} else {
|
||||
fmt.Println(readResponse(systemDateAndTymeResponse))
|
||||
fmt.Println(systemDateAndTymeResponse)
|
||||
}
|
||||
getCapabilitiesResponse, err := dev.CallMethod(getCapabilities)
|
||||
getCapabilitiesResponse, err := sdk.Call_GetCapabilities(ctx, dev, getCapabilities)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
} else {
|
||||
fmt.Println(readResponse(getCapabilitiesResponse))
|
||||
fmt.Println(getCapabilitiesResponse)
|
||||
}
|
||||
createUserResponse, err := dev.CallMethod(createUser)
|
||||
|
||||
createUserResponse, err := sdk.Call_CreateUsers(ctx, dev, createUser)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
} else {
|
||||
/*
|
||||
You could use https://github.com/use-go/onvif/gosoap for pretty printing response
|
||||
*/
|
||||
fmt.Println(gosoap.SoapMessage(readResponse(createUserResponse)).StringIndent())
|
||||
// You could use https://github.com/use-go/onvif/gosoap for pretty printing response
|
||||
fmt.Println(createUserResponse)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package example
|
||||
package main
|
||||
|
||||
import (
|
||||
"encoding/json"
|
||||
@@ -16,12 +16,8 @@ import (
|
||||
)
|
||||
|
||||
func TestGetAvailableDevicesAtSpecificEthernetInterface(t *testing.T) {
|
||||
|
||||
// client()
|
||||
// runDiscovery("en0")
|
||||
s := onvif.GetAvailableDevicesAtSpecificEthernetInterface("en0")
|
||||
|
||||
log.Printf("%s", s)
|
||||
s, err := onvif.GetAvailableDevicesAtSpecificEthernetInterface("en0")
|
||||
log.Printf("%v %v", err, s)
|
||||
}
|
||||
|
||||
func client() {
|
||||
@@ -45,7 +41,11 @@ type Host struct {
|
||||
|
||||
func runDiscovery(interfaceName string) {
|
||||
var hosts []*Host
|
||||
devices := discover.SendProbe(interfaceName, nil, []string{"dn:NetworkVideoTransmitter"}, map[string]string{"dn": "http://www.onvif.org/ver10/network/wsdl"})
|
||||
devices, err := discover.SendProbe(interfaceName, nil, []string{"dn:NetworkVideoTransmitter"}, map[string]string{"dn": "http://www.onvif.org/ver10/network/wsdl"})
|
||||
if err != nil {
|
||||
log.Printf("error %s", err)
|
||||
return
|
||||
}
|
||||
for _, j := range devices {
|
||||
doc := etree.NewDocument()
|
||||
if err := doc.ReadFromString(j); err != nil {
|
||||
|
||||
4
go.mod
4
go.mod
@@ -7,5 +7,7 @@ require (
|
||||
github.com/elgs/gostrgen v0.0.0-20161222160715-9d61ae07eeae
|
||||
github.com/gin-gonic/gin v1.7.0
|
||||
github.com/gofrs/uuid v3.2.0+incompatible
|
||||
golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0
|
||||
github.com/juju/errors v0.0.0-20220331221717-b38fca44723b
|
||||
github.com/rs/zerolog v1.26.1
|
||||
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d
|
||||
)
|
||||
|
||||
46
go.sum
46
go.sum
@@ -1,5 +1,7 @@
|
||||
github.com/beevik/etree v1.1.0 h1:T0xke/WvNtMoCqgzPhkX2r4rjY3GDZFi+FjpRZY2Jbs=
|
||||
github.com/beevik/etree v1.1.0/go.mod h1:r8Aw8JqVegEf0w2fDnATrX9VpkMcyFeM0FhwO62wh+A=
|
||||
github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
|
||||
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
@@ -17,6 +19,7 @@ github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD87
|
||||
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
|
||||
github.com/go-playground/validator/v10 v10.4.1 h1:pH2c5ADXtd66mxoE0Zm9SUhxE20r7aM3F26W0hOn+GE=
|
||||
github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4=
|
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/gofrs/uuid v3.2.0+incompatible h1:y12jRkkFxsd7GpqdSZ+/KCs/fJbqpEXSGd4+jfEaewE=
|
||||
github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
|
||||
github.com/golang/protobuf v1.3.3 h1:gyjaxf+svBWX08ZjK86iN9geUJF0H6gp2IRKX6Nf6/I=
|
||||
@@ -24,6 +27,14 @@ github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaW
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/json-iterator/go v1.1.9 h1:9yzud/Ht36ygwatGx56VwCZtlI/2AD15T1X2sjSuGns=
|
||||
github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4=
|
||||
github.com/juju/errors v0.0.0-20220331221717-b38fca44723b h1:AxFeSQJfcm2O3ov1wqAkTKYFsnMw2g1B4PkYujfAdkY=
|
||||
github.com/juju/errors v0.0.0-20220331221717-b38fca44723b/go.mod h1:jMGj9DWF/qbo91ODcfJq6z/RYc3FX3taCBZMCcpI4Ls=
|
||||
github.com/kr/pretty v0.2.1 h1:Fmg33tUaq4/8ym9TJN1x7sLJnHVwhP33CNkpYV/7rwI=
|
||||
github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI=
|
||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/leodido/go-urn v1.2.0 h1:hpXL4XnriNwQ/ABnpepYM/1vCLWNDfUNts8dX3xTG6Y=
|
||||
github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII=
|
||||
github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY=
|
||||
@@ -32,8 +43,12 @@ github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OH
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742 h1:Esafd1046DLDQ0W1YjYsBW+p8U2u7vzgW2SQVmlNazg=
|
||||
github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0=
|
||||
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
|
||||
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/rs/xid v1.3.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
||||
github.com/rs/zerolog v1.26.1 h1:/ihwxqH+4z8UxyI70wM1z9yCvkWcfz/a3mj48k/Zngc=
|
||||
github.com/rs/zerolog v1.26.1/go.mod h1:/wSSJWX7lVrsOwlbyTRSOJvqRlc+WjWlfes+CiJ+tmc=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk=
|
||||
@@ -42,22 +57,41 @@ github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo=
|
||||
github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw=
|
||||
github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs=
|
||||
github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY=
|
||||
github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI=
|
||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||
golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e h1:1SzTfNOXwIS2oWiMF+6qu0OUDKb0dauo6MoDUQyu+yU=
|
||||
golang.org/x/crypto v0.0.0-20211215165025-cf75a172585e/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8=
|
||||
golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
|
||||
golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0 h1:Jcxah/M+oLZ/R4/z5RzfPzGbPXnVDPkEDtf2JnuxN+U=
|
||||
golang.org/x/net v0.0.0-20200425230154-ff2c4b7c35a0/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
|
||||
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d h1:20cMwl2fHAzkJMEA+8J4JgqBQcQGzbisXo31MIeenXI=
|
||||
golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd h1:xhmwyvizuTgC2qz7ZlMluP20uW+C3Rm0FD/WLDX8884=
|
||||
golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e h1:WUoyKPm6nCo1BnNUvPGnFG3T5DUVem42yDJZZ4CNxMA=
|
||||
golang.org/x/sys v0.0.0-20210809222454-d867a43fc93e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM=
|
||||
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
|
||||
golang.org/x/tools v0.1.7/go.mod h1:LGqMHiF4EqQNHR1JncWGqT5BVaXmza+X+BDGol+dOxo=
|
||||
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
|
||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10=
|
||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||
|
||||
@@ -2,6 +2,7 @@ package networking
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/juju/errors"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
@@ -9,7 +10,7 @@ import (
|
||||
func SendSoap(httpClient *http.Client, endpoint, message string) (*http.Response, error) {
|
||||
resp, err := httpClient.Post(endpoint, "application/soap+xml; charset=utf-8", bytes.NewBufferString(message))
|
||||
if err != nil {
|
||||
return resp, err
|
||||
return resp, errors.Annotate(err, "Post")
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
|
||||
78
sdk/codegen/main.go
Normal file
78
sdk/codegen/main.go
Normal file
@@ -0,0 +1,78 @@
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"log"
|
||||
"os"
|
||||
"text/template"
|
||||
)
|
||||
|
||||
var mainTemplate = `// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package {{.Package}}
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/{{.StructPackage}}"
|
||||
)
|
||||
|
||||
// Call_{{.TypeRequest}} forwards the call to dev.CallMethod() then parses the payload of the reply as a {{.TypeReply}}.
|
||||
func Call_{{.TypeRequest}}(ctx context.Context, dev *onvif.Device, request {{.StructPackage}}.{{.TypeRequest}}) ({{.StructPackage}}.{{.TypeReply}}, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
{{.TypeReply}} {{.StructPackage}}.{{.TypeReply}}
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.{{.TypeReply}}, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "{{.TypeRequest}}")
|
||||
return reply.Body.{{.TypeReply}}, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
type parserEnv struct {
|
||||
Package string
|
||||
StructPackage string
|
||||
TypeReply string
|
||||
TypeRequest string
|
||||
}
|
||||
|
||||
func main() {
|
||||
flag.Parse()
|
||||
env := parserEnv{
|
||||
Package: flag.Arg(0),
|
||||
StructPackage: flag.Arg(1),
|
||||
TypeRequest: flag.Arg(2),
|
||||
TypeReply: flag.Arg(2) + "Response",
|
||||
}
|
||||
|
||||
log.Println(env)
|
||||
|
||||
body, err := template.New("body").Parse(mainTemplate)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
fout, err := os.Create(env.TypeRequest + "_auto.go")
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
defer fout.Close()
|
||||
|
||||
err = body.Execute(fout, &env)
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
}
|
||||
30
sdk/device/AddIPAddressFilter_auto.go
Normal file
30
sdk/device/AddIPAddressFilter_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_AddIPAddressFilter forwards the call to dev.CallMethod() then parses the payload of the reply as a AddIPAddressFilterResponse.
|
||||
func Call_AddIPAddressFilter(ctx context.Context, dev *onvif.Device, request device.AddIPAddressFilter) (device.AddIPAddressFilterResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
AddIPAddressFilterResponse device.AddIPAddressFilterResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.AddIPAddressFilterResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "AddIPAddressFilter")
|
||||
return reply.Body.AddIPAddressFilterResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/AddScopes_auto.go
Normal file
30
sdk/device/AddScopes_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_AddScopes forwards the call to dev.CallMethod() then parses the payload of the reply as a AddScopesResponse.
|
||||
func Call_AddScopes(ctx context.Context, dev *onvif.Device, request device.AddScopes) (device.AddScopesResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
AddScopesResponse device.AddScopesResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.AddScopesResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "AddScopes")
|
||||
return reply.Body.AddScopesResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/CreateCertificate_auto.go
Normal file
30
sdk/device/CreateCertificate_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_CreateCertificate forwards the call to dev.CallMethod() then parses the payload of the reply as a CreateCertificateResponse.
|
||||
func Call_CreateCertificate(ctx context.Context, dev *onvif.Device, request device.CreateCertificate) (device.CreateCertificateResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
CreateCertificateResponse device.CreateCertificateResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.CreateCertificateResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "CreateCertificate")
|
||||
return reply.Body.CreateCertificateResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/CreateDot1XConfiguration_auto.go
Normal file
30
sdk/device/CreateDot1XConfiguration_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_CreateDot1XConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a CreateDot1XConfigurationResponse.
|
||||
func Call_CreateDot1XConfiguration(ctx context.Context, dev *onvif.Device, request device.CreateDot1XConfiguration) (device.CreateDot1XConfigurationResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
CreateDot1XConfigurationResponse device.CreateDot1XConfigurationResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.CreateDot1XConfigurationResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "CreateDot1XConfiguration")
|
||||
return reply.Body.CreateDot1XConfigurationResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/CreateStorageConfiguration_auto.go
Normal file
30
sdk/device/CreateStorageConfiguration_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_CreateStorageConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a CreateStorageConfigurationResponse.
|
||||
func Call_CreateStorageConfiguration(ctx context.Context, dev *onvif.Device, request device.CreateStorageConfiguration) (device.CreateStorageConfigurationResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
CreateStorageConfigurationResponse device.CreateStorageConfigurationResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.CreateStorageConfigurationResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "CreateStorageConfiguration")
|
||||
return reply.Body.CreateStorageConfigurationResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/CreateUsers_auto.go
Normal file
30
sdk/device/CreateUsers_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_CreateUsers forwards the call to dev.CallMethod() then parses the payload of the reply as a CreateUsersResponse.
|
||||
func Call_CreateUsers(ctx context.Context, dev *onvif.Device, request device.CreateUsers) (device.CreateUsersResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
CreateUsersResponse device.CreateUsersResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.CreateUsersResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "CreateUsers")
|
||||
return reply.Body.CreateUsersResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/DeleteCertificates_auto.go
Normal file
30
sdk/device/DeleteCertificates_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_DeleteCertificates forwards the call to dev.CallMethod() then parses the payload of the reply as a DeleteCertificatesResponse.
|
||||
func Call_DeleteCertificates(ctx context.Context, dev *onvif.Device, request device.DeleteCertificates) (device.DeleteCertificatesResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
DeleteCertificatesResponse device.DeleteCertificatesResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.DeleteCertificatesResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "DeleteCertificates")
|
||||
return reply.Body.DeleteCertificatesResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/DeleteDot1XConfiguration_auto.go
Normal file
30
sdk/device/DeleteDot1XConfiguration_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_DeleteDot1XConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a DeleteDot1XConfigurationResponse.
|
||||
func Call_DeleteDot1XConfiguration(ctx context.Context, dev *onvif.Device, request device.DeleteDot1XConfiguration) (device.DeleteDot1XConfigurationResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
DeleteDot1XConfigurationResponse device.DeleteDot1XConfigurationResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.DeleteDot1XConfigurationResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "DeleteDot1XConfiguration")
|
||||
return reply.Body.DeleteDot1XConfigurationResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/DeleteGeoLocation_auto.go
Normal file
30
sdk/device/DeleteGeoLocation_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_DeleteGeoLocation forwards the call to dev.CallMethod() then parses the payload of the reply as a DeleteGeoLocationResponse.
|
||||
func Call_DeleteGeoLocation(ctx context.Context, dev *onvif.Device, request device.DeleteGeoLocation) (device.DeleteGeoLocationResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
DeleteGeoLocationResponse device.DeleteGeoLocationResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.DeleteGeoLocationResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "DeleteGeoLocation")
|
||||
return reply.Body.DeleteGeoLocationResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/DeleteStorageConfiguration_auto.go
Normal file
30
sdk/device/DeleteStorageConfiguration_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_DeleteStorageConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a DeleteStorageConfigurationResponse.
|
||||
func Call_DeleteStorageConfiguration(ctx context.Context, dev *onvif.Device, request device.DeleteStorageConfiguration) (device.DeleteStorageConfigurationResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
DeleteStorageConfigurationResponse device.DeleteStorageConfigurationResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.DeleteStorageConfigurationResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "DeleteStorageConfiguration")
|
||||
return reply.Body.DeleteStorageConfigurationResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/DeleteUsers_auto.go
Normal file
30
sdk/device/DeleteUsers_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_DeleteUsers forwards the call to dev.CallMethod() then parses the payload of the reply as a DeleteUsersResponse.
|
||||
func Call_DeleteUsers(ctx context.Context, dev *onvif.Device, request device.DeleteUsers) (device.DeleteUsersResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
DeleteUsersResponse device.DeleteUsersResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.DeleteUsersResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "DeleteUsers")
|
||||
return reply.Body.DeleteUsersResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetAccessPolicy_auto.go
Normal file
30
sdk/device/GetAccessPolicy_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetAccessPolicy forwards the call to dev.CallMethod() then parses the payload of the reply as a GetAccessPolicyResponse.
|
||||
func Call_GetAccessPolicy(ctx context.Context, dev *onvif.Device, request device.GetAccessPolicy) (device.GetAccessPolicyResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetAccessPolicyResponse device.GetAccessPolicyResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetAccessPolicyResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetAccessPolicy")
|
||||
return reply.Body.GetAccessPolicyResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetCACertificates_auto.go
Normal file
30
sdk/device/GetCACertificates_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetCACertificates forwards the call to dev.CallMethod() then parses the payload of the reply as a GetCACertificatesResponse.
|
||||
func Call_GetCACertificates(ctx context.Context, dev *onvif.Device, request device.GetCACertificates) (device.GetCACertificatesResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetCACertificatesResponse device.GetCACertificatesResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetCACertificatesResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetCACertificates")
|
||||
return reply.Body.GetCACertificatesResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetCapabilities_auto.go
Normal file
30
sdk/device/GetCapabilities_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetCapabilities forwards the call to dev.CallMethod() then parses the payload of the reply as a GetCapabilitiesResponse.
|
||||
func Call_GetCapabilities(ctx context.Context, dev *onvif.Device, request device.GetCapabilities) (device.GetCapabilitiesResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetCapabilitiesResponse device.GetCapabilitiesResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetCapabilitiesResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetCapabilities")
|
||||
return reply.Body.GetCapabilitiesResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetCertificateInformation_auto.go
Normal file
30
sdk/device/GetCertificateInformation_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetCertificateInformation forwards the call to dev.CallMethod() then parses the payload of the reply as a GetCertificateInformationResponse.
|
||||
func Call_GetCertificateInformation(ctx context.Context, dev *onvif.Device, request device.GetCertificateInformation) (device.GetCertificateInformationResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetCertificateInformationResponse device.GetCertificateInformationResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetCertificateInformationResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetCertificateInformation")
|
||||
return reply.Body.GetCertificateInformationResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetCertificatesStatus_auto.go
Normal file
30
sdk/device/GetCertificatesStatus_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetCertificatesStatus forwards the call to dev.CallMethod() then parses the payload of the reply as a GetCertificatesStatusResponse.
|
||||
func Call_GetCertificatesStatus(ctx context.Context, dev *onvif.Device, request device.GetCertificatesStatus) (device.GetCertificatesStatusResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetCertificatesStatusResponse device.GetCertificatesStatusResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetCertificatesStatusResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetCertificatesStatus")
|
||||
return reply.Body.GetCertificatesStatusResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetCertificates_auto.go
Normal file
30
sdk/device/GetCertificates_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetCertificates forwards the call to dev.CallMethod() then parses the payload of the reply as a GetCertificatesResponse.
|
||||
func Call_GetCertificates(ctx context.Context, dev *onvif.Device, request device.GetCertificates) (device.GetCertificatesResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetCertificatesResponse device.GetCertificatesResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetCertificatesResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetCertificates")
|
||||
return reply.Body.GetCertificatesResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetClientCertificateMode_auto.go
Normal file
30
sdk/device/GetClientCertificateMode_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetClientCertificateMode forwards the call to dev.CallMethod() then parses the payload of the reply as a GetClientCertificateModeResponse.
|
||||
func Call_GetClientCertificateMode(ctx context.Context, dev *onvif.Device, request device.GetClientCertificateMode) (device.GetClientCertificateModeResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetClientCertificateModeResponse device.GetClientCertificateModeResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetClientCertificateModeResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetClientCertificateMode")
|
||||
return reply.Body.GetClientCertificateModeResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetDNS_auto.go
Normal file
30
sdk/device/GetDNS_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetDNS forwards the call to dev.CallMethod() then parses the payload of the reply as a GetDNSResponse.
|
||||
func Call_GetDNS(ctx context.Context, dev *onvif.Device, request device.GetDNS) (device.GetDNSResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetDNSResponse device.GetDNSResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetDNSResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetDNS")
|
||||
return reply.Body.GetDNSResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetDPAddresses_auto.go
Normal file
30
sdk/device/GetDPAddresses_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetDPAddresses forwards the call to dev.CallMethod() then parses the payload of the reply as a GetDPAddressesResponse.
|
||||
func Call_GetDPAddresses(ctx context.Context, dev *onvif.Device, request device.GetDPAddresses) (device.GetDPAddressesResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetDPAddressesResponse device.GetDPAddressesResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetDPAddressesResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetDPAddresses")
|
||||
return reply.Body.GetDPAddressesResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetDeviceInformation_auto.go
Normal file
30
sdk/device/GetDeviceInformation_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetDeviceInformation forwards the call to dev.CallMethod() then parses the payload of the reply as a GetDeviceInformationResponse.
|
||||
func Call_GetDeviceInformation(ctx context.Context, dev *onvif.Device, request device.GetDeviceInformation) (device.GetDeviceInformationResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetDeviceInformationResponse device.GetDeviceInformationResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetDeviceInformationResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetDeviceInformation")
|
||||
return reply.Body.GetDeviceInformationResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetDiscoveryMode_auto.go
Normal file
30
sdk/device/GetDiscoveryMode_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetDiscoveryMode forwards the call to dev.CallMethod() then parses the payload of the reply as a GetDiscoveryModeResponse.
|
||||
func Call_GetDiscoveryMode(ctx context.Context, dev *onvif.Device, request device.GetDiscoveryMode) (device.GetDiscoveryModeResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetDiscoveryModeResponse device.GetDiscoveryModeResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetDiscoveryModeResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetDiscoveryMode")
|
||||
return reply.Body.GetDiscoveryModeResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetDot11Capabilities_auto.go
Normal file
30
sdk/device/GetDot11Capabilities_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetDot11Capabilities forwards the call to dev.CallMethod() then parses the payload of the reply as a GetDot11CapabilitiesResponse.
|
||||
func Call_GetDot11Capabilities(ctx context.Context, dev *onvif.Device, request device.GetDot11Capabilities) (device.GetDot11CapabilitiesResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetDot11CapabilitiesResponse device.GetDot11CapabilitiesResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetDot11CapabilitiesResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetDot11Capabilities")
|
||||
return reply.Body.GetDot11CapabilitiesResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetDot11Status_auto.go
Normal file
30
sdk/device/GetDot11Status_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetDot11Status forwards the call to dev.CallMethod() then parses the payload of the reply as a GetDot11StatusResponse.
|
||||
func Call_GetDot11Status(ctx context.Context, dev *onvif.Device, request device.GetDot11Status) (device.GetDot11StatusResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetDot11StatusResponse device.GetDot11StatusResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetDot11StatusResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetDot11Status")
|
||||
return reply.Body.GetDot11StatusResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetDot1XConfiguration_auto.go
Normal file
30
sdk/device/GetDot1XConfiguration_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetDot1XConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a GetDot1XConfigurationResponse.
|
||||
func Call_GetDot1XConfiguration(ctx context.Context, dev *onvif.Device, request device.GetDot1XConfiguration) (device.GetDot1XConfigurationResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetDot1XConfigurationResponse device.GetDot1XConfigurationResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetDot1XConfigurationResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetDot1XConfiguration")
|
||||
return reply.Body.GetDot1XConfigurationResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetDot1XConfigurations_auto.go
Normal file
30
sdk/device/GetDot1XConfigurations_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetDot1XConfigurations forwards the call to dev.CallMethod() then parses the payload of the reply as a GetDot1XConfigurationsResponse.
|
||||
func Call_GetDot1XConfigurations(ctx context.Context, dev *onvif.Device, request device.GetDot1XConfigurations) (device.GetDot1XConfigurationsResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetDot1XConfigurationsResponse device.GetDot1XConfigurationsResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetDot1XConfigurationsResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetDot1XConfigurations")
|
||||
return reply.Body.GetDot1XConfigurationsResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetDynamicDNS_auto.go
Normal file
30
sdk/device/GetDynamicDNS_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetDynamicDNS forwards the call to dev.CallMethod() then parses the payload of the reply as a GetDynamicDNSResponse.
|
||||
func Call_GetDynamicDNS(ctx context.Context, dev *onvif.Device, request device.GetDynamicDNS) (device.GetDynamicDNSResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetDynamicDNSResponse device.GetDynamicDNSResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetDynamicDNSResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetDynamicDNS")
|
||||
return reply.Body.GetDynamicDNSResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetEndpointReference_auto.go
Normal file
30
sdk/device/GetEndpointReference_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetEndpointReference forwards the call to dev.CallMethod() then parses the payload of the reply as a GetEndpointReferenceResponse.
|
||||
func Call_GetEndpointReference(ctx context.Context, dev *onvif.Device, request device.GetEndpointReference) (device.GetEndpointReferenceResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetEndpointReferenceResponse device.GetEndpointReferenceResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetEndpointReferenceResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetEndpointReference")
|
||||
return reply.Body.GetEndpointReferenceResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetGeoLocation_auto.go
Normal file
30
sdk/device/GetGeoLocation_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetGeoLocation forwards the call to dev.CallMethod() then parses the payload of the reply as a GetGeoLocationResponse.
|
||||
func Call_GetGeoLocation(ctx context.Context, dev *onvif.Device, request device.GetGeoLocation) (device.GetGeoLocationResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetGeoLocationResponse device.GetGeoLocationResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetGeoLocationResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetGeoLocation")
|
||||
return reply.Body.GetGeoLocationResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetHostname_auto.go
Normal file
30
sdk/device/GetHostname_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetHostname forwards the call to dev.CallMethod() then parses the payload of the reply as a GetHostnameResponse.
|
||||
func Call_GetHostname(ctx context.Context, dev *onvif.Device, request device.GetHostname) (device.GetHostnameResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetHostnameResponse device.GetHostnameResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetHostnameResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetHostname")
|
||||
return reply.Body.GetHostnameResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetIPAddressFilter_auto.go
Normal file
30
sdk/device/GetIPAddressFilter_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetIPAddressFilter forwards the call to dev.CallMethod() then parses the payload of the reply as a GetIPAddressFilterResponse.
|
||||
func Call_GetIPAddressFilter(ctx context.Context, dev *onvif.Device, request device.GetIPAddressFilter) (device.GetIPAddressFilterResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetIPAddressFilterResponse device.GetIPAddressFilterResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetIPAddressFilterResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetIPAddressFilter")
|
||||
return reply.Body.GetIPAddressFilterResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetNTP_auto.go
Normal file
30
sdk/device/GetNTP_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetNTP forwards the call to dev.CallMethod() then parses the payload of the reply as a GetNTPResponse.
|
||||
func Call_GetNTP(ctx context.Context, dev *onvif.Device, request device.GetNTP) (device.GetNTPResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetNTPResponse device.GetNTPResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetNTPResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetNTP")
|
||||
return reply.Body.GetNTPResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetNetworkDefaultGateway_auto.go
Normal file
30
sdk/device/GetNetworkDefaultGateway_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetNetworkDefaultGateway forwards the call to dev.CallMethod() then parses the payload of the reply as a GetNetworkDefaultGatewayResponse.
|
||||
func Call_GetNetworkDefaultGateway(ctx context.Context, dev *onvif.Device, request device.GetNetworkDefaultGateway) (device.GetNetworkDefaultGatewayResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetNetworkDefaultGatewayResponse device.GetNetworkDefaultGatewayResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetNetworkDefaultGatewayResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetNetworkDefaultGateway")
|
||||
return reply.Body.GetNetworkDefaultGatewayResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetNetworkInterfaces_auto.go
Normal file
30
sdk/device/GetNetworkInterfaces_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetNetworkInterfaces forwards the call to dev.CallMethod() then parses the payload of the reply as a GetNetworkInterfacesResponse.
|
||||
func Call_GetNetworkInterfaces(ctx context.Context, dev *onvif.Device, request device.GetNetworkInterfaces) (device.GetNetworkInterfacesResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetNetworkInterfacesResponse device.GetNetworkInterfacesResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetNetworkInterfacesResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetNetworkInterfaces")
|
||||
return reply.Body.GetNetworkInterfacesResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetNetworkProtocols_auto.go
Normal file
30
sdk/device/GetNetworkProtocols_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetNetworkProtocols forwards the call to dev.CallMethod() then parses the payload of the reply as a GetNetworkProtocolsResponse.
|
||||
func Call_GetNetworkProtocols(ctx context.Context, dev *onvif.Device, request device.GetNetworkProtocols) (device.GetNetworkProtocolsResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetNetworkProtocolsResponse device.GetNetworkProtocolsResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetNetworkProtocolsResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetNetworkProtocols")
|
||||
return reply.Body.GetNetworkProtocolsResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetPkcs10Request_auto.go
Normal file
30
sdk/device/GetPkcs10Request_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetPkcs10Request forwards the call to dev.CallMethod() then parses the payload of the reply as a GetPkcs10RequestResponse.
|
||||
func Call_GetPkcs10Request(ctx context.Context, dev *onvif.Device, request device.GetPkcs10Request) (device.GetPkcs10RequestResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetPkcs10RequestResponse device.GetPkcs10RequestResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetPkcs10RequestResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetPkcs10Request")
|
||||
return reply.Body.GetPkcs10RequestResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetRelayOutputs_auto.go
Normal file
30
sdk/device/GetRelayOutputs_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetRelayOutputs forwards the call to dev.CallMethod() then parses the payload of the reply as a GetRelayOutputsResponse.
|
||||
func Call_GetRelayOutputs(ctx context.Context, dev *onvif.Device, request device.GetRelayOutputs) (device.GetRelayOutputsResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetRelayOutputsResponse device.GetRelayOutputsResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetRelayOutputsResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetRelayOutputs")
|
||||
return reply.Body.GetRelayOutputsResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetRemoteDiscoveryMode_auto.go
Normal file
30
sdk/device/GetRemoteDiscoveryMode_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetRemoteDiscoveryMode forwards the call to dev.CallMethod() then parses the payload of the reply as a GetRemoteDiscoveryModeResponse.
|
||||
func Call_GetRemoteDiscoveryMode(ctx context.Context, dev *onvif.Device, request device.GetRemoteDiscoveryMode) (device.GetRemoteDiscoveryModeResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetRemoteDiscoveryModeResponse device.GetRemoteDiscoveryModeResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetRemoteDiscoveryModeResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetRemoteDiscoveryMode")
|
||||
return reply.Body.GetRemoteDiscoveryModeResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetRemoteUser_auto.go
Normal file
30
sdk/device/GetRemoteUser_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetRemoteUser forwards the call to dev.CallMethod() then parses the payload of the reply as a GetRemoteUserResponse.
|
||||
func Call_GetRemoteUser(ctx context.Context, dev *onvif.Device, request device.GetRemoteUser) (device.GetRemoteUserResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetRemoteUserResponse device.GetRemoteUserResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetRemoteUserResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetRemoteUser")
|
||||
return reply.Body.GetRemoteUserResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetScopes_auto.go
Normal file
30
sdk/device/GetScopes_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetScopes forwards the call to dev.CallMethod() then parses the payload of the reply as a GetScopesResponse.
|
||||
func Call_GetScopes(ctx context.Context, dev *onvif.Device, request device.GetScopes) (device.GetScopesResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetScopesResponse device.GetScopesResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetScopesResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetScopes")
|
||||
return reply.Body.GetScopesResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetServiceCapabilities_auto.go
Normal file
30
sdk/device/GetServiceCapabilities_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetServiceCapabilities forwards the call to dev.CallMethod() then parses the payload of the reply as a GetServiceCapabilitiesResponse.
|
||||
func Call_GetServiceCapabilities(ctx context.Context, dev *onvif.Device, request device.GetServiceCapabilities) (device.GetServiceCapabilitiesResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetServiceCapabilitiesResponse device.GetServiceCapabilitiesResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetServiceCapabilitiesResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetServiceCapabilities")
|
||||
return reply.Body.GetServiceCapabilitiesResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetServices_auto.go
Normal file
30
sdk/device/GetServices_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetServices forwards the call to dev.CallMethod() then parses the payload of the reply as a GetServicesResponse.
|
||||
func Call_GetServices(ctx context.Context, dev *onvif.Device, request device.GetServices) (device.GetServicesResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetServicesResponse device.GetServicesResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetServicesResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetServices")
|
||||
return reply.Body.GetServicesResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetStorageConfiguration_auto.go
Normal file
30
sdk/device/GetStorageConfiguration_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetStorageConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a GetStorageConfigurationResponse.
|
||||
func Call_GetStorageConfiguration(ctx context.Context, dev *onvif.Device, request device.GetStorageConfiguration) (device.GetStorageConfigurationResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetStorageConfigurationResponse device.GetStorageConfigurationResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetStorageConfigurationResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetStorageConfiguration")
|
||||
return reply.Body.GetStorageConfigurationResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetStorageConfigurations_auto.go
Normal file
30
sdk/device/GetStorageConfigurations_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetStorageConfigurations forwards the call to dev.CallMethod() then parses the payload of the reply as a GetStorageConfigurationsResponse.
|
||||
func Call_GetStorageConfigurations(ctx context.Context, dev *onvif.Device, request device.GetStorageConfigurations) (device.GetStorageConfigurationsResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetStorageConfigurationsResponse device.GetStorageConfigurationsResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetStorageConfigurationsResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetStorageConfigurations")
|
||||
return reply.Body.GetStorageConfigurationsResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetSystemBackup_auto.go
Normal file
30
sdk/device/GetSystemBackup_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetSystemBackup forwards the call to dev.CallMethod() then parses the payload of the reply as a GetSystemBackupResponse.
|
||||
func Call_GetSystemBackup(ctx context.Context, dev *onvif.Device, request device.GetSystemBackup) (device.GetSystemBackupResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetSystemBackupResponse device.GetSystemBackupResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetSystemBackupResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetSystemBackup")
|
||||
return reply.Body.GetSystemBackupResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetSystemDateAndTime_auto.go
Normal file
30
sdk/device/GetSystemDateAndTime_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetSystemDateAndTime forwards the call to dev.CallMethod() then parses the payload of the reply as a GetSystemDateAndTimeResponse.
|
||||
func Call_GetSystemDateAndTime(ctx context.Context, dev *onvif.Device, request device.GetSystemDateAndTime) (device.GetSystemDateAndTimeResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetSystemDateAndTimeResponse device.GetSystemDateAndTimeResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetSystemDateAndTimeResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetSystemDateAndTime")
|
||||
return reply.Body.GetSystemDateAndTimeResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetSystemLog_auto.go
Normal file
30
sdk/device/GetSystemLog_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetSystemLog forwards the call to dev.CallMethod() then parses the payload of the reply as a GetSystemLogResponse.
|
||||
func Call_GetSystemLog(ctx context.Context, dev *onvif.Device, request device.GetSystemLog) (device.GetSystemLogResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetSystemLogResponse device.GetSystemLogResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetSystemLogResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetSystemLog")
|
||||
return reply.Body.GetSystemLogResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetSystemSupportInformation_auto.go
Normal file
30
sdk/device/GetSystemSupportInformation_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetSystemSupportInformation forwards the call to dev.CallMethod() then parses the payload of the reply as a GetSystemSupportInformationResponse.
|
||||
func Call_GetSystemSupportInformation(ctx context.Context, dev *onvif.Device, request device.GetSystemSupportInformation) (device.GetSystemSupportInformationResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetSystemSupportInformationResponse device.GetSystemSupportInformationResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetSystemSupportInformationResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetSystemSupportInformation")
|
||||
return reply.Body.GetSystemSupportInformationResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetSystemUris_auto.go
Normal file
30
sdk/device/GetSystemUris_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetSystemUris forwards the call to dev.CallMethod() then parses the payload of the reply as a GetSystemUrisResponse.
|
||||
func Call_GetSystemUris(ctx context.Context, dev *onvif.Device, request device.GetSystemUris) (device.GetSystemUrisResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetSystemUrisResponse device.GetSystemUrisResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetSystemUrisResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetSystemUris")
|
||||
return reply.Body.GetSystemUrisResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetUsers_auto.go
Normal file
30
sdk/device/GetUsers_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetUsers forwards the call to dev.CallMethod() then parses the payload of the reply as a GetUsersResponse.
|
||||
func Call_GetUsers(ctx context.Context, dev *onvif.Device, request device.GetUsers) (device.GetUsersResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetUsersResponse device.GetUsersResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetUsersResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetUsers")
|
||||
return reply.Body.GetUsersResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetWsdlUrl_auto.go
Normal file
30
sdk/device/GetWsdlUrl_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetWsdlUrl forwards the call to dev.CallMethod() then parses the payload of the reply as a GetWsdlUrlResponse.
|
||||
func Call_GetWsdlUrl(ctx context.Context, dev *onvif.Device, request device.GetWsdlUrl) (device.GetWsdlUrlResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetWsdlUrlResponse device.GetWsdlUrlResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetWsdlUrlResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetWsdlUrl")
|
||||
return reply.Body.GetWsdlUrlResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/GetZeroConfiguration_auto.go
Normal file
30
sdk/device/GetZeroConfiguration_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_GetZeroConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a GetZeroConfigurationResponse.
|
||||
func Call_GetZeroConfiguration(ctx context.Context, dev *onvif.Device, request device.GetZeroConfiguration) (device.GetZeroConfigurationResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
GetZeroConfigurationResponse device.GetZeroConfigurationResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.GetZeroConfigurationResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetZeroConfiguration")
|
||||
return reply.Body.GetZeroConfigurationResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/LoadCACertificates_auto.go
Normal file
30
sdk/device/LoadCACertificates_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_LoadCACertificates forwards the call to dev.CallMethod() then parses the payload of the reply as a LoadCACertificatesResponse.
|
||||
func Call_LoadCACertificates(ctx context.Context, dev *onvif.Device, request device.LoadCACertificates) (device.LoadCACertificatesResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
LoadCACertificatesResponse device.LoadCACertificatesResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.LoadCACertificatesResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "LoadCACertificates")
|
||||
return reply.Body.LoadCACertificatesResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/LoadCertificateWithPrivateKey_auto.go
Normal file
30
sdk/device/LoadCertificateWithPrivateKey_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_LoadCertificateWithPrivateKey forwards the call to dev.CallMethod() then parses the payload of the reply as a LoadCertificateWithPrivateKeyResponse.
|
||||
func Call_LoadCertificateWithPrivateKey(ctx context.Context, dev *onvif.Device, request device.LoadCertificateWithPrivateKey) (device.LoadCertificateWithPrivateKeyResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
LoadCertificateWithPrivateKeyResponse device.LoadCertificateWithPrivateKeyResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.LoadCertificateWithPrivateKeyResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "LoadCertificateWithPrivateKey")
|
||||
return reply.Body.LoadCertificateWithPrivateKeyResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/LoadCertificates_auto.go
Normal file
30
sdk/device/LoadCertificates_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_LoadCertificates forwards the call to dev.CallMethod() then parses the payload of the reply as a LoadCertificatesResponse.
|
||||
func Call_LoadCertificates(ctx context.Context, dev *onvif.Device, request device.LoadCertificates) (device.LoadCertificatesResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
LoadCertificatesResponse device.LoadCertificatesResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.LoadCertificatesResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "LoadCertificates")
|
||||
return reply.Body.LoadCertificatesResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/RemoveIPAddressFilter_auto.go
Normal file
30
sdk/device/RemoveIPAddressFilter_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_RemoveIPAddressFilter forwards the call to dev.CallMethod() then parses the payload of the reply as a RemoveIPAddressFilterResponse.
|
||||
func Call_RemoveIPAddressFilter(ctx context.Context, dev *onvif.Device, request device.RemoveIPAddressFilter) (device.RemoveIPAddressFilterResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
RemoveIPAddressFilterResponse device.RemoveIPAddressFilterResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.RemoveIPAddressFilterResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "RemoveIPAddressFilter")
|
||||
return reply.Body.RemoveIPAddressFilterResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/RemoveScopes_auto.go
Normal file
30
sdk/device/RemoveScopes_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_RemoveScopes forwards the call to dev.CallMethod() then parses the payload of the reply as a RemoveScopesResponse.
|
||||
func Call_RemoveScopes(ctx context.Context, dev *onvif.Device, request device.RemoveScopes) (device.RemoveScopesResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
RemoveScopesResponse device.RemoveScopesResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.RemoveScopesResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "RemoveScopes")
|
||||
return reply.Body.RemoveScopesResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/RestoreSystem_auto.go
Normal file
30
sdk/device/RestoreSystem_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_RestoreSystem forwards the call to dev.CallMethod() then parses the payload of the reply as a RestoreSystemResponse.
|
||||
func Call_RestoreSystem(ctx context.Context, dev *onvif.Device, request device.RestoreSystem) (device.RestoreSystemResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
RestoreSystemResponse device.RestoreSystemResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.RestoreSystemResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "RestoreSystem")
|
||||
return reply.Body.RestoreSystemResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/ScanAvailableDot11Networks_auto.go
Normal file
30
sdk/device/ScanAvailableDot11Networks_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_ScanAvailableDot11Networks forwards the call to dev.CallMethod() then parses the payload of the reply as a ScanAvailableDot11NetworksResponse.
|
||||
func Call_ScanAvailableDot11Networks(ctx context.Context, dev *onvif.Device, request device.ScanAvailableDot11Networks) (device.ScanAvailableDot11NetworksResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
ScanAvailableDot11NetworksResponse device.ScanAvailableDot11NetworksResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.ScanAvailableDot11NetworksResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "ScanAvailableDot11Networks")
|
||||
return reply.Body.ScanAvailableDot11NetworksResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SendAuxiliaryCommand_auto.go
Normal file
30
sdk/device/SendAuxiliaryCommand_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SendAuxiliaryCommand forwards the call to dev.CallMethod() then parses the payload of the reply as a SendAuxiliaryCommandResponse.
|
||||
func Call_SendAuxiliaryCommand(ctx context.Context, dev *onvif.Device, request device.SendAuxiliaryCommand) (device.SendAuxiliaryCommandResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SendAuxiliaryCommandResponse device.SendAuxiliaryCommandResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SendAuxiliaryCommandResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SendAuxiliaryCommand")
|
||||
return reply.Body.SendAuxiliaryCommandResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetAccessPolicy_auto.go
Normal file
30
sdk/device/SetAccessPolicy_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetAccessPolicy forwards the call to dev.CallMethod() then parses the payload of the reply as a SetAccessPolicyResponse.
|
||||
func Call_SetAccessPolicy(ctx context.Context, dev *onvif.Device, request device.SetAccessPolicy) (device.SetAccessPolicyResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetAccessPolicyResponse device.SetAccessPolicyResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetAccessPolicyResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetAccessPolicy")
|
||||
return reply.Body.SetAccessPolicyResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetCertificatesStatus_auto.go
Normal file
30
sdk/device/SetCertificatesStatus_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetCertificatesStatus forwards the call to dev.CallMethod() then parses the payload of the reply as a SetCertificatesStatusResponse.
|
||||
func Call_SetCertificatesStatus(ctx context.Context, dev *onvif.Device, request device.SetCertificatesStatus) (device.SetCertificatesStatusResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetCertificatesStatusResponse device.SetCertificatesStatusResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetCertificatesStatusResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetCertificatesStatus")
|
||||
return reply.Body.SetCertificatesStatusResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetClientCertificateMode_auto.go
Normal file
30
sdk/device/SetClientCertificateMode_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetClientCertificateMode forwards the call to dev.CallMethod() then parses the payload of the reply as a SetClientCertificateModeResponse.
|
||||
func Call_SetClientCertificateMode(ctx context.Context, dev *onvif.Device, request device.SetClientCertificateMode) (device.SetClientCertificateModeResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetClientCertificateModeResponse device.SetClientCertificateModeResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetClientCertificateModeResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetClientCertificateMode")
|
||||
return reply.Body.SetClientCertificateModeResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetDNS_auto.go
Normal file
30
sdk/device/SetDNS_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetDNS forwards the call to dev.CallMethod() then parses the payload of the reply as a SetDNSResponse.
|
||||
func Call_SetDNS(ctx context.Context, dev *onvif.Device, request device.SetDNS) (device.SetDNSResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetDNSResponse device.SetDNSResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetDNSResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetDNS")
|
||||
return reply.Body.SetDNSResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetDiscoveryMode_auto.go
Normal file
30
sdk/device/SetDiscoveryMode_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetDiscoveryMode forwards the call to dev.CallMethod() then parses the payload of the reply as a SetDiscoveryModeResponse.
|
||||
func Call_SetDiscoveryMode(ctx context.Context, dev *onvif.Device, request device.SetDiscoveryMode) (device.SetDiscoveryModeResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetDiscoveryModeResponse device.SetDiscoveryModeResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetDiscoveryModeResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetDiscoveryMode")
|
||||
return reply.Body.SetDiscoveryModeResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetDot1XConfiguration_auto.go
Normal file
30
sdk/device/SetDot1XConfiguration_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetDot1XConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a SetDot1XConfigurationResponse.
|
||||
func Call_SetDot1XConfiguration(ctx context.Context, dev *onvif.Device, request device.SetDot1XConfiguration) (device.SetDot1XConfigurationResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetDot1XConfigurationResponse device.SetDot1XConfigurationResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetDot1XConfigurationResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetDot1XConfiguration")
|
||||
return reply.Body.SetDot1XConfigurationResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetDynamicDNS_auto.go
Normal file
30
sdk/device/SetDynamicDNS_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetDynamicDNS forwards the call to dev.CallMethod() then parses the payload of the reply as a SetDynamicDNSResponse.
|
||||
func Call_SetDynamicDNS(ctx context.Context, dev *onvif.Device, request device.SetDynamicDNS) (device.SetDynamicDNSResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetDynamicDNSResponse device.SetDynamicDNSResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetDynamicDNSResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetDynamicDNS")
|
||||
return reply.Body.SetDynamicDNSResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetGeoLocation_auto.go
Normal file
30
sdk/device/SetGeoLocation_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetGeoLocation forwards the call to dev.CallMethod() then parses the payload of the reply as a SetGeoLocationResponse.
|
||||
func Call_SetGeoLocation(ctx context.Context, dev *onvif.Device, request device.SetGeoLocation) (device.SetGeoLocationResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetGeoLocationResponse device.SetGeoLocationResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetGeoLocationResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetGeoLocation")
|
||||
return reply.Body.SetGeoLocationResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetHostnameFromDHCP_auto.go
Normal file
30
sdk/device/SetHostnameFromDHCP_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetHostnameFromDHCP forwards the call to dev.CallMethod() then parses the payload of the reply as a SetHostnameFromDHCPResponse.
|
||||
func Call_SetHostnameFromDHCP(ctx context.Context, dev *onvif.Device, request device.SetHostnameFromDHCP) (device.SetHostnameFromDHCPResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetHostnameFromDHCPResponse device.SetHostnameFromDHCPResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetHostnameFromDHCPResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetHostnameFromDHCP")
|
||||
return reply.Body.SetHostnameFromDHCPResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetHostname_auto.go
Normal file
30
sdk/device/SetHostname_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetHostname forwards the call to dev.CallMethod() then parses the payload of the reply as a SetHostnameResponse.
|
||||
func Call_SetHostname(ctx context.Context, dev *onvif.Device, request device.SetHostname) (device.SetHostnameResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetHostnameResponse device.SetHostnameResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetHostnameResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetHostname")
|
||||
return reply.Body.SetHostnameResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetIPAddressFilter_auto.go
Normal file
30
sdk/device/SetIPAddressFilter_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetIPAddressFilter forwards the call to dev.CallMethod() then parses the payload of the reply as a SetIPAddressFilterResponse.
|
||||
func Call_SetIPAddressFilter(ctx context.Context, dev *onvif.Device, request device.SetIPAddressFilter) (device.SetIPAddressFilterResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetIPAddressFilterResponse device.SetIPAddressFilterResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetIPAddressFilterResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetIPAddressFilter")
|
||||
return reply.Body.SetIPAddressFilterResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetNTP_auto.go
Normal file
30
sdk/device/SetNTP_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetNTP forwards the call to dev.CallMethod() then parses the payload of the reply as a SetNTPResponse.
|
||||
func Call_SetNTP(ctx context.Context, dev *onvif.Device, request device.SetNTP) (device.SetNTPResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetNTPResponse device.SetNTPResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetNTPResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetNTP")
|
||||
return reply.Body.SetNTPResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetNetworkDefaultGateway_auto.go
Normal file
30
sdk/device/SetNetworkDefaultGateway_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetNetworkDefaultGateway forwards the call to dev.CallMethod() then parses the payload of the reply as a SetNetworkDefaultGatewayResponse.
|
||||
func Call_SetNetworkDefaultGateway(ctx context.Context, dev *onvif.Device, request device.SetNetworkDefaultGateway) (device.SetNetworkDefaultGatewayResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetNetworkDefaultGatewayResponse device.SetNetworkDefaultGatewayResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetNetworkDefaultGatewayResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetNetworkDefaultGateway")
|
||||
return reply.Body.SetNetworkDefaultGatewayResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetNetworkInterfaces_auto.go
Normal file
30
sdk/device/SetNetworkInterfaces_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetNetworkInterfaces forwards the call to dev.CallMethod() then parses the payload of the reply as a SetNetworkInterfacesResponse.
|
||||
func Call_SetNetworkInterfaces(ctx context.Context, dev *onvif.Device, request device.SetNetworkInterfaces) (device.SetNetworkInterfacesResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetNetworkInterfacesResponse device.SetNetworkInterfacesResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetNetworkInterfacesResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetNetworkInterfaces")
|
||||
return reply.Body.SetNetworkInterfacesResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetNetworkProtocols_auto.go
Normal file
30
sdk/device/SetNetworkProtocols_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetNetworkProtocols forwards the call to dev.CallMethod() then parses the payload of the reply as a SetNetworkProtocolsResponse.
|
||||
func Call_SetNetworkProtocols(ctx context.Context, dev *onvif.Device, request device.SetNetworkProtocols) (device.SetNetworkProtocolsResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetNetworkProtocolsResponse device.SetNetworkProtocolsResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetNetworkProtocolsResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetNetworkProtocols")
|
||||
return reply.Body.SetNetworkProtocolsResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetRelayOutputSettings_auto.go
Normal file
30
sdk/device/SetRelayOutputSettings_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetRelayOutputSettings forwards the call to dev.CallMethod() then parses the payload of the reply as a SetRelayOutputSettingsResponse.
|
||||
func Call_SetRelayOutputSettings(ctx context.Context, dev *onvif.Device, request device.SetRelayOutputSettings) (device.SetRelayOutputSettingsResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetRelayOutputSettingsResponse device.SetRelayOutputSettingsResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetRelayOutputSettingsResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetRelayOutputSettings")
|
||||
return reply.Body.SetRelayOutputSettingsResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetRelayOutputState_auto.go
Normal file
30
sdk/device/SetRelayOutputState_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetRelayOutputState forwards the call to dev.CallMethod() then parses the payload of the reply as a SetRelayOutputStateResponse.
|
||||
func Call_SetRelayOutputState(ctx context.Context, dev *onvif.Device, request device.SetRelayOutputState) (device.SetRelayOutputStateResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetRelayOutputStateResponse device.SetRelayOutputStateResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetRelayOutputStateResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetRelayOutputState")
|
||||
return reply.Body.SetRelayOutputStateResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetRemoteDiscoveryMode_auto.go
Normal file
30
sdk/device/SetRemoteDiscoveryMode_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetRemoteDiscoveryMode forwards the call to dev.CallMethod() then parses the payload of the reply as a SetRemoteDiscoveryModeResponse.
|
||||
func Call_SetRemoteDiscoveryMode(ctx context.Context, dev *onvif.Device, request device.SetRemoteDiscoveryMode) (device.SetRemoteDiscoveryModeResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetRemoteDiscoveryModeResponse device.SetRemoteDiscoveryModeResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetRemoteDiscoveryModeResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetRemoteDiscoveryMode")
|
||||
return reply.Body.SetRemoteDiscoveryModeResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetRemoteUser_auto.go
Normal file
30
sdk/device/SetRemoteUser_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetRemoteUser forwards the call to dev.CallMethod() then parses the payload of the reply as a SetRemoteUserResponse.
|
||||
func Call_SetRemoteUser(ctx context.Context, dev *onvif.Device, request device.SetRemoteUser) (device.SetRemoteUserResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetRemoteUserResponse device.SetRemoteUserResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetRemoteUserResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetRemoteUser")
|
||||
return reply.Body.SetRemoteUserResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetScopes_auto.go
Normal file
30
sdk/device/SetScopes_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetScopes forwards the call to dev.CallMethod() then parses the payload of the reply as a SetScopesResponse.
|
||||
func Call_SetScopes(ctx context.Context, dev *onvif.Device, request device.SetScopes) (device.SetScopesResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetScopesResponse device.SetScopesResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetScopesResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetScopes")
|
||||
return reply.Body.SetScopesResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetStorageConfiguration_auto.go
Normal file
30
sdk/device/SetStorageConfiguration_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetStorageConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a SetStorageConfigurationResponse.
|
||||
func Call_SetStorageConfiguration(ctx context.Context, dev *onvif.Device, request device.SetStorageConfiguration) (device.SetStorageConfigurationResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetStorageConfigurationResponse device.SetStorageConfigurationResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetStorageConfigurationResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetStorageConfiguration")
|
||||
return reply.Body.SetStorageConfigurationResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetSystemDateAndTime_auto.go
Normal file
30
sdk/device/SetSystemDateAndTime_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetSystemDateAndTime forwards the call to dev.CallMethod() then parses the payload of the reply as a SetSystemDateAndTimeResponse.
|
||||
func Call_SetSystemDateAndTime(ctx context.Context, dev *onvif.Device, request device.SetSystemDateAndTime) (device.SetSystemDateAndTimeResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetSystemDateAndTimeResponse device.SetSystemDateAndTimeResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetSystemDateAndTimeResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetSystemDateAndTime")
|
||||
return reply.Body.SetSystemDateAndTimeResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetSystemFactoryDefault_auto.go
Normal file
30
sdk/device/SetSystemFactoryDefault_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetSystemFactoryDefault forwards the call to dev.CallMethod() then parses the payload of the reply as a SetSystemFactoryDefaultResponse.
|
||||
func Call_SetSystemFactoryDefault(ctx context.Context, dev *onvif.Device, request device.SetSystemFactoryDefault) (device.SetSystemFactoryDefaultResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetSystemFactoryDefaultResponse device.SetSystemFactoryDefaultResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetSystemFactoryDefaultResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetSystemFactoryDefault")
|
||||
return reply.Body.SetSystemFactoryDefaultResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetUser_auto.go
Normal file
30
sdk/device/SetUser_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetUser forwards the call to dev.CallMethod() then parses the payload of the reply as a SetUserResponse.
|
||||
func Call_SetUser(ctx context.Context, dev *onvif.Device, request device.SetUser) (device.SetUserResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetUserResponse device.SetUserResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetUserResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetUser")
|
||||
return reply.Body.SetUserResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SetZeroConfiguration_auto.go
Normal file
30
sdk/device/SetZeroConfiguration_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SetZeroConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a SetZeroConfigurationResponse.
|
||||
func Call_SetZeroConfiguration(ctx context.Context, dev *onvif.Device, request device.SetZeroConfiguration) (device.SetZeroConfigurationResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SetZeroConfigurationResponse device.SetZeroConfigurationResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SetZeroConfigurationResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetZeroConfiguration")
|
||||
return reply.Body.SetZeroConfigurationResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/StartFirmwareUpgrade_auto.go
Normal file
30
sdk/device/StartFirmwareUpgrade_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_StartFirmwareUpgrade forwards the call to dev.CallMethod() then parses the payload of the reply as a StartFirmwareUpgradeResponse.
|
||||
func Call_StartFirmwareUpgrade(ctx context.Context, dev *onvif.Device, request device.StartFirmwareUpgrade) (device.StartFirmwareUpgradeResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
StartFirmwareUpgradeResponse device.StartFirmwareUpgradeResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.StartFirmwareUpgradeResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "StartFirmwareUpgrade")
|
||||
return reply.Body.StartFirmwareUpgradeResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/StartSystemRestore_auto.go
Normal file
30
sdk/device/StartSystemRestore_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_StartSystemRestore forwards the call to dev.CallMethod() then parses the payload of the reply as a StartSystemRestoreResponse.
|
||||
func Call_StartSystemRestore(ctx context.Context, dev *onvif.Device, request device.StartSystemRestore) (device.StartSystemRestoreResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
StartSystemRestoreResponse device.StartSystemRestoreResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.StartSystemRestoreResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "StartSystemRestore")
|
||||
return reply.Body.StartSystemRestoreResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/SystemReboot_auto.go
Normal file
30
sdk/device/SystemReboot_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_SystemReboot forwards the call to dev.CallMethod() then parses the payload of the reply as a SystemRebootResponse.
|
||||
func Call_SystemReboot(ctx context.Context, dev *onvif.Device, request device.SystemReboot) (device.SystemRebootResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
SystemRebootResponse device.SystemRebootResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.SystemRebootResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "SystemReboot")
|
||||
return reply.Body.SystemRebootResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
30
sdk/device/UpgradeSystemFirmware_auto.go
Normal file
30
sdk/device/UpgradeSystemFirmware_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package device
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/device"
|
||||
)
|
||||
|
||||
// Call_UpgradeSystemFirmware forwards the call to dev.CallMethod() then parses the payload of the reply as a UpgradeSystemFirmwareResponse.
|
||||
func Call_UpgradeSystemFirmware(ctx context.Context, dev *onvif.Device, request device.UpgradeSystemFirmware) (device.UpgradeSystemFirmwareResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
UpgradeSystemFirmwareResponse device.UpgradeSystemFirmwareResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.UpgradeSystemFirmwareResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "UpgradeSystemFirmware")
|
||||
return reply.Body.UpgradeSystemFirmwareResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
91
sdk/device/device.go
Normal file
91
sdk/device/device.go
Normal file
@@ -0,0 +1,91 @@
|
||||
package device
|
||||
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetServices
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetServiceCapabilities
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetDeviceInformation
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetSystemDateAndTime
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetSystemDateAndTime
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetSystemFactoryDefault
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device UpgradeSystemFirmware
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SystemReboot
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device RestoreSystem
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetSystemBackup
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetSystemLog
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetSystemSupportInformation
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetScopes
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetScopes
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device AddScopes
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device RemoveScopes
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetDiscoveryMode
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetDiscoveryMode
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetRemoteDiscoveryMode
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetRemoteDiscoveryMode
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetDPAddresses
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetEndpointReference
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetRemoteUser
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetRemoteUser
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetUsers
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device CreateUsers
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device DeleteUsers
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetUser
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetWsdlUrl
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetCapabilities
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetHostname
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetHostname
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetHostnameFromDHCP
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetDNS
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetDNS
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetNTP
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetNTP
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetDynamicDNS
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetDynamicDNS
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetNetworkInterfaces
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetNetworkInterfaces
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetNetworkProtocols
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetNetworkProtocols
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetNetworkDefaultGateway
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetNetworkDefaultGateway
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetZeroConfiguration
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetZeroConfiguration
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetIPAddressFilter
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetIPAddressFilter
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device AddIPAddressFilter
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device RemoveIPAddressFilter
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetAccessPolicy
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetAccessPolicy
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device CreateCertificate
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetCertificates
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetCertificatesStatus
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetCertificatesStatus
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device DeleteCertificates
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetPkcs10Request
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device LoadCertificates
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetClientCertificateMode
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetClientCertificateMode
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetRelayOutputs
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetRelayOutputSettings
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetRelayOutputState
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SendAuxiliaryCommand
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetCACertificates
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device LoadCertificateWithPrivateKey
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetCertificateInformation
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device LoadCACertificates
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device CreateDot1XConfiguration
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetDot1XConfiguration
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetDot1XConfiguration
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetDot1XConfigurations
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device DeleteDot1XConfiguration
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetDot11Capabilities
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetDot11Status
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device ScanAvailableDot11Networks
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetSystemUris
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device StartFirmwareUpgrade
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device StartSystemRestore
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetStorageConfigurations
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device CreateStorageConfiguration
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetStorageConfiguration
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetStorageConfiguration
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device DeleteStorageConfiguration
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device GetGeoLocation
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device SetGeoLocation
|
||||
//go:generate go run github.com/use-go/onvif/sdk/codegen device device DeleteGeoLocation
|
||||
39
sdk/doc.go
Normal file
39
sdk/doc.go
Normal file
@@ -0,0 +1,39 @@
|
||||
package sdk
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/xml"
|
||||
"github.com/juju/errors"
|
||||
"github.com/rs/zerolog"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"os"
|
||||
"time"
|
||||
)
|
||||
|
||||
var (
|
||||
// LoggerContext is the builder of a zerolog.Logger that is exposed to the application so that
|
||||
// options at the CLI might alter the formatting and the output of the logs.
|
||||
LoggerContext = zerolog.
|
||||
New(zerolog.ConsoleWriter{Out: os.Stderr, TimeFormat: time.RFC3339}).
|
||||
With().Timestamp()
|
||||
|
||||
// Logger is a zerolog logger, that can be safely used from any part of the application.
|
||||
// It gathers the format and the output.
|
||||
Logger = LoggerContext.Logger()
|
||||
)
|
||||
|
||||
func ReadAndParse(ctx context.Context, httpReply *http.Response, reply interface{}, tag string) error {
|
||||
Logger.Debug().
|
||||
Str("msg", httpReply.Status).
|
||||
Int("status", httpReply.StatusCode).
|
||||
Str("action", tag).
|
||||
Msg("RPC")
|
||||
// TODO(jfsmig): extract the deadline from ctx.Deadline() and apply it on the reply reading
|
||||
if b, err := ioutil.ReadAll(httpReply.Body); err != nil {
|
||||
return errors.Annotate(err, "read")
|
||||
} else {
|
||||
err = xml.Unmarshal(b, reply)
|
||||
return errors.Annotate(err, "decode")
|
||||
}
|
||||
}
|
||||
30
sdk/media/AddAudioDecoderConfiguration_auto.go
Normal file
30
sdk/media/AddAudioDecoderConfiguration_auto.go
Normal file
@@ -0,0 +1,30 @@
|
||||
// Code generated : DO NOT EDIT.
|
||||
// Copyright (c) 2022 Jean-Francois SMIGIELSKI
|
||||
// Distributed under the MIT License
|
||||
|
||||
package media
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/juju/errors"
|
||||
"github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/sdk"
|
||||
"github.com/use-go/onvif/media"
|
||||
)
|
||||
|
||||
// Call_AddAudioDecoderConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a AddAudioDecoderConfigurationResponse.
|
||||
func Call_AddAudioDecoderConfiguration(ctx context.Context, dev *onvif.Device, request media.AddAudioDecoderConfiguration) (media.AddAudioDecoderConfigurationResponse, error) {
|
||||
type Envelope struct {
|
||||
Header struct{}
|
||||
Body struct {
|
||||
AddAudioDecoderConfigurationResponse media.AddAudioDecoderConfigurationResponse
|
||||
}
|
||||
}
|
||||
var reply Envelope
|
||||
if httpReply, err := dev.CallMethod(request); err != nil {
|
||||
return reply.Body.AddAudioDecoderConfigurationResponse, errors.Annotate(err, "call")
|
||||
} else {
|
||||
err = sdk.ReadAndParse(ctx, httpReply, &reply, "AddAudioDecoderConfiguration")
|
||||
return reply.Body.AddAudioDecoderConfigurationResponse, errors.Annotate(err, "reply")
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user