accesscontrol.go 47 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333
  1. package accesscontrol
  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. //
  12. // The Decision enumeration represents a choice of two available options for an access request:
  13. //
  14. // Decision type
  15. type Decision string
  16. const (
  17. // The decision is to grant access.
  18. // DecisionGranted const
  19. DecisionGranted Decision = "Granted"
  20. // The decision is to deny access.
  21. // DecisionDenied const
  22. DecisionDenied Decision = "Denied"
  23. )
  24. //
  25. // Non-normative enum that describes the various reasons for denying access.
  26. // The following strings shall be used for the reason field:
  27. //
  28. // DenyReason type
  29. type DenyReason string
  30. const (
  31. // The device shall provide the following event, whenever a valid credential
  32. // is not enabled or has been disabled (e.g., due to credential being lost etc.) to prevent
  33. // unauthorized entry.
  34. //
  35. // DenyReasonCredentialNotEnabled const
  36. DenyReasonCredentialNotEnabled DenyReason = "CredentialNotEnabled"
  37. // The device shall provide the following event, whenever a valid credential
  38. // is presented though it is not active yet;: e.g, the credential was presented before the
  39. // start date.
  40. //
  41. // DenyReasonCredentialNotActive const
  42. DenyReasonCredentialNotActive DenyReason = "CredentialNotActive"
  43. // The device shall provide the following event, whenever a valid credential
  44. // was presented after its expiry date.
  45. //
  46. // DenyReasonCredentialExpired const
  47. DenyReasonCredentialExpired DenyReason = "CredentialExpired"
  48. // The device shall provide the following event, whenever an entered PIN code
  49. // does not match the credential.
  50. //
  51. // DenyReasonInvalidPIN const
  52. DenyReasonInvalidPIN DenyReason = "InvalidPIN"
  53. // The device shall provide the following event, whenever a valid credential
  54. // is denied access to the requested AccessPoint because the credential is not permitted at
  55. // the moment.
  56. //
  57. // DenyReasonNotPermittedAtThisTime const
  58. DenyReasonNotPermittedAtThisTime DenyReason = "NotPermittedAtThisTime"
  59. // The device shall provide the following event, whenever the presented
  60. // credential is not authorized.
  61. //
  62. // DenyReasonUnauthorized const
  63. DenyReasonUnauthorized DenyReason = "Unauthorized"
  64. // The device shall provide the following event, whenever the request is
  65. // denied and no other specific event matches it or is supported by the service.
  66. //
  67. // DenyReasonOther const
  68. DenyReasonOther DenyReason = "Other"
  69. )
  70. // GetServiceCapabilities type
  71. type GetServiceCapabilities struct {
  72. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl GetServiceCapabilities"`
  73. }
  74. // GetServiceCapabilitiesResponse type
  75. type GetServiceCapabilitiesResponse struct {
  76. XMLName xml.Name `xml:"GetServiceCapabilitiesResponse"`
  77. // The capability response message contains the requested Access Control
  78. // service capabilities using a hierarchical XML capability structure.
  79. //
  80. Capabilities ServiceCapabilities `xml:"Capabilities,omitempty"`
  81. }
  82. // GetAccessPointInfoList type
  83. type GetAccessPointInfoList struct {
  84. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl GetAccessPointInfoList"`
  85. // Maximum number of entries to return. If not specified, less than one
  86. // or higher than what the device supports, the number of items is determined by the
  87. // device.
  88. //
  89. Limit int32 `xml:"http://www.onvif.org/ver10/schema Limit,omitempty"`
  90. // Start returning entries from this start reference. If not specified,
  91. // entries shall start from the beginning of the dataset.
  92. //
  93. StartReference string `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl StartReference,omitempty"`
  94. }
  95. // GetAccessPointInfoListResponse type
  96. type GetAccessPointInfoListResponse struct {
  97. XMLName xml.Name `xml:"GetAccessPointInfoListResponse"`
  98. // StartReference to use in next call to get the following items. If
  99. // absent, no more items to get.
  100. //
  101. NextStartReference string `xml:"NextStartReference,omitempty"`
  102. // List of AccessPointInfo items.
  103. AccessPointInfo []AccessPointInfo `xml:"AccessPointInfo,omitempty"`
  104. }
  105. // GetAccessPointInfo type
  106. type GetAccessPointInfo struct {
  107. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl GetAccessPointInfo"`
  108. // Tokens of AccessPointInfo items to get.
  109. Token []ReferenceToken `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Token,omitempty"`
  110. }
  111. // GetAccessPointInfoResponse type
  112. type GetAccessPointInfoResponse struct {
  113. XMLName xml.Name `xml:"GetAccessPointInfoResponse"`
  114. // List of AccessPointInfo items.
  115. AccessPointInfo []AccessPointInfo `xml:"AccessPointInfo,omitempty"`
  116. }
  117. // GetAccessPointList type
  118. type GetAccessPointList struct {
  119. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl GetAccessPointList"`
  120. // Maximum number of entries to return. If not specified, less than one
  121. // or higher than what the device supports, the number of items is determined by the
  122. // device.
  123. //
  124. Limit int32 `xml:"http://www.onvif.org/ver10/schema Limit,omitempty"`
  125. // Start returning entries from this start reference. If not specified,
  126. // entries shall start from the beginning of the dataset.
  127. //
  128. StartReference string `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl StartReference,omitempty"`
  129. }
  130. // GetAccessPointListResponse type
  131. type GetAccessPointListResponse struct {
  132. XMLName xml.Name `xml:"GetAccessPointListResponse"`
  133. // StartReference to use in next call to get the following items. If
  134. // absent, no more items to get.
  135. //
  136. NextStartReference string `xml:"NextStartReference,omitempty"`
  137. // List of AccessPoint items.
  138. AccessPoint []AccessPoint `xml:"AccessPoint,omitempty"`
  139. }
  140. // GetAccessPoints type
  141. type GetAccessPoints struct {
  142. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl GetAccessPoints"`
  143. // Tokens of AccessPoint items to get.
  144. Token []ReferenceToken `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Token,omitempty"`
  145. }
  146. // GetAccessPointsResponse type
  147. type GetAccessPointsResponse struct {
  148. XMLName xml.Name `xml:"GetAccessPointsResponse"`
  149. // List of AccessPoint items.
  150. AccessPoint []AccessPoint `xml:"AccessPoint,omitempty"`
  151. }
  152. // CreateAccessPoint type
  153. type CreateAccessPoint struct {
  154. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl CreateAccessPoint"`
  155. // AccessPoint item to create
  156. AccessPoint AccessPoint `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl AccessPoint,omitempty"`
  157. }
  158. // CreateAccessPointResponse type
  159. type CreateAccessPointResponse struct {
  160. XMLName xml.Name `xml:"CreateAccessPointResponse"`
  161. // Token of created AccessPoint item
  162. Token ReferenceToken `xml:"Token,omitempty"`
  163. }
  164. // SetAccessPoint type
  165. type SetAccessPoint struct {
  166. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl SetAccessPoint"`
  167. // AccessPoint item to create or modify
  168. AccessPoint AccessPoint `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl AccessPoint,omitempty"`
  169. }
  170. // SetAccessPointResponse type
  171. type SetAccessPointResponse struct {
  172. XMLName xml.Name `xml:"SetAccessPointResponse"`
  173. }
  174. // ModifyAccessPoint type
  175. type ModifyAccessPoint struct {
  176. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl ModifyAccessPoint"`
  177. // AccessPoint item to modify
  178. AccessPoint AccessPoint `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl AccessPoint,omitempty"`
  179. }
  180. // ModifyAccessPointResponse type
  181. type ModifyAccessPointResponse struct {
  182. XMLName xml.Name `xml:"ModifyAccessPointResponse"`
  183. }
  184. // DeleteAccessPoint type
  185. type DeleteAccessPoint struct {
  186. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl DeleteAccessPoint"`
  187. // Token of AccessPoint item to delete.
  188. Token ReferenceToken `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Token,omitempty"`
  189. }
  190. // DeleteAccessPointResponse type
  191. type DeleteAccessPointResponse struct {
  192. XMLName xml.Name `xml:"DeleteAccessPointResponse"`
  193. }
  194. // SetAccessPointAuthenticationProfile type
  195. type SetAccessPointAuthenticationProfile struct {
  196. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl SetAccessPointAuthenticationProfile"`
  197. // Token of the AccessPoint.
  198. Token ReferenceToken `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Token,omitempty"`
  199. // Token of the AuthenticationProfile.
  200. AuthenticationProfileToken ReferenceToken `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl AuthenticationProfileToken,omitempty"`
  201. }
  202. // SetAccessPointAuthenticationProfileResponse type
  203. type SetAccessPointAuthenticationProfileResponse struct {
  204. XMLName xml.Name `xml:"SetAccessPointAuthenticationProfileResponse"`
  205. }
  206. // DeleteAccessPointAuthenticationProfile type
  207. type DeleteAccessPointAuthenticationProfile struct {
  208. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl DeleteAccessPointAuthenticationProfile"`
  209. // Token of the AccessPoint.
  210. Token ReferenceToken `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Token,omitempty"`
  211. }
  212. // DeleteAccessPointAuthenticationProfileResponse type
  213. type DeleteAccessPointAuthenticationProfileResponse struct {
  214. XMLName xml.Name `xml:"DeleteAccessPointAuthenticationProfileResponse"`
  215. }
  216. // GetAreaInfoList type
  217. type GetAreaInfoList struct {
  218. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl GetAreaInfoList"`
  219. // Maximum number of entries to return. If not specified, less than one
  220. // or higher than what the device supports, the number of items is determined by the
  221. // device.
  222. //
  223. Limit int32 `xml:"http://www.onvif.org/ver10/schema Limit,omitempty"`
  224. // Start returning entries from this start reference. If not specified,
  225. // entries shall start from the beginning of the dataset.
  226. //
  227. StartReference string `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl StartReference,omitempty"`
  228. }
  229. // GetAreaInfoListResponse type
  230. type GetAreaInfoListResponse struct {
  231. XMLName xml.Name `xml:"GetAreaInfoListResponse"`
  232. // StartReference to use in next call to get the following items. If
  233. // absent, no more items to get.
  234. //
  235. NextStartReference string `xml:"NextStartReference,omitempty"`
  236. // List of AreaInfo items.
  237. AreaInfo []AreaInfo `xml:"AreaInfo,omitempty"`
  238. }
  239. // GetAreaInfo type
  240. type GetAreaInfo struct {
  241. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl GetAreaInfo"`
  242. // Tokens of AreaInfo items to get.
  243. Token []ReferenceToken `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Token,omitempty"`
  244. }
  245. // GetAreaInfoResponse type
  246. type GetAreaInfoResponse struct {
  247. XMLName xml.Name `xml:"GetAreaInfoResponse"`
  248. // List of AreaInfo items.
  249. AreaInfo []AreaInfo `xml:"AreaInfo,omitempty"`
  250. }
  251. // GetAreaList type
  252. type GetAreaList struct {
  253. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl GetAreaList"`
  254. // Maximum number of entries to return. If not specified, less than one
  255. // or higher than what the device supports, the number of items is determined by the
  256. // device.
  257. //
  258. Limit int32 `xml:"http://www.onvif.org/ver10/schema Limit,omitempty"`
  259. // Start returning entries from this start reference. If not specified,
  260. // entries shall start from the beginning of the dataset.
  261. //
  262. StartReference string `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl StartReference,omitempty"`
  263. }
  264. // GetAreaListResponse type
  265. type GetAreaListResponse struct {
  266. XMLName xml.Name `xml:"GetAreaListResponse"`
  267. // StartReference to use in next call to get the following items. If
  268. // absent, no more items to get.
  269. //
  270. NextStartReference string `xml:"NextStartReference,omitempty"`
  271. // List of Area items.
  272. Area []Area `xml:"Area,omitempty"`
  273. }
  274. // GetAreas type
  275. type GetAreas struct {
  276. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl GetAreas"`
  277. // Tokens of Area items to get.
  278. Token []ReferenceToken `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Token,omitempty"`
  279. }
  280. // GetAreasResponse type
  281. type GetAreasResponse struct {
  282. XMLName xml.Name `xml:"GetAreasResponse"`
  283. // List of Area items.
  284. Area []Area `xml:"Area,omitempty"`
  285. }
  286. // CreateArea type
  287. type CreateArea struct {
  288. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl CreateArea"`
  289. // Area item to create
  290. Area Area `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Area,omitempty"`
  291. }
  292. // CreateAreaResponse type
  293. type CreateAreaResponse struct {
  294. XMLName xml.Name `xml:"CreateAreaResponse"`
  295. // Token of created Area item
  296. Token ReferenceToken `xml:"Token,omitempty"`
  297. }
  298. // SetArea type
  299. type SetArea struct {
  300. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl SetArea"`
  301. // Area item to create or modify
  302. Area Area `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Area,omitempty"`
  303. }
  304. // SetAreaResponse type
  305. type SetAreaResponse struct {
  306. XMLName xml.Name `xml:"SetAreaResponse"`
  307. }
  308. // ModifyArea type
  309. type ModifyArea struct {
  310. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl ModifyArea"`
  311. // Area item to modify
  312. Area Area `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Area,omitempty"`
  313. }
  314. // ModifyAreaResponse type
  315. type ModifyAreaResponse struct {
  316. XMLName xml.Name `xml:"ModifyAreaResponse"`
  317. }
  318. // DeleteArea type
  319. type DeleteArea struct {
  320. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl DeleteArea"`
  321. // Token of Area item to delete.
  322. Token ReferenceToken `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Token,omitempty"`
  323. }
  324. // DeleteAreaResponse type
  325. type DeleteAreaResponse struct {
  326. XMLName xml.Name `xml:"DeleteAreaResponse"`
  327. }
  328. // GetAccessPointState type
  329. type GetAccessPointState struct {
  330. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl GetAccessPointState"`
  331. // Token of AccessPoint instance to get AccessPointState for.
  332. //
  333. Token ReferenceToken `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Token,omitempty"`
  334. }
  335. // GetAccessPointStateResponse type
  336. type GetAccessPointStateResponse struct {
  337. XMLName xml.Name `xml:"GetAccessPointStateResponse"`
  338. // AccessPointState item.
  339. AccessPointState AccessPointState `xml:"AccessPointState,omitempty"`
  340. }
  341. // EnableAccessPoint type
  342. type EnableAccessPoint struct {
  343. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl EnableAccessPoint"`
  344. // Token of the AccessPoint instance to enable.
  345. Token ReferenceToken `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Token,omitempty"`
  346. }
  347. // EnableAccessPointResponse type
  348. type EnableAccessPointResponse struct {
  349. XMLName xml.Name `xml:"EnableAccessPointResponse"`
  350. }
  351. // DisableAccessPoint type
  352. type DisableAccessPoint struct {
  353. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl DisableAccessPoint"`
  354. // Token of the AccessPoint instance to disable.
  355. Token ReferenceToken `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Token,omitempty"`
  356. }
  357. // DisableAccessPointResponse type
  358. type DisableAccessPointResponse struct {
  359. XMLName xml.Name `xml:"DisableAccessPointResponse"`
  360. }
  361. // ExternalAuthorization type
  362. type ExternalAuthorization struct {
  363. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl ExternalAuthorization"`
  364. // Token of the Access Point instance.
  365. AccessPointToken ReferenceToken `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl AccessPointToken,omitempty"`
  366. // Optional token of the Credential involved.
  367. CredentialToken ReferenceToken `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl CredentialToken,omitempty"`
  368. // Optional reason for decision.
  369. Reason string `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Reason,omitempty"`
  370. // Decision - Granted or Denied.
  371. Decision Decision `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Decision,omitempty"`
  372. }
  373. // ExternalAuthorizationResponse type
  374. type ExternalAuthorizationResponse struct {
  375. XMLName xml.Name `xml:"ExternalAuthorizationResponse"`
  376. }
  377. // ServiceCapabilities type
  378. type ServiceCapabilities struct {
  379. XMLName xml.Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Capabilities"`
  380. // The maximum number of entries returned by a single Get<Entity>List or
  381. // Get<Entity> request.
  382. // The device shall never return more than this number of entities in a single response.
  383. //
  384. MaxLimit uint32 `xml:"http://www.onvif.org/ver10/schema MaxLimit,attr,omitempty"`
  385. //
  386. // Indicates the maximum number of access points supported by the device.
  387. //
  388. MaxAccessPoints uint32 `xml:"http://www.onvif.org/ver10/schema MaxAccessPoints,attr,omitempty"`
  389. //
  390. // Indicates the maximum number of areas supported by the device.
  391. //
  392. MaxAreas uint32 `xml:"http://www.onvif.org/ver10/schema MaxAreas,attr,omitempty"`
  393. //
  394. // Indicates that the client is allowed to supply the token when creating access
  395. // points and areas.
  396. // To enable the use of the commands SetAccessPoint and SetArea, the value must be set to true.
  397. //
  398. ClientSuppliedTokenSupported bool `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl ClientSuppliedTokenSupported,attr,omitempty"`
  399. }
  400. // AccessPointInfoBase type
  401. type AccessPointInfoBase struct {
  402. *DataEntity
  403. // A user readable name. It shall be up to 64 characters.
  404. //
  405. Name Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Name,omitempty"`
  406. // Optional user readable description for the AccessPoint. It shall
  407. // be up to 1024 characters.
  408. //
  409. Description Description `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Description,omitempty"`
  410. // Optional reference to the Area from which access is requested.
  411. //
  412. AreaFrom ReferenceToken `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl AreaFrom,omitempty"`
  413. // Optional reference to the Area to which access is requested.
  414. //
  415. AreaTo ReferenceToken `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl AreaTo,omitempty"`
  416. //
  417. // Optional entity type; if missing, a Door type as defined by [ONVIF Door Control
  418. // Service Specification] should be assumed. This can also be represented by the
  419. // QName value "tdc:Door" – where tdc is the namespace of the door control service:
  420. // "http://www.onvif.org/ver10/doorcontrol/wsdl". This field is provided for future
  421. // extensions; it will allow an access point being extended to cover entity types
  422. // other than doors as well.
  423. //
  424. EntityType QName `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl EntityType,omitempty"`
  425. // Reference to the entity used to control access; the entity type
  426. // may be specified by the optional EntityType field explained below but is
  427. // typically a Door.
  428. //
  429. Entity ReferenceToken `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Entity,omitempty"`
  430. }
  431. // AccessPointInfo type
  432. type AccessPointInfo struct {
  433. *AccessPointInfoBase
  434. // The capabilities for the AccessPoint.
  435. Capabilities AccessPointCapabilities `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Capabilities,omitempty"`
  436. }
  437. // AccessPoint type
  438. type AccessPoint struct {
  439. *AccessPointInfo
  440. //
  441. // A reference to an authentication profile which defines the authentication
  442. // behavior of the access point.
  443. //
  444. AuthenticationProfileToken ReferenceToken `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl AuthenticationProfileToken,omitempty"`
  445. Extension AccessPointExtension `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Extension,omitempty"`
  446. }
  447. // AccessPointExtension type
  448. type AccessPointExtension struct {
  449. }
  450. // AccessPointCapabilities type
  451. type AccessPointCapabilities struct {
  452. // A list of security level tokens that this access point supports.
  453. // See [Authentication Behavior Service Specification].
  454. //
  455. SupportedSecurityLevels []ReferenceToken `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl SupportedSecurityLevels,omitempty"`
  456. Extension SupportedSecurityLevelsExtension `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Extension,omitempty"`
  457. //
  458. // Indicates whether or not this AccessPoint instance supports EnableAccessPoint
  459. // and DisableAccessPoint commands.
  460. //
  461. DisableAccessPoint bool `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl DisableAccessPoint,attr,omitempty"`
  462. //
  463. // Indicates whether or not this AccessPoint instance supports generation of duress events.
  464. //
  465. Duress bool `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Duress,attr,omitempty"`
  466. //
  467. // Indicates whether or not this AccessPoint has a REX switch or other input that
  468. // allows anonymous access.
  469. //
  470. AnonymousAccess bool `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl AnonymousAccess,attr,omitempty"`
  471. //
  472. // Indicates whether or not this AccessPoint instance supports generation of
  473. // AccessTaken and AccessNotTaken events. If AnonymousAccess and AccessTaken are both true, it
  474. // indicates that the Anonymous versions of AccessTaken and AccessNotTaken are supported.
  475. //
  476. AccessTaken bool `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl AccessTaken,attr,omitempty"`
  477. //
  478. // Indicates whether or not this AccessPoint instance supports the
  479. // ExternalAuthorization operation and the generation of Request events. If AnonymousAccess and
  480. // ExternalAuthorization are both true, it indicates that the Anonymous version is supported as
  481. // well.
  482. //
  483. ExternalAuthorization bool `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl ExternalAuthorization,attr,omitempty"`
  484. }
  485. // SupportedSecurityLevelsExtension type
  486. type SupportedSecurityLevelsExtension struct {
  487. }
  488. // AreaInfoBase type
  489. type AreaInfoBase struct {
  490. *DataEntity
  491. // User readable name. It shall be up to 64 characters.
  492. //
  493. Name Name `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Name,omitempty"`
  494. // User readable description for the Area. It shall be up to 1024
  495. // characters.
  496. //
  497. Description Description `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Description,omitempty"`
  498. }
  499. // AreaInfo type
  500. type AreaInfo struct {
  501. *AreaInfoBase
  502. }
  503. // Area type
  504. type Area struct {
  505. *AreaInfo
  506. Extension AreaExtension `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Extension,omitempty"`
  507. }
  508. // AreaExtension type
  509. type AreaExtension struct {
  510. }
  511. // AccessPointState type
  512. type AccessPointState struct {
  513. // Indicates that the AccessPoint is enabled. By default this field value
  514. // shall be True, if the DisableAccessPoint capabilities is not supported.
  515. //
  516. Enabled bool `xml:"http://www.onvif.org/ver10/accesscontrol/wsdl Enabled,omitempty"`
  517. }
  518. // Type used to reference logical and physical entities.
  519. // ReferenceToken type
  520. type ReferenceToken string
  521. // Type used for names of logical and physical entities.
  522. // Name type
  523. type Name string
  524. // Description is optional and the maximum length is device specific.
  525. // If the length is more than maximum length, it is silently chopped to the maximum length
  526. // supported by the device/service (which may be 0).
  527. //
  528. // Description type
  529. type Description string
  530. // Type used to represent the numbers from 1 ,2 , 3,...
  531. // DataEntity type
  532. type DataEntity struct {
  533. // A service-unique identifier of the item.
  534. Token ReferenceToken `xml:"token,attr,omitempty"`
  535. }
  536. // PACSPort type
  537. type PACSPort interface {
  538. /*
  539. This operation returns the capabilities of the access control service.
  540. A device which provides the access control service shall implement this method.
  541. */
  542. GetServiceCapabilities(request *GetServiceCapabilities) (*GetServiceCapabilitiesResponse, error)
  543. GetServiceCapabilitiesContext(ctx context.Context, request *GetServiceCapabilities) (*GetServiceCapabilitiesResponse, error)
  544. /*
  545. This operation requests a list of AccessPointInfo items matching the given tokens.
  546. The device shall ignore tokens it cannot resolve and shall return an empty list if
  547. there are no items matching the specified tokens.
  548. The device shall not return a fault in this case.
  549. If the number of requested items is greater than MaxLimit, a TooManyItems fault shall be returned.
  550. */
  551. GetAccessPointInfo(request *GetAccessPointInfo) (*GetAccessPointInfoResponse, error)
  552. GetAccessPointInfoContext(ctx context.Context, request *GetAccessPointInfo) (*GetAccessPointInfoResponse, error)
  553. /*
  554. This operation requests a list of all AccessPointInfo items provided by the device.
  555. A call to this method shall return a StartReference when not all data is returned and more
  556. data is available. The reference shall be valid for retrieving the next set of data.
  557. Please refer to section 4.8.3 in [ONVIF PACS Architecture and Design Considerations] for more details.
  558. The number of items returned shall not be greater than the Limit parameter.
  559. */
  560. GetAccessPointInfoList(request *GetAccessPointInfoList) (*GetAccessPointInfoListResponse, error)
  561. GetAccessPointInfoListContext(ctx context.Context, request *GetAccessPointInfoList) (*GetAccessPointInfoListResponse, error)
  562. /*
  563. This operation requests a list of AccessPoint items matching the given tokens.
  564. The device shall ignore tokens it cannot resolve and shall return an empty list if there are
  565. no items matching the specified tokens. The device shall not return a fault in this case.
  566. If the number of requested items is greater than MaxLimit, a TooManyItems fault shall be returned.
  567. */
  568. GetAccessPoints(request *GetAccessPoints) (*GetAccessPointsResponse, error)
  569. GetAccessPointsContext(ctx context.Context, request *GetAccessPoints) (*GetAccessPointsResponse, error)
  570. /*
  571. This operation requests a list of all AccessPoint items provided by the device. A call to
  572. this method shall return a StartReference when not all data is returned and more data is available.
  573. The reference shall be valid for retrieving the next set of data.
  574. The number of items returned shall not be greater than the Limit parameter.
  575. */
  576. GetAccessPointList(request *GetAccessPointList) (*GetAccessPointListResponse, error)
  577. GetAccessPointListContext(ctx context.Context, request *GetAccessPointList) (*GetAccessPointListResponse, error)
  578. /*
  579. This operation creates the specified access point in the device. The token field of the
  580. AccessPoint structure shall be empty and the device shall allocate a token for the access point.
  581. The allocated token shall be returned in the response. If the client sends any value in the
  582. token field, the device shall return InvalidArgVal as a generic fault code.
  583. */
  584. CreateAccessPoint(request *CreateAccessPoint) (*CreateAccessPointResponse, error)
  585. CreateAccessPointContext(ctx context.Context, request *CreateAccessPoint) (*CreateAccessPointResponse, error)
  586. /*
  587. This method is used to synchronize an access point in a client with the device. If an access
  588. point with the specified token does not exist in the device, the access point is created.
  589. If an access point with the specified token exists, then the access point is modified.
  590. A call to this method takes an AccessPoint structure as input parameter.
  591. The token field of the AccessPoint structure shall not be empty.
  592. A device that signals support for the ClientSuppliedTokenSupported capability shall implement this command.
  593. If no token was specified in the request, the device shall return InvalidArgs as a generic fault code.
  594. */
  595. SetAccessPoint(request *SetAccessPoint) (*SetAccessPointResponse, error)
  596. SetAccessPointContext(ctx context.Context, request *SetAccessPoint) (*SetAccessPointResponse, error)
  597. /*
  598. This operation modifies the specified access point. The token of the access point to modify
  599. is specified in the token field of the AccessPoint structure and shall not be empty.
  600. All other fields in the structure shall overwrite the fields in the specified access point.
  601. If no token was specified in the request, the device shall return InvalidArgs as a generic fault code.
  602. */
  603. ModifyAccessPoint(request *ModifyAccessPoint) (*ModifyAccessPointResponse, error)
  604. ModifyAccessPointContext(ctx context.Context, request *ModifyAccessPoint) (*ModifyAccessPointResponse, error)
  605. /*
  606. This operation deletes the specified access point. If it is associated with one or more
  607. entities some devices may not be able to delete the access point, and consequently a
  608. ReferenceInUse fault shall be generated.
  609. If no token was specified in the request, the device shall return InvalidArgs as a generic fault code.
  610. */
  611. DeleteAccessPoint(request *DeleteAccessPoint) (*DeleteAccessPointResponse, error)
  612. DeleteAccessPointContext(ctx context.Context, request *DeleteAccessPoint) (*DeleteAccessPointResponse, error)
  613. /*
  614. This operation defines the authentication behavior for an access point.
  615. */
  616. SetAccessPointAuthenticationProfile(request *SetAccessPointAuthenticationProfile) (*SetAccessPointAuthenticationProfileResponse, error)
  617. SetAccessPointAuthenticationProfileContext(ctx context.Context, request *SetAccessPointAuthenticationProfile) (*SetAccessPointAuthenticationProfileResponse, error)
  618. /*
  619. This operation reverts the authentication behavior for an access point to its default behavior.
  620. */
  621. DeleteAccessPointAuthenticationProfile(request *DeleteAccessPointAuthenticationProfile) (*DeleteAccessPointAuthenticationProfileResponse, error)
  622. DeleteAccessPointAuthenticationProfileContext(ctx context.Context, request *DeleteAccessPointAuthenticationProfile) (*DeleteAccessPointAuthenticationProfileResponse, error)
  623. /*
  624. This operation requests a list of AreaInfo items matching the given tokens. The device shall
  625. ignore tokens it cannot resolve and shall return an empty list if there are no items
  626. matching the specified tokens. The device shall not return a fault in this case.
  627. If the number of requested items is greater than MaxLimit, a TooManyItems fault shall be returned.
  628. */
  629. GetAreaInfo(request *GetAreaInfo) (*GetAreaInfoResponse, error)
  630. GetAreaInfoContext(ctx context.Context, request *GetAreaInfo) (*GetAreaInfoResponse, error)
  631. /*
  632. This operation requests a list of all AreaInfo items provided by the device. A call to this
  633. method shall return a StartReference when not all data is returned and more data is available.
  634. The reference shall be valid for retrieving the next set of data.
  635. The number of items returned shall not be greater than the Limit parameter.
  636. */
  637. GetAreaInfoList(request *GetAreaInfoList) (*GetAreaInfoListResponse, error)
  638. GetAreaInfoListContext(ctx context.Context, request *GetAreaInfoList) (*GetAreaInfoListResponse, error)
  639. /*
  640. This operation requests a list of Area items matching the given tokens. The device shall
  641. ignore tokens it cannot resolve and shall return an empty list if there are no items
  642. matching the specified tokens. The device shall not return a fault in this case.
  643. If the number of requested items is greater than MaxLimit, a TooManyItems fault shall be returned.
  644. */
  645. GetAreas(request *GetAreas) (*GetAreasResponse, error)
  646. GetAreasContext(ctx context.Context, request *GetAreas) (*GetAreasResponse, error)
  647. /*
  648. This operation requests a list of all Area items provided by the device. A call to this
  649. method shall return a StartReference when not all data is returned and more data is available.
  650. The reference shall be valid for retrieving the next set of data.
  651. The number of items returned shall not be greater than the Limit parameter.
  652. */
  653. GetAreaList(request *GetAreaList) (*GetAreaListResponse, error)
  654. GetAreaListContext(ctx context.Context, request *GetAreaList) (*GetAreaListResponse, error)
  655. /*
  656. This operation creates the specified area in the device. The token field of the Area
  657. structure shall be empty and the device shall allocate a token for the area.
  658. The allocated token shall be returned in the response.
  659. If the client sends any value in the token field, the device shall return InvalidArgVal as a generic fault code.
  660. */
  661. CreateArea(request *CreateArea) (*CreateAreaResponse, error)
  662. CreateAreaContext(ctx context.Context, request *CreateArea) (*CreateAreaResponse, error)
  663. /*
  664. This method is used to synchronize an area in a client with the device. If an area with the
  665. specified token does not exist in the device, the area is created. If an area with the
  666. specified token exists, then the area is modified. A call to this method takes an Area
  667. structure as input parameter. The token field of the Area structure shall not be empty.
  668. A device that signals support for the ClientSuppliedTokenSupported capability shall
  669. implement this command.
  670. If no token was specified in the request, the device shall return
  671. InvalidArgs as a generic fault code.
  672. */
  673. SetArea(request *SetArea) (*SetAreaResponse, error)
  674. SetAreaContext(ctx context.Context, request *SetArea) (*SetAreaResponse, error)
  675. /*
  676. This operation modifies the specified area. The token of the area to modify is specified in
  677. the token field of the Area structure and shall not be empty. All other fields in the
  678. structure shall overwrite the fields in the specified area.
  679. If no token was specified in the request, the device shall return InvalidArgs as a generic fault code.
  680. */
  681. ModifyArea(request *ModifyArea) (*ModifyAreaResponse, error)
  682. ModifyAreaContext(ctx context.Context, request *ModifyArea) (*ModifyAreaResponse, error)
  683. /*
  684. This operation deletes the specified area. If it is associated with one or more entities
  685. some devices may not be able to delete the area, and consequently a ReferenceInUse fault shall be generated.
  686. If no token was specified in the request, the device shall return InvalidArgs as a generic fault code.
  687. */
  688. DeleteArea(request *DeleteArea) (*DeleteAreaResponse, error)
  689. DeleteAreaContext(ctx context.Context, request *DeleteArea) (*DeleteAreaResponse, error)
  690. /*
  691. This operation requests the AccessPointState for the access point instance specified by the token.
  692. */
  693. GetAccessPointState(request *GetAccessPointState) (*GetAccessPointStateResponse, error)
  694. GetAccessPointStateContext(ctx context.Context, request *GetAccessPointState) (*GetAccessPointStateResponse, error)
  695. /*
  696. This operation allows enabling an access point. A device that signals support for
  697. DisableAccessPoint capability for a particular access point instance shall implement this command.
  698. */
  699. EnableAccessPoint(request *EnableAccessPoint) (*EnableAccessPointResponse, error)
  700. EnableAccessPointContext(ctx context.Context, request *EnableAccessPoint) (*EnableAccessPointResponse, error)
  701. /*
  702. This operation allows disabling an access point. A device that signals support for the
  703. DisableAccessPoint capability for a particular access point instance shall implement this command.
  704. */
  705. DisableAccessPoint(request *DisableAccessPoint) (*DisableAccessPointResponse, error)
  706. DisableAccessPointContext(ctx context.Context, request *DisableAccessPoint) (*DisableAccessPointResponse, error)
  707. /*
  708. This operation allows to deny or grant decision at an access point instance. A device that
  709. signals support for ExternalAuthorization capability for a particular access point instance
  710. shall implement this method.
  711. */
  712. ExternalAuthorization(request *ExternalAuthorization) (*ExternalAuthorizationResponse, error)
  713. ExternalAuthorizationContext(ctx context.Context, request *ExternalAuthorization) (*ExternalAuthorizationResponse, error)
  714. }
  715. // pACSPort type
  716. type pACSPort struct {
  717. client *soap.Client
  718. xaddr string
  719. }
  720. func NewPACSPort(client *soap.Client, xaddr string) PACSPort {
  721. return &pACSPort{
  722. client: client,
  723. xaddr: xaddr,
  724. }
  725. }
  726. func (service *pACSPort) GetServiceCapabilitiesContext(ctx context.Context, request *GetServiceCapabilities) (*GetServiceCapabilitiesResponse, error) {
  727. response := new(GetServiceCapabilitiesResponse)
  728. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/GetServiceCapabilities", request, response)
  729. if err != nil {
  730. return nil, err
  731. }
  732. return response, nil
  733. }
  734. func (service *pACSPort) GetServiceCapabilities(request *GetServiceCapabilities) (*GetServiceCapabilitiesResponse, error) {
  735. return service.GetServiceCapabilitiesContext(
  736. context.Background(),
  737. request,
  738. )
  739. }
  740. func (service *pACSPort) GetAccessPointInfoContext(ctx context.Context, request *GetAccessPointInfo) (*GetAccessPointInfoResponse, error) {
  741. response := new(GetAccessPointInfoResponse)
  742. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/GetAccessPointInfo", request, response)
  743. if err != nil {
  744. return nil, err
  745. }
  746. return response, nil
  747. }
  748. func (service *pACSPort) GetAccessPointInfo(request *GetAccessPointInfo) (*GetAccessPointInfoResponse, error) {
  749. return service.GetAccessPointInfoContext(
  750. context.Background(),
  751. request,
  752. )
  753. }
  754. func (service *pACSPort) GetAccessPointInfoListContext(ctx context.Context, request *GetAccessPointInfoList) (*GetAccessPointInfoListResponse, error) {
  755. response := new(GetAccessPointInfoListResponse)
  756. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/GetAccessPointInfoList", request, response)
  757. if err != nil {
  758. return nil, err
  759. }
  760. return response, nil
  761. }
  762. func (service *pACSPort) GetAccessPointInfoList(request *GetAccessPointInfoList) (*GetAccessPointInfoListResponse, error) {
  763. return service.GetAccessPointInfoListContext(
  764. context.Background(),
  765. request,
  766. )
  767. }
  768. func (service *pACSPort) GetAccessPointsContext(ctx context.Context, request *GetAccessPoints) (*GetAccessPointsResponse, error) {
  769. response := new(GetAccessPointsResponse)
  770. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/GetAccessPoints", request, response)
  771. if err != nil {
  772. return nil, err
  773. }
  774. return response, nil
  775. }
  776. func (service *pACSPort) GetAccessPoints(request *GetAccessPoints) (*GetAccessPointsResponse, error) {
  777. return service.GetAccessPointsContext(
  778. context.Background(),
  779. request,
  780. )
  781. }
  782. func (service *pACSPort) GetAccessPointListContext(ctx context.Context, request *GetAccessPointList) (*GetAccessPointListResponse, error) {
  783. response := new(GetAccessPointListResponse)
  784. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/GetAccessPointList", request, response)
  785. if err != nil {
  786. return nil, err
  787. }
  788. return response, nil
  789. }
  790. func (service *pACSPort) GetAccessPointList(request *GetAccessPointList) (*GetAccessPointListResponse, error) {
  791. return service.GetAccessPointListContext(
  792. context.Background(),
  793. request,
  794. )
  795. }
  796. func (service *pACSPort) CreateAccessPointContext(ctx context.Context, request *CreateAccessPoint) (*CreateAccessPointResponse, error) {
  797. response := new(CreateAccessPointResponse)
  798. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/CreateAccessPoint", request, response)
  799. if err != nil {
  800. return nil, err
  801. }
  802. return response, nil
  803. }
  804. func (service *pACSPort) CreateAccessPoint(request *CreateAccessPoint) (*CreateAccessPointResponse, error) {
  805. return service.CreateAccessPointContext(
  806. context.Background(),
  807. request,
  808. )
  809. }
  810. func (service *pACSPort) SetAccessPointContext(ctx context.Context, request *SetAccessPoint) (*SetAccessPointResponse, error) {
  811. response := new(SetAccessPointResponse)
  812. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/SetAccessPoint", request, response)
  813. if err != nil {
  814. return nil, err
  815. }
  816. return response, nil
  817. }
  818. func (service *pACSPort) SetAccessPoint(request *SetAccessPoint) (*SetAccessPointResponse, error) {
  819. return service.SetAccessPointContext(
  820. context.Background(),
  821. request,
  822. )
  823. }
  824. func (service *pACSPort) ModifyAccessPointContext(ctx context.Context, request *ModifyAccessPoint) (*ModifyAccessPointResponse, error) {
  825. response := new(ModifyAccessPointResponse)
  826. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/ModifyAccessPoint", request, response)
  827. if err != nil {
  828. return nil, err
  829. }
  830. return response, nil
  831. }
  832. func (service *pACSPort) ModifyAccessPoint(request *ModifyAccessPoint) (*ModifyAccessPointResponse, error) {
  833. return service.ModifyAccessPointContext(
  834. context.Background(),
  835. request,
  836. )
  837. }
  838. func (service *pACSPort) DeleteAccessPointContext(ctx context.Context, request *DeleteAccessPoint) (*DeleteAccessPointResponse, error) {
  839. response := new(DeleteAccessPointResponse)
  840. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/DeleteAccessPoint", request, response)
  841. if err != nil {
  842. return nil, err
  843. }
  844. return response, nil
  845. }
  846. func (service *pACSPort) DeleteAccessPoint(request *DeleteAccessPoint) (*DeleteAccessPointResponse, error) {
  847. return service.DeleteAccessPointContext(
  848. context.Background(),
  849. request,
  850. )
  851. }
  852. func (service *pACSPort) SetAccessPointAuthenticationProfileContext(ctx context.Context, request *SetAccessPointAuthenticationProfile) (*SetAccessPointAuthenticationProfileResponse, error) {
  853. response := new(SetAccessPointAuthenticationProfileResponse)
  854. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/SetAccessPointAuthenticationProfile", request, response)
  855. if err != nil {
  856. return nil, err
  857. }
  858. return response, nil
  859. }
  860. func (service *pACSPort) SetAccessPointAuthenticationProfile(request *SetAccessPointAuthenticationProfile) (*SetAccessPointAuthenticationProfileResponse, error) {
  861. return service.SetAccessPointAuthenticationProfileContext(
  862. context.Background(),
  863. request,
  864. )
  865. }
  866. func (service *pACSPort) DeleteAccessPointAuthenticationProfileContext(ctx context.Context, request *DeleteAccessPointAuthenticationProfile) (*DeleteAccessPointAuthenticationProfileResponse, error) {
  867. response := new(DeleteAccessPointAuthenticationProfileResponse)
  868. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/DeleteAccessPointAuthenticationProfile", request, response)
  869. if err != nil {
  870. return nil, err
  871. }
  872. return response, nil
  873. }
  874. func (service *pACSPort) DeleteAccessPointAuthenticationProfile(request *DeleteAccessPointAuthenticationProfile) (*DeleteAccessPointAuthenticationProfileResponse, error) {
  875. return service.DeleteAccessPointAuthenticationProfileContext(
  876. context.Background(),
  877. request,
  878. )
  879. }
  880. func (service *pACSPort) GetAreaInfoContext(ctx context.Context, request *GetAreaInfo) (*GetAreaInfoResponse, error) {
  881. response := new(GetAreaInfoResponse)
  882. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/GetAreaInfo", request, response)
  883. if err != nil {
  884. return nil, err
  885. }
  886. return response, nil
  887. }
  888. func (service *pACSPort) GetAreaInfo(request *GetAreaInfo) (*GetAreaInfoResponse, error) {
  889. return service.GetAreaInfoContext(
  890. context.Background(),
  891. request,
  892. )
  893. }
  894. func (service *pACSPort) GetAreaInfoListContext(ctx context.Context, request *GetAreaInfoList) (*GetAreaInfoListResponse, error) {
  895. response := new(GetAreaInfoListResponse)
  896. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/GetAreaInfoList", request, response)
  897. if err != nil {
  898. return nil, err
  899. }
  900. return response, nil
  901. }
  902. func (service *pACSPort) GetAreaInfoList(request *GetAreaInfoList) (*GetAreaInfoListResponse, error) {
  903. return service.GetAreaInfoListContext(
  904. context.Background(),
  905. request,
  906. )
  907. }
  908. func (service *pACSPort) GetAreasContext(ctx context.Context, request *GetAreas) (*GetAreasResponse, error) {
  909. response := new(GetAreasResponse)
  910. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/GetAreas", request, response)
  911. if err != nil {
  912. return nil, err
  913. }
  914. return response, nil
  915. }
  916. func (service *pACSPort) GetAreas(request *GetAreas) (*GetAreasResponse, error) {
  917. return service.GetAreasContext(
  918. context.Background(),
  919. request,
  920. )
  921. }
  922. func (service *pACSPort) GetAreaListContext(ctx context.Context, request *GetAreaList) (*GetAreaListResponse, error) {
  923. response := new(GetAreaListResponse)
  924. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/GetAreaList", request, response)
  925. if err != nil {
  926. return nil, err
  927. }
  928. return response, nil
  929. }
  930. func (service *pACSPort) GetAreaList(request *GetAreaList) (*GetAreaListResponse, error) {
  931. return service.GetAreaListContext(
  932. context.Background(),
  933. request,
  934. )
  935. }
  936. func (service *pACSPort) CreateAreaContext(ctx context.Context, request *CreateArea) (*CreateAreaResponse, error) {
  937. response := new(CreateAreaResponse)
  938. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/CreateArea", request, response)
  939. if err != nil {
  940. return nil, err
  941. }
  942. return response, nil
  943. }
  944. func (service *pACSPort) CreateArea(request *CreateArea) (*CreateAreaResponse, error) {
  945. return service.CreateAreaContext(
  946. context.Background(),
  947. request,
  948. )
  949. }
  950. func (service *pACSPort) SetAreaContext(ctx context.Context, request *SetArea) (*SetAreaResponse, error) {
  951. response := new(SetAreaResponse)
  952. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/SetArea", request, response)
  953. if err != nil {
  954. return nil, err
  955. }
  956. return response, nil
  957. }
  958. func (service *pACSPort) SetArea(request *SetArea) (*SetAreaResponse, error) {
  959. return service.SetAreaContext(
  960. context.Background(),
  961. request,
  962. )
  963. }
  964. func (service *pACSPort) ModifyAreaContext(ctx context.Context, request *ModifyArea) (*ModifyAreaResponse, error) {
  965. response := new(ModifyAreaResponse)
  966. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/ModifyArea", request, response)
  967. if err != nil {
  968. return nil, err
  969. }
  970. return response, nil
  971. }
  972. func (service *pACSPort) ModifyArea(request *ModifyArea) (*ModifyAreaResponse, error) {
  973. return service.ModifyAreaContext(
  974. context.Background(),
  975. request,
  976. )
  977. }
  978. func (service *pACSPort) DeleteAreaContext(ctx context.Context, request *DeleteArea) (*DeleteAreaResponse, error) {
  979. response := new(DeleteAreaResponse)
  980. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/DeleteArea", request, response)
  981. if err != nil {
  982. return nil, err
  983. }
  984. return response, nil
  985. }
  986. func (service *pACSPort) DeleteArea(request *DeleteArea) (*DeleteAreaResponse, error) {
  987. return service.DeleteAreaContext(
  988. context.Background(),
  989. request,
  990. )
  991. }
  992. func (service *pACSPort) GetAccessPointStateContext(ctx context.Context, request *GetAccessPointState) (*GetAccessPointStateResponse, error) {
  993. response := new(GetAccessPointStateResponse)
  994. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/GetAccessPointState", request, response)
  995. if err != nil {
  996. return nil, err
  997. }
  998. return response, nil
  999. }
  1000. func (service *pACSPort) GetAccessPointState(request *GetAccessPointState) (*GetAccessPointStateResponse, error) {
  1001. return service.GetAccessPointStateContext(
  1002. context.Background(),
  1003. request,
  1004. )
  1005. }
  1006. func (service *pACSPort) EnableAccessPointContext(ctx context.Context, request *EnableAccessPoint) (*EnableAccessPointResponse, error) {
  1007. response := new(EnableAccessPointResponse)
  1008. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/EnableAccessPoint", request, response)
  1009. if err != nil {
  1010. return nil, err
  1011. }
  1012. return response, nil
  1013. }
  1014. func (service *pACSPort) EnableAccessPoint(request *EnableAccessPoint) (*EnableAccessPointResponse, error) {
  1015. return service.EnableAccessPointContext(
  1016. context.Background(),
  1017. request,
  1018. )
  1019. }
  1020. func (service *pACSPort) DisableAccessPointContext(ctx context.Context, request *DisableAccessPoint) (*DisableAccessPointResponse, error) {
  1021. response := new(DisableAccessPointResponse)
  1022. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/DisableAccessPoint", request, response)
  1023. if err != nil {
  1024. return nil, err
  1025. }
  1026. return response, nil
  1027. }
  1028. func (service *pACSPort) DisableAccessPoint(request *DisableAccessPoint) (*DisableAccessPointResponse, error) {
  1029. return service.DisableAccessPointContext(
  1030. context.Background(),
  1031. request,
  1032. )
  1033. }
  1034. func (service *pACSPort) ExternalAuthorizationContext(ctx context.Context, request *ExternalAuthorization) (*ExternalAuthorizationResponse, error) {
  1035. response := new(ExternalAuthorizationResponse)
  1036. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/accesscontrol/wsdl/ExternalAuthorization", request, response)
  1037. if err != nil {
  1038. return nil, err
  1039. }
  1040. return response, nil
  1041. }
  1042. func (service *pACSPort) ExternalAuthorization(request *ExternalAuthorization) (*ExternalAuthorizationResponse, error) {
  1043. return service.ExternalAuthorizationContext(
  1044. context.Background(),
  1045. request,
  1046. )
  1047. }
  1048. // QName type
  1049. type QName string