mirror of
https://github.com/kerberos-io/onvif.git
synced 2026-08-23 15:08:33 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
75
Device.go
75
Device.go
@@ -3,7 +3,6 @@ package onvif
|
||||
import (
|
||||
"encoding/xml"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"net/url"
|
||||
@@ -108,65 +107,65 @@ 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) {
|
||||
func (dev *Device) getSupportedServices(resp *http.Response) error {
|
||||
doc := etree.NewDocument()
|
||||
|
||||
data, _ := ioutil.ReadAll(resp.Body)
|
||||
data, err := ioutil.ReadAll(resp.Body)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
resp.Body.Close()
|
||||
|
||||
if err := doc.ReadFromBytes(data); err != nil {
|
||||
//log.Println(err.Error())
|
||||
return
|
||||
return err
|
||||
}
|
||||
|
||||
services := doc.FindElements("./Envelope/Body/GetCapabilitiesResponse/Capabilities/*/XAddr")
|
||||
for _, j := range services {
|
||||
dev.addEndpoint(j.Parent().Tag, j.Text())
|
||||
}
|
||||
|
||||
extension_services := doc.FindElements("./Envelope/Body/GetCapabilitiesResponse/Capabilities/Extension/*/XAddr")
|
||||
for _, j := range extension_services {
|
||||
dev.addEndpoint(j.Parent().Tag, j.Text())
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
//NewDevice function construct a ONVIF Device entity
|
||||
@@ -188,7 +187,11 @@ func NewDevice(params DeviceParams) (*Device, error) {
|
||||
return nil, errors.New("camera is not available at " + dev.params.Xaddr + " or it does not support ONVIF services")
|
||||
}
|
||||
|
||||
dev.getSupportedServices(resp)
|
||||
err = dev.getSupportedServices(resp)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return dev, nil
|
||||
}
|
||||
|
||||
|
||||
136
api/api.go
136
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/kerberos-io/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,21 +145,23 @@ 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")
|
||||
}
|
||||
|
||||
servResp.Body.Close()
|
||||
|
||||
return string(rsp), nil
|
||||
}
|
||||
|
||||
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 +191,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 +205,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 +249,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 +271,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 +312,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 +339,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()))
|
||||
|
||||
@@ -21,18 +21,18 @@ type SubscriptionPolicy struct { //tev http://www.onvif.org/ver10/events/wsdl
|
||||
|
||||
//Subscribe action for subscribe event topic
|
||||
type Subscribe struct { //http://docs.oasis-open.org/wsn/b-2.xsd
|
||||
XMLName struct{} `xml:"wsnt:Subscribe"`
|
||||
ConsumerReference EndpointReferenceType `xml:"wsnt:ConsumerReference"`
|
||||
Filter FilterType `xml:"wsnt:Filter"`
|
||||
SubscriptionPolicy SubscriptionPolicy `xml:"wsnt:SubscriptionPolicy"`
|
||||
InitialTerminationTime TerminationTime `xml:"wsnt:InitialTerminationTime"`
|
||||
XMLName struct{} `xml:"wsnt:Subscribe"`
|
||||
ConsumerReference EndpointReferenceType `xml:"wsnt:ConsumerReference"`
|
||||
Filter FilterType `xml:"wsnt:Filter"`
|
||||
SubscriptionPolicy SubscriptionPolicy `xml:"wsnt:SubscriptionPolicy"`
|
||||
InitialTerminationTime AbsoluteOrRelativeTimeType `xml:"wsnt:InitialTerminationTime"`
|
||||
}
|
||||
|
||||
//SubscribeResponse message for subscribe event topic
|
||||
type SubscribeResponse struct { //http://docs.oasis-open.org/wsn/b-2.xsd
|
||||
ConsumerReference EndpointReferenceType `xml:"wsnt:ConsumerReference"`
|
||||
CurrentTime CurrentTime `xml:"wsnt:CurrentTime"`
|
||||
TerminationTime TerminationTime `xml:"wsnt:TerminationTime"`
|
||||
SubscriptionReference EndpointReferenceType
|
||||
CurrentTime CurrentTime
|
||||
TerminationTime TerminationTime
|
||||
}
|
||||
|
||||
//Renew action for refresh event topic subscription
|
||||
@@ -57,7 +57,6 @@ type UnsubscribeResponse struct { //http://docs.oasis-open.org/wsn/b-2.xsd
|
||||
}
|
||||
|
||||
//CreatePullPointSubscription action
|
||||
//BUG(r) Bad AbsoluteOrRelativeTimeType type
|
||||
type CreatePullPointSubscription struct {
|
||||
XMLName string `xml:"tev:CreatePullPointSubscription"`
|
||||
Filter FilterType `xml:"tev:Filter"`
|
||||
|
||||
112
event/types.go
112
event/types.go
@@ -2,44 +2,56 @@ package event
|
||||
|
||||
import (
|
||||
"github.com/kerberos-io/onvif/xsd"
|
||||
"github.com/kerberos-io/onvif/xsd/onvif"
|
||||
)
|
||||
|
||||
//Address Alias
|
||||
// Address Alias
|
||||
type Address xsd.String
|
||||
|
||||
//CurrentTime alias
|
||||
// CurrentTime alias
|
||||
type CurrentTime xsd.DateTime //wsnt http://docs.oasis-open.org/wsn/b-2.xsd
|
||||
//TerminationTime alias
|
||||
|
||||
// TerminationTime alias
|
||||
type TerminationTime xsd.DateTime //wsnt http://docs.oasis-open.org/wsn/b-2.xsd
|
||||
//FixedTopicSet alias
|
||||
|
||||
// FixedTopicSet alias
|
||||
type FixedTopicSet xsd.Boolean //wsnt http://docs.oasis-open.org/wsn/b-2.xsd
|
||||
|
||||
//Documentation alias
|
||||
// Documentation alias
|
||||
type Documentation xsd.AnyType //wstop http://docs.oasis-open.org/wsn/t-1.xsd
|
||||
|
||||
//TopicExpressionDialect alias
|
||||
// TopicExpressionDialect alias
|
||||
type TopicExpressionDialect xsd.AnyURI
|
||||
|
||||
//Message alias
|
||||
// Message alias
|
||||
type Message xsd.AnyType
|
||||
|
||||
//ActionType for AttributedURIType
|
||||
type ActionType AttributedURIType
|
||||
|
||||
//AttributedURIType in ws-addr
|
||||
type AttributedURIType xsd.AnyURI //wsa https://www.w3.org/2005/08/addressing/ws-addr.xsd
|
||||
|
||||
//AbsoluteOrRelativeTimeType <xsd:union memberTypes="xsd:dateTime xsd:duration"/>
|
||||
type AbsoluteOrRelativeTimeType struct { //wsnt http://docs.oasis-open.org/wsn/b-2.xsd
|
||||
xsd.DateTime
|
||||
xsd.Duration
|
||||
// MessageNotification alias
|
||||
type MessageNotification struct {
|
||||
Message MessageNotificationHolderType
|
||||
}
|
||||
|
||||
//EndpointReferenceType in ws-addr
|
||||
type MessageNotificationHolderType struct {
|
||||
UtcTime xsd.DateTime `xml:",attr"`
|
||||
PropertyOperation xsd.String `xml:",attr"`
|
||||
Source onvif.SimpleItem `xml:"Source>SimpleItem"`
|
||||
Data onvif.SimpleItem `xml:"Data>SimpleItem"`
|
||||
}
|
||||
|
||||
// ActionType for AttributedURIType
|
||||
type ActionType AttributedURIType
|
||||
|
||||
// AttributedURIType in ws-addr
|
||||
type AttributedURIType xsd.AnyURI //wsa https://www.w3.org/2005/08/addressing/ws-addr.xsd
|
||||
|
||||
// AbsoluteOrRelativeTimeType <xsd:union memberTypes="xsd:dateTime xsd:duration"/>
|
||||
type AbsoluteOrRelativeTimeType xsd.AnySimpleType //wsnt http://docs.oasis-open.org/wsn/b-2.xsd
|
||||
|
||||
// EndpointReferenceType in ws-addr
|
||||
type EndpointReferenceType struct { //wsa http://www.w3.org/2005/08/addressing/ws-addr.xsd
|
||||
Address AttributedURIType `xml:"wsnt:Address"`
|
||||
ReferenceParameters ReferenceParametersType `xml:"wsnt:ReferenceParameters"`
|
||||
Metadata MetadataType `xml:"wsnt:Metadata"`
|
||||
Address AttributedURIType
|
||||
ReferenceParameters ReferenceParametersType
|
||||
Metadata MetadataType
|
||||
}
|
||||
|
||||
// FilterType struct
|
||||
@@ -48,74 +60,74 @@ type FilterType struct {
|
||||
MessageContent QueryExpressionType `xml:"wsnt:MessageContent"`
|
||||
}
|
||||
|
||||
//EndpointReference alais
|
||||
// EndpointReference alais
|
||||
type EndpointReference EndpointReferenceType
|
||||
|
||||
//ReferenceParametersType in ws-addr
|
||||
// ReferenceParametersType in ws-addr
|
||||
type ReferenceParametersType struct { //wsa https://www.w3.org/2005/08/addressing/ws-addr.xsd
|
||||
//Here can be anyAttribute
|
||||
}
|
||||
|
||||
//Metadata in ws-addr
|
||||
// Metadata in ws-addr
|
||||
type Metadata MetadataType //wsa https://www.w3.org/2005/08/addressing/ws-addr.xsd
|
||||
|
||||
//MetadataType in ws-addr
|
||||
// MetadataType in ws-addr
|
||||
type MetadataType struct { //wsa https://www.w3.org/2005/08/addressing/ws-addr.xsd
|
||||
|
||||
//Here can be anyAttribute
|
||||
}
|
||||
|
||||
//TopicSet alias
|
||||
// TopicSet alias
|
||||
type TopicSet TopicSetType //wstop http://docs.oasis-open.org/wsn/t-1.xsd
|
||||
|
||||
//TopicSetType alias
|
||||
// TopicSetType alias
|
||||
type TopicSetType struct { //wstop http://docs.oasis-open.org/wsn/t-1.xsd
|
||||
ExtensibleDocumented
|
||||
//here can be any element
|
||||
}
|
||||
|
||||
//ExtensibleDocumented struct
|
||||
// ExtensibleDocumented struct
|
||||
type ExtensibleDocumented struct { //wstop http://docs.oasis-open.org/wsn/t-1.xsd
|
||||
Documentation Documentation //к xsd-документе documentation с маленькой буквы начинается
|
||||
//here can be anyAttribute
|
||||
}
|
||||
|
||||
//ProducerReference Alias
|
||||
// ProducerReference Alias
|
||||
type ProducerReference EndpointReferenceType
|
||||
|
||||
//SubscriptionReference Alias
|
||||
// SubscriptionReference Alias
|
||||
type SubscriptionReference EndpointReferenceType
|
||||
|
||||
//NotificationMessageHolderType Alias
|
||||
// NotificationMessageHolderType Alias
|
||||
type NotificationMessageHolderType struct {
|
||||
SubscriptionReference SubscriptionReference //wsnt http://docs.oasis-open.org/wsn/b-2.xsd
|
||||
Topic Topic
|
||||
ProducerReference ProducerReference
|
||||
Message Message
|
||||
Message MessageNotification
|
||||
}
|
||||
|
||||
//NotificationMessage Alias
|
||||
// NotificationMessage Alias
|
||||
type NotificationMessage NotificationMessageHolderType //wsnt http://docs.oasis-open.org/wsn/b-2.xsd
|
||||
|
||||
//QueryExpressionType struct for wsnt:MessageContent
|
||||
// QueryExpressionType struct for wsnt:MessageContent
|
||||
type QueryExpressionType struct { //wsnt http://docs.oasis-open.org/wsn/b-2.xsd
|
||||
Dialect xsd.AnyURI `xml:"Dialect,attr"`
|
||||
MessageKind xsd.String `xml:",chardata"` // boolean(ncex:Producer="15")
|
||||
}
|
||||
|
||||
//MessageContentType Alias
|
||||
// MessageContentType Alias
|
||||
type MessageContentType QueryExpressionType
|
||||
|
||||
//QueryExpression Alias
|
||||
// QueryExpression Alias
|
||||
type QueryExpression QueryExpressionType
|
||||
|
||||
//TopicExpressionType struct for wsnt:TopicExpression
|
||||
// TopicExpressionType struct for wsnt:TopicExpression
|
||||
type TopicExpressionType struct { //wsnt http://docs.oasis-open.org/wsn/b-2.xsd
|
||||
Dialect xsd.AnyURI `xml:"Dialect,attr"`
|
||||
TopicKinds xsd.String `xml:",chardata"`
|
||||
}
|
||||
|
||||
//Topic Alias
|
||||
// Topic Alias
|
||||
type Topic TopicExpressionType
|
||||
|
||||
// Capabilities of event
|
||||
@@ -128,50 +140,50 @@ type Capabilities struct { //tev
|
||||
PersistentNotificationStorage xsd.Boolean `xml:"PersistentNotificationStorage,attr"`
|
||||
}
|
||||
|
||||
//ResourceUnknownFault response type
|
||||
// ResourceUnknownFault response type
|
||||
type ResourceUnknownFault struct {
|
||||
}
|
||||
|
||||
//InvalidFilterFault response type
|
||||
// InvalidFilterFault response type
|
||||
type InvalidFilterFault struct {
|
||||
}
|
||||
|
||||
//TopicExpressionDialectUnknownFault response type
|
||||
// TopicExpressionDialectUnknownFault response type
|
||||
type TopicExpressionDialectUnknownFault struct {
|
||||
}
|
||||
|
||||
//InvalidTopicExpressionFault response type
|
||||
// InvalidTopicExpressionFault response type
|
||||
type InvalidTopicExpressionFault struct {
|
||||
}
|
||||
|
||||
//TopicNotSupportedFault response type
|
||||
// TopicNotSupportedFault response type
|
||||
type TopicNotSupportedFault struct {
|
||||
}
|
||||
|
||||
//InvalidProducerPropertiesExpressionFault response type
|
||||
// InvalidProducerPropertiesExpressionFault response type
|
||||
type InvalidProducerPropertiesExpressionFault struct {
|
||||
}
|
||||
|
||||
//InvalidMessageContentExpressionFault response type
|
||||
// InvalidMessageContentExpressionFault response type
|
||||
type InvalidMessageContentExpressionFault struct {
|
||||
}
|
||||
|
||||
//UnacceptableInitialTerminationTimeFault response type
|
||||
// UnacceptableInitialTerminationTimeFault response type
|
||||
type UnacceptableInitialTerminationTimeFault struct {
|
||||
}
|
||||
|
||||
//UnrecognizedPolicyRequestFault response type
|
||||
// UnrecognizedPolicyRequestFault response type
|
||||
type UnrecognizedPolicyRequestFault struct {
|
||||
}
|
||||
|
||||
//UnsupportedPolicyRequestFault response type
|
||||
// UnsupportedPolicyRequestFault response type
|
||||
type UnsupportedPolicyRequestFault struct {
|
||||
}
|
||||
|
||||
//NotifyMessageNotSupportedFault response type
|
||||
// NotifyMessageNotSupportedFault response type
|
||||
type NotifyMessageNotSupportedFault struct {
|
||||
}
|
||||
|
||||
//SubscribeCreationFailedFault response type
|
||||
// SubscribeCreationFailedFault response type
|
||||
type SubscribeCreationFailedFault struct {
|
||||
}
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"log"
|
||||
"net/http"
|
||||
|
||||
goonvif "github.com/kerberos-io/onvif"
|
||||
"github.com/kerberos-io/onvif/device"
|
||||
"github.com/kerberos-io/onvif/gosoap"
|
||||
"github.com/kerberos-io/onvif/xsd/onvif"
|
||||
goonvif "github.com/use-go/onvif"
|
||||
"github.com/use-go/onvif/device"
|
||||
sdk "github.com/use-go/onvif/sdk/device"
|
||||
"github.com/use-go/onvif/xsd/onvif"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -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/kerberos-io/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 {
|
||||
|
||||
6
go.mod
6
go.mod
@@ -5,7 +5,9 @@ go 1.15
|
||||
require (
|
||||
github.com/beevik/etree v1.1.0
|
||||
github.com/elgs/gostrgen v0.0.0-20161222160715-9d61ae07eeae
|
||||
github.com/gin-gonic/gin v1.6.2
|
||||
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
|
||||
)
|
||||
|
||||
56
go.sum
56
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=
|
||||
@@ -7,16 +9,17 @@ github.com/elgs/gostrgen v0.0.0-20161222160715-9d61ae07eeae h1:3KvK2DmA7TxQ6PZ2f
|
||||
github.com/elgs/gostrgen v0.0.0-20161222160715-9d61ae07eeae/go.mod h1:wruC5r2gHdr/JIUs5Rr1V45YtsAzKXZxAnn/5rPC97g=
|
||||
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
|
||||
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
|
||||
github.com/gin-gonic/gin v1.6.2 h1:88crIK23zO6TqlQBt+f9FrPJNKm9ZEr7qjp9vl/d5TM=
|
||||
github.com/gin-gonic/gin v1.6.2/go.mod h1:75u5sXoLsGZoRN5Sgbi1eraJ4GU3++wFwWzhwvtwp4M=
|
||||
github.com/gin-gonic/gin v1.7.0 h1:jGB9xAJQ12AIGNB4HguylppmDK1Am9ppF7XnGXXJuoU=
|
||||
github.com/gin-gonic/gin v1.7.0/go.mod h1:jD2toBW3GZUr5UMcdrwQA10I7RuaFOl/SGeDjXkfUtY=
|
||||
github.com/go-playground/assert/v2 v2.0.1 h1:MsBgLAaY856+nPRTKrp3/OZK38U/wa0CcBYNjji3q3A=
|
||||
github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4=
|
||||
github.com/go-playground/locales v0.13.0 h1:HyWk6mgj5qFqCT5fjGBuRArbVDfE4hi8+e8ceBS/t7Q=
|
||||
github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8=
|
||||
github.com/go-playground/universal-translator v0.17.0 h1:icxd5fm+REJzpZx7ZfpaD876Lmtgy7VtROAbHHXk8no=
|
||||
github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA=
|
||||
github.com/go-playground/validator/v10 v10.2.0 h1:KgJ0snyC2R9VXYN2rneOtQcw5aHQB1Vv0sFl1UcHBOY=
|
||||
github.com/go-playground/validator/v10 v10.2.0/go.mod h1:uOYAAleCW8F/7oMFd6aG0GOhaH6EGOAJShg8Id5JGkI=
|
||||
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,18 +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/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/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-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=
|
||||
|
||||
@@ -3,13 +3,15 @@ package networking
|
||||
import (
|
||||
"bytes"
|
||||
"net/http"
|
||||
|
||||
"github.com/juju/errors"
|
||||
)
|
||||
|
||||
// SendSoap send soap message
|
||||
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
|
||||
|
||||
@@ -98,7 +98,7 @@ type SetPreset struct {
|
||||
XMLName string `xml:"tptz:SetPreset"`
|
||||
ProfileToken onvif.ReferenceToken `xml:"tptz:ProfileToken"`
|
||||
PresetName xsd.String `xml:"tptz:PresetName"`
|
||||
PresetToken onvif.ReferenceToken `xml:"tptz:PresetToken"`
|
||||
PresetToken onvif.ReferenceToken `xml:"tptz:PresetToken,omitempty"`
|
||||
}
|
||||
|
||||
type SetPresetResponse struct {
|
||||
|
||||
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")
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user