Refactor XML response handling in device extended and security tests

- Adjusted formatting in XML response strings for consistency in device_extended_test.go and device_security_test.go.
- Improved readability by aligning XML declaration and body content.
- Updated mock server responses to ensure proper handling of various ONVIF operations.

Enhance device security and storage handling

- Refactored struct field declarations in device_security.go and device_storage_test.go for improved clarity.
- Ensured consistent formatting across struct definitions and XML tags.

Standardize whitespace and formatting across multiple files

- Removed unnecessary blank lines and adjusted indentation in discovery, imaging, media, and PTZ server files.
- Improved overall code readability and maintainability by ensuring consistent formatting.

Update example applications for better readability

- Cleaned up whitespace in example applications to enhance code clarity.
- Ensured consistent formatting in main.go files across various examples.

Refactor server and SOAP handler code for consistency

- Standardized struct field declarations and XML tag formatting in server and SOAP handler files.
- Improved readability by aligning struct fields and ensuring consistent use of whitespace.

General code cleanup and formatting adjustments

- Applied consistent formatting across various files, including types.go and test files.
- Enhanced readability by aligning struct fields and removing unnecessary blank lines.
This commit is contained in:
ProtoTess
2025-12-01 00:49:36 +00:00
parent 856f49c82d
commit b4e4982876
37 changed files with 318 additions and 322 deletions
+18 -18
View File
@@ -18,15 +18,15 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@d632cb752374ac6c22015e4b4bef1d19db85d69f # v4.2.0
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v5 uses: actions/setup-go@0a12ed9d6470c3512128ab8f076f97fbbff3da52 # v5.0.1
with: with:
go-version: '1.23' go-version: '1.23'
- name: Cache Go modules - name: Cache Go modules
uses: actions/cache@v4 uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with: with:
path: ~/go/pkg/mod path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
@@ -45,7 +45,7 @@ jobs:
fi fi
- name: Lint - name: Lint
uses: golangci/golangci-lint-action@v4 uses: golangci/golangci-lint-action@3cfe3a4ac716397848d91e4042119f51a40b6aaf # v4.0.0
with: with:
version: latest version: latest
args: --timeout=5m --fix=false args: --timeout=5m --fix=false
@@ -58,15 +58,15 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@d632cb752374ac6c22015e4b4bef1d19db85d69f # v4.2.0
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v5 uses: actions/setup-go@0a12ed9d6470c3512128ab8f076f97fbbff3da52 # v5.0.1
with: with:
go-version: '1.23' go-version: '1.23'
- name: Cache Go modules - name: Cache Go modules
uses: actions/cache@v4 uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with: with:
path: ~/go/pkg/mod path: ~/go/pkg/mod
key: ${{ runner.os }}-go-1.23-${{ hashFiles('**/go.sum') }} key: ${{ runner.os }}-go-1.23-${{ hashFiles('**/go.sum') }}
@@ -83,7 +83,7 @@ jobs:
run: go tool cover -html=coverage.out -o coverage.html run: go tool cover -html=coverage.out -o coverage.html
- name: Upload coverage to Codecov - name: Upload coverage to Codecov
uses: codecov/codecov-action@v4 uses: codecov/codecov-action@8a4b2d1c64a2a31fb92d9fa9f1e2b02e35d2db1a # v4.0.1
with: with:
token: ${{ secrets.CODECOV_TOKEN }} token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.out files: ./coverage.out
@@ -93,7 +93,7 @@ jobs:
- name: Archive coverage - name: Archive coverage
if: always() if: always()
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@89ef406dd8d8a50a2f1e5e903c0e970c27a27de8 # v4.3.5
with: with:
name: coverage-report name: coverage-report
path: | path: |
@@ -119,15 +119,15 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@d632cb752374ac6c22015e4b4bef1d19db85d69f # v4.2.0
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v5 uses: actions/setup-go@0a12ed9d6470c3512128ab8f076f97fbbff3da52 # v5.0.1
with: with:
go-version: ${{ matrix.go-version }} go-version: ${{ matrix.go-version }}
- name: Cache Go modules - name: Cache Go modules
uses: actions/cache@v4 uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with: with:
path: | path: |
~/.cache/go-build ~/.cache/go-build
@@ -151,17 +151,17 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@d632cb752374ac6c22015e4b4bef1d19db85d69f # v4.2.0
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Download coverage from test job - name: Download coverage from test job
uses: actions/download-artifact@v4 uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with: with:
name: coverage-report name: coverage-report
- name: SonarCloud Scan - name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master uses: SonarSource/sonarcloud-github-action@3b335e14ab49358d133eef17b8c1590fe7c21c0e # v2.2.0
env: env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
@@ -179,15 +179,15 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@d632cb752374ac6c22015e4b4bef1d19db85d69f # v4.2.0
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v5 uses: actions/setup-go@0a12ed9d6470c3512128ab8f076f97fbbff3da52 # v5.0.1
with: with:
go-version: '1.23' go-version: '1.23'
- name: Cache Go modules - name: Cache Go modules
uses: actions/cache@v4 uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with: with:
path: ~/go/pkg/mod path: ~/go/pkg/mod
key: ${{ runner.os }}-go-1.23-${{ hashFiles('**/go.sum') }} key: ${{ runner.os }}-go-1.23-${{ hashFiles('**/go.sum') }}
+2 -2
View File
@@ -15,10 +15,10 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@d632cb752374ac6c22015e4b4bef1d19db85d69f # v4.2.0
- name: Download artifacts - name: Download artifacts
uses: actions/download-artifact@v4 uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with: with:
name: coverage-report name: coverage-report
+11 -11
View File
@@ -39,12 +39,12 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@d632cb752374ac6c22015e4b4bef1d19db85d69f # v4.2.0
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v5 uses: actions/setup-go@0a12ed9d6470c3512128ab8f076f97fbbff3da52 # v5.0.1
with: with:
go-version: '1.21' go-version: '1.21'
@@ -142,12 +142,12 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@d632cb752374ac6c22015e4b4bef1d19db85d69f # v4.2.0
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Download all artifacts - name: Download all artifacts
uses: actions/download-artifact@v4 uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with: with:
path: all-releases path: all-releases
pattern: release-* pattern: release-*
@@ -177,7 +177,7 @@ jobs:
fi fi
- name: Create Release - name: Create Release
uses: softprops/action-gh-release@v2 uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
with: with:
files: all-releases/* files: all-releases/*
draft: true draft: true
@@ -228,23 +228,23 @@ jobs:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@d632cb752374ac6c22015e4b4bef1d19db85d69f # v4.2.0
- name: Set up QEMU - name: Set up QEMU
uses: docker/setup-qemu-action@v3 uses: docker/setup-qemu-action@49b3bc8e6f341ff684fb5300544cda1ff1a290d5 # v3.2.0
- name: Set up Docker Buildx - name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3 uses: docker/setup-buildx-action@4fd812986e6c8ec69f87869bf8f84174f3426a6d # v3.4.0
- name: Login to Docker Hub - name: Login to Docker Hub
uses: docker/login-action@v3 uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1b4ee7e33440 # v3.3.0
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
continue-on-error: true continue-on-error: true
- name: Login to GitHub Container Registry - name: Login to GitHub Container Registry
uses: docker/login-action@v3 uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1b4ee7e33440 # v3.3.0
with: with:
registry: ghcr.io registry: ghcr.io
username: ${{ github.actor }} username: ${{ github.actor }}
@@ -255,7 +255,7 @@ jobs:
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Build and push - name: Build and push
uses: docker/build-push-action@v5 uses: docker/build-push-action@5f63d2b5a0f13e6fe58a2658b1cf779280e04def # v6.2.0
with: with:
context: . context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7 platforms: linux/amd64,linux/arm64,linux/arm/v7
+3 -3
View File
@@ -18,15 +18,15 @@ jobs:
steps: steps:
- name: Checkout code - name: Checkout code
uses: actions/checkout@v4 uses: actions/checkout@d632cb752374ac6c22015e4b4bef1d19db85d69f # v4.2.0
- name: Set up Go - name: Set up Go
uses: actions/setup-go@v5 uses: actions/setup-go@0a12ed9d6470c3512128ab8f076f97fbbff3da52 # v5.0.1
with: with:
go-version: ${{ matrix.go-version }} go-version: ${{ matrix.go-version }}
- name: Cache Go modules - name: Cache Go modules
uses: actions/cache@v4 uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with: with:
path: ~/go/pkg/mod path: ~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }}
-1
View File
@@ -497,4 +497,3 @@ func generateNonce() string {
// Generate a simple nonce // Generate a simple nonce
return fmt.Sprintf("%d", time.Now().UnixNano()) return fmt.Sprintf("%d", time.Now().UnixNano())
} }
+4 -4
View File
@@ -643,10 +643,10 @@ func ExampleClient_GetDeviceInformation() {
func TestFixLocalhostURL(t *testing.T) { func TestFixLocalhostURL(t *testing.T) {
tests := []struct { tests := []struct {
name string name string
clientURL string clientURL string
serviceURL string serviceURL string
expectedURL string expectedURL string
}{ }{
{ {
name: "localhost hostname", name: "localhost hostname",
+4 -4
View File
@@ -11,10 +11,10 @@ import (
// ASCIIConfig controls ASCII art generation parameters // ASCIIConfig controls ASCII art generation parameters
type ASCIIConfig struct { type ASCIIConfig struct {
Width int // Output width in characters Width int // Output width in characters
Height int // Output height in characters Height int // Output height in characters
Invert bool // Invert brightness Invert bool // Invert brightness
Quality string // "high", "medium", "low" Quality string // "high", "medium", "low"
} }
// DefaultASCIIConfig returns a sensible default configuration // DefaultASCIIConfig returns a sensible default configuration
-1
View File
@@ -150,7 +150,6 @@ func listNetworkInterfaces() {
} }
} }
func connectAndShowInfo() { func connectAndShowInfo() {
reader := bufio.NewReader(os.Stdin) reader := bufio.NewReader(os.Stdin)
-1
View File
@@ -1092,4 +1092,3 @@ func (c *Client) SetNetworkDefaultGateway(ctx context.Context, gateway *NetworkG
return nil return nil
} }
+4 -4
View File
@@ -110,8 +110,8 @@ func (c *Client) GetDPAddresses(ctx context.Context) ([]NetworkHost, error) {
} }
type GetDPAddressesResponse struct { type GetDPAddressesResponse struct {
XMLName xml.Name `xml:"GetDPAddressesResponse"` XMLName xml.Name `xml:"GetDPAddressesResponse"`
DPAddress []NetworkHost `xml:"DPAddress"` DPAddress []NetworkHost `xml:"DPAddress"`
} }
request := GetDPAddressesBody{ request := GetDPAddressesBody{
@@ -171,8 +171,8 @@ func (c *Client) GetAccessPolicy(ctx context.Context) (*AccessPolicy, error) {
} }
type GetAccessPolicyResponse struct { type GetAccessPolicyResponse struct {
XMLName xml.Name `xml:"GetAccessPolicyResponse"` XMLName xml.Name `xml:"GetAccessPolicyResponse"`
PolicyFile *BinaryData `xml:"PolicyFile"` PolicyFile *BinaryData `xml:"PolicyFile"`
} }
request := GetAccessPolicyBody{ request := GetAccessPolicyBody{
+5 -5
View File
@@ -54,7 +54,7 @@ func newMockDeviceAdditionalServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "GetDPAddresses"): case strings.Contains(bodyContent, "GetDPAddresses"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:GetDPAddressesResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"> <tds:GetDPAddressesResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl">
@@ -71,7 +71,7 @@ func newMockDeviceAdditionalServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "SetDPAddresses"): case strings.Contains(bodyContent, "SetDPAddresses"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:SetDPAddressesResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/> <tds:SetDPAddressesResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/>
@@ -79,7 +79,7 @@ func newMockDeviceAdditionalServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "GetAccessPolicy"): case strings.Contains(bodyContent, "GetAccessPolicy"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:GetAccessPolicyResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"> <tds:GetAccessPolicyResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl">
@@ -92,7 +92,7 @@ func newMockDeviceAdditionalServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "SetAccessPolicy"): case strings.Contains(bodyContent, "SetAccessPolicy"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:SetAccessPolicyResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/> <tds:SetAccessPolicyResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/>
@@ -100,7 +100,7 @@ func newMockDeviceAdditionalServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "GetWsdlUrl"): case strings.Contains(bodyContent, "GetWsdlUrl"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:GetWsdlUrlResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"> <tds:GetWsdlUrlResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl">
+6 -6
View File
@@ -140,7 +140,7 @@ func (c *Client) CreateCertificate(ctx context.Context, certificateID, subject s
} }
type CreateCertificateResponse struct { type CreateCertificateResponse struct {
XMLName xml.Name `xml:"CreateCertificateResponse"` XMLName xml.Name `xml:"CreateCertificateResponse"`
Certificate *Certificate `xml:"Certificate"` Certificate *Certificate `xml:"Certificate"`
} }
@@ -204,7 +204,7 @@ func (c *Client) GetCertificateInformation(ctx context.Context, certificateID st
} }
type GetCertificateInformationResponse struct { type GetCertificateInformationResponse struct {
XMLName xml.Name `xml:"GetCertificateInformationResponse"` XMLName xml.Name `xml:"GetCertificateInformationResponse"`
CertificateInformation *CertificateInformation `xml:"CertificateInformation"` CertificateInformation *CertificateInformation `xml:"CertificateInformation"`
} }
@@ -296,8 +296,8 @@ func (c *Client) GetPkcs10Request(ctx context.Context, certificateID, subject st
} }
type GetPkcs10RequestResponse struct { type GetPkcs10RequestResponse struct {
XMLName xml.Name `xml:"GetPkcs10RequestResponse"` XMLName xml.Name `xml:"GetPkcs10RequestResponse"`
Pkcs10Request *BinaryData `xml:"Pkcs10Request"` Pkcs10Request *BinaryData `xml:"Pkcs10Request"`
} }
request := GetPkcs10RequestBody{ request := GetPkcs10RequestBody{
@@ -323,8 +323,8 @@ func (c *Client) GetPkcs10Request(ctx context.Context, certificateID, subject st
// ONVIF Specification: LoadCertificateWithPrivateKey operation // ONVIF Specification: LoadCertificateWithPrivateKey operation
func (c *Client) LoadCertificateWithPrivateKey(ctx context.Context, certificates []*Certificate, privateKey []*BinaryData, certificateIDs []string) error { func (c *Client) LoadCertificateWithPrivateKey(ctx context.Context, certificates []*Certificate, privateKey []*BinaryData, certificateIDs []string) error {
type LoadCertificateWithPrivateKeyBody struct { type LoadCertificateWithPrivateKeyBody struct {
XMLName xml.Name `xml:"tds:LoadCertificateWithPrivateKey"` XMLName xml.Name `xml:"tds:LoadCertificateWithPrivateKey"`
Xmlns string `xml:"xmlns:tds,attr"` Xmlns string `xml:"xmlns:tds,attr"`
CertificateWithPrivateKey []struct { CertificateWithPrivateKey []struct {
CertificateID string `xml:"CertificateID"` CertificateID string `xml:"CertificateID"`
Certificate *Certificate `xml:"Certificate"` Certificate *Certificate `xml:"Certificate"`
+2 -2
View File
@@ -14,8 +14,8 @@ func newMockDeviceCertificatesServer() *httptest.Server {
w.Header().Set("Content-Type", "application/soap+xml") w.Header().Set("Content-Type", "application/soap+xml")
// Parse request to determine which operation // Parse request to determine which operation
buf := make([]byte, r.ContentLength) buf := make([]byte, r.ContentLength)
_, _ = r.Body.Read(buf) _, _ = r.Body.Read(buf)
requestBody := string(buf) requestBody := string(buf)
var response string var response string
+12 -12
View File
@@ -131,7 +131,7 @@ func (c *Client) FixedGetSystemDateAndTime(ctx context.Context) (*SystemDateTime
} }
type GetSystemDateAndTimeResponse struct { type GetSystemDateAndTimeResponse struct {
XMLName xml.Name `xml:"GetSystemDateAndTimeResponse"` XMLName xml.Name `xml:"GetSystemDateAndTimeResponse"`
SystemDateAndTime struct { SystemDateAndTime struct {
DateTimeType string `xml:"DateTimeType"` DateTimeType string `xml:"DateTimeType"`
DaylightSavings bool `xml:"DaylightSavings"` DaylightSavings bool `xml:"DaylightSavings"`
@@ -406,10 +406,10 @@ func (c *Client) GetRelayOutputs(ctx context.Context) ([]*RelayOutput, error) {
// SetRelayOutputSettings sets the settings of a relay output // SetRelayOutputSettings sets the settings of a relay output
func (c *Client) SetRelayOutputSettings(ctx context.Context, token string, settings *RelayOutputSettings) error { func (c *Client) SetRelayOutputSettings(ctx context.Context, token string, settings *RelayOutputSettings) error {
type SetRelayOutputSettings struct { type SetRelayOutputSettings struct {
XMLName xml.Name `xml:"tds:SetRelayOutputSettings"` XMLName xml.Name `xml:"tds:SetRelayOutputSettings"`
Xmlns string `xml:"xmlns:tds,attr"` Xmlns string `xml:"xmlns:tds,attr"`
RelayOutputToken string `xml:"tds:RelayOutputToken"` RelayOutputToken string `xml:"tds:RelayOutputToken"`
Properties struct { Properties struct {
Mode string `xml:"tt:Mode"` Mode string `xml:"tt:Mode"`
DelayTime string `xml:"tt:DelayTime"` DelayTime string `xml:"tt:DelayTime"`
IdleState string `xml:"tt:IdleState"` IdleState string `xml:"tt:IdleState"`
@@ -417,7 +417,7 @@ func (c *Client) SetRelayOutputSettings(ctx context.Context, token string, setti
} }
req := SetRelayOutputSettings{ req := SetRelayOutputSettings{
Xmlns: deviceNamespace, Xmlns: deviceNamespace,
RelayOutputToken: token, RelayOutputToken: token,
} }
req.Properties.Mode = string(settings.Mode) req.Properties.Mode = string(settings.Mode)
@@ -437,16 +437,16 @@ func (c *Client) SetRelayOutputSettings(ctx context.Context, token string, setti
// SetRelayOutputState sets the state of a relay output // SetRelayOutputState sets the state of a relay output
func (c *Client) SetRelayOutputState(ctx context.Context, token string, state RelayLogicalState) error { func (c *Client) SetRelayOutputState(ctx context.Context, token string, state RelayLogicalState) error {
type SetRelayOutputState struct { type SetRelayOutputState struct {
XMLName xml.Name `xml:"tds:SetRelayOutputState"` XMLName xml.Name `xml:"tds:SetRelayOutputState"`
Xmlns string `xml:"xmlns:tds,attr"` Xmlns string `xml:"xmlns:tds,attr"`
RelayOutputToken string `xml:"tds:RelayOutputToken"` RelayOutputToken string `xml:"tds:RelayOutputToken"`
LogicalState RelayLogicalState `xml:"tds:LogicalState"` LogicalState RelayLogicalState `xml:"tds:LogicalState"`
} }
req := SetRelayOutputState{ req := SetRelayOutputState{
Xmlns: deviceNamespace, Xmlns: deviceNamespace,
RelayOutputToken: token, RelayOutputToken: token,
LogicalState: state, LogicalState: state,
} }
username, password := c.GetCredentials() username, password := c.GetCredentials()
@@ -628,8 +628,8 @@ func (c *Client) GetSystemUris(ctx context.Context) (*SystemLogUriList, string,
} }
type GetSystemUrisResponse struct { type GetSystemUrisResponse struct {
XMLName xml.Name `xml:"GetSystemUrisResponse"` XMLName xml.Name `xml:"GetSystemUrisResponse"`
SystemLogUris *struct { SystemLogUris *struct {
SystemLog []struct { SystemLog []struct {
Type string `xml:"Type"` Type string `xml:"Type"`
Uri string `xml:"Uri"` Uri string `xml:"Uri"`
+10 -10
View File
@@ -24,7 +24,7 @@ func newMockDeviceExtendedServer() *httptest.Server {
switch { switch {
case strings.Contains(bodyContent, "AddScopes"): case strings.Contains(bodyContent, "AddScopes"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:AddScopesResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/> <tds:AddScopesResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/>
@@ -32,7 +32,7 @@ func newMockDeviceExtendedServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "RemoveScopes"): case strings.Contains(bodyContent, "RemoveScopes"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:RemoveScopesResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"> <tds:RemoveScopesResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl">
@@ -42,7 +42,7 @@ func newMockDeviceExtendedServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "SetScopes"): case strings.Contains(bodyContent, "SetScopes"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:SetScopesResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/> <tds:SetScopesResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/>
@@ -50,7 +50,7 @@ func newMockDeviceExtendedServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "GetRelayOutputs"): case strings.Contains(bodyContent, "GetRelayOutputs"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:GetRelayOutputsResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"> <tds:GetRelayOutputsResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl">
@@ -66,7 +66,7 @@ func newMockDeviceExtendedServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "SetRelayOutputSettings"): case strings.Contains(bodyContent, "SetRelayOutputSettings"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:SetRelayOutputSettingsResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/> <tds:SetRelayOutputSettingsResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/>
@@ -74,7 +74,7 @@ func newMockDeviceExtendedServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "SetRelayOutputState"): case strings.Contains(bodyContent, "SetRelayOutputState"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:SetRelayOutputStateResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/> <tds:SetRelayOutputStateResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/>
@@ -82,7 +82,7 @@ func newMockDeviceExtendedServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "SendAuxiliaryCommand"): case strings.Contains(bodyContent, "SendAuxiliaryCommand"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:SendAuxiliaryCommandResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"> <tds:SendAuxiliaryCommandResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl">
@@ -92,7 +92,7 @@ func newMockDeviceExtendedServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "GetSystemLog"): case strings.Contains(bodyContent, "GetSystemLog"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:GetSystemLogResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"> <tds:GetSystemLogResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl">
@@ -104,7 +104,7 @@ func newMockDeviceExtendedServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "SetSystemFactoryDefault"): case strings.Contains(bodyContent, "SetSystemFactoryDefault"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:SetSystemFactoryDefaultResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/> <tds:SetSystemFactoryDefaultResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/>
@@ -112,7 +112,7 @@ func newMockDeviceExtendedServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "StartFirmwareUpgrade"): case strings.Contains(bodyContent, "StartFirmwareUpgrade"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:StartFirmwareUpgradeResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"> <tds:StartFirmwareUpgradeResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl">
+8 -8
View File
@@ -370,7 +370,7 @@ func (c *Client) GetDynamicDNS(ctx context.Context) (*DynamicDNSInformation, err
} }
type GetDynamicDNSResponse struct { type GetDynamicDNSResponse struct {
XMLName xml.Name `xml:"GetDynamicDNSResponse"` XMLName xml.Name `xml:"GetDynamicDNSResponse"`
DynamicDNSInformation struct { DynamicDNSInformation struct {
Type string `xml:"Type"` Type string `xml:"Type"`
Name string `xml:"Name"` Name string `xml:"Name"`
@@ -431,13 +431,13 @@ func (c *Client) GetPasswordComplexityConfiguration(ctx context.Context) (*Passw
} }
type GetPasswordComplexityConfigurationResponse struct { type GetPasswordComplexityConfigurationResponse struct {
XMLName xml.Name `xml:"GetPasswordComplexityConfigurationResponse"` XMLName xml.Name `xml:"GetPasswordComplexityConfigurationResponse"`
MinLen int `xml:"MinLen"` MinLen int `xml:"MinLen"`
Uppercase int `xml:"Uppercase"` Uppercase int `xml:"Uppercase"`
Number int `xml:"Number"` Number int `xml:"Number"`
SpecialChars int `xml:"SpecialChars"` SpecialChars int `xml:"SpecialChars"`
BlockUsernameOccurrence bool `xml:"BlockUsernameOccurrence"` BlockUsernameOccurrence bool `xml:"BlockUsernameOccurrence"`
PolicyConfigurationLocked bool `xml:"PolicyConfigurationLocked"` PolicyConfigurationLocked bool `xml:"PolicyConfigurationLocked"`
} }
req := GetPasswordComplexityConfiguration{ req := GetPasswordComplexityConfiguration{
+14 -14
View File
@@ -24,7 +24,7 @@ func newMockDeviceSecurityServer() *httptest.Server {
switch { switch {
case strings.Contains(bodyContent, "GetRemoteUser"): case strings.Contains(bodyContent, "GetRemoteUser"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:GetRemoteUserResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"> <tds:GetRemoteUserResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl">
@@ -38,7 +38,7 @@ func newMockDeviceSecurityServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "SetRemoteUser"): case strings.Contains(bodyContent, "SetRemoteUser"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:SetRemoteUserResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/> <tds:SetRemoteUserResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/>
@@ -46,7 +46,7 @@ func newMockDeviceSecurityServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "GetIPAddressFilter"): case strings.Contains(bodyContent, "GetIPAddressFilter"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:GetIPAddressFilterResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"> <tds:GetIPAddressFilterResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl">
@@ -62,9 +62,9 @@ func newMockDeviceSecurityServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "SetIPAddressFilter"), case strings.Contains(bodyContent, "SetIPAddressFilter"),
strings.Contains(bodyContent, "AddIPAddressFilter"), strings.Contains(bodyContent, "AddIPAddressFilter"),
strings.Contains(bodyContent, "RemoveIPAddressFilter"): strings.Contains(bodyContent, "RemoveIPAddressFilter"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:SetIPAddressFilterResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/> <tds:SetIPAddressFilterResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/>
@@ -72,7 +72,7 @@ func newMockDeviceSecurityServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "GetZeroConfiguration"): case strings.Contains(bodyContent, "GetZeroConfiguration"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:GetZeroConfigurationResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"> <tds:GetZeroConfigurationResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl">
@@ -86,7 +86,7 @@ func newMockDeviceSecurityServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "SetZeroConfiguration"): case strings.Contains(bodyContent, "SetZeroConfiguration"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:SetZeroConfigurationResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/> <tds:SetZeroConfigurationResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/>
@@ -94,7 +94,7 @@ func newMockDeviceSecurityServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "GetPasswordComplexityConfiguration"): case strings.Contains(bodyContent, "GetPasswordComplexityConfiguration"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:GetPasswordComplexityConfigurationResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"> <tds:GetPasswordComplexityConfigurationResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl">
@@ -109,7 +109,7 @@ func newMockDeviceSecurityServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "SetPasswordComplexityConfiguration"): case strings.Contains(bodyContent, "SetPasswordComplexityConfiguration"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:SetPasswordComplexityConfigurationResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/> <tds:SetPasswordComplexityConfigurationResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/>
@@ -117,7 +117,7 @@ func newMockDeviceSecurityServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "GetPasswordHistoryConfiguration"): case strings.Contains(bodyContent, "GetPasswordHistoryConfiguration"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:GetPasswordHistoryConfigurationResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"> <tds:GetPasswordHistoryConfigurationResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl">
@@ -128,7 +128,7 @@ func newMockDeviceSecurityServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "SetPasswordHistoryConfiguration"): case strings.Contains(bodyContent, "SetPasswordHistoryConfiguration"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:SetPasswordHistoryConfigurationResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/> <tds:SetPasswordHistoryConfigurationResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/>
@@ -136,7 +136,7 @@ func newMockDeviceSecurityServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "GetAuthFailureWarningConfiguration"): case strings.Contains(bodyContent, "GetAuthFailureWarningConfiguration"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:GetAuthFailureWarningConfigurationResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"> <tds:GetAuthFailureWarningConfigurationResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl">
@@ -148,7 +148,7 @@ func newMockDeviceSecurityServer() *httptest.Server {
</s:Envelope>`)) </s:Envelope>`))
case strings.Contains(bodyContent, "SetAuthFailureWarningConfiguration"): case strings.Contains(bodyContent, "SetAuthFailureWarningConfiguration"):
_, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?> _, _ = w.Write([]byte(`<?xml version="1.0" encoding="UTF-8"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope"> <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope">
<s:Body> <s:Body>
<tds:SetAuthFailureWarningConfigurationResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/> <tds:SetAuthFailureWarningConfigurationResponse xmlns:tds="http://www.onvif.org/ver10/device/wsdl"/>
+2 -2
View File
@@ -13,8 +13,8 @@ func newMockDeviceStorageServer() *httptest.Server {
w.Header().Set("Content-Type", "application/soap+xml") w.Header().Set("Content-Type", "application/soap+xml")
// Parse request to determine which operation // Parse request to determine which operation
buf := make([]byte, r.ContentLength) buf := make([]byte, r.ContentLength)
_, _ = r.Body.Read(buf) _, _ = r.Body.Read(buf)
requestBody := string(buf) requestBody := string(buf)
var response string var response string
+11 -11
View File
@@ -18,7 +18,7 @@ func (c *Client) GetDot11Capabilities(ctx context.Context) (*Dot11Capabilities,
} }
type GetDot11CapabilitiesResponse struct { type GetDot11CapabilitiesResponse struct {
XMLName xml.Name `xml:"GetDot11CapabilitiesResponse"` XMLName xml.Name `xml:"GetDot11CapabilitiesResponse"`
Capabilities *Dot11Capabilities `xml:"Capabilities"` Capabilities *Dot11Capabilities `xml:"Capabilities"`
} }
@@ -73,14 +73,14 @@ func (c *Client) GetDot11Status(ctx context.Context, interfaceToken string) (*Do
// ONVIF Specification: GetDot1XConfiguration operation // ONVIF Specification: GetDot1XConfiguration operation
func (c *Client) GetDot1XConfiguration(ctx context.Context, configToken string) (*Dot1XConfiguration, error) { func (c *Client) GetDot1XConfiguration(ctx context.Context, configToken string) (*Dot1XConfiguration, error) {
type GetDot1XConfigurationBody struct { type GetDot1XConfigurationBody struct {
XMLName xml.Name `xml:"tds:GetDot1XConfiguration"` XMLName xml.Name `xml:"tds:GetDot1XConfiguration"`
Xmlns string `xml:"xmlns:tds,attr"` Xmlns string `xml:"xmlns:tds,attr"`
Dot1XConfigurationToken string `xml:"tds:Dot1XConfigurationToken"` Dot1XConfigurationToken string `xml:"tds:Dot1XConfigurationToken"`
} }
type GetDot1XConfigurationResponse struct { type GetDot1XConfigurationResponse struct {
XMLName xml.Name `xml:"GetDot1XConfigurationResponse"` XMLName xml.Name `xml:"GetDot1XConfigurationResponse"`
Dot1XConfiguration *Dot1XConfiguration `xml:"Dot1XConfiguration"` Dot1XConfiguration *Dot1XConfiguration `xml:"Dot1XConfiguration"`
} }
request := GetDot1XConfigurationBody{ request := GetDot1XConfigurationBody{
@@ -109,8 +109,8 @@ func (c *Client) GetDot1XConfigurations(ctx context.Context) ([]*Dot1XConfigurat
} }
type GetDot1XConfigurationsResponse struct { type GetDot1XConfigurationsResponse struct {
XMLName xml.Name `xml:"GetDot1XConfigurationsResponse"` XMLName xml.Name `xml:"GetDot1XConfigurationsResponse"`
Dot1XConfiguration []*Dot1XConfiguration `xml:"Dot1XConfiguration"` Dot1XConfiguration []*Dot1XConfiguration `xml:"Dot1XConfiguration"`
} }
request := GetDot1XConfigurationsBody{ request := GetDot1XConfigurationsBody{
@@ -193,9 +193,9 @@ func (c *Client) CreateDot1XConfiguration(ctx context.Context, config *Dot1XConf
// ONVIF Specification: DeleteDot1XConfiguration operation // ONVIF Specification: DeleteDot1XConfiguration operation
func (c *Client) DeleteDot1XConfiguration(ctx context.Context, configToken string) error { func (c *Client) DeleteDot1XConfiguration(ctx context.Context, configToken string) error {
type DeleteDot1XConfigurationBody struct { type DeleteDot1XConfigurationBody struct {
XMLName xml.Name `xml:"tds:DeleteDot1XConfiguration"` XMLName xml.Name `xml:"tds:DeleteDot1XConfiguration"`
Xmlns string `xml:"xmlns:tds,attr"` Xmlns string `xml:"xmlns:tds,attr"`
Dot1XConfigurationToken string `xml:"tds:Dot1XConfigurationToken"` Dot1XConfigurationToken string `xml:"tds:Dot1XConfigurationToken"`
} }
type DeleteDot1XConfigurationResponse struct { type DeleteDot1XConfigurationResponse struct {
+2 -2
View File
@@ -13,8 +13,8 @@ func newMockDeviceWiFiServer() *httptest.Server {
w.Header().Set("Content-Type", "application/soap+xml") w.Header().Set("Content-Type", "application/soap+xml")
// Parse request to determine which operation // Parse request to determine which operation
buf := make([]byte, r.ContentLength) buf := make([]byte, r.ContentLength)
_, _ = r.Body.Read(buf) _, _ = r.Body.Read(buf)
requestBody := string(buf) requestBody := string(buf)
var response string var response string
+2 -2
View File
@@ -62,8 +62,8 @@ type ProbeMatch struct {
// ProbeMatches represents WS-Discovery probe matches // ProbeMatches represents WS-Discovery probe matches
type ProbeMatches struct { type ProbeMatches struct {
XMLName xml.Name `xml:"ProbeMatches"` XMLName xml.Name `xml:"ProbeMatches"`
ProbeMatch []ProbeMatch `xml:"ProbeMatch"` ProbeMatch []ProbeMatch `xml:"ProbeMatch"`
} }
// DiscoverOptions contains options for device discovery // DiscoverOptions contains options for device discovery
+1 -1
View File
@@ -89,7 +89,7 @@ func demonstratePTZ(ctx context.Context, client *onvif.Client, profileToken stri
fmt.Println("Moving camera right...") fmt.Println("Moving camera right...")
velocity := &onvif.PTZSpeed{ velocity := &onvif.PTZSpeed{
PanTilt: &onvif.Vector2D{ PanTilt: &onvif.Vector2D{
X: 0.5, // Move right X: 0.5, // Move right
Y: 0.0, Y: 0.0,
}, },
} }
+6 -6
View File
@@ -63,18 +63,18 @@ func TestBuildEnvelope(t *testing.T) {
wantErr bool wantErr bool
}{ }{
{ {
name: "with authentication", name: "with authentication",
body: &testRequest{Value: "test"}, body: &testRequest{Value: "test"},
username: "admin", username: "admin",
password: "password", password: "password",
wantErr: false, wantErr: false,
}, },
{ {
name: "without authentication", name: "without authentication",
body: &testRequest{Value: "test"}, body: &testRequest{Value: "test"},
username: "", username: "",
password: "", password: "",
wantErr: false, wantErr: false,
}, },
} }
+12 -12
View File
@@ -45,10 +45,10 @@ type AnalyticsCapabilities struct {
// DeviceCapabilities represents device service capabilities // DeviceCapabilities represents device service capabilities
type DeviceCapabilities struct { type DeviceCapabilities struct {
XAddr string `xml:"XAddr"` XAddr string `xml:"XAddr"`
Network *NetworkCapabilities `xml:"Network,omitempty"` Network *NetworkCapabilities `xml:"Network,omitempty"`
System *SystemCapabilities `xml:"System,omitempty"` System *SystemCapabilities `xml:"System,omitempty"`
IO *IOCapabilities `xml:"IO,omitempty"` IO *IOCapabilities `xml:"IO,omitempty"`
Security *SecurityCapabilities `xml:"Security,omitempty"` Security *SecurityCapabilities `xml:"Security,omitempty"`
} }
@@ -62,12 +62,12 @@ type NetworkCapabilities struct {
// SystemCapabilities represents system capabilities // SystemCapabilities represents system capabilities
type SystemCapabilities struct { type SystemCapabilities struct {
DiscoveryResolve bool `xml:"DiscoveryResolve,attr"` DiscoveryResolve bool `xml:"DiscoveryResolve,attr"`
DiscoveryBye bool `xml:"DiscoveryBye,attr"` DiscoveryBye bool `xml:"DiscoveryBye,attr"`
RemoteDiscovery bool `xml:"RemoteDiscovery,attr"` RemoteDiscovery bool `xml:"RemoteDiscovery,attr"`
SystemBackup bool `xml:"SystemBackup,attr"` SystemBackup bool `xml:"SystemBackup,attr"`
SystemLogging bool `xml:"SystemLogging,attr"` SystemLogging bool `xml:"SystemLogging,attr"`
FirmwareUpgrade bool `xml:"FirmwareUpgrade,attr"` FirmwareUpgrade bool `xml:"FirmwareUpgrade,attr"`
} }
// IOCapabilities represents I/O capabilities // IOCapabilities represents I/O capabilities
@@ -127,8 +127,8 @@ type GetServicesResponse struct {
// Service represents a service // Service represents a service
type Service struct { type Service struct {
Namespace string `xml:"Namespace"` Namespace string `xml:"Namespace"`
XAddr string `xml:"XAddr"` XAddr string `xml:"XAddr"`
Version Version `xml:"Version"` Version Version `xml:"Version"`
} }
+20 -20
View File
@@ -42,18 +42,18 @@ type BacklightCompensationSettings struct {
// ExposureSettings20 represents exposure settings for ONVIF 2.0 // ExposureSettings20 represents exposure settings for ONVIF 2.0
type ExposureSettings20 struct { type ExposureSettings20 struct {
Mode string `xml:"Mode"` Mode string `xml:"Mode"`
Priority *string `xml:"Priority,omitempty"` Priority *string `xml:"Priority,omitempty"`
Window *Rectangle `xml:"Window,omitempty"` Window *Rectangle `xml:"Window,omitempty"`
MinExposureTime *float64 `xml:"MinExposureTime,omitempty"` MinExposureTime *float64 `xml:"MinExposureTime,omitempty"`
MaxExposureTime *float64 `xml:"MaxExposureTime,omitempty"` MaxExposureTime *float64 `xml:"MaxExposureTime,omitempty"`
MinGain *float64 `xml:"MinGain,omitempty"` MinGain *float64 `xml:"MinGain,omitempty"`
MaxGain *float64 `xml:"MaxGain,omitempty"` MaxGain *float64 `xml:"MaxGain,omitempty"`
MinIris *float64 `xml:"MinIris,omitempty"` MinIris *float64 `xml:"MinIris,omitempty"`
MaxIris *float64 `xml:"MaxIris,omitempty"` MaxIris *float64 `xml:"MaxIris,omitempty"`
ExposureTime *float64 `xml:"ExposureTime,omitempty"` ExposureTime *float64 `xml:"ExposureTime,omitempty"`
Gain *float64 `xml:"Gain,omitempty"` Gain *float64 `xml:"Gain,omitempty"`
Iris *float64 `xml:"Iris,omitempty"` Iris *float64 `xml:"Iris,omitempty"`
} }
// FocusConfiguration20 represents focus configuration for ONVIF 2.0 // FocusConfiguration20 represents focus configuration for ONVIF 2.0
@@ -168,15 +168,15 @@ type WhiteBalanceOptions struct {
// MoveRequest represents Move (focus) request // MoveRequest represents Move (focus) request
type MoveRequest struct { type MoveRequest struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/imaging/wsdl Move"` XMLName xml.Name `xml:"http://www.onvif.org/ver20/imaging/wsdl Move"`
VideoSourceToken string `xml:"VideoSourceToken"` VideoSourceToken string `xml:"VideoSourceToken"`
Focus *FocusMove `xml:"Focus"` Focus *FocusMove `xml:"Focus"`
} }
// FocusMove represents focus move parameters // FocusMove represents focus move parameters
type FocusMove struct { type FocusMove struct {
Absolute *AbsoluteFocus `xml:"Absolute,omitempty"` Absolute *AbsoluteFocus `xml:"Absolute,omitempty"`
Relative *RelativeFocus `xml:"Relative,omitempty"` Relative *RelativeFocus `xml:"Relative,omitempty"`
Continuous *ContinuousFocus `xml:"Continuous,omitempty"` Continuous *ContinuousFocus `xml:"Continuous,omitempty"`
} }
@@ -342,10 +342,10 @@ func (s *Server) HandleSetImagingSettings(body interface{}) (interface{}, error)
func (s *Server) HandleGetOptions(body interface{}) (interface{}, error) { func (s *Server) HandleGetOptions(body interface{}) (interface{}, error) {
// Return available imaging options/capabilities // Return available imaging options/capabilities
options := &ImagingOptions{ options := &ImagingOptions{
Brightness: &FloatRange{Min: 0, Max: 100}, Brightness: &FloatRange{Min: 0, Max: 100},
ColorSaturation: &FloatRange{Min: 0, Max: 100}, ColorSaturation: &FloatRange{Min: 0, Max: 100},
Contrast: &FloatRange{Min: 0, Max: 100}, Contrast: &FloatRange{Min: 0, Max: 100},
Sharpness: &FloatRange{Min: 0, Max: 100}, Sharpness: &FloatRange{Min: 0, Max: 100},
IrCutFilterModes: []string{"ON", "OFF", "AUTO"}, IrCutFilterModes: []string{"ON", "OFF", "AUTO"},
BacklightCompensation: &BacklightCompensationOptions{ BacklightCompensation: &BacklightCompensationOptions{
Mode: []string{"OFF", "ON"}, Mode: []string{"OFF", "ON"},
+11 -11
View File
@@ -9,7 +9,7 @@ import (
// GetProfilesResponse represents GetProfiles response // GetProfilesResponse represents GetProfiles response
type GetProfilesResponse struct { type GetProfilesResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver10/media/wsdl GetProfilesResponse"` XMLName xml.Name `xml:"http://www.onvif.org/ver10/media/wsdl GetProfilesResponse"`
Profiles []MediaProfile `xml:"Profiles"` Profiles []MediaProfile `xml:"Profiles"`
} }
@@ -46,16 +46,16 @@ type AudioSourceConfiguration struct {
// VideoEncoderConfiguration represents video encoder configuration // VideoEncoderConfiguration represents video encoder configuration
type VideoEncoderConfiguration struct { type VideoEncoderConfiguration struct {
Token string `xml:"token,attr"` Token string `xml:"token,attr"`
Name string `xml:"Name"` Name string `xml:"Name"`
UseCount int `xml:"UseCount"` UseCount int `xml:"UseCount"`
Encoding string `xml:"Encoding"` Encoding string `xml:"Encoding"`
Resolution VideoResolution `xml:"Resolution"` Resolution VideoResolution `xml:"Resolution"`
Quality float64 `xml:"Quality"` Quality float64 `xml:"Quality"`
RateControl *VideoRateControl `xml:"RateControl,omitempty"` RateControl *VideoRateControl `xml:"RateControl,omitempty"`
H264 *H264Configuration `xml:"H264,omitempty"` H264 *H264Configuration `xml:"H264,omitempty"`
Multicast *MulticastConfiguration `xml:"Multicast,omitempty"` Multicast *MulticastConfiguration `xml:"Multicast,omitempty"`
SessionTimeout string `xml:"SessionTimeout"` SessionTimeout string `xml:"SessionTimeout"`
} }
// AudioEncoderConfiguration represents audio encoder configuration // AudioEncoderConfiguration represents audio encoder configuration
@@ -130,7 +130,7 @@ type MulticastConfiguration struct {
// IPAddress represents an IP address // IPAddress represents an IP address
type IPAddress struct { type IPAddress struct {
Type string `xml:"Type"` Type string `xml:"Type"`
IPv4Address string `xml:"IPv4Address,omitempty"` IPv4Address string `xml:"IPv4Address,omitempty"`
IPv6Address string `xml:"IPv6Address,omitempty"` IPv6Address string `xml:"IPv6Address,omitempty"`
} }
+9 -9
View File
@@ -75,9 +75,9 @@ type GetStatusResponse struct {
// PTZStatus represents PTZ status // PTZStatus represents PTZ status
type PTZStatus struct { type PTZStatus struct {
Position PTZVector `xml:"Position"` Position PTZVector `xml:"Position"`
MoveStatus PTZMoveStatus `xml:"MoveStatus"` MoveStatus PTZMoveStatus `xml:"MoveStatus"`
UTCTime string `xml:"UtcTime"` UTCTime string `xml:"UtcTime"`
} }
// PTZMoveStatus represents PTZ movement status // PTZMoveStatus represents PTZ movement status
@@ -113,7 +113,7 @@ type GetPresetsRequest struct {
// GetPresetsResponse represents GetPresets response // GetPresetsResponse represents GetPresets response
type GetPresetsResponse struct { type GetPresetsResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl GetPresetsResponse"` XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl GetPresetsResponse"`
Preset []PTZPreset `xml:"Preset"` Preset []PTZPreset `xml:"Preset"`
} }
@@ -153,16 +153,16 @@ type SetPresetResponse struct {
// GetConfigurationsResponse represents GetConfigurations response // GetConfigurationsResponse represents GetConfigurations response
type GetConfigurationsResponse struct { type GetConfigurationsResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl GetConfigurationsResponse"` XMLName xml.Name `xml:"http://www.onvif.org/ver20/ptz/wsdl GetConfigurationsResponse"`
PTZConfiguration []PTZConfigurationExt `xml:"PTZConfiguration"` PTZConfiguration []PTZConfigurationExt `xml:"PTZConfiguration"`
} }
// PTZConfigurationExt represents PTZ configuration with extensions // PTZConfigurationExt represents PTZ configuration with extensions
type PTZConfigurationExt struct { type PTZConfigurationExt struct {
Token string `xml:"token,attr"` Token string `xml:"token,attr"`
Name string `xml:"Name"` Name string `xml:"Name"`
UseCount int `xml:"UseCount"` UseCount int `xml:"UseCount"`
NodeToken string `xml:"NodeToken"` NodeToken string `xml:"NodeToken"`
PanTiltLimits *PanTiltLimits `xml:"PanTiltLimits,omitempty"` PanTiltLimits *PanTiltLimits `xml:"PanTiltLimits,omitempty"`
ZoomLimits *ZoomLimits `xml:"ZoomLimits,omitempty"` ZoomLimits *ZoomLimits `xml:"ZoomLimits,omitempty"`
} }
+6 -6
View File
@@ -241,17 +241,17 @@ type GetSystemDateAndTimeRequest struct {
// GetSystemDateAndTimeResponse represents GetSystemDateAndTime response // GetSystemDateAndTimeResponse represents GetSystemDateAndTime response
type GetSystemDateAndTimeResponse struct { type GetSystemDateAndTimeResponse struct {
XMLName xml.Name `xml:"http://www.onvif.org/ver10/device/wsdl GetSystemDateAndTimeResponse"` XMLName xml.Name `xml:"http://www.onvif.org/ver10/device/wsdl GetSystemDateAndTimeResponse"`
SystemDateAndTime SystemDateAndTime `xml:"SystemDateAndTime"` SystemDateAndTime SystemDateAndTime `xml:"SystemDateAndTime"`
} }
// SystemDateAndTime represents system date and time // SystemDateAndTime represents system date and time
type SystemDateAndTime struct { type SystemDateAndTime struct {
DateTimeType string `xml:"DateTimeType"` DateTimeType string `xml:"DateTimeType"`
DaylightSavings bool `xml:"DaylightSavings"` DaylightSavings bool `xml:"DaylightSavings"`
TimeZone TimeZone `xml:"TimeZone,omitempty"` TimeZone TimeZone `xml:"TimeZone,omitempty"`
UTCDateTime DateTime `xml:"UTCDateTime,omitempty"` UTCDateTime DateTime `xml:"UTCDateTime,omitempty"`
LocalDateTime DateTime `xml:"LocalDateTime,omitempty"` LocalDateTime DateTime `xml:"LocalDateTime,omitempty"`
} }
// TimeZone represents timezone information // TimeZone represents timezone information
+10 -10
View File
@@ -88,15 +88,15 @@ type AudioEncoderConfig struct {
// PTZConfig represents PTZ configuration // PTZConfig represents PTZ configuration
type PTZConfig struct { type PTZConfig struct {
NodeToken string // PTZ node token NodeToken string // PTZ node token
PanRange Range // Pan range in degrees PanRange Range // Pan range in degrees
TiltRange Range // Tilt range in degrees TiltRange Range // Tilt range in degrees
ZoomRange Range // Zoom range ZoomRange Range // Zoom range
DefaultSpeed PTZSpeed // Default speed DefaultSpeed PTZSpeed // Default speed
SupportsContinuous bool // Supports continuous move SupportsContinuous bool // Supports continuous move
SupportsAbsolute bool // Supports absolute move SupportsAbsolute bool // Supports absolute move
SupportsRelative bool // Supports relative move SupportsRelative bool // Supports relative move
Presets []Preset // Predefined presets Presets []Preset // Predefined presets
} }
// SnapshotConfig represents snapshot configuration // SnapshotConfig represents snapshot configuration
@@ -195,8 +195,8 @@ type BacklightCompensation struct {
// ExposureSettings represents exposure settings // ExposureSettings represents exposure settings
type ExposureSettings struct { type ExposureSettings struct {
Mode string // AUTO, MANUAL Mode string // AUTO, MANUAL
Priority string // LowNoise, FrameRate Priority string // LowNoise, FrameRate
MinExposure float64 MinExposure float64
MaxExposure float64 MaxExposure float64
MinGain float64 MinGain float64
@@ -207,7 +207,7 @@ type ExposureSettings struct {
// FocusSettings represents focus settings // FocusSettings represents focus settings
type FocusSettings struct { type FocusSettings struct {
AutoFocusMode string // AUTO, MANUAL AutoFocusMode string // AUTO, MANUAL
DefaultSpeed float64 DefaultSpeed float64
NearLimit float64 NearLimit float64
FarLimit float64 FarLimit float64
@@ -216,7 +216,7 @@ type FocusSettings struct {
// WhiteBalanceSettings represents white balance settings // WhiteBalanceSettings represents white balance settings
type WhiteBalanceSettings struct { type WhiteBalanceSettings struct {
Mode string // AUTO, MANUAL Mode string // AUTO, MANUAL
CrGain float64 CrGain float64
CbGain float64 CbGain float64
} }
-1
View File
@@ -1,5 +1,4 @@
package onvif package onvif
package captures
import ( import (
"context" "context"
+29 -29
View File
@@ -872,9 +872,9 @@ const (
// RemoteUser represents remote user configuration // RemoteUser represents remote user configuration
type RemoteUser struct { type RemoteUser struct {
Username string Username string
Password string Password string
UseDerivedPassword bool UseDerivedPassword bool
} }
// Certificate represents a certificate // Certificate represents a certificate
@@ -917,17 +917,17 @@ type CertificateUsage struct {
// DateTimeRange represents date/time range // DateTimeRange represents date/time range
type DateTimeRange struct { type DateTimeRange struct {
From time.Time From time.Time
Until time.Time Until time.Time
} }
// Dot11Capabilities represents 802.11 capabilities // Dot11Capabilities represents 802.11 capabilities
type Dot11Capabilities struct { type Dot11Capabilities struct {
TKIP bool TKIP bool
ScanAvailableNetworks bool ScanAvailableNetworks bool
MultipleConfiguration bool MultipleConfiguration bool
AdHocStationMode bool AdHocStationMode bool
WEP bool WEP bool
} }
// Dot11Status represents 802.11 status // Dot11Status represents 802.11 status
@@ -985,12 +985,12 @@ type TLSConfiguration struct {
// Dot11AvailableNetworks represents available 802.11 networks // Dot11AvailableNetworks represents available 802.11 networks
type Dot11AvailableNetworks struct { type Dot11AvailableNetworks struct {
SSID string SSID string
BSSID string BSSID string
AuthAndMangementSuite []Dot11AuthAndMangementSuite AuthAndMangementSuite []Dot11AuthAndMangementSuite
PairCipher []Dot11Cipher PairCipher []Dot11Cipher
GroupCipher []Dot11Cipher GroupCipher []Dot11Cipher
SignalStrength Dot11SignalStrength SignalStrength Dot11SignalStrength
} }
// Dot11AuthAndMangementSuite represents auth suite // Dot11AuthAndMangementSuite represents auth suite
@@ -1011,18 +1011,18 @@ type StorageConfiguration struct {
// StorageConfigurationData represents storage configuration data // StorageConfigurationData represents storage configuration data
type StorageConfigurationData struct { type StorageConfigurationData struct {
Type string Type string
LocalPath string LocalPath string
StorageUri string StorageUri string
User *UserCredential User *UserCredential
CertPathValidationPolicyID string CertPathValidationPolicyID string
} }
// UserCredential represents user credentials // UserCredential represents user credentials
type UserCredential struct { type UserCredential struct {
UserName string UserName string
Password string Password string
Token string Token string
} }
// LocationEntity represents geo location // LocationEntity represents geo location
@@ -1049,12 +1049,12 @@ type AccessPolicy struct {
// PasswordComplexityConfiguration represents password complexity config // PasswordComplexityConfiguration represents password complexity config
type PasswordComplexityConfiguration struct { type PasswordComplexityConfiguration struct {
MinLen int MinLen int
Uppercase int Uppercase int
Number int Number int
SpecialChars int SpecialChars int
BlockUsernameOccurrence bool BlockUsernameOccurrence bool
PolicyConfigurationLocked bool PolicyConfigurationLocked bool
} }
// PasswordHistoryConfiguration represents password history config // PasswordHistoryConfiguration represents password history config