credential.go 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232
  1. package credential
  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/credential/wsdl GetServiceCapabilities"`
  14. }
  15. // GetServiceCapabilitiesResponse type
  16. type GetServiceCapabilitiesResponse struct {
  17. XMLName xml.Name `xml:"GetServiceCapabilitiesResponse"`
  18. // The capability response message contains the requested credential
  19. // service capabilities using a hierarchical XML capability structure.
  20. //
  21. Capabilities ServiceCapabilities `xml:"Capabilities,omitempty"`
  22. }
  23. // GetSupportedFormatTypes type
  24. type GetSupportedFormatTypes struct {
  25. XMLName xml.Name `xml:"http://www.onvif.org/ver10/credential/wsdl GetSupportedFormatTypes"`
  26. // Name of the credential identifier type
  27. CredentialIdentifierTypeName string `xml:"http://www.onvif.org/ver10/credential/wsdl CredentialIdentifierTypeName,omitempty"`
  28. }
  29. // GetSupportedFormatTypesResponse type
  30. type GetSupportedFormatTypesResponse struct {
  31. XMLName xml.Name `xml:"GetSupportedFormatTypesResponse"`
  32. // Identifier format type
  33. FormatTypeInfo []CredentialIdentifierFormatTypeInfo `xml:"FormatTypeInfo,omitempty"`
  34. }
  35. // GetCredentialInfo type
  36. type GetCredentialInfo struct {
  37. XMLName xml.Name `xml:"http://www.onvif.org/ver10/credential/wsdl GetCredentialInfo"`
  38. // Tokens of CredentialInfo items to get.
  39. Token []ReferenceToken `xml:"http://www.onvif.org/ver10/credential/wsdl Token,omitempty"`
  40. }
  41. // GetCredentialInfoResponse type
  42. type GetCredentialInfoResponse struct {
  43. XMLName xml.Name `xml:"GetCredentialInfoResponse"`
  44. // List of CredentialInfo items.
  45. CredentialInfo []CredentialInfo `xml:"CredentialInfo,omitempty"`
  46. }
  47. // GetCredentialInfoList type
  48. type GetCredentialInfoList struct {
  49. XMLName xml.Name `xml:"http://www.onvif.org/ver10/credential/wsdl GetCredentialInfoList"`
  50. // Maximum number of entries to return. If not specified, less than one
  51. // or higher than what the device supports, the number of items is determined by the
  52. // device.
  53. //
  54. Limit int32 `xml:"http://www.onvif.org/ver10/schema Limit,omitempty"`
  55. // Start returning entries from this start reference. If not specified,
  56. // entries shall start from the beginning of the dataset.
  57. //
  58. StartReference string `xml:"http://www.onvif.org/ver10/credential/wsdl StartReference,omitempty"`
  59. }
  60. // GetCredentialInfoListResponse type
  61. type GetCredentialInfoListResponse struct {
  62. XMLName xml.Name `xml:"GetCredentialInfoListResponse"`
  63. // StartReference to use in next call to get the following items. If
  64. // absent, no more items to get.
  65. //
  66. NextStartReference string `xml:"NextStartReference,omitempty"`
  67. // List of CredentialInfo items.
  68. CredentialInfo []CredentialInfo `xml:"CredentialInfo,omitempty"`
  69. }
  70. // GetCredentials type
  71. type GetCredentials struct {
  72. XMLName xml.Name `xml:"http://www.onvif.org/ver10/credential/wsdl GetCredentials"`
  73. // Token of Credentials to get
  74. Token []ReferenceToken `xml:"http://www.onvif.org/ver10/credential/wsdl Token,omitempty"`
  75. }
  76. // GetCredentialsResponse type
  77. type GetCredentialsResponse struct {
  78. XMLName xml.Name `xml:"GetCredentialsResponse"`
  79. // List of Credential items.
  80. Credential []Credential `xml:"Credential,omitempty"`
  81. }
  82. // GetCredentialList type
  83. type GetCredentialList struct {
  84. XMLName xml.Name `xml:"http://www.onvif.org/ver10/credential/wsdl GetCredentialList"`
  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/credential/wsdl StartReference,omitempty"`
  94. }
  95. // GetCredentialListResponse type
  96. type GetCredentialListResponse struct {
  97. XMLName xml.Name `xml:"GetCredentialListResponse"`
  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 Credential items.
  103. Credential []Credential `xml:"Credential,omitempty"`
  104. }
  105. // CreateCredential type
  106. type CreateCredential struct {
  107. XMLName xml.Name `xml:"http://www.onvif.org/ver10/credential/wsdl CreateCredential"`
  108. // The credential to create.
  109. Credential Credential `xml:"http://www.onvif.org/ver10/credential/wsdl Credential,omitempty"`
  110. // The state of the credential.
  111. State CredentialState `xml:"http://www.onvif.org/ver10/credential/wsdl State,omitempty"`
  112. }
  113. // CreateCredentialResponse type
  114. type CreateCredentialResponse struct {
  115. XMLName xml.Name `xml:"CreateCredentialResponse"`
  116. // The token of the created credential
  117. Token ReferenceToken `xml:"Token,omitempty"`
  118. }
  119. // ModifyCredential type
  120. type ModifyCredential struct {
  121. XMLName xml.Name `xml:"http://www.onvif.org/ver10/credential/wsdl ModifyCredential"`
  122. // Details of the credential.
  123. Credential Credential `xml:"http://www.onvif.org/ver10/credential/wsdl Credential,omitempty"`
  124. }
  125. // ModifyCredentialResponse type
  126. type ModifyCredentialResponse struct {
  127. XMLName xml.Name `xml:"ModifyCredentialResponse"`
  128. }
  129. // SetCredential type
  130. type SetCredential struct {
  131. XMLName xml.Name `xml:"http://www.onvif.org/ver10/credential/wsdl SetCredential"`
  132. // Details of the credential.
  133. CredentialData CredentialData `xml:"http://www.onvif.org/ver10/credential/wsdl CredentialData,omitempty"`
  134. }
  135. // SetCredentialResponse type
  136. type SetCredentialResponse struct {
  137. XMLName xml.Name `xml:"SetCredentialResponse"`
  138. }
  139. // DeleteCredential type
  140. type DeleteCredential struct {
  141. XMLName xml.Name `xml:"http://www.onvif.org/ver10/credential/wsdl DeleteCredential"`
  142. // The token of the credential to delete.
  143. Token ReferenceToken `xml:"http://www.onvif.org/ver10/credential/wsdl Token,omitempty"`
  144. }
  145. // DeleteCredentialResponse type
  146. type DeleteCredentialResponse struct {
  147. XMLName xml.Name `xml:"DeleteCredentialResponse"`
  148. }
  149. // GetCredentialState type
  150. type GetCredentialState struct {
  151. XMLName xml.Name `xml:"http://www.onvif.org/ver10/credential/wsdl GetCredentialState"`
  152. // Token of Credential
  153. Token ReferenceToken `xml:"http://www.onvif.org/ver10/credential/wsdl Token,omitempty"`
  154. }
  155. // GetCredentialStateResponse type
  156. type GetCredentialStateResponse struct {
  157. XMLName xml.Name `xml:"GetCredentialStateResponse"`
  158. // State of the credential.
  159. State CredentialState `xml:"State,omitempty"`
  160. }
  161. // EnableCredential type
  162. type EnableCredential struct {
  163. XMLName xml.Name `xml:"http://www.onvif.org/ver10/credential/wsdl EnableCredential"`
  164. // The token of the credential
  165. Token ReferenceToken `xml:"http://www.onvif.org/ver10/credential/wsdl Token,omitempty"`
  166. // Reason for enabling the credential.
  167. Reason Name `xml:"http://www.onvif.org/ver10/credential/wsdl Reason,omitempty"`
  168. }
  169. // EnableCredentialResponse type
  170. type EnableCredentialResponse struct {
  171. XMLName xml.Name `xml:"EnableCredentialResponse"`
  172. }
  173. // DisableCredential type
  174. type DisableCredential struct {
  175. XMLName xml.Name `xml:"http://www.onvif.org/ver10/credential/wsdl DisableCredential"`
  176. // Token of the Credential
  177. Token ReferenceToken `xml:"http://www.onvif.org/ver10/credential/wsdl Token,omitempty"`
  178. // Reason for disabling the credential
  179. Reason Name `xml:"http://www.onvif.org/ver10/credential/wsdl Reason,omitempty"`
  180. }
  181. // DisableCredentialResponse type
  182. type DisableCredentialResponse struct {
  183. XMLName xml.Name `xml:"DisableCredentialResponse"`
  184. }
  185. // ResetAntipassbackViolation type
  186. type ResetAntipassbackViolation struct {
  187. XMLName xml.Name `xml:"http://www.onvif.org/ver10/credential/wsdl ResetAntipassbackViolation"`
  188. // Token of the Credential
  189. CredentialToken ReferenceToken `xml:"http://www.onvif.org/ver10/credential/wsdl CredentialToken,omitempty"`
  190. }
  191. // ResetAntipassbackViolationResponse type
  192. type ResetAntipassbackViolationResponse struct {
  193. XMLName xml.Name `xml:"ResetAntipassbackViolationResponse"`
  194. }
  195. // GetCredentialIdentifiers type
  196. type GetCredentialIdentifiers struct {
  197. XMLName xml.Name `xml:"http://www.onvif.org/ver10/credential/wsdl GetCredentialIdentifiers"`
  198. // Token of the Credential
  199. CredentialToken ReferenceToken `xml:"http://www.onvif.org/ver10/credential/wsdl CredentialToken,omitempty"`
  200. }
  201. // GetCredentialIdentifiersResponse type
  202. type GetCredentialIdentifiersResponse struct {
  203. XMLName xml.Name `xml:"GetCredentialIdentifiersResponse"`
  204. // Identifier of the credential
  205. CredentialIdentifier []CredentialIdentifier `xml:"CredentialIdentifier,omitempty"`
  206. }
  207. // SetCredentialIdentifier type
  208. type SetCredentialIdentifier struct {
  209. XMLName xml.Name `xml:"http://www.onvif.org/ver10/credential/wsdl SetCredentialIdentifier"`
  210. // Token of the Credential
  211. CredentialToken ReferenceToken `xml:"http://www.onvif.org/ver10/credential/wsdl CredentialToken,omitempty"`
  212. // Identifier of the credential
  213. CredentialIdentifier CredentialIdentifier `xml:"http://www.onvif.org/ver10/credential/wsdl CredentialIdentifier,omitempty"`
  214. }
  215. // SetCredentialIdentifierResponse type
  216. type SetCredentialIdentifierResponse struct {
  217. XMLName xml.Name `xml:"SetCredentialIdentifierResponse"`
  218. }
  219. // DeleteCredentialIdentifier type
  220. type DeleteCredentialIdentifier struct {
  221. XMLName xml.Name `xml:"http://www.onvif.org/ver10/credential/wsdl DeleteCredentialIdentifier"`
  222. // Token of the Credential
  223. CredentialToken ReferenceToken `xml:"http://www.onvif.org/ver10/credential/wsdl CredentialToken,omitempty"`
  224. // Identifier type name of a credential
  225. CredentialIdentifierTypeName Name `xml:"http://www.onvif.org/ver10/credential/wsdl CredentialIdentifierTypeName,omitempty"`
  226. }
  227. // DeleteCredentialIdentifierResponse type
  228. type DeleteCredentialIdentifierResponse struct {
  229. XMLName xml.Name `xml:"DeleteCredentialIdentifierResponse"`
  230. }
  231. // GetCredentialAccessProfiles type
  232. type GetCredentialAccessProfiles struct {
  233. XMLName xml.Name `xml:"http://www.onvif.org/ver10/credential/wsdl GetCredentialAccessProfiles"`
  234. // Token of the Credential
  235. CredentialToken ReferenceToken `xml:"http://www.onvif.org/ver10/credential/wsdl CredentialToken,omitempty"`
  236. }
  237. // GetCredentialAccessProfilesResponse type
  238. type GetCredentialAccessProfilesResponse struct {
  239. XMLName xml.Name `xml:"GetCredentialAccessProfilesResponse"`
  240. // Access Profiles of the credential
  241. CredentialAccessProfile []CredentialAccessProfile `xml:"CredentialAccessProfile,omitempty"`
  242. }
  243. // SetCredentialAccessProfiles type
  244. type SetCredentialAccessProfiles struct {
  245. XMLName xml.Name `xml:"http://www.onvif.org/ver10/credential/wsdl SetCredentialAccessProfiles"`
  246. // Token of the Credential
  247. CredentialToken ReferenceToken `xml:"http://www.onvif.org/ver10/credential/wsdl CredentialToken,omitempty"`
  248. // Access Profiles of the credential
  249. CredentialAccessProfile []CredentialAccessProfile `xml:"http://www.onvif.org/ver10/credential/wsdl CredentialAccessProfile,omitempty"`
  250. }
  251. // SetCredentialAccessProfilesResponse type
  252. type SetCredentialAccessProfilesResponse struct {
  253. XMLName xml.Name `xml:"SetCredentialAccessProfilesResponse"`
  254. }
  255. // DeleteCredentialAccessProfiles type
  256. type DeleteCredentialAccessProfiles struct {
  257. XMLName xml.Name `xml:"http://www.onvif.org/ver10/credential/wsdl DeleteCredentialAccessProfiles"`
  258. // Token of the Credential
  259. CredentialToken ReferenceToken `xml:"http://www.onvif.org/ver10/credential/wsdl CredentialToken,omitempty"`
  260. // Tokens of Access Profiles
  261. AccessProfileToken []ReferenceToken `xml:"http://www.onvif.org/ver10/credential/wsdl AccessProfileToken,omitempty"`
  262. }
  263. // DeleteCredentialAccessProfilesResponse type
  264. type DeleteCredentialAccessProfilesResponse struct {
  265. XMLName xml.Name `xml:"DeleteCredentialAccessProfilesResponse"`
  266. }
  267. // ServiceCapabilities type
  268. type ServiceCapabilities struct {
  269. XMLName xml.Name `xml:"http://www.onvif.org/ver10/credential/wsdl Capabilities"`
  270. //
  271. // A list of identifier types that the device supports. Identifiers types starting with
  272. // the prefix pt: are reserved to define ONVIF specific types. For custom defined identifier types
  273. // shall all share the "pt:<Name>" syntax.
  274. //
  275. SupportedIdentifierType []Name `xml:"http://www.onvif.org/ver10/credential/wsdl SupportedIdentifierType,omitempty"`
  276. Extension ServiceCapabilitiesExtension `xml:"http://www.onvif.org/ver10/credential/wsdl Extension,omitempty"`
  277. //
  278. // The maximum number of entries returned by a single Get<Entity>List or Get<Entity>
  279. // request. The device shall never return more than this number of entities in a single response.
  280. //
  281. MaxLimit PositiveInteger `xml:"http://www.onvif.org/ver10/credential/wsdl MaxLimit,attr,omitempty"`
  282. //
  283. // Indicates that the device supports credential validity.
  284. //
  285. CredentialValiditySupported bool `xml:"http://www.onvif.org/ver10/credential/wsdl CredentialValiditySupported,attr,omitempty"`
  286. //
  287. // Indicates that the device supports validity on the association between a credential and an
  288. // access profile.
  289. //
  290. CredentialAccessProfileValiditySupported bool `xml:"http://www.onvif.org/ver10/credential/wsdl CredentialAccessProfileValiditySupported,attr,omitempty"`
  291. //
  292. // Indicates that the device supports both date and time value for validity. If set to false,
  293. // then the time value is ignored.
  294. //
  295. ValiditySupportsTimeValue bool `xml:"http://www.onvif.org/ver10/credential/wsdl ValiditySupportsTimeValue,attr,omitempty"`
  296. //
  297. // The maximum number of credential supported by the device.
  298. //
  299. MaxCredentials PositiveInteger `xml:"http://www.onvif.org/ver10/credential/wsdl MaxCredentials,attr,omitempty"`
  300. //
  301. // The maximum number of access profiles for a credential.
  302. //
  303. MaxAccessProfilesPerCredential PositiveInteger `xml:"http://www.onvif.org/ver10/credential/wsdl MaxAccessProfilesPerCredential,attr,omitempty"`
  304. //
  305. // Indicates the device supports resetting of anti-passback violations and notifying on
  306. // anti-passback violations.
  307. //
  308. ResetAntipassbackSupported bool `xml:"http://www.onvif.org/ver10/credential/wsdl ResetAntipassbackSupported,attr,omitempty"`
  309. //
  310. // Indicates that the client is allowed to supply the token when creating credentials.
  311. // To enable the use of the command SetCredential, the value must be set to true.
  312. //
  313. ClientSuppliedTokenSupported bool `xml:"http://www.onvif.org/ver10/credential/wsdl ClientSuppliedTokenSupported,attr,omitempty"`
  314. //
  315. // The default time period that the credential will temporary be suspended (e.g. by using
  316. // the wrong PIN a predetermined number of times).
  317. // The time period is defined as an [ISO 8601] duration string (e.g. “PT5M”).
  318. //
  319. DefaultCredentialSuspensionDuration Duration `xml:"http://www.onvif.org/ver10/schema DefaultCredentialSuspensionDuration,attr,omitempty"`
  320. }
  321. // ServiceCapabilitiesExtension type
  322. type ServiceCapabilitiesExtension struct {
  323. //
  324. // A list of exemptions that the device supports. Supported exemptions starting with the
  325. // prefix pt: are reserved to define ONVIF specific exemption types and these reserved
  326. // exemption types shall all share "pt:<Name>" syntax.
  327. //
  328. SupportedExemptionType []Name `xml:"http://www.onvif.org/ver10/credential/wsdl SupportedExemptionType,omitempty"`
  329. }
  330. // CredentialInfo type
  331. type CredentialInfo struct {
  332. *DataEntity
  333. //
  334. // User readable description for the credential. It shall be up to 1024 characters.
  335. //
  336. Description Description `xml:"http://www.onvif.org/ver10/credential/wsdl Description,omitempty"`
  337. // An external reference to a person holding this credential. The
  338. // reference is a username or used ID in an external system, such as a directory
  339. // service.
  340. //
  341. CredentialHolderReference string `xml:"http://www.onvif.org/ver10/credential/wsdl CredentialHolderReference,omitempty"`
  342. // The start date/time validity of the credential. If the
  343. // ValiditySupportsTimeValue capability is set to false, then only date is
  344. // supported (time is ignored).
  345. //
  346. ValidFrom string `xml:"http://www.onvif.org/ver10/schema ValidFrom,omitempty"`
  347. // The expiration date/time validity of the credential. If the
  348. // ValiditySupportsTimeValue capability is set to false, then only date is
  349. // supported (time is ignored).
  350. //
  351. ValidTo string `xml:"http://www.onvif.org/ver10/schema ValidTo,omitempty"`
  352. }
  353. // Credential type
  354. type Credential struct {
  355. *CredentialInfo
  356. // A list of credential identifier structures. At least one
  357. // credential identifier is required. Maximum one credential identifier structure
  358. // per type is allowed.
  359. //
  360. CredentialIdentifier []CredentialIdentifier `xml:"http://www.onvif.org/ver10/credential/wsdl CredentialIdentifier,omitempty"`
  361. // A list of credential access profile structures.
  362. CredentialAccessProfile []CredentialAccessProfile `xml:"http://www.onvif.org/ver10/credential/wsdl CredentialAccessProfile,omitempty"`
  363. //
  364. // A boolean indicating that the credential holder needs extra time to get through the door.
  365. // ExtendedReleaseTime will be added to ReleaseTime, and ExtendedOpenTime will be added to OpenTime
  366. //
  367. ExtendedGrantTime bool `xml:"http://www.onvif.org/ver10/credential/wsdl ExtendedGrantTime,omitempty"`
  368. // A list of credential attributes as name value pairs. Key names
  369. // starting with the prefix pt: are reserved to define PACS specific attributes
  370. // following the "pt:<Name>" syntax.
  371. //
  372. Attribute []Attribute `xml:"http://www.onvif.org/ver10/credential/wsdl Attribute,omitempty"`
  373. Extension CredentialExtension `xml:"http://www.onvif.org/ver10/credential/wsdl Extension,omitempty"`
  374. }
  375. // CredentialExtension type
  376. type CredentialExtension struct {
  377. }
  378. // CredentialIdentifier type
  379. type CredentialIdentifier struct {
  380. // Contains the details of the credential identifier type. Is of type
  381. // CredentialIdentifierType.
  382. //
  383. Type CredentialIdentifierType `xml:"http://www.onvif.org/ver10/credential/wsdl Type,omitempty"`
  384. // If set to true, this credential identifier is not considered for
  385. // authentication. For example if the access point requests Card plus PIN, and the credential
  386. // identifier of type PIN is exempted from authentication, then the access point will not prompt
  387. // for the PIN.
  388. //
  389. ExemptedFromAuthentication bool `xml:"http://www.onvif.org/ver10/credential/wsdl ExemptedFromAuthentication,omitempty"`
  390. // The value of the identifier in hexadecimal representation.
  391. //
  392. Value []byte `xml:"http://www.onvif.org/ver10/schema Value,omitempty"`
  393. }
  394. // CredentialIdentifierType type
  395. type CredentialIdentifierType struct {
  396. // The name of the credential identifier type, such as pt:Card, pt:PIN,
  397. // etc.
  398. //
  399. Name Name `xml:"http://www.onvif.org/ver10/credential/wsdl Name,omitempty"`
  400. // Specifies the format of the credential value for the specified identifier
  401. // type name.
  402. //
  403. FormatType string `xml:"http://www.onvif.org/ver10/credential/wsdl FormatType,omitempty"`
  404. }
  405. // CredentialAccessProfile type
  406. type CredentialAccessProfile struct {
  407. // The reference token of the associated access profile.
  408. AccessProfileToken ReferenceToken `xml:"http://www.onvif.org/ver10/credential/wsdl AccessProfileToken,omitempty"`
  409. // The start date/time of the validity for the association between the
  410. // credential and the access profile. If the ValiditySupportsTimeValue capability is set to
  411. // false, then only date is supported (time is ignored).
  412. //
  413. ValidFrom string `xml:"http://www.onvif.org/ver10/schema ValidFrom,omitempty"`
  414. // The end date/time of the validity for the association between the
  415. // credential and the access profile. If the ValiditySupportsTimeValue capability is set to
  416. // false, then only date is supported (time is ignored).
  417. //
  418. ValidTo string `xml:"http://www.onvif.org/ver10/schema ValidTo,omitempty"`
  419. }
  420. // CredentialState type
  421. type CredentialState struct {
  422. // True if the credential is enabled or false if the credential is
  423. // disabled.
  424. //
  425. Enabled bool `xml:"http://www.onvif.org/ver10/credential/wsdl Enabled,omitempty"`
  426. // Predefined ONVIF reasons as mentioned in the section 5.4.2.7
  427. // of credential service specification document. For any other reason, free
  428. // text can be used.
  429. //
  430. Reason Name `xml:"http://www.onvif.org/ver10/credential/wsdl Reason,omitempty"`
  431. // A structure indicating the anti-passback state. This field shall be
  432. // supported if the ResetAntipassbackSupported capability is set to true.
  433. //
  434. AntipassbackState AntipassbackState `xml:"http://www.onvif.org/ver10/credential/wsdl AntipassbackState,omitempty"`
  435. Extension CredentialStateExtension `xml:"http://www.onvif.org/ver10/credential/wsdl Extension,omitempty"`
  436. }
  437. // CredentialStateExtension type
  438. type CredentialStateExtension struct {
  439. }
  440. // AntipassbackState type
  441. type AntipassbackState struct {
  442. // Indicates if anti-passback is violated for the credential.
  443. //
  444. AntipassbackViolated bool `xml:"http://www.onvif.org/ver10/credential/wsdl AntipassbackViolated,omitempty"`
  445. }
  446. // CredentialIdentifierFormatTypeInfo type
  447. type CredentialIdentifierFormatTypeInfo struct {
  448. // A format type supported by the device. A list of supported format types is
  449. // provided in [ISO 16484-5:2014-09 Annex P]. The BACnet type "CUSTOM" is not used in this
  450. // specification. Instead device manufacturers can define their own format types.
  451. //
  452. FormatType string `xml:"http://www.onvif.org/ver10/credential/wsdl FormatType,omitempty"`
  453. // User readable description of the credential identifier format type. It
  454. // shall be up to 1024 characters. For custom types, it is recommended to describe how the
  455. // octet string is encoded (following the structure in column Authentication Factor Value
  456. // Encoding of [ISO 16484-5:2014-09 Annex P]).
  457. //
  458. Description Description `xml:"http://www.onvif.org/ver10/credential/wsdl Description,omitempty"`
  459. Extension CredentialIdentifierFormatTypeInfoExtension `xml:"http://www.onvif.org/ver10/credential/wsdl Extension,omitempty"`
  460. }
  461. // CredentialIdentifierFormatTypeInfoExtension type
  462. type CredentialIdentifierFormatTypeInfoExtension struct {
  463. }
  464. // CredentialData type
  465. type CredentialData struct {
  466. // A format type supported by the device. A list of supported format types is
  467. // provided in [ISO 16484-5:2014-09 Annex P]. The BACnet type "CUSTOM" is not used in this
  468. // specification. Instead device manufacturers can define their own format types.
  469. //
  470. Credential Credential `xml:"http://www.onvif.org/ver10/credential/wsdl Credential,omitempty"`
  471. // User readable description of the credential identifier format type. It
  472. // shall be up to 1024 characters. For custom types, it is recommended to describe how the
  473. // octet string is encoded (following the structure in column Authentication Factor Value
  474. // Encoding of [ISO 16484-5:2014-09 Annex P]).
  475. //
  476. CredentialState CredentialState `xml:"http://www.onvif.org/ver10/credential/wsdl CredentialState,omitempty"`
  477. Extension CredentialDataExtension `xml:"http://www.onvif.org/ver10/credential/wsdl Extension,omitempty"`
  478. }
  479. // CredentialDataExtension type
  480. type CredentialDataExtension struct {
  481. }
  482. // FaultResponse type
  483. type FaultResponse struct {
  484. // A format type supported by the device. A list of supported format types is
  485. // provided in [ISO 16484-5:2014-09 Annex P]. The BACnet type "CUSTOM" is not used in this
  486. // specification. Instead device manufacturers can define their own format types.
  487. //
  488. Token ReferenceToken `xml:"Token,omitempty"`
  489. // User readable description of the credential identifier format type. It
  490. // shall be up to 1024 characters. For custom types, it is recommended to describe how the
  491. // octet string is encoded (following the structure in column Authentication Factor Value
  492. // Encoding of [ISO 16484-5:2014-09 Annex P]).
  493. //
  494. Fault string `xml:"Fault,omitempty"`
  495. Extension FaultResponseExtension `xml:"Extension,omitempty"`
  496. }
  497. // FaultResponseExtension type
  498. type FaultResponseExtension struct {
  499. }
  500. // Type used to reference logical and physical entities.
  501. // ReferenceToken type
  502. type ReferenceToken string
  503. // Type used for names of logical and physical entities.
  504. // Name type
  505. type Name string
  506. // Description is optional and the maximum length is device specific.
  507. // If the length is more than maximum length, it is silently chopped to the maximum length
  508. // supported by the device/service (which may be 0).
  509. //
  510. // Description type
  511. type Description string
  512. // Type used to represent the numbers from 1 ,2 , 3,...
  513. // PositiveInteger type
  514. type PositiveInteger uint32
  515. // DataEntity type
  516. type DataEntity struct {
  517. // A service-unique identifier of the item.
  518. Token ReferenceToken `xml:"token,attr,omitempty"`
  519. }
  520. // Attribute type
  521. type Attribute struct {
  522. // Name of attribute. Key names starting with "ONVIF" (any case) are reserved for ONVIF
  523. // use.
  524. //
  525. Name string `xml:"http://www.onvif.org/ver10/credential/wsdl Name,attr,omitempty"`
  526. // Value of attribute
  527. Value string `xml:"http://www.onvif.org/ver10/credential/wsdl Value,attr,omitempty"`
  528. }
  529. // CredentialPort type
  530. type CredentialPort interface {
  531. /* This operation returns the capabilities of the credential service. */
  532. GetServiceCapabilities(request *GetServiceCapabilities) (*GetServiceCapabilitiesResponse, error)
  533. GetServiceCapabilitiesContext(ctx context.Context, request *GetServiceCapabilities) (*GetServiceCapabilitiesResponse, error)
  534. /*
  535. This method returns all the supported format types of a specified identifier type that is supported by
  536. the device.
  537. */
  538. GetSupportedFormatTypes(request *GetSupportedFormatTypes) (*GetSupportedFormatTypesResponse, error)
  539. GetSupportedFormatTypesContext(ctx context.Context, request *GetSupportedFormatTypes) (*GetSupportedFormatTypesResponse, error)
  540. /*
  541. This operation requests a list of CredentialInfo items matching the given tokens.
  542. The device shall ignore tokens it cannot resolve and shall return an empty list if there are no
  543. items matching the specified tokens. The device shall not return a fault in this case.
  544. If the number of requested items is greater than MaxLimit, a TooManyItems fault shall be returned.
  545. */
  546. GetCredentialInfo(request *GetCredentialInfo) (*GetCredentialInfoResponse, error)
  547. GetCredentialInfoContext(ctx context.Context, request *GetCredentialInfo) (*GetCredentialInfoResponse, error)
  548. /*
  549. This operation requests a list of all CredentialInfo items provided by the device.
  550. A call to this method shall return a StartReference when not all data is returned and more data is available.
  551. The reference shall be valid for retrieving the next set of data. Please refer to section 4.8.3 in
  552. [ONVIF Access Control Service Specification] for more details.
  553. The number of items returned shall not be greater than the Limit parameter.
  554. */
  555. GetCredentialInfoList(request *GetCredentialInfoList) (*GetCredentialInfoListResponse, error)
  556. GetCredentialInfoListContext(ctx context.Context, request *GetCredentialInfoList) (*GetCredentialInfoListResponse, error)
  557. /*
  558. This operation returns the specified credential items matching the given tokens.
  559. The device shall ignore tokens it cannot resolve and shall return an empty list if there are no items
  560. matching specified tokens. The device shall not return a fault in this case.
  561. If the number of requested items is greater than MaxLimit, a TooManyItems fault shall be returned.
  562. */
  563. GetCredentials(request *GetCredentials) (*GetCredentialsResponse, error)
  564. GetCredentialsContext(ctx context.Context, request *GetCredentials) (*GetCredentialsResponse, error)
  565. /*
  566. This operation requests a list of all credential items provided by the device.
  567. A call to this method shall return a StartReference when not all data is returned and more data is
  568. available. The reference shall be valid for retrieving the next set of data. Please refer section 4.8.3
  569. in [Access Control Service Specification] for more details. The number of items returned shall not be
  570. greater the Limit parameter.
  571. */
  572. GetCredentialList(request *GetCredentialList) (*GetCredentialListResponse, error)
  573. GetCredentialListContext(ctx context.Context, request *GetCredentialList) (*GetCredentialListResponse, error)
  574. /*
  575. This operation creates a credential. A call to this method takes a credential structure and a credential
  576. state structure as input parameters. The credential state can be created in disabled or enabled state.
  577. The token field of the credential shall be empty, the device shall allocate a token for the credential.
  578. The allocated token shall be returned in the response. If the client sends any value in the token field,
  579. the device shall return InvalidArgVal as generic fault code.
  580. */
  581. CreateCredential(request *CreateCredential) (*CreateCredentialResponse, error)
  582. CreateCredentialContext(ctx context.Context, request *CreateCredential) (*CreateCredentialResponse, error)
  583. /*
  584. This method is used to synchronize a credential in a client with the device.
  585. */
  586. SetCredential(request *SetCredential) (*SetCredentialResponse, error)
  587. SetCredentialContext(ctx context.Context, request *SetCredential) (*SetCredentialResponse, error)
  588. /*
  589. This operation modifies the specified credential.
  590. The token of the credential to modify is specified in the token field of the Credential structure and
  591. shall not be empty. All other fields in the structure shall overwrite the fields in the specified credential.
  592. When an existing credential is modified, the state is not modified explicitly. The only way for a client to
  593. change the state of a credential is to explicitly call the EnableCredential, DisableCredential or
  594. ResetAntipassback command.
  595. All existing credential identifiers and credential access profiles are removed and replaced with the
  596. specified entities.
  597. */
  598. ModifyCredential(request *ModifyCredential) (*ModifyCredentialResponse, error)
  599. ModifyCredentialContext(ctx context.Context, request *ModifyCredential) (*ModifyCredentialResponse, error)
  600. /*
  601. This method deletes the specified credential.
  602. If it is associated with one or more entities some devices may not be able to delete the credential,
  603. and consequently a ReferenceInUse fault shall be generated.
  604. */
  605. DeleteCredential(request *DeleteCredential) (*DeleteCredentialResponse, error)
  606. DeleteCredentialContext(ctx context.Context, request *DeleteCredential) (*DeleteCredentialResponse, error)
  607. /*
  608. This method returns the state for the specified credential.
  609. If the capability ResetAntipassbackSupported is set to true, then the device shall supply the
  610. anti-passback state in the returned credential state structure.
  611. */
  612. GetCredentialState(request *GetCredentialState) (*GetCredentialStateResponse, error)
  613. GetCredentialStateContext(ctx context.Context, request *GetCredentialState) (*GetCredentialStateResponse, error)
  614. /*
  615. This method is used to enable a credential.
  616. */
  617. EnableCredential(request *EnableCredential) (*EnableCredentialResponse, error)
  618. EnableCredentialContext(ctx context.Context, request *EnableCredential) (*EnableCredentialResponse, error)
  619. /*
  620. This method is used to disable a credential.
  621. */
  622. DisableCredential(request *DisableCredential) (*DisableCredentialResponse, error)
  623. DisableCredentialContext(ctx context.Context, request *DisableCredential) (*DisableCredentialResponse, error)
  624. /*
  625. This method is used to reset anti-passback violations for a specified credential.
  626. */
  627. ResetAntipassbackViolation(request *ResetAntipassbackViolation) (*ResetAntipassbackViolationResponse, error)
  628. ResetAntipassbackViolationContext(ctx context.Context, request *ResetAntipassbackViolation) (*ResetAntipassbackViolationResponse, error)
  629. /*
  630. This method returns all the credential identifiers for a credential.
  631. */
  632. GetCredentialIdentifiers(request *GetCredentialIdentifiers) (*GetCredentialIdentifiersResponse, error)
  633. GetCredentialIdentifiersContext(ctx context.Context, request *GetCredentialIdentifiers) (*GetCredentialIdentifiersResponse, error)
  634. /*
  635. This operation creates or updates a credential identifier for a credential.
  636. If the type of specified credential identifier already exists, the current credential identifier of that
  637. type is replaced. Otherwise the credential identifier is added.
  638. */
  639. SetCredentialIdentifier(request *SetCredentialIdentifier) (*SetCredentialIdentifierResponse, error)
  640. SetCredentialIdentifierContext(ctx context.Context, request *SetCredentialIdentifier) (*SetCredentialIdentifierResponse, error)
  641. /*
  642. This method deletes all the identifier values for the specified type. However, if the identifier type
  643. name doesn’t exist in the device, it will be silently ignored without any response.
  644. */
  645. DeleteCredentialIdentifier(request *DeleteCredentialIdentifier) (*DeleteCredentialIdentifierResponse, error)
  646. DeleteCredentialIdentifierContext(ctx context.Context, request *DeleteCredentialIdentifier) (*DeleteCredentialIdentifierResponse, error)
  647. /*
  648. This method returns all the credential access profiles for a credential.
  649. */
  650. GetCredentialAccessProfiles(request *GetCredentialAccessProfiles) (*GetCredentialAccessProfilesResponse, error)
  651. GetCredentialAccessProfilesContext(ctx context.Context, request *GetCredentialAccessProfiles) (*GetCredentialAccessProfilesResponse, error)
  652. /*
  653. This operation add or updates the credential access profiles for a credential.
  654. The device shall update the credential access profile if the access profile token in the specified
  655. credential access profile matches. Otherwise the credential access profile is added.
  656. */
  657. SetCredentialAccessProfiles(request *SetCredentialAccessProfiles) (*SetCredentialAccessProfilesResponse, error)
  658. SetCredentialAccessProfilesContext(ctx context.Context, request *SetCredentialAccessProfiles) (*SetCredentialAccessProfilesResponse, error)
  659. /*
  660. This method deletes all the credential access profiles for the specified tokens.
  661. However, if no matching credential access profiles are found, the corresponding access profile tokens
  662. are silently ignored without any response.
  663. */
  664. DeleteCredentialAccessProfiles(request *DeleteCredentialAccessProfiles) (*DeleteCredentialAccessProfilesResponse, error)
  665. DeleteCredentialAccessProfilesContext(ctx context.Context, request *DeleteCredentialAccessProfiles) (*DeleteCredentialAccessProfilesResponse, error)
  666. }
  667. // credentialPort type
  668. type credentialPort struct {
  669. client *soap.Client
  670. xaddr string
  671. }
  672. func NewCredentialPort(client *soap.Client, xaddr string) CredentialPort {
  673. return &credentialPort{
  674. client: client,
  675. xaddr: xaddr,
  676. }
  677. }
  678. func (service *credentialPort) GetServiceCapabilitiesContext(ctx context.Context, request *GetServiceCapabilities) (*GetServiceCapabilitiesResponse, error) {
  679. response := new(GetServiceCapabilitiesResponse)
  680. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/credential/wsdl/GetServiceCapabilities", request, response)
  681. if err != nil {
  682. return nil, err
  683. }
  684. return response, nil
  685. }
  686. func (service *credentialPort) GetServiceCapabilities(request *GetServiceCapabilities) (*GetServiceCapabilitiesResponse, error) {
  687. return service.GetServiceCapabilitiesContext(
  688. context.Background(),
  689. request,
  690. )
  691. }
  692. func (service *credentialPort) GetSupportedFormatTypesContext(ctx context.Context, request *GetSupportedFormatTypes) (*GetSupportedFormatTypesResponse, error) {
  693. response := new(GetSupportedFormatTypesResponse)
  694. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/credential/wsdl/GetSupportedFormatTypes", request, response)
  695. if err != nil {
  696. return nil, err
  697. }
  698. return response, nil
  699. }
  700. func (service *credentialPort) GetSupportedFormatTypes(request *GetSupportedFormatTypes) (*GetSupportedFormatTypesResponse, error) {
  701. return service.GetSupportedFormatTypesContext(
  702. context.Background(),
  703. request,
  704. )
  705. }
  706. func (service *credentialPort) GetCredentialInfoContext(ctx context.Context, request *GetCredentialInfo) (*GetCredentialInfoResponse, error) {
  707. response := new(GetCredentialInfoResponse)
  708. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/credential/wsdl/GetCredentialInfo", request, response)
  709. if err != nil {
  710. return nil, err
  711. }
  712. return response, nil
  713. }
  714. func (service *credentialPort) GetCredentialInfo(request *GetCredentialInfo) (*GetCredentialInfoResponse, error) {
  715. return service.GetCredentialInfoContext(
  716. context.Background(),
  717. request,
  718. )
  719. }
  720. func (service *credentialPort) GetCredentialInfoListContext(ctx context.Context, request *GetCredentialInfoList) (*GetCredentialInfoListResponse, error) {
  721. response := new(GetCredentialInfoListResponse)
  722. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/credential/wsdl/GetCredentialInfoList", request, response)
  723. if err != nil {
  724. return nil, err
  725. }
  726. return response, nil
  727. }
  728. func (service *credentialPort) GetCredentialInfoList(request *GetCredentialInfoList) (*GetCredentialInfoListResponse, error) {
  729. return service.GetCredentialInfoListContext(
  730. context.Background(),
  731. request,
  732. )
  733. }
  734. func (service *credentialPort) GetCredentialsContext(ctx context.Context, request *GetCredentials) (*GetCredentialsResponse, error) {
  735. response := new(GetCredentialsResponse)
  736. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/credential/wsdl/GetCredentials", request, response)
  737. if err != nil {
  738. return nil, err
  739. }
  740. return response, nil
  741. }
  742. func (service *credentialPort) GetCredentials(request *GetCredentials) (*GetCredentialsResponse, error) {
  743. return service.GetCredentialsContext(
  744. context.Background(),
  745. request,
  746. )
  747. }
  748. func (service *credentialPort) GetCredentialListContext(ctx context.Context, request *GetCredentialList) (*GetCredentialListResponse, error) {
  749. response := new(GetCredentialListResponse)
  750. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/credential/wsdl/GetCredentialList", request, response)
  751. if err != nil {
  752. return nil, err
  753. }
  754. return response, nil
  755. }
  756. func (service *credentialPort) GetCredentialList(request *GetCredentialList) (*GetCredentialListResponse, error) {
  757. return service.GetCredentialListContext(
  758. context.Background(),
  759. request,
  760. )
  761. }
  762. func (service *credentialPort) CreateCredentialContext(ctx context.Context, request *CreateCredential) (*CreateCredentialResponse, error) {
  763. response := new(CreateCredentialResponse)
  764. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/credential/wsdl/CreateCredential", request, response)
  765. if err != nil {
  766. return nil, err
  767. }
  768. return response, nil
  769. }
  770. func (service *credentialPort) CreateCredential(request *CreateCredential) (*CreateCredentialResponse, error) {
  771. return service.CreateCredentialContext(
  772. context.Background(),
  773. request,
  774. )
  775. }
  776. func (service *credentialPort) SetCredentialContext(ctx context.Context, request *SetCredential) (*SetCredentialResponse, error) {
  777. response := new(SetCredentialResponse)
  778. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/credential/wsdl/SetCredential", request, response)
  779. if err != nil {
  780. return nil, err
  781. }
  782. return response, nil
  783. }
  784. func (service *credentialPort) SetCredential(request *SetCredential) (*SetCredentialResponse, error) {
  785. return service.SetCredentialContext(
  786. context.Background(),
  787. request,
  788. )
  789. }
  790. func (service *credentialPort) ModifyCredentialContext(ctx context.Context, request *ModifyCredential) (*ModifyCredentialResponse, error) {
  791. response := new(ModifyCredentialResponse)
  792. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/credential/wsdl/ModifyCredential", request, response)
  793. if err != nil {
  794. return nil, err
  795. }
  796. return response, nil
  797. }
  798. func (service *credentialPort) ModifyCredential(request *ModifyCredential) (*ModifyCredentialResponse, error) {
  799. return service.ModifyCredentialContext(
  800. context.Background(),
  801. request,
  802. )
  803. }
  804. func (service *credentialPort) DeleteCredentialContext(ctx context.Context, request *DeleteCredential) (*DeleteCredentialResponse, error) {
  805. response := new(DeleteCredentialResponse)
  806. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/credential/wsdl/DeleteCredential", request, response)
  807. if err != nil {
  808. return nil, err
  809. }
  810. return response, nil
  811. }
  812. func (service *credentialPort) DeleteCredential(request *DeleteCredential) (*DeleteCredentialResponse, error) {
  813. return service.DeleteCredentialContext(
  814. context.Background(),
  815. request,
  816. )
  817. }
  818. func (service *credentialPort) GetCredentialStateContext(ctx context.Context, request *GetCredentialState) (*GetCredentialStateResponse, error) {
  819. response := new(GetCredentialStateResponse)
  820. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/credential/wsdl/GetCredentialState", request, response)
  821. if err != nil {
  822. return nil, err
  823. }
  824. return response, nil
  825. }
  826. func (service *credentialPort) GetCredentialState(request *GetCredentialState) (*GetCredentialStateResponse, error) {
  827. return service.GetCredentialStateContext(
  828. context.Background(),
  829. request,
  830. )
  831. }
  832. func (service *credentialPort) EnableCredentialContext(ctx context.Context, request *EnableCredential) (*EnableCredentialResponse, error) {
  833. response := new(EnableCredentialResponse)
  834. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/credential/wsdl/EnableCredential", request, response)
  835. if err != nil {
  836. return nil, err
  837. }
  838. return response, nil
  839. }
  840. func (service *credentialPort) EnableCredential(request *EnableCredential) (*EnableCredentialResponse, error) {
  841. return service.EnableCredentialContext(
  842. context.Background(),
  843. request,
  844. )
  845. }
  846. func (service *credentialPort) DisableCredentialContext(ctx context.Context, request *DisableCredential) (*DisableCredentialResponse, error) {
  847. response := new(DisableCredentialResponse)
  848. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/credential/wsdl/DisableCredential", request, response)
  849. if err != nil {
  850. return nil, err
  851. }
  852. return response, nil
  853. }
  854. func (service *credentialPort) DisableCredential(request *DisableCredential) (*DisableCredentialResponse, error) {
  855. return service.DisableCredentialContext(
  856. context.Background(),
  857. request,
  858. )
  859. }
  860. func (service *credentialPort) ResetAntipassbackViolationContext(ctx context.Context, request *ResetAntipassbackViolation) (*ResetAntipassbackViolationResponse, error) {
  861. response := new(ResetAntipassbackViolationResponse)
  862. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/credential/wsdl/ResetAntipassbackViolation", request, response)
  863. if err != nil {
  864. return nil, err
  865. }
  866. return response, nil
  867. }
  868. func (service *credentialPort) ResetAntipassbackViolation(request *ResetAntipassbackViolation) (*ResetAntipassbackViolationResponse, error) {
  869. return service.ResetAntipassbackViolationContext(
  870. context.Background(),
  871. request,
  872. )
  873. }
  874. func (service *credentialPort) GetCredentialIdentifiersContext(ctx context.Context, request *GetCredentialIdentifiers) (*GetCredentialIdentifiersResponse, error) {
  875. response := new(GetCredentialIdentifiersResponse)
  876. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/credential/wsdl/GetCredentialIdentifiers", request, response)
  877. if err != nil {
  878. return nil, err
  879. }
  880. return response, nil
  881. }
  882. func (service *credentialPort) GetCredentialIdentifiers(request *GetCredentialIdentifiers) (*GetCredentialIdentifiersResponse, error) {
  883. return service.GetCredentialIdentifiersContext(
  884. context.Background(),
  885. request,
  886. )
  887. }
  888. func (service *credentialPort) SetCredentialIdentifierContext(ctx context.Context, request *SetCredentialIdentifier) (*SetCredentialIdentifierResponse, error) {
  889. response := new(SetCredentialIdentifierResponse)
  890. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/credential/wsdl/SetCredentialIdentifier", request, response)
  891. if err != nil {
  892. return nil, err
  893. }
  894. return response, nil
  895. }
  896. func (service *credentialPort) SetCredentialIdentifier(request *SetCredentialIdentifier) (*SetCredentialIdentifierResponse, error) {
  897. return service.SetCredentialIdentifierContext(
  898. context.Background(),
  899. request,
  900. )
  901. }
  902. func (service *credentialPort) DeleteCredentialIdentifierContext(ctx context.Context, request *DeleteCredentialIdentifier) (*DeleteCredentialIdentifierResponse, error) {
  903. response := new(DeleteCredentialIdentifierResponse)
  904. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/credential/wsdl/DeleteCredentialIdentifier", request, response)
  905. if err != nil {
  906. return nil, err
  907. }
  908. return response, nil
  909. }
  910. func (service *credentialPort) DeleteCredentialIdentifier(request *DeleteCredentialIdentifier) (*DeleteCredentialIdentifierResponse, error) {
  911. return service.DeleteCredentialIdentifierContext(
  912. context.Background(),
  913. request,
  914. )
  915. }
  916. func (service *credentialPort) GetCredentialAccessProfilesContext(ctx context.Context, request *GetCredentialAccessProfiles) (*GetCredentialAccessProfilesResponse, error) {
  917. response := new(GetCredentialAccessProfilesResponse)
  918. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/credential/wsdl/GetCredentialAccessProfiles", request, response)
  919. if err != nil {
  920. return nil, err
  921. }
  922. return response, nil
  923. }
  924. func (service *credentialPort) GetCredentialAccessProfiles(request *GetCredentialAccessProfiles) (*GetCredentialAccessProfilesResponse, error) {
  925. return service.GetCredentialAccessProfilesContext(
  926. context.Background(),
  927. request,
  928. )
  929. }
  930. func (service *credentialPort) SetCredentialAccessProfilesContext(ctx context.Context, request *SetCredentialAccessProfiles) (*SetCredentialAccessProfilesResponse, error) {
  931. response := new(SetCredentialAccessProfilesResponse)
  932. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/credential/wsdl/SetCredentialAccessProfiles", request, response)
  933. if err != nil {
  934. return nil, err
  935. }
  936. return response, nil
  937. }
  938. func (service *credentialPort) SetCredentialAccessProfiles(request *SetCredentialAccessProfiles) (*SetCredentialAccessProfilesResponse, error) {
  939. return service.SetCredentialAccessProfilesContext(
  940. context.Background(),
  941. request,
  942. )
  943. }
  944. func (service *credentialPort) DeleteCredentialAccessProfilesContext(ctx context.Context, request *DeleteCredentialAccessProfiles) (*DeleteCredentialAccessProfilesResponse, error) {
  945. response := new(DeleteCredentialAccessProfilesResponse)
  946. err := service.client.CallContext(ctx, service.xaddr, "http://www.onvif.org/ver10/credential/wsdl/DeleteCredentialAccessProfiles", request, response)
  947. if err != nil {
  948. return nil, err
  949. }
  950. return response, nil
  951. }
  952. func (service *credentialPort) DeleteCredentialAccessProfiles(request *DeleteCredentialAccessProfiles) (*DeleteCredentialAccessProfilesResponse, error) {
  953. return service.DeleteCredentialAccessProfilesContext(
  954. context.Background(),
  955. request,
  956. )
  957. }
  958. // Duration type
  959. type Duration string