event.go 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002
  1. package event
  2. import (
  3. "context"
  4. "encoding/xml"
  5. "time"
  6. "lc/common/onvif/soap"
  7. )
  8. // against "unused imports"
  9. var _ time.Time
  10. var _ xml.Name
  11. // GetServiceCapabilities type
  12. type GetServiceCapabilities struct {
  13. XMLName xml.Name `xml:"http://www.onvif.org/ver10/events/wsdl GetServiceCapabilities"`
  14. }
  15. // GetServiceCapabilitiesResponse type
  16. type GetServiceCapabilitiesResponse struct {
  17. XMLName xml.Name `xml:"GetServiceCapabilitiesResponse"`
  18. // The capabilities for the event service is returned in the Capabilities element.
  19. Capabilities Capabilities `xml:"Capabilities,omitempty"`
  20. }
  21. // CreatePullPointSubscription type
  22. type CreatePullPointSubscription struct {
  23. XMLName xml.Name `xml:"http://www.onvif.org/ver10/events/wsdl CreatePullPointSubscription"`
  24. // Optional XPATH expression to select specific topics.
  25. Filter FilterType `xml:"Filter,omitempty"`
  26. // Initial termination time.
  27. InitialTerminationTime AbsoluteOrRelativeTimeType `xml:"InitialTerminationTime,omitempty"`
  28. //SubscriptionPolicy struct {
  29. // ChangedOnly bool `xml:"ChangedOnly,attr"`
  30. //} `xml:"SubscriptionPolicy,omitempty"`
  31. }
  32. // CreatePullPointSubscriptionResponse type
  33. type CreatePullPointSubscriptionResponse struct {
  34. XMLName xml.Name `xml:"CreatePullPointSubscriptionResponse"`
  35. // Endpoint reference of the subscription to be used for pulling the messages.
  36. SubscriptionReference EndpointReferenceType `xml:"SubscriptionReference,omitempty"`
  37. CurrentTime string `xml:"CurrentTime,omitempty"`
  38. TerminationTime string `xml:"TerminationTime,omitempty"`
  39. }
  40. // PullMessages type
  41. type PullMessages struct {
  42. XMLName xml.Name `xml:"http://www.onvif.org/ver10/events/wsdl PullMessages"`
  43. // Maximum time to block until this method returns.
  44. Timeout Duration `xml:"http://www.onvif.org/ver10/schema Timeout,omitempty"`
  45. // Upper limit for the number of messages to return at once. A server implementation may decide to return less messages.
  46. MessageLimit int32 `xml:"http://www.onvif.org/ver10/schema MessageLimit,omitempty"`
  47. }
  48. // PullMessagesResponse type
  49. type PullMessagesResponse struct {
  50. XMLName xml.Name `xml:"PullMessagesResponse"`
  51. // The date and time when the messages have been delivered by the web server to the client.
  52. CurrentTime CurrentTime `xml:"CurrentTime,omitempty"`
  53. // Date time when the PullPoint will be shut down without further pull requests.
  54. TerminationTime TerminationTime `xml:"TerminationTime,omitempty"`
  55. NotificationMessage []NotificationMessage `xml:"NotificationMessage,omitempty"`
  56. }
  57. // Seek type
  58. type Seek struct {
  59. XMLName xml.Name `xml:"http://www.onvif.org/ver10/events/wsdl Seek"`
  60. // The date and time to match against stored messages.
  61. UtcTime string `xml:"http://www.onvif.org/ver10/schema UtcTime,omitempty"`
  62. // Reverse the pull direction of PullMessages.
  63. Reverse bool `xml:"http://www.onvif.org/ver10/events/wsdl Reverse,omitempty"`
  64. }
  65. // SeekResponse type
  66. type SeekResponse struct {
  67. XMLName xml.Name `xml:"SeekResponse"`
  68. }
  69. // SetSynchronizationPoint type
  70. type SetSynchronizationPoint struct {
  71. XMLName xml.Name `xml:"http://www.onvif.org/ver10/events/wsdl SetSynchronizationPoint"`
  72. }
  73. // SetSynchronizationPointResponse type
  74. type SetSynchronizationPointResponse struct {
  75. XMLName xml.Name `xml:"SetSynchronizationPointResponse"`
  76. }
  77. // GetEventProperties type
  78. type GetEventProperties struct {
  79. XMLName xml.Name `xml:"http://www.onvif.org/ver10/events/wsdl GetEventProperties"`
  80. }
  81. // GetEventPropertiesResponse type
  82. type GetEventPropertiesResponse struct {
  83. XMLName xml.Name `xml:"GetEventPropertiesResponse"`
  84. // List of topic namespaces supported.
  85. TopicNamespaceLocation []AnyURI `xml:"TopicNamespaceLocation,omitempty"`
  86. FixedTopicSet FixedTopicSet `xml:"FixedTopicSet,omitempty"`
  87. TopicSet TopicSet `xml:"TopicSet,omitempty"`
  88. TopicExpressionDialect []TopicExpressionDialect `xml:"TopicExpressionDialect,omitempty"`
  89. //
  90. // Defines the XPath function set supported for message content filtering.
  91. // The following MessageContentFilterDialects should be returned if a device supports the message content filtering:
  92. //
  93. // A device that does not support any MessageContentFilterDialect returns a single empty url.
  94. //
  95. MessageContentFilterDialect []AnyURI `xml:"MessageContentFilterDialect,omitempty"`
  96. //
  97. // Optional ProducerPropertiesDialects. Refer to for advanced filtering.
  98. ProducerPropertiesFilterDialect []AnyURI `xml:"ProducerPropertiesFilterDialect,omitempty"`
  99. //
  100. // The Message Content Description Language allows referencing
  101. // of vendor-specific types. In order to ease the integration of such types into a client application,
  102. // the GetEventPropertiesResponse shall list all URI locations to schema files whose types are
  103. // used in the description of notifications, with MessageContentSchemaLocation elements.
  104. // This list shall at least contain the URI of the ONVIF schema file.
  105. MessageContentSchemaLocation []AnyURI `xml:"MessageContentSchemaLocation,omitempty"`
  106. }
  107. // Capabilities type
  108. type Capabilities struct {
  109. // Indicates that the WS Subscription policy is supported.
  110. WSSubscriptionPolicySupport bool `xml:"http://www.onvif.org/ver10/events/wsdl WSSubscriptionPolicySupport,attr,omitempty"`
  111. // Indicates that the WS Pull Point is supported.
  112. WSPullPointSupport bool `xml:"http://www.onvif.org/ver10/events/wsdl WSPullPointSupport,attr,omitempty"`
  113. // Indicates that the WS Pausable Subscription Manager Interface is supported.
  114. WSPausableSubscriptionManagerInterfaceSupport bool `xml:"http://www.onvif.org/ver10/events/wsdl WSPausableSubscriptionManagerInterfaceSupport,attr,omitempty"`
  115. // Maximum number of supported notification producers as defined by WS-BaseNotification.
  116. MaxNotificationProducers int32 `xml:"http://www.onvif.org/ver10/schema MaxNotificationProducers,attr,omitempty"`
  117. // Maximum supported number of notification pull points.
  118. MaxPullPoints int32 `xml:"http://www.onvif.org/ver10/schema MaxPullPoints,attr,omitempty"`
  119. // Indication if the device supports persistent notification storage.
  120. PersistentNotificationStorage bool `xml:"http://www.onvif.org/ver10/events/wsdl PersistentNotificationStorage,attr,omitempty"`
  121. }
  122. // RelationshipTypeOpenEnum type
  123. type RelationshipTypeOpenEnum string
  124. // RelationshipType type
  125. type RelationshipType AnyURI
  126. const (
  127. // RelationshipTypeHttpwwww3org200508addressingreply const
  128. RelationshipTypeHttpwwww3org200508addressingreply RelationshipType = "http://www.w3.org/2005/08/addressing/reply"
  129. )
  130. // FaultCodesType type
  131. type FaultCodesType QName
  132. const (
  133. // FaultCodesTypeTnsInvalidAddressingHeader const
  134. FaultCodesTypeTnsInvalidAddressingHeader FaultCodesType = "tns:InvalidAddressingHeader"
  135. // FaultCodesTypeTnsInvalidAddress const
  136. FaultCodesTypeTnsInvalidAddress FaultCodesType = "tns:InvalidAddress"
  137. // FaultCodesTypeTnsInvalidEPR const
  138. FaultCodesTypeTnsInvalidEPR FaultCodesType = "tns:InvalidEPR"
  139. // FaultCodesTypeTnsInvalidCardinality const
  140. FaultCodesTypeTnsInvalidCardinality FaultCodesType = "tns:InvalidCardinality"
  141. // FaultCodesTypeTnsMissingAddressInEPR const
  142. FaultCodesTypeTnsMissingAddressInEPR FaultCodesType = "tns:MissingAddressInEPR"
  143. // FaultCodesTypeTnsDuplicateMessageID const
  144. FaultCodesTypeTnsDuplicateMessageID FaultCodesType = "tns:DuplicateMessageID"
  145. // FaultCodesTypeTnsActionMismatch const
  146. FaultCodesTypeTnsActionMismatch FaultCodesType = "tns:ActionMismatch"
  147. // FaultCodesTypeTnsMessageAddressingHeaderRequired const
  148. FaultCodesTypeTnsMessageAddressingHeaderRequired FaultCodesType = "tns:MessageAddressingHeaderRequired"
  149. // FaultCodesTypeTnsDestinationUnreachable const
  150. FaultCodesTypeTnsDestinationUnreachable FaultCodesType = "tns:DestinationUnreachable"
  151. // FaultCodesTypeTnsActionNotSupported const
  152. FaultCodesTypeTnsActionNotSupported FaultCodesType = "tns:ActionNotSupported"
  153. // FaultCodesTypeTnsEndpointUnavailable const
  154. FaultCodesTypeTnsEndpointUnavailable FaultCodesType = "tns:EndpointUnavailable"
  155. )
  156. // EndpointReference type
  157. type EndpointReference EndpointReferenceType
  158. // Metadata type
  159. type Metadata MetadataType
  160. // RelatesTo type
  161. type RelatesTo RelatesToType
  162. // To type
  163. type To AttributedURIType
  164. // Action type
  165. type Action AttributedURIType
  166. // ProblemAction type
  167. type ProblemAction ProblemActionType
  168. // EndpointReferenceType type
  169. /*
  170. type EndpointReferenceType struct {
  171. XMLName xml.Name `xml:"http://www.w3.org/2005/08/addressing EndpointReference"`
  172. Address AttributedURIType `xml:"Address,omitempty"`
  173. ReferenceParameters ReferenceParametersType `xml:"ReferenceParameters,omitempty"`
  174. Metadata Metadata `xml:"Metadata,omitempty"`
  175. }*/
  176. // EndpointReferenceType type
  177. type EndpointReferenceType struct {
  178. //XMLName xml.Name //`xml:"http://www.w3.org/2005/08/addressing EndpointReference"`
  179. Address AnyURI `xml:"http://www.w3.org/2005/08/addressing Address,omitempty"`
  180. ReferenceParameters ReferenceParametersType `xml:"ReferenceParameters,omitempty"`
  181. Metadata Metadata `xml:"Metadata,omitempty"`
  182. }
  183. // ReferenceParametersType type
  184. type ReferenceParametersType struct {
  185. }
  186. // MetadataType type
  187. type MetadataType struct {
  188. XMLName xml.Name `xml:"http://www.w3.org/2005/08/addressing Metadata"`
  189. }
  190. // RelatesToType type
  191. type RelatesToType struct {
  192. XMLName xml.Name `xml:"http://www.w3.org/2005/08/addressing RelatesTo"`
  193. Value AnyURI
  194. RelationshipType RelationshipTypeOpenEnum `xml:"RelationshipType,attr,omitempty"`
  195. }
  196. // AttributedURIType type
  197. type AttributedURIType struct {
  198. XMLName xml.Name `xml:"http://www.w3.org/2005/08/addressing MessageID"`
  199. Value AnyURI
  200. }
  201. // ProblemActionType type
  202. type ProblemActionType struct {
  203. XMLName xml.Name `xml:"http://www.w3.org/2005/08/addressing ProblemAction"`
  204. Action Action `xml:"Action,omitempty"`
  205. SoapAction AnyURI `xml:"http://www.onvif.org/ver10/schema SoapAction,omitempty"`
  206. }
  207. // ConcreteTopicExpression type
  208. type ConcreteTopicExpression string
  209. // SimpleTopicExpression type
  210. type SimpleTopicExpression QName
  211. // TopicNamespace type
  212. type TopicNamespace TopicNamespaceType
  213. // TopicSet type
  214. type TopicSet TopicSetType
  215. // Documentation type
  216. type Documentation struct {
  217. }
  218. // ExtensibleDocumented type
  219. type ExtensibleDocumented struct {
  220. Documentation Documentation `xml:"documentation,omitempty"`
  221. }
  222. // QueryExpressionType type
  223. type QueryExpressionType struct {
  224. //XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/t-1 ProducerProperties"`
  225. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 MessageContent"`
  226. QueryExpression string `xml:",chardata"`
  227. Dialect AnyURI `xml:"http://www.onvif.org/ver10/schema Dialect,attr,omitempty"`
  228. }
  229. // TopicNamespaceType type
  230. type TopicNamespaceType struct {
  231. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/t-1 TopicNamespace"`
  232. *ExtensibleDocumented
  233. Topic []struct {
  234. *TopicType
  235. Parent ConcreteTopicExpression `xml:"parent,attr,omitempty"`
  236. } `xml:"Topic,omitempty"`
  237. Name NCName `xml:"name,attr,omitempty"`
  238. TargetNamespace AnyURI `xml:"targetNamespace,attr,omitempty"`
  239. Final bool `xml:"final,attr,omitempty"`
  240. }
  241. // TopicType type
  242. type TopicType struct {
  243. *ExtensibleDocumented
  244. MessagePattern QueryExpressionType `xml:"MessagePattern,omitempty"`
  245. Topic []TopicType `xml:"Topic,omitempty"`
  246. Name NCName `xml:"name,attr,omitempty"`
  247. MessageTypes string `xml:"messageTypes,attr,omitempty"`
  248. Final bool `xml:"final,attr,omitempty"`
  249. }
  250. // TopicSetType type
  251. type TopicSetType struct {
  252. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/t-1 TopicSet"`
  253. //*ExtensibleDocumented
  254. TopicSet string `xml:",innerxml"`
  255. }
  256. // BaseFault type
  257. type BaseFault BaseFaultType
  258. // BaseFaultType type
  259. type BaseFaultType struct {
  260. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsrf/bf-2 BaseFault"`
  261. Timestamp string `xml:"http://www.onvif.org/ver10/schema Timestamp,omitempty"`
  262. Originator EndpointReferenceType `xml:"Originator,omitempty"`
  263. ErrorCode struct {
  264. Dialect AnyURI `xml:"dialect,attr,omitempty"`
  265. } `xml:"ErrorCode,omitempty"`
  266. Description []struct {
  267. Value string
  268. string `xml:",attr,omitempty"`
  269. } `xml:"Description,omitempty"`
  270. FaultCause struct {
  271. } `xml:"FaultCause,omitempty"`
  272. }
  273. // AbsoluteOrRelativeTimeType type
  274. type AbsoluteOrRelativeTimeType string
  275. // TopicExpression type
  276. type TopicExpression TopicExpressionType
  277. // FixedTopicSet type
  278. type FixedTopicSet bool
  279. // TopicExpressionDialect type
  280. type TopicExpressionDialect AnyURI
  281. // ConsumerReference type
  282. type ConsumerReference EndpointReferenceType
  283. // Filter type
  284. type Filter FilterType
  285. // SubscriptionPolicy type
  286. type SubscriptionPolicy SubscriptionPolicyType
  287. // CreationTime type
  288. type CreationTime time.Time
  289. // SubscriptionReference type
  290. type SubscriptionReference EndpointReferenceType
  291. // Topic type
  292. //type Topic TopicExpressionType
  293. // ProducerReference type
  294. type ProducerReference EndpointReferenceType
  295. // NotificationMessage type
  296. type NotificationMessage NotificationMessageHolderType
  297. // Notify type
  298. type Notify struct {
  299. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 Notify"`
  300. NotificationMessage []NotificationMessage `xml:"NotificationMessage,omitempty"`
  301. }
  302. // CurrentTime type
  303. type CurrentTime string
  304. // TerminationTime type
  305. type TerminationTime string
  306. // Subscribe type
  307. type Subscribe struct {
  308. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 Subscribe"`
  309. ConsumerReference EndpointReferenceType `xml:"ConsumerReference,omitempty"`
  310. Filter FilterType `xml:"Filter,omitempty"`
  311. InitialTerminationTime AbsoluteOrRelativeTimeType `xml:"InitialTerminationTime,omitempty"`
  312. SubscriptionPolicy struct {
  313. } `xml:"SubscriptionPolicy,omitempty"`
  314. }
  315. // SubscribeCreationFailedFault type
  316. type SubscribeCreationFailedFault SubscribeCreationFailedFaultType
  317. // InvalidFilterFault type
  318. type InvalidFilterFault InvalidFilterFaultType
  319. // TopicExpressionDialectUnknownFault type
  320. type TopicExpressionDialectUnknownFault TopicExpressionDialectUnknownFaultType
  321. // InvalidTopicExpressionFault type
  322. type InvalidTopicExpressionFault InvalidTopicExpressionFaultType
  323. // TopicNotSupportedFault type
  324. type TopicNotSupportedFault TopicNotSupportedFaultType
  325. // MultipleTopicsSpecifiedFault type
  326. type MultipleTopicsSpecifiedFault MultipleTopicsSpecifiedFaultType
  327. // InvalidProducerPropertiesExpressionFault type
  328. type InvalidProducerPropertiesExpressionFault InvalidProducerPropertiesExpressionFaultType
  329. // InvalidMessageContentExpressionFault type
  330. type InvalidMessageContentExpressionFault InvalidMessageContentExpressionFaultType
  331. // UnrecognizedPolicyRequestFault type
  332. type UnrecognizedPolicyRequestFault UnrecognizedPolicyRequestFaultType
  333. // UnsupportedPolicyRequestFault type
  334. type UnsupportedPolicyRequestFault UnsupportedPolicyRequestFaultType
  335. // NotifyMessageNotSupportedFault type
  336. type NotifyMessageNotSupportedFault NotifyMessageNotSupportedFaultType
  337. // UnacceptableInitialTerminationTimeFault type
  338. type UnacceptableInitialTerminationTimeFault UnacceptableInitialTerminationTimeFaultType
  339. // NoCurrentMessageOnTopicFault type
  340. type NoCurrentMessageOnTopicFault NoCurrentMessageOnTopicFaultType
  341. // UnableToGetMessagesFault type
  342. type UnableToGetMessagesFault UnableToGetMessagesFaultType
  343. // UnableToDestroyPullPointFault type
  344. type UnableToDestroyPullPointFault UnableToDestroyPullPointFaultType
  345. // CreatePullPoint type
  346. type CreatePullPoint struct {
  347. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 CreatePullPoint"`
  348. }
  349. // UnableToCreatePullPointFault type
  350. type UnableToCreatePullPointFault UnableToCreatePullPointFaultType
  351. // UnacceptableTerminationTimeFault type
  352. type UnacceptableTerminationTimeFault UnacceptableTerminationTimeFaultType
  353. // UnableToDestroySubscriptionFault type
  354. type UnableToDestroySubscriptionFault UnableToDestroySubscriptionFaultType
  355. // PauseFailedFault type
  356. type PauseFailedFault PauseFailedFaultType
  357. // ResumeFailedFault type
  358. type ResumeFailedFault ResumeFailedFaultType
  359. // Removed QueryExpressionType
  360. // TopicExpressionType type
  361. type TopicExpressionType struct {
  362. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 TopicExpression"`
  363. TopicKinds string `xml:",chardata"`
  364. Dialect AnyURI `xml:"http://www.onvif.org/ver10/schema Dialect,attr,omitempty"`
  365. }
  366. type Topic struct {
  367. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 Topic"`
  368. TopicKinds string `xml:",chardata"`
  369. Dialect AnyURI `xml:"http://www.onvif.org/ver10/schema Dialect,attr,omitempty"`
  370. }
  371. // FilterType type
  372. type FilterType struct {
  373. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 Filter"`
  374. TopicExpression TopicExpressionType `xml:"TopicExpression"`
  375. MessageContent QueryExpressionType `xml:"MessageContent"`
  376. }
  377. // SubscriptionPolicyType type
  378. type SubscriptionPolicyType struct {
  379. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 SubscriptionPolicy"`
  380. }
  381. type SimpleItem struct {
  382. XMLName xml.Name `xml:"http://www.onvif.org/ver10/schema SimpleItem"`
  383. Name string `xml:"Name,attr,omitempty"`
  384. Value string `xml:"Value,attr,omitempty"`
  385. }
  386. type SimpleItemSource struct {
  387. XMLName xml.Name `xml:"http://www.onvif.org/ver10/schema Source"`
  388. SimpleItem []SimpleItem `xml:"SimpleItem,omitempty"`
  389. }
  390. type SimpleItemKey struct {
  391. XMLName xml.Name `xml:"http://www.onvif.org/ver10/schema Key"`
  392. SimpleItem []SimpleItem `xml:"SimpleItem,omitempty"`
  393. }
  394. type SimpleItemData struct {
  395. XMLName xml.Name `xml:"http://www.onvif.org/ver10/schema Data"`
  396. SimpleItem []SimpleItem `xml:"SimpleItem,omitempty"`
  397. }
  398. type Message_ struct {
  399. XMLName xml.Name `xml:"http://www.onvif.org/ver10/schema Message"`
  400. UtcTime string `xml:"UtcTime,attr,omitempty"`
  401. PropertyOperation string `xml:"PropertyOperation,attr,omitempty"`
  402. Source SimpleItemSource `xml:"Source,omitempty"`
  403. Key SimpleItemKey `xml:"Key,omitempty"`
  404. Data SimpleItemData `xml:"Data,omitempty"`
  405. }
  406. type Message struct {
  407. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 Message"`
  408. Message Message_ `xml:"Message,omitempty"`
  409. }
  410. type InnerXml struct {
  411. Value string `xml:",innerxml"`
  412. }
  413. // NotificationMessageHolderType type
  414. type NotificationMessageHolderType struct {
  415. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 NotificationMessage"`
  416. SubscriptionReference SubscriptionReference `xml:"SubscriptionReference,omitempty"`
  417. Topic Topic `xml:"Topic,omitempty"`
  418. ProducerReference ProducerReference `xml:"ProducerReference,omitempty"`
  419. //Message InnerXml `xml:"Message,omitempty"`
  420. Message Message `xml:"Message,omitempty"`
  421. }
  422. // SubscribeCreationFailedFaultType type
  423. type SubscribeCreationFailedFaultType struct {
  424. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 SubscribeCreationFailedFault"`
  425. *BaseFaultType
  426. }
  427. // InvalidFilterFaultType type
  428. type InvalidFilterFaultType struct {
  429. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 InvalidFilterFault"`
  430. *BaseFaultType
  431. UnknownFilter []QName `xml:"http://www.onvif.org/ver10/schema UnknownFilter,omitempty"`
  432. }
  433. // TopicExpressionDialectUnknownFaultType type
  434. type TopicExpressionDialectUnknownFaultType struct {
  435. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 TopicExpressionDialectUnknownFault"`
  436. *BaseFaultType
  437. }
  438. // InvalidTopicExpressionFaultType type
  439. type InvalidTopicExpressionFaultType struct {
  440. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 InvalidTopicExpressionFault"`
  441. *BaseFaultType
  442. }
  443. // TopicNotSupportedFaultType type
  444. type TopicNotSupportedFaultType struct {
  445. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 TopicNotSupportedFault"`
  446. *BaseFaultType
  447. }
  448. // MultipleTopicsSpecifiedFaultType type
  449. type MultipleTopicsSpecifiedFaultType struct {
  450. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 MultipleTopicsSpecifiedFault"`
  451. *BaseFaultType
  452. }
  453. // InvalidProducerPropertiesExpressionFaultType type
  454. type InvalidProducerPropertiesExpressionFaultType struct {
  455. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 InvalidProducerPropertiesExpressionFault"`
  456. *BaseFaultType
  457. }
  458. // InvalidMessageContentExpressionFaultType type
  459. type InvalidMessageContentExpressionFaultType struct {
  460. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 InvalidMessageContentExpressionFault"`
  461. *BaseFaultType
  462. }
  463. // UnrecognizedPolicyRequestFaultType type
  464. type UnrecognizedPolicyRequestFaultType struct {
  465. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 UnrecognizedPolicyRequestFault"`
  466. *BaseFaultType
  467. UnrecognizedPolicy []QName `xml:"http://www.onvif.org/ver10/schema UnrecognizedPolicy,omitempty"`
  468. }
  469. // UnsupportedPolicyRequestFaultType type
  470. type UnsupportedPolicyRequestFaultType struct {
  471. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 UnsupportedPolicyRequestFault"`
  472. *BaseFaultType
  473. UnsupportedPolicy []QName `xml:"http://www.onvif.org/ver10/schema UnsupportedPolicy,omitempty"`
  474. }
  475. // NotifyMessageNotSupportedFaultType type
  476. type NotifyMessageNotSupportedFaultType struct {
  477. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 NotifyMessageNotSupportedFault"`
  478. *BaseFaultType
  479. }
  480. // UnacceptableInitialTerminationTimeFaultType type
  481. type UnacceptableInitialTerminationTimeFaultType struct {
  482. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 UnacceptableInitialTerminationTimeFault"`
  483. *BaseFaultType
  484. MinimumTime string `xml:"http://www.onvif.org/ver10/schema MinimumTime,omitempty"`
  485. MaximumTime string `xml:"http://www.onvif.org/ver10/schema MaximumTime,omitempty"`
  486. }
  487. // NoCurrentMessageOnTopicFaultType type
  488. type NoCurrentMessageOnTopicFaultType struct {
  489. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 NoCurrentMessageOnTopicFault"`
  490. *BaseFaultType
  491. }
  492. // UnableToGetMessagesFaultType type
  493. type UnableToGetMessagesFaultType struct {
  494. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 UnableToGetMessagesFault"`
  495. *BaseFaultType
  496. }
  497. // UnableToDestroyPullPointFaultType type
  498. type UnableToDestroyPullPointFaultType struct {
  499. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 UnableToDestroyPullPointFault"`
  500. *BaseFaultType
  501. }
  502. // UnableToCreatePullPointFaultType type
  503. type UnableToCreatePullPointFaultType struct {
  504. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 UnableToCreatePullPointFault"`
  505. *BaseFaultType
  506. }
  507. // UnacceptableTerminationTimeFaultType type
  508. type UnacceptableTerminationTimeFaultType struct {
  509. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 UnacceptableTerminationTimeFault"`
  510. *BaseFaultType
  511. MinimumTime string `xml:"http://www.onvif.org/ver10/schema MinimumTime,omitempty"`
  512. MaximumTime string `xml:"http://www.onvif.org/ver10/schema MaximumTime,omitempty"`
  513. }
  514. // UnableToDestroySubscriptionFaultType type
  515. type UnableToDestroySubscriptionFaultType struct {
  516. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 UnableToDestroySubscriptionFault"`
  517. *BaseFaultType
  518. }
  519. // PauseFailedFaultType type
  520. type PauseFailedFaultType struct {
  521. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 PauseFailedFault"`
  522. *BaseFaultType
  523. }
  524. // ResumeFailedFaultType type
  525. type ResumeFailedFaultType struct {
  526. XMLName xml.Name `xml:"http://docs.oasis-open.org/wsn/b-2 ResumeFailedFault"`
  527. *BaseFaultType
  528. }
  529. // EventPortType type
  530. type EventPortType interface {
  531. /* Returns the capabilities of the event service. The result is returned in a typed answer. */
  532. GetServiceCapabilities(request *GetServiceCapabilities) (*GetServiceCapabilitiesResponse, error)
  533. GetServiceCapabilitiesContext(ctx context.Context, request *GetServiceCapabilities) (*GetServiceCapabilitiesResponse, error)
  534. // Error can be either of the following types:
  535. //
  536. // - ResourceUnknownFault
  537. // - InvalidFilterFault
  538. // - TopicExpressionDialectUnknownFault
  539. // - InvalidTopicExpressionFault
  540. // - TopicNotSupportedFault
  541. // - InvalidProducerPropertiesExpressionFault
  542. // - InvalidMessageContentExpressionFault
  543. // - UnacceptableInitialTerminationTimeFault
  544. // - UnrecognizedPolicyRequestFault
  545. // - UnsupportedPolicyRequestFault
  546. // - NotifyMessageNotSupportedFault
  547. // - SubscribeCreationFailedFault
  548. /* This method returns a PullPointSubscription that can be polled using PullMessages.
  549. This message contains the same elements as the SubscriptionRequest of the WS-BaseNotification without the ConsumerReference.
  550. If no Filter is specified the pullpoint notifies all occurring events to the client.
  551. This method is mandatory. */
  552. CreatePullPointSubscription(request *CreatePullPointSubscription) (*CreatePullPointSubscriptionResponse, error)
  553. CreatePullPointSubscriptionContext(ctx context.Context, request *CreatePullPointSubscription) (*CreatePullPointSubscriptionResponse, error)
  554. /* The WS-BaseNotification specification defines a set of OPTIONAL WS-ResouceProperties.
  555. This specification does not require the implementation of the WS-ResourceProperty interface.
  556. Instead, the subsequent direct interface shall be implemented by an ONVIF compliant device
  557. in order to provide information about the FilterDialects, Schema files and topics supported by
  558. the device. */
  559. GetEventProperties(request *GetEventProperties) (*GetEventPropertiesResponse, error)
  560. GetEventPropertiesContext(ctx context.Context, request *GetEventProperties) (*GetEventPropertiesResponse, error)
  561. }
  562. // eventPortType type
  563. type eventPortType struct {
  564. client *soap.Client
  565. xaddr string
  566. }
  567. func NewEventPortType(client *soap.Client, xaddr string) EventPortType {
  568. return &eventPortType{
  569. client: client,
  570. xaddr: xaddr,
  571. }
  572. }
  573. func (service *eventPortType) GetServiceCapabilitiesContext(ctx context.Context, request *GetServiceCapabilities) (*GetServiceCapabilitiesResponse, error) {
  574. response := new(GetServiceCapabilitiesResponse)
  575. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/events/wsdl/GetServiceCapabilities", request, response)
  576. if err != nil {
  577. return nil, err
  578. }
  579. return response, nil
  580. }
  581. func (service *eventPortType) GetServiceCapabilities(request *GetServiceCapabilities) (*GetServiceCapabilitiesResponse, error) {
  582. return service.GetServiceCapabilitiesContext(
  583. context.Background(),
  584. request,
  585. )
  586. }
  587. func (service *eventPortType) CreatePullPointSubscriptionContext(ctx context.Context, request *CreatePullPointSubscription) (*CreatePullPointSubscriptionResponse, error) {
  588. response := new(CreatePullPointSubscriptionResponse)
  589. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/events/wsdl/CreatePullPointSubscription", request, response)
  590. if err != nil {
  591. return nil, err
  592. }
  593. return response, nil
  594. }
  595. func (service *eventPortType) CreatePullPointSubscription(request *CreatePullPointSubscription) (*CreatePullPointSubscriptionResponse, error) {
  596. return service.CreatePullPointSubscriptionContext(
  597. context.Background(),
  598. request,
  599. )
  600. }
  601. func (service *eventPortType) GetEventPropertiesContext(ctx context.Context, request *GetEventProperties) (*GetEventPropertiesResponse, error) {
  602. response := new(GetEventPropertiesResponse)
  603. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/events/wsdl/GetEventProperties", request, response)
  604. if err != nil {
  605. return nil, err
  606. }
  607. return response, nil
  608. }
  609. func (service *eventPortType) GetEventProperties(request *GetEventProperties) (*GetEventPropertiesResponse, error) {
  610. return service.GetEventPropertiesContext(
  611. context.Background(),
  612. request,
  613. )
  614. }
  615. // PullPointSubscription type
  616. type PullPointSubscription interface {
  617. // Error can be either of the following types:
  618. //
  619. // - PullMessagesFaultResponse
  620. /*
  621. This method pulls one or more messages from a PullPoint.
  622. The device shall provide the following PullMessages command for all SubscriptionManager
  623. endpoints returned by the CreatePullPointSubscription command. This method shall not wait until
  624. the requested number of messages is available but return as soon as at least one message is available.
  625. The command shall at least support a Timeout of one minute. In case a device supports retrieval of less messages
  626. than requested it shall return these without generating a fault. */
  627. PullMessages(request *PullMessages) (*PullMessagesResponse, error)
  628. PullMessagesContext(ctx context.Context, request *PullMessages) (*PullMessagesResponse, error)
  629. /*
  630. This method readjusts the pull pointer into the past.
  631. A device supporting persistent notification storage shall provide the
  632. following Seek command for all SubscriptionManager endpoints returned by
  633. the CreatePullPointSubscription command. The optional Reverse argument can
  634. be used to reverse the pull direction of the PullMessages command.
  635. The UtcTime argument will be matched against the UtcTime attribute on a
  636. NotificationMessage.
  637. */
  638. Seek(request *Seek) (*SeekResponse, error)
  639. SeekContext(ctx context.Context, request *Seek) (*SeekResponse, error)
  640. /* Properties inform a client about property creation, changes and
  641. deletion in a uniform way. When a client wants to synchronize its properties with the
  642. properties of the device, it can request a synchronization point which repeats the current
  643. status of all properties to which a client has subscribed. The PropertyOperation of all
  644. produced notifications is set to “Initialized”. The Synchronization Point is
  645. requested directly from the SubscriptionManager which was returned in either the
  646. SubscriptionResponse or in the CreatePullPointSubscriptionResponse. The property update is
  647. transmitted via the notification transportation of the notification interface. This method is mandatory.
  648. */
  649. SetSynchronizationPoint(request *SetSynchronizationPoint) (*SetSynchronizationPointResponse, error)
  650. SetSynchronizationPointContext(ctx context.Context, request *SetSynchronizationPoint) (*SetSynchronizationPointResponse, error)
  651. // Error can be either of the following types:
  652. //
  653. // - ResourceUnknownFault
  654. // - UnableToDestroySubscriptionFault
  655. /* The device shall provide the following Unsubscribe command for all SubscriptionManager endpoints returned by the CreatePullPointSubscription command.
  656. This command shall terminate the lifetime of a pull point.
  657. */
  658. Unsubscribe() error
  659. UnsubscribeContext(ctx context.Context) error
  660. }
  661. // pullPointSubscription type
  662. type pullPointSubscription struct {
  663. client *soap.Client
  664. xaddr string
  665. }
  666. func NewPullPointSubscription(client *soap.Client, xaddr string) PullPointSubscription {
  667. return &pullPointSubscription{
  668. client: client,
  669. xaddr: xaddr,
  670. }
  671. }
  672. func (service *pullPointSubscription) PullMessagesContext(ctx context.Context, request *PullMessages) (*PullMessagesResponse, error) {
  673. response := new(PullMessagesResponse)
  674. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/events/wsdl/PullMessages", request, response)
  675. if err != nil {
  676. return nil, err
  677. }
  678. return response, nil
  679. }
  680. func (service *pullPointSubscription) PullMessages(request *PullMessages) (*PullMessagesResponse, error) {
  681. return service.PullMessagesContext(
  682. context.Background(),
  683. request,
  684. )
  685. }
  686. func (service *pullPointSubscription) SeekContext(ctx context.Context, request *Seek) (*SeekResponse, error) {
  687. response := new(SeekResponse)
  688. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/events/wsdl/Seek", request, response)
  689. if err != nil {
  690. return nil, err
  691. }
  692. return response, nil
  693. }
  694. func (service *pullPointSubscription) Seek(request *Seek) (*SeekResponse, error) {
  695. return service.SeekContext(
  696. context.Background(),
  697. request,
  698. )
  699. }
  700. func (service *pullPointSubscription) SetSynchronizationPointContext(ctx context.Context, request *SetSynchronizationPoint) (*SetSynchronizationPointResponse, error) {
  701. response := new(SetSynchronizationPointResponse)
  702. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/events/wsdl/SetSynchronizationPoint", request, response)
  703. if err != nil {
  704. return nil, err
  705. }
  706. return response, nil
  707. }
  708. func (service *pullPointSubscription) SetSynchronizationPoint(request *SetSynchronizationPoint) (*SetSynchronizationPointResponse, error) {
  709. return service.SetSynchronizationPointContext(
  710. context.Background(),
  711. request,
  712. )
  713. }
  714. func (service *pullPointSubscription) UnsubscribeContext(ctx context.Context) error {
  715. err := service.client.CallContext(ctx, service.xaddr, "''", nil, struct{}{})
  716. if err != nil {
  717. return err
  718. }
  719. return nil
  720. }
  721. func (service *pullPointSubscription) Unsubscribe() error {
  722. return service.UnsubscribeContext(
  723. context.Background(),
  724. )
  725. }
  726. // AnyURI type
  727. type AnyURI string
  728. // Duration type
  729. type Duration string
  730. // QName type
  731. type QName string
  732. // NCName type
  733. type NCName string