From 8902e4e789ff1a0a711c818e0a3151477618869f Mon Sep 17 00:00:00 2001 From: Cedric Verstraeten Date: Mon, 18 Dec 2023 20:16:21 +0100 Subject: [PATCH] upgrade onvif library --- .github/dependabot.yml | 7 + .gitignore | 3 + .idea/.gitignore | 8 - .idea/modules.xml | 8 - .idea/onvif.iml | 9 - .idea/vcs.xml | 6 - .vscode/settings.json | 4 +- Device.go | 277 +++-- Device_test.go | 24 + Imaging/types.go | 44 + README.md | 35 +- analytics/common.go | 47 + analytics/function.go | 117 +++ analytics/types.go | 213 +++- api/api.go | 137 +-- cmd/camera-example/main.go | 132 +++ constant.go | 9 + device/function.go | 819 +++++++++++++++ device/types.go | 187 ++-- deviceio/function.go | 819 +++++++++++++++ deviceio/types.go | 913 +++++++++++++++++ digestclient.go | 111 ++ doc.go | 2 +- docs/Development.md | 34 + event/function.go | 99 ++ event/operation.go | 130 --- event/topic/description.go | 22 + event/topic/ruleengine.go | 63 ++ event/type_test.go | 92 ++ event/types.go | 236 ++++- examples/DeviceService.go | 44 +- .../getanalyticsconfigurations/main.go | 28 + examples/analytic/getprofiles/main.go | 28 + examples/discovery_test.go | 18 +- examples/event/createpullpoint/main.go | 87 ++ examples/event/eventproperties/main.go | 28 + examples/event/pullmessage/main.go | 92 ++ examples/event/renew/main.go | 94 ++ examples/event/subscribe/main.go | 110 ++ examples/event/unsubscribe/main.go | 75 ++ examples/getusers/main.go | 27 + functionmap.go | 36 + go.mod | 42 +- go.sum | 163 ++- gosoap/envelope.go | 121 +++ gosoap/soap-builder.go | 4 +- gosoap/ws-action.go | 2 +- gosoap/ws-security.go | 14 +- imaging/function.go | 108 ++ interfaces.go | 6 + mappings.go | 299 ++++++ media/function.go | 720 +++++++++++++ media/types.go | 36 +- media2/function.go | 45 + media2/types.go | 93 ++ media2/types_test.go | 134 +++ names.go | 297 ++++++ networking/networking.go | 4 +- ptz/function.go | 261 +++++ ptz/types.go | 62 +- python/Makefile | 11 + python/gen_commands.py | 149 +++ recording/function.go | 198 ++++ recording/types.go | 793 +++++++++++++++ sdk/codegen/main.go | 78 -- sdk/device/AddIPAddressFilter_auto.go | 30 - sdk/device/AddScopes_auto.go | 30 - sdk/device/CreateCertificate_auto.go | 30 - sdk/device/CreateDot1XConfiguration_auto.go | 30 - sdk/device/CreateStorageConfiguration_auto.go | 30 - sdk/device/CreateUsers_auto.go | 30 - sdk/device/DeleteCertificates_auto.go | 30 - sdk/device/DeleteDot1XConfiguration_auto.go | 30 - sdk/device/DeleteGeoLocation_auto.go | 30 - sdk/device/DeleteStorageConfiguration_auto.go | 30 - sdk/device/DeleteUsers_auto.go | 30 - sdk/device/GetAccessPolicy_auto.go | 30 - sdk/device/GetCACertificates_auto.go | 30 - sdk/device/GetCapabilities_auto.go | 30 - sdk/device/GetCertificateInformation_auto.go | 30 - sdk/device/GetCertificatesStatus_auto.go | 30 - sdk/device/GetCertificates_auto.go | 30 - sdk/device/GetClientCertificateMode_auto.go | 30 - sdk/device/GetDNS_auto.go | 30 - sdk/device/GetDPAddresses_auto.go | 30 - sdk/device/GetDeviceInformation_auto.go | 30 - sdk/device/GetDiscoveryMode_auto.go | 30 - sdk/device/GetDot11Capabilities_auto.go | 30 - sdk/device/GetDot11Status_auto.go | 30 - sdk/device/GetDot1XConfiguration_auto.go | 30 - sdk/device/GetDot1XConfigurations_auto.go | 30 - sdk/device/GetDynamicDNS_auto.go | 30 - sdk/device/GetEndpointReference_auto.go | 30 - sdk/device/GetGeoLocation_auto.go | 30 - sdk/device/GetHostname_auto.go | 30 - sdk/device/GetIPAddressFilter_auto.go | 30 - sdk/device/GetNTP_auto.go | 30 - sdk/device/GetNetworkDefaultGateway_auto.go | 30 - sdk/device/GetNetworkInterfaces_auto.go | 30 - sdk/device/GetNetworkProtocols_auto.go | 30 - sdk/device/GetPkcs10Request_auto.go | 30 - sdk/device/GetRelayOutputs_auto.go | 30 - sdk/device/GetRemoteDiscoveryMode_auto.go | 30 - sdk/device/GetRemoteUser_auto.go | 30 - sdk/device/GetScopes_auto.go | 30 - sdk/device/GetServiceCapabilities_auto.go | 30 - sdk/device/GetServices_auto.go | 30 - sdk/device/GetStorageConfiguration_auto.go | 30 - sdk/device/GetStorageConfigurations_auto.go | 30 - sdk/device/GetSystemBackup_auto.go | 30 - sdk/device/GetSystemDateAndTime_auto.go | 30 - sdk/device/GetSystemLog_auto.go | 30 - .../GetSystemSupportInformation_auto.go | 30 - sdk/device/GetSystemUris_auto.go | 30 - sdk/device/GetUsers_auto.go | 30 - sdk/device/GetWsdlUrl_auto.go | 30 - sdk/device/GetZeroConfiguration_auto.go | 30 - sdk/device/LoadCACertificates_auto.go | 30 - .../LoadCertificateWithPrivateKey_auto.go | 30 - sdk/device/LoadCertificates_auto.go | 30 - sdk/device/RemoveIPAddressFilter_auto.go | 30 - sdk/device/RemoveScopes_auto.go | 30 - sdk/device/RestoreSystem_auto.go | 30 - sdk/device/ScanAvailableDot11Networks_auto.go | 30 - sdk/device/SendAuxiliaryCommand_auto.go | 30 - sdk/device/SetAccessPolicy_auto.go | 30 - sdk/device/SetCertificatesStatus_auto.go | 30 - sdk/device/SetClientCertificateMode_auto.go | 30 - sdk/device/SetDNS_auto.go | 30 - sdk/device/SetDiscoveryMode_auto.go | 30 - sdk/device/SetDot1XConfiguration_auto.go | 30 - sdk/device/SetDynamicDNS_auto.go | 30 - sdk/device/SetGeoLocation_auto.go | 30 - sdk/device/SetHostnameFromDHCP_auto.go | 30 - sdk/device/SetHostname_auto.go | 30 - sdk/device/SetIPAddressFilter_auto.go | 30 - sdk/device/SetNTP_auto.go | 30 - sdk/device/SetNetworkDefaultGateway_auto.go | 30 - sdk/device/SetNetworkInterfaces_auto.go | 30 - sdk/device/SetNetworkProtocols_auto.go | 30 - sdk/device/SetRelayOutputSettings_auto.go | 30 - sdk/device/SetRelayOutputState_auto.go | 30 - sdk/device/SetRemoteDiscoveryMode_auto.go | 30 - sdk/device/SetRemoteUser_auto.go | 30 - sdk/device/SetScopes_auto.go | 30 - sdk/device/SetStorageConfiguration_auto.go | 30 - sdk/device/SetSystemDateAndTime_auto.go | 30 - sdk/device/SetSystemFactoryDefault_auto.go | 30 - sdk/device/SetUser_auto.go | 30 - sdk/device/SetZeroConfiguration_auto.go | 30 - sdk/device/StartFirmwareUpgrade_auto.go | 30 - sdk/device/StartSystemRestore_auto.go | 30 - sdk/device/SystemReboot_auto.go | 30 - sdk/device/UpgradeSystemFirmware_auto.go | 30 - sdk/device/device.go | 91 -- sdk/event/CreatePullPointSubscription_auto.go | 30 - sdk/event/GetEventProperties_auto.go | 30 - sdk/event/GetServiceCapabilities_auto.go | 30 - sdk/event/Subscribe_auto.go | 30 - sdk/event/Unsubscribe_auto.go | 30 - .../AddAudioDecoderConfiguration_auto.go | 30 - .../AddAudioEncoderConfiguration_auto.go | 30 - sdk/media/AddAudioOutputConfiguration_auto.go | 30 - sdk/media/AddAudioSourceConfiguration_auto.go | 30 - sdk/media/AddMetadataConfiguration_auto.go | 30 - sdk/media/AddPTZConfiguration_auto.go | 30 - .../AddVideoAnalyticsConfiguration_auto.go | 30 - .../AddVideoEncoderConfiguration_auto.go | 30 - sdk/media/AddVideoSourceConfiguration_auto.go | 30 - sdk/media/CreateOSD_auto.go | 30 - sdk/media/CreateProfile_auto.go | 30 - sdk/media/DeleteOSD_auto.go | 30 - sdk/media/DeleteProfile_auto.go | 30 - ...etAudioDecoderConfigurationOptions_auto.go | 30 - .../GetAudioDecoderConfiguration_auto.go | 30 - .../GetAudioDecoderConfigurations_auto.go | 30 - ...etAudioEncoderConfigurationOptions_auto.go | 30 - .../GetAudioEncoderConfiguration_auto.go | 30 - .../GetAudioEncoderConfigurations_auto.go | 30 - ...GetAudioOutputConfigurationOptions_auto.go | 30 - sdk/media/GetAudioOutputConfiguration_auto.go | 30 - .../GetAudioOutputConfigurations_auto.go | 30 - sdk/media/GetAudioOutputs_auto.go | 30 - ...GetAudioSourceConfigurationOptions_auto.go | 30 - sdk/media/GetAudioSourceConfiguration_auto.go | 30 - .../GetAudioSourceConfigurations_auto.go | 30 - sdk/media/GetAudioSources_auto.go | 30 - ...mpatibleAudioDecoderConfigurations_auto.go | 30 - ...mpatibleAudioEncoderConfigurations_auto.go | 30 - ...ompatibleAudioOutputConfigurations_auto.go | 30 - ...ompatibleAudioSourceConfigurations_auto.go | 30 - ...etCompatibleMetadataConfigurations_auto.go | 30 - ...atibleVideoAnalyticsConfigurations_auto.go | 30 - ...mpatibleVideoEncoderConfigurations_auto.go | 30 - ...ompatibleVideoSourceConfigurations_auto.go | 30 - ...nteedNumberOfVideoEncoderInstances_auto.go | 30 - .../GetMetadataConfigurationOptions_auto.go | 30 - sdk/media/GetMetadataConfiguration_auto.go | 30 - sdk/media/GetMetadataConfigurations_auto.go | 30 - sdk/media/GetOSDOptions_auto.go | 30 - sdk/media/GetOSD_auto.go | 30 - sdk/media/GetOSDs_auto.go | 30 - sdk/media/GetProfile_auto.go | 30 - sdk/media/GetProfiles_auto.go | 30 - sdk/media/GetServiceCapabilities_auto.go | 30 - sdk/media/GetSnapshotUri_auto.go | 30 - sdk/media/GetStreamUri_auto.go | 30 - .../GetVideoAnalyticsConfiguration_auto.go | 30 - .../GetVideoAnalyticsConfigurations_auto.go | 30 - ...etVideoEncoderConfigurationOptions_auto.go | 30 - .../GetVideoEncoderConfiguration_auto.go | 30 - .../GetVideoEncoderConfigurations_auto.go | 30 - ...GetVideoSourceConfigurationOptions_auto.go | 30 - sdk/media/GetVideoSourceConfiguration_auto.go | 30 - .../GetVideoSourceConfigurations_auto.go | 30 - sdk/media/GetVideoSourceModes_auto.go | 30 - sdk/media/GetVideoSources_auto.go | 30 - .../RemoveAudioDecoderConfiguration_auto.go | 30 - .../RemoveAudioEncoderConfiguration_auto.go | 30 - .../RemoveAudioOutputConfiguration_auto.go | 30 - .../RemoveAudioSourceConfiguration_auto.go | 30 - sdk/media/RemoveMetadataConfiguration_auto.go | 30 - sdk/media/RemovePTZConfiguration_auto.go | 30 - .../RemoveVideoAnalyticsConfiguration_auto.go | 30 - .../RemoveVideoEncoderConfiguration_auto.go | 30 - .../RemoveVideoSourceConfiguration_auto.go | 30 - .../SetAudioDecoderConfiguration_auto.go | 30 - .../SetAudioEncoderConfiguration_auto.go | 30 - sdk/media/SetAudioOutputConfiguration_auto.go | 30 - sdk/media/SetAudioSourceConfiguration_auto.go | 30 - sdk/media/SetMetadataConfiguration_auto.go | 30 - sdk/media/SetOSD_auto.go | 30 - sdk/media/SetSynchronizationPoint_auto.go | 30 - .../SetVideoAnalyticsConfiguration_auto.go | 30 - .../SetVideoEncoderConfiguration_auto.go | 30 - sdk/media/SetVideoSourceConfiguration_auto.go | 30 - sdk/media/SetVideoSourceMode_auto.go | 30 - sdk/media/StartMulticastStreaming_auto.go | 30 - sdk/media/StopMulticastStreaming_auto.go | 30 - sdk/media/media.go | 81 -- sdk/ptz/AbsoluteMove_auto.go | 30 - sdk/ptz/ContinuousMove_auto.go | 30 - sdk/ptz/CreatePresetTour_auto.go | 30 - sdk/ptz/GeoMove_auto.go | 30 - sdk/ptz/GetCompatibleConfigurations_auto.go | 30 - sdk/ptz/GetConfigurationOptions_auto.go | 30 - sdk/ptz/GetConfiguration_auto.go | 30 - sdk/ptz/GetConfigurations_auto.go | 30 - sdk/ptz/GetNode_auto.go | 30 - sdk/ptz/GetNodes_auto.go | 30 - sdk/ptz/GetPresetTourOptions_auto.go | 30 - sdk/ptz/GetPresetTour_auto.go | 30 - sdk/ptz/GetPresetTours_auto.go | 30 - sdk/ptz/GetPresets_auto.go | 30 - sdk/ptz/GetServiceCapabilities_auto.go | 30 - sdk/ptz/GetStatus_auto.go | 30 - sdk/ptz/GotoHomePosition_auto.go | 30 - sdk/ptz/GotoPreset_auto.go | 30 - sdk/ptz/ModifyPresetTour_auto.go | 30 - sdk/ptz/OperatePresetTour_auto.go | 30 - sdk/ptz/RelativeMove_auto.go | 30 - sdk/ptz/RemovePresetTour_auto.go | 30 - sdk/ptz/RemovePreset_auto.go | 30 - sdk/ptz/SendAuxiliaryCommand_auto.go | 30 - sdk/ptz/SetConfiguration_auto.go | 30 - sdk/ptz/SetHomePosition_auto.go | 30 - sdk/ptz/SetPreset_auto.go | 30 - sdk/ptz/Stop_auto.go | 30 - sdk/ptz/ptz.go | 30 - sdk/sdk.go | 43 - ws-discovery/networking.go | 176 +++- ws-discovery/networking_test.go | 56 + ws-discovery/ws-discovery.go | 73 +- xsd/built_in.go | 450 ++++---- xsd/onvif/onvif.go | 958 ++++++++++-------- 275 files changed, 9208 insertions(+), 7694 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .gitignore delete mode 100644 .idea/.gitignore delete mode 100644 .idea/modules.xml delete mode 100644 .idea/onvif.iml delete mode 100644 .idea/vcs.xml create mode 100644 Device_test.go create mode 100644 analytics/common.go create mode 100644 analytics/function.go create mode 100644 cmd/camera-example/main.go create mode 100644 constant.go create mode 100644 device/function.go create mode 100644 deviceio/function.go create mode 100644 deviceio/types.go create mode 100644 digestclient.go create mode 100644 docs/Development.md create mode 100644 event/function.go delete mode 100644 event/operation.go create mode 100644 event/topic/description.go create mode 100644 event/topic/ruleengine.go create mode 100644 event/type_test.go create mode 100644 examples/analytic/getanalyticsconfigurations/main.go create mode 100644 examples/analytic/getprofiles/main.go create mode 100644 examples/event/createpullpoint/main.go create mode 100644 examples/event/eventproperties/main.go create mode 100644 examples/event/pullmessage/main.go create mode 100644 examples/event/renew/main.go create mode 100644 examples/event/subscribe/main.go create mode 100644 examples/event/unsubscribe/main.go create mode 100644 examples/getusers/main.go create mode 100644 functionmap.go create mode 100644 gosoap/envelope.go create mode 100644 imaging/function.go create mode 100644 interfaces.go create mode 100644 mappings.go create mode 100644 media/function.go create mode 100644 media2/function.go create mode 100644 media2/types.go create mode 100644 media2/types_test.go create mode 100644 names.go create mode 100644 ptz/function.go create mode 100644 python/Makefile create mode 100755 python/gen_commands.py create mode 100644 recording/function.go create mode 100644 recording/types.go delete mode 100644 sdk/codegen/main.go delete mode 100644 sdk/device/AddIPAddressFilter_auto.go delete mode 100644 sdk/device/AddScopes_auto.go delete mode 100644 sdk/device/CreateCertificate_auto.go delete mode 100644 sdk/device/CreateDot1XConfiguration_auto.go delete mode 100644 sdk/device/CreateStorageConfiguration_auto.go delete mode 100644 sdk/device/CreateUsers_auto.go delete mode 100644 sdk/device/DeleteCertificates_auto.go delete mode 100644 sdk/device/DeleteDot1XConfiguration_auto.go delete mode 100644 sdk/device/DeleteGeoLocation_auto.go delete mode 100644 sdk/device/DeleteStorageConfiguration_auto.go delete mode 100644 sdk/device/DeleteUsers_auto.go delete mode 100644 sdk/device/GetAccessPolicy_auto.go delete mode 100644 sdk/device/GetCACertificates_auto.go delete mode 100644 sdk/device/GetCapabilities_auto.go delete mode 100644 sdk/device/GetCertificateInformation_auto.go delete mode 100644 sdk/device/GetCertificatesStatus_auto.go delete mode 100644 sdk/device/GetCertificates_auto.go delete mode 100644 sdk/device/GetClientCertificateMode_auto.go delete mode 100644 sdk/device/GetDNS_auto.go delete mode 100644 sdk/device/GetDPAddresses_auto.go delete mode 100644 sdk/device/GetDeviceInformation_auto.go delete mode 100644 sdk/device/GetDiscoveryMode_auto.go delete mode 100644 sdk/device/GetDot11Capabilities_auto.go delete mode 100644 sdk/device/GetDot11Status_auto.go delete mode 100644 sdk/device/GetDot1XConfiguration_auto.go delete mode 100644 sdk/device/GetDot1XConfigurations_auto.go delete mode 100644 sdk/device/GetDynamicDNS_auto.go delete mode 100644 sdk/device/GetEndpointReference_auto.go delete mode 100644 sdk/device/GetGeoLocation_auto.go delete mode 100644 sdk/device/GetHostname_auto.go delete mode 100644 sdk/device/GetIPAddressFilter_auto.go delete mode 100644 sdk/device/GetNTP_auto.go delete mode 100644 sdk/device/GetNetworkDefaultGateway_auto.go delete mode 100644 sdk/device/GetNetworkInterfaces_auto.go delete mode 100644 sdk/device/GetNetworkProtocols_auto.go delete mode 100644 sdk/device/GetPkcs10Request_auto.go delete mode 100644 sdk/device/GetRelayOutputs_auto.go delete mode 100644 sdk/device/GetRemoteDiscoveryMode_auto.go delete mode 100644 sdk/device/GetRemoteUser_auto.go delete mode 100644 sdk/device/GetScopes_auto.go delete mode 100644 sdk/device/GetServiceCapabilities_auto.go delete mode 100644 sdk/device/GetServices_auto.go delete mode 100644 sdk/device/GetStorageConfiguration_auto.go delete mode 100644 sdk/device/GetStorageConfigurations_auto.go delete mode 100644 sdk/device/GetSystemBackup_auto.go delete mode 100644 sdk/device/GetSystemDateAndTime_auto.go delete mode 100644 sdk/device/GetSystemLog_auto.go delete mode 100644 sdk/device/GetSystemSupportInformation_auto.go delete mode 100644 sdk/device/GetSystemUris_auto.go delete mode 100644 sdk/device/GetUsers_auto.go delete mode 100644 sdk/device/GetWsdlUrl_auto.go delete mode 100644 sdk/device/GetZeroConfiguration_auto.go delete mode 100644 sdk/device/LoadCACertificates_auto.go delete mode 100644 sdk/device/LoadCertificateWithPrivateKey_auto.go delete mode 100644 sdk/device/LoadCertificates_auto.go delete mode 100644 sdk/device/RemoveIPAddressFilter_auto.go delete mode 100644 sdk/device/RemoveScopes_auto.go delete mode 100644 sdk/device/RestoreSystem_auto.go delete mode 100644 sdk/device/ScanAvailableDot11Networks_auto.go delete mode 100644 sdk/device/SendAuxiliaryCommand_auto.go delete mode 100644 sdk/device/SetAccessPolicy_auto.go delete mode 100644 sdk/device/SetCertificatesStatus_auto.go delete mode 100644 sdk/device/SetClientCertificateMode_auto.go delete mode 100644 sdk/device/SetDNS_auto.go delete mode 100644 sdk/device/SetDiscoveryMode_auto.go delete mode 100644 sdk/device/SetDot1XConfiguration_auto.go delete mode 100644 sdk/device/SetDynamicDNS_auto.go delete mode 100644 sdk/device/SetGeoLocation_auto.go delete mode 100644 sdk/device/SetHostnameFromDHCP_auto.go delete mode 100644 sdk/device/SetHostname_auto.go delete mode 100644 sdk/device/SetIPAddressFilter_auto.go delete mode 100644 sdk/device/SetNTP_auto.go delete mode 100644 sdk/device/SetNetworkDefaultGateway_auto.go delete mode 100644 sdk/device/SetNetworkInterfaces_auto.go delete mode 100644 sdk/device/SetNetworkProtocols_auto.go delete mode 100644 sdk/device/SetRelayOutputSettings_auto.go delete mode 100644 sdk/device/SetRelayOutputState_auto.go delete mode 100644 sdk/device/SetRemoteDiscoveryMode_auto.go delete mode 100644 sdk/device/SetRemoteUser_auto.go delete mode 100644 sdk/device/SetScopes_auto.go delete mode 100644 sdk/device/SetStorageConfiguration_auto.go delete mode 100644 sdk/device/SetSystemDateAndTime_auto.go delete mode 100644 sdk/device/SetSystemFactoryDefault_auto.go delete mode 100644 sdk/device/SetUser_auto.go delete mode 100644 sdk/device/SetZeroConfiguration_auto.go delete mode 100644 sdk/device/StartFirmwareUpgrade_auto.go delete mode 100644 sdk/device/StartSystemRestore_auto.go delete mode 100644 sdk/device/SystemReboot_auto.go delete mode 100644 sdk/device/UpgradeSystemFirmware_auto.go delete mode 100644 sdk/device/device.go delete mode 100644 sdk/event/CreatePullPointSubscription_auto.go delete mode 100644 sdk/event/GetEventProperties_auto.go delete mode 100644 sdk/event/GetServiceCapabilities_auto.go delete mode 100644 sdk/event/Subscribe_auto.go delete mode 100644 sdk/event/Unsubscribe_auto.go delete mode 100644 sdk/media/AddAudioDecoderConfiguration_auto.go delete mode 100644 sdk/media/AddAudioEncoderConfiguration_auto.go delete mode 100644 sdk/media/AddAudioOutputConfiguration_auto.go delete mode 100644 sdk/media/AddAudioSourceConfiguration_auto.go delete mode 100644 sdk/media/AddMetadataConfiguration_auto.go delete mode 100644 sdk/media/AddPTZConfiguration_auto.go delete mode 100644 sdk/media/AddVideoAnalyticsConfiguration_auto.go delete mode 100644 sdk/media/AddVideoEncoderConfiguration_auto.go delete mode 100644 sdk/media/AddVideoSourceConfiguration_auto.go delete mode 100644 sdk/media/CreateOSD_auto.go delete mode 100644 sdk/media/CreateProfile_auto.go delete mode 100644 sdk/media/DeleteOSD_auto.go delete mode 100644 sdk/media/DeleteProfile_auto.go delete mode 100644 sdk/media/GetAudioDecoderConfigurationOptions_auto.go delete mode 100644 sdk/media/GetAudioDecoderConfiguration_auto.go delete mode 100644 sdk/media/GetAudioDecoderConfigurations_auto.go delete mode 100644 sdk/media/GetAudioEncoderConfigurationOptions_auto.go delete mode 100644 sdk/media/GetAudioEncoderConfiguration_auto.go delete mode 100644 sdk/media/GetAudioEncoderConfigurations_auto.go delete mode 100644 sdk/media/GetAudioOutputConfigurationOptions_auto.go delete mode 100644 sdk/media/GetAudioOutputConfiguration_auto.go delete mode 100644 sdk/media/GetAudioOutputConfigurations_auto.go delete mode 100644 sdk/media/GetAudioOutputs_auto.go delete mode 100644 sdk/media/GetAudioSourceConfigurationOptions_auto.go delete mode 100644 sdk/media/GetAudioSourceConfiguration_auto.go delete mode 100644 sdk/media/GetAudioSourceConfigurations_auto.go delete mode 100644 sdk/media/GetAudioSources_auto.go delete mode 100644 sdk/media/GetCompatibleAudioDecoderConfigurations_auto.go delete mode 100644 sdk/media/GetCompatibleAudioEncoderConfigurations_auto.go delete mode 100644 sdk/media/GetCompatibleAudioOutputConfigurations_auto.go delete mode 100644 sdk/media/GetCompatibleAudioSourceConfigurations_auto.go delete mode 100644 sdk/media/GetCompatibleMetadataConfigurations_auto.go delete mode 100644 sdk/media/GetCompatibleVideoAnalyticsConfigurations_auto.go delete mode 100644 sdk/media/GetCompatibleVideoEncoderConfigurations_auto.go delete mode 100644 sdk/media/GetCompatibleVideoSourceConfigurations_auto.go delete mode 100644 sdk/media/GetGuaranteedNumberOfVideoEncoderInstances_auto.go delete mode 100644 sdk/media/GetMetadataConfigurationOptions_auto.go delete mode 100644 sdk/media/GetMetadataConfiguration_auto.go delete mode 100644 sdk/media/GetMetadataConfigurations_auto.go delete mode 100644 sdk/media/GetOSDOptions_auto.go delete mode 100644 sdk/media/GetOSD_auto.go delete mode 100644 sdk/media/GetOSDs_auto.go delete mode 100644 sdk/media/GetProfile_auto.go delete mode 100644 sdk/media/GetProfiles_auto.go delete mode 100644 sdk/media/GetServiceCapabilities_auto.go delete mode 100644 sdk/media/GetSnapshotUri_auto.go delete mode 100644 sdk/media/GetStreamUri_auto.go delete mode 100644 sdk/media/GetVideoAnalyticsConfiguration_auto.go delete mode 100644 sdk/media/GetVideoAnalyticsConfigurations_auto.go delete mode 100644 sdk/media/GetVideoEncoderConfigurationOptions_auto.go delete mode 100644 sdk/media/GetVideoEncoderConfiguration_auto.go delete mode 100644 sdk/media/GetVideoEncoderConfigurations_auto.go delete mode 100644 sdk/media/GetVideoSourceConfigurationOptions_auto.go delete mode 100644 sdk/media/GetVideoSourceConfiguration_auto.go delete mode 100644 sdk/media/GetVideoSourceConfigurations_auto.go delete mode 100644 sdk/media/GetVideoSourceModes_auto.go delete mode 100644 sdk/media/GetVideoSources_auto.go delete mode 100644 sdk/media/RemoveAudioDecoderConfiguration_auto.go delete mode 100644 sdk/media/RemoveAudioEncoderConfiguration_auto.go delete mode 100644 sdk/media/RemoveAudioOutputConfiguration_auto.go delete mode 100644 sdk/media/RemoveAudioSourceConfiguration_auto.go delete mode 100644 sdk/media/RemoveMetadataConfiguration_auto.go delete mode 100644 sdk/media/RemovePTZConfiguration_auto.go delete mode 100644 sdk/media/RemoveVideoAnalyticsConfiguration_auto.go delete mode 100644 sdk/media/RemoveVideoEncoderConfiguration_auto.go delete mode 100644 sdk/media/RemoveVideoSourceConfiguration_auto.go delete mode 100644 sdk/media/SetAudioDecoderConfiguration_auto.go delete mode 100644 sdk/media/SetAudioEncoderConfiguration_auto.go delete mode 100644 sdk/media/SetAudioOutputConfiguration_auto.go delete mode 100644 sdk/media/SetAudioSourceConfiguration_auto.go delete mode 100644 sdk/media/SetMetadataConfiguration_auto.go delete mode 100644 sdk/media/SetOSD_auto.go delete mode 100644 sdk/media/SetSynchronizationPoint_auto.go delete mode 100644 sdk/media/SetVideoAnalyticsConfiguration_auto.go delete mode 100644 sdk/media/SetVideoEncoderConfiguration_auto.go delete mode 100644 sdk/media/SetVideoSourceConfiguration_auto.go delete mode 100644 sdk/media/SetVideoSourceMode_auto.go delete mode 100644 sdk/media/StartMulticastStreaming_auto.go delete mode 100644 sdk/media/StopMulticastStreaming_auto.go delete mode 100644 sdk/media/media.go delete mode 100644 sdk/ptz/AbsoluteMove_auto.go delete mode 100644 sdk/ptz/ContinuousMove_auto.go delete mode 100644 sdk/ptz/CreatePresetTour_auto.go delete mode 100644 sdk/ptz/GeoMove_auto.go delete mode 100644 sdk/ptz/GetCompatibleConfigurations_auto.go delete mode 100644 sdk/ptz/GetConfigurationOptions_auto.go delete mode 100644 sdk/ptz/GetConfiguration_auto.go delete mode 100644 sdk/ptz/GetConfigurations_auto.go delete mode 100644 sdk/ptz/GetNode_auto.go delete mode 100644 sdk/ptz/GetNodes_auto.go delete mode 100644 sdk/ptz/GetPresetTourOptions_auto.go delete mode 100644 sdk/ptz/GetPresetTour_auto.go delete mode 100644 sdk/ptz/GetPresetTours_auto.go delete mode 100644 sdk/ptz/GetPresets_auto.go delete mode 100644 sdk/ptz/GetServiceCapabilities_auto.go delete mode 100644 sdk/ptz/GetStatus_auto.go delete mode 100644 sdk/ptz/GotoHomePosition_auto.go delete mode 100644 sdk/ptz/GotoPreset_auto.go delete mode 100644 sdk/ptz/ModifyPresetTour_auto.go delete mode 100644 sdk/ptz/OperatePresetTour_auto.go delete mode 100644 sdk/ptz/RelativeMove_auto.go delete mode 100644 sdk/ptz/RemovePresetTour_auto.go delete mode 100644 sdk/ptz/RemovePreset_auto.go delete mode 100644 sdk/ptz/SendAuxiliaryCommand_auto.go delete mode 100644 sdk/ptz/SetConfiguration_auto.go delete mode 100644 sdk/ptz/SetHomePosition_auto.go delete mode 100644 sdk/ptz/SetPreset_auto.go delete mode 100644 sdk/ptz/Stop_auto.go delete mode 100644 sdk/ptz/ptz.go delete mode 100644 sdk/sdk.go create mode 100644 ws-discovery/networking_test.go diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..1e275fab --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,7 @@ +version: 2 +updates: + # Maintain dependencies for Go modules + - package-ecosystem: "gomod" + directory: "/" + schedule: + interval: "weekly" diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..72bb3617 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +*.iml +.idea/ +.vscode/ diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 73f69e09..00000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml -# Editor-based HTTP Client requests -/httpRequests/ diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index ce0aa0d1..00000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/onvif.iml b/.idea/onvif.iml deleted file mode 100644 index 5e764c4f..00000000 --- a/.idea/onvif.iml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7f..00000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 7746fc46..d58c7a74 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -27,7 +27,9 @@ "go.testTimeout": "10s", "go.formatTool": "goimports", "cSpell.allowCompoundWords": true, - "editor.codeActionsOnSave": {"source.organizeImports": true}, + "editor.codeActionsOnSave": { + "source.organizeImports": "explicit" + }, "cSpell.words": [ "wsdiscovery" ] diff --git a/Device.go b/Device.go index d88f5485..ec4c2581 100644 --- a/Device.go +++ b/Device.go @@ -1,8 +1,11 @@ package onvif import ( + "bytes" + "encoding/json" "encoding/xml" "errors" + "fmt" "io/ioutil" "net/http" "net/url" @@ -10,11 +13,11 @@ import ( "strconv" "strings" + "github.com/kerberos-io/onvif/xsd/onvif" + "github.com/beevik/etree" "github.com/kerberos-io/onvif/device" "github.com/kerberos-io/onvif/gosoap" - "github.com/kerberos-io/onvif/networking" - wsdiscovery "github.com/kerberos-io/onvif/ws-discovery" ) // Xlmns XML Scheam @@ -22,6 +25,7 @@ var Xlmns = map[string]string{ "onvif": "http://www.onvif.org/ver10/schema", "tds": "http://www.onvif.org/ver10/device/wsdl", "trt": "http://www.onvif.org/ver10/media/wsdl", + "tr2": "http://www.onvif.org/ver20/media/wsdl", "tev": "http://www.onvif.org/ver10/events/wsdl", "tptz": "http://www.onvif.org/ver20/ptz/wsdl", "timg": "http://www.onvif.org/ver20/imaging/wsdl", @@ -34,6 +38,9 @@ var Xlmns = map[string]string{ "wsntw": "http://docs.oasis-open.org/wsn/bw-2", "wsrf-rw": "http://docs.oasis-open.org/wsrf/rw-2", "wsaw": "http://www.w3.org/2006/05/addressing/wsdl", + "tt": "http://www.onvif.org/ver10/recording/wsdl", + "wsse": "http://docs.oasis-open.org/wss/2004/01/oasis-200401", + "wsu": "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", } // DeviceType alias for int @@ -45,6 +52,8 @@ const ( NVS NVA NVT + + ContentType = "Content-Type" ) func (devType DeviceType) String() string { @@ -65,6 +74,7 @@ func (devType DeviceType) String() string { // DeviceInfo struct contains general information about ONVIF device type DeviceInfo struct { + Name string Manufacturer string Model string FirmwareVersion string @@ -76,16 +86,19 @@ type DeviceInfo struct { // struct represents an abstract ONVIF device. // It contains methods, which helps to communicate with ONVIF device type Device struct { - params DeviceParams - endpoints map[string]string - info DeviceInfo + params DeviceParams + endpoints map[string]string + info DeviceInfo + digestClient *DigestClient } type DeviceParams struct { - Xaddr string - Username string - Password string - HttpClient *http.Client + Xaddr string + EndpointRefAddress string + Username string + Password string + HttpClient *http.Client + AuthMode string } // GetServices return available endpoints @@ -98,66 +111,60 @@ func (dev *Device) GetDeviceInfo() DeviceInfo { return dev.info } -func readResponse(resp *http.Response) string { - b, err := ioutil.ReadAll(resp.Body) - if err != nil { - panic(err) +// SetDeviceInfoFromScopes goes through the scopes and sets the device info fields for supported categories (currently name and hardware). +// See 7.3.2.2 Scopes in the ONVIF Core Specification (https://www.onvif.org/specs/core/ONVIF-Core-Specification.pdf). +func (dev *Device) SetDeviceInfoFromScopes(scopes []string) { + newInfo := dev.info + supportedScopes := []struct { + category string + setField func(s string) + }{ + {category: "name", setField: func(s string) { newInfo.Name = s }}, + {category: "hardware", setField: func(s string) { newInfo.Model = s }}, } - return string(b) -} - -// GetAvailableDevicesAtSpecificEthernetInterface ... -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 { - return nil, err - } - - for _, xaddr := range doc.Root().FindElements("./Body/ProbeMatches/ProbeMatch/XAddrs") { - xaddr := strings.Split(strings.Split(xaddr.Text(), " ")[0], "/")[2] - if !nvtDevicesSeen[xaddr] { - dev, err := NewDevice(DeviceParams{Xaddr: strings.Split(xaddr, " ")[0]}) + for _, s := range scopes { + for _, supp := range supportedScopes { + fullScope := fmt.Sprintf("onvif://www.onvif.org/%s/", supp.category) + scopeValue, matchesScope := strings.CutPrefix(s, fullScope) + if matchesScope { + unescaped, err := url.QueryUnescape(scopeValue) if err != nil { - // TODO(jfsmig) print a warning - } else { - nvtDevicesSeen[xaddr] = true - nvtDevices = append(nvtDevices, *dev) + continue } + supp.setField(unescaped) } } } + dev.info = newInfo +} - return nvtDevices, nil +func readResponse(resp *http.Response) string { + b, err := ioutil.ReadAll(resp.Body) + if err != nil { + panic(err) + } + return string(b) } -func (dev *Device) getSupportedServices(data []byte) error { +func (dev *Device) getSupportedServices(resp *http.Response) { doc := etree.NewDocument() + + data, _ := ioutil.ReadAll(resp.Body) + if err := doc.ReadFromBytes(data); err != nil { //log.Println(err.Error()) - return err + return } - 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 { + extensionServices := doc.FindElements("./Envelope/Body/GetCapabilitiesResponse/Capabilities/Extension/*/XAddr") + for _, j := range extensionServices { dev.addEndpoint(j.Parent().Tag, j.Text()) } - - return nil } // NewDevice function construct a ONVIF Device entity @@ -170,26 +177,17 @@ func NewDevice(params DeviceParams) (*Device, error) { if dev.params.HttpClient == nil { dev.params.HttpClient = new(http.Client) } + dev.digestClient = NewDigestClient(dev.params.HttpClient, dev.params.Username, dev.params.Password) - getCapabilities := device.GetCapabilities{Category: "All"} + getCapabilities := device.GetCapabilities{Category: []onvif.CapabilityCategory{"All"}} resp, err := dev.CallMethod(getCapabilities) - var b []byte - if resp != nil { - b, err = ioutil.ReadAll(resp.Body) - resp.Body.Close() - } - if err != nil || resp.StatusCode != http.StatusOK { return nil, errors.New("camera is not available at " + dev.params.Xaddr + " or it does not support ONVIF services") } - err = dev.getSupportedServices(b) - if err != nil { - return nil, err - } - + dev.getSupportedServices(resp) return dev, nil } @@ -205,6 +203,11 @@ func (dev *Device) addEndpoint(Key, Value string) { } dev.endpoints[lowCaseKey] = Value + + if lowCaseKey == strings.ToLower(MediaWebService) { + // Media2 uses the same endpoint but different XML name space + dev.endpoints[strings.ToLower(Media2WebService)] = Value + } } // GetEndpoint returns specific ONVIF service endpoint address @@ -212,7 +215,7 @@ func (dev *Device) GetEndpoint(name string) string { return dev.endpoints[name] } -func (dev Device) buildMethodSOAP(msg string) (gosoap.SoapMessage, error) { +func (dev *Device) buildMethodSOAP(msg string) (gosoap.SoapMessage, error) { doc := etree.NewDocument() if err := doc.ReadFromString(msg); err != nil { //log.Println("Got error") @@ -228,7 +231,7 @@ func (dev Device) buildMethodSOAP(msg string) (gosoap.SoapMessage, error) { } // getEndpoint functions get the target service endpoint in a better way -func (dev Device) getEndpoint(endpoint string) (string, error) { +func (dev *Device) getEndpoint(endpoint string) (string, error) { // common condition, endpointMark in map we use this. if endpointURL, bFound := dev.endpoints[endpoint]; bFound { @@ -250,7 +253,7 @@ func (dev Device) getEndpoint(endpoint string) (string, error) { // CallMethod functions call an method, defined struct. // You should use Authenticate method to call authorized requests. -func (dev Device) CallMethod(method interface{}) (*http.Response, error) { +func (dev *Device) CallMethod(method interface{}) (*http.Response, error) { pkgPath := strings.Split(reflect.TypeOf(method).PkgPath(), "/") pkg := strings.ToLower(pkgPath[len(pkgPath)-1]) @@ -258,28 +261,156 @@ func (dev Device) CallMethod(method interface{}) (*http.Response, error) { if err != nil { return nil, err } - return dev.callMethodDo(endpoint, method) + requestBody, err := xml.Marshal(method) + if err != nil { + return nil, err + } + return dev.SendSoap(endpoint, string(requestBody)) +} + +func (dev *Device) GetDeviceParams() DeviceParams { + return dev.params +} + +func (dev *Device) GetEndpointByRequestStruct(requestStruct interface{}) (string, error) { + pkgPath := strings.Split(reflect.TypeOf(requestStruct).Elem().PkgPath(), "/") + pkg := strings.ToLower(pkgPath[len(pkgPath)-1]) + + endpoint, err := dev.getEndpoint(pkg) + if err != nil { + return "", err + } + return endpoint, err +} + +func (dev *Device) SendSoap(endpoint string, xmlRequestBody string) (resp *http.Response, err error) { + soap := gosoap.NewEmptySOAP() + soap.AddStringBodyContent(xmlRequestBody) + soap.AddRootNamespaces(Xlmns) + if dev.params.AuthMode == UsernameTokenAuth || dev.params.AuthMode == Both { + soap.AddWSSecurity(dev.params.Username, dev.params.Password) + } + + if dev.params.AuthMode == DigestAuth || dev.params.AuthMode == Both { + resp, err = dev.digestClient.Do(http.MethodPost, endpoint, soap.String()) + } else { + var req *http.Request + req, err = createHttpRequest(http.MethodPost, endpoint, soap.String()) + if err != nil { + return nil, err + } + resp, err = dev.params.HttpClient.Do(req) + } + return resp, err +} + +func createHttpRequest(httpMethod string, endpoint string, soap string) (req *http.Request, err error) { + req, err = http.NewRequest(httpMethod, endpoint, bytes.NewBufferString(soap)) + if err != nil { + return nil, err + } + req.Header.Set(ContentType, "application/soap+xml; charset=utf-8") + return req, nil } -// CallMethod functions call an method, defined struct with authentication data -func (dev Device) callMethodDo(endpoint string, method interface{}) (*http.Response, error) { - output, err := xml.MarshalIndent(method, " ", " ") +func (dev *Device) CallOnvifFunction(serviceName, functionName string, data []byte) (interface{}, error) { + function, err := FunctionByServiceAndFunctionName(serviceName, functionName) + if err != nil { + return nil, err + } + request, err := createRequest(function, data) + if err != nil { + return nil, fmt.Errorf("fail to create '%s' request for the web service '%s', %v", functionName, serviceName, err) + } + + endpoint, err := dev.GetEndpointByRequestStruct(request) + if err != nil { + return nil, err + } + + requestBody, err := xml.Marshal(request) + if err != nil { + return nil, err + } + xmlRequestBody := string(requestBody) + + servResp, err := dev.SendSoap(endpoint, xmlRequestBody) + if err != nil { + return nil, fmt.Errorf("fail to send the '%s' request for the web service '%s', %v", functionName, serviceName, err) + } + defer servResp.Body.Close() + + rsp, err := ioutil.ReadAll(servResp.Body) if err != nil { return nil, err } - soap, err := dev.buildMethodSOAP(string(output)) + responseEnvelope, err := createResponse(function, rsp) + if err != nil { + return nil, fmt.Errorf("fail to create '%s' response for the web service '%s', %v", functionName, serviceName, err) + } + + if servResp.StatusCode == http.StatusUnauthorized { + return nil, fmt.Errorf("fail to verify the authentication for the function '%s' of web service '%s'. Onvif error: %s", + functionName, serviceName, responseEnvelope.Body.Fault.String()) + } else if servResp.StatusCode == http.StatusBadRequest { + return nil, fmt.Errorf("invalid request for the function '%s' of web service '%s'. Onvif error: %s", + functionName, serviceName, responseEnvelope.Body.Fault.String()) + } else if servResp.StatusCode > http.StatusNoContent { + return nil, fmt.Errorf("fail to execute the request for the function '%s' of web service '%s'. Onvif error: %s", + functionName, serviceName, responseEnvelope.Body.Fault.String()) + } + return responseEnvelope.Body.Content, nil +} + +func createRequest(function Function, data []byte) (interface{}, error) { + request := function.Request() + if len(data) > 0 { + err := json.Unmarshal(data, request) + if err != nil { + return nil, err + } + } + return request, nil +} + +func createResponse(function Function, data []byte) (*gosoap.SOAPEnvelope, error) { + response := function.Response() + responseEnvelope := gosoap.NewSOAPEnvelope(response) + err := xml.Unmarshal(data, responseEnvelope) if err != nil { return nil, err } + return responseEnvelope, nil +} +// SendGetSnapshotRequest sends the Get request to retrieve the snapshot from the Onvif camera +// The parameter url is come from the "GetSnapshotURI" command. +func (dev *Device) SendGetSnapshotRequest(url string) (resp *http.Response, err error) { + soap := gosoap.NewEmptySOAP() soap.AddRootNamespaces(Xlmns) - soap.AddAction() + if dev.params.AuthMode == UsernameTokenAuth { + soap.AddWSSecurity(dev.params.Username, dev.params.Password) + var req *http.Request + req, err = createHttpRequest(http.MethodGet, url, soap.String()) + if err != nil { + return nil, err + } + // Basic auth might work for some camera + req.SetBasicAuth(dev.params.Username, dev.params.Password) + resp, err = dev.params.HttpClient.Do(req) - //Auth Handling - if dev.params.Username != "" && dev.params.Password != "" { + } else if dev.params.AuthMode == DigestAuth || dev.params.AuthMode == Both { soap.AddWSSecurity(dev.params.Username, dev.params.Password) - } + resp, err = dev.digestClient.Do(http.MethodGet, url, soap.String()) - return networking.SendSoap(dev.params.HttpClient, endpoint, soap.String()) + } else { + var req *http.Request + req, err = createHttpRequest(http.MethodGet, url, soap.String()) + if err != nil { + return nil, err + } + resp, err = dev.params.HttpClient.Do(req) + } + return resp, err } diff --git a/Device_test.go b/Device_test.go new file mode 100644 index 00000000..f8bfe043 --- /dev/null +++ b/Device_test.go @@ -0,0 +1,24 @@ +package onvif + +import ( + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestDevice_SetDeviceInfoFromScopes(t *testing.T) { + const ( + name = "DeviceName" + hardware = "M9000" + ) + scopes := []string{ + "onvif://www.onvif.org/Profile/Streaming", + "onvif://www.onvif.org/SomethingElse/value", + "onvif://www.onvif.org/name/" + name, + "onvif://www.onvif.org/hardware/" + hardware, + } + device := Device{} + device.SetDeviceInfoFromScopes(scopes) + assert.Equal(t, device.info.Name, name) + assert.Equal(t, device.info.Model, hardware) +} diff --git a/Imaging/types.go b/Imaging/types.go index cf0779a2..adcd532a 100644 --- a/Imaging/types.go +++ b/Imaging/types.go @@ -1,5 +1,7 @@ package imaging +//go:generate python3 ../python/gen_commands.py + import ( "github.com/kerberos-io/onvif/xsd" "github.com/kerberos-io/onvif/xsd/onvif" @@ -9,11 +11,19 @@ type GetServiceCapabilities struct { XMLName string `xml:"timg:GetServiceCapabilities"` } +// todo: fill in response type +type GetServiceCapabilitiesResponse struct { +} + type GetImagingSettings struct { XMLName string `xml:"timg:GetImagingSettings"` VideoSourceToken onvif.ReferenceToken `xml:"timg:VideoSourceToken"` } +type GetImagingSettingsResponse struct { + ImagingSettings onvif.ImagingSettings20 `xml:"timg:ImagingSettings"` +} + type SetImagingSettings struct { XMLName string `xml:"timg:SetImagingSettings"` VideoSourceToken onvif.ReferenceToken `xml:"timg:VideoSourceToken"` @@ -21,44 +31,78 @@ type SetImagingSettings struct { ForcePersistence xsd.Boolean `xml:"timg:ForcePersistence"` } +type SetImagingSettingsResponse struct { +} + type GetOptions struct { XMLName string `xml:"timg:GetOptions"` VideoSourceToken onvif.ReferenceToken `xml:"timg:VideoSourceToken"` } +// todo: fill in response type +type GetOptionsResponse struct { +} + type Move struct { XMLName string `xml:"timg:Move"` VideoSourceToken onvif.ReferenceToken `xml:"timg:VideoSourceToken"` Focus onvif.FocusMove `xml:"timg:Focus"` } +// todo: fill in response type +type MoveResponse struct { +} + type GetMoveOptions struct { XMLName string `xml:"timg:GetMoveOptions"` VideoSourceToken onvif.ReferenceToken `xml:"timg:VideoSourceToken"` } +// todo: fill in response type +type GetMoveOptionsResponse struct { +} + type Stop struct { XMLName string `xml:"timg:Stop"` VideoSourceToken onvif.ReferenceToken `xml:"timg:VideoSourceToken"` } +// todo: fill in response type +type StopResponse struct { +} + type GetStatus struct { XMLName string `xml:"timg:GetStatus"` VideoSourceToken onvif.ReferenceToken `xml:"timg:VideoSourceToken"` } +// todo: fill in response type +type GetStatusResponse struct { +} + type GetPresets struct { XMLName string `xml:"timg:GetPresets"` VideoSourceToken onvif.ReferenceToken `xml:"timg:VideoSourceToken"` } +// todo: fill in response type +type GetPresetsResponse struct { +} + type GetCurrentPreset struct { XMLName string `xml:"timg:GetCurrentPreset"` VideoSourceToken onvif.ReferenceToken `xml:"timg:VideoSourceToken"` } +// todo: fill in response type +type GetCurrentPresetResponse struct { +} + type SetCurrentPreset struct { XMLName string `xml:"timg:SetCurrentPreset"` VideoSourceToken onvif.ReferenceToken `xml:"timg:VideoSourceToken"` PresetToken onvif.ReferenceToken `xml:"timg:PresetToken"` } + +type SetCurrentPresetResponse struct { +} diff --git a/README.md b/README.md index 232487e3..be444f5e 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,10 @@ -# ONVIF protocol +# Onvif library -Simple management of onvif IP-devices cameras. onvif is an implementation of ONVIF protocol for managing onvif IP devices. The purpose of this library is convenient and easy management of IP cameras and other devices that support ONVIF standard. +Simple management of onvif IP-devices cameras. onvif is an implementation of ONVIF protocol for managing onvif IP devices. The purpose of this library is convenient and easy management of IP cameras and other devices that support ONVIF standard. -## Installation +## Overview -To install the library, use **go get**: - -```go -go get github.com/kerberos-io/onvif - -``` +This repository is forked from: [use-go/onvif](https://github.com/use-go/onvif) ## Supported services @@ -18,30 +13,27 @@ The following services are implemented: - Device - Media - PTZ -- Imaging - Event - Discovery -- Auth(More Options) -- Soap ## Using ### General concept -1. Connecting to the device -2. Authentication (if necessary) -3. Defining Data Types -4. Carrying out the required method +1) Connecting to the device +2) Authentication (if necessary) +3) Defining Data Types +4) Carrying out the required method #### Connecting to the device -If there is a device on the network at the address _192.168.13.42_, and its ONVIF services use the _1234_ port, then you can connect to the device in the following way: +If there is a device on the network at the address *192.168.13.42*, and its ONVIF services use the *1234* port, then you can connect to the device in the following way: ```go dev, err := onvif.NewDevice(onvif.DeviceParams{Xaddr: "192.168.13.42:1234"}) ``` -\*The ONVIF port may differ depending on the device , to find out which port to use, you can go to the web interface of the device. **Usually this is 80 port.\*** +*The ONVIF port may differ depending on the device , to find out which port to use, you can go to the web interface of the device. **Usually this is 80 port.*** #### Authentication @@ -75,7 +67,7 @@ The figure below shows that `GetServiceCapabilities` does not accept any argumen ![PTZ GetServiceCapabilities](docs/img/GetServiceCapabilities.png) -_Common data types are in the xsd/onvif package. The types of data (structures) that can be shared by all services are defined in the onvif package._ +*Common data types are in the xsd/onvif package. The types of data (structures) that can be shared by all services are defined in the onvif package.* An example of how to define the data type of the CreateUsers function in [Devicemgmt](https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl): @@ -98,6 +90,5 @@ device.Authenticate("username", "password") resp, err := dev.CallMethod(createUsers) ``` -## Great Thanks - -Enhanced and Improved from: [goonvif](https://github.com/yakovlevdmv/goonvif) +## Development +See [here](docs/Development.md) diff --git a/analytics/common.go b/analytics/common.go new file mode 100644 index 00000000..458ecb19 --- /dev/null +++ b/analytics/common.go @@ -0,0 +1,47 @@ +package analytics + +import "github.com/kerberos-io/onvif/xsd" + +type Parameters struct { + SimpleItemDescription []SimpleItemDescription `json:",omitempty"` + ElementItemDescription []ElementItemDescription `json:",omitempty"` + Extension *xsd.String `json:",omitempty"` +} + +type SimpleItemDescription struct { + Name string `json:",omitempty" xml:",attr"` + Type string `json:",omitempty" xml:",attr"` + Value string `json:",omitempty" xml:",attr"` +} + +type ElementItemDescription struct { + Name string `json:",omitempty" xml:",attr"` + Value string `json:",omitempty" xml:",attr"` +} + +type Messages struct { + IsProperty *xsd.Boolean `json:",omitempty" xml:",attr"` + Source *Source `json:",omitempty"` + Key *Key `json:",omitempty"` + Data *Data `json:",omitempty"` + Extension *xsd.String `json:",omitempty"` + ParentTopic *xsd.String `json:",omitempty"` +} + +type Source struct { + SimpleItemDescription []SimpleItemDescription `json:",omitempty"` + ElementItemDescription []ElementItemDescription `json:",omitempty"` + Extension *xsd.String `json:",omitempty"` +} + +type Key struct { + SimpleItemDescription []SimpleItemDescription `json:",omitempty"` + ElementItemDescription []ElementItemDescription `json:",omitempty"` + Extension *xsd.String `json:",omitempty"` +} + +type Data struct { + SimpleItemDescription []SimpleItemDescription `json:",omitempty"` + ElementItemDescription []ElementItemDescription `json:",omitempty"` + Extension *xsd.String `json:",omitempty"` +} diff --git a/analytics/function.go b/analytics/function.go new file mode 100644 index 00000000..23ca063a --- /dev/null +++ b/analytics/function.go @@ -0,0 +1,117 @@ +// -*- Mode: Go; indent-tabs-mode: t -*- +// +// Copyright (C) 2022 Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by gen_commands.py DO NOT EDIT. + +package analytics + +type CreateAnalyticsModulesFunction struct{} + +func (_ *CreateAnalyticsModulesFunction) Request() interface{} { + return &CreateAnalyticsModules{} +} +func (_ *CreateAnalyticsModulesFunction) Response() interface{} { + return &CreateAnalyticsModulesResponse{} +} + +type CreateRulesFunction struct{} + +func (_ *CreateRulesFunction) Request() interface{} { + return &CreateRules{} +} +func (_ *CreateRulesFunction) Response() interface{} { + return &CreateRulesResponse{} +} + +type DeleteAnalyticsModulesFunction struct{} + +func (_ *DeleteAnalyticsModulesFunction) Request() interface{} { + return &DeleteAnalyticsModules{} +} +func (_ *DeleteAnalyticsModulesFunction) Response() interface{} { + return &DeleteAnalyticsModulesResponse{} +} + +type DeleteRulesFunction struct{} + +func (_ *DeleteRulesFunction) Request() interface{} { + return &DeleteRules{} +} +func (_ *DeleteRulesFunction) Response() interface{} { + return &DeleteRulesResponse{} +} + +type GetAnalyticsModuleOptionsFunction struct{} + +func (_ *GetAnalyticsModuleOptionsFunction) Request() interface{} { + return &GetAnalyticsModuleOptions{} +} +func (_ *GetAnalyticsModuleOptionsFunction) Response() interface{} { + return &GetAnalyticsModuleOptionsResponse{} +} + +type GetAnalyticsModulesFunction struct{} + +func (_ *GetAnalyticsModulesFunction) Request() interface{} { + return &GetAnalyticsModules{} +} +func (_ *GetAnalyticsModulesFunction) Response() interface{} { + return &GetAnalyticsModulesResponse{} +} + +type GetRuleOptionsFunction struct{} + +func (_ *GetRuleOptionsFunction) Request() interface{} { + return &GetRuleOptions{} +} +func (_ *GetRuleOptionsFunction) Response() interface{} { + return &GetRuleOptionsResponse{} +} + +type GetRulesFunction struct{} + +func (_ *GetRulesFunction) Request() interface{} { + return &GetRules{} +} +func (_ *GetRulesFunction) Response() interface{} { + return &GetRulesResponse{} +} + +type GetSupportedAnalyticsModulesFunction struct{} + +func (_ *GetSupportedAnalyticsModulesFunction) Request() interface{} { + return &GetSupportedAnalyticsModules{} +} +func (_ *GetSupportedAnalyticsModulesFunction) Response() interface{} { + return &GetSupportedAnalyticsModulesResponse{} +} + +type GetSupportedRulesFunction struct{} + +func (_ *GetSupportedRulesFunction) Request() interface{} { + return &GetSupportedRules{} +} +func (_ *GetSupportedRulesFunction) Response() interface{} { + return &GetSupportedRulesResponse{} +} + +type ModifyAnalyticsModulesFunction struct{} + +func (_ *ModifyAnalyticsModulesFunction) Request() interface{} { + return &ModifyAnalyticsModules{} +} +func (_ *ModifyAnalyticsModulesFunction) Response() interface{} { + return &ModifyAnalyticsModulesResponse{} +} + +type ModifyRulesFunction struct{} + +func (_ *ModifyRulesFunction) Request() interface{} { + return &ModifyRules{} +} +func (_ *ModifyRulesFunction) Response() interface{} { + return &ModifyRulesResponse{} +} diff --git a/analytics/types.go b/analytics/types.go index 2b9baf60..d915b4ed 100644 --- a/analytics/types.go +++ b/analytics/types.go @@ -1,78 +1,217 @@ package analytics +//go:generate python3 ../python/gen_commands.py + import ( "github.com/kerberos-io/onvif/xsd" "github.com/kerberos-io/onvif/xsd/onvif" ) -type GetSupportedRules struct { - XMLName string `xml:"tan:GetSupportedRules"` +// GetSupportedAnalyticsModules and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver20/analytics/wsdl/analytics.wsdl#op.GetSupportedAnalyticsModules +type GetSupportedAnalyticsModules struct { + XMLName string `xml:"tan:GetSupportedAnalyticsModules"` ConfigurationToken onvif.ReferenceToken `xml:"tan:ConfigurationToken"` } -type CreateRules struct { - XMLName string `xml:"tan:CreateRules"` +type GetSupportedAnalyticsModulesResponse struct { + SupportedAnalyticsModules SupportedAnalyticsModules +} + +type SupportedAnalyticsModules struct { + Limit *xsd.Int `json:",omitempty"` + AnalyticsModuleContentSchemaLocation *xsd.String `json:",omitempty"` + AnalyticsModuleDescription []AnalyticsModuleDescription `json:",omitempty"` +} + +type AnalyticsModuleDescription struct { + Name string `xml:"Name,attr"` + Fixed bool `xml:"fixed,attr"` + MaxInstances int `xml:"maxInstances,attr"` + Parameters *Parameters `json:",omitempty"` + Messages *Messages `json:",omitempty"` +} + +// CreateAnalyticsModules and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver20/analytics/wsdl/analytics.wsdl#op.CreateAnalyticsModules +type CreateAnalyticsModules struct { + XMLName string `xml:"tev:CreateAnalyticsModules"` + ConfigurationToken onvif.ReferenceToken `xml:"tan:ConfigurationToken"` + AnalyticsModule []onvif.ConfigRequest `xml:"tan:AnalyticsModule"` +} + +type CreateAnalyticsModulesResponse struct{} + +// DeleteAnalyticsModules and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver20/analytics/wsdl/analytics.wsdl#op.DeleteAnalyticsModules +type DeleteAnalyticsModules struct { + XMLName string `xml:"tan:DeleteAnalyticsModules"` + ConfigurationToken onvif.ReferenceToken `xml:"tan:ConfigurationToken"` + AnalyticsModuleName []xsd.String `xml:"tan:AnalyticsModuleName"` +} + +type DeleteAnalyticsModulesResponse struct{} + +// GetAnalyticsModules and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver20/analytics/wsdl/analytics.wsdl#op.GetAnalyticsModules +type GetAnalyticsModules struct { + XMLName string `xml:"tan:GetAnalyticsModules"` ConfigurationToken onvif.ReferenceToken `xml:"tan:ConfigurationToken"` - Rule onvif.Config `xml:"tan:Rule"` } -type DeleteRules struct { - XMLName string `xml:"tan:DeleteRules"` +type GetAnalyticsModulesResponse struct { + AnalyticsModule []onvif.Config +} + +// GetAnalyticsModuleOptions and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver20/analytics/wsdl/analytics.wsdl#op.GetAnalyticsModuleOptions +type GetAnalyticsModuleOptions struct { + XMLName string `xml:"tan:GetAnalyticsModuleOptions"` + Type xsd.QName `xml:"tan:Type,omitempty"` + ConfigurationToken onvif.ReferenceToken `xml:"tan:ConfigurationToken"` +} + +type GetAnalyticsModuleOptionsResponse struct { + Options []AnalyticsModuleOptions +} + +type AnalyticsModuleOptions struct { + RuleType string `json:",omitempty" xml:",attr"` + Name string `json:",omitempty" xml:",attr"` + Type string `json:",omitempty" xml:",attr"` + AnalyticsModule string `json:",omitempty" xml:",attr"` + IntRange *IntRange `json:",omitempty"` + StringItems *StringItems `json:",omitempty"` +} + +type IntRange struct { + Min int + Max int +} + +type StringItems struct { + Item []string +} + +// ModifyAnalyticsModules and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver20/analytics/wsdl/analytics.wsdl#op.ModifyAnalyticsModules +type ModifyAnalyticsModules struct { + XMLName string `xml:"tan:ModifyAnalyticsModules"` + ConfigurationToken onvif.ReferenceToken `xml:"tan:ConfigurationToken"` + AnalyticsModule []onvif.ConfigRequest `xml:"tan:AnalyticsModule"` +} + +type ModifyAnalyticsModulesResponse struct{} + +// GetSupportedRules and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver20/analytics/wsdl/analytics.wsdl#op.GetSupportedRules +type GetSupportedRules struct { + XMLName string `xml:"tan:GetSupportedRules"` ConfigurationToken onvif.ReferenceToken `xml:"tan:ConfigurationToken"` - RuleName xsd.String `xml:"tan:RuleName"` } +type GetSupportedRulesResponse struct { + SupportedRules SupportedRules +} + +type SupportedRules struct { + Limit *xsd.Int `json:",omitempty"` + RuleContentSchemaLocation *xsd.String `json:",omitempty"` + RuleDescription []RuleDescription +} + +type RuleDescription struct { + Name *xsd.String `json:",omitempty" xml:",attr"` + Fixed *xsd.Boolean `json:",omitempty" xml:"fixed,attr"` + MaxInstances *xsd.Int `json:",omitempty" xml:"maxInstances,attr"` + Parameters Parameters + Messages Messages `json:",omitempty"` +} + +// GetRules and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver20/analytics/wsdl/analytics.wsdl#op.GetRules type GetRules struct { XMLName string `xml:"tan:GetRules"` ConfigurationToken onvif.ReferenceToken `xml:"tan:ConfigurationToken"` } +type GetRulesResponse struct { + Rule []onvif.Config +} + +// CreateRules and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver20/analytics/wsdl/analytics.wsdl#op.CreateRules +type CreateRules struct { + XMLName string `xml:"tan:CreateRules"` + ConfigurationToken onvif.ReferenceToken `xml:"tan:ConfigurationToken"` + Rule []onvif.ConfigRequest `xml:"tan:Rule"` +} + +type ItemListExtension xsd.AnyType + +type CreateRulesResponse struct{} + +// DeleteRules and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver20/analytics/wsdl/analytics.wsdl#op.DeleteRules +type DeleteRules struct { + XMLName string `xml:"tan:DeleteRules"` + ConfigurationToken onvif.ReferenceToken `xml:"tan:ConfigurationToken"` + RuleName []xsd.String `xml:"tan:RuleName"` +} + +type DeleteRulesResponse struct{} + +// GetRuleOptions and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver20/analytics/wsdl/analytics.wsdl#op.GetRuleOptions type GetRuleOptions struct { XMLName string `xml:"tan:GetRuleOptions"` RuleType xsd.QName `xml:"tan:RuleType"` ConfigurationToken onvif.ReferenceToken `xml:"tan:ConfigurationToken"` } -type ModifyRules struct { - XMLName string `xml:"tan:ModifyRules"` - ConfigurationToken onvif.ReferenceToken `xml:"tan:ConfigurationToken"` - Rule onvif.Config `xml:"tan:Rule"` +type GetRuleOptionsResponse struct { + RuleOptions []RuleOptions } -type GetServiceCapabilities struct { - XMLName string `xml:"tan:GetServiceCapabilities"` +type RuleOptions struct { + RuleType *xsd.String `json:",omitempty"` + Name *xsd.String `json:",omitempty" xml:",attr"` + Type *xsd.String `json:",omitempty" xml:",attr"` + MinOccurs *xsd.String `json:",omitempty" xml:"minOccurs,attr"` + MaxOccurs *xsd.String `json:",omitempty" xml:"maxOccurs,attr"` + AnalyticsModule *xsd.String `json:",omitempty"` + IntRange *IntRange `json:",omitempty"` + StringItems *StringItems `json:",omitempty"` + PolygonOptions *PolygonOptions `json:",omitempty"` + MotionRegionConfigOptions *MotionRegionConfigOptions `json:",omitempty"` + StringList *xsd.String `json:",omitempty"` } -type GetSupportedAnalyticsModules struct { - XMLName string `xml:"tan:GetSupportedAnalyticsModules"` - ConfigurationToken onvif.ReferenceToken `xml:"tan:ConfigurationToken"` +type PolygonOptions struct { + VertexLimits VertexLimits } -type GetAnalyticsModuleOptions struct { - XMLName string `xml:"tan:GetAnalyticsModuleOptions"` - Type xsd.QName `xml:"tan:Type"` - ConfigurationToken onvif.ReferenceToken `xml:"tan:ConfigurationToken"` +type VertexLimits struct { + Min int + Max int } -type CreateAnalyticsModules struct { - XMLName string `xml:"tev:CreateAnalyticsModules"` - ConfigurationToken onvif.ReferenceToken `xml:"tan:ConfigurationToken"` - AnalyticsModule onvif.Config `xml:"tan:AnalyticsModule"` +type MotionRegionConfigOptions struct { + DisarmSupport bool + PolygonSupport bool + PolygonLimits VertexLimits } -type DeleteAnalyticsModules struct { - XMLName string `xml:"tan:DeleteAnalyticsModules"` - ConfigurationToken onvif.ReferenceToken `xml:"tan:ConfigurationToken"` - AnalyticsModuleName xsd.String `xml:"tan:AnalyticsModuleName"` +// ModifyRules and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver20/analytics/wsdl/analytics.wsdl#op.ModifyRules +type ModifyRules struct { + XMLName string `xml:"tan:ModifyRules"` + ConfigurationToken onvif.ReferenceToken `xml:"tan:ConfigurationToken"` + Rule []onvif.ConfigRequest `xml:"tan:Rule"` } -type GetAnalyticsModules struct { - XMLName string `xml:"tan:GetAnalyticsModules"` - ConfigurationToken onvif.ReferenceToken `xml:"tan:ConfigurationToken"` -} +type ModifyRulesResponse struct{} -type ModifyAnalyticsModules struct { - XMLName string `xml:"tan:ModifyAnalyticsModules"` - ConfigurationToken onvif.ReferenceToken `xml:"tan:ConfigurationToken"` - AnalyticsModule onvif.Config `xml:"tan:AnalyticsModule"` +type GetServiceCapabilities struct { + XMLName string `xml:"tan:GetServiceCapabilities"` } diff --git a/api/api.go b/api/api.go index af591265..ca0ac120 100644 --- a/api/api.go +++ b/api/api.go @@ -1,17 +1,14 @@ 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" @@ -21,18 +18,6 @@ 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() @@ -47,7 +32,7 @@ func RunApi() { xaddr := c.GetHeader("xaddr") acceptedData, err := c.GetRawData() if err != nil { - Logger.Debug().Err(err).Msg("Failed to get rawx data") + fmt.Println(err) } message, err := callNecessaryMethod(serviceName, methodName, string(acceptedData), username, pass, xaddr) @@ -64,45 +49,46 @@ func RunApi() { interfaceName := context.GetHeader("interface") - 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 := "[" + var response = "[" + // TODO: Handle this error. + devices, _ := wsdiscovery.SendProbe(interfaceName, nil, []string{"dn:NetworkVideoTransmitter"}, map[string]string{"dn": "http://www.onvif.org/ver10/network/wsdl"}) - 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 - break - } - response += "{" - response += `"url":"` + xaddr + `",` - } - if flag { + for _, xaddr := range endpoints { + xaddr := strings.Split(strings.Split(xaddr.Text(), " ")[0], "/")[2] + if strings.Contains(response, xaddr) { + flag = true 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 += "{" + response += `"url":"` + xaddr + `",` + } + 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 += "]" + + } + response = strings.TrimRight(response, ",") + response += "]" + if response != "" { context.String(http.StatusOK, response) } }) @@ -110,6 +96,25 @@ 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 @@ -125,17 +130,17 @@ func callNecessaryMethod(serviceName, methodName, acceptedData, username, passwo return "", errors.New("there is no such service") } if err != nil { //done - return "", errors.Annotate(err, "getStructByName") + return "", err } resp, err := xmlAnalize(methodStruct, &acceptedData) if err != nil { - return "", errors.Annotate(err, "xmlAnalize") + return "", err } endpoint, err := getEndpoint(serviceName, xaddr) if err != nil { - return "", errors.Annotate(err, "getEndpoint") + return "", err } soap := gosoap.NewEmptySOAP() @@ -145,23 +150,21 @@ func callNecessaryMethod(serviceName, methodName, acceptedData, username, passwo servResp, err := networking.SendSoap(new(http.Client), endpoint, soap.String()) if err != nil { - return "", errors.Annotate(err, "SendSoap") + return "", err } rsp, err := ioutil.ReadAll(servResp.Body) if err != nil { - return "", errors.Annotate(err, "ReadAll") + return "", err } - 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 "", errors.Annotate(err, "NewDevice") + return "", err } pkg := strings.ToLower(service) @@ -191,7 +194,7 @@ func xmlAnalize(methodStruct interface{}, acceptedData *string) (*string, error) doc := etree.NewDocument() if err := doc.ReadFromString(*acceptedData); err != nil { - return nil, errors.Annotate(err, "readFromString") + return nil, err } etr := doc.FindElements("./*") xmlUnmarshal(etr, &testunMarshal, &mas) @@ -205,7 +208,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, errors.Annotate(err, "xmlMarker") + return nil, err } if mas[lstIndex] == "Push" && lstIndex == 0 { //done @@ -249,10 +252,10 @@ func xmlAnalize(methodStruct interface{}, acceptedData *string) (*string, error) resp, err := document.WriteToString() if err != nil { - return nil, errors.Annotate(err, "writeToString") + return nil, err } - return &resp, nil + return &resp, err } func xmlMaker(lst *[]interface{}, tags *[]map[string]string, lstIndex int) (string, map[string]string, string, error) { @@ -271,13 +274,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, "", errors.Annotate(err, "xmlProcessing") + return "", nil, "", err } elemName = res } else if index == 0 { res, err := xmlProcessing(tg[conversion]) if err != nil { - return "", nil, "", errors.Annotate(err, "xmlProcessing") + return "", nil, "", err } elemName = res } else { @@ -312,6 +315,8 @@ 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 { @@ -339,9 +344,9 @@ func soapHandling(tp interface{}, tags *[]map[string]string) { } for i := 0; i < s.NumField(); i++ { f := s.Field(i) - tmp, ok := typeOfT.FieldByName(typeOfT.Field(i).Name) - if !ok { - Logger.Debug().Str("field", typeOfT.Field(i).Name).Msg("reflection failed") + tmp, err := typeOfT.FieldByName(typeOfT.Field(i).Name) + if err == false { + fmt.Println(err) } *tags = append(*tags, map[string]string{typeOfT.Field(i).Name: string(tmp.Tag)}) subStruct := reflect.New(reflect.TypeOf(f.Interface())) diff --git a/cmd/camera-example/main.go b/cmd/camera-example/main.go new file mode 100644 index 00000000..c3eea63e --- /dev/null +++ b/cmd/camera-example/main.go @@ -0,0 +1,132 @@ +package main + +import ( + "encoding/json" + "encoding/xml" + "fmt" + "io/ioutil" + "net/http" + + "github.com/kerberos-io/onvif" + "github.com/kerberos-io/onvif/gosoap" + "github.com/kerberos-io/onvif/networking" + + "github.com/gin-gonic/gin" +) + +func main() { + RunApi() +} + +func RunApi() { + router := gin.Default() + + router.POST("/:service/:function", func(c *gin.Context) { + c.Header("Access-Control-Allow-Origin", "*") + //c.Header("Access-Control-Allow-Headers", "access-control-allow-origin, access-control-allow-headers") + + serviceName := c.Param("service") + functionName := c.Param("function") + username := c.GetHeader("username") + pass := c.GetHeader("password") + xaddr := c.GetHeader("xaddr") + acceptedData, err := c.GetRawData() + if err != nil { + fmt.Println(err) + } + dev, err := onvif.NewDevice(onvif.DeviceParams{ + Xaddr: xaddr, + Username: username, + Password: pass, + }) + message, err := CallOnvifFunction(dev, serviceName, functionName, string(acceptedData)) + if err != nil { + c.XML(http.StatusBadRequest, err.Error()) + } else { + c.String(http.StatusOK, message) + } + }) + + router.Run() +} + +func CallOnvifFunction(dev *onvif.Device, serviceName, functionName, acceptedData string) (string, error) { + function, err := functionByServiceAndFunctionName(serviceName, functionName) + if err != nil { + return "", err + } + request := function.Request() + + if len(acceptedData) > 0 { + err = json.Unmarshal([]byte(acceptedData), request) + if err != nil { + return "", err + } + } + + requestBody, err := xml.Marshal(request) + if err != nil { + return "", err + } + + endpoint, err := dev.GetEndpointByRequestStruct(request) + if err != nil { + return "", err + } + + soap := gosoap.NewEmptySOAP() + soap.AddStringBodyContent(string(requestBody)) + soap.AddRootNamespaces(onvif.Xlmns) + soap.AddWSSecurity(dev.GetDeviceParams().Username, dev.GetDeviceParams().Password) + + servResp, err := networking.SendSoap(new(http.Client), endpoint, soap.String()) + if err != nil { + return "", err + } + + rsp, err := ioutil.ReadAll(servResp.Body) + if err != nil { + return "", err + } + + responseEnvelope := gosoap.NewSOAPEnvelope(function.Response()) + err = xml.Unmarshal(rsp, responseEnvelope) + if err != nil { + return "", err + } + + if responseEnvelope.Body.Fault != nil { + jsonData, err := json.Marshal(responseEnvelope.Body.Fault) + if err != nil { + return "", err + } + return string(jsonData), nil + } else { + jsonData, err := json.Marshal(responseEnvelope.Body.Content) + if err != nil { + return "", err + } + return string(jsonData), nil + } + +} + +func functionByServiceAndFunctionName(serviceName, functionName string) (onvif.Function, error) { + var function onvif.Function + var exist bool + switch serviceName { + case onvif.DeviceWebService: + function, exist = onvif.DeviceFunctionMap[functionName] + if !exist { + return nil, fmt.Errorf("the web service '%s'not support the function '%s'", serviceName, functionName) + } + case onvif.MediaWebService: + function, exist = onvif.MediaFunctionMap[functionName] + if !exist { + return nil, fmt.Errorf("the web service '%s' not support the function '%s'", serviceName, functionName) + } + default: + return nil, fmt.Errorf("not support the web service '%s'", serviceName) + } + return function, nil +} diff --git a/constant.go b/constant.go new file mode 100644 index 00000000..a638cd29 --- /dev/null +++ b/constant.go @@ -0,0 +1,9 @@ +package onvif + +// Onvif Auth Mode +const ( + DigestAuth = "digest" + UsernameTokenAuth = "usernametoken" + Both = "both" + NoAuth = "none" +) diff --git a/device/function.go b/device/function.go new file mode 100644 index 00000000..d018c689 --- /dev/null +++ b/device/function.go @@ -0,0 +1,819 @@ +// -*- Mode: Go; indent-tabs-mode: t -*- +// +// Copyright (C) 2022 Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by gen_commands.py DO NOT EDIT. + +package device + +type AddIPAddressFilterFunction struct{} + +func (_ *AddIPAddressFilterFunction) Request() interface{} { + return &AddIPAddressFilter{} +} +func (_ *AddIPAddressFilterFunction) Response() interface{} { + return &AddIPAddressFilterResponse{} +} + +type AddScopesFunction struct{} + +func (_ *AddScopesFunction) Request() interface{} { + return &AddScopes{} +} +func (_ *AddScopesFunction) Response() interface{} { + return &AddScopesResponse{} +} + +type CreateCertificateFunction struct{} + +func (_ *CreateCertificateFunction) Request() interface{} { + return &CreateCertificate{} +} +func (_ *CreateCertificateFunction) Response() interface{} { + return &CreateCertificateResponse{} +} + +type CreateDot1XConfigurationFunction struct{} + +func (_ *CreateDot1XConfigurationFunction) Request() interface{} { + return &CreateDot1XConfiguration{} +} +func (_ *CreateDot1XConfigurationFunction) Response() interface{} { + return &CreateDot1XConfigurationResponse{} +} + +type CreateStorageConfigurationFunction struct{} + +func (_ *CreateStorageConfigurationFunction) Request() interface{} { + return &CreateStorageConfiguration{} +} +func (_ *CreateStorageConfigurationFunction) Response() interface{} { + return &CreateStorageConfigurationResponse{} +} + +type CreateUsersFunction struct{} + +func (_ *CreateUsersFunction) Request() interface{} { + return &CreateUsers{} +} +func (_ *CreateUsersFunction) Response() interface{} { + return &CreateUsersResponse{} +} + +type DeleteCertificatesFunction struct{} + +func (_ *DeleteCertificatesFunction) Request() interface{} { + return &DeleteCertificates{} +} +func (_ *DeleteCertificatesFunction) Response() interface{} { + return &DeleteCertificatesResponse{} +} + +type DeleteDot1XConfigurationFunction struct{} + +func (_ *DeleteDot1XConfigurationFunction) Request() interface{} { + return &DeleteDot1XConfiguration{} +} +func (_ *DeleteDot1XConfigurationFunction) Response() interface{} { + return &DeleteDot1XConfigurationResponse{} +} + +type DeleteGeoLocationFunction struct{} + +func (_ *DeleteGeoLocationFunction) Request() interface{} { + return &DeleteGeoLocation{} +} +func (_ *DeleteGeoLocationFunction) Response() interface{} { + return &DeleteGeoLocationResponse{} +} + +type DeleteStorageConfigurationFunction struct{} + +func (_ *DeleteStorageConfigurationFunction) Request() interface{} { + return &DeleteStorageConfiguration{} +} +func (_ *DeleteStorageConfigurationFunction) Response() interface{} { + return &DeleteStorageConfigurationResponse{} +} + +type DeleteUsersFunction struct{} + +func (_ *DeleteUsersFunction) Request() interface{} { + return &DeleteUsers{} +} +func (_ *DeleteUsersFunction) Response() interface{} { + return &DeleteUsersResponse{} +} + +type GetAccessPolicyFunction struct{} + +func (_ *GetAccessPolicyFunction) Request() interface{} { + return &GetAccessPolicy{} +} +func (_ *GetAccessPolicyFunction) Response() interface{} { + return &GetAccessPolicyResponse{} +} + +type GetCACertificatesFunction struct{} + +func (_ *GetCACertificatesFunction) Request() interface{} { + return &GetCACertificates{} +} +func (_ *GetCACertificatesFunction) Response() interface{} { + return &GetCACertificatesResponse{} +} + +type GetCapabilitiesFunction struct{} + +func (_ *GetCapabilitiesFunction) Request() interface{} { + return &GetCapabilities{} +} +func (_ *GetCapabilitiesFunction) Response() interface{} { + return &GetCapabilitiesResponse{} +} + +type GetCertificateInformationFunction struct{} + +func (_ *GetCertificateInformationFunction) Request() interface{} { + return &GetCertificateInformation{} +} +func (_ *GetCertificateInformationFunction) Response() interface{} { + return &GetCertificateInformationResponse{} +} + +type GetCertificatesFunction struct{} + +func (_ *GetCertificatesFunction) Request() interface{} { + return &GetCertificates{} +} +func (_ *GetCertificatesFunction) Response() interface{} { + return &GetCertificatesResponse{} +} + +type GetCertificatesStatusFunction struct{} + +func (_ *GetCertificatesStatusFunction) Request() interface{} { + return &GetCertificatesStatus{} +} +func (_ *GetCertificatesStatusFunction) Response() interface{} { + return &GetCertificatesStatusResponse{} +} + +type GetClientCertificateModeFunction struct{} + +func (_ *GetClientCertificateModeFunction) Request() interface{} { + return &GetClientCertificateMode{} +} +func (_ *GetClientCertificateModeFunction) Response() interface{} { + return &GetClientCertificateModeResponse{} +} + +type GetDNSFunction struct{} + +func (_ *GetDNSFunction) Request() interface{} { + return &GetDNS{} +} +func (_ *GetDNSFunction) Response() interface{} { + return &GetDNSResponse{} +} + +type GetDPAddressesFunction struct{} + +func (_ *GetDPAddressesFunction) Request() interface{} { + return &GetDPAddresses{} +} +func (_ *GetDPAddressesFunction) Response() interface{} { + return &GetDPAddressesResponse{} +} + +type GetDeviceInformationFunction struct{} + +func (_ *GetDeviceInformationFunction) Request() interface{} { + return &GetDeviceInformation{} +} +func (_ *GetDeviceInformationFunction) Response() interface{} { + return &GetDeviceInformationResponse{} +} + +type GetDiscoveryModeFunction struct{} + +func (_ *GetDiscoveryModeFunction) Request() interface{} { + return &GetDiscoveryMode{} +} +func (_ *GetDiscoveryModeFunction) Response() interface{} { + return &GetDiscoveryModeResponse{} +} + +type GetDot11CapabilitiesFunction struct{} + +func (_ *GetDot11CapabilitiesFunction) Request() interface{} { + return &GetDot11Capabilities{} +} +func (_ *GetDot11CapabilitiesFunction) Response() interface{} { + return &GetDot11CapabilitiesResponse{} +} + +type GetDot11StatusFunction struct{} + +func (_ *GetDot11StatusFunction) Request() interface{} { + return &GetDot11Status{} +} +func (_ *GetDot11StatusFunction) Response() interface{} { + return &GetDot11StatusResponse{} +} + +type GetDot1XConfigurationFunction struct{} + +func (_ *GetDot1XConfigurationFunction) Request() interface{} { + return &GetDot1XConfiguration{} +} +func (_ *GetDot1XConfigurationFunction) Response() interface{} { + return &GetDot1XConfigurationResponse{} +} + +type GetDot1XConfigurationsFunction struct{} + +func (_ *GetDot1XConfigurationsFunction) Request() interface{} { + return &GetDot1XConfigurations{} +} +func (_ *GetDot1XConfigurationsFunction) Response() interface{} { + return &GetDot1XConfigurationsResponse{} +} + +type GetDynamicDNSFunction struct{} + +func (_ *GetDynamicDNSFunction) Request() interface{} { + return &GetDynamicDNS{} +} +func (_ *GetDynamicDNSFunction) Response() interface{} { + return &GetDynamicDNSResponse{} +} + +type GetEndpointReferenceFunction struct{} + +func (_ *GetEndpointReferenceFunction) Request() interface{} { + return &GetEndpointReference{} +} +func (_ *GetEndpointReferenceFunction) Response() interface{} { + return &GetEndpointReferenceResponse{} +} + +type GetGeoLocationFunction struct{} + +func (_ *GetGeoLocationFunction) Request() interface{} { + return &GetGeoLocation{} +} +func (_ *GetGeoLocationFunction) Response() interface{} { + return &GetGeoLocationResponse{} +} + +type GetHostnameFunction struct{} + +func (_ *GetHostnameFunction) Request() interface{} { + return &GetHostname{} +} +func (_ *GetHostnameFunction) Response() interface{} { + return &GetHostnameResponse{} +} + +type GetIPAddressFilterFunction struct{} + +func (_ *GetIPAddressFilterFunction) Request() interface{} { + return &GetIPAddressFilter{} +} +func (_ *GetIPAddressFilterFunction) Response() interface{} { + return &GetIPAddressFilterResponse{} +} + +type GetNTPFunction struct{} + +func (_ *GetNTPFunction) Request() interface{} { + return &GetNTP{} +} +func (_ *GetNTPFunction) Response() interface{} { + return &GetNTPResponse{} +} + +type GetNetworkDefaultGatewayFunction struct{} + +func (_ *GetNetworkDefaultGatewayFunction) Request() interface{} { + return &GetNetworkDefaultGateway{} +} +func (_ *GetNetworkDefaultGatewayFunction) Response() interface{} { + return &GetNetworkDefaultGatewayResponse{} +} + +type GetNetworkInterfacesFunction struct{} + +func (_ *GetNetworkInterfacesFunction) Request() interface{} { + return &GetNetworkInterfaces{} +} +func (_ *GetNetworkInterfacesFunction) Response() interface{} { + return &GetNetworkInterfacesResponse{} +} + +type GetNetworkProtocolsFunction struct{} + +func (_ *GetNetworkProtocolsFunction) Request() interface{} { + return &GetNetworkProtocols{} +} +func (_ *GetNetworkProtocolsFunction) Response() interface{} { + return &GetNetworkProtocolsResponse{} +} + +type GetPkcs10RequestFunction struct{} + +func (_ *GetPkcs10RequestFunction) Request() interface{} { + return &GetPkcs10Request{} +} +func (_ *GetPkcs10RequestFunction) Response() interface{} { + return &GetPkcs10RequestResponse{} +} + +type GetRelayOutputsFunction struct{} + +func (_ *GetRelayOutputsFunction) Request() interface{} { + return &GetRelayOutputs{} +} +func (_ *GetRelayOutputsFunction) Response() interface{} { + return &GetRelayOutputsResponse{} +} + +type GetRemoteDiscoveryModeFunction struct{} + +func (_ *GetRemoteDiscoveryModeFunction) Request() interface{} { + return &GetRemoteDiscoveryMode{} +} +func (_ *GetRemoteDiscoveryModeFunction) Response() interface{} { + return &GetRemoteDiscoveryModeResponse{} +} + +type GetRemoteUserFunction struct{} + +func (_ *GetRemoteUserFunction) Request() interface{} { + return &GetRemoteUser{} +} +func (_ *GetRemoteUserFunction) Response() interface{} { + return &GetRemoteUserResponse{} +} + +type GetScopesFunction struct{} + +func (_ *GetScopesFunction) Request() interface{} { + return &GetScopes{} +} +func (_ *GetScopesFunction) Response() interface{} { + return &GetScopesResponse{} +} + +type GetServiceCapabilitiesFunction struct{} + +func (_ *GetServiceCapabilitiesFunction) Request() interface{} { + return &GetServiceCapabilities{} +} +func (_ *GetServiceCapabilitiesFunction) Response() interface{} { + return &GetServiceCapabilitiesResponse{} +} + +type GetServicesFunction struct{} + +func (_ *GetServicesFunction) Request() interface{} { + return &GetServices{} +} +func (_ *GetServicesFunction) Response() interface{} { + return &GetServicesResponse{} +} + +type GetStorageConfigurationFunction struct{} + +func (_ *GetStorageConfigurationFunction) Request() interface{} { + return &GetStorageConfiguration{} +} +func (_ *GetStorageConfigurationFunction) Response() interface{} { + return &GetStorageConfigurationResponse{} +} + +type GetStorageConfigurationsFunction struct{} + +func (_ *GetStorageConfigurationsFunction) Request() interface{} { + return &GetStorageConfigurations{} +} +func (_ *GetStorageConfigurationsFunction) Response() interface{} { + return &GetStorageConfigurationsResponse{} +} + +type GetSystemBackupFunction struct{} + +func (_ *GetSystemBackupFunction) Request() interface{} { + return &GetSystemBackup{} +} +func (_ *GetSystemBackupFunction) Response() interface{} { + return &GetSystemBackupResponse{} +} + +type GetSystemDateAndTimeFunction struct{} + +func (_ *GetSystemDateAndTimeFunction) Request() interface{} { + return &GetSystemDateAndTime{} +} +func (_ *GetSystemDateAndTimeFunction) Response() interface{} { + return &GetSystemDateAndTimeResponse{} +} + +type GetSystemLogFunction struct{} + +func (_ *GetSystemLogFunction) Request() interface{} { + return &GetSystemLog{} +} +func (_ *GetSystemLogFunction) Response() interface{} { + return &GetSystemLogResponse{} +} + +type GetSystemSupportInformationFunction struct{} + +func (_ *GetSystemSupportInformationFunction) Request() interface{} { + return &GetSystemSupportInformation{} +} +func (_ *GetSystemSupportInformationFunction) Response() interface{} { + return &GetSystemSupportInformationResponse{} +} + +type GetSystemUrisFunction struct{} + +func (_ *GetSystemUrisFunction) Request() interface{} { + return &GetSystemUris{} +} +func (_ *GetSystemUrisFunction) Response() interface{} { + return &GetSystemUrisResponse{} +} + +type GetUsersFunction struct{} + +func (_ *GetUsersFunction) Request() interface{} { + return &GetUsers{} +} +func (_ *GetUsersFunction) Response() interface{} { + return &GetUsersResponse{} +} + +type GetWsdlUrlFunction struct{} + +func (_ *GetWsdlUrlFunction) Request() interface{} { + return &GetWsdlUrl{} +} +func (_ *GetWsdlUrlFunction) Response() interface{} { + return &GetWsdlUrlResponse{} +} + +type GetZeroConfigurationFunction struct{} + +func (_ *GetZeroConfigurationFunction) Request() interface{} { + return &GetZeroConfiguration{} +} +func (_ *GetZeroConfigurationFunction) Response() interface{} { + return &GetZeroConfigurationResponse{} +} + +type LoadCACertificatesFunction struct{} + +func (_ *LoadCACertificatesFunction) Request() interface{} { + return &LoadCACertificates{} +} +func (_ *LoadCACertificatesFunction) Response() interface{} { + return &LoadCACertificatesResponse{} +} + +type LoadCertificateWithPrivateKeyFunction struct{} + +func (_ *LoadCertificateWithPrivateKeyFunction) Request() interface{} { + return &LoadCertificateWithPrivateKey{} +} +func (_ *LoadCertificateWithPrivateKeyFunction) Response() interface{} { + return &LoadCertificateWithPrivateKeyResponse{} +} + +type LoadCertificatesFunction struct{} + +func (_ *LoadCertificatesFunction) Request() interface{} { + return &LoadCertificates{} +} +func (_ *LoadCertificatesFunction) Response() interface{} { + return &LoadCertificatesResponse{} +} + +type RemoveIPAddressFilterFunction struct{} + +func (_ *RemoveIPAddressFilterFunction) Request() interface{} { + return &RemoveIPAddressFilter{} +} +func (_ *RemoveIPAddressFilterFunction) Response() interface{} { + return &RemoveIPAddressFilterResponse{} +} + +type RemoveScopesFunction struct{} + +func (_ *RemoveScopesFunction) Request() interface{} { + return &RemoveScopes{} +} +func (_ *RemoveScopesFunction) Response() interface{} { + return &RemoveScopesResponse{} +} + +type RestoreSystemFunction struct{} + +func (_ *RestoreSystemFunction) Request() interface{} { + return &RestoreSystem{} +} +func (_ *RestoreSystemFunction) Response() interface{} { + return &RestoreSystemResponse{} +} + +type ScanAvailableDot11NetworksFunction struct{} + +func (_ *ScanAvailableDot11NetworksFunction) Request() interface{} { + return &ScanAvailableDot11Networks{} +} +func (_ *ScanAvailableDot11NetworksFunction) Response() interface{} { + return &ScanAvailableDot11NetworksResponse{} +} + +type SendAuxiliaryCommandFunction struct{} + +func (_ *SendAuxiliaryCommandFunction) Request() interface{} { + return &SendAuxiliaryCommand{} +} +func (_ *SendAuxiliaryCommandFunction) Response() interface{} { + return &SendAuxiliaryCommandResponse{} +} + +type SetAccessPolicyFunction struct{} + +func (_ *SetAccessPolicyFunction) Request() interface{} { + return &SetAccessPolicy{} +} +func (_ *SetAccessPolicyFunction) Response() interface{} { + return &SetAccessPolicyResponse{} +} + +type SetCertificatesStatusFunction struct{} + +func (_ *SetCertificatesStatusFunction) Request() interface{} { + return &SetCertificatesStatus{} +} +func (_ *SetCertificatesStatusFunction) Response() interface{} { + return &SetCertificatesStatusResponse{} +} + +type SetClientCertificateModeFunction struct{} + +func (_ *SetClientCertificateModeFunction) Request() interface{} { + return &SetClientCertificateMode{} +} +func (_ *SetClientCertificateModeFunction) Response() interface{} { + return &SetClientCertificateModeResponse{} +} + +type SetDNSFunction struct{} + +func (_ *SetDNSFunction) Request() interface{} { + return &SetDNS{} +} +func (_ *SetDNSFunction) Response() interface{} { + return &SetDNSResponse{} +} + +type SetDPAddressesFunction struct{} + +func (_ *SetDPAddressesFunction) Request() interface{} { + return &SetDPAddresses{} +} +func (_ *SetDPAddressesFunction) Response() interface{} { + return &SetDPAddressesResponse{} +} + +type SetDiscoveryModeFunction struct{} + +func (_ *SetDiscoveryModeFunction) Request() interface{} { + return &SetDiscoveryMode{} +} +func (_ *SetDiscoveryModeFunction) Response() interface{} { + return &SetDiscoveryModeResponse{} +} + +type SetDot1XConfigurationFunction struct{} + +func (_ *SetDot1XConfigurationFunction) Request() interface{} { + return &SetDot1XConfiguration{} +} +func (_ *SetDot1XConfigurationFunction) Response() interface{} { + return &SetDot1XConfigurationResponse{} +} + +type SetDynamicDNSFunction struct{} + +func (_ *SetDynamicDNSFunction) Request() interface{} { + return &SetDynamicDNS{} +} +func (_ *SetDynamicDNSFunction) Response() interface{} { + return &SetDynamicDNSResponse{} +} + +type SetGeoLocationFunction struct{} + +func (_ *SetGeoLocationFunction) Request() interface{} { + return &SetGeoLocation{} +} +func (_ *SetGeoLocationFunction) Response() interface{} { + return &SetGeoLocationResponse{} +} + +type SetHostnameFunction struct{} + +func (_ *SetHostnameFunction) Request() interface{} { + return &SetHostname{} +} +func (_ *SetHostnameFunction) Response() interface{} { + return &SetHostnameResponse{} +} + +type SetHostnameFromDHCPFunction struct{} + +func (_ *SetHostnameFromDHCPFunction) Request() interface{} { + return &SetHostnameFromDHCP{} +} +func (_ *SetHostnameFromDHCPFunction) Response() interface{} { + return &SetHostnameFromDHCPResponse{} +} + +type SetIPAddressFilterFunction struct{} + +func (_ *SetIPAddressFilterFunction) Request() interface{} { + return &SetIPAddressFilter{} +} +func (_ *SetIPAddressFilterFunction) Response() interface{} { + return &SetIPAddressFilterResponse{} +} + +type SetNTPFunction struct{} + +func (_ *SetNTPFunction) Request() interface{} { + return &SetNTP{} +} +func (_ *SetNTPFunction) Response() interface{} { + return &SetNTPResponse{} +} + +type SetNetworkDefaultGatewayFunction struct{} + +func (_ *SetNetworkDefaultGatewayFunction) Request() interface{} { + return &SetNetworkDefaultGateway{} +} +func (_ *SetNetworkDefaultGatewayFunction) Response() interface{} { + return &SetNetworkDefaultGatewayResponse{} +} + +type SetNetworkInterfacesFunction struct{} + +func (_ *SetNetworkInterfacesFunction) Request() interface{} { + return &SetNetworkInterfaces{} +} +func (_ *SetNetworkInterfacesFunction) Response() interface{} { + return &SetNetworkInterfacesResponse{} +} + +type SetNetworkProtocolsFunction struct{} + +func (_ *SetNetworkProtocolsFunction) Request() interface{} { + return &SetNetworkProtocols{} +} +func (_ *SetNetworkProtocolsFunction) Response() interface{} { + return &SetNetworkProtocolsResponse{} +} + +type SetRelayOutputSettingsFunction struct{} + +func (_ *SetRelayOutputSettingsFunction) Request() interface{} { + return &SetRelayOutputSettings{} +} +func (_ *SetRelayOutputSettingsFunction) Response() interface{} { + return &SetRelayOutputSettingsResponse{} +} + +type SetRelayOutputStateFunction struct{} + +func (_ *SetRelayOutputStateFunction) Request() interface{} { + return &SetRelayOutputState{} +} +func (_ *SetRelayOutputStateFunction) Response() interface{} { + return &SetRelayOutputStateResponse{} +} + +type SetRemoteDiscoveryModeFunction struct{} + +func (_ *SetRemoteDiscoveryModeFunction) Request() interface{} { + return &SetRemoteDiscoveryMode{} +} +func (_ *SetRemoteDiscoveryModeFunction) Response() interface{} { + return &SetRemoteDiscoveryModeResponse{} +} + +type SetRemoteUserFunction struct{} + +func (_ *SetRemoteUserFunction) Request() interface{} { + return &SetRemoteUser{} +} +func (_ *SetRemoteUserFunction) Response() interface{} { + return &SetRemoteUserResponse{} +} + +type SetScopesFunction struct{} + +func (_ *SetScopesFunction) Request() interface{} { + return &SetScopes{} +} +func (_ *SetScopesFunction) Response() interface{} { + return &SetScopesResponse{} +} + +type SetStorageConfigurationFunction struct{} + +func (_ *SetStorageConfigurationFunction) Request() interface{} { + return &SetStorageConfiguration{} +} +func (_ *SetStorageConfigurationFunction) Response() interface{} { + return &SetStorageConfigurationResponse{} +} + +type SetSystemDateAndTimeFunction struct{} + +func (_ *SetSystemDateAndTimeFunction) Request() interface{} { + return &SetSystemDateAndTime{} +} +func (_ *SetSystemDateAndTimeFunction) Response() interface{} { + return &SetSystemDateAndTimeResponse{} +} + +type SetSystemFactoryDefaultFunction struct{} + +func (_ *SetSystemFactoryDefaultFunction) Request() interface{} { + return &SetSystemFactoryDefault{} +} +func (_ *SetSystemFactoryDefaultFunction) Response() interface{} { + return &SetSystemFactoryDefaultResponse{} +} + +type SetUserFunction struct{} + +func (_ *SetUserFunction) Request() interface{} { + return &SetUser{} +} +func (_ *SetUserFunction) Response() interface{} { + return &SetUserResponse{} +} + +type SetZeroConfigurationFunction struct{} + +func (_ *SetZeroConfigurationFunction) Request() interface{} { + return &SetZeroConfiguration{} +} +func (_ *SetZeroConfigurationFunction) Response() interface{} { + return &SetZeroConfigurationResponse{} +} + +type StartFirmwareUpgradeFunction struct{} + +func (_ *StartFirmwareUpgradeFunction) Request() interface{} { + return &StartFirmwareUpgrade{} +} +func (_ *StartFirmwareUpgradeFunction) Response() interface{} { + return &StartFirmwareUpgradeResponse{} +} + +type StartSystemRestoreFunction struct{} + +func (_ *StartSystemRestoreFunction) Request() interface{} { + return &StartSystemRestore{} +} +func (_ *StartSystemRestoreFunction) Response() interface{} { + return &StartSystemRestoreResponse{} +} + +type SystemRebootFunction struct{} + +func (_ *SystemRebootFunction) Request() interface{} { + return &SystemReboot{} +} +func (_ *SystemRebootFunction) Response() interface{} { + return &SystemRebootResponse{} +} + +type UpgradeSystemFirmwareFunction struct{} + +func (_ *UpgradeSystemFirmwareFunction) Request() interface{} { + return &UpgradeSystemFirmware{} +} +func (_ *UpgradeSystemFirmwareFunction) Response() interface{} { + return &UpgradeSystemFirmwareResponse{} +} diff --git a/device/types.go b/device/types.go index 79ed7558..210cd00d 100644 --- a/device/types.go +++ b/device/types.go @@ -1,5 +1,7 @@ package device +//go:generate python3 ../python/gen_commands.py + import ( "github.com/kerberos-io/onvif/xsd" "github.com/kerberos-io/onvif/xsd/onvif" @@ -36,28 +38,24 @@ type NetworkCapabilities struct { } type SecurityCapabilities struct { - TLS1_0 xsd.Boolean `xml:"TLS1_0,attr"` - TLS1_1 xsd.Boolean `xml:"TLS1_1,attr"` - TLS1_2 xsd.Boolean `xml:"TLS1_2,attr"` - OnboardKeyGeneration xsd.Boolean `xml:"OnboardKeyGeneration,attr"` - AccessPolicyConfig xsd.Boolean `xml:"AccessPolicyConfig,attr"` - DefaultAccessPolicy xsd.Boolean `xml:"DefaultAccessPolicy,attr"` - Dot1X xsd.Boolean `xml:"Dot1X,attr"` - RemoteUserHandling xsd.Boolean `xml:"RemoteUserHandling,attr"` - X_509Token xsd.Boolean `xml:"X_509Token,attr"` - SAMLToken xsd.Boolean `xml:"SAMLToken,attr"` - KerberosToken xsd.Boolean `xml:"KerberosToken,attr"` - UsernameToken xsd.Boolean `xml:"UsernameToken,attr"` - HttpDigest xsd.Boolean `xml:"HttpDigest,attr"` - RELToken xsd.Boolean `xml:"RELToken,attr"` - SupportedEAPMethods EAPMethodTypes `xml:"SupportedEAPMethods,attr"` - MaxUsers int `xml:"MaxUsers,attr"` - MaxUserNameLength int `xml:"MaxUserNameLength,attr"` - MaxPasswordLength int `xml:"MaxPasswordLength,attr"` -} - -type EAPMethodTypes struct { - Types []int + TLS1_0 xsd.Boolean `xml:"TLS1_0,attr"` + TLS1_1 xsd.Boolean `xml:"TLS1_1,attr"` + TLS1_2 xsd.Boolean `xml:"TLS1_2,attr"` + OnboardKeyGeneration xsd.Boolean `xml:"OnboardKeyGeneration,attr"` + AccessPolicyConfig xsd.Boolean `xml:"AccessPolicyConfig,attr"` + DefaultAccessPolicy xsd.Boolean `xml:"DefaultAccessPolicy,attr"` + Dot1X xsd.Boolean `xml:"Dot1X,attr"` + RemoteUserHandling xsd.Boolean `xml:"RemoteUserHandling,attr"` + X_509Token xsd.Boolean `xml:"X_509Token,attr"` + SAMLToken xsd.Boolean `xml:"SAMLToken,attr"` + KerberosToken xsd.Boolean `xml:"KerberosToken,attr"` + UsernameToken xsd.Boolean `xml:"UsernameToken,attr"` + HttpDigest xsd.Boolean `xml:"HttpDigest,attr"` + RELToken xsd.Boolean `xml:"RELToken,attr"` + SupportedEAPMethods onvif.IntAttrList `xml:"SupportedEAPMethods,attr"` + MaxUsers int `xml:"MaxUsers,attr"` + MaxUserNameLength int `xml:"MaxUserNameLength,attr"` + MaxPasswordLength int `xml:"MaxPasswordLength,attr"` } type SystemCapabilities struct { @@ -73,6 +71,7 @@ type SystemCapabilities struct { HttpSupportInformation xsd.Boolean `xml:"HttpSupportInformation,attr"` StorageConfiguration xsd.Boolean `xml:"StorageConfiguration,attr"` MaxStorageConfigurations int `xml:"MaxStorageConfigurations,attr"` + StorageTypesSupported onvif.StringAttrList `xml:"StorageTypesSupported,attr"` GeoLocationEntries int `xml:"GeoLocationEntries,attr"` AutoGeo onvif.StringAttrList `xml:"AutoGeo,attr"` } @@ -83,11 +82,23 @@ type MiscCapabilities struct { type StorageConfiguration struct { onvif.DeviceEntity - Data StorageConfigurationData `xml:"tds:Data"` + Data struct { + Type xsd.String `xml:"type,attr"` + Region string + LocalPath xsd.AnyURI + StorageUri xsd.AnyURI + User struct { + UserName xsd.String + Password xsd.String `json:",omitempty"` + Extension xsd.AnyType `json:",omitempty"` + } + Extension xsd.AnyURI `json:",omitempty"` + } } type StorageConfigurationData struct { Type xsd.String `xml:"type,attr"` + Region string `xml:"tds:Region,omitempty"` LocalPath xsd.AnyURI `xml:"tds:LocalPath"` StorageUri xsd.AnyURI `xml:"tds:StorageUri"` User UserCredential `xml:"tds:User"` @@ -131,12 +142,14 @@ type GetDeviceInformationResponse struct { HardwareId string } +// SetSystemDateAndTime and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl#op.SetSystemDateAndTime type SetSystemDateAndTime struct { - XMLName string `xml:"tds:SetSystemDateAndTime"` - DateTimeType onvif.SetDateTimeType `xml:"tds:DateTimeType"` - DaylightSavings xsd.Boolean `xml:"tds:DaylightSavings"` - TimeZone onvif.TimeZone `xml:"tds:TimeZone"` - UTCDateTime onvif.DateTime `xml:"tds:UTCDateTime"` + XMLName string `xml:"tds:SetSystemDateAndTime,omitempty"` + DateTimeType *onvif.SetDateTimeType `xml:"tds:DateTimeType,omitempty"` + DaylightSavings *xsd.Boolean `xml:"tds:DaylightSavings,omitempty"` + TimeZone *onvif.TimeZone `xml:"tds:TimeZone,omitempty"` + UTCDateTime *onvif.DateTimeRequest `xml:"tds:UTCDateTime,omitempty"` } type SetSystemDateAndTimeResponse struct { @@ -150,6 +163,8 @@ type GetSystemDateAndTimeResponse struct { SystemDateAndTime onvif.SystemDateTime } +// SetSystemFactoryDefault and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl#op.SetSystemFactoryDefault type SetSystemFactoryDefault struct { XMLName string `xml:"tds:SetSystemFactoryDefault"` FactoryDefault onvif.FactoryDefaultType `xml:"tds:FactoryDefault"` @@ -167,6 +182,8 @@ type UpgradeSystemFirmwareResponse struct { Message string } +// SystemReboot and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl#op.SystemReboot type SystemReboot struct { XMLName string `xml:"tds:SystemReboot"` } @@ -175,7 +192,7 @@ type SystemRebootResponse struct { Message string } -//TODO: one or more repetitions +// TODO: one or more repetitions type RestoreSystem struct { XMLName string `xml:"tds:RestoreSystem"` BackupFiles onvif.BackupFile `xml:"tds:BackupFiles"` @@ -214,37 +231,40 @@ type GetScopes struct { } type GetScopesResponse struct { - Scopes onvif.Scope + Scopes []onvif.Scope } -//TODO: one or more scopes +// SetScopes and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl#op.SetScopes type SetScopes struct { - XMLName string `xml:"tds:SetScopes"` - Scopes xsd.AnyURI `xml:"tds:Scopes"` + XMLName string `xml:"tds:SetScopes"` + Scopes []xsd.AnyURI `xml:"tds:Scopes"` } type SetScopesResponse struct { } -//TODO: list of scopes +// AddScopes and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl#op.AddScopes type AddScopes struct { - XMLName string `xml:"tds:AddScopes"` - ScopeItem xsd.AnyURI `xml:"tds:ScopeItem"` + XMLName string `xml:"tds:AddScopes"` + ScopeItem []xsd.AnyURI `xml:"tds:ScopeItem"` } type AddScopesResponse struct { } -//TODO: One or more repetitions type RemoveScopes struct { - XMLName string `xml:"tds:RemoveScopes"` - ScopeItem xsd.AnyURI `xml:"onvif:ScopeItem"` + XMLName string `xml:"tds:RemoveScopes"` + ScopeItem []xsd.AnyURI `xml:"tds:ScopeItem"` } type RemoveScopesResponse struct { ScopeItem xsd.AnyURI } +// GetDiscoveryMode and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl#op.GetDiscoveryMode type GetDiscoveryMode struct { XMLName string `xml:"tds:GetDiscoveryMode"` } @@ -253,6 +273,8 @@ type GetDiscoveryModeResponse struct { DiscoveryMode onvif.DiscoveryMode } +// SetDiscoveryMode and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl#op.SetDiscoveryMode type SetDiscoveryMode struct { XMLName string `xml:"tds:SetDiscoveryMode"` DiscoveryMode onvif.DiscoveryMode `xml:"tds:DiscoveryMode"` @@ -322,30 +344,34 @@ type GetUsers struct { } type GetUsersResponse struct { - User onvif.User + User []onvif.User } -//TODO: List of users +// CreateUsers and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl#op.CreateUsers type CreateUsers struct { - XMLName string `xml:"tds:CreateUsers"` - User onvif.User `xml:"tds:User,omitempty"` + XMLName string `xml:"tds:CreateUsers"` + User []onvif.UserRequest `xml:"tds:User,omitempty"` } type CreateUsersResponse struct { } -//TODO: one or more Username +// DeleteUsers and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl#op.DeleteUsers type DeleteUsers struct { - XMLName xsd.String `xml:"tds:DeleteUsers"` - Username xsd.String `xml:"tds:Username"` + XMLName xsd.String `xml:"tds:DeleteUsers"` + Username []xsd.String `xml:"tds:Username"` } type DeleteUsersResponse struct { } +// SetUser and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl#op.SetUser type SetUser struct { - XMLName string `xml:"tds:SetUser"` - User onvif.User `xml:"tds:User"` + XMLName string `xml:"tds:SetUser"` + User []onvif.UserRequest `xml:"tds:User"` } type SetUserResponse struct { @@ -360,8 +386,8 @@ type GetWsdlUrlResponse struct { } type GetCapabilities struct { - XMLName string `xml:"tds:GetCapabilities"` - Category onvif.CapabilityCategory `xml:"tds:Category"` + XMLName string `xml:"tds:GetCapabilities"` + Category []onvif.CapabilityCategory `xml:"tds:Category"` } type GetCapabilitiesResponse struct { @@ -402,10 +428,10 @@ type GetDNSResponse struct { } type SetDNS struct { - XMLName string `xml:"tds:SetDNS"` - FromDHCP xsd.Boolean `xml:"tds:FromDHCP"` - SearchDomain xsd.Token `xml:"tds:SearchDomain"` - DNSManual onvif.IPAddress `xml:"tds:DNSManual"` + XMLName string `xml:"tds:SetDNS"` + FromDHCP *xsd.Boolean `xml:"tds:FromDHCP,omitempty"` + SearchDomain *xsd.Token `xml:"tds:SearchDomain,omitempty"` + DNSManual *onvif.IPAddress `xml:"tds:DNSManual,omitempty"` } type SetDNSResponse struct { @@ -455,9 +481,9 @@ type GetNetworkInterfacesResponse struct { } type SetNetworkInterfaces struct { - XMLName string `xml:"tds:SetNetworkInterfaces"` - InterfaceToken onvif.ReferenceToken `xml:"tds:InterfaceToken"` - NetworkInterface onvif.NetworkInterfaceSetConfiguration `xml:"tds:NetworkInterface"` + XMLName string `xml:"tds:SetNetworkInterfaces"` + InterfaceToken *onvif.ReferenceToken `xml:"tds:InterfaceToken,omitempty"` + NetworkInterface *onvif.NetworkInterfaceSetConfiguration `xml:"tds:NetworkInterface,omitempty"` } type SetNetworkInterfacesResponse struct { @@ -469,12 +495,12 @@ type GetNetworkProtocols struct { } type GetNetworkProtocolsResponse struct { - NetworkProtocols onvif.NetworkProtocol + NetworkProtocols []onvif.NetworkProtocolResponse } type SetNetworkProtocols struct { - XMLName string `xml:"tds:SetNetworkProtocols"` - NetworkProtocols onvif.NetworkProtocol `xml:"tds:NetworkProtocols"` + XMLName string `xml:"tds:SetNetworkProtocols"` + NetworkProtocols []onvif.NetworkProtocolRequest `xml:"tds:NetworkProtocols"` } type SetNetworkProtocolsResponse struct { @@ -490,8 +516,8 @@ type GetNetworkDefaultGatewayResponse struct { type SetNetworkDefaultGateway struct { XMLName string `xml:"tds:SetNetworkDefaultGateway"` - IPv4Address onvif.IPv4Address `xml:"tds:IPv4Address"` - IPv6Address onvif.IPv6Address `xml:"tds:IPv6Address"` + IPv4Address onvif.IPv4Address `xml:"tds:IPv4Address,omitempty"` + IPv6Address onvif.IPv6Address `xml:"tds:IPv6Address,omitempty"` } type SetNetworkDefaultGatewayResponse struct { @@ -530,11 +556,11 @@ type SetIPAddressFilter struct { type SetIPAddressFilterResponse struct { } -//This operation adds an IP filter address to a device. -//If the device supports device access control based on -//IP filtering rules (denied or accepted ranges of IP addresses), -//the device shall support adding of IP filtering addresses through -//the AddIPAddressFilter command. +// This operation adds an IP filter address to a device. +// If the device supports device access control based on +// IP filtering rules (denied or accepted ranges of IP addresses), +// the device shall support adding of IP filtering addresses through +// the AddIPAddressFilter command. type AddIPAddressFilter struct { XMLName string `xml:"tds:AddIPAddressFilter"` IPAddressFilter onvif.IPAddressFilter `xml:"tds:IPAddressFilter"` @@ -545,7 +571,7 @@ type AddIPAddressFilterResponse struct { type RemoveIPAddressFilter struct { XMLName string `xml:"tds:RemoveIPAddressFilter"` - IPAddressFilter onvif.IPAddressFilter `xml:"onvif:IPAddressFilter"` + IPAddressFilter onvif.IPAddressFilter `xml:"IPAddressFilter"` } type RemoveIPAddressFilterResponse struct { @@ -603,7 +629,7 @@ type SetCertificatesStatus struct { type SetCertificatesStatusResponse struct { } -//TODO: List of CertificateID +// TODO: List of CertificateID type DeleteCertificates struct { XMLName string `xml:"tds:DeleteCertificates"` CertificateID xsd.Token `xml:"tds:CertificateID"` @@ -612,7 +638,7 @@ type DeleteCertificates struct { type DeleteCertificatesResponse struct { } -//TODO: Откуда onvif:data = cid:21312413412 +// TODO: Откуда onvif:data = cid:21312413412 type GetPkcs10Request struct { XMLName string `xml:"tds:GetPkcs10Request"` CertificateID xsd.Token `xml:"tds:CertificateID"` @@ -624,7 +650,7 @@ type GetPkcs10RequestResponse struct { Pkcs10Request onvif.BinaryData } -//TODO: one or more NTVCertificate +// TODO: one or more NTVCertificate type LoadCertificates struct { XMLName string `xml:"tds:LoadCertificates"` NVTCertificate onvif.Certificate `xml:"tds:NVTCertificate"` @@ -692,7 +718,7 @@ type GetCACertificatesResponse struct { CACertificate onvif.Certificate } -//TODO: one or more CertificateWithPrivateKey +// TODO: one or more CertificateWithPrivateKey type LoadCertificateWithPrivateKey struct { XMLName string `xml:"tds:LoadCertificateWithPrivateKey"` CertificateWithPrivateKey onvif.CertificateWithPrivateKey `xml:"tds:CertificateWithPrivateKey"` @@ -751,7 +777,7 @@ type GetDot1XConfigurationsResponse struct { Dot1XConfiguration onvif.Dot1XConfiguration } -//TODO: Zero or more Dot1XConfigurationToken +// TODO: Zero or more Dot1XConfigurationToken type DeleteDot1XConfiguration struct { XMLName string `xml:"tds:DeleteDot1XConfiguration"` Dot1XConfigurationToken onvif.ReferenceToken `xml:"tds:Dot1XConfigurationToken"` @@ -821,12 +847,12 @@ type GetStorageConfigurations struct { } type GetStorageConfigurationsResponse struct { - StorageConfigurations StorageConfiguration + StorageConfigurations []StorageConfiguration } type CreateStorageConfiguration struct { - XMLName string `xml:"tds:CreateStorageConfiguration"` - StorageConfiguration StorageConfigurationData + XMLName string `xml:"tds:CreateStorageConfiguration"` + StorageConfiguration StorageConfigurationData `xml:"tds:StorageConfiguration"` } type CreateStorageConfigurationResponse struct { @@ -843,8 +869,11 @@ type GetStorageConfigurationResponse struct { } type SetStorageConfiguration struct { - XMLName string `xml:"tds:SetStorageConfiguration"` - StorageConfiguration StorageConfiguration `xml:"tds:StorageConfiguration"` + XMLName string `xml:"tds:SetStorageConfiguration"` + StorageConfiguration struct { + Token xsd.String `xml:"token,attr"` + Data StorageConfigurationData `xml:"tds:Data"` + } `xml:"tds:StorageConfiguration"` } type SetStorageConfigurationResponse struct { @@ -866,7 +895,7 @@ type GetGeoLocationResponse struct { Location onvif.LocationEntity } -//TODO: one or more Location +// TODO: one or more Location type SetGeoLocation struct { XMLName string `xml:"tds:SetGeoLocation"` Location onvif.LocationEntity `xml:"tds:Location"` diff --git a/deviceio/function.go b/deviceio/function.go new file mode 100644 index 00000000..1e97bc68 --- /dev/null +++ b/deviceio/function.go @@ -0,0 +1,819 @@ +// -*- Mode: Go; indent-tabs-mode: t -*- +// +// Copyright (C) 2022 Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by gen_commands.py DO NOT EDIT. + +package deviceio + +type AddIPAddressFilterFunction struct{} + +func (_ *AddIPAddressFilterFunction) Request() interface{} { + return &AddIPAddressFilter{} +} +func (_ *AddIPAddressFilterFunction) Response() interface{} { + return &AddIPAddressFilterResponse{} +} + +type AddScopesFunction struct{} + +func (_ *AddScopesFunction) Request() interface{} { + return &AddScopes{} +} +func (_ *AddScopesFunction) Response() interface{} { + return &AddScopesResponse{} +} + +type CreateCertificateFunction struct{} + +func (_ *CreateCertificateFunction) Request() interface{} { + return &CreateCertificate{} +} +func (_ *CreateCertificateFunction) Response() interface{} { + return &CreateCertificateResponse{} +} + +type CreateDot1XConfigurationFunction struct{} + +func (_ *CreateDot1XConfigurationFunction) Request() interface{} { + return &CreateDot1XConfiguration{} +} +func (_ *CreateDot1XConfigurationFunction) Response() interface{} { + return &CreateDot1XConfigurationResponse{} +} + +type CreateStorageConfigurationFunction struct{} + +func (_ *CreateStorageConfigurationFunction) Request() interface{} { + return &CreateStorageConfiguration{} +} +func (_ *CreateStorageConfigurationFunction) Response() interface{} { + return &CreateStorageConfigurationResponse{} +} + +type CreateUsersFunction struct{} + +func (_ *CreateUsersFunction) Request() interface{} { + return &CreateUsers{} +} +func (_ *CreateUsersFunction) Response() interface{} { + return &CreateUsersResponse{} +} + +type DeleteCertificatesFunction struct{} + +func (_ *DeleteCertificatesFunction) Request() interface{} { + return &DeleteCertificates{} +} +func (_ *DeleteCertificatesFunction) Response() interface{} { + return &DeleteCertificatesResponse{} +} + +type DeleteDot1XConfigurationFunction struct{} + +func (_ *DeleteDot1XConfigurationFunction) Request() interface{} { + return &DeleteDot1XConfiguration{} +} +func (_ *DeleteDot1XConfigurationFunction) Response() interface{} { + return &DeleteDot1XConfigurationResponse{} +} + +type DeleteGeoLocationFunction struct{} + +func (_ *DeleteGeoLocationFunction) Request() interface{} { + return &DeleteGeoLocation{} +} +func (_ *DeleteGeoLocationFunction) Response() interface{} { + return &DeleteGeoLocationResponse{} +} + +type DeleteStorageConfigurationFunction struct{} + +func (_ *DeleteStorageConfigurationFunction) Request() interface{} { + return &DeleteStorageConfiguration{} +} +func (_ *DeleteStorageConfigurationFunction) Response() interface{} { + return &DeleteStorageConfigurationResponse{} +} + +type DeleteUsersFunction struct{} + +func (_ *DeleteUsersFunction) Request() interface{} { + return &DeleteUsers{} +} +func (_ *DeleteUsersFunction) Response() interface{} { + return &DeleteUsersResponse{} +} + +type GetAccessPolicyFunction struct{} + +func (_ *GetAccessPolicyFunction) Request() interface{} { + return &GetAccessPolicy{} +} +func (_ *GetAccessPolicyFunction) Response() interface{} { + return &GetAccessPolicyResponse{} +} + +type GetCACertificatesFunction struct{} + +func (_ *GetCACertificatesFunction) Request() interface{} { + return &GetCACertificates{} +} +func (_ *GetCACertificatesFunction) Response() interface{} { + return &GetCACertificatesResponse{} +} + +type GetCapabilitiesFunction struct{} + +func (_ *GetCapabilitiesFunction) Request() interface{} { + return &GetCapabilities{} +} +func (_ *GetCapabilitiesFunction) Response() interface{} { + return &GetCapabilitiesResponse{} +} + +type GetCertificateInformationFunction struct{} + +func (_ *GetCertificateInformationFunction) Request() interface{} { + return &GetCertificateInformation{} +} +func (_ *GetCertificateInformationFunction) Response() interface{} { + return &GetCertificateInformationResponse{} +} + +type GetCertificatesFunction struct{} + +func (_ *GetCertificatesFunction) Request() interface{} { + return &GetCertificates{} +} +func (_ *GetCertificatesFunction) Response() interface{} { + return &GetCertificatesResponse{} +} + +type GetCertificatesStatusFunction struct{} + +func (_ *GetCertificatesStatusFunction) Request() interface{} { + return &GetCertificatesStatus{} +} +func (_ *GetCertificatesStatusFunction) Response() interface{} { + return &GetCertificatesStatusResponse{} +} + +type GetClientCertificateModeFunction struct{} + +func (_ *GetClientCertificateModeFunction) Request() interface{} { + return &GetClientCertificateMode{} +} +func (_ *GetClientCertificateModeFunction) Response() interface{} { + return &GetClientCertificateModeResponse{} +} + +type GetDNSFunction struct{} + +func (_ *GetDNSFunction) Request() interface{} { + return &GetDNS{} +} +func (_ *GetDNSFunction) Response() interface{} { + return &GetDNSResponse{} +} + +type GetDPAddressesFunction struct{} + +func (_ *GetDPAddressesFunction) Request() interface{} { + return &GetDPAddresses{} +} +func (_ *GetDPAddressesFunction) Response() interface{} { + return &GetDPAddressesResponse{} +} + +type GetDeviceInformationFunction struct{} + +func (_ *GetDeviceInformationFunction) Request() interface{} { + return &GetDeviceInformation{} +} +func (_ *GetDeviceInformationFunction) Response() interface{} { + return &GetDeviceInformationResponse{} +} + +type GetDiscoveryModeFunction struct{} + +func (_ *GetDiscoveryModeFunction) Request() interface{} { + return &GetDiscoveryMode{} +} +func (_ *GetDiscoveryModeFunction) Response() interface{} { + return &GetDiscoveryModeResponse{} +} + +type GetDot11CapabilitiesFunction struct{} + +func (_ *GetDot11CapabilitiesFunction) Request() interface{} { + return &GetDot11Capabilities{} +} +func (_ *GetDot11CapabilitiesFunction) Response() interface{} { + return &GetDot11CapabilitiesResponse{} +} + +type GetDot11StatusFunction struct{} + +func (_ *GetDot11StatusFunction) Request() interface{} { + return &GetDot11Status{} +} +func (_ *GetDot11StatusFunction) Response() interface{} { + return &GetDot11StatusResponse{} +} + +type GetDot1XConfigurationFunction struct{} + +func (_ *GetDot1XConfigurationFunction) Request() interface{} { + return &GetDot1XConfiguration{} +} +func (_ *GetDot1XConfigurationFunction) Response() interface{} { + return &GetDot1XConfigurationResponse{} +} + +type GetDot1XConfigurationsFunction struct{} + +func (_ *GetDot1XConfigurationsFunction) Request() interface{} { + return &GetDot1XConfigurations{} +} +func (_ *GetDot1XConfigurationsFunction) Response() interface{} { + return &GetDot1XConfigurationsResponse{} +} + +type GetDynamicDNSFunction struct{} + +func (_ *GetDynamicDNSFunction) Request() interface{} { + return &GetDynamicDNS{} +} +func (_ *GetDynamicDNSFunction) Response() interface{} { + return &GetDynamicDNSResponse{} +} + +type GetEndpointReferenceFunction struct{} + +func (_ *GetEndpointReferenceFunction) Request() interface{} { + return &GetEndpointReference{} +} +func (_ *GetEndpointReferenceFunction) Response() interface{} { + return &GetEndpointReferenceResponse{} +} + +type GetGeoLocationFunction struct{} + +func (_ *GetGeoLocationFunction) Request() interface{} { + return &GetGeoLocation{} +} +func (_ *GetGeoLocationFunction) Response() interface{} { + return &GetGeoLocationResponse{} +} + +type GetHostnameFunction struct{} + +func (_ *GetHostnameFunction) Request() interface{} { + return &GetHostname{} +} +func (_ *GetHostnameFunction) Response() interface{} { + return &GetHostnameResponse{} +} + +type GetIPAddressFilterFunction struct{} + +func (_ *GetIPAddressFilterFunction) Request() interface{} { + return &GetIPAddressFilter{} +} +func (_ *GetIPAddressFilterFunction) Response() interface{} { + return &GetIPAddressFilterResponse{} +} + +type GetNTPFunction struct{} + +func (_ *GetNTPFunction) Request() interface{} { + return &GetNTP{} +} +func (_ *GetNTPFunction) Response() interface{} { + return &GetNTPResponse{} +} + +type GetNetworkDefaultGatewayFunction struct{} + +func (_ *GetNetworkDefaultGatewayFunction) Request() interface{} { + return &GetNetworkDefaultGateway{} +} +func (_ *GetNetworkDefaultGatewayFunction) Response() interface{} { + return &GetNetworkDefaultGatewayResponse{} +} + +type GetNetworkInterfacesFunction struct{} + +func (_ *GetNetworkInterfacesFunction) Request() interface{} { + return &GetNetworkInterfaces{} +} +func (_ *GetNetworkInterfacesFunction) Response() interface{} { + return &GetNetworkInterfacesResponse{} +} + +type GetNetworkProtocolsFunction struct{} + +func (_ *GetNetworkProtocolsFunction) Request() interface{} { + return &GetNetworkProtocols{} +} +func (_ *GetNetworkProtocolsFunction) Response() interface{} { + return &GetNetworkProtocolsResponse{} +} + +type GetPkcs10RequestFunction struct{} + +func (_ *GetPkcs10RequestFunction) Request() interface{} { + return &GetPkcs10Request{} +} +func (_ *GetPkcs10RequestFunction) Response() interface{} { + return &GetPkcs10RequestResponse{} +} + +type GetRelayOutputsFunction struct{} + +func (_ *GetRelayOutputsFunction) Request() interface{} { + return &GetRelayOutputs{} +} +func (_ *GetRelayOutputsFunction) Response() interface{} { + return &GetRelayOutputsResponse{} +} + +type GetRemoteDiscoveryModeFunction struct{} + +func (_ *GetRemoteDiscoveryModeFunction) Request() interface{} { + return &GetRemoteDiscoveryMode{} +} +func (_ *GetRemoteDiscoveryModeFunction) Response() interface{} { + return &GetRemoteDiscoveryModeResponse{} +} + +type GetRemoteUserFunction struct{} + +func (_ *GetRemoteUserFunction) Request() interface{} { + return &GetRemoteUser{} +} +func (_ *GetRemoteUserFunction) Response() interface{} { + return &GetRemoteUserResponse{} +} + +type GetScopesFunction struct{} + +func (_ *GetScopesFunction) Request() interface{} { + return &GetScopes{} +} +func (_ *GetScopesFunction) Response() interface{} { + return &GetScopesResponse{} +} + +type GetServiceCapabilitiesFunction struct{} + +func (_ *GetServiceCapabilitiesFunction) Request() interface{} { + return &GetServiceCapabilities{} +} +func (_ *GetServiceCapabilitiesFunction) Response() interface{} { + return &GetServiceCapabilitiesResponse{} +} + +type GetServicesFunction struct{} + +func (_ *GetServicesFunction) Request() interface{} { + return &GetServices{} +} +func (_ *GetServicesFunction) Response() interface{} { + return &GetServicesResponse{} +} + +type GetStorageConfigurationFunction struct{} + +func (_ *GetStorageConfigurationFunction) Request() interface{} { + return &GetStorageConfiguration{} +} +func (_ *GetStorageConfigurationFunction) Response() interface{} { + return &GetStorageConfigurationResponse{} +} + +type GetStorageConfigurationsFunction struct{} + +func (_ *GetStorageConfigurationsFunction) Request() interface{} { + return &GetStorageConfigurations{} +} +func (_ *GetStorageConfigurationsFunction) Response() interface{} { + return &GetStorageConfigurationsResponse{} +} + +type GetSystemBackupFunction struct{} + +func (_ *GetSystemBackupFunction) Request() interface{} { + return &GetSystemBackup{} +} +func (_ *GetSystemBackupFunction) Response() interface{} { + return &GetSystemBackupResponse{} +} + +type GetSystemDateAndTimeFunction struct{} + +func (_ *GetSystemDateAndTimeFunction) Request() interface{} { + return &GetSystemDateAndTime{} +} +func (_ *GetSystemDateAndTimeFunction) Response() interface{} { + return &GetSystemDateAndTimeResponse{} +} + +type GetSystemLogFunction struct{} + +func (_ *GetSystemLogFunction) Request() interface{} { + return &GetSystemLog{} +} +func (_ *GetSystemLogFunction) Response() interface{} { + return &GetSystemLogResponse{} +} + +type GetSystemSupportInformationFunction struct{} + +func (_ *GetSystemSupportInformationFunction) Request() interface{} { + return &GetSystemSupportInformation{} +} +func (_ *GetSystemSupportInformationFunction) Response() interface{} { + return &GetSystemSupportInformationResponse{} +} + +type GetSystemUrisFunction struct{} + +func (_ *GetSystemUrisFunction) Request() interface{} { + return &GetSystemUris{} +} +func (_ *GetSystemUrisFunction) Response() interface{} { + return &GetSystemUrisResponse{} +} + +type GetUsersFunction struct{} + +func (_ *GetUsersFunction) Request() interface{} { + return &GetUsers{} +} +func (_ *GetUsersFunction) Response() interface{} { + return &GetUsersResponse{} +} + +type GetWsdlUrlFunction struct{} + +func (_ *GetWsdlUrlFunction) Request() interface{} { + return &GetWsdlUrl{} +} +func (_ *GetWsdlUrlFunction) Response() interface{} { + return &GetWsdlUrlResponse{} +} + +type GetZeroConfigurationFunction struct{} + +func (_ *GetZeroConfigurationFunction) Request() interface{} { + return &GetZeroConfiguration{} +} +func (_ *GetZeroConfigurationFunction) Response() interface{} { + return &GetZeroConfigurationResponse{} +} + +type LoadCACertificatesFunction struct{} + +func (_ *LoadCACertificatesFunction) Request() interface{} { + return &LoadCACertificates{} +} +func (_ *LoadCACertificatesFunction) Response() interface{} { + return &LoadCACertificatesResponse{} +} + +type LoadCertificateWithPrivateKeyFunction struct{} + +func (_ *LoadCertificateWithPrivateKeyFunction) Request() interface{} { + return &LoadCertificateWithPrivateKey{} +} +func (_ *LoadCertificateWithPrivateKeyFunction) Response() interface{} { + return &LoadCertificateWithPrivateKeyResponse{} +} + +type LoadCertificatesFunction struct{} + +func (_ *LoadCertificatesFunction) Request() interface{} { + return &LoadCertificates{} +} +func (_ *LoadCertificatesFunction) Response() interface{} { + return &LoadCertificatesResponse{} +} + +type RemoveIPAddressFilterFunction struct{} + +func (_ *RemoveIPAddressFilterFunction) Request() interface{} { + return &RemoveIPAddressFilter{} +} +func (_ *RemoveIPAddressFilterFunction) Response() interface{} { + return &RemoveIPAddressFilterResponse{} +} + +type RemoveScopesFunction struct{} + +func (_ *RemoveScopesFunction) Request() interface{} { + return &RemoveScopes{} +} +func (_ *RemoveScopesFunction) Response() interface{} { + return &RemoveScopesResponse{} +} + +type RestoreSystemFunction struct{} + +func (_ *RestoreSystemFunction) Request() interface{} { + return &RestoreSystem{} +} +func (_ *RestoreSystemFunction) Response() interface{} { + return &RestoreSystemResponse{} +} + +type ScanAvailableDot11NetworksFunction struct{} + +func (_ *ScanAvailableDot11NetworksFunction) Request() interface{} { + return &ScanAvailableDot11Networks{} +} +func (_ *ScanAvailableDot11NetworksFunction) Response() interface{} { + return &ScanAvailableDot11NetworksResponse{} +} + +type SendAuxiliaryCommandFunction struct{} + +func (_ *SendAuxiliaryCommandFunction) Request() interface{} { + return &SendAuxiliaryCommand{} +} +func (_ *SendAuxiliaryCommandFunction) Response() interface{} { + return &SendAuxiliaryCommandResponse{} +} + +type SetAccessPolicyFunction struct{} + +func (_ *SetAccessPolicyFunction) Request() interface{} { + return &SetAccessPolicy{} +} +func (_ *SetAccessPolicyFunction) Response() interface{} { + return &SetAccessPolicyResponse{} +} + +type SetCertificatesStatusFunction struct{} + +func (_ *SetCertificatesStatusFunction) Request() interface{} { + return &SetCertificatesStatus{} +} +func (_ *SetCertificatesStatusFunction) Response() interface{} { + return &SetCertificatesStatusResponse{} +} + +type SetClientCertificateModeFunction struct{} + +func (_ *SetClientCertificateModeFunction) Request() interface{} { + return &SetClientCertificateMode{} +} +func (_ *SetClientCertificateModeFunction) Response() interface{} { + return &SetClientCertificateModeResponse{} +} + +type SetDNSFunction struct{} + +func (_ *SetDNSFunction) Request() interface{} { + return &SetDNS{} +} +func (_ *SetDNSFunction) Response() interface{} { + return &SetDNSResponse{} +} + +type SetDPAddressesFunction struct{} + +func (_ *SetDPAddressesFunction) Request() interface{} { + return &SetDPAddresses{} +} +func (_ *SetDPAddressesFunction) Response() interface{} { + return &SetDPAddressesResponse{} +} + +type SetDiscoveryModeFunction struct{} + +func (_ *SetDiscoveryModeFunction) Request() interface{} { + return &SetDiscoveryMode{} +} +func (_ *SetDiscoveryModeFunction) Response() interface{} { + return &SetDiscoveryModeResponse{} +} + +type SetDot1XConfigurationFunction struct{} + +func (_ *SetDot1XConfigurationFunction) Request() interface{} { + return &SetDot1XConfiguration{} +} +func (_ *SetDot1XConfigurationFunction) Response() interface{} { + return &SetDot1XConfigurationResponse{} +} + +type SetDynamicDNSFunction struct{} + +func (_ *SetDynamicDNSFunction) Request() interface{} { + return &SetDynamicDNS{} +} +func (_ *SetDynamicDNSFunction) Response() interface{} { + return &SetDynamicDNSResponse{} +} + +type SetGeoLocationFunction struct{} + +func (_ *SetGeoLocationFunction) Request() interface{} { + return &SetGeoLocation{} +} +func (_ *SetGeoLocationFunction) Response() interface{} { + return &SetGeoLocationResponse{} +} + +type SetHostnameFunction struct{} + +func (_ *SetHostnameFunction) Request() interface{} { + return &SetHostname{} +} +func (_ *SetHostnameFunction) Response() interface{} { + return &SetHostnameResponse{} +} + +type SetHostnameFromDHCPFunction struct{} + +func (_ *SetHostnameFromDHCPFunction) Request() interface{} { + return &SetHostnameFromDHCP{} +} +func (_ *SetHostnameFromDHCPFunction) Response() interface{} { + return &SetHostnameFromDHCPResponse{} +} + +type SetIPAddressFilterFunction struct{} + +func (_ *SetIPAddressFilterFunction) Request() interface{} { + return &SetIPAddressFilter{} +} +func (_ *SetIPAddressFilterFunction) Response() interface{} { + return &SetIPAddressFilterResponse{} +} + +type SetNTPFunction struct{} + +func (_ *SetNTPFunction) Request() interface{} { + return &SetNTP{} +} +func (_ *SetNTPFunction) Response() interface{} { + return &SetNTPResponse{} +} + +type SetNetworkDefaultGatewayFunction struct{} + +func (_ *SetNetworkDefaultGatewayFunction) Request() interface{} { + return &SetNetworkDefaultGateway{} +} +func (_ *SetNetworkDefaultGatewayFunction) Response() interface{} { + return &SetNetworkDefaultGatewayResponse{} +} + +type SetNetworkInterfacesFunction struct{} + +func (_ *SetNetworkInterfacesFunction) Request() interface{} { + return &SetNetworkInterfaces{} +} +func (_ *SetNetworkInterfacesFunction) Response() interface{} { + return &SetNetworkInterfacesResponse{} +} + +type SetNetworkProtocolsFunction struct{} + +func (_ *SetNetworkProtocolsFunction) Request() interface{} { + return &SetNetworkProtocols{} +} +func (_ *SetNetworkProtocolsFunction) Response() interface{} { + return &SetNetworkProtocolsResponse{} +} + +type SetRelayOutputSettingsFunction struct{} + +func (_ *SetRelayOutputSettingsFunction) Request() interface{} { + return &SetRelayOutputSettings{} +} +func (_ *SetRelayOutputSettingsFunction) Response() interface{} { + return &SetRelayOutputSettingsResponse{} +} + +type SetRelayOutputStateFunction struct{} + +func (_ *SetRelayOutputStateFunction) Request() interface{} { + return &SetRelayOutputState{} +} +func (_ *SetRelayOutputStateFunction) Response() interface{} { + return &SetRelayOutputStateResponse{} +} + +type SetRemoteDiscoveryModeFunction struct{} + +func (_ *SetRemoteDiscoveryModeFunction) Request() interface{} { + return &SetRemoteDiscoveryMode{} +} +func (_ *SetRemoteDiscoveryModeFunction) Response() interface{} { + return &SetRemoteDiscoveryModeResponse{} +} + +type SetRemoteUserFunction struct{} + +func (_ *SetRemoteUserFunction) Request() interface{} { + return &SetRemoteUser{} +} +func (_ *SetRemoteUserFunction) Response() interface{} { + return &SetRemoteUserResponse{} +} + +type SetScopesFunction struct{} + +func (_ *SetScopesFunction) Request() interface{} { + return &SetScopes{} +} +func (_ *SetScopesFunction) Response() interface{} { + return &SetScopesResponse{} +} + +type SetStorageConfigurationFunction struct{} + +func (_ *SetStorageConfigurationFunction) Request() interface{} { + return &SetStorageConfiguration{} +} +func (_ *SetStorageConfigurationFunction) Response() interface{} { + return &SetStorageConfigurationResponse{} +} + +type SetSystemDateAndTimeFunction struct{} + +func (_ *SetSystemDateAndTimeFunction) Request() interface{} { + return &SetSystemDateAndTime{} +} +func (_ *SetSystemDateAndTimeFunction) Response() interface{} { + return &SetSystemDateAndTimeResponse{} +} + +type SetSystemFactoryDefaultFunction struct{} + +func (_ *SetSystemFactoryDefaultFunction) Request() interface{} { + return &SetSystemFactoryDefault{} +} +func (_ *SetSystemFactoryDefaultFunction) Response() interface{} { + return &SetSystemFactoryDefaultResponse{} +} + +type SetUserFunction struct{} + +func (_ *SetUserFunction) Request() interface{} { + return &SetUser{} +} +func (_ *SetUserFunction) Response() interface{} { + return &SetUserResponse{} +} + +type SetZeroConfigurationFunction struct{} + +func (_ *SetZeroConfigurationFunction) Request() interface{} { + return &SetZeroConfiguration{} +} +func (_ *SetZeroConfigurationFunction) Response() interface{} { + return &SetZeroConfigurationResponse{} +} + +type StartFirmwareUpgradeFunction struct{} + +func (_ *StartFirmwareUpgradeFunction) Request() interface{} { + return &StartFirmwareUpgrade{} +} +func (_ *StartFirmwareUpgradeFunction) Response() interface{} { + return &StartFirmwareUpgradeResponse{} +} + +type StartSystemRestoreFunction struct{} + +func (_ *StartSystemRestoreFunction) Request() interface{} { + return &StartSystemRestore{} +} +func (_ *StartSystemRestoreFunction) Response() interface{} { + return &StartSystemRestoreResponse{} +} + +type SystemRebootFunction struct{} + +func (_ *SystemRebootFunction) Request() interface{} { + return &SystemReboot{} +} +func (_ *SystemRebootFunction) Response() interface{} { + return &SystemRebootResponse{} +} + +type UpgradeSystemFirmwareFunction struct{} + +func (_ *UpgradeSystemFirmwareFunction) Request() interface{} { + return &UpgradeSystemFirmware{} +} +func (_ *UpgradeSystemFirmwareFunction) Response() interface{} { + return &UpgradeSystemFirmwareResponse{} +} diff --git a/deviceio/types.go b/deviceio/types.go new file mode 100644 index 00000000..f6a3b3a0 --- /dev/null +++ b/deviceio/types.go @@ -0,0 +1,913 @@ +package deviceio + +//go:generate python3 ../python/gen_commands.py + +import ( + "github.com/kerberos-io/onvif/xsd" + "github.com/kerberos-io/onvif/xsd/onvif" +) + +type Service struct { + Namespace xsd.AnyURI + XAddr xsd.AnyURI + Capabilities + Version onvif.OnvifVersion +} + +type Capabilities struct { + Any string +} + +type DeviceServiceCapabilities struct { + Network NetworkCapabilities + Security SecurityCapabilities + System SystemCapabilities + Misc MiscCapabilities +} + +type NetworkCapabilities struct { + IPFilter xsd.Boolean `xml:"IPFilter,attr"` + ZeroConfiguration xsd.Boolean `xml:"ZeroConfiguration,attr"` + IPVersion6 xsd.Boolean `xml:"IPVersion6,attr"` + DynDNS xsd.Boolean `xml:"DynDNS,attr"` + Dot11Configuration xsd.Boolean `xml:"Dot11Configuration,attr"` + Dot1XConfigurations int `xml:"Dot1XConfigurations,attr"` + HostnameFromDHCP xsd.Boolean `xml:"HostnameFromDHCP,attr"` + NTP int `xml:"NTP,attr"` + DHCPv6 xsd.Boolean `xml:"DHCPv6,attr"` +} + +type SecurityCapabilities struct { + TLS1_0 xsd.Boolean `xml:"TLS1_0,attr"` + TLS1_1 xsd.Boolean `xml:"TLS1_1,attr"` + TLS1_2 xsd.Boolean `xml:"TLS1_2,attr"` + OnboardKeyGeneration xsd.Boolean `xml:"OnboardKeyGeneration,attr"` + AccessPolicyConfig xsd.Boolean `xml:"AccessPolicyConfig,attr"` + DefaultAccessPolicy xsd.Boolean `xml:"DefaultAccessPolicy,attr"` + Dot1X xsd.Boolean `xml:"Dot1X,attr"` + RemoteUserHandling xsd.Boolean `xml:"RemoteUserHandling,attr"` + X_509Token xsd.Boolean `xml:"X_509Token,attr"` + SAMLToken xsd.Boolean `xml:"SAMLToken,attr"` + KerberosToken xsd.Boolean `xml:"KerberosToken,attr"` + UsernameToken xsd.Boolean `xml:"UsernameToken,attr"` + HttpDigest xsd.Boolean `xml:"HttpDigest,attr"` + RELToken xsd.Boolean `xml:"RELToken,attr"` + SupportedEAPMethods onvif.IntAttrList `xml:"SupportedEAPMethods,attr"` + MaxUsers int `xml:"MaxUsers,attr"` + MaxUserNameLength int `xml:"MaxUserNameLength,attr"` + MaxPasswordLength int `xml:"MaxPasswordLength,attr"` +} + +type SystemCapabilities struct { + DiscoveryResolve xsd.Boolean `xml:"DiscoveryResolve,attr"` + DiscoveryBye xsd.Boolean `xml:"DiscoveryBye,attr"` + RemoteDiscovery xsd.Boolean `xml:"RemoteDiscovery,attr"` + SystemBackup xsd.Boolean `xml:"SystemBackup,attr"` + SystemLogging xsd.Boolean `xml:"SystemLogging,attr"` + FirmwareUpgrade xsd.Boolean `xml:"FirmwareUpgrade,attr"` + HttpFirmwareUpgrade xsd.Boolean `xml:"HttpFirmwareUpgrade,attr"` + HttpSystemBackup xsd.Boolean `xml:"HttpSystemBackup,attr"` + HttpSystemLogging xsd.Boolean `xml:"HttpSystemLogging,attr"` + HttpSupportInformation xsd.Boolean `xml:"HttpSupportInformation,attr"` + StorageConfiguration xsd.Boolean `xml:"StorageConfiguration,attr"` + MaxStorageConfigurations int `xml:"MaxStorageConfigurations,attr"` + StorageTypesSupported onvif.StringAttrList `xml:"StorageTypesSupported,attr"` + GeoLocationEntries int `xml:"GeoLocationEntries,attr"` + AutoGeo onvif.StringAttrList `xml:"AutoGeo,attr"` +} + +type MiscCapabilities struct { + AuxiliaryCommands onvif.StringAttrList `xml:"AuxiliaryCommands,attr"` +} + +type StorageConfiguration struct { + onvif.DeviceEntity + Data struct { + Type xsd.String `xml:"type,attr"` + Region string + LocalPath xsd.AnyURI + StorageUri xsd.AnyURI + User struct { + UserName xsd.String + Password xsd.String `json:",omitempty"` + Extension xsd.AnyType `json:",omitempty"` + } + Extension xsd.AnyURI `json:",omitempty"` + } +} + +type StorageConfigurationData struct { + Type xsd.String `xml:"type,attr"` + Region string `xml:"tds:Region,omitempty"` + LocalPath xsd.AnyURI `xml:"tds:LocalPath"` + StorageUri xsd.AnyURI `xml:"tds:StorageUri"` + User UserCredential `xml:"tds:User"` + Extension xsd.AnyURI `xml:"tds:Extension"` +} + +type UserCredential struct { + UserName xsd.String `xml:"tds:UserName"` + Password xsd.String `xml:"tds:Password"` + Extension xsd.AnyType `xml:"tds:Extension"` +} + +//Device main types + +type GetServices struct { + XMLName string `xml:"tds:GetServices"` + IncludeCapability xsd.Boolean `xml:"tds:IncludeCapability"` +} + +type GetServicesResponse struct { + Service Service +} + +type GetServiceCapabilities struct { + XMLName string `xml:"tds:GetServiceCapabilities"` +} + +type GetServiceCapabilitiesResponse struct { + Capabilities DeviceServiceCapabilities +} + +type GetDeviceInformation struct { + XMLName string `xml:"tds:GetDeviceInformation"` +} + +type GetDeviceInformationResponse struct { + Manufacturer string + Model string + FirmwareVersion string + SerialNumber string + HardwareId string +} + +// SetSystemDateAndTime and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl#op.SetSystemDateAndTime +type SetSystemDateAndTime struct { + XMLName string `xml:"tds:SetSystemDateAndTime,omitempty"` + DateTimeType *onvif.SetDateTimeType `xml:"tds:DateTimeType,omitempty"` + DaylightSavings *xsd.Boolean `xml:"tds:DaylightSavings,omitempty"` + TimeZone *onvif.TimeZone `xml:"tds:TimeZone,omitempty"` + UTCDateTime *onvif.DateTimeRequest `xml:"tds:UTCDateTime,omitempty"` +} + +type SetSystemDateAndTimeResponse struct { +} + +type GetSystemDateAndTime struct { + XMLName string `xml:"tds:GetSystemDateAndTime"` +} + +type GetSystemDateAndTimeResponse struct { + SystemDateAndTime onvif.SystemDateTime +} + +// SetSystemFactoryDefault and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl#op.SetSystemFactoryDefault +type SetSystemFactoryDefault struct { + XMLName string `xml:"tds:SetSystemFactoryDefault"` + FactoryDefault onvif.FactoryDefaultType `xml:"tds:FactoryDefault"` +} + +type SetSystemFactoryDefaultResponse struct { +} + +type UpgradeSystemFirmware struct { + XMLName string `xml:"tds:UpgradeSystemFirmware"` + Firmware onvif.AttachmentData `xml:"tds:Firmware"` +} + +type UpgradeSystemFirmwareResponse struct { + Message string +} + +// SystemReboot and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl#op.SystemReboot +type SystemReboot struct { + XMLName string `xml:"tds:SystemReboot"` +} + +type SystemRebootResponse struct { + Message string +} + +// TODO: one or more repetitions +type RestoreSystem struct { + XMLName string `xml:"tds:RestoreSystem"` + BackupFiles onvif.BackupFile `xml:"tds:BackupFiles"` +} + +type RestoreSystemResponse struct { +} + +type GetSystemBackup struct { + XMLName string `xml:"tds:GetSystemBackup"` +} + +type GetSystemBackupResponse struct { + BackupFiles onvif.BackupFile +} + +type GetSystemLog struct { + XMLName string `xml:"tds:GetSystemLog"` + LogType onvif.SystemLogType `xml:"tds:LogType"` +} + +type GetSystemLogResponse struct { + SystemLog onvif.SystemLog +} + +type GetSystemSupportInformation struct { + XMLName string `xml:"tds:GetSystemSupportInformation"` +} + +type GetSystemSupportInformationResponse struct { + SupportInformation onvif.SupportInformation +} + +type GetScopes struct { + XMLName string `xml:"tds:GetScopes"` +} + +type GetScopesResponse struct { + Scopes []onvif.Scope +} + +// SetScopes and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl#op.SetScopes +type SetScopes struct { + XMLName string `xml:"tds:SetScopes"` + Scopes []xsd.AnyURI `xml:"tds:Scopes"` +} + +type SetScopesResponse struct { +} + +// AddScopes and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl#op.AddScopes +type AddScopes struct { + XMLName string `xml:"tds:AddScopes"` + ScopeItem []xsd.AnyURI `xml:"tds:ScopeItem"` +} + +type AddScopesResponse struct { +} + +type RemoveScopes struct { + XMLName string `xml:"tds:RemoveScopes"` + ScopeItem []xsd.AnyURI `xml:"tds:ScopeItem"` +} + +type RemoveScopesResponse struct { + ScopeItem xsd.AnyURI +} + +// GetDiscoveryMode and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl#op.GetDiscoveryMode +type GetDiscoveryMode struct { + XMLName string `xml:"tds:GetDiscoveryMode"` +} + +type GetDiscoveryModeResponse struct { + DiscoveryMode onvif.DiscoveryMode +} + +// SetDiscoveryMode and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl#op.SetDiscoveryMode +type SetDiscoveryMode struct { + XMLName string `xml:"tds:SetDiscoveryMode"` + DiscoveryMode onvif.DiscoveryMode `xml:"tds:DiscoveryMode"` +} + +type SetDiscoveryModeResponse struct { +} + +type GetRemoteDiscoveryMode struct { + XMLName string `xml:"tds:GetRemoteDiscoveryMode"` +} + +type GetRemoteDiscoveryModeResponse struct { + RemoteDiscoveryMode onvif.DiscoveryMode +} + +type SetRemoteDiscoveryMode struct { + XMLName string `xml:"tds:SetRemoteDiscoveryMode"` + RemoteDiscoveryMode onvif.DiscoveryMode `xml:"tds:RemoteDiscoveryMode"` +} + +type SetRemoteDiscoveryModeResponse struct { +} + +type GetDPAddresses struct { + XMLName string `xml:"tds:GetDPAddresses"` +} + +type GetDPAddressesResponse struct { + DPAddress onvif.NetworkHost +} + +type SetDPAddresses struct { + XMLName string `xml:"tds:SetDPAddresses"` + DPAddress onvif.NetworkHost `xml:"tds:DPAddress"` +} + +type SetDPAddressesResponse struct { +} + +type GetEndpointReference struct { + XMLName string `xml:"tds:GetEndpointReference"` +} + +type GetEndpointReferenceResponse struct { + GUID string +} + +type GetRemoteUser struct { + XMLName string `xml:"tds:GetRemoteUser"` +} + +type GetRemoteUserResponse struct { + RemoteUser onvif.RemoteUser +} + +type SetRemoteUser struct { + XMLName string `xml:"tds:SetRemoteUser"` + RemoteUser onvif.RemoteUser `xml:"tds:RemoteUser"` +} + +type SetRemoteUserResponse struct { +} + +type GetUsers struct { + XMLName string `xml:"tds:GetUsers"` +} + +type GetUsersResponse struct { + User []onvif.User +} + +// CreateUsers and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl#op.CreateUsers +type CreateUsers struct { + XMLName string `xml:"tds:CreateUsers"` + User []onvif.UserRequest `xml:"tds:User,omitempty"` +} + +type CreateUsersResponse struct { +} + +// DeleteUsers and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl#op.DeleteUsers +type DeleteUsers struct { + XMLName xsd.String `xml:"tds:DeleteUsers"` + Username []xsd.String `xml:"tds:Username"` +} + +type DeleteUsersResponse struct { +} + +// SetUser and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/device/wsdl/devicemgmt.wsdl#op.SetUser +type SetUser struct { + XMLName string `xml:"tds:SetUser"` + User []onvif.UserRequest `xml:"tds:User"` +} + +type SetUserResponse struct { +} + +type GetWsdlUrl struct { + XMLName string `xml:"tds:GetWsdlUrl"` +} + +type GetWsdlUrlResponse struct { + WsdlUrl xsd.AnyURI +} + +type GetCapabilities struct { + XMLName string `xml:"tds:GetCapabilities"` + Category []onvif.CapabilityCategory `xml:"tds:Category"` +} + +type GetCapabilitiesResponse struct { + Capabilities onvif.Capabilities +} + +type GetHostname struct { + XMLName string `xml:"tds:GetHostname"` +} + +type GetHostnameResponse struct { + HostnameInformation onvif.HostnameInformation +} + +type SetHostname struct { + XMLName string `xml:"tds:SetHostname"` + Name xsd.Token `xml:"tds:Name"` +} + +type SetHostnameResponse struct { +} + +type SetHostnameFromDHCP struct { + XMLName string `xml:"tds:SetHostnameFromDHCP"` + FromDHCP xsd.Boolean `xml:"tds:FromDHCP"` +} + +type SetHostnameFromDHCPResponse struct { + RebootNeeded xsd.Boolean +} + +type GetDNS struct { + XMLName string `xml:"tds:GetDNS"` +} + +type GetDNSResponse struct { + DNSInformation onvif.DNSInformation +} + +type SetDNS struct { + XMLName string `xml:"tds:SetDNS"` + FromDHCP *xsd.Boolean `xml:"tds:FromDHCP,omitempty"` + SearchDomain *xsd.Token `xml:"tds:SearchDomain,omitempty"` + DNSManual *onvif.IPAddress `xml:"tds:DNSManual,omitempty"` +} + +type SetDNSResponse struct { +} + +type GetNTP struct { + XMLName string `xml:"tds:GetNTP"` +} + +type GetNTPResponse struct { + NTPInformation onvif.NTPInformation +} + +type SetNTP struct { + XMLName string `xml:"tds:SetNTP"` + FromDHCP xsd.Boolean `xml:"tds:FromDHCP"` + NTPManual onvif.NetworkHost `xml:"tds:NTPManual"` +} + +type SetNTPResponse struct { +} + +type GetDynamicDNS struct { + XMLName string `xml:"tds:GetDynamicDNS"` +} + +type GetDynamicDNSResponse struct { + DynamicDNSInformation onvif.DynamicDNSInformation +} + +type SetDynamicDNS struct { + XMLName string `xml:"tds:SetDynamicDNS"` + Type onvif.DynamicDNSType `xml:"tds:Type"` + Name onvif.DNSName `xml:"tds:Name"` + TTL xsd.Duration `xml:"tds:TTL"` +} + +type SetDynamicDNSResponse struct { +} + +type GetNetworkInterfaces struct { + XMLName string `xml:"tds:GetNetworkInterfaces"` +} + +type GetNetworkInterfacesResponse struct { + NetworkInterfaces onvif.NetworkInterface +} + +type SetNetworkInterfaces struct { + XMLName string `xml:"tds:SetNetworkInterfaces"` + InterfaceToken *onvif.ReferenceToken `xml:"tds:InterfaceToken,omitempty"` + NetworkInterface *onvif.NetworkInterfaceSetConfiguration `xml:"tds:NetworkInterface,omitempty"` +} + +type SetNetworkInterfacesResponse struct { + RebootNeeded xsd.Boolean +} + +type GetNetworkProtocols struct { + XMLName string `xml:"tds:GetNetworkProtocols"` +} + +type GetNetworkProtocolsResponse struct { + NetworkProtocols []onvif.NetworkProtocolResponse +} + +type SetNetworkProtocols struct { + XMLName string `xml:"tds:SetNetworkProtocols"` + NetworkProtocols []onvif.NetworkProtocolRequest `xml:"tds:NetworkProtocols"` +} + +type SetNetworkProtocolsResponse struct { +} + +type GetNetworkDefaultGateway struct { + XMLName string `xml:"tds:GetNetworkDefaultGateway"` +} + +type GetNetworkDefaultGatewayResponse struct { + NetworkGateway onvif.NetworkGateway +} + +type SetNetworkDefaultGateway struct { + XMLName string `xml:"tds:SetNetworkDefaultGateway"` + IPv4Address onvif.IPv4Address `xml:"tds:IPv4Address,omitempty"` + IPv6Address onvif.IPv6Address `xml:"tds:IPv6Address,omitempty"` +} + +type SetNetworkDefaultGatewayResponse struct { +} + +type GetZeroConfiguration struct { + XMLName string `xml:"tds:GetZeroConfiguration"` +} + +type GetZeroConfigurationResponse struct { + ZeroConfiguration onvif.NetworkZeroConfiguration +} + +type SetZeroConfiguration struct { + XMLName string `xml:"tds:SetZeroConfiguration"` + InterfaceToken onvif.ReferenceToken `xml:"tds:InterfaceToken"` + Enabled xsd.Boolean `xml:"tds:Enabled"` +} + +type SetZeroConfigurationResponse struct { +} + +type GetIPAddressFilter struct { + XMLName string `xml:"tds:GetIPAddressFilter"` +} + +type GetIPAddressFilterResponse struct { + IPAddressFilter onvif.IPAddressFilter +} + +type SetIPAddressFilter struct { + XMLName string `xml:"tds:SetIPAddressFilter"` + IPAddressFilter onvif.IPAddressFilter `xml:"tds:IPAddressFilter"` +} + +type SetIPAddressFilterResponse struct { +} + +// This operation adds an IP filter address to a device. +// If the device supports device access control based on +// IP filtering rules (denied or accepted ranges of IP addresses), +// the device shall support adding of IP filtering addresses through +// the AddIPAddressFilter command. +type AddIPAddressFilter struct { + XMLName string `xml:"tds:AddIPAddressFilter"` + IPAddressFilter onvif.IPAddressFilter `xml:"tds:IPAddressFilter"` +} + +type AddIPAddressFilterResponse struct { +} + +type RemoveIPAddressFilter struct { + XMLName string `xml:"tds:RemoveIPAddressFilter"` + IPAddressFilter onvif.IPAddressFilter `xml:"IPAddressFilter"` +} + +type RemoveIPAddressFilterResponse struct { +} + +type GetAccessPolicy struct { + XMLName string `xml:"tds:GetAccessPolicy"` +} + +type GetAccessPolicyResponse struct { + PolicyFile onvif.BinaryData +} + +type SetAccessPolicy struct { + XMLName string `xml:"tds:SetAccessPolicy"` + PolicyFile onvif.BinaryData `xml:"tds:PolicyFile"` +} + +type SetAccessPolicyResponse struct { +} + +type CreateCertificate struct { + XMLName string `xml:"tds:CreateCertificate"` + CertificateID xsd.Token `xml:"tds:CertificateID,omitempty"` + Subject string `xml:"tds:Subject,omitempty"` + ValidNotBefore xsd.DateTime `xml:"tds:ValidNotBefore,omitempty"` + ValidNotAfter xsd.DateTime `xml:"tds:ValidNotAfter,omitempty"` +} + +type CreateCertificateResponse struct { + NvtCertificate onvif.Certificate +} + +type GetCertificates struct { + XMLName string `xml:"tds:GetCertificates"` +} + +type GetCertificatesResponse struct { + NvtCertificate onvif.Certificate +} + +type GetCertificatesStatus struct { + XMLName string `xml:"tds:GetCertificatesStatus"` +} + +type GetCertificatesStatusResponse struct { + CertificateStatus onvif.CertificateStatus +} + +type SetCertificatesStatus struct { + XMLName string `xml:"tds:SetCertificatesStatus"` + CertificateStatus onvif.CertificateStatus `xml:"tds:CertificateStatus"` +} + +type SetCertificatesStatusResponse struct { +} + +// TODO: List of CertificateID +type DeleteCertificates struct { + XMLName string `xml:"tds:DeleteCertificates"` + CertificateID xsd.Token `xml:"tds:CertificateID"` +} + +type DeleteCertificatesResponse struct { +} + +// TODO: Откуда onvif:data = cid:21312413412 +type GetPkcs10Request struct { + XMLName string `xml:"tds:GetPkcs10Request"` + CertificateID xsd.Token `xml:"tds:CertificateID"` + Subject xsd.String `xml:"tds:Subject"` + Attributes onvif.BinaryData `xml:"tds:Attributes"` +} + +type GetPkcs10RequestResponse struct { + Pkcs10Request onvif.BinaryData +} + +// TODO: one or more NTVCertificate +type LoadCertificates struct { + XMLName string `xml:"tds:LoadCertificates"` + NVTCertificate onvif.Certificate `xml:"tds:NVTCertificate"` +} + +type LoadCertificatesResponse struct { +} + +type GetClientCertificateMode struct { + XMLName string `xml:"tds:GetClientCertificateMode"` +} + +type GetClientCertificateModeResponse struct { + Enabled xsd.Boolean +} + +type SetClientCertificateMode struct { + XMLName string `xml:"tds:SetClientCertificateMode"` + Enabled xsd.Boolean `xml:"tds:Enabled"` +} + +type SetClientCertificateModeResponse struct { +} + +type GetRelayOutputs struct { + XMLName string `xml:"tds:GetRelayOutputs"` +} + +type GetRelayOutputsResponse struct { + RelayOutputs onvif.RelayOutput +} + +type SetRelayOutputSettings struct { + XMLName string `xml:"tds:SetRelayOutputSettings"` + RelayOutputToken onvif.ReferenceToken `xml:"tds:RelayOutputToken"` + Properties onvif.RelayOutputSettings `xml:"tds:Properties"` +} + +type SetRelayOutputSettingsResponse struct { +} + +type SetRelayOutputState struct { + XMLName string `xml:"tds:SetRelayOutputState"` + RelayOutputToken onvif.ReferenceToken `xml:"tds:RelayOutputToken"` + LogicalState onvif.RelayLogicalState `xml:"tds:LogicalState"` +} + +type SetRelayOutputStateResponse struct { +} + +type SendAuxiliaryCommand struct { + XMLName string `xml:"tds:SendAuxiliaryCommand"` + AuxiliaryCommand onvif.AuxiliaryData `xml:"tds:AuxiliaryCommand"` +} + +type SendAuxiliaryCommandResponse struct { + AuxiliaryCommandResponse onvif.AuxiliaryData +} + +type GetCACertificates struct { + XMLName string `xml:"tds:GetCACertificates"` +} + +type GetCACertificatesResponse struct { + CACertificate onvif.Certificate +} + +// TODO: one or more CertificateWithPrivateKey +type LoadCertificateWithPrivateKey struct { + XMLName string `xml:"tds:LoadCertificateWithPrivateKey"` + CertificateWithPrivateKey onvif.CertificateWithPrivateKey `xml:"tds:CertificateWithPrivateKey"` +} + +type LoadCertificateWithPrivateKeyResponse struct { +} + +type GetCertificateInformation struct { + XMLName string `xml:"tds:GetCertificateInformation"` + CertificateID xsd.Token `xml:"tds:CertificateID"` +} + +type GetCertificateInformationResponse struct { + CertificateInformation onvif.CertificateInformation +} + +type LoadCACertificates struct { + XMLName string `xml:"tds:LoadCACertificates"` + CACertificate onvif.Certificate `xml:"tds:CACertificate"` +} + +type LoadCACertificatesResponse struct { +} + +type CreateDot1XConfiguration struct { + XMLName string `xml:"tds:CreateDot1XConfiguration"` + Dot1XConfiguration onvif.Dot1XConfiguration `xml:"tds:Dot1XConfiguration"` +} + +type CreateDot1XConfigurationResponse struct { +} + +type SetDot1XConfiguration struct { + XMLName string `xml:"tds:SetDot1XConfiguration"` + Dot1XConfiguration onvif.Dot1XConfiguration `xml:"tds:Dot1XConfiguration"` +} + +type SetDot1XConfigurationResponse struct { +} + +type GetDot1XConfiguration struct { + XMLName string `xml:"tds:GetDot1XConfiguration"` + Dot1XConfigurationToken onvif.ReferenceToken `xml:"tds:Dot1XConfigurationToken"` +} + +type GetDot1XConfigurationResponse struct { + Dot1XConfiguration onvif.Dot1XConfiguration +} + +type GetDot1XConfigurations struct { + XMLName string `xml:"tds:GetDot1XConfigurations"` +} + +type GetDot1XConfigurationsResponse struct { + Dot1XConfiguration onvif.Dot1XConfiguration +} + +// TODO: Zero or more Dot1XConfigurationToken +type DeleteDot1XConfiguration struct { + XMLName string `xml:"tds:DeleteDot1XConfiguration"` + Dot1XConfigurationToken onvif.ReferenceToken `xml:"tds:Dot1XConfigurationToken"` +} + +type DeleteDot1XConfigurationResponse struct { +} + +type GetDot11Capabilities struct { + XMLName string `xml:"tds:GetDot11Capabilities"` +} + +type GetDot11CapabilitiesResponse struct { + Capabilities onvif.Dot11Capabilities +} + +type GetDot11Status struct { + XMLName string `xml:"tds:GetDot11Status"` + InterfaceToken onvif.ReferenceToken `xml:"tds:InterfaceToken"` +} + +type GetDot11StatusResponse struct { + Status onvif.Dot11Status +} + +type ScanAvailableDot11Networks struct { + XMLName string `xml:"tds:ScanAvailableDot11Networks"` + InterfaceToken onvif.ReferenceToken `xml:"tds:InterfaceToken"` +} + +type ScanAvailableDot11NetworksResponse struct { + Networks onvif.Dot11AvailableNetworks +} + +type GetSystemUris struct { + XMLName string `xml:"tds:GetSystemUris"` +} + +type GetSystemUrisResponse struct { + SystemLogUris onvif.SystemLogUriList + SupportInfoUri xsd.AnyURI + SystemBackupUri xsd.AnyURI + Extension xsd.AnyType +} + +type StartFirmwareUpgrade struct { + XMLName string `xml:"tds:StartFirmwareUpgrade"` +} + +type StartFirmwareUpgradeResponse struct { + UploadUri xsd.AnyURI + UploadDelay xsd.Duration + ExpectedDownTime xsd.Duration +} + +type StartSystemRestore struct { + XMLName string `xml:"tds:StartSystemRestore"` +} + +type StartSystemRestoreResponse struct { + UploadUri xsd.AnyURI + ExpectedDownTime xsd.Duration +} + +type GetStorageConfigurations struct { + XMLName string `xml:"tds:GetStorageConfigurations"` +} + +type GetStorageConfigurationsResponse struct { + StorageConfigurations []StorageConfiguration +} + +type CreateStorageConfiguration struct { + XMLName string `xml:"tds:CreateStorageConfiguration"` + StorageConfiguration StorageConfigurationData `xml:"tds:StorageConfiguration"` +} + +type CreateStorageConfigurationResponse struct { + Token onvif.ReferenceToken +} + +type GetStorageConfiguration struct { + XMLName string `xml:"tds:GetStorageConfiguration"` + Token onvif.ReferenceToken `xml:"tds:Token"` +} + +type GetStorageConfigurationResponse struct { + StorageConfiguration StorageConfiguration +} + +type SetStorageConfiguration struct { + XMLName string `xml:"tds:SetStorageConfiguration"` + StorageConfiguration struct { + Token xsd.String `xml:"token,attr"` + Data StorageConfigurationData `xml:"tds:Data"` + } `xml:"tds:StorageConfiguration"` +} + +type SetStorageConfigurationResponse struct { +} + +type DeleteStorageConfiguration struct { + XMLName string `xml:"tds:DeleteStorageConfiguration"` + Token onvif.ReferenceToken `xml:"tds:Token"` +} + +type DeleteStorageConfigurationResponse struct { +} + +type GetGeoLocation struct { + XMLName string `xml:"tds:GetGeoLocation"` +} + +type GetGeoLocationResponse struct { + Location onvif.LocationEntity +} + +// TODO: one or more Location +type SetGeoLocation struct { + XMLName string `xml:"tds:SetGeoLocation"` + Location onvif.LocationEntity `xml:"tds:Location"` +} + +type SetGeoLocationResponse struct { +} + +type DeleteGeoLocation struct { + XMLName string `xml:"tds:DeleteGeoLocation"` + Location onvif.LocationEntity `xml:"tds:Location"` +} + +type DeleteGeoLocationResponse struct { +} diff --git a/digestclient.go b/digestclient.go new file mode 100644 index 00000000..b11457e8 --- /dev/null +++ b/digestclient.go @@ -0,0 +1,111 @@ +package onvif + +import ( + "crypto/md5" + "crypto/rand" + "encoding/hex" + "fmt" + "io" + "net/http" + "strings" +) + +// DigestClient represents an HTTP client used for making requests authenticated +// with http digest authentication. +type DigestClient struct { + client *http.Client + username string + password string + snonce string + realm string + qop string + nonceCount uint32 +} + +// NewDigestClient returns a DigestClient that wraps a given standard library http Client with the given username and password +func NewDigestClient(stdClient *http.Client, username string, password string) *DigestClient { + return &DigestClient{ + client: stdClient, + username: username, + password: password, + } +} + +func (dc *DigestClient) Do(httpMethod string, endpoint string, soap string) (*http.Response, error) { + req, err := createHttpRequest(httpMethod, endpoint, soap) + if err != nil { + return nil, err + } + if dc.snonce != "" { + req.Header.Set("Authorization", dc.getDigestAuth(req.Method, req.URL.String())) + } + + // Attempt the request using the underlying client + resp, err := dc.client.Do(req) + if err != nil { + return nil, err + } + + if resp.StatusCode != http.StatusUnauthorized { + return resp, nil + } + + dc.getDigestParts(resp) + // We will need to return the response from another request, so defer a close on this one + defer resp.Body.Close() + + req, err = createHttpRequest(httpMethod, endpoint, soap) + if err != nil { + return nil, err + } + req.Header.Set("Authorization", dc.getDigestAuth(req.Method, req.URL.String())) + + authedResp, err := dc.client.Do(req) + if err != nil { + return nil, err + } + return authedResp, nil +} + +func (dc *DigestClient) getDigestParts(resp *http.Response) { + result := map[string]string{} + authHeader := resp.Header.Get("WWW-Authenticate") + if len(authHeader) > 0 { + wantedHeaders := []string{"nonce", "realm", "qop"} + responseHeaders := strings.Split(authHeader, ",") + for _, r := range responseHeaders { + for _, w := range wantedHeaders { + if strings.Contains(r, w) { + result[w] = strings.Split(r, `"`)[1] + } + } + } + } + dc.snonce = result["nonce"] + dc.realm = result["realm"] + dc.qop = result["qop"] + dc.nonceCount = 0 +} + +func getMD5(text string) string { + hasher := md5.New() + hasher.Write([]byte(text)) + return hex.EncodeToString(hasher.Sum(nil)) +} + +func getCnonce() string { + b := make([]byte, 8) + io.ReadFull(rand.Reader, b) + return fmt.Sprintf("%x", b)[:16] +} + +func (dc *DigestClient) getDigestAuth(method string, uri string) string { + ha1 := getMD5(dc.username + ":" + dc.realm + ":" + dc.password) + ha2 := getMD5(method + ":" + uri) + cnonce := getCnonce() + dc.nonceCount++ + response := getMD5(fmt.Sprintf("%s:%s:%v:%s:%s:%s", ha1, dc.snonce, dc.nonceCount, cnonce, dc.qop, ha2)) + authorization := fmt.Sprintf(`Digest username="%s", realm="%s", nonce="%s", uri="%s", cnonce="%s", nc="%v", qop="%s", response="%s"`, + dc.username, dc.realm, dc.snonce, uri, cnonce, dc.nonceCount, dc.qop, response) + return authorization +} diff --git a/doc.go b/doc.go index 0f47715e..0bf16798 100644 --- a/doc.go +++ b/doc.go @@ -1,2 +1,2 @@ -//Package onvif is developed to provide an ONVIF client implementation on Go programming language +// Package onvif is developed to provide an ONVIF client implementation on Go programming language package onvif diff --git a/docs/Development.md b/docs/Development.md new file mode 100644 index 00000000..4d5cdaf7 --- /dev/null +++ b/docs/Development.md @@ -0,0 +1,34 @@ +# Development + +## Onvif Command Support +Each of the following Onvif Web services has its own directory: +- [Analytics](../analytics) +- [Device](../device) +- [Event](../event) +- [Imaging](../imaging) +- [Media](../media) +- [Media2](../media2) +- [PTZ](../ptz) + +Inside each directory there is: +- `types.go`: contains the struct definitions for each onvif command and response +- `function.go`: contains the auto-generated types that implement the `Function` interface providing `Request()` and `Response()` type mappings. + +At the root level there is: +- [names.go](../names.go): contains the auto-generated constant names of all the commands +- [mappings.go](../mappings.go): contains the auto-generated mappings for each Onvif WebService from function name to function datatype + + +### Adding support for additional commands +> **Note:** Currently, the python script looks for types that end with `Response` and work backwards from there. +> This is to prevent creating commands for every struct type defined there, and only the ones that are actually commands. +> It also skips any types ending with `FaultResponse`, as there typically are no `Fault` commands, only responses. + +For the respective web service the command belongs to, add the command and response struct definitions +into `/types.go`, and then run: +```shell +python3 python/gen_commands.py +``` + +> **Note:** You can also typically run the generator within your IDE thanks to the `//go:generate` lines +> towards the top of the `types.go` files. diff --git a/event/function.go b/event/function.go new file mode 100644 index 00000000..729bf07d --- /dev/null +++ b/event/function.go @@ -0,0 +1,99 @@ +// -*- Mode: Go; indent-tabs-mode: t -*- +// +// Copyright (C) 2022 Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by gen_commands.py DO NOT EDIT. + +package event + +type CreatePullPointSubscriptionFunction struct{} + +func (_ *CreatePullPointSubscriptionFunction) Request() interface{} { + return &CreatePullPointSubscription{} +} +func (_ *CreatePullPointSubscriptionFunction) Response() interface{} { + return &CreatePullPointSubscriptionResponse{} +} + +type GetEventPropertiesFunction struct{} + +func (_ *GetEventPropertiesFunction) Request() interface{} { + return &GetEventProperties{} +} +func (_ *GetEventPropertiesFunction) Response() interface{} { + return &GetEventPropertiesResponse{} +} + +type GetServiceCapabilitiesFunction struct{} + +func (_ *GetServiceCapabilitiesFunction) Request() interface{} { + return &GetServiceCapabilities{} +} +func (_ *GetServiceCapabilitiesFunction) Response() interface{} { + return &GetServiceCapabilitiesResponse{} +} + +type PullMessagesFunction struct{} + +func (_ *PullMessagesFunction) Request() interface{} { + return &PullMessages{} +} +func (_ *PullMessagesFunction) Response() interface{} { + return &PullMessagesResponse{} +} + +type RenewFunction struct{} + +func (_ *RenewFunction) Request() interface{} { + return &Renew{} +} +func (_ *RenewFunction) Response() interface{} { + return &RenewResponse{} +} + +type SeekFunction struct{} + +func (_ *SeekFunction) Request() interface{} { + return &Seek{} +} +func (_ *SeekFunction) Response() interface{} { + return &SeekResponse{} +} + +type SetSynchronizationPointFunction struct{} + +func (_ *SetSynchronizationPointFunction) Request() interface{} { + return &SetSynchronizationPoint{} +} +func (_ *SetSynchronizationPointFunction) Response() interface{} { + return &SetSynchronizationPointResponse{} +} + +type SubscribeFunction struct{} + +func (_ *SubscribeFunction) Request() interface{} { + return &Subscribe{} +} +func (_ *SubscribeFunction) Response() interface{} { + return &SubscribeResponse{} +} + +type SubscriptionReferenceFunction struct{} + +func (_ *SubscriptionReferenceFunction) Request() interface{} { + return &SubscriptionReference{} +} +func (_ *SubscriptionReferenceFunction) Response() interface{} { + return &SubscriptionReferenceResponse{} +} + +type UnsubscribeFunction struct{} + +func (_ *UnsubscribeFunction) Request() interface{} { + return &Unsubscribe{} +} +func (_ *UnsubscribeFunction) Response() interface{} { + return &UnsubscribeResponse{} +} diff --git a/event/operation.go b/event/operation.go deleted file mode 100644 index 408a2a10..00000000 --- a/event/operation.go +++ /dev/null @@ -1,130 +0,0 @@ -package event - -import ( - "github.com/kerberos-io/onvif/xsd" -) - -//GetServiceCapabilities action -type GetServiceCapabilities struct { - XMLName string `xml:"tev:GetServiceCapabilities"` -} - -//GetServiceCapabilitiesResponse type -type GetServiceCapabilitiesResponse struct { - Capabilities Capabilities -} - -//SubscriptionPolicy action -type SubscriptionPolicy struct { //tev http://www.onvif.org/ver10/events/wsdl - ChangedOnly xsd.Boolean `xml:"ChangedOnly,attr"` -} - -//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 AbsoluteOrRelativeTimeType `xml:"wsnt:InitialTerminationTime"` -} - -//SubscribeResponse message for subscribe event topic -type SubscribeResponse struct { //http://docs.oasis-open.org/wsn/b-2.xsd - SubscriptionReference EndpointReferenceType - CurrentTime CurrentTime - TerminationTime TerminationTime -} - -//Renew action for refresh event topic subscription -type Renew struct { //http://docs.oasis-open.org/wsn/b-2.xsd - TerminationTime AbsoluteOrRelativeTimeType `xml:"wsnt:TerminationTime"` -} - -//RenewResponse for Renew action -type RenewResponse struct { //http://docs.oasis-open.org/wsn/b-2.xsd - TerminationTime TerminationTime `xml:"wsnt:TerminationTime"` - CurrentTime CurrentTime `xml:"wsnt:CurrentTime"` -} - -//Unsubscribe action for Unsubscribe event topic -type Unsubscribe struct { //http://docs.oasis-open.org/wsn/b-2.xsd - Any string -} - -//UnsubscribeResponse message for Unsubscribe event topic -type UnsubscribeResponse struct { //http://docs.oasis-open.org/wsn/b-2.xsd - Any string -} - -//CreatePullPointSubscription action -type CreatePullPointSubscription struct { - XMLName string `xml:"tev:CreatePullPointSubscription"` - Filter FilterType `xml:"tev:Filter"` - InitialTerminationTime AbsoluteOrRelativeTimeType `xml:"wsnt:InitialTerminationTime"` - SubscriptionPolicy SubscriptionPolicy `xml:"wsnt:sSubscriptionPolicy"` -} - -//CreatePullPointSubscriptionResponse action -type CreatePullPointSubscriptionResponse struct { - SubscriptionReference EndpointReferenceType - CurrentTime CurrentTime - TerminationTime TerminationTime -} - -//GetEventProperties action -type GetEventProperties struct { - XMLName string `xml:"tev:GetEventProperties"` -} - -//GetEventPropertiesResponse action -type GetEventPropertiesResponse struct { - TopicNamespaceLocation xsd.AnyURI - FixedTopicSet FixedTopicSet - TopicSet TopicSet - TopicExpressionDialect TopicExpressionDialect - MessageContentFilterDialect xsd.AnyURI - ProducerPropertiesFilterDialect xsd.AnyURI - MessageContentSchemaLocation xsd.AnyURI -} - -//Port type PullPointSubscription - -//PullMessages Action -type PullMessages struct { - XMLName string `xml:"tev:PullMessages"` - Timeout xsd.Duration `xml:"tev:Timeout"` - MessageLimit xsd.Int `xml:"tev:MessageLimit"` -} - -//PullMessagesResponse response type -type PullMessagesResponse struct { - CurrentTime CurrentTime - TerminationTime TerminationTime - NotificationMessage NotificationMessage -} - -//PullMessagesFaultResponse response type -type PullMessagesFaultResponse struct { - MaxTimeout xsd.Duration - MaxMessageLimit xsd.Int -} - -//Seek action -type Seek struct { - XMLName string `xml:"tev:Seek"` - UtcTime xsd.DateTime `xml:"tev:UtcTime"` - Reverse xsd.Boolean `xml:"tev:Reverse"` -} - -//SeekResponse action -type SeekResponse struct { -} - -//SetSynchronizationPoint action -type SetSynchronizationPoint struct { - XMLName string `xml:"tev:SetSynchronizationPoint"` -} - -//SetSynchronizationPointResponse action -type SetSynchronizationPointResponse struct { -} diff --git a/event/topic/description.go b/event/topic/description.go new file mode 100644 index 00000000..cf50664f --- /dev/null +++ b/event/topic/description.go @@ -0,0 +1,22 @@ +package topic + +import "github.com/kerberos-io/onvif/xsd" + +type MessageDescription struct { + IsProperty xsd.Boolean `xml:"IsProperty,attr"` + Source Source `json:",omitempty" xml:",omitempty"` + Data Data `json:",omitempty" xml:",omitempty"` +} + +type Source struct { + SimpleItemDescription []SimpleItemDescription `json:",omitempty" xml:",omitempty"` +} + +type Data struct { + SimpleItemDescription []SimpleItemDescription `json:",omitempty" xml:",omitempty"` +} + +type SimpleItemDescription struct { + Name xsd.AnyType `xml:"Name,attr"` + Type xsd.AnyType `xml:"Type,attr"` +} diff --git a/event/topic/ruleengine.go b/event/topic/ruleengine.go new file mode 100644 index 00000000..b6c30309 --- /dev/null +++ b/event/topic/ruleengine.go @@ -0,0 +1,63 @@ +package topic + +import "github.com/kerberos-io/onvif/xsd" + +type RuleEngine struct { + Topic *xsd.Boolean `xml:"topic,attr"` + MotionRegionDetector *MotionRegionDetector `json:",omitempty" xml:",omitempty"` + CellMotionDetector *CellMotionDetector `json:",omitempty" xml:",omitempty"` + TamperDetector *TamperDetector `json:",omitempty" xml:",omitempty"` + Recognition *Recognition `json:",omitempty" xml:",omitempty"` + CountAggregation *CountAggregation `json:",omitempty" xml:",omitempty"` +} + +type MotionRegionDetector struct { + Topic *xsd.Boolean `xml:"topic,attr"` + Motion *Motion `json:"Motion" xml:"Motion"` +} + +type CellMotionDetector struct { + Topic *xsd.Boolean `xml:"topic,attr"` + Motion *Motion +} + +type Motion struct { + Topic *xsd.Boolean `xml:"topic,attr"` + MessageDescription *MessageDescription `json:",omitempty" xml:",omitempty"` +} + +type TamperDetector struct { + Topic *xsd.Boolean `xml:"topic,attr"` + Tamper *Tamper +} + +type Tamper struct { + Topic *xsd.Boolean `xml:"topic,attr"` + MessageDescription *MessageDescription `json:",omitempty" xml:",omitempty"` +} + +type Recognition struct { + Topic *xsd.Boolean `xml:"topic,attr"` + Face *Face `json:",omitempty" xml:",omitempty"` + LicensePlate *Face `json:",omitempty" xml:",omitempty"` +} + +type Face struct { + Topic *xsd.Boolean `xml:"topic,attr"` + MessageDescription *MessageDescription `json:",omitempty" xml:",omitempty"` +} + +type LicensePlate struct { + Topic *xsd.Boolean `xml:"topic,attr"` + MessageDescription *MessageDescription `json:",omitempty" xml:",omitempty"` +} + +type CountAggregation struct { + Topic *xsd.Boolean `xml:"topic,attr"` + Counter *Counter `json:",omitempty" xml:",omitempty"` +} + +type Counter struct { + Topic *xsd.Boolean `xml:"topic,attr"` + MessageDescription *MessageDescription `json:",omitempty" xml:",omitempty"` +} diff --git a/event/type_test.go b/event/type_test.go new file mode 100644 index 00000000..a77c7789 --- /dev/null +++ b/event/type_test.go @@ -0,0 +1,92 @@ +package event + +import ( + "encoding/xml" + "testing" + + "github.com/kerberos-io/onvif/xsd" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +var eventPropertiesData = []byte(` + + http://www.onvif.org/onvif/ver10/topics/topicns.xml + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + http://www.onvif.org/ver10/tev/messageContentFilter/ItemFilter + http://www.onvif.org/onvif/ver10/schema/onvif.xsd + +`) + +var eventRenewResponse = []byte(` + + 2023-11-25T18:08:15Z + 2023-11-24T14:50:25Z + +`) + +func TestEventPropertiesUnmarshalXML(t *testing.T) { + res := GetEventPropertiesResponse{} + err := xml.Unmarshal(eventPropertiesData, &res) + require.NoError(t, err) + assert.Equal(t, FixedTopicSet(true), *res.FixedTopicSet) + assert.Equal(t, xsd.AnyURI("http://www.onvif.org/ver10/tev/messageContentFilter/ItemFilter"), *res.MessageContentFilterDialect) + assert.Equal(t, xsd.AnyURI("http://www.onvif.org/onvif/ver10/schema/onvif.xsd"), *res.MessageContentSchemaLocation) + userAlarm, exists := map[string]interface{}(*res.TopicSet)["tns1:UserAlarm"] + assert.True(t, exists) + _, exists = (userAlarm).(map[string]interface{})["tnshik:IllegalAccess"] + assert.True(t, exists) + ruleEngine, exists := map[string]interface{}(*res.TopicSet)["tns1:RuleEngine"] + assert.True(t, exists) + tamperDetector, exists := (ruleEngine).(map[string]interface{})["TamperDetector"] + assert.True(t, exists) + tamper, exists := (tamperDetector).(map[string]interface{})["Tamper"] + assert.True(t, exists) + _, exists = (tamper).(map[string]interface{})["tt:MessageDescription"] + assert.True(t, exists) +} + +func TestRenewFunction_Response(t *testing.T) { + res := RenewResponse{} + err := xml.Unmarshal(eventRenewResponse, &res) + require.NoError(t, err) + assert.NotNil(t, res.TerminationTime) + assert.NotNil(t, res.CurrentTime) + assert.Equal(t, xsd.String("2023-11-25T18:08:15Z"), *res.TerminationTime) + assert.Equal(t, xsd.String("2023-11-24T14:50:25Z"), *res.CurrentTime) +} diff --git a/event/types.go b/event/types.go index 745080b3..a82e5967 100644 --- a/event/types.go +++ b/event/types.go @@ -1,8 +1,15 @@ package event +//go:generate python3 ../python/gen_commands.py + import ( + "encoding/xml" + "fmt" + "reflect" + + mv "github.com/clbanning/mxj/v2" + "github.com/kerberos-io/onvif/event/topic" "github.com/kerberos-io/onvif/xsd" - "github.com/kerberos-io/onvif/xsd/onvif" ) // Address Alias @@ -10,10 +17,8 @@ type Address xsd.String // CurrentTime alias type CurrentTime xsd.DateTime //wsnt http://docs.oasis-open.org/wsn/b-2.xsd - // TerminationTime alias type TerminationTime xsd.DateTime //wsnt http://docs.oasis-open.org/wsn/b-2.xsd - // FixedTopicSet alias type FixedTopicSet xsd.Boolean //wsnt http://docs.oasis-open.org/wsn/b-2.xsd @@ -26,18 +31,6 @@ type TopicExpressionDialect xsd.AnyURI // Message alias type Message xsd.AnyType -// MessageNotification alias -type MessageNotification struct { - Message MessageNotificationHolderType -} - -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 @@ -45,22 +38,25 @@ type ActionType AttributedURIType type AttributedURIType xsd.AnyURI //wsa https://www.w3.org/2005/08/addressing/ws-addr.xsd // AbsoluteOrRelativeTimeType -type AbsoluteOrRelativeTimeType xsd.AnySimpleType //wsnt http://docs.oasis-open.org/wsn/b-2.xsd +type AbsoluteOrRelativeTimeType struct { //wsnt http://docs.oasis-open.org/wsn/b-2.xsd + xsd.DateTime + xsd.Duration +} // EndpointReferenceType in ws-addr type EndpointReferenceType struct { //wsa http://www.w3.org/2005/08/addressing/ws-addr.xsd - Address AttributedURIType - ReferenceParameters ReferenceParametersType - Metadata MetadataType + Address AttributedURIType `xml:"wsa:Address"` + ReferenceParameters *ReferenceParametersType + Metadata *MetadataType `xml:"Metadata"` } // FilterType struct type FilterType struct { - TopicExpression TopicExpressionType `xml:"wsnt:TopicExpression"` - MessageContent QueryExpressionType `xml:"wsnt:MessageContent"` + TopicExpression *TopicExpressionType `xml:"wsnt:TopicExpression,omitempty"` + MessageContent *QueryExpressionType `xml:"wsnt:MessageContent,omitempty"` } -// EndpointReference alais +// EndpointReference alias type EndpointReference EndpointReferenceType // ReferenceParametersType in ws-addr @@ -78,12 +74,37 @@ type MetadataType struct { //wsa https://www.w3.org/2005/08/addressing/ws-addr.x } // TopicSet alias -type TopicSet TopicSetType //wstop http://docs.oasis-open.org/wsn/t-1.xsd +type TopicSet map[string]interface{} //wstop http://docs.oasis-open.org/wsn/t-1.xsd + +type Node struct { + XMLName xml.Name + Content []byte `xml:",innerxml"` +} + +func (n *TopicSet) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error { + node := Node{} + err := d.DecodeElement(&node, &start) + if err != nil { + return err + } + wrapper := "root" // The TopicSet is an array, we need to wrap with a tag for XML parsing + c := fmt.Sprintf("<%s>%s", wrapper, node.Content, wrapper) + result, err := mv.NewMapXmlSeq([]byte(c)) + if err != nil { + return err + } + if result[wrapper] != nil && reflect.ValueOf(result[wrapper]).Kind() == reflect.Map { + *n = (result[wrapper]).(map[string]interface{}) + } + return nil +} // TopicSetType alias type TopicSetType struct { //wstop http://docs.oasis-open.org/wsn/t-1.xsd - ExtensibleDocumented + //ExtensibleDocumented + //here can be any element + RuleEngine *topic.RuleEngine `json:"tns:RuleEngine,omitempty" xml:",omitempty"` } // ExtensibleDocumented struct @@ -103,7 +124,30 @@ type NotificationMessageHolderType struct { SubscriptionReference SubscriptionReference //wsnt http://docs.oasis-open.org/wsn/b-2.xsd Topic Topic ProducerReference ProducerReference - Message MessageNotification + Message MessageBody +} + +type MessageBody struct { + Message MessageDescription +} + +type MessageDescription struct { + PropertyOperation xsd.AnyType `xml:"PropertyOperation,attr"` + Source Source `json:",omitempty" xml:",omitempty"` + Data Data `json:",omitempty" xml:",omitempty"` +} + +type Source struct { + SimpleItem []SimpleItem `json:",omitempty" xml:",omitempty"` +} + +type Data struct { + SimpleItem []SimpleItem `json:",omitempty" xml:",omitempty"` +} + +type SimpleItem struct { + Name xsd.AnyType `xml:"Name,attr"` + Value xsd.AnyType `xml:"Value,attr"` } // NotificationMessage Alias @@ -111,7 +155,6 @@ type NotificationMessage NotificationMessageHolderType //wsnt http://docs.oasis- // 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") } @@ -123,7 +166,6 @@ type QueryExpression QueryExpressionType // 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"` } @@ -187,3 +229,143 @@ type NotifyMessageNotSupportedFault struct { // SubscribeCreationFailedFault response type type SubscribeCreationFailedFault struct { } + +// GetServiceCapabilities action +type GetServiceCapabilities struct { + XMLName string `xml:"tev:GetServiceCapabilities"` +} + +// GetServiceCapabilitiesResponse type +type GetServiceCapabilitiesResponse struct { + Capabilities Capabilities +} + +// SubscriptionPolicy action +type SubscriptionPolicy struct { //tev http://www.onvif.org/ver10/events/wsdl + ChangedOnly xsd.Boolean `xml:"ChangedOnly,attr"` + string +} + +// 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 *xsd.String `xml:"wsnt:SubscriptionPolicy"` + TerminationTime *xsd.String `xml:"wsnt:TerminationTime"` +} + +// SubscribeResponse message for subscribe event topic +type SubscribeResponse struct { //http://docs.oasis-open.org/wsn/b-2.xsd + SubscriptionReference SubscriptionReferenceResponse + CurrentTime *xsd.String + TerminationTime *xsd.String +} + +// Renew action for refresh event topic subscription +type Renew struct { //http://docs.oasis-open.org/wsn/b-2.xsd + XMLName string `xml:"wsnt:Renew"` + TerminationTime xsd.String `xml:"wsnt:TerminationTime"` +} + +// RenewResponse for Renew action +type RenewResponse struct { //http://docs.oasis-open.org/wsn/b-2.xsd + TerminationTime *xsd.String + CurrentTime *xsd.String +} + +// Unsubscribe action for Unsubscribe event topic +type Unsubscribe struct { //http://docs.oasis-open.org/wsn/b-2.xsd + XMLName string `xml:"tev:Unsubscribe"` + Any string +} + +// UnsubscribeResponse message for Unsubscribe event topic +type UnsubscribeResponse struct { //http://docs.oasis-open.org/wsn/b-2.xsd + Any string +} + +// CreatePullPointSubscription action +// BUG(r) Bad AbsoluteOrRelativeTimeType type +type CreatePullPointSubscription struct { + XMLName string `xml:"tev:CreatePullPointSubscription,omitempty"` + Filter *FilterType `xml:"tev:Filter,omitempty"` + InitialTerminationTime *xsd.String `xml:"tev:InitialTerminationTime,omitempty"` + SubscriptionPolicy *xsd.String `xml:"tev:SubscriptionPolicy,omitempty"` +} + +// CreatePullPointSubscriptionResponse action +type CreatePullPointSubscriptionResponse struct { + SubscriptionReference SubscriptionReferenceResponse + CurrentTime CurrentTime + TerminationTime TerminationTime +} + +type SubscriptionReferenceResponse struct { + Address AttributedURIType + ReferenceParameters *ReferenceParametersType + Metadata *MetadataType +} + +// GetEventProperties action +type GetEventProperties struct { + XMLName string `xml:"tev:GetEventProperties"` +} + +// GetEventPropertiesResponse action +type GetEventPropertiesResponse struct { + TopicNamespaceLocation *xsd.AnyURI `json:",omitempty" xml:",omitempty"` + FixedTopicSet *FixedTopicSet `json:",omitempty" xml:",omitempty"` + TopicSet *TopicSet `json:",omitempty" xml:",omitempty"` + TopicExpressionDialect *TopicExpressionDialect `json:",omitempty" xml:",omitempty"` + MessageContentFilterDialect *xsd.AnyURI `json:",omitempty" xml:",omitempty"` + ProducerPropertiesFilterDialect *xsd.AnyURI `json:",omitempty" xml:",omitempty"` + MessageContentSchemaLocation *xsd.AnyURI `json:",omitempty" xml:",omitempty"` +} + +//Port type PullPointSubscription + +// PullMessages Action +type PullMessages struct { + XMLName string `xml:"tev:PullMessages"` + Timeout xsd.Duration `xml:"tev:Timeout"` + MessageLimit xsd.Int `xml:"tev:MessageLimit"` +} + +// PullMessagesResponse response type +type PullMessagesResponse struct { + CurrentTime *xsd.String `json:",omitempty" xml:",omitempty"` + TerminationTime *xsd.String `json:",omitempty" xml:",omitempty"` + NotificationMessage []NotificationMessage `json:",omitempty" xml:",omitempty"` +} + +// PullMessagesFaultResponse response type +type PullMessagesFaultResponse struct { + MaxTimeout xsd.Duration + MaxMessageLimit xsd.Int +} + +// Seek action +type Seek struct { + XMLName string `xml:"tev:Seek"` + UtcTime xsd.DateTime `xml:"tev:UtcTime"` + Reverse xsd.Boolean `xml:"tev:Reverse"` +} + +// SeekResponse action +type SeekResponse struct { +} + +// SetSynchronizationPoint action +type SetSynchronizationPoint struct { + XMLName string `xml:"tev:SetSynchronizationPoint"` +} + +// SetSynchronizationPointResponse action +type SetSynchronizationPointResponse struct { +} + +// Notify type +type Notify struct { + NotificationMessage []NotificationMessage `json:",omitempty" xml:",omitempty"` +} diff --git a/examples/DeviceService.go b/examples/DeviceService.go index 5bf6aa89..286a8208 100644 --- a/examples/DeviceService.go +++ b/examples/DeviceService.go @@ -1,14 +1,14 @@ package main import ( - "context" "fmt" + "io/ioutil" "log" "net/http" goonvif "github.com/kerberos-io/onvif" "github.com/kerberos-io/onvif/device" - sdk "github.com/kerberos-io/onvif/sdk/device" + "github.com/kerberos-io/onvif/gosoap" "github.com/kerberos-io/onvif/xsd/onvif" ) @@ -17,9 +17,15 @@ const ( password = "Supervisor" ) -func main() { - ctx := context.Background() +func readResponse(resp *http.Response) string { + b, err := ioutil.ReadAll(resp.Body) + if err != nil { + panic(err) + } + return string(b) +} +func main() { //Getting an camera instance dev, err := goonvif.NewDevice(goonvif.DeviceParams{ Xaddr: "192.168.13.14:80", @@ -32,36 +38,40 @@ func main() { } //Preparing commands + UserLevel := onvif.UserLevel("User") systemDateAndTyme := device.GetSystemDateAndTime{} - getCapabilities := device.GetCapabilities{Category: "All"} createUser := device.CreateUsers{ - User: onvif.User{ - Username: "TestUser", - Password: "TestPassword", - UserLevel: "User", + User: []onvif.UserRequest{ + { + Username: "TestUser", + Password: "TestPassword", + UserLevel: &UserLevel, + }, }, } //Commands execution - systemDateAndTymeResponse, err := sdk.Call_GetSystemDateAndTime(ctx, dev, systemDateAndTyme) + systemDateAndTymeResponse, err := dev.CallMethod(systemDateAndTyme) if err != nil { log.Println(err) } else { - fmt.Println(systemDateAndTymeResponse) + fmt.Println(readResponse(systemDateAndTymeResponse)) } - getCapabilitiesResponse, err := sdk.Call_GetCapabilities(ctx, dev, getCapabilities) + getCapabilities := device.GetCapabilities{Category: []onvif.CapabilityCategory{"All"}} + getCapabilitiesResponse, err := dev.CallMethod(getCapabilities) if err != nil { log.Println(err) } else { - fmt.Println(getCapabilitiesResponse) + fmt.Println(readResponse(getCapabilitiesResponse)) } - - createUserResponse, err := sdk.Call_CreateUsers(ctx, dev, createUser) + createUserResponse, err := dev.CallMethod(createUser) if err != nil { log.Println(err) } else { - // You could use https://github.com/kerberos-io/onvif/gosoap for pretty printing response - fmt.Println(createUserResponse) + /* + You could use https://github.com/kerberos-io/onvif/gosoap for pretty printing response + */ + fmt.Println(gosoap.SoapMessage(readResponse(createUserResponse)).StringIndent()) } } diff --git a/examples/analytic/getanalyticsconfigurations/main.go b/examples/analytic/getanalyticsconfigurations/main.go new file mode 100644 index 00000000..7dea23cb --- /dev/null +++ b/examples/analytic/getanalyticsconfigurations/main.go @@ -0,0 +1,28 @@ +package main + +import ( + "github.com/kerberos-io/onvif" + "github.com/kerberos-io/onvif/media2" + "io/ioutil" + "log" +) + +func main() { + dev, err := onvif.NewDevice(onvif.DeviceParams{ + Xaddr: "192.168.12.148", // BOSCH + Username: "administrator", + Password: "Password1!", + AuthMode: onvif.UsernameTokenAuth, + }) + if err != nil { + log.Fatalln("fail to new device:", err) + } + + res, err := dev.CallMethod(media2.GetAnalyticsConfigurations{}) + if err != nil { + log.Fatalln("fail to CallMethod:", err) + } + bs, _ := ioutil.ReadAll(res.Body) + + log.Printf(">> Result: %+v \n %s", res.StatusCode, bs) +} diff --git a/examples/analytic/getprofiles/main.go b/examples/analytic/getprofiles/main.go new file mode 100644 index 00000000..f5936028 --- /dev/null +++ b/examples/analytic/getprofiles/main.go @@ -0,0 +1,28 @@ +package main + +import ( + "github.com/kerberos-io/onvif" + "github.com/kerberos-io/onvif/media2" + "io/ioutil" + "log" +) + +func main() { + dev, err := onvif.NewDevice(onvif.DeviceParams{ + Xaddr: "192.168.12.148", // BOSCH + Username: "administrator", + Password: "Password1!", + AuthMode: onvif.UsernameTokenAuth, + }) + if err != nil { + log.Fatalln("fail to new device:", err) + } + + res, err := dev.CallMethod(media2.GetProfiles{}) + if err != nil { + log.Fatalln("fail to CallMethod:", err) + } + bs, _ := ioutil.ReadAll(res.Body) + + log.Printf(">> Result: %+v \n %s", res.StatusCode, bs) +} diff --git a/examples/discovery_test.go b/examples/discovery_test.go index e2bd1364..b2651b02 100644 --- a/examples/discovery_test.go +++ b/examples/discovery_test.go @@ -12,12 +12,16 @@ import ( "github.com/beevik/etree" "github.com/kerberos-io/onvif" "github.com/kerberos-io/onvif/device" - discover "github.com/kerberos-io/onvif/ws-discovery" + wsdiscovery "github.com/kerberos-io/onvif/ws-discovery" ) func TestGetAvailableDevicesAtSpecificEthernetInterface(t *testing.T) { - s, err := onvif.GetAvailableDevicesAtSpecificEthernetInterface("en0") - log.Printf("%v %v", err, s) + + // client() + // runDiscovery("en0") + s, _ := wsdiscovery.GetAvailableDevicesAtSpecificEthernetInterface("en0") + + log.Printf("%v", s) } func client() { @@ -28,7 +32,7 @@ func client() { log.Printf("output %+v", dev.GetServices()) - res, err := dev.CallMethod(device.GetUsers{}) + res, _ := dev.CallMethod(device.GetUsers{}) bs, _ := ioutil.ReadAll(res.Body) log.Printf("output %+v %s", res.StatusCode, bs) } @@ -41,11 +45,7 @@ type Host struct { func runDiscovery(interfaceName string) { var hosts []*Host - 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 - } + devices, _ := wsdiscovery.SendProbe(interfaceName, nil, []string{"dn:NetworkVideoTransmitter"}, map[string]string{"dn": "http://www.onvif.org/ver10/network/wsdl"}) for _, j := range devices { doc := etree.NewDocument() if err := doc.ReadFromString(j); err != nil { diff --git a/examples/event/createpullpoint/main.go b/examples/event/createpullpoint/main.go new file mode 100644 index 00000000..cced0e6d --- /dev/null +++ b/examples/event/createpullpoint/main.go @@ -0,0 +1,87 @@ +package main + +import ( + "github.com/kerberos-io/onvif" + "github.com/kerberos-io/onvif/event" + "github.com/kerberos-io/onvif/xsd" + "io/ioutil" + "log" +) + +// Geovision +// Request: +// +// PT120S +// +// Response: +// +// +// http://192.168.12.149:80/onvif/events +// +// 2021-12-02T02:02:15Z +// 2021-12-02T02:04:15Z +// +// +// Test Summary: +// 1. TerminationTime = CurrentTime+InitialTerminationTime +// 2. but always return http://192.168.12.149:80/onvif/events +// 3. We can pulling the event without creating the pull point, and the unsubscribe is not supported + +// BOSCH +// Request: +// +// PT1H +// +// Response: +// +// +// http://192.168.12.148/Web_Service?Idx=1 +// +// 2021-12-02T02:59:30Z +// 2021-12-02T03:00:30Z +// +// +// Test Summary +// 1. The TerminationTime always increase one minute +// 2. The SubscriptionReference Address will change when create another PullPoint + +// === Hikvision === +// Request: +// +// PT120S +// +// Response: +// +// +// http://192.168.12.123/onvif/Events/PullSubManager_2021-12-02T06:04:46Z_0 +// +// 2021-12-02T06:04:46Z +// 2021-12-02T06:06:46Z +// +// +// Test Summary: +// 1. TerminationTime = CurrentTime+InitialTerminationTime +// 2. The pull point will drop after exceeding the termination time + +func main() { + dev, err := onvif.NewDevice(onvif.DeviceParams{ + //Xaddr: "192.168.12.148", // BOSCH + //Xaddr: "192.168.12.149", // Geovision + Xaddr: "192.168.12.123", //Hikvision + Username: "administrator", + Password: "Password1!", + AuthMode: onvif.UsernameTokenAuth, + }) + if err != nil { + log.Fatalln("fail to new device:", err) + } + + initialTerminationTime := xsd.String("PT120S") + res, err := dev.CallMethod(event.CreatePullPointSubscription{InitialTerminationTime: &initialTerminationTime}) + if err != nil { + log.Fatalln("fail to CallMethod:", err) + } + bs, _ := ioutil.ReadAll(res.Body) + + log.Printf(">> Result: %+v \n %s", res.StatusCode, bs) +} diff --git a/examples/event/eventproperties/main.go b/examples/event/eventproperties/main.go new file mode 100644 index 00000000..f4fe0613 --- /dev/null +++ b/examples/event/eventproperties/main.go @@ -0,0 +1,28 @@ +package main + +import ( + "github.com/kerberos-io/onvif" + "github.com/kerberos-io/onvif/event" + "io/ioutil" + "log" +) + +func main() { + dev, err := onvif.NewDevice(onvif.DeviceParams{ + Xaddr: "192.168.12.148", // BOSCH + //Xaddr: "192.168.12.149", // Geovision + Username: "administrator", + Password: "Password1!", + }) + if err != nil { + log.Fatalln("fail to new device:", err) + } + // CreateUsers + res, err := dev.CallMethod(event.GetEventProperties{}) + if err != nil { + log.Fatalln("fail to CallMethod:", err) + } + bs, _ := ioutil.ReadAll(res.Body) + + log.Printf(">> Result: %+v \n %s", res.StatusCode, bs) +} diff --git a/examples/event/pullmessage/main.go b/examples/event/pullmessage/main.go new file mode 100644 index 00000000..d5d1eb5e --- /dev/null +++ b/examples/event/pullmessage/main.go @@ -0,0 +1,92 @@ +package main + +import ( + "encoding/xml" + "github.com/kerberos-io/onvif" + "github.com/kerberos-io/onvif/event" + "github.com/kerberos-io/onvif/xsd" + "io/ioutil" + "log" +) + +// === Geovision === +// Request: +// +// PT20S +// 10 +// +// Response: +// +// 2021-12-02T02:42:30Z +// 2021-12-02T02:42:50Z +// ... +// +// +// Test Summary: +// 1. the TerminationTime = CurrentTime+Timeout +// 2. even current time exceed the TerminationTime, the pull point still alive + +// === BOSCH === +// Request: +// +// PT20S +// 10 +// +// Response: +// +// 2021-12-02T03:06:39Z +// 2021-12-02T03:07:39Z +// ... +// +// +// Test Summary: +// the TerminationTime increase one minute + +// === Hikvisiion === +// Request: +// +// Response: +// 2021-12-02T06:08:35Z +// +// 2021-12-02T06:18:40Z +// tns1:RuleEngine/CellMotionDetector/Motion +// ... +// +// +// +// Test Summary: +// +// the TerminationTime increase ten minutes +func main() { + dev, err := onvif.NewDevice(onvif.DeviceParams{ + Xaddr: "192.168.12.148", // BOSCH + //Xaddr: "192.168.12.149", // Geovision + //Xaddr: "192.168.12.123", //Hikvision + Username: "administrator", + Password: "Password1!", + AuthMode: onvif.UsernameTokenAuth, + }) + if err != nil { + log.Fatalln("fail to new device:", err) + } + + pullMessage := event.PullMessages{ + Timeout: xsd.Duration("PT5S"), + MessageLimit: 10, + } + + endPoint := "http://192.168.12.148/Web_Service?Idx=0" // BOSCH + //endPoint := "http://192.168.12.149:80/onvif/events" // Geovision + //endPoint := "http://192.168.12.123/onvif/Events/PullSubManager_2021-12-02T06:07:58Z_0" + requestBody, err := xml.Marshal(pullMessage) + if err != nil { + log.Fatalln(err) + } + res, err := dev.SendSoap(endPoint, string(requestBody)) + if err != nil { + log.Fatalln("fail to CallMethod:", err) + } + bs, _ := ioutil.ReadAll(res.Body) + + log.Printf(">> Result: %+v \n %s", res.StatusCode, bs) +} diff --git a/examples/event/renew/main.go b/examples/event/renew/main.go new file mode 100644 index 00000000..4d2e5c6d --- /dev/null +++ b/examples/event/renew/main.go @@ -0,0 +1,94 @@ +package main + +import ( + "encoding/xml" + "github.com/kerberos-io/onvif" + "github.com/kerberos-io/onvif/event" + "github.com/kerberos-io/onvif/xsd" + "io/ioutil" + "log" +) + +// === Geovision === +// Request: +// +// PT20S +// 10 +// +// Response: +// +// 2021-12-02T02:42:30Z +// 2021-12-02T02:42:50Z +// ... +// +// +// Test Summary: +// 1. the TerminationTime = CurrentTime+Timeout +// 2. even current time exceed the TerminationTime, the pull point still alive + +// === BOSCH === +// Request: +// +// +// 2021-12-03T15:50:03Z +// +// +// Response: +// +// +// 2021-12-03T15:50:03Z +// +// +// 2021-12-02T03:36:04Z +// +// +// +// Test Summary: +// 1. the response's TerminationTime equal request's TerminationTime +// 2. But the subscription still live for one minute + +// === Hikvision === +// Request: +// 2021-12-02T18:30:53Z +// Response: +// +// 2021-12-02T18:30:53Z +// 2021-12-02T06:31:57Z +// +// +// Test Summary: +// 1. the subscription's termination time will update if the request's TerminationTime greater than the curren time + +func main() { + dev, err := onvif.NewDevice(onvif.DeviceParams{ + Xaddr: "192.168.12.148", // BOSCH + //Xaddr: "192.168.12.149", // Geovision + //Xaddr: "192.168.12.123", //Hikvision + Username: "administrator", + Password: "Password1!", + AuthMode: onvif.UsernameTokenAuth, + }) + if err != nil { + log.Fatalln("fail to new device:", err) + } + + terminationTime := xsd.String("PT120S") + renew := event.Renew{ + TerminationTime: terminationTime, + } + + endPoint := "http://192.168.12.148/Web_Service?Idx=0" // BOSCH + //endPoint := "http://192.168.12.149:80/onvif/events" // Geovision + //endPoint := "http://192.168.12.123:80/onvif/Events/SubManager__0" // Hikvision + requestBody, err := xml.Marshal(renew) + if err != nil { + log.Fatalln(err) + } + res, err := dev.SendSoap(endPoint, string(requestBody)) + if err != nil { + log.Fatalln("fail to CallMethod:", err) + } + bs, _ := ioutil.ReadAll(res.Body) + + log.Printf(">> Result: %+v \n %s", res.StatusCode, bs) +} diff --git a/examples/event/subscribe/main.go b/examples/event/subscribe/main.go new file mode 100644 index 00000000..69c079de --- /dev/null +++ b/examples/event/subscribe/main.go @@ -0,0 +1,110 @@ +package main + +import ( + "github.com/kerberos-io/onvif" + "github.com/kerberos-io/onvif/event" + "github.com/kerberos-io/onvif/xsd" + "io/ioutil" + "log" +) + +// === Geovision === +// Request: +// +// 2021-12-02T10:10:16Z +// +// Response: +// +// +// +// SOAP-ENV:Sender +// +// +// +// +// Validation constraint violation: invalid value in element 'wsnt:TerminationTime' +// +// +// +// +// Test Summary: +// 1. The time pattern 2021-12-02T10:20:15Z and PT1H not work and always return error +// 2. If not provide the time, camera return the error: ' fail to CallMethod: Post "http://192.168.12.149/onvif/events": net/http: HTTP/1.x transport connection broken: unexpected EOF' +// 3. Geovision might not support the BaseNotification + +// === BOSCH === +// Request: +// +// +// http://192.168.12.112:8080/ping +// +// +// 2021-12-01T15:50:03Z +// +// +// Response: +// +// +// http://192.168.12.148/Web_Service?Idx=1 +// +// 2021-12-02T03:21:13Z +// 2021-12-02T03:22:13Z +// +// +// Test Summary +// 1. The TerminationTime always increase one minute +// 2. The SubscriptionReference Address will change when create another PullPoint + +// Hikvision +// Request: +// +// +// http://192.168.12.112:8080/ping +// +// 2021-12-03T15:50:03Z +// +// Response: +// +// +// http:///onvif/Events/SubManager_2021-12-02T06:21:11Z_1 +// +// 2021-12-02T06:21:11Z +// 2021-12-02T06:22:11Z +// +// +// Test Summary +// 1. Regardless of the request's TerminationTime, the response TerminationTime always increase one minute +// 2. The SubscriptionReference Address will change when create another PullPoint +// 3. The response's reference address is invalid, renew request will fail + +func main() { + dev, err := onvif.NewDevice(onvif.DeviceParams{ + Xaddr: "192.168.12.148", // BOSCH + //Xaddr: "192.168.12.149", // Geovision + //Xaddr: "192.168.12.123", //Hikvision + Username: "administrator", + Password: "Password1!", + AuthMode: onvif.UsernameTokenAuth, + }) + if err != nil { + log.Fatalln("fail to new device:", err) + } + + consumerAddress := event.AttributedURIType("http://192.168.12.112:8080/ping") + //terminationTime:= xsd.String("2021-12-03T15:50:03Z") + terminationTime := xsd.String("PT180S") + res, err := dev.CallMethod(event.Subscribe{ + ConsumerReference: &event.EndpointReferenceType{ + Address: consumerAddress, + }, + TerminationTime: &terminationTime, + }, + ) + if err != nil { + log.Fatalln("fail to CallMethod:", err) + } + log.Printf(">> Status Code: %+v \n", res.StatusCode) + bs, _ := ioutil.ReadAll(res.Body) + + log.Printf(">> Result: %+v \n %s", res.StatusCode, bs) +} diff --git a/examples/event/unsubscribe/main.go b/examples/event/unsubscribe/main.go new file mode 100644 index 00000000..73d6f7b3 --- /dev/null +++ b/examples/event/unsubscribe/main.go @@ -0,0 +1,75 @@ +package main + +import ( + "encoding/xml" + "github.com/kerberos-io/onvif" + "github.com/kerberos-io/onvif/event" + "io/ioutil" + "log" +) + +// === Geovision === +// Request: +// +// Response: +// +// +// SOAP-ENV:Sender +// +// +// +// Method 'tev:Unsubscribe' not implemented: method name or namespace not recognized +// +// +// +// +// Test Summary: Geovision might not support unsubscribe + +// === BOSCH === +// Request: +// +// Response: +// +// SOAP-ENV:Receiverter:Action +// Action Failed +// http://www.w3.org/2003/05/soap-envelope/node/ultimateReceiverhttp://www.w3.org/2003/05/soap-envelope/node/ultimateReceiver +// +// +// Test Summary: BOSCH might not support unsubscribe + +// === Hikvision +// Request: +// +// Response: +// + +func main() { + dev, err := onvif.NewDevice(onvif.DeviceParams{ + //Xaddr: "192.168.12.148", // BOSCH + //Xaddr: "192.168.12.149", // Geovision + Xaddr: "192.168.12.123", //Hikvision + Username: "administrator", + Password: "Password1!", + AuthMode: onvif.UsernameTokenAuth, + }) + if err != nil { + log.Fatalln("fail to new device:", err) + } + + unsubscribe := event.Unsubscribe{} + + //endPoint:= "http://192.168.12.148/Web_Service?Idx=0" // BOSCH + //endPoint := "http://192.168.12.149:80/onvif/events" // Geovision + endPoint := "http://192.168.12.123/onvif/Events/PullSubManager_2021-12-02T06:13:45Z_0" // Hikvision + requestBody, err := xml.Marshal(unsubscribe) + if err != nil { + log.Fatalln(err) + } + res, err := dev.SendSoap(endPoint, string(requestBody)) + if err != nil { + log.Fatalln("fail to CallMethod:", err) + } + bs, _ := ioutil.ReadAll(res.Body) + + log.Printf(">> Result: %+v \n %s", res.StatusCode, bs) +} diff --git a/examples/getusers/main.go b/examples/getusers/main.go new file mode 100644 index 00000000..7b580841 --- /dev/null +++ b/examples/getusers/main.go @@ -0,0 +1,27 @@ +package main + +import ( + "github.com/kerberos-io/onvif" + "github.com/kerberos-io/onvif/device" + "io/ioutil" + "log" +) + +func main() { + dev, err := onvif.NewDevice(onvif.DeviceParams{ + Xaddr: "192.168.12.149", + Username: "administrator", + Password: "Password1!", + }) + if err != nil { + log.Fatalln("fail to new device:", err) + } + // CreateUsers + res, err := dev.CallMethod(device.GetUsers{}) + if err != nil { + log.Fatalln("fail to CallMethod:", err) + } + bs, _ := ioutil.ReadAll(res.Body) + + log.Printf(">> Result: %+v \n %s", res.StatusCode, bs) +} diff --git a/functionmap.go b/functionmap.go new file mode 100644 index 00000000..49718a26 --- /dev/null +++ b/functionmap.go @@ -0,0 +1,36 @@ +package onvif + +import ( + "fmt" +) + +func FunctionByServiceAndFunctionName(serviceName, functionName string) (Function, error) { + var functionMap map[string]Function + + switch serviceName { + case DeviceWebService: + functionMap = DeviceFunctionMap + case MediaWebService: + functionMap = MediaFunctionMap + case Media2WebService: + functionMap = Media2FunctionMap + case PTZWebService: + functionMap = PTZFunctionMap + case EventWebService: + functionMap = EventFunctionMap + case AnalyticsWebService: + functionMap = AnalyticsFunctionMap + case ImagingWebService: + functionMap = ImagingFunctionMap + case RecordingWebService: + functionMap = RecordingFunctionMap + default: + return nil, fmt.Errorf("the web service '%s' is not supported", serviceName) + } + + if function, found := functionMap[functionName]; !found { + return nil, fmt.Errorf("the web service '%s' does not support the function '%s'", serviceName, functionName) + } else { + return function, nil + } +} diff --git a/go.mod b/go.mod index 90e204e7..f9817515 100644 --- a/go.mod +++ b/go.mod @@ -1,13 +1,41 @@ module github.com/kerberos-io/onvif -go 1.15 +go 1.20 require ( - github.com/beevik/etree v1.1.0 + github.com/beevik/etree v1.2.0 + github.com/clbanning/mxj/v2 v2.7.0 github.com/elgs/gostrgen v0.0.0-20161222160715-9d61ae07eeae - github.com/gin-gonic/gin v1.7.0 - github.com/gofrs/uuid v3.2.0+incompatible - 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 + github.com/gin-gonic/gin v1.9.1 + github.com/google/uuid v1.4.0 + github.com/stretchr/testify v1.8.4 + golang.org/x/net v0.19.0 +) + +require ( + github.com/bytedance/sonic v1.9.1 // indirect + github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/gabriel-vasile/mimetype v1.4.2 // indirect + github.com/gin-contrib/sse v0.1.0 // indirect + github.com/go-playground/locales v0.14.1 // indirect + github.com/go-playground/universal-translator v0.18.1 // indirect + github.com/go-playground/validator/v10 v10.14.0 // indirect + github.com/goccy/go-json v0.10.2 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/klauspost/cpuid/v2 v2.2.4 // indirect + github.com/leodido/go-urn v1.2.4 // indirect + github.com/mattn/go-isatty v0.0.19 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pelletier/go-toml/v2 v2.0.8 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/twitchyliquid64/golang-asm v0.15.1 // indirect + github.com/ugorji/go/codec v1.2.11 // indirect + golang.org/x/arch v0.3.0 // indirect + golang.org/x/crypto v0.16.0 // indirect + golang.org/x/sys v0.15.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/protobuf v1.30.0 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/go.sum b/go.sum index 4a3f2558..52070878 100644 --- a/go.sum +++ b/go.sum @@ -1,97 +1,94 @@ -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/beevik/etree v1.2.0 h1:l7WETslUG/T+xOPs47dtd6jov2Ii/8/OjCldk5fYfQw= +github.com/beevik/etree v1.2.0/go.mod h1:aiPf89g/1k3AShMVAzriilpcE4R/Vuor90y83zVZWFc= +github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM= +github.com/bytedance/sonic v1.9.1 h1:6iJ6NqdoxCDr6mbY8h18oSO+cShGSMRGCEo7F2h0x8s= +github.com/bytedance/sonic v1.9.1/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U= +github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= +github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= +github.com/clbanning/mxj/v2 v2.7.0 h1:WA/La7UGCanFe5NpHF0Q3DNtnCsVoxbPKuyBNHWRyME= +github.com/clbanning/mxj/v2 v2.7.0/go.mod h1:hNiWqW14h+kc+MdF9C6/YoRfjEJoR3ou6tn/Qo+ve2s= 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= github.com/elgs/gostrgen v0.0.0-20161222160715-9d61ae07eeae h1:3KvK2DmA7TxQ6PZ2f0rWbdqjgJhRcqgbY70bBeE4clI= github.com/elgs/gostrgen v0.0.0-20161222160715-9d61ae07eeae/go.mod h1:wruC5r2gHdr/JIUs5Rr1V45YtsAzKXZxAnn/5rPC97g= +github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU= +github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA= 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.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.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= -github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg= +github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU= +github.com/go-playground/assert/v2 v2.2.0 h1:JvknZsQTYeFEAhQwI4qEt9cyV5ONwRHC+lYKSsYSR8s= +github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA= +github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY= +github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY= +github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY= +github.com/go-playground/validator/v10 v10.14.0 h1:vgvQWe3XCz3gIeFDm/HnTIbj6UGmg/+t63MyGU2n5js= +github.com/go-playground/validator/v10 v10.14.0/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU= +github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU= +github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/google/go-cmp v0.5.5 h1:Khx7svrCpmxxtHBq5j2mp/xVjsi8hQMfNLvJFAlrGgU= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= 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= -github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= -github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421 h1:ZqeYNhU3OHLH3mGKHDcjJRFFRrJa6eAM5H+CtDdOsPc= +github.com/google/uuid v1.4.0 h1:MtMxsa51/r9yyhkyLsVeVt0B+BGQZzpQiTQ4eHZ8bc4= +github.com/google/uuid v1.4.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= +github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= +github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= +github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= +github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= +github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA= +github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y= 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/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/pelletier/go-toml/v2 v2.0.8 h1:0ctb6s9mE31h0/lhu+J6OPmVeDxJn+kYnJc2jZR9tGQ= +github.com/pelletier/go-toml/v2 v2.0.8/go.mod h1:vuYfssBdrU2XDZ9bYydBu6t+6a6PYNcZljzZR9VXg+4= 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/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= +github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/ugorji/go v1.1.7 h1:/68gy2h+1mWMrwZFeD1kQialdSzAb432dtpeJ42ovdo= -github.com/ugorji/go v1.1.7/go.mod h1:kZn38zHttfInRq0xu/PH0az30d+z6vm202qpg1oXVMw= -github.com/ugorji/go/codec v1.1.7 h1:2SvQaVZ1ouYrrKKwoSk2pzd4A9evlKJb9oTL+OaLUSs= -github.com/ugorji/go/codec v1.1.7/go.mod h1:Ax+UKWsSmolVDwsd+7N3ZtXu+yMGCf907BLYF3GoBXY= -github.com/yuin/goldmark v1.4.0/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= -golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-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-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= -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= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= +github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= +github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= +github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI= +github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08= +github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU= +github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg= +golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/arch v0.3.0 h1:02VY4/ZcO/gBOH6PUaoiptASxtXU10jazRCP865E97k= +golang.org/x/arch v0.3.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8= +golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY= +golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= +golang.org/x/net v0.19.0 h1:zTwKpTd2XuCqf8huc7Fo2iSy+4RHPd10s4KzeTnVr1c= +golang.org/x/net v0.19.0/go.mod h1:CfAk/cbD4CthTvqiEl8NpboMuiuOYsAr/7NOjZJtv1U= +golang.org/x/sys v0.0.0-20220704084225-05e143d24a9e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc= +golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng= +google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= 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= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4= diff --git a/gosoap/envelope.go b/gosoap/envelope.go new file mode 100644 index 00000000..3029cd67 --- /dev/null +++ b/gosoap/envelope.go @@ -0,0 +1,121 @@ +package gosoap + +import ( + "encoding/xml" + "fmt" +) + +type SOAPEnvelope struct { + XMLName xml.Name `xml:"http://www.w3.org/2003/05/soap-envelope Envelope"` + Header SOAPHeader + Body SOAPBody +} + +type SOAPHeader struct { + XMLName xml.Name `xml:"http://www.w3.org/2003/05/soap-envelope Header"` + + Headers []interface{} +} + +type SOAPBody struct { + XMLName xml.Name `xml:"http://www.w3.org/2003/05/soap-envelope Body"` + + Fault *SOAPFault `xml:",omitempty"` + Content interface{} `xml:",omitempty"` +} + +type SOAPFault struct { + XMLName xml.Name `xml:"http://www.w3.org/2003/05/soap-envelope Fault"` + + Code SOAPFaultCode `xml:",omitempty"` + Reason SOAPFaultReason `xml:",omitempty"` + Detail SOAPFaultDetail `xml:",omitempty"` +} + +// UnmarshalXML the response body +// https://github.com/faceterteam/onvif4go/blob/master/soap/types.go#L46 +// https://play.golang.org/p/FRzdAFrXZ1 +func (b *SOAPBody) UnmarshalXML(d *xml.Decoder, _ xml.StartElement) error { + if b.Content == nil { + return xml.UnmarshalError("Content must be a pointer to a struct") + } + + var ( + token xml.Token + err error + consumed bool + ) + +Loop: + for { + if token, err = d.Token(); err != nil { + return err + } + + if token == nil { + break + } + + switch se := token.(type) { + case xml.StartElement: + if consumed { + return xml.UnmarshalError("Found multiple elements inside SOAP body; not wrapped-document/literal WS-I compliant") + } else if se.Name.Space == "http://www.w3.org/2003/05/soap-envelope" && se.Name.Local == "Fault" { + b.Fault = &SOAPFault{} + b.Content = nil + + err = d.DecodeElement(b.Fault, &se) + if err != nil { + return err + } + + consumed = true + } else { + if err = d.DecodeElement(b.Content, &se); err != nil { + return err + } + + consumed = true + } + case xml.EndElement: + break Loop + } + } + + return nil +} + +type SOAPFaultCode struct { + Value string `xml:"Value"` + Subcode SOAPFaultSubCode `xml:"Subcode,omitempty"` +} + +type SOAPFaultSubCode struct { + Value string `xml:"Value"` + Subcode *SOAPFaultSubCode `xml:"Subcode,omitempty"` +} + +type SOAPFaultReason struct { + Text string `xml:"Text"` +} + +type SOAPFaultDetail struct { + Text string `xml:"Text"` +} + +func (fault *SOAPFault) String() string { + msg := fmt.Sprintf("fault reason: %s, fault detail: %s, fault code: %v %v ", + fault.Reason.Text, fault.Detail.Text, fault.Code.Value, fault.Code.Subcode.Value) + if fault.Code.Subcode.Subcode != nil { + msg += fault.Code.Subcode.Subcode.Value + } + return msg +} + +func NewSOAPEnvelope(content interface{}) *SOAPEnvelope { + return &SOAPEnvelope{ + Body: SOAPBody{ + Content: content, + }, + } +} diff --git a/gosoap/soap-builder.go b/gosoap/soap-builder.go index d3ac5547..2a31d8ee 100644 --- a/gosoap/soap-builder.go +++ b/gosoap/soap-builder.go @@ -81,7 +81,9 @@ func (msg *SoapMessage) AddStringBodyContent(data string) { } //doc.FindElement("./Envelope/Body").AddChild(element) bodyTag := doc.Root().SelectElement("Body") - bodyTag.AddChild(element) + if element != nil { + bodyTag.AddChild(element) + } //doc.IndentTabs() res, _ := doc.WriteToString() diff --git a/gosoap/ws-action.go b/gosoap/ws-action.go index f5a9e3d2..cc9cea30 100644 --- a/gosoap/ws-action.go +++ b/gosoap/ws-action.go @@ -36,7 +36,7 @@ func NewAction(key, value string) Action { /** Generating Nonce sequence **/ auth := Action{ - // Created: time.Now().UTC().Format(time.RFC3339Nano), + // Created: time.Now().UTC().Format(time.RFC3339Nano), } return auth diff --git a/gosoap/ws-security.go b/gosoap/ws-security.go index 38214020..c56ea6b9 100644 --- a/gosoap/ws-security.go +++ b/gosoap/ws-security.go @@ -9,15 +9,19 @@ import ( "github.com/elgs/gostrgen" ) -/************************* +/* +************************ + WS-Security types -*************************/ + +************************ +*/ const ( passwordType = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest" encodingType = "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ) -//Security type :XMLName xml.Name `xml:"http://purl.org/rss/1.0/modules/content/ encoded"` +// Security type :XMLName xml.Name `xml:"http://purl.org/rss/1.0/modules/content/ encoded"` type Security struct { //XMLName xml.Name `xml:"wsse:Security"` XMLName xml.Name `xml:"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd Security"` @@ -55,7 +59,7 @@ type wsAuth struct { */ -//NewSecurity get a new security +// NewSecurity get a new security func NewSecurity(username, passwd string) Security { /** Generating Nonce sequence **/ charsToGenerate := 32 @@ -81,7 +85,7 @@ func NewSecurity(username, passwd string) Security { return auth } -//Digest = B64ENCODE( SHA1( B64DECODE( Nonce ) + Date + Password ) ) +// Digest = B64ENCODE( SHA1( B64DECODE( Nonce ) + Date + Password ) ) func generateToken(Username string, Nonce string, Created string, Password string) string { sDec, _ := base64.StdEncoding.DecodeString(Nonce) diff --git a/imaging/function.go b/imaging/function.go new file mode 100644 index 00000000..b86f7f66 --- /dev/null +++ b/imaging/function.go @@ -0,0 +1,108 @@ +// -*- Mode: Go; indent-tabs-mode: t -*- +// +// Copyright (C) 2022 Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by gen_commands.py DO NOT EDIT. + +package imaging + +type GetCurrentPresetFunction struct{} + +func (_ *GetCurrentPresetFunction) Request() interface{} { + return &GetCurrentPreset{} +} +func (_ *GetCurrentPresetFunction) Response() interface{} { + return &GetCurrentPresetResponse{} +} + +type GetImagingSettingsFunction struct{} + +func (_ *GetImagingSettingsFunction) Request() interface{} { + return &GetImagingSettings{} +} +func (_ *GetImagingSettingsFunction) Response() interface{} { + return &GetImagingSettingsResponse{} +} + +type GetMoveOptionsFunction struct{} + +func (_ *GetMoveOptionsFunction) Request() interface{} { + return &GetMoveOptions{} +} +func (_ *GetMoveOptionsFunction) Response() interface{} { + return &GetMoveOptionsResponse{} +} + +type GetOptionsFunction struct{} + +func (_ *GetOptionsFunction) Request() interface{} { + return &GetOptions{} +} +func (_ *GetOptionsFunction) Response() interface{} { + return &GetOptionsResponse{} +} + +type GetPresetsFunction struct{} + +func (_ *GetPresetsFunction) Request() interface{} { + return &GetPresets{} +} +func (_ *GetPresetsFunction) Response() interface{} { + return &GetPresetsResponse{} +} + +type GetServiceCapabilitiesFunction struct{} + +func (_ *GetServiceCapabilitiesFunction) Request() interface{} { + return &GetServiceCapabilities{} +} +func (_ *GetServiceCapabilitiesFunction) Response() interface{} { + return &GetServiceCapabilitiesResponse{} +} + +type GetStatusFunction struct{} + +func (_ *GetStatusFunction) Request() interface{} { + return &GetStatus{} +} +func (_ *GetStatusFunction) Response() interface{} { + return &GetStatusResponse{} +} + +type MoveFunction struct{} + +func (_ *MoveFunction) Request() interface{} { + return &Move{} +} +func (_ *MoveFunction) Response() interface{} { + return &MoveResponse{} +} + +type SetCurrentPresetFunction struct{} + +func (_ *SetCurrentPresetFunction) Request() interface{} { + return &SetCurrentPreset{} +} +func (_ *SetCurrentPresetFunction) Response() interface{} { + return &SetCurrentPresetResponse{} +} + +type SetImagingSettingsFunction struct{} + +func (_ *SetImagingSettingsFunction) Request() interface{} { + return &SetImagingSettings{} +} +func (_ *SetImagingSettingsFunction) Response() interface{} { + return &SetImagingSettingsResponse{} +} + +type StopFunction struct{} + +func (_ *StopFunction) Request() interface{} { + return &Stop{} +} +func (_ *StopFunction) Response() interface{} { + return &StopResponse{} +} diff --git a/interfaces.go b/interfaces.go new file mode 100644 index 00000000..9e1c0787 --- /dev/null +++ b/interfaces.go @@ -0,0 +1,6 @@ +package onvif + +type Function interface { + Request() interface{} + Response() interface{} +} diff --git a/mappings.go b/mappings.go new file mode 100644 index 00000000..1c7576c2 --- /dev/null +++ b/mappings.go @@ -0,0 +1,299 @@ +// -*- Mode: Go; indent-tabs-mode: t -*- +// +// Copyright (C) 2022 Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by gen_commands.py DO NOT EDIT. + +package onvif + +import ( + "github.com/kerberos-io/onvif/analytics" + "github.com/kerberos-io/onvif/device" + "github.com/kerberos-io/onvif/event" + "github.com/kerberos-io/onvif/imaging" + "github.com/kerberos-io/onvif/media" + "github.com/kerberos-io/onvif/media2" + "github.com/kerberos-io/onvif/ptz" + "github.com/kerberos-io/onvif/recording" +) + +var AnalyticsFunctionMap = map[string]Function{ + CreateAnalyticsModules: &analytics.CreateAnalyticsModulesFunction{}, + CreateRules: &analytics.CreateRulesFunction{}, + DeleteAnalyticsModules: &analytics.DeleteAnalyticsModulesFunction{}, + DeleteRules: &analytics.DeleteRulesFunction{}, + GetAnalyticsModuleOptions: &analytics.GetAnalyticsModuleOptionsFunction{}, + GetAnalyticsModules: &analytics.GetAnalyticsModulesFunction{}, + GetRuleOptions: &analytics.GetRuleOptionsFunction{}, + GetRules: &analytics.GetRulesFunction{}, + GetSupportedAnalyticsModules: &analytics.GetSupportedAnalyticsModulesFunction{}, + GetSupportedRules: &analytics.GetSupportedRulesFunction{}, + ModifyAnalyticsModules: &analytics.ModifyAnalyticsModulesFunction{}, + ModifyRules: &analytics.ModifyRulesFunction{}, +} + +var DeviceFunctionMap = map[string]Function{ + AddIPAddressFilter: &device.AddIPAddressFilterFunction{}, + AddScopes: &device.AddScopesFunction{}, + CreateCertificate: &device.CreateCertificateFunction{}, + CreateDot1XConfiguration: &device.CreateDot1XConfigurationFunction{}, + CreateStorageConfiguration: &device.CreateStorageConfigurationFunction{}, + CreateUsers: &device.CreateUsersFunction{}, + DeleteCertificates: &device.DeleteCertificatesFunction{}, + DeleteDot1XConfiguration: &device.DeleteDot1XConfigurationFunction{}, + DeleteGeoLocation: &device.DeleteGeoLocationFunction{}, + DeleteStorageConfiguration: &device.DeleteStorageConfigurationFunction{}, + DeleteUsers: &device.DeleteUsersFunction{}, + GetAccessPolicy: &device.GetAccessPolicyFunction{}, + GetCACertificates: &device.GetCACertificatesFunction{}, + GetCapabilities: &device.GetCapabilitiesFunction{}, + GetCertificateInformation: &device.GetCertificateInformationFunction{}, + GetCertificates: &device.GetCertificatesFunction{}, + GetCertificatesStatus: &device.GetCertificatesStatusFunction{}, + GetClientCertificateMode: &device.GetClientCertificateModeFunction{}, + GetDNS: &device.GetDNSFunction{}, + GetDPAddresses: &device.GetDPAddressesFunction{}, + GetDeviceInformation: &device.GetDeviceInformationFunction{}, + GetDiscoveryMode: &device.GetDiscoveryModeFunction{}, + GetDot11Capabilities: &device.GetDot11CapabilitiesFunction{}, + GetDot11Status: &device.GetDot11StatusFunction{}, + GetDot1XConfiguration: &device.GetDot1XConfigurationFunction{}, + GetDot1XConfigurations: &device.GetDot1XConfigurationsFunction{}, + GetDynamicDNS: &device.GetDynamicDNSFunction{}, + GetEndpointReference: &device.GetEndpointReferenceFunction{}, + GetGeoLocation: &device.GetGeoLocationFunction{}, + GetHostname: &device.GetHostnameFunction{}, + GetIPAddressFilter: &device.GetIPAddressFilterFunction{}, + GetNTP: &device.GetNTPFunction{}, + GetNetworkDefaultGateway: &device.GetNetworkDefaultGatewayFunction{}, + GetNetworkInterfaces: &device.GetNetworkInterfacesFunction{}, + GetNetworkProtocols: &device.GetNetworkProtocolsFunction{}, + GetPkcs10Request: &device.GetPkcs10RequestFunction{}, + GetRelayOutputs: &device.GetRelayOutputsFunction{}, + GetRemoteDiscoveryMode: &device.GetRemoteDiscoveryModeFunction{}, + GetRemoteUser: &device.GetRemoteUserFunction{}, + GetScopes: &device.GetScopesFunction{}, + GetServiceCapabilities: &device.GetServiceCapabilitiesFunction{}, + GetServices: &device.GetServicesFunction{}, + GetStorageConfiguration: &device.GetStorageConfigurationFunction{}, + GetStorageConfigurations: &device.GetStorageConfigurationsFunction{}, + GetSystemBackup: &device.GetSystemBackupFunction{}, + GetSystemDateAndTime: &device.GetSystemDateAndTimeFunction{}, + GetSystemLog: &device.GetSystemLogFunction{}, + GetSystemSupportInformation: &device.GetSystemSupportInformationFunction{}, + GetSystemUris: &device.GetSystemUrisFunction{}, + GetUsers: &device.GetUsersFunction{}, + GetWsdlUrl: &device.GetWsdlUrlFunction{}, + GetZeroConfiguration: &device.GetZeroConfigurationFunction{}, + LoadCACertificates: &device.LoadCACertificatesFunction{}, + LoadCertificateWithPrivateKey: &device.LoadCertificateWithPrivateKeyFunction{}, + LoadCertificates: &device.LoadCertificatesFunction{}, + RemoveIPAddressFilter: &device.RemoveIPAddressFilterFunction{}, + RemoveScopes: &device.RemoveScopesFunction{}, + RestoreSystem: &device.RestoreSystemFunction{}, + ScanAvailableDot11Networks: &device.ScanAvailableDot11NetworksFunction{}, + SendAuxiliaryCommand: &device.SendAuxiliaryCommandFunction{}, + SetAccessPolicy: &device.SetAccessPolicyFunction{}, + SetCertificatesStatus: &device.SetCertificatesStatusFunction{}, + SetClientCertificateMode: &device.SetClientCertificateModeFunction{}, + SetDNS: &device.SetDNSFunction{}, + SetDPAddresses: &device.SetDPAddressesFunction{}, + SetDiscoveryMode: &device.SetDiscoveryModeFunction{}, + SetDot1XConfiguration: &device.SetDot1XConfigurationFunction{}, + SetDynamicDNS: &device.SetDynamicDNSFunction{}, + SetGeoLocation: &device.SetGeoLocationFunction{}, + SetHostname: &device.SetHostnameFunction{}, + SetHostnameFromDHCP: &device.SetHostnameFromDHCPFunction{}, + SetIPAddressFilter: &device.SetIPAddressFilterFunction{}, + SetNTP: &device.SetNTPFunction{}, + SetNetworkDefaultGateway: &device.SetNetworkDefaultGatewayFunction{}, + SetNetworkInterfaces: &device.SetNetworkInterfacesFunction{}, + SetNetworkProtocols: &device.SetNetworkProtocolsFunction{}, + SetRelayOutputSettings: &device.SetRelayOutputSettingsFunction{}, + SetRelayOutputState: &device.SetRelayOutputStateFunction{}, + SetRemoteDiscoveryMode: &device.SetRemoteDiscoveryModeFunction{}, + SetRemoteUser: &device.SetRemoteUserFunction{}, + SetScopes: &device.SetScopesFunction{}, + SetStorageConfiguration: &device.SetStorageConfigurationFunction{}, + SetSystemDateAndTime: &device.SetSystemDateAndTimeFunction{}, + SetSystemFactoryDefault: &device.SetSystemFactoryDefaultFunction{}, + SetUser: &device.SetUserFunction{}, + SetZeroConfiguration: &device.SetZeroConfigurationFunction{}, + StartFirmwareUpgrade: &device.StartFirmwareUpgradeFunction{}, + StartSystemRestore: &device.StartSystemRestoreFunction{}, + SystemReboot: &device.SystemRebootFunction{}, + UpgradeSystemFirmware: &device.UpgradeSystemFirmwareFunction{}, +} + +var EventFunctionMap = map[string]Function{ + CreatePullPointSubscription: &event.CreatePullPointSubscriptionFunction{}, + GetEventProperties: &event.GetEventPropertiesFunction{}, + GetServiceCapabilities: &event.GetServiceCapabilitiesFunction{}, + PullMessages: &event.PullMessagesFunction{}, + Renew: &event.RenewFunction{}, + Seek: &event.SeekFunction{}, + SetSynchronizationPoint: &event.SetSynchronizationPointFunction{}, + Subscribe: &event.SubscribeFunction{}, + SubscriptionReference: &event.SubscriptionReferenceFunction{}, + Unsubscribe: &event.UnsubscribeFunction{}, +} + +var ImagingFunctionMap = map[string]Function{ + GetCurrentPreset: &imaging.GetCurrentPresetFunction{}, + GetImagingSettings: &imaging.GetImagingSettingsFunction{}, + GetMoveOptions: &imaging.GetMoveOptionsFunction{}, + GetOptions: &imaging.GetOptionsFunction{}, + GetPresets: &imaging.GetPresetsFunction{}, + GetServiceCapabilities: &imaging.GetServiceCapabilitiesFunction{}, + GetStatus: &imaging.GetStatusFunction{}, + Move: &imaging.MoveFunction{}, + SetCurrentPreset: &imaging.SetCurrentPresetFunction{}, + SetImagingSettings: &imaging.SetImagingSettingsFunction{}, + Stop: &imaging.StopFunction{}, +} + +var MediaFunctionMap = map[string]Function{ + AddAudioDecoderConfiguration: &media.AddAudioDecoderConfigurationFunction{}, + AddAudioEncoderConfiguration: &media.AddAudioEncoderConfigurationFunction{}, + AddAudioOutputConfiguration: &media.AddAudioOutputConfigurationFunction{}, + AddAudioSourceConfiguration: &media.AddAudioSourceConfigurationFunction{}, + AddMetadataConfiguration: &media.AddMetadataConfigurationFunction{}, + AddPTZConfiguration: &media.AddPTZConfigurationFunction{}, + AddVideoAnalyticsConfiguration: &media.AddVideoAnalyticsConfigurationFunction{}, + AddVideoEncoderConfiguration: &media.AddVideoEncoderConfigurationFunction{}, + AddVideoSourceConfiguration: &media.AddVideoSourceConfigurationFunction{}, + CreateOSD: &media.CreateOSDFunction{}, + CreateProfile: &media.CreateProfileFunction{}, + DeleteOSD: &media.DeleteOSDFunction{}, + DeleteProfile: &media.DeleteProfileFunction{}, + GetAudioDecoderConfiguration: &media.GetAudioDecoderConfigurationFunction{}, + GetAudioDecoderConfigurationOptions: &media.GetAudioDecoderConfigurationOptionsFunction{}, + GetAudioDecoderConfigurations: &media.GetAudioDecoderConfigurationsFunction{}, + GetAudioEncoderConfiguration: &media.GetAudioEncoderConfigurationFunction{}, + GetAudioEncoderConfigurationOptions: &media.GetAudioEncoderConfigurationOptionsFunction{}, + GetAudioEncoderConfigurations: &media.GetAudioEncoderConfigurationsFunction{}, + GetAudioOutputConfiguration: &media.GetAudioOutputConfigurationFunction{}, + GetAudioOutputConfigurationOptions: &media.GetAudioOutputConfigurationOptionsFunction{}, + GetAudioOutputConfigurations: &media.GetAudioOutputConfigurationsFunction{}, + GetAudioOutputs: &media.GetAudioOutputsFunction{}, + GetAudioSourceConfiguration: &media.GetAudioSourceConfigurationFunction{}, + GetAudioSourceConfigurationOptions: &media.GetAudioSourceConfigurationOptionsFunction{}, + GetAudioSourceConfigurations: &media.GetAudioSourceConfigurationsFunction{}, + GetAudioSources: &media.GetAudioSourcesFunction{}, + GetCompatibleAudioDecoderConfigurations: &media.GetCompatibleAudioDecoderConfigurationsFunction{}, + GetCompatibleAudioEncoderConfigurations: &media.GetCompatibleAudioEncoderConfigurationsFunction{}, + GetCompatibleAudioOutputConfigurations: &media.GetCompatibleAudioOutputConfigurationsFunction{}, + GetCompatibleAudioSourceConfigurations: &media.GetCompatibleAudioSourceConfigurationsFunction{}, + GetCompatibleMetadataConfigurations: &media.GetCompatibleMetadataConfigurationsFunction{}, + GetCompatibleVideoAnalyticsConfigurations: &media.GetCompatibleVideoAnalyticsConfigurationsFunction{}, + GetCompatibleVideoEncoderConfigurations: &media.GetCompatibleVideoEncoderConfigurationsFunction{}, + GetCompatibleVideoSourceConfigurations: &media.GetCompatibleVideoSourceConfigurationsFunction{}, + GetGuaranteedNumberOfVideoEncoderInstances: &media.GetGuaranteedNumberOfVideoEncoderInstancesFunction{}, + GetMetadataConfiguration: &media.GetMetadataConfigurationFunction{}, + GetMetadataConfigurationOptions: &media.GetMetadataConfigurationOptionsFunction{}, + GetMetadataConfigurations: &media.GetMetadataConfigurationsFunction{}, + GetOSD: &media.GetOSDFunction{}, + GetOSDOptions: &media.GetOSDOptionsFunction{}, + GetOSDs: &media.GetOSDsFunction{}, + GetProfile: &media.GetProfileFunction{}, + GetProfiles: &media.GetProfilesFunction{}, + GetServiceCapabilities: &media.GetServiceCapabilitiesFunction{}, + GetSnapshotUri: &media.GetSnapshotUriFunction{}, + GetStreamUri: &media.GetStreamUriFunction{}, + GetVideoAnalyticsConfiguration: &media.GetVideoAnalyticsConfigurationFunction{}, + GetVideoAnalyticsConfigurations: &media.GetVideoAnalyticsConfigurationsFunction{}, + GetVideoEncoderConfiguration: &media.GetVideoEncoderConfigurationFunction{}, + GetVideoEncoderConfigurationOptions: &media.GetVideoEncoderConfigurationOptionsFunction{}, + GetVideoEncoderConfigurations: &media.GetVideoEncoderConfigurationsFunction{}, + GetVideoSourceConfiguration: &media.GetVideoSourceConfigurationFunction{}, + GetVideoSourceConfigurationOptions: &media.GetVideoSourceConfigurationOptionsFunction{}, + GetVideoSourceConfigurations: &media.GetVideoSourceConfigurationsFunction{}, + GetVideoSourceModes: &media.GetVideoSourceModesFunction{}, + GetVideoSources: &media.GetVideoSourcesFunction{}, + RemoveAudioDecoderConfiguration: &media.RemoveAudioDecoderConfigurationFunction{}, + RemoveAudioEncoderConfiguration: &media.RemoveAudioEncoderConfigurationFunction{}, + RemoveAudioOutputConfiguration: &media.RemoveAudioOutputConfigurationFunction{}, + RemoveAudioSourceConfiguration: &media.RemoveAudioSourceConfigurationFunction{}, + RemoveMetadataConfiguration: &media.RemoveMetadataConfigurationFunction{}, + RemovePTZConfiguration: &media.RemovePTZConfigurationFunction{}, + RemoveVideoAnalyticsConfiguration: &media.RemoveVideoAnalyticsConfigurationFunction{}, + RemoveVideoEncoderConfiguration: &media.RemoveVideoEncoderConfigurationFunction{}, + RemoveVideoSourceConfiguration: &media.RemoveVideoSourceConfigurationFunction{}, + SetAudioDecoderConfiguration: &media.SetAudioDecoderConfigurationFunction{}, + SetAudioEncoderConfiguration: &media.SetAudioEncoderConfigurationFunction{}, + SetAudioOutputConfiguration: &media.SetAudioOutputConfigurationFunction{}, + SetAudioSourceConfiguration: &media.SetAudioSourceConfigurationFunction{}, + SetMetadataConfiguration: &media.SetMetadataConfigurationFunction{}, + SetOSD: &media.SetOSDFunction{}, + SetSynchronizationPoint: &media.SetSynchronizationPointFunction{}, + SetVideoAnalyticsConfiguration: &media.SetVideoAnalyticsConfigurationFunction{}, + SetVideoEncoderConfiguration: &media.SetVideoEncoderConfigurationFunction{}, + SetVideoSourceConfiguration: &media.SetVideoSourceConfigurationFunction{}, + SetVideoSourceMode: &media.SetVideoSourceModeFunction{}, + StartMulticastStreaming: &media.StartMulticastStreamingFunction{}, + StopMulticastStreaming: &media.StopMulticastStreamingFunction{}, +} + +var Media2FunctionMap = map[string]Function{ + AddConfiguration: &media2.AddConfigurationFunction{}, + GetAnalyticsConfigurations: &media2.GetAnalyticsConfigurationsFunction{}, + GetProfiles: &media2.GetProfilesFunction{}, + RemoveConfiguration: &media2.RemoveConfigurationFunction{}, +} + +var PTZFunctionMap = map[string]Function{ + AbsoluteMove: &ptz.AbsoluteMoveFunction{}, + ContinuousMove: &ptz.ContinuousMoveFunction{}, + CreatePresetTour: &ptz.CreatePresetTourFunction{}, + GeoMove: &ptz.GeoMoveFunction{}, + GetCompatibleConfigurations: &ptz.GetCompatibleConfigurationsFunction{}, + GetConfiguration: &ptz.GetConfigurationFunction{}, + GetConfigurationOptions: &ptz.GetConfigurationOptionsFunction{}, + GetConfigurations: &ptz.GetConfigurationsFunction{}, + GetNode: &ptz.GetNodeFunction{}, + GetNodes: &ptz.GetNodesFunction{}, + GetPresetTour: &ptz.GetPresetTourFunction{}, + GetPresetTourOptions: &ptz.GetPresetTourOptionsFunction{}, + GetPresetTours: &ptz.GetPresetToursFunction{}, + GetPresets: &ptz.GetPresetsFunction{}, + GetServiceCapabilities: &ptz.GetServiceCapabilitiesFunction{}, + GetStatus: &ptz.GetStatusFunction{}, + GotoHomePosition: &ptz.GotoHomePositionFunction{}, + GotoPreset: &ptz.GotoPresetFunction{}, + ModifyPresetTour: &ptz.ModifyPresetTourFunction{}, + OperatePresetTour: &ptz.OperatePresetTourFunction{}, + RelativeMove: &ptz.RelativeMoveFunction{}, + RemovePreset: &ptz.RemovePresetFunction{}, + RemovePresetTour: &ptz.RemovePresetTourFunction{}, + SendAuxiliaryCommand: &ptz.SendAuxiliaryCommandFunction{}, + SetConfiguration: &ptz.SetConfigurationFunction{}, + SetHomePosition: &ptz.SetHomePositionFunction{}, + SetPreset: &ptz.SetPresetFunction{}, + Stop: &ptz.StopFunction{}, +} + +var RecordingFunctionMap = map[string]Function{ + CreateRecording: &recording.CreateRecordingFunction{}, + CreateRecordingJob: &recording.CreateRecordingJobFunction{}, + CreateTrack: &recording.CreateTrackFunction{}, + DeleteRecording: &recording.DeleteRecordingFunction{}, + DeleteRecordingJob: &recording.DeleteRecordingJobFunction{}, + DeleteTrack: &recording.DeleteTrackFunction{}, + ExportRecordedData: &recording.ExportRecordedDataFunction{}, + GetExportRecordedDataState: &recording.GetExportRecordedDataStateFunction{}, + GetRecordingConfiguration: &recording.GetRecordingConfigurationFunction{}, + GetRecordingJobConfiguration: &recording.GetRecordingJobConfigurationFunction{}, + GetRecordingJobState: &recording.GetRecordingJobStateFunction{}, + GetRecordingJobs: &recording.GetRecordingJobsFunction{}, + GetRecordingOptions: &recording.GetRecordingOptionsFunction{}, + GetRecordings: &recording.GetRecordingsFunction{}, + GetServiceCapabilities: &recording.GetServiceCapabilitiesFunction{}, + GetTrackConfiguration: &recording.GetTrackConfigurationFunction{}, + SetRecordingConfiguration: &recording.SetRecordingConfigurationFunction{}, + SetRecordingJobConfiguration: &recording.SetRecordingJobConfigurationFunction{}, + SetRecordingJobMode: &recording.SetRecordingJobModeFunction{}, + SetTrackConfiguration: &recording.SetTrackConfigurationFunction{}, + StopExportRecordedData: &recording.StopExportRecordedDataFunction{}, +} diff --git a/media/function.go b/media/function.go new file mode 100644 index 00000000..87104b16 --- /dev/null +++ b/media/function.go @@ -0,0 +1,720 @@ +// -*- Mode: Go; indent-tabs-mode: t -*- +// +// Copyright (C) 2022 Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by gen_commands.py DO NOT EDIT. + +package media + +type AddAudioDecoderConfigurationFunction struct{} + +func (_ *AddAudioDecoderConfigurationFunction) Request() interface{} { + return &AddAudioDecoderConfiguration{} +} +func (_ *AddAudioDecoderConfigurationFunction) Response() interface{} { + return &AddAudioDecoderConfigurationResponse{} +} + +type AddAudioEncoderConfigurationFunction struct{} + +func (_ *AddAudioEncoderConfigurationFunction) Request() interface{} { + return &AddAudioEncoderConfiguration{} +} +func (_ *AddAudioEncoderConfigurationFunction) Response() interface{} { + return &AddAudioEncoderConfigurationResponse{} +} + +type AddAudioOutputConfigurationFunction struct{} + +func (_ *AddAudioOutputConfigurationFunction) Request() interface{} { + return &AddAudioOutputConfiguration{} +} +func (_ *AddAudioOutputConfigurationFunction) Response() interface{} { + return &AddAudioOutputConfigurationResponse{} +} + +type AddAudioSourceConfigurationFunction struct{} + +func (_ *AddAudioSourceConfigurationFunction) Request() interface{} { + return &AddAudioSourceConfiguration{} +} +func (_ *AddAudioSourceConfigurationFunction) Response() interface{} { + return &AddAudioSourceConfigurationResponse{} +} + +type AddMetadataConfigurationFunction struct{} + +func (_ *AddMetadataConfigurationFunction) Request() interface{} { + return &AddMetadataConfiguration{} +} +func (_ *AddMetadataConfigurationFunction) Response() interface{} { + return &AddMetadataConfigurationResponse{} +} + +type AddPTZConfigurationFunction struct{} + +func (_ *AddPTZConfigurationFunction) Request() interface{} { + return &AddPTZConfiguration{} +} +func (_ *AddPTZConfigurationFunction) Response() interface{} { + return &AddPTZConfigurationResponse{} +} + +type AddVideoAnalyticsConfigurationFunction struct{} + +func (_ *AddVideoAnalyticsConfigurationFunction) Request() interface{} { + return &AddVideoAnalyticsConfiguration{} +} +func (_ *AddVideoAnalyticsConfigurationFunction) Response() interface{} { + return &AddVideoAnalyticsConfigurationResponse{} +} + +type AddVideoEncoderConfigurationFunction struct{} + +func (_ *AddVideoEncoderConfigurationFunction) Request() interface{} { + return &AddVideoEncoderConfiguration{} +} +func (_ *AddVideoEncoderConfigurationFunction) Response() interface{} { + return &AddVideoEncoderConfigurationResponse{} +} + +type AddVideoSourceConfigurationFunction struct{} + +func (_ *AddVideoSourceConfigurationFunction) Request() interface{} { + return &AddVideoSourceConfiguration{} +} +func (_ *AddVideoSourceConfigurationFunction) Response() interface{} { + return &AddVideoSourceConfigurationResponse{} +} + +type CreateOSDFunction struct{} + +func (_ *CreateOSDFunction) Request() interface{} { + return &CreateOSD{} +} +func (_ *CreateOSDFunction) Response() interface{} { + return &CreateOSDResponse{} +} + +type CreateProfileFunction struct{} + +func (_ *CreateProfileFunction) Request() interface{} { + return &CreateProfile{} +} +func (_ *CreateProfileFunction) Response() interface{} { + return &CreateProfileResponse{} +} + +type DeleteOSDFunction struct{} + +func (_ *DeleteOSDFunction) Request() interface{} { + return &DeleteOSD{} +} +func (_ *DeleteOSDFunction) Response() interface{} { + return &DeleteOSDResponse{} +} + +type DeleteProfileFunction struct{} + +func (_ *DeleteProfileFunction) Request() interface{} { + return &DeleteProfile{} +} +func (_ *DeleteProfileFunction) Response() interface{} { + return &DeleteProfileResponse{} +} + +type GetAudioDecoderConfigurationFunction struct{} + +func (_ *GetAudioDecoderConfigurationFunction) Request() interface{} { + return &GetAudioDecoderConfiguration{} +} +func (_ *GetAudioDecoderConfigurationFunction) Response() interface{} { + return &GetAudioDecoderConfigurationResponse{} +} + +type GetAudioDecoderConfigurationOptionsFunction struct{} + +func (_ *GetAudioDecoderConfigurationOptionsFunction) Request() interface{} { + return &GetAudioDecoderConfigurationOptions{} +} +func (_ *GetAudioDecoderConfigurationOptionsFunction) Response() interface{} { + return &GetAudioDecoderConfigurationOptionsResponse{} +} + +type GetAudioDecoderConfigurationsFunction struct{} + +func (_ *GetAudioDecoderConfigurationsFunction) Request() interface{} { + return &GetAudioDecoderConfigurations{} +} +func (_ *GetAudioDecoderConfigurationsFunction) Response() interface{} { + return &GetAudioDecoderConfigurationsResponse{} +} + +type GetAudioEncoderConfigurationFunction struct{} + +func (_ *GetAudioEncoderConfigurationFunction) Request() interface{} { + return &GetAudioEncoderConfiguration{} +} +func (_ *GetAudioEncoderConfigurationFunction) Response() interface{} { + return &GetAudioEncoderConfigurationResponse{} +} + +type GetAudioEncoderConfigurationOptionsFunction struct{} + +func (_ *GetAudioEncoderConfigurationOptionsFunction) Request() interface{} { + return &GetAudioEncoderConfigurationOptions{} +} +func (_ *GetAudioEncoderConfigurationOptionsFunction) Response() interface{} { + return &GetAudioEncoderConfigurationOptionsResponse{} +} + +type GetAudioEncoderConfigurationsFunction struct{} + +func (_ *GetAudioEncoderConfigurationsFunction) Request() interface{} { + return &GetAudioEncoderConfigurations{} +} +func (_ *GetAudioEncoderConfigurationsFunction) Response() interface{} { + return &GetAudioEncoderConfigurationsResponse{} +} + +type GetAudioOutputConfigurationFunction struct{} + +func (_ *GetAudioOutputConfigurationFunction) Request() interface{} { + return &GetAudioOutputConfiguration{} +} +func (_ *GetAudioOutputConfigurationFunction) Response() interface{} { + return &GetAudioOutputConfigurationResponse{} +} + +type GetAudioOutputConfigurationOptionsFunction struct{} + +func (_ *GetAudioOutputConfigurationOptionsFunction) Request() interface{} { + return &GetAudioOutputConfigurationOptions{} +} +func (_ *GetAudioOutputConfigurationOptionsFunction) Response() interface{} { + return &GetAudioOutputConfigurationOptionsResponse{} +} + +type GetAudioOutputConfigurationsFunction struct{} + +func (_ *GetAudioOutputConfigurationsFunction) Request() interface{} { + return &GetAudioOutputConfigurations{} +} +func (_ *GetAudioOutputConfigurationsFunction) Response() interface{} { + return &GetAudioOutputConfigurationsResponse{} +} + +type GetAudioOutputsFunction struct{} + +func (_ *GetAudioOutputsFunction) Request() interface{} { + return &GetAudioOutputs{} +} +func (_ *GetAudioOutputsFunction) Response() interface{} { + return &GetAudioOutputsResponse{} +} + +type GetAudioSourceConfigurationFunction struct{} + +func (_ *GetAudioSourceConfigurationFunction) Request() interface{} { + return &GetAudioSourceConfiguration{} +} +func (_ *GetAudioSourceConfigurationFunction) Response() interface{} { + return &GetAudioSourceConfigurationResponse{} +} + +type GetAudioSourceConfigurationOptionsFunction struct{} + +func (_ *GetAudioSourceConfigurationOptionsFunction) Request() interface{} { + return &GetAudioSourceConfigurationOptions{} +} +func (_ *GetAudioSourceConfigurationOptionsFunction) Response() interface{} { + return &GetAudioSourceConfigurationOptionsResponse{} +} + +type GetAudioSourceConfigurationsFunction struct{} + +func (_ *GetAudioSourceConfigurationsFunction) Request() interface{} { + return &GetAudioSourceConfigurations{} +} +func (_ *GetAudioSourceConfigurationsFunction) Response() interface{} { + return &GetAudioSourceConfigurationsResponse{} +} + +type GetAudioSourcesFunction struct{} + +func (_ *GetAudioSourcesFunction) Request() interface{} { + return &GetAudioSources{} +} +func (_ *GetAudioSourcesFunction) Response() interface{} { + return &GetAudioSourcesResponse{} +} + +type GetCompatibleAudioDecoderConfigurationsFunction struct{} + +func (_ *GetCompatibleAudioDecoderConfigurationsFunction) Request() interface{} { + return &GetCompatibleAudioDecoderConfigurations{} +} +func (_ *GetCompatibleAudioDecoderConfigurationsFunction) Response() interface{} { + return &GetCompatibleAudioDecoderConfigurationsResponse{} +} + +type GetCompatibleAudioEncoderConfigurationsFunction struct{} + +func (_ *GetCompatibleAudioEncoderConfigurationsFunction) Request() interface{} { + return &GetCompatibleAudioEncoderConfigurations{} +} +func (_ *GetCompatibleAudioEncoderConfigurationsFunction) Response() interface{} { + return &GetCompatibleAudioEncoderConfigurationsResponse{} +} + +type GetCompatibleAudioOutputConfigurationsFunction struct{} + +func (_ *GetCompatibleAudioOutputConfigurationsFunction) Request() interface{} { + return &GetCompatibleAudioOutputConfigurations{} +} +func (_ *GetCompatibleAudioOutputConfigurationsFunction) Response() interface{} { + return &GetCompatibleAudioOutputConfigurationsResponse{} +} + +type GetCompatibleAudioSourceConfigurationsFunction struct{} + +func (_ *GetCompatibleAudioSourceConfigurationsFunction) Request() interface{} { + return &GetCompatibleAudioSourceConfigurations{} +} +func (_ *GetCompatibleAudioSourceConfigurationsFunction) Response() interface{} { + return &GetCompatibleAudioSourceConfigurationsResponse{} +} + +type GetCompatibleMetadataConfigurationsFunction struct{} + +func (_ *GetCompatibleMetadataConfigurationsFunction) Request() interface{} { + return &GetCompatibleMetadataConfigurations{} +} +func (_ *GetCompatibleMetadataConfigurationsFunction) Response() interface{} { + return &GetCompatibleMetadataConfigurationsResponse{} +} + +type GetCompatibleVideoAnalyticsConfigurationsFunction struct{} + +func (_ *GetCompatibleVideoAnalyticsConfigurationsFunction) Request() interface{} { + return &GetCompatibleVideoAnalyticsConfigurations{} +} +func (_ *GetCompatibleVideoAnalyticsConfigurationsFunction) Response() interface{} { + return &GetCompatibleVideoAnalyticsConfigurationsResponse{} +} + +type GetCompatibleVideoEncoderConfigurationsFunction struct{} + +func (_ *GetCompatibleVideoEncoderConfigurationsFunction) Request() interface{} { + return &GetCompatibleVideoEncoderConfigurations{} +} +func (_ *GetCompatibleVideoEncoderConfigurationsFunction) Response() interface{} { + return &GetCompatibleVideoEncoderConfigurationsResponse{} +} + +type GetCompatibleVideoSourceConfigurationsFunction struct{} + +func (_ *GetCompatibleVideoSourceConfigurationsFunction) Request() interface{} { + return &GetCompatibleVideoSourceConfigurations{} +} +func (_ *GetCompatibleVideoSourceConfigurationsFunction) Response() interface{} { + return &GetCompatibleVideoSourceConfigurationsResponse{} +} + +type GetGuaranteedNumberOfVideoEncoderInstancesFunction struct{} + +func (_ *GetGuaranteedNumberOfVideoEncoderInstancesFunction) Request() interface{} { + return &GetGuaranteedNumberOfVideoEncoderInstances{} +} +func (_ *GetGuaranteedNumberOfVideoEncoderInstancesFunction) Response() interface{} { + return &GetGuaranteedNumberOfVideoEncoderInstancesResponse{} +} + +type GetMetadataConfigurationFunction struct{} + +func (_ *GetMetadataConfigurationFunction) Request() interface{} { + return &GetMetadataConfiguration{} +} +func (_ *GetMetadataConfigurationFunction) Response() interface{} { + return &GetMetadataConfigurationResponse{} +} + +type GetMetadataConfigurationOptionsFunction struct{} + +func (_ *GetMetadataConfigurationOptionsFunction) Request() interface{} { + return &GetMetadataConfigurationOptions{} +} +func (_ *GetMetadataConfigurationOptionsFunction) Response() interface{} { + return &GetMetadataConfigurationOptionsResponse{} +} + +type GetMetadataConfigurationsFunction struct{} + +func (_ *GetMetadataConfigurationsFunction) Request() interface{} { + return &GetMetadataConfigurations{} +} +func (_ *GetMetadataConfigurationsFunction) Response() interface{} { + return &GetMetadataConfigurationsResponse{} +} + +type GetOSDFunction struct{} + +func (_ *GetOSDFunction) Request() interface{} { + return &GetOSD{} +} +func (_ *GetOSDFunction) Response() interface{} { + return &GetOSDResponse{} +} + +type GetOSDOptionsFunction struct{} + +func (_ *GetOSDOptionsFunction) Request() interface{} { + return &GetOSDOptions{} +} +func (_ *GetOSDOptionsFunction) Response() interface{} { + return &GetOSDOptionsResponse{} +} + +type GetOSDsFunction struct{} + +func (_ *GetOSDsFunction) Request() interface{} { + return &GetOSDs{} +} +func (_ *GetOSDsFunction) Response() interface{} { + return &GetOSDsResponse{} +} + +type GetProfileFunction struct{} + +func (_ *GetProfileFunction) Request() interface{} { + return &GetProfile{} +} +func (_ *GetProfileFunction) Response() interface{} { + return &GetProfileResponse{} +} + +type GetProfilesFunction struct{} + +func (_ *GetProfilesFunction) Request() interface{} { + return &GetProfiles{} +} +func (_ *GetProfilesFunction) Response() interface{} { + return &GetProfilesResponse{} +} + +type GetServiceCapabilitiesFunction struct{} + +func (_ *GetServiceCapabilitiesFunction) Request() interface{} { + return &GetServiceCapabilities{} +} +func (_ *GetServiceCapabilitiesFunction) Response() interface{} { + return &GetServiceCapabilitiesResponse{} +} + +type GetSnapshotUriFunction struct{} + +func (_ *GetSnapshotUriFunction) Request() interface{} { + return &GetSnapshotUri{} +} +func (_ *GetSnapshotUriFunction) Response() interface{} { + return &GetSnapshotUriResponse{} +} + +type GetStreamUriFunction struct{} + +func (_ *GetStreamUriFunction) Request() interface{} { + return &GetStreamUri{} +} +func (_ *GetStreamUriFunction) Response() interface{} { + return &GetStreamUriResponse{} +} + +type GetVideoAnalyticsConfigurationFunction struct{} + +func (_ *GetVideoAnalyticsConfigurationFunction) Request() interface{} { + return &GetVideoAnalyticsConfiguration{} +} +func (_ *GetVideoAnalyticsConfigurationFunction) Response() interface{} { + return &GetVideoAnalyticsConfigurationResponse{} +} + +type GetVideoAnalyticsConfigurationsFunction struct{} + +func (_ *GetVideoAnalyticsConfigurationsFunction) Request() interface{} { + return &GetVideoAnalyticsConfigurations{} +} +func (_ *GetVideoAnalyticsConfigurationsFunction) Response() interface{} { + return &GetVideoAnalyticsConfigurationsResponse{} +} + +type GetVideoEncoderConfigurationFunction struct{} + +func (_ *GetVideoEncoderConfigurationFunction) Request() interface{} { + return &GetVideoEncoderConfiguration{} +} +func (_ *GetVideoEncoderConfigurationFunction) Response() interface{} { + return &GetVideoEncoderConfigurationResponse{} +} + +type GetVideoEncoderConfigurationOptionsFunction struct{} + +func (_ *GetVideoEncoderConfigurationOptionsFunction) Request() interface{} { + return &GetVideoEncoderConfigurationOptions{} +} +func (_ *GetVideoEncoderConfigurationOptionsFunction) Response() interface{} { + return &GetVideoEncoderConfigurationOptionsResponse{} +} + +type GetVideoEncoderConfigurationsFunction struct{} + +func (_ *GetVideoEncoderConfigurationsFunction) Request() interface{} { + return &GetVideoEncoderConfigurations{} +} +func (_ *GetVideoEncoderConfigurationsFunction) Response() interface{} { + return &GetVideoEncoderConfigurationsResponse{} +} + +type GetVideoSourceConfigurationFunction struct{} + +func (_ *GetVideoSourceConfigurationFunction) Request() interface{} { + return &GetVideoSourceConfiguration{} +} +func (_ *GetVideoSourceConfigurationFunction) Response() interface{} { + return &GetVideoSourceConfigurationResponse{} +} + +type GetVideoSourceConfigurationOptionsFunction struct{} + +func (_ *GetVideoSourceConfigurationOptionsFunction) Request() interface{} { + return &GetVideoSourceConfigurationOptions{} +} +func (_ *GetVideoSourceConfigurationOptionsFunction) Response() interface{} { + return &GetVideoSourceConfigurationOptionsResponse{} +} + +type GetVideoSourceConfigurationsFunction struct{} + +func (_ *GetVideoSourceConfigurationsFunction) Request() interface{} { + return &GetVideoSourceConfigurations{} +} +func (_ *GetVideoSourceConfigurationsFunction) Response() interface{} { + return &GetVideoSourceConfigurationsResponse{} +} + +type GetVideoSourceModesFunction struct{} + +func (_ *GetVideoSourceModesFunction) Request() interface{} { + return &GetVideoSourceModes{} +} +func (_ *GetVideoSourceModesFunction) Response() interface{} { + return &GetVideoSourceModesResponse{} +} + +type GetVideoSourcesFunction struct{} + +func (_ *GetVideoSourcesFunction) Request() interface{} { + return &GetVideoSources{} +} +func (_ *GetVideoSourcesFunction) Response() interface{} { + return &GetVideoSourcesResponse{} +} + +type RemoveAudioDecoderConfigurationFunction struct{} + +func (_ *RemoveAudioDecoderConfigurationFunction) Request() interface{} { + return &RemoveAudioDecoderConfiguration{} +} +func (_ *RemoveAudioDecoderConfigurationFunction) Response() interface{} { + return &RemoveAudioDecoderConfigurationResponse{} +} + +type RemoveAudioEncoderConfigurationFunction struct{} + +func (_ *RemoveAudioEncoderConfigurationFunction) Request() interface{} { + return &RemoveAudioEncoderConfiguration{} +} +func (_ *RemoveAudioEncoderConfigurationFunction) Response() interface{} { + return &RemoveAudioEncoderConfigurationResponse{} +} + +type RemoveAudioOutputConfigurationFunction struct{} + +func (_ *RemoveAudioOutputConfigurationFunction) Request() interface{} { + return &RemoveAudioOutputConfiguration{} +} +func (_ *RemoveAudioOutputConfigurationFunction) Response() interface{} { + return &RemoveAudioOutputConfigurationResponse{} +} + +type RemoveAudioSourceConfigurationFunction struct{} + +func (_ *RemoveAudioSourceConfigurationFunction) Request() interface{} { + return &RemoveAudioSourceConfiguration{} +} +func (_ *RemoveAudioSourceConfigurationFunction) Response() interface{} { + return &RemoveAudioSourceConfigurationResponse{} +} + +type RemoveMetadataConfigurationFunction struct{} + +func (_ *RemoveMetadataConfigurationFunction) Request() interface{} { + return &RemoveMetadataConfiguration{} +} +func (_ *RemoveMetadataConfigurationFunction) Response() interface{} { + return &RemoveMetadataConfigurationResponse{} +} + +type RemovePTZConfigurationFunction struct{} + +func (_ *RemovePTZConfigurationFunction) Request() interface{} { + return &RemovePTZConfiguration{} +} +func (_ *RemovePTZConfigurationFunction) Response() interface{} { + return &RemovePTZConfigurationResponse{} +} + +type RemoveVideoAnalyticsConfigurationFunction struct{} + +func (_ *RemoveVideoAnalyticsConfigurationFunction) Request() interface{} { + return &RemoveVideoAnalyticsConfiguration{} +} +func (_ *RemoveVideoAnalyticsConfigurationFunction) Response() interface{} { + return &RemoveVideoAnalyticsConfigurationResponse{} +} + +type RemoveVideoEncoderConfigurationFunction struct{} + +func (_ *RemoveVideoEncoderConfigurationFunction) Request() interface{} { + return &RemoveVideoEncoderConfiguration{} +} +func (_ *RemoveVideoEncoderConfigurationFunction) Response() interface{} { + return &RemoveVideoEncoderConfigurationResponse{} +} + +type RemoveVideoSourceConfigurationFunction struct{} + +func (_ *RemoveVideoSourceConfigurationFunction) Request() interface{} { + return &RemoveVideoSourceConfiguration{} +} +func (_ *RemoveVideoSourceConfigurationFunction) Response() interface{} { + return &RemoveVideoSourceConfigurationResponse{} +} + +type SetAudioDecoderConfigurationFunction struct{} + +func (_ *SetAudioDecoderConfigurationFunction) Request() interface{} { + return &SetAudioDecoderConfiguration{} +} +func (_ *SetAudioDecoderConfigurationFunction) Response() interface{} { + return &SetAudioDecoderConfigurationResponse{} +} + +type SetAudioEncoderConfigurationFunction struct{} + +func (_ *SetAudioEncoderConfigurationFunction) Request() interface{} { + return &SetAudioEncoderConfiguration{} +} +func (_ *SetAudioEncoderConfigurationFunction) Response() interface{} { + return &SetAudioEncoderConfigurationResponse{} +} + +type SetAudioOutputConfigurationFunction struct{} + +func (_ *SetAudioOutputConfigurationFunction) Request() interface{} { + return &SetAudioOutputConfiguration{} +} +func (_ *SetAudioOutputConfigurationFunction) Response() interface{} { + return &SetAudioOutputConfigurationResponse{} +} + +type SetAudioSourceConfigurationFunction struct{} + +func (_ *SetAudioSourceConfigurationFunction) Request() interface{} { + return &SetAudioSourceConfiguration{} +} +func (_ *SetAudioSourceConfigurationFunction) Response() interface{} { + return &SetAudioSourceConfigurationResponse{} +} + +type SetMetadataConfigurationFunction struct{} + +func (_ *SetMetadataConfigurationFunction) Request() interface{} { + return &SetMetadataConfiguration{} +} +func (_ *SetMetadataConfigurationFunction) Response() interface{} { + return &SetMetadataConfigurationResponse{} +} + +type SetOSDFunction struct{} + +func (_ *SetOSDFunction) Request() interface{} { + return &SetOSD{} +} +func (_ *SetOSDFunction) Response() interface{} { + return &SetOSDResponse{} +} + +type SetSynchronizationPointFunction struct{} + +func (_ *SetSynchronizationPointFunction) Request() interface{} { + return &SetSynchronizationPoint{} +} +func (_ *SetSynchronizationPointFunction) Response() interface{} { + return &SetSynchronizationPointResponse{} +} + +type SetVideoAnalyticsConfigurationFunction struct{} + +func (_ *SetVideoAnalyticsConfigurationFunction) Request() interface{} { + return &SetVideoAnalyticsConfiguration{} +} +func (_ *SetVideoAnalyticsConfigurationFunction) Response() interface{} { + return &SetVideoAnalyticsConfigurationResponse{} +} + +type SetVideoEncoderConfigurationFunction struct{} + +func (_ *SetVideoEncoderConfigurationFunction) Request() interface{} { + return &SetVideoEncoderConfiguration{} +} +func (_ *SetVideoEncoderConfigurationFunction) Response() interface{} { + return &SetVideoEncoderConfigurationResponse{} +} + +type SetVideoSourceConfigurationFunction struct{} + +func (_ *SetVideoSourceConfigurationFunction) Request() interface{} { + return &SetVideoSourceConfiguration{} +} +func (_ *SetVideoSourceConfigurationFunction) Response() interface{} { + return &SetVideoSourceConfigurationResponse{} +} + +type SetVideoSourceModeFunction struct{} + +func (_ *SetVideoSourceModeFunction) Request() interface{} { + return &SetVideoSourceMode{} +} +func (_ *SetVideoSourceModeFunction) Response() interface{} { + return &SetVideoSourceModeResponse{} +} + +type StartMulticastStreamingFunction struct{} + +func (_ *StartMulticastStreamingFunction) Request() interface{} { + return &StartMulticastStreaming{} +} +func (_ *StartMulticastStreamingFunction) Response() interface{} { + return &StartMulticastStreamingResponse{} +} + +type StopMulticastStreamingFunction struct{} + +func (_ *StopMulticastStreamingFunction) Request() interface{} { + return &StopMulticastStreaming{} +} +func (_ *StopMulticastStreamingFunction) Response() interface{} { + return &StopMulticastStreamingResponse{} +} diff --git a/media/types.go b/media/types.go index 47666606..1c9258c5 100644 --- a/media/types.go +++ b/media/types.go @@ -1,5 +1,7 @@ package media +//go:generate python3 ../python/gen_commands.py + import ( "github.com/kerberos-io/onvif/xsd" "github.com/kerberos-io/onvif/xsd/onvif" @@ -72,6 +74,8 @@ type CreateProfileResponse struct { Profile onvif.Profile } +// GetProfile and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/media/wsdl/media.wsdl#op.GetProfile type GetProfile struct { XMLName string `xml:"trt:GetProfile"` ProfileToken onvif.ReferenceToken `xml:"trt:ProfileToken"` @@ -290,6 +294,8 @@ type GetVideoAnalyticsConfigurationsResponse struct { Configurations onvif.VideoAnalyticsConfiguration } +// GetMetadataConfigurations and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/media/wsdl/media.wsdl#op.GetMetadataConfigurations type GetMetadataConfigurations struct { XMLName string `xml:"trt:GetMetadataConfigurations"` } @@ -323,6 +329,8 @@ type GetVideoSourceConfigurationResponse struct { Configuration onvif.VideoSourceConfiguration } +// GetVideoEncoderConfiguration and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/media/wsdl/media.wsdl#op.GetVideoEncoderConfiguration type GetVideoEncoderConfiguration struct { XMLName string `xml:"trt:GetVideoEncoderConfiguration"` ConfigurationToken onvif.ReferenceToken `xml:"trt:ConfigurationToken"` @@ -359,6 +367,8 @@ type GetVideoAnalyticsConfigurationResponse struct { Configuration onvif.VideoAnalyticsConfiguration } +// GetMetadataConfiguration and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/media/wsdl/media.wsdl#op.GetMetadataConfiguration type GetMetadataConfiguration struct { XMLName string `xml:"trt:GetMetadataConfiguration"` ConfigurationToken onvif.ReferenceToken `xml:"trt:ConfigurationToken"` @@ -431,6 +441,8 @@ type GetCompatibleVideoAnalyticsConfigurationsResponse struct { Configurations onvif.VideoAnalyticsConfiguration } +// GetCompatibleMetadataConfigurations and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/media/wsdl/media.wsdl#op.GetCompatibleMetadataConfigurations type GetCompatibleMetadataConfigurations struct { XMLName string `xml:"trt:GetCompatibleMetadataConfigurations"` ProfileToken onvif.ReferenceToken `xml:"trt:ProfileToken"` @@ -468,9 +480,9 @@ type SetVideoSourceConfigurationResponse struct { } type SetVideoEncoderConfiguration struct { - XMLName string `xml:"trt:SetVideoEncoderConfiguration"` - Configuration onvif.VideoEncoderConfiguration `xml:"trt:Configuration"` - ForcePersistence xsd.Boolean `xml:"trt:ForcePersistence"` + XMLName string `xml:"trt:SetVideoEncoderConfiguration"` + Configuration *onvif.VideoEncoderConfigurationRequest `xml:"trt:Configuration,omitempty"` + ForcePersistence *xsd.Boolean `xml:"trt:ForcePersistence,omitempty"` } type SetVideoEncoderConfigurationResponse struct { @@ -503,10 +515,12 @@ type SetVideoAnalyticsConfiguration struct { type SetVideoAnalyticsConfigurationResponse struct { } +// SetMetadataConfiguration and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/media/wsdl/media.wsdl#op.SetMetadataConfiguration type SetMetadataConfiguration struct { - XMLName string `xml:"trt:GetDeviceInformation"` - Configuration onvif.MetadataConfiguration `xml:"trt:Configuration"` - ForcePersistence xsd.Boolean `xml:"trt:ForcePersistence"` + XMLName string `xml:"trt:SetMetadataConfiguration"` + Configuration onvif.MetadataConfigurationRequest `xml:"trt:Configuration"` + ForcePersistence xsd.Boolean `xml:"trt:ForcePersistence"` } type SetMetadataConfigurationResponse struct { @@ -540,6 +554,8 @@ type GetVideoSourceConfigurationOptionsResponse struct { Options onvif.VideoSourceConfigurationOptions } +// GetVideoEncoderConfigurationOptions and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/media/wsdl/media.wsdl#op.GetVideoEncoderConfigurationOptions type GetVideoEncoderConfigurationOptions struct { XMLName string `xml:"trt:GetVideoEncoderConfigurationOptions"` ProfileToken onvif.ReferenceToken `xml:"trt:ProfileToken"` @@ -612,10 +628,12 @@ type GetGuaranteedNumberOfVideoEncoderInstancesResponse struct { MPEG4 int } +// GetStreamUri and its properties are defined in the Onvif specification: +// https://www.onvif.org/ver10/media/wsdl/media.wsdl#op.GetStreamUri type GetStreamUri struct { - XMLName string `xml:"trt:GetStreamUri"` - StreamSetup onvif.StreamSetup `xml:"trt:StreamSetup"` - ProfileToken onvif.ReferenceToken `xml:"trt:ProfileToken"` + XMLName string `xml:"trt:GetStreamUri"` + StreamSetup *onvif.StreamSetup `xml:"trt:StreamSetup"` + ProfileToken *onvif.ReferenceToken `xml:"trt:ProfileToken"` } type GetStreamUriResponse struct { diff --git a/media2/function.go b/media2/function.go new file mode 100644 index 00000000..83e74231 --- /dev/null +++ b/media2/function.go @@ -0,0 +1,45 @@ +// -*- Mode: Go; indent-tabs-mode: t -*- +// +// Copyright (C) 2022 Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by gen_commands.py DO NOT EDIT. + +package media2 + +type AddConfigurationFunction struct{} + +func (_ *AddConfigurationFunction) Request() interface{} { + return &AddConfiguration{} +} +func (_ *AddConfigurationFunction) Response() interface{} { + return &AddConfigurationResponse{} +} + +type GetAnalyticsConfigurationsFunction struct{} + +func (_ *GetAnalyticsConfigurationsFunction) Request() interface{} { + return &GetAnalyticsConfigurations{} +} +func (_ *GetAnalyticsConfigurationsFunction) Response() interface{} { + return &GetAnalyticsConfigurationsResponse{} +} + +type GetProfilesFunction struct{} + +func (_ *GetProfilesFunction) Request() interface{} { + return &GetProfiles{} +} +func (_ *GetProfilesFunction) Response() interface{} { + return &GetProfilesResponse{} +} + +type RemoveConfigurationFunction struct{} + +func (_ *RemoveConfigurationFunction) Request() interface{} { + return &RemoveConfiguration{} +} +func (_ *RemoveConfigurationFunction) Response() interface{} { + return &RemoveConfigurationResponse{} +} diff --git a/media2/types.go b/media2/types.go new file mode 100644 index 00000000..178bb913 --- /dev/null +++ b/media2/types.go @@ -0,0 +1,93 @@ +package media2 + +//go:generate python3 ../python/gen_commands.py + +import ( + "github.com/kerberos-io/onvif/xsd" + "github.com/kerberos-io/onvif/xsd/onvif" +) + +type GetProfiles struct { + XMLName string `xml:"tr2:GetProfiles"` +} + +type GetProfilesResponse struct { + Profiles []Profile +} + +type Profile struct { + Token string `xml:"token,attr"` + Fixed bool `xml:"fixed,attr"` + Name string +} + +type GetAnalyticsConfigurations struct { + XMLName string `xml:"tr2:GetAnalyticsConfigurations"` +} + +type GetAnalyticsConfigurationsResponse struct { + Configurations []Configurations +} + +type Configurations struct { + onvif.ConfigurationEntity + AnalyticsEngineConfiguration *AnalyticsEngineConfiguration `json:",omitempty"` + RuleEngineConfiguration *RuleEngineConfiguration `json:",omitempty"` +} + +type AnalyticsEngineConfiguration struct { + AnalyticsModule []AnalyticsModule +} + +type AnalyticsModule struct { + Name string `xml:",attr"` + Type string `xml:",attr"` + Parameters Parameters +} + +type RuleEngineConfiguration struct { + Rule []Rule `json:",omitempty"` +} + +type Rule struct { + Name string `xml:",attr"` + Type string `xml:",attr"` + Parameters Parameters +} + +type Parameters struct { + SimpleItem []SimpleItem `json:",omitempty"` + ElementItem []ElementItem `json:",omitempty"` +} + +type SimpleItem struct { + Name string `xml:",attr"` + Value string `xml:",attr"` +} + +type ElementItem struct { + Name string `xml:",attr"` +} + +type AddConfiguration struct { + XMLName string `xml:"tr2:AddConfiguration"` + ProfileToken string `xml:"tr2:ProfileToken"` + Name string `xml:"tr2:Name,omitempty"` + Configuration []Configuration +} + +type AddConfigurationResponse struct{} + +type RemoveConfiguration struct { + XMLName string `xml:"tr2:RemoveConfiguration"` + ProfileToken string `xml:"tr2:ProfileToken"` + Configuration []Configuration +} + +type RemoveConfigurationResponse struct{} + +type Configuration struct { + XMLName xsd.String `xml:"tr2:Configuration"` + Type *xsd.String `xml:"tr2:Type,omitempty"` + Token *xsd.String `xml:"tr2:Token,omitempty"` +} diff --git a/media2/types_test.go b/media2/types_test.go new file mode 100644 index 00000000..9db97a79 --- /dev/null +++ b/media2/types_test.go @@ -0,0 +1,134 @@ +package media2 + +import ( + "encoding/xml" + "fmt" + "testing" + + "github.com/kerberos-io/onvif/xsd" + "github.com/kerberos-io/onvif/xsd/onvif" + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestUnmarshalGetProfilesResponse(t *testing.T) { + profile1Name := "H26x_L1S1" + profile1Token := "profile_1" + profile1Fixed := false + profile2Name := "JPEG_L1S3" + profile2Token := "profile_2" + profile2Fixed := true + GetProfilesResponseData := fmt.Sprintf(` + + %s + %s + + `, profile1Token, profile1Fixed, profile1Name, profile2Token, profile2Fixed, profile2Name) + + getProfilesResponse := &GetProfilesResponse{} + err := xml.Unmarshal([]byte(GetProfilesResponseData), getProfilesResponse) + require.NoError(t, err) + + assert.Equal(t, getProfilesResponse.Profiles[0].Token, profile1Token) + assert.Equal(t, getProfilesResponse.Profiles[0].Fixed, profile1Fixed) + assert.Equal(t, getProfilesResponse.Profiles[0].Name, profile1Name) + assert.Equal(t, getProfilesResponse.Profiles[1].Token, profile2Token) + assert.Equal(t, getProfilesResponse.Profiles[1].Fixed, profile2Fixed) + assert.Equal(t, getProfilesResponse.Profiles[1].Name, profile2Name) +} + +func TestUnmarshalGetAnalyticsConfigurationsResponse(t *testing.T) { + configToken := onvif.ReferenceToken("token_1") + configName := onvif.Name("Analytics_1") + useCount := 0 + analyticsModuleName := "Viproc" + analyticsModuleType := "tt:Viproc" + analyticsModuleItemName := "AnalysisType" + analyticsModuleItemValue := "Intelligent Video Analytics" + ruleName := "The Min ObjectHeight" + ruleType := "tt:ObjectInField" + ruleItemName := "MaxObjectHeight" + ruleItemValue := "100" + + responseData := fmt.Sprintf(` + + + %s + %d + + + + + + + + + + + + + + + + + `, configToken, configName, useCount, analyticsModuleName, analyticsModuleType, analyticsModuleItemName, analyticsModuleItemValue, + ruleName, ruleType, ruleItemName, ruleItemValue) + + response := &GetAnalyticsConfigurationsResponse{} + err := xml.Unmarshal([]byte(responseData), response) + require.NoError(t, err) + + assert.Equal(t, response.Configurations[0].Token, configToken) + assert.Equal(t, response.Configurations[0].Name, configName) + assert.Equal(t, response.Configurations[0].AnalyticsEngineConfiguration.AnalyticsModule[0].Name, analyticsModuleName) + assert.Equal(t, response.Configurations[0].AnalyticsEngineConfiguration.AnalyticsModule[0].Type, analyticsModuleType) + assert.Equal(t, response.Configurations[0].AnalyticsEngineConfiguration.AnalyticsModule[0].Parameters.SimpleItem[0].Name, analyticsModuleItemName) + assert.Equal(t, response.Configurations[0].AnalyticsEngineConfiguration.AnalyticsModule[0].Parameters.SimpleItem[0].Value, analyticsModuleItemValue) + assert.Equal(t, response.Configurations[0].RuleEngineConfiguration.Rule[0].Name, ruleName) + assert.Equal(t, response.Configurations[0].RuleEngineConfiguration.Rule[0].Type, ruleType) + assert.Equal(t, response.Configurations[0].RuleEngineConfiguration.Rule[0].Parameters.SimpleItem[0].Name, ruleItemName) + assert.Equal(t, response.Configurations[0].RuleEngineConfiguration.Rule[0].Parameters.SimpleItem[0].Value, ruleItemValue) +} + +func TestMarshalAddConfigurationRequest(t *testing.T) { + analyticsType := xsd.String("Analytics") + analyticsToken := xsd.String("AnalyticsToken") + request := AddConfiguration{ + ProfileToken: "profile_1", + Configuration: []Configuration{ + { + Type: &analyticsType, + Token: &analyticsToken, + }, + }, + } + expected := fmt.Sprintf("%s%s%s", + request.ProfileToken, *request.Configuration[0].Type, *request.Configuration[0].Token) + + data, err := xml.Marshal(request) + require.NoError(t, err) + + assert.Equal(t, expected, string(data)) + +} + +func TestMarshalRemoveConfigurationRequest(t *testing.T) { + analyticsType := xsd.String("Analytics") + analyticsToken := xsd.String("AnalyticsToken") + request := RemoveConfiguration{ + ProfileToken: "profile_1", + Configuration: []Configuration{ + { + Type: &analyticsType, + Token: &analyticsToken, + }, + }, + } + expected := fmt.Sprintf("%s%s%s", + request.ProfileToken, *request.Configuration[0].Type, *request.Configuration[0].Token) + + data, err := xml.Marshal(request) + require.NoError(t, err) + + assert.Equal(t, expected, string(data)) +} diff --git a/names.go b/names.go new file mode 100644 index 00000000..e3cbaeab --- /dev/null +++ b/names.go @@ -0,0 +1,297 @@ +// -*- Mode: Go; indent-tabs-mode: t -*- +// +// Copyright (C) 2022 Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by gen_commands.py DO NOT EDIT. + +package onvif + +// Onvif WebService +const ( + AnalyticsWebService = "Analytics" + DeviceWebService = "Device" + EventWebService = "Event" + ImagingWebService = "Imaging" + MediaWebService = "Media" + Media2WebService = "Media2" + PTZWebService = "PTZ" + RecordingWebService = "Recording" +) + +// WebService - Analytics +const ( + CreateAnalyticsModules = "CreateAnalyticsModules" + CreateRules = "CreateRules" + DeleteAnalyticsModules = "DeleteAnalyticsModules" + DeleteRules = "DeleteRules" + GetAnalyticsModuleOptions = "GetAnalyticsModuleOptions" + GetAnalyticsModules = "GetAnalyticsModules" + GetRuleOptions = "GetRuleOptions" + GetRules = "GetRules" + GetSupportedAnalyticsModules = "GetSupportedAnalyticsModules" + GetSupportedRules = "GetSupportedRules" + ModifyAnalyticsModules = "ModifyAnalyticsModules" + ModifyRules = "ModifyRules" +) + +// WebService - Device +const ( + AddIPAddressFilter = "AddIPAddressFilter" + AddScopes = "AddScopes" + CreateCertificate = "CreateCertificate" + CreateDot1XConfiguration = "CreateDot1XConfiguration" + CreateStorageConfiguration = "CreateStorageConfiguration" + CreateUsers = "CreateUsers" + DeleteCertificates = "DeleteCertificates" + DeleteDot1XConfiguration = "DeleteDot1XConfiguration" + DeleteGeoLocation = "DeleteGeoLocation" + DeleteStorageConfiguration = "DeleteStorageConfiguration" + DeleteUsers = "DeleteUsers" + GetAccessPolicy = "GetAccessPolicy" + GetCACertificates = "GetCACertificates" + GetCapabilities = "GetCapabilities" + GetCertificateInformation = "GetCertificateInformation" + GetCertificates = "GetCertificates" + GetCertificatesStatus = "GetCertificatesStatus" + GetClientCertificateMode = "GetClientCertificateMode" + GetDNS = "GetDNS" + GetDPAddresses = "GetDPAddresses" + GetDeviceInformation = "GetDeviceInformation" + GetDiscoveryMode = "GetDiscoveryMode" + GetDot11Capabilities = "GetDot11Capabilities" + GetDot11Status = "GetDot11Status" + GetDot1XConfiguration = "GetDot1XConfiguration" + GetDot1XConfigurations = "GetDot1XConfigurations" + GetDynamicDNS = "GetDynamicDNS" + GetEndpointReference = "GetEndpointReference" + GetGeoLocation = "GetGeoLocation" + GetHostname = "GetHostname" + GetIPAddressFilter = "GetIPAddressFilter" + GetNTP = "GetNTP" + GetNetworkDefaultGateway = "GetNetworkDefaultGateway" + GetNetworkInterfaces = "GetNetworkInterfaces" + GetNetworkProtocols = "GetNetworkProtocols" + GetPkcs10Request = "GetPkcs10Request" + GetRelayOutputs = "GetRelayOutputs" + GetRemoteDiscoveryMode = "GetRemoteDiscoveryMode" + GetRemoteUser = "GetRemoteUser" + GetScopes = "GetScopes" + GetServiceCapabilities = "GetServiceCapabilities" + GetServices = "GetServices" + GetStorageConfiguration = "GetStorageConfiguration" + GetStorageConfigurations = "GetStorageConfigurations" + GetSystemBackup = "GetSystemBackup" + GetSystemDateAndTime = "GetSystemDateAndTime" + GetSystemLog = "GetSystemLog" + GetSystemSupportInformation = "GetSystemSupportInformation" + GetSystemUris = "GetSystemUris" + GetUsers = "GetUsers" + GetWsdlUrl = "GetWsdlUrl" + GetZeroConfiguration = "GetZeroConfiguration" + LoadCACertificates = "LoadCACertificates" + LoadCertificateWithPrivateKey = "LoadCertificateWithPrivateKey" + LoadCertificates = "LoadCertificates" + RemoveIPAddressFilter = "RemoveIPAddressFilter" + RemoveScopes = "RemoveScopes" + RestoreSystem = "RestoreSystem" + ScanAvailableDot11Networks = "ScanAvailableDot11Networks" + SendAuxiliaryCommand = "SendAuxiliaryCommand" + SetAccessPolicy = "SetAccessPolicy" + SetCertificatesStatus = "SetCertificatesStatus" + SetClientCertificateMode = "SetClientCertificateMode" + SetDNS = "SetDNS" + SetDPAddresses = "SetDPAddresses" + SetDiscoveryMode = "SetDiscoveryMode" + SetDot1XConfiguration = "SetDot1XConfiguration" + SetDynamicDNS = "SetDynamicDNS" + SetGeoLocation = "SetGeoLocation" + SetHostname = "SetHostname" + SetHostnameFromDHCP = "SetHostnameFromDHCP" + SetIPAddressFilter = "SetIPAddressFilter" + SetNTP = "SetNTP" + SetNetworkDefaultGateway = "SetNetworkDefaultGateway" + SetNetworkInterfaces = "SetNetworkInterfaces" + SetNetworkProtocols = "SetNetworkProtocols" + SetRelayOutputSettings = "SetRelayOutputSettings" + SetRelayOutputState = "SetRelayOutputState" + SetRemoteDiscoveryMode = "SetRemoteDiscoveryMode" + SetRemoteUser = "SetRemoteUser" + SetScopes = "SetScopes" + SetStorageConfiguration = "SetStorageConfiguration" + SetSystemDateAndTime = "SetSystemDateAndTime" + SetSystemFactoryDefault = "SetSystemFactoryDefault" + SetUser = "SetUser" + SetZeroConfiguration = "SetZeroConfiguration" + StartFirmwareUpgrade = "StartFirmwareUpgrade" + StartSystemRestore = "StartSystemRestore" + SystemReboot = "SystemReboot" + UpgradeSystemFirmware = "UpgradeSystemFirmware" +) + +// WebService - Event +const ( + CreatePullPointSubscription = "CreatePullPointSubscription" + GetEventProperties = "GetEventProperties" + PullMessages = "PullMessages" + Renew = "Renew" + Seek = "Seek" + SetSynchronizationPoint = "SetSynchronizationPoint" + Subscribe = "Subscribe" + SubscriptionReference = "SubscriptionReference" + Unsubscribe = "Unsubscribe" +) + +// WebService - Imaging +const ( + GetCurrentPreset = "GetCurrentPreset" + GetImagingSettings = "GetImagingSettings" + GetMoveOptions = "GetMoveOptions" + GetOptions = "GetOptions" + GetPresets = "GetPresets" + GetStatus = "GetStatus" + Move = "Move" + SetCurrentPreset = "SetCurrentPreset" + SetImagingSettings = "SetImagingSettings" + Stop = "Stop" +) + +// WebService - Media +const ( + AddAudioDecoderConfiguration = "AddAudioDecoderConfiguration" + AddAudioEncoderConfiguration = "AddAudioEncoderConfiguration" + AddAudioOutputConfiguration = "AddAudioOutputConfiguration" + AddAudioSourceConfiguration = "AddAudioSourceConfiguration" + AddMetadataConfiguration = "AddMetadataConfiguration" + AddPTZConfiguration = "AddPTZConfiguration" + AddVideoAnalyticsConfiguration = "AddVideoAnalyticsConfiguration" + AddVideoEncoderConfiguration = "AddVideoEncoderConfiguration" + AddVideoSourceConfiguration = "AddVideoSourceConfiguration" + CreateOSD = "CreateOSD" + CreateProfile = "CreateProfile" + DeleteOSD = "DeleteOSD" + DeleteProfile = "DeleteProfile" + GetAudioDecoderConfiguration = "GetAudioDecoderConfiguration" + GetAudioDecoderConfigurationOptions = "GetAudioDecoderConfigurationOptions" + GetAudioDecoderConfigurations = "GetAudioDecoderConfigurations" + GetAudioEncoderConfiguration = "GetAudioEncoderConfiguration" + GetAudioEncoderConfigurationOptions = "GetAudioEncoderConfigurationOptions" + GetAudioEncoderConfigurations = "GetAudioEncoderConfigurations" + GetAudioOutputConfiguration = "GetAudioOutputConfiguration" + GetAudioOutputConfigurationOptions = "GetAudioOutputConfigurationOptions" + GetAudioOutputConfigurations = "GetAudioOutputConfigurations" + GetAudioOutputs = "GetAudioOutputs" + GetAudioSourceConfiguration = "GetAudioSourceConfiguration" + GetAudioSourceConfigurationOptions = "GetAudioSourceConfigurationOptions" + GetAudioSourceConfigurations = "GetAudioSourceConfigurations" + GetAudioSources = "GetAudioSources" + GetCompatibleAudioDecoderConfigurations = "GetCompatibleAudioDecoderConfigurations" + GetCompatibleAudioEncoderConfigurations = "GetCompatibleAudioEncoderConfigurations" + GetCompatibleAudioOutputConfigurations = "GetCompatibleAudioOutputConfigurations" + GetCompatibleAudioSourceConfigurations = "GetCompatibleAudioSourceConfigurations" + GetCompatibleMetadataConfigurations = "GetCompatibleMetadataConfigurations" + GetCompatibleVideoAnalyticsConfigurations = "GetCompatibleVideoAnalyticsConfigurations" + GetCompatibleVideoEncoderConfigurations = "GetCompatibleVideoEncoderConfigurations" + GetCompatibleVideoSourceConfigurations = "GetCompatibleVideoSourceConfigurations" + GetGuaranteedNumberOfVideoEncoderInstances = "GetGuaranteedNumberOfVideoEncoderInstances" + GetMetadataConfiguration = "GetMetadataConfiguration" + GetMetadataConfigurationOptions = "GetMetadataConfigurationOptions" + GetMetadataConfigurations = "GetMetadataConfigurations" + GetOSD = "GetOSD" + GetOSDOptions = "GetOSDOptions" + GetOSDs = "GetOSDs" + GetProfile = "GetProfile" + GetProfiles = "GetProfiles" + GetSnapshotUri = "GetSnapshotUri" + GetStreamUri = "GetStreamUri" + GetVideoAnalyticsConfiguration = "GetVideoAnalyticsConfiguration" + GetVideoAnalyticsConfigurations = "GetVideoAnalyticsConfigurations" + GetVideoEncoderConfiguration = "GetVideoEncoderConfiguration" + GetVideoEncoderConfigurationOptions = "GetVideoEncoderConfigurationOptions" + GetVideoEncoderConfigurations = "GetVideoEncoderConfigurations" + GetVideoSourceConfiguration = "GetVideoSourceConfiguration" + GetVideoSourceConfigurationOptions = "GetVideoSourceConfigurationOptions" + GetVideoSourceConfigurations = "GetVideoSourceConfigurations" + GetVideoSourceModes = "GetVideoSourceModes" + GetVideoSources = "GetVideoSources" + RemoveAudioDecoderConfiguration = "RemoveAudioDecoderConfiguration" + RemoveAudioEncoderConfiguration = "RemoveAudioEncoderConfiguration" + RemoveAudioOutputConfiguration = "RemoveAudioOutputConfiguration" + RemoveAudioSourceConfiguration = "RemoveAudioSourceConfiguration" + RemoveMetadataConfiguration = "RemoveMetadataConfiguration" + RemovePTZConfiguration = "RemovePTZConfiguration" + RemoveVideoAnalyticsConfiguration = "RemoveVideoAnalyticsConfiguration" + RemoveVideoEncoderConfiguration = "RemoveVideoEncoderConfiguration" + RemoveVideoSourceConfiguration = "RemoveVideoSourceConfiguration" + SetAudioDecoderConfiguration = "SetAudioDecoderConfiguration" + SetAudioEncoderConfiguration = "SetAudioEncoderConfiguration" + SetAudioOutputConfiguration = "SetAudioOutputConfiguration" + SetAudioSourceConfiguration = "SetAudioSourceConfiguration" + SetMetadataConfiguration = "SetMetadataConfiguration" + SetOSD = "SetOSD" + SetVideoAnalyticsConfiguration = "SetVideoAnalyticsConfiguration" + SetVideoEncoderConfiguration = "SetVideoEncoderConfiguration" + SetVideoSourceConfiguration = "SetVideoSourceConfiguration" + SetVideoSourceMode = "SetVideoSourceMode" + StartMulticastStreaming = "StartMulticastStreaming" + StopMulticastStreaming = "StopMulticastStreaming" +) + +// WebService - Media2 +const ( + AddConfiguration = "AddConfiguration" + GetAnalyticsConfigurations = "GetAnalyticsConfigurations" + RemoveConfiguration = "RemoveConfiguration" +) + +// WebService - PTZ +const ( + AbsoluteMove = "AbsoluteMove" + ContinuousMove = "ContinuousMove" + CreatePresetTour = "CreatePresetTour" + GeoMove = "GeoMove" + GetCompatibleConfigurations = "GetCompatibleConfigurations" + GetConfiguration = "GetConfiguration" + GetConfigurationOptions = "GetConfigurationOptions" + GetConfigurations = "GetConfigurations" + GetNode = "GetNode" + GetNodes = "GetNodes" + GetPresetTour = "GetPresetTour" + GetPresetTourOptions = "GetPresetTourOptions" + GetPresetTours = "GetPresetTours" + GotoHomePosition = "GotoHomePosition" + GotoPreset = "GotoPreset" + ModifyPresetTour = "ModifyPresetTour" + OperatePresetTour = "OperatePresetTour" + RelativeMove = "RelativeMove" + RemovePreset = "RemovePreset" + RemovePresetTour = "RemovePresetTour" + SetConfiguration = "SetConfiguration" + SetHomePosition = "SetHomePosition" + SetPreset = "SetPreset" +) + +// WebService - Recording +const ( + CreateRecording = "CreateRecording" + CreateRecordingJob = "CreateRecordingJob" + CreateTrack = "CreateTrack" + DeleteRecording = "DeleteRecording" + DeleteRecordingJob = "DeleteRecordingJob" + DeleteTrack = "DeleteTrack" + ExportRecordedData = "ExportRecordedData" + GetExportRecordedDataState = "GetExportRecordedDataState" + GetRecordingConfiguration = "GetRecordingConfiguration" + GetRecordingJobConfiguration = "GetRecordingJobConfiguration" + GetRecordingJobState = "GetRecordingJobState" + GetRecordingJobs = "GetRecordingJobs" + GetRecordingOptions = "GetRecordingOptions" + GetRecordings = "GetRecordings" + GetTrackConfiguration = "GetTrackConfiguration" + SetRecordingConfiguration = "SetRecordingConfiguration" + SetRecordingJobConfiguration = "SetRecordingJobConfiguration" + SetRecordingJobMode = "SetRecordingJobMode" + SetTrackConfiguration = "SetTrackConfiguration" + StopExportRecordedData = "StopExportRecordedData" +) diff --git a/networking/networking.go b/networking/networking.go index f86f4e05..7e1aef20 100644 --- a/networking/networking.go +++ b/networking/networking.go @@ -3,15 +3,13 @@ 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, errors.Annotate(err, "Post") + return resp, err } return resp, nil diff --git a/ptz/function.go b/ptz/function.go new file mode 100644 index 00000000..0143d1b9 --- /dev/null +++ b/ptz/function.go @@ -0,0 +1,261 @@ +// -*- Mode: Go; indent-tabs-mode: t -*- +// +// Copyright (C) 2022 Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by gen_commands.py DO NOT EDIT. + +package ptz + +type AbsoluteMoveFunction struct{} + +func (_ *AbsoluteMoveFunction) Request() interface{} { + return &AbsoluteMove{} +} +func (_ *AbsoluteMoveFunction) Response() interface{} { + return &AbsoluteMoveResponse{} +} + +type ContinuousMoveFunction struct{} + +func (_ *ContinuousMoveFunction) Request() interface{} { + return &ContinuousMove{} +} +func (_ *ContinuousMoveFunction) Response() interface{} { + return &ContinuousMoveResponse{} +} + +type CreatePresetTourFunction struct{} + +func (_ *CreatePresetTourFunction) Request() interface{} { + return &CreatePresetTour{} +} +func (_ *CreatePresetTourFunction) Response() interface{} { + return &CreatePresetTourResponse{} +} + +type GeoMoveFunction struct{} + +func (_ *GeoMoveFunction) Request() interface{} { + return &GeoMove{} +} +func (_ *GeoMoveFunction) Response() interface{} { + return &GeoMoveResponse{} +} + +type GetCompatibleConfigurationsFunction struct{} + +func (_ *GetCompatibleConfigurationsFunction) Request() interface{} { + return &GetCompatibleConfigurations{} +} +func (_ *GetCompatibleConfigurationsFunction) Response() interface{} { + return &GetCompatibleConfigurationsResponse{} +} + +type GetConfigurationFunction struct{} + +func (_ *GetConfigurationFunction) Request() interface{} { + return &GetConfiguration{} +} +func (_ *GetConfigurationFunction) Response() interface{} { + return &GetConfigurationResponse{} +} + +type GetConfigurationOptionsFunction struct{} + +func (_ *GetConfigurationOptionsFunction) Request() interface{} { + return &GetConfigurationOptions{} +} +func (_ *GetConfigurationOptionsFunction) Response() interface{} { + return &GetConfigurationOptionsResponse{} +} + +type GetConfigurationsFunction struct{} + +func (_ *GetConfigurationsFunction) Request() interface{} { + return &GetConfigurations{} +} +func (_ *GetConfigurationsFunction) Response() interface{} { + return &GetConfigurationsResponse{} +} + +type GetNodeFunction struct{} + +func (_ *GetNodeFunction) Request() interface{} { + return &GetNode{} +} +func (_ *GetNodeFunction) Response() interface{} { + return &GetNodeResponse{} +} + +type GetNodesFunction struct{} + +func (_ *GetNodesFunction) Request() interface{} { + return &GetNodes{} +} +func (_ *GetNodesFunction) Response() interface{} { + return &GetNodesResponse{} +} + +type GetPresetTourFunction struct{} + +func (_ *GetPresetTourFunction) Request() interface{} { + return &GetPresetTour{} +} +func (_ *GetPresetTourFunction) Response() interface{} { + return &GetPresetTourResponse{} +} + +type GetPresetTourOptionsFunction struct{} + +func (_ *GetPresetTourOptionsFunction) Request() interface{} { + return &GetPresetTourOptions{} +} +func (_ *GetPresetTourOptionsFunction) Response() interface{} { + return &GetPresetTourOptionsResponse{} +} + +type GetPresetToursFunction struct{} + +func (_ *GetPresetToursFunction) Request() interface{} { + return &GetPresetTours{} +} +func (_ *GetPresetToursFunction) Response() interface{} { + return &GetPresetToursResponse{} +} + +type GetPresetsFunction struct{} + +func (_ *GetPresetsFunction) Request() interface{} { + return &GetPresets{} +} +func (_ *GetPresetsFunction) Response() interface{} { + return &GetPresetsResponse{} +} + +type GetServiceCapabilitiesFunction struct{} + +func (_ *GetServiceCapabilitiesFunction) Request() interface{} { + return &GetServiceCapabilities{} +} +func (_ *GetServiceCapabilitiesFunction) Response() interface{} { + return &GetServiceCapabilitiesResponse{} +} + +type GetStatusFunction struct{} + +func (_ *GetStatusFunction) Request() interface{} { + return &GetStatus{} +} +func (_ *GetStatusFunction) Response() interface{} { + return &GetStatusResponse{} +} + +type GotoHomePositionFunction struct{} + +func (_ *GotoHomePositionFunction) Request() interface{} { + return &GotoHomePosition{} +} +func (_ *GotoHomePositionFunction) Response() interface{} { + return &GotoHomePositionResponse{} +} + +type GotoPresetFunction struct{} + +func (_ *GotoPresetFunction) Request() interface{} { + return &GotoPreset{} +} +func (_ *GotoPresetFunction) Response() interface{} { + return &GotoPresetResponse{} +} + +type ModifyPresetTourFunction struct{} + +func (_ *ModifyPresetTourFunction) Request() interface{} { + return &ModifyPresetTour{} +} +func (_ *ModifyPresetTourFunction) Response() interface{} { + return &ModifyPresetTourResponse{} +} + +type OperatePresetTourFunction struct{} + +func (_ *OperatePresetTourFunction) Request() interface{} { + return &OperatePresetTour{} +} +func (_ *OperatePresetTourFunction) Response() interface{} { + return &OperatePresetTourResponse{} +} + +type RelativeMoveFunction struct{} + +func (_ *RelativeMoveFunction) Request() interface{} { + return &RelativeMove{} +} +func (_ *RelativeMoveFunction) Response() interface{} { + return &RelativeMoveResponse{} +} + +type RemovePresetFunction struct{} + +func (_ *RemovePresetFunction) Request() interface{} { + return &RemovePreset{} +} +func (_ *RemovePresetFunction) Response() interface{} { + return &RemovePresetResponse{} +} + +type RemovePresetTourFunction struct{} + +func (_ *RemovePresetTourFunction) Request() interface{} { + return &RemovePresetTour{} +} +func (_ *RemovePresetTourFunction) Response() interface{} { + return &RemovePresetTourResponse{} +} + +type SendAuxiliaryCommandFunction struct{} + +func (_ *SendAuxiliaryCommandFunction) Request() interface{} { + return &SendAuxiliaryCommand{} +} +func (_ *SendAuxiliaryCommandFunction) Response() interface{} { + return &SendAuxiliaryCommandResponse{} +} + +type SetConfigurationFunction struct{} + +func (_ *SetConfigurationFunction) Request() interface{} { + return &SetConfiguration{} +} +func (_ *SetConfigurationFunction) Response() interface{} { + return &SetConfigurationResponse{} +} + +type SetHomePositionFunction struct{} + +func (_ *SetHomePositionFunction) Request() interface{} { + return &SetHomePosition{} +} +func (_ *SetHomePositionFunction) Response() interface{} { + return &SetHomePositionResponse{} +} + +type SetPresetFunction struct{} + +func (_ *SetPresetFunction) Request() interface{} { + return &SetPreset{} +} +func (_ *SetPresetFunction) Response() interface{} { + return &SetPresetResponse{} +} + +type StopFunction struct{} + +func (_ *StopFunction) Request() interface{} { + return &Stop{} +} +func (_ *StopFunction) Response() interface{} { + return &StopResponse{} +} diff --git a/ptz/types.go b/ptz/types.go index f21dd571..e07c3fc5 100644 --- a/ptz/types.go +++ b/ptz/types.go @@ -1,5 +1,7 @@ package ptz +//go:generate python3 ../python/gen_commands.py + import ( "github.com/kerberos-io/onvif/xsd" "github.com/kerberos-io/onvif/xsd/onvif" @@ -28,7 +30,7 @@ type GetNodes struct { } type GetNodesResponse struct { - PTZNode onvif.PTZNode + PTZNode []onvif.PTZNode } type GetNode struct { @@ -41,8 +43,8 @@ type GetNodeResponse struct { } type GetConfiguration struct { - XMLName string `xml:"tptz:GetConfiguration"` - ProfileToken onvif.ReferenceToken `xml:"tptz:ProfileToken"` + XMLName string `xml:"tptz:GetConfiguration"` + PTZConfigurationToken onvif.ReferenceToken `xml:"tptz:PTZConfigurationToken"` } type GetConfigurationResponse struct { @@ -54,7 +56,7 @@ type GetConfigurations struct { } type GetConfigurationsResponse struct { - PTZConfiguration onvif.PTZConfiguration + PTZConfiguration []onvif.PTZConfiguration } type SetConfiguration struct { @@ -67,8 +69,8 @@ type SetConfigurationResponse struct { } type GetConfigurationOptions struct { - XMLName string `xml:"tptz:GetConfigurationOptions"` - ProfileToken onvif.ReferenceToken `xml:"tptz:ProfileToken"` + XMLName string `xml:"tptz:GetConfigurationOptions"` + ConfigurationToken onvif.ReferenceToken `xml:"tptz:ConfigurationToken"` } type GetConfigurationOptionsResponse struct { @@ -95,10 +97,10 @@ type GetPresetsResponse struct { } 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,omitempty"` + XMLName string `xml:"tptz:SetPreset"` + ProfileToken *onvif.ReferenceToken `xml:"tptz:ProfileToken,omitempty"` + PresetName *xsd.String `xml:"tptz:PresetName,omitempty"` + PresetToken *onvif.ReferenceToken `xml:"tptz:PresetToken,omitempty"` } type SetPresetResponse struct { @@ -115,19 +117,19 @@ type RemovePresetResponse struct { } type GotoPreset struct { - XMLName string `xml:"tptz:GotoPreset"` - ProfileToken onvif.ReferenceToken `xml:"tptz:ProfileToken"` - PresetToken onvif.ReferenceToken `xml:"tptz:PresetToken"` - Speed onvif.PTZSpeed `xml:"tptz:Speed"` + XMLName string `xml:"tptz:GotoPreset,omitempty"` + ProfileToken *onvif.ReferenceToken `xml:"tptz:ProfileToken,omitempty"` + PresetToken *onvif.ReferenceToken `xml:"tptz:PresetToken,omitempty"` + Speed *onvif.PTZSpeed `xml:"tptz:Speed,omitempty"` } type GotoPresetResponse struct { } type GotoHomePosition struct { - XMLName string `xml:"tptz:GotoHomePosition"` - ProfileToken onvif.ReferenceToken `xml:"tptz:ProfileToken"` - Speed onvif.PTZSpeed `xml:"tptz:Speed"` + XMLName string `xml:"tptz:GotoHomePosition"` + ProfileToken *onvif.ReferenceToken `xml:"tptz:ProfileToken,omitempty"` + Speed *onvif.PTZSpeed `xml:"tptz:Speed,omitempty"` } type GotoHomePositionResponse struct { @@ -142,20 +144,20 @@ type SetHomePositionResponse struct { } type ContinuousMove struct { - XMLName string `xml:"tptz:ContinuousMove"` - ProfileToken onvif.ReferenceToken `xml:"tptz:ProfileToken"` - Velocity onvif.PTZSpeed `xml:"tptz:Velocity"` - //Timeout xsd.Duration `xml:"tptz:Timeout"` + XMLName string `xml:"tptz:ContinuousMove"` + ProfileToken *onvif.ReferenceToken `xml:"tptz:ProfileToken,omitempty"` + Velocity onvif.PTZSpeed `xml:"tptz:Velocity,omitempty"` + Timeout *xsd.Duration `xml:"tptz:Timeout,omitempty"` } type ContinuousMoveResponse struct { } type RelativeMove struct { - XMLName string `xml:"tptz:RelativeMove,omitempty"` - ProfileToken onvif.ReferenceToken `xml:"tptz:ProfileToken,omitempty"` - Translation onvif.PTZVector `xml:"tptz:Translation,omitempty"` - Speed onvif.PTZSpeed `xml:"tptz:Speed,omitempty"` + XMLName string `xml:"tptz:RelativeMove"` + ProfileToken onvif.ReferenceToken `xml:"tptz:ProfileToken"` + Translation Vector `json:",omitempty" xml:"tptz:Translation,omitempty"` + Speed Speed `json:",omitempty" xml:"tptz:Speed,omitempty"` } type RelativeMoveResponse struct { @@ -177,6 +179,16 @@ type AbsoluteMove struct { Speed onvif.PTZSpeed `xml:"tptz:Speed"` } +type Vector struct { + PanTilt *onvif.Vector2D `json:",omitempty" xml:"onvif:PanTilt,omitempty"` + Zoom *onvif.Vector1D `json:",omitempty" xml:"onvif:Zoom,omitempty"` +} + +type Speed struct { + PanTilt *onvif.Vector2D `json:",omitempty" xml:"onvif:PanTilt,omitempty"` + Zoom *onvif.Vector1D `json:",omitempty" xml:"onvif:Zoom,omitempty"` +} + type AbsoluteMoveResponse struct { } diff --git a/python/Makefile b/python/Makefile new file mode 100644 index 00000000..28929c80 --- /dev/null +++ b/python/Makefile @@ -0,0 +1,11 @@ +# Copyright (C) 2022 Intel Corporation +# +# SPDX-License-Identifier: Apache-2.0 + +.PHONY: gen + +gen: + python3 gen_commands.py + which go + go fmt ../... + diff --git a/python/gen_commands.py b/python/gen_commands.py new file mode 100755 index 00000000..e0be6902 --- /dev/null +++ b/python/gen_commands.py @@ -0,0 +1,149 @@ +#!/usr/bin/env python3 + +import dataclasses +import pathlib +import re +import subprocess + + +# license header to use for generated go files +HEADER = '''\ +// -*- Mode: Go; indent-tabs-mode: t -*- +// +// Copyright (C) 2022 Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by gen_commands.py DO NOT EDIT. + +''' + +BASE_MODULE_NAME = 'github.com/kerberos-io/onvif' + +SERVICE_NAMES = [ + 'analytics', + 'device', + 'event', + 'imaging', + 'media', + 'media2', + 'ptz', + 'recording', +] + + +@dataclasses.dataclass +class FunctionsGenerator: + service_name: str + input_file: pathlib.Path + output_file: pathlib.Path + commands = [] + + @staticmethod + def make_function(cmd): + return '''\ +type %sFunction struct{} + +func (_ *%sFunction) Request() interface{} { +\treturn &%s{} +} +func (_ *%sFunction) Response() interface{} { +\treturn &%sResponse{} +} + +''' % (cmd, cmd, cmd, cmd, cmd) + + def run(self): + self.commands = [] + with open(self.input_file) as f: + with open(self.output_file, 'w') as w: + w.write(HEADER) + w.write(f'package {self.service_name}\n\n') + + while line := f.readline(): + if m := re.search(r'type ([^ ]+)Response struct', line): + cmd = m.group(1) + if cmd.endswith('Fault'): + continue # skip Fault responses + self.commands.append(cmd) + + self.commands = sorted(self.commands) + for cmd in self.commands: + print(f'{self.service_name}.{cmd}') + w.write(FunctionsGenerator.make_function(cmd)) + + def write_func_map(self, w): + w.write('var %sFunctionMap = map[string]Function{\n' % self.proper_name) + for cmd in self.commands: + w.write('\t%s: &%s.%sFunction{},\n' % (cmd, self.service_name, cmd)) + w.write('}\n\n') + + @property + def proper_name(self): + return (self.service_name[0].upper() + self.service_name[1:]).replace('Ptz', 'PTZ') + + +@dataclasses.dataclass +class MainGenerator: + root_dir: pathlib.Path + generators = [] + unique_cmds = set() + + def _generate_mappings(self): + with open(self.root_dir.joinpath('mappings.go'), 'w') as w: + w.write(HEADER) + w.write('package onvif\n\n') + w.write('import (\n') + for service_name in SERVICE_NAMES: + w.write(f'\t"{BASE_MODULE_NAME}/{service_name}"\n') + w.write(')\n\n') + + for generator in self.generators: + generator.write_func_map(w) + + def _generate_names(self): + with open(self.root_dir.joinpath('names.go'), 'w') as w: + w.write(HEADER) + w.write('package onvif\n\n') + w.write('// Onvif WebService\n') + w.write('const (\n') + for gen in self.generators: + w.write(f'\t{gen.proper_name}WebService = "{gen.proper_name}"\n') + w.write(')\n\n') + + for gen in self.generators: + w.write(f'// WebService - {gen.proper_name}\n') + w.write('const (\n') + for cmd in gen.commands: + if cmd not in self.unique_cmds: + w.write(f'\t{cmd} = "{cmd}"\n') + self.unique_cmds.add(cmd) + w.write(')\n\n') + + def run(self): + for service_name in SERVICE_NAMES: + gen = FunctionsGenerator(service_name, + self.root_dir.joinpath(f'{service_name}/types.go'), + self.root_dir.joinpath(f'{service_name}/function.go')) + gen.run() + self.generators.append(gen) + + self._generate_mappings() + self._generate_names() + + +def main(): + root_dir = pathlib.Path(__file__).parent.parent.resolve() + main_gen = MainGenerator(root_dir) + main_gen.run() + + print('\n\nFormatting generated files...') + try: + subprocess.check_call(['go', 'fmt', str(root_dir) + "/..."]) + except OSError as e: + print(f"\n\033[31;1mError occurred while trying to format generated files: {e}\033[0m") + print("\033[33;1mPlease run 'go fmt ./...' manually to cleanup generated code formatting!\033[0m") + + +if __name__ == '__main__': + main() diff --git a/recording/function.go b/recording/function.go new file mode 100644 index 00000000..d29c93ea --- /dev/null +++ b/recording/function.go @@ -0,0 +1,198 @@ +// -*- Mode: Go; indent-tabs-mode: t -*- +// +// Copyright (C) 2022 Intel Corporation +// +// SPDX-License-Identifier: Apache-2.0 + +// Code generated by gen_commands.py DO NOT EDIT. + +package recording + +type CreateRecordingFunction struct{} + +func (_ *CreateRecordingFunction) Request() interface{} { + return &CreateRecording{} +} +func (_ *CreateRecordingFunction) Response() interface{} { + return &CreateRecordingResponse{} +} + +type CreateRecordingJobFunction struct{} + +func (_ *CreateRecordingJobFunction) Request() interface{} { + return &CreateRecordingJob{} +} +func (_ *CreateRecordingJobFunction) Response() interface{} { + return &CreateRecordingJobResponse{} +} + +type CreateTrackFunction struct{} + +func (_ *CreateTrackFunction) Request() interface{} { + return &CreateTrack{} +} +func (_ *CreateTrackFunction) Response() interface{} { + return &CreateTrackResponse{} +} + +type DeleteRecordingFunction struct{} + +func (_ *DeleteRecordingFunction) Request() interface{} { + return &DeleteRecording{} +} +func (_ *DeleteRecordingFunction) Response() interface{} { + return &DeleteRecordingResponse{} +} + +type DeleteRecordingJobFunction struct{} + +func (_ *DeleteRecordingJobFunction) Request() interface{} { + return &DeleteRecordingJob{} +} +func (_ *DeleteRecordingJobFunction) Response() interface{} { + return &DeleteRecordingJobResponse{} +} + +type DeleteTrackFunction struct{} + +func (_ *DeleteTrackFunction) Request() interface{} { + return &DeleteTrack{} +} +func (_ *DeleteTrackFunction) Response() interface{} { + return &DeleteTrackResponse{} +} + +type ExportRecordedDataFunction struct{} + +func (_ *ExportRecordedDataFunction) Request() interface{} { + return &ExportRecordedData{} +} +func (_ *ExportRecordedDataFunction) Response() interface{} { + return &ExportRecordedDataResponse{} +} + +type GetExportRecordedDataStateFunction struct{} + +func (_ *GetExportRecordedDataStateFunction) Request() interface{} { + return &GetExportRecordedDataState{} +} +func (_ *GetExportRecordedDataStateFunction) Response() interface{} { + return &GetExportRecordedDataStateResponse{} +} + +type GetRecordingConfigurationFunction struct{} + +func (_ *GetRecordingConfigurationFunction) Request() interface{} { + return &GetRecordingConfiguration{} +} +func (_ *GetRecordingConfigurationFunction) Response() interface{} { + return &GetRecordingConfigurationResponse{} +} + +type GetRecordingJobConfigurationFunction struct{} + +func (_ *GetRecordingJobConfigurationFunction) Request() interface{} { + return &GetRecordingJobConfiguration{} +} +func (_ *GetRecordingJobConfigurationFunction) Response() interface{} { + return &GetRecordingJobConfigurationResponse{} +} + +type GetRecordingJobStateFunction struct{} + +func (_ *GetRecordingJobStateFunction) Request() interface{} { + return &GetRecordingJobState{} +} +func (_ *GetRecordingJobStateFunction) Response() interface{} { + return &GetRecordingJobStateResponse{} +} + +type GetRecordingJobsFunction struct{} + +func (_ *GetRecordingJobsFunction) Request() interface{} { + return &GetRecordingJobs{} +} +func (_ *GetRecordingJobsFunction) Response() interface{} { + return &GetRecordingJobsResponse{} +} + +type GetRecordingOptionsFunction struct{} + +func (_ *GetRecordingOptionsFunction) Request() interface{} { + return &GetRecordingOptions{} +} +func (_ *GetRecordingOptionsFunction) Response() interface{} { + return &GetRecordingOptionsResponse{} +} + +type GetRecordingsFunction struct{} + +func (_ *GetRecordingsFunction) Request() interface{} { + return &GetRecordings{} +} +func (_ *GetRecordingsFunction) Response() interface{} { + return &GetRecordingsResponse{} +} + +type GetServiceCapabilitiesFunction struct{} + +func (_ *GetServiceCapabilitiesFunction) Request() interface{} { + return &GetServiceCapabilities{} +} +func (_ *GetServiceCapabilitiesFunction) Response() interface{} { + return &GetServiceCapabilitiesResponse{} +} + +type GetTrackConfigurationFunction struct{} + +func (_ *GetTrackConfigurationFunction) Request() interface{} { + return &GetTrackConfiguration{} +} +func (_ *GetTrackConfigurationFunction) Response() interface{} { + return &GetTrackConfigurationResponse{} +} + +type SetRecordingConfigurationFunction struct{} + +func (_ *SetRecordingConfigurationFunction) Request() interface{} { + return &SetRecordingConfiguration{} +} +func (_ *SetRecordingConfigurationFunction) Response() interface{} { + return &SetRecordingConfigurationResponse{} +} + +type SetRecordingJobConfigurationFunction struct{} + +func (_ *SetRecordingJobConfigurationFunction) Request() interface{} { + return &SetRecordingJobConfiguration{} +} +func (_ *SetRecordingJobConfigurationFunction) Response() interface{} { + return &SetRecordingJobConfigurationResponse{} +} + +type SetRecordingJobModeFunction struct{} + +func (_ *SetRecordingJobModeFunction) Request() interface{} { + return &SetRecordingJobMode{} +} +func (_ *SetRecordingJobModeFunction) Response() interface{} { + return &SetRecordingJobModeResponse{} +} + +type SetTrackConfigurationFunction struct{} + +func (_ *SetTrackConfigurationFunction) Request() interface{} { + return &SetTrackConfiguration{} +} +func (_ *SetTrackConfigurationFunction) Response() interface{} { + return &SetTrackConfigurationResponse{} +} + +type StopExportRecordedDataFunction struct{} + +func (_ *StopExportRecordedDataFunction) Request() interface{} { + return &StopExportRecordedData{} +} +func (_ *StopExportRecordedDataFunction) Response() interface{} { + return &StopExportRecordedDataResponse{} +} diff --git a/recording/types.go b/recording/types.go new file mode 100644 index 00000000..fab6fb02 --- /dev/null +++ b/recording/types.go @@ -0,0 +1,793 @@ +package recording + +import ( + "encoding/xml" + + "github.com/kerberos-io/onvif/xsd" + "github.com/kerberos-io/onvif/xsd/onvif" +) + +// TrackType type +type TrackType string + +const ( + // TrackTypeVideo const + TrackTypeVideo TrackType = "Video" + + // TrackTypeAudio const + TrackTypeAudio TrackType = "Audio" + + // TrackTypeMetadata const + TrackTypeMetadata TrackType = "Metadata" + + // Placeholder for future extension. + // TrackTypeExtended const + TrackTypeExtended TrackType = "Extended" +) + +// EncodingTypes type +type EncodingTypes []string + +// GetServiceCapabilities type +type GetServiceCapabilities struct { + XMLName xml.Name `xml:"tt:GetServiceCapabilities"` +} + +// GetServiceCapabilitiesResponse type +type GetServiceCapabilitiesResponse struct { + XMLName xml.Name `xml:"GetServiceCapabilitiesResponse"` + + // The capabilities for the recording service is returned in the Capabilities element. + Capabilities Capabilities `xml:"Capabilities,omitempty"` +} + +// CreateRecording type +type CreateRecording struct { + XMLName xml.Name `xml:"tt:CreateRecording"` + + // Initial configuration for the recording. + RecordingConfiguration RecordingConfiguration `xml:"tt:RecordingConfiguration,omitempty"` +} + +// RecordingConfiguration type +type RecordingConfiguration struct { + + // Information about the source of the recording. + Source RecordingSourceInformation `xml:"tt:Source,omitempty"` + + // Informative description of the source. + Content onvif.Description `xml:"tt:Content,omitempty"` + + // Sspecifies the maximum time that data in any track within the + // recording shall be stored. The device shall delete any data older than the maximum retention + // time. Such data shall not be accessible anymore. If the MaximumRetentionPeriod is set to 0, + // the device shall not limit the retention time of stored data, except by resource constraints. + // Whatever the value of MaximumRetentionTime, the device may automatically delete + // recordings to free up storage space for new recordings. + MaximumRetentionTime xsd.Duration `xml:"tt:MaximumRetentionTime,omitempty"` +} + +// RecordingSourceInformation type +type RecordingSourceInformation struct { + + // + // Identifier for the source chosen by the client that creates the structure. + // This identifier is opaque to the device. Clients may use any type of URI for this field. A device shall support at least 128 characters. + SourceId xsd.AnyURI `xml:"tt:SourceId,omitempty"` + + // Informative user readable name of the source, e.g. "Camera23". A device shall support at least 20 characters. + Name xsd.Name `xml:"tt:Name,omitempty"` + + // Informative description of the physical location of the source, e.g. the coordinates on a map. + Location onvif.Description `xml:"tt:Location,omitempty"` + + // Informative description of the source. + Description onvif.Description `xml:"tt:Description,omitempty"` + + // URI provided by the service supplying data to be recorded. A device shall support at least 128 characters. + Address xsd.AnyURI `xml:"tt:Address,omitempty"` +} + +// CreateRecordingResponse type +type CreateRecordingResponse struct { + XMLName xml.Name `xml:"CreateRecordingResponse"` + + // The reference to the created recording. + RecordingToken RecordingReference `xml:"RecordingToken,omitempty"` +} + +// DeleteRecording type +type DeleteRecording struct { + XMLName xml.Name `xml:"tt:DeleteRecording"` + + // The reference of the recording to be deleted. + RecordingToken RecordingReference `xml:"tt:RecordingToken,omitempty"` +} + +// DeleteRecordingResponse type +type DeleteRecordingResponse struct { + XMLName xml.Name `xml:"DeleteRecordingResponse"` +} + +// GetRecordings type +type GetRecordings struct { + XMLName xml.Name `xml:"tt:GetRecordings"` +} + +// GetRecordingsResponse type +type GetRecordingsResponse struct { + XMLName xml.Name `xml:"GetRecordingsResponse"` + + // List of recording items. + RecordingItem []GetRecordingsResponseItem +} + +// GetRecordingsResponseItem type +type GetRecordingsResponseItem struct { + // Token of the recording. + RecordingToken RecordingReference + + // Configuration of the recording. + Configuration struct { + Source struct { + SourceId xsd.AnyURI + Name xsd.Name + Location xsd.String + Description xsd.String + Address xsd.AnyURI + } + Content xsd.String + MaximumRetentionTime xsd.Duration + } + + // List of tracks. + Tracks GetTracksResponseList +} + +// GetTracksResponseList type +type GetTracksResponseList struct { + // Configuration of a track. + Track []GetTracksResponseItem +} + +// GetTracksResponseItem type +type GetTracksResponseItem struct { + // Token of the track. + TrackToken TrackReference + // Configuration of the track. + Configuration struct { + TrackType TrackType + Description xsd.String + } +} + +// TrackConfiguration type +type TrackConfiguration struct { + + // Type of the track. It shall be equal to the strings “Video”, + // “Audio” or “Metadata”. The track shall only be able to hold data of that type. + TrackType TrackType `xml:"tt:TrackType,omitempty"` + + // Informative description of the track. + Description onvif.Description `xml:"tt:Description,omitempty"` +} + +// SetRecordingConfiguration type +type SetRecordingConfiguration struct { + XMLName xml.Name `xml:"tt:SetRecordingConfiguration"` + + // Token of the recording that shall be changed. + RecordingToken RecordingReference `xml:"tt:RecordingToken,omitempty"` + + // The new configuration. + RecordingConfiguration RecordingConfiguration `xml:"tt:RecordingConfiguration,omitempty"` +} + +// SetRecordingConfigurationResponse type +type SetRecordingConfigurationResponse struct { + XMLName xml.Name `xml:"SetRecordingConfigurationResponse"` +} + +// GetRecordingConfiguration type +type GetRecordingConfiguration struct { + XMLName xml.Name `xml:"tt:GetRecordingConfiguration"` + + // Token of the configuration to be retrieved. + RecordingToken RecordingReference `xml:"tt:RecordingToken,omitempty"` +} + +// GetRecordingConfigurationResponse type +type GetRecordingConfigurationResponse struct { + XMLName xml.Name `xml:"GetRecordingConfigurationResponse"` + + // Configuration of the recording. + RecordingConfiguration RecordingConfiguration `xml:"RecordingConfiguration,omitempty"` +} + +// CreateTrack type +type CreateTrack struct { + XMLName xml.Name `xml:"tt:CreateTrack"` + + // Identifies the recording to which a track shall be added. + RecordingToken RecordingReference `xml:"tt:RecordingToken,omitempty"` + + // The configuration of the new track. + TrackConfiguration TrackConfiguration `xml:"tt:TrackConfiguration,omitempty"` +} + +// CreateTrackResponse type +type CreateTrackResponse struct { + XMLName xml.Name `xml:"CreateTrackResponse"` + + // The TrackToken shall identify the newly created track. The + // TrackToken shall be unique within the recoding to which + // the new track belongs. + TrackToken TrackReference `xml:"TrackToken,omitempty"` +} + +// DeleteTrack type +type DeleteTrack struct { + XMLName xml.Name `xml:"tt:DeleteTrack"` + + // Token of the recording the track belongs to. + RecordingToken RecordingReference `xml:"tt:RecordingToken,omitempty"` + + // Token of the track to be deleted. + TrackToken TrackReference `xml:"tt:TrackToken,omitempty"` +} + +// DeleteTrackResponse type +type DeleteTrackResponse struct { + XMLName xml.Name `xml:"DeleteTrackResponse"` +} + +// GetTrackConfiguration type +type GetTrackConfiguration struct { + XMLName xml.Name `xml:"tt:GetTrackConfiguration"` + + // Token of the recording the track belongs to. + RecordingToken RecordingReference `xml:"tt:RecordingToken,omitempty"` + + // Token of the track. + TrackToken TrackReference `xml:"tt:TrackToken,omitempty"` +} + +// GetTrackConfigurationResponse type +type GetTrackConfigurationResponse struct { + XMLName xml.Name `xml:"GetTrackConfigurationResponse"` + + // Configuration of the track. + TrackConfiguration TrackConfiguration `xml:"TrackConfiguration,omitempty"` +} + +// SetTrackConfiguration type +type SetTrackConfiguration struct { + XMLName xml.Name `xml:"tt:SetTrackConfiguration"` + + // Token of the recording the track belongs to. + RecordingToken RecordingReference `xml:"tt:RecordingToken,omitempty"` + + // Token of the track to be modified. + TrackToken TrackReference `xml:"tt:TrackToken,omitempty"` + + // New configuration for the track. + TrackConfiguration TrackConfiguration `xml:"tt:TrackConfiguration,omitempty"` +} + +// SetTrackConfigurationResponse type +type SetTrackConfigurationResponse struct { + XMLName xml.Name `xml:"SetTrackConfigurationResponse"` +} + +// CreateRecordingJob type +type CreateRecordingJob struct { + XMLName xml.Name `xml:"tt:CreateRecordingJob"` + + // The initial configuration of the new recording job. + JobConfiguration RecordingJobConfiguration `xml:"tt:JobConfiguration,omitempty"` +} + +// CreateRecordingJobResponse type +type CreateRecordingJobResponse struct { + XMLName xml.Name `xml:"CreateRecordingJobResponse"` + + // The JobToken shall identify the created recording job. + JobToken RecordingJobReference `xml:"JobToken,omitempty"` + + // + // The JobConfiguration structure shall be the configuration as it is used by the device. This may be different from the + // JobConfiguration passed to CreateRecordingJob. + JobConfiguration RecordingJobConfiguration `xml:"JobConfiguration,omitempty"` +} + +// RecordingJobReference type +type RecordingJobReference ReferenceToken + +// RecordingJobConfiguration type +type RecordingJobConfiguration struct { + + // Identifies the recording to which this job shall store the received data. + RecordingToken RecordingReference `xml:"tt:RecordingToken,omitempty"` + + // The mode of the job. If it is idle, nothing shall happen. If it is active, the device shall try + // to obtain data from the receivers. A client shall use GetRecordingJobState to determine if data transfer is really taking place. + // The only valid values for Mode shall be “Idle” and “Active”. + Mode RecordingJobMode `xml:"tt:Mode,omitempty"` + + // This shall be a non-negative number. If there are multiple recording jobs that store data to + // the same track, the device will only store the data for the recording job with the highest + // priority. The priority is specified per recording job, but the device shall determine the priority + // of each track individually. If there are two recording jobs with the same priority, the device + // shall record the data corresponding to the recording job that was activated the latest. + Priority int32 `xml:"tt:Priority,omitempty"` + + // Source of the recording. + Source []RecordingJobSource `xml:"tt:Source,omitempty"` + + Extension RecordingJobConfigurationExtension `xml:"tt:Extension,omitempty"` + + // This attribute adds an additional requirement for activating the recording job. + // If this optional field is provided the job shall only record if the schedule exists and is active. + // + + ScheduleToken string `xml:"tt:ScheduleToken,attr,omitempty"` +} + +// RecordingJobConfigurationExtension type +type RecordingJobConfigurationExtension struct { +} + +// RecordingJobSource type +type RecordingJobSource struct { + + // This field shall be a reference to the source of the data. The type of the source + // is determined by the attribute Type in the SourceToken structure. If Type is + // http://www.onvif.org/ver10/schema/Receiver, the token is a ReceiverReference. In this case + // the device shall receive the data over the network. If Type is + // http://www.onvif.org/ver10/schema/Profile, the token identifies a media profile, instructing the + // device to obtain data from a profile that exists on the local device. + SourceToken SourceReference `xml:"tt:SourceToken,omitempty"` + + // If this field is TRUE, and if the SourceToken is omitted, the device + // shall create a receiver object (through the receiver service) and assign the + // ReceiverReference to the SourceToken field. When retrieving the RecordingJobConfiguration + // from the device, the AutoCreateReceiver field shall never be present. + AutoCreateReceiver bool `xml:"tt:AutoCreateReceiver,omitempty"` + + // List of tracks associated with the recording. + Tracks []RecordingJobTrack `xml:"tt:Tracks,omitempty"` + + Extension RecordingJobSourceExtension `xml:"tt:Extension,omitempty"` +} + +// RecordingJobTrack type +type RecordingJobTrack struct { + + // If the received RTSP stream contains multiple tracks of the same type, the + // SourceTag differentiates between those Tracks. This field can be ignored in case of recording a local source. + SourceTag string `xml:"tt:SourceTag,omitempty"` + + // The destination is the tracktoken of the track to which the device shall store the + // received data. + Destination TrackReference `xml:"tt:Destination,omitempty"` +} + +// RecordingJobSourceExtension type +type RecordingJobSourceExtension struct { +} + +// RecordingJobMode type +type RecordingJobMode string + +// RecordingJobState type +type RecordingJobState string + +// ModeOfOperation type +type ModeOfOperation string + +// DeleteRecordingJob type +type DeleteRecordingJob struct { + XMLName xml.Name `xml:"tt:DeleteRecordingJob"` + + // The token of the job to be deleted. + JobToken RecordingJobReference `xml:"tt:JobToken,omitempty"` +} + +// DeleteRecordingJobResponse type +type DeleteRecordingJobResponse struct { + XMLName xml.Name `xml:"DeleteRecordingJobResponse"` +} + +// GetRecordingJobs type +type GetRecordingJobs struct { + XMLName xml.Name `xml:"tt:GetRecordingJobs"` +} + +// GetRecordingJobsResponse type +type GetRecordingJobsResponse struct { + XMLName xml.Name `xml:"GetRecordingJobsResponse"` + + // List of recording jobs. + JobItem []GetRecordingJobsResponseItem `xml:"JobItem,omitempty"` +} + +// GetRecordingJobsResponseItem type +type GetRecordingJobsResponseItem struct { + JobToken RecordingJobReference `xml:"JobToken,omitempty"` + + JobConfiguration RecordingJobConfiguration `xml:"JobConfiguration,omitempty"` +} + +// SetRecordingJobConfiguration type +type SetRecordingJobConfiguration struct { + XMLName xml.Name `xml:"tt:SetRecordingJobConfiguration"` + + // Token of the job to be modified. + JobToken RecordingJobReference `xml:"tt:JobToken,omitempty"` + + // New configuration of the recording job. + JobConfiguration RecordingJobConfiguration `xml:"tt:JobConfiguration,omitempty"` +} + +// SetRecordingJobConfigurationResponse type +type SetRecordingJobConfigurationResponse struct { + XMLName xml.Name `xml:"SetRecordingJobConfigurationResponse"` + + // The JobConfiguration structure shall be the configuration + // as it is used by the device. This may be different from the JobConfiguration passed to SetRecordingJobConfiguration. + JobConfiguration RecordingJobConfiguration `xml:"JobConfiguration,omitempty"` +} + +// GetRecordingJobConfiguration type +type GetRecordingJobConfiguration struct { + XMLName xml.Name `xml:"tt:GetRecordingJobConfiguration"` + + // Token of the recording job. + JobToken RecordingJobReference `xml:"tt:JobToken,omitempty"` +} + +// GetRecordingJobConfigurationResponse type +type GetRecordingJobConfigurationResponse struct { + XMLName xml.Name `xml:"GetRecordingJobConfigurationResponse"` + + // Current configuration of the recording job. + JobConfiguration RecordingJobConfiguration `xml:"JobConfiguration,omitempty"` +} + +// SetRecordingJobMode type +type SetRecordingJobMode struct { + XMLName xml.Name `xml:"tt:SetRecordingJobMode"` + + // Token of the recording job. + JobToken RecordingJobReference `xml:"tt:JobToken,omitempty"` + + // The new mode for the recording job. + Mode RecordingJobMode `xml:"tt:Mode,omitempty"` +} + +// SetRecordingJobModeResponse type +type SetRecordingJobModeResponse struct { + XMLName xml.Name `xml:"SetRecordingJobModeResponse"` +} + +// GetRecordingJobState type +type GetRecordingJobState struct { + XMLName xml.Name `xml:"tt:GetRecordingJobState"` + + // Token of the recording job. + JobToken RecordingJobReference `xml:"tt:JobToken,omitempty"` +} + +// GetRecordingJobStateResponse type +type GetRecordingJobStateResponse struct { + XMLName xml.Name `xml:"GetRecordingJobStateResponse"` + + // The current state of the recording job. + State RecordingJobStateInformation `xml:"State,omitempty"` +} + +// RecordingJobStateInformation type +type RecordingJobStateInformation struct { + + // Identification of the recording that the recording job records to. + RecordingToken RecordingReference `xml:"tt:RecordingToken,omitempty"` + + // Holds the aggregated state over the whole RecordingJobInformation structure. + State RecordingJobState `xml:"tt:State,omitempty"` + + // Identifies the data source of the recording job. + Sources []RecordingJobStateSource `xml:"tt:Sources,omitempty"` + + Extension RecordingJobStateInformationExtension `xml:"tt:Extension,omitempty"` +} + +// RecordingJobStateInformationExtension type +type RecordingJobStateInformationExtension struct { +} + +// RecordingJobStateSource type +type RecordingJobStateSource struct { + + // Identifies the data source of the recording job. + SourceToken SourceReference `xml:"tt:SourceToken,omitempty"` + + // Holds the aggregated state over all substructures of RecordingJobStateSource. + State RecordingJobState `xml:"tt:State,omitempty"` + + // List of track items. + Tracks RecordingJobStateTracks `xml:"tt:Tracks,omitempty"` +} + +// RecordingJobStateTracks type +type RecordingJobStateTracks struct { + Track []RecordingJobStateTrack `xml:"tt:Track,omitempty"` +} + +// RecordingJobStateTrack type +type RecordingJobStateTrack struct { + + // Identifies the track of the data source that provides the data. + SourceTag string `xml:"tt:SourceTag,omitempty"` + + // Indicates the destination track. + Destination TrackReference `xml:"tt:Destination,omitempty"` + + // Optionally holds an implementation defined string value that describes the error. + // The string should be in the English language. + Error string `xml:"tt:Error,omitempty"` + + // Provides the job state of the track. The valid + // values of state shall be “Idle”, “Active” and “Error”. If state equals “Error”, the Error field may be filled in with an implementation defined value. + State RecordingJobState `xml:"tt:State,omitempty"` +} + +// GetRecordingOptions type +type GetRecordingOptions struct { + XMLName xml.Name `xml:"tt:GetRecordingOptions"` + + // Token of the recording. + RecordingToken RecordingReference `xml:"tt:RecordingToken,omitempty"` +} + +// GetRecordingOptionsResponse type +type GetRecordingOptionsResponse struct { + XMLName xml.Name `xml:"GetRecordingOptionsResponse"` + + // Configuration of the recording. + Options RecordingOptions `xml:"Options,omitempty"` +} + +// ExportRecordedData type +type ExportRecordedData struct { + XMLName xml.Name `xml:"tt:ExportRecordedData"` + + // Optional parameter that specifies start time for the exporting. + StartPoint string `xml:"tt:StartPoint,omitempty"` + + // Optional parameter that specifies end time for the exporting. + EndPoint string `xml:"tt:EndPoint,omitempty"` + + // Indicates the selection criterion on the existing recordings. . + SearchScope SearchScope `xml:"tt:SearchScope,omitempty"` + + // Indicates which export file format to be used. + FileFormat string `xml:"tt:FileFormat,omitempty"` + + // Indicates the target storage and relative directory path. + StorageDestination StorageReferencePath `xml:"tt:StorageDestination,omitempty"` +} + +// StorageReferencePath type +type StorageReferencePath struct { + + // identifier of an existing Storage Configuration. + StorageToken ReferenceToken `xml:"tt:StorageToken,omitempty"` + + // gives the relative directory path on the storage + RelativePath string `xml:"tt:RelativePath,omitempty"` + + Extension StorageReferencePathExtension `xml:"tt:Extension,omitempty"` +} + +// StorageReferencePathExtension type +type StorageReferencePathExtension struct { +} + +// ExportRecordedDataResponse type +type ExportRecordedDataResponse struct { + XMLName xml.Name `xml:"ExportRecordedDataResponse"` + + // Unique operation token for client to associate the relevant events. + OperationToken ReferenceToken `xml:"OperationToken,omitempty"` + + // List of exported file names. The device can also use AsyncronousOperationStatus event to publish this list. + FileNames []string `xml:"FileNames,omitempty"` + + Extension struct { + } `xml:"Extension,omitempty"` +} + +// StopExportRecordedData type +type StopExportRecordedData struct { + XMLName xml.Name `xml:"tt:StopExportRecordedData"` + + // Unique ExportRecordedData operation token + OperationToken ReferenceToken `xml:"tt:OperationToken,omitempty"` +} + +// StopExportRecordedDataResponse type +type StopExportRecordedDataResponse struct { + XMLName xml.Name `xml:"StopExportRecordedDataResponse"` + + // Progress percentage of ExportRecordedData operation. + Progress float32 `xml:"Progress,omitempty"` + + FileProgressStatus ArrayOfFileProgress `xml:"FileProgressStatus,omitempty"` +} + +// ArrayOfFileProgress type +type ArrayOfFileProgress struct { + + // Exported file name and export progress information + FileProgress []FileProgress `xml:"tt:FileProgress,omitempty"` + + Extension ArrayOfFileProgressExtension `xml:"tt:Extension,omitempty"` +} + +// FileProgress type +type FileProgress struct { + + // Exported file name + FileName string `xml:"tt:FileName,omitempty"` + + // Normalized percentage completion for uploading the exported file + Progress float32 `xml:"tt:Progress,omitempty"` +} + +// ArrayOfFileProgressExtension type +type ArrayOfFileProgressExtension struct { +} + +// GetExportRecordedDataState type +type GetExportRecordedDataState struct { + XMLName xml.Name `xml:"tt:GetExportRecordedDataState"` + + // Unique ExportRecordedData operation token + OperationToken ReferenceToken `xml:"tt:OperationToken,omitempty"` +} + +// GetExportRecordedDataStateResponse type +type GetExportRecordedDataStateResponse struct { + XMLName xml.Name `xml:"GetExportRecordedDataStateResponse"` + + // Progress percentage of ExportRecordedData operation. + Progress float32 `xml:"Progress,omitempty"` + + FileProgressStatus ArrayOfFileProgress `xml:"FileProgressStatus,omitempty"` +} + +// Capabilities type +type Capabilities struct { + + // Indication if the device supports dynamic creation and deletion of recordings + + DynamicRecordings bool `xml:"tt:DynamicRecordings,attr,omitempty"` + + // Indication if the device supports dynamic creation and deletion of tracks + + DynamicTracks bool `xml:"tt:DynamicTracks,attr,omitempty"` + + // Indication which encodings are supported for recording. The list may contain one or more enumeration values of tt:VideoEncoding and tt:AudioEncoding. For encodings that are neither defined in tt:VideoEncoding nor tt:AudioEncoding the device shall use the defintions. Note, that a device without audio support shall not return audio encodings. + + Encoding EncodingTypes `xml:"tt:Encoding,attr,omitempty"` + + // Maximum supported bit rate for all tracks of a recording in kBit/s. + + MaxRate float32 `xml:"tt:MaxRate,attr,omitempty"` + + // Maximum supported bit rate for all recordings in kBit/s. + + MaxTotalRate float32 `xml:"tt:MaxTotalRate,attr,omitempty"` + + // Maximum number of recordings supported. (Integer values only.) + + MaxRecordings float32 `xml:"tt:MaxRecordings,attr,omitempty"` + + // Maximum total number of supported recording jobs by the device. + + MaxRecordingJobs int32 `xml:"tt:MaxRecordingJobs,attr,omitempty"` + + // Indication if the device supports the GetRecordingOptions command. + + Options bool `xml:"tt:Options,attr,omitempty"` + + // Indication if the device supports recording metadata. + + MetadataRecording bool `xml:"tt:MetadataRecording,attr,omitempty"` + + // + // Indication that the device supports ExportRecordedData command for the listed export file formats. + // The list shall return at least one export file format value. The value of 'ONVIF' refers to + // ONVIF Export File Format specification. + // + + SupportedExportFileFormats onvif.StringAttrList `xml:"tt:SupportedExportFileFormats,attr,omitempty"` +} + +// RecordingOptions type +type RecordingOptions struct { + Job JobOptions `xml:"tt:Job,omitempty"` + + Track TrackOptions `xml:"tt:Track,omitempty"` +} + +// JobOptions type +type JobOptions struct { + + // Number of spare jobs that can be created for the recording. + + Spare int32 `xml:"tt:Spare,attr,omitempty"` + + // A device that supports recording of a restricted set of Media/Media2 Service Profiles returns the list of profiles that can be recorded on the given Recording. + + CompatibleSources onvif.StringAttrList `xml:"tt:CompatibleSources,attr,omitempty"` +} + +// TrackOptions type +type TrackOptions struct { + + // Total spare number of tracks that can be added to this recording. + + SpareTotal int32 `xml:"tt:SpareTotal,attr,omitempty"` + + // Number of spare Video tracks that can be added to this recording. + + SpareVideo int32 `xml:"tt:SpareVideo,attr,omitempty"` + + // Number of spare Aduio tracks that can be added to this recording. + + SpareAudio int32 `xml:"tt:SpareAudio,attr,omitempty"` + + // Number of spare Metadata tracks that can be added to this recording. + + SpareMetadata int32 `xml:"tt:SpareMetadata,attr,omitempty"` +} + +// SearchScope type +type SearchScope struct { + + // A list of sources that are included in the scope. If this list is included, only data from one of these sources shall be searched. + IncludedSources []SourceReference `xml:"tt:IncludedSources,omitempty"` + + // A list of recordings that are included in the scope. If this list is included, only data from one of these recordings shall be searched. + IncludedRecordings []RecordingReference `xml:"tt:IncludedRecordings,omitempty"` + + // An xpath expression used to specify what recordings to search. Only those recordings with an RecordingInformation structure that matches the filter shall be searched. + RecordingInformationFilter XPathExpression `xml:"tt:RecordingInformationFilter,omitempty"` + + // Extension point + Extension SearchScopeExtension `xml:"tt:Extension,omitempty"` +} + +// XPathExpression type +type XPathExpression string + +// SourceReference type +type SourceReference struct { + Token ReferenceToken `xml:"tt:Token,omitempty"` + + Type xsd.AnyURI `xml:"tt:Type,attr,omitempty"` +} + +// RecordingReference type +type RecordingReference ReferenceToken + +// TrackReference type +type TrackReference ReferenceToken + +// ReferenceToken type +type ReferenceToken string + +// SearchScopeExtension type +type SearchScopeExtension struct { +} diff --git a/sdk/codegen/main.go b/sdk/codegen/main.go deleted file mode 100644 index 9884c999..00000000 --- a/sdk/codegen/main.go +++ /dev/null @@ -1,78 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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) - } -} diff --git a/sdk/device/AddIPAddressFilter_auto.go b/sdk/device/AddIPAddressFilter_auto.go deleted file mode 100644 index 15cd4dfa..00000000 --- a/sdk/device/AddIPAddressFilter_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/AddScopes_auto.go b/sdk/device/AddScopes_auto.go deleted file mode 100644 index 0f765f40..00000000 --- a/sdk/device/AddScopes_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/CreateCertificate_auto.go b/sdk/device/CreateCertificate_auto.go deleted file mode 100644 index 1a733d58..00000000 --- a/sdk/device/CreateCertificate_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/CreateDot1XConfiguration_auto.go b/sdk/device/CreateDot1XConfiguration_auto.go deleted file mode 100644 index c34ec641..00000000 --- a/sdk/device/CreateDot1XConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/CreateStorageConfiguration_auto.go b/sdk/device/CreateStorageConfiguration_auto.go deleted file mode 100644 index 542f374d..00000000 --- a/sdk/device/CreateStorageConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/CreateUsers_auto.go b/sdk/device/CreateUsers_auto.go deleted file mode 100644 index a938bed9..00000000 --- a/sdk/device/CreateUsers_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/DeleteCertificates_auto.go b/sdk/device/DeleteCertificates_auto.go deleted file mode 100644 index 5aedbe8d..00000000 --- a/sdk/device/DeleteCertificates_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/DeleteDot1XConfiguration_auto.go b/sdk/device/DeleteDot1XConfiguration_auto.go deleted file mode 100644 index 51dea1fd..00000000 --- a/sdk/device/DeleteDot1XConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/DeleteGeoLocation_auto.go b/sdk/device/DeleteGeoLocation_auto.go deleted file mode 100644 index 13a2af70..00000000 --- a/sdk/device/DeleteGeoLocation_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/DeleteStorageConfiguration_auto.go b/sdk/device/DeleteStorageConfiguration_auto.go deleted file mode 100644 index 7866d534..00000000 --- a/sdk/device/DeleteStorageConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/DeleteUsers_auto.go b/sdk/device/DeleteUsers_auto.go deleted file mode 100644 index 786a5a42..00000000 --- a/sdk/device/DeleteUsers_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetAccessPolicy_auto.go b/sdk/device/GetAccessPolicy_auto.go deleted file mode 100644 index 66ac1ee6..00000000 --- a/sdk/device/GetAccessPolicy_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetCACertificates_auto.go b/sdk/device/GetCACertificates_auto.go deleted file mode 100644 index 160a8c20..00000000 --- a/sdk/device/GetCACertificates_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetCapabilities_auto.go b/sdk/device/GetCapabilities_auto.go deleted file mode 100644 index 8df95ee6..00000000 --- a/sdk/device/GetCapabilities_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetCertificateInformation_auto.go b/sdk/device/GetCertificateInformation_auto.go deleted file mode 100644 index f91541ba..00000000 --- a/sdk/device/GetCertificateInformation_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetCertificatesStatus_auto.go b/sdk/device/GetCertificatesStatus_auto.go deleted file mode 100644 index 1981b6b9..00000000 --- a/sdk/device/GetCertificatesStatus_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetCertificates_auto.go b/sdk/device/GetCertificates_auto.go deleted file mode 100644 index 7143c7d2..00000000 --- a/sdk/device/GetCertificates_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetClientCertificateMode_auto.go b/sdk/device/GetClientCertificateMode_auto.go deleted file mode 100644 index 9f3ba106..00000000 --- a/sdk/device/GetClientCertificateMode_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetDNS_auto.go b/sdk/device/GetDNS_auto.go deleted file mode 100644 index 68f60d28..00000000 --- a/sdk/device/GetDNS_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetDPAddresses_auto.go b/sdk/device/GetDPAddresses_auto.go deleted file mode 100644 index 6b12e4d3..00000000 --- a/sdk/device/GetDPAddresses_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetDeviceInformation_auto.go b/sdk/device/GetDeviceInformation_auto.go deleted file mode 100644 index 9511f7ec..00000000 --- a/sdk/device/GetDeviceInformation_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetDiscoveryMode_auto.go b/sdk/device/GetDiscoveryMode_auto.go deleted file mode 100644 index 81c8b2bc..00000000 --- a/sdk/device/GetDiscoveryMode_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetDot11Capabilities_auto.go b/sdk/device/GetDot11Capabilities_auto.go deleted file mode 100644 index 68cfc0f1..00000000 --- a/sdk/device/GetDot11Capabilities_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetDot11Status_auto.go b/sdk/device/GetDot11Status_auto.go deleted file mode 100644 index 7256878b..00000000 --- a/sdk/device/GetDot11Status_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetDot1XConfiguration_auto.go b/sdk/device/GetDot1XConfiguration_auto.go deleted file mode 100644 index 19e3e64b..00000000 --- a/sdk/device/GetDot1XConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetDot1XConfigurations_auto.go b/sdk/device/GetDot1XConfigurations_auto.go deleted file mode 100644 index 3b497790..00000000 --- a/sdk/device/GetDot1XConfigurations_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetDynamicDNS_auto.go b/sdk/device/GetDynamicDNS_auto.go deleted file mode 100644 index 7cf603b7..00000000 --- a/sdk/device/GetDynamicDNS_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetEndpointReference_auto.go b/sdk/device/GetEndpointReference_auto.go deleted file mode 100644 index 2261c528..00000000 --- a/sdk/device/GetEndpointReference_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetGeoLocation_auto.go b/sdk/device/GetGeoLocation_auto.go deleted file mode 100644 index c734c7fd..00000000 --- a/sdk/device/GetGeoLocation_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetHostname_auto.go b/sdk/device/GetHostname_auto.go deleted file mode 100644 index 79c67e63..00000000 --- a/sdk/device/GetHostname_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetIPAddressFilter_auto.go b/sdk/device/GetIPAddressFilter_auto.go deleted file mode 100644 index 9c7fd95c..00000000 --- a/sdk/device/GetIPAddressFilter_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetNTP_auto.go b/sdk/device/GetNTP_auto.go deleted file mode 100644 index 8851044d..00000000 --- a/sdk/device/GetNTP_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetNetworkDefaultGateway_auto.go b/sdk/device/GetNetworkDefaultGateway_auto.go deleted file mode 100644 index 3f2dff4d..00000000 --- a/sdk/device/GetNetworkDefaultGateway_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetNetworkInterfaces_auto.go b/sdk/device/GetNetworkInterfaces_auto.go deleted file mode 100644 index a19be90e..00000000 --- a/sdk/device/GetNetworkInterfaces_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetNetworkProtocols_auto.go b/sdk/device/GetNetworkProtocols_auto.go deleted file mode 100644 index b922d681..00000000 --- a/sdk/device/GetNetworkProtocols_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetPkcs10Request_auto.go b/sdk/device/GetPkcs10Request_auto.go deleted file mode 100644 index d4cc7e8c..00000000 --- a/sdk/device/GetPkcs10Request_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetRelayOutputs_auto.go b/sdk/device/GetRelayOutputs_auto.go deleted file mode 100644 index 732ab49c..00000000 --- a/sdk/device/GetRelayOutputs_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetRemoteDiscoveryMode_auto.go b/sdk/device/GetRemoteDiscoveryMode_auto.go deleted file mode 100644 index 263fa236..00000000 --- a/sdk/device/GetRemoteDiscoveryMode_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetRemoteUser_auto.go b/sdk/device/GetRemoteUser_auto.go deleted file mode 100644 index bdab0b15..00000000 --- a/sdk/device/GetRemoteUser_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetScopes_auto.go b/sdk/device/GetScopes_auto.go deleted file mode 100644 index 9f68ecba..00000000 --- a/sdk/device/GetScopes_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetServiceCapabilities_auto.go b/sdk/device/GetServiceCapabilities_auto.go deleted file mode 100644 index 54f970cb..00000000 --- a/sdk/device/GetServiceCapabilities_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetServices_auto.go b/sdk/device/GetServices_auto.go deleted file mode 100644 index bfbef441..00000000 --- a/sdk/device/GetServices_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetStorageConfiguration_auto.go b/sdk/device/GetStorageConfiguration_auto.go deleted file mode 100644 index ceac17c4..00000000 --- a/sdk/device/GetStorageConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetStorageConfigurations_auto.go b/sdk/device/GetStorageConfigurations_auto.go deleted file mode 100644 index 502be952..00000000 --- a/sdk/device/GetStorageConfigurations_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetSystemBackup_auto.go b/sdk/device/GetSystemBackup_auto.go deleted file mode 100644 index 37884d0c..00000000 --- a/sdk/device/GetSystemBackup_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetSystemDateAndTime_auto.go b/sdk/device/GetSystemDateAndTime_auto.go deleted file mode 100644 index 6c2d265c..00000000 --- a/sdk/device/GetSystemDateAndTime_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetSystemLog_auto.go b/sdk/device/GetSystemLog_auto.go deleted file mode 100644 index 87b99453..00000000 --- a/sdk/device/GetSystemLog_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetSystemSupportInformation_auto.go b/sdk/device/GetSystemSupportInformation_auto.go deleted file mode 100644 index 16593ad5..00000000 --- a/sdk/device/GetSystemSupportInformation_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetSystemUris_auto.go b/sdk/device/GetSystemUris_auto.go deleted file mode 100644 index 1eec1750..00000000 --- a/sdk/device/GetSystemUris_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetUsers_auto.go b/sdk/device/GetUsers_auto.go deleted file mode 100644 index 95d863dc..00000000 --- a/sdk/device/GetUsers_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetWsdlUrl_auto.go b/sdk/device/GetWsdlUrl_auto.go deleted file mode 100644 index a010bccd..00000000 --- a/sdk/device/GetWsdlUrl_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/GetZeroConfiguration_auto.go b/sdk/device/GetZeroConfiguration_auto.go deleted file mode 100644 index 02887a87..00000000 --- a/sdk/device/GetZeroConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/LoadCACertificates_auto.go b/sdk/device/LoadCACertificates_auto.go deleted file mode 100644 index 8a15da6d..00000000 --- a/sdk/device/LoadCACertificates_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/LoadCertificateWithPrivateKey_auto.go b/sdk/device/LoadCertificateWithPrivateKey_auto.go deleted file mode 100644 index 376952b7..00000000 --- a/sdk/device/LoadCertificateWithPrivateKey_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/LoadCertificates_auto.go b/sdk/device/LoadCertificates_auto.go deleted file mode 100644 index 7a2385ab..00000000 --- a/sdk/device/LoadCertificates_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/RemoveIPAddressFilter_auto.go b/sdk/device/RemoveIPAddressFilter_auto.go deleted file mode 100644 index fabb4c6e..00000000 --- a/sdk/device/RemoveIPAddressFilter_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/RemoveScopes_auto.go b/sdk/device/RemoveScopes_auto.go deleted file mode 100644 index 3aa699f9..00000000 --- a/sdk/device/RemoveScopes_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/RestoreSystem_auto.go b/sdk/device/RestoreSystem_auto.go deleted file mode 100644 index 4a18cc6c..00000000 --- a/sdk/device/RestoreSystem_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/ScanAvailableDot11Networks_auto.go b/sdk/device/ScanAvailableDot11Networks_auto.go deleted file mode 100644 index ba8a498d..00000000 --- a/sdk/device/ScanAvailableDot11Networks_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SendAuxiliaryCommand_auto.go b/sdk/device/SendAuxiliaryCommand_auto.go deleted file mode 100644 index df23a07b..00000000 --- a/sdk/device/SendAuxiliaryCommand_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetAccessPolicy_auto.go b/sdk/device/SetAccessPolicy_auto.go deleted file mode 100644 index 4c29b295..00000000 --- a/sdk/device/SetAccessPolicy_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetCertificatesStatus_auto.go b/sdk/device/SetCertificatesStatus_auto.go deleted file mode 100644 index c3ff4864..00000000 --- a/sdk/device/SetCertificatesStatus_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetClientCertificateMode_auto.go b/sdk/device/SetClientCertificateMode_auto.go deleted file mode 100644 index 3eae86f5..00000000 --- a/sdk/device/SetClientCertificateMode_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetDNS_auto.go b/sdk/device/SetDNS_auto.go deleted file mode 100644 index 111f885e..00000000 --- a/sdk/device/SetDNS_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetDiscoveryMode_auto.go b/sdk/device/SetDiscoveryMode_auto.go deleted file mode 100644 index 605fcab8..00000000 --- a/sdk/device/SetDiscoveryMode_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetDot1XConfiguration_auto.go b/sdk/device/SetDot1XConfiguration_auto.go deleted file mode 100644 index 9c54e532..00000000 --- a/sdk/device/SetDot1XConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetDynamicDNS_auto.go b/sdk/device/SetDynamicDNS_auto.go deleted file mode 100644 index 8eb6ee08..00000000 --- a/sdk/device/SetDynamicDNS_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetGeoLocation_auto.go b/sdk/device/SetGeoLocation_auto.go deleted file mode 100644 index 0e48399d..00000000 --- a/sdk/device/SetGeoLocation_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetHostnameFromDHCP_auto.go b/sdk/device/SetHostnameFromDHCP_auto.go deleted file mode 100644 index 96c1af58..00000000 --- a/sdk/device/SetHostnameFromDHCP_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetHostname_auto.go b/sdk/device/SetHostname_auto.go deleted file mode 100644 index f7bae402..00000000 --- a/sdk/device/SetHostname_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetIPAddressFilter_auto.go b/sdk/device/SetIPAddressFilter_auto.go deleted file mode 100644 index 6900b6ce..00000000 --- a/sdk/device/SetIPAddressFilter_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetNTP_auto.go b/sdk/device/SetNTP_auto.go deleted file mode 100644 index 92eeb0e2..00000000 --- a/sdk/device/SetNTP_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetNetworkDefaultGateway_auto.go b/sdk/device/SetNetworkDefaultGateway_auto.go deleted file mode 100644 index 8110bdd6..00000000 --- a/sdk/device/SetNetworkDefaultGateway_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetNetworkInterfaces_auto.go b/sdk/device/SetNetworkInterfaces_auto.go deleted file mode 100644 index 8e11245e..00000000 --- a/sdk/device/SetNetworkInterfaces_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetNetworkProtocols_auto.go b/sdk/device/SetNetworkProtocols_auto.go deleted file mode 100644 index 05cb82c2..00000000 --- a/sdk/device/SetNetworkProtocols_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetRelayOutputSettings_auto.go b/sdk/device/SetRelayOutputSettings_auto.go deleted file mode 100644 index 5420134b..00000000 --- a/sdk/device/SetRelayOutputSettings_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetRelayOutputState_auto.go b/sdk/device/SetRelayOutputState_auto.go deleted file mode 100644 index f946c46a..00000000 --- a/sdk/device/SetRelayOutputState_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetRemoteDiscoveryMode_auto.go b/sdk/device/SetRemoteDiscoveryMode_auto.go deleted file mode 100644 index 53c143ce..00000000 --- a/sdk/device/SetRemoteDiscoveryMode_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetRemoteUser_auto.go b/sdk/device/SetRemoteUser_auto.go deleted file mode 100644 index 6d2454c4..00000000 --- a/sdk/device/SetRemoteUser_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetScopes_auto.go b/sdk/device/SetScopes_auto.go deleted file mode 100644 index e1f0195e..00000000 --- a/sdk/device/SetScopes_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetStorageConfiguration_auto.go b/sdk/device/SetStorageConfiguration_auto.go deleted file mode 100644 index 59dfcf1e..00000000 --- a/sdk/device/SetStorageConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetSystemDateAndTime_auto.go b/sdk/device/SetSystemDateAndTime_auto.go deleted file mode 100644 index 25f57bb2..00000000 --- a/sdk/device/SetSystemDateAndTime_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetSystemFactoryDefault_auto.go b/sdk/device/SetSystemFactoryDefault_auto.go deleted file mode 100644 index 9616b108..00000000 --- a/sdk/device/SetSystemFactoryDefault_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetUser_auto.go b/sdk/device/SetUser_auto.go deleted file mode 100644 index 3c7f030c..00000000 --- a/sdk/device/SetUser_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SetZeroConfiguration_auto.go b/sdk/device/SetZeroConfiguration_auto.go deleted file mode 100644 index a3b76e6d..00000000 --- a/sdk/device/SetZeroConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/StartFirmwareUpgrade_auto.go b/sdk/device/StartFirmwareUpgrade_auto.go deleted file mode 100644 index e890ae2d..00000000 --- a/sdk/device/StartFirmwareUpgrade_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/StartSystemRestore_auto.go b/sdk/device/StartSystemRestore_auto.go deleted file mode 100644 index ab9d35d1..00000000 --- a/sdk/device/StartSystemRestore_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/SystemReboot_auto.go b/sdk/device/SystemReboot_auto.go deleted file mode 100644 index 6ad68312..00000000 --- a/sdk/device/SystemReboot_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/UpgradeSystemFirmware_auto.go b/sdk/device/UpgradeSystemFirmware_auto.go deleted file mode 100644 index a6d63af5..00000000 --- a/sdk/device/UpgradeSystemFirmware_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// 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/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/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") - } -} diff --git a/sdk/device/device.go b/sdk/device/device.go deleted file mode 100644 index 1f4c1a87..00000000 --- a/sdk/device/device.go +++ /dev/null @@ -1,91 +0,0 @@ -package device - -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetServices -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetServiceCapabilities -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetDeviceInformation -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetSystemDateAndTime -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetSystemDateAndTime -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetSystemFactoryDefault -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device UpgradeSystemFirmware -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SystemReboot -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device RestoreSystem -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetSystemBackup -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetSystemLog -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetSystemSupportInformation -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetScopes -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetScopes -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device AddScopes -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device RemoveScopes -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetDiscoveryMode -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetDiscoveryMode -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetRemoteDiscoveryMode -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetRemoteDiscoveryMode -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetDPAddresses -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetEndpointReference -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetRemoteUser -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetRemoteUser -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetUsers -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device CreateUsers -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device DeleteUsers -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetUser -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetWsdlUrl -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetCapabilities -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetHostname -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetHostname -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetHostnameFromDHCP -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetDNS -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetDNS -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetNTP -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetNTP -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetDynamicDNS -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetDynamicDNS -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetNetworkInterfaces -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetNetworkInterfaces -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetNetworkProtocols -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetNetworkProtocols -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetNetworkDefaultGateway -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetNetworkDefaultGateway -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetZeroConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetZeroConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetIPAddressFilter -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetIPAddressFilter -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device AddIPAddressFilter -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device RemoveIPAddressFilter -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetAccessPolicy -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetAccessPolicy -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device CreateCertificate -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetCertificates -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetCertificatesStatus -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetCertificatesStatus -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device DeleteCertificates -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetPkcs10Request -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device LoadCertificates -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetClientCertificateMode -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetClientCertificateMode -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetRelayOutputs -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetRelayOutputSettings -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetRelayOutputState -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SendAuxiliaryCommand -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetCACertificates -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device LoadCertificateWithPrivateKey -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetCertificateInformation -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device LoadCACertificates -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device CreateDot1XConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetDot1XConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetDot1XConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetDot1XConfigurations -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device DeleteDot1XConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetDot11Capabilities -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetDot11Status -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device ScanAvailableDot11Networks -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetSystemUris -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device StartFirmwareUpgrade -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device StartSystemRestore -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetStorageConfigurations -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device CreateStorageConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetStorageConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetStorageConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device DeleteStorageConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device GetGeoLocation -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device SetGeoLocation -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen device device DeleteGeoLocation diff --git a/sdk/event/CreatePullPointSubscription_auto.go b/sdk/event/CreatePullPointSubscription_auto.go deleted file mode 100644 index 971f31b0..00000000 --- a/sdk/event/CreatePullPointSubscription_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package event - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/event" -) - -// Call_CreatePullPointSubscription forwards the call to dev.CallMethod() then parses the payload of the reply as a CreatePullPointSubscriptionResponse. -func Call_CreatePullPointSubscription(ctx context.Context, dev *onvif.Device, request event.CreatePullPointSubscription) (event.CreatePullPointSubscriptionResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - CreatePullPointSubscriptionResponse event.CreatePullPointSubscriptionResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.CreatePullPointSubscriptionResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "CreatePullPointSubscription") - return reply.Body.CreatePullPointSubscriptionResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/event/GetEventProperties_auto.go b/sdk/event/GetEventProperties_auto.go deleted file mode 100644 index 839ad5d3..00000000 --- a/sdk/event/GetEventProperties_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package event - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/event" -) - -// Call_GetEventProperties forwards the call to dev.CallMethod() then parses the payload of the reply as a GetEventPropertiesResponse. -func Call_GetEventProperties(ctx context.Context, dev *onvif.Device, request event.GetEventProperties) (event.GetEventPropertiesResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetEventPropertiesResponse event.GetEventPropertiesResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetEventPropertiesResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetEventProperties") - return reply.Body.GetEventPropertiesResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/event/GetServiceCapabilities_auto.go b/sdk/event/GetServiceCapabilities_auto.go deleted file mode 100644 index df48a717..00000000 --- a/sdk/event/GetServiceCapabilities_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package event - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/event" -) - -// 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 event.GetServiceCapabilities) (event.GetServiceCapabilitiesResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetServiceCapabilitiesResponse event.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") - } -} diff --git a/sdk/event/Subscribe_auto.go b/sdk/event/Subscribe_auto.go deleted file mode 100644 index 6c411319..00000000 --- a/sdk/event/Subscribe_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package event - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/event" -) - -// Call_Subscribe forwards the call to dev.CallMethod() then parses the payload of the reply as a SubscribeResponse. -func Call_Subscribe(ctx context.Context, dev *onvif.Device, request event.Subscribe) (event.SubscribeResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - SubscribeResponse event.SubscribeResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.SubscribeResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "Subscribe") - return reply.Body.SubscribeResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/event/Unsubscribe_auto.go b/sdk/event/Unsubscribe_auto.go deleted file mode 100644 index 0faa9eaf..00000000 --- a/sdk/event/Unsubscribe_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package event - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/event" -) - -// Call_Unsubscribe forwards the call to dev.CallMethod() then parses the payload of the reply as a UnsubscribeResponse. -func Call_Unsubscribe(ctx context.Context, dev *onvif.Device, request event.Unsubscribe) (event.UnsubscribeResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - UnsubscribeResponse event.UnsubscribeResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.UnsubscribeResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "Unsubscribe") - return reply.Body.UnsubscribeResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/AddAudioDecoderConfiguration_auto.go b/sdk/media/AddAudioDecoderConfiguration_auto.go deleted file mode 100644 index f2626693..00000000 --- a/sdk/media/AddAudioDecoderConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_AddAudioDecoderConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a AddAudioDecoderConfigurationResponse. -func Call_AddAudioDecoderConfiguration(ctx context.Context, dev *onvif.Device, request media.AddAudioDecoderConfiguration) (media.AddAudioDecoderConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - AddAudioDecoderConfigurationResponse media.AddAudioDecoderConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.AddAudioDecoderConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "AddAudioDecoderConfiguration") - return reply.Body.AddAudioDecoderConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/AddAudioEncoderConfiguration_auto.go b/sdk/media/AddAudioEncoderConfiguration_auto.go deleted file mode 100644 index 5e616a39..00000000 --- a/sdk/media/AddAudioEncoderConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_AddAudioEncoderConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a AddAudioEncoderConfigurationResponse. -func Call_AddAudioEncoderConfiguration(ctx context.Context, dev *onvif.Device, request media.AddAudioEncoderConfiguration) (media.AddAudioEncoderConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - AddAudioEncoderConfigurationResponse media.AddAudioEncoderConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.AddAudioEncoderConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "AddAudioEncoderConfiguration") - return reply.Body.AddAudioEncoderConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/AddAudioOutputConfiguration_auto.go b/sdk/media/AddAudioOutputConfiguration_auto.go deleted file mode 100644 index 8de8e862..00000000 --- a/sdk/media/AddAudioOutputConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_AddAudioOutputConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a AddAudioOutputConfigurationResponse. -func Call_AddAudioOutputConfiguration(ctx context.Context, dev *onvif.Device, request media.AddAudioOutputConfiguration) (media.AddAudioOutputConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - AddAudioOutputConfigurationResponse media.AddAudioOutputConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.AddAudioOutputConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "AddAudioOutputConfiguration") - return reply.Body.AddAudioOutputConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/AddAudioSourceConfiguration_auto.go b/sdk/media/AddAudioSourceConfiguration_auto.go deleted file mode 100644 index 2b537999..00000000 --- a/sdk/media/AddAudioSourceConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_AddAudioSourceConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a AddAudioSourceConfigurationResponse. -func Call_AddAudioSourceConfiguration(ctx context.Context, dev *onvif.Device, request media.AddAudioSourceConfiguration) (media.AddAudioSourceConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - AddAudioSourceConfigurationResponse media.AddAudioSourceConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.AddAudioSourceConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "AddAudioSourceConfiguration") - return reply.Body.AddAudioSourceConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/AddMetadataConfiguration_auto.go b/sdk/media/AddMetadataConfiguration_auto.go deleted file mode 100644 index e2139a7c..00000000 --- a/sdk/media/AddMetadataConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_AddMetadataConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a AddMetadataConfigurationResponse. -func Call_AddMetadataConfiguration(ctx context.Context, dev *onvif.Device, request media.AddMetadataConfiguration) (media.AddMetadataConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - AddMetadataConfigurationResponse media.AddMetadataConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.AddMetadataConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "AddMetadataConfiguration") - return reply.Body.AddMetadataConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/AddPTZConfiguration_auto.go b/sdk/media/AddPTZConfiguration_auto.go deleted file mode 100644 index e3ed43dc..00000000 --- a/sdk/media/AddPTZConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_AddPTZConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a AddPTZConfigurationResponse. -func Call_AddPTZConfiguration(ctx context.Context, dev *onvif.Device, request media.AddPTZConfiguration) (media.AddPTZConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - AddPTZConfigurationResponse media.AddPTZConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.AddPTZConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "AddPTZConfiguration") - return reply.Body.AddPTZConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/AddVideoAnalyticsConfiguration_auto.go b/sdk/media/AddVideoAnalyticsConfiguration_auto.go deleted file mode 100644 index c0c66da3..00000000 --- a/sdk/media/AddVideoAnalyticsConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_AddVideoAnalyticsConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a AddVideoAnalyticsConfigurationResponse. -func Call_AddVideoAnalyticsConfiguration(ctx context.Context, dev *onvif.Device, request media.AddVideoAnalyticsConfiguration) (media.AddVideoAnalyticsConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - AddVideoAnalyticsConfigurationResponse media.AddVideoAnalyticsConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.AddVideoAnalyticsConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "AddVideoAnalyticsConfiguration") - return reply.Body.AddVideoAnalyticsConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/AddVideoEncoderConfiguration_auto.go b/sdk/media/AddVideoEncoderConfiguration_auto.go deleted file mode 100644 index c5b57642..00000000 --- a/sdk/media/AddVideoEncoderConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_AddVideoEncoderConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a AddVideoEncoderConfigurationResponse. -func Call_AddVideoEncoderConfiguration(ctx context.Context, dev *onvif.Device, request media.AddVideoEncoderConfiguration) (media.AddVideoEncoderConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - AddVideoEncoderConfigurationResponse media.AddVideoEncoderConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.AddVideoEncoderConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "AddVideoEncoderConfiguration") - return reply.Body.AddVideoEncoderConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/AddVideoSourceConfiguration_auto.go b/sdk/media/AddVideoSourceConfiguration_auto.go deleted file mode 100644 index 8f67d802..00000000 --- a/sdk/media/AddVideoSourceConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_AddVideoSourceConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a AddVideoSourceConfigurationResponse. -func Call_AddVideoSourceConfiguration(ctx context.Context, dev *onvif.Device, request media.AddVideoSourceConfiguration) (media.AddVideoSourceConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - AddVideoSourceConfigurationResponse media.AddVideoSourceConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.AddVideoSourceConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "AddVideoSourceConfiguration") - return reply.Body.AddVideoSourceConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/CreateOSD_auto.go b/sdk/media/CreateOSD_auto.go deleted file mode 100644 index 8fa9641d..00000000 --- a/sdk/media/CreateOSD_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_CreateOSD forwards the call to dev.CallMethod() then parses the payload of the reply as a CreateOSDResponse. -func Call_CreateOSD(ctx context.Context, dev *onvif.Device, request media.CreateOSD) (media.CreateOSDResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - CreateOSDResponse media.CreateOSDResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.CreateOSDResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "CreateOSD") - return reply.Body.CreateOSDResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/CreateProfile_auto.go b/sdk/media/CreateProfile_auto.go deleted file mode 100644 index 401e9132..00000000 --- a/sdk/media/CreateProfile_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_CreateProfile forwards the call to dev.CallMethod() then parses the payload of the reply as a CreateProfileResponse. -func Call_CreateProfile(ctx context.Context, dev *onvif.Device, request media.CreateProfile) (media.CreateProfileResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - CreateProfileResponse media.CreateProfileResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.CreateProfileResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "CreateProfile") - return reply.Body.CreateProfileResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/DeleteOSD_auto.go b/sdk/media/DeleteOSD_auto.go deleted file mode 100644 index 896604cf..00000000 --- a/sdk/media/DeleteOSD_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_DeleteOSD forwards the call to dev.CallMethod() then parses the payload of the reply as a DeleteOSDResponse. -func Call_DeleteOSD(ctx context.Context, dev *onvif.Device, request media.DeleteOSD) (media.DeleteOSDResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - DeleteOSDResponse media.DeleteOSDResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.DeleteOSDResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "DeleteOSD") - return reply.Body.DeleteOSDResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/DeleteProfile_auto.go b/sdk/media/DeleteProfile_auto.go deleted file mode 100644 index 16e15649..00000000 --- a/sdk/media/DeleteProfile_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_DeleteProfile forwards the call to dev.CallMethod() then parses the payload of the reply as a DeleteProfileResponse. -func Call_DeleteProfile(ctx context.Context, dev *onvif.Device, request media.DeleteProfile) (media.DeleteProfileResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - DeleteProfileResponse media.DeleteProfileResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.DeleteProfileResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "DeleteProfile") - return reply.Body.DeleteProfileResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetAudioDecoderConfigurationOptions_auto.go b/sdk/media/GetAudioDecoderConfigurationOptions_auto.go deleted file mode 100644 index e396d370..00000000 --- a/sdk/media/GetAudioDecoderConfigurationOptions_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetAudioDecoderConfigurationOptions forwards the call to dev.CallMethod() then parses the payload of the reply as a GetAudioDecoderConfigurationOptionsResponse. -func Call_GetAudioDecoderConfigurationOptions(ctx context.Context, dev *onvif.Device, request media.GetAudioDecoderConfigurationOptions) (media.GetAudioDecoderConfigurationOptionsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetAudioDecoderConfigurationOptionsResponse media.GetAudioDecoderConfigurationOptionsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetAudioDecoderConfigurationOptionsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetAudioDecoderConfigurationOptions") - return reply.Body.GetAudioDecoderConfigurationOptionsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetAudioDecoderConfiguration_auto.go b/sdk/media/GetAudioDecoderConfiguration_auto.go deleted file mode 100644 index 0879aaa0..00000000 --- a/sdk/media/GetAudioDecoderConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetAudioDecoderConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a GetAudioDecoderConfigurationResponse. -func Call_GetAudioDecoderConfiguration(ctx context.Context, dev *onvif.Device, request media.GetAudioDecoderConfiguration) (media.GetAudioDecoderConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetAudioDecoderConfigurationResponse media.GetAudioDecoderConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetAudioDecoderConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetAudioDecoderConfiguration") - return reply.Body.GetAudioDecoderConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetAudioDecoderConfigurations_auto.go b/sdk/media/GetAudioDecoderConfigurations_auto.go deleted file mode 100644 index 899aef93..00000000 --- a/sdk/media/GetAudioDecoderConfigurations_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetAudioDecoderConfigurations forwards the call to dev.CallMethod() then parses the payload of the reply as a GetAudioDecoderConfigurationsResponse. -func Call_GetAudioDecoderConfigurations(ctx context.Context, dev *onvif.Device, request media.GetAudioDecoderConfigurations) (media.GetAudioDecoderConfigurationsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetAudioDecoderConfigurationsResponse media.GetAudioDecoderConfigurationsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetAudioDecoderConfigurationsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetAudioDecoderConfigurations") - return reply.Body.GetAudioDecoderConfigurationsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetAudioEncoderConfigurationOptions_auto.go b/sdk/media/GetAudioEncoderConfigurationOptions_auto.go deleted file mode 100644 index 5b7e7184..00000000 --- a/sdk/media/GetAudioEncoderConfigurationOptions_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetAudioEncoderConfigurationOptions forwards the call to dev.CallMethod() then parses the payload of the reply as a GetAudioEncoderConfigurationOptionsResponse. -func Call_GetAudioEncoderConfigurationOptions(ctx context.Context, dev *onvif.Device, request media.GetAudioEncoderConfigurationOptions) (media.GetAudioEncoderConfigurationOptionsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetAudioEncoderConfigurationOptionsResponse media.GetAudioEncoderConfigurationOptionsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetAudioEncoderConfigurationOptionsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetAudioEncoderConfigurationOptions") - return reply.Body.GetAudioEncoderConfigurationOptionsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetAudioEncoderConfiguration_auto.go b/sdk/media/GetAudioEncoderConfiguration_auto.go deleted file mode 100644 index 7dd8029b..00000000 --- a/sdk/media/GetAudioEncoderConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetAudioEncoderConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a GetAudioEncoderConfigurationResponse. -func Call_GetAudioEncoderConfiguration(ctx context.Context, dev *onvif.Device, request media.GetAudioEncoderConfiguration) (media.GetAudioEncoderConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetAudioEncoderConfigurationResponse media.GetAudioEncoderConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetAudioEncoderConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetAudioEncoderConfiguration") - return reply.Body.GetAudioEncoderConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetAudioEncoderConfigurations_auto.go b/sdk/media/GetAudioEncoderConfigurations_auto.go deleted file mode 100644 index 62cea4b8..00000000 --- a/sdk/media/GetAudioEncoderConfigurations_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetAudioEncoderConfigurations forwards the call to dev.CallMethod() then parses the payload of the reply as a GetAudioEncoderConfigurationsResponse. -func Call_GetAudioEncoderConfigurations(ctx context.Context, dev *onvif.Device, request media.GetAudioEncoderConfigurations) (media.GetAudioEncoderConfigurationsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetAudioEncoderConfigurationsResponse media.GetAudioEncoderConfigurationsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetAudioEncoderConfigurationsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetAudioEncoderConfigurations") - return reply.Body.GetAudioEncoderConfigurationsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetAudioOutputConfigurationOptions_auto.go b/sdk/media/GetAudioOutputConfigurationOptions_auto.go deleted file mode 100644 index db0f4a13..00000000 --- a/sdk/media/GetAudioOutputConfigurationOptions_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetAudioOutputConfigurationOptions forwards the call to dev.CallMethod() then parses the payload of the reply as a GetAudioOutputConfigurationOptionsResponse. -func Call_GetAudioOutputConfigurationOptions(ctx context.Context, dev *onvif.Device, request media.GetAudioOutputConfigurationOptions) (media.GetAudioOutputConfigurationOptionsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetAudioOutputConfigurationOptionsResponse media.GetAudioOutputConfigurationOptionsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetAudioOutputConfigurationOptionsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetAudioOutputConfigurationOptions") - return reply.Body.GetAudioOutputConfigurationOptionsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetAudioOutputConfiguration_auto.go b/sdk/media/GetAudioOutputConfiguration_auto.go deleted file mode 100644 index 9292b8b0..00000000 --- a/sdk/media/GetAudioOutputConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetAudioOutputConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a GetAudioOutputConfigurationResponse. -func Call_GetAudioOutputConfiguration(ctx context.Context, dev *onvif.Device, request media.GetAudioOutputConfiguration) (media.GetAudioOutputConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetAudioOutputConfigurationResponse media.GetAudioOutputConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetAudioOutputConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetAudioOutputConfiguration") - return reply.Body.GetAudioOutputConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetAudioOutputConfigurations_auto.go b/sdk/media/GetAudioOutputConfigurations_auto.go deleted file mode 100644 index be284cd4..00000000 --- a/sdk/media/GetAudioOutputConfigurations_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetAudioOutputConfigurations forwards the call to dev.CallMethod() then parses the payload of the reply as a GetAudioOutputConfigurationsResponse. -func Call_GetAudioOutputConfigurations(ctx context.Context, dev *onvif.Device, request media.GetAudioOutputConfigurations) (media.GetAudioOutputConfigurationsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetAudioOutputConfigurationsResponse media.GetAudioOutputConfigurationsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetAudioOutputConfigurationsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetAudioOutputConfigurations") - return reply.Body.GetAudioOutputConfigurationsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetAudioOutputs_auto.go b/sdk/media/GetAudioOutputs_auto.go deleted file mode 100644 index 50cc9b34..00000000 --- a/sdk/media/GetAudioOutputs_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetAudioOutputs forwards the call to dev.CallMethod() then parses the payload of the reply as a GetAudioOutputsResponse. -func Call_GetAudioOutputs(ctx context.Context, dev *onvif.Device, request media.GetAudioOutputs) (media.GetAudioOutputsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetAudioOutputsResponse media.GetAudioOutputsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetAudioOutputsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetAudioOutputs") - return reply.Body.GetAudioOutputsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetAudioSourceConfigurationOptions_auto.go b/sdk/media/GetAudioSourceConfigurationOptions_auto.go deleted file mode 100644 index a9584eaf..00000000 --- a/sdk/media/GetAudioSourceConfigurationOptions_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetAudioSourceConfigurationOptions forwards the call to dev.CallMethod() then parses the payload of the reply as a GetAudioSourceConfigurationOptionsResponse. -func Call_GetAudioSourceConfigurationOptions(ctx context.Context, dev *onvif.Device, request media.GetAudioSourceConfigurationOptions) (media.GetAudioSourceConfigurationOptionsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetAudioSourceConfigurationOptionsResponse media.GetAudioSourceConfigurationOptionsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetAudioSourceConfigurationOptionsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetAudioSourceConfigurationOptions") - return reply.Body.GetAudioSourceConfigurationOptionsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetAudioSourceConfiguration_auto.go b/sdk/media/GetAudioSourceConfiguration_auto.go deleted file mode 100644 index 8d287e89..00000000 --- a/sdk/media/GetAudioSourceConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetAudioSourceConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a GetAudioSourceConfigurationResponse. -func Call_GetAudioSourceConfiguration(ctx context.Context, dev *onvif.Device, request media.GetAudioSourceConfiguration) (media.GetAudioSourceConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetAudioSourceConfigurationResponse media.GetAudioSourceConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetAudioSourceConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetAudioSourceConfiguration") - return reply.Body.GetAudioSourceConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetAudioSourceConfigurations_auto.go b/sdk/media/GetAudioSourceConfigurations_auto.go deleted file mode 100644 index d29ca2e9..00000000 --- a/sdk/media/GetAudioSourceConfigurations_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetAudioSourceConfigurations forwards the call to dev.CallMethod() then parses the payload of the reply as a GetAudioSourceConfigurationsResponse. -func Call_GetAudioSourceConfigurations(ctx context.Context, dev *onvif.Device, request media.GetAudioSourceConfigurations) (media.GetAudioSourceConfigurationsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetAudioSourceConfigurationsResponse media.GetAudioSourceConfigurationsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetAudioSourceConfigurationsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetAudioSourceConfigurations") - return reply.Body.GetAudioSourceConfigurationsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetAudioSources_auto.go b/sdk/media/GetAudioSources_auto.go deleted file mode 100644 index 833a54f7..00000000 --- a/sdk/media/GetAudioSources_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetAudioSources forwards the call to dev.CallMethod() then parses the payload of the reply as a GetAudioSourcesResponse. -func Call_GetAudioSources(ctx context.Context, dev *onvif.Device, request media.GetAudioSources) (media.GetAudioSourcesResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetAudioSourcesResponse media.GetAudioSourcesResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetAudioSourcesResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetAudioSources") - return reply.Body.GetAudioSourcesResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetCompatibleAudioDecoderConfigurations_auto.go b/sdk/media/GetCompatibleAudioDecoderConfigurations_auto.go deleted file mode 100644 index 1d2e171c..00000000 --- a/sdk/media/GetCompatibleAudioDecoderConfigurations_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetCompatibleAudioDecoderConfigurations forwards the call to dev.CallMethod() then parses the payload of the reply as a GetCompatibleAudioDecoderConfigurationsResponse. -func Call_GetCompatibleAudioDecoderConfigurations(ctx context.Context, dev *onvif.Device, request media.GetCompatibleAudioDecoderConfigurations) (media.GetCompatibleAudioDecoderConfigurationsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetCompatibleAudioDecoderConfigurationsResponse media.GetCompatibleAudioDecoderConfigurationsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetCompatibleAudioDecoderConfigurationsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetCompatibleAudioDecoderConfigurations") - return reply.Body.GetCompatibleAudioDecoderConfigurationsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetCompatibleAudioEncoderConfigurations_auto.go b/sdk/media/GetCompatibleAudioEncoderConfigurations_auto.go deleted file mode 100644 index dcf1c3ce..00000000 --- a/sdk/media/GetCompatibleAudioEncoderConfigurations_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetCompatibleAudioEncoderConfigurations forwards the call to dev.CallMethod() then parses the payload of the reply as a GetCompatibleAudioEncoderConfigurationsResponse. -func Call_GetCompatibleAudioEncoderConfigurations(ctx context.Context, dev *onvif.Device, request media.GetCompatibleAudioEncoderConfigurations) (media.GetCompatibleAudioEncoderConfigurationsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetCompatibleAudioEncoderConfigurationsResponse media.GetCompatibleAudioEncoderConfigurationsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetCompatibleAudioEncoderConfigurationsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetCompatibleAudioEncoderConfigurations") - return reply.Body.GetCompatibleAudioEncoderConfigurationsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetCompatibleAudioOutputConfigurations_auto.go b/sdk/media/GetCompatibleAudioOutputConfigurations_auto.go deleted file mode 100644 index d88cb066..00000000 --- a/sdk/media/GetCompatibleAudioOutputConfigurations_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetCompatibleAudioOutputConfigurations forwards the call to dev.CallMethod() then parses the payload of the reply as a GetCompatibleAudioOutputConfigurationsResponse. -func Call_GetCompatibleAudioOutputConfigurations(ctx context.Context, dev *onvif.Device, request media.GetCompatibleAudioOutputConfigurations) (media.GetCompatibleAudioOutputConfigurationsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetCompatibleAudioOutputConfigurationsResponse media.GetCompatibleAudioOutputConfigurationsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetCompatibleAudioOutputConfigurationsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetCompatibleAudioOutputConfigurations") - return reply.Body.GetCompatibleAudioOutputConfigurationsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetCompatibleAudioSourceConfigurations_auto.go b/sdk/media/GetCompatibleAudioSourceConfigurations_auto.go deleted file mode 100644 index b40e3954..00000000 --- a/sdk/media/GetCompatibleAudioSourceConfigurations_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetCompatibleAudioSourceConfigurations forwards the call to dev.CallMethod() then parses the payload of the reply as a GetCompatibleAudioSourceConfigurationsResponse. -func Call_GetCompatibleAudioSourceConfigurations(ctx context.Context, dev *onvif.Device, request media.GetCompatibleAudioSourceConfigurations) (media.GetCompatibleAudioSourceConfigurationsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetCompatibleAudioSourceConfigurationsResponse media.GetCompatibleAudioSourceConfigurationsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetCompatibleAudioSourceConfigurationsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetCompatibleAudioSourceConfigurations") - return reply.Body.GetCompatibleAudioSourceConfigurationsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetCompatibleMetadataConfigurations_auto.go b/sdk/media/GetCompatibleMetadataConfigurations_auto.go deleted file mode 100644 index 6791715e..00000000 --- a/sdk/media/GetCompatibleMetadataConfigurations_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetCompatibleMetadataConfigurations forwards the call to dev.CallMethod() then parses the payload of the reply as a GetCompatibleMetadataConfigurationsResponse. -func Call_GetCompatibleMetadataConfigurations(ctx context.Context, dev *onvif.Device, request media.GetCompatibleMetadataConfigurations) (media.GetCompatibleMetadataConfigurationsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetCompatibleMetadataConfigurationsResponse media.GetCompatibleMetadataConfigurationsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetCompatibleMetadataConfigurationsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetCompatibleMetadataConfigurations") - return reply.Body.GetCompatibleMetadataConfigurationsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetCompatibleVideoAnalyticsConfigurations_auto.go b/sdk/media/GetCompatibleVideoAnalyticsConfigurations_auto.go deleted file mode 100644 index 4ef36ab7..00000000 --- a/sdk/media/GetCompatibleVideoAnalyticsConfigurations_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetCompatibleVideoAnalyticsConfigurations forwards the call to dev.CallMethod() then parses the payload of the reply as a GetCompatibleVideoAnalyticsConfigurationsResponse. -func Call_GetCompatibleVideoAnalyticsConfigurations(ctx context.Context, dev *onvif.Device, request media.GetCompatibleVideoAnalyticsConfigurations) (media.GetCompatibleVideoAnalyticsConfigurationsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetCompatibleVideoAnalyticsConfigurationsResponse media.GetCompatibleVideoAnalyticsConfigurationsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetCompatibleVideoAnalyticsConfigurationsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetCompatibleVideoAnalyticsConfigurations") - return reply.Body.GetCompatibleVideoAnalyticsConfigurationsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetCompatibleVideoEncoderConfigurations_auto.go b/sdk/media/GetCompatibleVideoEncoderConfigurations_auto.go deleted file mode 100644 index 2ddf7a82..00000000 --- a/sdk/media/GetCompatibleVideoEncoderConfigurations_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetCompatibleVideoEncoderConfigurations forwards the call to dev.CallMethod() then parses the payload of the reply as a GetCompatibleVideoEncoderConfigurationsResponse. -func Call_GetCompatibleVideoEncoderConfigurations(ctx context.Context, dev *onvif.Device, request media.GetCompatibleVideoEncoderConfigurations) (media.GetCompatibleVideoEncoderConfigurationsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetCompatibleVideoEncoderConfigurationsResponse media.GetCompatibleVideoEncoderConfigurationsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetCompatibleVideoEncoderConfigurationsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetCompatibleVideoEncoderConfigurations") - return reply.Body.GetCompatibleVideoEncoderConfigurationsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetCompatibleVideoSourceConfigurations_auto.go b/sdk/media/GetCompatibleVideoSourceConfigurations_auto.go deleted file mode 100644 index 80d31336..00000000 --- a/sdk/media/GetCompatibleVideoSourceConfigurations_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetCompatibleVideoSourceConfigurations forwards the call to dev.CallMethod() then parses the payload of the reply as a GetCompatibleVideoSourceConfigurationsResponse. -func Call_GetCompatibleVideoSourceConfigurations(ctx context.Context, dev *onvif.Device, request media.GetCompatibleVideoSourceConfigurations) (media.GetCompatibleVideoSourceConfigurationsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetCompatibleVideoSourceConfigurationsResponse media.GetCompatibleVideoSourceConfigurationsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetCompatibleVideoSourceConfigurationsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetCompatibleVideoSourceConfigurations") - return reply.Body.GetCompatibleVideoSourceConfigurationsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetGuaranteedNumberOfVideoEncoderInstances_auto.go b/sdk/media/GetGuaranteedNumberOfVideoEncoderInstances_auto.go deleted file mode 100644 index b3535d8b..00000000 --- a/sdk/media/GetGuaranteedNumberOfVideoEncoderInstances_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetGuaranteedNumberOfVideoEncoderInstances forwards the call to dev.CallMethod() then parses the payload of the reply as a GetGuaranteedNumberOfVideoEncoderInstancesResponse. -func Call_GetGuaranteedNumberOfVideoEncoderInstances(ctx context.Context, dev *onvif.Device, request media.GetGuaranteedNumberOfVideoEncoderInstances) (media.GetGuaranteedNumberOfVideoEncoderInstancesResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetGuaranteedNumberOfVideoEncoderInstancesResponse media.GetGuaranteedNumberOfVideoEncoderInstancesResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetGuaranteedNumberOfVideoEncoderInstancesResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetGuaranteedNumberOfVideoEncoderInstances") - return reply.Body.GetGuaranteedNumberOfVideoEncoderInstancesResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetMetadataConfigurationOptions_auto.go b/sdk/media/GetMetadataConfigurationOptions_auto.go deleted file mode 100644 index ad67d6b5..00000000 --- a/sdk/media/GetMetadataConfigurationOptions_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetMetadataConfigurationOptions forwards the call to dev.CallMethod() then parses the payload of the reply as a GetMetadataConfigurationOptionsResponse. -func Call_GetMetadataConfigurationOptions(ctx context.Context, dev *onvif.Device, request media.GetMetadataConfigurationOptions) (media.GetMetadataConfigurationOptionsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetMetadataConfigurationOptionsResponse media.GetMetadataConfigurationOptionsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetMetadataConfigurationOptionsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetMetadataConfigurationOptions") - return reply.Body.GetMetadataConfigurationOptionsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetMetadataConfiguration_auto.go b/sdk/media/GetMetadataConfiguration_auto.go deleted file mode 100644 index 94af08be..00000000 --- a/sdk/media/GetMetadataConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetMetadataConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a GetMetadataConfigurationResponse. -func Call_GetMetadataConfiguration(ctx context.Context, dev *onvif.Device, request media.GetMetadataConfiguration) (media.GetMetadataConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetMetadataConfigurationResponse media.GetMetadataConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetMetadataConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetMetadataConfiguration") - return reply.Body.GetMetadataConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetMetadataConfigurations_auto.go b/sdk/media/GetMetadataConfigurations_auto.go deleted file mode 100644 index 13d31417..00000000 --- a/sdk/media/GetMetadataConfigurations_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetMetadataConfigurations forwards the call to dev.CallMethod() then parses the payload of the reply as a GetMetadataConfigurationsResponse. -func Call_GetMetadataConfigurations(ctx context.Context, dev *onvif.Device, request media.GetMetadataConfigurations) (media.GetMetadataConfigurationsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetMetadataConfigurationsResponse media.GetMetadataConfigurationsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetMetadataConfigurationsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetMetadataConfigurations") - return reply.Body.GetMetadataConfigurationsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetOSDOptions_auto.go b/sdk/media/GetOSDOptions_auto.go deleted file mode 100644 index d92d20a9..00000000 --- a/sdk/media/GetOSDOptions_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetOSDOptions forwards the call to dev.CallMethod() then parses the payload of the reply as a GetOSDOptionsResponse. -func Call_GetOSDOptions(ctx context.Context, dev *onvif.Device, request media.GetOSDOptions) (media.GetOSDOptionsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetOSDOptionsResponse media.GetOSDOptionsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetOSDOptionsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetOSDOptions") - return reply.Body.GetOSDOptionsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetOSD_auto.go b/sdk/media/GetOSD_auto.go deleted file mode 100644 index 6a5483da..00000000 --- a/sdk/media/GetOSD_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetOSD forwards the call to dev.CallMethod() then parses the payload of the reply as a GetOSDResponse. -func Call_GetOSD(ctx context.Context, dev *onvif.Device, request media.GetOSD) (media.GetOSDResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetOSDResponse media.GetOSDResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetOSDResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetOSD") - return reply.Body.GetOSDResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetOSDs_auto.go b/sdk/media/GetOSDs_auto.go deleted file mode 100644 index f6a713c2..00000000 --- a/sdk/media/GetOSDs_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetOSDs forwards the call to dev.CallMethod() then parses the payload of the reply as a GetOSDsResponse. -func Call_GetOSDs(ctx context.Context, dev *onvif.Device, request media.GetOSDs) (media.GetOSDsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetOSDsResponse media.GetOSDsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetOSDsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetOSDs") - return reply.Body.GetOSDsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetProfile_auto.go b/sdk/media/GetProfile_auto.go deleted file mode 100644 index d43b9cb9..00000000 --- a/sdk/media/GetProfile_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetProfile forwards the call to dev.CallMethod() then parses the payload of the reply as a GetProfileResponse. -func Call_GetProfile(ctx context.Context, dev *onvif.Device, request media.GetProfile) (media.GetProfileResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetProfileResponse media.GetProfileResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetProfileResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetProfile") - return reply.Body.GetProfileResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetProfiles_auto.go b/sdk/media/GetProfiles_auto.go deleted file mode 100644 index b081b46d..00000000 --- a/sdk/media/GetProfiles_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetProfiles forwards the call to dev.CallMethod() then parses the payload of the reply as a GetProfilesResponse. -func Call_GetProfiles(ctx context.Context, dev *onvif.Device, request media.GetProfiles) (media.GetProfilesResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetProfilesResponse media.GetProfilesResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetProfilesResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetProfiles") - return reply.Body.GetProfilesResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetServiceCapabilities_auto.go b/sdk/media/GetServiceCapabilities_auto.go deleted file mode 100644 index 9459292c..00000000 --- a/sdk/media/GetServiceCapabilities_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// 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 media.GetServiceCapabilities) (media.GetServiceCapabilitiesResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetServiceCapabilitiesResponse media.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") - } -} diff --git a/sdk/media/GetSnapshotUri_auto.go b/sdk/media/GetSnapshotUri_auto.go deleted file mode 100644 index d325d37f..00000000 --- a/sdk/media/GetSnapshotUri_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetSnapshotUri forwards the call to dev.CallMethod() then parses the payload of the reply as a GetSnapshotUriResponse. -func Call_GetSnapshotUri(ctx context.Context, dev *onvif.Device, request media.GetSnapshotUri) (media.GetSnapshotUriResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetSnapshotUriResponse media.GetSnapshotUriResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetSnapshotUriResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetSnapshotUri") - return reply.Body.GetSnapshotUriResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetStreamUri_auto.go b/sdk/media/GetStreamUri_auto.go deleted file mode 100644 index ebb345b9..00000000 --- a/sdk/media/GetStreamUri_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetStreamUri forwards the call to dev.CallMethod() then parses the payload of the reply as a GetStreamUriResponse. -func Call_GetStreamUri(ctx context.Context, dev *onvif.Device, request media.GetStreamUri) (media.GetStreamUriResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetStreamUriResponse media.GetStreamUriResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetStreamUriResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetStreamUri") - return reply.Body.GetStreamUriResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetVideoAnalyticsConfiguration_auto.go b/sdk/media/GetVideoAnalyticsConfiguration_auto.go deleted file mode 100644 index bbeb7d36..00000000 --- a/sdk/media/GetVideoAnalyticsConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetVideoAnalyticsConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a GetVideoAnalyticsConfigurationResponse. -func Call_GetVideoAnalyticsConfiguration(ctx context.Context, dev *onvif.Device, request media.GetVideoAnalyticsConfiguration) (media.GetVideoAnalyticsConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetVideoAnalyticsConfigurationResponse media.GetVideoAnalyticsConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetVideoAnalyticsConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetVideoAnalyticsConfiguration") - return reply.Body.GetVideoAnalyticsConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetVideoAnalyticsConfigurations_auto.go b/sdk/media/GetVideoAnalyticsConfigurations_auto.go deleted file mode 100644 index a2071aaf..00000000 --- a/sdk/media/GetVideoAnalyticsConfigurations_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetVideoAnalyticsConfigurations forwards the call to dev.CallMethod() then parses the payload of the reply as a GetVideoAnalyticsConfigurationsResponse. -func Call_GetVideoAnalyticsConfigurations(ctx context.Context, dev *onvif.Device, request media.GetVideoAnalyticsConfigurations) (media.GetVideoAnalyticsConfigurationsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetVideoAnalyticsConfigurationsResponse media.GetVideoAnalyticsConfigurationsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetVideoAnalyticsConfigurationsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetVideoAnalyticsConfigurations") - return reply.Body.GetVideoAnalyticsConfigurationsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetVideoEncoderConfigurationOptions_auto.go b/sdk/media/GetVideoEncoderConfigurationOptions_auto.go deleted file mode 100644 index 9380e745..00000000 --- a/sdk/media/GetVideoEncoderConfigurationOptions_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetVideoEncoderConfigurationOptions forwards the call to dev.CallMethod() then parses the payload of the reply as a GetVideoEncoderConfigurationOptionsResponse. -func Call_GetVideoEncoderConfigurationOptions(ctx context.Context, dev *onvif.Device, request media.GetVideoEncoderConfigurationOptions) (media.GetVideoEncoderConfigurationOptionsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetVideoEncoderConfigurationOptionsResponse media.GetVideoEncoderConfigurationOptionsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetVideoEncoderConfigurationOptionsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetVideoEncoderConfigurationOptions") - return reply.Body.GetVideoEncoderConfigurationOptionsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetVideoEncoderConfiguration_auto.go b/sdk/media/GetVideoEncoderConfiguration_auto.go deleted file mode 100644 index d5aece02..00000000 --- a/sdk/media/GetVideoEncoderConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetVideoEncoderConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a GetVideoEncoderConfigurationResponse. -func Call_GetVideoEncoderConfiguration(ctx context.Context, dev *onvif.Device, request media.GetVideoEncoderConfiguration) (media.GetVideoEncoderConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetVideoEncoderConfigurationResponse media.GetVideoEncoderConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetVideoEncoderConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetVideoEncoderConfiguration") - return reply.Body.GetVideoEncoderConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetVideoEncoderConfigurations_auto.go b/sdk/media/GetVideoEncoderConfigurations_auto.go deleted file mode 100644 index 8932c923..00000000 --- a/sdk/media/GetVideoEncoderConfigurations_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetVideoEncoderConfigurations forwards the call to dev.CallMethod() then parses the payload of the reply as a GetVideoEncoderConfigurationsResponse. -func Call_GetVideoEncoderConfigurations(ctx context.Context, dev *onvif.Device, request media.GetVideoEncoderConfigurations) (media.GetVideoEncoderConfigurationsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetVideoEncoderConfigurationsResponse media.GetVideoEncoderConfigurationsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetVideoEncoderConfigurationsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetVideoEncoderConfigurations") - return reply.Body.GetVideoEncoderConfigurationsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetVideoSourceConfigurationOptions_auto.go b/sdk/media/GetVideoSourceConfigurationOptions_auto.go deleted file mode 100644 index a079f98c..00000000 --- a/sdk/media/GetVideoSourceConfigurationOptions_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetVideoSourceConfigurationOptions forwards the call to dev.CallMethod() then parses the payload of the reply as a GetVideoSourceConfigurationOptionsResponse. -func Call_GetVideoSourceConfigurationOptions(ctx context.Context, dev *onvif.Device, request media.GetVideoSourceConfigurationOptions) (media.GetVideoSourceConfigurationOptionsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetVideoSourceConfigurationOptionsResponse media.GetVideoSourceConfigurationOptionsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetVideoSourceConfigurationOptionsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetVideoSourceConfigurationOptions") - return reply.Body.GetVideoSourceConfigurationOptionsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetVideoSourceConfiguration_auto.go b/sdk/media/GetVideoSourceConfiguration_auto.go deleted file mode 100644 index ef7c1707..00000000 --- a/sdk/media/GetVideoSourceConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetVideoSourceConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a GetVideoSourceConfigurationResponse. -func Call_GetVideoSourceConfiguration(ctx context.Context, dev *onvif.Device, request media.GetVideoSourceConfiguration) (media.GetVideoSourceConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetVideoSourceConfigurationResponse media.GetVideoSourceConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetVideoSourceConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetVideoSourceConfiguration") - return reply.Body.GetVideoSourceConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetVideoSourceConfigurations_auto.go b/sdk/media/GetVideoSourceConfigurations_auto.go deleted file mode 100644 index 11b3dda1..00000000 --- a/sdk/media/GetVideoSourceConfigurations_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetVideoSourceConfigurations forwards the call to dev.CallMethod() then parses the payload of the reply as a GetVideoSourceConfigurationsResponse. -func Call_GetVideoSourceConfigurations(ctx context.Context, dev *onvif.Device, request media.GetVideoSourceConfigurations) (media.GetVideoSourceConfigurationsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetVideoSourceConfigurationsResponse media.GetVideoSourceConfigurationsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetVideoSourceConfigurationsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetVideoSourceConfigurations") - return reply.Body.GetVideoSourceConfigurationsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetVideoSourceModes_auto.go b/sdk/media/GetVideoSourceModes_auto.go deleted file mode 100644 index 3ddc4899..00000000 --- a/sdk/media/GetVideoSourceModes_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetVideoSourceModes forwards the call to dev.CallMethod() then parses the payload of the reply as a GetVideoSourceModesResponse. -func Call_GetVideoSourceModes(ctx context.Context, dev *onvif.Device, request media.GetVideoSourceModes) (media.GetVideoSourceModesResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetVideoSourceModesResponse media.GetVideoSourceModesResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetVideoSourceModesResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetVideoSourceModes") - return reply.Body.GetVideoSourceModesResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/GetVideoSources_auto.go b/sdk/media/GetVideoSources_auto.go deleted file mode 100644 index 9fadfaf5..00000000 --- a/sdk/media/GetVideoSources_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_GetVideoSources forwards the call to dev.CallMethod() then parses the payload of the reply as a GetVideoSourcesResponse. -func Call_GetVideoSources(ctx context.Context, dev *onvif.Device, request media.GetVideoSources) (media.GetVideoSourcesResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetVideoSourcesResponse media.GetVideoSourcesResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetVideoSourcesResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetVideoSources") - return reply.Body.GetVideoSourcesResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/RemoveAudioDecoderConfiguration_auto.go b/sdk/media/RemoveAudioDecoderConfiguration_auto.go deleted file mode 100644 index 6ab5e320..00000000 --- a/sdk/media/RemoveAudioDecoderConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_RemoveAudioDecoderConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a RemoveAudioDecoderConfigurationResponse. -func Call_RemoveAudioDecoderConfiguration(ctx context.Context, dev *onvif.Device, request media.RemoveAudioDecoderConfiguration) (media.RemoveAudioDecoderConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - RemoveAudioDecoderConfigurationResponse media.RemoveAudioDecoderConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.RemoveAudioDecoderConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "RemoveAudioDecoderConfiguration") - return reply.Body.RemoveAudioDecoderConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/RemoveAudioEncoderConfiguration_auto.go b/sdk/media/RemoveAudioEncoderConfiguration_auto.go deleted file mode 100644 index 48db46d6..00000000 --- a/sdk/media/RemoveAudioEncoderConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_RemoveAudioEncoderConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a RemoveAudioEncoderConfigurationResponse. -func Call_RemoveAudioEncoderConfiguration(ctx context.Context, dev *onvif.Device, request media.RemoveAudioEncoderConfiguration) (media.RemoveAudioEncoderConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - RemoveAudioEncoderConfigurationResponse media.RemoveAudioEncoderConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.RemoveAudioEncoderConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "RemoveAudioEncoderConfiguration") - return reply.Body.RemoveAudioEncoderConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/RemoveAudioOutputConfiguration_auto.go b/sdk/media/RemoveAudioOutputConfiguration_auto.go deleted file mode 100644 index db04e136..00000000 --- a/sdk/media/RemoveAudioOutputConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_RemoveAudioOutputConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a RemoveAudioOutputConfigurationResponse. -func Call_RemoveAudioOutputConfiguration(ctx context.Context, dev *onvif.Device, request media.RemoveAudioOutputConfiguration) (media.RemoveAudioOutputConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - RemoveAudioOutputConfigurationResponse media.RemoveAudioOutputConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.RemoveAudioOutputConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "RemoveAudioOutputConfiguration") - return reply.Body.RemoveAudioOutputConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/RemoveAudioSourceConfiguration_auto.go b/sdk/media/RemoveAudioSourceConfiguration_auto.go deleted file mode 100644 index 95802e18..00000000 --- a/sdk/media/RemoveAudioSourceConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_RemoveAudioSourceConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a RemoveAudioSourceConfigurationResponse. -func Call_RemoveAudioSourceConfiguration(ctx context.Context, dev *onvif.Device, request media.RemoveAudioSourceConfiguration) (media.RemoveAudioSourceConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - RemoveAudioSourceConfigurationResponse media.RemoveAudioSourceConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.RemoveAudioSourceConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "RemoveAudioSourceConfiguration") - return reply.Body.RemoveAudioSourceConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/RemoveMetadataConfiguration_auto.go b/sdk/media/RemoveMetadataConfiguration_auto.go deleted file mode 100644 index 8d3a5f7f..00000000 --- a/sdk/media/RemoveMetadataConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_RemoveMetadataConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a RemoveMetadataConfigurationResponse. -func Call_RemoveMetadataConfiguration(ctx context.Context, dev *onvif.Device, request media.RemoveMetadataConfiguration) (media.RemoveMetadataConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - RemoveMetadataConfigurationResponse media.RemoveMetadataConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.RemoveMetadataConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "RemoveMetadataConfiguration") - return reply.Body.RemoveMetadataConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/RemovePTZConfiguration_auto.go b/sdk/media/RemovePTZConfiguration_auto.go deleted file mode 100644 index 7f517f54..00000000 --- a/sdk/media/RemovePTZConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_RemovePTZConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a RemovePTZConfigurationResponse. -func Call_RemovePTZConfiguration(ctx context.Context, dev *onvif.Device, request media.RemovePTZConfiguration) (media.RemovePTZConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - RemovePTZConfigurationResponse media.RemovePTZConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.RemovePTZConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "RemovePTZConfiguration") - return reply.Body.RemovePTZConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/RemoveVideoAnalyticsConfiguration_auto.go b/sdk/media/RemoveVideoAnalyticsConfiguration_auto.go deleted file mode 100644 index 3b615219..00000000 --- a/sdk/media/RemoveVideoAnalyticsConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_RemoveVideoAnalyticsConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a RemoveVideoAnalyticsConfigurationResponse. -func Call_RemoveVideoAnalyticsConfiguration(ctx context.Context, dev *onvif.Device, request media.RemoveVideoAnalyticsConfiguration) (media.RemoveVideoAnalyticsConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - RemoveVideoAnalyticsConfigurationResponse media.RemoveVideoAnalyticsConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.RemoveVideoAnalyticsConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "RemoveVideoAnalyticsConfiguration") - return reply.Body.RemoveVideoAnalyticsConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/RemoveVideoEncoderConfiguration_auto.go b/sdk/media/RemoveVideoEncoderConfiguration_auto.go deleted file mode 100644 index df3e048d..00000000 --- a/sdk/media/RemoveVideoEncoderConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_RemoveVideoEncoderConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a RemoveVideoEncoderConfigurationResponse. -func Call_RemoveVideoEncoderConfiguration(ctx context.Context, dev *onvif.Device, request media.RemoveVideoEncoderConfiguration) (media.RemoveVideoEncoderConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - RemoveVideoEncoderConfigurationResponse media.RemoveVideoEncoderConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.RemoveVideoEncoderConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "RemoveVideoEncoderConfiguration") - return reply.Body.RemoveVideoEncoderConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/RemoveVideoSourceConfiguration_auto.go b/sdk/media/RemoveVideoSourceConfiguration_auto.go deleted file mode 100644 index aaf6acad..00000000 --- a/sdk/media/RemoveVideoSourceConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_RemoveVideoSourceConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a RemoveVideoSourceConfigurationResponse. -func Call_RemoveVideoSourceConfiguration(ctx context.Context, dev *onvif.Device, request media.RemoveVideoSourceConfiguration) (media.RemoveVideoSourceConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - RemoveVideoSourceConfigurationResponse media.RemoveVideoSourceConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.RemoveVideoSourceConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "RemoveVideoSourceConfiguration") - return reply.Body.RemoveVideoSourceConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/SetAudioDecoderConfiguration_auto.go b/sdk/media/SetAudioDecoderConfiguration_auto.go deleted file mode 100644 index 0a9e4d92..00000000 --- a/sdk/media/SetAudioDecoderConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_SetAudioDecoderConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a SetAudioDecoderConfigurationResponse. -func Call_SetAudioDecoderConfiguration(ctx context.Context, dev *onvif.Device, request media.SetAudioDecoderConfiguration) (media.SetAudioDecoderConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - SetAudioDecoderConfigurationResponse media.SetAudioDecoderConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.SetAudioDecoderConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetAudioDecoderConfiguration") - return reply.Body.SetAudioDecoderConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/SetAudioEncoderConfiguration_auto.go b/sdk/media/SetAudioEncoderConfiguration_auto.go deleted file mode 100644 index 2c9c2810..00000000 --- a/sdk/media/SetAudioEncoderConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_SetAudioEncoderConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a SetAudioEncoderConfigurationResponse. -func Call_SetAudioEncoderConfiguration(ctx context.Context, dev *onvif.Device, request media.SetAudioEncoderConfiguration) (media.SetAudioEncoderConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - SetAudioEncoderConfigurationResponse media.SetAudioEncoderConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.SetAudioEncoderConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetAudioEncoderConfiguration") - return reply.Body.SetAudioEncoderConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/SetAudioOutputConfiguration_auto.go b/sdk/media/SetAudioOutputConfiguration_auto.go deleted file mode 100644 index 41107f2a..00000000 --- a/sdk/media/SetAudioOutputConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_SetAudioOutputConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a SetAudioOutputConfigurationResponse. -func Call_SetAudioOutputConfiguration(ctx context.Context, dev *onvif.Device, request media.SetAudioOutputConfiguration) (media.SetAudioOutputConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - SetAudioOutputConfigurationResponse media.SetAudioOutputConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.SetAudioOutputConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetAudioOutputConfiguration") - return reply.Body.SetAudioOutputConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/SetAudioSourceConfiguration_auto.go b/sdk/media/SetAudioSourceConfiguration_auto.go deleted file mode 100644 index 81b092de..00000000 --- a/sdk/media/SetAudioSourceConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_SetAudioSourceConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a SetAudioSourceConfigurationResponse. -func Call_SetAudioSourceConfiguration(ctx context.Context, dev *onvif.Device, request media.SetAudioSourceConfiguration) (media.SetAudioSourceConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - SetAudioSourceConfigurationResponse media.SetAudioSourceConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.SetAudioSourceConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetAudioSourceConfiguration") - return reply.Body.SetAudioSourceConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/SetMetadataConfiguration_auto.go b/sdk/media/SetMetadataConfiguration_auto.go deleted file mode 100644 index 6da2cb65..00000000 --- a/sdk/media/SetMetadataConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_SetMetadataConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a SetMetadataConfigurationResponse. -func Call_SetMetadataConfiguration(ctx context.Context, dev *onvif.Device, request media.SetMetadataConfiguration) (media.SetMetadataConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - SetMetadataConfigurationResponse media.SetMetadataConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.SetMetadataConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetMetadataConfiguration") - return reply.Body.SetMetadataConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/SetOSD_auto.go b/sdk/media/SetOSD_auto.go deleted file mode 100644 index 5dd12ea7..00000000 --- a/sdk/media/SetOSD_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_SetOSD forwards the call to dev.CallMethod() then parses the payload of the reply as a SetOSDResponse. -func Call_SetOSD(ctx context.Context, dev *onvif.Device, request media.SetOSD) (media.SetOSDResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - SetOSDResponse media.SetOSDResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.SetOSDResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetOSD") - return reply.Body.SetOSDResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/SetSynchronizationPoint_auto.go b/sdk/media/SetSynchronizationPoint_auto.go deleted file mode 100644 index 8bc3289e..00000000 --- a/sdk/media/SetSynchronizationPoint_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_SetSynchronizationPoint forwards the call to dev.CallMethod() then parses the payload of the reply as a SetSynchronizationPointResponse. -func Call_SetSynchronizationPoint(ctx context.Context, dev *onvif.Device, request media.SetSynchronizationPoint) (media.SetSynchronizationPointResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - SetSynchronizationPointResponse media.SetSynchronizationPointResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.SetSynchronizationPointResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetSynchronizationPoint") - return reply.Body.SetSynchronizationPointResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/SetVideoAnalyticsConfiguration_auto.go b/sdk/media/SetVideoAnalyticsConfiguration_auto.go deleted file mode 100644 index 6bc2b838..00000000 --- a/sdk/media/SetVideoAnalyticsConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_SetVideoAnalyticsConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a SetVideoAnalyticsConfigurationResponse. -func Call_SetVideoAnalyticsConfiguration(ctx context.Context, dev *onvif.Device, request media.SetVideoAnalyticsConfiguration) (media.SetVideoAnalyticsConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - SetVideoAnalyticsConfigurationResponse media.SetVideoAnalyticsConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.SetVideoAnalyticsConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetVideoAnalyticsConfiguration") - return reply.Body.SetVideoAnalyticsConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/SetVideoEncoderConfiguration_auto.go b/sdk/media/SetVideoEncoderConfiguration_auto.go deleted file mode 100644 index 6aca6cfa..00000000 --- a/sdk/media/SetVideoEncoderConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_SetVideoEncoderConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a SetVideoEncoderConfigurationResponse. -func Call_SetVideoEncoderConfiguration(ctx context.Context, dev *onvif.Device, request media.SetVideoEncoderConfiguration) (media.SetVideoEncoderConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - SetVideoEncoderConfigurationResponse media.SetVideoEncoderConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.SetVideoEncoderConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetVideoEncoderConfiguration") - return reply.Body.SetVideoEncoderConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/SetVideoSourceConfiguration_auto.go b/sdk/media/SetVideoSourceConfiguration_auto.go deleted file mode 100644 index 5cc60e6e..00000000 --- a/sdk/media/SetVideoSourceConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_SetVideoSourceConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a SetVideoSourceConfigurationResponse. -func Call_SetVideoSourceConfiguration(ctx context.Context, dev *onvif.Device, request media.SetVideoSourceConfiguration) (media.SetVideoSourceConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - SetVideoSourceConfigurationResponse media.SetVideoSourceConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.SetVideoSourceConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetVideoSourceConfiguration") - return reply.Body.SetVideoSourceConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/SetVideoSourceMode_auto.go b/sdk/media/SetVideoSourceMode_auto.go deleted file mode 100644 index 985be97d..00000000 --- a/sdk/media/SetVideoSourceMode_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_SetVideoSourceMode forwards the call to dev.CallMethod() then parses the payload of the reply as a SetVideoSourceModeResponse. -func Call_SetVideoSourceMode(ctx context.Context, dev *onvif.Device, request media.SetVideoSourceMode) (media.SetVideoSourceModeResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - SetVideoSourceModeResponse media.SetVideoSourceModeResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.SetVideoSourceModeResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetVideoSourceMode") - return reply.Body.SetVideoSourceModeResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/StartMulticastStreaming_auto.go b/sdk/media/StartMulticastStreaming_auto.go deleted file mode 100644 index 1e6f1ae3..00000000 --- a/sdk/media/StartMulticastStreaming_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_StartMulticastStreaming forwards the call to dev.CallMethod() then parses the payload of the reply as a StartMulticastStreamingResponse. -func Call_StartMulticastStreaming(ctx context.Context, dev *onvif.Device, request media.StartMulticastStreaming) (media.StartMulticastStreamingResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - StartMulticastStreamingResponse media.StartMulticastStreamingResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.StartMulticastStreamingResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "StartMulticastStreaming") - return reply.Body.StartMulticastStreamingResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/StopMulticastStreaming_auto.go b/sdk/media/StopMulticastStreaming_auto.go deleted file mode 100644 index 477ad402..00000000 --- a/sdk/media/StopMulticastStreaming_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package media - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/media" -) - -// Call_StopMulticastStreaming forwards the call to dev.CallMethod() then parses the payload of the reply as a StopMulticastStreamingResponse. -func Call_StopMulticastStreaming(ctx context.Context, dev *onvif.Device, request media.StopMulticastStreaming) (media.StopMulticastStreamingResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - StopMulticastStreamingResponse media.StopMulticastStreamingResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.StopMulticastStreamingResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "StopMulticastStreaming") - return reply.Body.StopMulticastStreamingResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/media/media.go b/sdk/media/media.go deleted file mode 100644 index 4ce49d7c..00000000 --- a/sdk/media/media.go +++ /dev/null @@ -1,81 +0,0 @@ -package media - -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetServiceCapabilities -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetVideoSources -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetAudioSources -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetAudioOutputs -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media CreateProfile -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetProfile -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetProfiles -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media AddVideoEncoderConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media RemoveVideoEncoderConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media AddVideoSourceConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media RemoveVideoSourceConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media AddAudioEncoderConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media RemoveAudioEncoderConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media AddAudioSourceConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media RemoveAudioSourceConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media AddPTZConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media RemovePTZConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media AddVideoAnalyticsConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media RemoveVideoAnalyticsConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media AddMetadataConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media RemoveMetadataConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media AddAudioOutputConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media RemoveAudioOutputConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media AddAudioDecoderConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media RemoveAudioDecoderConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media DeleteProfile -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetVideoSourceConfigurations -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetVideoEncoderConfigurations -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetAudioSourceConfigurations -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetAudioEncoderConfigurations -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetVideoAnalyticsConfigurations -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetMetadataConfigurations -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetAudioOutputConfigurations -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetAudioDecoderConfigurations -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetVideoSourceConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetVideoEncoderConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetAudioSourceConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetAudioEncoderConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetVideoAnalyticsConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetMetadataConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetAudioOutputConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetAudioDecoderConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetCompatibleVideoEncoderConfigurations -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetCompatibleVideoSourceConfigurations -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetCompatibleAudioEncoderConfigurations -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetCompatibleAudioSourceConfigurations -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetCompatibleVideoAnalyticsConfigurations -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetCompatibleMetadataConfigurations -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetCompatibleAudioOutputConfigurations -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetCompatibleAudioDecoderConfigurations -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media SetVideoSourceConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media SetVideoEncoderConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media SetAudioSourceConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media SetAudioEncoderConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media SetVideoAnalyticsConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media SetMetadataConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media SetAudioOutputConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media SetAudioDecoderConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetVideoSourceConfigurationOptions -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetVideoEncoderConfigurationOptions -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetAudioSourceConfigurationOptions -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetAudioEncoderConfigurationOptions -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetMetadataConfigurationOptions -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetAudioOutputConfigurationOptions -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetAudioDecoderConfigurationOptions -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetGuaranteedNumberOfVideoEncoderInstances -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetStreamUri -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media StartMulticastStreaming -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media StopMulticastStreaming -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media SetSynchronizationPoint -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetSnapshotUri -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetVideoSourceModes -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media SetVideoSourceMode -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetOSDs -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetOSD -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media GetOSDOptions -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media SetOSD -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media CreateOSD -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen media media DeleteOSD diff --git a/sdk/ptz/AbsoluteMove_auto.go b/sdk/ptz/AbsoluteMove_auto.go deleted file mode 100644 index 61a877c9..00000000 --- a/sdk/ptz/AbsoluteMove_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_AbsoluteMove forwards the call to dev.CallMethod() then parses the payload of the reply as a AbsoluteMoveResponse. -func Call_AbsoluteMove(ctx context.Context, dev *onvif.Device, request ptz.AbsoluteMove) (ptz.AbsoluteMoveResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - AbsoluteMoveResponse ptz.AbsoluteMoveResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.AbsoluteMoveResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "AbsoluteMove") - return reply.Body.AbsoluteMoveResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/ContinuousMove_auto.go b/sdk/ptz/ContinuousMove_auto.go deleted file mode 100644 index beaf9ab4..00000000 --- a/sdk/ptz/ContinuousMove_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_ContinuousMove forwards the call to dev.CallMethod() then parses the payload of the reply as a ContinuousMoveResponse. -func Call_ContinuousMove(ctx context.Context, dev *onvif.Device, request ptz.ContinuousMove) (ptz.ContinuousMoveResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - ContinuousMoveResponse ptz.ContinuousMoveResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.ContinuousMoveResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "ContinuousMove") - return reply.Body.ContinuousMoveResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/CreatePresetTour_auto.go b/sdk/ptz/CreatePresetTour_auto.go deleted file mode 100644 index 43bea08c..00000000 --- a/sdk/ptz/CreatePresetTour_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_CreatePresetTour forwards the call to dev.CallMethod() then parses the payload of the reply as a CreatePresetTourResponse. -func Call_CreatePresetTour(ctx context.Context, dev *onvif.Device, request ptz.CreatePresetTour) (ptz.CreatePresetTourResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - CreatePresetTourResponse ptz.CreatePresetTourResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.CreatePresetTourResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "CreatePresetTour") - return reply.Body.CreatePresetTourResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/GeoMove_auto.go b/sdk/ptz/GeoMove_auto.go deleted file mode 100644 index 6c70105c..00000000 --- a/sdk/ptz/GeoMove_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_GeoMove forwards the call to dev.CallMethod() then parses the payload of the reply as a GeoMoveResponse. -func Call_GeoMove(ctx context.Context, dev *onvif.Device, request ptz.GeoMove) (ptz.GeoMoveResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GeoMoveResponse ptz.GeoMoveResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GeoMoveResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GeoMove") - return reply.Body.GeoMoveResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/GetCompatibleConfigurations_auto.go b/sdk/ptz/GetCompatibleConfigurations_auto.go deleted file mode 100644 index 8673ee2d..00000000 --- a/sdk/ptz/GetCompatibleConfigurations_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_GetCompatibleConfigurations forwards the call to dev.CallMethod() then parses the payload of the reply as a GetCompatibleConfigurationsResponse. -func Call_GetCompatibleConfigurations(ctx context.Context, dev *onvif.Device, request ptz.GetCompatibleConfigurations) (ptz.GetCompatibleConfigurationsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetCompatibleConfigurationsResponse ptz.GetCompatibleConfigurationsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetCompatibleConfigurationsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetCompatibleConfigurations") - return reply.Body.GetCompatibleConfigurationsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/GetConfigurationOptions_auto.go b/sdk/ptz/GetConfigurationOptions_auto.go deleted file mode 100644 index e9abd7de..00000000 --- a/sdk/ptz/GetConfigurationOptions_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_GetConfigurationOptions forwards the call to dev.CallMethod() then parses the payload of the reply as a GetConfigurationOptionsResponse. -func Call_GetConfigurationOptions(ctx context.Context, dev *onvif.Device, request ptz.GetConfigurationOptions) (ptz.GetConfigurationOptionsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetConfigurationOptionsResponse ptz.GetConfigurationOptionsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetConfigurationOptionsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetConfigurationOptions") - return reply.Body.GetConfigurationOptionsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/GetConfiguration_auto.go b/sdk/ptz/GetConfiguration_auto.go deleted file mode 100644 index 852308e3..00000000 --- a/sdk/ptz/GetConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_GetConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a GetConfigurationResponse. -func Call_GetConfiguration(ctx context.Context, dev *onvif.Device, request ptz.GetConfiguration) (ptz.GetConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetConfigurationResponse ptz.GetConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetConfiguration") - return reply.Body.GetConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/GetConfigurations_auto.go b/sdk/ptz/GetConfigurations_auto.go deleted file mode 100644 index 41da1375..00000000 --- a/sdk/ptz/GetConfigurations_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_GetConfigurations forwards the call to dev.CallMethod() then parses the payload of the reply as a GetConfigurationsResponse. -func Call_GetConfigurations(ctx context.Context, dev *onvif.Device, request ptz.GetConfigurations) (ptz.GetConfigurationsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetConfigurationsResponse ptz.GetConfigurationsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetConfigurationsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetConfigurations") - return reply.Body.GetConfigurationsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/GetNode_auto.go b/sdk/ptz/GetNode_auto.go deleted file mode 100644 index 7f469521..00000000 --- a/sdk/ptz/GetNode_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_GetNode forwards the call to dev.CallMethod() then parses the payload of the reply as a GetNodeResponse. -func Call_GetNode(ctx context.Context, dev *onvif.Device, request ptz.GetNode) (ptz.GetNodeResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetNodeResponse ptz.GetNodeResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetNodeResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetNode") - return reply.Body.GetNodeResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/GetNodes_auto.go b/sdk/ptz/GetNodes_auto.go deleted file mode 100644 index 84699b0e..00000000 --- a/sdk/ptz/GetNodes_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_GetNodes forwards the call to dev.CallMethod() then parses the payload of the reply as a GetNodesResponse. -func Call_GetNodes(ctx context.Context, dev *onvif.Device, request ptz.GetNodes) (ptz.GetNodesResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetNodesResponse ptz.GetNodesResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetNodesResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetNodes") - return reply.Body.GetNodesResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/GetPresetTourOptions_auto.go b/sdk/ptz/GetPresetTourOptions_auto.go deleted file mode 100644 index 2a63618f..00000000 --- a/sdk/ptz/GetPresetTourOptions_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_GetPresetTourOptions forwards the call to dev.CallMethod() then parses the payload of the reply as a GetPresetTourOptionsResponse. -func Call_GetPresetTourOptions(ctx context.Context, dev *onvif.Device, request ptz.GetPresetTourOptions) (ptz.GetPresetTourOptionsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetPresetTourOptionsResponse ptz.GetPresetTourOptionsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetPresetTourOptionsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetPresetTourOptions") - return reply.Body.GetPresetTourOptionsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/GetPresetTour_auto.go b/sdk/ptz/GetPresetTour_auto.go deleted file mode 100644 index 15fef289..00000000 --- a/sdk/ptz/GetPresetTour_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_GetPresetTour forwards the call to dev.CallMethod() then parses the payload of the reply as a GetPresetTourResponse. -func Call_GetPresetTour(ctx context.Context, dev *onvif.Device, request ptz.GetPresetTour) (ptz.GetPresetTourResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetPresetTourResponse ptz.GetPresetTourResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetPresetTourResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetPresetTour") - return reply.Body.GetPresetTourResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/GetPresetTours_auto.go b/sdk/ptz/GetPresetTours_auto.go deleted file mode 100644 index ea848584..00000000 --- a/sdk/ptz/GetPresetTours_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_GetPresetTours forwards the call to dev.CallMethod() then parses the payload of the reply as a GetPresetToursResponse. -func Call_GetPresetTours(ctx context.Context, dev *onvif.Device, request ptz.GetPresetTours) (ptz.GetPresetToursResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetPresetToursResponse ptz.GetPresetToursResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetPresetToursResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetPresetTours") - return reply.Body.GetPresetToursResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/GetPresets_auto.go b/sdk/ptz/GetPresets_auto.go deleted file mode 100644 index 1273f5cc..00000000 --- a/sdk/ptz/GetPresets_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_GetPresets forwards the call to dev.CallMethod() then parses the payload of the reply as a GetPresetsResponse. -func Call_GetPresets(ctx context.Context, dev *onvif.Device, request ptz.GetPresets) (ptz.GetPresetsResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetPresetsResponse ptz.GetPresetsResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetPresetsResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetPresets") - return reply.Body.GetPresetsResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/GetServiceCapabilities_auto.go b/sdk/ptz/GetServiceCapabilities_auto.go deleted file mode 100644 index 4c6b7a30..00000000 --- a/sdk/ptz/GetServiceCapabilities_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// 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 ptz.GetServiceCapabilities) (ptz.GetServiceCapabilitiesResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetServiceCapabilitiesResponse ptz.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") - } -} diff --git a/sdk/ptz/GetStatus_auto.go b/sdk/ptz/GetStatus_auto.go deleted file mode 100644 index 433df4d6..00000000 --- a/sdk/ptz/GetStatus_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_GetStatus forwards the call to dev.CallMethod() then parses the payload of the reply as a GetStatusResponse. -func Call_GetStatus(ctx context.Context, dev *onvif.Device, request ptz.GetStatus) (ptz.GetStatusResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GetStatusResponse ptz.GetStatusResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GetStatusResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GetStatus") - return reply.Body.GetStatusResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/GotoHomePosition_auto.go b/sdk/ptz/GotoHomePosition_auto.go deleted file mode 100644 index ce6c22d7..00000000 --- a/sdk/ptz/GotoHomePosition_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_GotoHomePosition forwards the call to dev.CallMethod() then parses the payload of the reply as a GotoHomePositionResponse. -func Call_GotoHomePosition(ctx context.Context, dev *onvif.Device, request ptz.GotoHomePosition) (ptz.GotoHomePositionResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GotoHomePositionResponse ptz.GotoHomePositionResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GotoHomePositionResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GotoHomePosition") - return reply.Body.GotoHomePositionResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/GotoPreset_auto.go b/sdk/ptz/GotoPreset_auto.go deleted file mode 100644 index 28dac132..00000000 --- a/sdk/ptz/GotoPreset_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_GotoPreset forwards the call to dev.CallMethod() then parses the payload of the reply as a GotoPresetResponse. -func Call_GotoPreset(ctx context.Context, dev *onvif.Device, request ptz.GotoPreset) (ptz.GotoPresetResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - GotoPresetResponse ptz.GotoPresetResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.GotoPresetResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "GotoPreset") - return reply.Body.GotoPresetResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/ModifyPresetTour_auto.go b/sdk/ptz/ModifyPresetTour_auto.go deleted file mode 100644 index 2d0d6e00..00000000 --- a/sdk/ptz/ModifyPresetTour_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_ModifyPresetTour forwards the call to dev.CallMethod() then parses the payload of the reply as a ModifyPresetTourResponse. -func Call_ModifyPresetTour(ctx context.Context, dev *onvif.Device, request ptz.ModifyPresetTour) (ptz.ModifyPresetTourResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - ModifyPresetTourResponse ptz.ModifyPresetTourResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.ModifyPresetTourResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "ModifyPresetTour") - return reply.Body.ModifyPresetTourResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/OperatePresetTour_auto.go b/sdk/ptz/OperatePresetTour_auto.go deleted file mode 100644 index 9e278d0e..00000000 --- a/sdk/ptz/OperatePresetTour_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_OperatePresetTour forwards the call to dev.CallMethod() then parses the payload of the reply as a OperatePresetTourResponse. -func Call_OperatePresetTour(ctx context.Context, dev *onvif.Device, request ptz.OperatePresetTour) (ptz.OperatePresetTourResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - OperatePresetTourResponse ptz.OperatePresetTourResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.OperatePresetTourResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "OperatePresetTour") - return reply.Body.OperatePresetTourResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/RelativeMove_auto.go b/sdk/ptz/RelativeMove_auto.go deleted file mode 100644 index 8a241898..00000000 --- a/sdk/ptz/RelativeMove_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_RelativeMove forwards the call to dev.CallMethod() then parses the payload of the reply as a RelativeMoveResponse. -func Call_RelativeMove(ctx context.Context, dev *onvif.Device, request ptz.RelativeMove) (ptz.RelativeMoveResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - RelativeMoveResponse ptz.RelativeMoveResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.RelativeMoveResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "RelativeMove") - return reply.Body.RelativeMoveResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/RemovePresetTour_auto.go b/sdk/ptz/RemovePresetTour_auto.go deleted file mode 100644 index ed220490..00000000 --- a/sdk/ptz/RemovePresetTour_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_RemovePresetTour forwards the call to dev.CallMethod() then parses the payload of the reply as a RemovePresetTourResponse. -func Call_RemovePresetTour(ctx context.Context, dev *onvif.Device, request ptz.RemovePresetTour) (ptz.RemovePresetTourResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - RemovePresetTourResponse ptz.RemovePresetTourResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.RemovePresetTourResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "RemovePresetTour") - return reply.Body.RemovePresetTourResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/RemovePreset_auto.go b/sdk/ptz/RemovePreset_auto.go deleted file mode 100644 index ae4828f4..00000000 --- a/sdk/ptz/RemovePreset_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_RemovePreset forwards the call to dev.CallMethod() then parses the payload of the reply as a RemovePresetResponse. -func Call_RemovePreset(ctx context.Context, dev *onvif.Device, request ptz.RemovePreset) (ptz.RemovePresetResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - RemovePresetResponse ptz.RemovePresetResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.RemovePresetResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "RemovePreset") - return reply.Body.RemovePresetResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/SendAuxiliaryCommand_auto.go b/sdk/ptz/SendAuxiliaryCommand_auto.go deleted file mode 100644 index 23a7fa42..00000000 --- a/sdk/ptz/SendAuxiliaryCommand_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// 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 ptz.SendAuxiliaryCommand) (ptz.SendAuxiliaryCommandResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - SendAuxiliaryCommandResponse ptz.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") - } -} diff --git a/sdk/ptz/SetConfiguration_auto.go b/sdk/ptz/SetConfiguration_auto.go deleted file mode 100644 index 262be180..00000000 --- a/sdk/ptz/SetConfiguration_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_SetConfiguration forwards the call to dev.CallMethod() then parses the payload of the reply as a SetConfigurationResponse. -func Call_SetConfiguration(ctx context.Context, dev *onvif.Device, request ptz.SetConfiguration) (ptz.SetConfigurationResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - SetConfigurationResponse ptz.SetConfigurationResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.SetConfigurationResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetConfiguration") - return reply.Body.SetConfigurationResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/SetHomePosition_auto.go b/sdk/ptz/SetHomePosition_auto.go deleted file mode 100644 index bef68884..00000000 --- a/sdk/ptz/SetHomePosition_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_SetHomePosition forwards the call to dev.CallMethod() then parses the payload of the reply as a SetHomePositionResponse. -func Call_SetHomePosition(ctx context.Context, dev *onvif.Device, request ptz.SetHomePosition) (ptz.SetHomePositionResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - SetHomePositionResponse ptz.SetHomePositionResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.SetHomePositionResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetHomePosition") - return reply.Body.SetHomePositionResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/SetPreset_auto.go b/sdk/ptz/SetPreset_auto.go deleted file mode 100644 index d319dbb1..00000000 --- a/sdk/ptz/SetPreset_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_SetPreset forwards the call to dev.CallMethod() then parses the payload of the reply as a SetPresetResponse. -func Call_SetPreset(ctx context.Context, dev *onvif.Device, request ptz.SetPreset) (ptz.SetPresetResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - SetPresetResponse ptz.SetPresetResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.SetPresetResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "SetPreset") - return reply.Body.SetPresetResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/Stop_auto.go b/sdk/ptz/Stop_auto.go deleted file mode 100644 index dc21364b..00000000 --- a/sdk/ptz/Stop_auto.go +++ /dev/null @@ -1,30 +0,0 @@ -// Code generated : DO NOT EDIT. -// Copyright (c) 2022 Jean-Francois SMIGIELSKI -// Distributed under the MIT License - -package ptz - -import ( - "context" - "github.com/juju/errors" - "github.com/kerberos-io/onvif" - "github.com/kerberos-io/onvif/sdk" - "github.com/kerberos-io/onvif/ptz" -) - -// Call_Stop forwards the call to dev.CallMethod() then parses the payload of the reply as a StopResponse. -func Call_Stop(ctx context.Context, dev *onvif.Device, request ptz.Stop) (ptz.StopResponse, error) { - type Envelope struct { - Header struct{} - Body struct { - StopResponse ptz.StopResponse - } - } - var reply Envelope - if httpReply, err := dev.CallMethod(request); err != nil { - return reply.Body.StopResponse, errors.Annotate(err, "call") - } else { - err = sdk.ReadAndParse(ctx, httpReply, &reply, "Stop") - return reply.Body.StopResponse, errors.Annotate(err, "reply") - } -} diff --git a/sdk/ptz/ptz.go b/sdk/ptz/ptz.go deleted file mode 100644 index 40b7ee22..00000000 --- a/sdk/ptz/ptz.go +++ /dev/null @@ -1,30 +0,0 @@ -package ptz - -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz GetServiceCapabilities -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz GetNodes -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz GetNode -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz GetConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz GetConfigurations -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz SetConfiguration -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz GetConfigurationOptions -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz SendAuxiliaryCommand -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz GetPresets -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz SetPreset -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz RemovePreset -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz GotoPreset -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz GotoHomePosition -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz SetHomePosition -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz ContinuousMove -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz RelativeMove -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz GetStatus -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz AbsoluteMove -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz GeoMove -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz Stop -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz GetPresetTours -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz GetPresetTour -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz GetPresetTourOptions -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz CreatePresetTour -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz ModifyPresetTour -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz OperatePresetTour -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz RemovePresetTour -//go:generate go run github.com/kerberos-io/onvif/sdk/codegen ptz ptz GetCompatibleConfigurations diff --git a/sdk/sdk.go b/sdk/sdk.go deleted file mode 100644 index 0399b4ee..00000000 --- a/sdk/sdk.go +++ /dev/null @@ -1,43 +0,0 @@ -package sdk - -import ( - "context" - "encoding/xml" - "io/ioutil" - "net/http" - "os" - "time" - - "github.com/juju/errors" - "github.com/rs/zerolog" -) - -var ( - // LoggerContext is the builder of a zerolog.Logger that is exposed to the application so that - // options at the CLI might alter the formatting and the output of the logs. - LoggerContext = zerolog. - New(zerolog.ConsoleWriter{Out: os.Stderr, TimeFormat: time.RFC3339}). - With().Timestamp() - - // Logger is a zerolog logger, that can be safely used from any part of the application. - // It gathers the format and the output. - Logger = LoggerContext.Logger() -) - -func ReadAndParse(ctx context.Context, httpReply *http.Response, reply interface{}, tag string) error { - Logger.Debug(). - Str("msg", httpReply.Status). - Int("status", httpReply.StatusCode). - Str("action", tag). - Msg("RPC") - // TODO(jfsmig): extract the deadline from ctx.Deadline() and apply it on the reply reading - b, err := ioutil.ReadAll(httpReply.Body) - if err != nil { - return errors.Annotate(err, "read") - } - - httpReply.Body.Close() - - err = xml.Unmarshal(b, reply) - return errors.Annotate(err, "decode") -} diff --git a/ws-discovery/networking.go b/ws-discovery/networking.go index 7c1dc4f7..4013d40c 100644 --- a/ws-discovery/networking.go +++ b/ws-discovery/networking.go @@ -9,87 +9,171 @@ package wsdiscovery * permission of Palanjyan Zhorzhik *******************************************************/ +// Copyright (C) 2022 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 + import ( "errors" + "fmt" "net" + "net/http" + "net/url" "os" + "strings" "time" - "github.com/gofrs/uuid" + "github.com/beevik/etree" + "github.com/google/uuid" + "github.com/kerberos-io/onvif" "golang.org/x/net/ipv4" ) -const bufSize = 8192 +const ( + bufSize = 8192 +) + +// GetAvailableDevicesAtSpecificEthernetInterface sends a ws-discovery Probe Message via +// UDP multicast to Discover NVT type Devices +func GetAvailableDevicesAtSpecificEthernetInterface(interfaceName string) ([]onvif.Device, error) { + types := []string{"dn:NetworkVideoTransmitter"} + namespaces := map[string]string{"dn": "http://www.onvif.org/ver10/network/wsdl", "ds": "http://www.onvif.org/ver10/device/wsdl"} + + probeResponses, err := SendProbe(interfaceName, nil, types, namespaces) + if err != nil { + return nil, fmt.Errorf("failed to probe: %w", err) + } + + nvtDevices, err := DevicesFromProbeResponses(probeResponses) + if err != nil { + return nil, fmt.Errorf("failed to discover Onvif devices: %w", err) + } + + return nvtDevices, nil +} + +func DevicesFromProbeResponses(probeResponses []string) ([]onvif.Device, error) { + nvtDevices := make([]onvif.Device, 0) + xaddrSet := make(map[string]struct{}) + for _, j := range probeResponses { + doc := etree.NewDocument() + if err := doc.ReadFromString(j); err != nil { + return nil, err + } + + probeMatches := doc.Root().FindElements("./Body/ProbeMatches/ProbeMatch") + for _, probeMatch := range probeMatches { + var xaddr string + if address := probeMatch.FindElement("./XAddrs"); address != nil { + u, err := url.Parse(address.Text()) + if err != nil { + // TODO: Add logger for fmt.Printf("Invalid XAddrs: %s\n", address.Text()) + continue + } + xaddr = u.Host + } + if _, dupe := xaddrSet[xaddr]; dupe { + // TODO: Add logger for fmt.Printf("Skipping duplicate XAddr: %s\n", xaddr) + continue + } + + var endpointRefAddress string + if ref := probeMatch.FindElement("./EndpointReference/Address"); ref != nil { + uuidElements := strings.Split(ref.Text(), ":") + endpointRefAddress = uuidElements[len(uuidElements)-1] + } + + dev, err := onvif.NewDevice(onvif.DeviceParams{ + Xaddr: xaddr, + EndpointRefAddress: endpointRefAddress, + HttpClient: &http.Client{ + Timeout: 2 * time.Second, + }, + }) + if err != nil { + // TODO: Add logger for fmt.Printf("Failed to connect to camera at %s: %s\n", xaddr, err.Error()) + continue + } + + var scopes []string + ref := probeMatch.FindElement("./Scopes") + if ref != nil { + scopes = strings.Split(ref.Text(), " ") + } + dev.SetDeviceInfoFromScopes(scopes) + + xaddrSet[xaddr] = struct{}{} + nvtDevices = append(nvtDevices, *dev) + // TODO: Add logger for fmt.Printf("Onvif WS-Discovery: Find Xaddr: %-25s EndpointRefAddress: %s\n", xaddr, string(endpointRefAddress)) + } + } + + return nvtDevices, nil +} -//SendProbe to device +// SendProbe to device func SendProbe(interfaceName string, scopes, types []string, namespaces map[string]string) ([]string, error) { - // Creating UUID Version 4 - uuidV4 := uuid.Must(uuid.NewV4()) - //fmt.Printf("UUIDv4: %s\n", uuidV4) - - probeSOAP := buildProbeMessage(uuidV4.String(), scopes, types, namespaces) - //probeSOAP = ` - // - //
- //http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe - //uuid:78a2ed98-bc1f-4b08-9668-094fcba81e35 - //http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous - //urn:schemas-xmlsoap-org:ws:2005:04:discovery - //
- // - //dp0:NetworkVideoTransmitter - // - // - //
` - - return sendUDPMulticast(probeSOAP.String(), interfaceName) + probeSOAP := BuildProbeMessage(uuid.NewString(), scopes, types, namespaces) + return SendUDPMulticast(probeSOAP.String(), interfaceName) } -func sendUDPMulticast(msg string, interfaceName string) ([]string, error) { +func SendUDPMulticast(msg string, interfaceName string) ([]string, error) { + var responses []string + data := []byte(msg) + c, err := net.ListenPacket("udp4", "0.0.0.0:0") if err != nil { return nil, err } defer c.Close() - iface, err := net.InterfaceByName(interfaceName) - if err != nil { - return nil, err - } - p := ipv4.NewPacketConn(c) + + // 239.255.255.250 port 3702 is the multicast address and port used by ws-discovery group := net.IPv4(239, 255, 255, 250) - if err := p.JoinGroup(iface, &net.UDPAddr{IP: group}); err != nil { - return nil, err + dest := &net.UDPAddr{IP: group, Port: 3702} + + var iface *net.Interface + if interfaceName == "" { + iface = nil + } else { + iface, err = net.InterfaceByName(interfaceName) + if err != nil { + return nil, fmt.Errorf("failed to call InterfaceByName for interface %q: %w", interfaceName, err) + } } - dst := &net.UDPAddr{IP: group, Port: 3702} - data := []byte(msg) - for _, ifi := range []*net.Interface{iface} { - if err := p.SetMulticastInterface(ifi); err != nil { - return nil, err + if err = p.JoinGroup(iface, &net.UDPAddr{IP: group}); err != nil { + return nil, fmt.Errorf("failed to JoinGroup for ws-discovery: %w", err) + } + if iface != nil { + if err = p.SetMulticastInterface(iface); err != nil { + return nil, fmt.Errorf("failed to SetMulticastInterface for interface %q: %w", interfaceName, err) } - p.SetMulticastTTL(2) - if _, err := p.WriteTo(data, nil, dst); err != nil { - return nil, err + if err = p.SetMulticastTTL(2); err != nil { + return nil, fmt.Errorf("failed to SetMulticastTTL: %w", err) } } + if _, err = p.WriteTo(data, nil, dest); err != nil { + return nil, fmt.Errorf("failed to write to ws-discovery multicast address %s: %w", dest.String(), err) + } - if err := p.SetReadDeadline(time.Now().Add(time.Second * 1)); err != nil { - return nil, err + if err = p.SetReadDeadline(time.Now().Add(time.Second * 1)); err != nil { + return nil, fmt.Errorf("failed to set read deadline: %w", err) } - var result []string + b := make([]byte, bufSize) + + // keep reading from the PacketConn until the read deadline expires or an error occurs for { - b := make([]byte, bufSize) n, _, _, err := p.ReadFrom(b) if err != nil { + // ErrDeadlineExceeded is expected once the read timeout is expired if !errors.Is(err, os.ErrDeadlineExceeded) { - return nil, err + return nil, fmt.Errorf("unexpected error occurred while reading ws-discovery responses: %w", err) } break } - result = append(result, string(b[0:n])) + responses = append(responses, string(b[0:n])) } - return result, nil + return responses, nil } diff --git a/ws-discovery/networking_test.go b/ws-discovery/networking_test.go new file mode 100644 index 00000000..a845db29 --- /dev/null +++ b/ws-discovery/networking_test.go @@ -0,0 +1,56 @@ +package wsdiscovery + +import ( + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" +) + +func TestDevicesFromProbeResponses(t *testing.T) { + probeResponses := []string{ + ` + + + + + + urn:uuid:cea94000-fb96-11b3-8260-686dbc5cb15d + + dn:NetworkVideoTransmitter tds:Device + onvif://www.onvif.org/type/video_encoder onvif://www.onvif.org/Profile/Streaming onvif://www.onvif.org/MAC/68:6d:bc:5c:b1:5d onvif://www.onvif.org/hardware/DFI6256TE http:123 + http://192.168.12.123/onvif/device_service + 10 + + + + `, + ` + + + + + + uuid:3fa1fe68-b915-4053-a3e1-c006c3afec0e + + + ttl + + tdn:NetworkVideoTransmitter + onvif://www.onvif.org/name/TP-IPC onvif://www.onvif.org/hardware/MODEL onvif://www.onvif.org/Profile/Streaming onvif://www.onvif.org/location/ShenZhen onvif://www.onvif.org/type/NetworkVideoTransmitter + http://192.168.12.128:2020/onvif/device_service + 1 + + + + `, + } + + devices, err := DevicesFromProbeResponses(probeResponses) + require.NoError(t, err) + require.Equal(t, 2, len(devices)) + assert.Equal(t, devices[0].GetDeviceParams().Xaddr, "192.168.12.123") + assert.Equal(t, devices[0].GetDeviceParams().EndpointRefAddress, "cea94000-fb96-11b3-8260-686dbc5cb15d") + assert.Equal(t, devices[1].GetDeviceParams().Xaddr, "192.168.12.128:2020") + assert.Equal(t, devices[1].GetDeviceParams().EndpointRefAddress, "3fa1fe68-b915-4053-a3e1-c006c3afec0e") +} diff --git a/ws-discovery/ws-discovery.go b/ws-discovery/ws-discovery.go index e6c6293a..450dfd8d 100644 --- a/ws-discovery/ws-discovery.go +++ b/ws-discovery/ws-discovery.go @@ -7,22 +7,41 @@ import ( "github.com/kerberos-io/onvif/gosoap" ) -func buildProbeMessage(uuidV4 string, scopes, types []string, nmsp map[string]string) gosoap.SoapMessage { - //Список namespace +// BuildProbeMessage generates a SOAP ws-discovery Probe message +// +// Example Message: +// +// +// +// +// http://schemas.xmlsoap.org/ws/2005/04/discovery/Probe +// uuid:a277f13a-ecae-4492-9d6a-218982122d1c +// urn:schemas-xmlsoap-org:ws:2005:04:discovery +// +// +// +// dn:NetworkVideoTransmitter +// +// +// +func BuildProbeMessage(uuidV4 string, scopes, types []string, nmsp map[string]string) gosoap.SoapMessage { + // Namespace List namespaces := make(map[string]string) namespaces["a"] = "http://schemas.xmlsoap.org/ws/2004/08/addressing" - //namespaces["d"] = "http://schemas.xmlsoap.org/ws/2005/04/discovery" + namespaces["d"] = "http://schemas.xmlsoap.org/ws/2005/04/discovery" + namespaces["dn"] = "http://www.onvif.org/ver10/network/wsdl" probeMessage := gosoap.NewEmptySOAP() - probeMessage.AddRootNamespaces(namespaces) - //if len(nmsp) != 0 { - // probeMessage.AddRootNamespaces(nmsp) - //} - - //fmt.Println(probeMessage.String()) + if len(nmsp) != 0 { + probeMessage.AddRootNamespaces(nmsp) + } - //Содержимое Head + // Probe Header var headerContent []*etree.Element action := etree.NewElement("a:Action") @@ -32,49 +51,25 @@ func buildProbeMessage(uuidV4 string, scopes, types []string, nmsp map[string]st msgID := etree.NewElement("a:MessageID") msgID.SetText("uuid:" + uuidV4) - replyTo := etree.NewElement("a:ReplyTo") - replyTo.CreateElement("a:Address").SetText("http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous") - to := etree.NewElement("a:To") to.SetText("urn:schemas-xmlsoap-org:ws:2005:04:discovery") to.CreateAttr("mustUnderstand", "1") - headerContent = append(headerContent, action, msgID, replyTo, to) + headerContent = append(headerContent, action, msgID, to) probeMessage.AddHeaderContents(headerContent) - //Содержимое Body - probe := etree.NewElement("Probe") - probe.CreateAttr("xmlns", "http://schemas.xmlsoap.org/ws/2005/04/discovery") + // Probe Body + probe := etree.NewElement("d:Probe") if len(types) != 0 { typesTag := etree.NewElement("d:Types") - if len(nmsp) != 0 { - for key, value := range nmsp { - typesTag.CreateAttr("xmlns:"+key, value) - } - } - typesTag.CreateAttr("xmlns:d", "http://schemas.xmlsoap.org/ws/2005/04/discovery") - //typesTag.CreateAttr("xmlns:dp0", "http://www.onvif.org/ver10/network/wsdl") - var typesString string - for _, j := range types { - typesString += j - typesString += " " - } - - typesTag.SetText(strings.TrimSpace(typesString)) - + typesTag.SetText(strings.Join(types, " ")) probe.AddChild(typesTag) } if len(scopes) != 0 { scopesTag := etree.NewElement("d:Scopes") - var scopesString string - for _, j := range scopes { - scopesString += j - scopesString += " " - } - scopesTag.SetText(strings.TrimSpace(scopesString)) - + scopesTag.SetText(strings.Join(scopes, " ")) probe.AddChild(scopesTag) } diff --git a/xsd/built_in.go b/xsd/built_in.go index 2592b0ab..3ff59caf 100644 --- a/xsd/built_in.go +++ b/xsd/built_in.go @@ -29,128 +29,127 @@ type AnySimpleType string ***********************************************************/ /* - The string datatype represents character strings in XML. - The ·value space· of string is the set of finite-length sequences of characters. - String has the following constraining facets: - • length - • minLength - • maxLength - • pattern - • enumeration - • whiteSpace +The string datatype represents character strings in XML. +The ·value space· of string is the set of finite-length sequences of characters. +String has the following constraining facets: +• length +• minLength +• maxLength +• pattern +• enumeration +• whiteSpace - More info: https://www.w3.org/TR/xmlschema-2/#string +More info: https://www.w3.org/TR/xmlschema-2/#string - //TODO: valid/invalid character declaration and process restrictions +//TODO: valid/invalid character declaration and process restrictions */ type String string /* - Construct an instance of xsd String type +Construct an instance of xsd String type */ func (tp String) NewString(data string) String { return String(data) } /* - Boolean has the ·value space· required to support the mathematical concept of binary-valued logic: {true, false}. - Boolean has the following ·constraining facets·: - • pattern - • whiteSpace +Boolean has the ·value space· required to support the mathematical concept of binary-valued logic: {true, false}. +Boolean has the following ·constraining facets·: +• pattern +• whiteSpace - More info: https://www.w3.org/TR/xmlschema-2/#boolean +More info: https://www.w3.org/TR/xmlschema-2/#boolean - //TODO: process restrictions +//TODO: process restrictions */ type Boolean bool /* - Construct an instance of xsd Boolean type +Construct an instance of xsd Boolean type */ func (tp Boolean) NewBool(data bool) Boolean { return Boolean(data) } /* - Float is patterned after the IEEE single-precision 32-bit floating point type - Float has the following ·constraining facets·: - • pattern - • enumeration - • whiteSpace - • maxInclusive - • maxExclusive - • minInclusive - • minExclusive +Float is patterned after the IEEE single-precision 32-bit floating point type +Float has the following ·constraining facets·: +• pattern +• enumeration +• whiteSpace +• maxInclusive +• maxExclusive +• minInclusive +• minExclusive - More info: https://www.w3.org/TR/xmlschema-2/#float +More info: https://www.w3.org/TR/xmlschema-2/#float - //TODO: process restrictions +//TODO: process restrictions */ type Float float32 /* - Construct an instance of xsd Float type +Construct an instance of xsd Float type */ func (tp Float) NewFloat(data float32) Float { return Float(data) } /* - The double datatype is patterned after the IEEE double-precision 64-bit floating point type - Double has the following ·constraining facets·: - • pattern - • enumeration - • whiteSpace - • maxInclusive - • maxExclusive - • minInclusive - • minExclusive +The double datatype is patterned after the IEEE double-precision 64-bit floating point type +Double has the following ·constraining facets·: +• pattern +• enumeration +• whiteSpace +• maxInclusive +• maxExclusive +• minInclusive +• minExclusive - More info: https://www.w3.org/TR/xmlschema-2/#double +More info: https://www.w3.org/TR/xmlschema-2/#double - //TODO: process restrictions +//TODO: process restrictions */ type Double float64 /* - Construct an instance of xsd Double type +Construct an instance of xsd Double type */ func (tp Double) NewDouble(data float64) Double { return Double(data) } /* - The type decimal represents a decimal number of arbitrary precision. - Schema processors vary in the number of significant digits they support, - but a conforming processor must support a minimum of 18 significant digits. - The format of xsd:decimal is a sequence of digits optionally preceded by a sign ("+" or "-") - and optionally containing a period. The value may start or end with a period. - If the fractional part is 0 then the period and trailing zeros may be omitted. - Leading and trailing zeros are permitted, but they are not considered significant. - That is, the decimal values 3.0 and 3.0000 are considered equal. - - Source: http://www.datypic.com/sc/xsd/t-xsd_decimal.html - - Decimal has the following ·constraining facets·: - • totalDigits - • fractionDigits - • pattern - • whiteSpace - • enumeration - • maxInclusive - • maxExclusive - • minInclusive - • minExclusive +The type decimal represents a decimal number of arbitrary precision. +Schema processors vary in the number of significant digits they support, +but a conforming processor must support a minimum of 18 significant digits. +The format of xsd:decimal is a sequence of digits optionally preceded by a sign ("+" or "-") +and optionally containing a period. The value may start or end with a period. +If the fractional part is 0 then the period and trailing zeros may be omitted. +Leading and trailing zeros are permitted, but they are not considered significant. +That is, the decimal values 3.0 and 3.0000 are considered equal. - More info: https://www.w3.org/TR/xmlschema-2/#decimal +Source: http://www.datypic.com/sc/xsd/t-xsd_decimal.html - //TODO: process restrictions, valid/invalid characters(commas are not permitted; the decimal separator must be a period) +Decimal has the following ·constraining facets·: +• totalDigits +• fractionDigits +• pattern +• whiteSpace +• enumeration +• maxInclusive +• maxExclusive +• minInclusive +• minExclusive +More info: https://www.w3.org/TR/xmlschema-2/#decimal + +//TODO: process restrictions, valid/invalid characters(commas are not permitted; the decimal separator must be a period) */ type Decimal string /* - Construct an instance of xsd Decimal type +Construct an instance of xsd Decimal type */ func (tp Decimal) NewDecimal(data string) Decimal { return Decimal(data) @@ -180,11 +179,11 @@ func (tp Decimal) NewDecimal(data string) Decimal { TODO: Look at time.Duration go type */ -//Duration alias for AnySimpleType +// Duration alias for AnySimpleType type Duration AnySimpleType /* - Construct an instance of xsd duration type +Construct an instance of xsd duration type */ func (tp Duration) NewDateTime(years, months, days, hours, minutes, seconds string) Duration { i, err := iso8601.NewDuration( @@ -206,197 +205,192 @@ func (tp Duration) NewDateTime(years, months, days, hours, minutes, seconds stri } /* - DateTime values may be viewed as objects with integer-valued year, month, day, hour - and minute properties, a decimal-valued second property, and a boolean timezoned property. - +DateTime values may be viewed as objects with integer-valued year, month, day, hour +and minute properties, a decimal-valued second property, and a boolean timezoned property. - The ·lexical space· of dateTime consists of finite-length sequences of characters of the form: - '-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)?, +The ·lexical space· of dateTime consists of finite-length sequences of characters of the form: + '-'? yyyy '-' mm '-' dd 'T' hh ':' mm ':' ss ('.' s+)? (zzzzzz)?, - DateTime has the following ·constraining facets·: - - • pattern - • enumeration - • whiteSpace - • maxInclusive - • maxExclusive - • minInclusive - • minExclusive +DateTime has the following ·constraining facets·: - More info: https://www.w3.org/TR/xmlschema-2/#dateTime +• pattern +• enumeration +• whiteSpace +• maxInclusive +• maxExclusive +• minInclusive +• minExclusive - TODO: decide good type for time with proper format - TODO: process restrictions -*/ -type DateTime AnySimpleType +More info: https://www.w3.org/TR/xmlschema-2/#dateTime -/* - Construct an instance of xsd dateTime type +TODO: decide good type for time with proper format +TODO: process restrictions */ -func (tp DateTime) NewDateTime(time time.Time) DateTime { - return DateTime(time.Format("2002-10-10T12:00:00-05:00")) +type DateTime struct { + Time Time + Date Date } /* - Time represents an instant of time that recurs every day. - The ·value space· of time is the space of time of day values - as defined in § 5.3 of [ISO 8601]. Specifically, it is a set - of zero-duration daily time instances. - - Time has the following ·constraining facets·: +Time represents an instant of time that recurs every day. +The ·value space· of time is the space of time of day values +as defined in § 5.3 of [ISO 8601]. Specifically, it is a set +of zero-duration daily time instances. - • pattern - • enumeration - • whiteSpace - • maxInclusive - • maxExclusive - • minInclusive - • minExclusive +Time has the following ·constraining facets·: - More info: https://www.w3.org/TR/xmlschema-2/#time +• pattern +• enumeration +• whiteSpace +• maxInclusive +• maxExclusive +• minInclusive +• minExclusive - TODO: process restrictions -*/ -type Time AnySimpleType +More info: https://www.w3.org/TR/xmlschema-2/#time -/* - Construct an instance of xsd time type +TODO: process restrictions */ -func (tp DateTime) NewTime(time time.Time) DateTime { - return DateTime(time.Format("15:04:05")) +type Time struct { + Hour Int + Minute Int + Second Int } /* - The ·value space· of date consists of top-open intervals of - exactly one day in length on the timelines of dateTime, beginning - on the beginning moment of each day (in each timezone), - i.e. '00:00:00', up to but not including '24:00:00' - (which is identical with '00:00:00' of the next day). - For nontimezoned values, the top-open intervals disjointly - cover the nontimezoned timeline, one per day. For timezoned - values, the intervals begin at every minute and therefore overlap. + Construct an instance of xsd time type */ -type Date AnySimpleType /* - Construct an instance of xsd date type +The ·value space· of date consists of top-open intervals of +exactly one day in length on the timelines of dateTime, beginning +on the beginning moment of each day (in each timezone), +i.e. '00:00:00', up to but not including '24:00:00' +(which is identical with '00:00:00' of the next day). +For nontimezoned values, the top-open intervals disjointly +cover the nontimezoned timeline, one per day. For timezoned +values, the intervals begin at every minute and therefore overlap. */ -func (tp Date) NewDate(time time.Time) Date { - return Date(time.Format("2004-04-12-05:00")) +type Date struct { + Year Int + Month Int + Day Int } /* - The type xsd:gYearMonth represents a specific month of a specific - year. The letter g signifies "Gregorian." The format of - xsd:gYearMonth is CCYY-MM. No left truncation is allowed on - either part. To represents years later than 9999, additional - digits can be added to the left of the year value. - To represent years before 0001, a preceding minus sign ("-") - is permitted. +The type xsd:gYearMonth represents a specific month of a specific +year. The letter g signifies "Gregorian." The format of +xsd:gYearMonth is CCYY-MM. No left truncation is allowed on +either part. To represents years later than 9999, additional +digits can be added to the left of the year value. +To represent years before 0001, a preceding minus sign ("-") +is permitted. - Source: http://www.datypic.com/sc/xsd/t-xsd_gYearMonth.html +Source: http://www.datypic.com/sc/xsd/t-xsd_gYearMonth.html - More info: https://www.w3.org/TR/xmlschema-2/#gYearMonth +More info: https://www.w3.org/TR/xmlschema-2/#gYearMonth */ type GYearMonth AnySimpleType /* - Construct an instance of xsd GYearMonth type +Construct an instance of xsd GYearMonth type */ -func (tp GYearMonth) NewGYearMonth(t time.Time) GYearMonth { - return GYearMonth(fmt.Sprintf("%4d-%2d", t.Year(), t.Month())) +func (tp GYearMonth) NewGYearMonth(time time.Time) GYearMonth { + return GYearMonth(fmt.Sprint("", time.Year(), "-", time.Month())) + //return GYearMonth(time.Format("2004-04-05:00")) } /* - The type xsd:gYear represents a specific calendar year. - The letter g signifies "Gregorian." The format of xsd:gYear - is CCYY. No left truncation is allowed. To represent years - later than 9999, additional digits can be added to the left - of the year value. To represent years before 0001, a preceding - minus sign ("-") is allowed. +The type xsd:gYear represents a specific calendar year. +The letter g signifies "Gregorian." The format of xsd:gYear +is CCYY. No left truncation is allowed. To represent years +later than 9999, additional digits can be added to the left +of the year value. To represent years before 0001, a preceding +minus sign ("-") is allowed. - Source: http://www.datypic.com/sc/xsd/t-xsd_gYear.html +Source: http://www.datypic.com/sc/xsd/t-xsd_gYear.html - More info: https://www.w3.org/TR/xmlschema-2/#gYear +More info: https://www.w3.org/TR/xmlschema-2/#gYear */ type GYear AnySimpleType /* - Construct an instance of xsd GYear type +Construct an instance of xsd GYear type */ -func (tp GYear) NewGYear(t time.Time) GYear { - return GYear(fmt.Sprintf("%4d", t.Year())) +func (tp GYear) NewGYear(time time.Time) GYear { + return GYear(fmt.Sprint("", time.Year())) + //return GYearMonth(time.Format("2004-04-05:00")) } /* - The type xsd:gMonthDay represents a specific day that recurs - every year. The letter g signifies "Gregorian." xsd:gMonthDay - can be used to say, for example, that your birthday is on the - 14th of April every year. The format of xsd:gMonthDay is --MM-DD. +The type xsd:gMonthDay represents a specific day that recurs +every year. The letter g signifies "Gregorian." xsd:gMonthDay +can be used to say, for example, that your birthday is on the +14th of April every year. The format of xsd:gMonthDay is --MM-DD. - Source: http://www.datypic.com/sc/xsd/t-xsd_gMonthDay.html +Source: http://www.datypic.com/sc/xsd/t-xsd_gMonthDay.html - More info: https://www.w3.org/TR/xmlschema-2/#gMonthDay +More info: https://www.w3.org/TR/xmlschema-2/#gMonthDay */ type GMonthDay AnySimpleType /* - Construct an instance of xsd GMonthDay type +Construct an instance of xsd GMonthDay type */ -func (tp GMonthDay) NewGMonthDay(t time.Time) GMonthDay { - return GMonthDay(fmt.Sprintf("--%2d-%2d", t.Month(), t.Day())) +func (tp GMonthDay) NewGMonthDay(time time.Time) GMonthDay { + return GMonthDay(fmt.Sprint("--", time.Month(), "-", time.Day())) } /* - The type xsd:gDay represents a day that recurs every month. - The letter g signifies "Gregorian." xsd:gDay can be used to say, - for example, that checks are paid on the 5th of each month. - To represent a duration of days, use the duration type instead. - The format of gDay is ---DD. +The type xsd:gDay represents a day that recurs every month. +The letter g signifies "Gregorian." xsd:gDay can be used to say, +for example, that checks are paid on the 5th of each month. +To represent a duration of days, use the duration type instead. +The format of gDay is ---DD. - Source: http://www.datypic.com/sc/xsd/t-xsd_gDay.html +Source: http://www.datypic.com/sc/xsd/t-xsd_gDay.html - More info: https://www.w3.org/TR/xmlschema-2/#gDay +More info: https://www.w3.org/TR/xmlschema-2/#gDay */ type GDay AnySimpleType /* - Construct an instance of xsd GDay type +Construct an instance of xsd GDay type */ -func (tp GDay) NewGDay(t time.Time) GDay { - return GDay(fmt.Sprintf("---%2d", t.Day())) +func (tp GDay) NewGDay(time time.Time) GDay { + return GDay(fmt.Sprint("---", time.Day())) } /* - The type xsd:gMonth represents a specific month that recurs - every year. The letter g signifies "Gregorian." xsd:gMonth - can be used to indicate, for example, that fiscal year-end - processing occurs in September of every year. To represent - a duration of months, use the duration type instead. The format - of xsd:gMonth is --MM. +The type xsd:gMonth represents a specific month that recurs +every year. The letter g signifies "Gregorian." xsd:gMonth +can be used to indicate, for example, that fiscal year-end +processing occurs in September of every year. To represent +a duration of months, use the duration type instead. The format +of xsd:gMonth is --MM. - Source: http://www.datypic.com/sc/xsd/t-xsd_gMonth.html +Source: http://www.datypic.com/sc/xsd/t-xsd_gMonth.html - More info: https://www.w3.org/TR/xmlschema-2/#gMonth +More info: https://www.w3.org/TR/xmlschema-2/#gMonth */ type GMonth AnySimpleType -func (tp GMonth) NewGMonth(t time.Time) GMonth { - return GMonth(fmt.Sprintf("--%2d", t.Month())) +func (tp GMonth) NewGMonth(time time.Time) GMonth { + return GMonth(fmt.Sprint("--", time.Month())) } /* - The xsd:hexBinary type represents binary data as a sequence - of binary octets. It uses hexadecimal encoding, where each - binary octet is a two-character hexadecimal number. - Lowercase and uppercase letters A through F are permitted. - For example, 0FB8 and 0fb8 are two equal xsd:hexBinary - representations consisting of two octets. +The xsd:hexBinary type represents binary data as a sequence +of binary octets. It uses hexadecimal encoding, where each +binary octet is a two-character hexadecimal number. +Lowercase and uppercase letters A through F are permitted. +For example, 0FB8 and 0fb8 are two equal xsd:hexBinary +representations consisting of two octets. - Source: http://www.datypic.com/sc/xsd/t-xsd_hexBinary.html +Source: http://www.datypic.com/sc/xsd/t-xsd_hexBinary.html - More info: https://www.w3.org/TR/xmlschema-2/#hexBinary +More info: https://www.w3.org/TR/xmlschema-2/#hexBinary */ type HexBinary AnySimpleType @@ -405,19 +399,19 @@ func (tp HexBinary) NewHexBinary(data []byte) HexBinary { } /* - base64Binary represents Base64-encoded arbitrary binary data. - The ·value space· of base64Binary is the set of finite-length sequences of binary octets. - For base64Binary data the entire binary stream is encoded using the Base64 Alphabet in [RFC 2045]. - - base64Binary has the following ·constraining facets·: - • length - • minLength - • maxLength - • pattern - • enumeration - • whiteSpace +base64Binary represents Base64-encoded arbitrary binary data. +The ·value space· of base64Binary is the set of finite-length sequences of binary octets. +For base64Binary data the entire binary stream is encoded using the Base64 Alphabet in [RFC 2045]. + +base64Binary has the following ·constraining facets·: +• length +• minLength +• maxLength +• pattern +• enumeration +• whiteSpace - More info: https://www.w3.org/TR/xmlschema-2/#base64Binary +More info: https://www.w3.org/TR/xmlschema-2/#base64Binary */ type Base64Binary AnySimpleType @@ -426,21 +420,21 @@ func (tp Base64Binary) NewBase64Binary(data []byte) Base64Binary { } /* - anyURI represents a Uniform Resource Identifier Reference (URI). - An anyURI value can be absolute or relative, and may have an optional - fragment identifier (i.e., it may be a URI Reference). - This type should be used to specify the intention that the - value fulfills the role of a URI as defined by [RFC 2396], as amended by [RFC 2732]. - - anyURI has the following ·constraining facets·: - • length - • minLength - • maxLength - • pattern - • enumeration - • whiteSpace +anyURI represents a Uniform Resource Identifier Reference (URI). +An anyURI value can be absolute or relative, and may have an optional +fragment identifier (i.e., it may be a URI Reference). +This type should be used to specify the intention that the +value fulfills the role of a URI as defined by [RFC 2396], as amended by [RFC 2732]. + +anyURI has the following ·constraining facets·: +• length +• minLength +• maxLength +• pattern +• enumeration +• whiteSpace - More info: https://www.w3.org/TR/xmlschema-2/#anyURI +More info: https://www.w3.org/TR/xmlschema-2/#anyURI */ type AnyURI AnySimpleType @@ -449,19 +443,19 @@ func (tp AnyURI) NewAnyURI(data url.URL) AnyURI { } /* - QName represents XML qualified names. The ·value space· of QName is the set of tuples - {namespace name, local part}, where namespace name is an anyURI and local part is an NCName. - The ·lexical space· of QName is the set of strings that ·match· the QName production of [Namespaces in XML]. - - QName has the following ·constraining facets·: - • length - • minLength - • maxLength - • pattern - • enumeration - • whiteSpace +QName represents XML qualified names. The ·value space· of QName is the set of tuples +{namespace name, local part}, where namespace name is an anyURI and local part is an NCName. +The ·lexical space· of QName is the set of strings that ·match· the QName production of [Namespaces in XML]. + +QName has the following ·constraining facets·: +• length +• minLength +• maxLength +• pattern +• enumeration +• whiteSpace - More info: https://www.w3.org/TR/xmlschema-2/#QName +More info: https://www.w3.org/TR/xmlschema-2/#QName */ type QName AnySimpleType @@ -484,7 +478,7 @@ func (tp QName) NewQName(prefix, local string) QName { type NormalizedString String -//TODO: check normalization +// TODO: check normalization func (tp NormalizedString) NewNormalizedString(data string) (NormalizedString, error) { if strings.ContainsAny(data, "\r\n\t<>&") { return NormalizedString(""), errors.New("String " + data + " contains forbidden symbols") @@ -520,7 +514,7 @@ func (tp Language) NewLanguage(data Token) (Language, error) { type NMTOKEN Token -//TODO: check for valid symbols: https://www.w3.org/TR/xml/#NT-Nmtoken +// TODO: check for valid symbols: https://www.w3.org/TR/xml/#NT-Nmtoken func (tp NMTOKEN) NewNMTOKEN(data string) NMTOKEN { return NMTOKEN(data) } @@ -537,19 +531,19 @@ func (tp NMTOKENS) NewNMTOKENS(data []NMTOKEN) NMTOKENS { type Name Token -//TODO: implements https://www.w3.org/TR/xml/#NT-Name +// TODO: implements https://www.w3.org/TR/xml/#NT-Name func (tp Name) NewName(data Token) Name { return Name(data) } type NCName Name -//TODO: https://www.w3.org/TR/REC-xml/#NT-Name and https://www.w3.org/TR/xml-names/#NT-NCName +// TODO: https://www.w3.org/TR/REC-xml/#NT-Name and https://www.w3.org/TR/xml-names/#NT-NCName func (tp NCName) NewNCName(data Name) NCName { return NCName(data) } -//TODO: improve next types to correspond to XMLSchema +// TODO: improve next types to correspond to XMLSchema type ID NCName func (tp ID) NewID(data NCName) ID { diff --git a/xsd/onvif/onvif.go b/xsd/onvif/onvif.go index 0eea49e1..b973f063 100644 --- a/xsd/onvif/onvif.go +++ b/xsd/onvif/onvif.go @@ -59,20 +59,20 @@ type FloatRange struct { type OSDConfiguration struct { DeviceEntity `xml:"token,attr"` - VideoSourceConfigurationToken OSDReference `xml:"onvif:VideoSourceConfigurationToken"` - Type OSDType `xml:"onvif:Type"` - Position OSDPosConfiguration `xml:"onvif:Position"` - TextString OSDTextConfiguration `xml:"onvif:TextString"` - Image OSDImgConfiguration `xml:"onvif:Image"` - Extension OSDConfigurationExtension `xml:"onvif:Extension"` + VideoSourceConfigurationToken OSDReference `xml:"VideoSourceConfigurationToken"` + Type OSDType `xml:"Type"` + Position OSDPosConfiguration `xml:"Position"` + TextString OSDTextConfiguration `xml:"TextString"` + Image OSDImgConfiguration `xml:"Image"` + Extension OSDConfigurationExtension `xml:"Extension"` } type OSDType xsd.String type OSDPosConfiguration struct { - Type string `xml:"onvif:Type"` - Pos Vector `xml:"onvif:Pos"` - Extension OSDPosConfigurationExtension `xml:"onvif:Extension"` + Type string `xml:"Type"` + Pos Vector `xml:"Pos"` + Extension OSDPosConfigurationExtension `xml:"Extension"` } type Vector struct { @@ -87,20 +87,20 @@ type OSDReference ReferenceToken type OSDTextConfiguration struct { IsPersistentText xsd.Boolean `xml:"IsPersistentText,attr"` - Type xsd.String `xml:"onvif:Type"` - DateFormat xsd.String `xml:"onvif:DateFormat"` - TimeFormat xsd.String `xml:"onvif:TimeFormat"` - FontSize xsd.Int `xml:"onvif:FontSize"` - FontColor OSDColor `xml:"onvif:FontColor"` - BackgroundColor OSDColor `xml:"onvif:BackgroundColor"` - PlainText xsd.String `xml:"onvif:PlainText"` - Extension OSDTextConfigurationExtension `xml:"onvif:Extension"` + Type xsd.String `xml:"Type"` + DateFormat xsd.String `xml:"DateFormat"` + TimeFormat xsd.String `xml:"TimeFormat"` + FontSize xsd.Int `xml:"FontSize"` + FontColor OSDColor `xml:"FontColor"` + BackgroundColor OSDColor `xml:"BackgroundColor"` + PlainText xsd.String `xml:"PlainText"` + Extension OSDTextConfigurationExtension `xml:"Extension"` } type OSDColor struct { Transparent int `xml:"Transparent,attr"` - Color Color `xml:"onvif:Color"` + Color Color `xml:"Color"` } type Color struct { @@ -113,8 +113,8 @@ type Color struct { type OSDTextConfigurationExtension xsd.AnyType type OSDImgConfiguration struct { - ImgPath xsd.AnyURI `xml:"onvif:ImgPath"` - Extension OSDImgConfigurationExtension `xml:"onvif:Extension"` + ImgPath xsd.AnyURI `xml:"ImgPath"` + Extension OSDImgConfigurationExtension `xml:"Extension"` } type OSDImgConfigurationExtension xsd.AnyType @@ -130,8 +130,13 @@ type VideoSource struct { } type VideoResolution struct { - Width xsd.Int `xml:"onvif:Width"` - Height xsd.Int `xml:"onvif:Height"` + Width *xsd.Int `json:",omitempty"` + Height *xsd.Int `json:",omitempty"` +} + +type VideoResolutionRequest struct { + Width *xsd.Int `xml:"onvif:Width,omitempty"` + Height *xsd.Int `xml:"onvif:Height,omitempty"` } type ImagingSettings struct { @@ -193,8 +198,8 @@ type AutoFocusMode xsd.String type IrCutFilterMode xsd.String type WideDynamicRange struct { - Mode WideDynamicMode `xml:"onvif:Mode"` - Level float64 `xml:"onvif:Level"` + Mode WideDynamicMode `xml:"Mode"` + Level float64 `xml:"Level"` } type WideDynamicMode xsd.String @@ -215,72 +220,72 @@ type VideoSourceExtension struct { } type ImagingSettings20 struct { - BacklightCompensation *BacklightCompensation20 `xml:"onvif:BacklightCompensation"` - Brightness float64 `xml:"onvif:Brightness,omitempty"` - ColorSaturation float64 `xml:"onvif:ColorSaturation,omitempty"` - Contrast float64 `xml:"onvif:Contrast,omitempty"` - Exposure *Exposure20 `xml:"onvif:Exposure"` - Focus *FocusConfiguration20 `xml:"onvif:Focus"` - IrCutFilter *IrCutFilterMode `xml:"onvif:IrCutFilter"` - Sharpness float64 `xml:"onvif:Sharpness,omitempty"` - WideDynamicRange *WideDynamicRange20 `xml:"onvif:WideDynamicRange"` - WhiteBalance *WhiteBalance20 `xml:"onvif:WhiteBalance"` - Extension *ImagingSettingsExtension20 `xml:"onvif:Extension"` + BacklightCompensation BacklightCompensation20 `xml:"BacklightCompensation"` + Brightness float64 `xml:"Brightness"` + ColorSaturation float64 `xml:"ColorSaturation"` + Contrast float64 `xml:"Contrast"` + Exposure Exposure20 `xml:"Exposure"` + Focus FocusConfiguration20 `xml:"Focus"` + IrCutFilter IrCutFilterMode `xml:"IrCutFilter"` + Sharpness float64 `xml:"Sharpness"` + WideDynamicRange WideDynamicRange20 `xml:"WideDynamicRange"` + WhiteBalance WhiteBalance20 `xml:"WhiteBalance"` + Extension ImagingSettingsExtension20 `xml:"Extension"` } type BacklightCompensation20 struct { - Mode BacklightCompensationMode `xml:"onvif:Mode"` - Level float64 `xml:"onvif:Level"` + Mode BacklightCompensationMode `xml:"Mode"` + Level float64 `xml:"Level"` } type Exposure20 struct { - Mode ExposureMode `xml:"onvif:Mode,omitempty"` - Priority ExposurePriority `xml:"onvif:Priority,omitempty"` - Window Rectangle `xml:"onvif:Window,omitempty"` - MinExposureTime float64 `xml:"onvif:MinExposureTime,omitempty"` - MaxExposureTime float64 `xml:"onvif:MaxExposureTime,omitempty"` - MinGain float64 `xml:"onvif:MinGain,omitempty"` - MaxGain float64 `xml:"onvif:MaxGain,omitempty"` - MinIris float64 `xml:"onvif:MinIris,omitempty"` - MaxIris float64 `xml:"onvif:MaxIris,omitempty"` - ExposureTime float64 `xml:"onvif:ExposureTime,omitempty"` - Gain float64 `xml:"onvif:Gain,omitempty"` - Iris float64 `xml:"onvif:Iris,omitempty"` + Mode ExposureMode `xml:"Mode"` + Priority ExposurePriority `xml:"Priority"` + Window Rectangle `xml:"Window"` + MinExposureTime float64 `xml:"MinExposureTime"` + MaxExposureTime float64 `xml:"MaxExposureTime"` + MinGain float64 `xml:"MinGain"` + MaxGain float64 `xml:"MaxGain"` + MinIris float64 `xml:"MinIris"` + MaxIris float64 `xml:"MaxIris"` + ExposureTime float64 `xml:"ExposureTime"` + Gain float64 `xml:"Gain"` + Iris float64 `xml:"Iris"` } type FocusConfiguration20 struct { - AutoFocusMode AutoFocusMode `xml:"onvif:AutoFocusMode"` - DefaultSpeed float64 `xml:"onvif:DefaultSpeed"` - NearLimit float64 `xml:"onvif:NearLimit"` - FarLimit float64 `xml:"onvif:FarLimit"` - Extension FocusConfiguration20Extension `xml:"onvif:Extension"` + AutoFocusMode AutoFocusMode `xml:"AutoFocusMode"` + DefaultSpeed float64 `xml:"DefaultSpeed"` + NearLimit float64 `xml:"NearLimit"` + FarLimit float64 `xml:"FarLimit"` + Extension FocusConfiguration20Extension `xml:"Extension"` } type FocusConfiguration20Extension xsd.AnyType type WideDynamicRange20 struct { - Mode WideDynamicMode `xml:"onvif:Mode"` - Level float64 `xml:"onvif:Level"` + Mode WideDynamicMode `xml:"Mode"` + Level float64 `xml:"Level"` } type WhiteBalance20 struct { - Mode WhiteBalanceMode `xml:"onvif:Mode"` - CrGain float64 `xml:"onvif:CrGain"` - CbGain float64 `xml:"onvif:CbGain"` - Extension WhiteBalance20Extension `xml:"onvif:Extension"` + Mode WhiteBalanceMode `xml:"Mode"` + CrGain float64 `xml:"CrGain"` + CbGain float64 `xml:"CbGain"` + Extension WhiteBalance20Extension `xml:"Extension"` } type WhiteBalance20Extension xsd.AnyType type ImagingSettingsExtension20 struct { - ImageStabilization ImageStabilization `xml:"onvif:ImageStabilization"` - Extension ImagingSettingsExtension202 `xml:"onvif:Extension"` + ImageStabilization ImageStabilization `xml:"ImageStabilization"` + Extension ImagingSettingsExtension202 `xml:"Extension"` } type ImageStabilization struct { - Mode ImageStabilizationMode `xml:"onvif:Mode"` - Level float64 `xml:"onvif:Level"` - Extension ImageStabilizationExtension `xml:"onvif:Extension"` + Mode ImageStabilizationMode `xml:"Mode"` + Level float64 `xml:"Level"` + Extension ImageStabilizationExtension `xml:"Extension"` } type ImageStabilizationMode xsd.String @@ -288,30 +293,30 @@ type ImageStabilizationMode xsd.String type ImageStabilizationExtension xsd.AnyType type ImagingSettingsExtension202 struct { - IrCutFilterAutoAdjustment IrCutFilterAutoAdjustment `xml:"onvif:IrCutFilterAutoAdjustment"` - Extension ImagingSettingsExtension203 `xml:"onvif:Extension"` + IrCutFilterAutoAdjustment IrCutFilterAutoAdjustment `xml:"IrCutFilterAutoAdjustment"` + Extension ImagingSettingsExtension203 `xml:"Extension"` } type IrCutFilterAutoAdjustment struct { - BoundaryType string `xml:"onvif:BoundaryType"` - BoundaryOffset float64 `xml:"onvif:BoundaryOffset"` - ResponseTime xsd.Duration `xml:"onvif:ResponseTime"` - Extension IrCutFilterAutoAdjustmentExtension `xml:"onvif:Extension"` + BoundaryType string `xml:"BoundaryType"` + BoundaryOffset float64 `xml:"BoundaryOffset"` + ResponseTime xsd.Duration `xml:"ResponseTime"` + Extension IrCutFilterAutoAdjustmentExtension `xml:"Extension"` } type IrCutFilterAutoAdjustmentExtension xsd.AnyType type ImagingSettingsExtension203 struct { - ToneCompensation ToneCompensation `xml:"onvif:ToneCompensation"` - Defogging Defogging `xml:"onvif:Defogging"` - NoiseReduction NoiseReduction `xml:"onvif:NoiseReduction"` - Extension ImagingSettingsExtension204 `xml:"onvif:Extension"` + ToneCompensation ToneCompensation `xml:"ToneCompensation"` + Defogging Defogging `xml:"Defogging"` + NoiseReduction NoiseReduction `xml:"NoiseReduction"` + Extension ImagingSettingsExtension204 `xml:"Extension"` } type ToneCompensation struct { - Mode string `xml:"onvif:Mode"` - Level float64 `xml:"onvif:Level"` - Extension ToneCompensationExtension `xml:"onvif:Extension"` + Mode string `xml:"Mode"` + Level float64 `xml:"Level"` + Extension ToneCompensationExtension `xml:"Extension"` } type ToneCompensationExtension xsd.AnyType @@ -325,7 +330,7 @@ type Defogging struct { type DefoggingExtension xsd.AnyType type NoiseReduction struct { - Level float64 `xml:"onvif:Level"` + Level float64 `xml:"Level"` } type ImagingSettingsExtension204 xsd.AnyType @@ -345,39 +350,45 @@ type Profile struct { Token ReferenceToken `xml:"token,attr"` Fixed bool `xml:"fixed,attr"` Name Name - VideoSourceConfiguration VideoSourceConfiguration - AudioSourceConfiguration AudioSourceConfiguration - VideoEncoderConfiguration VideoEncoderConfiguration - AudioEncoderConfiguration AudioEncoderConfiguration - VideoAnalyticsConfiguration VideoAnalyticsConfiguration - PTZConfiguration PTZConfiguration - MetadataConfiguration MetadataConfiguration - Extension ProfileExtension + VideoSourceConfiguration *VideoSourceConfiguration `xml:",omitempty"` + AudioSourceConfiguration *AudioSourceConfiguration `xml:",omitempty"` + VideoEncoderConfiguration *VideoEncoderConfiguration `xml:",omitempty"` + AudioEncoderConfiguration *AudioEncoderConfiguration `xml:",omitempty"` + VideoAnalyticsConfiguration *VideoAnalyticsConfiguration `xml:",omitempty"` + PTZConfiguration *PTZConfiguration `xml:",omitempty"` + MetadataConfiguration *MetadataConfiguration `xml:",omitempty"` + Extension *ProfileExtension `xml:",omitempty"` } type VideoSourceConfiguration struct { ConfigurationEntity - ViewMode string `xml:"ViewMode,attr"` - SourceToken ReferenceToken `xml:"onvif:SourceToken"` - Bounds IntRectangle `xml:"onvif:Bounds"` - Extension VideoSourceConfigurationExtension `xml:"onvif:Extension"` + ViewMode string `xml:"ViewMode,attr"` + SourceToken *ReferenceToken `xml:",omitempty"` + Bounds *IntRectangle `xml:",omitempty"` + Extension *VideoSourceConfigurationExtension `xml:",omitempty"` } type ConfigurationEntity struct { - Token ReferenceToken `xml:"token,attr"` - Name Name `xml:"onvif:Name"` - UseCount int `xml:"onvif:UseCount"` + Token ReferenceToken `json:",omitempty" xml:"token,attr,omitempty"` + Name Name `json:",omitempty" xml:",omitempty"` + UseCount int `json:",omitempty" xml:",omitempty"` +} + +type ConfigurationEntityRequest struct { + Token ReferenceToken `xml:"token,attr,omitempty"` + Name Name `xml:"onvif:Name,omitempty"` + UseCount int `xml:"onvif:UseCount,omitempty"` } type VideoSourceConfigurationExtension struct { - Rotate Rotate `xml:"onvif:Rotate"` - Extension VideoSourceConfigurationExtension2 `xml:"onvif:Extension"` + Rotate *Rotate `xml:",omitempty"` + Extension *VideoSourceConfigurationExtension2 `xml:",omitempty"` } type Rotate struct { - Mode RotateMode `xml:"onvif:Mode"` - Degree xsd.Int `xml:"onvif:Degree"` - Extension RotateExtension `xml:"onvif:Extension"` + Mode RotateMode `xml:"Mode"` + Degree xsd.Int `xml:"Degree"` + Extension RotateExtension `xml:"Extension"` } type RotateMode xsd.String @@ -385,15 +396,15 @@ type RotateMode xsd.String type RotateExtension xsd.AnyType type VideoSourceConfigurationExtension2 struct { - LensDescription LensDescription `xml:"onvif:LensDescription"` - SceneOrientation SceneOrientation `xml:"onvif:SceneOrientation"` + LensDescription LensDescription `xml:"LensDescription"` + SceneOrientation SceneOrientation `xml:"SceneOrientation"` } type LensDescription struct { FocalLength float64 `xml:"FocalLength,attr"` - Offset LensOffset `xml:"onvif:Offset"` - Projection LensProjection `xml:"onvif:Projection"` - XFactor float64 `xml:"onvif:XFactor"` + Offset LensOffset `xml:"Offset"` + Projection LensProjection `xml:"Projection"` + XFactor float64 `xml:"XFactor"` } type LensOffset struct { @@ -402,68 +413,109 @@ type LensOffset struct { } type LensProjection struct { - Angle float64 `xml:"onvif:Angle"` - Radius float64 `xml:"onvif:Radius"` - Transmittance float64 `xml:"onvif:Transmittance"` + Angle float64 `xml:"Angle"` + Radius float64 `xml:"Radius"` + Transmittance float64 `xml:"Transmittance"` } type SceneOrientation struct { - Mode SceneOrientationMode `xml:"onvif:Mode"` - Orientation xsd.String `xml:"onvif:Orientation"` + Mode SceneOrientationMode `xml:"Mode"` + Orientation xsd.String `xml:"Orientation"` } type SceneOrientationMode xsd.String type AudioSourceConfiguration struct { ConfigurationEntity - SourceToken ReferenceToken `xml:"onvif:SourceToken"` + SourceToken ReferenceToken `xml:"SourceToken"` } type VideoEncoderConfiguration struct { ConfigurationEntity - Encoding VideoEncoding `xml:"onvif:Encoding"` - Resolution VideoResolution `xml:"onvif:Resolution"` - Quality float64 `xml:"onvif:Quality"` - RateControl VideoRateControl `xml:"onvif:RateControl"` - MPEG4 Mpeg4Configuration `xml:"onvif:MPEG4"` - H264 H264Configuration `xml:"onvif:H264"` - Multicast MulticastConfiguration `xml:"onvif:Multicast"` - SessionTimeout xsd.Duration `xml:"onvif:SessionTimeout"` + Encoding *VideoEncoding `json:",omitempty"` + Resolution *VideoResolution `json:",omitempty"` + Quality float64 `json:",omitempty"` + RateControl *VideoRateControl `json:",omitempty"` + MPEG4 *Mpeg4Configuration `json:",omitempty"` + H264 *H264Configuration `json:",omitempty"` + Multicast *MulticastConfiguration `json:",omitempty"` + SessionTimeout *xsd.Duration `json:",omitempty"` +} + +type VideoEncoderConfigurationRequest struct { + ConfigurationEntityRequest + Encoding *VideoEncoding `xml:"onvif:Encoding,omitempty"` + Resolution *VideoResolutionRequest `xml:"onvif:Resolution,omitempty"` + Quality *xsd.Float `xml:"onvif:Quality,omitempty"` + RateControl *VideoRateControlRequest `xml:"onvif:RateControl,omitempty"` + MPEG4 *Mpeg4ConfigurationRequest `xml:"onvif:MPEG4,omitempty"` + H264 *H264ConfigurationRequest `xml:"onvif:H264,omitempty"` + Multicast *MulticastConfigurationRequest `xml:"onvif:Multicast,omitempty"` + SessionTimeout *xsd.Duration `xml:"onvif:SessionTimeout,omitempty"` } type VideoEncoding xsd.String type VideoRateControl struct { - FrameRateLimit xsd.Int `xml:"onvif:FrameRateLimit"` - EncodingInterval xsd.Int `xml:"onvif:EncodingInterval"` - BitrateLimit xsd.Int `xml:"onvif:BitrateLimit"` + FrameRateLimit *xsd.Int `json:",omitempty"` + EncodingInterval *xsd.Int `json:",omitempty"` + BitrateLimit *xsd.Int `json:",omitempty"` +} + +type VideoRateControlRequest struct { + FrameRateLimit *xsd.Int `xml:"onvif:FrameRateLimit,omitempty"` + EncodingInterval *xsd.Int `xml:"onvif:EncodingInterval,omitempty"` + BitrateLimit *xsd.Int `xml:"onvif:BitrateLimit,omitempty"` } type Mpeg4Configuration struct { - GovLength xsd.Int `xml:"onvif:GovLength"` - Mpeg4Profile Mpeg4Profile `xml:"onvif:Mpeg4Profile"` + GovLength *xsd.Int `json:",omitempty"` + Mpeg4Profile *Mpeg4Profile `json:",omitempty"` +} + +type Mpeg4ConfigurationRequest struct { + GovLength *xsd.Int `xml:"onvif:GovLength,omitempty"` + Mpeg4Profile *Mpeg4Profile `xml:"onvif:Mpeg4Profile,omitempty"` } type Mpeg4Profile xsd.String type H264Configuration struct { - GovLength xsd.Int `xml:"onvif:GovLength"` - H264Profile H264Profile `xml:"onvif:H264Profile"` + GovLength *xsd.Int `json:",omitempty"` + H264Profile *H264Profile `json:",omitempty"` +} + +type H264ConfigurationRequest struct { + GovLength *xsd.Int `xml:"onvif:GovLength,omitempty"` + H264Profile *H264Profile `xml:"onvif:H264Profile,omitempty"` } type H264Profile xsd.String type MulticastConfiguration struct { - Address IPAddress `xml:"onvif:Address"` - Port int `xml:"onvif:Port"` - TTL int `xml:"onvif:TTL"` - AutoStart xsd.Boolean `xml:"onvif:AutoStart"` + Address *IPAddress `json:",omitempty"` + Port *xsd.Int `json:",omitempty"` + TTL *xsd.Int `json:",omitempty"` + AutoStart *xsd.Boolean `json:",omitempty"` +} + +type MulticastConfigurationRequest struct { + Address *IPAddressRequest `xml:"onvif:Address,omitempty"` + Port *xsd.Int `xml:"onvif:Port,omitempty"` + TTL *xsd.Int `xml:"onvif:TTL,omitempty"` + AutoStart *xsd.Boolean `xml:"onvif:AutoStart,omitempty"` } type IPAddress struct { - Type IPType `xml:"onvif:Type"` - IPv4Address IPv4Address `xml:"onvif:IPv4Address"` - IPv6Address IPv6Address `xml:"onvif:IPv6Address"` + Type IPType `json:",omitempty"` + IPv4Address IPv4Address `json:",omitempty"` + IPv6Address IPv6Address `json:",omitempty"` +} + +type IPAddressRequest struct { + Type IPType `xml:"onvif:Type,omitempty"` + IPv4Address IPv4Address `xml:"onvif:IPv4Address,omitempty"` + IPv6Address IPv6Address `xml:"onvif:IPv6Address,omitempty"` } type IPType xsd.String @@ -476,45 +528,93 @@ type IPv6Address xsd.Token type AudioEncoderConfiguration struct { ConfigurationEntity - Encoding AudioEncoding `xml:"onvif:Encoding"` - Bitrate int `xml:"onvif:Bitrate"` - SampleRate int `xml:"onvif:SampleRate"` - Multicast MulticastConfiguration `xml:"onvif:Multicast"` - SessionTimeout xsd.Duration `xml:"onvif:SessionTimeout"` + Encoding AudioEncoding `xml:"Encoding"` + Bitrate int `xml:"Bitrate"` + SampleRate int `xml:"SampleRate"` + Multicast MulticastConfiguration `xml:"Multicast"` + SessionTimeout xsd.Duration `xml:"SessionTimeout"` } type AudioEncoding xsd.String type VideoAnalyticsConfiguration struct { ConfigurationEntity - AnalyticsEngineConfiguration AnalyticsEngineConfiguration `xml:"onvif:AnalyticsEngineConfiguration"` - RuleEngineConfiguration RuleEngineConfiguration `xml:"onvif:RuleEngineConfiguration"` + AnalyticsEngineConfiguration *AnalyticsEngineConfiguration `xml:"AnalyticsEngineConfiguration"` + RuleEngineConfiguration *RuleEngineConfiguration `xml:"RuleEngineConfiguration"` } type AnalyticsEngineConfiguration struct { - AnalyticsModule Config `xml:"onvif:AnalyticsModule"` - Extension AnalyticsEngineConfigurationExtension `xml:"onvif:Extension"` + AnalyticsModule []AnalyticsModule `json:",omitempty"` + Extension *AnalyticsEngineConfigurationExtension `json:",omitempty"` +} + +type AnalyticsModule struct { + Name string `xml:",attr"` + Type string `xml:",attr"` + Parameters Parameters +} + +type Parameters struct { + SimpleItem []SimpleItem `json:",omitempty"` + ElementItem []ElementItem `json:",omitempty"` +} + +type AnalyticsEngineConfigurationRequest struct { + AnalyticsModule *ConfigRequest `xml:"onvif:AnalyticsEngineConfigurationRequest,omitempty"` + Extension *AnalyticsEngineConfigurationExtension `xml:"onvif:Extension,omitempty"` } type Config struct { - Name string `xml:"Name,attr"` - Type xsd.QName `xml:"Type,attr"` - Parameters ItemList `xml:"onvif:Parameters"` + Name string `json:",omitempty" xml:",attr"` + Type *xsd.QName `json:",omitempty" xml:",attr"` + Parameters *ItemList `json:",omitempty"` } type ItemList struct { - SimpleItem SimpleItem `xml:"onvif:SimpleItem"` - ElementItem ElementItem `xml:"onvif:ElementItem"` - Extension ItemListExtension `xml:"onvif:Extension"` + SimpleItem []SimpleItem `json:",omitempty"` + ElementItem []ElementItem `json:",omitempty"` + Extension *ItemListExtension `json:",omitempty"` } type SimpleItem struct { - Name string `xml:"Name,attr"` - Value xsd.AnySimpleType `xml:"Value,attr"` + Name *xsd.String `json:",omitempty" xml:",attr"` + Value *xsd.String `json:",omitempty" xml:",attr"` } type ElementItem struct { - Name string `xml:"Name,attr"` + Name *xsd.String `json:",omitempty" xml:",attr"` + Value *xsd.String `json:",omitempty" xml:",attr"` +} + +type ConfigRequest struct { + Name string `xml:",attr,omitempty"` + Type *xsd.QName `xml:",attr,omitempty"` + Parameters *ItemListRequest `xml:"onvif:Parameters,omitempty"` +} + +type ItemListRequest struct { + SimpleItem []SimpleItemRequest `xml:"onvif:SimpleItem,omitempty"` + ElementItem []ElementItemRequest `xml:"onvif:ElementItem,omitempty"` + Extension *ItemListExtension `xml:"onvif:Extension,omitempty"` +} + +type ElementItemRequest struct { + Name string `xml:",attr,omitempty"` + Polyline *Polyline `xml:"onvif:Polyline,omitempty"` +} + +type Polyline struct { + Point []Point `xml:"onvif:Point,omitempty"` +} + +type Point struct { + X *xsd.String `xml:"x,attr,omitempty"` + Y *xsd.String `xml:"onvif:y,attr,omitempty"` +} + +type SimpleItemRequest struct { + Name string `xml:",attr,omitempty"` + Value xsd.AnySimpleType `xml:",attr,omitempty"` } type ItemListExtension xsd.AnyType @@ -522,29 +622,36 @@ type ItemListExtension xsd.AnyType type AnalyticsEngineConfigurationExtension xsd.AnyType type RuleEngineConfiguration struct { - Rule Config `xml:"onvif:Rule"` - Extension RuleEngineConfigurationExtension `xml:"onvif:Extension"` + Rule *Config `json:",omitempty"` + Extension *RuleEngineConfigurationExtension `json:",omitempty"` } type RuleEngineConfigurationExtension xsd.AnyType type PTZConfiguration struct { - ConfigurationEntity - MoveRamp int `xml:"MoveRamp,attr"` - PresetRamp int `xml:"PresetRamp,attr"` - PresetTourRamp int `xml:"PresetTourRamp,attr"` - NodeToken ReferenceToken `xml:"NodeToken"` - DefaultAbsolutePantTiltPositionSpace xsd.AnyURI `xml:"DefaultAbsolutePantTiltPositionSpace"` - DefaultAbsoluteZoomPositionSpace xsd.AnyURI `xml:"DefaultAbsoluteZoomPositionSpace"` - DefaultRelativePanTiltTranslationSpace xsd.AnyURI `xml:"DefaultRelativePanTiltTranslationSpace"` - DefaultRelativeZoomTranslationSpace xsd.AnyURI `xml:"DefaultRelativeZoomTranslationSpace"` - DefaultContinuousPanTiltVelocitySpace xsd.AnyURI `xml:"DefaultContinuousPanTiltVelocitySpace"` - DefaultContinuousZoomVelocitySpace xsd.AnyURI `xml:"DefaultContinuousZoomVelocitySpace"` - DefaultPTZSpeed PTZSpeed `xml:"DefaultPTZSpeed"` - DefaultPTZTimeout xsd.Duration `xml:"DefaultPTZTimeout"` - PanTiltLimits PanTiltLimits `xml:"PanTiltLimits"` - ZoomLimits ZoomLimits `xml:"ZoomLimits"` - Extension PTZConfigurationExtension `xml:"Extension"` + PTZConfigurationEntity + Token ReferenceToken `xml:"token,attr"` + MoveRamp int `json:",omitempty" xml:"MoveRamp,attr,omitempty"` + PresetRamp int `json:",omitempty" xml:"PresetRamp,attr,omitempty"` + PresetTourRamp int `json:",omitempty" xml:"PresetTourRamp,attr,omitempty"` + NodeToken *ReferenceToken `json:",omitempty" xml:"tptz:NodeToken,omitempty"` + DefaultAbsolutePantTiltPositionSpace *xsd.AnyURI `json:",omitempty" xml:",omitempty"` + DefaultAbsoluteZoomPositionSpace *xsd.AnyURI `json:",omitempty" xml:",omitempty"` + DefaultRelativePanTiltTranslationSpace *xsd.AnyURI `json:",omitempty" xml:",omitempty"` + DefaultRelativeZoomTranslationSpace *xsd.AnyURI `json:",omitempty" xml:",omitempty"` + DefaultContinuousPanTiltVelocitySpace *xsd.AnyURI `json:",omitempty" xml:",omitempty"` + DefaultContinuousZoomVelocitySpace *xsd.AnyURI `json:",omitempty" xml:",omitempty"` + DefaultPTZSpeed *PTZSpeed `json:",omitempty" xml:",omitempty"` + DefaultPTZTimeout *xsd.Duration `json:",omitempty" xml:",omitempty"` + PanTiltLimits *PanTiltLimits `json:",omitempty" xml:",omitempty"` + ZoomLimits *ZoomLimits `json:",omitempty" xml:",omitempty"` + Extension *PTZConfigurationExtension `json:",omitempty" xml:",omitempty"` +} + +type PTZConfigurationEntity struct { + Token ReferenceToken `json:",omitempty" xml:"token,attr,omitempty"` + Name Name `json:",omitempty" xml:"tptz:Name,omitempty"` + UseCount int `json:",omitempty" xml:"tptz:UseCount,omitempty"` } type PTZSpeed interface { @@ -559,24 +666,24 @@ type PTZSpeedPanTilt struct { } type Vector2D struct { - X float64 `xml:"x,attr"` - Y float64 `xml:"y,attr"` - Space xsd.AnyURI `xml:"space,attr,omitempty"` + X float64 `xml:"x,attr,omitempty"` + Y float64 `xml:"y,attr,omitempty"` + Space *xsd.AnyURI `xml:"space,attr,omitempty"` } type Vector1D struct { - X float64 `xml:"x,attr"` - Space xsd.AnyURI `xml:"space,attr,omitempty"` + X float64 `xml:"x,attr,omitempty"` + Space *xsd.AnyURI `xml:"space,attr,omitempty"` } type PanTiltLimits struct { - Range Space2DDescription `xml:"Range"` + Range *Space2DDescription `xml:"Range,omitempty"` } type Space2DDescription struct { - URI xsd.AnyURI `xml:"URI"` - XRange FloatRange `xml:"XRange"` - YRange FloatRange `xml:"YRange"` + URI *xsd.AnyURI `xml:"URI,omitempty"` + XRange *FloatRange `xml:"XRange,omitempty"` + YRange *FloatRange `xml:"YRange,omitempty"` } type ZoomLimits struct { @@ -589,24 +696,24 @@ type Space1DDescription struct { } type PTZConfigurationExtension struct { - PTControlDirection PTControlDirection `xml:"onvif:PTControlDirection"` - Extension PTZConfigurationExtension2 `xml:"onvif:Extension"` + PTControlDirection *PTControlDirection `xml:"PTControlDirection,omitempty"` + Extension *PTZConfigurationExtension2 `xml:"Extension,omitempty"` } type PTControlDirection struct { - EFlip EFlip `xml:"onvif:EFlip"` - Reverse Reverse `xml:"onvif:Reverse"` - Extension PTControlDirectionExtension `xml:"onvif:Extension"` + EFlip EFlip `xml:"EFlip"` + Reverse Reverse `xml:"Reverse"` + Extension PTControlDirectionExtension `xml:"Extension"` } type EFlip struct { - Mode EFlipMode `xml:"onvif:Mode"` + Mode EFlipMode `xml:"Mode"` } type EFlipMode xsd.String type Reverse struct { - Mode ReverseMode `xml:"onvif:Mode"` + Mode ReverseMode `xml:"Mode"` } type ReverseMode xsd.String @@ -617,24 +724,46 @@ type PTZConfigurationExtension2 xsd.AnyType type MetadataConfiguration struct { ConfigurationEntity - CompressionType string `xml:"CompressionType,attr"` - PTZStatus PTZFilter `xml:"onvif:PTZStatus"` - Events EventSubscription `xml:"onvif:Events"` - Analytics xsd.Boolean `xml:"onvif:Analytics"` - Multicast MulticastConfiguration `xml:"onvif:Multicast"` - SessionTimeout xsd.Duration `xml:"onvif:SessionTimeout"` - AnalyticsEngineConfiguration AnalyticsEngineConfiguration `xml:"onvif:AnalyticsEngineConfiguration"` - Extension MetadataConfigurationExtension `xml:"onvif:Extension"` + CompressionType string `json:",omitempty" xml:",attr,omitempty"` + PTZStatus *PTZFilter `json:",omitempty" xml:",omitempty"` + Events *EventSubscription `json:",omitempty" xml:",omitempty"` + Analytics *xsd.Boolean `json:",omitempty" xml:",omitempty"` + Multicast *MulticastConfiguration `json:",omitempty" xml:",omitempty"` + SessionTimeout *xsd.Duration `json:",omitempty" xml:",omitempty"` + AnalyticsEngineConfiguration *AnalyticsEngineConfiguration `json:",omitempty" xml:",omitempty"` + Extension *MetadataConfigurationExtension `json:",omitempty" xml:",omitempty"` +} + +type MetadataConfigurationRequest struct { + ConfigurationEntity + CompressionType string `xml:"onvif:CompressionType,attr,omitempty"` + PTZStatus *PTZFilterRequest `xml:"onvif:PTZStatus,omitempty"` + Events *EventSubscriptionRequest `xml:"onvif:Events,omitempty"` + Analytics *xsd.Boolean `xml:"onvif:Analytics,omitempty"` + Multicast *MulticastConfigurationRequest `xml:"onvif:Multicast,omitempty"` + SessionTimeout *xsd.Duration `xml:"onvif:CompressionType,omitempty"` + AnalyticsEngineConfiguration *AnalyticsEngineConfigurationRequest `xml:"onvif:AnalyticsEngineConfiguration,omitempty"` + Extension *MetadataConfigurationExtension `xml:"onvif:Extension,omitempty"` } type PTZFilter struct { - Status bool `xml:"onvif:Status"` - Position bool `xml:"onvif:Position"` + Status bool `xml:"Status"` + Position bool `xml:"Position"` +} + +type PTZFilterRequest struct { + Status bool `xml:"onvif:Status,omitempty"` + Position bool `xml:"onvif:Position,omitempty"` } type EventSubscription struct { - Filter FilterType `xml:"onvif:Filter"` - SubscriptionPolicy `xml:"onvif:SubscriptionPolicy"` + Filter *FilterType `json:",omitempty"` + SubscriptionPolicy *SubscriptionPolicy `json:",omitempty"` +} + +type EventSubscriptionRequest struct { + Filter FilterType `xml:"onvif:Filter,omitempty"` + SubscriptionPolicy SubscriptionPolicy `xml:"onvif:SubscriptionPolicy,omitempty"` } type FilterType xsd.AnyType @@ -644,16 +773,16 @@ type SubscriptionPolicy xsd.AnyType type MetadataConfigurationExtension xsd.AnyType type ProfileExtension struct { - AudioOutputConfiguration AudioOutputConfiguration - AudioDecoderConfiguration AudioDecoderConfiguration - Extension ProfileExtension2 + AudioOutputConfiguration *AudioOutputConfiguration `xml:",omitempty"` + AudioDecoderConfiguration *AudioDecoderConfiguration `xml:",omitempty"` + Extension *ProfileExtension2 `xml:",omitempty"` } type AudioOutputConfiguration struct { ConfigurationEntity - OutputToken ReferenceToken `xml:"onvif:OutputToken"` - SendPrimacy xsd.AnyURI `xml:"onvif:SendPrimacy"` - OutputLevel int `xml:"onvif:OutputLevel"` + OutputToken ReferenceToken `xml:"OutputToken"` + SendPrimacy xsd.AnyURI `xml:"SendPrimacy"` + OutputLevel int `xml:"OutputLevel"` } type AudioDecoderConfiguration struct { @@ -691,15 +820,15 @@ type VideoSourceConfigurationOptionsExtension2 struct { } type VideoEncoderConfigurationOptions struct { - QualityRange IntRange - JPEG JpegOptions - MPEG4 Mpeg4Options - H264 H264Options - Extension VideoEncoderOptionsExtension + QualityRange *IntRange `json:",omitempty"` + JPEG *JpegOptions `json:",omitempty"` + MPEG4 *Mpeg4Options `json:",omitempty"` + H264 *H264Options `json:",omitempty"` + Extension *VideoEncoderOptionsExtension `json:",omitempty"` } type JpegOptions struct { - ResolutionsAvailable VideoResolution + ResolutionsAvailable []VideoResolution FrameRateRange IntRange EncodingIntervalRange IntRange } @@ -713,18 +842,18 @@ type Mpeg4Options struct { } type H264Options struct { - ResolutionsAvailable VideoResolution + ResolutionsAvailable []VideoResolution GovLengthRange IntRange FrameRateRange IntRange EncodingIntervalRange IntRange - H264ProfilesSupported H264Profile + H264ProfilesSupported []H264Profile } type VideoEncoderOptionsExtension struct { - JPEG JpegOptions2 - MPEG4 Mpeg4Options2 - H264 H264Options2 - Extension VideoEncoderOptionsExtension2 + JPEG *JpegOptions2 `json:",omitempty"` + MPEG4 *Mpeg4Options2 `json:",omitempty"` + H264 *H264Options2 `json:",omitempty"` + Extension *VideoEncoderOptionsExtension2 `json:",omitempty"` } type JpegOptions2 struct { @@ -762,8 +891,8 @@ type AudioEncoderConfigurationOption struct { } type MetadataConfigurationOptions struct { - PTZStatusFilterOptions PTZStatusFilterOptions - Extension MetadataConfigurationOptionsExtension + PTZStatusFilterOptions *PTZStatusFilterOptions `json:",omitempty" xml:",omitempty"` + Extension *MetadataConfigurationOptionsExtension `json:",omitempty" xml:",omitempty"` } type PTZStatusFilterOptions struct { @@ -771,14 +900,14 @@ type PTZStatusFilterOptions struct { ZoomStatusSupported bool PanTiltPositionSupported bool ZoomPositionSupported bool - Extension PTZStatusFilterOptionsExtension + Extension *PTZStatusFilterOptionsExtension `json:",omitempty" xml:",omitempty"` } type PTZStatusFilterOptionsExtension xsd.AnyType type MetadataConfigurationOptionsExtension struct { - CompressionType string - Extension MetadataConfigurationOptionsExtension2 + CompressionType string `json:",omitempty" xml:",omitempty"` + Extension *MetadataConfigurationOptionsExtension2 `json:",omitempty" xml:",omitempty"` } type MetadataConfigurationOptionsExtension2 xsd.AnyType @@ -814,15 +943,15 @@ type G726DecOptions struct { type AudioDecoderConfigurationOptionsExtension xsd.AnyType type StreamSetup struct { - Stream StreamType `xml:"onvif:Stream"` - Transport Transport `xml:"onvif:Transport"` + Stream *StreamType `xml:"onvif:Stream,omitempty"` + Transport *Transport `xml:"onvif:Transport,omitempty"` } type StreamType xsd.String type Transport struct { - Protocol TransportProtocol `xml:"onvif:Protocol"` - Tunnel *Transport `xml:"onvif:Tunnel"` + Protocol *TransportProtocol `xml:"onvif:Protocol,omitempty"` + Tunnel *Transport `xml:"onvif:Tunnel,omitempty"` } // enum @@ -916,9 +1045,7 @@ type OSDImgOptions struct { Extension OSDImgOptionsExtension } -type StringAttrList struct { - AttrList []string -} +type StringAttrList []string type OSDImgOptionsExtension xsd.AnyType @@ -928,14 +1055,14 @@ type OSDConfigurationOptionsExtension xsd.AnyType type PTZNode struct { DeviceEntity - FixedHomePosition xsd.Boolean `xml:"FixedHomePosition,attr"` - GeoMove xsd.Boolean `xml:"GeoMove,attr"` - Name Name - SupportedPTZSpaces PTZSpaces - MaximumNumberOfPresets int - HomeSupported xsd.Boolean - AuxiliaryCommands AuxiliaryData - Extension PTZNodeExtension + FixedHomePosition *xsd.Boolean `json:",omitempty" xml:",attr,omitempty"` + GeoMove *xsd.Boolean `json:",omitempty" xml:",attr,omitempty"` + Name *Name `json:",omitempty" xml:",omitempty"` + SupportedPTZSpaces *PTZSpaces `json:",omitempty" xml:",omitempty"` + MaximumNumberOfPresets int `json:",omitempty" xml:",omitempty"` + HomeSupported *xsd.Boolean `json:",omitempty" xml:",omitempty"` + AuxiliaryCommands *AuxiliaryData `json:",omitempty" xml:",omitempty"` + Extension *PTZNodeExtension `json:",omitempty" xml:",omitempty"` } type PTZSpaces struct { @@ -972,16 +1099,14 @@ type PTZPresetTourSupportedExtension xsd.AnyType type PTZNodeExtension2 xsd.AnyType type PTZConfigurationOptions struct { - PTZRamps IntAttrList `xml:"PTZRamps,attr"` - Spaces PTZSpaces - PTZTimeout DurationRange - PTControlDirection PTControlDirectionOptions - Extension PTZConfigurationOptions2 + PTZRamps *IntAttrList `json:",omitempty" xml:",attr,omitempty"` + Spaces *PTZSpaces `json:",omitempty" xml:",omitempty"` + PTZTimeout *DurationRange `json:",omitempty" xml:",omitempty"` + PTControlDirection *PTControlDirectionOptions `json:",omitempty" xml:",omitempty"` + Extension *PTZConfigurationOptions2 `json:",omitempty" xml:",omitempty"` } -type IntAttrList struct { - IntAttrList []int -} +type IntAttrList []int type DurationRange struct { Min xsd.Duration @@ -1019,20 +1144,20 @@ type PTZPreset struct { } type PTZVector struct { - PanTilt Vector2D `xml:"PanTilt,omitempty"` - Zoom Vector1D `xml:"Zoom,omitempty"` + PanTilt *Vector2D `json:",omitempty" xml:"PanTilt,omitempty"` + Zoom *Vector1D `json:",omitempty" xml:"Zoom,omitempty"` } type PTZStatus struct { - Position PTZVector `xml:"Position"` - MoveStatus PTZMoveStatus `xml:"MoveStatus"` - Error string `xml:"Error"` - UtcTime xsd.DateTime `xml:"UtcTime"` + Position PTZVector `json:",omitempty" xml:",omitempty"` + MoveStatus PTZMoveStatus `json:",omitempty" xml:",omitempty"` + Error string `json:",omitempty" xml:",omitempty"` + UtcTime string `json:",omitempty" xml:",omitempty"` } type PTZMoveStatus struct { - PanTilt MoveStatus - Zoom MoveStatus + PanTilt string `json:",omitempty" xml:",omitempty"` + Zoom string `json:",omitempty" xml:",omitempty"` } type MoveStatus struct { @@ -1047,34 +1172,34 @@ type GeoLocation struct { type PresetTour struct { Token ReferenceToken `xml:"token,attr"` - Name Name `xml:"onvif:Name"` - Status PTZPresetTourStatus `xml:"onvif:Status"` - AutoStart xsd.Boolean `xml:"onvif:AutoStart"` - StartingCondition PTZPresetTourStartingCondition `xml:"onvif:StartingCondition"` - TourSpot PTZPresetTourSpot `xml:"onvif:TourSpot"` - Extension PTZPresetTourExtension `xml:"onvif:Extension"` + Name Name `xml:"Name"` + Status PTZPresetTourStatus `xml:"Status"` + AutoStart xsd.Boolean `xml:"AutoStart"` + StartingCondition PTZPresetTourStartingCondition `xml:"StartingCondition"` + TourSpot PTZPresetTourSpot `xml:"TourSpot"` + Extension PTZPresetTourExtension `xml:"Extension"` } type PTZPresetTourStatus struct { - State PTZPresetTourState `xml:"onvif:State"` - CurrentTourSpot PTZPresetTourSpot `xml:"onvif:CurrentTourSpot"` - Extension PTZPresetTourStatusExtension `xml:"onvif:Extension"` + State PTZPresetTourState `xml:"State"` + CurrentTourSpot PTZPresetTourSpot `xml:"CurrentTourSpot"` + Extension PTZPresetTourStatusExtension `xml:"Extension"` } type PTZPresetTourState xsd.String type PTZPresetTourSpot struct { - PresetDetail PTZPresetTourPresetDetail `xml:"onvif:PresetDetail"` - Speed PTZSpeed `xml:"onvif:Speed"` - StayTime xsd.Duration `xml:"onvif:StayTime"` - Extension PTZPresetTourSpotExtension `xml:"onvif:Extension"` + PresetDetail PTZPresetTourPresetDetail `xml:"PresetDetail"` + Speed PTZSpeed `xml:"Speed"` + StayTime xsd.Duration `xml:"StayTime"` + Extension PTZPresetTourSpotExtension `xml:"Extension"` } type PTZPresetTourPresetDetail struct { - PresetToken ReferenceToken `xml:"onvif:PresetToken"` - Home xsd.Boolean `xml:"onvif:Home"` - PTZPosition PTZVector `xml:"onvif:PTZPosition"` - TypeExtension PTZPresetTourTypeExtension `xml:"onvif:TypeExtension"` + PresetToken ReferenceToken `xml:"PresetToken"` + Home xsd.Boolean `xml:"Home"` + PTZPosition PTZVector `xml:"PTZPosition"` + TypeExtension PTZPresetTourTypeExtension `xml:"TypeExtension"` } type PTZPresetTourTypeExtension xsd.AnyType @@ -1085,10 +1210,10 @@ type PTZPresetTourStatusExtension xsd.AnyType type PTZPresetTourStartingCondition struct { RandomPresetOrder xsd.Boolean `xml:"RandomPresetOrder,attr"` - RecurringTime xsd.Int `xml:"onvif:RecurringTime"` - RecurringDuration xsd.Duration `xml:"onvif:RecurringDuration"` - Direction PTZPresetTourDirection `xml:"onvif:Direction"` - Extension PTZPresetTourStartingConditionExtension `xml:"onvif:Extension"` + RecurringTime xsd.Int `xml:"RecurringTime"` + RecurringDuration xsd.Duration `xml:"RecurringDuration"` + Direction PTZPresetTourDirection `xml:"Direction"` + Extension PTZPresetTourStartingConditionExtension `xml:"Extension"` } type PTZPresetTourDirection xsd.String @@ -1137,7 +1262,7 @@ type OnvifVersion struct { type SetDateTimeType xsd.String type TimeZone struct { - TZ xsd.Token `xml:"onvif:TZ"` + TZ xsd.Token `xml:"TZ"` } type SystemDateTime struct { @@ -1163,8 +1288,8 @@ type Include struct { } type BackupFile struct { - Name string `xml:"onvif:Name"` - Data AttachmentData `xml:"onvif:Data"` + Name string `xml:"Name"` + Data AttachmentData `xml:"Data"` } type SystemLogType xsd.String @@ -1189,11 +1314,11 @@ type ScopeDefinition xsd.String type DiscoveryMode xsd.String type NetworkHost struct { - Type NetworkHostType `xml:"onvif:Type"` - IPv4Address IPv4Address `xml:"onvif:IPv4Address"` - IPv6Address IPv6Address `xml:"onvif:IPv6Address"` - DNSname DNSName `xml:"onvif:DNSname"` - Extension NetworkHostExtension `xml:"onvif:Extension"` + Type NetworkHostType `xml:"Type"` + IPv4Address IPv4Address `xml:"IPv4Address"` + IPv6Address IPv6Address `xml:"IPv6Address"` + DNSname DNSName `xml:"DNSname"` + Extension NetworkHostExtension `xml:"Extension"` } type NetworkHostType xsd.String @@ -1201,16 +1326,23 @@ type NetworkHostType xsd.String type NetworkHostExtension xsd.String type RemoteUser struct { - Username string `xml:"onvif:Username"` - Password string `xml:"onvif:Password"` - UseDerivedPassword xsd.Boolean `xml:"onvif:UseDerivedPassword"` + Username string `xml:"Username"` + Password string `xml:"Password"` + UseDerivedPassword xsd.Boolean `xml:"UseDerivedPassword"` } type User struct { - Username string `xml:"onvif:Username"` - Password string `xml:"onvif:Password"` - UserLevel UserLevel `xml:"onvif:UserLevel"` - Extension UserExtension `xml:"onvif:Extension"` + Username string `json:",omitempty" xml:",omitempty"` + Password string `json:",omitempty" xml:",omitempty"` + UserLevel *UserLevel `json:",omitempty" xml:",omitempty"` + Extension *UserExtension `json:",omitempty" xml:",omitempty"` +} + +type UserRequest struct { + Username string `xml:"onvif:Username,omitempty"` + Password string `xml:"onvif:Password,omitempty"` + UserLevel *UserLevel `xml:"onvif:UserLevel,omitempty"` + Extension *UserExtension `xml:"onvif:Extension,omitempty"` } type UserLevel xsd.String @@ -1427,19 +1559,19 @@ type AnalyticsDeviceExtension xsd.AnyType type CapabilitiesExtension2 xsd.AnyType type HostnameInformation struct { - FromDHCP xsd.Boolean - Name xsd.Token - Extension HostnameInformationExtension + FromDHCP *xsd.Boolean `json:"FromDHCP,omitempty"` + Name *xsd.Token `json:"Name,omitempty"` + Extension *HostnameInformationExtension `json:"Extension,omitempty"` } type HostnameInformationExtension xsd.AnyType type DNSInformation struct { - FromDHCP xsd.Boolean - SearchDomain xsd.Token - DNSFromDHCP IPAddress - DNSManual IPAddress - Extension DNSInformationExtension + FromDHCP *xsd.Boolean `json:"FromDHCP,omitempty"` + SearchDomain *xsd.Token `json:"SearchDomain,omitempty"` + DNSFromDHCP *IPAddress `json:"DNSFromDHCP,omitempty"` + DNSManual *IPAddress `json:"DNSManual,omitempty"` + Extension *DNSInformationExtension `json:"Extension,omitempty"` } type DNSInformationExtension xsd.AnyType @@ -1467,18 +1599,18 @@ type DynamicDNSInformationExtension xsd.AnyType type NetworkInterface struct { DeviceEntity - Enabled xsd.Boolean - Info NetworkInterfaceInfo - Link NetworkInterfaceLink - IPv4 IPv4NetworkInterface - IPv6 IPv6NetworkInterface - Extension NetworkInterfaceExtension + Enabled *xsd.Boolean `json:",omitempty"` + Info *NetworkInterfaceInfo `json:",omitempty"` + Link *NetworkInterfaceLink `json:",omitempty"` + IPv4 *IPv4NetworkInterface `json:",omitempty"` + IPv6 *IPv6NetworkInterface `json:",omitempty"` + Extension *NetworkInterfaceExtension `json:",omitempty"` } type NetworkInterfaceInfo struct { - Name xsd.String - HwAddress HwAddress - MTU xsd.Int + Name xsd.String `json:"Name,omitempty"` + HwAddress HwAddress `json:"HwAddress,omitempty"` + MTU xsd.Int `json:"MTU,omitempty"` } type HwAddress xsd.Token @@ -1486,15 +1618,15 @@ type HwAddress xsd.Token type NetworkInterfaceLink struct { AdminSettings NetworkInterfaceConnectionSetting OperSettings NetworkInterfaceConnectionSetting - InterfaceType IANA_IfTypes `xml:"IANA-IfTypes"` + InterfaceType *IANA_IfTypes `xml:"IANA-IfTypes,omitempty" json:"IANA-IfTypes,omitempty"` } type IANA_IfTypes xsd.Int type NetworkInterfaceConnectionSetting struct { - AutoNegotiation xsd.Boolean `xml:"onvif:AutoNegotiation"` - Speed xsd.Int `xml:"onvif:Speed"` - Duplex Duplex `xml:"onvif:Duplex"` + AutoNegotiation *xsd.Boolean `xml:"onvif:AutoNegotiation,omitempty" json:"AutoNegotiation,omitempty"` + Speed *xsd.Int `xml:"onvif:Speed,omitempty" json:"Speed,omitempty"` + Duplex *Duplex `xml:"onvif:Duplex,omitempty" json:"Duplex,omitempty"` } // TODO: enum @@ -1502,35 +1634,35 @@ type Duplex xsd.String type NetworkInterfaceExtension struct { InterfaceType IANA_IfTypes - Dot3 Dot3Configuration - Dot11 Dot11Configuration + Dot3 *Dot3Configuration `xml:"Dot3,omitempty" json:"Dot3,omitempty"` + Dot11 *Dot11Configuration `xml:"Dot11,omitempty" json:"Dot11,omitempty"` Extension NetworkInterfaceExtension2 } type NetworkInterfaceExtension2 xsd.AnyType type Dot11Configuration struct { - SSID Dot11SSIDType `xml:"onvif:SSID"` - Mode Dot11StationMode `xml:"onvif:Mode"` - Alias Name `xml:"onvif:Alias"` - Priority NetworkInterfaceConfigPriority `xml:"onvif:Priority"` - Security Dot11SecurityConfiguration `xml:"onvif:Security"` + SSID Dot11SSIDType `xml:"SSID,omitempty" json:"SSID,omitempty"` + Mode Dot11StationMode `xml:"Mode,omitempty" json:"Mode,omitempty"` + Alias Name `xml:"Alias,omitempty" json:"Alias,omitempty"` + Priority NetworkInterfaceConfigPriority `xml:"Priority,omitempty" json:"Priority,omitempty"` + Security Dot11SecurityConfiguration `xml:"Security,omitempty" json:"Security,omitempty"` } type Dot11SecurityConfiguration struct { - Mode Dot11SecurityMode `xml:"onvif:Mode"` - Algorithm Dot11Cipher `xml:"onvif:Algorithm"` - PSK Dot11PSKSet `xml:"onvif:PSK"` - Dot1X ReferenceToken `xml:"onvif:Dot1X"` - Extension Dot11SecurityConfigurationExtension `xml:"onvif:Extension"` + Mode Dot11SecurityMode `xml:"Mode,omitempty" json:"Mode,omitempty"` + Algorithm Dot11Cipher `xml:"Algorithm,omitempty" json:"Algorithm,omitempty"` + PSK Dot11PSKSet `xml:"PSK,omitempty" json:"PSK,omitempty"` + Dot1X ReferenceToken `xml:"Dot1X,omitempty" json:"Dot1X,omitempty"` + Extension Dot11SecurityConfigurationExtension `xml:"Extension,omitempty" json:"Extension,omitempty"` } type Dot11SecurityConfigurationExtension xsd.AnyType type Dot11PSKSet struct { - Key Dot11PSK `xml:"onvif:Key"` - Passphrase Dot11PSKPassphrase `xml:"onvif:Passphrase"` - Extension Dot11PSKSetExtension `xml:"onvif:Extension"` + Key Dot11PSK `xml:"Key,omitempty" json:"Key,omitempty"` + Passphrase Dot11PSKPassphrase `xml:"Passphrase,omitempty" json:"Passphrase,omitempty"` + Extension Dot11PSKSetExtension `xml:"Extension,omitempty" json:"Extension,omitempty"` } type Dot11PSKSetExtension xsd.AnyType @@ -1574,66 +1706,73 @@ type IPv6Configuration struct { type IPv6ConfigurationExtension xsd.AnyType type PrefixedIPv6Address struct { - Address IPv6Address `xml:"onvif:Address"` - PrefixLength xsd.Int `xml:"onvif:PrefixLength"` + Address IPv6Address `xml:"Address,omitempty" json:"Address,omitempty"` + PrefixLength xsd.Int `xml:"PrefixLength,omitempty" json:"PrefixLength,omitempty"` } // TODO: enumeration type IPv6DHCPConfiguration xsd.String type IPv4NetworkInterface struct { - Enabled xsd.Boolean - Config IPv4Configuration + Enabled *xsd.Boolean `json:"Enabled,omitempty"` + Config *IPv4Configuration `json:"Config,omitempty"` } type IPv4Configuration struct { - Manual PrefixedIPv4Address - LinkLocal PrefixedIPv4Address - FromDHCP PrefixedIPv4Address - DHCP xsd.Boolean + Manual *PrefixedIPv4Address `json:"Manual,omitempty"` + LinkLocal *PrefixedIPv4Address `json:"LinkLocal,omitempty"` + FromDHCP *PrefixedIPv4Address `json:"FromDHCP,omitempty"` + DHCP *xsd.Boolean `json:"DHCP,omitempty"` } // optional, unbounded type PrefixedIPv4Address struct { - Address IPv4Address `xml:"onvif:Address"` - PrefixLength xsd.Int `xml:"onvif:PrefixLength"` + Address IPv4Address `xml:"Address" json:"Address,omitempty"` + PrefixLength xsd.Int `xml:"PrefixLength" json:"PrefixLength,omitempty"` } type NetworkInterfaceSetConfiguration struct { - Enabled xsd.Boolean `xml:"onvif:Enabled"` - Link NetworkInterfaceConnectionSetting `xml:"onvif:Link"` - MTU xsd.Int `xml:"onvif:MTU"` - IPv4 IPv4NetworkInterfaceSetConfiguration `xml:"onvif:IPv4"` - IPv6 IPv6NetworkInterfaceSetConfiguration `xml:"onvif:IPv6"` - Extension NetworkInterfaceSetConfigurationExtension `xml:"onvif:Extension"` + Enabled *xsd.Boolean `xml:"onvif:Enabled,omitempty"` + Link *NetworkInterfaceConnectionSetting `xml:"onvif:Link,omitempty"` + MTU *xsd.Int `xml:"onvif:MTU,omitempty"` + IPv4 *IPv4NetworkInterfaceSetConfiguration `xml:"onvif:IPv4,omitempty"` + IPv6 *IPv6NetworkInterfaceSetConfiguration `xml:"onvif:IPv6,omitempty"` + Extension *NetworkInterfaceSetConfigurationExtension `xml:"onvif:Extension,omitempty"` } type NetworkInterfaceSetConfigurationExtension struct { - Dot3 Dot3Configuration `xml:"onvif:Dot3"` - Dot11 Dot11Configuration `xml:"onvif:Dot11"` - Extension NetworkInterfaceSetConfigurationExtension2 `xml:"onvif:Extension"` + Dot3 Dot3Configuration `xml:"onvif:Dot3,omitempty"` + Dot11 Dot11Configuration `xml:"onvif:Dot11,omitempty"` + Extension NetworkInterfaceSetConfigurationExtension2 `xml:"onvif:Extension,omitempty"` } type NetworkInterfaceSetConfigurationExtension2 xsd.AnyType type IPv6NetworkInterfaceSetConfiguration struct { - Enabled xsd.Boolean `xml:"onvif:Enabled"` - AcceptRouterAdvert xsd.Boolean `xml:"onvif:AcceptRouterAdvert"` - Manual PrefixedIPv6Address `xml:"onvif:Manual"` - DHCP IPv6DHCPConfiguration `xml:"onvif:DHCP"` + Enabled *xsd.Boolean `xml:"onvif:Enabled,omitempty" json:",omitempty"` + AcceptRouterAdvert *xsd.Boolean `xml:"onvif:AcceptRouterAdvert,omitempty" json:",omitempty"` + Manual *PrefixedIPv6Address `xml:"onvif:Manual,omitempty" json:",omitempty"` + DHCP *IPv6DHCPConfiguration `xml:"onvif:DHCP,omitempty" json:",omitempty"` } type IPv4NetworkInterfaceSetConfiguration struct { - Enabled xsd.Boolean `xml:"onvif:Enabled"` - Manual PrefixedIPv4Address `xml:"onvif:Manual"` - DHCP xsd.Boolean `xml:"onvif:DHCP"` + Enabled *xsd.Boolean `xml:"onvif:Enabled,omitempty"` + Manual *PrefixedIPv4Address `xml:"onvif:Manual,omitempty"` + DHCP *xsd.Boolean `xml:"onvif:DHCP,omitempty"` +} + +type NetworkProtocolResponse struct { + Name *NetworkProtocolType `json:",omitempty"` + Enabled *xsd.Boolean `json:",omitempty"` + Port *xsd.Int `json:",omitempty"` + Extension *NetworkProtocolExtension `json:",omitempty"` } -type NetworkProtocol struct { - Name NetworkProtocolType `xml:"onvif:Name"` - Enabled xsd.Boolean `xml:"onvif:Enabled"` - Port xsd.Int `xml:"onvif:Port"` - Extension NetworkProtocolExtension `xml:"onvif:Extension"` +type NetworkProtocolRequest struct { + Name *NetworkProtocolType `xml:"onvif:Name,omitempty"` + Enabled *xsd.Boolean `xml:"onvif:Enabled,omitempty"` + Port *xsd.Int `xml:"onvif:Port,omitempty"` + Extension *NetworkProtocolExtension `xml:"onvif:Extension,omitempty"` } type NetworkProtocolExtension xsd.AnyType @@ -1642,8 +1781,8 @@ type NetworkProtocolExtension xsd.AnyType type NetworkProtocolType xsd.String type NetworkGateway struct { - IPv4Address IPv4Address - IPv6Address IPv6Address + IPv4Address *IPv4Address `json:"IPv4Address,omitempty"` + IPv6Address *IPv6Address `json:"IPv6Address,omitempty"` } type NetworkZeroConfiguration struct { @@ -1661,10 +1800,10 @@ type NetworkZeroConfigurationExtension struct { type NetworkZeroConfigurationExtension2 xsd.AnyType type IPAddressFilter struct { - Type IPAddressFilterType `xml:"onvif:Type"` - IPv4Address PrefixedIPv4Address `xml:"onvif:IPv4Address,omitempty"` - IPv6Address PrefixedIPv6Address `xml:"onvif:IPv6Address,omitempty"` - Extension IPAddressFilterExtension `xml:"onvif:Extension,omitempty"` + Type IPAddressFilterType `xml:"Type,omitempty"` + IPv4Address PrefixedIPv4Address `xml:"IPv4Address,omitempty"` + IPv6Address PrefixedIPv6Address `xml:"IPv6Address,omitempty"` + Extension IPAddressFilterExtension `xml:"Extension,omitempty"` } type IPAddressFilterExtension xsd.AnyType @@ -1676,17 +1815,17 @@ type IPAddressFilterType xsd.String // TODO: attribite type BinaryData struct { X ContentType `xml:"xmime:contentType,attr"` - Data xsd.Base64Binary `xml:"onvif:Data"` + Data xsd.Base64Binary `xml:"Data"` } type Certificate struct { - CertificateID xsd.Token `xml:"onvif:CertificateID"` - Certificate BinaryData `xml:"onvif:Certificate"` + CertificateID xsd.Token `xml:"CertificateID"` + Certificate BinaryData `xml:"Certificate"` } type CertificateStatus struct { - CertificateID xsd.Token `xml:"onvif:CertificateID"` - Status xsd.Boolean `xml:"onvif:Status"` + CertificateID xsd.Token `xml:"CertificateID"` + Status xsd.Boolean `xml:"Status"` } type RelayOutput struct { @@ -1695,9 +1834,9 @@ type RelayOutput struct { } type RelayOutputSettings struct { - Mode RelayMode `xml:"onvif:Mode"` - DelayTime xsd.Duration `xml:"onvif:DelayTime"` - IdleState RelayIdleState `xml:"onvif:IdleState"` + Mode RelayMode `xml:"Mode"` + DelayTime xsd.Duration `xml:"DelayTime"` + IdleState RelayIdleState `xml:"IdleState"` } // TODO:enumeration @@ -1710,9 +1849,9 @@ type RelayMode xsd.String type RelayLogicalState xsd.String type CertificateWithPrivateKey struct { - CertificateID xsd.Token `xml:"onvif:CertificateID"` - Certificate BinaryData `xml:"onvif:Certificate"` - PrivateKey BinaryData `xml:"onvif:PrivateKey"` + CertificateID xsd.Token `xml:"CertificateID"` + Certificate BinaryData `xml:"Certificate"` + PrivateKey BinaryData `xml:"PrivateKey"` } type CertificateInformation struct { @@ -1742,27 +1881,27 @@ type CertificateUsage struct { } type Dot1XConfiguration struct { - Dot1XConfigurationToken ReferenceToken `xml:"onvif:Dot1XConfigurationToken"` - Identity xsd.String `xml:"onvif:Identity"` - AnonymousID xsd.String `xml:"onvif:AnonymousID,omitempty"` - EAPMethod xsd.Int `xml:"onvif:EAPMethod"` - CACertificateID xsd.Token `xml:"onvif:CACertificateID,omitempty"` - EAPMethodConfiguration EAPMethodConfiguration `xml:"onvif:EAPMethodConfiguration,omitempty"` - Extension Dot1XConfigurationExtension `xml:"onvif:Extension,omitempty"` + Dot1XConfigurationToken ReferenceToken `xml:"Dot1XConfigurationToken"` + Identity xsd.String `xml:"Identity"` + AnonymousID xsd.String `xml:"AnonymousID,omitempty"` + EAPMethod xsd.Int `xml:"EAPMethod"` + CACertificateID xsd.Token `xml:"CACertificateID,omitempty"` + EAPMethodConfiguration EAPMethodConfiguration `xml:"EAPMethodConfiguration,omitempty"` + Extension Dot1XConfigurationExtension `xml:"Extension,omitempty"` } type Dot1XConfigurationExtension xsd.AnyType type EAPMethodConfiguration struct { - TLSConfiguration TLSConfiguration `xml:"onvif:TLSConfiguration,omitempty"` - Password xsd.String `xml:"onvif:Password,omitempty"` - Extension EapMethodExtension `xml:"onvif:Extension,omitempty"` + TLSConfiguration TLSConfiguration `xml:"TLSConfiguration,omitempty"` + Password xsd.String `xml:"Password,omitempty"` + Extension EapMethodExtension `xml:"Extension,omitempty"` } type EapMethodExtension xsd.AnyType type TLSConfiguration struct { - CertificateID xsd.Token `xml:"onvif:CertificateID,omitempty"` + CertificateID xsd.Token `xml:"CertificateID,omitempty"` } type Dot11Capabilities struct { @@ -1816,10 +1955,10 @@ type LocationEntity struct { GeoSource xsd.AnyURI `xml:"GeoSource,attr"` AutoGeo xsd.Boolean `xml:"AutoGeo,attr"` - GeoLocation GeoLocation `xml:"onvif:GeoLocation"` - GeoOrientation GeoOrientation `xml:"onvif:GeoOrientation"` - LocalLocation LocalLocation `xml:"onvif:LocalLocation"` - LocalOrientation LocalOrientation `xml:"onvif:LocalOrientation"` + GeoLocation GeoLocation `xml:"GeoLocation"` + GeoOrientation GeoOrientation `xml:"GeoOrientation"` + LocalLocation LocalLocation `xml:"LocalLocation"` + LocalOrientation LocalOrientation `xml:"LocalOrientation"` } type LocalOrientation struct { @@ -1841,38 +1980,55 @@ type GeoOrientation struct { } type FocusMove struct { - Absolute AbsoluteFocus `xml:"onvif:Absolute"` - Relative RelativeFocus `xml:"onvif:Relative"` - Continuous ContinuousFocus `xml:"onvif:Continuous"` + Absolute AbsoluteFocus `xml:"Absolute"` + Relative RelativeFocus `xml:"Relative"` + Continuous ContinuousFocus `xml:"Continuous"` } type ContinuousFocus struct { - Speed xsd.Float `xml:"onvif:Speed"` + Speed xsd.Float `xml:"Speed"` } type RelativeFocus struct { - Distance xsd.Float `xml:"onvif:Distance"` - Speed xsd.Float `xml:"onvif:Speed"` + Distance xsd.Float `xml:"Distance"` + Speed xsd.Float `xml:"Speed"` } type AbsoluteFocus struct { - Position xsd.Float `xml:"onvif:Position"` - Speed xsd.Float `xml:"onvif:Speed"` + Position xsd.Float `xml:"Position"` + Speed xsd.Float `xml:"Speed"` } type DateTime struct { - Time Time `xml:"onvif:Time"` - Date Date `xml:"onvif:Date"` + Time Time `xml:"Time"` + Date Date `xml:"Date"` } type Time struct { - Hour xsd.Int `xml:"onvif:Hour"` - Minute xsd.Int `xml:"onvif:Minute"` - Second xsd.Int `xml:"onvif:Second"` + Hour xsd.Int `xml:"Hour"` + Minute xsd.Int `xml:"Minute"` + Second xsd.Int `xml:"Second"` } type Date struct { - Year xsd.Int `xml:"onvif:Year"` - Month xsd.Int `xml:"onvif:Month"` - Day xsd.Int `xml:"onvif:Day"` + Year xsd.Int `xml:"Year"` + Month xsd.Int `xml:"Month"` + Day xsd.Int `xml:"Day"` +} + +type DateTimeRequest struct { + Time *TimeRequest `xml:"onvif:Time,omitempty"` + Date *DateRequest `xml:"onvif:Date,omitempty"` +} + +type TimeRequest struct { + Hour *xsd.Int `xml:"onvif:Hour,omitempty"` + Minute *xsd.Int `xml:"onvif:Minute,omitempty"` + Second *xsd.Int `xml:"onvif:Second,omitempty"` +} + +type DateRequest struct { + Year *xsd.Int `xml:"onvif:Year,omitempty"` + Month *xsd.Int `xml:"onvif:Month,omitempty"` + Day *xsd.Int `xml:"onvif:Day,omitempty"` }