Completed
Push — master ( 2f9535...d18e54 )
by Olivier
03:53
created

CallMethodResult   A

Complexity

Total Complexity 15

Size/Duplication

Total Lines 76
Duplicated Lines 17.11 %

Test Coverage

Coverage 94%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 13
loc 76
ccs 47
cts 50
cp 0.94
rs 10
wmc 15

5 Methods

Rating   Name   Duplication   Size   Complexity  
A from_binary() 0 3 1
B _binary_init() 0 20 7
A to_binary() 13 13 4
A __str__() 0 5 1
A __init__() 0 10 2

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
'''
2
Autogenerate code from xml spec
3
'''
4
5 1
from datetime import datetime
6 1
from enum import Enum, IntEnum
7
8 1
from opcua.common.utils import Buffer
9 1
from opcua.ua.uaerrors import UaError
10 1
from opcua.ua.uatypes import *
11 1
from opcua.ua import ua_binary as uabin
12 1
from opcua.ua.object_ids import ObjectIds
13
14
15 1
class NamingRuleType(IntEnum):
16
    '''
17
    :ivar Mandatory:
18
    :vartype Mandatory: 1
19
    :ivar Optional:
20
    :vartype Optional: 2
21
    :ivar Constraint:
22
    :vartype Constraint: 3
23
    '''
24 1
    Mandatory = 1
25 1
    Optional = 2
26 1
    Constraint = 3
27
28
29 1
class OpenFileMode(IntEnum):
30
    '''
31
    :ivar Read:
32
    :vartype Read: 1
33
    :ivar Write:
34
    :vartype Write: 2
35
    :ivar EraseExisting:
36
    :vartype EraseExisting: 4
37
    :ivar Append:
38
    :vartype Append: 8
39
    '''
40 1
    Read = 1
41 1
    Write = 2
42 1
    EraseExisting = 4
43 1
    Append = 8
44
45
46 1
class TrustListMasks(IntEnum):
47
    '''
48
    :ivar None_:
49
    :vartype None_: 0
50
    :ivar TrustedCertificates:
51
    :vartype TrustedCertificates: 1
52
    :ivar TrustedCrls:
53
    :vartype TrustedCrls: 2
54
    :ivar IssuerCertificates:
55
    :vartype IssuerCertificates: 4
56
    :ivar IssuerCrls:
57
    :vartype IssuerCrls: 8
58
    :ivar All:
59
    :vartype All: 15
60
    '''
61 1
    None_ = 0
62 1
    TrustedCertificates = 1
63 1
    TrustedCrls = 2
64 1
    IssuerCertificates = 4
65 1
    IssuerCrls = 8
66 1
    All = 15
67
68
69 1
class IdType(IntEnum):
70
    '''
71
    The type of identifier used in a node id.
72
73
    :ivar Numeric:
74
    :vartype Numeric: 0
75
    :ivar String:
76
    :vartype String: 1
77
    :ivar Guid:
78
    :vartype Guid: 2
79
    :ivar Opaque:
80
    :vartype Opaque: 3
81
    '''
82 1
    Numeric = 0
83 1
    String = 1
84 1
    Guid = 2
85 1
    Opaque = 3
86
87
88 1
class NodeClass(IntEnum):
89
    '''
90
    A mask specifying the class of the node.
91
92
    :ivar Unspecified:
93
    :vartype Unspecified: 0
94
    :ivar Object:
95
    :vartype Object: 1
96
    :ivar Variable:
97
    :vartype Variable: 2
98
    :ivar Method:
99
    :vartype Method: 4
100
    :ivar ObjectType:
101
    :vartype ObjectType: 8
102
    :ivar VariableType:
103
    :vartype VariableType: 16
104
    :ivar ReferenceType:
105
    :vartype ReferenceType: 32
106
    :ivar DataType:
107
    :vartype DataType: 64
108
    :ivar View:
109
    :vartype View: 128
110
    '''
111 1
    Unspecified = 0
112 1
    Object = 1
113 1
    Variable = 2
114 1
    Method = 4
115 1
    ObjectType = 8
116 1
    VariableType = 16
117 1
    ReferenceType = 32
118 1
    DataType = 64
119 1
    View = 128
120
121
122 1
class ApplicationType(IntEnum):
123
    '''
124
    The types of applications.
125
126
    :ivar Server:
127
    :vartype Server: 0
128
    :ivar Client:
129
    :vartype Client: 1
130
    :ivar ClientAndServer:
131
    :vartype ClientAndServer: 2
132
    :ivar DiscoveryServer:
133
    :vartype DiscoveryServer: 3
134
    '''
135 1
    Server = 0
136 1
    Client = 1
137 1
    ClientAndServer = 2
138 1
    DiscoveryServer = 3
139
140
141 1
class MessageSecurityMode(IntEnum):
142
    '''
143
    The type of security to use on a message.
144
145
    :ivar Invalid:
146
    :vartype Invalid: 0
147
    :ivar None_:
148
    :vartype None_: 1
149
    :ivar Sign:
150
    :vartype Sign: 2
151
    :ivar SignAndEncrypt:
152
    :vartype SignAndEncrypt: 3
153
    '''
154 1
    Invalid = 0
155 1
    None_ = 1
156 1
    Sign = 2
157 1
    SignAndEncrypt = 3
158
159
160 1
class UserTokenType(IntEnum):
161
    '''
162
    The possible user token types.
163
164
    :ivar Anonymous:
165
    :vartype Anonymous: 0
166
    :ivar UserName:
167
    :vartype UserName: 1
168
    :ivar Certificate:
169
    :vartype Certificate: 2
170
    :ivar IssuedToken:
171
    :vartype IssuedToken: 3
172
    :ivar Kerberos:
173
    :vartype Kerberos: 4
174
    '''
175 1
    Anonymous = 0
176 1
    UserName = 1
177 1
    Certificate = 2
178 1
    IssuedToken = 3
179 1
    Kerberos = 4
180
181
182 1
class SecurityTokenRequestType(IntEnum):
183
    '''
184
    Indicates whether a token if being created or renewed.
185
186
    :ivar Issue:
187
    :vartype Issue: 0
188
    :ivar Renew:
189
    :vartype Renew: 1
190
    '''
191 1
    Issue = 0
192 1
    Renew = 1
193
194
195 1
class NodeAttributesMask(IntEnum):
196
    '''
197
    The bits used to specify default attributes for a new node.
198
199
    :ivar None_:
200
    :vartype None_: 0
201
    :ivar AccessLevel:
202
    :vartype AccessLevel: 1
203
    :ivar ArrayDimensions:
204
    :vartype ArrayDimensions: 2
205
    :ivar BrowseName:
206
    :vartype BrowseName: 4
207
    :ivar ContainsNoLoops:
208
    :vartype ContainsNoLoops: 8
209
    :ivar DataType:
210
    :vartype DataType: 16
211
    :ivar Description:
212
    :vartype Description: 32
213
    :ivar DisplayName:
214
    :vartype DisplayName: 64
215
    :ivar EventNotifier:
216
    :vartype EventNotifier: 128
217
    :ivar Executable:
218
    :vartype Executable: 256
219
    :ivar Historizing:
220
    :vartype Historizing: 512
221
    :ivar InverseName:
222
    :vartype InverseName: 1024
223
    :ivar IsAbstract:
224
    :vartype IsAbstract: 2048
225
    :ivar MinimumSamplingInterval:
226
    :vartype MinimumSamplingInterval: 4096
227
    :ivar NodeClass:
228
    :vartype NodeClass: 8192
229
    :ivar NodeId:
230
    :vartype NodeId: 16384
231
    :ivar Symmetric:
232
    :vartype Symmetric: 32768
233
    :ivar UserAccessLevel:
234
    :vartype UserAccessLevel: 65536
235
    :ivar UserExecutable:
236
    :vartype UserExecutable: 131072
237
    :ivar UserWriteMask:
238
    :vartype UserWriteMask: 262144
239
    :ivar ValueRank:
240
    :vartype ValueRank: 524288
241
    :ivar WriteMask:
242
    :vartype WriteMask: 1048576
243
    :ivar Value:
244
    :vartype Value: 2097152
245
    :ivar All:
246
    :vartype All: 4194303
247
    :ivar BaseNode:
248
    :vartype BaseNode: 1335396
249
    :ivar Object:
250
    :vartype Object: 1335524
251
    :ivar ObjectTypeOrDataType:
252
    :vartype ObjectTypeOrDataType: 1337444
253
    :ivar Variable:
254
    :vartype Variable: 4026999
255
    :ivar VariableType:
256
    :vartype VariableType: 3958902
257
    :ivar Method:
258
    :vartype Method: 1466724
259
    :ivar ReferenceType:
260
    :vartype ReferenceType: 1371236
261
    :ivar View:
262
    :vartype View: 1335532
263
    '''
264 1
    None_ = 0
265 1
    AccessLevel = 1
266 1
    ArrayDimensions = 2
267 1
    BrowseName = 4
268 1
    ContainsNoLoops = 8
269 1
    DataType = 16
270 1
    Description = 32
271 1
    DisplayName = 64
272 1
    EventNotifier = 128
273 1
    Executable = 256
274 1
    Historizing = 512
275 1
    InverseName = 1024
276 1
    IsAbstract = 2048
277 1
    MinimumSamplingInterval = 4096
278 1
    NodeClass = 8192
279 1
    NodeId = 16384
280 1
    Symmetric = 32768
281 1
    UserAccessLevel = 65536
282 1
    UserExecutable = 131072
283 1
    UserWriteMask = 262144
284 1
    ValueRank = 524288
285 1
    WriteMask = 1048576
286 1
    Value = 2097152
287 1
    All = 4194303
288 1
    BaseNode = 1335396
289 1
    Object = 1335524
290 1
    ObjectTypeOrDataType = 1337444
291 1
    Variable = 4026999
292 1
    VariableType = 3958902
293 1
    Method = 1466724
294 1
    ReferenceType = 1371236
295 1
    View = 1335532
296
297 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
298 1
class AttributeWriteMask(IntEnum):
299
    '''
300
    Define bits used to indicate which attributes are writable.
301
302
    :ivar None_:
303
    :vartype None_: 0
304
    :ivar AccessLevel:
305
    :vartype AccessLevel: 1
306
    :ivar ArrayDimensions:
307
    :vartype ArrayDimensions: 2
308
    :ivar BrowseName:
309
    :vartype BrowseName: 4
310
    :ivar ContainsNoLoops:
311
    :vartype ContainsNoLoops: 8
312
    :ivar DataType:
313
    :vartype DataType: 16
314
    :ivar Description:
315
    :vartype Description: 32
316
    :ivar DisplayName:
317
    :vartype DisplayName: 64
318
    :ivar EventNotifier:
319
    :vartype EventNotifier: 128
320
    :ivar Executable:
321
    :vartype Executable: 256
322
    :ivar Historizing:
323
    :vartype Historizing: 512
324
    :ivar InverseName:
325
    :vartype InverseName: 1024
326
    :ivar IsAbstract:
327
    :vartype IsAbstract: 2048
328
    :ivar MinimumSamplingInterval:
329
    :vartype MinimumSamplingInterval: 4096
330
    :ivar NodeClass:
331
    :vartype NodeClass: 8192
332
    :ivar NodeId:
333
    :vartype NodeId: 16384
334
    :ivar Symmetric:
335
    :vartype Symmetric: 32768
336
    :ivar UserAccessLevel:
337
    :vartype UserAccessLevel: 65536
338
    :ivar UserExecutable:
339
    :vartype UserExecutable: 131072
340
    :ivar UserWriteMask:
341
    :vartype UserWriteMask: 262144
342
    :ivar ValueRank:
343
    :vartype ValueRank: 524288
344
    :ivar WriteMask:
345
    :vartype WriteMask: 1048576
346
    :ivar ValueForVariableType:
347
    :vartype ValueForVariableType: 2097152
348
    '''
349 1
    None_ = 0
350 1
    AccessLevel = 1
351 1
    ArrayDimensions = 2
352 1
    BrowseName = 4
353 1
    ContainsNoLoops = 8
354 1
    DataType = 16
355 1
    Description = 32
356 1
    DisplayName = 64
357 1
    EventNotifier = 128
358 1
    Executable = 256
359 1
    Historizing = 512
360 1
    InverseName = 1024
361 1
    IsAbstract = 2048
362 1
    MinimumSamplingInterval = 4096
363 1
    NodeClass = 8192
364 1
    NodeId = 16384
365 1
    Symmetric = 32768
366 1
    UserAccessLevel = 65536
367 1
    UserExecutable = 131072
368 1
    UserWriteMask = 262144
369 1
    ValueRank = 524288
370 1
    WriteMask = 1048576
371 1
    ValueForVariableType = 2097152
372
373
374 1
class BrowseDirection(IntEnum):
375
    '''
376
    The directions of the references to return.
377
378
    :ivar Forward:
379
    :vartype Forward: 0
380
    :ivar Inverse:
381
    :vartype Inverse: 1
382
    :ivar Both:
383
    :vartype Both: 2
384
    '''
385 1
    Forward = 0
386 1
    Inverse = 1
387 1
    Both = 2
388
389
390 1
class BrowseResultMask(IntEnum):
391
    '''
392
    A bit mask which specifies what should be returned in a browse response.
393
394
    :ivar None_:
395
    :vartype None_: 0
396
    :ivar ReferenceTypeId:
397
    :vartype ReferenceTypeId: 1
398
    :ivar IsForward:
399
    :vartype IsForward: 2
400
    :ivar NodeClass:
401
    :vartype NodeClass: 4
402
    :ivar BrowseName:
403
    :vartype BrowseName: 8
404
    :ivar DisplayName:
405
    :vartype DisplayName: 16
406
    :ivar TypeDefinition:
407
    :vartype TypeDefinition: 32
408
    :ivar All:
409
    :vartype All: 63
410
    :ivar ReferenceTypeInfo:
411
    :vartype ReferenceTypeInfo: 3
412
    :ivar TargetInfo:
413
    :vartype TargetInfo: 60
414
    '''
415 1
    None_ = 0
416 1
    ReferenceTypeId = 1
417 1
    IsForward = 2
418 1
    NodeClass = 4
419 1
    BrowseName = 8
420 1
    DisplayName = 16
421 1
    TypeDefinition = 32
422 1
    All = 63
423 1
    ReferenceTypeInfo = 3
424 1
    TargetInfo = 60
425
426
427 1
class ComplianceLevel(IntEnum):
428
    '''
429
    :ivar Untested:
430
    :vartype Untested: 0
431
    :ivar Partial:
432
    :vartype Partial: 1
433
    :ivar SelfTested:
434
    :vartype SelfTested: 2
435
    :ivar Certified:
436
    :vartype Certified: 3
437
    '''
438 1
    Untested = 0
439 1
    Partial = 1
440 1
    SelfTested = 2
441 1
    Certified = 3
442
443
444 1
class FilterOperator(IntEnum):
445
    '''
446
    :ivar Equals:
447
    :vartype Equals: 0
448
    :ivar IsNull:
449
    :vartype IsNull: 1
450
    :ivar GreaterThan:
451
    :vartype GreaterThan: 2
452
    :ivar LessThan:
453
    :vartype LessThan: 3
454
    :ivar GreaterThanOrEqual:
455
    :vartype GreaterThanOrEqual: 4
456
    :ivar LessThanOrEqual:
457
    :vartype LessThanOrEqual: 5
458
    :ivar Like:
459
    :vartype Like: 6
460
    :ivar Not:
461
    :vartype Not: 7
462
    :ivar Between:
463
    :vartype Between: 8
464
    :ivar InList:
465
    :vartype InList: 9
466
    :ivar And:
467
    :vartype And: 10
468
    :ivar Or:
469
    :vartype Or: 11
470
    :ivar Cast:
471
    :vartype Cast: 12
472
    :ivar InView:
473
    :vartype InView: 13
474
    :ivar OfType:
475
    :vartype OfType: 14
476
    :ivar RelatedTo:
477
    :vartype RelatedTo: 15
478
    :ivar BitwiseAnd:
479
    :vartype BitwiseAnd: 16
480
    :ivar BitwiseOr:
481
    :vartype BitwiseOr: 17
482
    '''
483 1
    Equals = 0
484 1
    IsNull = 1
485 1
    GreaterThan = 2
486 1
    LessThan = 3
487 1
    GreaterThanOrEqual = 4
488 1
    LessThanOrEqual = 5
489 1
    Like = 6
490 1
    Not = 7
491 1
    Between = 8
492 1
    InList = 9
493 1
    And = 10
494 1
    Or = 11
495 1
    Cast = 12
496 1
    InView = 13
497 1
    OfType = 14
498 1
    RelatedTo = 15
499 1
    BitwiseAnd = 16
500 1
    BitwiseOr = 17
501
502
503 1
class TimestampsToReturn(IntEnum):
504
    '''
505
    :ivar Source:
506
    :vartype Source: 0
507
    :ivar Server:
508
    :vartype Server: 1
509
    :ivar Both:
510
    :vartype Both: 2
511
    :ivar Neither:
512
    :vartype Neither: 3
513
    '''
514 1
    Source = 0
515 1
    Server = 1
516 1
    Both = 2
517 1
    Neither = 3
518
519
520 1
class HistoryUpdateType(IntEnum):
521
    '''
522
    :ivar Insert:
523
    :vartype Insert: 1
524
    :ivar Replace:
525
    :vartype Replace: 2
526
    :ivar Update:
527
    :vartype Update: 3
528
    :ivar Delete:
529
    :vartype Delete: 4
530
    '''
531 1
    Insert = 1
532 1
    Replace = 2
533 1
    Update = 3
534 1
    Delete = 4
535
536
537 1
class PerformUpdateType(IntEnum):
538
    '''
539
    :ivar Insert:
540
    :vartype Insert: 1
541
    :ivar Replace:
542
    :vartype Replace: 2
543
    :ivar Update:
544
    :vartype Update: 3
545
    :ivar Remove:
546
    :vartype Remove: 4
547
    '''
548 1
    Insert = 1
549 1
    Replace = 2
550 1
    Update = 3
551 1
    Remove = 4
552
553
554 1
class MonitoringMode(IntEnum):
555
    '''
556
    :ivar Disabled:
557
    :vartype Disabled: 0
558
    :ivar Sampling:
559
    :vartype Sampling: 1
560
    :ivar Reporting:
561
    :vartype Reporting: 2
562
    '''
563 1
    Disabled = 0
564 1
    Sampling = 1
565 1
    Reporting = 2
566
567
568 1
class DataChangeTrigger(IntEnum):
569
    '''
570
    :ivar Status:
571
    :vartype Status: 0
572
    :ivar StatusValue:
573
    :vartype StatusValue: 1
574
    :ivar StatusValueTimestamp:
575
    :vartype StatusValueTimestamp: 2
576
    '''
577 1
    Status = 0
578 1
    StatusValue = 1
579 1
    StatusValueTimestamp = 2
580
581
582 1
class DeadbandType(IntEnum):
583
    '''
584
    :ivar None_:
585
    :vartype None_: 0
586
    :ivar Absolute:
587
    :vartype Absolute: 1
588
    :ivar Percent:
589
    :vartype Percent: 2
590
    '''
591 1
    None_ = 0
592 1
    Absolute = 1
593 1
    Percent = 2
594
595
596 1
class EnumeratedTestType(IntEnum):
597
    '''
598
    A simple enumerated type used for testing.
599
600
    :ivar Red:
601
    :vartype Red: 1
602
    :ivar Yellow:
603
    :vartype Yellow: 4
604
    :ivar Green:
605
    :vartype Green: 5
606
    '''
607 1
    Red = 1
608 1
    Yellow = 4
609 1
    Green = 5
610
611
612 1
class RedundancySupport(IntEnum):
613
    '''
614
    :ivar None_:
615
    :vartype None_: 0
616
    :ivar Cold:
617
    :vartype Cold: 1
618
    :ivar Warm:
619
    :vartype Warm: 2
620
    :ivar Hot:
621
    :vartype Hot: 3
622
    :ivar Transparent:
623
    :vartype Transparent: 4
624
    :ivar HotAndMirrored:
625
    :vartype HotAndMirrored: 5
626
    '''
627 1
    None_ = 0
628 1
    Cold = 1
629 1
    Warm = 2
630 1
    Hot = 3
631 1
    Transparent = 4
632 1
    HotAndMirrored = 5
633
634
635 1
class ServerState(IntEnum):
636
    '''
637
    :ivar Running:
638
    :vartype Running: 0
639
    :ivar Failed:
640
    :vartype Failed: 1
641
    :ivar NoConfiguration:
642
    :vartype NoConfiguration: 2
643
    :ivar Suspended:
644
    :vartype Suspended: 3
645
    :ivar Shutdown:
646
    :vartype Shutdown: 4
647
    :ivar Test:
648
    :vartype Test: 5
649
    :ivar CommunicationFault:
650
    :vartype CommunicationFault: 6
651
    :ivar Unknown:
652
    :vartype Unknown: 7
653
    '''
654 1
    Running = 0
655 1
    Failed = 1
656 1
    NoConfiguration = 2
657 1
    Suspended = 3
658 1
    Shutdown = 4
659 1
    Test = 5
660 1
    CommunicationFault = 6
661 1
    Unknown = 7
662
663
664 1
class ModelChangeStructureVerbMask(IntEnum):
665
    '''
666
    :ivar NodeAdded:
667
    :vartype NodeAdded: 1
668
    :ivar NodeDeleted:
669
    :vartype NodeDeleted: 2
670
    :ivar ReferenceAdded:
671
    :vartype ReferenceAdded: 4
672
    :ivar ReferenceDeleted:
673
    :vartype ReferenceDeleted: 8
674
    :ivar DataTypeChanged:
675
    :vartype DataTypeChanged: 16
676
    '''
677 1
    NodeAdded = 1
678 1
    NodeDeleted = 2
679 1
    ReferenceAdded = 4
680 1
    ReferenceDeleted = 8
681 1
    DataTypeChanged = 16
682
683
684 1
class AxisScaleEnumeration(IntEnum):
685
    '''
686
    :ivar Linear:
687
    :vartype Linear: 0
688
    :ivar Log:
689
    :vartype Log: 1
690
    :ivar Ln:
691
    :vartype Ln: 2
692
    '''
693 1
    Linear = 0
694 1
    Log = 1
695 1
    Ln = 2
696
697
698 1
class ExceptionDeviationFormat(IntEnum):
699
    '''
700
    :ivar AbsoluteValue:
701
    :vartype AbsoluteValue: 0
702
    :ivar PercentOfValue:
703
    :vartype PercentOfValue: 1
704
    :ivar PercentOfRange:
705
    :vartype PercentOfRange: 2
706
    :ivar PercentOfEURange:
707
    :vartype PercentOfEURange: 3
708
    :ivar Unknown:
709
    :vartype Unknown: 4
710
    '''
711 1
    AbsoluteValue = 0
712 1
    PercentOfValue = 1
713 1
    PercentOfRange = 2
714 1
    PercentOfEURange = 3
715 1
    Unknown = 4
716
717
718 1
class DiagnosticInfo(FrozenClass):
719
    '''
720
    A recursive structure containing diagnostic information associated with a status code.
721
722
    :ivar Encoding:
723
    :vartype Encoding: UInt8
724
    :ivar SymbolicId:
725
    :vartype SymbolicId: Int32
726
    :ivar NamespaceURI:
727
    :vartype NamespaceURI: Int32
728
    :ivar Locale:
729
    :vartype Locale: Int32
730
    :ivar LocalizedText:
731
    :vartype LocalizedText: Int32
732
    :ivar AdditionalInfo:
733
    :vartype AdditionalInfo: CharArray
734
    :ivar InnerStatusCode:
735
    :vartype InnerStatusCode: StatusCode
736
    :ivar InnerDiagnosticInfo:
737
    :vartype InnerDiagnosticInfo: DiagnosticInfo
738
    '''
739
740 1
    ua_types = {
741
        'Encoding': 'UInt8',
742
        'SymbolicId': 'Int32',
743
        'NamespaceURI': 'Int32',
744
        'Locale': 'Int32',
745
        'LocalizedText': 'Int32',
746
        'AdditionalInfo': 'CharArray',
747
        'InnerStatusCode': 'StatusCode',
748
        'InnerDiagnosticInfo': 'DiagnosticInfo',
749
               }
750
751 1
    def __init__(self, binary=None):
752 1
        if binary is not None:
753 1
            self._binary_init(binary)
754 1
            self._freeze = True
755 1
            return
756 1
        self.Encoding = 0
757 1
        self.SymbolicId = 0
758 1
        self.NamespaceURI = 0
759 1
        self.Locale = 0
760 1
        self.LocalizedText = 0
761 1
        self.AdditionalInfo = None
762 1
        self.InnerStatusCode = StatusCode()
763 1
        self.InnerDiagnosticInfo = None
764 1
        self._freeze = True
765
766 1
    def to_binary(self):
767 1
        packet = []
768 1
        if self.SymbolicId: self.Encoding |= (1 << 0)
769 1
        if self.NamespaceURI: self.Encoding |= (1 << 1)
770 1
        if self.Locale: self.Encoding |= (1 << 2)
771 1
        if self.LocalizedText: self.Encoding |= (1 << 3)
772 1
        if self.AdditionalInfo: self.Encoding |= (1 << 4)
773 1
        if self.InnerStatusCode: self.Encoding |= (1 << 5)
774 1
        if self.InnerDiagnosticInfo: self.Encoding |= (1 << 6)
775 1
        packet.append(uabin.Primitives.UInt8.pack(self.Encoding))
776 1
        if self.SymbolicId: 
777
            packet.append(uabin.Primitives.Int32.pack(self.SymbolicId))
778 1
        if self.NamespaceURI: 
779
            packet.append(uabin.Primitives.Int32.pack(self.NamespaceURI))
780 1
        if self.Locale: 
781
            packet.append(uabin.Primitives.Int32.pack(self.Locale))
782 1
        if self.LocalizedText: 
783
            packet.append(uabin.Primitives.Int32.pack(self.LocalizedText))
784 1
        if self.AdditionalInfo: 
785
            packet.append(uabin.Primitives.CharArray.pack(self.AdditionalInfo))
786 1
        if self.InnerStatusCode: 
787 1
            packet.append(self.InnerStatusCode.to_binary())
788 1
        if self.InnerDiagnosticInfo: 
789
            packet.append(self.InnerDiagnosticInfo.to_binary())
790 1
        return b''.join(packet)
791
792 1
    @staticmethod
793
    def from_binary(data):
794 1
        return DiagnosticInfo(data)
795
796 1
    def _binary_init(self, data):
797 1
        self.Encoding = uabin.Primitives.UInt8.unpack(data)
798 1
        if self.Encoding & (1 << 0):
799
            self.SymbolicId = uabin.Primitives.Int32.unpack(data)
800
        else:
801 1
            self.SymbolicId = 0
802 1
        if self.Encoding & (1 << 1):
803
            self.NamespaceURI = uabin.Primitives.Int32.unpack(data)
804
        else:
805 1
            self.NamespaceURI = 0
806 1
        if self.Encoding & (1 << 2):
807
            self.Locale = uabin.Primitives.Int32.unpack(data)
808
        else:
809 1
            self.Locale = 0
810 1
        if self.Encoding & (1 << 3):
811
            self.LocalizedText = uabin.Primitives.Int32.unpack(data)
812
        else:
813 1
            self.LocalizedText = 0
814 1
        if self.Encoding & (1 << 4):
815
            self.AdditionalInfo = uabin.Primitives.CharArray.unpack(data)
816
        else:
817 1
            self.AdditionalInfo = None
818 1
        if self.Encoding & (1 << 5):
819 1
            self.InnerStatusCode = StatusCode.from_binary(data)
820
        else:
821
            self.InnerStatusCode = StatusCode()
822 1
        if self.Encoding & (1 << 6):
823
            self.InnerDiagnosticInfo = DiagnosticInfo.from_binary(data)
824
        else:
825 1
            self.InnerDiagnosticInfo = None
826
827 1
    def __str__(self):
828
        return 'DiagnosticInfo(' + 'Encoding:' + str(self.Encoding) + ', ' + \
829
               'SymbolicId:' + str(self.SymbolicId) + ', ' + \
830
               'NamespaceURI:' + str(self.NamespaceURI) + ', ' + \
831
               'Locale:' + str(self.Locale) + ', ' + \
832
               'LocalizedText:' + str(self.LocalizedText) + ', ' + \
833
               'AdditionalInfo:' + str(self.AdditionalInfo) + ', ' + \
834
               'InnerStatusCode:' + str(self.InnerStatusCode) + ', ' + \
835
               'InnerDiagnosticInfo:' + str(self.InnerDiagnosticInfo) + ')'
836
837 1
    __repr__ = __str__
838
839
840 1
class TrustListDataType(FrozenClass):
841
    '''
842
    :ivar SpecifiedLists:
843
    :vartype SpecifiedLists: UInt32
844
    :ivar TrustedCertificates:
845
    :vartype TrustedCertificates: ByteString
846
    :ivar TrustedCrls:
847
    :vartype TrustedCrls: ByteString
848
    :ivar IssuerCertificates:
849
    :vartype IssuerCertificates: ByteString
850
    :ivar IssuerCrls:
851
    :vartype IssuerCrls: ByteString
852
    '''
853
854 1
    ua_types = {
855
        'SpecifiedLists': 'UInt32',
856
        'TrustedCertificates': 'ByteString',
857
        'TrustedCrls': 'ByteString',
858
        'IssuerCertificates': 'ByteString',
859
        'IssuerCrls': 'ByteString',
860
               }
861
862 1
    def __init__(self, binary=None):
863
        if binary is not None:
864
            self._binary_init(binary)
865
            self._freeze = True
866
            return
867
        self.SpecifiedLists = 0
868
        self.TrustedCertificates = []
869
        self.TrustedCrls = []
870
        self.IssuerCertificates = []
871
        self.IssuerCrls = []
872
        self._freeze = True
873
874 1
    def to_binary(self):
875
        packet = []
876
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedLists))
877
        packet.append(uabin.Primitives.Int32.pack(len(self.TrustedCertificates)))
878
        for fieldname in self.TrustedCertificates:
879
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
880
        packet.append(uabin.Primitives.Int32.pack(len(self.TrustedCrls)))
881
        for fieldname in self.TrustedCrls:
882
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
883
        packet.append(uabin.Primitives.Int32.pack(len(self.IssuerCertificates)))
884
        for fieldname in self.IssuerCertificates:
885
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
886
        packet.append(uabin.Primitives.Int32.pack(len(self.IssuerCrls)))
887
        for fieldname in self.IssuerCrls:
888
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
889
        return b''.join(packet)
890
891 1
    @staticmethod
892
    def from_binary(data):
893
        return TrustListDataType(data)
894
895 1
    def _binary_init(self, data):
896
        self.SpecifiedLists = uabin.Primitives.UInt32.unpack(data)
897
        self.TrustedCertificates = uabin.Primitives.ByteString.unpack_array(data)
898
        self.TrustedCrls = uabin.Primitives.ByteString.unpack_array(data)
899
        self.IssuerCertificates = uabin.Primitives.ByteString.unpack_array(data)
900
        self.IssuerCrls = uabin.Primitives.ByteString.unpack_array(data)
901
902 1
    def __str__(self):
903
        return 'TrustListDataType(' + 'SpecifiedLists:' + str(self.SpecifiedLists) + ', ' + \
904
               'TrustedCertificates:' + str(self.TrustedCertificates) + ', ' + \
905
               'TrustedCrls:' + str(self.TrustedCrls) + ', ' + \
906
               'IssuerCertificates:' + str(self.IssuerCertificates) + ', ' + \
907
               'IssuerCrls:' + str(self.IssuerCrls) + ')'
908
909 1
    __repr__ = __str__
910
911
912 1 View Code Duplication
class Argument(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
913
    '''
914
    An argument for a method.
915
916
    :ivar Name:
917
    :vartype Name: String
918
    :ivar DataType:
919
    :vartype DataType: NodeId
920
    :ivar ValueRank:
921
    :vartype ValueRank: Int32
922
    :ivar ArrayDimensions:
923
    :vartype ArrayDimensions: UInt32
924
    :ivar Description:
925
    :vartype Description: LocalizedText
926
    '''
927
928 1
    ua_types = {
929
        'Name': 'String',
930
        'DataType': 'NodeId',
931
        'ValueRank': 'Int32',
932
        'ArrayDimensions': 'UInt32',
933
        'Description': 'LocalizedText',
934
               }
935
936 1
    def __init__(self, binary=None):
937 1
        if binary is not None:
938 1
            self._binary_init(binary)
939 1
            self._freeze = True
940 1
            return
941 1
        self.Name = None
942 1
        self.DataType = NodeId()
943 1
        self.ValueRank = 0
944 1
        self.ArrayDimensions = []
945 1
        self.Description = LocalizedText()
946 1
        self._freeze = True
947
948 1
    def to_binary(self):
949 1
        packet = []
950 1
        packet.append(uabin.Primitives.String.pack(self.Name))
951 1
        packet.append(self.DataType.to_binary())
952 1
        packet.append(uabin.Primitives.Int32.pack(self.ValueRank))
953 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ArrayDimensions)))
954 1
        for fieldname in self.ArrayDimensions:
955
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
956 1
        packet.append(self.Description.to_binary())
957 1
        return b''.join(packet)
958
959 1
    @staticmethod
960
    def from_binary(data):
961 1
        return Argument(data)
962
963 1
    def _binary_init(self, data):
964 1
        self.Name = uabin.Primitives.String.unpack(data)
965 1
        self.DataType = NodeId.from_binary(data)
966 1
        self.ValueRank = uabin.Primitives.Int32.unpack(data)
967 1
        self.ArrayDimensions = uabin.Primitives.UInt32.unpack_array(data)
968 1
        self.Description = LocalizedText.from_binary(data)
969
970 1
    def __str__(self):
971
        return 'Argument(' + 'Name:' + str(self.Name) + ', ' + \
972
               'DataType:' + str(self.DataType) + ', ' + \
973
               'ValueRank:' + str(self.ValueRank) + ', ' + \
974
               'ArrayDimensions:' + str(self.ArrayDimensions) + ', ' + \
975
               'Description:' + str(self.Description) + ')'
976
977 1
    __repr__ = __str__
978
979
980 1 View Code Duplication
class EnumValueType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
981
    '''
982
    A mapping between a value of an enumerated type and a name and description.
983
984
    :ivar Value:
985
    :vartype Value: Int64
986
    :ivar DisplayName:
987
    :vartype DisplayName: LocalizedText
988
    :ivar Description:
989
    :vartype Description: LocalizedText
990
    '''
991
992 1
    ua_types = {
993
        'Value': 'Int64',
994
        'DisplayName': 'LocalizedText',
995
        'Description': 'LocalizedText',
996
               }
997
998 1
    def __init__(self, binary=None):
999 1
        if binary is not None:
1000
            self._binary_init(binary)
1001
            self._freeze = True
1002
            return
1003 1
        self.Value = 0
1004 1
        self.DisplayName = LocalizedText()
1005 1
        self.Description = LocalizedText()
1006 1
        self._freeze = True
1007
1008 1
    def to_binary(self):
1009
        packet = []
1010
        packet.append(uabin.Primitives.Int64.pack(self.Value))
1011
        packet.append(self.DisplayName.to_binary())
1012
        packet.append(self.Description.to_binary())
1013
        return b''.join(packet)
1014
1015 1
    @staticmethod
1016
    def from_binary(data):
1017
        return EnumValueType(data)
1018
1019 1
    def _binary_init(self, data):
1020
        self.Value = uabin.Primitives.Int64.unpack(data)
1021
        self.DisplayName = LocalizedText.from_binary(data)
1022
        self.Description = LocalizedText.from_binary(data)
1023
1024 1
    def __str__(self):
1025
        return 'EnumValueType(' + 'Value:' + str(self.Value) + ', ' + \
1026
               'DisplayName:' + str(self.DisplayName) + ', ' + \
1027
               'Description:' + str(self.Description) + ')'
1028
1029 1
    __repr__ = __str__
1030
1031
1032 1 View Code Duplication
class OptionSet(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1033
    '''
1034
    This abstract Structured DataType is the base DataType for all DataTypes representing a bit mask.
1035
1036
    :ivar Value:
1037
    :vartype Value: ByteString
1038
    :ivar ValidBits:
1039
    :vartype ValidBits: ByteString
1040
    '''
1041
1042 1
    ua_types = {
1043
        'Value': 'ByteString',
1044
        'ValidBits': 'ByteString',
1045
               }
1046
1047 1
    def __init__(self, binary=None):
1048
        if binary is not None:
1049
            self._binary_init(binary)
1050
            self._freeze = True
1051
            return
1052
        self.Value = None
1053
        self.ValidBits = None
1054
        self._freeze = True
1055
1056 1
    def to_binary(self):
1057
        packet = []
1058
        packet.append(uabin.Primitives.ByteString.pack(self.Value))
1059
        packet.append(uabin.Primitives.ByteString.pack(self.ValidBits))
1060
        return b''.join(packet)
1061
1062 1
    @staticmethod
1063
    def from_binary(data):
1064
        return OptionSet(data)
1065
1066 1
    def _binary_init(self, data):
1067
        self.Value = uabin.Primitives.ByteString.unpack(data)
1068
        self.ValidBits = uabin.Primitives.ByteString.unpack(data)
1069
1070 1
    def __str__(self):
1071
        return 'OptionSet(' + 'Value:' + str(self.Value) + ', ' + \
1072
               'ValidBits:' + str(self.ValidBits) + ')'
1073
1074 1
    __repr__ = __str__
1075
1076
1077 1 View Code Duplication
class Union(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1078
    '''
1079
    This abstract DataType is the base DataType for all union DataTypes.
1080
1081
    '''
1082
1083 1
    ua_types = {
1084
               }
1085
1086 1
    def __init__(self, binary=None):
1087
        if binary is not None:
1088
            self._binary_init(binary)
1089
            self._freeze = True
1090
            return
1091
        self._freeze = True
1092
1093 1
    def to_binary(self):
1094
        packet = []
1095
        return b''.join(packet)
1096
1097 1
    @staticmethod
1098
    def from_binary(data):
1099
        return Union(data)
1100
1101 1
    def _binary_init(self, data):
1102
        pass
1103
1104 1
    def __str__(self):
1105
        return 'Union(' +  + ')'
1106
1107 1
    __repr__ = __str__
1108
1109
1110 1 View Code Duplication
class TimeZoneDataType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1111
    '''
1112
    :ivar Offset:
1113
    :vartype Offset: Int16
1114
    :ivar DaylightSavingInOffset:
1115
    :vartype DaylightSavingInOffset: Boolean
1116
    '''
1117
1118 1
    ua_types = {
1119
        'Offset': 'Int16',
1120
        'DaylightSavingInOffset': 'Boolean',
1121
               }
1122
1123 1
    def __init__(self, binary=None):
1124
        if binary is not None:
1125
            self._binary_init(binary)
1126
            self._freeze = True
1127
            return
1128
        self.Offset = 0
1129
        self.DaylightSavingInOffset = True
1130
        self._freeze = True
1131
1132 1
    def to_binary(self):
1133
        packet = []
1134
        packet.append(uabin.Primitives.Int16.pack(self.Offset))
1135
        packet.append(uabin.Primitives.Boolean.pack(self.DaylightSavingInOffset))
1136
        return b''.join(packet)
1137
1138 1
    @staticmethod
1139
    def from_binary(data):
1140
        return TimeZoneDataType(data)
1141
1142 1
    def _binary_init(self, data):
1143
        self.Offset = uabin.Primitives.Int16.unpack(data)
1144
        self.DaylightSavingInOffset = uabin.Primitives.Boolean.unpack(data)
1145
1146 1
    def __str__(self):
1147
        return 'TimeZoneDataType(' + 'Offset:' + str(self.Offset) + ', ' + \
1148
               'DaylightSavingInOffset:' + str(self.DaylightSavingInOffset) + ')'
1149
1150 1
    __repr__ = __str__
1151
1152
1153 1
class ApplicationDescription(FrozenClass):
1154
    '''
1155
    Describes an application and how to find it.
1156
1157
    :ivar ApplicationUri:
1158
    :vartype ApplicationUri: String
1159
    :ivar ProductUri:
1160
    :vartype ProductUri: String
1161
    :ivar ApplicationName:
1162
    :vartype ApplicationName: LocalizedText
1163
    :ivar ApplicationType:
1164
    :vartype ApplicationType: ApplicationType
1165
    :ivar GatewayServerUri:
1166
    :vartype GatewayServerUri: String
1167
    :ivar DiscoveryProfileUri:
1168
    :vartype DiscoveryProfileUri: String
1169
    :ivar DiscoveryUrls:
1170
    :vartype DiscoveryUrls: String
1171
    '''
1172
1173 1
    ua_types = {
1174
        'ApplicationUri': 'String',
1175
        'ProductUri': 'String',
1176
        'ApplicationName': 'LocalizedText',
1177
        'ApplicationType': 'ApplicationType',
1178
        'GatewayServerUri': 'String',
1179
        'DiscoveryProfileUri': 'String',
1180
        'DiscoveryUrls': 'String',
1181
               }
1182
1183 1
    def __init__(self, binary=None):
1184 1
        if binary is not None:
1185 1
            self._binary_init(binary)
1186 1
            self._freeze = True
1187 1
            return
1188 1
        self.ApplicationUri = None
1189 1
        self.ProductUri = None
1190 1
        self.ApplicationName = LocalizedText()
1191 1
        self.ApplicationType = ApplicationType(0)
1192 1
        self.GatewayServerUri = None
1193 1
        self.DiscoveryProfileUri = None
1194 1
        self.DiscoveryUrls = []
1195 1
        self._freeze = True
1196
1197 1 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1198 1
        packet = []
1199 1
        packet.append(uabin.Primitives.String.pack(self.ApplicationUri))
1200 1
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
1201 1
        packet.append(self.ApplicationName.to_binary())
1202 1
        packet.append(uabin.Primitives.UInt32.pack(self.ApplicationType.value))
1203 1
        packet.append(uabin.Primitives.String.pack(self.GatewayServerUri))
1204 1
        packet.append(uabin.Primitives.String.pack(self.DiscoveryProfileUri))
1205 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiscoveryUrls)))
1206 1
        for fieldname in self.DiscoveryUrls:
1207 1
            packet.append(uabin.Primitives.String.pack(fieldname))
1208 1
        return b''.join(packet)
1209
1210 1
    @staticmethod
1211
    def from_binary(data):
1212 1
        return ApplicationDescription(data)
1213
1214 1
    def _binary_init(self, data):
1215 1
        self.ApplicationUri = uabin.Primitives.String.unpack(data)
1216 1
        self.ProductUri = uabin.Primitives.String.unpack(data)
1217 1
        self.ApplicationName = LocalizedText.from_binary(data)
1218 1
        self.ApplicationType = ApplicationType(uabin.Primitives.UInt32.unpack(data))
1219 1
        self.GatewayServerUri = uabin.Primitives.String.unpack(data)
1220 1
        self.DiscoveryProfileUri = uabin.Primitives.String.unpack(data)
1221 1
        self.DiscoveryUrls = uabin.Primitives.String.unpack_array(data)
1222
1223 1
    def __str__(self):
1224
        return 'ApplicationDescription(' + 'ApplicationUri:' + str(self.ApplicationUri) + ', ' + \
1225
               'ProductUri:' + str(self.ProductUri) + ', ' + \
1226
               'ApplicationName:' + str(self.ApplicationName) + ', ' + \
1227
               'ApplicationType:' + str(self.ApplicationType) + ', ' + \
1228
               'GatewayServerUri:' + str(self.GatewayServerUri) + ', ' + \
1229
               'DiscoveryProfileUri:' + str(self.DiscoveryProfileUri) + ', ' + \
1230
               'DiscoveryUrls:' + str(self.DiscoveryUrls) + ')'
1231
1232 1
    __repr__ = __str__
1233
1234
1235 1
class RequestHeader(FrozenClass):
1236
    '''
1237
    The header passed with every server request.
1238
1239
    :ivar AuthenticationToken:
1240
    :vartype AuthenticationToken: NodeId
1241
    :ivar Timestamp:
1242
    :vartype Timestamp: DateTime
1243
    :ivar RequestHandle:
1244
    :vartype RequestHandle: UInt32
1245
    :ivar ReturnDiagnostics:
1246
    :vartype ReturnDiagnostics: UInt32
1247
    :ivar AuditEntryId:
1248
    :vartype AuditEntryId: String
1249
    :ivar TimeoutHint:
1250
    :vartype TimeoutHint: UInt32
1251
    :ivar AdditionalHeader:
1252
    :vartype AdditionalHeader: ExtensionObject
1253
    '''
1254
1255 1
    ua_types = {
1256
        'AuthenticationToken': 'NodeId',
1257
        'Timestamp': 'DateTime',
1258
        'RequestHandle': 'UInt32',
1259
        'ReturnDiagnostics': 'UInt32',
1260
        'AuditEntryId': 'String',
1261
        'TimeoutHint': 'UInt32',
1262
        'AdditionalHeader': 'ExtensionObject',
1263
               }
1264
1265 1
    def __init__(self, binary=None):
1266 1
        if binary is not None:
1267 1
            self._binary_init(binary)
1268 1
            self._freeze = True
1269 1
            return
1270 1
        self.AuthenticationToken = NodeId()
1271 1
        self.Timestamp = datetime.now()
1272 1
        self.RequestHandle = 0
1273 1
        self.ReturnDiagnostics = 0
1274 1
        self.AuditEntryId = None
1275 1
        self.TimeoutHint = 0
1276 1
        self.AdditionalHeader = None
1277 1
        self._freeze = True
1278
1279 1
    def to_binary(self):
1280 1
        packet = []
1281 1
        packet.append(self.AuthenticationToken.to_binary())
1282 1
        packet.append(uabin.Primitives.DateTime.pack(self.Timestamp))
1283 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestHandle))
1284 1
        packet.append(uabin.Primitives.UInt32.pack(self.ReturnDiagnostics))
1285 1
        packet.append(uabin.Primitives.String.pack(self.AuditEntryId))
1286 1
        packet.append(uabin.Primitives.UInt32.pack(self.TimeoutHint))
1287 1
        packet.append(extensionobject_to_binary(self.AdditionalHeader))
1288 1
        return b''.join(packet)
1289
1290 1
    @staticmethod
1291
    def from_binary(data):
1292 1
        return RequestHeader(data)
1293
1294 1
    def _binary_init(self, data):
1295 1
        self.AuthenticationToken = NodeId.from_binary(data)
1296 1
        self.Timestamp = uabin.Primitives.DateTime.unpack(data)
1297 1
        self.RequestHandle = uabin.Primitives.UInt32.unpack(data)
1298 1
        self.ReturnDiagnostics = uabin.Primitives.UInt32.unpack(data)
1299 1
        self.AuditEntryId = uabin.Primitives.String.unpack(data)
1300 1
        self.TimeoutHint = uabin.Primitives.UInt32.unpack(data)
1301 1
        self.AdditionalHeader = extensionobject_from_binary(data)
1302
1303 1
    def __str__(self):
1304
        return 'RequestHeader(' + 'AuthenticationToken:' + str(self.AuthenticationToken) + ', ' + \
1305
               'Timestamp:' + str(self.Timestamp) + ', ' + \
1306
               'RequestHandle:' + str(self.RequestHandle) + ', ' + \
1307
               'ReturnDiagnostics:' + str(self.ReturnDiagnostics) + ', ' + \
1308
               'AuditEntryId:' + str(self.AuditEntryId) + ', ' + \
1309
               'TimeoutHint:' + str(self.TimeoutHint) + ', ' + \
1310
               'AdditionalHeader:' + str(self.AdditionalHeader) + ')'
1311
1312 1
    __repr__ = __str__
1313
1314
1315 1 View Code Duplication
class ResponseHeader(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1316
    '''
1317
    The header passed with every server response.
1318
1319
    :ivar Timestamp:
1320
    :vartype Timestamp: DateTime
1321
    :ivar RequestHandle:
1322
    :vartype RequestHandle: UInt32
1323
    :ivar ServiceResult:
1324
    :vartype ServiceResult: StatusCode
1325
    :ivar ServiceDiagnostics:
1326
    :vartype ServiceDiagnostics: DiagnosticInfo
1327
    :ivar StringTable:
1328
    :vartype StringTable: String
1329
    :ivar AdditionalHeader:
1330
    :vartype AdditionalHeader: ExtensionObject
1331
    '''
1332
1333 1
    ua_types = {
1334
        'Timestamp': 'DateTime',
1335
        'RequestHandle': 'UInt32',
1336
        'ServiceResult': 'StatusCode',
1337
        'ServiceDiagnostics': 'DiagnosticInfo',
1338
        'StringTable': 'String',
1339
        'AdditionalHeader': 'ExtensionObject',
1340
               }
1341
1342 1
    def __init__(self, binary=None):
1343 1
        if binary is not None:
1344 1
            self._binary_init(binary)
1345 1
            self._freeze = True
1346 1
            return
1347 1
        self.Timestamp = datetime.now()
1348 1
        self.RequestHandle = 0
1349 1
        self.ServiceResult = StatusCode()
1350 1
        self.ServiceDiagnostics = DiagnosticInfo()
1351 1
        self.StringTable = []
1352 1
        self.AdditionalHeader = None
1353 1
        self._freeze = True
1354
1355 1
    def to_binary(self):
1356 1
        packet = []
1357 1
        packet.append(uabin.Primitives.DateTime.pack(self.Timestamp))
1358 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestHandle))
1359 1
        packet.append(self.ServiceResult.to_binary())
1360 1
        packet.append(self.ServiceDiagnostics.to_binary())
1361 1
        packet.append(uabin.Primitives.Int32.pack(len(self.StringTable)))
1362 1
        for fieldname in self.StringTable:
1363
            packet.append(uabin.Primitives.String.pack(fieldname))
1364 1
        packet.append(extensionobject_to_binary(self.AdditionalHeader))
1365 1
        return b''.join(packet)
1366
1367 1
    @staticmethod
1368
    def from_binary(data):
1369 1
        return ResponseHeader(data)
1370
1371 1
    def _binary_init(self, data):
1372 1
        self.Timestamp = uabin.Primitives.DateTime.unpack(data)
1373 1
        self.RequestHandle = uabin.Primitives.UInt32.unpack(data)
1374 1
        self.ServiceResult = StatusCode.from_binary(data)
1375 1
        self.ServiceDiagnostics = DiagnosticInfo.from_binary(data)
1376 1
        self.StringTable = uabin.Primitives.String.unpack_array(data)
1377 1
        self.AdditionalHeader = extensionobject_from_binary(data)
1378
1379 1
    def __str__(self):
1380
        return 'ResponseHeader(' + 'Timestamp:' + str(self.Timestamp) + ', ' + \
1381
               'RequestHandle:' + str(self.RequestHandle) + ', ' + \
1382
               'ServiceResult:' + str(self.ServiceResult) + ', ' + \
1383
               'ServiceDiagnostics:' + str(self.ServiceDiagnostics) + ', ' + \
1384
               'StringTable:' + str(self.StringTable) + ', ' + \
1385
               'AdditionalHeader:' + str(self.AdditionalHeader) + ')'
1386
1387 1
    __repr__ = __str__
1388
1389
1390 1 View Code Duplication
class ServiceFault(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1391
    '''
1392
    The response returned by all services when there is a service level error.
1393
1394
    :ivar TypeId:
1395
    :vartype TypeId: NodeId
1396
    :ivar ResponseHeader:
1397
    :vartype ResponseHeader: ResponseHeader
1398
    '''
1399
1400 1
    ua_types = {
1401
        'TypeId': 'NodeId',
1402
        'ResponseHeader': 'ResponseHeader',
1403
               }
1404
1405 1
    def __init__(self, binary=None):
1406 1
        if binary is not None:
1407
            self._binary_init(binary)
1408
            self._freeze = True
1409
            return
1410 1
        self.TypeId = FourByteNodeId(ObjectIds.ServiceFault_Encoding_DefaultBinary)
1411 1
        self.ResponseHeader = ResponseHeader()
1412 1
        self._freeze = True
1413
1414 1
    def to_binary(self):
1415 1
        packet = []
1416 1
        packet.append(self.TypeId.to_binary())
1417 1
        packet.append(self.ResponseHeader.to_binary())
1418 1
        return b''.join(packet)
1419
1420 1
    @staticmethod
1421
    def from_binary(data):
1422
        return ServiceFault(data)
1423
1424 1
    def _binary_init(self, data):
1425
        self.TypeId = NodeId.from_binary(data)
1426
        self.ResponseHeader = ResponseHeader.from_binary(data)
1427
1428 1
    def __str__(self):
1429
        return 'ServiceFault(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1430
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
1431
1432 1
    __repr__ = __str__
1433
1434
1435 1 View Code Duplication
class FindServersParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1436
    '''
1437
    :ivar EndpointUrl:
1438
    :vartype EndpointUrl: String
1439
    :ivar LocaleIds:
1440
    :vartype LocaleIds: String
1441
    :ivar ServerUris:
1442
    :vartype ServerUris: String
1443
    '''
1444
1445 1
    ua_types = {
1446
        'EndpointUrl': 'String',
1447
        'LocaleIds': 'String',
1448
        'ServerUris': 'String',
1449
               }
1450
1451 1
    def __init__(self, binary=None):
1452 1
        if binary is not None:
1453 1
            self._binary_init(binary)
1454 1
            self._freeze = True
1455 1
            return
1456 1
        self.EndpointUrl = None
1457 1
        self.LocaleIds = []
1458 1
        self.ServerUris = []
1459 1
        self._freeze = True
1460
1461 1
    def to_binary(self):
1462 1
        packet = []
1463 1
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
1464 1
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
1465 1
        for fieldname in self.LocaleIds:
1466
            packet.append(uabin.Primitives.String.pack(fieldname))
1467 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerUris)))
1468 1
        for fieldname in self.ServerUris:
1469 1
            packet.append(uabin.Primitives.String.pack(fieldname))
1470 1
        return b''.join(packet)
1471
1472 1
    @staticmethod
1473
    def from_binary(data):
1474 1
        return FindServersParameters(data)
1475
1476 1
    def _binary_init(self, data):
1477 1
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
1478 1
        self.LocaleIds = uabin.Primitives.String.unpack_array(data)
1479 1
        self.ServerUris = uabin.Primitives.String.unpack_array(data)
1480
1481 1
    def __str__(self):
1482
        return 'FindServersParameters(' + 'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
1483
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
1484
               'ServerUris:' + str(self.ServerUris) + ')'
1485
1486 1
    __repr__ = __str__
1487
1488
1489 1
class FindServersRequest(FrozenClass):
1490
    '''
1491
    Finds the servers known to the discovery server.
1492
1493
    :ivar TypeId:
1494
    :vartype TypeId: NodeId
1495
    :ivar RequestHeader:
1496
    :vartype RequestHeader: RequestHeader
1497
    :ivar Parameters:
1498
    :vartype Parameters: FindServersParameters
1499
    '''
1500
1501 1
    ua_types = {
1502
        'TypeId': 'NodeId',
1503
        'RequestHeader': 'RequestHeader',
1504
        'Parameters': 'FindServersParameters',
1505
               }
1506
1507 1
    def __init__(self, binary=None):
1508 1
        if binary is not None:
1509
            self._binary_init(binary)
1510
            self._freeze = True
1511
            return
1512 1
        self.TypeId = FourByteNodeId(ObjectIds.FindServersRequest_Encoding_DefaultBinary)
1513 1
        self.RequestHeader = RequestHeader()
1514 1
        self.Parameters = FindServersParameters()
1515 1
        self._freeze = True
1516
1517 1
    def to_binary(self):
1518 1
        packet = []
1519 1
        packet.append(self.TypeId.to_binary())
1520 1
        packet.append(self.RequestHeader.to_binary())
1521 1
        packet.append(self.Parameters.to_binary())
1522 1
        return b''.join(packet)
1523
1524 1
    @staticmethod
1525
    def from_binary(data):
1526
        return FindServersRequest(data)
1527
1528 1
    def _binary_init(self, data):
1529
        self.TypeId = NodeId.from_binary(data)
1530
        self.RequestHeader = RequestHeader.from_binary(data)
1531
        self.Parameters = FindServersParameters.from_binary(data)
1532
1533 1
    def __str__(self):
1534
        return 'FindServersRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1535
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
1536
               'Parameters:' + str(self.Parameters) + ')'
1537
1538 1
    __repr__ = __str__
1539
1540
1541 1 View Code Duplication
class FindServersResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1542
    '''
1543
    Finds the servers known to the discovery server.
1544
1545
    :ivar TypeId:
1546
    :vartype TypeId: NodeId
1547
    :ivar ResponseHeader:
1548
    :vartype ResponseHeader: ResponseHeader
1549
    :ivar Servers:
1550
    :vartype Servers: ApplicationDescription
1551
    '''
1552
1553 1
    ua_types = {
1554
        'TypeId': 'NodeId',
1555
        'ResponseHeader': 'ResponseHeader',
1556
        'Servers': 'ApplicationDescription',
1557
               }
1558
1559 1
    def __init__(self, binary=None):
1560 1
        if binary is not None:
1561 1
            self._binary_init(binary)
1562 1
            self._freeze = True
1563 1
            return
1564 1
        self.TypeId = FourByteNodeId(ObjectIds.FindServersResponse_Encoding_DefaultBinary)
1565 1
        self.ResponseHeader = ResponseHeader()
1566 1
        self.Servers = []
1567 1
        self._freeze = True
1568
1569 1
    def to_binary(self):
1570 1
        packet = []
1571 1
        packet.append(self.TypeId.to_binary())
1572 1
        packet.append(self.ResponseHeader.to_binary())
1573 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Servers)))
1574 1
        for fieldname in self.Servers:
1575 1
            packet.append(fieldname.to_binary())
1576 1
        return b''.join(packet)
1577
1578 1
    @staticmethod
1579
    def from_binary(data):
1580 1
        return FindServersResponse(data)
1581
1582 1
    def _binary_init(self, data):
1583 1
        self.TypeId = NodeId.from_binary(data)
1584 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
1585 1
        length = uabin.Primitives.Int32.unpack(data)
1586 1
        array = []
1587 1
        if length != -1:
1588 1
            for _ in range(0, length):
1589 1
                array.append(ApplicationDescription.from_binary(data))
1590 1
        self.Servers = array
1591
1592 1
    def __str__(self):
1593
        return 'FindServersResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1594
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
1595
               'Servers:' + str(self.Servers) + ')'
1596
1597 1
    __repr__ = __str__
1598
1599
1600 1 View Code Duplication
class ServerOnNetwork(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1601
    '''
1602
    :ivar RecordId:
1603
    :vartype RecordId: UInt32
1604
    :ivar ServerName:
1605
    :vartype ServerName: String
1606
    :ivar DiscoveryUrl:
1607
    :vartype DiscoveryUrl: String
1608
    :ivar ServerCapabilities:
1609
    :vartype ServerCapabilities: String
1610
    '''
1611
1612 1
    ua_types = {
1613
        'RecordId': 'UInt32',
1614
        'ServerName': 'String',
1615
        'DiscoveryUrl': 'String',
1616
        'ServerCapabilities': 'String',
1617
               }
1618
1619 1
    def __init__(self, binary=None):
1620
        if binary is not None:
1621
            self._binary_init(binary)
1622
            self._freeze = True
1623
            return
1624
        self.RecordId = 0
1625
        self.ServerName = None
1626
        self.DiscoveryUrl = None
1627
        self.ServerCapabilities = []
1628
        self._freeze = True
1629
1630 1
    def to_binary(self):
1631
        packet = []
1632
        packet.append(uabin.Primitives.UInt32.pack(self.RecordId))
1633
        packet.append(uabin.Primitives.String.pack(self.ServerName))
1634
        packet.append(uabin.Primitives.String.pack(self.DiscoveryUrl))
1635
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerCapabilities)))
1636
        for fieldname in self.ServerCapabilities:
1637
            packet.append(uabin.Primitives.String.pack(fieldname))
1638
        return b''.join(packet)
1639
1640 1
    @staticmethod
1641
    def from_binary(data):
1642
        return ServerOnNetwork(data)
1643
1644 1
    def _binary_init(self, data):
1645
        self.RecordId = uabin.Primitives.UInt32.unpack(data)
1646
        self.ServerName = uabin.Primitives.String.unpack(data)
1647
        self.DiscoveryUrl = uabin.Primitives.String.unpack(data)
1648
        self.ServerCapabilities = uabin.Primitives.String.unpack_array(data)
1649
1650 1
    def __str__(self):
1651
        return 'ServerOnNetwork(' + 'RecordId:' + str(self.RecordId) + ', ' + \
1652
               'ServerName:' + str(self.ServerName) + ', ' + \
1653
               'DiscoveryUrl:' + str(self.DiscoveryUrl) + ', ' + \
1654
               'ServerCapabilities:' + str(self.ServerCapabilities) + ')'
1655
1656 1
    __repr__ = __str__
1657
1658
1659 1 View Code Duplication
class FindServersOnNetworkParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1660
    '''
1661
    :ivar StartingRecordId:
1662
    :vartype StartingRecordId: UInt32
1663
    :ivar MaxRecordsToReturn:
1664
    :vartype MaxRecordsToReturn: UInt32
1665
    :ivar ServerCapabilityFilter:
1666
    :vartype ServerCapabilityFilter: String
1667
    '''
1668
1669 1
    ua_types = {
1670
        'StartingRecordId': 'UInt32',
1671
        'MaxRecordsToReturn': 'UInt32',
1672
        'ServerCapabilityFilter': 'String',
1673
               }
1674
1675 1
    def __init__(self, binary=None):
1676
        if binary is not None:
1677
            self._binary_init(binary)
1678
            self._freeze = True
1679
            return
1680
        self.StartingRecordId = 0
1681
        self.MaxRecordsToReturn = 0
1682
        self.ServerCapabilityFilter = []
1683
        self._freeze = True
1684
1685 1
    def to_binary(self):
1686
        packet = []
1687
        packet.append(uabin.Primitives.UInt32.pack(self.StartingRecordId))
1688
        packet.append(uabin.Primitives.UInt32.pack(self.MaxRecordsToReturn))
1689
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerCapabilityFilter)))
1690
        for fieldname in self.ServerCapabilityFilter:
1691
            packet.append(uabin.Primitives.String.pack(fieldname))
1692
        return b''.join(packet)
1693
1694 1
    @staticmethod
1695
    def from_binary(data):
1696
        return FindServersOnNetworkParameters(data)
1697
1698 1
    def _binary_init(self, data):
1699
        self.StartingRecordId = uabin.Primitives.UInt32.unpack(data)
1700
        self.MaxRecordsToReturn = uabin.Primitives.UInt32.unpack(data)
1701
        self.ServerCapabilityFilter = uabin.Primitives.String.unpack_array(data)
1702
1703 1
    def __str__(self):
1704
        return 'FindServersOnNetworkParameters(' + 'StartingRecordId:' + str(self.StartingRecordId) + ', ' + \
1705
               'MaxRecordsToReturn:' + str(self.MaxRecordsToReturn) + ', ' + \
1706
               'ServerCapabilityFilter:' + str(self.ServerCapabilityFilter) + ')'
1707
1708 1
    __repr__ = __str__
1709
1710
1711 1
class FindServersOnNetworkRequest(FrozenClass):
1712
    '''
1713
    :ivar TypeId:
1714
    :vartype TypeId: NodeId
1715
    :ivar RequestHeader:
1716
    :vartype RequestHeader: RequestHeader
1717
    :ivar Parameters:
1718
    :vartype Parameters: FindServersOnNetworkParameters
1719
    '''
1720
1721 1
    ua_types = {
1722
        'TypeId': 'NodeId',
1723
        'RequestHeader': 'RequestHeader',
1724
        'Parameters': 'FindServersOnNetworkParameters',
1725
               }
1726
1727 1
    def __init__(self, binary=None):
1728
        if binary is not None:
1729
            self._binary_init(binary)
1730
            self._freeze = True
1731
            return
1732
        self.TypeId = FourByteNodeId(ObjectIds.FindServersOnNetworkRequest_Encoding_DefaultBinary)
1733
        self.RequestHeader = RequestHeader()
1734
        self.Parameters = FindServersOnNetworkParameters()
1735
        self._freeze = True
1736
1737 1
    def to_binary(self):
1738
        packet = []
1739
        packet.append(self.TypeId.to_binary())
1740
        packet.append(self.RequestHeader.to_binary())
1741
        packet.append(self.Parameters.to_binary())
1742
        return b''.join(packet)
1743
1744 1
    @staticmethod
1745
    def from_binary(data):
1746
        return FindServersOnNetworkRequest(data)
1747
1748 1
    def _binary_init(self, data):
1749
        self.TypeId = NodeId.from_binary(data)
1750
        self.RequestHeader = RequestHeader.from_binary(data)
1751
        self.Parameters = FindServersOnNetworkParameters.from_binary(data)
1752
1753 1
    def __str__(self):
1754
        return 'FindServersOnNetworkRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1755
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
1756
               'Parameters:' + str(self.Parameters) + ')'
1757
1758 1
    __repr__ = __str__
1759
1760
1761 1 View Code Duplication
class FindServersOnNetworkResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1762
    '''
1763
    :ivar LastCounterResetTime:
1764
    :vartype LastCounterResetTime: DateTime
1765
    :ivar Servers:
1766
    :vartype Servers: ServerOnNetwork
1767
    '''
1768
1769 1
    ua_types = {
1770
        'LastCounterResetTime': 'DateTime',
1771
        'Servers': 'ServerOnNetwork',
1772
               }
1773
1774 1
    def __init__(self, binary=None):
1775
        if binary is not None:
1776
            self._binary_init(binary)
1777
            self._freeze = True
1778
            return
1779
        self.LastCounterResetTime = datetime.now()
1780
        self.Servers = []
1781
        self._freeze = True
1782
1783 1
    def to_binary(self):
1784
        packet = []
1785
        packet.append(uabin.Primitives.DateTime.pack(self.LastCounterResetTime))
1786
        packet.append(uabin.Primitives.Int32.pack(len(self.Servers)))
1787
        for fieldname in self.Servers:
1788
            packet.append(fieldname.to_binary())
1789
        return b''.join(packet)
1790
1791 1
    @staticmethod
1792
    def from_binary(data):
1793
        return FindServersOnNetworkResult(data)
1794
1795 1
    def _binary_init(self, data):
1796
        self.LastCounterResetTime = uabin.Primitives.DateTime.unpack(data)
1797
        length = uabin.Primitives.Int32.unpack(data)
1798
        array = []
1799
        if length != -1:
1800
            for _ in range(0, length):
1801
                array.append(ServerOnNetwork.from_binary(data))
1802
        self.Servers = array
1803
1804 1
    def __str__(self):
1805
        return 'FindServersOnNetworkResult(' + 'LastCounterResetTime:' + str(self.LastCounterResetTime) + ', ' + \
1806
               'Servers:' + str(self.Servers) + ')'
1807
1808 1
    __repr__ = __str__
1809
1810
1811 1
class FindServersOnNetworkResponse(FrozenClass):
1812
    '''
1813
    :ivar TypeId:
1814
    :vartype TypeId: NodeId
1815
    :ivar ResponseHeader:
1816
    :vartype ResponseHeader: ResponseHeader
1817
    :ivar Parameters:
1818
    :vartype Parameters: FindServersOnNetworkResult
1819
    '''
1820
1821 1
    ua_types = {
1822
        'TypeId': 'NodeId',
1823
        'ResponseHeader': 'ResponseHeader',
1824
        'Parameters': 'FindServersOnNetworkResult',
1825
               }
1826
1827 1
    def __init__(self, binary=None):
1828
        if binary is not None:
1829
            self._binary_init(binary)
1830
            self._freeze = True
1831
            return
1832
        self.TypeId = FourByteNodeId(ObjectIds.FindServersOnNetworkResponse_Encoding_DefaultBinary)
1833
        self.ResponseHeader = ResponseHeader()
1834
        self.Parameters = FindServersOnNetworkResult()
1835
        self._freeze = True
1836
1837 1
    def to_binary(self):
1838
        packet = []
1839
        packet.append(self.TypeId.to_binary())
1840
        packet.append(self.ResponseHeader.to_binary())
1841
        packet.append(self.Parameters.to_binary())
1842
        return b''.join(packet)
1843
1844 1
    @staticmethod
1845
    def from_binary(data):
1846
        return FindServersOnNetworkResponse(data)
1847
1848 1
    def _binary_init(self, data):
1849
        self.TypeId = NodeId.from_binary(data)
1850
        self.ResponseHeader = ResponseHeader.from_binary(data)
1851
        self.Parameters = FindServersOnNetworkResult.from_binary(data)
1852
1853 1
    def __str__(self):
1854
        return 'FindServersOnNetworkResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1855
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
1856
               'Parameters:' + str(self.Parameters) + ')'
1857
1858 1
    __repr__ = __str__
1859
1860
1861 1 View Code Duplication
class UserTokenPolicy(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1862
    '''
1863
    Describes a user token that can be used with a server.
1864
1865
    :ivar PolicyId:
1866
    :vartype PolicyId: String
1867
    :ivar TokenType:
1868
    :vartype TokenType: UserTokenType
1869
    :ivar IssuedTokenType:
1870
    :vartype IssuedTokenType: String
1871
    :ivar IssuerEndpointUrl:
1872
    :vartype IssuerEndpointUrl: String
1873
    :ivar SecurityPolicyUri:
1874
    :vartype SecurityPolicyUri: String
1875
    '''
1876
1877 1
    ua_types = {
1878
        'PolicyId': 'String',
1879
        'TokenType': 'UserTokenType',
1880
        'IssuedTokenType': 'String',
1881
        'IssuerEndpointUrl': 'String',
1882
        'SecurityPolicyUri': 'String',
1883
               }
1884
1885 1
    def __init__(self, binary=None):
1886 1
        if binary is not None:
1887 1
            self._binary_init(binary)
1888 1
            self._freeze = True
1889 1
            return
1890 1
        self.PolicyId = None
1891 1
        self.TokenType = UserTokenType(0)
1892 1
        self.IssuedTokenType = None
1893 1
        self.IssuerEndpointUrl = None
1894 1
        self.SecurityPolicyUri = None
1895 1
        self._freeze = True
1896
1897 1
    def to_binary(self):
1898 1
        packet = []
1899 1
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
1900 1
        packet.append(uabin.Primitives.UInt32.pack(self.TokenType.value))
1901 1
        packet.append(uabin.Primitives.String.pack(self.IssuedTokenType))
1902 1
        packet.append(uabin.Primitives.String.pack(self.IssuerEndpointUrl))
1903 1
        packet.append(uabin.Primitives.String.pack(self.SecurityPolicyUri))
1904 1
        return b''.join(packet)
1905
1906 1
    @staticmethod
1907
    def from_binary(data):
1908 1
        return UserTokenPolicy(data)
1909
1910 1
    def _binary_init(self, data):
1911 1
        self.PolicyId = uabin.Primitives.String.unpack(data)
1912 1
        self.TokenType = UserTokenType(uabin.Primitives.UInt32.unpack(data))
1913 1
        self.IssuedTokenType = uabin.Primitives.String.unpack(data)
1914 1
        self.IssuerEndpointUrl = uabin.Primitives.String.unpack(data)
1915 1
        self.SecurityPolicyUri = uabin.Primitives.String.unpack(data)
1916
1917 1
    def __str__(self):
1918
        return 'UserTokenPolicy(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
1919
               'TokenType:' + str(self.TokenType) + ', ' + \
1920
               'IssuedTokenType:' + str(self.IssuedTokenType) + ', ' + \
1921
               'IssuerEndpointUrl:' + str(self.IssuerEndpointUrl) + ', ' + \
1922
               'SecurityPolicyUri:' + str(self.SecurityPolicyUri) + ')'
1923
1924 1
    __repr__ = __str__
1925
1926
1927 1
class EndpointDescription(FrozenClass):
1928
    '''
1929
    The description of a endpoint that can be used to access a server.
1930
1931
    :ivar EndpointUrl:
1932
    :vartype EndpointUrl: String
1933
    :ivar Server:
1934
    :vartype Server: ApplicationDescription
1935
    :ivar ServerCertificate:
1936
    :vartype ServerCertificate: ByteString
1937
    :ivar SecurityMode:
1938
    :vartype SecurityMode: MessageSecurityMode
1939
    :ivar SecurityPolicyUri:
1940
    :vartype SecurityPolicyUri: String
1941
    :ivar UserIdentityTokens:
1942
    :vartype UserIdentityTokens: UserTokenPolicy
1943
    :ivar TransportProfileUri:
1944
    :vartype TransportProfileUri: String
1945
    :ivar SecurityLevel:
1946
    :vartype SecurityLevel: Byte
1947
    '''
1948
1949 1
    ua_types = {
1950
        'EndpointUrl': 'String',
1951
        'Server': 'ApplicationDescription',
1952
        'ServerCertificate': 'ByteString',
1953
        'SecurityMode': 'MessageSecurityMode',
1954
        'SecurityPolicyUri': 'String',
1955
        'UserIdentityTokens': 'UserTokenPolicy',
1956
        'TransportProfileUri': 'String',
1957
        'SecurityLevel': 'Byte',
1958
               }
1959
1960 1
    def __init__(self, binary=None):
1961 1
        if binary is not None:
1962 1
            self._binary_init(binary)
1963 1
            self._freeze = True
1964 1
            return
1965 1
        self.EndpointUrl = None
1966 1
        self.Server = ApplicationDescription()
1967 1
        self.ServerCertificate = None
1968 1
        self.SecurityMode = MessageSecurityMode(0)
1969 1
        self.SecurityPolicyUri = None
1970 1
        self.UserIdentityTokens = []
1971 1
        self.TransportProfileUri = None
1972 1
        self.SecurityLevel = 0
1973 1
        self._freeze = True
1974
1975 1 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1976 1
        packet = []
1977 1
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
1978 1
        packet.append(self.Server.to_binary())
1979 1
        packet.append(uabin.Primitives.ByteString.pack(self.ServerCertificate))
1980 1
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityMode.value))
1981 1
        packet.append(uabin.Primitives.String.pack(self.SecurityPolicyUri))
1982 1
        packet.append(uabin.Primitives.Int32.pack(len(self.UserIdentityTokens)))
1983 1
        for fieldname in self.UserIdentityTokens:
1984 1
            packet.append(fieldname.to_binary())
1985 1
        packet.append(uabin.Primitives.String.pack(self.TransportProfileUri))
1986 1
        packet.append(uabin.Primitives.Byte.pack(self.SecurityLevel))
1987 1
        return b''.join(packet)
1988
1989 1
    @staticmethod
1990
    def from_binary(data):
1991 1
        return EndpointDescription(data)
1992
1993 1 View Code Duplication
    def _binary_init(self, data):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1994 1
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
1995 1
        self.Server = ApplicationDescription.from_binary(data)
1996 1
        self.ServerCertificate = uabin.Primitives.ByteString.unpack(data)
1997 1
        self.SecurityMode = MessageSecurityMode(uabin.Primitives.UInt32.unpack(data))
1998 1
        self.SecurityPolicyUri = uabin.Primitives.String.unpack(data)
1999 1
        length = uabin.Primitives.Int32.unpack(data)
2000 1
        array = []
2001 1
        if length != -1:
2002 1
            for _ in range(0, length):
2003 1
                array.append(UserTokenPolicy.from_binary(data))
2004 1
        self.UserIdentityTokens = array
2005 1
        self.TransportProfileUri = uabin.Primitives.String.unpack(data)
2006 1
        self.SecurityLevel = uabin.Primitives.Byte.unpack(data)
2007
2008 1
    def __str__(self):
2009
        return 'EndpointDescription(' + 'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
2010
               'Server:' + str(self.Server) + ', ' + \
2011
               'ServerCertificate:' + str(self.ServerCertificate) + ', ' + \
2012
               'SecurityMode:' + str(self.SecurityMode) + ', ' + \
2013
               'SecurityPolicyUri:' + str(self.SecurityPolicyUri) + ', ' + \
2014
               'UserIdentityTokens:' + str(self.UserIdentityTokens) + ', ' + \
2015
               'TransportProfileUri:' + str(self.TransportProfileUri) + ', ' + \
2016
               'SecurityLevel:' + str(self.SecurityLevel) + ')'
2017
2018 1
    __repr__ = __str__
2019
2020
2021 1 View Code Duplication
class GetEndpointsParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2022
    '''
2023
    :ivar EndpointUrl:
2024
    :vartype EndpointUrl: String
2025
    :ivar LocaleIds:
2026
    :vartype LocaleIds: String
2027
    :ivar ProfileUris:
2028
    :vartype ProfileUris: String
2029
    '''
2030
2031 1
    ua_types = {
2032
        'EndpointUrl': 'String',
2033
        'LocaleIds': 'String',
2034
        'ProfileUris': 'String',
2035
               }
2036
2037 1
    def __init__(self, binary=None):
2038 1
        if binary is not None:
2039 1
            self._binary_init(binary)
2040 1
            self._freeze = True
2041 1
            return
2042 1
        self.EndpointUrl = None
2043 1
        self.LocaleIds = []
2044 1
        self.ProfileUris = []
2045 1
        self._freeze = True
2046
2047 1
    def to_binary(self):
2048 1
        packet = []
2049 1
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
2050 1
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
2051 1
        for fieldname in self.LocaleIds:
2052
            packet.append(uabin.Primitives.String.pack(fieldname))
2053 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ProfileUris)))
2054 1
        for fieldname in self.ProfileUris:
2055
            packet.append(uabin.Primitives.String.pack(fieldname))
2056 1
        return b''.join(packet)
2057
2058 1
    @staticmethod
2059
    def from_binary(data):
2060 1
        return GetEndpointsParameters(data)
2061
2062 1
    def _binary_init(self, data):
2063 1
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
2064 1
        self.LocaleIds = uabin.Primitives.String.unpack_array(data)
2065 1
        self.ProfileUris = uabin.Primitives.String.unpack_array(data)
2066
2067 1
    def __str__(self):
2068
        return 'GetEndpointsParameters(' + 'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
2069
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
2070
               'ProfileUris:' + str(self.ProfileUris) + ')'
2071
2072 1
    __repr__ = __str__
2073
2074
2075 1
class GetEndpointsRequest(FrozenClass):
2076
    '''
2077
    Gets the endpoints used by the server.
2078
2079
    :ivar TypeId:
2080
    :vartype TypeId: NodeId
2081
    :ivar RequestHeader:
2082
    :vartype RequestHeader: RequestHeader
2083
    :ivar Parameters:
2084
    :vartype Parameters: GetEndpointsParameters
2085
    '''
2086
2087 1
    ua_types = {
2088
        'TypeId': 'NodeId',
2089
        'RequestHeader': 'RequestHeader',
2090
        'Parameters': 'GetEndpointsParameters',
2091
               }
2092
2093 1
    def __init__(self, binary=None):
2094 1
        if binary is not None:
2095
            self._binary_init(binary)
2096
            self._freeze = True
2097
            return
2098 1
        self.TypeId = FourByteNodeId(ObjectIds.GetEndpointsRequest_Encoding_DefaultBinary)
2099 1
        self.RequestHeader = RequestHeader()
2100 1
        self.Parameters = GetEndpointsParameters()
2101 1
        self._freeze = True
2102
2103 1
    def to_binary(self):
2104 1
        packet = []
2105 1
        packet.append(self.TypeId.to_binary())
2106 1
        packet.append(self.RequestHeader.to_binary())
2107 1
        packet.append(self.Parameters.to_binary())
2108 1
        return b''.join(packet)
2109
2110 1
    @staticmethod
2111
    def from_binary(data):
2112
        return GetEndpointsRequest(data)
2113
2114 1
    def _binary_init(self, data):
2115
        self.TypeId = NodeId.from_binary(data)
2116
        self.RequestHeader = RequestHeader.from_binary(data)
2117
        self.Parameters = GetEndpointsParameters.from_binary(data)
2118
2119 1
    def __str__(self):
2120
        return 'GetEndpointsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2121
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2122
               'Parameters:' + str(self.Parameters) + ')'
2123
2124 1
    __repr__ = __str__
2125
2126
2127 1 View Code Duplication
class GetEndpointsResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2128
    '''
2129
    Gets the endpoints used by the server.
2130
2131
    :ivar TypeId:
2132
    :vartype TypeId: NodeId
2133
    :ivar ResponseHeader:
2134
    :vartype ResponseHeader: ResponseHeader
2135
    :ivar Endpoints:
2136
    :vartype Endpoints: EndpointDescription
2137
    '''
2138
2139 1
    ua_types = {
2140
        'TypeId': 'NodeId',
2141
        'ResponseHeader': 'ResponseHeader',
2142
        'Endpoints': 'EndpointDescription',
2143
               }
2144
2145 1
    def __init__(self, binary=None):
2146 1
        if binary is not None:
2147 1
            self._binary_init(binary)
2148 1
            self._freeze = True
2149 1
            return
2150 1
        self.TypeId = FourByteNodeId(ObjectIds.GetEndpointsResponse_Encoding_DefaultBinary)
2151 1
        self.ResponseHeader = ResponseHeader()
2152 1
        self.Endpoints = []
2153 1
        self._freeze = True
2154
2155 1
    def to_binary(self):
2156 1
        packet = []
2157 1
        packet.append(self.TypeId.to_binary())
2158 1
        packet.append(self.ResponseHeader.to_binary())
2159 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Endpoints)))
2160 1
        for fieldname in self.Endpoints:
2161 1
            packet.append(fieldname.to_binary())
2162 1
        return b''.join(packet)
2163
2164 1
    @staticmethod
2165
    def from_binary(data):
2166 1
        return GetEndpointsResponse(data)
2167
2168 1
    def _binary_init(self, data):
2169 1
        self.TypeId = NodeId.from_binary(data)
2170 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
2171 1
        length = uabin.Primitives.Int32.unpack(data)
2172 1
        array = []
2173 1
        if length != -1:
2174 1
            for _ in range(0, length):
2175 1
                array.append(EndpointDescription.from_binary(data))
2176 1
        self.Endpoints = array
2177
2178 1
    def __str__(self):
2179
        return 'GetEndpointsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2180
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
2181
               'Endpoints:' + str(self.Endpoints) + ')'
2182
2183 1
    __repr__ = __str__
2184
2185
2186 1
class RegisteredServer(FrozenClass):
2187
    '''
2188
    The information required to register a server with a discovery server.
2189
2190
    :ivar ServerUri:
2191
    :vartype ServerUri: String
2192
    :ivar ProductUri:
2193
    :vartype ProductUri: String
2194
    :ivar ServerNames:
2195
    :vartype ServerNames: LocalizedText
2196
    :ivar ServerType:
2197
    :vartype ServerType: ApplicationType
2198
    :ivar GatewayServerUri:
2199
    :vartype GatewayServerUri: String
2200
    :ivar DiscoveryUrls:
2201
    :vartype DiscoveryUrls: String
2202
    :ivar SemaphoreFilePath:
2203
    :vartype SemaphoreFilePath: String
2204
    :ivar IsOnline:
2205
    :vartype IsOnline: Boolean
2206
    '''
2207
2208 1
    ua_types = {
2209
        'ServerUri': 'String',
2210
        'ProductUri': 'String',
2211
        'ServerNames': 'LocalizedText',
2212
        'ServerType': 'ApplicationType',
2213
        'GatewayServerUri': 'String',
2214
        'DiscoveryUrls': 'String',
2215
        'SemaphoreFilePath': 'String',
2216
        'IsOnline': 'Boolean',
2217
               }
2218
2219 1
    def __init__(self, binary=None):
2220 1
        if binary is not None:
2221 1
            self._binary_init(binary)
2222 1
            self._freeze = True
2223 1
            return
2224 1
        self.ServerUri = None
2225 1
        self.ProductUri = None
2226 1
        self.ServerNames = []
2227 1
        self.ServerType = ApplicationType(0)
2228 1
        self.GatewayServerUri = None
2229 1
        self.DiscoveryUrls = []
2230 1
        self.SemaphoreFilePath = None
2231 1
        self.IsOnline = True
2232 1
        self._freeze = True
2233
2234 1
    def to_binary(self):
2235 1
        packet = []
2236 1
        packet.append(uabin.Primitives.String.pack(self.ServerUri))
2237 1
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
2238 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerNames)))
2239 1
        for fieldname in self.ServerNames:
2240 1
            packet.append(fieldname.to_binary())
2241 1
        packet.append(uabin.Primitives.UInt32.pack(self.ServerType.value))
2242 1
        packet.append(uabin.Primitives.String.pack(self.GatewayServerUri))
2243 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiscoveryUrls)))
2244 1
        for fieldname in self.DiscoveryUrls:
2245 1
            packet.append(uabin.Primitives.String.pack(fieldname))
2246 1
        packet.append(uabin.Primitives.String.pack(self.SemaphoreFilePath))
2247 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsOnline))
2248 1
        return b''.join(packet)
2249
2250 1
    @staticmethod
2251
    def from_binary(data):
2252 1
        return RegisteredServer(data)
2253
2254 1 View Code Duplication
    def _binary_init(self, data):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2255 1
        self.ServerUri = uabin.Primitives.String.unpack(data)
2256 1
        self.ProductUri = uabin.Primitives.String.unpack(data)
2257 1
        length = uabin.Primitives.Int32.unpack(data)
2258 1
        array = []
2259 1
        if length != -1:
2260 1
            for _ in range(0, length):
2261 1
                array.append(LocalizedText.from_binary(data))
2262 1
        self.ServerNames = array
2263 1
        self.ServerType = ApplicationType(uabin.Primitives.UInt32.unpack(data))
2264 1
        self.GatewayServerUri = uabin.Primitives.String.unpack(data)
2265 1
        self.DiscoveryUrls = uabin.Primitives.String.unpack_array(data)
2266 1
        self.SemaphoreFilePath = uabin.Primitives.String.unpack(data)
2267 1
        self.IsOnline = uabin.Primitives.Boolean.unpack(data)
2268
2269 1
    def __str__(self):
2270
        return 'RegisteredServer(' + 'ServerUri:' + str(self.ServerUri) + ', ' + \
2271
               'ProductUri:' + str(self.ProductUri) + ', ' + \
2272
               'ServerNames:' + str(self.ServerNames) + ', ' + \
2273
               'ServerType:' + str(self.ServerType) + ', ' + \
2274
               'GatewayServerUri:' + str(self.GatewayServerUri) + ', ' + \
2275
               'DiscoveryUrls:' + str(self.DiscoveryUrls) + ', ' + \
2276
               'SemaphoreFilePath:' + str(self.SemaphoreFilePath) + ', ' + \
2277
               'IsOnline:' + str(self.IsOnline) + ')'
2278
2279 1
    __repr__ = __str__
2280
2281
2282 1
class RegisterServerRequest(FrozenClass):
2283
    '''
2284
    Registers a server with the discovery server.
2285
2286
    :ivar TypeId:
2287
    :vartype TypeId: NodeId
2288
    :ivar RequestHeader:
2289
    :vartype RequestHeader: RequestHeader
2290
    :ivar Server:
2291
    :vartype Server: RegisteredServer
2292
    '''
2293
2294 1
    ua_types = {
2295
        'TypeId': 'NodeId',
2296
        'RequestHeader': 'RequestHeader',
2297
        'Server': 'RegisteredServer',
2298
               }
2299
2300 1
    def __init__(self, binary=None):
2301 1
        if binary is not None:
2302
            self._binary_init(binary)
2303
            self._freeze = True
2304
            return
2305 1
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServerRequest_Encoding_DefaultBinary)
2306 1
        self.RequestHeader = RequestHeader()
2307 1
        self.Server = RegisteredServer()
2308 1
        self._freeze = True
2309
2310 1
    def to_binary(self):
2311 1
        packet = []
2312 1
        packet.append(self.TypeId.to_binary())
2313 1
        packet.append(self.RequestHeader.to_binary())
2314 1
        packet.append(self.Server.to_binary())
2315 1
        return b''.join(packet)
2316
2317 1
    @staticmethod
2318
    def from_binary(data):
2319
        return RegisterServerRequest(data)
2320
2321 1
    def _binary_init(self, data):
2322
        self.TypeId = NodeId.from_binary(data)
2323
        self.RequestHeader = RequestHeader.from_binary(data)
2324
        self.Server = RegisteredServer.from_binary(data)
2325
2326 1
    def __str__(self):
2327
        return 'RegisterServerRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2328
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2329
               'Server:' + str(self.Server) + ')'
2330
2331 1
    __repr__ = __str__
2332
2333
2334 1 View Code Duplication
class RegisterServerResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2335
    '''
2336
    Registers a server with the discovery server.
2337
2338
    :ivar TypeId:
2339
    :vartype TypeId: NodeId
2340
    :ivar ResponseHeader:
2341
    :vartype ResponseHeader: ResponseHeader
2342
    '''
2343
2344 1
    ua_types = {
2345
        'TypeId': 'NodeId',
2346
        'ResponseHeader': 'ResponseHeader',
2347
               }
2348
2349 1
    def __init__(self, binary=None):
2350 1
        if binary is not None:
2351 1
            self._binary_init(binary)
2352 1
            self._freeze = True
2353 1
            return
2354 1
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServerResponse_Encoding_DefaultBinary)
2355 1
        self.ResponseHeader = ResponseHeader()
2356 1
        self._freeze = True
2357
2358 1
    def to_binary(self):
2359 1
        packet = []
2360 1
        packet.append(self.TypeId.to_binary())
2361 1
        packet.append(self.ResponseHeader.to_binary())
2362 1
        return b''.join(packet)
2363
2364 1
    @staticmethod
2365
    def from_binary(data):
2366 1
        return RegisterServerResponse(data)
2367
2368 1
    def _binary_init(self, data):
2369 1
        self.TypeId = NodeId.from_binary(data)
2370 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
2371
2372 1
    def __str__(self):
2373
        return 'RegisterServerResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2374
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
2375
2376 1
    __repr__ = __str__
2377
2378
2379 1 View Code Duplication
class DiscoveryConfiguration(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2380
    '''
2381
    A base type for discovery configuration information.
2382
2383
    '''
2384
2385 1
    ua_types = {
2386
               }
2387
2388 1
    def __init__(self, binary=None):
2389
        if binary is not None:
2390
            self._binary_init(binary)
2391
            self._freeze = True
2392
            return
2393
        self._freeze = True
2394
2395 1
    def to_binary(self):
2396
        packet = []
2397
        return b''.join(packet)
2398
2399 1
    @staticmethod
2400
    def from_binary(data):
2401
        return DiscoveryConfiguration(data)
2402
2403 1
    def _binary_init(self, data):
2404
        pass
2405
2406 1
    def __str__(self):
2407
        return 'DiscoveryConfiguration(' +  + ')'
2408
2409 1
    __repr__ = __str__
2410
2411
2412 1 View Code Duplication
class MdnsDiscoveryConfiguration(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2413
    '''
2414
    The discovery information needed for mDNS registration.
2415
2416
    :ivar MdnsServerName:
2417
    :vartype MdnsServerName: String
2418
    :ivar ServerCapabilities:
2419
    :vartype ServerCapabilities: String
2420
    '''
2421
2422 1
    ua_types = {
2423
        'MdnsServerName': 'String',
2424
        'ServerCapabilities': 'String',
2425
               }
2426
2427 1
    def __init__(self, binary=None):
2428
        if binary is not None:
2429
            self._binary_init(binary)
2430
            self._freeze = True
2431
            return
2432
        self.MdnsServerName = None
2433
        self.ServerCapabilities = []
2434
        self._freeze = True
2435
2436 1
    def to_binary(self):
2437
        packet = []
2438
        packet.append(uabin.Primitives.String.pack(self.MdnsServerName))
2439
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerCapabilities)))
2440
        for fieldname in self.ServerCapabilities:
2441
            packet.append(uabin.Primitives.String.pack(fieldname))
2442
        return b''.join(packet)
2443
2444 1
    @staticmethod
2445
    def from_binary(data):
2446
        return MdnsDiscoveryConfiguration(data)
2447
2448 1
    def _binary_init(self, data):
2449
        self.MdnsServerName = uabin.Primitives.String.unpack(data)
2450
        self.ServerCapabilities = uabin.Primitives.String.unpack_array(data)
2451
2452 1
    def __str__(self):
2453
        return 'MdnsDiscoveryConfiguration(' + 'MdnsServerName:' + str(self.MdnsServerName) + ', ' + \
2454
               'ServerCapabilities:' + str(self.ServerCapabilities) + ')'
2455
2456 1
    __repr__ = __str__
2457
2458
2459 1 View Code Duplication
class RegisterServer2Parameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2460
    '''
2461
    :ivar Server:
2462
    :vartype Server: RegisteredServer
2463
    :ivar DiscoveryConfiguration:
2464
    :vartype DiscoveryConfiguration: ExtensionObject
2465
    '''
2466
2467 1
    ua_types = {
2468
        'Server': 'RegisteredServer',
2469
        'DiscoveryConfiguration': 'ExtensionObject',
2470
               }
2471
2472 1
    def __init__(self, binary=None):
2473
        if binary is not None:
2474
            self._binary_init(binary)
2475
            self._freeze = True
2476
            return
2477
        self.Server = RegisteredServer()
2478
        self.DiscoveryConfiguration = []
2479
        self._freeze = True
2480
2481 1
    def to_binary(self):
2482
        packet = []
2483
        packet.append(self.Server.to_binary())
2484
        packet.append(uabin.Primitives.Int32.pack(len(self.DiscoveryConfiguration)))
2485
        for fieldname in self.DiscoveryConfiguration:
2486
            packet.append(extensionobject_to_binary(fieldname))
2487
        return b''.join(packet)
2488
2489 1
    @staticmethod
2490
    def from_binary(data):
2491
        return RegisterServer2Parameters(data)
2492
2493 1
    def _binary_init(self, data):
2494
        self.Server = RegisteredServer.from_binary(data)
2495
        length = uabin.Primitives.Int32.unpack(data)
2496
        array = []
2497
        if length != -1:
2498
            for _ in range(0, length):
2499
                array.append(extensionobject_from_binary(data))
2500
        self.DiscoveryConfiguration = array
2501
2502 1
    def __str__(self):
2503
        return 'RegisterServer2Parameters(' + 'Server:' + str(self.Server) + ', ' + \
2504
               'DiscoveryConfiguration:' + str(self.DiscoveryConfiguration) + ')'
2505
2506 1
    __repr__ = __str__
2507
2508
2509 1
class RegisterServer2Request(FrozenClass):
2510
    '''
2511
    :ivar TypeId:
2512
    :vartype TypeId: NodeId
2513
    :ivar RequestHeader:
2514
    :vartype RequestHeader: RequestHeader
2515
    :ivar Parameters:
2516
    :vartype Parameters: RegisterServer2Parameters
2517
    '''
2518
2519 1
    ua_types = {
2520
        'TypeId': 'NodeId',
2521
        'RequestHeader': 'RequestHeader',
2522
        'Parameters': 'RegisterServer2Parameters',
2523
               }
2524
2525 1
    def __init__(self, binary=None):
2526
        if binary is not None:
2527
            self._binary_init(binary)
2528
            self._freeze = True
2529
            return
2530
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServer2Request_Encoding_DefaultBinary)
2531
        self.RequestHeader = RequestHeader()
2532
        self.Parameters = RegisterServer2Parameters()
2533
        self._freeze = True
2534
2535 1
    def to_binary(self):
2536
        packet = []
2537
        packet.append(self.TypeId.to_binary())
2538
        packet.append(self.RequestHeader.to_binary())
2539
        packet.append(self.Parameters.to_binary())
2540
        return b''.join(packet)
2541
2542 1
    @staticmethod
2543
    def from_binary(data):
2544
        return RegisterServer2Request(data)
2545
2546 1
    def _binary_init(self, data):
2547
        self.TypeId = NodeId.from_binary(data)
2548
        self.RequestHeader = RequestHeader.from_binary(data)
2549
        self.Parameters = RegisterServer2Parameters.from_binary(data)
2550
2551 1
    def __str__(self):
2552
        return 'RegisterServer2Request(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2553
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2554
               'Parameters:' + str(self.Parameters) + ')'
2555
2556 1
    __repr__ = __str__
2557
2558
2559 1
class RegisterServer2Response(FrozenClass):
2560
    '''
2561
    :ivar TypeId:
2562
    :vartype TypeId: NodeId
2563
    :ivar ResponseHeader:
2564
    :vartype ResponseHeader: ResponseHeader
2565
    :ivar ConfigurationResults:
2566
    :vartype ConfigurationResults: StatusCode
2567
    :ivar DiagnosticInfos:
2568
    :vartype DiagnosticInfos: DiagnosticInfo
2569
    '''
2570
2571 1
    ua_types = {
2572
        'TypeId': 'NodeId',
2573
        'ResponseHeader': 'ResponseHeader',
2574
        'ConfigurationResults': 'StatusCode',
2575
        'DiagnosticInfos': 'DiagnosticInfo',
2576
               }
2577
2578 1
    def __init__(self, binary=None):
2579
        if binary is not None:
2580
            self._binary_init(binary)
2581
            self._freeze = True
2582
            return
2583
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServer2Response_Encoding_DefaultBinary)
2584
        self.ResponseHeader = ResponseHeader()
2585
        self.ConfigurationResults = []
2586
        self.DiagnosticInfos = []
2587
        self._freeze = True
2588
2589 1
    def to_binary(self):
2590
        packet = []
2591
        packet.append(self.TypeId.to_binary())
2592
        packet.append(self.ResponseHeader.to_binary())
2593
        packet.append(uabin.Primitives.Int32.pack(len(self.ConfigurationResults)))
2594
        for fieldname in self.ConfigurationResults:
2595
            packet.append(fieldname.to_binary())
2596
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
2597
        for fieldname in self.DiagnosticInfos:
2598
            packet.append(fieldname.to_binary())
2599
        return b''.join(packet)
2600
2601 1
    @staticmethod
2602
    def from_binary(data):
2603
        return RegisterServer2Response(data)
2604
2605 1
    def _binary_init(self, data):
2606
        self.TypeId = NodeId.from_binary(data)
2607
        self.ResponseHeader = ResponseHeader.from_binary(data)
2608
        length = uabin.Primitives.Int32.unpack(data)
2609
        array = []
2610
        if length != -1:
2611
            for _ in range(0, length):
2612
                array.append(StatusCode.from_binary(data))
2613
        self.ConfigurationResults = array
2614
        length = uabin.Primitives.Int32.unpack(data)
2615
        array = []
2616
        if length != -1:
2617
            for _ in range(0, length):
2618
                array.append(DiagnosticInfo.from_binary(data))
2619
        self.DiagnosticInfos = array
2620
2621 1
    def __str__(self):
2622
        return 'RegisterServer2Response(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2623
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
2624
               'ConfigurationResults:' + str(self.ConfigurationResults) + ', ' + \
2625
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
2626
2627 1
    __repr__ = __str__
2628
2629
2630 1 View Code Duplication
class ChannelSecurityToken(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2631
    '''
2632
    The token that identifies a set of keys for an active secure channel.
2633
2634
    :ivar ChannelId:
2635
    :vartype ChannelId: UInt32
2636
    :ivar TokenId:
2637
    :vartype TokenId: UInt32
2638
    :ivar CreatedAt:
2639
    :vartype CreatedAt: DateTime
2640
    :ivar RevisedLifetime:
2641
    :vartype RevisedLifetime: UInt32
2642
    '''
2643
2644 1
    ua_types = {
2645
        'ChannelId': 'UInt32',
2646
        'TokenId': 'UInt32',
2647
        'CreatedAt': 'DateTime',
2648
        'RevisedLifetime': 'UInt32',
2649
               }
2650
2651 1
    def __init__(self, binary=None):
2652 1
        if binary is not None:
2653 1
            self._binary_init(binary)
2654 1
            self._freeze = True
2655 1
            return
2656 1
        self.ChannelId = 0
2657 1
        self.TokenId = 0
2658 1
        self.CreatedAt = datetime.now()
2659 1
        self.RevisedLifetime = 0
2660 1
        self._freeze = True
2661
2662 1
    def to_binary(self):
2663 1
        packet = []
2664 1
        packet.append(uabin.Primitives.UInt32.pack(self.ChannelId))
2665 1
        packet.append(uabin.Primitives.UInt32.pack(self.TokenId))
2666 1
        packet.append(uabin.Primitives.DateTime.pack(self.CreatedAt))
2667 1
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedLifetime))
2668 1
        return b''.join(packet)
2669
2670 1
    @staticmethod
2671
    def from_binary(data):
2672 1
        return ChannelSecurityToken(data)
2673
2674 1
    def _binary_init(self, data):
2675 1
        self.ChannelId = uabin.Primitives.UInt32.unpack(data)
2676 1
        self.TokenId = uabin.Primitives.UInt32.unpack(data)
2677 1
        self.CreatedAt = uabin.Primitives.DateTime.unpack(data)
2678 1
        self.RevisedLifetime = uabin.Primitives.UInt32.unpack(data)
2679
2680 1
    def __str__(self):
2681
        return 'ChannelSecurityToken(' + 'ChannelId:' + str(self.ChannelId) + ', ' + \
2682
               'TokenId:' + str(self.TokenId) + ', ' + \
2683
               'CreatedAt:' + str(self.CreatedAt) + ', ' + \
2684
               'RevisedLifetime:' + str(self.RevisedLifetime) + ')'
2685
2686 1
    __repr__ = __str__
2687
2688
2689 1 View Code Duplication
class OpenSecureChannelParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2690
    '''
2691
    :ivar ClientProtocolVersion:
2692
    :vartype ClientProtocolVersion: UInt32
2693
    :ivar RequestType:
2694
    :vartype RequestType: SecurityTokenRequestType
2695
    :ivar SecurityMode:
2696
    :vartype SecurityMode: MessageSecurityMode
2697
    :ivar ClientNonce:
2698
    :vartype ClientNonce: ByteString
2699
    :ivar RequestedLifetime:
2700
    :vartype RequestedLifetime: UInt32
2701
    '''
2702
2703 1
    ua_types = {
2704
        'ClientProtocolVersion': 'UInt32',
2705
        'RequestType': 'SecurityTokenRequestType',
2706
        'SecurityMode': 'MessageSecurityMode',
2707
        'ClientNonce': 'ByteString',
2708
        'RequestedLifetime': 'UInt32',
2709
               }
2710
2711 1
    def __init__(self, binary=None):
2712 1
        if binary is not None:
2713 1
            self._binary_init(binary)
2714 1
            self._freeze = True
2715 1
            return
2716 1
        self.ClientProtocolVersion = 0
2717 1
        self.RequestType = SecurityTokenRequestType(0)
2718 1
        self.SecurityMode = MessageSecurityMode(0)
2719 1
        self.ClientNonce = None
2720 1
        self.RequestedLifetime = 0
2721 1
        self._freeze = True
2722
2723 1
    def to_binary(self):
2724 1
        packet = []
2725 1
        packet.append(uabin.Primitives.UInt32.pack(self.ClientProtocolVersion))
2726 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestType.value))
2727 1
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityMode.value))
2728 1
        packet.append(uabin.Primitives.ByteString.pack(self.ClientNonce))
2729 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedLifetime))
2730 1
        return b''.join(packet)
2731
2732 1
    @staticmethod
2733
    def from_binary(data):
2734 1
        return OpenSecureChannelParameters(data)
2735
2736 1
    def _binary_init(self, data):
2737 1
        self.ClientProtocolVersion = uabin.Primitives.UInt32.unpack(data)
2738 1
        self.RequestType = SecurityTokenRequestType(uabin.Primitives.UInt32.unpack(data))
2739 1
        self.SecurityMode = MessageSecurityMode(uabin.Primitives.UInt32.unpack(data))
2740 1
        self.ClientNonce = uabin.Primitives.ByteString.unpack(data)
2741 1
        self.RequestedLifetime = uabin.Primitives.UInt32.unpack(data)
2742
2743 1
    def __str__(self):
2744
        return 'OpenSecureChannelParameters(' + 'ClientProtocolVersion:' + str(self.ClientProtocolVersion) + ', ' + \
2745
               'RequestType:' + str(self.RequestType) + ', ' + \
2746
               'SecurityMode:' + str(self.SecurityMode) + ', ' + \
2747
               'ClientNonce:' + str(self.ClientNonce) + ', ' + \
2748
               'RequestedLifetime:' + str(self.RequestedLifetime) + ')'
2749
2750 1
    __repr__ = __str__
2751
2752
2753 1
class OpenSecureChannelRequest(FrozenClass):
2754
    '''
2755
    Creates a secure channel with a server.
2756
2757
    :ivar TypeId:
2758
    :vartype TypeId: NodeId
2759
    :ivar RequestHeader:
2760
    :vartype RequestHeader: RequestHeader
2761
    :ivar Parameters:
2762
    :vartype Parameters: OpenSecureChannelParameters
2763
    '''
2764
2765 1
    ua_types = {
2766
        'TypeId': 'NodeId',
2767
        'RequestHeader': 'RequestHeader',
2768
        'Parameters': 'OpenSecureChannelParameters',
2769
               }
2770
2771 1
    def __init__(self, binary=None):
2772 1
        if binary is not None:
2773 1
            self._binary_init(binary)
2774 1
            self._freeze = True
2775 1
            return
2776 1
        self.TypeId = FourByteNodeId(ObjectIds.OpenSecureChannelRequest_Encoding_DefaultBinary)
2777 1
        self.RequestHeader = RequestHeader()
2778 1
        self.Parameters = OpenSecureChannelParameters()
2779 1
        self._freeze = True
2780
2781 1
    def to_binary(self):
2782 1
        packet = []
2783 1
        packet.append(self.TypeId.to_binary())
2784 1
        packet.append(self.RequestHeader.to_binary())
2785 1
        packet.append(self.Parameters.to_binary())
2786 1
        return b''.join(packet)
2787
2788 1
    @staticmethod
2789
    def from_binary(data):
2790 1
        return OpenSecureChannelRequest(data)
2791
2792 1
    def _binary_init(self, data):
2793 1
        self.TypeId = NodeId.from_binary(data)
2794 1
        self.RequestHeader = RequestHeader.from_binary(data)
2795 1
        self.Parameters = OpenSecureChannelParameters.from_binary(data)
2796
2797 1
    def __str__(self):
2798
        return 'OpenSecureChannelRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2799
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2800
               'Parameters:' + str(self.Parameters) + ')'
2801
2802 1
    __repr__ = __str__
2803
2804
2805 1 View Code Duplication
class OpenSecureChannelResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2806
    '''
2807
    :ivar ServerProtocolVersion:
2808
    :vartype ServerProtocolVersion: UInt32
2809
    :ivar SecurityToken:
2810
    :vartype SecurityToken: ChannelSecurityToken
2811
    :ivar ServerNonce:
2812
    :vartype ServerNonce: ByteString
2813
    '''
2814
2815 1
    ua_types = {
2816
        'ServerProtocolVersion': 'UInt32',
2817
        'SecurityToken': 'ChannelSecurityToken',
2818
        'ServerNonce': 'ByteString',
2819
               }
2820
2821 1
    def __init__(self, binary=None):
2822 1
        if binary is not None:
2823 1
            self._binary_init(binary)
2824 1
            self._freeze = True
2825 1
            return
2826 1
        self.ServerProtocolVersion = 0
2827 1
        self.SecurityToken = ChannelSecurityToken()
2828 1
        self.ServerNonce = None
2829 1
        self._freeze = True
2830
2831 1
    def to_binary(self):
2832 1
        packet = []
2833 1
        packet.append(uabin.Primitives.UInt32.pack(self.ServerProtocolVersion))
2834 1
        packet.append(self.SecurityToken.to_binary())
2835 1
        packet.append(uabin.Primitives.ByteString.pack(self.ServerNonce))
2836 1
        return b''.join(packet)
2837
2838 1
    @staticmethod
2839
    def from_binary(data):
2840 1
        return OpenSecureChannelResult(data)
2841
2842 1
    def _binary_init(self, data):
2843 1
        self.ServerProtocolVersion = uabin.Primitives.UInt32.unpack(data)
2844 1
        self.SecurityToken = ChannelSecurityToken.from_binary(data)
2845 1
        self.ServerNonce = uabin.Primitives.ByteString.unpack(data)
2846
2847 1
    def __str__(self):
2848
        return 'OpenSecureChannelResult(' + 'ServerProtocolVersion:' + str(self.ServerProtocolVersion) + ', ' + \
2849
               'SecurityToken:' + str(self.SecurityToken) + ', ' + \
2850
               'ServerNonce:' + str(self.ServerNonce) + ')'
2851
2852 1
    __repr__ = __str__
2853
2854
2855 1
class OpenSecureChannelResponse(FrozenClass):
2856
    '''
2857
    Creates a secure channel with a server.
2858
2859
    :ivar TypeId:
2860
    :vartype TypeId: NodeId
2861
    :ivar ResponseHeader:
2862
    :vartype ResponseHeader: ResponseHeader
2863
    :ivar Parameters:
2864
    :vartype Parameters: OpenSecureChannelResult
2865
    '''
2866
2867 1
    ua_types = {
2868
        'TypeId': 'NodeId',
2869
        'ResponseHeader': 'ResponseHeader',
2870
        'Parameters': 'OpenSecureChannelResult',
2871
               }
2872
2873 1
    def __init__(self, binary=None):
2874 1
        if binary is not None:
2875 1
            self._binary_init(binary)
2876 1
            self._freeze = True
2877 1
            return
2878 1
        self.TypeId = FourByteNodeId(ObjectIds.OpenSecureChannelResponse_Encoding_DefaultBinary)
2879 1
        self.ResponseHeader = ResponseHeader()
2880 1
        self.Parameters = OpenSecureChannelResult()
2881 1
        self._freeze = True
2882
2883 1
    def to_binary(self):
2884 1
        packet = []
2885 1
        packet.append(self.TypeId.to_binary())
2886 1
        packet.append(self.ResponseHeader.to_binary())
2887 1
        packet.append(self.Parameters.to_binary())
2888 1
        return b''.join(packet)
2889
2890 1
    @staticmethod
2891
    def from_binary(data):
2892 1
        return OpenSecureChannelResponse(data)
2893
2894 1
    def _binary_init(self, data):
2895 1
        self.TypeId = NodeId.from_binary(data)
2896 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
2897 1
        self.Parameters = OpenSecureChannelResult.from_binary(data)
2898
2899 1
    def __str__(self):
2900
        return 'OpenSecureChannelResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2901
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
2902
               'Parameters:' + str(self.Parameters) + ')'
2903
2904 1
    __repr__ = __str__
2905
2906
2907 1 View Code Duplication
class CloseSecureChannelRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2908
    '''
2909
    Closes a secure channel.
2910
2911
    :ivar TypeId:
2912
    :vartype TypeId: NodeId
2913
    :ivar RequestHeader:
2914
    :vartype RequestHeader: RequestHeader
2915
    '''
2916
2917 1
    ua_types = {
2918
        'TypeId': 'NodeId',
2919
        'RequestHeader': 'RequestHeader',
2920
               }
2921
2922 1
    def __init__(self, binary=None):
2923 1
        if binary is not None:
2924
            self._binary_init(binary)
2925
            self._freeze = True
2926
            return
2927 1
        self.TypeId = FourByteNodeId(ObjectIds.CloseSecureChannelRequest_Encoding_DefaultBinary)
2928 1
        self.RequestHeader = RequestHeader()
2929 1
        self._freeze = True
2930
2931 1
    def to_binary(self):
2932 1
        packet = []
2933 1
        packet.append(self.TypeId.to_binary())
2934 1
        packet.append(self.RequestHeader.to_binary())
2935 1
        return b''.join(packet)
2936
2937 1
    @staticmethod
2938
    def from_binary(data):
2939
        return CloseSecureChannelRequest(data)
2940
2941 1
    def _binary_init(self, data):
2942
        self.TypeId = NodeId.from_binary(data)
2943
        self.RequestHeader = RequestHeader.from_binary(data)
2944
2945 1
    def __str__(self):
2946
        return 'CloseSecureChannelRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2947
               'RequestHeader:' + str(self.RequestHeader) + ')'
2948
2949 1
    __repr__ = __str__
2950
2951
2952 1 View Code Duplication
class CloseSecureChannelResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2953
    '''
2954
    Closes a secure channel.
2955
2956
    :ivar TypeId:
2957
    :vartype TypeId: NodeId
2958
    :ivar ResponseHeader:
2959
    :vartype ResponseHeader: ResponseHeader
2960
    '''
2961
2962 1
    ua_types = {
2963
        'TypeId': 'NodeId',
2964
        'ResponseHeader': 'ResponseHeader',
2965
               }
2966
2967 1
    def __init__(self, binary=None):
2968
        if binary is not None:
2969
            self._binary_init(binary)
2970
            self._freeze = True
2971
            return
2972
        self.TypeId = FourByteNodeId(ObjectIds.CloseSecureChannelResponse_Encoding_DefaultBinary)
2973
        self.ResponseHeader = ResponseHeader()
2974
        self._freeze = True
2975
2976 1
    def to_binary(self):
2977
        packet = []
2978
        packet.append(self.TypeId.to_binary())
2979
        packet.append(self.ResponseHeader.to_binary())
2980
        return b''.join(packet)
2981
2982 1
    @staticmethod
2983
    def from_binary(data):
2984
        return CloseSecureChannelResponse(data)
2985
2986 1
    def _binary_init(self, data):
2987
        self.TypeId = NodeId.from_binary(data)
2988
        self.ResponseHeader = ResponseHeader.from_binary(data)
2989
2990 1
    def __str__(self):
2991
        return 'CloseSecureChannelResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2992
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
2993
2994 1
    __repr__ = __str__
2995
2996
2997 1 View Code Duplication
class SignedSoftwareCertificate(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2998
    '''
2999
    A software certificate with a digital signature.
3000
3001
    :ivar CertificateData:
3002
    :vartype CertificateData: ByteString
3003
    :ivar Signature:
3004
    :vartype Signature: ByteString
3005
    '''
3006
3007 1
    ua_types = {
3008
        'CertificateData': 'ByteString',
3009
        'Signature': 'ByteString',
3010
               }
3011
3012 1
    def __init__(self, binary=None):
3013
        if binary is not None:
3014
            self._binary_init(binary)
3015
            self._freeze = True
3016
            return
3017
        self.CertificateData = None
3018
        self.Signature = None
3019
        self._freeze = True
3020
3021 1
    def to_binary(self):
3022
        packet = []
3023
        packet.append(uabin.Primitives.ByteString.pack(self.CertificateData))
3024
        packet.append(uabin.Primitives.ByteString.pack(self.Signature))
3025
        return b''.join(packet)
3026
3027 1
    @staticmethod
3028
    def from_binary(data):
3029
        return SignedSoftwareCertificate(data)
3030
3031 1
    def _binary_init(self, data):
3032
        self.CertificateData = uabin.Primitives.ByteString.unpack(data)
3033
        self.Signature = uabin.Primitives.ByteString.unpack(data)
3034
3035 1
    def __str__(self):
3036
        return 'SignedSoftwareCertificate(' + 'CertificateData:' + str(self.CertificateData) + ', ' + \
3037
               'Signature:' + str(self.Signature) + ')'
3038
3039 1
    __repr__ = __str__
3040
3041
3042 1 View Code Duplication
class SignatureData(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3043
    '''
3044
    A digital signature.
3045
3046
    :ivar Algorithm:
3047
    :vartype Algorithm: String
3048
    :ivar Signature:
3049
    :vartype Signature: ByteString
3050
    '''
3051
3052 1
    ua_types = {
3053
        'Algorithm': 'String',
3054
        'Signature': 'ByteString',
3055
               }
3056
3057 1
    def __init__(self, binary=None):
3058 1
        if binary is not None:
3059 1
            self._binary_init(binary)
3060 1
            self._freeze = True
3061 1
            return
3062 1
        self.Algorithm = None
3063 1
        self.Signature = None
3064 1
        self._freeze = True
3065
3066 1
    def to_binary(self):
3067 1
        packet = []
3068 1
        packet.append(uabin.Primitives.String.pack(self.Algorithm))
3069 1
        packet.append(uabin.Primitives.ByteString.pack(self.Signature))
3070 1
        return b''.join(packet)
3071
3072 1
    @staticmethod
3073
    def from_binary(data):
3074 1
        return SignatureData(data)
3075
3076 1
    def _binary_init(self, data):
3077 1
        self.Algorithm = uabin.Primitives.String.unpack(data)
3078 1
        self.Signature = uabin.Primitives.ByteString.unpack(data)
3079
3080 1
    def __str__(self):
3081
        return 'SignatureData(' + 'Algorithm:' + str(self.Algorithm) + ', ' + \
3082
               'Signature:' + str(self.Signature) + ')'
3083
3084 1
    __repr__ = __str__
3085
3086
3087 1
class CreateSessionParameters(FrozenClass):
3088
    '''
3089
    :ivar ClientDescription:
3090
    :vartype ClientDescription: ApplicationDescription
3091
    :ivar ServerUri:
3092
    :vartype ServerUri: String
3093
    :ivar EndpointUrl:
3094
    :vartype EndpointUrl: String
3095
    :ivar SessionName:
3096
    :vartype SessionName: String
3097
    :ivar ClientNonce:
3098
    :vartype ClientNonce: ByteString
3099
    :ivar ClientCertificate:
3100
    :vartype ClientCertificate: ByteString
3101
    :ivar RequestedSessionTimeout:
3102
    :vartype RequestedSessionTimeout: Double
3103
    :ivar MaxResponseMessageSize:
3104
    :vartype MaxResponseMessageSize: UInt32
3105
    '''
3106
3107 1
    ua_types = {
3108
        'ClientDescription': 'ApplicationDescription',
3109
        'ServerUri': 'String',
3110
        'EndpointUrl': 'String',
3111
        'SessionName': 'String',
3112
        'ClientNonce': 'ByteString',
3113
        'ClientCertificate': 'ByteString',
3114
        'RequestedSessionTimeout': 'Double',
3115
        'MaxResponseMessageSize': 'UInt32',
3116
               }
3117
3118 1
    def __init__(self, binary=None):
3119 1
        if binary is not None:
3120 1
            self._binary_init(binary)
3121 1
            self._freeze = True
3122 1
            return
3123 1
        self.ClientDescription = ApplicationDescription()
3124 1
        self.ServerUri = None
3125 1
        self.EndpointUrl = None
3126 1
        self.SessionName = None
3127 1
        self.ClientNonce = None
3128 1
        self.ClientCertificate = None
3129 1
        self.RequestedSessionTimeout = 0
3130 1
        self.MaxResponseMessageSize = 0
3131 1
        self._freeze = True
3132
3133 1 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3134 1
        packet = []
3135 1
        packet.append(self.ClientDescription.to_binary())
3136 1
        packet.append(uabin.Primitives.String.pack(self.ServerUri))
3137 1
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
3138 1
        packet.append(uabin.Primitives.String.pack(self.SessionName))
3139 1
        packet.append(uabin.Primitives.ByteString.pack(self.ClientNonce))
3140 1
        packet.append(uabin.Primitives.ByteString.pack(self.ClientCertificate))
3141 1
        packet.append(uabin.Primitives.Double.pack(self.RequestedSessionTimeout))
3142 1
        packet.append(uabin.Primitives.UInt32.pack(self.MaxResponseMessageSize))
3143 1
        return b''.join(packet)
3144
3145 1
    @staticmethod
3146
    def from_binary(data):
3147 1
        return CreateSessionParameters(data)
3148
3149 1
    def _binary_init(self, data):
3150 1
        self.ClientDescription = ApplicationDescription.from_binary(data)
3151 1
        self.ServerUri = uabin.Primitives.String.unpack(data)
3152 1
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
3153 1
        self.SessionName = uabin.Primitives.String.unpack(data)
3154 1
        self.ClientNonce = uabin.Primitives.ByteString.unpack(data)
3155 1
        self.ClientCertificate = uabin.Primitives.ByteString.unpack(data)
3156 1
        self.RequestedSessionTimeout = uabin.Primitives.Double.unpack(data)
3157 1
        self.MaxResponseMessageSize = uabin.Primitives.UInt32.unpack(data)
3158
3159 1
    def __str__(self):
3160
        return 'CreateSessionParameters(' + 'ClientDescription:' + str(self.ClientDescription) + ', ' + \
3161
               'ServerUri:' + str(self.ServerUri) + ', ' + \
3162
               'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
3163
               'SessionName:' + str(self.SessionName) + ', ' + \
3164
               'ClientNonce:' + str(self.ClientNonce) + ', ' + \
3165
               'ClientCertificate:' + str(self.ClientCertificate) + ', ' + \
3166
               'RequestedSessionTimeout:' + str(self.RequestedSessionTimeout) + ', ' + \
3167
               'MaxResponseMessageSize:' + str(self.MaxResponseMessageSize) + ')'
3168
3169 1
    __repr__ = __str__
3170
3171
3172 1
class CreateSessionRequest(FrozenClass):
3173
    '''
3174
    Creates a new session with the server.
3175
3176
    :ivar TypeId:
3177
    :vartype TypeId: NodeId
3178
    :ivar RequestHeader:
3179
    :vartype RequestHeader: RequestHeader
3180
    :ivar Parameters:
3181
    :vartype Parameters: CreateSessionParameters
3182
    '''
3183
3184 1
    ua_types = {
3185
        'TypeId': 'NodeId',
3186
        'RequestHeader': 'RequestHeader',
3187
        'Parameters': 'CreateSessionParameters',
3188
               }
3189
3190 1
    def __init__(self, binary=None):
3191 1
        if binary is not None:
3192
            self._binary_init(binary)
3193
            self._freeze = True
3194
            return
3195 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateSessionRequest_Encoding_DefaultBinary)
3196 1
        self.RequestHeader = RequestHeader()
3197 1
        self.Parameters = CreateSessionParameters()
3198 1
        self._freeze = True
3199
3200 1
    def to_binary(self):
3201 1
        packet = []
3202 1
        packet.append(self.TypeId.to_binary())
3203 1
        packet.append(self.RequestHeader.to_binary())
3204 1
        packet.append(self.Parameters.to_binary())
3205 1
        return b''.join(packet)
3206
3207 1
    @staticmethod
3208
    def from_binary(data):
3209
        return CreateSessionRequest(data)
3210
3211 1
    def _binary_init(self, data):
3212
        self.TypeId = NodeId.from_binary(data)
3213
        self.RequestHeader = RequestHeader.from_binary(data)
3214
        self.Parameters = CreateSessionParameters.from_binary(data)
3215
3216 1
    def __str__(self):
3217
        return 'CreateSessionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3218
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
3219
               'Parameters:' + str(self.Parameters) + ')'
3220
3221 1
    __repr__ = __str__
3222
3223
3224 1
class CreateSessionResult(FrozenClass):
3225
    '''
3226
    :ivar SessionId:
3227
    :vartype SessionId: NodeId
3228
    :ivar AuthenticationToken:
3229
    :vartype AuthenticationToken: NodeId
3230
    :ivar RevisedSessionTimeout:
3231
    :vartype RevisedSessionTimeout: Double
3232
    :ivar ServerNonce:
3233
    :vartype ServerNonce: ByteString
3234
    :ivar ServerCertificate:
3235
    :vartype ServerCertificate: ByteString
3236
    :ivar ServerEndpoints:
3237
    :vartype ServerEndpoints: EndpointDescription
3238
    :ivar ServerSoftwareCertificates:
3239
    :vartype ServerSoftwareCertificates: SignedSoftwareCertificate
3240
    :ivar ServerSignature:
3241
    :vartype ServerSignature: SignatureData
3242
    :ivar MaxRequestMessageSize:
3243
    :vartype MaxRequestMessageSize: UInt32
3244
    '''
3245
3246 1
    ua_types = {
3247
        'SessionId': 'NodeId',
3248
        'AuthenticationToken': 'NodeId',
3249
        'RevisedSessionTimeout': 'Double',
3250
        'ServerNonce': 'ByteString',
3251
        'ServerCertificate': 'ByteString',
3252
        'ServerEndpoints': 'EndpointDescription',
3253
        'ServerSoftwareCertificates': 'SignedSoftwareCertificate',
3254
        'ServerSignature': 'SignatureData',
3255
        'MaxRequestMessageSize': 'UInt32',
3256
               }
3257
3258 1
    def __init__(self, binary=None):
3259 1
        if binary is not None:
3260 1
            self._binary_init(binary)
3261 1
            self._freeze = True
3262 1
            return
3263 1
        self.SessionId = NodeId()
3264 1
        self.AuthenticationToken = NodeId()
3265 1
        self.RevisedSessionTimeout = 0
3266 1
        self.ServerNonce = None
3267 1
        self.ServerCertificate = None
3268 1
        self.ServerEndpoints = []
3269 1
        self.ServerSoftwareCertificates = []
3270 1
        self.ServerSignature = SignatureData()
3271 1
        self.MaxRequestMessageSize = 0
3272 1
        self._freeze = True
3273
3274 1
    def to_binary(self):
3275 1
        packet = []
3276 1
        packet.append(self.SessionId.to_binary())
3277 1
        packet.append(self.AuthenticationToken.to_binary())
3278 1
        packet.append(uabin.Primitives.Double.pack(self.RevisedSessionTimeout))
3279 1
        packet.append(uabin.Primitives.ByteString.pack(self.ServerNonce))
3280 1
        packet.append(uabin.Primitives.ByteString.pack(self.ServerCertificate))
3281 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerEndpoints)))
3282 1
        for fieldname in self.ServerEndpoints:
3283 1
            packet.append(fieldname.to_binary())
3284 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerSoftwareCertificates)))
3285 1
        for fieldname in self.ServerSoftwareCertificates:
3286
            packet.append(fieldname.to_binary())
3287 1
        packet.append(self.ServerSignature.to_binary())
3288 1
        packet.append(uabin.Primitives.UInt32.pack(self.MaxRequestMessageSize))
3289 1
        return b''.join(packet)
3290
3291 1
    @staticmethod
3292
    def from_binary(data):
3293 1
        return CreateSessionResult(data)
3294
3295 1
    def _binary_init(self, data):
3296 1
        self.SessionId = NodeId.from_binary(data)
3297 1
        self.AuthenticationToken = NodeId.from_binary(data)
3298 1
        self.RevisedSessionTimeout = uabin.Primitives.Double.unpack(data)
3299 1
        self.ServerNonce = uabin.Primitives.ByteString.unpack(data)
3300 1
        self.ServerCertificate = uabin.Primitives.ByteString.unpack(data)
3301 1
        length = uabin.Primitives.Int32.unpack(data)
3302 1
        array = []
3303 1
        if length != -1:
3304 1
            for _ in range(0, length):
3305 1
                array.append(EndpointDescription.from_binary(data))
3306 1
        self.ServerEndpoints = array
3307 1
        length = uabin.Primitives.Int32.unpack(data)
3308 1
        array = []
3309 1
        if length != -1:
3310 1
            for _ in range(0, length):
3311
                array.append(SignedSoftwareCertificate.from_binary(data))
3312 1
        self.ServerSoftwareCertificates = array
3313 1
        self.ServerSignature = SignatureData.from_binary(data)
3314 1
        self.MaxRequestMessageSize = uabin.Primitives.UInt32.unpack(data)
3315
3316 1
    def __str__(self):
3317
        return 'CreateSessionResult(' + 'SessionId:' + str(self.SessionId) + ', ' + \
3318
               'AuthenticationToken:' + str(self.AuthenticationToken) + ', ' + \
3319
               'RevisedSessionTimeout:' + str(self.RevisedSessionTimeout) + ', ' + \
3320
               'ServerNonce:' + str(self.ServerNonce) + ', ' + \
3321
               'ServerCertificate:' + str(self.ServerCertificate) + ', ' + \
3322
               'ServerEndpoints:' + str(self.ServerEndpoints) + ', ' + \
3323
               'ServerSoftwareCertificates:' + str(self.ServerSoftwareCertificates) + ', ' + \
3324
               'ServerSignature:' + str(self.ServerSignature) + ', ' + \
3325
               'MaxRequestMessageSize:' + str(self.MaxRequestMessageSize) + ')'
3326
3327 1
    __repr__ = __str__
3328
3329
3330 1
class CreateSessionResponse(FrozenClass):
3331
    '''
3332
    Creates a new session with the server.
3333
3334
    :ivar TypeId:
3335
    :vartype TypeId: NodeId
3336
    :ivar ResponseHeader:
3337
    :vartype ResponseHeader: ResponseHeader
3338
    :ivar Parameters:
3339
    :vartype Parameters: CreateSessionResult
3340
    '''
3341
3342 1
    ua_types = {
3343
        'TypeId': 'NodeId',
3344
        'ResponseHeader': 'ResponseHeader',
3345
        'Parameters': 'CreateSessionResult',
3346
               }
3347
3348 1
    def __init__(self, binary=None):
3349 1
        if binary is not None:
3350 1
            self._binary_init(binary)
3351 1
            self._freeze = True
3352 1
            return
3353 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateSessionResponse_Encoding_DefaultBinary)
3354 1
        self.ResponseHeader = ResponseHeader()
3355 1
        self.Parameters = CreateSessionResult()
3356 1
        self._freeze = True
3357
3358 1
    def to_binary(self):
3359 1
        packet = []
3360 1
        packet.append(self.TypeId.to_binary())
3361 1
        packet.append(self.ResponseHeader.to_binary())
3362 1
        packet.append(self.Parameters.to_binary())
3363 1
        return b''.join(packet)
3364
3365 1
    @staticmethod
3366
    def from_binary(data):
3367 1
        return CreateSessionResponse(data)
3368
3369 1
    def _binary_init(self, data):
3370 1
        self.TypeId = NodeId.from_binary(data)
3371 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
3372 1
        self.Parameters = CreateSessionResult.from_binary(data)
3373
3374 1
    def __str__(self):
3375
        return 'CreateSessionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3376
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
3377
               'Parameters:' + str(self.Parameters) + ')'
3378
3379 1
    __repr__ = __str__
3380
3381
3382 1
class UserIdentityToken(FrozenClass):
3383
    '''
3384
    A base type for a user identity token.
3385
3386
    :ivar PolicyId:
3387
    :vartype PolicyId: String
3388
    '''
3389
3390 1
    ua_types = {
3391
        'PolicyId': 'String',
3392
               }
3393
3394 1
    def __init__(self, binary=None):
3395
        if binary is not None:
3396
            self._binary_init(binary)
3397
            self._freeze = True
3398
            return
3399
        self.PolicyId = None
3400
        self._freeze = True
3401
3402 1
    def to_binary(self):
3403
        packet = []
3404
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3405
        return b''.join(packet)
3406
3407 1
    @staticmethod
3408
    def from_binary(data):
3409
        return UserIdentityToken(data)
3410
3411 1
    def _binary_init(self, data):
3412
        self.PolicyId = uabin.Primitives.String.unpack(data)
3413
3414 1
    def __str__(self):
3415
        return 'UserIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ')'
3416
3417 1
    __repr__ = __str__
3418
3419
3420 1
class AnonymousIdentityToken(FrozenClass):
3421
    '''
3422
    A token representing an anonymous user.
3423
3424
    :ivar PolicyId:
3425
    :vartype PolicyId: String
3426
    '''
3427
3428 1
    ua_types = {
3429
        'PolicyId': 'String',
3430
               }
3431
3432 1
    def __init__(self, binary=None):
3433 1
        if binary is not None:
3434 1
            self._binary_init(binary)
3435 1
            self._freeze = True
3436 1
            return
3437 1
        self.PolicyId = None
3438 1
        self._freeze = True
3439
3440 1
    def to_binary(self):
3441 1
        packet = []
3442 1
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3443 1
        return b''.join(packet)
3444
3445 1
    @staticmethod
3446
    def from_binary(data):
3447 1
        return AnonymousIdentityToken(data)
3448
3449 1
    def _binary_init(self, data):
3450 1
        self.PolicyId = uabin.Primitives.String.unpack(data)
3451
3452 1
    def __str__(self):
3453
        return 'AnonymousIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ')'
3454
3455 1
    __repr__ = __str__
3456
3457
3458 1 View Code Duplication
class UserNameIdentityToken(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3459
    '''
3460
    A token representing a user identified by a user name and password.
3461
3462
    :ivar PolicyId:
3463
    :vartype PolicyId: String
3464
    :ivar UserName:
3465
    :vartype UserName: String
3466
    :ivar Password:
3467
    :vartype Password: ByteString
3468
    :ivar EncryptionAlgorithm:
3469
    :vartype EncryptionAlgorithm: String
3470
    '''
3471
3472 1
    ua_types = {
3473
        'PolicyId': 'String',
3474
        'UserName': 'String',
3475
        'Password': 'ByteString',
3476
        'EncryptionAlgorithm': 'String',
3477
               }
3478
3479 1
    def __init__(self, binary=None):
3480 1
        if binary is not None:
3481 1
            self._binary_init(binary)
3482 1
            self._freeze = True
3483 1
            return
3484 1
        self.PolicyId = None
3485 1
        self.UserName = None
3486 1
        self.Password = None
3487 1
        self.EncryptionAlgorithm = None
3488 1
        self._freeze = True
3489
3490 1
    def to_binary(self):
3491 1
        packet = []
3492 1
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3493 1
        packet.append(uabin.Primitives.String.pack(self.UserName))
3494 1
        packet.append(uabin.Primitives.ByteString.pack(self.Password))
3495 1
        packet.append(uabin.Primitives.String.pack(self.EncryptionAlgorithm))
3496 1
        return b''.join(packet)
3497
3498 1
    @staticmethod
3499
    def from_binary(data):
3500 1
        return UserNameIdentityToken(data)
3501
3502 1
    def _binary_init(self, data):
3503 1
        self.PolicyId = uabin.Primitives.String.unpack(data)
3504 1
        self.UserName = uabin.Primitives.String.unpack(data)
3505 1
        self.Password = uabin.Primitives.ByteString.unpack(data)
3506 1
        self.EncryptionAlgorithm = uabin.Primitives.String.unpack(data)
3507
3508 1
    def __str__(self):
3509
        return 'UserNameIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3510
               'UserName:' + str(self.UserName) + ', ' + \
3511
               'Password:' + str(self.Password) + ', ' + \
3512
               'EncryptionAlgorithm:' + str(self.EncryptionAlgorithm) + ')'
3513
3514 1
    __repr__ = __str__
3515
3516
3517 1 View Code Duplication
class X509IdentityToken(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3518
    '''
3519
    A token representing a user identified by an X509 certificate.
3520
3521
    :ivar PolicyId:
3522
    :vartype PolicyId: String
3523
    :ivar CertificateData:
3524
    :vartype CertificateData: ByteString
3525
    '''
3526
3527 1
    ua_types = {
3528
        'PolicyId': 'String',
3529
        'CertificateData': 'ByteString',
3530
               }
3531
3532 1
    def __init__(self, binary=None):
3533
        if binary is not None:
3534
            self._binary_init(binary)
3535
            self._freeze = True
3536
            return
3537
        self.PolicyId = None
3538
        self.CertificateData = None
3539
        self._freeze = True
3540
3541 1
    def to_binary(self):
3542
        packet = []
3543
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3544
        packet.append(uabin.Primitives.ByteString.pack(self.CertificateData))
3545
        return b''.join(packet)
3546
3547 1
    @staticmethod
3548
    def from_binary(data):
3549
        return X509IdentityToken(data)
3550
3551 1
    def _binary_init(self, data):
3552
        self.PolicyId = uabin.Primitives.String.unpack(data)
3553
        self.CertificateData = uabin.Primitives.ByteString.unpack(data)
3554
3555 1
    def __str__(self):
3556
        return 'X509IdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3557
               'CertificateData:' + str(self.CertificateData) + ')'
3558
3559 1
    __repr__ = __str__
3560
3561
3562 1 View Code Duplication
class KerberosIdentityToken(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3563
    '''
3564
    :ivar PolicyId:
3565
    :vartype PolicyId: String
3566
    :ivar TicketData:
3567
    :vartype TicketData: ByteString
3568
    '''
3569
3570 1
    ua_types = {
3571
        'PolicyId': 'String',
3572
        'TicketData': 'ByteString',
3573
               }
3574
3575 1
    def __init__(self, binary=None):
3576
        if binary is not None:
3577
            self._binary_init(binary)
3578
            self._freeze = True
3579
            return
3580
        self.PolicyId = None
3581
        self.TicketData = None
3582
        self._freeze = True
3583
3584 1
    def to_binary(self):
3585
        packet = []
3586
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3587
        packet.append(uabin.Primitives.ByteString.pack(self.TicketData))
3588
        return b''.join(packet)
3589
3590 1
    @staticmethod
3591
    def from_binary(data):
3592
        return KerberosIdentityToken(data)
3593
3594 1
    def _binary_init(self, data):
3595
        self.PolicyId = uabin.Primitives.String.unpack(data)
3596
        self.TicketData = uabin.Primitives.ByteString.unpack(data)
3597
3598 1
    def __str__(self):
3599
        return 'KerberosIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3600
               'TicketData:' + str(self.TicketData) + ')'
3601
3602 1
    __repr__ = __str__
3603
3604
3605 1 View Code Duplication
class IssuedIdentityToken(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3606
    '''
3607
    A token representing a user identified by a WS-Security XML token.
3608
3609
    :ivar PolicyId:
3610
    :vartype PolicyId: String
3611
    :ivar TokenData:
3612
    :vartype TokenData: ByteString
3613
    :ivar EncryptionAlgorithm:
3614
    :vartype EncryptionAlgorithm: String
3615
    '''
3616
3617 1
    ua_types = {
3618
        'PolicyId': 'String',
3619
        'TokenData': 'ByteString',
3620
        'EncryptionAlgorithm': 'String',
3621
               }
3622
3623 1
    def __init__(self, binary=None):
3624
        if binary is not None:
3625
            self._binary_init(binary)
3626
            self._freeze = True
3627
            return
3628
        self.PolicyId = None
3629
        self.TokenData = None
3630
        self.EncryptionAlgorithm = None
3631
        self._freeze = True
3632
3633 1
    def to_binary(self):
3634
        packet = []
3635
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3636
        packet.append(uabin.Primitives.ByteString.pack(self.TokenData))
3637
        packet.append(uabin.Primitives.String.pack(self.EncryptionAlgorithm))
3638
        return b''.join(packet)
3639
3640 1
    @staticmethod
3641
    def from_binary(data):
3642
        return IssuedIdentityToken(data)
3643
3644 1
    def _binary_init(self, data):
3645
        self.PolicyId = uabin.Primitives.String.unpack(data)
3646
        self.TokenData = uabin.Primitives.ByteString.unpack(data)
3647
        self.EncryptionAlgorithm = uabin.Primitives.String.unpack(data)
3648
3649 1
    def __str__(self):
3650
        return 'IssuedIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3651
               'TokenData:' + str(self.TokenData) + ', ' + \
3652
               'EncryptionAlgorithm:' + str(self.EncryptionAlgorithm) + ')'
3653
3654 1
    __repr__ = __str__
3655
3656
3657 1 View Code Duplication
class ActivateSessionParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3658
    '''
3659
    :ivar ClientSignature:
3660
    :vartype ClientSignature: SignatureData
3661
    :ivar ClientSoftwareCertificates:
3662
    :vartype ClientSoftwareCertificates: SignedSoftwareCertificate
3663
    :ivar LocaleIds:
3664
    :vartype LocaleIds: String
3665
    :ivar UserIdentityToken:
3666
    :vartype UserIdentityToken: ExtensionObject
3667
    :ivar UserTokenSignature:
3668
    :vartype UserTokenSignature: SignatureData
3669
    '''
3670
3671 1
    ua_types = {
3672
        'ClientSignature': 'SignatureData',
3673
        'ClientSoftwareCertificates': 'SignedSoftwareCertificate',
3674
        'LocaleIds': 'String',
3675
        'UserIdentityToken': 'ExtensionObject',
3676
        'UserTokenSignature': 'SignatureData',
3677
               }
3678
3679 1
    def __init__(self, binary=None):
3680 1
        if binary is not None:
3681 1
            self._binary_init(binary)
3682 1
            self._freeze = True
3683 1
            return
3684 1
        self.ClientSignature = SignatureData()
3685 1
        self.ClientSoftwareCertificates = []
3686 1
        self.LocaleIds = []
3687 1
        self.UserIdentityToken = None
3688 1
        self.UserTokenSignature = SignatureData()
3689 1
        self._freeze = True
3690
3691 1
    def to_binary(self):
3692 1
        packet = []
3693 1
        packet.append(self.ClientSignature.to_binary())
3694 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ClientSoftwareCertificates)))
3695 1
        for fieldname in self.ClientSoftwareCertificates:
3696
            packet.append(fieldname.to_binary())
3697 1
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
3698 1
        for fieldname in self.LocaleIds:
3699 1
            packet.append(uabin.Primitives.String.pack(fieldname))
3700 1
        packet.append(extensionobject_to_binary(self.UserIdentityToken))
3701 1
        packet.append(self.UserTokenSignature.to_binary())
3702 1
        return b''.join(packet)
3703
3704 1
    @staticmethod
3705
    def from_binary(data):
3706 1
        return ActivateSessionParameters(data)
3707
3708 1
    def _binary_init(self, data):
3709 1
        self.ClientSignature = SignatureData.from_binary(data)
3710 1
        length = uabin.Primitives.Int32.unpack(data)
3711 1
        array = []
3712 1
        if length != -1:
3713 1
            for _ in range(0, length):
3714
                array.append(SignedSoftwareCertificate.from_binary(data))
3715 1
        self.ClientSoftwareCertificates = array
3716 1
        self.LocaleIds = uabin.Primitives.String.unpack_array(data)
3717 1
        self.UserIdentityToken = extensionobject_from_binary(data)
3718 1
        self.UserTokenSignature = SignatureData.from_binary(data)
3719
3720 1
    def __str__(self):
3721
        return 'ActivateSessionParameters(' + 'ClientSignature:' + str(self.ClientSignature) + ', ' + \
3722
               'ClientSoftwareCertificates:' + str(self.ClientSoftwareCertificates) + ', ' + \
3723
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
3724
               'UserIdentityToken:' + str(self.UserIdentityToken) + ', ' + \
3725
               'UserTokenSignature:' + str(self.UserTokenSignature) + ')'
3726
3727 1
    __repr__ = __str__
3728
3729
3730 1
class ActivateSessionRequest(FrozenClass):
3731
    '''
3732
    Activates a session with the server.
3733
3734
    :ivar TypeId:
3735
    :vartype TypeId: NodeId
3736
    :ivar RequestHeader:
3737
    :vartype RequestHeader: RequestHeader
3738
    :ivar Parameters:
3739
    :vartype Parameters: ActivateSessionParameters
3740
    '''
3741
3742 1
    ua_types = {
3743
        'TypeId': 'NodeId',
3744
        'RequestHeader': 'RequestHeader',
3745
        'Parameters': 'ActivateSessionParameters',
3746
               }
3747
3748 1
    def __init__(self, binary=None):
3749 1
        if binary is not None:
3750
            self._binary_init(binary)
3751
            self._freeze = True
3752
            return
3753 1
        self.TypeId = FourByteNodeId(ObjectIds.ActivateSessionRequest_Encoding_DefaultBinary)
3754 1
        self.RequestHeader = RequestHeader()
3755 1
        self.Parameters = ActivateSessionParameters()
3756 1
        self._freeze = True
3757
3758 1
    def to_binary(self):
3759 1
        packet = []
3760 1
        packet.append(self.TypeId.to_binary())
3761 1
        packet.append(self.RequestHeader.to_binary())
3762 1
        packet.append(self.Parameters.to_binary())
3763 1
        return b''.join(packet)
3764
3765 1
    @staticmethod
3766
    def from_binary(data):
3767
        return ActivateSessionRequest(data)
3768
3769 1
    def _binary_init(self, data):
3770
        self.TypeId = NodeId.from_binary(data)
3771
        self.RequestHeader = RequestHeader.from_binary(data)
3772
        self.Parameters = ActivateSessionParameters.from_binary(data)
3773
3774 1
    def __str__(self):
3775
        return 'ActivateSessionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3776
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
3777
               'Parameters:' + str(self.Parameters) + ')'
3778
3779 1
    __repr__ = __str__
3780
3781
3782 1 View Code Duplication
class ActivateSessionResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3783
    '''
3784
    :ivar ServerNonce:
3785
    :vartype ServerNonce: ByteString
3786
    :ivar Results:
3787
    :vartype Results: StatusCode
3788
    :ivar DiagnosticInfos:
3789
    :vartype DiagnosticInfos: DiagnosticInfo
3790
    '''
3791
3792 1
    ua_types = {
3793
        'ServerNonce': 'ByteString',
3794
        'Results': 'StatusCode',
3795
        'DiagnosticInfos': 'DiagnosticInfo',
3796
               }
3797
3798 1
    def __init__(self, binary=None):
3799 1
        if binary is not None:
3800 1
            self._binary_init(binary)
3801 1
            self._freeze = True
3802 1
            return
3803 1
        self.ServerNonce = None
3804 1
        self.Results = []
3805 1
        self.DiagnosticInfos = []
3806 1
        self._freeze = True
3807
3808 1
    def to_binary(self):
3809 1
        packet = []
3810 1
        packet.append(uabin.Primitives.ByteString.pack(self.ServerNonce))
3811 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
3812 1
        for fieldname in self.Results:
3813
            packet.append(fieldname.to_binary())
3814 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
3815 1
        for fieldname in self.DiagnosticInfos:
3816
            packet.append(fieldname.to_binary())
3817 1
        return b''.join(packet)
3818
3819 1
    @staticmethod
3820
    def from_binary(data):
3821 1
        return ActivateSessionResult(data)
3822
3823 1
    def _binary_init(self, data):
3824 1
        self.ServerNonce = uabin.Primitives.ByteString.unpack(data)
3825 1
        length = uabin.Primitives.Int32.unpack(data)
3826 1
        array = []
3827 1
        if length != -1:
3828 1
            for _ in range(0, length):
3829
                array.append(StatusCode.from_binary(data))
3830 1
        self.Results = array
3831 1
        length = uabin.Primitives.Int32.unpack(data)
3832 1
        array = []
3833 1
        if length != -1:
3834 1
            for _ in range(0, length):
3835
                array.append(DiagnosticInfo.from_binary(data))
3836 1
        self.DiagnosticInfos = array
3837
3838 1
    def __str__(self):
3839
        return 'ActivateSessionResult(' + 'ServerNonce:' + str(self.ServerNonce) + ', ' + \
3840
               'Results:' + str(self.Results) + ', ' + \
3841
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
3842
3843 1
    __repr__ = __str__
3844
3845
3846 1
class ActivateSessionResponse(FrozenClass):
3847
    '''
3848
    Activates a session with the server.
3849
3850
    :ivar TypeId:
3851
    :vartype TypeId: NodeId
3852
    :ivar ResponseHeader:
3853
    :vartype ResponseHeader: ResponseHeader
3854
    :ivar Parameters:
3855
    :vartype Parameters: ActivateSessionResult
3856
    '''
3857
3858 1
    ua_types = {
3859
        'TypeId': 'NodeId',
3860
        'ResponseHeader': 'ResponseHeader',
3861
        'Parameters': 'ActivateSessionResult',
3862
               }
3863
3864 1
    def __init__(self, binary=None):
3865 1
        if binary is not None:
3866 1
            self._binary_init(binary)
3867 1
            self._freeze = True
3868 1
            return
3869 1
        self.TypeId = FourByteNodeId(ObjectIds.ActivateSessionResponse_Encoding_DefaultBinary)
3870 1
        self.ResponseHeader = ResponseHeader()
3871 1
        self.Parameters = ActivateSessionResult()
3872 1
        self._freeze = True
3873
3874 1
    def to_binary(self):
3875 1
        packet = []
3876 1
        packet.append(self.TypeId.to_binary())
3877 1
        packet.append(self.ResponseHeader.to_binary())
3878 1
        packet.append(self.Parameters.to_binary())
3879 1
        return b''.join(packet)
3880
3881 1
    @staticmethod
3882
    def from_binary(data):
3883 1
        return ActivateSessionResponse(data)
3884
3885 1
    def _binary_init(self, data):
3886 1
        self.TypeId = NodeId.from_binary(data)
3887 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
3888 1
        self.Parameters = ActivateSessionResult.from_binary(data)
3889
3890 1
    def __str__(self):
3891
        return 'ActivateSessionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3892
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
3893
               'Parameters:' + str(self.Parameters) + ')'
3894
3895 1
    __repr__ = __str__
3896
3897
3898 1
class CloseSessionRequest(FrozenClass):
3899
    '''
3900
    Closes a session with the server.
3901
3902
    :ivar TypeId:
3903
    :vartype TypeId: NodeId
3904
    :ivar RequestHeader:
3905
    :vartype RequestHeader: RequestHeader
3906
    :ivar DeleteSubscriptions:
3907
    :vartype DeleteSubscriptions: Boolean
3908
    '''
3909
3910 1
    ua_types = {
3911
        'TypeId': 'NodeId',
3912
        'RequestHeader': 'RequestHeader',
3913
        'DeleteSubscriptions': 'Boolean',
3914
               }
3915
3916 1
    def __init__(self, binary=None):
3917 1
        if binary is not None:
3918
            self._binary_init(binary)
3919
            self._freeze = True
3920
            return
3921 1
        self.TypeId = FourByteNodeId(ObjectIds.CloseSessionRequest_Encoding_DefaultBinary)
3922 1
        self.RequestHeader = RequestHeader()
3923 1
        self.DeleteSubscriptions = True
3924 1
        self._freeze = True
3925
3926 1
    def to_binary(self):
3927 1
        packet = []
3928 1
        packet.append(self.TypeId.to_binary())
3929 1
        packet.append(self.RequestHeader.to_binary())
3930 1
        packet.append(uabin.Primitives.Boolean.pack(self.DeleteSubscriptions))
3931 1
        return b''.join(packet)
3932
3933 1
    @staticmethod
3934
    def from_binary(data):
3935
        return CloseSessionRequest(data)
3936
3937 1
    def _binary_init(self, data):
3938
        self.TypeId = NodeId.from_binary(data)
3939
        self.RequestHeader = RequestHeader.from_binary(data)
3940
        self.DeleteSubscriptions = uabin.Primitives.Boolean.unpack(data)
3941
3942 1
    def __str__(self):
3943
        return 'CloseSessionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3944
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
3945
               'DeleteSubscriptions:' + str(self.DeleteSubscriptions) + ')'
3946
3947 1
    __repr__ = __str__
3948
3949
3950 1 View Code Duplication
class CloseSessionResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3951
    '''
3952
    Closes a session with the server.
3953
3954
    :ivar TypeId:
3955
    :vartype TypeId: NodeId
3956
    :ivar ResponseHeader:
3957
    :vartype ResponseHeader: ResponseHeader
3958
    '''
3959
3960 1
    ua_types = {
3961
        'TypeId': 'NodeId',
3962
        'ResponseHeader': 'ResponseHeader',
3963
               }
3964
3965 1
    def __init__(self, binary=None):
3966 1
        if binary is not None:
3967 1
            self._binary_init(binary)
3968 1
            self._freeze = True
3969 1
            return
3970 1
        self.TypeId = FourByteNodeId(ObjectIds.CloseSessionResponse_Encoding_DefaultBinary)
3971 1
        self.ResponseHeader = ResponseHeader()
3972 1
        self._freeze = True
3973
3974 1
    def to_binary(self):
3975 1
        packet = []
3976 1
        packet.append(self.TypeId.to_binary())
3977 1
        packet.append(self.ResponseHeader.to_binary())
3978 1
        return b''.join(packet)
3979
3980 1
    @staticmethod
3981
    def from_binary(data):
3982 1
        return CloseSessionResponse(data)
3983
3984 1
    def _binary_init(self, data):
3985 1
        self.TypeId = NodeId.from_binary(data)
3986 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
3987
3988 1
    def __str__(self):
3989
        return 'CloseSessionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3990
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
3991
3992 1
    __repr__ = __str__
3993
3994
3995 1
class CancelParameters(FrozenClass):
3996
    '''
3997
    :ivar RequestHandle:
3998
    :vartype RequestHandle: UInt32
3999
    '''
4000
4001 1
    ua_types = {
4002
        'RequestHandle': 'UInt32',
4003
               }
4004
4005 1
    def __init__(self, binary=None):
4006
        if binary is not None:
4007
            self._binary_init(binary)
4008
            self._freeze = True
4009
            return
4010
        self.RequestHandle = 0
4011
        self._freeze = True
4012
4013 1
    def to_binary(self):
4014
        packet = []
4015
        packet.append(uabin.Primitives.UInt32.pack(self.RequestHandle))
4016
        return b''.join(packet)
4017
4018 1
    @staticmethod
4019
    def from_binary(data):
4020
        return CancelParameters(data)
4021
4022 1
    def _binary_init(self, data):
4023
        self.RequestHandle = uabin.Primitives.UInt32.unpack(data)
4024
4025 1
    def __str__(self):
4026
        return 'CancelParameters(' + 'RequestHandle:' + str(self.RequestHandle) + ')'
4027
4028 1
    __repr__ = __str__
4029
4030
4031 1
class CancelRequest(FrozenClass):
4032
    '''
4033
    Cancels an outstanding request.
4034
4035
    :ivar TypeId:
4036
    :vartype TypeId: NodeId
4037
    :ivar RequestHeader:
4038
    :vartype RequestHeader: RequestHeader
4039
    :ivar Parameters:
4040
    :vartype Parameters: CancelParameters
4041
    '''
4042
4043 1
    ua_types = {
4044
        'TypeId': 'NodeId',
4045
        'RequestHeader': 'RequestHeader',
4046
        'Parameters': 'CancelParameters',
4047
               }
4048
4049 1
    def __init__(self, binary=None):
4050
        if binary is not None:
4051
            self._binary_init(binary)
4052
            self._freeze = True
4053
            return
4054
        self.TypeId = FourByteNodeId(ObjectIds.CancelRequest_Encoding_DefaultBinary)
4055
        self.RequestHeader = RequestHeader()
4056
        self.Parameters = CancelParameters()
4057
        self._freeze = True
4058
4059 1
    def to_binary(self):
4060
        packet = []
4061
        packet.append(self.TypeId.to_binary())
4062
        packet.append(self.RequestHeader.to_binary())
4063
        packet.append(self.Parameters.to_binary())
4064
        return b''.join(packet)
4065
4066 1
    @staticmethod
4067
    def from_binary(data):
4068
        return CancelRequest(data)
4069
4070 1
    def _binary_init(self, data):
4071
        self.TypeId = NodeId.from_binary(data)
4072
        self.RequestHeader = RequestHeader.from_binary(data)
4073
        self.Parameters = CancelParameters.from_binary(data)
4074
4075 1
    def __str__(self):
4076
        return 'CancelRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
4077
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
4078
               'Parameters:' + str(self.Parameters) + ')'
4079
4080 1
    __repr__ = __str__
4081
4082
4083 1
class CancelResult(FrozenClass):
4084
    '''
4085
    :ivar CancelCount:
4086
    :vartype CancelCount: UInt32
4087
    '''
4088
4089 1
    ua_types = {
4090
        'CancelCount': 'UInt32',
4091
               }
4092
4093 1
    def __init__(self, binary=None):
4094
        if binary is not None:
4095
            self._binary_init(binary)
4096
            self._freeze = True
4097
            return
4098
        self.CancelCount = 0
4099
        self._freeze = True
4100
4101 1
    def to_binary(self):
4102
        packet = []
4103
        packet.append(uabin.Primitives.UInt32.pack(self.CancelCount))
4104 View Code Duplication
        return b''.join(packet)
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4105
4106 1
    @staticmethod
4107
    def from_binary(data):
4108
        return CancelResult(data)
4109
4110 1
    def _binary_init(self, data):
4111
        self.CancelCount = uabin.Primitives.UInt32.unpack(data)
4112
4113 1
    def __str__(self):
4114
        return 'CancelResult(' + 'CancelCount:' + str(self.CancelCount) + ')'
4115
4116 1
    __repr__ = __str__
4117
4118
4119 1
class CancelResponse(FrozenClass):
4120
    '''
4121
    Cancels an outstanding request.
4122
4123
    :ivar TypeId:
4124
    :vartype TypeId: NodeId
4125
    :ivar ResponseHeader:
4126
    :vartype ResponseHeader: ResponseHeader
4127
    :ivar Parameters:
4128
    :vartype Parameters: CancelResult
4129
    '''
4130
4131 1
    ua_types = {
4132
        'TypeId': 'NodeId',
4133
        'ResponseHeader': 'ResponseHeader',
4134
        'Parameters': 'CancelResult',
4135
               }
4136
4137 1
    def __init__(self, binary=None):
4138
        if binary is not None:
4139
            self._binary_init(binary)
4140
            self._freeze = True
4141
            return
4142
        self.TypeId = FourByteNodeId(ObjectIds.CancelResponse_Encoding_DefaultBinary)
4143
        self.ResponseHeader = ResponseHeader()
4144
        self.Parameters = CancelResult()
4145
        self._freeze = True
4146
4147 1
    def to_binary(self):
4148
        packet = []
4149
        packet.append(self.TypeId.to_binary())
4150
        packet.append(self.ResponseHeader.to_binary())
4151
        packet.append(self.Parameters.to_binary())
4152
        return b''.join(packet)
4153
4154 1
    @staticmethod
4155
    def from_binary(data):
4156
        return CancelResponse(data)
4157
4158 1
    def _binary_init(self, data):
4159
        self.TypeId = NodeId.from_binary(data)
4160
        self.ResponseHeader = ResponseHeader.from_binary(data)
4161
        self.Parameters = CancelResult.from_binary(data)
4162
4163 1
    def __str__(self):
4164
        return 'CancelResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
4165
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
4166
               'Parameters:' + str(self.Parameters) + ')'
4167
4168 1
    __repr__ = __str__
4169
4170
4171 1
class NodeAttributes(FrozenClass):
4172
    '''
4173
    The base attributes for all nodes.
4174
4175
    :ivar SpecifiedAttributes:
4176
    :vartype SpecifiedAttributes: UInt32
4177
    :ivar DisplayName:
4178
    :vartype DisplayName: LocalizedText
4179
    :ivar Description:
4180
    :vartype Description: LocalizedText
4181
    :ivar WriteMask:
4182
    :vartype WriteMask: UInt32
4183
    :ivar UserWriteMask:
4184
    :vartype UserWriteMask: UInt32
4185
    '''
4186
4187 1
    ua_types = {
4188
        'SpecifiedAttributes': 'UInt32',
4189 View Code Duplication
        'DisplayName': 'LocalizedText',
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4190
        'Description': 'LocalizedText',
4191
        'WriteMask': 'UInt32',
4192
        'UserWriteMask': 'UInt32',
4193
               }
4194
4195 1
    def __init__(self, binary=None):
4196
        if binary is not None:
4197
            self._binary_init(binary)
4198
            self._freeze = True
4199
            return
4200
        self.SpecifiedAttributes = 0
4201
        self.DisplayName = LocalizedText()
4202
        self.Description = LocalizedText()
4203
        self.WriteMask = 0
4204
        self.UserWriteMask = 0
4205
        self._freeze = True
4206
4207 1
    def to_binary(self):
4208
        packet = []
4209
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4210
        packet.append(self.DisplayName.to_binary())
4211
        packet.append(self.Description.to_binary())
4212
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4213
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4214
        return b''.join(packet)
4215
4216 1
    @staticmethod
4217
    def from_binary(data):
4218
        return NodeAttributes(data)
4219
4220 1
    def _binary_init(self, data):
4221
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4222
        self.DisplayName = LocalizedText.from_binary(data)
4223
        self.Description = LocalizedText.from_binary(data)
4224
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4225
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4226
4227 1
    def __str__(self):
4228
        return 'NodeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4229
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4230
               'Description:' + str(self.Description) + ', ' + \
4231
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4232
               'UserWriteMask:' + str(self.UserWriteMask) + ')'
4233
4234 1
    __repr__ = __str__
4235
4236
4237 1 View Code Duplication
class ObjectAttributes(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4238
    '''
4239
    The attributes for an object node.
4240
4241
    :ivar SpecifiedAttributes:
4242
    :vartype SpecifiedAttributes: UInt32
4243
    :ivar DisplayName:
4244
    :vartype DisplayName: LocalizedText
4245
    :ivar Description:
4246
    :vartype Description: LocalizedText
4247
    :ivar WriteMask:
4248
    :vartype WriteMask: UInt32
4249
    :ivar UserWriteMask:
4250
    :vartype UserWriteMask: UInt32
4251
    :ivar EventNotifier:
4252
    :vartype EventNotifier: Byte
4253
    '''
4254
4255 1
    ua_types = {
4256
        'SpecifiedAttributes': 'UInt32',
4257
        'DisplayName': 'LocalizedText',
4258
        'Description': 'LocalizedText',
4259
        'WriteMask': 'UInt32',
4260
        'UserWriteMask': 'UInt32',
4261
        'EventNotifier': 'Byte',
4262
               }
4263
4264 1
    def __init__(self, binary=None):
4265 1
        if binary is not None:
4266 1
            self._binary_init(binary)
4267 1
            self._freeze = True
4268 1
            return
4269 1
        self.SpecifiedAttributes = 0
4270 1
        self.DisplayName = LocalizedText()
4271 1
        self.Description = LocalizedText()
4272 1
        self.WriteMask = 0
4273 1
        self.UserWriteMask = 0
4274 1
        self.EventNotifier = 0
4275 1
        self._freeze = True
4276
4277 1
    def to_binary(self):
4278 1
        packet = []
4279 1
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4280 1
        packet.append(self.DisplayName.to_binary())
4281 1
        packet.append(self.Description.to_binary())
4282 1
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4283 1
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4284 1
        packet.append(uabin.Primitives.Byte.pack(self.EventNotifier))
4285 1
        return b''.join(packet)
4286
4287 1
    @staticmethod
4288
    def from_binary(data):
4289 1
        return ObjectAttributes(data)
4290
4291 1
    def _binary_init(self, data):
4292 1
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4293 1
        self.DisplayName = LocalizedText.from_binary(data)
4294 1
        self.Description = LocalizedText.from_binary(data)
4295 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4296 1
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4297 1
        self.EventNotifier = uabin.Primitives.Byte.unpack(data)
4298
4299 1
    def __str__(self):
4300
        return 'ObjectAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4301
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4302
               'Description:' + str(self.Description) + ', ' + \
4303
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4304
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4305
               'EventNotifier:' + str(self.EventNotifier) + ')'
4306
4307 1
    __repr__ = __str__
4308
4309
4310 1
class VariableAttributes(FrozenClass):
4311
    '''
4312
    The attributes for a variable node.
4313
4314
    :ivar SpecifiedAttributes:
4315
    :vartype SpecifiedAttributes: UInt32
4316
    :ivar DisplayName:
4317
    :vartype DisplayName: LocalizedText
4318
    :ivar Description:
4319
    :vartype Description: LocalizedText
4320
    :ivar WriteMask:
4321
    :vartype WriteMask: UInt32
4322
    :ivar UserWriteMask:
4323
    :vartype UserWriteMask: UInt32
4324
    :ivar Value:
4325
    :vartype Value: Variant
4326
    :ivar DataType:
4327
    :vartype DataType: NodeId
4328
    :ivar ValueRank:
4329
    :vartype ValueRank: Int32
4330
    :ivar ArrayDimensions:
4331
    :vartype ArrayDimensions: UInt32
4332
    :ivar AccessLevel:
4333
    :vartype AccessLevel: Byte
4334
    :ivar UserAccessLevel:
4335
    :vartype UserAccessLevel: Byte
4336
    :ivar MinimumSamplingInterval:
4337
    :vartype MinimumSamplingInterval: Double
4338
    :ivar Historizing:
4339
    :vartype Historizing: Boolean
4340
    '''
4341
4342 1
    ua_types = {
4343
        'SpecifiedAttributes': 'UInt32',
4344
        'DisplayName': 'LocalizedText',
4345
        'Description': 'LocalizedText',
4346
        'WriteMask': 'UInt32',
4347
        'UserWriteMask': 'UInt32',
4348
        'Value': 'Variant',
4349
        'DataType': 'NodeId',
4350
        'ValueRank': 'Int32',
4351
        'ArrayDimensions': 'UInt32',
4352
        'AccessLevel': 'Byte',
4353
        'UserAccessLevel': 'Byte',
4354
        'MinimumSamplingInterval': 'Double',
4355
        'Historizing': 'Boolean',
4356
               }
4357
4358 1
    def __init__(self, binary=None):
4359 1
        if binary is not None:
4360 1
            self._binary_init(binary)
4361 1
            self._freeze = True
4362 1
            return
4363 1
        self.SpecifiedAttributes = 0
4364 1
        self.DisplayName = LocalizedText()
4365 1
        self.Description = LocalizedText()
4366 1
        self.WriteMask = 0
4367 1
        self.UserWriteMask = 0
4368 1
        self.Value = Variant()
4369 1
        self.DataType = NodeId()
4370 1
        self.ValueRank = 0
4371 1
        self.ArrayDimensions = []
4372 1
        self.AccessLevel = 0
4373 1
        self.UserAccessLevel = 0
4374 1
        self.MinimumSamplingInterval = 0
4375 1
        self.Historizing = True
4376 1
        self._freeze = True
4377
4378 1
    def to_binary(self):
4379 1
        packet = []
4380 1
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4381 1
        packet.append(self.DisplayName.to_binary())
4382 1
        packet.append(self.Description.to_binary())
4383 1
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4384 1
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4385 1
        packet.append(self.Value.to_binary())
4386 1
        packet.append(self.DataType.to_binary())
4387 1
        packet.append(uabin.Primitives.Int32.pack(self.ValueRank))
4388 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ArrayDimensions)))
4389 1
        for fieldname in self.ArrayDimensions:
4390 1
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
4391 1
        packet.append(uabin.Primitives.Byte.pack(self.AccessLevel))
4392 1
        packet.append(uabin.Primitives.Byte.pack(self.UserAccessLevel))
4393 1
        packet.append(uabin.Primitives.Double.pack(self.MinimumSamplingInterval))
4394 1
        packet.append(uabin.Primitives.Boolean.pack(self.Historizing))
4395 1
        return b''.join(packet)
4396
4397 1
    @staticmethod
4398
    def from_binary(data):
4399 1
        return VariableAttributes(data)
4400
4401 1
    def _binary_init(self, data):
4402 1
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4403 1
        self.DisplayName = LocalizedText.from_binary(data)
4404 1
        self.Description = LocalizedText.from_binary(data)
4405 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4406 1
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4407 1
        self.Value = Variant.from_binary(data)
4408 1
        self.DataType = NodeId.from_binary(data)
4409 1
        self.ValueRank = uabin.Primitives.Int32.unpack(data)
4410 1
        self.ArrayDimensions = uabin.Primitives.UInt32.unpack_array(data)
4411 1
        self.AccessLevel = uabin.Primitives.Byte.unpack(data)
4412 1
        self.UserAccessLevel = uabin.Primitives.Byte.unpack(data)
4413 1
        self.MinimumSamplingInterval = uabin.Primitives.Double.unpack(data)
4414 1
        self.Historizing = uabin.Primitives.Boolean.unpack(data)
4415
4416 1
    def __str__(self):
4417
        return 'VariableAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4418
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4419
               'Description:' + str(self.Description) + ', ' + \
4420
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4421
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4422
               'Value:' + str(self.Value) + ', ' + \
4423
               'DataType:' + str(self.DataType) + ', ' + \
4424
               'ValueRank:' + str(self.ValueRank) + ', ' + \
4425
               'ArrayDimensions:' + str(self.ArrayDimensions) + ', ' + \
4426
               'AccessLevel:' + str(self.AccessLevel) + ', ' + \
4427
               'UserAccessLevel:' + str(self.UserAccessLevel) + ', ' + \
4428
               'MinimumSamplingInterval:' + str(self.MinimumSamplingInterval) + ', ' + \
4429
               'Historizing:' + str(self.Historizing) + ')'
4430
4431 1
    __repr__ = __str__
4432
4433
4434 1 View Code Duplication
class MethodAttributes(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4435
    '''
4436
    The attributes for a method node.
4437
4438
    :ivar SpecifiedAttributes:
4439
    :vartype SpecifiedAttributes: UInt32
4440
    :ivar DisplayName:
4441
    :vartype DisplayName: LocalizedText
4442
    :ivar Description:
4443
    :vartype Description: LocalizedText
4444
    :ivar WriteMask:
4445
    :vartype WriteMask: UInt32
4446
    :ivar UserWriteMask:
4447
    :vartype UserWriteMask: UInt32
4448
    :ivar Executable:
4449
    :vartype Executable: Boolean
4450
    :ivar UserExecutable:
4451
    :vartype UserExecutable: Boolean
4452
    '''
4453
4454 1
    ua_types = {
4455
        'SpecifiedAttributes': 'UInt32',
4456
        'DisplayName': 'LocalizedText',
4457
        'Description': 'LocalizedText',
4458
        'WriteMask': 'UInt32',
4459
        'UserWriteMask': 'UInt32',
4460
        'Executable': 'Boolean',
4461
        'UserExecutable': 'Boolean',
4462
               }
4463
4464 1
    def __init__(self, binary=None):
4465 1
        if binary is not None:
4466
            self._binary_init(binary)
4467
            self._freeze = True
4468
            return
4469 1
        self.SpecifiedAttributes = 0
4470 1
        self.DisplayName = LocalizedText()
4471 1
        self.Description = LocalizedText()
4472 1
        self.WriteMask = 0
4473 1
        self.UserWriteMask = 0
4474 1
        self.Executable = True
4475 1
        self.UserExecutable = True
4476 1
        self._freeze = True
4477
4478 1
    def to_binary(self):
4479
        packet = []
4480
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4481
        packet.append(self.DisplayName.to_binary())
4482
        packet.append(self.Description.to_binary())
4483
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4484
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4485
        packet.append(uabin.Primitives.Boolean.pack(self.Executable))
4486
        packet.append(uabin.Primitives.Boolean.pack(self.UserExecutable))
4487
        return b''.join(packet)
4488
4489 1
    @staticmethod
4490
    def from_binary(data):
4491
        return MethodAttributes(data)
4492
4493 1
    def _binary_init(self, data):
4494
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4495
        self.DisplayName = LocalizedText.from_binary(data)
4496
        self.Description = LocalizedText.from_binary(data)
4497
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4498
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4499
        self.Executable = uabin.Primitives.Boolean.unpack(data)
4500
        self.UserExecutable = uabin.Primitives.Boolean.unpack(data)
4501
4502 1
    def __str__(self):
4503
        return 'MethodAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4504
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4505
               'Description:' + str(self.Description) + ', ' + \
4506
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4507
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4508
               'Executable:' + str(self.Executable) + ', ' + \
4509
               'UserExecutable:' + str(self.UserExecutable) + ')'
4510
4511 1
    __repr__ = __str__
4512
4513
4514 1 View Code Duplication
class ObjectTypeAttributes(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4515
    '''
4516
    The attributes for an object type node.
4517
4518
    :ivar SpecifiedAttributes:
4519
    :vartype SpecifiedAttributes: UInt32
4520
    :ivar DisplayName:
4521
    :vartype DisplayName: LocalizedText
4522
    :ivar Description:
4523
    :vartype Description: LocalizedText
4524
    :ivar WriteMask:
4525
    :vartype WriteMask: UInt32
4526
    :ivar UserWriteMask:
4527
    :vartype UserWriteMask: UInt32
4528
    :ivar IsAbstract:
4529
    :vartype IsAbstract: Boolean
4530
    '''
4531
4532 1
    ua_types = {
4533
        'SpecifiedAttributes': 'UInt32',
4534
        'DisplayName': 'LocalizedText',
4535
        'Description': 'LocalizedText',
4536
        'WriteMask': 'UInt32',
4537
        'UserWriteMask': 'UInt32',
4538
        'IsAbstract': 'Boolean',
4539
               }
4540
4541 1
    def __init__(self, binary=None):
4542 1
        if binary is not None:
4543 1
            self._binary_init(binary)
4544 1
            self._freeze = True
4545 1
            return
4546 1
        self.SpecifiedAttributes = 0
4547 1
        self.DisplayName = LocalizedText()
4548 1
        self.Description = LocalizedText()
4549 1
        self.WriteMask = 0
4550 1
        self.UserWriteMask = 0
4551 1
        self.IsAbstract = True
4552 1
        self._freeze = True
4553
4554 1
    def to_binary(self):
4555 1
        packet = []
4556 1
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4557 1
        packet.append(self.DisplayName.to_binary())
4558 1
        packet.append(self.Description.to_binary())
4559 1
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4560 1
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4561 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsAbstract))
4562 1
        return b''.join(packet)
4563
4564 1
    @staticmethod
4565
    def from_binary(data):
4566 1
        return ObjectTypeAttributes(data)
4567
4568 1
    def _binary_init(self, data):
4569 1
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4570 1
        self.DisplayName = LocalizedText.from_binary(data)
4571 1
        self.Description = LocalizedText.from_binary(data)
4572 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4573 1
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4574 1
        self.IsAbstract = uabin.Primitives.Boolean.unpack(data)
4575
4576 1
    def __str__(self):
4577
        return 'ObjectTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4578
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4579
               'Description:' + str(self.Description) + ', ' + \
4580
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4581
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4582
               'IsAbstract:' + str(self.IsAbstract) + ')'
4583
4584 1
    __repr__ = __str__
4585
4586
4587 1
class VariableTypeAttributes(FrozenClass):
4588
    '''
4589
    The attributes for a variable type node.
4590
4591
    :ivar SpecifiedAttributes:
4592
    :vartype SpecifiedAttributes: UInt32
4593
    :ivar DisplayName:
4594
    :vartype DisplayName: LocalizedText
4595
    :ivar Description:
4596
    :vartype Description: LocalizedText
4597
    :ivar WriteMask:
4598
    :vartype WriteMask: UInt32
4599
    :ivar UserWriteMask:
4600
    :vartype UserWriteMask: UInt32
4601
    :ivar Value:
4602
    :vartype Value: Variant
4603
    :ivar DataType:
4604
    :vartype DataType: NodeId
4605
    :ivar ValueRank:
4606
    :vartype ValueRank: Int32
4607
    :ivar ArrayDimensions:
4608
    :vartype ArrayDimensions: UInt32
4609
    :ivar IsAbstract:
4610
    :vartype IsAbstract: Boolean
4611
    '''
4612
4613 1
    ua_types = {
4614
        'SpecifiedAttributes': 'UInt32',
4615
        'DisplayName': 'LocalizedText',
4616
        'Description': 'LocalizedText',
4617
        'WriteMask': 'UInt32',
4618
        'UserWriteMask': 'UInt32',
4619
        'Value': 'Variant',
4620
        'DataType': 'NodeId',
4621
        'ValueRank': 'Int32',
4622
        'ArrayDimensions': 'UInt32',
4623
        'IsAbstract': 'Boolean',
4624
               }
4625
4626 1
    def __init__(self, binary=None):
4627 1
        if binary is not None:
4628
            self._binary_init(binary)
4629
            self._freeze = True
4630
            return
4631 1
        self.SpecifiedAttributes = 0
4632 1
        self.DisplayName = LocalizedText()
4633 1
        self.Description = LocalizedText()
4634 1
        self.WriteMask = 0
4635 1
        self.UserWriteMask = 0
4636 1
        self.Value = Variant()
4637 1
        self.DataType = NodeId()
4638 1
        self.ValueRank = 0
4639 1
        self.ArrayDimensions = []
4640 1
        self.IsAbstract = True
4641 1
        self._freeze = True
4642
4643 1
    def to_binary(self):
4644
        packet = []
4645
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4646
        packet.append(self.DisplayName.to_binary())
4647
        packet.append(self.Description.to_binary())
4648
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4649
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4650
        packet.append(self.Value.to_binary())
4651
        packet.append(self.DataType.to_binary())
4652
        packet.append(uabin.Primitives.Int32.pack(self.ValueRank))
4653
        packet.append(uabin.Primitives.Int32.pack(len(self.ArrayDimensions)))
4654
        for fieldname in self.ArrayDimensions:
4655
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
4656
        packet.append(uabin.Primitives.Boolean.pack(self.IsAbstract))
4657
        return b''.join(packet)
4658
4659 1
    @staticmethod
4660
    def from_binary(data):
4661
        return VariableTypeAttributes(data)
4662
4663 1 View Code Duplication
    def _binary_init(self, data):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4664
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4665
        self.DisplayName = LocalizedText.from_binary(data)
4666
        self.Description = LocalizedText.from_binary(data)
4667
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4668
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4669
        self.Value = Variant.from_binary(data)
4670
        self.DataType = NodeId.from_binary(data)
4671
        self.ValueRank = uabin.Primitives.Int32.unpack(data)
4672
        self.ArrayDimensions = uabin.Primitives.UInt32.unpack_array(data)
4673
        self.IsAbstract = uabin.Primitives.Boolean.unpack(data)
4674
4675 1
    def __str__(self):
4676
        return 'VariableTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4677
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4678
               'Description:' + str(self.Description) + ', ' + \
4679
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4680
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4681
               'Value:' + str(self.Value) + ', ' + \
4682
               'DataType:' + str(self.DataType) + ', ' + \
4683
               'ValueRank:' + str(self.ValueRank) + ', ' + \
4684
               'ArrayDimensions:' + str(self.ArrayDimensions) + ', ' + \
4685
               'IsAbstract:' + str(self.IsAbstract) + ')'
4686
4687 1
    __repr__ = __str__
4688
4689
4690 1
class ReferenceTypeAttributes(FrozenClass):
4691
    '''
4692
    The attributes for a reference type node.
4693
4694
    :ivar SpecifiedAttributes:
4695
    :vartype SpecifiedAttributes: UInt32
4696
    :ivar DisplayName:
4697
    :vartype DisplayName: LocalizedText
4698
    :ivar Description:
4699
    :vartype Description: LocalizedText
4700
    :ivar WriteMask:
4701
    :vartype WriteMask: UInt32
4702
    :ivar UserWriteMask:
4703
    :vartype UserWriteMask: UInt32
4704
    :ivar IsAbstract:
4705
    :vartype IsAbstract: Boolean
4706
    :ivar Symmetric:
4707
    :vartype Symmetric: Boolean
4708
    :ivar InverseName:
4709
    :vartype InverseName: LocalizedText
4710
    '''
4711
4712 1
    ua_types = {
4713
        'SpecifiedAttributes': 'UInt32',
4714
        'DisplayName': 'LocalizedText',
4715
        'Description': 'LocalizedText',
4716
        'WriteMask': 'UInt32',
4717
        'UserWriteMask': 'UInt32',
4718
        'IsAbstract': 'Boolean',
4719
        'Symmetric': 'Boolean',
4720
        'InverseName': 'LocalizedText',
4721
               }
4722
4723 1
    def __init__(self, binary=None):
4724 1
        if binary is not None:
4725
            self._binary_init(binary)
4726
            self._freeze = True
4727
            return
4728 1
        self.SpecifiedAttributes = 0
4729 1
        self.DisplayName = LocalizedText()
4730 1
        self.Description = LocalizedText()
4731 1
        self.WriteMask = 0
4732 1
        self.UserWriteMask = 0
4733 1
        self.IsAbstract = True
4734 1
        self.Symmetric = True
4735 1
        self.InverseName = LocalizedText()
4736 1
        self._freeze = True
4737
4738 1
    def to_binary(self):
4739
        packet = []
4740
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4741
        packet.append(self.DisplayName.to_binary())
4742
        packet.append(self.Description.to_binary())
4743
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4744
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4745
        packet.append(uabin.Primitives.Boolean.pack(self.IsAbstract))
4746
        packet.append(uabin.Primitives.Boolean.pack(self.Symmetric))
4747
        packet.append(self.InverseName.to_binary())
4748
        return b''.join(packet)
4749
4750 1
    @staticmethod
4751
    def from_binary(data):
4752
        return ReferenceTypeAttributes(data)
4753
4754 1
    def _binary_init(self, data):
4755
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4756
        self.DisplayName = LocalizedText.from_binary(data)
4757
        self.Description = LocalizedText.from_binary(data)
4758
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4759
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4760
        self.IsAbstract = uabin.Primitives.Boolean.unpack(data)
4761
        self.Symmetric = uabin.Primitives.Boolean.unpack(data)
4762
        self.InverseName = LocalizedText.from_binary(data)
4763
4764 1
    def __str__(self):
4765
        return 'ReferenceTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4766
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4767
               'Description:' + str(self.Description) + ', ' + \
4768
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4769
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4770
               'IsAbstract:' + str(self.IsAbstract) + ', ' + \
4771
               'Symmetric:' + str(self.Symmetric) + ', ' + \
4772
               'InverseName:' + str(self.InverseName) + ')'
4773
4774 1
    __repr__ = __str__
4775
4776
4777 1 View Code Duplication
class DataTypeAttributes(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4778
    '''
4779
    The attributes for a data type node.
4780
4781
    :ivar SpecifiedAttributes:
4782
    :vartype SpecifiedAttributes: UInt32
4783
    :ivar DisplayName:
4784
    :vartype DisplayName: LocalizedText
4785
    :ivar Description:
4786
    :vartype Description: LocalizedText
4787
    :ivar WriteMask:
4788
    :vartype WriteMask: UInt32
4789
    :ivar UserWriteMask:
4790
    :vartype UserWriteMask: UInt32
4791
    :ivar IsAbstract:
4792
    :vartype IsAbstract: Boolean
4793
    '''
4794
4795 1
    ua_types = {
4796
        'SpecifiedAttributes': 'UInt32',
4797
        'DisplayName': 'LocalizedText',
4798
        'Description': 'LocalizedText',
4799
        'WriteMask': 'UInt32',
4800
        'UserWriteMask': 'UInt32',
4801
        'IsAbstract': 'Boolean',
4802
               }
4803
4804 1
    def __init__(self, binary=None):
4805 1
        if binary is not None:
4806 1
            self._binary_init(binary)
4807 1
            self._freeze = True
4808 1
            return
4809 1
        self.SpecifiedAttributes = 0
4810 1
        self.DisplayName = LocalizedText()
4811 1
        self.Description = LocalizedText()
4812 1
        self.WriteMask = 0
4813 1
        self.UserWriteMask = 0
4814 1
        self.IsAbstract = True
4815 1
        self._freeze = True
4816
4817 1
    def to_binary(self):
4818 1
        packet = []
4819 1
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4820 1
        packet.append(self.DisplayName.to_binary())
4821 1
        packet.append(self.Description.to_binary())
4822 1
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4823 1
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4824 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsAbstract))
4825 1
        return b''.join(packet)
4826
4827 1
    @staticmethod
4828
    def from_binary(data):
4829 1
        return DataTypeAttributes(data)
4830
4831 1
    def _binary_init(self, data):
4832 1
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4833 1
        self.DisplayName = LocalizedText.from_binary(data)
4834 1
        self.Description = LocalizedText.from_binary(data)
4835 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4836 1
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4837 1
        self.IsAbstract = uabin.Primitives.Boolean.unpack(data)
4838
4839 1
    def __str__(self):
4840
        return 'DataTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4841
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4842
               'Description:' + str(self.Description) + ', ' + \
4843
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4844
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4845
               'IsAbstract:' + str(self.IsAbstract) + ')'
4846
4847 1
    __repr__ = __str__
4848
4849
4850 1 View Code Duplication
class ViewAttributes(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4851
    '''
4852
    The attributes for a view node.
4853
4854
    :ivar SpecifiedAttributes:
4855
    :vartype SpecifiedAttributes: UInt32
4856
    :ivar DisplayName:
4857
    :vartype DisplayName: LocalizedText
4858
    :ivar Description:
4859
    :vartype Description: LocalizedText
4860
    :ivar WriteMask:
4861
    :vartype WriteMask: UInt32
4862
    :ivar UserWriteMask:
4863
    :vartype UserWriteMask: UInt32
4864
    :ivar ContainsNoLoops:
4865
    :vartype ContainsNoLoops: Boolean
4866
    :ivar EventNotifier:
4867
    :vartype EventNotifier: Byte
4868
    '''
4869
4870 1
    ua_types = {
4871
        'SpecifiedAttributes': 'UInt32',
4872
        'DisplayName': 'LocalizedText',
4873
        'Description': 'LocalizedText',
4874
        'WriteMask': 'UInt32',
4875
        'UserWriteMask': 'UInt32',
4876
        'ContainsNoLoops': 'Boolean',
4877
        'EventNotifier': 'Byte',
4878
               }
4879
4880 1
    def __init__(self, binary=None):
4881
        if binary is not None:
4882
            self._binary_init(binary)
4883
            self._freeze = True
4884
            return
4885
        self.SpecifiedAttributes = 0
4886
        self.DisplayName = LocalizedText()
4887
        self.Description = LocalizedText()
4888
        self.WriteMask = 0
4889
        self.UserWriteMask = 0
4890
        self.ContainsNoLoops = True
4891
        self.EventNotifier = 0
4892
        self._freeze = True
4893
4894 1
    def to_binary(self):
4895
        packet = []
4896
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4897
        packet.append(self.DisplayName.to_binary())
4898
        packet.append(self.Description.to_binary())
4899
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4900
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4901
        packet.append(uabin.Primitives.Boolean.pack(self.ContainsNoLoops))
4902
        packet.append(uabin.Primitives.Byte.pack(self.EventNotifier))
4903
        return b''.join(packet)
4904
4905 1
    @staticmethod
4906
    def from_binary(data):
4907
        return ViewAttributes(data)
4908
4909 1
    def _binary_init(self, data):
4910
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4911
        self.DisplayName = LocalizedText.from_binary(data)
4912
        self.Description = LocalizedText.from_binary(data)
4913
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4914
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4915
        self.ContainsNoLoops = uabin.Primitives.Boolean.unpack(data)
4916
        self.EventNotifier = uabin.Primitives.Byte.unpack(data)
4917
4918 1
    def __str__(self):
4919
        return 'ViewAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4920
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4921
               'Description:' + str(self.Description) + ', ' + \
4922
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4923
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4924
               'ContainsNoLoops:' + str(self.ContainsNoLoops) + ', ' + \
4925
               'EventNotifier:' + str(self.EventNotifier) + ')'
4926
4927 1
    __repr__ = __str__
4928
4929
4930 1 View Code Duplication
class AddNodesItem(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4931
    '''
4932
    A request to add a node to the server address space.
4933
4934
    :ivar ParentNodeId:
4935
    :vartype ParentNodeId: ExpandedNodeId
4936
    :ivar ReferenceTypeId:
4937
    :vartype ReferenceTypeId: NodeId
4938
    :ivar RequestedNewNodeId:
4939
    :vartype RequestedNewNodeId: ExpandedNodeId
4940
    :ivar BrowseName:
4941
    :vartype BrowseName: QualifiedName
4942
    :ivar NodeClass:
4943
    :vartype NodeClass: NodeClass
4944
    :ivar NodeAttributes:
4945
    :vartype NodeAttributes: ExtensionObject
4946
    :ivar TypeDefinition:
4947
    :vartype TypeDefinition: ExpandedNodeId
4948
    '''
4949
4950 1
    ua_types = {
4951
        'ParentNodeId': 'ExpandedNodeId',
4952
        'ReferenceTypeId': 'NodeId',
4953
        'RequestedNewNodeId': 'ExpandedNodeId',
4954
        'BrowseName': 'QualifiedName',
4955
        'NodeClass': 'NodeClass',
4956
        'NodeAttributes': 'ExtensionObject',
4957
        'TypeDefinition': 'ExpandedNodeId',
4958
               }
4959
4960 1
    def __init__(self, binary=None):
4961 1
        if binary is not None:
4962 1
            self._binary_init(binary)
4963 1
            self._freeze = True
4964 1
            return
4965 1
        self.ParentNodeId = ExpandedNodeId()
4966 1
        self.ReferenceTypeId = NodeId()
4967 1
        self.RequestedNewNodeId = ExpandedNodeId()
4968 1
        self.BrowseName = QualifiedName()
4969 1
        self.NodeClass = NodeClass(0)
4970 1
        self.NodeAttributes = None
4971 1
        self.TypeDefinition = ExpandedNodeId()
4972 1
        self._freeze = True
4973
4974 1
    def to_binary(self):
4975 1
        packet = []
4976 1
        packet.append(self.ParentNodeId.to_binary())
4977 1
        packet.append(self.ReferenceTypeId.to_binary())
4978 1
        packet.append(self.RequestedNewNodeId.to_binary())
4979 1
        packet.append(self.BrowseName.to_binary())
4980 1
        packet.append(uabin.Primitives.UInt32.pack(self.NodeClass.value))
4981 1
        packet.append(extensionobject_to_binary(self.NodeAttributes))
4982 1
        packet.append(self.TypeDefinition.to_binary())
4983 1
        return b''.join(packet)
4984
4985 1
    @staticmethod
4986
    def from_binary(data):
4987 1
        return AddNodesItem(data)
4988
4989 1
    def _binary_init(self, data):
4990 1
        self.ParentNodeId = ExpandedNodeId.from_binary(data)
4991 1
        self.ReferenceTypeId = NodeId.from_binary(data)
4992 1
        self.RequestedNewNodeId = ExpandedNodeId.from_binary(data)
4993 1
        self.BrowseName = QualifiedName.from_binary(data)
4994 1
        self.NodeClass = NodeClass(uabin.Primitives.UInt32.unpack(data))
4995 1
        self.NodeAttributes = extensionobject_from_binary(data)
4996 1
        self.TypeDefinition = ExpandedNodeId.from_binary(data)
4997
4998 1
    def __str__(self):
4999
        return 'AddNodesItem(' + 'ParentNodeId:' + str(self.ParentNodeId) + ', ' + \
5000
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
5001
               'RequestedNewNodeId:' + str(self.RequestedNewNodeId) + ', ' + \
5002
               'BrowseName:' + str(self.BrowseName) + ', ' + \
5003
               'NodeClass:' + str(self.NodeClass) + ', ' + \
5004
               'NodeAttributes:' + str(self.NodeAttributes) + ', ' + \
5005
               'TypeDefinition:' + str(self.TypeDefinition) + ')'
5006
5007 1
    __repr__ = __str__
5008
5009
5010 1 View Code Duplication
class AddNodesResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5011
    '''
5012
    A result of an add node operation.
5013
5014
    :ivar StatusCode:
5015
    :vartype StatusCode: StatusCode
5016
    :ivar AddedNodeId:
5017
    :vartype AddedNodeId: NodeId
5018
    '''
5019
5020 1
    ua_types = {
5021
        'StatusCode': 'StatusCode',
5022
        'AddedNodeId': 'NodeId',
5023
               }
5024
5025 1
    def __init__(self, binary=None):
5026 1
        if binary is not None:
5027 1
            self._binary_init(binary)
5028 1
            self._freeze = True
5029 1
            return
5030 1
        self.StatusCode = StatusCode()
5031 1
        self.AddedNodeId = NodeId()
5032 1
        self._freeze = True
5033
5034 1
    def to_binary(self):
5035 1
        packet = []
5036 1
        packet.append(self.StatusCode.to_binary())
5037 1
        packet.append(self.AddedNodeId.to_binary())
5038 1
        return b''.join(packet)
5039
5040 1
    @staticmethod
5041
    def from_binary(data):
5042 1
        return AddNodesResult(data)
5043
5044 1
    def _binary_init(self, data):
5045 1
        self.StatusCode = StatusCode.from_binary(data)
5046 1
        self.AddedNodeId = NodeId.from_binary(data)
5047
5048 1
    def __str__(self):
5049
        return 'AddNodesResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
5050
               'AddedNodeId:' + str(self.AddedNodeId) + ')'
5051
5052 1
    __repr__ = __str__
5053
5054
5055 1
class AddNodesParameters(FrozenClass):
5056
    '''
5057
    :ivar NodesToAdd:
5058
    :vartype NodesToAdd: AddNodesItem
5059
    '''
5060
5061 1
    ua_types = {
5062
        'NodesToAdd': 'AddNodesItem',
5063
               }
5064
5065 1
    def __init__(self, binary=None):
5066 1
        if binary is not None:
5067 1
            self._binary_init(binary)
5068 1
            self._freeze = True
5069 1
            return
5070 1
        self.NodesToAdd = []
5071 1
        self._freeze = True
5072
5073 1
    def to_binary(self):
5074 1
        packet = []
5075 1
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToAdd)))
5076 1
        for fieldname in self.NodesToAdd:
5077 1
            packet.append(fieldname.to_binary())
5078 1
        return b''.join(packet)
5079
5080 1
    @staticmethod
5081
    def from_binary(data):
5082 1
        return AddNodesParameters(data)
5083
5084 1
    def _binary_init(self, data):
5085 1
        length = uabin.Primitives.Int32.unpack(data)
5086 1
        array = []
5087 1
        if length != -1:
5088 1
            for _ in range(0, length):
5089 1
                array.append(AddNodesItem.from_binary(data))
5090 1
        self.NodesToAdd = array
5091
5092 1
    def __str__(self):
5093
        return 'AddNodesParameters(' + 'NodesToAdd:' + str(self.NodesToAdd) + ')'
5094
5095 1
    __repr__ = __str__
5096
5097
5098 1
class AddNodesRequest(FrozenClass):
5099
    '''
5100
    Adds one or more nodes to the server address space.
5101
5102
    :ivar TypeId:
5103
    :vartype TypeId: NodeId
5104
    :ivar RequestHeader:
5105
    :vartype RequestHeader: RequestHeader
5106
    :ivar Parameters:
5107
    :vartype Parameters: AddNodesParameters
5108
    '''
5109
5110 1
    ua_types = {
5111
        'TypeId': 'NodeId',
5112
        'RequestHeader': 'RequestHeader',
5113
        'Parameters': 'AddNodesParameters',
5114
               }
5115
5116 1
    def __init__(self, binary=None):
5117 1
        if binary is not None:
5118
            self._binary_init(binary)
5119
            self._freeze = True
5120
            return
5121 1
        self.TypeId = FourByteNodeId(ObjectIds.AddNodesRequest_Encoding_DefaultBinary)
5122 1
        self.RequestHeader = RequestHeader()
5123 1
        self.Parameters = AddNodesParameters()
5124 1
        self._freeze = True
5125
5126 1
    def to_binary(self):
5127 1
        packet = []
5128 1
        packet.append(self.TypeId.to_binary())
5129 1
        packet.append(self.RequestHeader.to_binary())
5130 1
        packet.append(self.Parameters.to_binary())
5131 1
        return b''.join(packet)
5132
5133 1
    @staticmethod
5134
    def from_binary(data):
5135
        return AddNodesRequest(data)
5136
5137 1
    def _binary_init(self, data):
5138
        self.TypeId = NodeId.from_binary(data)
5139
        self.RequestHeader = RequestHeader.from_binary(data)
5140
        self.Parameters = AddNodesParameters.from_binary(data)
5141
5142 1
    def __str__(self):
5143
        return 'AddNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5144
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5145
               'Parameters:' + str(self.Parameters) + ')'
5146
5147 1
    __repr__ = __str__
5148
5149
5150 1
class AddNodesResponse(FrozenClass):
5151
    '''
5152
    Adds one or more nodes to the server address space.
5153
5154
    :ivar TypeId:
5155
    :vartype TypeId: NodeId
5156
    :ivar ResponseHeader:
5157
    :vartype ResponseHeader: ResponseHeader
5158
    :ivar Results:
5159
    :vartype Results: AddNodesResult
5160
    :ivar DiagnosticInfos:
5161
    :vartype DiagnosticInfos: DiagnosticInfo
5162
    '''
5163
5164 1
    ua_types = {
5165
        'TypeId': 'NodeId',
5166
        'ResponseHeader': 'ResponseHeader',
5167
        'Results': 'AddNodesResult',
5168
        'DiagnosticInfos': 'DiagnosticInfo',
5169
               }
5170
5171 1
    def __init__(self, binary=None):
5172 1
        if binary is not None:
5173 1
            self._binary_init(binary)
5174 1
            self._freeze = True
5175 1
            return
5176 1
        self.TypeId = FourByteNodeId(ObjectIds.AddNodesResponse_Encoding_DefaultBinary)
5177 1
        self.ResponseHeader = ResponseHeader()
5178 1
        self.Results = []
5179 1
        self.DiagnosticInfos = []
5180 1
        self._freeze = True
5181
5182 1
    def to_binary(self):
5183 1
        packet = []
5184 1
        packet.append(self.TypeId.to_binary())
5185 1
        packet.append(self.ResponseHeader.to_binary())
5186 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
5187 1
        for fieldname in self.Results:
5188 1
            packet.append(fieldname.to_binary())
5189 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
5190 1
        for fieldname in self.DiagnosticInfos:
5191
            packet.append(fieldname.to_binary())
5192 1
        return b''.join(packet)
5193
5194 1
    @staticmethod
5195
    def from_binary(data):
5196 1
        return AddNodesResponse(data)
5197
5198 1
    def _binary_init(self, data):
5199 1
        self.TypeId = NodeId.from_binary(data)
5200 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
5201 1
        length = uabin.Primitives.Int32.unpack(data)
5202 1
        array = []
5203 1
        if length != -1:
5204 1
            for _ in range(0, length):
5205 1
                array.append(AddNodesResult.from_binary(data))
5206 1
        self.Results = array
5207 1
        length = uabin.Primitives.Int32.unpack(data)
5208 1
        array = []
5209 1
        if length != -1:
5210 1
            for _ in range(0, length):
5211
                array.append(DiagnosticInfo.from_binary(data))
5212 1
        self.DiagnosticInfos = array
5213
5214 1
    def __str__(self):
5215
        return 'AddNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5216
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5217
               'Results:' + str(self.Results) + ', ' + \
5218
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5219
5220 1
    __repr__ = __str__
5221
5222
5223 1 View Code Duplication
class AddReferencesItem(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5224
    '''
5225
    A request to add a reference to the server address space.
5226
5227
    :ivar SourceNodeId:
5228
    :vartype SourceNodeId: NodeId
5229
    :ivar ReferenceTypeId:
5230
    :vartype ReferenceTypeId: NodeId
5231
    :ivar IsForward:
5232
    :vartype IsForward: Boolean
5233
    :ivar TargetServerUri:
5234
    :vartype TargetServerUri: String
5235
    :ivar TargetNodeId:
5236
    :vartype TargetNodeId: ExpandedNodeId
5237
    :ivar TargetNodeClass:
5238
    :vartype TargetNodeClass: NodeClass
5239
    '''
5240
5241 1
    ua_types = {
5242
        'SourceNodeId': 'NodeId',
5243
        'ReferenceTypeId': 'NodeId',
5244
        'IsForward': 'Boolean',
5245
        'TargetServerUri': 'String',
5246
        'TargetNodeId': 'ExpandedNodeId',
5247
        'TargetNodeClass': 'NodeClass',
5248
               }
5249
5250 1
    def __init__(self, binary=None):
5251 1
        if binary is not None:
5252
            self._binary_init(binary)
5253
            self._freeze = True
5254
            return
5255 1
        self.SourceNodeId = NodeId()
5256 1
        self.ReferenceTypeId = NodeId()
5257 1
        self.IsForward = True
5258 1
        self.TargetServerUri = None
5259 1
        self.TargetNodeId = ExpandedNodeId()
5260 1
        self.TargetNodeClass = NodeClass(0)
5261 1
        self._freeze = True
5262
5263 1
    def to_binary(self):
5264
        packet = []
5265
        packet.append(self.SourceNodeId.to_binary())
5266
        packet.append(self.ReferenceTypeId.to_binary())
5267
        packet.append(uabin.Primitives.Boolean.pack(self.IsForward))
5268
        packet.append(uabin.Primitives.String.pack(self.TargetServerUri))
5269
        packet.append(self.TargetNodeId.to_binary())
5270
        packet.append(uabin.Primitives.UInt32.pack(self.TargetNodeClass.value))
5271
        return b''.join(packet)
5272
5273 1
    @staticmethod
5274
    def from_binary(data):
5275
        return AddReferencesItem(data)
5276
5277 1
    def _binary_init(self, data):
5278
        self.SourceNodeId = NodeId.from_binary(data)
5279
        self.ReferenceTypeId = NodeId.from_binary(data)
5280
        self.IsForward = uabin.Primitives.Boolean.unpack(data)
5281
        self.TargetServerUri = uabin.Primitives.String.unpack(data)
5282
        self.TargetNodeId = ExpandedNodeId.from_binary(data)
5283
        self.TargetNodeClass = NodeClass(uabin.Primitives.UInt32.unpack(data))
5284
5285 1
    def __str__(self):
5286
        return 'AddReferencesItem(' + 'SourceNodeId:' + str(self.SourceNodeId) + ', ' + \
5287
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
5288
               'IsForward:' + str(self.IsForward) + ', ' + \
5289
               'TargetServerUri:' + str(self.TargetServerUri) + ', ' + \
5290
               'TargetNodeId:' + str(self.TargetNodeId) + ', ' + \
5291
               'TargetNodeClass:' + str(self.TargetNodeClass) + ')'
5292
5293 1
    __repr__ = __str__
5294
5295
5296 1 View Code Duplication
class AddReferencesRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5297
    '''
5298
    Adds one or more references to the server address space.
5299
5300
    :ivar TypeId:
5301
    :vartype TypeId: NodeId
5302
    :ivar RequestHeader:
5303
    :vartype RequestHeader: RequestHeader
5304
    :ivar ReferencesToAdd:
5305
    :vartype ReferencesToAdd: AddReferencesItem
5306
    '''
5307
5308 1
    ua_types = {
5309
        'TypeId': 'NodeId',
5310
        'RequestHeader': 'RequestHeader',
5311
        'ReferencesToAdd': 'AddReferencesItem',
5312
               }
5313
5314 1
    def __init__(self, binary=None):
5315
        if binary is not None:
5316
            self._binary_init(binary)
5317
            self._freeze = True
5318
            return
5319
        self.TypeId = FourByteNodeId(ObjectIds.AddReferencesRequest_Encoding_DefaultBinary)
5320
        self.RequestHeader = RequestHeader()
5321
        self.ReferencesToAdd = []
5322
        self._freeze = True
5323
5324 1
    def to_binary(self):
5325
        packet = []
5326
        packet.append(self.TypeId.to_binary())
5327
        packet.append(self.RequestHeader.to_binary())
5328
        packet.append(uabin.Primitives.Int32.pack(len(self.ReferencesToAdd)))
5329
        for fieldname in self.ReferencesToAdd:
5330
            packet.append(fieldname.to_binary())
5331
        return b''.join(packet)
5332
5333 1
    @staticmethod
5334
    def from_binary(data):
5335
        return AddReferencesRequest(data)
5336
5337 1
    def _binary_init(self, data):
5338
        self.TypeId = NodeId.from_binary(data)
5339
        self.RequestHeader = RequestHeader.from_binary(data)
5340
        length = uabin.Primitives.Int32.unpack(data)
5341
        array = []
5342
        if length != -1:
5343
            for _ in range(0, length):
5344
                array.append(AddReferencesItem.from_binary(data))
5345
        self.ReferencesToAdd = array
5346
5347 1
    def __str__(self):
5348
        return 'AddReferencesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5349
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5350
               'ReferencesToAdd:' + str(self.ReferencesToAdd) + ')'
5351
5352 1
    __repr__ = __str__
5353
5354
5355 1
class AddReferencesResponse(FrozenClass):
5356
    '''
5357
    Adds one or more references to the server address space.
5358
5359
    :ivar TypeId:
5360
    :vartype TypeId: NodeId
5361
    :ivar ResponseHeader:
5362
    :vartype ResponseHeader: ResponseHeader
5363
    :ivar Results:
5364
    :vartype Results: StatusCode
5365
    :ivar DiagnosticInfos:
5366
    :vartype DiagnosticInfos: DiagnosticInfo
5367
    '''
5368
5369 1
    ua_types = {
5370
        'TypeId': 'NodeId',
5371
        'ResponseHeader': 'ResponseHeader',
5372
        'Results': 'StatusCode',
5373
        'DiagnosticInfos': 'DiagnosticInfo',
5374
               }
5375
5376 1
    def __init__(self, binary=None):
5377
        if binary is not None:
5378
            self._binary_init(binary)
5379
            self._freeze = True
5380
            return
5381
        self.TypeId = FourByteNodeId(ObjectIds.AddReferencesResponse_Encoding_DefaultBinary)
5382
        self.ResponseHeader = ResponseHeader()
5383
        self.Results = []
5384
        self.DiagnosticInfos = []
5385
        self._freeze = True
5386
5387 1
    def to_binary(self):
5388
        packet = []
5389
        packet.append(self.TypeId.to_binary())
5390
        packet.append(self.ResponseHeader.to_binary())
5391
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
5392
        for fieldname in self.Results:
5393
            packet.append(fieldname.to_binary())
5394
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
5395
        for fieldname in self.DiagnosticInfos:
5396
            packet.append(fieldname.to_binary())
5397
        return b''.join(packet)
5398
5399 1
    @staticmethod
5400
    def from_binary(data):
5401
        return AddReferencesResponse(data)
5402
5403 1
    def _binary_init(self, data):
5404
        self.TypeId = NodeId.from_binary(data)
5405
        self.ResponseHeader = ResponseHeader.from_binary(data)
5406
        length = uabin.Primitives.Int32.unpack(data)
5407
        array = []
5408
        if length != -1:
5409
            for _ in range(0, length):
5410
                array.append(StatusCode.from_binary(data))
5411
        self.Results = array
5412
        length = uabin.Primitives.Int32.unpack(data)
5413
        array = []
5414
        if length != -1:
5415
            for _ in range(0, length):
5416
                array.append(DiagnosticInfo.from_binary(data))
5417
        self.DiagnosticInfos = array
5418
5419 1
    def __str__(self):
5420
        return 'AddReferencesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5421
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5422
               'Results:' + str(self.Results) + ', ' + \
5423
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5424
5425 1
    __repr__ = __str__
5426
5427
5428 1 View Code Duplication
class DeleteNodesItem(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5429
    '''
5430
    A request to delete a node to the server address space.
5431
5432
    :ivar NodeId:
5433
    :vartype NodeId: NodeId
5434
    :ivar DeleteTargetReferences:
5435
    :vartype DeleteTargetReferences: Boolean
5436
    '''
5437
5438 1
    ua_types = {
5439
        'NodeId': 'NodeId',
5440
        'DeleteTargetReferences': 'Boolean',
5441
               }
5442
5443 1
    def __init__(self, binary=None):
5444 1
        if binary is not None:
5445 1
            self._binary_init(binary)
5446 1
            self._freeze = True
5447 1
            return
5448 1
        self.NodeId = NodeId()
5449 1
        self.DeleteTargetReferences = True
5450 1
        self._freeze = True
5451
5452 1
    def to_binary(self):
5453 1
        packet = []
5454 1
        packet.append(self.NodeId.to_binary())
5455 1
        packet.append(uabin.Primitives.Boolean.pack(self.DeleteTargetReferences))
5456 1
        return b''.join(packet)
5457
5458 1
    @staticmethod
5459
    def from_binary(data):
5460 1
        return DeleteNodesItem(data)
5461
5462 1
    def _binary_init(self, data):
5463 1
        self.NodeId = NodeId.from_binary(data)
5464 1
        self.DeleteTargetReferences = uabin.Primitives.Boolean.unpack(data)
5465
5466 1
    def __str__(self):
5467
        return 'DeleteNodesItem(' + 'NodeId:' + str(self.NodeId) + ', ' + \
5468
               'DeleteTargetReferences:' + str(self.DeleteTargetReferences) + ')'
5469
5470 1
    __repr__ = __str__
5471
5472
5473 1
class DeleteNodesParameters(FrozenClass):
5474
    '''
5475
    :ivar NodesToDelete:
5476
    :vartype NodesToDelete: DeleteNodesItem
5477
    '''
5478
5479 1
    ua_types = {
5480
        'NodesToDelete': 'DeleteNodesItem',
5481
               }
5482
5483 1
    def __init__(self, binary=None):
5484 1
        if binary is not None:
5485 1
            self._binary_init(binary)
5486 1
            self._freeze = True
5487 1
            return
5488 1
        self.NodesToDelete = []
5489 1
        self._freeze = True
5490
5491 1
    def to_binary(self):
5492 1
        packet = []
5493 1
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToDelete)))
5494 1
        for fieldname in self.NodesToDelete:
5495 1
            packet.append(fieldname.to_binary())
5496 1
        return b''.join(packet)
5497
5498 1
    @staticmethod
5499
    def from_binary(data):
5500 1
        return DeleteNodesParameters(data)
5501
5502 1
    def _binary_init(self, data):
5503 1
        length = uabin.Primitives.Int32.unpack(data)
5504 1
        array = []
5505 1
        if length != -1:
5506 1
            for _ in range(0, length):
5507 1
                array.append(DeleteNodesItem.from_binary(data))
5508 1
        self.NodesToDelete = array
5509
5510 1
    def __str__(self):
5511
        return 'DeleteNodesParameters(' + 'NodesToDelete:' + str(self.NodesToDelete) + ')'
5512
5513 1
    __repr__ = __str__
5514
5515
5516 1
class DeleteNodesRequest(FrozenClass):
5517
    '''
5518
    Delete one or more nodes from the server address space.
5519
5520
    :ivar TypeId:
5521
    :vartype TypeId: NodeId
5522
    :ivar RequestHeader:
5523
    :vartype RequestHeader: RequestHeader
5524
    :ivar Parameters:
5525
    :vartype Parameters: DeleteNodesParameters
5526
    '''
5527
5528 1
    ua_types = {
5529
        'TypeId': 'NodeId',
5530
        'RequestHeader': 'RequestHeader',
5531
        'Parameters': 'DeleteNodesParameters',
5532
               }
5533
5534 1
    def __init__(self, binary=None):
5535 1
        if binary is not None:
5536
            self._binary_init(binary)
5537
            self._freeze = True
5538
            return
5539 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteNodesRequest_Encoding_DefaultBinary)
5540 1
        self.RequestHeader = RequestHeader()
5541 1
        self.Parameters = DeleteNodesParameters()
5542 1
        self._freeze = True
5543
5544 1
    def to_binary(self):
5545 1
        packet = []
5546 1
        packet.append(self.TypeId.to_binary())
5547 1
        packet.append(self.RequestHeader.to_binary())
5548 1
        packet.append(self.Parameters.to_binary())
5549 1
        return b''.join(packet)
5550
5551 1
    @staticmethod
5552
    def from_binary(data):
5553
        return DeleteNodesRequest(data)
5554
5555 1
    def _binary_init(self, data):
5556
        self.TypeId = NodeId.from_binary(data)
5557
        self.RequestHeader = RequestHeader.from_binary(data)
5558
        self.Parameters = DeleteNodesParameters.from_binary(data)
5559
5560 1
    def __str__(self):
5561
        return 'DeleteNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5562
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5563
               'Parameters:' + str(self.Parameters) + ')'
5564
5565 1
    __repr__ = __str__
5566
5567
5568 1
class DeleteNodesResponse(FrozenClass):
5569
    '''
5570
    Delete one or more nodes from the server address space.
5571
5572
    :ivar TypeId:
5573
    :vartype TypeId: NodeId
5574
    :ivar ResponseHeader:
5575
    :vartype ResponseHeader: ResponseHeader
5576
    :ivar Results:
5577
    :vartype Results: StatusCode
5578
    :ivar DiagnosticInfos:
5579
    :vartype DiagnosticInfos: DiagnosticInfo
5580
    '''
5581
5582 1
    ua_types = {
5583
        'TypeId': 'NodeId',
5584
        'ResponseHeader': 'ResponseHeader',
5585
        'Results': 'StatusCode',
5586
        'DiagnosticInfos': 'DiagnosticInfo',
5587
               }
5588
5589 1
    def __init__(self, binary=None):
5590 1
        if binary is not None:
5591 1
            self._binary_init(binary)
5592 1
            self._freeze = True
5593 1
            return
5594 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteNodesResponse_Encoding_DefaultBinary)
5595 1
        self.ResponseHeader = ResponseHeader()
5596 1
        self.Results = []
5597 1
        self.DiagnosticInfos = []
5598 1
        self._freeze = True
5599
5600 1
    def to_binary(self):
5601 1
        packet = []
5602 1
        packet.append(self.TypeId.to_binary())
5603 1
        packet.append(self.ResponseHeader.to_binary())
5604 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
5605 1
        for fieldname in self.Results:
5606 1
            packet.append(fieldname.to_binary())
5607 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
5608 1
        for fieldname in self.DiagnosticInfos:
5609
            packet.append(fieldname.to_binary())
5610 1
        return b''.join(packet)
5611
5612 1
    @staticmethod
5613
    def from_binary(data):
5614 1
        return DeleteNodesResponse(data)
5615
5616 1
    def _binary_init(self, data):
5617 1
        self.TypeId = NodeId.from_binary(data)
5618 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
5619 1
        length = uabin.Primitives.Int32.unpack(data)
5620 1
        array = []
5621 1
        if length != -1:
5622 1
            for _ in range(0, length):
5623 1
                array.append(StatusCode.from_binary(data))
5624 1
        self.Results = array
5625 1
        length = uabin.Primitives.Int32.unpack(data)
5626 1
        array = []
5627 1
        if length != -1:
5628 1
            for _ in range(0, length):
5629
                array.append(DiagnosticInfo.from_binary(data))
5630 1
        self.DiagnosticInfos = array
5631
5632 1
    def __str__(self):
5633
        return 'DeleteNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5634
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5635
               'Results:' + str(self.Results) + ', ' + \
5636
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5637
5638 1
    __repr__ = __str__
5639
5640
5641 1 View Code Duplication
class DeleteReferencesItem(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5642
    '''
5643
    A request to delete a node from the server address space.
5644
5645
    :ivar SourceNodeId:
5646
    :vartype SourceNodeId: NodeId
5647
    :ivar ReferenceTypeId:
5648
    :vartype ReferenceTypeId: NodeId
5649
    :ivar IsForward:
5650
    :vartype IsForward: Boolean
5651
    :ivar TargetNodeId:
5652
    :vartype TargetNodeId: ExpandedNodeId
5653
    :ivar DeleteBidirectional:
5654
    :vartype DeleteBidirectional: Boolean
5655
    '''
5656
5657 1
    ua_types = {
5658
        'SourceNodeId': 'NodeId',
5659
        'ReferenceTypeId': 'NodeId',
5660
        'IsForward': 'Boolean',
5661
        'TargetNodeId': 'ExpandedNodeId',
5662
        'DeleteBidirectional': 'Boolean',
5663
               }
5664
5665 1
    def __init__(self, binary=None):
5666
        if binary is not None:
5667
            self._binary_init(binary)
5668
            self._freeze = True
5669
            return
5670
        self.SourceNodeId = NodeId()
5671
        self.ReferenceTypeId = NodeId()
5672
        self.IsForward = True
5673
        self.TargetNodeId = ExpandedNodeId()
5674
        self.DeleteBidirectional = True
5675
        self._freeze = True
5676
5677 1
    def to_binary(self):
5678
        packet = []
5679
        packet.append(self.SourceNodeId.to_binary())
5680
        packet.append(self.ReferenceTypeId.to_binary())
5681
        packet.append(uabin.Primitives.Boolean.pack(self.IsForward))
5682
        packet.append(self.TargetNodeId.to_binary())
5683
        packet.append(uabin.Primitives.Boolean.pack(self.DeleteBidirectional))
5684
        return b''.join(packet)
5685
5686 1
    @staticmethod
5687
    def from_binary(data):
5688
        return DeleteReferencesItem(data)
5689
5690 1
    def _binary_init(self, data):
5691
        self.SourceNodeId = NodeId.from_binary(data)
5692
        self.ReferenceTypeId = NodeId.from_binary(data)
5693
        self.IsForward = uabin.Primitives.Boolean.unpack(data)
5694
        self.TargetNodeId = ExpandedNodeId.from_binary(data)
5695
        self.DeleteBidirectional = uabin.Primitives.Boolean.unpack(data)
5696
5697 1
    def __str__(self):
5698
        return 'DeleteReferencesItem(' + 'SourceNodeId:' + str(self.SourceNodeId) + ', ' + \
5699
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
5700
               'IsForward:' + str(self.IsForward) + ', ' + \
5701
               'TargetNodeId:' + str(self.TargetNodeId) + ', ' + \
5702
               'DeleteBidirectional:' + str(self.DeleteBidirectional) + ')'
5703
5704 1
    __repr__ = __str__
5705
5706
5707 1
class DeleteReferencesParameters(FrozenClass):
5708
    '''
5709
    :ivar ReferencesToDelete:
5710
    :vartype ReferencesToDelete: DeleteReferencesItem
5711
    '''
5712
5713 1
    ua_types = {
5714
        'ReferencesToDelete': 'DeleteReferencesItem',
5715
               }
5716
5717 1
    def __init__(self, binary=None):
5718
        if binary is not None:
5719
            self._binary_init(binary)
5720
            self._freeze = True
5721
            return
5722
        self.ReferencesToDelete = []
5723
        self._freeze = True
5724
5725 1
    def to_binary(self):
5726
        packet = []
5727
        packet.append(uabin.Primitives.Int32.pack(len(self.ReferencesToDelete)))
5728
        for fieldname in self.ReferencesToDelete:
5729
            packet.append(fieldname.to_binary())
5730
        return b''.join(packet)
5731
5732 1
    @staticmethod
5733
    def from_binary(data):
5734
        return DeleteReferencesParameters(data)
5735
5736 1
    def _binary_init(self, data):
5737
        length = uabin.Primitives.Int32.unpack(data)
5738
        array = []
5739
        if length != -1:
5740
            for _ in range(0, length):
5741
                array.append(DeleteReferencesItem.from_binary(data))
5742
        self.ReferencesToDelete = array
5743
5744 1
    def __str__(self):
5745
        return 'DeleteReferencesParameters(' + 'ReferencesToDelete:' + str(self.ReferencesToDelete) + ')'
5746
5747 1
    __repr__ = __str__
5748
5749
5750 1
class DeleteReferencesRequest(FrozenClass):
5751
    '''
5752
    Delete one or more references from the server address space.
5753
5754
    :ivar TypeId:
5755
    :vartype TypeId: NodeId
5756
    :ivar RequestHeader:
5757
    :vartype RequestHeader: RequestHeader
5758
    :ivar Parameters:
5759
    :vartype Parameters: DeleteReferencesParameters
5760
    '''
5761
5762 1
    ua_types = {
5763
        'TypeId': 'NodeId',
5764
        'RequestHeader': 'RequestHeader',
5765
        'Parameters': 'DeleteReferencesParameters',
5766
               }
5767
5768 1
    def __init__(self, binary=None):
5769
        if binary is not None:
5770
            self._binary_init(binary)
5771
            self._freeze = True
5772
            return
5773
        self.TypeId = FourByteNodeId(ObjectIds.DeleteReferencesRequest_Encoding_DefaultBinary)
5774
        self.RequestHeader = RequestHeader()
5775
        self.Parameters = DeleteReferencesParameters()
5776
        self._freeze = True
5777
5778 1
    def to_binary(self):
5779
        packet = []
5780
        packet.append(self.TypeId.to_binary())
5781
        packet.append(self.RequestHeader.to_binary())
5782
        packet.append(self.Parameters.to_binary())
5783
        return b''.join(packet)
5784
5785 1
    @staticmethod
5786
    def from_binary(data):
5787
        return DeleteReferencesRequest(data)
5788
5789 1
    def _binary_init(self, data):
5790
        self.TypeId = NodeId.from_binary(data)
5791
        self.RequestHeader = RequestHeader.from_binary(data)
5792
        self.Parameters = DeleteReferencesParameters.from_binary(data)
5793
5794 1
    def __str__(self):
5795
        return 'DeleteReferencesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5796
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5797
               'Parameters:' + str(self.Parameters) + ')'
5798
5799 1
    __repr__ = __str__
5800
5801
5802 1 View Code Duplication
class DeleteReferencesResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5803
    '''
5804
    :ivar Results:
5805
    :vartype Results: StatusCode
5806
    :ivar DiagnosticInfos:
5807
    :vartype DiagnosticInfos: DiagnosticInfo
5808
    '''
5809
5810 1
    ua_types = {
5811
        'Results': 'StatusCode',
5812
        'DiagnosticInfos': 'DiagnosticInfo',
5813
               }
5814
5815 1
    def __init__(self, binary=None):
5816
        if binary is not None:
5817
            self._binary_init(binary)
5818
            self._freeze = True
5819
            return
5820
        self.Results = []
5821
        self.DiagnosticInfos = []
5822
        self._freeze = True
5823
5824 1
    def to_binary(self):
5825
        packet = []
5826
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
5827
        for fieldname in self.Results:
5828
            packet.append(fieldname.to_binary())
5829
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
5830
        for fieldname in self.DiagnosticInfos:
5831
            packet.append(fieldname.to_binary())
5832
        return b''.join(packet)
5833
5834 1
    @staticmethod
5835
    def from_binary(data):
5836
        return DeleteReferencesResult(data)
5837
5838 1
    def _binary_init(self, data):
5839
        length = uabin.Primitives.Int32.unpack(data)
5840
        array = []
5841
        if length != -1:
5842
            for _ in range(0, length):
5843
                array.append(StatusCode.from_binary(data))
5844
        self.Results = array
5845
        length = uabin.Primitives.Int32.unpack(data)
5846
        array = []
5847
        if length != -1:
5848
            for _ in range(0, length):
5849
                array.append(DiagnosticInfo.from_binary(data))
5850
        self.DiagnosticInfos = array
5851
5852 1
    def __str__(self):
5853
        return 'DeleteReferencesResult(' + 'Results:' + str(self.Results) + ', ' + \
5854
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5855
5856 1
    __repr__ = __str__
5857
5858
5859 1
class DeleteReferencesResponse(FrozenClass):
5860
    '''
5861
    Delete one or more references from the server address space.
5862
5863
    :ivar TypeId:
5864
    :vartype TypeId: NodeId
5865
    :ivar ResponseHeader:
5866
    :vartype ResponseHeader: ResponseHeader
5867
    :ivar Parameters:
5868
    :vartype Parameters: DeleteReferencesResult
5869
    '''
5870
5871 1
    ua_types = {
5872
        'TypeId': 'NodeId',
5873
        'ResponseHeader': 'ResponseHeader',
5874
        'Parameters': 'DeleteReferencesResult',
5875
               }
5876
5877 1
    def __init__(self, binary=None):
5878
        if binary is not None:
5879
            self._binary_init(binary)
5880
            self._freeze = True
5881
            return
5882
        self.TypeId = FourByteNodeId(ObjectIds.DeleteReferencesResponse_Encoding_DefaultBinary)
5883
        self.ResponseHeader = ResponseHeader()
5884
        self.Parameters = DeleteReferencesResult()
5885
        self._freeze = True
5886
5887 1
    def to_binary(self):
5888
        packet = []
5889
        packet.append(self.TypeId.to_binary())
5890
        packet.append(self.ResponseHeader.to_binary())
5891
        packet.append(self.Parameters.to_binary())
5892
        return b''.join(packet)
5893
5894 1
    @staticmethod
5895
    def from_binary(data):
5896
        return DeleteReferencesResponse(data)
5897
5898 1
    def _binary_init(self, data):
5899
        self.TypeId = NodeId.from_binary(data)
5900
        self.ResponseHeader = ResponseHeader.from_binary(data)
5901
        self.Parameters = DeleteReferencesResult.from_binary(data)
5902
5903 1
    def __str__(self):
5904
        return 'DeleteReferencesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5905
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5906
               'Parameters:' + str(self.Parameters) + ')'
5907
5908 1
    __repr__ = __str__
5909
5910
5911 1 View Code Duplication
class ViewDescription(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5912
    '''
5913
    The view to browse.
5914
5915
    :ivar ViewId:
5916
    :vartype ViewId: NodeId
5917
    :ivar Timestamp:
5918
    :vartype Timestamp: DateTime
5919
    :ivar ViewVersion:
5920
    :vartype ViewVersion: UInt32
5921
    '''
5922
5923 1
    ua_types = {
5924
        'ViewId': 'NodeId',
5925
        'Timestamp': 'DateTime',
5926
        'ViewVersion': 'UInt32',
5927
               }
5928
5929 1
    def __init__(self, binary=None):
5930 1
        if binary is not None:
5931 1
            self._binary_init(binary)
5932 1
            self._freeze = True
5933 1
            return
5934 1
        self.ViewId = NodeId()
5935 1
        self.Timestamp = datetime.now()
5936 1
        self.ViewVersion = 0
5937 1
        self._freeze = True
5938
5939 1
    def to_binary(self):
5940 1
        packet = []
5941 1
        packet.append(self.ViewId.to_binary())
5942 1
        packet.append(uabin.Primitives.DateTime.pack(self.Timestamp))
5943 1
        packet.append(uabin.Primitives.UInt32.pack(self.ViewVersion))
5944 1
        return b''.join(packet)
5945
5946 1
    @staticmethod
5947
    def from_binary(data):
5948 1
        return ViewDescription(data)
5949
5950 1
    def _binary_init(self, data):
5951 1
        self.ViewId = NodeId.from_binary(data)
5952 1
        self.Timestamp = uabin.Primitives.DateTime.unpack(data)
5953 1
        self.ViewVersion = uabin.Primitives.UInt32.unpack(data)
5954
5955 1
    def __str__(self):
5956
        return 'ViewDescription(' + 'ViewId:' + str(self.ViewId) + ', ' + \
5957
               'Timestamp:' + str(self.Timestamp) + ', ' + \
5958
               'ViewVersion:' + str(self.ViewVersion) + ')'
5959
5960 1
    __repr__ = __str__
5961
5962
5963 1 View Code Duplication
class BrowseDescription(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5964
    '''
5965
    A request to browse the the references from a node.
5966
5967
    :ivar NodeId:
5968
    :vartype NodeId: NodeId
5969
    :ivar BrowseDirection:
5970
    :vartype BrowseDirection: BrowseDirection
5971
    :ivar ReferenceTypeId:
5972
    :vartype ReferenceTypeId: NodeId
5973
    :ivar IncludeSubtypes:
5974
    :vartype IncludeSubtypes: Boolean
5975
    :ivar NodeClassMask:
5976
    :vartype NodeClassMask: UInt32
5977
    :ivar ResultMask:
5978
    :vartype ResultMask: UInt32
5979
    '''
5980
5981 1
    ua_types = {
5982
        'NodeId': 'NodeId',
5983
        'BrowseDirection': 'BrowseDirection',
5984
        'ReferenceTypeId': 'NodeId',
5985
        'IncludeSubtypes': 'Boolean',
5986
        'NodeClassMask': 'UInt32',
5987
        'ResultMask': 'UInt32',
5988
               }
5989
5990 1
    def __init__(self, binary=None):
5991 1
        if binary is not None:
5992 1
            self._binary_init(binary)
5993 1
            self._freeze = True
5994 1
            return
5995 1
        self.NodeId = NodeId()
5996 1
        self.BrowseDirection = BrowseDirection(0)
5997 1
        self.ReferenceTypeId = NodeId()
5998 1
        self.IncludeSubtypes = True
5999 1
        self.NodeClassMask = 0
6000 1
        self.ResultMask = 0
6001 1
        self._freeze = True
6002
6003 1
    def to_binary(self):
6004 1
        packet = []
6005 1
        packet.append(self.NodeId.to_binary())
6006 1
        packet.append(uabin.Primitives.UInt32.pack(self.BrowseDirection.value))
6007 1
        packet.append(self.ReferenceTypeId.to_binary())
6008 1
        packet.append(uabin.Primitives.Boolean.pack(self.IncludeSubtypes))
6009 1
        packet.append(uabin.Primitives.UInt32.pack(self.NodeClassMask))
6010 1
        packet.append(uabin.Primitives.UInt32.pack(self.ResultMask))
6011 1
        return b''.join(packet)
6012
6013 1
    @staticmethod
6014
    def from_binary(data):
6015 1
        return BrowseDescription(data)
6016
6017 1
    def _binary_init(self, data):
6018 1
        self.NodeId = NodeId.from_binary(data)
6019 1
        self.BrowseDirection = BrowseDirection(uabin.Primitives.UInt32.unpack(data))
6020 1
        self.ReferenceTypeId = NodeId.from_binary(data)
6021 1
        self.IncludeSubtypes = uabin.Primitives.Boolean.unpack(data)
6022 1
        self.NodeClassMask = uabin.Primitives.UInt32.unpack(data)
6023 1
        self.ResultMask = uabin.Primitives.UInt32.unpack(data)
6024
6025 1
    def __str__(self):
6026
        return 'BrowseDescription(' + 'NodeId:' + str(self.NodeId) + ', ' + \
6027
               'BrowseDirection:' + str(self.BrowseDirection) + ', ' + \
6028
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
6029
               'IncludeSubtypes:' + str(self.IncludeSubtypes) + ', ' + \
6030
               'NodeClassMask:' + str(self.NodeClassMask) + ', ' + \
6031
               'ResultMask:' + str(self.ResultMask) + ')'
6032
6033 1
    __repr__ = __str__
6034
6035
6036 1 View Code Duplication
class ReferenceDescription(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6037
    '''
6038
    The description of a reference.
6039
6040
    :ivar ReferenceTypeId:
6041
    :vartype ReferenceTypeId: NodeId
6042
    :ivar IsForward:
6043
    :vartype IsForward: Boolean
6044
    :ivar NodeId:
6045
    :vartype NodeId: ExpandedNodeId
6046
    :ivar BrowseName:
6047
    :vartype BrowseName: QualifiedName
6048
    :ivar DisplayName:
6049
    :vartype DisplayName: LocalizedText
6050
    :ivar NodeClass:
6051
    :vartype NodeClass: NodeClass
6052
    :ivar TypeDefinition:
6053
    :vartype TypeDefinition: ExpandedNodeId
6054
    '''
6055
6056 1
    ua_types = {
6057
        'ReferenceTypeId': 'NodeId',
6058
        'IsForward': 'Boolean',
6059
        'NodeId': 'ExpandedNodeId',
6060
        'BrowseName': 'QualifiedName',
6061
        'DisplayName': 'LocalizedText',
6062
        'NodeClass': 'NodeClass',
6063
        'TypeDefinition': 'ExpandedNodeId',
6064
               }
6065
6066 1
    def __init__(self, binary=None):
6067 1
        if binary is not None:
6068 1
            self._binary_init(binary)
6069 1
            self._freeze = True
6070 1
            return
6071 1
        self.ReferenceTypeId = NodeId()
6072 1
        self.IsForward = True
6073 1
        self.NodeId = ExpandedNodeId()
6074 1
        self.BrowseName = QualifiedName()
6075 1
        self.DisplayName = LocalizedText()
6076 1
        self.NodeClass = NodeClass(0)
6077 1
        self.TypeDefinition = ExpandedNodeId()
6078 1
        self._freeze = True
6079
6080 1
    def to_binary(self):
6081 1
        packet = []
6082 1
        packet.append(self.ReferenceTypeId.to_binary())
6083 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsForward))
6084 1
        packet.append(self.NodeId.to_binary())
6085 1
        packet.append(self.BrowseName.to_binary())
6086 1
        packet.append(self.DisplayName.to_binary())
6087 1
        packet.append(uabin.Primitives.UInt32.pack(self.NodeClass.value))
6088 1
        packet.append(self.TypeDefinition.to_binary())
6089 1
        return b''.join(packet)
6090
6091 1
    @staticmethod
6092
    def from_binary(data):
6093 1
        return ReferenceDescription(data)
6094
6095 1
    def _binary_init(self, data):
6096 1
        self.ReferenceTypeId = NodeId.from_binary(data)
6097 1
        self.IsForward = uabin.Primitives.Boolean.unpack(data)
6098 1
        self.NodeId = ExpandedNodeId.from_binary(data)
6099 1
        self.BrowseName = QualifiedName.from_binary(data)
6100 1
        self.DisplayName = LocalizedText.from_binary(data)
6101 1
        self.NodeClass = NodeClass(uabin.Primitives.UInt32.unpack(data))
6102 1
        self.TypeDefinition = ExpandedNodeId.from_binary(data)
6103
6104 1
    def __str__(self):
6105
        return 'ReferenceDescription(' + 'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
6106
               'IsForward:' + str(self.IsForward) + ', ' + \
6107
               'NodeId:' + str(self.NodeId) + ', ' + \
6108
               'BrowseName:' + str(self.BrowseName) + ', ' + \
6109
               'DisplayName:' + str(self.DisplayName) + ', ' + \
6110
               'NodeClass:' + str(self.NodeClass) + ', ' + \
6111
               'TypeDefinition:' + str(self.TypeDefinition) + ')'
6112
6113 1
    __repr__ = __str__
6114
6115
6116 1 View Code Duplication
class BrowseResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6117
    '''
6118
    The result of a browse operation.
6119
6120
    :ivar StatusCode:
6121
    :vartype StatusCode: StatusCode
6122
    :ivar ContinuationPoint:
6123
    :vartype ContinuationPoint: ByteString
6124
    :ivar References:
6125
    :vartype References: ReferenceDescription
6126
    '''
6127
6128 1
    ua_types = {
6129
        'StatusCode': 'StatusCode',
6130
        'ContinuationPoint': 'ByteString',
6131
        'References': 'ReferenceDescription',
6132
               }
6133
6134 1
    def __init__(self, binary=None):
6135 1
        if binary is not None:
6136 1
            self._binary_init(binary)
6137 1
            self._freeze = True
6138 1
            return
6139 1
        self.StatusCode = StatusCode()
6140 1
        self.ContinuationPoint = None
6141 1
        self.References = []
6142 1
        self._freeze = True
6143
6144 1
    def to_binary(self):
6145 1
        packet = []
6146 1
        packet.append(self.StatusCode.to_binary())
6147 1
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
6148 1
        packet.append(uabin.Primitives.Int32.pack(len(self.References)))
6149 1
        for fieldname in self.References:
6150 1
            packet.append(fieldname.to_binary())
6151 1
        return b''.join(packet)
6152
6153 1
    @staticmethod
6154
    def from_binary(data):
6155 1
        return BrowseResult(data)
6156
6157 1
    def _binary_init(self, data):
6158 1
        self.StatusCode = StatusCode.from_binary(data)
6159 1
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
6160 1
        length = uabin.Primitives.Int32.unpack(data)
6161 1
        array = []
6162 1
        if length != -1:
6163 1
            for _ in range(0, length):
6164 1
                array.append(ReferenceDescription.from_binary(data))
6165 1
        self.References = array
6166
6167 1
    def __str__(self):
6168
        return 'BrowseResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
6169
               'ContinuationPoint:' + str(self.ContinuationPoint) + ', ' + \
6170
               'References:' + str(self.References) + ')'
6171
6172 1
    __repr__ = __str__
6173
6174
6175 1 View Code Duplication
class BrowseParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6176
    '''
6177
    :ivar View:
6178
    :vartype View: ViewDescription
6179
    :ivar RequestedMaxReferencesPerNode:
6180
    :vartype RequestedMaxReferencesPerNode: UInt32
6181
    :ivar NodesToBrowse:
6182
    :vartype NodesToBrowse: BrowseDescription
6183
    '''
6184
6185 1
    ua_types = {
6186
        'View': 'ViewDescription',
6187
        'RequestedMaxReferencesPerNode': 'UInt32',
6188
        'NodesToBrowse': 'BrowseDescription',
6189
               }
6190
6191 1
    def __init__(self, binary=None):
6192 1
        if binary is not None:
6193 1
            self._binary_init(binary)
6194 1
            self._freeze = True
6195 1
            return
6196 1
        self.View = ViewDescription()
6197 1
        self.RequestedMaxReferencesPerNode = 0
6198 1
        self.NodesToBrowse = []
6199 1
        self._freeze = True
6200
6201 1
    def to_binary(self):
6202 1
        packet = []
6203 1
        packet.append(self.View.to_binary())
6204 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedMaxReferencesPerNode))
6205 1
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToBrowse)))
6206 1
        for fieldname in self.NodesToBrowse:
6207 1
            packet.append(fieldname.to_binary())
6208 1
        return b''.join(packet)
6209
6210 1
    @staticmethod
6211
    def from_binary(data):
6212 1
        return BrowseParameters(data)
6213
6214 1
    def _binary_init(self, data):
6215 1
        self.View = ViewDescription.from_binary(data)
6216 1
        self.RequestedMaxReferencesPerNode = uabin.Primitives.UInt32.unpack(data)
6217 1
        length = uabin.Primitives.Int32.unpack(data)
6218 1
        array = []
6219 1
        if length != -1:
6220 1
            for _ in range(0, length):
6221 1
                array.append(BrowseDescription.from_binary(data))
6222 1
        self.NodesToBrowse = array
6223
6224 1
    def __str__(self):
6225
        return 'BrowseParameters(' + 'View:' + str(self.View) + ', ' + \
6226
               'RequestedMaxReferencesPerNode:' + str(self.RequestedMaxReferencesPerNode) + ', ' + \
6227
               'NodesToBrowse:' + str(self.NodesToBrowse) + ')'
6228
6229 1
    __repr__ = __str__
6230
6231
6232 1
class BrowseRequest(FrozenClass):
6233
    '''
6234
    Browse the references for one or more nodes from the server address space.
6235
6236
    :ivar TypeId:
6237
    :vartype TypeId: NodeId
6238
    :ivar RequestHeader:
6239
    :vartype RequestHeader: RequestHeader
6240
    :ivar Parameters:
6241
    :vartype Parameters: BrowseParameters
6242
    '''
6243
6244 1
    ua_types = {
6245
        'TypeId': 'NodeId',
6246
        'RequestHeader': 'RequestHeader',
6247
        'Parameters': 'BrowseParameters',
6248
               }
6249
6250 1
    def __init__(self, binary=None):
6251 1
        if binary is not None:
6252
            self._binary_init(binary)
6253
            self._freeze = True
6254
            return
6255 1
        self.TypeId = FourByteNodeId(ObjectIds.BrowseRequest_Encoding_DefaultBinary)
6256 1
        self.RequestHeader = RequestHeader()
6257 1
        self.Parameters = BrowseParameters()
6258 1
        self._freeze = True
6259
6260 1
    def to_binary(self):
6261 1
        packet = []
6262 1
        packet.append(self.TypeId.to_binary())
6263 1
        packet.append(self.RequestHeader.to_binary())
6264 1
        packet.append(self.Parameters.to_binary())
6265 1
        return b''.join(packet)
6266
6267 1
    @staticmethod
6268
    def from_binary(data):
6269
        return BrowseRequest(data)
6270
6271 1
    def _binary_init(self, data):
6272
        self.TypeId = NodeId.from_binary(data)
6273
        self.RequestHeader = RequestHeader.from_binary(data)
6274
        self.Parameters = BrowseParameters.from_binary(data)
6275
6276 1
    def __str__(self):
6277
        return 'BrowseRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6278
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
6279
               'Parameters:' + str(self.Parameters) + ')'
6280
6281 1
    __repr__ = __str__
6282
6283
6284 1
class BrowseResponse(FrozenClass):
6285
    '''
6286
    Browse the references for one or more nodes from the server address space.
6287
6288
    :ivar TypeId:
6289
    :vartype TypeId: NodeId
6290
    :ivar ResponseHeader:
6291
    :vartype ResponseHeader: ResponseHeader
6292
    :ivar Results:
6293
    :vartype Results: BrowseResult
6294
    :ivar DiagnosticInfos:
6295
    :vartype DiagnosticInfos: DiagnosticInfo
6296
    '''
6297
6298 1
    ua_types = {
6299
        'TypeId': 'NodeId',
6300
        'ResponseHeader': 'ResponseHeader',
6301
        'Results': 'BrowseResult',
6302
        'DiagnosticInfos': 'DiagnosticInfo',
6303
               }
6304
6305 1
    def __init__(self, binary=None):
6306 1
        if binary is not None:
6307 1
            self._binary_init(binary)
6308 1
            self._freeze = True
6309 1
            return
6310 1
        self.TypeId = FourByteNodeId(ObjectIds.BrowseResponse_Encoding_DefaultBinary)
6311 1
        self.ResponseHeader = ResponseHeader()
6312 1
        self.Results = []
6313 1
        self.DiagnosticInfos = []
6314 1
        self._freeze = True
6315
6316 1
    def to_binary(self):
6317 1
        packet = []
6318 1
        packet.append(self.TypeId.to_binary())
6319 1
        packet.append(self.ResponseHeader.to_binary())
6320 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
6321 1
        for fieldname in self.Results:
6322 1
            packet.append(fieldname.to_binary())
6323 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
6324 1
        for fieldname in self.DiagnosticInfos:
6325
            packet.append(fieldname.to_binary())
6326 1
        return b''.join(packet)
6327
6328 1
    @staticmethod
6329
    def from_binary(data):
6330 1
        return BrowseResponse(data)
6331
6332 1
    def _binary_init(self, data):
6333 1
        self.TypeId = NodeId.from_binary(data)
6334 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
6335 1
        length = uabin.Primitives.Int32.unpack(data)
6336 1
        array = []
6337 1
        if length != -1:
6338 1
            for _ in range(0, length):
6339 1
                array.append(BrowseResult.from_binary(data))
6340 1
        self.Results = array
6341 1
        length = uabin.Primitives.Int32.unpack(data)
6342 1
        array = []
6343 1
        if length != -1:
6344 1
            for _ in range(0, length):
6345
                array.append(DiagnosticInfo.from_binary(data))
6346 1
        self.DiagnosticInfos = array
6347
6348 1
    def __str__(self):
6349
        return 'BrowseResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6350
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
6351
               'Results:' + str(self.Results) + ', ' + \
6352
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
6353
6354 1
    __repr__ = __str__
6355
6356
6357 1 View Code Duplication
class BrowseNextParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6358
    '''
6359
    :ivar ReleaseContinuationPoints:
6360
    :vartype ReleaseContinuationPoints: Boolean
6361
    :ivar ContinuationPoints:
6362
    :vartype ContinuationPoints: ByteString
6363
    '''
6364
6365 1
    ua_types = {
6366
        'ReleaseContinuationPoints': 'Boolean',
6367
        'ContinuationPoints': 'ByteString',
6368
               }
6369
6370 1
    def __init__(self, binary=None):
6371
        if binary is not None:
6372
            self._binary_init(binary)
6373
            self._freeze = True
6374
            return
6375
        self.ReleaseContinuationPoints = True
6376
        self.ContinuationPoints = []
6377
        self._freeze = True
6378
6379 1
    def to_binary(self):
6380
        packet = []
6381
        packet.append(uabin.Primitives.Boolean.pack(self.ReleaseContinuationPoints))
6382
        packet.append(uabin.Primitives.Int32.pack(len(self.ContinuationPoints)))
6383
        for fieldname in self.ContinuationPoints:
6384
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
6385
        return b''.join(packet)
6386
6387 1
    @staticmethod
6388
    def from_binary(data):
6389
        return BrowseNextParameters(data)
6390
6391 1
    def _binary_init(self, data):
6392
        self.ReleaseContinuationPoints = uabin.Primitives.Boolean.unpack(data)
6393
        self.ContinuationPoints = uabin.Primitives.ByteString.unpack_array(data)
6394
6395 1
    def __str__(self):
6396
        return 'BrowseNextParameters(' + 'ReleaseContinuationPoints:' + str(self.ReleaseContinuationPoints) + ', ' + \
6397
               'ContinuationPoints:' + str(self.ContinuationPoints) + ')'
6398
6399 1
    __repr__ = __str__
6400
6401
6402 1
class BrowseNextRequest(FrozenClass):
6403
    '''
6404
    Continues one or more browse operations.
6405
6406
    :ivar TypeId:
6407
    :vartype TypeId: NodeId
6408
    :ivar RequestHeader:
6409
    :vartype RequestHeader: RequestHeader
6410
    :ivar Parameters:
6411
    :vartype Parameters: BrowseNextParameters
6412
    '''
6413
6414 1
    ua_types = {
6415
        'TypeId': 'NodeId',
6416
        'RequestHeader': 'RequestHeader',
6417
        'Parameters': 'BrowseNextParameters',
6418
               }
6419
6420 1
    def __init__(self, binary=None):
6421
        if binary is not None:
6422
            self._binary_init(binary)
6423
            self._freeze = True
6424
            return
6425
        self.TypeId = FourByteNodeId(ObjectIds.BrowseNextRequest_Encoding_DefaultBinary)
6426
        self.RequestHeader = RequestHeader()
6427
        self.Parameters = BrowseNextParameters()
6428
        self._freeze = True
6429
6430 1
    def to_binary(self):
6431
        packet = []
6432
        packet.append(self.TypeId.to_binary())
6433
        packet.append(self.RequestHeader.to_binary())
6434
        packet.append(self.Parameters.to_binary())
6435
        return b''.join(packet)
6436
6437 1
    @staticmethod
6438
    def from_binary(data):
6439
        return BrowseNextRequest(data)
6440
6441 1
    def _binary_init(self, data):
6442
        self.TypeId = NodeId.from_binary(data)
6443
        self.RequestHeader = RequestHeader.from_binary(data)
6444
        self.Parameters = BrowseNextParameters.from_binary(data)
6445
6446 1
    def __str__(self):
6447
        return 'BrowseNextRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6448
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
6449
               'Parameters:' + str(self.Parameters) + ')'
6450
6451 1
    __repr__ = __str__
6452
6453
6454 1 View Code Duplication
class BrowseNextResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6455
    '''
6456
    :ivar Results:
6457
    :vartype Results: BrowseResult
6458
    :ivar DiagnosticInfos:
6459
    :vartype DiagnosticInfos: DiagnosticInfo
6460
    '''
6461
6462 1
    ua_types = {
6463
        'Results': 'BrowseResult',
6464
        'DiagnosticInfos': 'DiagnosticInfo',
6465
               }
6466
6467 1
    def __init__(self, binary=None):
6468
        if binary is not None:
6469
            self._binary_init(binary)
6470
            self._freeze = True
6471
            return
6472
        self.Results = []
6473
        self.DiagnosticInfos = []
6474
        self._freeze = True
6475
6476 1
    def to_binary(self):
6477
        packet = []
6478
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
6479
        for fieldname in self.Results:
6480
            packet.append(fieldname.to_binary())
6481
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
6482
        for fieldname in self.DiagnosticInfos:
6483
            packet.append(fieldname.to_binary())
6484
        return b''.join(packet)
6485
6486 1
    @staticmethod
6487
    def from_binary(data):
6488
        return BrowseNextResult(data)
6489
6490 1
    def _binary_init(self, data):
6491
        length = uabin.Primitives.Int32.unpack(data)
6492
        array = []
6493
        if length != -1:
6494
            for _ in range(0, length):
6495
                array.append(BrowseResult.from_binary(data))
6496
        self.Results = array
6497
        length = uabin.Primitives.Int32.unpack(data)
6498
        array = []
6499
        if length != -1:
6500
            for _ in range(0, length):
6501
                array.append(DiagnosticInfo.from_binary(data))
6502
        self.DiagnosticInfos = array
6503
6504 1
    def __str__(self):
6505
        return 'BrowseNextResult(' + 'Results:' + str(self.Results) + ', ' + \
6506
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
6507
6508 1
    __repr__ = __str__
6509
6510
6511 1
class BrowseNextResponse(FrozenClass):
6512
    '''
6513
    Continues one or more browse operations.
6514
6515
    :ivar TypeId:
6516
    :vartype TypeId: NodeId
6517
    :ivar ResponseHeader:
6518
    :vartype ResponseHeader: ResponseHeader
6519
    :ivar Parameters:
6520
    :vartype Parameters: BrowseNextResult
6521
    '''
6522
6523 1
    ua_types = {
6524
        'TypeId': 'NodeId',
6525
        'ResponseHeader': 'ResponseHeader',
6526
        'Parameters': 'BrowseNextResult',
6527
               }
6528
6529 1
    def __init__(self, binary=None):
6530
        if binary is not None:
6531
            self._binary_init(binary)
6532
            self._freeze = True
6533
            return
6534
        self.TypeId = FourByteNodeId(ObjectIds.BrowseNextResponse_Encoding_DefaultBinary)
6535
        self.ResponseHeader = ResponseHeader()
6536
        self.Parameters = BrowseNextResult()
6537
        self._freeze = True
6538
6539 1
    def to_binary(self):
6540
        packet = []
6541
        packet.append(self.TypeId.to_binary())
6542
        packet.append(self.ResponseHeader.to_binary())
6543
        packet.append(self.Parameters.to_binary())
6544
        return b''.join(packet)
6545
6546 1
    @staticmethod
6547
    def from_binary(data):
6548
        return BrowseNextResponse(data)
6549
6550 1
    def _binary_init(self, data):
6551
        self.TypeId = NodeId.from_binary(data)
6552
        self.ResponseHeader = ResponseHeader.from_binary(data)
6553
        self.Parameters = BrowseNextResult.from_binary(data)
6554
6555 1
    def __str__(self):
6556
        return 'BrowseNextResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6557
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
6558
               'Parameters:' + str(self.Parameters) + ')'
6559
6560 1
    __repr__ = __str__
6561
6562
6563 1 View Code Duplication
class RelativePathElement(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6564
    '''
6565
    An element in a relative path.
6566
6567
    :ivar ReferenceTypeId:
6568
    :vartype ReferenceTypeId: NodeId
6569
    :ivar IsInverse:
6570
    :vartype IsInverse: Boolean
6571
    :ivar IncludeSubtypes:
6572
    :vartype IncludeSubtypes: Boolean
6573
    :ivar TargetName:
6574
    :vartype TargetName: QualifiedName
6575
    '''
6576
6577 1
    ua_types = {
6578
        'ReferenceTypeId': 'NodeId',
6579
        'IsInverse': 'Boolean',
6580
        'IncludeSubtypes': 'Boolean',
6581
        'TargetName': 'QualifiedName',
6582
               }
6583
6584 1
    def __init__(self, binary=None):
6585 1
        if binary is not None:
6586 1
            self._binary_init(binary)
6587 1
            self._freeze = True
6588 1
            return
6589 1
        self.ReferenceTypeId = NodeId()
6590 1
        self.IsInverse = True
6591 1
        self.IncludeSubtypes = True
6592 1
        self.TargetName = QualifiedName()
6593 1
        self._freeze = True
6594
6595 1
    def to_binary(self):
6596 1
        packet = []
6597 1
        packet.append(self.ReferenceTypeId.to_binary())
6598 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsInverse))
6599 1
        packet.append(uabin.Primitives.Boolean.pack(self.IncludeSubtypes))
6600 1
        packet.append(self.TargetName.to_binary())
6601 1
        return b''.join(packet)
6602
6603 1
    @staticmethod
6604
    def from_binary(data):
6605 1
        return RelativePathElement(data)
6606
6607 1
    def _binary_init(self, data):
6608 1
        self.ReferenceTypeId = NodeId.from_binary(data)
6609 1
        self.IsInverse = uabin.Primitives.Boolean.unpack(data)
6610 1
        self.IncludeSubtypes = uabin.Primitives.Boolean.unpack(data)
6611 1
        self.TargetName = QualifiedName.from_binary(data)
6612
6613 1
    def __str__(self):
6614
        return 'RelativePathElement(' + 'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
6615
               'IsInverse:' + str(self.IsInverse) + ', ' + \
6616
               'IncludeSubtypes:' + str(self.IncludeSubtypes) + ', ' + \
6617
               'TargetName:' + str(self.TargetName) + ')'
6618
6619 1
    __repr__ = __str__
6620
6621
6622 1
class RelativePath(FrozenClass):
6623
    '''
6624
    A relative path constructed from reference types and browse names.
6625
6626
    :ivar Elements:
6627
    :vartype Elements: RelativePathElement
6628
    '''
6629
6630 1
    ua_types = {
6631
        'Elements': 'RelativePathElement',
6632
               }
6633
6634 1
    def __init__(self, binary=None):
6635 1
        if binary is not None:
6636 1
            self._binary_init(binary)
6637 1
            self._freeze = True
6638 1
            return
6639 1
        self.Elements = []
6640 1
        self._freeze = True
6641
6642 1
    def to_binary(self):
6643 1
        packet = []
6644 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Elements)))
6645 1
        for fieldname in self.Elements:
6646 1
            packet.append(fieldname.to_binary())
6647 1
        return b''.join(packet)
6648
6649 1
    @staticmethod
6650
    def from_binary(data):
6651 1
        return RelativePath(data)
6652
6653 1
    def _binary_init(self, data):
6654 1
        length = uabin.Primitives.Int32.unpack(data)
6655 1
        array = []
6656 1
        if length != -1:
6657 1
            for _ in range(0, length):
6658 1
                array.append(RelativePathElement.from_binary(data))
6659 1
        self.Elements = array
6660
6661 1
    def __str__(self):
6662
        return 'RelativePath(' + 'Elements:' + str(self.Elements) + ')'
6663
6664 1
    __repr__ = __str__
6665
6666
6667 1 View Code Duplication
class BrowsePath(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6668
    '''
6669
    A request to translate a path into a node id.
6670
6671
    :ivar StartingNode:
6672
    :vartype StartingNode: NodeId
6673
    :ivar RelativePath:
6674
    :vartype RelativePath: RelativePath
6675
    '''
6676
6677 1
    ua_types = {
6678
        'StartingNode': 'NodeId',
6679
        'RelativePath': 'RelativePath',
6680
               }
6681
6682 1
    def __init__(self, binary=None):
6683 1
        if binary is not None:
6684 1
            self._binary_init(binary)
6685 1
            self._freeze = True
6686 1
            return
6687 1
        self.StartingNode = NodeId()
6688 1
        self.RelativePath = RelativePath()
6689 1
        self._freeze = True
6690
6691 1
    def to_binary(self):
6692 1
        packet = []
6693 1
        packet.append(self.StartingNode.to_binary())
6694 1
        packet.append(self.RelativePath.to_binary())
6695 1
        return b''.join(packet)
6696
6697 1
    @staticmethod
6698
    def from_binary(data):
6699 1
        return BrowsePath(data)
6700
6701 1
    def _binary_init(self, data):
6702 1
        self.StartingNode = NodeId.from_binary(data)
6703 1
        self.RelativePath = RelativePath.from_binary(data)
6704
6705 1
    def __str__(self):
6706
        return 'BrowsePath(' + 'StartingNode:' + str(self.StartingNode) + ', ' + \
6707
               'RelativePath:' + str(self.RelativePath) + ')'
6708
6709 1
    __repr__ = __str__
6710
6711
6712 1 View Code Duplication
class BrowsePathTarget(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6713
    '''
6714
    The target of the translated path.
6715
6716
    :ivar TargetId:
6717
    :vartype TargetId: ExpandedNodeId
6718
    :ivar RemainingPathIndex:
6719
    :vartype RemainingPathIndex: UInt32
6720
    '''
6721
6722 1
    ua_types = {
6723
        'TargetId': 'ExpandedNodeId',
6724
        'RemainingPathIndex': 'UInt32',
6725
               }
6726
6727 1
    def __init__(self, binary=None):
6728 1
        if binary is not None:
6729 1
            self._binary_init(binary)
6730 1
            self._freeze = True
6731 1
            return
6732 1
        self.TargetId = ExpandedNodeId()
6733 1
        self.RemainingPathIndex = 0
6734 1
        self._freeze = True
6735
6736 1
    def to_binary(self):
6737 1
        packet = []
6738 1
        packet.append(self.TargetId.to_binary())
6739 1
        packet.append(uabin.Primitives.UInt32.pack(self.RemainingPathIndex))
6740 1
        return b''.join(packet)
6741
6742 1
    @staticmethod
6743
    def from_binary(data):
6744 1
        return BrowsePathTarget(data)
6745
6746 1
    def _binary_init(self, data):
6747 1
        self.TargetId = ExpandedNodeId.from_binary(data)
6748 1
        self.RemainingPathIndex = uabin.Primitives.UInt32.unpack(data)
6749
6750 1
    def __str__(self):
6751
        return 'BrowsePathTarget(' + 'TargetId:' + str(self.TargetId) + ', ' + \
6752
               'RemainingPathIndex:' + str(self.RemainingPathIndex) + ')'
6753
6754 1
    __repr__ = __str__
6755
6756
6757 1 View Code Duplication
class BrowsePathResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6758
    '''
6759
    The result of a translate opearation.
6760
6761
    :ivar StatusCode:
6762
    :vartype StatusCode: StatusCode
6763
    :ivar Targets:
6764
    :vartype Targets: BrowsePathTarget
6765
    '''
6766
6767 1
    ua_types = {
6768
        'StatusCode': 'StatusCode',
6769
        'Targets': 'BrowsePathTarget',
6770
               }
6771
6772 1
    def __init__(self, binary=None):
6773 1
        if binary is not None:
6774 1
            self._binary_init(binary)
6775 1
            self._freeze = True
6776 1
            return
6777 1
        self.StatusCode = StatusCode()
6778 1
        self.Targets = []
6779 1
        self._freeze = True
6780
6781 1
    def to_binary(self):
6782 1
        packet = []
6783 1
        packet.append(self.StatusCode.to_binary())
6784 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Targets)))
6785 1
        for fieldname in self.Targets:
6786 1
            packet.append(fieldname.to_binary())
6787 1
        return b''.join(packet)
6788
6789 1
    @staticmethod
6790
    def from_binary(data):
6791 1
        return BrowsePathResult(data)
6792
6793 1
    def _binary_init(self, data):
6794 1
        self.StatusCode = StatusCode.from_binary(data)
6795 1
        length = uabin.Primitives.Int32.unpack(data)
6796 1
        array = []
6797 1
        if length != -1:
6798 1
            for _ in range(0, length):
6799 1
                array.append(BrowsePathTarget.from_binary(data))
6800 1
        self.Targets = array
6801
6802 1
    def __str__(self):
6803
        return 'BrowsePathResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
6804
               'Targets:' + str(self.Targets) + ')'
6805
6806 1
    __repr__ = __str__
6807
6808
6809 1
class TranslateBrowsePathsToNodeIdsParameters(FrozenClass):
6810
    '''
6811
    :ivar BrowsePaths:
6812
    :vartype BrowsePaths: BrowsePath
6813
    '''
6814
6815 1
    ua_types = {
6816
        'BrowsePaths': 'BrowsePath',
6817
               }
6818
6819 1
    def __init__(self, binary=None):
6820 1
        if binary is not None:
6821 1
            self._binary_init(binary)
6822 1
            self._freeze = True
6823 1
            return
6824 1
        self.BrowsePaths = []
6825 1
        self._freeze = True
6826
6827 1
    def to_binary(self):
6828 1
        packet = []
6829 1
        packet.append(uabin.Primitives.Int32.pack(len(self.BrowsePaths)))
6830 1
        for fieldname in self.BrowsePaths:
6831 1
            packet.append(fieldname.to_binary())
6832 1
        return b''.join(packet)
6833
6834 1
    @staticmethod
6835
    def from_binary(data):
6836 1
        return TranslateBrowsePathsToNodeIdsParameters(data)
6837
6838 1
    def _binary_init(self, data):
6839 1
        length = uabin.Primitives.Int32.unpack(data)
6840 1
        array = []
6841 1
        if length != -1:
6842 1
            for _ in range(0, length):
6843 1
                array.append(BrowsePath.from_binary(data))
6844 1
        self.BrowsePaths = array
6845
6846 1
    def __str__(self):
6847
        return 'TranslateBrowsePathsToNodeIdsParameters(' + 'BrowsePaths:' + str(self.BrowsePaths) + ')'
6848
6849 1
    __repr__ = __str__
6850
6851
6852 1
class TranslateBrowsePathsToNodeIdsRequest(FrozenClass):
6853
    '''
6854
    Translates one or more paths in the server address space.
6855
6856
    :ivar TypeId:
6857
    :vartype TypeId: NodeId
6858
    :ivar RequestHeader:
6859
    :vartype RequestHeader: RequestHeader
6860
    :ivar Parameters:
6861
    :vartype Parameters: TranslateBrowsePathsToNodeIdsParameters
6862
    '''
6863
6864 1
    ua_types = {
6865
        'TypeId': 'NodeId',
6866
        'RequestHeader': 'RequestHeader',
6867
        'Parameters': 'TranslateBrowsePathsToNodeIdsParameters',
6868
               }
6869
6870 1
    def __init__(self, binary=None):
6871 1
        if binary is not None:
6872
            self._binary_init(binary)
6873
            self._freeze = True
6874
            return
6875 1
        self.TypeId = FourByteNodeId(ObjectIds.TranslateBrowsePathsToNodeIdsRequest_Encoding_DefaultBinary)
6876 1
        self.RequestHeader = RequestHeader()
6877 1
        self.Parameters = TranslateBrowsePathsToNodeIdsParameters()
6878 1
        self._freeze = True
6879
6880 1
    def to_binary(self):
6881 1
        packet = []
6882 1
        packet.append(self.TypeId.to_binary())
6883 1
        packet.append(self.RequestHeader.to_binary())
6884 1
        packet.append(self.Parameters.to_binary())
6885 1
        return b''.join(packet)
6886
6887 1
    @staticmethod
6888
    def from_binary(data):
6889
        return TranslateBrowsePathsToNodeIdsRequest(data)
6890
6891 1
    def _binary_init(self, data):
6892
        self.TypeId = NodeId.from_binary(data)
6893
        self.RequestHeader = RequestHeader.from_binary(data)
6894
        self.Parameters = TranslateBrowsePathsToNodeIdsParameters.from_binary(data)
6895
6896 1
    def __str__(self):
6897
        return 'TranslateBrowsePathsToNodeIdsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6898
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
6899
               'Parameters:' + str(self.Parameters) + ')'
6900
6901 1
    __repr__ = __str__
6902
6903
6904 1
class TranslateBrowsePathsToNodeIdsResponse(FrozenClass):
6905
    '''
6906
    Translates one or more paths in the server address space.
6907
6908
    :ivar TypeId:
6909
    :vartype TypeId: NodeId
6910
    :ivar ResponseHeader:
6911
    :vartype ResponseHeader: ResponseHeader
6912
    :ivar Results:
6913
    :vartype Results: BrowsePathResult
6914
    :ivar DiagnosticInfos:
6915
    :vartype DiagnosticInfos: DiagnosticInfo
6916
    '''
6917
6918 1
    ua_types = {
6919
        'TypeId': 'NodeId',
6920
        'ResponseHeader': 'ResponseHeader',
6921
        'Results': 'BrowsePathResult',
6922
        'DiagnosticInfos': 'DiagnosticInfo',
6923
               }
6924
6925 1
    def __init__(self, binary=None):
6926 1
        if binary is not None:
6927 1
            self._binary_init(binary)
6928 1
            self._freeze = True
6929 1
            return
6930 1
        self.TypeId = FourByteNodeId(ObjectIds.TranslateBrowsePathsToNodeIdsResponse_Encoding_DefaultBinary)
6931 1
        self.ResponseHeader = ResponseHeader()
6932 1
        self.Results = []
6933 1
        self.DiagnosticInfos = []
6934 1
        self._freeze = True
6935
6936 1
    def to_binary(self):
6937 1
        packet = []
6938 1
        packet.append(self.TypeId.to_binary())
6939 1
        packet.append(self.ResponseHeader.to_binary())
6940 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
6941 1
        for fieldname in self.Results:
6942 1
            packet.append(fieldname.to_binary())
6943 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
6944 1
        for fieldname in self.DiagnosticInfos:
6945
            packet.append(fieldname.to_binary())
6946 1
        return b''.join(packet)
6947
6948 1
    @staticmethod
6949
    def from_binary(data):
6950 1
        return TranslateBrowsePathsToNodeIdsResponse(data)
6951
6952 1
    def _binary_init(self, data):
6953 1
        self.TypeId = NodeId.from_binary(data)
6954 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
6955 1
        length = uabin.Primitives.Int32.unpack(data)
6956 1
        array = []
6957 1
        if length != -1:
6958 1
            for _ in range(0, length):
6959 1
                array.append(BrowsePathResult.from_binary(data))
6960 1
        self.Results = array
6961 1
        length = uabin.Primitives.Int32.unpack(data)
6962 1
        array = []
6963 1
        if length != -1:
6964 1
            for _ in range(0, length):
6965
                array.append(DiagnosticInfo.from_binary(data))
6966 1
        self.DiagnosticInfos = array
6967
6968 1
    def __str__(self):
6969
        return 'TranslateBrowsePathsToNodeIdsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6970
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
6971
               'Results:' + str(self.Results) + ', ' + \
6972
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
6973
6974 1
    __repr__ = __str__
6975
6976
6977 1
class RegisterNodesParameters(FrozenClass):
6978
    '''
6979
    :ivar NodesToRegister:
6980
    :vartype NodesToRegister: NodeId
6981
    '''
6982
6983 1
    ua_types = {
6984
        'NodesToRegister': 'NodeId',
6985
               }
6986
6987 1
    def __init__(self, binary=None):
6988
        if binary is not None:
6989
            self._binary_init(binary)
6990
            self._freeze = True
6991
            return
6992
        self.NodesToRegister = []
6993
        self._freeze = True
6994
6995 1
    def to_binary(self):
6996
        packet = []
6997
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToRegister)))
6998
        for fieldname in self.NodesToRegister:
6999
            packet.append(fieldname.to_binary())
7000
        return b''.join(packet)
7001
7002 1
    @staticmethod
7003
    def from_binary(data):
7004
        return RegisterNodesParameters(data)
7005
7006 1
    def _binary_init(self, data):
7007
        length = uabin.Primitives.Int32.unpack(data)
7008
        array = []
7009
        if length != -1:
7010
            for _ in range(0, length):
7011
                array.append(NodeId.from_binary(data))
7012
        self.NodesToRegister = array
7013
7014 1
    def __str__(self):
7015
        return 'RegisterNodesParameters(' + 'NodesToRegister:' + str(self.NodesToRegister) + ')'
7016
7017 1
    __repr__ = __str__
7018
7019
7020 1
class RegisterNodesRequest(FrozenClass):
7021
    '''
7022
    Registers one or more nodes for repeated use within a session.
7023
7024
    :ivar TypeId:
7025
    :vartype TypeId: NodeId
7026
    :ivar RequestHeader:
7027
    :vartype RequestHeader: RequestHeader
7028
    :ivar Parameters:
7029
    :vartype Parameters: RegisterNodesParameters
7030
    '''
7031
7032 1
    ua_types = {
7033
        'TypeId': 'NodeId',
7034
        'RequestHeader': 'RequestHeader',
7035
        'Parameters': 'RegisterNodesParameters',
7036
               }
7037
7038 1
    def __init__(self, binary=None):
7039
        if binary is not None:
7040
            self._binary_init(binary)
7041
            self._freeze = True
7042
            return
7043
        self.TypeId = FourByteNodeId(ObjectIds.RegisterNodesRequest_Encoding_DefaultBinary)
7044
        self.RequestHeader = RequestHeader()
7045
        self.Parameters = RegisterNodesParameters()
7046
        self._freeze = True
7047
7048 1
    def to_binary(self):
7049
        packet = []
7050
        packet.append(self.TypeId.to_binary())
7051
        packet.append(self.RequestHeader.to_binary())
7052
        packet.append(self.Parameters.to_binary())
7053
        return b''.join(packet)
7054
7055 1
    @staticmethod
7056
    def from_binary(data):
7057
        return RegisterNodesRequest(data)
7058
7059 1
    def _binary_init(self, data):
7060
        self.TypeId = NodeId.from_binary(data)
7061
        self.RequestHeader = RequestHeader.from_binary(data)
7062
        self.Parameters = RegisterNodesParameters.from_binary(data)
7063
7064 1
    def __str__(self):
7065
        return 'RegisterNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7066
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
7067
               'Parameters:' + str(self.Parameters) + ')'
7068
7069 1
    __repr__ = __str__
7070
7071
7072 1
class RegisterNodesResult(FrozenClass):
7073
    '''
7074
    :ivar RegisteredNodeIds:
7075
    :vartype RegisteredNodeIds: NodeId
7076
    '''
7077
7078 1
    ua_types = {
7079
        'RegisteredNodeIds': 'NodeId',
7080
               }
7081
7082 1
    def __init__(self, binary=None):
7083
        if binary is not None:
7084
            self._binary_init(binary)
7085
            self._freeze = True
7086
            return
7087
        self.RegisteredNodeIds = []
7088
        self._freeze = True
7089
7090 1
    def to_binary(self):
7091
        packet = []
7092
        packet.append(uabin.Primitives.Int32.pack(len(self.RegisteredNodeIds)))
7093
        for fieldname in self.RegisteredNodeIds:
7094
            packet.append(fieldname.to_binary())
7095
        return b''.join(packet)
7096
7097 1
    @staticmethod
7098
    def from_binary(data):
7099
        return RegisterNodesResult(data)
7100
7101 1
    def _binary_init(self, data):
7102
        length = uabin.Primitives.Int32.unpack(data)
7103
        array = []
7104
        if length != -1:
7105
            for _ in range(0, length):
7106
                array.append(NodeId.from_binary(data))
7107
        self.RegisteredNodeIds = array
7108
7109 1
    def __str__(self):
7110
        return 'RegisterNodesResult(' + 'RegisteredNodeIds:' + str(self.RegisteredNodeIds) + ')'
7111
7112 1
    __repr__ = __str__
7113
7114
7115 1
class RegisterNodesResponse(FrozenClass):
7116
    '''
7117
    Registers one or more nodes for repeated use within a session.
7118
7119
    :ivar TypeId:
7120
    :vartype TypeId: NodeId
7121
    :ivar ResponseHeader:
7122
    :vartype ResponseHeader: ResponseHeader
7123
    :ivar Parameters:
7124
    :vartype Parameters: RegisterNodesResult
7125
    '''
7126
7127 1
    ua_types = {
7128
        'TypeId': 'NodeId',
7129
        'ResponseHeader': 'ResponseHeader',
7130
        'Parameters': 'RegisterNodesResult',
7131
               }
7132
7133 1
    def __init__(self, binary=None):
7134
        if binary is not None:
7135
            self._binary_init(binary)
7136
            self._freeze = True
7137
            return
7138
        self.TypeId = FourByteNodeId(ObjectIds.RegisterNodesResponse_Encoding_DefaultBinary)
7139
        self.ResponseHeader = ResponseHeader()
7140
        self.Parameters = RegisterNodesResult()
7141
        self._freeze = True
7142
7143 1
    def to_binary(self):
7144
        packet = []
7145
        packet.append(self.TypeId.to_binary())
7146
        packet.append(self.ResponseHeader.to_binary())
7147
        packet.append(self.Parameters.to_binary())
7148
        return b''.join(packet)
7149
7150 1
    @staticmethod
7151
    def from_binary(data):
7152
        return RegisterNodesResponse(data)
7153
7154 1
    def _binary_init(self, data):
7155
        self.TypeId = NodeId.from_binary(data)
7156
        self.ResponseHeader = ResponseHeader.from_binary(data)
7157
        self.Parameters = RegisterNodesResult.from_binary(data)
7158
7159 1
    def __str__(self):
7160
        return 'RegisterNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7161
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
7162
               'Parameters:' + str(self.Parameters) + ')'
7163
7164 1
    __repr__ = __str__
7165
7166
7167 1
class UnregisterNodesParameters(FrozenClass):
7168
    '''
7169
    :ivar NodesToUnregister:
7170
    :vartype NodesToUnregister: NodeId
7171
    '''
7172
7173 1
    ua_types = {
7174
        'NodesToUnregister': 'NodeId',
7175
               }
7176
7177 1
    def __init__(self, binary=None):
7178
        if binary is not None:
7179
            self._binary_init(binary)
7180
            self._freeze = True
7181
            return
7182
        self.NodesToUnregister = []
7183
        self._freeze = True
7184
7185 1
    def to_binary(self):
7186
        packet = []
7187
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToUnregister)))
7188
        for fieldname in self.NodesToUnregister:
7189
            packet.append(fieldname.to_binary())
7190
        return b''.join(packet)
7191
7192 1
    @staticmethod
7193
    def from_binary(data):
7194
        return UnregisterNodesParameters(data)
7195
7196 1
    def _binary_init(self, data):
7197
        length = uabin.Primitives.Int32.unpack(data)
7198
        array = []
7199
        if length != -1:
7200
            for _ in range(0, length):
7201
                array.append(NodeId.from_binary(data))
7202
        self.NodesToUnregister = array
7203
7204 1
    def __str__(self):
7205
        return 'UnregisterNodesParameters(' + 'NodesToUnregister:' + str(self.NodesToUnregister) + ')'
7206
7207 1
    __repr__ = __str__
7208
7209
7210 1
class UnregisterNodesRequest(FrozenClass):
7211
    '''
7212
    Unregisters one or more previously registered nodes.
7213
7214
    :ivar TypeId:
7215
    :vartype TypeId: NodeId
7216
    :ivar RequestHeader:
7217
    :vartype RequestHeader: RequestHeader
7218
    :ivar Parameters:
7219
    :vartype Parameters: UnregisterNodesParameters
7220
    '''
7221
7222 1
    ua_types = {
7223
        'TypeId': 'NodeId',
7224
        'RequestHeader': 'RequestHeader',
7225
        'Parameters': 'UnregisterNodesParameters',
7226
               }
7227
7228 1
    def __init__(self, binary=None):
7229
        if binary is not None:
7230
            self._binary_init(binary)
7231
            self._freeze = True
7232
            return
7233
        self.TypeId = FourByteNodeId(ObjectIds.UnregisterNodesRequest_Encoding_DefaultBinary)
7234
        self.RequestHeader = RequestHeader()
7235
        self.Parameters = UnregisterNodesParameters()
7236
        self._freeze = True
7237
7238 1
    def to_binary(self):
7239
        packet = []
7240
        packet.append(self.TypeId.to_binary())
7241
        packet.append(self.RequestHeader.to_binary())
7242
        packet.append(self.Parameters.to_binary())
7243
        return b''.join(packet)
7244
7245 1
    @staticmethod
7246
    def from_binary(data):
7247
        return UnregisterNodesRequest(data)
7248
7249 1
    def _binary_init(self, data):
7250
        self.TypeId = NodeId.from_binary(data)
7251
        self.RequestHeader = RequestHeader.from_binary(data)
7252
        self.Parameters = UnregisterNodesParameters.from_binary(data)
7253
7254 1
    def __str__(self):
7255
        return 'UnregisterNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7256
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
7257
               'Parameters:' + str(self.Parameters) + ')'
7258
7259 1
    __repr__ = __str__
7260
7261
7262 1 View Code Duplication
class UnregisterNodesResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7263
    '''
7264
    Unregisters one or more previously registered nodes.
7265
7266
    :ivar TypeId:
7267
    :vartype TypeId: NodeId
7268
    :ivar ResponseHeader:
7269
    :vartype ResponseHeader: ResponseHeader
7270
    '''
7271
7272 1
    ua_types = {
7273
        'TypeId': 'NodeId',
7274
        'ResponseHeader': 'ResponseHeader',
7275
               }
7276
7277 1
    def __init__(self, binary=None):
7278
        if binary is not None:
7279
            self._binary_init(binary)
7280
            self._freeze = True
7281
            return
7282
        self.TypeId = FourByteNodeId(ObjectIds.UnregisterNodesResponse_Encoding_DefaultBinary)
7283
        self.ResponseHeader = ResponseHeader()
7284
        self._freeze = True
7285
7286 1
    def to_binary(self):
7287
        packet = []
7288
        packet.append(self.TypeId.to_binary())
7289
        packet.append(self.ResponseHeader.to_binary())
7290
        return b''.join(packet)
7291
7292 1
    @staticmethod
7293
    def from_binary(data):
7294
        return UnregisterNodesResponse(data)
7295
7296 1
    def _binary_init(self, data):
7297
        self.TypeId = NodeId.from_binary(data)
7298
        self.ResponseHeader = ResponseHeader.from_binary(data)
7299
7300 1
    def __str__(self):
7301
        return 'UnregisterNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7302
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
7303
7304 1
    __repr__ = __str__
7305
7306
7307 1
class EndpointConfiguration(FrozenClass):
7308
    '''
7309
    :ivar OperationTimeout:
7310
    :vartype OperationTimeout: Int32
7311
    :ivar UseBinaryEncoding:
7312
    :vartype UseBinaryEncoding: Boolean
7313
    :ivar MaxStringLength:
7314
    :vartype MaxStringLength: Int32
7315
    :ivar MaxByteStringLength:
7316
    :vartype MaxByteStringLength: Int32
7317
    :ivar MaxArrayLength:
7318
    :vartype MaxArrayLength: Int32
7319
    :ivar MaxMessageSize:
7320
    :vartype MaxMessageSize: Int32
7321
    :ivar MaxBufferSize:
7322
    :vartype MaxBufferSize: Int32
7323
    :ivar ChannelLifetime:
7324
    :vartype ChannelLifetime: Int32
7325
    :ivar SecurityTokenLifetime:
7326
    :vartype SecurityTokenLifetime: Int32
7327
    '''
7328
7329 1
    ua_types = {
7330
        'OperationTimeout': 'Int32',
7331
        'UseBinaryEncoding': 'Boolean',
7332
        'MaxStringLength': 'Int32',
7333
        'MaxByteStringLength': 'Int32',
7334
        'MaxArrayLength': 'Int32',
7335
        'MaxMessageSize': 'Int32',
7336
        'MaxBufferSize': 'Int32',
7337
        'ChannelLifetime': 'Int32',
7338
        'SecurityTokenLifetime': 'Int32',
7339
               }
7340
7341 1
    def __init__(self, binary=None):
7342
        if binary is not None:
7343
            self._binary_init(binary)
7344
            self._freeze = True
7345
            return
7346
        self.OperationTimeout = 0
7347
        self.UseBinaryEncoding = True
7348
        self.MaxStringLength = 0
7349
        self.MaxByteStringLength = 0
7350
        self.MaxArrayLength = 0
7351
        self.MaxMessageSize = 0
7352
        self.MaxBufferSize = 0
7353
        self.ChannelLifetime = 0
7354
        self.SecurityTokenLifetime = 0
7355
        self._freeze = True
7356
7357 1
    def to_binary(self):
7358
        packet = []
7359
        packet.append(uabin.Primitives.Int32.pack(self.OperationTimeout))
7360
        packet.append(uabin.Primitives.Boolean.pack(self.UseBinaryEncoding))
7361
        packet.append(uabin.Primitives.Int32.pack(self.MaxStringLength))
7362
        packet.append(uabin.Primitives.Int32.pack(self.MaxByteStringLength))
7363
        packet.append(uabin.Primitives.Int32.pack(self.MaxArrayLength))
7364
        packet.append(uabin.Primitives.Int32.pack(self.MaxMessageSize))
7365
        packet.append(uabin.Primitives.Int32.pack(self.MaxBufferSize))
7366
        packet.append(uabin.Primitives.Int32.pack(self.ChannelLifetime))
7367
        packet.append(uabin.Primitives.Int32.pack(self.SecurityTokenLifetime))
7368
        return b''.join(packet)
7369
7370 1
    @staticmethod
7371
    def from_binary(data):
7372
        return EndpointConfiguration(data)
7373
7374 1
    def _binary_init(self, data):
7375
        self.OperationTimeout = uabin.Primitives.Int32.unpack(data)
7376
        self.UseBinaryEncoding = uabin.Primitives.Boolean.unpack(data)
7377
        self.MaxStringLength = uabin.Primitives.Int32.unpack(data)
7378
        self.MaxByteStringLength = uabin.Primitives.Int32.unpack(data)
7379
        self.MaxArrayLength = uabin.Primitives.Int32.unpack(data)
7380
        self.MaxMessageSize = uabin.Primitives.Int32.unpack(data)
7381
        self.MaxBufferSize = uabin.Primitives.Int32.unpack(data)
7382
        self.ChannelLifetime = uabin.Primitives.Int32.unpack(data)
7383
        self.SecurityTokenLifetime = uabin.Primitives.Int32.unpack(data)
7384
7385 1
    def __str__(self):
7386
        return 'EndpointConfiguration(' + 'OperationTimeout:' + str(self.OperationTimeout) + ', ' + \
7387
               'UseBinaryEncoding:' + str(self.UseBinaryEncoding) + ', ' + \
7388
               'MaxStringLength:' + str(self.MaxStringLength) + ', ' + \
7389
               'MaxByteStringLength:' + str(self.MaxByteStringLength) + ', ' + \
7390
               'MaxArrayLength:' + str(self.MaxArrayLength) + ', ' + \
7391
               'MaxMessageSize:' + str(self.MaxMessageSize) + ', ' + \
7392
               'MaxBufferSize:' + str(self.MaxBufferSize) + ', ' + \
7393
               'ChannelLifetime:' + str(self.ChannelLifetime) + ', ' + \
7394
               'SecurityTokenLifetime:' + str(self.SecurityTokenLifetime) + ')'
7395
7396 1
    __repr__ = __str__
7397
7398
7399 1
class SupportedProfile(FrozenClass):
7400
    '''
7401
    :ivar OrganizationUri:
7402
    :vartype OrganizationUri: String
7403
    :ivar ProfileId:
7404
    :vartype ProfileId: String
7405
    :ivar ComplianceTool:
7406
    :vartype ComplianceTool: String
7407
    :ivar ComplianceDate:
7408
    :vartype ComplianceDate: DateTime
7409
    :ivar ComplianceLevel:
7410
    :vartype ComplianceLevel: ComplianceLevel
7411
    :ivar UnsupportedUnitIds:
7412
    :vartype UnsupportedUnitIds: String
7413
    '''
7414
7415 1
    ua_types = {
7416
        'OrganizationUri': 'String',
7417
        'ProfileId': 'String',
7418
        'ComplianceTool': 'String',
7419
        'ComplianceDate': 'DateTime',
7420
        'ComplianceLevel': 'ComplianceLevel',
7421
        'UnsupportedUnitIds': 'String',
7422
               }
7423
7424 1
    def __init__(self, binary=None):
7425
        if binary is not None:
7426
            self._binary_init(binary)
7427
            self._freeze = True
7428
            return
7429
        self.OrganizationUri = None
7430
        self.ProfileId = None
7431
        self.ComplianceTool = None
7432
        self.ComplianceDate = datetime.now()
7433
        self.ComplianceLevel = ComplianceLevel(0)
7434
        self.UnsupportedUnitIds = []
7435
        self._freeze = True
7436
7437 1 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7438
        packet = []
7439
        packet.append(uabin.Primitives.String.pack(self.OrganizationUri))
7440
        packet.append(uabin.Primitives.String.pack(self.ProfileId))
7441
        packet.append(uabin.Primitives.String.pack(self.ComplianceTool))
7442
        packet.append(uabin.Primitives.DateTime.pack(self.ComplianceDate))
7443
        packet.append(uabin.Primitives.UInt32.pack(self.ComplianceLevel.value))
7444
        packet.append(uabin.Primitives.Int32.pack(len(self.UnsupportedUnitIds)))
7445
        for fieldname in self.UnsupportedUnitIds:
7446
            packet.append(uabin.Primitives.String.pack(fieldname))
7447
        return b''.join(packet)
7448
7449 1
    @staticmethod
7450
    def from_binary(data):
7451
        return SupportedProfile(data)
7452
7453 1
    def _binary_init(self, data):
7454
        self.OrganizationUri = uabin.Primitives.String.unpack(data)
7455
        self.ProfileId = uabin.Primitives.String.unpack(data)
7456
        self.ComplianceTool = uabin.Primitives.String.unpack(data)
7457 View Code Duplication
        self.ComplianceDate = uabin.Primitives.DateTime.unpack(data)
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7458
        self.ComplianceLevel = ComplianceLevel(uabin.Primitives.UInt32.unpack(data))
7459
        self.UnsupportedUnitIds = uabin.Primitives.String.unpack_array(data)
7460
7461 1
    def __str__(self):
7462
        return 'SupportedProfile(' + 'OrganizationUri:' + str(self.OrganizationUri) + ', ' + \
7463
               'ProfileId:' + str(self.ProfileId) + ', ' + \
7464
               'ComplianceTool:' + str(self.ComplianceTool) + ', ' + \
7465
               'ComplianceDate:' + str(self.ComplianceDate) + ', ' + \
7466
               'ComplianceLevel:' + str(self.ComplianceLevel) + ', ' + \
7467
               'UnsupportedUnitIds:' + str(self.UnsupportedUnitIds) + ')'
7468
7469 1
    __repr__ = __str__
7470
7471
7472 1
class SoftwareCertificate(FrozenClass):
7473
    '''
7474
    :ivar ProductName:
7475
    :vartype ProductName: String
7476
    :ivar ProductUri:
7477
    :vartype ProductUri: String
7478
    :ivar VendorName:
7479
    :vartype VendorName: String
7480
    :ivar VendorProductCertificate:
7481
    :vartype VendorProductCertificate: ByteString
7482
    :ivar SoftwareVersion:
7483
    :vartype SoftwareVersion: String
7484
    :ivar BuildNumber:
7485
    :vartype BuildNumber: String
7486
    :ivar BuildDate:
7487
    :vartype BuildDate: DateTime
7488
    :ivar IssuedBy:
7489
    :vartype IssuedBy: String
7490
    :ivar IssueDate:
7491
    :vartype IssueDate: DateTime
7492
    :ivar SupportedProfiles:
7493
    :vartype SupportedProfiles: SupportedProfile
7494
    '''
7495
7496 1
    ua_types = {
7497
        'ProductName': 'String',
7498
        'ProductUri': 'String',
7499
        'VendorName': 'String',
7500
        'VendorProductCertificate': 'ByteString',
7501
        'SoftwareVersion': 'String',
7502
        'BuildNumber': 'String',
7503
        'BuildDate': 'DateTime',
7504
        'IssuedBy': 'String',
7505
        'IssueDate': 'DateTime',
7506
        'SupportedProfiles': 'SupportedProfile',
7507
               }
7508
7509 1
    def __init__(self, binary=None):
7510
        if binary is not None:
7511
            self._binary_init(binary)
7512
            self._freeze = True
7513
            return
7514
        self.ProductName = None
7515
        self.ProductUri = None
7516
        self.VendorName = None
7517
        self.VendorProductCertificate = None
7518
        self.SoftwareVersion = None
7519
        self.BuildNumber = None
7520
        self.BuildDate = datetime.now()
7521
        self.IssuedBy = None
7522
        self.IssueDate = datetime.now()
7523
        self.SupportedProfiles = []
7524
        self._freeze = True
7525
7526 1
    def to_binary(self):
7527
        packet = []
7528
        packet.append(uabin.Primitives.String.pack(self.ProductName))
7529
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
7530
        packet.append(uabin.Primitives.String.pack(self.VendorName))
7531
        packet.append(uabin.Primitives.ByteString.pack(self.VendorProductCertificate))
7532
        packet.append(uabin.Primitives.String.pack(self.SoftwareVersion))
7533
        packet.append(uabin.Primitives.String.pack(self.BuildNumber))
7534
        packet.append(uabin.Primitives.DateTime.pack(self.BuildDate))
7535
        packet.append(uabin.Primitives.String.pack(self.IssuedBy))
7536
        packet.append(uabin.Primitives.DateTime.pack(self.IssueDate))
7537
        packet.append(uabin.Primitives.Int32.pack(len(self.SupportedProfiles)))
7538
        for fieldname in self.SupportedProfiles:
7539
            packet.append(fieldname.to_binary())
7540
        return b''.join(packet)
7541
7542 1
    @staticmethod
7543
    def from_binary(data):
7544
        return SoftwareCertificate(data)
7545
7546 1
    def _binary_init(self, data):
7547
        self.ProductName = uabin.Primitives.String.unpack(data)
7548
        self.ProductUri = uabin.Primitives.String.unpack(data)
7549
        self.VendorName = uabin.Primitives.String.unpack(data)
7550
        self.VendorProductCertificate = uabin.Primitives.ByteString.unpack(data)
7551
        self.SoftwareVersion = uabin.Primitives.String.unpack(data)
7552
        self.BuildNumber = uabin.Primitives.String.unpack(data)
7553
        self.BuildDate = uabin.Primitives.DateTime.unpack(data)
7554
        self.IssuedBy = uabin.Primitives.String.unpack(data)
7555
        self.IssueDate = uabin.Primitives.DateTime.unpack(data)
7556
        length = uabin.Primitives.Int32.unpack(data)
7557
        array = []
7558
        if length != -1:
7559
            for _ in range(0, length):
7560
                array.append(SupportedProfile.from_binary(data))
7561
        self.SupportedProfiles = array
7562
7563 1
    def __str__(self):
7564
        return 'SoftwareCertificate(' + 'ProductName:' + str(self.ProductName) + ', ' + \
7565
               'ProductUri:' + str(self.ProductUri) + ', ' + \
7566
               'VendorName:' + str(self.VendorName) + ', ' + \
7567
               'VendorProductCertificate:' + str(self.VendorProductCertificate) + ', ' + \
7568
               'SoftwareVersion:' + str(self.SoftwareVersion) + ', ' + \
7569
               'BuildNumber:' + str(self.BuildNumber) + ', ' + \
7570
               'BuildDate:' + str(self.BuildDate) + ', ' + \
7571
               'IssuedBy:' + str(self.IssuedBy) + ', ' + \
7572
               'IssueDate:' + str(self.IssueDate) + ', ' + \
7573
               'SupportedProfiles:' + str(self.SupportedProfiles) + ')'
7574
7575 1
    __repr__ = __str__
7576
7577
7578 1 View Code Duplication
class QueryDataDescription(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7579
    '''
7580
    :ivar RelativePath:
7581
    :vartype RelativePath: RelativePath
7582
    :ivar AttributeId:
7583
    :vartype AttributeId: UInt32
7584
    :ivar IndexRange:
7585
    :vartype IndexRange: String
7586
    '''
7587
7588 1
    ua_types = {
7589
        'RelativePath': 'RelativePath',
7590
        'AttributeId': 'UInt32',
7591
        'IndexRange': 'String',
7592
               }
7593
7594 1
    def __init__(self, binary=None):
7595
        if binary is not None:
7596
            self._binary_init(binary)
7597
            self._freeze = True
7598
            return
7599
        self.RelativePath = RelativePath()
7600
        self.AttributeId = 0
7601
        self.IndexRange = None
7602
        self._freeze = True
7603
7604 1
    def to_binary(self):
7605
        packet = []
7606
        packet.append(self.RelativePath.to_binary())
7607
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
7608
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
7609
        return b''.join(packet)
7610
7611 1
    @staticmethod
7612
    def from_binary(data):
7613
        return QueryDataDescription(data)
7614
7615 1
    def _binary_init(self, data):
7616
        self.RelativePath = RelativePath.from_binary(data)
7617
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
7618
        self.IndexRange = uabin.Primitives.String.unpack(data)
7619
7620 1
    def __str__(self):
7621
        return 'QueryDataDescription(' + 'RelativePath:' + str(self.RelativePath) + ', ' + \
7622
               'AttributeId:' + str(self.AttributeId) + ', ' + \
7623
               'IndexRange:' + str(self.IndexRange) + ')'
7624
7625 1
    __repr__ = __str__
7626
7627
7628 1 View Code Duplication
class NodeTypeDescription(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7629
    '''
7630
    :ivar TypeDefinitionNode:
7631
    :vartype TypeDefinitionNode: ExpandedNodeId
7632
    :ivar IncludeSubTypes:
7633
    :vartype IncludeSubTypes: Boolean
7634
    :ivar DataToReturn:
7635
    :vartype DataToReturn: QueryDataDescription
7636
    '''
7637
7638 1
    ua_types = {
7639
        'TypeDefinitionNode': 'ExpandedNodeId',
7640
        'IncludeSubTypes': 'Boolean',
7641
        'DataToReturn': 'QueryDataDescription',
7642
               }
7643
7644 1
    def __init__(self, binary=None):
7645
        if binary is not None:
7646
            self._binary_init(binary)
7647
            self._freeze = True
7648
            return
7649
        self.TypeDefinitionNode = ExpandedNodeId()
7650
        self.IncludeSubTypes = True
7651
        self.DataToReturn = []
7652
        self._freeze = True
7653
7654 1
    def to_binary(self):
7655
        packet = []
7656
        packet.append(self.TypeDefinitionNode.to_binary())
7657
        packet.append(uabin.Primitives.Boolean.pack(self.IncludeSubTypes))
7658
        packet.append(uabin.Primitives.Int32.pack(len(self.DataToReturn)))
7659
        for fieldname in self.DataToReturn:
7660
            packet.append(fieldname.to_binary())
7661
        return b''.join(packet)
7662
7663 1
    @staticmethod
7664
    def from_binary(data):
7665
        return NodeTypeDescription(data)
7666
7667 1
    def _binary_init(self, data):
7668
        self.TypeDefinitionNode = ExpandedNodeId.from_binary(data)
7669
        self.IncludeSubTypes = uabin.Primitives.Boolean.unpack(data)
7670
        length = uabin.Primitives.Int32.unpack(data)
7671
        array = []
7672
        if length != -1:
7673
            for _ in range(0, length):
7674
                array.append(QueryDataDescription.from_binary(data))
7675
        self.DataToReturn = array
7676
7677 1
    def __str__(self):
7678
        return 'NodeTypeDescription(' + 'TypeDefinitionNode:' + str(self.TypeDefinitionNode) + ', ' + \
7679
               'IncludeSubTypes:' + str(self.IncludeSubTypes) + ', ' + \
7680
               'DataToReturn:' + str(self.DataToReturn) + ')'
7681
7682 1
    __repr__ = __str__
7683
7684
7685 1 View Code Duplication
class QueryDataSet(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7686
    '''
7687
    :ivar NodeId:
7688
    :vartype NodeId: ExpandedNodeId
7689
    :ivar TypeDefinitionNode:
7690
    :vartype TypeDefinitionNode: ExpandedNodeId
7691
    :ivar Values:
7692
    :vartype Values: Variant
7693
    '''
7694
7695 1
    ua_types = {
7696
        'NodeId': 'ExpandedNodeId',
7697
        'TypeDefinitionNode': 'ExpandedNodeId',
7698
        'Values': 'Variant',
7699
               }
7700
7701 1
    def __init__(self, binary=None):
7702
        if binary is not None:
7703
            self._binary_init(binary)
7704
            self._freeze = True
7705
            return
7706
        self.NodeId = ExpandedNodeId()
7707
        self.TypeDefinitionNode = ExpandedNodeId()
7708
        self.Values = []
7709
        self._freeze = True
7710
7711 1
    def to_binary(self):
7712
        packet = []
7713
        packet.append(self.NodeId.to_binary())
7714
        packet.append(self.TypeDefinitionNode.to_binary())
7715
        packet.append(uabin.Primitives.Int32.pack(len(self.Values)))
7716
        for fieldname in self.Values:
7717
            packet.append(fieldname.to_binary())
7718
        return b''.join(packet)
7719
7720 1
    @staticmethod
7721
    def from_binary(data):
7722
        return QueryDataSet(data)
7723
7724 1
    def _binary_init(self, data):
7725
        self.NodeId = ExpandedNodeId.from_binary(data)
7726
        self.TypeDefinitionNode = ExpandedNodeId.from_binary(data)
7727
        length = uabin.Primitives.Int32.unpack(data)
7728
        array = []
7729
        if length != -1:
7730
            for _ in range(0, length):
7731
                array.append(Variant.from_binary(data))
7732
        self.Values = array
7733
7734 1
    def __str__(self):
7735
        return 'QueryDataSet(' + 'NodeId:' + str(self.NodeId) + ', ' + \
7736
               'TypeDefinitionNode:' + str(self.TypeDefinitionNode) + ', ' + \
7737
               'Values:' + str(self.Values) + ')'
7738
7739 1
    __repr__ = __str__
7740
7741
7742 1 View Code Duplication
class NodeReference(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7743
    '''
7744
    :ivar NodeId:
7745
    :vartype NodeId: NodeId
7746
    :ivar ReferenceTypeId:
7747
    :vartype ReferenceTypeId: NodeId
7748
    :ivar IsForward:
7749
    :vartype IsForward: Boolean
7750
    :ivar ReferencedNodeIds:
7751
    :vartype ReferencedNodeIds: NodeId
7752
    '''
7753
7754 1
    ua_types = {
7755
        'NodeId': 'NodeId',
7756
        'ReferenceTypeId': 'NodeId',
7757
        'IsForward': 'Boolean',
7758
        'ReferencedNodeIds': 'NodeId',
7759
               }
7760
7761 1
    def __init__(self, binary=None):
7762
        if binary is not None:
7763
            self._binary_init(binary)
7764
            self._freeze = True
7765
            return
7766
        self.NodeId = NodeId()
7767
        self.ReferenceTypeId = NodeId()
7768
        self.IsForward = True
7769
        self.ReferencedNodeIds = []
7770
        self._freeze = True
7771
7772 1
    def to_binary(self):
7773
        packet = []
7774
        packet.append(self.NodeId.to_binary())
7775
        packet.append(self.ReferenceTypeId.to_binary())
7776
        packet.append(uabin.Primitives.Boolean.pack(self.IsForward))
7777
        packet.append(uabin.Primitives.Int32.pack(len(self.ReferencedNodeIds)))
7778
        for fieldname in self.ReferencedNodeIds:
7779
            packet.append(fieldname.to_binary())
7780
        return b''.join(packet)
7781
7782 1
    @staticmethod
7783
    def from_binary(data):
7784
        return NodeReference(data)
7785
7786 1
    def _binary_init(self, data):
7787
        self.NodeId = NodeId.from_binary(data)
7788
        self.ReferenceTypeId = NodeId.from_binary(data)
7789
        self.IsForward = uabin.Primitives.Boolean.unpack(data)
7790
        length = uabin.Primitives.Int32.unpack(data)
7791
        array = []
7792
        if length != -1:
7793
            for _ in range(0, length):
7794
                array.append(NodeId.from_binary(data))
7795
        self.ReferencedNodeIds = array
7796
7797 1
    def __str__(self):
7798
        return 'NodeReference(' + 'NodeId:' + str(self.NodeId) + ', ' + \
7799
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
7800
               'IsForward:' + str(self.IsForward) + ', ' + \
7801
               'ReferencedNodeIds:' + str(self.ReferencedNodeIds) + ')'
7802
7803 1
    __repr__ = __str__
7804
7805
7806 1 View Code Duplication
class ContentFilterElement(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7807
    '''
7808
    :ivar FilterOperator:
7809
    :vartype FilterOperator: FilterOperator
7810
    :ivar FilterOperands:
7811
    :vartype FilterOperands: ExtensionObject
7812
    '''
7813
7814 1
    ua_types = {
7815
        'FilterOperator': 'FilterOperator',
7816
        'FilterOperands': 'ExtensionObject',
7817
               }
7818
7819 1
    def __init__(self, binary=None):
7820 1
        if binary is not None:
7821 1
            self._binary_init(binary)
7822 1
            self._freeze = True
7823 1
            return
7824 1
        self.FilterOperator = FilterOperator(0)
7825 1
        self.FilterOperands = []
7826 1
        self._freeze = True
7827
7828 1
    def to_binary(self):
7829 1
        packet = []
7830 1
        packet.append(uabin.Primitives.UInt32.pack(self.FilterOperator.value))
7831 1
        packet.append(uabin.Primitives.Int32.pack(len(self.FilterOperands)))
7832 1
        for fieldname in self.FilterOperands:
7833 1
            packet.append(extensionobject_to_binary(fieldname))
7834 1
        return b''.join(packet)
7835
7836 1
    @staticmethod
7837
    def from_binary(data):
7838 1
        return ContentFilterElement(data)
7839
7840 1
    def _binary_init(self, data):
7841 1
        self.FilterOperator = FilterOperator(uabin.Primitives.UInt32.unpack(data))
7842 1
        length = uabin.Primitives.Int32.unpack(data)
7843 1
        array = []
7844 1
        if length != -1:
7845 1
            for _ in range(0, length):
7846 1
                array.append(extensionobject_from_binary(data))
7847 1
        self.FilterOperands = array
7848
7849 1
    def __str__(self):
7850
        return 'ContentFilterElement(' + 'FilterOperator:' + str(self.FilterOperator) + ', ' + \
7851
               'FilterOperands:' + str(self.FilterOperands) + ')'
7852
7853 1
    __repr__ = __str__
7854
7855
7856 1
class ContentFilter(FrozenClass):
7857
    '''
7858
    :ivar Elements:
7859
    :vartype Elements: ContentFilterElement
7860
    '''
7861
7862 1
    ua_types = {
7863
        'Elements': 'ContentFilterElement',
7864
               }
7865
7866 1
    def __init__(self, binary=None):
7867 1
        if binary is not None:
7868 1
            self._binary_init(binary)
7869 1
            self._freeze = True
7870 1
            return
7871 1
        self.Elements = []
7872 1
        self._freeze = True
7873
7874 1
    def to_binary(self):
7875 1
        packet = []
7876 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Elements)))
7877 1
        for fieldname in self.Elements:
7878 1
            packet.append(fieldname.to_binary())
7879 1
        return b''.join(packet)
7880
7881 1
    @staticmethod
7882
    def from_binary(data):
7883 1
        return ContentFilter(data)
7884
7885 1
    def _binary_init(self, data):
7886 1
        length = uabin.Primitives.Int32.unpack(data)
7887 1
        array = []
7888 1
        if length != -1:
7889 1
            for _ in range(0, length):
7890 1
                array.append(ContentFilterElement.from_binary(data))
7891 1
        self.Elements = array
7892
7893 1
    def __str__(self):
7894
        return 'ContentFilter(' + 'Elements:' + str(self.Elements) + ')'
7895
7896 1
    __repr__ = __str__
7897
7898
7899 1
class ElementOperand(FrozenClass):
7900
    '''
7901
    :ivar Index:
7902
    :vartype Index: UInt32
7903
    '''
7904
7905 1
    ua_types = {
7906
        'Index': 'UInt32',
7907
               }
7908
7909 1
    def __init__(self, binary=None):
7910
        if binary is not None:
7911
            self._binary_init(binary)
7912
            self._freeze = True
7913
            return
7914
        self.Index = 0
7915
        self._freeze = True
7916
7917 1
    def to_binary(self):
7918
        packet = []
7919
        packet.append(uabin.Primitives.UInt32.pack(self.Index))
7920
        return b''.join(packet)
7921
7922 1
    @staticmethod
7923
    def from_binary(data):
7924
        return ElementOperand(data)
7925
7926 1
    def _binary_init(self, data):
7927
        self.Index = uabin.Primitives.UInt32.unpack(data)
7928
7929 1
    def __str__(self):
7930
        return 'ElementOperand(' + 'Index:' + str(self.Index) + ')'
7931
7932 1
    __repr__ = __str__
7933
7934
7935 1 View Code Duplication
class LiteralOperand(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7936
    '''
7937
    :ivar Value:
7938
    :vartype Value: Variant
7939
    '''
7940
7941 1
    ua_types = {
7942
        'Value': 'Variant',
7943
               }
7944
7945 1
    def __init__(self, binary=None):
7946 1
        if binary is not None:
7947 1
            self._binary_init(binary)
7948 1
            self._freeze = True
7949 1
            return
7950 1
        self.Value = Variant()
7951 1
        self._freeze = True
7952
7953 1
    def to_binary(self):
7954 1
        packet = []
7955 1
        packet.append(self.Value.to_binary())
7956 1
        return b''.join(packet)
7957
7958 1
    @staticmethod
7959
    def from_binary(data):
7960 1
        return LiteralOperand(data)
7961
7962 1
    def _binary_init(self, data):
7963 1
        self.Value = Variant.from_binary(data)
7964
7965 1
    def __str__(self):
7966
        return 'LiteralOperand(' + 'Value:' + str(self.Value) + ')'
7967
7968 1
    __repr__ = __str__
7969
7970
7971 1
class AttributeOperand(FrozenClass):
7972
    '''
7973
    :ivar NodeId:
7974
    :vartype NodeId: NodeId
7975
    :ivar Alias:
7976
    :vartype Alias: String
7977
    :ivar BrowsePath:
7978
    :vartype BrowsePath: RelativePath
7979
    :ivar AttributeId:
7980
    :vartype AttributeId: UInt32
7981
    :ivar IndexRange:
7982
    :vartype IndexRange: String
7983
    '''
7984
7985 1
    ua_types = {
7986
        'NodeId': 'NodeId',
7987
        'Alias': 'String',
7988
        'BrowsePath': 'RelativePath',
7989
        'AttributeId': 'UInt32',
7990
        'IndexRange': 'String',
7991
               }
7992
7993 1
    def __init__(self, binary=None):
7994
        if binary is not None:
7995
            self._binary_init(binary)
7996
            self._freeze = True
7997
            return
7998
        self.NodeId = NodeId()
7999
        self.Alias = None
8000
        self.BrowsePath = RelativePath()
8001
        self.AttributeId = 0
8002
        self.IndexRange = None
8003
        self._freeze = True
8004
8005 1
    def to_binary(self):
8006
        packet = []
8007
        packet.append(self.NodeId.to_binary())
8008
        packet.append(uabin.Primitives.String.pack(self.Alias))
8009
        packet.append(self.BrowsePath.to_binary())
8010
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
8011
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
8012
        return b''.join(packet)
8013
8014 1
    @staticmethod
8015
    def from_binary(data):
8016
        return AttributeOperand(data)
8017
8018 1
    def _binary_init(self, data):
8019
        self.NodeId = NodeId.from_binary(data)
8020
        self.Alias = uabin.Primitives.String.unpack(data)
8021
        self.BrowsePath = RelativePath.from_binary(data)
8022
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
8023
        self.IndexRange = uabin.Primitives.String.unpack(data)
8024
8025 1
    def __str__(self):
8026
        return 'AttributeOperand(' + 'NodeId:' + str(self.NodeId) + ', ' + \
8027
               'Alias:' + str(self.Alias) + ', ' + \
8028
               'BrowsePath:' + str(self.BrowsePath) + ', ' + \
8029
               'AttributeId:' + str(self.AttributeId) + ', ' + \
8030
               'IndexRange:' + str(self.IndexRange) + ')'
8031
8032 1
    __repr__ = __str__
8033
8034
8035 1 View Code Duplication
class SimpleAttributeOperand(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8036
    '''
8037
    :ivar TypeDefinitionId:
8038
    :vartype TypeDefinitionId: NodeId
8039
    :ivar BrowsePath:
8040
    :vartype BrowsePath: QualifiedName
8041
    :ivar AttributeId:
8042
    :vartype AttributeId: UInt32
8043
    :ivar IndexRange:
8044
    :vartype IndexRange: String
8045
    '''
8046
8047 1
    ua_types = {
8048
        'TypeDefinitionId': 'NodeId',
8049
        'BrowsePath': 'QualifiedName',
8050
        'AttributeId': 'UInt32',
8051
        'IndexRange': 'String',
8052
               }
8053
8054 1
    def __init__(self, binary=None):
8055 1
        if binary is not None:
8056 1
            self._binary_init(binary)
8057 1
            self._freeze = True
8058 1
            return
8059 1
        self.TypeDefinitionId = NodeId()
8060 1
        self.BrowsePath = []
8061 1
        self.AttributeId = 0
8062 1
        self.IndexRange = None
8063 1
        self._freeze = True
8064
8065 1
    def to_binary(self):
8066 1
        packet = []
8067 1
        packet.append(self.TypeDefinitionId.to_binary())
8068 1
        packet.append(uabin.Primitives.Int32.pack(len(self.BrowsePath)))
8069 1
        for fieldname in self.BrowsePath:
8070 1
            packet.append(fieldname.to_binary())
8071 1
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
8072 1
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
8073 1
        return b''.join(packet)
8074
8075 1
    @staticmethod
8076
    def from_binary(data):
8077 1
        return SimpleAttributeOperand(data)
8078
8079 1
    def _binary_init(self, data):
8080 1
        self.TypeDefinitionId = NodeId.from_binary(data)
8081 1
        length = uabin.Primitives.Int32.unpack(data)
8082 1
        array = []
8083 1
        if length != -1:
8084 1
            for _ in range(0, length):
8085 1
                array.append(QualifiedName.from_binary(data))
8086 1
        self.BrowsePath = array
8087 1
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
8088 1
        self.IndexRange = uabin.Primitives.String.unpack(data)
8089
8090 1
    def __str__(self):
8091
        return 'SimpleAttributeOperand(' + 'TypeDefinitionId:' + str(self.TypeDefinitionId) + ', ' + \
8092
               'BrowsePath:' + str(self.BrowsePath) + ', ' + \
8093
               'AttributeId:' + str(self.AttributeId) + ', ' + \
8094
               'IndexRange:' + str(self.IndexRange) + ')'
8095
8096 1
    __repr__ = __str__
8097
8098
8099 1 View Code Duplication
class ContentFilterElementResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8100
    '''
8101
    :ivar StatusCode:
8102
    :vartype StatusCode: StatusCode
8103
    :ivar OperandStatusCodes:
8104
    :vartype OperandStatusCodes: StatusCode
8105
    :ivar OperandDiagnosticInfos:
8106
    :vartype OperandDiagnosticInfos: DiagnosticInfo
8107
    '''
8108
8109 1
    ua_types = {
8110
        'StatusCode': 'StatusCode',
8111
        'OperandStatusCodes': 'StatusCode',
8112
        'OperandDiagnosticInfos': 'DiagnosticInfo',
8113
               }
8114
8115 1
    def __init__(self, binary=None):
8116
        if binary is not None:
8117
            self._binary_init(binary)
8118
            self._freeze = True
8119
            return
8120
        self.StatusCode = StatusCode()
8121
        self.OperandStatusCodes = []
8122
        self.OperandDiagnosticInfos = []
8123
        self._freeze = True
8124
8125 1
    def to_binary(self):
8126
        packet = []
8127
        packet.append(self.StatusCode.to_binary())
8128
        packet.append(uabin.Primitives.Int32.pack(len(self.OperandStatusCodes)))
8129
        for fieldname in self.OperandStatusCodes:
8130
            packet.append(fieldname.to_binary())
8131
        packet.append(uabin.Primitives.Int32.pack(len(self.OperandDiagnosticInfos)))
8132
        for fieldname in self.OperandDiagnosticInfos:
8133
            packet.append(fieldname.to_binary())
8134
        return b''.join(packet)
8135
8136 1
    @staticmethod
8137
    def from_binary(data):
8138
        return ContentFilterElementResult(data)
8139
8140 1
    def _binary_init(self, data):
8141
        self.StatusCode = StatusCode.from_binary(data)
8142
        length = uabin.Primitives.Int32.unpack(data)
8143
        array = []
8144
        if length != -1:
8145
            for _ in range(0, length):
8146
                array.append(StatusCode.from_binary(data))
8147
        self.OperandStatusCodes = array
8148
        length = uabin.Primitives.Int32.unpack(data)
8149
        array = []
8150
        if length != -1:
8151
            for _ in range(0, length):
8152
                array.append(DiagnosticInfo.from_binary(data))
8153
        self.OperandDiagnosticInfos = array
8154
8155 1
    def __str__(self):
8156
        return 'ContentFilterElementResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
8157
               'OperandStatusCodes:' + str(self.OperandStatusCodes) + ', ' + \
8158
               'OperandDiagnosticInfos:' + str(self.OperandDiagnosticInfos) + ')'
8159
8160 1
    __repr__ = __str__
8161
8162
8163 1 View Code Duplication
class ContentFilterResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8164
    '''
8165
    :ivar ElementResults:
8166
    :vartype ElementResults: ContentFilterElementResult
8167
    :ivar ElementDiagnosticInfos:
8168
    :vartype ElementDiagnosticInfos: DiagnosticInfo
8169
    '''
8170
8171 1
    ua_types = {
8172
        'ElementResults': 'ContentFilterElementResult',
8173
        'ElementDiagnosticInfos': 'DiagnosticInfo',
8174
               }
8175
8176 1
    def __init__(self, binary=None):
8177
        if binary is not None:
8178
            self._binary_init(binary)
8179
            self._freeze = True
8180
            return
8181
        self.ElementResults = []
8182
        self.ElementDiagnosticInfos = []
8183
        self._freeze = True
8184
8185 1
    def to_binary(self):
8186
        packet = []
8187
        packet.append(uabin.Primitives.Int32.pack(len(self.ElementResults)))
8188
        for fieldname in self.ElementResults:
8189
            packet.append(fieldname.to_binary())
8190
        packet.append(uabin.Primitives.Int32.pack(len(self.ElementDiagnosticInfos)))
8191
        for fieldname in self.ElementDiagnosticInfos:
8192
            packet.append(fieldname.to_binary())
8193
        return b''.join(packet)
8194
8195 1
    @staticmethod
8196
    def from_binary(data):
8197
        return ContentFilterResult(data)
8198
8199 1
    def _binary_init(self, data):
8200
        length = uabin.Primitives.Int32.unpack(data)
8201
        array = []
8202
        if length != -1:
8203
            for _ in range(0, length):
8204
                array.append(ContentFilterElementResult.from_binary(data))
8205
        self.ElementResults = array
8206
        length = uabin.Primitives.Int32.unpack(data)
8207
        array = []
8208
        if length != -1:
8209
            for _ in range(0, length):
8210
                array.append(DiagnosticInfo.from_binary(data))
8211
        self.ElementDiagnosticInfos = array
8212
8213 1
    def __str__(self):
8214
        return 'ContentFilterResult(' + 'ElementResults:' + str(self.ElementResults) + ', ' + \
8215
               'ElementDiagnosticInfos:' + str(self.ElementDiagnosticInfos) + ')'
8216
8217 1
    __repr__ = __str__
8218
8219
8220 1 View Code Duplication
class ParsingResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8221
    '''
8222
    :ivar StatusCode:
8223
    :vartype StatusCode: StatusCode
8224
    :ivar DataStatusCodes:
8225
    :vartype DataStatusCodes: StatusCode
8226
    :ivar DataDiagnosticInfos:
8227
    :vartype DataDiagnosticInfos: DiagnosticInfo
8228
    '''
8229
8230 1
    ua_types = {
8231
        'StatusCode': 'StatusCode',
8232
        'DataStatusCodes': 'StatusCode',
8233
        'DataDiagnosticInfos': 'DiagnosticInfo',
8234
               }
8235
8236 1
    def __init__(self, binary=None):
8237
        if binary is not None:
8238
            self._binary_init(binary)
8239
            self._freeze = True
8240
            return
8241
        self.StatusCode = StatusCode()
8242
        self.DataStatusCodes = []
8243
        self.DataDiagnosticInfos = []
8244
        self._freeze = True
8245
8246 1
    def to_binary(self):
8247
        packet = []
8248
        packet.append(self.StatusCode.to_binary())
8249
        packet.append(uabin.Primitives.Int32.pack(len(self.DataStatusCodes)))
8250
        for fieldname in self.DataStatusCodes:
8251
            packet.append(fieldname.to_binary())
8252
        packet.append(uabin.Primitives.Int32.pack(len(self.DataDiagnosticInfos)))
8253
        for fieldname in self.DataDiagnosticInfos:
8254
            packet.append(fieldname.to_binary())
8255
        return b''.join(packet)
8256
8257 1
    @staticmethod
8258
    def from_binary(data):
8259
        return ParsingResult(data)
8260
8261 1
    def _binary_init(self, data):
8262
        self.StatusCode = StatusCode.from_binary(data)
8263
        length = uabin.Primitives.Int32.unpack(data)
8264
        array = []
8265
        if length != -1:
8266
            for _ in range(0, length):
8267
                array.append(StatusCode.from_binary(data))
8268
        self.DataStatusCodes = array
8269
        length = uabin.Primitives.Int32.unpack(data)
8270
        array = []
8271
        if length != -1:
8272
            for _ in range(0, length):
8273
                array.append(DiagnosticInfo.from_binary(data))
8274
        self.DataDiagnosticInfos = array
8275
8276 1
    def __str__(self):
8277
        return 'ParsingResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
8278
               'DataStatusCodes:' + str(self.DataStatusCodes) + ', ' + \
8279
               'DataDiagnosticInfos:' + str(self.DataDiagnosticInfos) + ')'
8280
8281 1
    __repr__ = __str__
8282
8283
8284 1 View Code Duplication
class QueryFirstParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8285
    '''
8286
    :ivar View:
8287
    :vartype View: ViewDescription
8288
    :ivar NodeTypes:
8289
    :vartype NodeTypes: NodeTypeDescription
8290
    :ivar Filter:
8291
    :vartype Filter: ContentFilter
8292
    :ivar MaxDataSetsToReturn:
8293
    :vartype MaxDataSetsToReturn: UInt32
8294
    :ivar MaxReferencesToReturn:
8295
    :vartype MaxReferencesToReturn: UInt32
8296
    '''
8297
8298 1
    ua_types = {
8299
        'View': 'ViewDescription',
8300
        'NodeTypes': 'NodeTypeDescription',
8301
        'Filter': 'ContentFilter',
8302
        'MaxDataSetsToReturn': 'UInt32',
8303
        'MaxReferencesToReturn': 'UInt32',
8304
               }
8305
8306 1
    def __init__(self, binary=None):
8307
        if binary is not None:
8308
            self._binary_init(binary)
8309
            self._freeze = True
8310
            return
8311
        self.View = ViewDescription()
8312
        self.NodeTypes = []
8313
        self.Filter = ContentFilter()
8314
        self.MaxDataSetsToReturn = 0
8315
        self.MaxReferencesToReturn = 0
8316
        self._freeze = True
8317
8318 1
    def to_binary(self):
8319
        packet = []
8320
        packet.append(self.View.to_binary())
8321
        packet.append(uabin.Primitives.Int32.pack(len(self.NodeTypes)))
8322
        for fieldname in self.NodeTypes:
8323
            packet.append(fieldname.to_binary())
8324
        packet.append(self.Filter.to_binary())
8325
        packet.append(uabin.Primitives.UInt32.pack(self.MaxDataSetsToReturn))
8326
        packet.append(uabin.Primitives.UInt32.pack(self.MaxReferencesToReturn))
8327
        return b''.join(packet)
8328
8329 1
    @staticmethod
8330
    def from_binary(data):
8331
        return QueryFirstParameters(data)
8332
8333 1
    def _binary_init(self, data):
8334
        self.View = ViewDescription.from_binary(data)
8335
        length = uabin.Primitives.Int32.unpack(data)
8336
        array = []
8337
        if length != -1:
8338
            for _ in range(0, length):
8339
                array.append(NodeTypeDescription.from_binary(data))
8340
        self.NodeTypes = array
8341
        self.Filter = ContentFilter.from_binary(data)
8342
        self.MaxDataSetsToReturn = uabin.Primitives.UInt32.unpack(data)
8343
        self.MaxReferencesToReturn = uabin.Primitives.UInt32.unpack(data)
8344
8345 1
    def __str__(self):
8346
        return 'QueryFirstParameters(' + 'View:' + str(self.View) + ', ' + \
8347
               'NodeTypes:' + str(self.NodeTypes) + ', ' + \
8348
               'Filter:' + str(self.Filter) + ', ' + \
8349
               'MaxDataSetsToReturn:' + str(self.MaxDataSetsToReturn) + ', ' + \
8350
               'MaxReferencesToReturn:' + str(self.MaxReferencesToReturn) + ')'
8351
8352 1
    __repr__ = __str__
8353
8354
8355 1
class QueryFirstRequest(FrozenClass):
8356
    '''
8357
    :ivar TypeId:
8358
    :vartype TypeId: NodeId
8359
    :ivar RequestHeader:
8360
    :vartype RequestHeader: RequestHeader
8361
    :ivar Parameters:
8362
    :vartype Parameters: QueryFirstParameters
8363
    '''
8364
8365 1
    ua_types = {
8366
        'TypeId': 'NodeId',
8367
        'RequestHeader': 'RequestHeader',
8368
        'Parameters': 'QueryFirstParameters',
8369
               }
8370
8371 1
    def __init__(self, binary=None):
8372
        if binary is not None:
8373
            self._binary_init(binary)
8374
            self._freeze = True
8375
            return
8376
        self.TypeId = FourByteNodeId(ObjectIds.QueryFirstRequest_Encoding_DefaultBinary)
8377
        self.RequestHeader = RequestHeader()
8378
        self.Parameters = QueryFirstParameters()
8379
        self._freeze = True
8380
8381 1
    def to_binary(self):
8382
        packet = []
8383
        packet.append(self.TypeId.to_binary())
8384
        packet.append(self.RequestHeader.to_binary())
8385
        packet.append(self.Parameters.to_binary())
8386
        return b''.join(packet)
8387
8388 1
    @staticmethod
8389
    def from_binary(data):
8390
        return QueryFirstRequest(data)
8391
8392 1
    def _binary_init(self, data):
8393
        self.TypeId = NodeId.from_binary(data)
8394
        self.RequestHeader = RequestHeader.from_binary(data)
8395
        self.Parameters = QueryFirstParameters.from_binary(data)
8396
8397 1
    def __str__(self):
8398
        return 'QueryFirstRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8399
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
8400
               'Parameters:' + str(self.Parameters) + ')'
8401
8402 1
    __repr__ = __str__
8403
8404
8405 1
class QueryFirstResult(FrozenClass):
8406
    '''
8407
    :ivar QueryDataSets:
8408
    :vartype QueryDataSets: QueryDataSet
8409
    :ivar ContinuationPoint:
8410
    :vartype ContinuationPoint: ByteString
8411
    :ivar ParsingResults:
8412
    :vartype ParsingResults: ParsingResult
8413
    :ivar DiagnosticInfos:
8414
    :vartype DiagnosticInfos: DiagnosticInfo
8415
    :ivar FilterResult:
8416
    :vartype FilterResult: ContentFilterResult
8417
    '''
8418
8419 1
    ua_types = {
8420
        'QueryDataSets': 'QueryDataSet',
8421
        'ContinuationPoint': 'ByteString',
8422
        'ParsingResults': 'ParsingResult',
8423
        'DiagnosticInfos': 'DiagnosticInfo',
8424
        'FilterResult': 'ContentFilterResult',
8425
               }
8426
8427 1
    def __init__(self, binary=None):
8428
        if binary is not None:
8429
            self._binary_init(binary)
8430
            self._freeze = True
8431
            return
8432
        self.QueryDataSets = []
8433
        self.ContinuationPoint = None
8434
        self.ParsingResults = []
8435
        self.DiagnosticInfos = []
8436
        self.FilterResult = ContentFilterResult()
8437
        self._freeze = True
8438
8439 1 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8440
        packet = []
8441
        packet.append(uabin.Primitives.Int32.pack(len(self.QueryDataSets)))
8442
        for fieldname in self.QueryDataSets:
8443
            packet.append(fieldname.to_binary())
8444
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
8445
        packet.append(uabin.Primitives.Int32.pack(len(self.ParsingResults)))
8446
        for fieldname in self.ParsingResults:
8447
            packet.append(fieldname.to_binary())
8448
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
8449
        for fieldname in self.DiagnosticInfos:
8450
            packet.append(fieldname.to_binary())
8451
        packet.append(self.FilterResult.to_binary())
8452
        return b''.join(packet)
8453
8454 1
    @staticmethod
8455
    def from_binary(data):
8456
        return QueryFirstResult(data)
8457
8458 1
    def _binary_init(self, data):
8459
        length = uabin.Primitives.Int32.unpack(data)
8460
        array = []
8461
        if length != -1:
8462
            for _ in range(0, length):
8463
                array.append(QueryDataSet.from_binary(data))
8464
        self.QueryDataSets = array
8465
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
8466
        length = uabin.Primitives.Int32.unpack(data)
8467
        array = []
8468
        if length != -1:
8469
            for _ in range(0, length):
8470
                array.append(ParsingResult.from_binary(data))
8471
        self.ParsingResults = array
8472
        length = uabin.Primitives.Int32.unpack(data)
8473
        array = []
8474
        if length != -1:
8475
            for _ in range(0, length):
8476
                array.append(DiagnosticInfo.from_binary(data))
8477
        self.DiagnosticInfos = array
8478
        self.FilterResult = ContentFilterResult.from_binary(data)
8479
8480 1
    def __str__(self):
8481
        return 'QueryFirstResult(' + 'QueryDataSets:' + str(self.QueryDataSets) + ', ' + \
8482
               'ContinuationPoint:' + str(self.ContinuationPoint) + ', ' + \
8483
               'ParsingResults:' + str(self.ParsingResults) + ', ' + \
8484
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ', ' + \
8485
               'FilterResult:' + str(self.FilterResult) + ')'
8486
8487 1
    __repr__ = __str__
8488
8489
8490 1
class QueryFirstResponse(FrozenClass):
8491
    '''
8492
    :ivar TypeId:
8493
    :vartype TypeId: NodeId
8494
    :ivar ResponseHeader:
8495
    :vartype ResponseHeader: ResponseHeader
8496
    :ivar Parameters:
8497
    :vartype Parameters: QueryFirstResult
8498
    '''
8499
8500 1
    ua_types = {
8501
        'TypeId': 'NodeId',
8502
        'ResponseHeader': 'ResponseHeader',
8503
        'Parameters': 'QueryFirstResult',
8504
               }
8505
8506 1
    def __init__(self, binary=None):
8507
        if binary is not None:
8508
            self._binary_init(binary)
8509
            self._freeze = True
8510
            return
8511
        self.TypeId = FourByteNodeId(ObjectIds.QueryFirstResponse_Encoding_DefaultBinary)
8512
        self.ResponseHeader = ResponseHeader()
8513
        self.Parameters = QueryFirstResult()
8514
        self._freeze = True
8515
8516 1
    def to_binary(self):
8517
        packet = []
8518
        packet.append(self.TypeId.to_binary())
8519
        packet.append(self.ResponseHeader.to_binary())
8520
        packet.append(self.Parameters.to_binary())
8521
        return b''.join(packet)
8522
8523 1
    @staticmethod
8524
    def from_binary(data):
8525
        return QueryFirstResponse(data)
8526
8527 1
    def _binary_init(self, data):
8528
        self.TypeId = NodeId.from_binary(data)
8529
        self.ResponseHeader = ResponseHeader.from_binary(data)
8530
        self.Parameters = QueryFirstResult.from_binary(data)
8531
8532 1
    def __str__(self):
8533
        return 'QueryFirstResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8534
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
8535
               'Parameters:' + str(self.Parameters) + ')'
8536
8537 1
    __repr__ = __str__
8538
8539
8540 1 View Code Duplication
class QueryNextParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8541
    '''
8542
    :ivar ReleaseContinuationPoint:
8543
    :vartype ReleaseContinuationPoint: Boolean
8544
    :ivar ContinuationPoint:
8545
    :vartype ContinuationPoint: ByteString
8546
    '''
8547
8548 1
    ua_types = {
8549
        'ReleaseContinuationPoint': 'Boolean',
8550
        'ContinuationPoint': 'ByteString',
8551
               }
8552
8553 1
    def __init__(self, binary=None):
8554
        if binary is not None:
8555
            self._binary_init(binary)
8556
            self._freeze = True
8557
            return
8558
        self.ReleaseContinuationPoint = True
8559
        self.ContinuationPoint = None
8560
        self._freeze = True
8561
8562 1
    def to_binary(self):
8563
        packet = []
8564
        packet.append(uabin.Primitives.Boolean.pack(self.ReleaseContinuationPoint))
8565
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
8566
        return b''.join(packet)
8567
8568 1
    @staticmethod
8569
    def from_binary(data):
8570
        return QueryNextParameters(data)
8571
8572 1
    def _binary_init(self, data):
8573
        self.ReleaseContinuationPoint = uabin.Primitives.Boolean.unpack(data)
8574
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
8575
8576 1
    def __str__(self):
8577
        return 'QueryNextParameters(' + 'ReleaseContinuationPoint:' + str(self.ReleaseContinuationPoint) + ', ' + \
8578
               'ContinuationPoint:' + str(self.ContinuationPoint) + ')'
8579
8580 1
    __repr__ = __str__
8581
8582
8583 1
class QueryNextRequest(FrozenClass):
8584
    '''
8585
    :ivar TypeId:
8586
    :vartype TypeId: NodeId
8587
    :ivar RequestHeader:
8588
    :vartype RequestHeader: RequestHeader
8589
    :ivar Parameters:
8590
    :vartype Parameters: QueryNextParameters
8591
    '''
8592
8593 1
    ua_types = {
8594
        'TypeId': 'NodeId',
8595
        'RequestHeader': 'RequestHeader',
8596
        'Parameters': 'QueryNextParameters',
8597
               }
8598
8599 1
    def __init__(self, binary=None):
8600
        if binary is not None:
8601
            self._binary_init(binary)
8602
            self._freeze = True
8603
            return
8604
        self.TypeId = FourByteNodeId(ObjectIds.QueryNextRequest_Encoding_DefaultBinary)
8605
        self.RequestHeader = RequestHeader()
8606
        self.Parameters = QueryNextParameters()
8607
        self._freeze = True
8608
8609 1
    def to_binary(self):
8610
        packet = []
8611
        packet.append(self.TypeId.to_binary())
8612
        packet.append(self.RequestHeader.to_binary())
8613
        packet.append(self.Parameters.to_binary())
8614
        return b''.join(packet)
8615
8616 1
    @staticmethod
8617
    def from_binary(data):
8618
        return QueryNextRequest(data)
8619
8620 1
    def _binary_init(self, data):
8621
        self.TypeId = NodeId.from_binary(data)
8622
        self.RequestHeader = RequestHeader.from_binary(data)
8623
        self.Parameters = QueryNextParameters.from_binary(data)
8624
8625 1
    def __str__(self):
8626
        return 'QueryNextRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8627
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
8628
               'Parameters:' + str(self.Parameters) + ')'
8629
8630 1
    __repr__ = __str__
8631
8632
8633 1 View Code Duplication
class QueryNextResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8634
    '''
8635
    :ivar QueryDataSets:
8636
    :vartype QueryDataSets: QueryDataSet
8637
    :ivar RevisedContinuationPoint:
8638
    :vartype RevisedContinuationPoint: ByteString
8639
    '''
8640
8641 1
    ua_types = {
8642
        'QueryDataSets': 'QueryDataSet',
8643
        'RevisedContinuationPoint': 'ByteString',
8644
               }
8645
8646 1
    def __init__(self, binary=None):
8647
        if binary is not None:
8648
            self._binary_init(binary)
8649
            self._freeze = True
8650
            return
8651
        self.QueryDataSets = []
8652
        self.RevisedContinuationPoint = None
8653
        self._freeze = True
8654
8655 1
    def to_binary(self):
8656
        packet = []
8657
        packet.append(uabin.Primitives.Int32.pack(len(self.QueryDataSets)))
8658
        for fieldname in self.QueryDataSets:
8659
            packet.append(fieldname.to_binary())
8660
        packet.append(uabin.Primitives.ByteString.pack(self.RevisedContinuationPoint))
8661
        return b''.join(packet)
8662
8663 1
    @staticmethod
8664
    def from_binary(data):
8665
        return QueryNextResult(data)
8666
8667 1
    def _binary_init(self, data):
8668
        length = uabin.Primitives.Int32.unpack(data)
8669
        array = []
8670
        if length != -1:
8671
            for _ in range(0, length):
8672
                array.append(QueryDataSet.from_binary(data))
8673
        self.QueryDataSets = array
8674
        self.RevisedContinuationPoint = uabin.Primitives.ByteString.unpack(data)
8675
8676 1
    def __str__(self):
8677
        return 'QueryNextResult(' + 'QueryDataSets:' + str(self.QueryDataSets) + ', ' + \
8678
               'RevisedContinuationPoint:' + str(self.RevisedContinuationPoint) + ')'
8679
8680 1
    __repr__ = __str__
8681
8682
8683 1
class QueryNextResponse(FrozenClass):
8684
    '''
8685
    :ivar TypeId:
8686
    :vartype TypeId: NodeId
8687
    :ivar ResponseHeader:
8688
    :vartype ResponseHeader: ResponseHeader
8689
    :ivar Parameters:
8690
    :vartype Parameters: QueryNextResult
8691
    '''
8692
8693 1
    ua_types = {
8694
        'TypeId': 'NodeId',
8695
        'ResponseHeader': 'ResponseHeader',
8696
        'Parameters': 'QueryNextResult',
8697
               }
8698
8699 1
    def __init__(self, binary=None):
8700
        if binary is not None:
8701
            self._binary_init(binary)
8702
            self._freeze = True
8703
            return
8704
        self.TypeId = FourByteNodeId(ObjectIds.QueryNextResponse_Encoding_DefaultBinary)
8705
        self.ResponseHeader = ResponseHeader()
8706
        self.Parameters = QueryNextResult()
8707
        self._freeze = True
8708
8709 1
    def to_binary(self):
8710
        packet = []
8711
        packet.append(self.TypeId.to_binary())
8712
        packet.append(self.ResponseHeader.to_binary())
8713
        packet.append(self.Parameters.to_binary())
8714
        return b''.join(packet)
8715
8716 1
    @staticmethod
8717
    def from_binary(data):
8718
        return QueryNextResponse(data)
8719
8720 1
    def _binary_init(self, data):
8721
        self.TypeId = NodeId.from_binary(data)
8722
        self.ResponseHeader = ResponseHeader.from_binary(data)
8723
        self.Parameters = QueryNextResult.from_binary(data)
8724
8725 1
    def __str__(self):
8726
        return 'QueryNextResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8727
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
8728
               'Parameters:' + str(self.Parameters) + ')'
8729
8730 1
    __repr__ = __str__
8731
8732
8733 1 View Code Duplication
class ReadValueId(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8734
    '''
8735
    :ivar NodeId:
8736
    :vartype NodeId: NodeId
8737
    :ivar AttributeId:
8738
    :vartype AttributeId: UInt32
8739
    :ivar IndexRange:
8740
    :vartype IndexRange: String
8741
    :ivar DataEncoding:
8742
    :vartype DataEncoding: QualifiedName
8743
    '''
8744
8745 1
    ua_types = {
8746
        'NodeId': 'NodeId',
8747
        'AttributeId': 'UInt32',
8748
        'IndexRange': 'String',
8749
        'DataEncoding': 'QualifiedName',
8750
               }
8751
8752 1
    def __init__(self, binary=None):
8753 1
        if binary is not None:
8754 1
            self._binary_init(binary)
8755 1
            self._freeze = True
8756 1
            return
8757 1
        self.NodeId = NodeId()
8758 1
        self.AttributeId = 0
8759 1
        self.IndexRange = None
8760 1
        self.DataEncoding = QualifiedName()
8761 1
        self._freeze = True
8762
8763 1
    def to_binary(self):
8764 1
        packet = []
8765 1
        packet.append(self.NodeId.to_binary())
8766 1
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
8767 1
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
8768 1
        packet.append(self.DataEncoding.to_binary())
8769 1
        return b''.join(packet)
8770
8771 1
    @staticmethod
8772
    def from_binary(data):
8773 1
        return ReadValueId(data)
8774
8775 1
    def _binary_init(self, data):
8776 1
        self.NodeId = NodeId.from_binary(data)
8777 1
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
8778 1
        self.IndexRange = uabin.Primitives.String.unpack(data)
8779 1
        self.DataEncoding = QualifiedName.from_binary(data)
8780
8781 1
    def __str__(self):
8782
        return 'ReadValueId(' + 'NodeId:' + str(self.NodeId) + ', ' + \
8783
               'AttributeId:' + str(self.AttributeId) + ', ' + \
8784
               'IndexRange:' + str(self.IndexRange) + ', ' + \
8785
               'DataEncoding:' + str(self.DataEncoding) + ')'
8786
8787 1
    __repr__ = __str__
8788
8789
8790 1 View Code Duplication
class ReadParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8791
    '''
8792
    :ivar MaxAge:
8793
    :vartype MaxAge: Double
8794
    :ivar TimestampsToReturn:
8795
    :vartype TimestampsToReturn: TimestampsToReturn
8796
    :ivar NodesToRead:
8797
    :vartype NodesToRead: ReadValueId
8798
    '''
8799
8800 1
    ua_types = {
8801
        'MaxAge': 'Double',
8802
        'TimestampsToReturn': 'TimestampsToReturn',
8803
        'NodesToRead': 'ReadValueId',
8804
               }
8805
8806 1
    def __init__(self, binary=None):
8807 1
        if binary is not None:
8808 1
            self._binary_init(binary)
8809 1
            self._freeze = True
8810 1
            return
8811 1
        self.MaxAge = 0
8812 1
        self.TimestampsToReturn = TimestampsToReturn(0)
8813 1
        self.NodesToRead = []
8814 1
        self._freeze = True
8815
8816 1
    def to_binary(self):
8817 1
        packet = []
8818 1
        packet.append(uabin.Primitives.Double.pack(self.MaxAge))
8819 1
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
8820 1
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToRead)))
8821 1
        for fieldname in self.NodesToRead:
8822 1
            packet.append(fieldname.to_binary())
8823 1
        return b''.join(packet)
8824
8825 1
    @staticmethod
8826
    def from_binary(data):
8827 1
        return ReadParameters(data)
8828
8829 1
    def _binary_init(self, data):
8830 1
        self.MaxAge = uabin.Primitives.Double.unpack(data)
8831 1
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
8832 1
        length = uabin.Primitives.Int32.unpack(data)
8833 1
        array = []
8834 1
        if length != -1:
8835 1
            for _ in range(0, length):
8836 1
                array.append(ReadValueId.from_binary(data))
8837 1
        self.NodesToRead = array
8838
8839 1
    def __str__(self):
8840
        return 'ReadParameters(' + 'MaxAge:' + str(self.MaxAge) + ', ' + \
8841
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
8842
               'NodesToRead:' + str(self.NodesToRead) + ')'
8843
8844 1
    __repr__ = __str__
8845
8846
8847 1
class ReadRequest(FrozenClass):
8848
    '''
8849
    :ivar TypeId:
8850
    :vartype TypeId: NodeId
8851
    :ivar RequestHeader:
8852
    :vartype RequestHeader: RequestHeader
8853
    :ivar Parameters:
8854
    :vartype Parameters: ReadParameters
8855
    '''
8856
8857 1
    ua_types = {
8858
        'TypeId': 'NodeId',
8859
        'RequestHeader': 'RequestHeader',
8860
        'Parameters': 'ReadParameters',
8861
               }
8862
8863 1
    def __init__(self, binary=None):
8864 1
        if binary is not None:
8865
            self._binary_init(binary)
8866
            self._freeze = True
8867
            return
8868 1
        self.TypeId = FourByteNodeId(ObjectIds.ReadRequest_Encoding_DefaultBinary)
8869 1
        self.RequestHeader = RequestHeader()
8870 1
        self.Parameters = ReadParameters()
8871 1
        self._freeze = True
8872
8873 1
    def to_binary(self):
8874 1
        packet = []
8875 1
        packet.append(self.TypeId.to_binary())
8876 1
        packet.append(self.RequestHeader.to_binary())
8877 1
        packet.append(self.Parameters.to_binary())
8878 1
        return b''.join(packet)
8879
8880 1
    @staticmethod
8881
    def from_binary(data):
8882
        return ReadRequest(data)
8883
8884 1
    def _binary_init(self, data):
8885
        self.TypeId = NodeId.from_binary(data)
8886
        self.RequestHeader = RequestHeader.from_binary(data)
8887
        self.Parameters = ReadParameters.from_binary(data)
8888
8889 1
    def __str__(self):
8890
        return 'ReadRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8891
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
8892
               'Parameters:' + str(self.Parameters) + ')'
8893
8894 1
    __repr__ = __str__
8895
8896
8897 1
class ReadResponse(FrozenClass):
8898
    '''
8899
    :ivar TypeId:
8900
    :vartype TypeId: NodeId
8901
    :ivar ResponseHeader:
8902
    :vartype ResponseHeader: ResponseHeader
8903
    :ivar Results:
8904
    :vartype Results: DataValue
8905
    :ivar DiagnosticInfos:
8906
    :vartype DiagnosticInfos: DiagnosticInfo
8907
    '''
8908
8909 1
    ua_types = {
8910
        'TypeId': 'NodeId',
8911
        'ResponseHeader': 'ResponseHeader',
8912
        'Results': 'DataValue',
8913
        'DiagnosticInfos': 'DiagnosticInfo',
8914
               }
8915
8916 1
    def __init__(self, binary=None):
8917 1
        if binary is not None:
8918 1
            self._binary_init(binary)
8919 1
            self._freeze = True
8920 1
            return
8921 1
        self.TypeId = FourByteNodeId(ObjectIds.ReadResponse_Encoding_DefaultBinary)
8922 1
        self.ResponseHeader = ResponseHeader()
8923 1
        self.Results = []
8924 1
        self.DiagnosticInfos = []
8925 1
        self._freeze = True
8926
8927 1
    def to_binary(self):
8928 1
        packet = []
8929 1
        packet.append(self.TypeId.to_binary())
8930 1
        packet.append(self.ResponseHeader.to_binary())
8931 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
8932 1
        for fieldname in self.Results:
8933 1
            packet.append(fieldname.to_binary())
8934 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
8935 1
        for fieldname in self.DiagnosticInfos:
8936
            packet.append(fieldname.to_binary())
8937 1
        return b''.join(packet)
8938
8939 1
    @staticmethod
8940
    def from_binary(data):
8941 1
        return ReadResponse(data)
8942
8943 1
    def _binary_init(self, data):
8944 1
        self.TypeId = NodeId.from_binary(data)
8945 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
8946 1
        length = uabin.Primitives.Int32.unpack(data)
8947 1
        array = []
8948 1
        if length != -1:
8949 1
            for _ in range(0, length):
8950 1
                array.append(DataValue.from_binary(data))
8951 1
        self.Results = array
8952 1
        length = uabin.Primitives.Int32.unpack(data)
8953 1
        array = []
8954 1
        if length != -1:
8955 1
            for _ in range(0, length):
8956
                array.append(DiagnosticInfo.from_binary(data))
8957 1
        self.DiagnosticInfos = array
8958
8959 1
    def __str__(self):
8960
        return 'ReadResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8961
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
8962
               'Results:' + str(self.Results) + ', ' + \
8963
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
8964
8965 1
    __repr__ = __str__
8966
8967
8968 1 View Code Duplication
class HistoryReadValueId(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8969
    '''
8970
    :ivar NodeId:
8971
    :vartype NodeId: NodeId
8972
    :ivar IndexRange:
8973
    :vartype IndexRange: String
8974
    :ivar DataEncoding:
8975
    :vartype DataEncoding: QualifiedName
8976
    :ivar ContinuationPoint:
8977
    :vartype ContinuationPoint: ByteString
8978
    '''
8979
8980 1
    ua_types = {
8981
        'NodeId': 'NodeId',
8982
        'IndexRange': 'String',
8983
        'DataEncoding': 'QualifiedName',
8984
        'ContinuationPoint': 'ByteString',
8985
               }
8986
8987 1
    def __init__(self, binary=None):
8988 1
        if binary is not None:
8989
            self._binary_init(binary)
8990
            self._freeze = True
8991
            return
8992 1
        self.NodeId = NodeId()
8993 1
        self.IndexRange = None
8994 1
        self.DataEncoding = QualifiedName()
8995 1
        self.ContinuationPoint = None
8996 1
        self._freeze = True
8997
8998 1
    def to_binary(self):
8999
        packet = []
9000
        packet.append(self.NodeId.to_binary())
9001
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
9002
        packet.append(self.DataEncoding.to_binary())
9003
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
9004
        return b''.join(packet)
9005
9006 1
    @staticmethod
9007
    def from_binary(data):
9008
        return HistoryReadValueId(data)
9009
9010 1
    def _binary_init(self, data):
9011
        self.NodeId = NodeId.from_binary(data)
9012
        self.IndexRange = uabin.Primitives.String.unpack(data)
9013
        self.DataEncoding = QualifiedName.from_binary(data)
9014
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
9015
9016 1
    def __str__(self):
9017
        return 'HistoryReadValueId(' + 'NodeId:' + str(self.NodeId) + ', ' + \
9018
               'IndexRange:' + str(self.IndexRange) + ', ' + \
9019
               'DataEncoding:' + str(self.DataEncoding) + ', ' + \
9020
               'ContinuationPoint:' + str(self.ContinuationPoint) + ')'
9021
9022 1
    __repr__ = __str__
9023
9024
9025 1 View Code Duplication
class HistoryReadResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9026
    '''
9027
    :ivar StatusCode:
9028
    :vartype StatusCode: StatusCode
9029
    :ivar ContinuationPoint:
9030
    :vartype ContinuationPoint: ByteString
9031
    :ivar HistoryData:
9032
    :vartype HistoryData: ExtensionObject
9033
    '''
9034
9035 1
    ua_types = {
9036
        'StatusCode': 'StatusCode',
9037
        'ContinuationPoint': 'ByteString',
9038
        'HistoryData': 'ExtensionObject',
9039
               }
9040
9041 1
    def __init__(self, binary=None):
9042 1
        if binary is not None:
9043
            self._binary_init(binary)
9044
            self._freeze = True
9045
            return
9046 1
        self.StatusCode = StatusCode()
9047 1
        self.ContinuationPoint = None
9048 1
        self.HistoryData = None
9049 1
        self._freeze = True
9050
9051 1
    def to_binary(self):
9052
        packet = []
9053
        packet.append(self.StatusCode.to_binary())
9054
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
9055
        packet.append(extensionobject_to_binary(self.HistoryData))
9056
        return b''.join(packet)
9057
9058 1
    @staticmethod
9059
    def from_binary(data):
9060
        return HistoryReadResult(data)
9061
9062 1
    def _binary_init(self, data):
9063
        self.StatusCode = StatusCode.from_binary(data)
9064
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
9065
        self.HistoryData = extensionobject_from_binary(data)
9066
9067 1
    def __str__(self):
9068
        return 'HistoryReadResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
9069
               'ContinuationPoint:' + str(self.ContinuationPoint) + ', ' + \
9070
               'HistoryData:' + str(self.HistoryData) + ')'
9071
9072 1
    __repr__ = __str__
9073
9074
9075 1 View Code Duplication
class HistoryReadDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9076
    '''
9077
    '''
9078
9079 1
    ua_types = {
9080
               }
9081
9082 1
    def __init__(self, binary=None):
9083
        if binary is not None:
9084
            self._binary_init(binary)
9085
            self._freeze = True
9086
            return
9087
        self._freeze = True
9088
9089 1
    def to_binary(self):
9090
        packet = []
9091
        return b''.join(packet)
9092
9093 1
    @staticmethod
9094
    def from_binary(data):
9095
        return HistoryReadDetails(data)
9096
9097 1
    def _binary_init(self, data):
9098
        pass
9099
9100 1
    def __str__(self):
9101
        return 'HistoryReadDetails(' +  + ')'
9102
9103 1
    __repr__ = __str__
9104
9105
9106 1 View Code Duplication
class ReadEventDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9107
    '''
9108
    :ivar NumValuesPerNode:
9109
    :vartype NumValuesPerNode: UInt32
9110
    :ivar StartTime:
9111
    :vartype StartTime: DateTime
9112
    :ivar EndTime:
9113
    :vartype EndTime: DateTime
9114
    :ivar Filter:
9115
    :vartype Filter: EventFilter
9116
    '''
9117
9118 1
    ua_types = {
9119
        'NumValuesPerNode': 'UInt32',
9120
        'StartTime': 'DateTime',
9121
        'EndTime': 'DateTime',
9122
        'Filter': 'EventFilter',
9123
               }
9124
9125 1
    def __init__(self, binary=None):
9126 1
        if binary is not None:
9127
            self._binary_init(binary)
9128
            self._freeze = True
9129
            return
9130 1
        self.NumValuesPerNode = 0
9131 1
        self.StartTime = datetime.now()
9132 1
        self.EndTime = datetime.now()
9133 1
        self.Filter = EventFilter()
9134 1
        self._freeze = True
9135
9136 1
    def to_binary(self):
9137
        packet = []
9138
        packet.append(uabin.Primitives.UInt32.pack(self.NumValuesPerNode))
9139
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
9140
        packet.append(uabin.Primitives.DateTime.pack(self.EndTime))
9141
        packet.append(self.Filter.to_binary())
9142
        return b''.join(packet)
9143
9144 1
    @staticmethod
9145
    def from_binary(data):
9146
        return ReadEventDetails(data)
9147
9148 1
    def _binary_init(self, data):
9149
        self.NumValuesPerNode = uabin.Primitives.UInt32.unpack(data)
9150
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
9151
        self.EndTime = uabin.Primitives.DateTime.unpack(data)
9152
        self.Filter = EventFilter.from_binary(data)
9153
9154 1
    def __str__(self):
9155
        return 'ReadEventDetails(' + 'NumValuesPerNode:' + str(self.NumValuesPerNode) + ', ' + \
9156
               'StartTime:' + str(self.StartTime) + ', ' + \
9157
               'EndTime:' + str(self.EndTime) + ', ' + \
9158
               'Filter:' + str(self.Filter) + ')'
9159
9160 1
    __repr__ = __str__
9161
9162
9163 1 View Code Duplication
class ReadRawModifiedDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9164
    '''
9165
    :ivar IsReadModified:
9166
    :vartype IsReadModified: Boolean
9167
    :ivar StartTime:
9168
    :vartype StartTime: DateTime
9169
    :ivar EndTime:
9170
    :vartype EndTime: DateTime
9171
    :ivar NumValuesPerNode:
9172
    :vartype NumValuesPerNode: UInt32
9173
    :ivar ReturnBounds:
9174
    :vartype ReturnBounds: Boolean
9175
    '''
9176
9177 1
    ua_types = {
9178
        'IsReadModified': 'Boolean',
9179
        'StartTime': 'DateTime',
9180
        'EndTime': 'DateTime',
9181
        'NumValuesPerNode': 'UInt32',
9182
        'ReturnBounds': 'Boolean',
9183
               }
9184
9185 1
    def __init__(self, binary=None):
9186 1
        if binary is not None:
9187
            self._binary_init(binary)
9188
            self._freeze = True
9189
            return
9190 1
        self.IsReadModified = True
9191 1
        self.StartTime = datetime.now()
9192 1
        self.EndTime = datetime.now()
9193 1
        self.NumValuesPerNode = 0
9194 1
        self.ReturnBounds = True
9195 1
        self._freeze = True
9196
9197 1
    def to_binary(self):
9198
        packet = []
9199
        packet.append(uabin.Primitives.Boolean.pack(self.IsReadModified))
9200
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
9201
        packet.append(uabin.Primitives.DateTime.pack(self.EndTime))
9202
        packet.append(uabin.Primitives.UInt32.pack(self.NumValuesPerNode))
9203
        packet.append(uabin.Primitives.Boolean.pack(self.ReturnBounds))
9204
        return b''.join(packet)
9205
9206 1
    @staticmethod
9207
    def from_binary(data):
9208
        return ReadRawModifiedDetails(data)
9209
9210 1
    def _binary_init(self, data):
9211
        self.IsReadModified = uabin.Primitives.Boolean.unpack(data)
9212
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
9213
        self.EndTime = uabin.Primitives.DateTime.unpack(data)
9214
        self.NumValuesPerNode = uabin.Primitives.UInt32.unpack(data)
9215
        self.ReturnBounds = uabin.Primitives.Boolean.unpack(data)
9216
9217 1
    def __str__(self):
9218
        return 'ReadRawModifiedDetails(' + 'IsReadModified:' + str(self.IsReadModified) + ', ' + \
9219
               'StartTime:' + str(self.StartTime) + ', ' + \
9220
               'EndTime:' + str(self.EndTime) + ', ' + \
9221
               'NumValuesPerNode:' + str(self.NumValuesPerNode) + ', ' + \
9222
               'ReturnBounds:' + str(self.ReturnBounds) + ')'
9223
9224 1
    __repr__ = __str__
9225
9226
9227 1 View Code Duplication
class ReadProcessedDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9228
    '''
9229
    :ivar StartTime:
9230
    :vartype StartTime: DateTime
9231
    :ivar EndTime:
9232
    :vartype EndTime: DateTime
9233
    :ivar ProcessingInterval:
9234
    :vartype ProcessingInterval: Double
9235
    :ivar AggregateType:
9236
    :vartype AggregateType: NodeId
9237
    :ivar AggregateConfiguration:
9238
    :vartype AggregateConfiguration: AggregateConfiguration
9239
    '''
9240
9241 1
    ua_types = {
9242
        'StartTime': 'DateTime',
9243
        'EndTime': 'DateTime',
9244
        'ProcessingInterval': 'Double',
9245
        'AggregateType': 'NodeId',
9246
        'AggregateConfiguration': 'AggregateConfiguration',
9247
               }
9248
9249 1
    def __init__(self, binary=None):
9250
        if binary is not None:
9251
            self._binary_init(binary)
9252
            self._freeze = True
9253
            return
9254
        self.StartTime = datetime.now()
9255
        self.EndTime = datetime.now()
9256
        self.ProcessingInterval = 0
9257
        self.AggregateType = []
9258
        self.AggregateConfiguration = AggregateConfiguration()
9259
        self._freeze = True
9260
9261 1
    def to_binary(self):
9262
        packet = []
9263
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
9264
        packet.append(uabin.Primitives.DateTime.pack(self.EndTime))
9265
        packet.append(uabin.Primitives.Double.pack(self.ProcessingInterval))
9266
        packet.append(uabin.Primitives.Int32.pack(len(self.AggregateType)))
9267
        for fieldname in self.AggregateType:
9268
            packet.append(fieldname.to_binary())
9269
        packet.append(self.AggregateConfiguration.to_binary())
9270
        return b''.join(packet)
9271
9272 1
    @staticmethod
9273
    def from_binary(data):
9274
        return ReadProcessedDetails(data)
9275
9276 1
    def _binary_init(self, data):
9277
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
9278
        self.EndTime = uabin.Primitives.DateTime.unpack(data)
9279
        self.ProcessingInterval = uabin.Primitives.Double.unpack(data)
9280
        length = uabin.Primitives.Int32.unpack(data)
9281
        array = []
9282
        if length != -1:
9283
            for _ in range(0, length):
9284
                array.append(NodeId.from_binary(data))
9285
        self.AggregateType = array
9286
        self.AggregateConfiguration = AggregateConfiguration.from_binary(data)
9287
9288 1
    def __str__(self):
9289
        return 'ReadProcessedDetails(' + 'StartTime:' + str(self.StartTime) + ', ' + \
9290
               'EndTime:' + str(self.EndTime) + ', ' + \
9291
               'ProcessingInterval:' + str(self.ProcessingInterval) + ', ' + \
9292
               'AggregateType:' + str(self.AggregateType) + ', ' + \
9293
               'AggregateConfiguration:' + str(self.AggregateConfiguration) + ')'
9294
9295 1
    __repr__ = __str__
9296
9297
9298 1 View Code Duplication
class ReadAtTimeDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9299
    '''
9300
    :ivar ReqTimes:
9301
    :vartype ReqTimes: DateTime
9302
    :ivar UseSimpleBounds:
9303
    :vartype UseSimpleBounds: Boolean
9304
    '''
9305
9306 1
    ua_types = {
9307
        'ReqTimes': 'DateTime',
9308
        'UseSimpleBounds': 'Boolean',
9309
               }
9310
9311 1
    def __init__(self, binary=None):
9312
        if binary is not None:
9313
            self._binary_init(binary)
9314
            self._freeze = True
9315
            return
9316
        self.ReqTimes = []
9317
        self.UseSimpleBounds = True
9318
        self._freeze = True
9319
9320 1
    def to_binary(self):
9321
        packet = []
9322
        packet.append(uabin.Primitives.Int32.pack(len(self.ReqTimes)))
9323
        for fieldname in self.ReqTimes:
9324
            packet.append(uabin.Primitives.DateTime.pack(fieldname))
9325
        packet.append(uabin.Primitives.Boolean.pack(self.UseSimpleBounds))
9326
        return b''.join(packet)
9327
9328 1
    @staticmethod
9329
    def from_binary(data):
9330
        return ReadAtTimeDetails(data)
9331
9332 1
    def _binary_init(self, data):
9333
        self.ReqTimes = uabin.Primitives.DateTime.unpack_array(data)
9334
        self.UseSimpleBounds = uabin.Primitives.Boolean.unpack(data)
9335
9336 1
    def __str__(self):
9337
        return 'ReadAtTimeDetails(' + 'ReqTimes:' + str(self.ReqTimes) + ', ' + \
9338
               'UseSimpleBounds:' + str(self.UseSimpleBounds) + ')'
9339
9340 1
    __repr__ = __str__
9341
9342
9343 1
class HistoryData(FrozenClass):
9344
    '''
9345
    :ivar DataValues:
9346
    :vartype DataValues: DataValue
9347
    '''
9348
9349 1
    ua_types = {
9350
        'DataValues': 'DataValue',
9351
               }
9352
9353 1
    def __init__(self, binary=None):
9354 1
        if binary is not None:
9355
            self._binary_init(binary)
9356
            self._freeze = True
9357
            return
9358 1 View Code Duplication
        self.DataValues = []
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9359 1
        self._freeze = True
9360
9361 1
    def to_binary(self):
9362
        packet = []
9363
        packet.append(uabin.Primitives.Int32.pack(len(self.DataValues)))
9364
        for fieldname in self.DataValues:
9365
            packet.append(fieldname.to_binary())
9366
        return b''.join(packet)
9367
9368 1
    @staticmethod
9369
    def from_binary(data):
9370
        return HistoryData(data)
9371
9372 1
    def _binary_init(self, data):
9373
        length = uabin.Primitives.Int32.unpack(data)
9374
        array = []
9375
        if length != -1:
9376
            for _ in range(0, length):
9377
                array.append(DataValue.from_binary(data))
9378
        self.DataValues = array
9379
9380 1
    def __str__(self):
9381
        return 'HistoryData(' + 'DataValues:' + str(self.DataValues) + ')'
9382
9383 1
    __repr__ = __str__
9384
9385
9386 1 View Code Duplication
class ModificationInfo(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9387
    '''
9388
    :ivar ModificationTime:
9389
    :vartype ModificationTime: DateTime
9390
    :ivar UpdateType:
9391
    :vartype UpdateType: HistoryUpdateType
9392
    :ivar UserName:
9393
    :vartype UserName: String
9394
    '''
9395
9396 1
    ua_types = {
9397
        'ModificationTime': 'DateTime',
9398
        'UpdateType': 'HistoryUpdateType',
9399
        'UserName': 'String',
9400
               }
9401
9402 1
    def __init__(self, binary=None):
9403
        if binary is not None:
9404
            self._binary_init(binary)
9405
            self._freeze = True
9406
            return
9407
        self.ModificationTime = datetime.now()
9408
        self.UpdateType = HistoryUpdateType(0)
9409
        self.UserName = None
9410
        self._freeze = True
9411
9412 1
    def to_binary(self):
9413
        packet = []
9414
        packet.append(uabin.Primitives.DateTime.pack(self.ModificationTime))
9415
        packet.append(uabin.Primitives.UInt32.pack(self.UpdateType.value))
9416
        packet.append(uabin.Primitives.String.pack(self.UserName))
9417
        return b''.join(packet)
9418
9419 1
    @staticmethod
9420
    def from_binary(data):
9421
        return ModificationInfo(data)
9422
9423 1
    def _binary_init(self, data):
9424
        self.ModificationTime = uabin.Primitives.DateTime.unpack(data)
9425
        self.UpdateType = HistoryUpdateType(uabin.Primitives.UInt32.unpack(data))
9426
        self.UserName = uabin.Primitives.String.unpack(data)
9427
9428 1
    def __str__(self):
9429
        return 'ModificationInfo(' + 'ModificationTime:' + str(self.ModificationTime) + ', ' + \
9430
               'UpdateType:' + str(self.UpdateType) + ', ' + \
9431
               'UserName:' + str(self.UserName) + ')'
9432
9433 1
    __repr__ = __str__
9434
9435
9436 1 View Code Duplication
class HistoryModifiedData(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9437
    '''
9438
    :ivar DataValues:
9439
    :vartype DataValues: DataValue
9440
    :ivar ModificationInfos:
9441
    :vartype ModificationInfos: ModificationInfo
9442
    '''
9443
9444 1
    ua_types = {
9445
        'DataValues': 'DataValue',
9446
        'ModificationInfos': 'ModificationInfo',
9447
               }
9448
9449 1
    def __init__(self, binary=None):
9450
        if binary is not None:
9451
            self._binary_init(binary)
9452
            self._freeze = True
9453
            return
9454
        self.DataValues = []
9455
        self.ModificationInfos = []
9456
        self._freeze = True
9457
9458 1
    def to_binary(self):
9459
        packet = []
9460
        packet.append(uabin.Primitives.Int32.pack(len(self.DataValues)))
9461
        for fieldname in self.DataValues:
9462
            packet.append(fieldname.to_binary())
9463
        packet.append(uabin.Primitives.Int32.pack(len(self.ModificationInfos)))
9464
        for fieldname in self.ModificationInfos:
9465
            packet.append(fieldname.to_binary())
9466
        return b''.join(packet)
9467
9468 1
    @staticmethod
9469
    def from_binary(data):
9470
        return HistoryModifiedData(data)
9471
9472 1
    def _binary_init(self, data):
9473
        length = uabin.Primitives.Int32.unpack(data)
9474
        array = []
9475
        if length != -1:
9476
            for _ in range(0, length):
9477
                array.append(DataValue.from_binary(data))
9478
        self.DataValues = array
9479
        length = uabin.Primitives.Int32.unpack(data)
9480
        array = []
9481
        if length != -1:
9482
            for _ in range(0, length):
9483
                array.append(ModificationInfo.from_binary(data))
9484
        self.ModificationInfos = array
9485
9486 1
    def __str__(self):
9487
        return 'HistoryModifiedData(' + 'DataValues:' + str(self.DataValues) + ', ' + \
9488
               'ModificationInfos:' + str(self.ModificationInfos) + ')'
9489
9490 1
    __repr__ = __str__
9491
9492
9493 1
class HistoryEvent(FrozenClass):
9494
    '''
9495
    :ivar Events:
9496
    :vartype Events: HistoryEventFieldList
9497
    '''
9498
9499 1
    ua_types = {
9500
        'Events': 'HistoryEventFieldList',
9501
               }
9502
9503 1
    def __init__(self, binary=None):
9504 1
        if binary is not None:
9505
            self._binary_init(binary)
9506
            self._freeze = True
9507
            return
9508 1
        self.Events = []
9509 1
        self._freeze = True
9510
9511 1
    def to_binary(self):
9512
        packet = []
9513
        packet.append(uabin.Primitives.Int32.pack(len(self.Events)))
9514
        for fieldname in self.Events:
9515
            packet.append(fieldname.to_binary())
9516
        return b''.join(packet)
9517
9518 1
    @staticmethod
9519
    def from_binary(data):
9520
        return HistoryEvent(data)
9521
9522 1
    def _binary_init(self, data):
9523
        length = uabin.Primitives.Int32.unpack(data)
9524
        array = []
9525
        if length != -1:
9526
            for _ in range(0, length):
9527
                array.append(HistoryEventFieldList.from_binary(data))
9528
        self.Events = array
9529
9530 1
    def __str__(self):
9531
        return 'HistoryEvent(' + 'Events:' + str(self.Events) + ')'
9532
9533 1
    __repr__ = __str__
9534
9535
9536 1 View Code Duplication
class HistoryReadParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9537
    '''
9538
    :ivar HistoryReadDetails:
9539
    :vartype HistoryReadDetails: ExtensionObject
9540
    :ivar TimestampsToReturn:
9541
    :vartype TimestampsToReturn: TimestampsToReturn
9542
    :ivar ReleaseContinuationPoints:
9543
    :vartype ReleaseContinuationPoints: Boolean
9544
    :ivar NodesToRead:
9545
    :vartype NodesToRead: HistoryReadValueId
9546
    '''
9547
9548 1
    ua_types = {
9549
        'HistoryReadDetails': 'ExtensionObject',
9550
        'TimestampsToReturn': 'TimestampsToReturn',
9551
        'ReleaseContinuationPoints': 'Boolean',
9552
        'NodesToRead': 'HistoryReadValueId',
9553
               }
9554
9555 1
    def __init__(self, binary=None):
9556 1
        if binary is not None:
9557
            self._binary_init(binary)
9558
            self._freeze = True
9559
            return
9560 1
        self.HistoryReadDetails = None
9561 1
        self.TimestampsToReturn = TimestampsToReturn(0)
9562 1
        self.ReleaseContinuationPoints = True
9563 1
        self.NodesToRead = []
9564 1
        self._freeze = True
9565
9566 1
    def to_binary(self):
9567
        packet = []
9568
        packet.append(extensionobject_to_binary(self.HistoryReadDetails))
9569
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
9570
        packet.append(uabin.Primitives.Boolean.pack(self.ReleaseContinuationPoints))
9571
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToRead)))
9572
        for fieldname in self.NodesToRead:
9573
            packet.append(fieldname.to_binary())
9574
        return b''.join(packet)
9575
9576 1
    @staticmethod
9577
    def from_binary(data):
9578
        return HistoryReadParameters(data)
9579
9580 1
    def _binary_init(self, data):
9581
        self.HistoryReadDetails = extensionobject_from_binary(data)
9582
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
9583
        self.ReleaseContinuationPoints = uabin.Primitives.Boolean.unpack(data)
9584
        length = uabin.Primitives.Int32.unpack(data)
9585
        array = []
9586
        if length != -1:
9587
            for _ in range(0, length):
9588
                array.append(HistoryReadValueId.from_binary(data))
9589
        self.NodesToRead = array
9590
9591 1
    def __str__(self):
9592
        return 'HistoryReadParameters(' + 'HistoryReadDetails:' + str(self.HistoryReadDetails) + ', ' + \
9593
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
9594
               'ReleaseContinuationPoints:' + str(self.ReleaseContinuationPoints) + ', ' + \
9595
               'NodesToRead:' + str(self.NodesToRead) + ')'
9596
9597 1
    __repr__ = __str__
9598
9599
9600 1
class HistoryReadRequest(FrozenClass):
9601
    '''
9602
    :ivar TypeId:
9603
    :vartype TypeId: NodeId
9604
    :ivar RequestHeader:
9605
    :vartype RequestHeader: RequestHeader
9606
    :ivar Parameters:
9607
    :vartype Parameters: HistoryReadParameters
9608
    '''
9609
9610 1
    ua_types = {
9611
        'TypeId': 'NodeId',
9612
        'RequestHeader': 'RequestHeader',
9613
        'Parameters': 'HistoryReadParameters',
9614
               }
9615
9616 1
    def __init__(self, binary=None):
9617
        if binary is not None:
9618
            self._binary_init(binary)
9619
            self._freeze = True
9620
            return
9621
        self.TypeId = FourByteNodeId(ObjectIds.HistoryReadRequest_Encoding_DefaultBinary)
9622
        self.RequestHeader = RequestHeader()
9623
        self.Parameters = HistoryReadParameters()
9624
        self._freeze = True
9625
9626 1
    def to_binary(self):
9627
        packet = []
9628
        packet.append(self.TypeId.to_binary())
9629
        packet.append(self.RequestHeader.to_binary())
9630
        packet.append(self.Parameters.to_binary())
9631
        return b''.join(packet)
9632
9633 1
    @staticmethod
9634
    def from_binary(data):
9635
        return HistoryReadRequest(data)
9636
9637 1
    def _binary_init(self, data):
9638
        self.TypeId = NodeId.from_binary(data)
9639
        self.RequestHeader = RequestHeader.from_binary(data)
9640
        self.Parameters = HistoryReadParameters.from_binary(data)
9641
9642 1
    def __str__(self):
9643
        return 'HistoryReadRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9644
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
9645
               'Parameters:' + str(self.Parameters) + ')'
9646
9647 1
    __repr__ = __str__
9648
9649
9650 1
class HistoryReadResponse(FrozenClass):
9651
    '''
9652
    :ivar TypeId:
9653
    :vartype TypeId: NodeId
9654
    :ivar ResponseHeader:
9655
    :vartype ResponseHeader: ResponseHeader
9656
    :ivar Results:
9657
    :vartype Results: HistoryReadResult
9658
    :ivar DiagnosticInfos:
9659
    :vartype DiagnosticInfos: DiagnosticInfo
9660
    '''
9661
9662 1
    ua_types = {
9663
        'TypeId': 'NodeId',
9664
        'ResponseHeader': 'ResponseHeader',
9665
        'Results': 'HistoryReadResult',
9666
        'DiagnosticInfos': 'DiagnosticInfo',
9667
               }
9668
9669 1
    def __init__(self, binary=None):
9670
        if binary is not None:
9671
            self._binary_init(binary)
9672
            self._freeze = True
9673
            return
9674
        self.TypeId = FourByteNodeId(ObjectIds.HistoryReadResponse_Encoding_DefaultBinary)
9675
        self.ResponseHeader = ResponseHeader()
9676
        self.Results = []
9677
        self.DiagnosticInfos = []
9678
        self._freeze = True
9679
9680 1
    def to_binary(self):
9681
        packet = []
9682
        packet.append(self.TypeId.to_binary())
9683
        packet.append(self.ResponseHeader.to_binary())
9684
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
9685
        for fieldname in self.Results:
9686
            packet.append(fieldname.to_binary())
9687
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
9688
        for fieldname in self.DiagnosticInfos:
9689
            packet.append(fieldname.to_binary())
9690
        return b''.join(packet)
9691
9692 1
    @staticmethod
9693
    def from_binary(data):
9694
        return HistoryReadResponse(data)
9695
9696 1
    def _binary_init(self, data):
9697
        self.TypeId = NodeId.from_binary(data)
9698
        self.ResponseHeader = ResponseHeader.from_binary(data)
9699
        length = uabin.Primitives.Int32.unpack(data)
9700
        array = []
9701
        if length != -1:
9702
            for _ in range(0, length):
9703
                array.append(HistoryReadResult.from_binary(data))
9704
        self.Results = array
9705
        length = uabin.Primitives.Int32.unpack(data)
9706
        array = []
9707
        if length != -1:
9708
            for _ in range(0, length):
9709
                array.append(DiagnosticInfo.from_binary(data))
9710
        self.DiagnosticInfos = array
9711
9712 1
    def __str__(self):
9713
        return 'HistoryReadResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9714
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
9715
               'Results:' + str(self.Results) + ', ' + \
9716
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
9717
9718 1
    __repr__ = __str__
9719
9720
9721 1 View Code Duplication
class WriteValue(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9722
    '''
9723
    :ivar NodeId:
9724
    :vartype NodeId: NodeId
9725
    :ivar AttributeId:
9726
    :vartype AttributeId: UInt32
9727
    :ivar IndexRange:
9728
    :vartype IndexRange: String
9729
    :ivar Value:
9730
    :vartype Value: DataValue
9731
    '''
9732
9733 1
    ua_types = {
9734
        'NodeId': 'NodeId',
9735
        'AttributeId': 'UInt32',
9736
        'IndexRange': 'String',
9737
        'Value': 'DataValue',
9738
               }
9739
9740 1
    def __init__(self, binary=None):
9741 1
        if binary is not None:
9742 1
            self._binary_init(binary)
9743 1
            self._freeze = True
9744 1
            return
9745 1
        self.NodeId = NodeId()
9746 1
        self.AttributeId = 0
9747 1
        self.IndexRange = None
9748 1
        self.Value = DataValue()
9749 1
        self._freeze = True
9750
9751 1
    def to_binary(self):
9752 1
        packet = []
9753 1
        packet.append(self.NodeId.to_binary())
9754 1
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
9755 1
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
9756 1
        packet.append(self.Value.to_binary())
9757 1
        return b''.join(packet)
9758
9759 1
    @staticmethod
9760
    def from_binary(data):
9761 1
        return WriteValue(data)
9762
9763 1
    def _binary_init(self, data):
9764 1
        self.NodeId = NodeId.from_binary(data)
9765 1
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
9766 1
        self.IndexRange = uabin.Primitives.String.unpack(data)
9767 1
        self.Value = DataValue.from_binary(data)
9768
9769 1
    def __str__(self):
9770
        return 'WriteValue(' + 'NodeId:' + str(self.NodeId) + ', ' + \
9771
               'AttributeId:' + str(self.AttributeId) + ', ' + \
9772
               'IndexRange:' + str(self.IndexRange) + ', ' + \
9773
               'Value:' + str(self.Value) + ')'
9774
9775 1
    __repr__ = __str__
9776
9777
9778 1
class WriteParameters(FrozenClass):
9779
    '''
9780
    :ivar NodesToWrite:
9781
    :vartype NodesToWrite: WriteValue
9782
    '''
9783
9784 1
    ua_types = {
9785
        'NodesToWrite': 'WriteValue',
9786
               }
9787
9788 1
    def __init__(self, binary=None):
9789 1
        if binary is not None:
9790 1
            self._binary_init(binary)
9791 1
            self._freeze = True
9792 1
            return
9793 1
        self.NodesToWrite = []
9794 1
        self._freeze = True
9795
9796 1
    def to_binary(self):
9797 1
        packet = []
9798 1
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToWrite)))
9799 1
        for fieldname in self.NodesToWrite:
9800 1
            packet.append(fieldname.to_binary())
9801 1
        return b''.join(packet)
9802
9803 1
    @staticmethod
9804
    def from_binary(data):
9805 1
        return WriteParameters(data)
9806
9807 1
    def _binary_init(self, data):
9808 1
        length = uabin.Primitives.Int32.unpack(data)
9809 1
        array = []
9810 1
        if length != -1:
9811 1
            for _ in range(0, length):
9812 1
                array.append(WriteValue.from_binary(data))
9813 1
        self.NodesToWrite = array
9814
9815 1
    def __str__(self):
9816
        return 'WriteParameters(' + 'NodesToWrite:' + str(self.NodesToWrite) + ')'
9817
9818 1
    __repr__ = __str__
9819
9820
9821 1
class WriteRequest(FrozenClass):
9822
    '''
9823
    :ivar TypeId:
9824
    :vartype TypeId: NodeId
9825
    :ivar RequestHeader:
9826
    :vartype RequestHeader: RequestHeader
9827
    :ivar Parameters:
9828
    :vartype Parameters: WriteParameters
9829
    '''
9830
9831 1
    ua_types = {
9832
        'TypeId': 'NodeId',
9833
        'RequestHeader': 'RequestHeader',
9834
        'Parameters': 'WriteParameters',
9835
               }
9836
9837 1
    def __init__(self, binary=None):
9838 1
        if binary is not None:
9839
            self._binary_init(binary)
9840
            self._freeze = True
9841
            return
9842 1
        self.TypeId = FourByteNodeId(ObjectIds.WriteRequest_Encoding_DefaultBinary)
9843 1
        self.RequestHeader = RequestHeader()
9844 1
        self.Parameters = WriteParameters()
9845 1
        self._freeze = True
9846
9847 1
    def to_binary(self):
9848 1
        packet = []
9849 1
        packet.append(self.TypeId.to_binary())
9850 1
        packet.append(self.RequestHeader.to_binary())
9851 1
        packet.append(self.Parameters.to_binary())
9852 1
        return b''.join(packet)
9853
9854 1
    @staticmethod
9855
    def from_binary(data):
9856
        return WriteRequest(data)
9857
9858 1
    def _binary_init(self, data):
9859
        self.TypeId = NodeId.from_binary(data)
9860
        self.RequestHeader = RequestHeader.from_binary(data)
9861
        self.Parameters = WriteParameters.from_binary(data)
9862
9863 1
    def __str__(self):
9864
        return 'WriteRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9865
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
9866
               'Parameters:' + str(self.Parameters) + ')'
9867
9868 1
    __repr__ = __str__
9869
9870
9871 1
class WriteResponse(FrozenClass):
9872
    '''
9873
    :ivar TypeId:
9874
    :vartype TypeId: NodeId
9875
    :ivar ResponseHeader:
9876
    :vartype ResponseHeader: ResponseHeader
9877
    :ivar Results:
9878
    :vartype Results: StatusCode
9879
    :ivar DiagnosticInfos:
9880
    :vartype DiagnosticInfos: DiagnosticInfo
9881
    '''
9882
9883 1
    ua_types = {
9884
        'TypeId': 'NodeId',
9885
        'ResponseHeader': 'ResponseHeader',
9886
        'Results': 'StatusCode',
9887
        'DiagnosticInfos': 'DiagnosticInfo',
9888
               }
9889
9890 1
    def __init__(self, binary=None):
9891 1
        if binary is not None:
9892 1
            self._binary_init(binary)
9893 1
            self._freeze = True
9894 1
            return
9895 1
        self.TypeId = FourByteNodeId(ObjectIds.WriteResponse_Encoding_DefaultBinary)
9896 1
        self.ResponseHeader = ResponseHeader()
9897 1
        self.Results = []
9898 1
        self.DiagnosticInfos = []
9899 1
        self._freeze = True
9900
9901 1
    def to_binary(self):
9902 1
        packet = []
9903 1
        packet.append(self.TypeId.to_binary())
9904 1
        packet.append(self.ResponseHeader.to_binary())
9905 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
9906 1
        for fieldname in self.Results:
9907 1
            packet.append(fieldname.to_binary())
9908 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
9909 1
        for fieldname in self.DiagnosticInfos:
9910
            packet.append(fieldname.to_binary())
9911 1
        return b''.join(packet)
9912
9913 1
    @staticmethod
9914
    def from_binary(data):
9915 1
        return WriteResponse(data)
9916
9917 1
    def _binary_init(self, data):
9918 1
        self.TypeId = NodeId.from_binary(data)
9919 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
9920 1
        length = uabin.Primitives.Int32.unpack(data)
9921 1
        array = []
9922 1
        if length != -1:
9923 1
            for _ in range(0, length):
9924 1
                array.append(StatusCode.from_binary(data))
9925 1
        self.Results = array
9926 1
        length = uabin.Primitives.Int32.unpack(data)
9927 1
        array = []
9928 1
        if length != -1:
9929 1
            for _ in range(0, length):
9930
                array.append(DiagnosticInfo.from_binary(data))
9931 1
        self.DiagnosticInfos = array
9932
9933 1
    def __str__(self):
9934
        return 'WriteResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9935
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
9936
               'Results:' + str(self.Results) + ', ' + \
9937
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
9938
9939 1
    __repr__ = __str__
9940
9941
9942 1 View Code Duplication
class HistoryUpdateDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9943
    '''
9944
    :ivar NodeId:
9945
    :vartype NodeId: NodeId
9946
    '''
9947
9948 1
    ua_types = {
9949
        'NodeId': 'NodeId',
9950
               }
9951
9952 1
    def __init__(self, binary=None):
9953
        if binary is not None:
9954
            self._binary_init(binary)
9955
            self._freeze = True
9956
            return
9957
        self.NodeId = NodeId()
9958
        self._freeze = True
9959
9960 1
    def to_binary(self):
9961
        packet = []
9962
        packet.append(self.NodeId.to_binary())
9963
        return b''.join(packet)
9964
9965 1
    @staticmethod
9966
    def from_binary(data):
9967
        return HistoryUpdateDetails(data)
9968
9969 1
    def _binary_init(self, data):
9970
        self.NodeId = NodeId.from_binary(data)
9971
9972 1
    def __str__(self):
9973
        return 'HistoryUpdateDetails(' + 'NodeId:' + str(self.NodeId) + ')'
9974
9975 1
    __repr__ = __str__
9976
9977
9978 1 View Code Duplication
class UpdateDataDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9979
    '''
9980
    :ivar NodeId:
9981
    :vartype NodeId: NodeId
9982
    :ivar PerformInsertReplace:
9983
    :vartype PerformInsertReplace: PerformUpdateType
9984
    :ivar UpdateValues:
9985
    :vartype UpdateValues: DataValue
9986
    '''
9987
9988 1
    ua_types = {
9989
        'NodeId': 'NodeId',
9990
        'PerformInsertReplace': 'PerformUpdateType',
9991
        'UpdateValues': 'DataValue',
9992
               }
9993
9994 1
    def __init__(self, binary=None):
9995
        if binary is not None:
9996
            self._binary_init(binary)
9997
            self._freeze = True
9998
            return
9999
        self.NodeId = NodeId()
10000
        self.PerformInsertReplace = PerformUpdateType(0)
10001
        self.UpdateValues = []
10002
        self._freeze = True
10003
10004 1
    def to_binary(self):
10005
        packet = []
10006
        packet.append(self.NodeId.to_binary())
10007
        packet.append(uabin.Primitives.UInt32.pack(self.PerformInsertReplace.value))
10008
        packet.append(uabin.Primitives.Int32.pack(len(self.UpdateValues)))
10009
        for fieldname in self.UpdateValues:
10010
            packet.append(fieldname.to_binary())
10011
        return b''.join(packet)
10012
10013 1
    @staticmethod
10014
    def from_binary(data):
10015
        return UpdateDataDetails(data)
10016
10017 1
    def _binary_init(self, data):
10018
        self.NodeId = NodeId.from_binary(data)
10019
        self.PerformInsertReplace = PerformUpdateType(uabin.Primitives.UInt32.unpack(data))
10020
        length = uabin.Primitives.Int32.unpack(data)
10021
        array = []
10022
        if length != -1:
10023
            for _ in range(0, length):
10024
                array.append(DataValue.from_binary(data))
10025
        self.UpdateValues = array
10026
10027 1
    def __str__(self):
10028
        return 'UpdateDataDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10029
               'PerformInsertReplace:' + str(self.PerformInsertReplace) + ', ' + \
10030
               'UpdateValues:' + str(self.UpdateValues) + ')'
10031
10032 1
    __repr__ = __str__
10033
10034
10035 1 View Code Duplication
class UpdateStructureDataDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10036
    '''
10037
    :ivar NodeId:
10038
    :vartype NodeId: NodeId
10039
    :ivar PerformInsertReplace:
10040
    :vartype PerformInsertReplace: PerformUpdateType
10041
    :ivar UpdateValues:
10042
    :vartype UpdateValues: DataValue
10043
    '''
10044
10045 1
    ua_types = {
10046
        'NodeId': 'NodeId',
10047
        'PerformInsertReplace': 'PerformUpdateType',
10048
        'UpdateValues': 'DataValue',
10049
               }
10050
10051 1
    def __init__(self, binary=None):
10052
        if binary is not None:
10053
            self._binary_init(binary)
10054
            self._freeze = True
10055
            return
10056
        self.NodeId = NodeId()
10057
        self.PerformInsertReplace = PerformUpdateType(0)
10058
        self.UpdateValues = []
10059
        self._freeze = True
10060
10061 1
    def to_binary(self):
10062
        packet = []
10063
        packet.append(self.NodeId.to_binary())
10064
        packet.append(uabin.Primitives.UInt32.pack(self.PerformInsertReplace.value))
10065
        packet.append(uabin.Primitives.Int32.pack(len(self.UpdateValues)))
10066
        for fieldname in self.UpdateValues:
10067
            packet.append(fieldname.to_binary())
10068
        return b''.join(packet)
10069
10070 1
    @staticmethod
10071
    def from_binary(data):
10072
        return UpdateStructureDataDetails(data)
10073
10074 1
    def _binary_init(self, data):
10075
        self.NodeId = NodeId.from_binary(data)
10076
        self.PerformInsertReplace = PerformUpdateType(uabin.Primitives.UInt32.unpack(data))
10077
        length = uabin.Primitives.Int32.unpack(data)
10078
        array = []
10079
        if length != -1:
10080
            for _ in range(0, length):
10081
                array.append(DataValue.from_binary(data))
10082
        self.UpdateValues = array
10083
10084 1
    def __str__(self):
10085
        return 'UpdateStructureDataDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10086
               'PerformInsertReplace:' + str(self.PerformInsertReplace) + ', ' + \
10087
               'UpdateValues:' + str(self.UpdateValues) + ')'
10088
10089 1
    __repr__ = __str__
10090
10091
10092 1 View Code Duplication
class UpdateEventDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10093
    '''
10094
    :ivar NodeId:
10095
    :vartype NodeId: NodeId
10096
    :ivar PerformInsertReplace:
10097
    :vartype PerformInsertReplace: PerformUpdateType
10098
    :ivar Filter:
10099
    :vartype Filter: EventFilter
10100
    :ivar EventData:
10101
    :vartype EventData: HistoryEventFieldList
10102
    '''
10103
10104 1
    ua_types = {
10105
        'NodeId': 'NodeId',
10106
        'PerformInsertReplace': 'PerformUpdateType',
10107
        'Filter': 'EventFilter',
10108
        'EventData': 'HistoryEventFieldList',
10109
               }
10110
10111 1
    def __init__(self, binary=None):
10112
        if binary is not None:
10113
            self._binary_init(binary)
10114
            self._freeze = True
10115
            return
10116
        self.NodeId = NodeId()
10117
        self.PerformInsertReplace = PerformUpdateType(0)
10118
        self.Filter = EventFilter()
10119
        self.EventData = []
10120
        self._freeze = True
10121
10122 1
    def to_binary(self):
10123
        packet = []
10124
        packet.append(self.NodeId.to_binary())
10125
        packet.append(uabin.Primitives.UInt32.pack(self.PerformInsertReplace.value))
10126
        packet.append(self.Filter.to_binary())
10127
        packet.append(uabin.Primitives.Int32.pack(len(self.EventData)))
10128
        for fieldname in self.EventData:
10129
            packet.append(fieldname.to_binary())
10130
        return b''.join(packet)
10131
10132 1
    @staticmethod
10133
    def from_binary(data):
10134
        return UpdateEventDetails(data)
10135
10136 1
    def _binary_init(self, data):
10137
        self.NodeId = NodeId.from_binary(data)
10138
        self.PerformInsertReplace = PerformUpdateType(uabin.Primitives.UInt32.unpack(data))
10139
        self.Filter = EventFilter.from_binary(data)
10140
        length = uabin.Primitives.Int32.unpack(data)
10141
        array = []
10142
        if length != -1:
10143
            for _ in range(0, length):
10144
                array.append(HistoryEventFieldList.from_binary(data))
10145
        self.EventData = array
10146
10147 1
    def __str__(self):
10148
        return 'UpdateEventDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10149
               'PerformInsertReplace:' + str(self.PerformInsertReplace) + ', ' + \
10150
               'Filter:' + str(self.Filter) + ', ' + \
10151
               'EventData:' + str(self.EventData) + ')'
10152
10153 1
    __repr__ = __str__
10154
10155
10156 1 View Code Duplication
class DeleteRawModifiedDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10157
    '''
10158
    :ivar NodeId:
10159
    :vartype NodeId: NodeId
10160
    :ivar IsDeleteModified:
10161
    :vartype IsDeleteModified: Boolean
10162
    :ivar StartTime:
10163
    :vartype StartTime: DateTime
10164
    :ivar EndTime:
10165
    :vartype EndTime: DateTime
10166
    '''
10167
10168 1
    ua_types = {
10169
        'NodeId': 'NodeId',
10170
        'IsDeleteModified': 'Boolean',
10171
        'StartTime': 'DateTime',
10172
        'EndTime': 'DateTime',
10173
               }
10174
10175 1
    def __init__(self, binary=None):
10176
        if binary is not None:
10177
            self._binary_init(binary)
10178
            self._freeze = True
10179
            return
10180
        self.NodeId = NodeId()
10181
        self.IsDeleteModified = True
10182
        self.StartTime = datetime.now()
10183
        self.EndTime = datetime.now()
10184
        self._freeze = True
10185
10186 1
    def to_binary(self):
10187
        packet = []
10188
        packet.append(self.NodeId.to_binary())
10189
        packet.append(uabin.Primitives.Boolean.pack(self.IsDeleteModified))
10190
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
10191
        packet.append(uabin.Primitives.DateTime.pack(self.EndTime))
10192
        return b''.join(packet)
10193
10194 1
    @staticmethod
10195
    def from_binary(data):
10196
        return DeleteRawModifiedDetails(data)
10197
10198 1
    def _binary_init(self, data):
10199
        self.NodeId = NodeId.from_binary(data)
10200
        self.IsDeleteModified = uabin.Primitives.Boolean.unpack(data)
10201
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
10202
        self.EndTime = uabin.Primitives.DateTime.unpack(data)
10203
10204 1
    def __str__(self):
10205
        return 'DeleteRawModifiedDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10206
               'IsDeleteModified:' + str(self.IsDeleteModified) + ', ' + \
10207
               'StartTime:' + str(self.StartTime) + ', ' + \
10208
               'EndTime:' + str(self.EndTime) + ')'
10209
10210 1
    __repr__ = __str__
10211
10212
10213 1 View Code Duplication
class DeleteAtTimeDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10214
    '''
10215
    :ivar NodeId:
10216
    :vartype NodeId: NodeId
10217
    :ivar ReqTimes:
10218
    :vartype ReqTimes: DateTime
10219
    '''
10220
10221 1
    ua_types = {
10222
        'NodeId': 'NodeId',
10223
        'ReqTimes': 'DateTime',
10224
               }
10225
10226 1
    def __init__(self, binary=None):
10227
        if binary is not None:
10228
            self._binary_init(binary)
10229
            self._freeze = True
10230
            return
10231
        self.NodeId = NodeId()
10232
        self.ReqTimes = []
10233
        self._freeze = True
10234
10235 1
    def to_binary(self):
10236
        packet = []
10237
        packet.append(self.NodeId.to_binary())
10238
        packet.append(uabin.Primitives.Int32.pack(len(self.ReqTimes)))
10239
        for fieldname in self.ReqTimes:
10240
            packet.append(uabin.Primitives.DateTime.pack(fieldname))
10241
        return b''.join(packet)
10242
10243 1
    @staticmethod
10244
    def from_binary(data):
10245
        return DeleteAtTimeDetails(data)
10246
10247 1
    def _binary_init(self, data):
10248
        self.NodeId = NodeId.from_binary(data)
10249
        self.ReqTimes = uabin.Primitives.DateTime.unpack_array(data)
10250
10251 1
    def __str__(self):
10252
        return 'DeleteAtTimeDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10253
               'ReqTimes:' + str(self.ReqTimes) + ')'
10254
10255 1
    __repr__ = __str__
10256
10257
10258 1 View Code Duplication
class DeleteEventDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10259
    '''
10260
    :ivar NodeId:
10261
    :vartype NodeId: NodeId
10262
    :ivar EventIds:
10263
    :vartype EventIds: ByteString
10264
    '''
10265
10266 1
    ua_types = {
10267
        'NodeId': 'NodeId',
10268
        'EventIds': 'ByteString',
10269
               }
10270
10271 1
    def __init__(self, binary=None):
10272
        if binary is not None:
10273
            self._binary_init(binary)
10274
            self._freeze = True
10275
            return
10276
        self.NodeId = NodeId()
10277
        self.EventIds = []
10278
        self._freeze = True
10279
10280 1
    def to_binary(self):
10281
        packet = []
10282
        packet.append(self.NodeId.to_binary())
10283
        packet.append(uabin.Primitives.Int32.pack(len(self.EventIds)))
10284
        for fieldname in self.EventIds:
10285
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
10286
        return b''.join(packet)
10287
10288 1
    @staticmethod
10289
    def from_binary(data):
10290
        return DeleteEventDetails(data)
10291
10292 1
    def _binary_init(self, data):
10293
        self.NodeId = NodeId.from_binary(data)
10294
        self.EventIds = uabin.Primitives.ByteString.unpack_array(data)
10295
10296 1
    def __str__(self):
10297
        return 'DeleteEventDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10298
               'EventIds:' + str(self.EventIds) + ')'
10299
10300 1
    __repr__ = __str__
10301
10302
10303 1 View Code Duplication
class HistoryUpdateResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10304
    '''
10305
    :ivar StatusCode:
10306
    :vartype StatusCode: StatusCode
10307
    :ivar OperationResults:
10308
    :vartype OperationResults: StatusCode
10309
    :ivar DiagnosticInfos:
10310
    :vartype DiagnosticInfos: DiagnosticInfo
10311
    '''
10312
10313 1
    ua_types = {
10314
        'StatusCode': 'StatusCode',
10315
        'OperationResults': 'StatusCode',
10316
        'DiagnosticInfos': 'DiagnosticInfo',
10317
               }
10318
10319 1
    def __init__(self, binary=None):
10320
        if binary is not None:
10321
            self._binary_init(binary)
10322
            self._freeze = True
10323
            return
10324
        self.StatusCode = StatusCode()
10325
        self.OperationResults = []
10326
        self.DiagnosticInfos = []
10327
        self._freeze = True
10328
10329 1
    def to_binary(self):
10330
        packet = []
10331
        packet.append(self.StatusCode.to_binary())
10332
        packet.append(uabin.Primitives.Int32.pack(len(self.OperationResults)))
10333
        for fieldname in self.OperationResults:
10334
            packet.append(fieldname.to_binary())
10335
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
10336
        for fieldname in self.DiagnosticInfos:
10337
            packet.append(fieldname.to_binary())
10338
        return b''.join(packet)
10339
10340 1
    @staticmethod
10341
    def from_binary(data):
10342
        return HistoryUpdateResult(data)
10343
10344 1
    def _binary_init(self, data):
10345
        self.StatusCode = StatusCode.from_binary(data)
10346
        length = uabin.Primitives.Int32.unpack(data)
10347
        array = []
10348
        if length != -1:
10349
            for _ in range(0, length):
10350
                array.append(StatusCode.from_binary(data))
10351
        self.OperationResults = array
10352
        length = uabin.Primitives.Int32.unpack(data)
10353
        array = []
10354
        if length != -1:
10355
            for _ in range(0, length):
10356
                array.append(DiagnosticInfo.from_binary(data))
10357
        self.DiagnosticInfos = array
10358
10359 1
    def __str__(self):
10360
        return 'HistoryUpdateResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
10361
               'OperationResults:' + str(self.OperationResults) + ', ' + \
10362
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
10363
10364 1
    __repr__ = __str__
10365
10366
10367 1
class HistoryUpdateParameters(FrozenClass):
10368
    '''
10369
    :ivar HistoryUpdateDetails:
10370
    :vartype HistoryUpdateDetails: ExtensionObject
10371
    '''
10372
10373 1
    ua_types = {
10374
        'HistoryUpdateDetails': 'ExtensionObject',
10375
               }
10376
10377 1
    def __init__(self, binary=None):
10378
        if binary is not None:
10379
            self._binary_init(binary)
10380
            self._freeze = True
10381
            return
10382
        self.HistoryUpdateDetails = []
10383
        self._freeze = True
10384
10385 1
    def to_binary(self):
10386
        packet = []
10387
        packet.append(uabin.Primitives.Int32.pack(len(self.HistoryUpdateDetails)))
10388
        for fieldname in self.HistoryUpdateDetails:
10389
            packet.append(extensionobject_to_binary(fieldname))
10390
        return b''.join(packet)
10391
10392 1
    @staticmethod
10393
    def from_binary(data):
10394
        return HistoryUpdateParameters(data)
10395
10396 1
    def _binary_init(self, data):
10397
        length = uabin.Primitives.Int32.unpack(data)
10398
        array = []
10399
        if length != -1:
10400
            for _ in range(0, length):
10401
                array.append(extensionobject_from_binary(data))
10402
        self.HistoryUpdateDetails = array
10403
10404 1
    def __str__(self):
10405
        return 'HistoryUpdateParameters(' + 'HistoryUpdateDetails:' + str(self.HistoryUpdateDetails) + ')'
10406
10407 1
    __repr__ = __str__
10408
10409
10410 1
class HistoryUpdateRequest(FrozenClass):
10411
    '''
10412
    :ivar TypeId:
10413
    :vartype TypeId: NodeId
10414
    :ivar RequestHeader:
10415
    :vartype RequestHeader: RequestHeader
10416
    :ivar Parameters:
10417
    :vartype Parameters: HistoryUpdateParameters
10418
    '''
10419
10420 1
    ua_types = {
10421
        'TypeId': 'NodeId',
10422
        'RequestHeader': 'RequestHeader',
10423
        'Parameters': 'HistoryUpdateParameters',
10424
               }
10425
10426 1
    def __init__(self, binary=None):
10427
        if binary is not None:
10428
            self._binary_init(binary)
10429
            self._freeze = True
10430
            return
10431
        self.TypeId = FourByteNodeId(ObjectIds.HistoryUpdateRequest_Encoding_DefaultBinary)
10432
        self.RequestHeader = RequestHeader()
10433
        self.Parameters = HistoryUpdateParameters()
10434
        self._freeze = True
10435
10436 1
    def to_binary(self):
10437
        packet = []
10438
        packet.append(self.TypeId.to_binary())
10439
        packet.append(self.RequestHeader.to_binary())
10440
        packet.append(self.Parameters.to_binary())
10441
        return b''.join(packet)
10442
10443 1
    @staticmethod
10444
    def from_binary(data):
10445
        return HistoryUpdateRequest(data)
10446
10447 1
    def _binary_init(self, data):
10448
        self.TypeId = NodeId.from_binary(data)
10449
        self.RequestHeader = RequestHeader.from_binary(data)
10450
        self.Parameters = HistoryUpdateParameters.from_binary(data)
10451
10452 1
    def __str__(self):
10453
        return 'HistoryUpdateRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10454
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
10455
               'Parameters:' + str(self.Parameters) + ')'
10456
10457 1
    __repr__ = __str__
10458
10459
10460 1
class HistoryUpdateResponse(FrozenClass):
10461
    '''
10462
    :ivar TypeId:
10463
    :vartype TypeId: NodeId
10464
    :ivar ResponseHeader:
10465
    :vartype ResponseHeader: ResponseHeader
10466
    :ivar Results:
10467
    :vartype Results: HistoryUpdateResult
10468
    :ivar DiagnosticInfos:
10469
    :vartype DiagnosticInfos: DiagnosticInfo
10470
    '''
10471
10472 1
    ua_types = {
10473
        'TypeId': 'NodeId',
10474
        'ResponseHeader': 'ResponseHeader',
10475
        'Results': 'HistoryUpdateResult',
10476
        'DiagnosticInfos': 'DiagnosticInfo',
10477
               }
10478
10479 1
    def __init__(self, binary=None):
10480
        if binary is not None:
10481
            self._binary_init(binary)
10482
            self._freeze = True
10483
            return
10484
        self.TypeId = FourByteNodeId(ObjectIds.HistoryUpdateResponse_Encoding_DefaultBinary)
10485
        self.ResponseHeader = ResponseHeader()
10486
        self.Results = []
10487
        self.DiagnosticInfos = []
10488
        self._freeze = True
10489
10490 1
    def to_binary(self):
10491
        packet = []
10492
        packet.append(self.TypeId.to_binary())
10493
        packet.append(self.ResponseHeader.to_binary())
10494
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
10495
        for fieldname in self.Results:
10496
            packet.append(fieldname.to_binary())
10497
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
10498
        for fieldname in self.DiagnosticInfos:
10499
            packet.append(fieldname.to_binary())
10500
        return b''.join(packet)
10501
10502 1
    @staticmethod
10503
    def from_binary(data):
10504
        return HistoryUpdateResponse(data)
10505
10506 1
    def _binary_init(self, data):
10507
        self.TypeId = NodeId.from_binary(data)
10508
        self.ResponseHeader = ResponseHeader.from_binary(data)
10509
        length = uabin.Primitives.Int32.unpack(data)
10510
        array = []
10511
        if length != -1:
10512
            for _ in range(0, length):
10513
                array.append(HistoryUpdateResult.from_binary(data))
10514
        self.Results = array
10515
        length = uabin.Primitives.Int32.unpack(data)
10516
        array = []
10517
        if length != -1:
10518
            for _ in range(0, length):
10519
                array.append(DiagnosticInfo.from_binary(data))
10520
        self.DiagnosticInfos = array
10521
10522 1
    def __str__(self):
10523
        return 'HistoryUpdateResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10524
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
10525
               'Results:' + str(self.Results) + ', ' + \
10526
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
10527
10528 1
    __repr__ = __str__
10529
10530
10531 1 View Code Duplication
class CallMethodRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10532
    '''
10533
    :ivar ObjectId:
10534
    :vartype ObjectId: NodeId
10535
    :ivar MethodId:
10536
    :vartype MethodId: NodeId
10537
    :ivar InputArguments:
10538
    :vartype InputArguments: Variant
10539
    '''
10540
10541 1
    ua_types = {
10542
        'ObjectId': 'NodeId',
10543
        'MethodId': 'NodeId',
10544
        'InputArguments': 'Variant',
10545
               }
10546
10547 1
    def __init__(self, binary=None):
10548 1
        if binary is not None:
10549 1
            self._binary_init(binary)
10550 1
            self._freeze = True
10551 1
            return
10552 1
        self.ObjectId = NodeId()
10553 1
        self.MethodId = NodeId()
10554 1
        self.InputArguments = []
10555 1
        self._freeze = True
10556
10557 1
    def to_binary(self):
10558 1
        packet = []
10559 1
        packet.append(self.ObjectId.to_binary())
10560 1
        packet.append(self.MethodId.to_binary())
10561 1
        packet.append(uabin.Primitives.Int32.pack(len(self.InputArguments)))
10562 1
        for fieldname in self.InputArguments:
10563 1
            packet.append(fieldname.to_binary())
10564 1
        return b''.join(packet)
10565
10566 1
    @staticmethod
10567
    def from_binary(data):
10568 1
        return CallMethodRequest(data)
10569
10570 1
    def _binary_init(self, data):
10571 1
        self.ObjectId = NodeId.from_binary(data)
10572 1
        self.MethodId = NodeId.from_binary(data)
10573 1
        length = uabin.Primitives.Int32.unpack(data)
10574 1
        array = []
10575 1
        if length != -1:
10576 1
            for _ in range(0, length):
10577 1
                array.append(Variant.from_binary(data))
10578 1
        self.InputArguments = array
10579
10580 1
    def __str__(self):
10581 1
        return 'CallMethodRequest(' + 'ObjectId:' + str(self.ObjectId) + ', ' + \
10582
               'MethodId:' + str(self.MethodId) + ', ' + \
10583
               'InputArguments:' + str(self.InputArguments) + ')'
10584
10585 1
    __repr__ = __str__
10586
10587
10588 1
class CallMethodResult(FrozenClass):
10589
    '''
10590
    :ivar StatusCode:
10591
    :vartype StatusCode: StatusCode
10592
    :ivar InputArgumentResults:
10593
    :vartype InputArgumentResults: StatusCode
10594
    :ivar InputArgumentDiagnosticInfos:
10595
    :vartype InputArgumentDiagnosticInfos: DiagnosticInfo
10596
    :ivar OutputArguments:
10597
    :vartype OutputArguments: Variant
10598
    '''
10599
10600 1
    ua_types = {
10601
        'StatusCode': 'StatusCode',
10602
        'InputArgumentResults': 'StatusCode',
10603
        'InputArgumentDiagnosticInfos': 'DiagnosticInfo',
10604
        'OutputArguments': 'Variant',
10605
               }
10606
10607 1
    def __init__(self, binary=None):
10608 1
        if binary is not None:
10609 1
            self._binary_init(binary)
10610 1
            self._freeze = True
10611 1
            return
10612 1
        self.StatusCode = StatusCode()
10613 1
        self.InputArgumentResults = []
10614 1
        self.InputArgumentDiagnosticInfos = []
10615 1
        self.OutputArguments = []
10616 1
        self._freeze = True
10617
10618 1 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10619 1
        packet = []
10620 1
        packet.append(self.StatusCode.to_binary())
10621 1
        packet.append(uabin.Primitives.Int32.pack(len(self.InputArgumentResults)))
10622 1
        for fieldname in self.InputArgumentResults:
10623 1
            packet.append(fieldname.to_binary())
10624 1
        packet.append(uabin.Primitives.Int32.pack(len(self.InputArgumentDiagnosticInfos)))
10625 1
        for fieldname in self.InputArgumentDiagnosticInfos:
10626
            packet.append(fieldname.to_binary())
10627 1
        packet.append(uabin.Primitives.Int32.pack(len(self.OutputArguments)))
10628 1
        for fieldname in self.OutputArguments:
10629 1
            packet.append(fieldname.to_binary())
10630 1
        return b''.join(packet)
10631
10632 1
    @staticmethod
10633
    def from_binary(data):
10634 1
        return CallMethodResult(data)
10635
10636 1
    def _binary_init(self, data):
10637 1
        self.StatusCode = StatusCode.from_binary(data)
10638 1
        length = uabin.Primitives.Int32.unpack(data)
10639 1
        array = []
10640 1
        if length != -1:
10641 1
            for _ in range(0, length):
10642 1
                array.append(StatusCode.from_binary(data))
10643 1
        self.InputArgumentResults = array
10644 1
        length = uabin.Primitives.Int32.unpack(data)
10645 1
        array = []
10646 1
        if length != -1:
10647 1
            for _ in range(0, length):
10648
                array.append(DiagnosticInfo.from_binary(data))
10649 1
        self.InputArgumentDiagnosticInfos = array
10650 1
        length = uabin.Primitives.Int32.unpack(data)
10651 1
        array = []
10652 1
        if length != -1:
10653 1
            for _ in range(0, length):
10654 1
                array.append(Variant.from_binary(data))
10655 1
        self.OutputArguments = array
10656
10657 1
    def __str__(self):
10658
        return 'CallMethodResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
10659
               'InputArgumentResults:' + str(self.InputArgumentResults) + ', ' + \
10660
               'InputArgumentDiagnosticInfos:' + str(self.InputArgumentDiagnosticInfos) + ', ' + \
10661
               'OutputArguments:' + str(self.OutputArguments) + ')'
10662
10663 1
    __repr__ = __str__
10664
10665
10666 1
class CallParameters(FrozenClass):
10667
    '''
10668
    :ivar MethodsToCall:
10669
    :vartype MethodsToCall: CallMethodRequest
10670
    '''
10671
10672 1
    ua_types = {
10673
        'MethodsToCall': 'CallMethodRequest',
10674
               }
10675
10676 1
    def __init__(self, binary=None):
10677 1
        if binary is not None:
10678 1
            self._binary_init(binary)
10679 1
            self._freeze = True
10680 1
            return
10681 1
        self.MethodsToCall = []
10682 1
        self._freeze = True
10683
10684 1
    def to_binary(self):
10685 1
        packet = []
10686 1
        packet.append(uabin.Primitives.Int32.pack(len(self.MethodsToCall)))
10687 1
        for fieldname in self.MethodsToCall:
10688 1
            packet.append(fieldname.to_binary())
10689 1
        return b''.join(packet)
10690
10691 1
    @staticmethod
10692
    def from_binary(data):
10693 1
        return CallParameters(data)
10694
10695 1
    def _binary_init(self, data):
10696 1
        length = uabin.Primitives.Int32.unpack(data)
10697 1
        array = []
10698 1
        if length != -1:
10699 1
            for _ in range(0, length):
10700 1
                array.append(CallMethodRequest.from_binary(data))
10701 1
        self.MethodsToCall = array
10702
10703 1
    def __str__(self):
10704
        return 'CallParameters(' + 'MethodsToCall:' + str(self.MethodsToCall) + ')'
10705
10706 1
    __repr__ = __str__
10707
10708
10709 1
class CallRequest(FrozenClass):
10710
    '''
10711
    :ivar TypeId:
10712
    :vartype TypeId: NodeId
10713
    :ivar RequestHeader:
10714
    :vartype RequestHeader: RequestHeader
10715
    :ivar Parameters:
10716
    :vartype Parameters: CallParameters
10717
    '''
10718
10719 1
    ua_types = {
10720
        'TypeId': 'NodeId',
10721
        'RequestHeader': 'RequestHeader',
10722
        'Parameters': 'CallParameters',
10723
               }
10724
10725 1
    def __init__(self, binary=None):
10726 1
        if binary is not None:
10727
            self._binary_init(binary)
10728
            self._freeze = True
10729
            return
10730 1
        self.TypeId = FourByteNodeId(ObjectIds.CallRequest_Encoding_DefaultBinary)
10731 1
        self.RequestHeader = RequestHeader()
10732 1
        self.Parameters = CallParameters()
10733 1
        self._freeze = True
10734
10735 1
    def to_binary(self):
10736 1
        packet = []
10737 1
        packet.append(self.TypeId.to_binary())
10738 1
        packet.append(self.RequestHeader.to_binary())
10739 1
        packet.append(self.Parameters.to_binary())
10740 1
        return b''.join(packet)
10741
10742 1
    @staticmethod
10743
    def from_binary(data):
10744
        return CallRequest(data)
10745
10746 1
    def _binary_init(self, data):
10747
        self.TypeId = NodeId.from_binary(data)
10748 View Code Duplication
        self.RequestHeader = RequestHeader.from_binary(data)
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10749
        self.Parameters = CallParameters.from_binary(data)
10750
10751 1
    def __str__(self):
10752
        return 'CallRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10753
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
10754
               'Parameters:' + str(self.Parameters) + ')'
10755
10756 1
    __repr__ = __str__
10757
10758
10759 1
class CallResponse(FrozenClass):
10760
    '''
10761
    :ivar TypeId:
10762
    :vartype TypeId: NodeId
10763
    :ivar ResponseHeader:
10764
    :vartype ResponseHeader: ResponseHeader
10765
    :ivar Results:
10766
    :vartype Results: CallMethodResult
10767
    :ivar DiagnosticInfos:
10768
    :vartype DiagnosticInfos: DiagnosticInfo
10769
    '''
10770
10771 1
    ua_types = {
10772
        'TypeId': 'NodeId',
10773
        'ResponseHeader': 'ResponseHeader',
10774
        'Results': 'CallMethodResult',
10775
        'DiagnosticInfos': 'DiagnosticInfo',
10776
               }
10777
10778 1
    def __init__(self, binary=None):
10779 1
        if binary is not None:
10780 1
            self._binary_init(binary)
10781 1
            self._freeze = True
10782 1
            return
10783 1
        self.TypeId = FourByteNodeId(ObjectIds.CallResponse_Encoding_DefaultBinary)
10784 1
        self.ResponseHeader = ResponseHeader()
10785 1
        self.Results = []
10786 1
        self.DiagnosticInfos = []
10787 1
        self._freeze = True
10788
10789 1
    def to_binary(self):
10790 1
        packet = []
10791 1
        packet.append(self.TypeId.to_binary())
10792 1
        packet.append(self.ResponseHeader.to_binary())
10793 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
10794 1
        for fieldname in self.Results:
10795 1
            packet.append(fieldname.to_binary())
10796 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
10797 1
        for fieldname in self.DiagnosticInfos:
10798
            packet.append(fieldname.to_binary())
10799 1
        return b''.join(packet)
10800
10801 1
    @staticmethod
10802
    def from_binary(data):
10803 1
        return CallResponse(data)
10804
10805 1
    def _binary_init(self, data):
10806 1
        self.TypeId = NodeId.from_binary(data)
10807 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
10808 1
        length = uabin.Primitives.Int32.unpack(data)
10809 1
        array = []
10810 1
        if length != -1:
10811 1
            for _ in range(0, length):
10812 1
                array.append(CallMethodResult.from_binary(data))
10813 1
        self.Results = array
10814 1
        length = uabin.Primitives.Int32.unpack(data)
10815 1
        array = []
10816 1
        if length != -1:
10817 1
            for _ in range(0, length):
10818
                array.append(DiagnosticInfo.from_binary(data))
10819 1
        self.DiagnosticInfos = array
10820
10821 1
    def __str__(self):
10822
        return 'CallResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10823
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
10824
               'Results:' + str(self.Results) + ', ' + \
10825
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
10826
10827 1
    __repr__ = __str__
10828
10829
10830 1 View Code Duplication
class MonitoringFilter(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10831
    '''
10832
    '''
10833
10834 1
    ua_types = {
10835
               }
10836
10837 1
    def __init__(self, binary=None):
10838
        if binary is not None:
10839
            self._binary_init(binary)
10840
            self._freeze = True
10841
            return
10842
        self._freeze = True
10843
10844 1
    def to_binary(self):
10845
        packet = []
10846
        return b''.join(packet)
10847
10848 1
    @staticmethod
10849
    def from_binary(data):
10850
        return MonitoringFilter(data)
10851
10852 1
    def _binary_init(self, data):
10853
        pass
10854
10855 1
    def __str__(self):
10856
        return 'MonitoringFilter(' +  + ')'
10857
10858 1
    __repr__ = __str__
10859
10860
10861 1 View Code Duplication
class DataChangeFilter(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10862
    '''
10863
    :ivar Trigger:
10864
    :vartype Trigger: DataChangeTrigger
10865
    :ivar DeadbandType:
10866
    :vartype DeadbandType: UInt32
10867
    :ivar DeadbandValue:
10868
    :vartype DeadbandValue: Double
10869
    '''
10870
10871 1
    ua_types = {
10872
        'Trigger': 'DataChangeTrigger',
10873
        'DeadbandType': 'UInt32',
10874
        'DeadbandValue': 'Double',
10875
               }
10876
10877 1
    def __init__(self, binary=None):
10878
        if binary is not None:
10879
            self._binary_init(binary)
10880
            self._freeze = True
10881
            return
10882
        self.Trigger = DataChangeTrigger(0)
10883
        self.DeadbandType = 0
10884
        self.DeadbandValue = 0
10885
        self._freeze = True
10886
10887 1
    def to_binary(self):
10888
        packet = []
10889
        packet.append(uabin.Primitives.UInt32.pack(self.Trigger.value))
10890
        packet.append(uabin.Primitives.UInt32.pack(self.DeadbandType))
10891
        packet.append(uabin.Primitives.Double.pack(self.DeadbandValue))
10892
        return b''.join(packet)
10893
10894 1
    @staticmethod
10895
    def from_binary(data):
10896
        return DataChangeFilter(data)
10897
10898 1
    def _binary_init(self, data):
10899
        self.Trigger = DataChangeTrigger(uabin.Primitives.UInt32.unpack(data))
10900
        self.DeadbandType = uabin.Primitives.UInt32.unpack(data)
10901
        self.DeadbandValue = uabin.Primitives.Double.unpack(data)
10902
10903 1
    def __str__(self):
10904
        return 'DataChangeFilter(' + 'Trigger:' + str(self.Trigger) + ', ' + \
10905
               'DeadbandType:' + str(self.DeadbandType) + ', ' + \
10906
               'DeadbandValue:' + str(self.DeadbandValue) + ')'
10907
10908 1
    __repr__ = __str__
10909
10910
10911 1 View Code Duplication
class EventFilter(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10912
    '''
10913
    :ivar SelectClauses:
10914
    :vartype SelectClauses: SimpleAttributeOperand
10915
    :ivar WhereClause:
10916
    :vartype WhereClause: ContentFilter
10917
    '''
10918
10919 1
    ua_types = {
10920
        'SelectClauses': 'SimpleAttributeOperand',
10921
        'WhereClause': 'ContentFilter',
10922
               }
10923
10924 1
    def __init__(self, binary=None):
10925 1
        if binary is not None:
10926 1
            self._binary_init(binary)
10927 1
            self._freeze = True
10928 1
            return
10929 1
        self.SelectClauses = []
10930 1
        self.WhereClause = ContentFilter()
10931 1
        self._freeze = True
10932
10933 1
    def to_binary(self):
10934 1
        packet = []
10935 1
        packet.append(uabin.Primitives.Int32.pack(len(self.SelectClauses)))
10936 1
        for fieldname in self.SelectClauses:
10937 1
            packet.append(fieldname.to_binary())
10938 1
        packet.append(self.WhereClause.to_binary())
10939 1
        return b''.join(packet)
10940
10941 1
    @staticmethod
10942
    def from_binary(data):
10943 1
        return EventFilter(data)
10944
10945 1
    def _binary_init(self, data):
10946 1
        length = uabin.Primitives.Int32.unpack(data)
10947 1
        array = []
10948 1
        if length != -1:
10949 1
            for _ in range(0, length):
10950 1
                array.append(SimpleAttributeOperand.from_binary(data))
10951 1
        self.SelectClauses = array
10952 1
        self.WhereClause = ContentFilter.from_binary(data)
10953
10954 1
    def __str__(self):
10955
        return 'EventFilter(' + 'SelectClauses:' + str(self.SelectClauses) + ', ' + \
10956
               'WhereClause:' + str(self.WhereClause) + ')'
10957
10958 1
    __repr__ = __str__
10959
10960
10961 1 View Code Duplication
class AggregateConfiguration(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10962
    '''
10963
    :ivar UseServerCapabilitiesDefaults:
10964
    :vartype UseServerCapabilitiesDefaults: Boolean
10965
    :ivar TreatUncertainAsBad:
10966
    :vartype TreatUncertainAsBad: Boolean
10967
    :ivar PercentDataBad:
10968
    :vartype PercentDataBad: Byte
10969
    :ivar PercentDataGood:
10970
    :vartype PercentDataGood: Byte
10971
    :ivar UseSlopedExtrapolation:
10972
    :vartype UseSlopedExtrapolation: Boolean
10973
    '''
10974
10975 1
    ua_types = {
10976
        'UseServerCapabilitiesDefaults': 'Boolean',
10977
        'TreatUncertainAsBad': 'Boolean',
10978
        'PercentDataBad': 'Byte',
10979
        'PercentDataGood': 'Byte',
10980
        'UseSlopedExtrapolation': 'Boolean',
10981
               }
10982
10983 1
    def __init__(self, binary=None):
10984
        if binary is not None:
10985
            self._binary_init(binary)
10986
            self._freeze = True
10987
            return
10988
        self.UseServerCapabilitiesDefaults = True
10989
        self.TreatUncertainAsBad = True
10990
        self.PercentDataBad = 0
10991
        self.PercentDataGood = 0
10992
        self.UseSlopedExtrapolation = True
10993
        self._freeze = True
10994
10995 1
    def to_binary(self):
10996
        packet = []
10997
        packet.append(uabin.Primitives.Boolean.pack(self.UseServerCapabilitiesDefaults))
10998
        packet.append(uabin.Primitives.Boolean.pack(self.TreatUncertainAsBad))
10999
        packet.append(uabin.Primitives.Byte.pack(self.PercentDataBad))
11000
        packet.append(uabin.Primitives.Byte.pack(self.PercentDataGood))
11001
        packet.append(uabin.Primitives.Boolean.pack(self.UseSlopedExtrapolation))
11002
        return b''.join(packet)
11003
11004 1
    @staticmethod
11005
    def from_binary(data):
11006
        return AggregateConfiguration(data)
11007
11008 1
    def _binary_init(self, data):
11009
        self.UseServerCapabilitiesDefaults = uabin.Primitives.Boolean.unpack(data)
11010
        self.TreatUncertainAsBad = uabin.Primitives.Boolean.unpack(data)
11011
        self.PercentDataBad = uabin.Primitives.Byte.unpack(data)
11012
        self.PercentDataGood = uabin.Primitives.Byte.unpack(data)
11013
        self.UseSlopedExtrapolation = uabin.Primitives.Boolean.unpack(data)
11014
11015 1
    def __str__(self):
11016
        return 'AggregateConfiguration(' + 'UseServerCapabilitiesDefaults:' + str(self.UseServerCapabilitiesDefaults) + ', ' + \
11017
               'TreatUncertainAsBad:' + str(self.TreatUncertainAsBad) + ', ' + \
11018
               'PercentDataBad:' + str(self.PercentDataBad) + ', ' + \
11019
               'PercentDataGood:' + str(self.PercentDataGood) + ', ' + \
11020
               'UseSlopedExtrapolation:' + str(self.UseSlopedExtrapolation) + ')'
11021
11022 1
    __repr__ = __str__
11023
11024
11025 1 View Code Duplication
class AggregateFilter(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11026
    '''
11027
    :ivar StartTime:
11028
    :vartype StartTime: DateTime
11029
    :ivar AggregateType:
11030
    :vartype AggregateType: NodeId
11031
    :ivar ProcessingInterval:
11032
    :vartype ProcessingInterval: Double
11033
    :ivar AggregateConfiguration:
11034
    :vartype AggregateConfiguration: AggregateConfiguration
11035
    '''
11036
11037 1
    ua_types = {
11038
        'StartTime': 'DateTime',
11039
        'AggregateType': 'NodeId',
11040
        'ProcessingInterval': 'Double',
11041
        'AggregateConfiguration': 'AggregateConfiguration',
11042
               }
11043
11044 1
    def __init__(self, binary=None):
11045
        if binary is not None:
11046
            self._binary_init(binary)
11047
            self._freeze = True
11048
            return
11049
        self.StartTime = datetime.now()
11050
        self.AggregateType = NodeId()
11051
        self.ProcessingInterval = 0
11052
        self.AggregateConfiguration = AggregateConfiguration()
11053
        self._freeze = True
11054
11055 1
    def to_binary(self):
11056
        packet = []
11057
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
11058
        packet.append(self.AggregateType.to_binary())
11059
        packet.append(uabin.Primitives.Double.pack(self.ProcessingInterval))
11060
        packet.append(self.AggregateConfiguration.to_binary())
11061
        return b''.join(packet)
11062
11063 1
    @staticmethod
11064
    def from_binary(data):
11065
        return AggregateFilter(data)
11066
11067 1
    def _binary_init(self, data):
11068
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
11069
        self.AggregateType = NodeId.from_binary(data)
11070
        self.ProcessingInterval = uabin.Primitives.Double.unpack(data)
11071
        self.AggregateConfiguration = AggregateConfiguration.from_binary(data)
11072
11073 1
    def __str__(self):
11074
        return 'AggregateFilter(' + 'StartTime:' + str(self.StartTime) + ', ' + \
11075
               'AggregateType:' + str(self.AggregateType) + ', ' + \
11076
               'ProcessingInterval:' + str(self.ProcessingInterval) + ', ' + \
11077
               'AggregateConfiguration:' + str(self.AggregateConfiguration) + ')'
11078
11079 1
    __repr__ = __str__
11080
11081
11082 1 View Code Duplication
class MonitoringFilterResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11083
    '''
11084
    '''
11085
11086 1
    ua_types = {
11087
               }
11088
11089 1
    def __init__(self, binary=None):
11090
        if binary is not None:
11091
            self._binary_init(binary)
11092
            self._freeze = True
11093
            return
11094
        self._freeze = True
11095
11096 1
    def to_binary(self):
11097
        packet = []
11098
        return b''.join(packet)
11099
11100 1
    @staticmethod
11101
    def from_binary(data):
11102
        return MonitoringFilterResult(data)
11103
11104 1
    def _binary_init(self, data):
11105
        pass
11106
11107 1
    def __str__(self):
11108
        return 'MonitoringFilterResult(' +  + ')'
11109
11110 1
    __repr__ = __str__
11111
11112
11113 1 View Code Duplication
class EventFilterResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11114
    '''
11115
    :ivar SelectClauseResults:
11116
    :vartype SelectClauseResults: StatusCode
11117
    :ivar SelectClauseDiagnosticInfos:
11118
    :vartype SelectClauseDiagnosticInfos: DiagnosticInfo
11119
    :ivar WhereClauseResult:
11120
    :vartype WhereClauseResult: ContentFilterResult
11121
    '''
11122
11123 1
    ua_types = {
11124
        'SelectClauseResults': 'StatusCode',
11125
        'SelectClauseDiagnosticInfos': 'DiagnosticInfo',
11126
        'WhereClauseResult': 'ContentFilterResult',
11127
               }
11128
11129 1
    def __init__(self, binary=None):
11130
        if binary is not None:
11131
            self._binary_init(binary)
11132
            self._freeze = True
11133
            return
11134
        self.SelectClauseResults = []
11135
        self.SelectClauseDiagnosticInfos = []
11136
        self.WhereClauseResult = ContentFilterResult()
11137
        self._freeze = True
11138
11139 1
    def to_binary(self):
11140
        packet = []
11141
        packet.append(uabin.Primitives.Int32.pack(len(self.SelectClauseResults)))
11142
        for fieldname in self.SelectClauseResults:
11143
            packet.append(fieldname.to_binary())
11144
        packet.append(uabin.Primitives.Int32.pack(len(self.SelectClauseDiagnosticInfos)))
11145
        for fieldname in self.SelectClauseDiagnosticInfos:
11146
            packet.append(fieldname.to_binary())
11147
        packet.append(self.WhereClauseResult.to_binary())
11148
        return b''.join(packet)
11149
11150 1
    @staticmethod
11151
    def from_binary(data):
11152
        return EventFilterResult(data)
11153
11154 1
    def _binary_init(self, data):
11155
        length = uabin.Primitives.Int32.unpack(data)
11156
        array = []
11157
        if length != -1:
11158
            for _ in range(0, length):
11159
                array.append(StatusCode.from_binary(data))
11160
        self.SelectClauseResults = array
11161
        length = uabin.Primitives.Int32.unpack(data)
11162
        array = []
11163
        if length != -1:
11164
            for _ in range(0, length):
11165
                array.append(DiagnosticInfo.from_binary(data))
11166
        self.SelectClauseDiagnosticInfos = array
11167
        self.WhereClauseResult = ContentFilterResult.from_binary(data)
11168
11169 1
    def __str__(self):
11170
        return 'EventFilterResult(' + 'SelectClauseResults:' + str(self.SelectClauseResults) + ', ' + \
11171
               'SelectClauseDiagnosticInfos:' + str(self.SelectClauseDiagnosticInfos) + ', ' + \
11172
               'WhereClauseResult:' + str(self.WhereClauseResult) + ')'
11173
11174 1
    __repr__ = __str__
11175
11176
11177 1 View Code Duplication
class AggregateFilterResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11178
    '''
11179
    :ivar RevisedStartTime:
11180
    :vartype RevisedStartTime: DateTime
11181
    :ivar RevisedProcessingInterval:
11182
    :vartype RevisedProcessingInterval: Double
11183
    :ivar RevisedAggregateConfiguration:
11184
    :vartype RevisedAggregateConfiguration: AggregateConfiguration
11185
    '''
11186
11187 1
    ua_types = {
11188
        'RevisedStartTime': 'DateTime',
11189
        'RevisedProcessingInterval': 'Double',
11190
        'RevisedAggregateConfiguration': 'AggregateConfiguration',
11191
               }
11192
11193 1
    def __init__(self, binary=None):
11194
        if binary is not None:
11195
            self._binary_init(binary)
11196
            self._freeze = True
11197
            return
11198
        self.RevisedStartTime = datetime.now()
11199
        self.RevisedProcessingInterval = 0
11200
        self.RevisedAggregateConfiguration = AggregateConfiguration()
11201
        self._freeze = True
11202
11203 1
    def to_binary(self):
11204
        packet = []
11205
        packet.append(uabin.Primitives.DateTime.pack(self.RevisedStartTime))
11206
        packet.append(uabin.Primitives.Double.pack(self.RevisedProcessingInterval))
11207
        packet.append(self.RevisedAggregateConfiguration.to_binary())
11208
        return b''.join(packet)
11209
11210 1
    @staticmethod
11211
    def from_binary(data):
11212
        return AggregateFilterResult(data)
11213
11214 1
    def _binary_init(self, data):
11215
        self.RevisedStartTime = uabin.Primitives.DateTime.unpack(data)
11216
        self.RevisedProcessingInterval = uabin.Primitives.Double.unpack(data)
11217
        self.RevisedAggregateConfiguration = AggregateConfiguration.from_binary(data)
11218
11219 1
    def __str__(self):
11220
        return 'AggregateFilterResult(' + 'RevisedStartTime:' + str(self.RevisedStartTime) + ', ' + \
11221
               'RevisedProcessingInterval:' + str(self.RevisedProcessingInterval) + ', ' + \
11222
               'RevisedAggregateConfiguration:' + str(self.RevisedAggregateConfiguration) + ')'
11223
11224 1
    __repr__ = __str__
11225
11226
11227 1
class MonitoringParameters(FrozenClass):
11228
    '''
11229
    :ivar ClientHandle:
11230
    :vartype ClientHandle: UInt32
11231
    :ivar SamplingInterval:
11232
    :vartype SamplingInterval: Double
11233
    :ivar Filter:
11234
    :vartype Filter: ExtensionObject
11235
    :ivar QueueSize:
11236
    :vartype QueueSize: UInt32
11237
    :ivar DiscardOldest:
11238
    :vartype DiscardOldest: Boolean
11239
    '''
11240
11241 1
    ua_types = {
11242
        'ClientHandle': 'UInt32',
11243
        'SamplingInterval': 'Double',
11244
        'Filter': 'ExtensionObject',
11245
        'QueueSize': 'UInt32',
11246
        'DiscardOldest': 'Boolean',
11247
               }
11248
11249 1
    def __init__(self, binary=None):
11250 1
        if binary is not None:
11251 1
            self._binary_init(binary)
11252 1
            self._freeze = True
11253 1
            return
11254 1
        self.ClientHandle = 0
11255 1
        self.SamplingInterval = 0
11256 1
        self.Filter = None
11257 1
        self.QueueSize = 0
11258 1
        self.DiscardOldest = True
11259 1
        self._freeze = True
11260
11261 1
    def to_binary(self):
11262 1
        packet = []
11263 1
        packet.append(uabin.Primitives.UInt32.pack(self.ClientHandle))
11264 1
        packet.append(uabin.Primitives.Double.pack(self.SamplingInterval))
11265 1
        packet.append(extensionobject_to_binary(self.Filter))
11266 1
        packet.append(uabin.Primitives.UInt32.pack(self.QueueSize))
11267 1
        packet.append(uabin.Primitives.Boolean.pack(self.DiscardOldest))
11268 1
        return b''.join(packet)
11269
11270 1
    @staticmethod
11271
    def from_binary(data):
11272 1
        return MonitoringParameters(data)
11273
11274 1
    def _binary_init(self, data):
11275 1
        self.ClientHandle = uabin.Primitives.UInt32.unpack(data)
11276 1
        self.SamplingInterval = uabin.Primitives.Double.unpack(data)
11277 1
        self.Filter = extensionobject_from_binary(data)
11278 1
        self.QueueSize = uabin.Primitives.UInt32.unpack(data)
11279 1
        self.DiscardOldest = uabin.Primitives.Boolean.unpack(data)
11280
11281 1
    def __str__(self):
11282
        return 'MonitoringParameters(' + 'ClientHandle:' + str(self.ClientHandle) + ', ' + \
11283
               'SamplingInterval:' + str(self.SamplingInterval) + ', ' + \
11284
               'Filter:' + str(self.Filter) + ', ' + \
11285
               'QueueSize:' + str(self.QueueSize) + ', ' + \
11286
               'DiscardOldest:' + str(self.DiscardOldest) + ')'
11287
11288 1
    __repr__ = __str__
11289
11290
11291 1 View Code Duplication
class MonitoredItemCreateRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11292
    '''
11293
    :ivar ItemToMonitor:
11294
    :vartype ItemToMonitor: ReadValueId
11295
    :ivar MonitoringMode:
11296
    :vartype MonitoringMode: MonitoringMode
11297
    :ivar RequestedParameters:
11298
    :vartype RequestedParameters: MonitoringParameters
11299
    '''
11300
11301 1
    ua_types = {
11302
        'ItemToMonitor': 'ReadValueId',
11303
        'MonitoringMode': 'MonitoringMode',
11304
        'RequestedParameters': 'MonitoringParameters',
11305
               }
11306
11307 1
    def __init__(self, binary=None):
11308 1
        if binary is not None:
11309 1
            self._binary_init(binary)
11310 1
            self._freeze = True
11311 1
            return
11312 1
        self.ItemToMonitor = ReadValueId()
11313 1
        self.MonitoringMode = MonitoringMode(0)
11314 1
        self.RequestedParameters = MonitoringParameters()
11315 1
        self._freeze = True
11316
11317 1
    def to_binary(self):
11318 1
        packet = []
11319 1
        packet.append(self.ItemToMonitor.to_binary())
11320 1
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoringMode.value))
11321 1
        packet.append(self.RequestedParameters.to_binary())
11322 1
        return b''.join(packet)
11323
11324 1
    @staticmethod
11325
    def from_binary(data):
11326 1
        return MonitoredItemCreateRequest(data)
11327
11328 1
    def _binary_init(self, data):
11329 1
        self.ItemToMonitor = ReadValueId.from_binary(data)
11330 1
        self.MonitoringMode = MonitoringMode(uabin.Primitives.UInt32.unpack(data))
11331 1
        self.RequestedParameters = MonitoringParameters.from_binary(data)
11332
11333 1
    def __str__(self):
11334
        return 'MonitoredItemCreateRequest(' + 'ItemToMonitor:' + str(self.ItemToMonitor) + ', ' + \
11335
               'MonitoringMode:' + str(self.MonitoringMode) + ', ' + \
11336
               'RequestedParameters:' + str(self.RequestedParameters) + ')'
11337
11338 1
    __repr__ = __str__
11339
11340
11341 1
class MonitoredItemCreateResult(FrozenClass):
11342
    '''
11343
    :ivar StatusCode:
11344
    :vartype StatusCode: StatusCode
11345
    :ivar MonitoredItemId:
11346
    :vartype MonitoredItemId: UInt32
11347
    :ivar RevisedSamplingInterval:
11348
    :vartype RevisedSamplingInterval: Double
11349
    :ivar RevisedQueueSize:
11350
    :vartype RevisedQueueSize: UInt32
11351
    :ivar FilterResult:
11352
    :vartype FilterResult: ExtensionObject
11353
    '''
11354
11355 1
    ua_types = {
11356
        'StatusCode': 'StatusCode',
11357
        'MonitoredItemId': 'UInt32',
11358
        'RevisedSamplingInterval': 'Double',
11359
        'RevisedQueueSize': 'UInt32',
11360
        'FilterResult': 'ExtensionObject',
11361
               }
11362
11363 1
    def __init__(self, binary=None):
11364 1
        if binary is not None:
11365 1
            self._binary_init(binary)
11366 1
            self._freeze = True
11367 1
            return
11368 1
        self.StatusCode = StatusCode()
11369 1
        self.MonitoredItemId = 0
11370 1
        self.RevisedSamplingInterval = 0
11371 1
        self.RevisedQueueSize = 0
11372 1
        self.FilterResult = None
11373 1
        self._freeze = True
11374
11375 1
    def to_binary(self):
11376 1
        packet = []
11377 1
        packet.append(self.StatusCode.to_binary())
11378 1
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoredItemId))
11379 1
        packet.append(uabin.Primitives.Double.pack(self.RevisedSamplingInterval))
11380 1
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedQueueSize))
11381 1
        packet.append(extensionobject_to_binary(self.FilterResult))
11382 1
        return b''.join(packet)
11383
11384 1
    @staticmethod
11385
    def from_binary(data):
11386 1
        return MonitoredItemCreateResult(data)
11387
11388 1
    def _binary_init(self, data):
11389 1
        self.StatusCode = StatusCode.from_binary(data)
11390 1
        self.MonitoredItemId = uabin.Primitives.UInt32.unpack(data)
11391 1
        self.RevisedSamplingInterval = uabin.Primitives.Double.unpack(data)
11392 1
        self.RevisedQueueSize = uabin.Primitives.UInt32.unpack(data)
11393 1
        self.FilterResult = extensionobject_from_binary(data)
11394
11395 1
    def __str__(self):
11396
        return 'MonitoredItemCreateResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
11397
               'MonitoredItemId:' + str(self.MonitoredItemId) + ', ' + \
11398
               'RevisedSamplingInterval:' + str(self.RevisedSamplingInterval) + ', ' + \
11399
               'RevisedQueueSize:' + str(self.RevisedQueueSize) + ', ' + \
11400
               'FilterResult:' + str(self.FilterResult) + ')'
11401
11402 1
    __repr__ = __str__
11403
11404
11405 1 View Code Duplication
class CreateMonitoredItemsParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11406
    '''
11407
    :ivar SubscriptionId:
11408
    :vartype SubscriptionId: UInt32
11409
    :ivar TimestampsToReturn:
11410
    :vartype TimestampsToReturn: TimestampsToReturn
11411
    :ivar ItemsToCreate:
11412
    :vartype ItemsToCreate: MonitoredItemCreateRequest
11413
    '''
11414
11415 1
    ua_types = {
11416
        'SubscriptionId': 'UInt32',
11417
        'TimestampsToReturn': 'TimestampsToReturn',
11418
        'ItemsToCreate': 'MonitoredItemCreateRequest',
11419
               }
11420
11421 1
    def __init__(self, binary=None):
11422 1
        if binary is not None:
11423 1
            self._binary_init(binary)
11424 1
            self._freeze = True
11425 1
            return
11426 1
        self.SubscriptionId = 0
11427 1
        self.TimestampsToReturn = TimestampsToReturn(0)
11428 1
        self.ItemsToCreate = []
11429 1
        self._freeze = True
11430
11431 1
    def to_binary(self):
11432 1
        packet = []
11433 1
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
11434 1
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
11435 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ItemsToCreate)))
11436 1
        for fieldname in self.ItemsToCreate:
11437 1
            packet.append(fieldname.to_binary())
11438 1
        return b''.join(packet)
11439
11440 1
    @staticmethod
11441
    def from_binary(data):
11442 1
        return CreateMonitoredItemsParameters(data)
11443
11444 1
    def _binary_init(self, data):
11445 1
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
11446 1
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
11447 1
        length = uabin.Primitives.Int32.unpack(data)
11448 1
        array = []
11449 1
        if length != -1:
11450 1
            for _ in range(0, length):
11451 1
                array.append(MonitoredItemCreateRequest.from_binary(data))
11452 1
        self.ItemsToCreate = array
11453
11454 1
    def __str__(self):
11455
        return 'CreateMonitoredItemsParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
11456
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
11457
               'ItemsToCreate:' + str(self.ItemsToCreate) + ')'
11458
11459 1
    __repr__ = __str__
11460
11461
11462 1
class CreateMonitoredItemsRequest(FrozenClass):
11463
    '''
11464
    :ivar TypeId:
11465
    :vartype TypeId: NodeId
11466
    :ivar RequestHeader:
11467
    :vartype RequestHeader: RequestHeader
11468
    :ivar Parameters:
11469
    :vartype Parameters: CreateMonitoredItemsParameters
11470
    '''
11471
11472 1
    ua_types = {
11473
        'TypeId': 'NodeId',
11474
        'RequestHeader': 'RequestHeader',
11475
        'Parameters': 'CreateMonitoredItemsParameters',
11476
               }
11477
11478 1
    def __init__(self, binary=None):
11479 1
        if binary is not None:
11480
            self._binary_init(binary)
11481
            self._freeze = True
11482
            return
11483 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateMonitoredItemsRequest_Encoding_DefaultBinary)
11484 1
        self.RequestHeader = RequestHeader()
11485 1
        self.Parameters = CreateMonitoredItemsParameters()
11486 1
        self._freeze = True
11487
11488 1
    def to_binary(self):
11489 1
        packet = []
11490 1
        packet.append(self.TypeId.to_binary())
11491 1
        packet.append(self.RequestHeader.to_binary())
11492 1
        packet.append(self.Parameters.to_binary())
11493 1
        return b''.join(packet)
11494
11495 1
    @staticmethod
11496
    def from_binary(data):
11497
        return CreateMonitoredItemsRequest(data)
11498
11499 1
    def _binary_init(self, data):
11500
        self.TypeId = NodeId.from_binary(data)
11501
        self.RequestHeader = RequestHeader.from_binary(data)
11502
        self.Parameters = CreateMonitoredItemsParameters.from_binary(data)
11503
11504 1
    def __str__(self):
11505
        return 'CreateMonitoredItemsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11506
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
11507
               'Parameters:' + str(self.Parameters) + ')'
11508
11509 1
    __repr__ = __str__
11510
11511
11512 1
class CreateMonitoredItemsResponse(FrozenClass):
11513
    '''
11514
    :ivar TypeId:
11515
    :vartype TypeId: NodeId
11516
    :ivar ResponseHeader:
11517
    :vartype ResponseHeader: ResponseHeader
11518
    :ivar Results:
11519
    :vartype Results: MonitoredItemCreateResult
11520
    :ivar DiagnosticInfos:
11521
    :vartype DiagnosticInfos: DiagnosticInfo
11522
    '''
11523
11524 1
    ua_types = {
11525
        'TypeId': 'NodeId',
11526
        'ResponseHeader': 'ResponseHeader',
11527
        'Results': 'MonitoredItemCreateResult',
11528
        'DiagnosticInfos': 'DiagnosticInfo',
11529
               }
11530
11531 1
    def __init__(self, binary=None):
11532 1
        if binary is not None:
11533 1
            self._binary_init(binary)
11534 1
            self._freeze = True
11535 1
            return
11536 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateMonitoredItemsResponse_Encoding_DefaultBinary)
11537 1
        self.ResponseHeader = ResponseHeader()
11538 1
        self.Results = []
11539 1
        self.DiagnosticInfos = []
11540 1
        self._freeze = True
11541
11542 1
    def to_binary(self):
11543 1
        packet = []
11544 1
        packet.append(self.TypeId.to_binary())
11545 1
        packet.append(self.ResponseHeader.to_binary())
11546 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
11547 1
        for fieldname in self.Results:
11548 1
            packet.append(fieldname.to_binary())
11549 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
11550 1
        for fieldname in self.DiagnosticInfos:
11551
            packet.append(fieldname.to_binary())
11552 1
        return b''.join(packet)
11553
11554 1
    @staticmethod
11555
    def from_binary(data):
11556 1
        return CreateMonitoredItemsResponse(data)
11557
11558 1
    def _binary_init(self, data):
11559 1
        self.TypeId = NodeId.from_binary(data)
11560 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
11561 1
        length = uabin.Primitives.Int32.unpack(data)
11562 1
        array = []
11563 1
        if length != -1:
11564 1
            for _ in range(0, length):
11565 1
                array.append(MonitoredItemCreateResult.from_binary(data))
11566 1
        self.Results = array
11567 1
        length = uabin.Primitives.Int32.unpack(data)
11568 1
        array = []
11569 1
        if length != -1:
11570 1
            for _ in range(0, length):
11571
                array.append(DiagnosticInfo.from_binary(data))
11572 1
        self.DiagnosticInfos = array
11573
11574 1
    def __str__(self):
11575
        return 'CreateMonitoredItemsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11576
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
11577
               'Results:' + str(self.Results) + ', ' + \
11578
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
11579
11580 1
    __repr__ = __str__
11581
11582
11583 1 View Code Duplication
class MonitoredItemModifyRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11584
    '''
11585
    :ivar MonitoredItemId:
11586
    :vartype MonitoredItemId: UInt32
11587
    :ivar RequestedParameters:
11588
    :vartype RequestedParameters: MonitoringParameters
11589
    '''
11590
11591 1
    ua_types = {
11592
        'MonitoredItemId': 'UInt32',
11593
        'RequestedParameters': 'MonitoringParameters',
11594
               }
11595
11596 1
    def __init__(self, binary=None):
11597
        if binary is not None:
11598
            self._binary_init(binary)
11599
            self._freeze = True
11600
            return
11601
        self.MonitoredItemId = 0
11602
        self.RequestedParameters = MonitoringParameters()
11603
        self._freeze = True
11604
11605 1
    def to_binary(self):
11606
        packet = []
11607
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoredItemId))
11608
        packet.append(self.RequestedParameters.to_binary())
11609
        return b''.join(packet)
11610
11611 1
    @staticmethod
11612
    def from_binary(data):
11613
        return MonitoredItemModifyRequest(data)
11614
11615 1
    def _binary_init(self, data):
11616
        self.MonitoredItemId = uabin.Primitives.UInt32.unpack(data)
11617
        self.RequestedParameters = MonitoringParameters.from_binary(data)
11618
11619 1
    def __str__(self):
11620
        return 'MonitoredItemModifyRequest(' + 'MonitoredItemId:' + str(self.MonitoredItemId) + ', ' + \
11621
               'RequestedParameters:' + str(self.RequestedParameters) + ')'
11622
11623 1
    __repr__ = __str__
11624
11625
11626 1 View Code Duplication
class MonitoredItemModifyResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11627
    '''
11628
    :ivar StatusCode:
11629
    :vartype StatusCode: StatusCode
11630
    :ivar RevisedSamplingInterval:
11631
    :vartype RevisedSamplingInterval: Double
11632
    :ivar RevisedQueueSize:
11633
    :vartype RevisedQueueSize: UInt32
11634
    :ivar FilterResult:
11635
    :vartype FilterResult: ExtensionObject
11636
    '''
11637
11638 1
    ua_types = {
11639
        'StatusCode': 'StatusCode',
11640
        'RevisedSamplingInterval': 'Double',
11641
        'RevisedQueueSize': 'UInt32',
11642
        'FilterResult': 'ExtensionObject',
11643
               }
11644
11645 1
    def __init__(self, binary=None):
11646
        if binary is not None:
11647
            self._binary_init(binary)
11648
            self._freeze = True
11649
            return
11650
        self.StatusCode = StatusCode()
11651
        self.RevisedSamplingInterval = 0
11652
        self.RevisedQueueSize = 0
11653
        self.FilterResult = None
11654
        self._freeze = True
11655
11656 1
    def to_binary(self):
11657
        packet = []
11658
        packet.append(self.StatusCode.to_binary())
11659
        packet.append(uabin.Primitives.Double.pack(self.RevisedSamplingInterval))
11660
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedQueueSize))
11661
        packet.append(extensionobject_to_binary(self.FilterResult))
11662
        return b''.join(packet)
11663
11664 1
    @staticmethod
11665
    def from_binary(data):
11666
        return MonitoredItemModifyResult(data)
11667
11668 1
    def _binary_init(self, data):
11669
        self.StatusCode = StatusCode.from_binary(data)
11670
        self.RevisedSamplingInterval = uabin.Primitives.Double.unpack(data)
11671
        self.RevisedQueueSize = uabin.Primitives.UInt32.unpack(data)
11672
        self.FilterResult = extensionobject_from_binary(data)
11673
11674 1
    def __str__(self):
11675
        return 'MonitoredItemModifyResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
11676
               'RevisedSamplingInterval:' + str(self.RevisedSamplingInterval) + ', ' + \
11677
               'RevisedQueueSize:' + str(self.RevisedQueueSize) + ', ' + \
11678
               'FilterResult:' + str(self.FilterResult) + ')'
11679
11680 1
    __repr__ = __str__
11681
11682
11683 1 View Code Duplication
class ModifyMonitoredItemsParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11684
    '''
11685
    :ivar SubscriptionId:
11686
    :vartype SubscriptionId: UInt32
11687
    :ivar TimestampsToReturn:
11688
    :vartype TimestampsToReturn: TimestampsToReturn
11689
    :ivar ItemsToModify:
11690
    :vartype ItemsToModify: MonitoredItemModifyRequest
11691
    '''
11692
11693 1
    ua_types = {
11694
        'SubscriptionId': 'UInt32',
11695
        'TimestampsToReturn': 'TimestampsToReturn',
11696
        'ItemsToModify': 'MonitoredItemModifyRequest',
11697
               }
11698
11699 1
    def __init__(self, binary=None):
11700
        if binary is not None:
11701
            self._binary_init(binary)
11702
            self._freeze = True
11703
            return
11704
        self.SubscriptionId = 0
11705
        self.TimestampsToReturn = TimestampsToReturn(0)
11706
        self.ItemsToModify = []
11707
        self._freeze = True
11708
11709 1
    def to_binary(self):
11710
        packet = []
11711
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
11712
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
11713
        packet.append(uabin.Primitives.Int32.pack(len(self.ItemsToModify)))
11714
        for fieldname in self.ItemsToModify:
11715
            packet.append(fieldname.to_binary())
11716
        return b''.join(packet)
11717
11718 1
    @staticmethod
11719
    def from_binary(data):
11720
        return ModifyMonitoredItemsParameters(data)
11721
11722 1
    def _binary_init(self, data):
11723
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
11724
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
11725
        length = uabin.Primitives.Int32.unpack(data)
11726
        array = []
11727
        if length != -1:
11728
            for _ in range(0, length):
11729
                array.append(MonitoredItemModifyRequest.from_binary(data))
11730
        self.ItemsToModify = array
11731
11732 1
    def __str__(self):
11733
        return 'ModifyMonitoredItemsParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
11734
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
11735
               'ItemsToModify:' + str(self.ItemsToModify) + ')'
11736
11737 1
    __repr__ = __str__
11738
11739
11740 1
class ModifyMonitoredItemsRequest(FrozenClass):
11741
    '''
11742
    :ivar TypeId:
11743
    :vartype TypeId: NodeId
11744
    :ivar RequestHeader:
11745
    :vartype RequestHeader: RequestHeader
11746
    :ivar Parameters:
11747
    :vartype Parameters: ModifyMonitoredItemsParameters
11748
    '''
11749
11750 1
    ua_types = {
11751
        'TypeId': 'NodeId',
11752
        'RequestHeader': 'RequestHeader',
11753
        'Parameters': 'ModifyMonitoredItemsParameters',
11754
               }
11755
11756 1
    def __init__(self, binary=None):
11757
        if binary is not None:
11758
            self._binary_init(binary)
11759
            self._freeze = True
11760
            return
11761
        self.TypeId = FourByteNodeId(ObjectIds.ModifyMonitoredItemsRequest_Encoding_DefaultBinary)
11762
        self.RequestHeader = RequestHeader()
11763
        self.Parameters = ModifyMonitoredItemsParameters()
11764
        self._freeze = True
11765
11766 1
    def to_binary(self):
11767
        packet = []
11768
        packet.append(self.TypeId.to_binary())
11769
        packet.append(self.RequestHeader.to_binary())
11770
        packet.append(self.Parameters.to_binary())
11771
        return b''.join(packet)
11772
11773 1
    @staticmethod
11774
    def from_binary(data):
11775
        return ModifyMonitoredItemsRequest(data)
11776
11777 1
    def _binary_init(self, data):
11778
        self.TypeId = NodeId.from_binary(data)
11779
        self.RequestHeader = RequestHeader.from_binary(data)
11780
        self.Parameters = ModifyMonitoredItemsParameters.from_binary(data)
11781
11782 1
    def __str__(self):
11783
        return 'ModifyMonitoredItemsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11784
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
11785
               'Parameters:' + str(self.Parameters) + ')'
11786
11787 1
    __repr__ = __str__
11788
11789
11790 1
class ModifyMonitoredItemsResponse(FrozenClass):
11791
    '''
11792
    :ivar TypeId:
11793
    :vartype TypeId: NodeId
11794
    :ivar ResponseHeader:
11795
    :vartype ResponseHeader: ResponseHeader
11796
    :ivar Results:
11797
    :vartype Results: MonitoredItemModifyResult
11798
    :ivar DiagnosticInfos:
11799
    :vartype DiagnosticInfos: DiagnosticInfo
11800
    '''
11801
11802 1
    ua_types = {
11803
        'TypeId': 'NodeId',
11804
        'ResponseHeader': 'ResponseHeader',
11805
        'Results': 'MonitoredItemModifyResult',
11806
        'DiagnosticInfos': 'DiagnosticInfo',
11807
               }
11808
11809 1
    def __init__(self, binary=None):
11810
        if binary is not None:
11811
            self._binary_init(binary)
11812
            self._freeze = True
11813
            return
11814
        self.TypeId = FourByteNodeId(ObjectIds.ModifyMonitoredItemsResponse_Encoding_DefaultBinary)
11815
        self.ResponseHeader = ResponseHeader()
11816
        self.Results = []
11817
        self.DiagnosticInfos = []
11818
        self._freeze = True
11819
11820 1
    def to_binary(self):
11821
        packet = []
11822
        packet.append(self.TypeId.to_binary())
11823
        packet.append(self.ResponseHeader.to_binary())
11824
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
11825
        for fieldname in self.Results:
11826
            packet.append(fieldname.to_binary())
11827
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
11828
        for fieldname in self.DiagnosticInfos:
11829
            packet.append(fieldname.to_binary())
11830
        return b''.join(packet)
11831
11832 1
    @staticmethod
11833
    def from_binary(data):
11834
        return ModifyMonitoredItemsResponse(data)
11835
11836 1
    def _binary_init(self, data):
11837
        self.TypeId = NodeId.from_binary(data)
11838
        self.ResponseHeader = ResponseHeader.from_binary(data)
11839
        length = uabin.Primitives.Int32.unpack(data)
11840
        array = []
11841
        if length != -1:
11842
            for _ in range(0, length):
11843
                array.append(MonitoredItemModifyResult.from_binary(data))
11844
        self.Results = array
11845
        length = uabin.Primitives.Int32.unpack(data)
11846
        array = []
11847
        if length != -1:
11848
            for _ in range(0, length):
11849
                array.append(DiagnosticInfo.from_binary(data))
11850
        self.DiagnosticInfos = array
11851
11852 1
    def __str__(self):
11853
        return 'ModifyMonitoredItemsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11854
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
11855
               'Results:' + str(self.Results) + ', ' + \
11856
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
11857
11858 1
    __repr__ = __str__
11859
11860
11861 1 View Code Duplication
class SetMonitoringModeParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11862
    '''
11863
    :ivar SubscriptionId:
11864
    :vartype SubscriptionId: UInt32
11865
    :ivar MonitoringMode:
11866
    :vartype MonitoringMode: MonitoringMode
11867
    :ivar MonitoredItemIds:
11868
    :vartype MonitoredItemIds: UInt32
11869
    '''
11870
11871 1
    ua_types = {
11872
        'SubscriptionId': 'UInt32',
11873
        'MonitoringMode': 'MonitoringMode',
11874
        'MonitoredItemIds': 'UInt32',
11875
               }
11876
11877 1
    def __init__(self, binary=None):
11878
        if binary is not None:
11879
            self._binary_init(binary)
11880
            self._freeze = True
11881
            return
11882
        self.SubscriptionId = 0
11883
        self.MonitoringMode = MonitoringMode(0)
11884
        self.MonitoredItemIds = []
11885
        self._freeze = True
11886
11887 1
    def to_binary(self):
11888
        packet = []
11889
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
11890
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoringMode.value))
11891
        packet.append(uabin.Primitives.Int32.pack(len(self.MonitoredItemIds)))
11892
        for fieldname in self.MonitoredItemIds:
11893
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
11894
        return b''.join(packet)
11895
11896 1
    @staticmethod
11897
    def from_binary(data):
11898
        return SetMonitoringModeParameters(data)
11899
11900 1
    def _binary_init(self, data):
11901
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
11902
        self.MonitoringMode = MonitoringMode(uabin.Primitives.UInt32.unpack(data))
11903
        self.MonitoredItemIds = uabin.Primitives.UInt32.unpack_array(data)
11904
11905 1
    def __str__(self):
11906
        return 'SetMonitoringModeParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
11907
               'MonitoringMode:' + str(self.MonitoringMode) + ', ' + \
11908
               'MonitoredItemIds:' + str(self.MonitoredItemIds) + ')'
11909
11910 1
    __repr__ = __str__
11911
11912
11913 1
class SetMonitoringModeRequest(FrozenClass):
11914
    '''
11915
    :ivar TypeId:
11916
    :vartype TypeId: NodeId
11917
    :ivar RequestHeader:
11918
    :vartype RequestHeader: RequestHeader
11919
    :ivar Parameters:
11920
    :vartype Parameters: SetMonitoringModeParameters
11921
    '''
11922
11923 1
    ua_types = {
11924
        'TypeId': 'NodeId',
11925
        'RequestHeader': 'RequestHeader',
11926
        'Parameters': 'SetMonitoringModeParameters',
11927
               }
11928
11929 1
    def __init__(self, binary=None):
11930
        if binary is not None:
11931
            self._binary_init(binary)
11932
            self._freeze = True
11933
            return
11934
        self.TypeId = FourByteNodeId(ObjectIds.SetMonitoringModeRequest_Encoding_DefaultBinary)
11935
        self.RequestHeader = RequestHeader()
11936
        self.Parameters = SetMonitoringModeParameters()
11937
        self._freeze = True
11938
11939 1
    def to_binary(self):
11940
        packet = []
11941
        packet.append(self.TypeId.to_binary())
11942
        packet.append(self.RequestHeader.to_binary())
11943
        packet.append(self.Parameters.to_binary())
11944
        return b''.join(packet)
11945
11946 1
    @staticmethod
11947
    def from_binary(data):
11948
        return SetMonitoringModeRequest(data)
11949
11950 1
    def _binary_init(self, data):
11951
        self.TypeId = NodeId.from_binary(data)
11952
        self.RequestHeader = RequestHeader.from_binary(data)
11953
        self.Parameters = SetMonitoringModeParameters.from_binary(data)
11954
11955 1
    def __str__(self):
11956
        return 'SetMonitoringModeRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11957
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
11958
               'Parameters:' + str(self.Parameters) + ')'
11959
11960 1
    __repr__ = __str__
11961
11962
11963 1 View Code Duplication
class SetMonitoringModeResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11964
    '''
11965
    :ivar Results:
11966
    :vartype Results: StatusCode
11967
    :ivar DiagnosticInfos:
11968
    :vartype DiagnosticInfos: DiagnosticInfo
11969
    '''
11970
11971 1
    ua_types = {
11972
        'Results': 'StatusCode',
11973
        'DiagnosticInfos': 'DiagnosticInfo',
11974
               }
11975
11976 1
    def __init__(self, binary=None):
11977
        if binary is not None:
11978
            self._binary_init(binary)
11979
            self._freeze = True
11980
            return
11981
        self.Results = []
11982
        self.DiagnosticInfos = []
11983
        self._freeze = True
11984
11985 1
    def to_binary(self):
11986
        packet = []
11987
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
11988
        for fieldname in self.Results:
11989
            packet.append(fieldname.to_binary())
11990
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
11991
        for fieldname in self.DiagnosticInfos:
11992
            packet.append(fieldname.to_binary())
11993
        return b''.join(packet)
11994
11995 1
    @staticmethod
11996
    def from_binary(data):
11997
        return SetMonitoringModeResult(data)
11998
11999 1
    def _binary_init(self, data):
12000
        length = uabin.Primitives.Int32.unpack(data)
12001
        array = []
12002
        if length != -1:
12003
            for _ in range(0, length):
12004
                array.append(StatusCode.from_binary(data))
12005
        self.Results = array
12006
        length = uabin.Primitives.Int32.unpack(data)
12007
        array = []
12008
        if length != -1:
12009
            for _ in range(0, length):
12010
                array.append(DiagnosticInfo.from_binary(data))
12011
        self.DiagnosticInfos = array
12012
12013 1
    def __str__(self):
12014
        return 'SetMonitoringModeResult(' + 'Results:' + str(self.Results) + ', ' + \
12015
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
12016
12017 1
    __repr__ = __str__
12018
12019
12020 1
class SetMonitoringModeResponse(FrozenClass):
12021
    '''
12022
    :ivar TypeId:
12023
    :vartype TypeId: NodeId
12024
    :ivar ResponseHeader:
12025
    :vartype ResponseHeader: ResponseHeader
12026
    :ivar Parameters:
12027
    :vartype Parameters: SetMonitoringModeResult
12028
    '''
12029
12030 1
    ua_types = {
12031
        'TypeId': 'NodeId',
12032
        'ResponseHeader': 'ResponseHeader',
12033
        'Parameters': 'SetMonitoringModeResult',
12034
               }
12035
12036 1
    def __init__(self, binary=None):
12037
        if binary is not None:
12038
            self._binary_init(binary)
12039
            self._freeze = True
12040
            return
12041
        self.TypeId = FourByteNodeId(ObjectIds.SetMonitoringModeResponse_Encoding_DefaultBinary)
12042
        self.ResponseHeader = ResponseHeader()
12043
        self.Parameters = SetMonitoringModeResult()
12044
        self._freeze = True
12045
12046 1
    def to_binary(self):
12047
        packet = []
12048
        packet.append(self.TypeId.to_binary())
12049
        packet.append(self.ResponseHeader.to_binary())
12050
        packet.append(self.Parameters.to_binary())
12051
        return b''.join(packet)
12052
12053 1
    @staticmethod
12054
    def from_binary(data):
12055
        return SetMonitoringModeResponse(data)
12056
12057 1
    def _binary_init(self, data):
12058
        self.TypeId = NodeId.from_binary(data)
12059
        self.ResponseHeader = ResponseHeader.from_binary(data)
12060
        self.Parameters = SetMonitoringModeResult.from_binary(data)
12061
12062 1
    def __str__(self):
12063
        return 'SetMonitoringModeResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12064
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12065
               'Parameters:' + str(self.Parameters) + ')'
12066
12067 1
    __repr__ = __str__
12068
12069
12070 1 View Code Duplication
class SetTriggeringParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12071
    '''
12072
    :ivar SubscriptionId:
12073
    :vartype SubscriptionId: UInt32
12074
    :ivar TriggeringItemId:
12075
    :vartype TriggeringItemId: UInt32
12076
    :ivar LinksToAdd:
12077
    :vartype LinksToAdd: UInt32
12078
    :ivar LinksToRemove:
12079
    :vartype LinksToRemove: UInt32
12080
    '''
12081
12082 1
    ua_types = {
12083
        'SubscriptionId': 'UInt32',
12084
        'TriggeringItemId': 'UInt32',
12085
        'LinksToAdd': 'UInt32',
12086
        'LinksToRemove': 'UInt32',
12087
               }
12088
12089 1
    def __init__(self, binary=None):
12090
        if binary is not None:
12091
            self._binary_init(binary)
12092
            self._freeze = True
12093
            return
12094
        self.SubscriptionId = 0
12095
        self.TriggeringItemId = 0
12096
        self.LinksToAdd = []
12097
        self.LinksToRemove = []
12098
        self._freeze = True
12099
12100 1
    def to_binary(self):
12101
        packet = []
12102
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
12103
        packet.append(uabin.Primitives.UInt32.pack(self.TriggeringItemId))
12104
        packet.append(uabin.Primitives.Int32.pack(len(self.LinksToAdd)))
12105
        for fieldname in self.LinksToAdd:
12106
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
12107
        packet.append(uabin.Primitives.Int32.pack(len(self.LinksToRemove)))
12108
        for fieldname in self.LinksToRemove:
12109
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
12110
        return b''.join(packet)
12111
12112 1
    @staticmethod
12113
    def from_binary(data):
12114
        return SetTriggeringParameters(data)
12115
12116 1
    def _binary_init(self, data):
12117
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
12118
        self.TriggeringItemId = uabin.Primitives.UInt32.unpack(data)
12119
        self.LinksToAdd = uabin.Primitives.UInt32.unpack_array(data)
12120
        self.LinksToRemove = uabin.Primitives.UInt32.unpack_array(data)
12121
12122 1
    def __str__(self):
12123
        return 'SetTriggeringParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12124
               'TriggeringItemId:' + str(self.TriggeringItemId) + ', ' + \
12125
               'LinksToAdd:' + str(self.LinksToAdd) + ', ' + \
12126
               'LinksToRemove:' + str(self.LinksToRemove) + ')'
12127
12128 1
    __repr__ = __str__
12129
12130
12131 1
class SetTriggeringRequest(FrozenClass):
12132
    '''
12133
    :ivar TypeId:
12134
    :vartype TypeId: NodeId
12135
    :ivar RequestHeader:
12136
    :vartype RequestHeader: RequestHeader
12137
    :ivar Parameters:
12138
    :vartype Parameters: SetTriggeringParameters
12139
    '''
12140
12141 1
    ua_types = {
12142
        'TypeId': 'NodeId',
12143
        'RequestHeader': 'RequestHeader',
12144
        'Parameters': 'SetTriggeringParameters',
12145
               }
12146
12147 1
    def __init__(self, binary=None):
12148
        if binary is not None:
12149
            self._binary_init(binary)
12150
            self._freeze = True
12151
            return
12152
        self.TypeId = FourByteNodeId(ObjectIds.SetTriggeringRequest_Encoding_DefaultBinary)
12153
        self.RequestHeader = RequestHeader()
12154
        self.Parameters = SetTriggeringParameters()
12155
        self._freeze = True
12156
12157 1
    def to_binary(self):
12158
        packet = []
12159
        packet.append(self.TypeId.to_binary())
12160
        packet.append(self.RequestHeader.to_binary())
12161
        packet.append(self.Parameters.to_binary())
12162
        return b''.join(packet)
12163
12164 1
    @staticmethod
12165
    def from_binary(data):
12166
        return SetTriggeringRequest(data)
12167
12168 1
    def _binary_init(self, data):
12169
        self.TypeId = NodeId.from_binary(data)
12170
        self.RequestHeader = RequestHeader.from_binary(data)
12171
        self.Parameters = SetTriggeringParameters.from_binary(data)
12172
12173 1
    def __str__(self):
12174
        return 'SetTriggeringRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12175
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12176
               'Parameters:' + str(self.Parameters) + ')'
12177
12178 1
    __repr__ = __str__
12179
12180
12181 1
class SetTriggeringResult(FrozenClass):
12182
    '''
12183
    :ivar AddResults:
12184
    :vartype AddResults: StatusCode
12185
    :ivar AddDiagnosticInfos:
12186
    :vartype AddDiagnosticInfos: DiagnosticInfo
12187
    :ivar RemoveResults:
12188
    :vartype RemoveResults: StatusCode
12189
    :ivar RemoveDiagnosticInfos:
12190
    :vartype RemoveDiagnosticInfos: DiagnosticInfo
12191
    '''
12192
12193 1
    ua_types = {
12194
        'AddResults': 'StatusCode',
12195
        'AddDiagnosticInfos': 'DiagnosticInfo',
12196
        'RemoveResults': 'StatusCode',
12197
        'RemoveDiagnosticInfos': 'DiagnosticInfo',
12198
               }
12199
12200 1
    def __init__(self, binary=None):
12201
        if binary is not None:
12202
            self._binary_init(binary)
12203
            self._freeze = True
12204
            return
12205
        self.AddResults = []
12206
        self.AddDiagnosticInfos = []
12207
        self.RemoveResults = []
12208
        self.RemoveDiagnosticInfos = []
12209
        self._freeze = True
12210
12211 1 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12212
        packet = []
12213
        packet.append(uabin.Primitives.Int32.pack(len(self.AddResults)))
12214
        for fieldname in self.AddResults:
12215
            packet.append(fieldname.to_binary())
12216
        packet.append(uabin.Primitives.Int32.pack(len(self.AddDiagnosticInfos)))
12217
        for fieldname in self.AddDiagnosticInfos:
12218
            packet.append(fieldname.to_binary())
12219
        packet.append(uabin.Primitives.Int32.pack(len(self.RemoveResults)))
12220
        for fieldname in self.RemoveResults:
12221
            packet.append(fieldname.to_binary())
12222
        packet.append(uabin.Primitives.Int32.pack(len(self.RemoveDiagnosticInfos)))
12223
        for fieldname in self.RemoveDiagnosticInfos:
12224
            packet.append(fieldname.to_binary())
12225
        return b''.join(packet)
12226
12227 1
    @staticmethod
12228
    def from_binary(data):
12229
        return SetTriggeringResult(data)
12230
12231 1
    def _binary_init(self, data):
12232
        length = uabin.Primitives.Int32.unpack(data)
12233
        array = []
12234
        if length != -1:
12235
            for _ in range(0, length):
12236
                array.append(StatusCode.from_binary(data))
12237
        self.AddResults = array
12238
        length = uabin.Primitives.Int32.unpack(data)
12239
        array = []
12240
        if length != -1:
12241
            for _ in range(0, length):
12242
                array.append(DiagnosticInfo.from_binary(data))
12243
        self.AddDiagnosticInfos = array
12244
        length = uabin.Primitives.Int32.unpack(data)
12245
        array = []
12246
        if length != -1:
12247
            for _ in range(0, length):
12248
                array.append(StatusCode.from_binary(data))
12249
        self.RemoveResults = array
12250
        length = uabin.Primitives.Int32.unpack(data)
12251
        array = []
12252
        if length != -1:
12253
            for _ in range(0, length):
12254
                array.append(DiagnosticInfo.from_binary(data))
12255
        self.RemoveDiagnosticInfos = array
12256
12257 1
    def __str__(self):
12258
        return 'SetTriggeringResult(' + 'AddResults:' + str(self.AddResults) + ', ' + \
12259
               'AddDiagnosticInfos:' + str(self.AddDiagnosticInfos) + ', ' + \
12260
               'RemoveResults:' + str(self.RemoveResults) + ', ' + \
12261
               'RemoveDiagnosticInfos:' + str(self.RemoveDiagnosticInfos) + ')'
12262
12263 1
    __repr__ = __str__
12264
12265
12266 1
class SetTriggeringResponse(FrozenClass):
12267
    '''
12268
    :ivar TypeId:
12269
    :vartype TypeId: NodeId
12270
    :ivar ResponseHeader:
12271
    :vartype ResponseHeader: ResponseHeader
12272
    :ivar Parameters:
12273
    :vartype Parameters: SetTriggeringResult
12274
    '''
12275
12276 1
    ua_types = {
12277
        'TypeId': 'NodeId',
12278
        'ResponseHeader': 'ResponseHeader',
12279
        'Parameters': 'SetTriggeringResult',
12280
               }
12281
12282 1
    def __init__(self, binary=None):
12283
        if binary is not None:
12284
            self._binary_init(binary)
12285
            self._freeze = True
12286
            return
12287
        self.TypeId = FourByteNodeId(ObjectIds.SetTriggeringResponse_Encoding_DefaultBinary)
12288
        self.ResponseHeader = ResponseHeader()
12289
        self.Parameters = SetTriggeringResult()
12290
        self._freeze = True
12291
12292 1
    def to_binary(self):
12293
        packet = []
12294
        packet.append(self.TypeId.to_binary())
12295
        packet.append(self.ResponseHeader.to_binary())
12296
        packet.append(self.Parameters.to_binary())
12297
        return b''.join(packet)
12298
12299 1
    @staticmethod
12300
    def from_binary(data):
12301
        return SetTriggeringResponse(data)
12302
12303 1
    def _binary_init(self, data):
12304
        self.TypeId = NodeId.from_binary(data)
12305
        self.ResponseHeader = ResponseHeader.from_binary(data)
12306
        self.Parameters = SetTriggeringResult.from_binary(data)
12307
12308 1
    def __str__(self):
12309
        return 'SetTriggeringResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12310
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12311
               'Parameters:' + str(self.Parameters) + ')'
12312
12313 1
    __repr__ = __str__
12314
12315
12316 1 View Code Duplication
class DeleteMonitoredItemsParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12317
    '''
12318
    :ivar SubscriptionId:
12319
    :vartype SubscriptionId: UInt32
12320
    :ivar MonitoredItemIds:
12321
    :vartype MonitoredItemIds: UInt32
12322
    '''
12323
12324 1
    ua_types = {
12325
        'SubscriptionId': 'UInt32',
12326
        'MonitoredItemIds': 'UInt32',
12327
               }
12328
12329 1
    def __init__(self, binary=None):
12330 1
        if binary is not None:
12331 1
            self._binary_init(binary)
12332 1
            self._freeze = True
12333 1
            return
12334 1
        self.SubscriptionId = 0
12335 1
        self.MonitoredItemIds = []
12336 1
        self._freeze = True
12337
12338 1
    def to_binary(self):
12339 1
        packet = []
12340 1
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
12341 1
        packet.append(uabin.Primitives.Int32.pack(len(self.MonitoredItemIds)))
12342 1
        for fieldname in self.MonitoredItemIds:
12343 1
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
12344 1
        return b''.join(packet)
12345
12346 1
    @staticmethod
12347
    def from_binary(data):
12348 1
        return DeleteMonitoredItemsParameters(data)
12349
12350 1
    def _binary_init(self, data):
12351 1
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
12352 1
        self.MonitoredItemIds = uabin.Primitives.UInt32.unpack_array(data)
12353
12354 1
    def __str__(self):
12355
        return 'DeleteMonitoredItemsParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12356
               'MonitoredItemIds:' + str(self.MonitoredItemIds) + ')'
12357
12358 1
    __repr__ = __str__
12359
12360
12361 1
class DeleteMonitoredItemsRequest(FrozenClass):
12362
    '''
12363
    :ivar TypeId:
12364
    :vartype TypeId: NodeId
12365
    :ivar RequestHeader:
12366
    :vartype RequestHeader: RequestHeader
12367
    :ivar Parameters:
12368
    :vartype Parameters: DeleteMonitoredItemsParameters
12369
    '''
12370
12371 1
    ua_types = {
12372
        'TypeId': 'NodeId',
12373
        'RequestHeader': 'RequestHeader',
12374
        'Parameters': 'DeleteMonitoredItemsParameters',
12375
               }
12376
12377 1
    def __init__(self, binary=None):
12378 1
        if binary is not None:
12379
            self._binary_init(binary)
12380
            self._freeze = True
12381
            return
12382 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteMonitoredItemsRequest_Encoding_DefaultBinary)
12383 1
        self.RequestHeader = RequestHeader()
12384 1
        self.Parameters = DeleteMonitoredItemsParameters()
12385 1
        self._freeze = True
12386
12387 1
    def to_binary(self):
12388 1
        packet = []
12389 1
        packet.append(self.TypeId.to_binary())
12390 1
        packet.append(self.RequestHeader.to_binary())
12391 1
        packet.append(self.Parameters.to_binary())
12392 1
        return b''.join(packet)
12393
12394 1
    @staticmethod
12395
    def from_binary(data):
12396
        return DeleteMonitoredItemsRequest(data)
12397
12398 1
    def _binary_init(self, data):
12399
        self.TypeId = NodeId.from_binary(data)
12400
        self.RequestHeader = RequestHeader.from_binary(data)
12401
        self.Parameters = DeleteMonitoredItemsParameters.from_binary(data)
12402
12403 1
    def __str__(self):
12404
        return 'DeleteMonitoredItemsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12405
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12406
               'Parameters:' + str(self.Parameters) + ')'
12407
12408 1
    __repr__ = __str__
12409
12410
12411 1
class DeleteMonitoredItemsResponse(FrozenClass):
12412
    '''
12413
    :ivar TypeId:
12414
    :vartype TypeId: NodeId
12415
    :ivar ResponseHeader:
12416
    :vartype ResponseHeader: ResponseHeader
12417
    :ivar Results:
12418
    :vartype Results: StatusCode
12419
    :ivar DiagnosticInfos:
12420
    :vartype DiagnosticInfos: DiagnosticInfo
12421
    '''
12422
12423 1
    ua_types = {
12424
        'TypeId': 'NodeId',
12425
        'ResponseHeader': 'ResponseHeader',
12426
        'Results': 'StatusCode',
12427
        'DiagnosticInfos': 'DiagnosticInfo',
12428
               }
12429
12430 1
    def __init__(self, binary=None):
12431 1
        if binary is not None:
12432 1
            self._binary_init(binary)
12433 1
            self._freeze = True
12434 1
            return
12435 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteMonitoredItemsResponse_Encoding_DefaultBinary)
12436 1
        self.ResponseHeader = ResponseHeader()
12437 1
        self.Results = []
12438 1
        self.DiagnosticInfos = []
12439 1
        self._freeze = True
12440
12441 1
    def to_binary(self):
12442 1
        packet = []
12443 1
        packet.append(self.TypeId.to_binary())
12444 1
        packet.append(self.ResponseHeader.to_binary())
12445 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
12446 1
        for fieldname in self.Results:
12447 1
            packet.append(fieldname.to_binary())
12448 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
12449 1
        for fieldname in self.DiagnosticInfos:
12450
            packet.append(fieldname.to_binary())
12451 1
        return b''.join(packet)
12452
12453 1
    @staticmethod
12454
    def from_binary(data):
12455 1
        return DeleteMonitoredItemsResponse(data)
12456
12457 1
    def _binary_init(self, data):
12458 1
        self.TypeId = NodeId.from_binary(data)
12459 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
12460 1
        length = uabin.Primitives.Int32.unpack(data)
12461 1
        array = []
12462 1
        if length != -1:
12463 1
            for _ in range(0, length):
12464 1
                array.append(StatusCode.from_binary(data))
12465 1
        self.Results = array
12466 1
        length = uabin.Primitives.Int32.unpack(data)
12467 1
        array = []
12468 1
        if length != -1:
12469 1
            for _ in range(0, length):
12470
                array.append(DiagnosticInfo.from_binary(data))
12471 1
        self.DiagnosticInfos = array
12472
12473 1
    def __str__(self):
12474
        return 'DeleteMonitoredItemsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12475
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12476
               'Results:' + str(self.Results) + ', ' + \
12477
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
12478
12479 1
    __repr__ = __str__
12480
12481
12482 1 View Code Duplication
class CreateSubscriptionParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12483
    '''
12484
    :ivar RequestedPublishingInterval:
12485
    :vartype RequestedPublishingInterval: Double
12486
    :ivar RequestedLifetimeCount:
12487
    :vartype RequestedLifetimeCount: UInt32
12488
    :ivar RequestedMaxKeepAliveCount:
12489
    :vartype RequestedMaxKeepAliveCount: UInt32
12490
    :ivar MaxNotificationsPerPublish:
12491
    :vartype MaxNotificationsPerPublish: UInt32
12492
    :ivar PublishingEnabled:
12493
    :vartype PublishingEnabled: Boolean
12494
    :ivar Priority:
12495
    :vartype Priority: Byte
12496
    '''
12497
12498 1
    ua_types = {
12499
        'RequestedPublishingInterval': 'Double',
12500
        'RequestedLifetimeCount': 'UInt32',
12501
        'RequestedMaxKeepAliveCount': 'UInt32',
12502
        'MaxNotificationsPerPublish': 'UInt32',
12503
        'PublishingEnabled': 'Boolean',
12504
        'Priority': 'Byte',
12505
               }
12506
12507 1
    def __init__(self, binary=None):
12508 1
        if binary is not None:
12509 1
            self._binary_init(binary)
12510 1
            self._freeze = True
12511 1
            return
12512 1
        self.RequestedPublishingInterval = 0
12513 1
        self.RequestedLifetimeCount = 0
12514 1
        self.RequestedMaxKeepAliveCount = 0
12515 1
        self.MaxNotificationsPerPublish = 0
12516 1
        self.PublishingEnabled = True
12517 1
        self.Priority = 0
12518 1
        self._freeze = True
12519
12520 1
    def to_binary(self):
12521 1
        packet = []
12522 1
        packet.append(uabin.Primitives.Double.pack(self.RequestedPublishingInterval))
12523 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedLifetimeCount))
12524 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedMaxKeepAliveCount))
12525 1
        packet.append(uabin.Primitives.UInt32.pack(self.MaxNotificationsPerPublish))
12526 1
        packet.append(uabin.Primitives.Boolean.pack(self.PublishingEnabled))
12527 1
        packet.append(uabin.Primitives.Byte.pack(self.Priority))
12528 1
        return b''.join(packet)
12529
12530 1
    @staticmethod
12531
    def from_binary(data):
12532 1
        return CreateSubscriptionParameters(data)
12533
12534 1
    def _binary_init(self, data):
12535 1
        self.RequestedPublishingInterval = uabin.Primitives.Double.unpack(data)
12536 1
        self.RequestedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
12537 1
        self.RequestedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
12538 1
        self.MaxNotificationsPerPublish = uabin.Primitives.UInt32.unpack(data)
12539 1
        self.PublishingEnabled = uabin.Primitives.Boolean.unpack(data)
12540 1
        self.Priority = uabin.Primitives.Byte.unpack(data)
12541
12542 1
    def __str__(self):
12543
        return 'CreateSubscriptionParameters(' + 'RequestedPublishingInterval:' + str(self.RequestedPublishingInterval) + ', ' + \
12544
               'RequestedLifetimeCount:' + str(self.RequestedLifetimeCount) + ', ' + \
12545
               'RequestedMaxKeepAliveCount:' + str(self.RequestedMaxKeepAliveCount) + ', ' + \
12546
               'MaxNotificationsPerPublish:' + str(self.MaxNotificationsPerPublish) + ', ' + \
12547
               'PublishingEnabled:' + str(self.PublishingEnabled) + ', ' + \
12548
               'Priority:' + str(self.Priority) + ')'
12549
12550 1
    __repr__ = __str__
12551
12552
12553 1
class CreateSubscriptionRequest(FrozenClass):
12554
    '''
12555
    :ivar TypeId:
12556
    :vartype TypeId: NodeId
12557
    :ivar RequestHeader:
12558
    :vartype RequestHeader: RequestHeader
12559
    :ivar Parameters:
12560
    :vartype Parameters: CreateSubscriptionParameters
12561
    '''
12562
12563 1
    ua_types = {
12564
        'TypeId': 'NodeId',
12565
        'RequestHeader': 'RequestHeader',
12566
        'Parameters': 'CreateSubscriptionParameters',
12567
               }
12568
12569 1
    def __init__(self, binary=None):
12570 1
        if binary is not None:
12571
            self._binary_init(binary)
12572
            self._freeze = True
12573
            return
12574 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateSubscriptionRequest_Encoding_DefaultBinary)
12575 1
        self.RequestHeader = RequestHeader()
12576 1
        self.Parameters = CreateSubscriptionParameters()
12577 1
        self._freeze = True
12578
12579 1
    def to_binary(self):
12580 1
        packet = []
12581 1
        packet.append(self.TypeId.to_binary())
12582 1
        packet.append(self.RequestHeader.to_binary())
12583 1
        packet.append(self.Parameters.to_binary())
12584 1
        return b''.join(packet)
12585
12586 1
    @staticmethod
12587
    def from_binary(data):
12588
        return CreateSubscriptionRequest(data)
12589
12590 1
    def _binary_init(self, data):
12591
        self.TypeId = NodeId.from_binary(data)
12592
        self.RequestHeader = RequestHeader.from_binary(data)
12593
        self.Parameters = CreateSubscriptionParameters.from_binary(data)
12594
12595 1
    def __str__(self):
12596
        return 'CreateSubscriptionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12597
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12598
               'Parameters:' + str(self.Parameters) + ')'
12599
12600 1
    __repr__ = __str__
12601
12602
12603 1 View Code Duplication
class CreateSubscriptionResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12604
    '''
12605
    :ivar SubscriptionId:
12606
    :vartype SubscriptionId: UInt32
12607
    :ivar RevisedPublishingInterval:
12608
    :vartype RevisedPublishingInterval: Double
12609
    :ivar RevisedLifetimeCount:
12610
    :vartype RevisedLifetimeCount: UInt32
12611
    :ivar RevisedMaxKeepAliveCount:
12612
    :vartype RevisedMaxKeepAliveCount: UInt32
12613
    '''
12614
12615 1
    ua_types = {
12616
        'SubscriptionId': 'UInt32',
12617
        'RevisedPublishingInterval': 'Double',
12618
        'RevisedLifetimeCount': 'UInt32',
12619
        'RevisedMaxKeepAliveCount': 'UInt32',
12620
               }
12621
12622 1
    def __init__(self, binary=None):
12623 1
        if binary is not None:
12624 1
            self._binary_init(binary)
12625 1
            self._freeze = True
12626 1
            return
12627 1
        self.SubscriptionId = 0
12628 1
        self.RevisedPublishingInterval = 0
12629 1
        self.RevisedLifetimeCount = 0
12630 1
        self.RevisedMaxKeepAliveCount = 0
12631 1
        self._freeze = True
12632
12633 1
    def to_binary(self):
12634 1
        packet = []
12635 1
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
12636 1
        packet.append(uabin.Primitives.Double.pack(self.RevisedPublishingInterval))
12637 1
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedLifetimeCount))
12638 1
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedMaxKeepAliveCount))
12639 1
        return b''.join(packet)
12640
12641 1
    @staticmethod
12642
    def from_binary(data):
12643 1
        return CreateSubscriptionResult(data)
12644
12645 1
    def _binary_init(self, data):
12646 1
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
12647 1
        self.RevisedPublishingInterval = uabin.Primitives.Double.unpack(data)
12648 1
        self.RevisedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
12649 1
        self.RevisedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
12650
12651 1
    def __str__(self):
12652
        return 'CreateSubscriptionResult(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12653
               'RevisedPublishingInterval:' + str(self.RevisedPublishingInterval) + ', ' + \
12654
               'RevisedLifetimeCount:' + str(self.RevisedLifetimeCount) + ', ' + \
12655
               'RevisedMaxKeepAliveCount:' + str(self.RevisedMaxKeepAliveCount) + ')'
12656
12657 1
    __repr__ = __str__
12658
12659
12660 1
class CreateSubscriptionResponse(FrozenClass):
12661
    '''
12662
    :ivar TypeId:
12663
    :vartype TypeId: NodeId
12664
    :ivar ResponseHeader:
12665
    :vartype ResponseHeader: ResponseHeader
12666
    :ivar Parameters:
12667
    :vartype Parameters: CreateSubscriptionResult
12668
    '''
12669
12670 1
    ua_types = {
12671
        'TypeId': 'NodeId',
12672
        'ResponseHeader': 'ResponseHeader',
12673
        'Parameters': 'CreateSubscriptionResult',
12674
               }
12675
12676 1
    def __init__(self, binary=None):
12677 1
        if binary is not None:
12678 1
            self._binary_init(binary)
12679 1
            self._freeze = True
12680 1
            return
12681 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateSubscriptionResponse_Encoding_DefaultBinary)
12682 1
        self.ResponseHeader = ResponseHeader()
12683 1
        self.Parameters = CreateSubscriptionResult()
12684 1
        self._freeze = True
12685
12686 1
    def to_binary(self):
12687 1
        packet = []
12688 1
        packet.append(self.TypeId.to_binary())
12689 1
        packet.append(self.ResponseHeader.to_binary())
12690 1
        packet.append(self.Parameters.to_binary())
12691 1
        return b''.join(packet)
12692
12693 1
    @staticmethod
12694
    def from_binary(data):
12695 1
        return CreateSubscriptionResponse(data)
12696
12697 1
    def _binary_init(self, data):
12698 1
        self.TypeId = NodeId.from_binary(data)
12699 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
12700 1
        self.Parameters = CreateSubscriptionResult.from_binary(data)
12701
12702 1
    def __str__(self):
12703
        return 'CreateSubscriptionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12704
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12705
               'Parameters:' + str(self.Parameters) + ')'
12706
12707 1
    __repr__ = __str__
12708
12709
12710 1 View Code Duplication
class ModifySubscriptionParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12711
    '''
12712
    :ivar SubscriptionId:
12713
    :vartype SubscriptionId: UInt32
12714
    :ivar RequestedPublishingInterval:
12715
    :vartype RequestedPublishingInterval: Double
12716
    :ivar RequestedLifetimeCount:
12717
    :vartype RequestedLifetimeCount: UInt32
12718
    :ivar RequestedMaxKeepAliveCount:
12719
    :vartype RequestedMaxKeepAliveCount: UInt32
12720
    :ivar MaxNotificationsPerPublish:
12721
    :vartype MaxNotificationsPerPublish: UInt32
12722
    :ivar Priority:
12723
    :vartype Priority: Byte
12724
    '''
12725
12726 1
    ua_types = {
12727
        'SubscriptionId': 'UInt32',
12728
        'RequestedPublishingInterval': 'Double',
12729
        'RequestedLifetimeCount': 'UInt32',
12730
        'RequestedMaxKeepAliveCount': 'UInt32',
12731
        'MaxNotificationsPerPublish': 'UInt32',
12732
        'Priority': 'Byte',
12733
               }
12734
12735 1
    def __init__(self, binary=None):
12736
        if binary is not None:
12737
            self._binary_init(binary)
12738
            self._freeze = True
12739
            return
12740
        self.SubscriptionId = 0
12741
        self.RequestedPublishingInterval = 0
12742
        self.RequestedLifetimeCount = 0
12743
        self.RequestedMaxKeepAliveCount = 0
12744
        self.MaxNotificationsPerPublish = 0
12745
        self.Priority = 0
12746
        self._freeze = True
12747
12748 1
    def to_binary(self):
12749
        packet = []
12750
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
12751
        packet.append(uabin.Primitives.Double.pack(self.RequestedPublishingInterval))
12752
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedLifetimeCount))
12753
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedMaxKeepAliveCount))
12754
        packet.append(uabin.Primitives.UInt32.pack(self.MaxNotificationsPerPublish))
12755
        packet.append(uabin.Primitives.Byte.pack(self.Priority))
12756
        return b''.join(packet)
12757
12758 1
    @staticmethod
12759
    def from_binary(data):
12760
        return ModifySubscriptionParameters(data)
12761
12762 1
    def _binary_init(self, data):
12763
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
12764
        self.RequestedPublishingInterval = uabin.Primitives.Double.unpack(data)
12765
        self.RequestedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
12766
        self.RequestedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
12767
        self.MaxNotificationsPerPublish = uabin.Primitives.UInt32.unpack(data)
12768
        self.Priority = uabin.Primitives.Byte.unpack(data)
12769
12770 1
    def __str__(self):
12771
        return 'ModifySubscriptionParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12772
               'RequestedPublishingInterval:' + str(self.RequestedPublishingInterval) + ', ' + \
12773
               'RequestedLifetimeCount:' + str(self.RequestedLifetimeCount) + ', ' + \
12774
               'RequestedMaxKeepAliveCount:' + str(self.RequestedMaxKeepAliveCount) + ', ' + \
12775
               'MaxNotificationsPerPublish:' + str(self.MaxNotificationsPerPublish) + ', ' + \
12776
               'Priority:' + str(self.Priority) + ')'
12777
12778 1
    __repr__ = __str__
12779
12780
12781 1
class ModifySubscriptionRequest(FrozenClass):
12782
    '''
12783
    :ivar TypeId:
12784
    :vartype TypeId: NodeId
12785
    :ivar RequestHeader:
12786
    :vartype RequestHeader: RequestHeader
12787
    :ivar Parameters:
12788
    :vartype Parameters: ModifySubscriptionParameters
12789
    '''
12790
12791 1
    ua_types = {
12792
        'TypeId': 'NodeId',
12793
        'RequestHeader': 'RequestHeader',
12794
        'Parameters': 'ModifySubscriptionParameters',
12795
               }
12796
12797 1
    def __init__(self, binary=None):
12798
        if binary is not None:
12799
            self._binary_init(binary)
12800
            self._freeze = True
12801
            return
12802
        self.TypeId = FourByteNodeId(ObjectIds.ModifySubscriptionRequest_Encoding_DefaultBinary)
12803
        self.RequestHeader = RequestHeader()
12804
        self.Parameters = ModifySubscriptionParameters()
12805
        self._freeze = True
12806
12807 1
    def to_binary(self):
12808
        packet = []
12809
        packet.append(self.TypeId.to_binary())
12810
        packet.append(self.RequestHeader.to_binary())
12811
        packet.append(self.Parameters.to_binary())
12812
        return b''.join(packet)
12813
12814 1
    @staticmethod
12815
    def from_binary(data):
12816
        return ModifySubscriptionRequest(data)
12817
12818 1
    def _binary_init(self, data):
12819
        self.TypeId = NodeId.from_binary(data)
12820
        self.RequestHeader = RequestHeader.from_binary(data)
12821
        self.Parameters = ModifySubscriptionParameters.from_binary(data)
12822
12823 1
    def __str__(self):
12824
        return 'ModifySubscriptionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12825
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12826
               'Parameters:' + str(self.Parameters) + ')'
12827
12828 1
    __repr__ = __str__
12829
12830
12831 1 View Code Duplication
class ModifySubscriptionResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12832
    '''
12833
    :ivar RevisedPublishingInterval:
12834
    :vartype RevisedPublishingInterval: Double
12835
    :ivar RevisedLifetimeCount:
12836
    :vartype RevisedLifetimeCount: UInt32
12837
    :ivar RevisedMaxKeepAliveCount:
12838
    :vartype RevisedMaxKeepAliveCount: UInt32
12839
    '''
12840
12841 1
    ua_types = {
12842
        'RevisedPublishingInterval': 'Double',
12843
        'RevisedLifetimeCount': 'UInt32',
12844
        'RevisedMaxKeepAliveCount': 'UInt32',
12845
               }
12846
12847 1
    def __init__(self, binary=None):
12848
        if binary is not None:
12849
            self._binary_init(binary)
12850
            self._freeze = True
12851
            return
12852
        self.RevisedPublishingInterval = 0
12853
        self.RevisedLifetimeCount = 0
12854
        self.RevisedMaxKeepAliveCount = 0
12855
        self._freeze = True
12856
12857 1
    def to_binary(self):
12858
        packet = []
12859
        packet.append(uabin.Primitives.Double.pack(self.RevisedPublishingInterval))
12860
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedLifetimeCount))
12861
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedMaxKeepAliveCount))
12862
        return b''.join(packet)
12863
12864 1
    @staticmethod
12865
    def from_binary(data):
12866
        return ModifySubscriptionResult(data)
12867
12868 1
    def _binary_init(self, data):
12869
        self.RevisedPublishingInterval = uabin.Primitives.Double.unpack(data)
12870
        self.RevisedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
12871
        self.RevisedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
12872
12873 1
    def __str__(self):
12874
        return 'ModifySubscriptionResult(' + 'RevisedPublishingInterval:' + str(self.RevisedPublishingInterval) + ', ' + \
12875
               'RevisedLifetimeCount:' + str(self.RevisedLifetimeCount) + ', ' + \
12876
               'RevisedMaxKeepAliveCount:' + str(self.RevisedMaxKeepAliveCount) + ')'
12877
12878 1
    __repr__ = __str__
12879
12880
12881 1
class ModifySubscriptionResponse(FrozenClass):
12882
    '''
12883
    :ivar TypeId:
12884
    :vartype TypeId: NodeId
12885
    :ivar ResponseHeader:
12886
    :vartype ResponseHeader: ResponseHeader
12887
    :ivar Parameters:
12888
    :vartype Parameters: ModifySubscriptionResult
12889
    '''
12890
12891 1
    ua_types = {
12892
        'TypeId': 'NodeId',
12893
        'ResponseHeader': 'ResponseHeader',
12894
        'Parameters': 'ModifySubscriptionResult',
12895
               }
12896
12897 1
    def __init__(self, binary=None):
12898
        if binary is not None:
12899
            self._binary_init(binary)
12900
            self._freeze = True
12901
            return
12902
        self.TypeId = FourByteNodeId(ObjectIds.ModifySubscriptionResponse_Encoding_DefaultBinary)
12903
        self.ResponseHeader = ResponseHeader()
12904
        self.Parameters = ModifySubscriptionResult()
12905
        self._freeze = True
12906
12907 1
    def to_binary(self):
12908
        packet = []
12909
        packet.append(self.TypeId.to_binary())
12910
        packet.append(self.ResponseHeader.to_binary())
12911
        packet.append(self.Parameters.to_binary())
12912
        return b''.join(packet)
12913
12914 1
    @staticmethod
12915
    def from_binary(data):
12916
        return ModifySubscriptionResponse(data)
12917
12918 1
    def _binary_init(self, data):
12919
        self.TypeId = NodeId.from_binary(data)
12920
        self.ResponseHeader = ResponseHeader.from_binary(data)
12921
        self.Parameters = ModifySubscriptionResult.from_binary(data)
12922
12923 1
    def __str__(self):
12924
        return 'ModifySubscriptionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12925
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12926
               'Parameters:' + str(self.Parameters) + ')'
12927
12928 1
    __repr__ = __str__
12929
12930
12931 1 View Code Duplication
class SetPublishingModeParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12932
    '''
12933
    :ivar PublishingEnabled:
12934
    :vartype PublishingEnabled: Boolean
12935
    :ivar SubscriptionIds:
12936
    :vartype SubscriptionIds: UInt32
12937
    '''
12938
12939 1
    ua_types = {
12940
        'PublishingEnabled': 'Boolean',
12941
        'SubscriptionIds': 'UInt32',
12942
               }
12943
12944 1
    def __init__(self, binary=None):
12945
        if binary is not None:
12946
            self._binary_init(binary)
12947
            self._freeze = True
12948
            return
12949
        self.PublishingEnabled = True
12950
        self.SubscriptionIds = []
12951
        self._freeze = True
12952
12953 1
    def to_binary(self):
12954
        packet = []
12955
        packet.append(uabin.Primitives.Boolean.pack(self.PublishingEnabled))
12956
        packet.append(uabin.Primitives.Int32.pack(len(self.SubscriptionIds)))
12957
        for fieldname in self.SubscriptionIds:
12958
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
12959
        return b''.join(packet)
12960
12961 1
    @staticmethod
12962
    def from_binary(data):
12963
        return SetPublishingModeParameters(data)
12964
12965 1
    def _binary_init(self, data):
12966
        self.PublishingEnabled = uabin.Primitives.Boolean.unpack(data)
12967
        self.SubscriptionIds = uabin.Primitives.UInt32.unpack_array(data)
12968
12969 1
    def __str__(self):
12970
        return 'SetPublishingModeParameters(' + 'PublishingEnabled:' + str(self.PublishingEnabled) + ', ' + \
12971
               'SubscriptionIds:' + str(self.SubscriptionIds) + ')'
12972
12973 1
    __repr__ = __str__
12974
12975
12976 1
class SetPublishingModeRequest(FrozenClass):
12977
    '''
12978
    :ivar TypeId:
12979
    :vartype TypeId: NodeId
12980
    :ivar RequestHeader:
12981
    :vartype RequestHeader: RequestHeader
12982
    :ivar Parameters:
12983
    :vartype Parameters: SetPublishingModeParameters
12984
    '''
12985
12986 1
    ua_types = {
12987
        'TypeId': 'NodeId',
12988
        'RequestHeader': 'RequestHeader',
12989
        'Parameters': 'SetPublishingModeParameters',
12990
               }
12991
12992 1
    def __init__(self, binary=None):
12993
        if binary is not None:
12994
            self._binary_init(binary)
12995
            self._freeze = True
12996
            return
12997
        self.TypeId = FourByteNodeId(ObjectIds.SetPublishingModeRequest_Encoding_DefaultBinary)
12998
        self.RequestHeader = RequestHeader()
12999
        self.Parameters = SetPublishingModeParameters()
13000
        self._freeze = True
13001
13002 1
    def to_binary(self):
13003
        packet = []
13004
        packet.append(self.TypeId.to_binary())
13005
        packet.append(self.RequestHeader.to_binary())
13006
        packet.append(self.Parameters.to_binary())
13007
        return b''.join(packet)
13008
13009 1
    @staticmethod
13010
    def from_binary(data):
13011
        return SetPublishingModeRequest(data)
13012
13013 1
    def _binary_init(self, data):
13014
        self.TypeId = NodeId.from_binary(data)
13015
        self.RequestHeader = RequestHeader.from_binary(data)
13016
        self.Parameters = SetPublishingModeParameters.from_binary(data)
13017
13018 1
    def __str__(self):
13019
        return 'SetPublishingModeRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13020
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
13021
               'Parameters:' + str(self.Parameters) + ')'
13022
13023 1
    __repr__ = __str__
13024
13025
13026 1 View Code Duplication
class SetPublishingModeResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13027
    '''
13028
    :ivar Results:
13029
    :vartype Results: StatusCode
13030
    :ivar DiagnosticInfos:
13031
    :vartype DiagnosticInfos: DiagnosticInfo
13032
    '''
13033
13034 1
    ua_types = {
13035
        'Results': 'StatusCode',
13036
        'DiagnosticInfos': 'DiagnosticInfo',
13037
               }
13038
13039 1
    def __init__(self, binary=None):
13040
        if binary is not None:
13041
            self._binary_init(binary)
13042
            self._freeze = True
13043
            return
13044
        self.Results = []
13045
        self.DiagnosticInfos = []
13046
        self._freeze = True
13047
13048 1
    def to_binary(self):
13049
        packet = []
13050
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
13051
        for fieldname in self.Results:
13052
            packet.append(fieldname.to_binary())
13053
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
13054
        for fieldname in self.DiagnosticInfos:
13055
            packet.append(fieldname.to_binary())
13056
        return b''.join(packet)
13057
13058 1
    @staticmethod
13059
    def from_binary(data):
13060
        return SetPublishingModeResult(data)
13061
13062 1
    def _binary_init(self, data):
13063
        length = uabin.Primitives.Int32.unpack(data)
13064
        array = []
13065
        if length != -1:
13066
            for _ in range(0, length):
13067
                array.append(StatusCode.from_binary(data))
13068
        self.Results = array
13069
        length = uabin.Primitives.Int32.unpack(data)
13070
        array = []
13071
        if length != -1:
13072
            for _ in range(0, length):
13073
                array.append(DiagnosticInfo.from_binary(data))
13074
        self.DiagnosticInfos = array
13075
13076 1
    def __str__(self):
13077
        return 'SetPublishingModeResult(' + 'Results:' + str(self.Results) + ', ' + \
13078
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
13079
13080 1
    __repr__ = __str__
13081
13082
13083 1
class SetPublishingModeResponse(FrozenClass):
13084
    '''
13085
    :ivar TypeId:
13086
    :vartype TypeId: NodeId
13087
    :ivar ResponseHeader:
13088
    :vartype ResponseHeader: ResponseHeader
13089
    :ivar Parameters:
13090
    :vartype Parameters: SetPublishingModeResult
13091
    '''
13092
13093 1
    ua_types = {
13094
        'TypeId': 'NodeId',
13095
        'ResponseHeader': 'ResponseHeader',
13096
        'Parameters': 'SetPublishingModeResult',
13097
               }
13098
13099 1
    def __init__(self, binary=None):
13100
        if binary is not None:
13101
            self._binary_init(binary)
13102
            self._freeze = True
13103
            return
13104
        self.TypeId = FourByteNodeId(ObjectIds.SetPublishingModeResponse_Encoding_DefaultBinary)
13105
        self.ResponseHeader = ResponseHeader()
13106
        self.Parameters = SetPublishingModeResult()
13107
        self._freeze = True
13108
13109 1
    def to_binary(self):
13110
        packet = []
13111
        packet.append(self.TypeId.to_binary())
13112
        packet.append(self.ResponseHeader.to_binary())
13113
        packet.append(self.Parameters.to_binary())
13114
        return b''.join(packet)
13115
13116 1
    @staticmethod
13117
    def from_binary(data):
13118
        return SetPublishingModeResponse(data)
13119
13120 1
    def _binary_init(self, data):
13121
        self.TypeId = NodeId.from_binary(data)
13122
        self.ResponseHeader = ResponseHeader.from_binary(data)
13123
        self.Parameters = SetPublishingModeResult.from_binary(data)
13124
13125 1
    def __str__(self):
13126
        return 'SetPublishingModeResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13127
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
13128
               'Parameters:' + str(self.Parameters) + ')'
13129
13130 1
    __repr__ = __str__
13131
13132
13133 1 View Code Duplication
class NotificationMessage(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13134
    '''
13135
    :ivar SequenceNumber:
13136
    :vartype SequenceNumber: UInt32
13137
    :ivar PublishTime:
13138
    :vartype PublishTime: DateTime
13139
    :ivar NotificationData:
13140
    :vartype NotificationData: ExtensionObject
13141
    '''
13142
13143 1
    ua_types = {
13144
        'SequenceNumber': 'UInt32',
13145
        'PublishTime': 'DateTime',
13146
        'NotificationData': 'ExtensionObject',
13147
               }
13148
13149 1
    def __init__(self, binary=None):
13150 1
        if binary is not None:
13151 1
            self._binary_init(binary)
13152 1
            self._freeze = True
13153 1
            return
13154 1
        self.SequenceNumber = 0
13155 1
        self.PublishTime = datetime.now()
13156 1
        self.NotificationData = []
13157 1
        self._freeze = True
13158
13159 1
    def to_binary(self):
13160 1
        packet = []
13161 1
        packet.append(uabin.Primitives.UInt32.pack(self.SequenceNumber))
13162 1
        packet.append(uabin.Primitives.DateTime.pack(self.PublishTime))
13163 1
        packet.append(uabin.Primitives.Int32.pack(len(self.NotificationData)))
13164 1
        for fieldname in self.NotificationData:
13165 1
            packet.append(extensionobject_to_binary(fieldname))
13166 1
        return b''.join(packet)
13167
13168 1
    @staticmethod
13169
    def from_binary(data):
13170 1
        return NotificationMessage(data)
13171
13172 1
    def _binary_init(self, data):
13173 1
        self.SequenceNumber = uabin.Primitives.UInt32.unpack(data)
13174 1
        self.PublishTime = uabin.Primitives.DateTime.unpack(data)
13175 1
        length = uabin.Primitives.Int32.unpack(data)
13176 1
        array = []
13177 1
        if length != -1:
13178 1
            for _ in range(0, length):
13179 1
                array.append(extensionobject_from_binary(data))
13180 1
        self.NotificationData = array
13181
13182 1
    def __str__(self):
13183
        return 'NotificationMessage(' + 'SequenceNumber:' + str(self.SequenceNumber) + ', ' + \
13184
               'PublishTime:' + str(self.PublishTime) + ', ' + \
13185
               'NotificationData:' + str(self.NotificationData) + ')'
13186
13187 1
    __repr__ = __str__
13188
13189
13190 1 View Code Duplication
class NotificationData(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13191
    '''
13192
    '''
13193
13194 1
    ua_types = {
13195
               }
13196
13197 1
    def __init__(self, binary=None):
13198
        if binary is not None:
13199
            self._binary_init(binary)
13200
            self._freeze = True
13201
            return
13202
        self._freeze = True
13203
13204 1
    def to_binary(self):
13205
        packet = []
13206
        return b''.join(packet)
13207
13208 1
    @staticmethod
13209
    def from_binary(data):
13210
        return NotificationData(data)
13211
13212 1
    def _binary_init(self, data):
13213
        pass
13214
13215 1
    def __str__(self):
13216
        return 'NotificationData(' +  + ')'
13217
13218 1
    __repr__ = __str__
13219
13220
13221 1 View Code Duplication
class DataChangeNotification(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13222
    '''
13223
    :ivar MonitoredItems:
13224
    :vartype MonitoredItems: MonitoredItemNotification
13225
    :ivar DiagnosticInfos:
13226
    :vartype DiagnosticInfos: DiagnosticInfo
13227
    '''
13228
13229 1
    ua_types = {
13230
        'MonitoredItems': 'MonitoredItemNotification',
13231
        'DiagnosticInfos': 'DiagnosticInfo',
13232
               }
13233
13234 1
    def __init__(self, binary=None):
13235 1
        if binary is not None:
13236 1
            self._binary_init(binary)
13237 1
            self._freeze = True
13238 1
            return
13239 1
        self.MonitoredItems = []
13240 1
        self.DiagnosticInfos = []
13241 1
        self._freeze = True
13242
13243 1
    def to_binary(self):
13244 1
        packet = []
13245 1
        packet.append(uabin.Primitives.Int32.pack(len(self.MonitoredItems)))
13246 1
        for fieldname in self.MonitoredItems:
13247 1
            packet.append(fieldname.to_binary())
13248 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
13249 1
        for fieldname in self.DiagnosticInfos:
13250
            packet.append(fieldname.to_binary())
13251 1
        return b''.join(packet)
13252
13253 1
    @staticmethod
13254
    def from_binary(data):
13255 1
        return DataChangeNotification(data)
13256
13257 1
    def _binary_init(self, data):
13258 1
        length = uabin.Primitives.Int32.unpack(data)
13259 1
        array = []
13260 1
        if length != -1:
13261 1
            for _ in range(0, length):
13262 1
                array.append(MonitoredItemNotification.from_binary(data))
13263 1
        self.MonitoredItems = array
13264 1
        length = uabin.Primitives.Int32.unpack(data)
13265 1
        array = []
13266 1
        if length != -1:
13267 1
            for _ in range(0, length):
13268
                array.append(DiagnosticInfo.from_binary(data))
13269 1
        self.DiagnosticInfos = array
13270
13271 1
    def __str__(self):
13272
        return 'DataChangeNotification(' + 'MonitoredItems:' + str(self.MonitoredItems) + ', ' + \
13273
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
13274
13275 1
    __repr__ = __str__
13276
13277
13278 1 View Code Duplication
class MonitoredItemNotification(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13279
    '''
13280
    :ivar ClientHandle:
13281
    :vartype ClientHandle: UInt32
13282
    :ivar Value:
13283
    :vartype Value: DataValue
13284
    '''
13285
13286 1
    ua_types = {
13287
        'ClientHandle': 'UInt32',
13288
        'Value': 'DataValue',
13289
               }
13290
13291 1
    def __init__(self, binary=None):
13292 1
        if binary is not None:
13293 1
            self._binary_init(binary)
13294 1
            self._freeze = True
13295 1
            return
13296 1
        self.ClientHandle = 0
13297 1
        self.Value = DataValue()
13298 1
        self._freeze = True
13299
13300 1
    def to_binary(self):
13301 1
        packet = []
13302 1
        packet.append(uabin.Primitives.UInt32.pack(self.ClientHandle))
13303 1
        packet.append(self.Value.to_binary())
13304 1
        return b''.join(packet)
13305
13306 1
    @staticmethod
13307
    def from_binary(data):
13308 1
        return MonitoredItemNotification(data)
13309
13310 1
    def _binary_init(self, data):
13311 1
        self.ClientHandle = uabin.Primitives.UInt32.unpack(data)
13312 1
        self.Value = DataValue.from_binary(data)
13313
13314 1
    def __str__(self):
13315
        return 'MonitoredItemNotification(' + 'ClientHandle:' + str(self.ClientHandle) + ', ' + \
13316
               'Value:' + str(self.Value) + ')'
13317
13318 1
    __repr__ = __str__
13319
13320
13321 1
class EventNotificationList(FrozenClass):
13322
    '''
13323
    :ivar Events:
13324
    :vartype Events: EventFieldList
13325
    '''
13326
13327 1
    ua_types = {
13328
        'Events': 'EventFieldList',
13329
               }
13330
13331 1
    def __init__(self, binary=None):
13332 1
        if binary is not None:
13333 1
            self._binary_init(binary)
13334 1
            self._freeze = True
13335 1
            return
13336 1
        self.Events = []
13337 1
        self._freeze = True
13338
13339 1
    def to_binary(self):
13340 1
        packet = []
13341 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Events)))
13342 1
        for fieldname in self.Events:
13343 1
            packet.append(fieldname.to_binary())
13344 1
        return b''.join(packet)
13345
13346 1
    @staticmethod
13347
    def from_binary(data):
13348 1
        return EventNotificationList(data)
13349
13350 1
    def _binary_init(self, data):
13351 1
        length = uabin.Primitives.Int32.unpack(data)
13352 1
        array = []
13353 1
        if length != -1:
13354 1
            for _ in range(0, length):
13355 1
                array.append(EventFieldList.from_binary(data))
13356 1
        self.Events = array
13357
13358 1
    def __str__(self):
13359
        return 'EventNotificationList(' + 'Events:' + str(self.Events) + ')'
13360
13361 1
    __repr__ = __str__
13362
13363
13364 1 View Code Duplication
class EventFieldList(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13365
    '''
13366
    :ivar ClientHandle:
13367
    :vartype ClientHandle: UInt32
13368
    :ivar EventFields:
13369
    :vartype EventFields: Variant
13370
    '''
13371
13372 1
    ua_types = {
13373
        'ClientHandle': 'UInt32',
13374
        'EventFields': 'Variant',
13375
               }
13376
13377 1
    def __init__(self, binary=None):
13378 1
        if binary is not None:
13379 1
            self._binary_init(binary)
13380 1
            self._freeze = True
13381 1
            return
13382 1
        self.ClientHandle = 0
13383 1
        self.EventFields = []
13384 1
        self._freeze = True
13385
13386 1
    def to_binary(self):
13387 1
        packet = []
13388 1
        packet.append(uabin.Primitives.UInt32.pack(self.ClientHandle))
13389 1
        packet.append(uabin.Primitives.Int32.pack(len(self.EventFields)))
13390 1
        for fieldname in self.EventFields:
13391 1
            packet.append(fieldname.to_binary())
13392 1
        return b''.join(packet)
13393
13394 1
    @staticmethod
13395
    def from_binary(data):
13396 1
        return EventFieldList(data)
13397
13398 1
    def _binary_init(self, data):
13399 1
        self.ClientHandle = uabin.Primitives.UInt32.unpack(data)
13400 1
        length = uabin.Primitives.Int32.unpack(data)
13401 1
        array = []
13402 1
        if length != -1:
13403 1
            for _ in range(0, length):
13404 1
                array.append(Variant.from_binary(data))
13405 1
        self.EventFields = array
13406
13407 1
    def __str__(self):
13408
        return 'EventFieldList(' + 'ClientHandle:' + str(self.ClientHandle) + ', ' + \
13409
               'EventFields:' + str(self.EventFields) + ')'
13410
13411 1
    __repr__ = __str__
13412
13413
13414 1
class HistoryEventFieldList(FrozenClass):
13415
    '''
13416
    :ivar EventFields:
13417
    :vartype EventFields: Variant
13418
    '''
13419
13420 1
    ua_types = {
13421
        'EventFields': 'Variant',
13422
               }
13423
13424 1
    def __init__(self, binary=None):
13425 1
        if binary is not None:
13426
            self._binary_init(binary)
13427
            self._freeze = True
13428
            return
13429 1
        self.EventFields = []
13430 1
        self._freeze = True
13431
13432 1
    def to_binary(self):
13433
        packet = []
13434
        packet.append(uabin.Primitives.Int32.pack(len(self.EventFields)))
13435
        for fieldname in self.EventFields:
13436
            packet.append(fieldname.to_binary())
13437
        return b''.join(packet)
13438
13439 1
    @staticmethod
13440
    def from_binary(data):
13441
        return HistoryEventFieldList(data)
13442
13443 1
    def _binary_init(self, data):
13444
        length = uabin.Primitives.Int32.unpack(data)
13445
        array = []
13446
        if length != -1:
13447
            for _ in range(0, length):
13448
                array.append(Variant.from_binary(data))
13449
        self.EventFields = array
13450
13451 1
    def __str__(self):
13452
        return 'HistoryEventFieldList(' + 'EventFields:' + str(self.EventFields) + ')'
13453
13454 1
    __repr__ = __str__
13455
13456
13457 1 View Code Duplication
class StatusChangeNotification(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13458
    '''
13459
    :ivar Status:
13460
    :vartype Status: StatusCode
13461
    :ivar DiagnosticInfo:
13462
    :vartype DiagnosticInfo: DiagnosticInfo
13463
    '''
13464
13465 1
    ua_types = {
13466
        'Status': 'StatusCode',
13467
        'DiagnosticInfo': 'DiagnosticInfo',
13468
               }
13469
13470 1
    def __init__(self, binary=None):
13471
        if binary is not None:
13472
            self._binary_init(binary)
13473
            self._freeze = True
13474
            return
13475
        self.Status = StatusCode()
13476
        self.DiagnosticInfo = DiagnosticInfo()
13477
        self._freeze = True
13478
13479 1
    def to_binary(self):
13480
        packet = []
13481
        packet.append(self.Status.to_binary())
13482
        packet.append(self.DiagnosticInfo.to_binary())
13483
        return b''.join(packet)
13484
13485 1
    @staticmethod
13486
    def from_binary(data):
13487
        return StatusChangeNotification(data)
13488
13489 1
    def _binary_init(self, data):
13490
        self.Status = StatusCode.from_binary(data)
13491
        self.DiagnosticInfo = DiagnosticInfo.from_binary(data)
13492
13493 1
    def __str__(self):
13494
        return 'StatusChangeNotification(' + 'Status:' + str(self.Status) + ', ' + \
13495
               'DiagnosticInfo:' + str(self.DiagnosticInfo) + ')'
13496
13497 1
    __repr__ = __str__
13498
13499
13500 1 View Code Duplication
class SubscriptionAcknowledgement(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13501
    '''
13502
    :ivar SubscriptionId:
13503
    :vartype SubscriptionId: UInt32
13504
    :ivar SequenceNumber:
13505
    :vartype SequenceNumber: UInt32
13506
    '''
13507
13508 1
    ua_types = {
13509
        'SubscriptionId': 'UInt32',
13510
        'SequenceNumber': 'UInt32',
13511
               }
13512
13513 1
    def __init__(self, binary=None):
13514 1
        if binary is not None:
13515 1
            self._binary_init(binary)
13516 1
            self._freeze = True
13517 1
            return
13518 1
        self.SubscriptionId = 0
13519 1
        self.SequenceNumber = 0
13520 1
        self._freeze = True
13521
13522 1
    def to_binary(self):
13523 1
        packet = []
13524 1
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
13525 1
        packet.append(uabin.Primitives.UInt32.pack(self.SequenceNumber))
13526 1
        return b''.join(packet)
13527
13528 1
    @staticmethod
13529
    def from_binary(data):
13530 1
        return SubscriptionAcknowledgement(data)
13531
13532 1
    def _binary_init(self, data):
13533 1
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
13534 1
        self.SequenceNumber = uabin.Primitives.UInt32.unpack(data)
13535
13536 1
    def __str__(self):
13537
        return 'SubscriptionAcknowledgement(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
13538
               'SequenceNumber:' + str(self.SequenceNumber) + ')'
13539
13540 1
    __repr__ = __str__
13541
13542
13543 1
class PublishParameters(FrozenClass):
13544
    '''
13545
    :ivar SubscriptionAcknowledgements:
13546
    :vartype SubscriptionAcknowledgements: SubscriptionAcknowledgement
13547
    '''
13548
13549 1
    ua_types = {
13550
        'SubscriptionAcknowledgements': 'SubscriptionAcknowledgement',
13551
               }
13552
13553 1
    def __init__(self, binary=None):
13554 1
        if binary is not None:
13555 1
            self._binary_init(binary)
13556 1
            self._freeze = True
13557 1
            return
13558 1
        self.SubscriptionAcknowledgements = []
13559 1
        self._freeze = True
13560
13561 1
    def to_binary(self):
13562 1
        packet = []
13563 1
        packet.append(uabin.Primitives.Int32.pack(len(self.SubscriptionAcknowledgements)))
13564 1
        for fieldname in self.SubscriptionAcknowledgements:
13565 1
            packet.append(fieldname.to_binary())
13566 1
        return b''.join(packet)
13567
13568 1
    @staticmethod
13569
    def from_binary(data):
13570 1
        return PublishParameters(data)
13571
13572 1
    def _binary_init(self, data):
13573 1
        length = uabin.Primitives.Int32.unpack(data)
13574 1
        array = []
13575 1
        if length != -1:
13576 1
            for _ in range(0, length):
13577 1
                array.append(SubscriptionAcknowledgement.from_binary(data))
13578 1
        self.SubscriptionAcknowledgements = array
13579
13580 1
    def __str__(self):
13581
        return 'PublishParameters(' + 'SubscriptionAcknowledgements:' + str(self.SubscriptionAcknowledgements) + ')'
13582
13583 1
    __repr__ = __str__
13584
13585
13586 1
class PublishRequest(FrozenClass):
13587
    '''
13588
    :ivar TypeId:
13589
    :vartype TypeId: NodeId
13590
    :ivar RequestHeader:
13591
    :vartype RequestHeader: RequestHeader
13592
    :ivar Parameters:
13593
    :vartype Parameters: PublishParameters
13594
    '''
13595
13596 1
    ua_types = {
13597
        'TypeId': 'NodeId',
13598
        'RequestHeader': 'RequestHeader',
13599
        'Parameters': 'PublishParameters',
13600
               }
13601
13602 1
    def __init__(self, binary=None):
13603 1
        if binary is not None:
13604
            self._binary_init(binary)
13605
            self._freeze = True
13606
            return
13607 1
        self.TypeId = FourByteNodeId(ObjectIds.PublishRequest_Encoding_DefaultBinary)
13608 1
        self.RequestHeader = RequestHeader()
13609 1
        self.Parameters = PublishParameters()
13610 1
        self._freeze = True
13611
13612 1
    def to_binary(self):
13613 1
        packet = []
13614 1
        packet.append(self.TypeId.to_binary())
13615 1
        packet.append(self.RequestHeader.to_binary())
13616 1
        packet.append(self.Parameters.to_binary())
13617 1
        return b''.join(packet)
13618
13619 1
    @staticmethod
13620
    def from_binary(data):
13621
        return PublishRequest(data)
13622
13623 1
    def _binary_init(self, data):
13624
        self.TypeId = NodeId.from_binary(data)
13625
        self.RequestHeader = RequestHeader.from_binary(data)
13626
        self.Parameters = PublishParameters.from_binary(data)
13627
13628 1
    def __str__(self):
13629
        return 'PublishRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13630
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
13631
               'Parameters:' + str(self.Parameters) + ')'
13632
13633 1
    __repr__ = __str__
13634
13635
13636 1
class PublishResult(FrozenClass):
13637
    '''
13638
    :ivar SubscriptionId:
13639
    :vartype SubscriptionId: UInt32
13640
    :ivar AvailableSequenceNumbers:
13641
    :vartype AvailableSequenceNumbers: UInt32
13642
    :ivar MoreNotifications:
13643
    :vartype MoreNotifications: Boolean
13644
    :ivar NotificationMessage:
13645
    :vartype NotificationMessage: NotificationMessage
13646
    :ivar Results:
13647
    :vartype Results: StatusCode
13648
    :ivar DiagnosticInfos:
13649
    :vartype DiagnosticInfos: DiagnosticInfo
13650
    '''
13651
13652 1
    ua_types = {
13653
        'SubscriptionId': 'UInt32',
13654
        'AvailableSequenceNumbers': 'UInt32',
13655
        'MoreNotifications': 'Boolean',
13656
        'NotificationMessage': 'NotificationMessage',
13657
        'Results': 'StatusCode',
13658
        'DiagnosticInfos': 'DiagnosticInfo',
13659
               }
13660
13661 1
    def __init__(self, binary=None):
13662 1
        if binary is not None:
13663 1
            self._binary_init(binary)
13664 1
            self._freeze = True
13665 1
            return
13666 1
        self.SubscriptionId = 0
13667 1
        self.AvailableSequenceNumbers = []
13668 1
        self.MoreNotifications = True
13669 1
        self.NotificationMessage = NotificationMessage()
13670 1
        self.Results = []
13671 1
        self.DiagnosticInfos = []
13672 1
        self._freeze = True
13673
13674 1 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13675 1
        packet = []
13676 1
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
13677 1
        packet.append(uabin.Primitives.Int32.pack(len(self.AvailableSequenceNumbers)))
13678 1
        for fieldname in self.AvailableSequenceNumbers:
13679 1
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
13680 1
        packet.append(uabin.Primitives.Boolean.pack(self.MoreNotifications))
13681 1
        packet.append(self.NotificationMessage.to_binary())
13682 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
13683 1
        for fieldname in self.Results:
13684
            packet.append(fieldname.to_binary())
13685 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
13686 1
        for fieldname in self.DiagnosticInfos:
13687
            packet.append(fieldname.to_binary())
13688 1
        return b''.join(packet)
13689
13690 1
    @staticmethod
13691
    def from_binary(data):
13692 1
        return PublishResult(data)
13693
13694 1
    def _binary_init(self, data):
13695 1
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
13696 1
        self.AvailableSequenceNumbers = uabin.Primitives.UInt32.unpack_array(data)
13697 1
        self.MoreNotifications = uabin.Primitives.Boolean.unpack(data)
13698 1
        self.NotificationMessage = NotificationMessage.from_binary(data)
13699 1
        length = uabin.Primitives.Int32.unpack(data)
13700 1
        array = []
13701 1
        if length != -1:
13702 1
            for _ in range(0, length):
13703
                array.append(StatusCode.from_binary(data))
13704 1
        self.Results = array
13705 1
        length = uabin.Primitives.Int32.unpack(data)
13706 1
        array = []
13707 1
        if length != -1:
13708 1
            for _ in range(0, length):
13709
                array.append(DiagnosticInfo.from_binary(data))
13710 1
        self.DiagnosticInfos = array
13711
13712 1
    def __str__(self):
13713
        return 'PublishResult(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
13714
               'AvailableSequenceNumbers:' + str(self.AvailableSequenceNumbers) + ', ' + \
13715
               'MoreNotifications:' + str(self.MoreNotifications) + ', ' + \
13716
               'NotificationMessage:' + str(self.NotificationMessage) + ', ' + \
13717
               'Results:' + str(self.Results) + ', ' + \
13718
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
13719
13720 1
    __repr__ = __str__
13721
13722
13723 1
class PublishResponse(FrozenClass):
13724
    '''
13725
    :ivar TypeId:
13726
    :vartype TypeId: NodeId
13727
    :ivar ResponseHeader:
13728
    :vartype ResponseHeader: ResponseHeader
13729
    :ivar Parameters:
13730
    :vartype Parameters: PublishResult
13731
    '''
13732
13733 1
    ua_types = {
13734
        'TypeId': 'NodeId',
13735
        'ResponseHeader': 'ResponseHeader',
13736
        'Parameters': 'PublishResult',
13737
               }
13738
13739 1
    def __init__(self, binary=None):
13740 1
        if binary is not None:
13741 1
            self._binary_init(binary)
13742 1
            self._freeze = True
13743 1
            return
13744 1
        self.TypeId = FourByteNodeId(ObjectIds.PublishResponse_Encoding_DefaultBinary)
13745 1
        self.ResponseHeader = ResponseHeader()
13746 1
        self.Parameters = PublishResult()
13747 1
        self._freeze = True
13748
13749 1
    def to_binary(self):
13750 1
        packet = []
13751 1
        packet.append(self.TypeId.to_binary())
13752 1
        packet.append(self.ResponseHeader.to_binary())
13753 1
        packet.append(self.Parameters.to_binary())
13754 1
        return b''.join(packet)
13755
13756 1
    @staticmethod
13757
    def from_binary(data):
13758 1
        return PublishResponse(data)
13759
13760 1
    def _binary_init(self, data):
13761 1
        self.TypeId = NodeId.from_binary(data)
13762 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
13763 1
        self.Parameters = PublishResult.from_binary(data)
13764
13765 1
    def __str__(self):
13766
        return 'PublishResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13767
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
13768
               'Parameters:' + str(self.Parameters) + ')'
13769
13770 1
    __repr__ = __str__
13771
13772
13773 1 View Code Duplication
class RepublishParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13774
    '''
13775
    :ivar SubscriptionId:
13776
    :vartype SubscriptionId: UInt32
13777
    :ivar RetransmitSequenceNumber:
13778
    :vartype RetransmitSequenceNumber: UInt32
13779
    '''
13780
13781 1
    ua_types = {
13782
        'SubscriptionId': 'UInt32',
13783
        'RetransmitSequenceNumber': 'UInt32',
13784
               }
13785
13786 1
    def __init__(self, binary=None):
13787
        if binary is not None:
13788
            self._binary_init(binary)
13789
            self._freeze = True
13790
            return
13791
        self.SubscriptionId = 0
13792
        self.RetransmitSequenceNumber = 0
13793
        self._freeze = True
13794
13795 1
    def to_binary(self):
13796
        packet = []
13797
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
13798
        packet.append(uabin.Primitives.UInt32.pack(self.RetransmitSequenceNumber))
13799
        return b''.join(packet)
13800
13801 1
    @staticmethod
13802
    def from_binary(data):
13803
        return RepublishParameters(data)
13804
13805 1
    def _binary_init(self, data):
13806
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
13807
        self.RetransmitSequenceNumber = uabin.Primitives.UInt32.unpack(data)
13808
13809 1
    def __str__(self):
13810
        return 'RepublishParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
13811
               'RetransmitSequenceNumber:' + str(self.RetransmitSequenceNumber) + ')'
13812
13813 1
    __repr__ = __str__
13814
13815
13816 1
class RepublishRequest(FrozenClass):
13817
    '''
13818
    :ivar TypeId:
13819
    :vartype TypeId: NodeId
13820
    :ivar RequestHeader:
13821
    :vartype RequestHeader: RequestHeader
13822
    :ivar Parameters:
13823
    :vartype Parameters: RepublishParameters
13824
    '''
13825
13826 1
    ua_types = {
13827
        'TypeId': 'NodeId',
13828
        'RequestHeader': 'RequestHeader',
13829
        'Parameters': 'RepublishParameters',
13830
               }
13831
13832 1
    def __init__(self, binary=None):
13833
        if binary is not None:
13834
            self._binary_init(binary)
13835
            self._freeze = True
13836
            return
13837
        self.TypeId = FourByteNodeId(ObjectIds.RepublishRequest_Encoding_DefaultBinary)
13838
        self.RequestHeader = RequestHeader()
13839
        self.Parameters = RepublishParameters()
13840
        self._freeze = True
13841
13842 1
    def to_binary(self):
13843
        packet = []
13844
        packet.append(self.TypeId.to_binary())
13845
        packet.append(self.RequestHeader.to_binary())
13846
        packet.append(self.Parameters.to_binary())
13847
        return b''.join(packet)
13848
13849 1
    @staticmethod
13850
    def from_binary(data):
13851
        return RepublishRequest(data)
13852
13853 1
    def _binary_init(self, data):
13854
        self.TypeId = NodeId.from_binary(data)
13855
        self.RequestHeader = RequestHeader.from_binary(data)
13856
        self.Parameters = RepublishParameters.from_binary(data)
13857
13858 1
    def __str__(self):
13859
        return 'RepublishRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13860
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
13861
               'Parameters:' + str(self.Parameters) + ')'
13862
13863 1
    __repr__ = __str__
13864
13865
13866 1
class RepublishResponse(FrozenClass):
13867
    '''
13868
    :ivar TypeId:
13869
    :vartype TypeId: NodeId
13870
    :ivar ResponseHeader:
13871
    :vartype ResponseHeader: ResponseHeader
13872
    :ivar NotificationMessage:
13873
    :vartype NotificationMessage: NotificationMessage
13874
    '''
13875
13876 1
    ua_types = {
13877
        'TypeId': 'NodeId',
13878
        'ResponseHeader': 'ResponseHeader',
13879
        'NotificationMessage': 'NotificationMessage',
13880
               }
13881
13882 1
    def __init__(self, binary=None):
13883
        if binary is not None:
13884
            self._binary_init(binary)
13885
            self._freeze = True
13886
            return
13887
        self.TypeId = FourByteNodeId(ObjectIds.RepublishResponse_Encoding_DefaultBinary)
13888
        self.ResponseHeader = ResponseHeader()
13889
        self.NotificationMessage = NotificationMessage()
13890
        self._freeze = True
13891
13892 1
    def to_binary(self):
13893
        packet = []
13894
        packet.append(self.TypeId.to_binary())
13895
        packet.append(self.ResponseHeader.to_binary())
13896
        packet.append(self.NotificationMessage.to_binary())
13897
        return b''.join(packet)
13898
13899 1
    @staticmethod
13900
    def from_binary(data):
13901
        return RepublishResponse(data)
13902
13903 1
    def _binary_init(self, data):
13904
        self.TypeId = NodeId.from_binary(data)
13905
        self.ResponseHeader = ResponseHeader.from_binary(data)
13906
        self.NotificationMessage = NotificationMessage.from_binary(data)
13907
13908 1
    def __str__(self):
13909
        return 'RepublishResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13910
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
13911
               'NotificationMessage:' + str(self.NotificationMessage) + ')'
13912
13913 1
    __repr__ = __str__
13914
13915
13916 1 View Code Duplication
class TransferResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13917
    '''
13918
    :ivar StatusCode:
13919
    :vartype StatusCode: StatusCode
13920
    :ivar AvailableSequenceNumbers:
13921
    :vartype AvailableSequenceNumbers: UInt32
13922
    '''
13923
13924 1
    ua_types = {
13925
        'StatusCode': 'StatusCode',
13926
        'AvailableSequenceNumbers': 'UInt32',
13927
               }
13928
13929 1
    def __init__(self, binary=None):
13930
        if binary is not None:
13931
            self._binary_init(binary)
13932
            self._freeze = True
13933
            return
13934
        self.StatusCode = StatusCode()
13935
        self.AvailableSequenceNumbers = []
13936
        self._freeze = True
13937
13938 1
    def to_binary(self):
13939
        packet = []
13940
        packet.append(self.StatusCode.to_binary())
13941
        packet.append(uabin.Primitives.Int32.pack(len(self.AvailableSequenceNumbers)))
13942
        for fieldname in self.AvailableSequenceNumbers:
13943
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
13944
        return b''.join(packet)
13945
13946 1
    @staticmethod
13947
    def from_binary(data):
13948
        return TransferResult(data)
13949
13950 1
    def _binary_init(self, data):
13951
        self.StatusCode = StatusCode.from_binary(data)
13952
        self.AvailableSequenceNumbers = uabin.Primitives.UInt32.unpack_array(data)
13953
13954 1
    def __str__(self):
13955
        return 'TransferResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
13956
               'AvailableSequenceNumbers:' + str(self.AvailableSequenceNumbers) + ')'
13957
13958 1
    __repr__ = __str__
13959
13960
13961 1 View Code Duplication
class TransferSubscriptionsParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13962
    '''
13963
    :ivar SubscriptionIds:
13964
    :vartype SubscriptionIds: UInt32
13965
    :ivar SendInitialValues:
13966
    :vartype SendInitialValues: Boolean
13967
    '''
13968
13969 1
    ua_types = {
13970
        'SubscriptionIds': 'UInt32',
13971
        'SendInitialValues': 'Boolean',
13972
               }
13973
13974 1
    def __init__(self, binary=None):
13975
        if binary is not None:
13976
            self._binary_init(binary)
13977
            self._freeze = True
13978
            return
13979
        self.SubscriptionIds = []
13980
        self.SendInitialValues = True
13981
        self._freeze = True
13982
13983 1
    def to_binary(self):
13984
        packet = []
13985
        packet.append(uabin.Primitives.Int32.pack(len(self.SubscriptionIds)))
13986
        for fieldname in self.SubscriptionIds:
13987
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
13988
        packet.append(uabin.Primitives.Boolean.pack(self.SendInitialValues))
13989
        return b''.join(packet)
13990
13991 1
    @staticmethod
13992
    def from_binary(data):
13993
        return TransferSubscriptionsParameters(data)
13994
13995 1
    def _binary_init(self, data):
13996
        self.SubscriptionIds = uabin.Primitives.UInt32.unpack_array(data)
13997
        self.SendInitialValues = uabin.Primitives.Boolean.unpack(data)
13998
13999 1
    def __str__(self):
14000
        return 'TransferSubscriptionsParameters(' + 'SubscriptionIds:' + str(self.SubscriptionIds) + ', ' + \
14001
               'SendInitialValues:' + str(self.SendInitialValues) + ')'
14002
14003 1
    __repr__ = __str__
14004
14005
14006 1
class TransferSubscriptionsRequest(FrozenClass):
14007
    '''
14008
    :ivar TypeId:
14009
    :vartype TypeId: NodeId
14010
    :ivar RequestHeader:
14011
    :vartype RequestHeader: RequestHeader
14012
    :ivar Parameters:
14013
    :vartype Parameters: TransferSubscriptionsParameters
14014
    '''
14015
14016 1
    ua_types = {
14017
        'TypeId': 'NodeId',
14018
        'RequestHeader': 'RequestHeader',
14019
        'Parameters': 'TransferSubscriptionsParameters',
14020
               }
14021
14022 1
    def __init__(self, binary=None):
14023
        if binary is not None:
14024
            self._binary_init(binary)
14025
            self._freeze = True
14026
            return
14027
        self.TypeId = FourByteNodeId(ObjectIds.TransferSubscriptionsRequest_Encoding_DefaultBinary)
14028
        self.RequestHeader = RequestHeader()
14029
        self.Parameters = TransferSubscriptionsParameters()
14030
        self._freeze = True
14031
14032 1
    def to_binary(self):
14033
        packet = []
14034
        packet.append(self.TypeId.to_binary())
14035
        packet.append(self.RequestHeader.to_binary())
14036
        packet.append(self.Parameters.to_binary())
14037
        return b''.join(packet)
14038
14039 1
    @staticmethod
14040
    def from_binary(data):
14041
        return TransferSubscriptionsRequest(data)
14042
14043 1
    def _binary_init(self, data):
14044
        self.TypeId = NodeId.from_binary(data)
14045
        self.RequestHeader = RequestHeader.from_binary(data)
14046
        self.Parameters = TransferSubscriptionsParameters.from_binary(data)
14047
14048 1
    def __str__(self):
14049
        return 'TransferSubscriptionsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
14050
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
14051
               'Parameters:' + str(self.Parameters) + ')'
14052
14053 1
    __repr__ = __str__
14054
14055
14056 1 View Code Duplication
class TransferSubscriptionsResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
14057
    '''
14058
    :ivar Results:
14059
    :vartype Results: TransferResult
14060
    :ivar DiagnosticInfos:
14061
    :vartype DiagnosticInfos: DiagnosticInfo
14062
    '''
14063
14064 1
    ua_types = {
14065
        'Results': 'TransferResult',
14066
        'DiagnosticInfos': 'DiagnosticInfo',
14067
               }
14068
14069 1
    def __init__(self, binary=None):
14070
        if binary is not None:
14071
            self._binary_init(binary)
14072
            self._freeze = True
14073
            return
14074
        self.Results = []
14075
        self.DiagnosticInfos = []
14076
        self._freeze = True
14077
14078 1
    def to_binary(self):
14079
        packet = []
14080
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
14081
        for fieldname in self.Results:
14082
            packet.append(fieldname.to_binary())
14083
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
14084
        for fieldname in self.DiagnosticInfos:
14085
            packet.append(fieldname.to_binary())
14086
        return b''.join(packet)
14087
14088 1
    @staticmethod
14089
    def from_binary(data):
14090
        return TransferSubscriptionsResult(data)
14091
14092 1
    def _binary_init(self, data):
14093
        length = uabin.Primitives.Int32.unpack(data)
14094
        array = []
14095
        if length != -1:
14096
            for _ in range(0, length):
14097
                array.append(TransferResult.from_binary(data))
14098
        self.Results = array
14099
        length = uabin.Primitives.Int32.unpack(data)
14100
        array = []
14101
        if length != -1:
14102
            for _ in range(0, length):
14103
                array.append(DiagnosticInfo.from_binary(data))
14104
        self.DiagnosticInfos = array
14105
14106 1
    def __str__(self):
14107
        return 'TransferSubscriptionsResult(' + 'Results:' + str(self.Results) + ', ' + \
14108
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
14109
14110 1
    __repr__ = __str__
14111
14112
14113 1
class TransferSubscriptionsResponse(FrozenClass):
14114
    '''
14115
    :ivar TypeId:
14116
    :vartype TypeId: NodeId
14117
    :ivar ResponseHeader:
14118
    :vartype ResponseHeader: ResponseHeader
14119
    :ivar Parameters:
14120
    :vartype Parameters: TransferSubscriptionsResult
14121
    '''
14122
14123 1
    ua_types = {
14124
        'TypeId': 'NodeId',
14125
        'ResponseHeader': 'ResponseHeader',
14126
        'Parameters': 'TransferSubscriptionsResult',
14127
               }
14128
14129 1
    def __init__(self, binary=None):
14130
        if binary is not None:
14131
            self._binary_init(binary)
14132
            self._freeze = True
14133
            return
14134
        self.TypeId = FourByteNodeId(ObjectIds.TransferSubscriptionsResponse_Encoding_DefaultBinary)
14135
        self.ResponseHeader = ResponseHeader()
14136
        self.Parameters = TransferSubscriptionsResult()
14137
        self._freeze = True
14138
14139 1
    def to_binary(self):
14140
        packet = []
14141
        packet.append(self.TypeId.to_binary())
14142
        packet.append(self.ResponseHeader.to_binary())
14143
        packet.append(self.Parameters.to_binary())
14144
        return b''.join(packet)
14145
14146 1
    @staticmethod
14147
    def from_binary(data):
14148
        return TransferSubscriptionsResponse(data)
14149
14150 1
    def _binary_init(self, data):
14151
        self.TypeId = NodeId.from_binary(data)
14152
        self.ResponseHeader = ResponseHeader.from_binary(data)
14153
        self.Parameters = TransferSubscriptionsResult.from_binary(data)
14154
14155 1
    def __str__(self):
14156
        return 'TransferSubscriptionsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
14157
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
14158
               'Parameters:' + str(self.Parameters) + ')'
14159
14160 1
    __repr__ = __str__
14161
14162
14163 1
class DeleteSubscriptionsParameters(FrozenClass):
14164
    '''
14165
    :ivar SubscriptionIds:
14166
    :vartype SubscriptionIds: UInt32
14167
    '''
14168
14169 1
    ua_types = {
14170
        'SubscriptionIds': 'UInt32',
14171
               }
14172
14173 1
    def __init__(self, binary=None):
14174 1
        if binary is not None:
14175 1
            self._binary_init(binary)
14176 1
            self._freeze = True
14177 1
            return
14178 1
        self.SubscriptionIds = []
14179 1
        self._freeze = True
14180
14181 1
    def to_binary(self):
14182 1
        packet = []
14183 1
        packet.append(uabin.Primitives.Int32.pack(len(self.SubscriptionIds)))
14184 1
        for fieldname in self.SubscriptionIds:
14185 1
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
14186 1
        return b''.join(packet)
14187
14188 1
    @staticmethod
14189
    def from_binary(data):
14190 1
        return DeleteSubscriptionsParameters(data)
14191
14192 1
    def _binary_init(self, data):
14193 1
        self.SubscriptionIds = uabin.Primitives.UInt32.unpack_array(data)
14194
14195 1
    def __str__(self):
14196
        return 'DeleteSubscriptionsParameters(' + 'SubscriptionIds:' + str(self.SubscriptionIds) + ')'
14197
14198 1
    __repr__ = __str__
14199
14200
14201 1
class DeleteSubscriptionsRequest(FrozenClass):
14202
    '''
14203
    :ivar TypeId:
14204
    :vartype TypeId: NodeId
14205
    :ivar RequestHeader:
14206
    :vartype RequestHeader: RequestHeader
14207
    :ivar Parameters:
14208
    :vartype Parameters: DeleteSubscriptionsParameters
14209
    '''
14210
14211 1
    ua_types = {
14212
        'TypeId': 'NodeId',
14213
        'RequestHeader': 'RequestHeader',
14214
        'Parameters': 'DeleteSubscriptionsParameters',
14215
               }
14216
14217 1
    def __init__(self, binary=None):
14218 1
        if binary is not None:
14219
            self._binary_init(binary)
14220
            self._freeze = True
14221
            return
14222 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteSubscriptionsRequest_Encoding_DefaultBinary)
14223 1
        self.RequestHeader = RequestHeader()
14224 1
        self.Parameters = DeleteSubscriptionsParameters()
14225 1
        self._freeze = True
14226
14227 1
    def to_binary(self):
14228 1
        packet = []
14229 1
        packet.append(self.TypeId.to_binary())
14230 1
        packet.append(self.RequestHeader.to_binary())
14231 1
        packet.append(self.Parameters.to_binary())
14232 1
        return b''.join(packet)
14233
14234 1
    @staticmethod
14235
    def from_binary(data):
14236
        return DeleteSubscriptionsRequest(data)
14237
14238 1
    def _binary_init(self, data):
14239
        self.TypeId = NodeId.from_binary(data)
14240
        self.RequestHeader = RequestHeader.from_binary(data)
14241
        self.Parameters = DeleteSubscriptionsParameters.from_binary(data)
14242
14243 1
    def __str__(self):
14244
        return 'DeleteSubscriptionsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
14245
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
14246
               'Parameters:' + str(self.Parameters) + ')'
14247
14248 1
    __repr__ = __str__
14249
14250
14251 1
class DeleteSubscriptionsResponse(FrozenClass):
14252
    '''
14253
    :ivar TypeId:
14254
    :vartype TypeId: NodeId
14255
    :ivar ResponseHeader:
14256
    :vartype ResponseHeader: ResponseHeader
14257
    :ivar Results:
14258
    :vartype Results: StatusCode
14259
    :ivar DiagnosticInfos:
14260
    :vartype DiagnosticInfos: DiagnosticInfo
14261
    '''
14262
14263 1
    ua_types = {
14264
        'TypeId': 'NodeId',
14265
        'ResponseHeader': 'ResponseHeader',
14266
        'Results': 'StatusCode',
14267
        'DiagnosticInfos': 'DiagnosticInfo',
14268
               }
14269
14270 1
    def __init__(self, binary=None):
14271 1
        if binary is not None:
14272 1
            self._binary_init(binary)
14273 1
            self._freeze = True
14274 1
            return
14275 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteSubscriptionsResponse_Encoding_DefaultBinary)
14276 1
        self.ResponseHeader = ResponseHeader()
14277 1
        self.Results = []
14278 1
        self.DiagnosticInfos = []
14279 1
        self._freeze = True
14280
14281 1
    def to_binary(self):
14282 1
        packet = []
14283 1
        packet.append(self.TypeId.to_binary())
14284 1
        packet.append(self.ResponseHeader.to_binary())
14285 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
14286 1
        for fieldname in self.Results:
14287 1
            packet.append(fieldname.to_binary())
14288 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
14289 1
        for fieldname in self.DiagnosticInfos:
14290
            packet.append(fieldname.to_binary())
14291 1
        return b''.join(packet)
14292
14293 1
    @staticmethod
14294
    def from_binary(data):
14295 1
        return DeleteSubscriptionsResponse(data)
14296
14297 1
    def _binary_init(self, data):
14298 1
        self.TypeId = NodeId.from_binary(data)
14299 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
14300 1
        length = uabin.Primitives.Int32.unpack(data)
14301 1
        array = []
14302 1
        if length != -1:
14303 1
            for _ in range(0, length):
14304 1
                array.append(StatusCode.from_binary(data))
14305 1
        self.Results = array
14306 1
        length = uabin.Primitives.Int32.unpack(data)
14307 1
        array = []
14308 1
        if length != -1:
14309 1
            for _ in range(0, length):
14310
                array.append(DiagnosticInfo.from_binary(data))
14311 1
        self.DiagnosticInfos = array
14312
14313 1
    def __str__(self):
14314
        return 'DeleteSubscriptionsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
14315
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
14316
               'Results:' + str(self.Results) + ', ' + \
14317
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
14318
14319 1
    __repr__ = __str__
14320
14321
14322 1
class BuildInfo(FrozenClass):
14323
    '''
14324
    :ivar ProductUri:
14325
    :vartype ProductUri: String
14326
    :ivar ManufacturerName:
14327
    :vartype ManufacturerName: String
14328
    :ivar ProductName:
14329
    :vartype ProductName: String
14330
    :ivar SoftwareVersion:
14331
    :vartype SoftwareVersion: String
14332
    :ivar BuildNumber:
14333
    :vartype BuildNumber: String
14334
    :ivar BuildDate:
14335
    :vartype BuildDate: DateTime
14336
    '''
14337
14338 1
    ua_types = {
14339
        'ProductUri': 'String',
14340
        'ManufacturerName': 'String',
14341
        'ProductName': 'String',
14342
        'SoftwareVersion': 'String',
14343
        'BuildNumber': 'String',
14344
        'BuildDate': 'DateTime',
14345
               }
14346
14347 1
    def __init__(self, binary=None):
14348
        if binary is not None:
14349
            self._binary_init(binary)
14350
            self._freeze = True
14351
            return
14352
        self.ProductUri = None
14353
        self.ManufacturerName = None
14354
        self.ProductName = None
14355
        self.SoftwareVersion = None
14356
        self.BuildNumber = None
14357
        self.BuildDate = datetime.now()
14358
        self._freeze = True
14359
14360 1
    def to_binary(self):
14361
        packet = []
14362
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
14363
        packet.append(uabin.Primitives.String.pack(self.ManufacturerName))
14364
        packet.append(uabin.Primitives.String.pack(self.ProductName))
14365
        packet.append(uabin.Primitives.String.pack(self.SoftwareVersion))
14366
        packet.append(uabin.Primitives.String.pack(self.BuildNumber))
14367
        packet.append(uabin.Primitives.DateTime.pack(self.BuildDate))
14368
        return b''.join(packet)
14369
14370 1
    @staticmethod
14371
    def from_binary(data):
14372
        return BuildInfo(data)
14373
14374 1
    def _binary_init(self, data):
14375
        self.ProductUri = uabin.Primitives.String.unpack(data)
14376
        self.ManufacturerName = uabin.Primitives.String.unpack(data)
14377
        self.ProductName = uabin.Primitives.String.unpack(data)
14378
        self.SoftwareVersion = uabin.Primitives.String.unpack(data)
14379
        self.BuildNumber = uabin.Primitives.String.unpack(data)
14380
        self.BuildDate = uabin.Primitives.DateTime.unpack(data)
14381
14382 1
    def __str__(self):
14383
        return 'BuildInfo(' + 'ProductUri:' + str(self.ProductUri) + ', ' + \
14384
               'ManufacturerName:' + str(self.ManufacturerName) + ', ' + \
14385
               'ProductName:' + str(self.ProductName) + ', ' + \
14386
               'SoftwareVersion:' + str(self.SoftwareVersion) + ', ' + \
14387
               'BuildNumber:' + str(self.BuildNumber) + ', ' + \
14388
               'BuildDate:' + str(self.BuildDate) + ')'
14389
14390 1
    __repr__ = __str__
14391
14392
14393 1 View Code Duplication
class RedundantServerDataType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
14394
    '''
14395
    :ivar ServerId:
14396
    :vartype ServerId: String
14397
    :ivar ServiceLevel:
14398
    :vartype ServiceLevel: Byte
14399
    :ivar ServerState:
14400
    :vartype ServerState: ServerState
14401
    '''
14402
14403 1
    ua_types = {
14404
        'ServerId': 'String',
14405
        'ServiceLevel': 'Byte',
14406
        'ServerState': 'ServerState',
14407
               }
14408
14409 1
    def __init__(self, binary=None):
14410
        if binary is not None:
14411
            self._binary_init(binary)
14412
            self._freeze = True
14413
            return
14414
        self.ServerId = None
14415
        self.ServiceLevel = 0
14416
        self.ServerState = ServerState(0)
14417
        self._freeze = True
14418
14419 1
    def to_binary(self):
14420
        packet = []
14421
        packet.append(uabin.Primitives.String.pack(self.ServerId))
14422
        packet.append(uabin.Primitives.Byte.pack(self.ServiceLevel))
14423
        packet.append(uabin.Primitives.UInt32.pack(self.ServerState.value))
14424
        return b''.join(packet)
14425
14426 1
    @staticmethod
14427
    def from_binary(data):
14428
        return RedundantServerDataType(data)
14429
14430 1
    def _binary_init(self, data):
14431
        self.ServerId = uabin.Primitives.String.unpack(data)
14432
        self.ServiceLevel = uabin.Primitives.Byte.unpack(data)
14433
        self.ServerState = ServerState(uabin.Primitives.UInt32.unpack(data))
14434
14435 1
    def __str__(self):
14436
        return 'RedundantServerDataType(' + 'ServerId:' + str(self.ServerId) + ', ' + \
14437
               'ServiceLevel:' + str(self.ServiceLevel) + ', ' + \
14438
               'ServerState:' + str(self.ServerState) + ')'
14439
14440 1
    __repr__ = __str__
14441
14442
14443 1
class EndpointUrlListDataType(FrozenClass):
14444
    '''
14445
    :ivar EndpointUrlList:
14446
    :vartype EndpointUrlList: String
14447
    '''
14448
14449 1
    ua_types = {
14450
        'EndpointUrlList': 'String',
14451
               }
14452
14453 1
    def __init__(self, binary=None):
14454
        if binary is not None:
14455
            self._binary_init(binary)
14456
            self._freeze = True
14457
            return
14458
        self.EndpointUrlList = []
14459
        self._freeze = True
14460
14461 1
    def to_binary(self):
14462
        packet = []
14463
        packet.append(uabin.Primitives.Int32.pack(len(self.EndpointUrlList)))
14464
        for fieldname in self.EndpointUrlList:
14465
            packet.append(uabin.Primitives.String.pack(fieldname))
14466
        return b''.join(packet)
14467
14468 1
    @staticmethod
14469
    def from_binary(data):
14470
        return EndpointUrlListDataType(data)
14471
14472 1
    def _binary_init(self, data):
14473
        self.EndpointUrlList = uabin.Primitives.String.unpack_array(data)
14474
14475 1
    def __str__(self):
14476
        return 'EndpointUrlListDataType(' + 'EndpointUrlList:' + str(self.EndpointUrlList) + ')'
14477
14478 1
    __repr__ = __str__
14479
14480
14481 1 View Code Duplication
class NetworkGroupDataType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
14482
    '''
14483
    :ivar ServerUri:
14484
    :vartype ServerUri: String
14485
    :ivar NetworkPaths:
14486
    :vartype NetworkPaths: EndpointUrlListDataType
14487
    '''
14488
14489 1
    ua_types = {
14490
        'ServerUri': 'String',
14491
        'NetworkPaths': 'EndpointUrlListDataType',
14492
               }
14493
14494 1
    def __init__(self, binary=None):
14495
        if binary is not None:
14496
            self._binary_init(binary)
14497
            self._freeze = True
14498
            return
14499
        self.ServerUri = None
14500
        self.NetworkPaths = []
14501
        self._freeze = True
14502
14503 1
    def to_binary(self):
14504
        packet = []
14505
        packet.append(uabin.Primitives.String.pack(self.ServerUri))
14506
        packet.append(uabin.Primitives.Int32.pack(len(self.NetworkPaths)))
14507
        for fieldname in self.NetworkPaths:
14508
            packet.append(fieldname.to_binary())
14509
        return b''.join(packet)
14510
14511 1
    @staticmethod
14512
    def from_binary(data):
14513
        return NetworkGroupDataType(data)
14514
14515 1
    def _binary_init(self, data):
14516
        self.ServerUri = uabin.Primitives.String.unpack(data)
14517
        length = uabin.Primitives.Int32.unpack(data)
14518
        array = []
14519
        if length != -1:
14520
            for _ in range(0, length):
14521
                array.append(EndpointUrlListDataType.from_binary(data))
14522
        self.NetworkPaths = array
14523
14524 1
    def __str__(self):
14525
        return 'NetworkGroupDataType(' + 'ServerUri:' + str(self.ServerUri) + ', ' + \
14526
               'NetworkPaths:' + str(self.NetworkPaths) + ')'
14527
14528 1
    __repr__ = __str__
14529
14530
14531 1 View Code Duplication
class SamplingIntervalDiagnosticsDataType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
14532
    '''
14533
    :ivar SamplingInterval:
14534
    :vartype SamplingInterval: Double
14535
    :ivar MonitoredItemCount:
14536
    :vartype MonitoredItemCount: UInt32
14537
    :ivar MaxMonitoredItemCount:
14538
    :vartype MaxMonitoredItemCount: UInt32
14539
    :ivar DisabledMonitoredItemCount:
14540
    :vartype DisabledMonitoredItemCount: UInt32
14541
    '''
14542
14543 1
    ua_types = {
14544
        'SamplingInterval': 'Double',
14545
        'MonitoredItemCount': 'UInt32',
14546
        'MaxMonitoredItemCount': 'UInt32',
14547
        'DisabledMonitoredItemCount': 'UInt32',
14548
               }
14549
14550 1
    def __init__(self, binary=None):
14551
        if binary is not None:
14552
            self._binary_init(binary)
14553
            self._freeze = True
14554
            return
14555
        self.SamplingInterval = 0
14556
        self.MonitoredItemCount = 0
14557
        self.MaxMonitoredItemCount = 0
14558
        self.DisabledMonitoredItemCount = 0
14559
        self._freeze = True
14560
14561 1
    def to_binary(self):
14562
        packet = []
14563
        packet.append(uabin.Primitives.Double.pack(self.SamplingInterval))
14564
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoredItemCount))
14565
        packet.append(uabin.Primitives.UInt32.pack(self.MaxMonitoredItemCount))
14566
        packet.append(uabin.Primitives.UInt32.pack(self.DisabledMonitoredItemCount))
14567
        return b''.join(packet)
14568
14569 1
    @staticmethod
14570
    def from_binary(data):
14571
        return SamplingIntervalDiagnosticsDataType(data)
14572
14573 1
    def _binary_init(self, data):
14574
        self.SamplingInterval = uabin.Primitives.Double.unpack(data)
14575
        self.MonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
14576
        self.MaxMonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
14577
        self.DisabledMonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
14578
14579 1
    def __str__(self):
14580
        return 'SamplingIntervalDiagnosticsDataType(' + 'SamplingInterval:' + str(self.SamplingInterval) + ', ' + \
14581
               'MonitoredItemCount:' + str(self.MonitoredItemCount) + ', ' + \
14582
               'MaxMonitoredItemCount:' + str(self.MaxMonitoredItemCount) + ', ' + \
14583
               'DisabledMonitoredItemCount:' + str(self.DisabledMonitoredItemCount) + ')'
14584
14585 1
    __repr__ = __str__
14586
14587
14588 1
class ServerDiagnosticsSummaryDataType(FrozenClass):
14589
    '''
14590
    :ivar ServerViewCount:
14591
    :vartype ServerViewCount: UInt32
14592
    :ivar CurrentSessionCount:
14593
    :vartype CurrentSessionCount: UInt32
14594
    :ivar CumulatedSessionCount:
14595
    :vartype CumulatedSessionCount: UInt32
14596
    :ivar SecurityRejectedSessionCount:
14597
    :vartype SecurityRejectedSessionCount: UInt32
14598
    :ivar RejectedSessionCount:
14599
    :vartype RejectedSessionCount: UInt32
14600
    :ivar SessionTimeoutCount:
14601
    :vartype SessionTimeoutCount: UInt32
14602
    :ivar SessionAbortCount:
14603
    :vartype SessionAbortCount: UInt32
14604
    :ivar CurrentSubscriptionCount:
14605
    :vartype CurrentSubscriptionCount: UInt32
14606
    :ivar CumulatedSubscriptionCount:
14607
    :vartype CumulatedSubscriptionCount: UInt32
14608
    :ivar PublishingIntervalCount:
14609
    :vartype PublishingIntervalCount: UInt32
14610
    :ivar SecurityRejectedRequestsCount:
14611
    :vartype SecurityRejectedRequestsCount: UInt32
14612
    :ivar RejectedRequestsCount:
14613
    :vartype RejectedRequestsCount: UInt32
14614
    '''
14615
14616 1
    ua_types = {
14617
        'ServerViewCount': 'UInt32',
14618
        'CurrentSessionCount': 'UInt32',
14619
        'CumulatedSessionCount': 'UInt32',
14620
        'SecurityRejectedSessionCount': 'UInt32',
14621
        'RejectedSessionCount': 'UInt32',
14622
        'SessionTimeoutCount': 'UInt32',
14623
        'SessionAbortCount': 'UInt32',
14624
        'CurrentSubscriptionCount': 'UInt32',
14625
        'CumulatedSubscriptionCount': 'UInt32',
14626
        'PublishingIntervalCount': 'UInt32',
14627
        'SecurityRejectedRequestsCount': 'UInt32',
14628
        'RejectedRequestsCount': 'UInt32',
14629
               }
14630
14631 1
    def __init__(self, binary=None):
14632
        if binary is not None:
14633
            self._binary_init(binary)
14634
            self._freeze = True
14635
            return
14636
        self.ServerViewCount = 0
14637
        self.CurrentSessionCount = 0
14638
        self.CumulatedSessionCount = 0
14639
        self.SecurityRejectedSessionCount = 0
14640
        self.RejectedSessionCount = 0
14641
        self.SessionTimeoutCount = 0
14642
        self.SessionAbortCount = 0
14643
        self.CurrentSubscriptionCount = 0
14644
        self.CumulatedSubscriptionCount = 0
14645
        self.PublishingIntervalCount = 0
14646
        self.SecurityRejectedRequestsCount = 0
14647
        self.RejectedRequestsCount = 0
14648
        self._freeze = True
14649
14650 1
    def to_binary(self):
14651
        packet = []
14652
        packet.append(uabin.Primitives.UInt32.pack(self.ServerViewCount))
14653
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentSessionCount))
14654
        packet.append(uabin.Primitives.UInt32.pack(self.CumulatedSessionCount))
14655
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityRejectedSessionCount))
14656
        packet.append(uabin.Primitives.UInt32.pack(self.RejectedSessionCount))
14657
        packet.append(uabin.Primitives.UInt32.pack(self.SessionTimeoutCount))
14658
        packet.append(uabin.Primitives.UInt32.pack(self.SessionAbortCount))
14659
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentSubscriptionCount))
14660
        packet.append(uabin.Primitives.UInt32.pack(self.CumulatedSubscriptionCount))
14661
        packet.append(uabin.Primitives.UInt32.pack(self.PublishingIntervalCount))
14662
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityRejectedRequestsCount))
14663
        packet.append(uabin.Primitives.UInt32.pack(self.RejectedRequestsCount))
14664
        return b''.join(packet)
14665
14666 1
    @staticmethod
14667
    def from_binary(data):
14668
        return ServerDiagnosticsSummaryDataType(data)
14669
14670 1
    def _binary_init(self, data):
14671
        self.ServerViewCount = uabin.Primitives.UInt32.unpack(data)
14672
        self.CurrentSessionCount = uabin.Primitives.UInt32.unpack(data)
14673
        self.CumulatedSessionCount = uabin.Primitives.UInt32.unpack(data)
14674
        self.SecurityRejectedSessionCount = uabin.Primitives.UInt32.unpack(data)
14675
        self.RejectedSessionCount = uabin.Primitives.UInt32.unpack(data)
14676
        self.SessionTimeoutCount = uabin.Primitives.UInt32.unpack(data)
14677
        self.SessionAbortCount = uabin.Primitives.UInt32.unpack(data)
14678
        self.CurrentSubscriptionCount = uabin.Primitives.UInt32.unpack(data)
14679
        self.CumulatedSubscriptionCount = uabin.Primitives.UInt32.unpack(data)
14680
        self.PublishingIntervalCount = uabin.Primitives.UInt32.unpack(data)
14681
        self.SecurityRejectedRequestsCount = uabin.Primitives.UInt32.unpack(data)
14682
        self.RejectedRequestsCount = uabin.Primitives.UInt32.unpack(data)
14683
14684 1
    def __str__(self):
14685
        return 'ServerDiagnosticsSummaryDataType(' + 'ServerViewCount:' + str(self.ServerViewCount) + ', ' + \
14686
               'CurrentSessionCount:' + str(self.CurrentSessionCount) + ', ' + \
14687
               'CumulatedSessionCount:' + str(self.CumulatedSessionCount) + ', ' + \
14688
               'SecurityRejectedSessionCount:' + str(self.SecurityRejectedSessionCount) + ', ' + \
14689
               'RejectedSessionCount:' + str(self.RejectedSessionCount) + ', ' + \
14690
               'SessionTimeoutCount:' + str(self.SessionTimeoutCount) + ', ' + \
14691
               'SessionAbortCount:' + str(self.SessionAbortCount) + ', ' + \
14692
               'CurrentSubscriptionCount:' + str(self.CurrentSubscriptionCount) + ', ' + \
14693
               'CumulatedSubscriptionCount:' + str(self.CumulatedSubscriptionCount) + ', ' + \
14694
               'PublishingIntervalCount:' + str(self.PublishingIntervalCount) + ', ' + \
14695
               'SecurityRejectedRequestsCount:' + str(self.SecurityRejectedRequestsCount) + ', ' + \
14696
               'RejectedRequestsCount:' + str(self.RejectedRequestsCount) + ')'
14697
14698 1
    __repr__ = __str__
14699
14700
14701 1 View Code Duplication
class ServerStatusDataType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
14702
    '''
14703
    :ivar StartTime:
14704
    :vartype StartTime: DateTime
14705
    :ivar CurrentTime:
14706
    :vartype CurrentTime: DateTime
14707
    :ivar State:
14708
    :vartype State: ServerState
14709
    :ivar BuildInfo:
14710
    :vartype BuildInfo: BuildInfo
14711
    :ivar SecondsTillShutdown:
14712
    :vartype SecondsTillShutdown: UInt32
14713
    :ivar ShutdownReason:
14714
    :vartype ShutdownReason: LocalizedText
14715
    '''
14716
14717 1
    ua_types = {
14718
        'StartTime': 'DateTime',
14719
        'CurrentTime': 'DateTime',
14720
        'State': 'ServerState',
14721
        'BuildInfo': 'BuildInfo',
14722
        'SecondsTillShutdown': 'UInt32',
14723
        'ShutdownReason': 'LocalizedText',
14724
               }
14725
14726 1
    def __init__(self, binary=None):
14727
        if binary is not None:
14728
            self._binary_init(binary)
14729
            self._freeze = True
14730
            return
14731
        self.StartTime = datetime.now()
14732
        self.CurrentTime = datetime.now()
14733
        self.State = ServerState(0)
14734
        self.BuildInfo = BuildInfo()
14735
        self.SecondsTillShutdown = 0
14736
        self.ShutdownReason = LocalizedText()
14737
        self._freeze = True
14738
14739 1
    def to_binary(self):
14740
        packet = []
14741
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
14742
        packet.append(uabin.Primitives.DateTime.pack(self.CurrentTime))
14743
        packet.append(uabin.Primitives.UInt32.pack(self.State.value))
14744
        packet.append(self.BuildInfo.to_binary())
14745
        packet.append(uabin.Primitives.UInt32.pack(self.SecondsTillShutdown))
14746
        packet.append(self.ShutdownReason.to_binary())
14747
        return b''.join(packet)
14748
14749 1
    @staticmethod
14750
    def from_binary(data):
14751
        return ServerStatusDataType(data)
14752
14753 1
    def _binary_init(self, data):
14754
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
14755
        self.CurrentTime = uabin.Primitives.DateTime.unpack(data)
14756
        self.State = ServerState(uabin.Primitives.UInt32.unpack(data))
14757
        self.BuildInfo = BuildInfo.from_binary(data)
14758
        self.SecondsTillShutdown = uabin.Primitives.UInt32.unpack(data)
14759
        self.ShutdownReason = LocalizedText.from_binary(data)
14760
14761 1
    def __str__(self):
14762
        return 'ServerStatusDataType(' + 'StartTime:' + str(self.StartTime) + ', ' + \
14763
               'CurrentTime:' + str(self.CurrentTime) + ', ' + \
14764
               'State:' + str(self.State) + ', ' + \
14765
               'BuildInfo:' + str(self.BuildInfo) + ', ' + \
14766
               'SecondsTillShutdown:' + str(self.SecondsTillShutdown) + ', ' + \
14767
               'ShutdownReason:' + str(self.ShutdownReason) + ')'
14768
14769 1
    __repr__ = __str__
14770
14771
14772 1
class SessionDiagnosticsDataType(FrozenClass):
14773
    '''
14774
    :ivar SessionId:
14775
    :vartype SessionId: NodeId
14776
    :ivar SessionName:
14777
    :vartype SessionName: String
14778
    :ivar ClientDescription:
14779
    :vartype ClientDescription: ApplicationDescription
14780
    :ivar ServerUri:
14781
    :vartype ServerUri: String
14782
    :ivar EndpointUrl:
14783
    :vartype EndpointUrl: String
14784
    :ivar LocaleIds:
14785
    :vartype LocaleIds: String
14786
    :ivar ActualSessionTimeout:
14787
    :vartype ActualSessionTimeout: Double
14788
    :ivar MaxResponseMessageSize:
14789
    :vartype MaxResponseMessageSize: UInt32
14790
    :ivar ClientConnectionTime:
14791
    :vartype ClientConnectionTime: DateTime
14792
    :ivar ClientLastContactTime:
14793
    :vartype ClientLastContactTime: DateTime
14794
    :ivar CurrentSubscriptionsCount:
14795
    :vartype CurrentSubscriptionsCount: UInt32
14796
    :ivar CurrentMonitoredItemsCount:
14797
    :vartype CurrentMonitoredItemsCount: UInt32
14798
    :ivar CurrentPublishRequestsInQueue:
14799
    :vartype CurrentPublishRequestsInQueue: UInt32
14800
    :ivar TotalRequestCount:
14801
    :vartype TotalRequestCount: ServiceCounterDataType
14802
    :ivar UnauthorizedRequestCount:
14803
    :vartype UnauthorizedRequestCount: UInt32
14804
    :ivar ReadCount:
14805
    :vartype ReadCount: ServiceCounterDataType
14806
    :ivar HistoryReadCount:
14807
    :vartype HistoryReadCount: ServiceCounterDataType
14808
    :ivar WriteCount:
14809
    :vartype WriteCount: ServiceCounterDataType
14810
    :ivar HistoryUpdateCount:
14811
    :vartype HistoryUpdateCount: ServiceCounterDataType
14812
    :ivar CallCount:
14813
    :vartype CallCount: ServiceCounterDataType
14814
    :ivar CreateMonitoredItemsCount:
14815
    :vartype CreateMonitoredItemsCount: ServiceCounterDataType
14816
    :ivar ModifyMonitoredItemsCount:
14817
    :vartype ModifyMonitoredItemsCount: ServiceCounterDataType
14818
    :ivar SetMonitoringModeCount:
14819
    :vartype SetMonitoringModeCount: ServiceCounterDataType
14820
    :ivar SetTriggeringCount:
14821
    :vartype SetTriggeringCount: ServiceCounterDataType
14822
    :ivar DeleteMonitoredItemsCount:
14823
    :vartype DeleteMonitoredItemsCount: ServiceCounterDataType
14824
    :ivar CreateSubscriptionCount:
14825
    :vartype CreateSubscriptionCount: ServiceCounterDataType
14826
    :ivar ModifySubscriptionCount:
14827
    :vartype ModifySubscriptionCount: ServiceCounterDataType
14828
    :ivar SetPublishingModeCount:
14829
    :vartype SetPublishingModeCount: ServiceCounterDataType
14830
    :ivar PublishCount:
14831
    :vartype PublishCount: ServiceCounterDataType
14832
    :ivar RepublishCount:
14833
    :vartype RepublishCount: ServiceCounterDataType
14834
    :ivar TransferSubscriptionsCount:
14835
    :vartype TransferSubscriptionsCount: ServiceCounterDataType
14836
    :ivar DeleteSubscriptionsCount:
14837
    :vartype DeleteSubscriptionsCount: ServiceCounterDataType
14838
    :ivar AddNodesCount:
14839
    :vartype AddNodesCount: ServiceCounterDataType
14840
    :ivar AddReferencesCount:
14841
    :vartype AddReferencesCount: ServiceCounterDataType
14842
    :ivar DeleteNodesCount:
14843
    :vartype DeleteNodesCount: ServiceCounterDataType
14844
    :ivar DeleteReferencesCount:
14845
    :vartype DeleteReferencesCount: ServiceCounterDataType
14846
    :ivar BrowseCount:
14847
    :vartype BrowseCount: ServiceCounterDataType
14848
    :ivar BrowseNextCount:
14849
    :vartype BrowseNextCount: ServiceCounterDataType
14850
    :ivar TranslateBrowsePathsToNodeIdsCount:
14851
    :vartype TranslateBrowsePathsToNodeIdsCount: ServiceCounterDataType
14852
    :ivar QueryFirstCount:
14853
    :vartype QueryFirstCount: ServiceCounterDataType
14854
    :ivar QueryNextCount:
14855
    :vartype QueryNextCount: ServiceCounterDataType
14856
    :ivar RegisterNodesCount:
14857
    :vartype RegisterNodesCount: ServiceCounterDataType
14858
    :ivar UnregisterNodesCount:
14859
    :vartype UnregisterNodesCount: ServiceCounterDataType
14860
    '''
14861
14862 1
    ua_types = {
14863
        'SessionId': 'NodeId',
14864
        'SessionName': 'String',
14865
        'ClientDescription': 'ApplicationDescription',
14866
        'ServerUri': 'String',
14867
        'EndpointUrl': 'String',
14868
        'LocaleIds': 'String',
14869
        'ActualSessionTimeout': 'Double',
14870
        'MaxResponseMessageSize': 'UInt32',
14871
        'ClientConnectionTime': 'DateTime',
14872
        'ClientLastContactTime': 'DateTime',
14873
        'CurrentSubscriptionsCount': 'UInt32',
14874
        'CurrentMonitoredItemsCount': 'UInt32',
14875
        'CurrentPublishRequestsInQueue': 'UInt32',
14876
        'TotalRequestCount': 'ServiceCounterDataType',
14877
        'UnauthorizedRequestCount': 'UInt32',
14878
        'ReadCount': 'ServiceCounterDataType',
14879
        'HistoryReadCount': 'ServiceCounterDataType',
14880
        'WriteCount': 'ServiceCounterDataType',
14881
        'HistoryUpdateCount': 'ServiceCounterDataType',
14882
        'CallCount': 'ServiceCounterDataType',
14883
        'CreateMonitoredItemsCount': 'ServiceCounterDataType',
14884
        'ModifyMonitoredItemsCount': 'ServiceCounterDataType',
14885
        'SetMonitoringModeCount': 'ServiceCounterDataType',
14886
        'SetTriggeringCount': 'ServiceCounterDataType',
14887
        'DeleteMonitoredItemsCount': 'ServiceCounterDataType',
14888
        'CreateSubscriptionCount': 'ServiceCounterDataType',
14889
        'ModifySubscriptionCount': 'ServiceCounterDataType',
14890
        'SetPublishingModeCount': 'ServiceCounterDataType',
14891
        'PublishCount': 'ServiceCounterDataType',
14892
        'RepublishCount': 'ServiceCounterDataType',
14893
        'TransferSubscriptionsCount': 'ServiceCounterDataType',
14894
        'DeleteSubscriptionsCount': 'ServiceCounterDataType',
14895
        'AddNodesCount': 'ServiceCounterDataType',
14896
        'AddReferencesCount': 'ServiceCounterDataType',
14897
        'DeleteNodesCount': 'ServiceCounterDataType',
14898
        'DeleteReferencesCount': 'ServiceCounterDataType',
14899
        'BrowseCount': 'ServiceCounterDataType',
14900
        'BrowseNextCount': 'ServiceCounterDataType',
14901
        'TranslateBrowsePathsToNodeIdsCount': 'ServiceCounterDataType',
14902
        'QueryFirstCount': 'ServiceCounterDataType',
14903
        'QueryNextCount': 'ServiceCounterDataType',
14904
        'RegisterNodesCount': 'ServiceCounterDataType',
14905
        'UnregisterNodesCount': 'ServiceCounterDataType',
14906
               }
14907
14908 1
    def __init__(self, binary=None):
14909
        if binary is not None:
14910
            self._binary_init(binary)
14911
            self._freeze = True
14912
            return
14913
        self.SessionId = NodeId()
14914
        self.SessionName = None
14915
        self.ClientDescription = ApplicationDescription()
14916
        self.ServerUri = None
14917
        self.EndpointUrl = None
14918
        self.LocaleIds = []
14919
        self.ActualSessionTimeout = 0
14920
        self.MaxResponseMessageSize = 0
14921
        self.ClientConnectionTime = datetime.now()
14922
        self.ClientLastContactTime = datetime.now()
14923
        self.CurrentSubscriptionsCount = 0
14924
        self.CurrentMonitoredItemsCount = 0
14925
        self.CurrentPublishRequestsInQueue = 0
14926
        self.TotalRequestCount = ServiceCounterDataType()
14927
        self.UnauthorizedRequestCount = 0
14928
        self.ReadCount = ServiceCounterDataType()
14929
        self.HistoryReadCount = ServiceCounterDataType()
14930
        self.WriteCount = ServiceCounterDataType()
14931
        self.HistoryUpdateCount = ServiceCounterDataType()
14932
        self.CallCount = ServiceCounterDataType()
14933
        self.CreateMonitoredItemsCount = ServiceCounterDataType()
14934
        self.ModifyMonitoredItemsCount = ServiceCounterDataType()
14935
        self.SetMonitoringModeCount = ServiceCounterDataType()
14936
        self.SetTriggeringCount = ServiceCounterDataType()
14937
        self.DeleteMonitoredItemsCount = ServiceCounterDataType()
14938
        self.CreateSubscriptionCount = ServiceCounterDataType()
14939
        self.ModifySubscriptionCount = ServiceCounterDataType()
14940
        self.SetPublishingModeCount = ServiceCounterDataType()
14941
        self.PublishCount = ServiceCounterDataType()
14942
        self.RepublishCount = ServiceCounterDataType()
14943
        self.TransferSubscriptionsCount = ServiceCounterDataType()
14944
        self.DeleteSubscriptionsCount = ServiceCounterDataType()
14945
        self.AddNodesCount = ServiceCounterDataType()
14946
        self.AddReferencesCount = ServiceCounterDataType()
14947
        self.DeleteNodesCount = ServiceCounterDataType()
14948
        self.DeleteReferencesCount = ServiceCounterDataType()
14949
        self.BrowseCount = ServiceCounterDataType()
14950
        self.BrowseNextCount = ServiceCounterDataType()
14951
        self.TranslateBrowsePathsToNodeIdsCount = ServiceCounterDataType()
14952
        self.QueryFirstCount = ServiceCounterDataType()
14953
        self.QueryNextCount = ServiceCounterDataType()
14954
        self.RegisterNodesCount = ServiceCounterDataType()
14955
        self.UnregisterNodesCount = ServiceCounterDataType()
14956
        self._freeze = True
14957
14958 1
    def to_binary(self):
14959
        packet = []
14960
        packet.append(self.SessionId.to_binary())
14961
        packet.append(uabin.Primitives.String.pack(self.SessionName))
14962
        packet.append(self.ClientDescription.to_binary())
14963
        packet.append(uabin.Primitives.String.pack(self.ServerUri))
14964
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
14965
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
14966
        for fieldname in self.LocaleIds:
14967
            packet.append(uabin.Primitives.String.pack(fieldname))
14968
        packet.append(uabin.Primitives.Double.pack(self.ActualSessionTimeout))
14969
        packet.append(uabin.Primitives.UInt32.pack(self.MaxResponseMessageSize))
14970
        packet.append(uabin.Primitives.DateTime.pack(self.ClientConnectionTime))
14971
        packet.append(uabin.Primitives.DateTime.pack(self.ClientLastContactTime))
14972
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentSubscriptionsCount))
14973
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentMonitoredItemsCount))
14974
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentPublishRequestsInQueue))
14975
        packet.append(self.TotalRequestCount.to_binary())
14976
        packet.append(uabin.Primitives.UInt32.pack(self.UnauthorizedRequestCount))
14977
        packet.append(self.ReadCount.to_binary())
14978
        packet.append(self.HistoryReadCount.to_binary())
14979
        packet.append(self.WriteCount.to_binary())
14980
        packet.append(self.HistoryUpdateCount.to_binary())
14981
        packet.append(self.CallCount.to_binary())
14982
        packet.append(self.CreateMonitoredItemsCount.to_binary())
14983
        packet.append(self.ModifyMonitoredItemsCount.to_binary())
14984
        packet.append(self.SetMonitoringModeCount.to_binary())
14985
        packet.append(self.SetTriggeringCount.to_binary())
14986
        packet.append(self.DeleteMonitoredItemsCount.to_binary())
14987
        packet.append(self.CreateSubscriptionCount.to_binary())
14988
        packet.append(self.ModifySubscriptionCount.to_binary())
14989
        packet.append(self.SetPublishingModeCount.to_binary())
14990
        packet.append(self.PublishCount.to_binary())
14991
        packet.append(self.RepublishCount.to_binary())
14992
        packet.append(self.TransferSubscriptionsCount.to_binary())
14993
        packet.append(self.DeleteSubscriptionsCount.to_binary())
14994
        packet.append(self.AddNodesCount.to_binary())
14995
        packet.append(self.AddReferencesCount.to_binary())
14996
        packet.append(self.DeleteNodesCount.to_binary())
14997
        packet.append(self.DeleteReferencesCount.to_binary())
14998
        packet.append(self.BrowseCount.to_binary())
14999
        packet.append(self.BrowseNextCount.to_binary())
15000
        packet.append(self.TranslateBrowsePathsToNodeIdsCount.to_binary())
15001
        packet.append(self.QueryFirstCount.to_binary())
15002
        packet.append(self.QueryNextCount.to_binary())
15003
        packet.append(self.RegisterNodesCount.to_binary())
15004
        packet.append(self.UnregisterNodesCount.to_binary())
15005
        return b''.join(packet)
15006
15007 1
    @staticmethod
15008
    def from_binary(data):
15009
        return SessionDiagnosticsDataType(data)
15010
15011 1
    def _binary_init(self, data):
15012
        self.SessionId = NodeId.from_binary(data)
15013
        self.SessionName = uabin.Primitives.String.unpack(data)
15014
        self.ClientDescription = ApplicationDescription.from_binary(data)
15015
        self.ServerUri = uabin.Primitives.String.unpack(data)
15016
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
15017
        self.LocaleIds = uabin.Primitives.String.unpack_array(data)
15018
        self.ActualSessionTimeout = uabin.Primitives.Double.unpack(data)
15019
        self.MaxResponseMessageSize = uabin.Primitives.UInt32.unpack(data)
15020
        self.ClientConnectionTime = uabin.Primitives.DateTime.unpack(data)
15021
        self.ClientLastContactTime = uabin.Primitives.DateTime.unpack(data)
15022
        self.CurrentSubscriptionsCount = uabin.Primitives.UInt32.unpack(data)
15023
        self.CurrentMonitoredItemsCount = uabin.Primitives.UInt32.unpack(data)
15024
        self.CurrentPublishRequestsInQueue = uabin.Primitives.UInt32.unpack(data)
15025
        self.TotalRequestCount = ServiceCounterDataType.from_binary(data)
15026
        self.UnauthorizedRequestCount = uabin.Primitives.UInt32.unpack(data)
15027
        self.ReadCount = ServiceCounterDataType.from_binary(data)
15028
        self.HistoryReadCount = ServiceCounterDataType.from_binary(data)
15029
        self.WriteCount = ServiceCounterDataType.from_binary(data)
15030
        self.HistoryUpdateCount = ServiceCounterDataType.from_binary(data)
15031
        self.CallCount = ServiceCounterDataType.from_binary(data)
15032
        self.CreateMonitoredItemsCount = ServiceCounterDataType.from_binary(data)
15033
        self.ModifyMonitoredItemsCount = ServiceCounterDataType.from_binary(data)
15034
        self.SetMonitoringModeCount = ServiceCounterDataType.from_binary(data)
15035
        self.SetTriggeringCount = ServiceCounterDataType.from_binary(data)
15036
        self.DeleteMonitoredItemsCount = ServiceCounterDataType.from_binary(data)
15037
        self.CreateSubscriptionCount = ServiceCounterDataType.from_binary(data)
15038
        self.ModifySubscriptionCount = ServiceCounterDataType.from_binary(data)
15039
        self.SetPublishingModeCount = ServiceCounterDataType.from_binary(data)
15040
        self.PublishCount = ServiceCounterDataType.from_binary(data)
15041
        self.RepublishCount = ServiceCounterDataType.from_binary(data)
15042
        self.TransferSubscriptionsCount = ServiceCounterDataType.from_binary(data)
15043
        self.DeleteSubscriptionsCount = ServiceCounterDataType.from_binary(data)
15044
        self.AddNodesCount = ServiceCounterDataType.from_binary(data)
15045
        self.AddReferencesCount = ServiceCounterDataType.from_binary(data)
15046
        self.DeleteNodesCount = ServiceCounterDataType.from_binary(data)
15047
        self.DeleteReferencesCount = ServiceCounterDataType.from_binary(data)
15048
        self.BrowseCount = ServiceCounterDataType.from_binary(data)
15049
        self.BrowseNextCount = ServiceCounterDataType.from_binary(data)
15050
        self.TranslateBrowsePathsToNodeIdsCount = ServiceCounterDataType.from_binary(data)
15051
        self.QueryFirstCount = ServiceCounterDataType.from_binary(data)
15052
        self.QueryNextCount = ServiceCounterDataType.from_binary(data)
15053
        self.RegisterNodesCount = ServiceCounterDataType.from_binary(data)
15054
        self.UnregisterNodesCount = ServiceCounterDataType.from_binary(data)
15055
15056 1
    def __str__(self):
15057
        return 'SessionDiagnosticsDataType(' + 'SessionId:' + str(self.SessionId) + ', ' + \
15058
               'SessionName:' + str(self.SessionName) + ', ' + \
15059
               'ClientDescription:' + str(self.ClientDescription) + ', ' + \
15060
               'ServerUri:' + str(self.ServerUri) + ', ' + \
15061
               'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
15062
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
15063
               'ActualSessionTimeout:' + str(self.ActualSessionTimeout) + ', ' + \
15064
               'MaxResponseMessageSize:' + str(self.MaxResponseMessageSize) + ', ' + \
15065
               'ClientConnectionTime:' + str(self.ClientConnectionTime) + ', ' + \
15066
               'ClientLastContactTime:' + str(self.ClientLastContactTime) + ', ' + \
15067
               'CurrentSubscriptionsCount:' + str(self.CurrentSubscriptionsCount) + ', ' + \
15068
               'CurrentMonitoredItemsCount:' + str(self.CurrentMonitoredItemsCount) + ', ' + \
15069
               'CurrentPublishRequestsInQueue:' + str(self.CurrentPublishRequestsInQueue) + ', ' + \
15070
               'TotalRequestCount:' + str(self.TotalRequestCount) + ', ' + \
15071
               'UnauthorizedRequestCount:' + str(self.UnauthorizedRequestCount) + ', ' + \
15072
               'ReadCount:' + str(self.ReadCount) + ', ' + \
15073
               'HistoryReadCount:' + str(self.HistoryReadCount) + ', ' + \
15074
               'WriteCount:' + str(self.WriteCount) + ', ' + \
15075
               'HistoryUpdateCount:' + str(self.HistoryUpdateCount) + ', ' + \
15076
               'CallCount:' + str(self.CallCount) + ', ' + \
15077
               'CreateMonitoredItemsCount:' + str(self.CreateMonitoredItemsCount) + ', ' + \
15078
               'ModifyMonitoredItemsCount:' + str(self.ModifyMonitoredItemsCount) + ', ' + \
15079
               'SetMonitoringModeCount:' + str(self.SetMonitoringModeCount) + ', ' + \
15080
               'SetTriggeringCount:' + str(self.SetTriggeringCount) + ', ' + \
15081
               'DeleteMonitoredItemsCount:' + str(self.DeleteMonitoredItemsCount) + ', ' + \
15082
               'CreateSubscriptionCount:' + str(self.CreateSubscriptionCount) + ', ' + \
15083
               'ModifySubscriptionCount:' + str(self.ModifySubscriptionCount) + ', ' + \
15084
               'SetPublishingModeCount:' + str(self.SetPublishingModeCount) + ', ' + \
15085
               'PublishCount:' + str(self.PublishCount) + ', ' + \
15086
               'RepublishCount:' + str(self.RepublishCount) + ', ' + \
15087
               'TransferSubscriptionsCount:' + str(self.TransferSubscriptionsCount) + ', ' + \
15088
               'DeleteSubscriptionsCount:' + str(self.DeleteSubscriptionsCount) + ', ' + \
15089
               'AddNodesCount:' + str(self.AddNodesCount) + ', ' + \
15090
               'AddReferencesCount:' + str(self.AddReferencesCount) + ', ' + \
15091
               'DeleteNodesCount:' + str(self.DeleteNodesCount) + ', ' + \
15092
               'DeleteReferencesCount:' + str(self.DeleteReferencesCount) + ', ' + \
15093
               'BrowseCount:' + str(self.BrowseCount) + ', ' + \
15094
               'BrowseNextCount:' + str(self.BrowseNextCount) + ', ' + \
15095
               'TranslateBrowsePathsToNodeIdsCount:' + str(self.TranslateBrowsePathsToNodeIdsCount) + ', ' + \
15096
               'QueryFirstCount:' + str(self.QueryFirstCount) + ', ' + \
15097
               'QueryNextCount:' + str(self.QueryNextCount) + ', ' + \
15098
               'RegisterNodesCount:' + str(self.RegisterNodesCount) + ', ' + \
15099
               'UnregisterNodesCount:' + str(self.UnregisterNodesCount) + ')'
15100
15101 1
    __repr__ = __str__
15102
15103
15104 1
class SessionSecurityDiagnosticsDataType(FrozenClass):
15105
    '''
15106
    :ivar SessionId:
15107
    :vartype SessionId: NodeId
15108
    :ivar ClientUserIdOfSession:
15109
    :vartype ClientUserIdOfSession: String
15110
    :ivar ClientUserIdHistory:
15111
    :vartype ClientUserIdHistory: String
15112
    :ivar AuthenticationMechanism:
15113
    :vartype AuthenticationMechanism: String
15114
    :ivar Encoding:
15115
    :vartype Encoding: String
15116
    :ivar TransportProtocol:
15117
    :vartype TransportProtocol: String
15118
    :ivar SecurityMode:
15119
    :vartype SecurityMode: MessageSecurityMode
15120
    :ivar SecurityPolicyUri:
15121
    :vartype SecurityPolicyUri: String
15122
    :ivar ClientCertificate:
15123
    :vartype ClientCertificate: ByteString
15124
    '''
15125
15126 1
    ua_types = {
15127
        'SessionId': 'NodeId',
15128
        'ClientUserIdOfSession': 'String',
15129
        'ClientUserIdHistory': 'String',
15130
        'AuthenticationMechanism': 'String',
15131
        'Encoding': 'String',
15132
        'TransportProtocol': 'String',
15133
        'SecurityMode': 'MessageSecurityMode',
15134
        'SecurityPolicyUri': 'String',
15135
        'ClientCertificate': 'ByteString',
15136
               }
15137
15138 1
    def __init__(self, binary=None):
15139
        if binary is not None:
15140
            self._binary_init(binary)
15141
            self._freeze = True
15142
            return
15143
        self.SessionId = NodeId()
15144
        self.ClientUserIdOfSession = None
15145
        self.ClientUserIdHistory = []
15146
        self.AuthenticationMechanism = None
15147
        self.Encoding = None
15148
        self.TransportProtocol = None
15149
        self.SecurityMode = MessageSecurityMode(0)
15150
        self.SecurityPolicyUri = None
15151
        self.ClientCertificate = None
15152
        self._freeze = True
15153
15154 1 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15155
        packet = []
15156
        packet.append(self.SessionId.to_binary())
15157
        packet.append(uabin.Primitives.String.pack(self.ClientUserIdOfSession))
15158
        packet.append(uabin.Primitives.Int32.pack(len(self.ClientUserIdHistory)))
15159
        for fieldname in self.ClientUserIdHistory:
15160
            packet.append(uabin.Primitives.String.pack(fieldname))
15161
        packet.append(uabin.Primitives.String.pack(self.AuthenticationMechanism))
15162
        packet.append(uabin.Primitives.String.pack(self.Encoding))
15163
        packet.append(uabin.Primitives.String.pack(self.TransportProtocol))
15164
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityMode.value))
15165
        packet.append(uabin.Primitives.String.pack(self.SecurityPolicyUri))
15166
        packet.append(uabin.Primitives.ByteString.pack(self.ClientCertificate))
15167
        return b''.join(packet)
15168
15169 1
    @staticmethod
15170
    def from_binary(data):
15171
        return SessionSecurityDiagnosticsDataType(data)
15172
15173 1
    def _binary_init(self, data):
15174
        self.SessionId = NodeId.from_binary(data)
15175
        self.ClientUserIdOfSession = uabin.Primitives.String.unpack(data)
15176
        self.ClientUserIdHistory = uabin.Primitives.String.unpack_array(data)
15177
        self.AuthenticationMechanism = uabin.Primitives.String.unpack(data)
15178
        self.Encoding = uabin.Primitives.String.unpack(data)
15179
        self.TransportProtocol = uabin.Primitives.String.unpack(data)
15180
        self.SecurityMode = MessageSecurityMode(uabin.Primitives.UInt32.unpack(data))
15181
        self.SecurityPolicyUri = uabin.Primitives.String.unpack(data)
15182
        self.ClientCertificate = uabin.Primitives.ByteString.unpack(data)
15183
15184 1
    def __str__(self):
15185
        return 'SessionSecurityDiagnosticsDataType(' + 'SessionId:' + str(self.SessionId) + ', ' + \
15186
               'ClientUserIdOfSession:' + str(self.ClientUserIdOfSession) + ', ' + \
15187
               'ClientUserIdHistory:' + str(self.ClientUserIdHistory) + ', ' + \
15188
               'AuthenticationMechanism:' + str(self.AuthenticationMechanism) + ', ' + \
15189
               'Encoding:' + str(self.Encoding) + ', ' + \
15190
               'TransportProtocol:' + str(self.TransportProtocol) + ', ' + \
15191
               'SecurityMode:' + str(self.SecurityMode) + ', ' + \
15192
               'SecurityPolicyUri:' + str(self.SecurityPolicyUri) + ', ' + \
15193
               'ClientCertificate:' + str(self.ClientCertificate) + ')'
15194
15195 1
    __repr__ = __str__
15196
15197
15198 1 View Code Duplication
class ServiceCounterDataType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15199
    '''
15200
    :ivar TotalCount:
15201
    :vartype TotalCount: UInt32
15202
    :ivar ErrorCount:
15203
    :vartype ErrorCount: UInt32
15204
    '''
15205
15206 1
    ua_types = {
15207
        'TotalCount': 'UInt32',
15208
        'ErrorCount': 'UInt32',
15209
               }
15210
15211 1
    def __init__(self, binary=None):
15212
        if binary is not None:
15213
            self._binary_init(binary)
15214
            self._freeze = True
15215
            return
15216
        self.TotalCount = 0
15217
        self.ErrorCount = 0
15218
        self._freeze = True
15219
15220 1
    def to_binary(self):
15221
        packet = []
15222
        packet.append(uabin.Primitives.UInt32.pack(self.TotalCount))
15223
        packet.append(uabin.Primitives.UInt32.pack(self.ErrorCount))
15224
        return b''.join(packet)
15225
15226 1
    @staticmethod
15227
    def from_binary(data):
15228
        return ServiceCounterDataType(data)
15229
15230 1
    def _binary_init(self, data):
15231
        self.TotalCount = uabin.Primitives.UInt32.unpack(data)
15232
        self.ErrorCount = uabin.Primitives.UInt32.unpack(data)
15233
15234 1
    def __str__(self):
15235
        return 'ServiceCounterDataType(' + 'TotalCount:' + str(self.TotalCount) + ', ' + \
15236
               'ErrorCount:' + str(self.ErrorCount) + ')'
15237
15238 1
    __repr__ = __str__
15239
15240
15241 1 View Code Duplication
class StatusResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15242
    '''
15243
    :ivar StatusCode:
15244
    :vartype StatusCode: StatusCode
15245
    :ivar DiagnosticInfo:
15246
    :vartype DiagnosticInfo: DiagnosticInfo
15247
    '''
15248
15249 1
    ua_types = {
15250
        'StatusCode': 'StatusCode',
15251
        'DiagnosticInfo': 'DiagnosticInfo',
15252
               }
15253
15254 1
    def __init__(self, binary=None):
15255
        if binary is not None:
15256
            self._binary_init(binary)
15257
            self._freeze = True
15258
            return
15259
        self.StatusCode = StatusCode()
15260
        self.DiagnosticInfo = DiagnosticInfo()
15261
        self._freeze = True
15262
15263 1
    def to_binary(self):
15264
        packet = []
15265
        packet.append(self.StatusCode.to_binary())
15266
        packet.append(self.DiagnosticInfo.to_binary())
15267
        return b''.join(packet)
15268
15269 1
    @staticmethod
15270
    def from_binary(data):
15271
        return StatusResult(data)
15272
15273 1
    def _binary_init(self, data):
15274
        self.StatusCode = StatusCode.from_binary(data)
15275
        self.DiagnosticInfo = DiagnosticInfo.from_binary(data)
15276
15277 1
    def __str__(self):
15278
        return 'StatusResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
15279
               'DiagnosticInfo:' + str(self.DiagnosticInfo) + ')'
15280
15281 1
    __repr__ = __str__
15282
15283
15284 1
class SubscriptionDiagnosticsDataType(FrozenClass):
15285
    '''
15286
    :ivar SessionId:
15287
    :vartype SessionId: NodeId
15288
    :ivar SubscriptionId:
15289
    :vartype SubscriptionId: UInt32
15290
    :ivar Priority:
15291
    :vartype Priority: Byte
15292
    :ivar PublishingInterval:
15293
    :vartype PublishingInterval: Double
15294
    :ivar MaxKeepAliveCount:
15295
    :vartype MaxKeepAliveCount: UInt32
15296
    :ivar MaxLifetimeCount:
15297
    :vartype MaxLifetimeCount: UInt32
15298
    :ivar MaxNotificationsPerPublish:
15299
    :vartype MaxNotificationsPerPublish: UInt32
15300
    :ivar PublishingEnabled:
15301
    :vartype PublishingEnabled: Boolean
15302
    :ivar ModifyCount:
15303
    :vartype ModifyCount: UInt32
15304
    :ivar EnableCount:
15305
    :vartype EnableCount: UInt32
15306
    :ivar DisableCount:
15307
    :vartype DisableCount: UInt32
15308
    :ivar RepublishRequestCount:
15309
    :vartype RepublishRequestCount: UInt32
15310
    :ivar RepublishMessageRequestCount:
15311
    :vartype RepublishMessageRequestCount: UInt32
15312
    :ivar RepublishMessageCount:
15313
    :vartype RepublishMessageCount: UInt32
15314
    :ivar TransferRequestCount:
15315
    :vartype TransferRequestCount: UInt32
15316
    :ivar TransferredToAltClientCount:
15317
    :vartype TransferredToAltClientCount: UInt32
15318
    :ivar TransferredToSameClientCount:
15319
    :vartype TransferredToSameClientCount: UInt32
15320
    :ivar PublishRequestCount:
15321
    :vartype PublishRequestCount: UInt32
15322
    :ivar DataChangeNotificationsCount:
15323
    :vartype DataChangeNotificationsCount: UInt32
15324
    :ivar EventNotificationsCount:
15325
    :vartype EventNotificationsCount: UInt32
15326
    :ivar NotificationsCount:
15327
    :vartype NotificationsCount: UInt32
15328
    :ivar LatePublishRequestCount:
15329
    :vartype LatePublishRequestCount: UInt32
15330
    :ivar CurrentKeepAliveCount:
15331
    :vartype CurrentKeepAliveCount: UInt32
15332
    :ivar CurrentLifetimeCount:
15333
    :vartype CurrentLifetimeCount: UInt32
15334
    :ivar UnacknowledgedMessageCount:
15335
    :vartype UnacknowledgedMessageCount: UInt32
15336
    :ivar DiscardedMessageCount:
15337
    :vartype DiscardedMessageCount: UInt32
15338
    :ivar MonitoredItemCount:
15339
    :vartype MonitoredItemCount: UInt32
15340
    :ivar DisabledMonitoredItemCount:
15341
    :vartype DisabledMonitoredItemCount: UInt32
15342
    :ivar MonitoringQueueOverflowCount:
15343
    :vartype MonitoringQueueOverflowCount: UInt32
15344
    :ivar NextSequenceNumber:
15345
    :vartype NextSequenceNumber: UInt32
15346
    :ivar EventQueueOverFlowCount:
15347
    :vartype EventQueueOverFlowCount: UInt32
15348
    '''
15349
15350 1
    ua_types = {
15351
        'SessionId': 'NodeId',
15352
        'SubscriptionId': 'UInt32',
15353
        'Priority': 'Byte',
15354
        'PublishingInterval': 'Double',
15355
        'MaxKeepAliveCount': 'UInt32',
15356
        'MaxLifetimeCount': 'UInt32',
15357
        'MaxNotificationsPerPublish': 'UInt32',
15358
        'PublishingEnabled': 'Boolean',
15359
        'ModifyCount': 'UInt32',
15360
        'EnableCount': 'UInt32',
15361
        'DisableCount': 'UInt32',
15362
        'RepublishRequestCount': 'UInt32',
15363
        'RepublishMessageRequestCount': 'UInt32',
15364
        'RepublishMessageCount': 'UInt32',
15365
        'TransferRequestCount': 'UInt32',
15366
        'TransferredToAltClientCount': 'UInt32',
15367
        'TransferredToSameClientCount': 'UInt32',
15368
        'PublishRequestCount': 'UInt32',
15369
        'DataChangeNotificationsCount': 'UInt32',
15370
        'EventNotificationsCount': 'UInt32',
15371
        'NotificationsCount': 'UInt32',
15372
        'LatePublishRequestCount': 'UInt32',
15373
        'CurrentKeepAliveCount': 'UInt32',
15374
        'CurrentLifetimeCount': 'UInt32',
15375
        'UnacknowledgedMessageCount': 'UInt32',
15376
        'DiscardedMessageCount': 'UInt32',
15377
        'MonitoredItemCount': 'UInt32',
15378
        'DisabledMonitoredItemCount': 'UInt32',
15379
        'MonitoringQueueOverflowCount': 'UInt32',
15380
        'NextSequenceNumber': 'UInt32',
15381
        'EventQueueOverFlowCount': 'UInt32',
15382
               }
15383
15384 1
    def __init__(self, binary=None):
15385
        if binary is not None:
15386
            self._binary_init(binary)
15387
            self._freeze = True
15388
            return
15389
        self.SessionId = NodeId()
15390
        self.SubscriptionId = 0
15391
        self.Priority = 0
15392
        self.PublishingInterval = 0
15393
        self.MaxKeepAliveCount = 0
15394
        self.MaxLifetimeCount = 0
15395
        self.MaxNotificationsPerPublish = 0
15396
        self.PublishingEnabled = True
15397
        self.ModifyCount = 0
15398
        self.EnableCount = 0
15399
        self.DisableCount = 0
15400
        self.RepublishRequestCount = 0
15401
        self.RepublishMessageRequestCount = 0
15402
        self.RepublishMessageCount = 0
15403
        self.TransferRequestCount = 0
15404
        self.TransferredToAltClientCount = 0
15405
        self.TransferredToSameClientCount = 0
15406
        self.PublishRequestCount = 0
15407
        self.DataChangeNotificationsCount = 0
15408
        self.EventNotificationsCount = 0
15409
        self.NotificationsCount = 0
15410
        self.LatePublishRequestCount = 0
15411
        self.CurrentKeepAliveCount = 0
15412
        self.CurrentLifetimeCount = 0
15413
        self.UnacknowledgedMessageCount = 0
15414
        self.DiscardedMessageCount = 0
15415
        self.MonitoredItemCount = 0
15416
        self.DisabledMonitoredItemCount = 0
15417
        self.MonitoringQueueOverflowCount = 0
15418
        self.NextSequenceNumber = 0
15419
        self.EventQueueOverFlowCount = 0
15420
        self._freeze = True
15421
15422 1
    def to_binary(self):
15423
        packet = []
15424
        packet.append(self.SessionId.to_binary())
15425
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
15426
        packet.append(uabin.Primitives.Byte.pack(self.Priority))
15427
        packet.append(uabin.Primitives.Double.pack(self.PublishingInterval))
15428
        packet.append(uabin.Primitives.UInt32.pack(self.MaxKeepAliveCount))
15429
        packet.append(uabin.Primitives.UInt32.pack(self.MaxLifetimeCount))
15430
        packet.append(uabin.Primitives.UInt32.pack(self.MaxNotificationsPerPublish))
15431
        packet.append(uabin.Primitives.Boolean.pack(self.PublishingEnabled))
15432
        packet.append(uabin.Primitives.UInt32.pack(self.ModifyCount))
15433
        packet.append(uabin.Primitives.UInt32.pack(self.EnableCount))
15434
        packet.append(uabin.Primitives.UInt32.pack(self.DisableCount))
15435
        packet.append(uabin.Primitives.UInt32.pack(self.RepublishRequestCount))
15436
        packet.append(uabin.Primitives.UInt32.pack(self.RepublishMessageRequestCount))
15437
        packet.append(uabin.Primitives.UInt32.pack(self.RepublishMessageCount))
15438
        packet.append(uabin.Primitives.UInt32.pack(self.TransferRequestCount))
15439
        packet.append(uabin.Primitives.UInt32.pack(self.TransferredToAltClientCount))
15440
        packet.append(uabin.Primitives.UInt32.pack(self.TransferredToSameClientCount))
15441
        packet.append(uabin.Primitives.UInt32.pack(self.PublishRequestCount))
15442
        packet.append(uabin.Primitives.UInt32.pack(self.DataChangeNotificationsCount))
15443
        packet.append(uabin.Primitives.UInt32.pack(self.EventNotificationsCount))
15444
        packet.append(uabin.Primitives.UInt32.pack(self.NotificationsCount))
15445
        packet.append(uabin.Primitives.UInt32.pack(self.LatePublishRequestCount))
15446
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentKeepAliveCount))
15447
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentLifetimeCount))
15448
        packet.append(uabin.Primitives.UInt32.pack(self.UnacknowledgedMessageCount))
15449
        packet.append(uabin.Primitives.UInt32.pack(self.DiscardedMessageCount))
15450
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoredItemCount))
15451
        packet.append(uabin.Primitives.UInt32.pack(self.DisabledMonitoredItemCount))
15452
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoringQueueOverflowCount))
15453
        packet.append(uabin.Primitives.UInt32.pack(self.NextSequenceNumber))
15454
        packet.append(uabin.Primitives.UInt32.pack(self.EventQueueOverFlowCount))
15455
        return b''.join(packet)
15456
15457 1
    @staticmethod
15458
    def from_binary(data):
15459
        return SubscriptionDiagnosticsDataType(data)
15460
15461 1
    def _binary_init(self, data):
15462
        self.SessionId = NodeId.from_binary(data)
15463
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
15464
        self.Priority = uabin.Primitives.Byte.unpack(data)
15465
        self.PublishingInterval = uabin.Primitives.Double.unpack(data)
15466
        self.MaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
15467
        self.MaxLifetimeCount = uabin.Primitives.UInt32.unpack(data)
15468
        self.MaxNotificationsPerPublish = uabin.Primitives.UInt32.unpack(data)
15469
        self.PublishingEnabled = uabin.Primitives.Boolean.unpack(data)
15470
        self.ModifyCount = uabin.Primitives.UInt32.unpack(data)
15471
        self.EnableCount = uabin.Primitives.UInt32.unpack(data)
15472
        self.DisableCount = uabin.Primitives.UInt32.unpack(data)
15473
        self.RepublishRequestCount = uabin.Primitives.UInt32.unpack(data)
15474
        self.RepublishMessageRequestCount = uabin.Primitives.UInt32.unpack(data)
15475
        self.RepublishMessageCount = uabin.Primitives.UInt32.unpack(data)
15476
        self.TransferRequestCount = uabin.Primitives.UInt32.unpack(data)
15477
        self.TransferredToAltClientCount = uabin.Primitives.UInt32.unpack(data)
15478
        self.TransferredToSameClientCount = uabin.Primitives.UInt32.unpack(data)
15479
        self.PublishRequestCount = uabin.Primitives.UInt32.unpack(data)
15480
        self.DataChangeNotificationsCount = uabin.Primitives.UInt32.unpack(data)
15481
        self.EventNotificationsCount = uabin.Primitives.UInt32.unpack(data)
15482
        self.NotificationsCount = uabin.Primitives.UInt32.unpack(data)
15483
        self.LatePublishRequestCount = uabin.Primitives.UInt32.unpack(data)
15484
        self.CurrentKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
15485
        self.CurrentLifetimeCount = uabin.Primitives.UInt32.unpack(data)
15486
        self.UnacknowledgedMessageCount = uabin.Primitives.UInt32.unpack(data)
15487
        self.DiscardedMessageCount = uabin.Primitives.UInt32.unpack(data)
15488
        self.MonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
15489
        self.DisabledMonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
15490
        self.MonitoringQueueOverflowCount = uabin.Primitives.UInt32.unpack(data)
15491
        self.NextSequenceNumber = uabin.Primitives.UInt32.unpack(data)
15492
        self.EventQueueOverFlowCount = uabin.Primitives.UInt32.unpack(data)
15493
15494 1
    def __str__(self):
15495
        return 'SubscriptionDiagnosticsDataType(' + 'SessionId:' + str(self.SessionId) + ', ' + \
15496
               'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
15497
               'Priority:' + str(self.Priority) + ', ' + \
15498
               'PublishingInterval:' + str(self.PublishingInterval) + ', ' + \
15499
               'MaxKeepAliveCount:' + str(self.MaxKeepAliveCount) + ', ' + \
15500
               'MaxLifetimeCount:' + str(self.MaxLifetimeCount) + ', ' + \
15501
               'MaxNotificationsPerPublish:' + str(self.MaxNotificationsPerPublish) + ', ' + \
15502
               'PublishingEnabled:' + str(self.PublishingEnabled) + ', ' + \
15503
               'ModifyCount:' + str(self.ModifyCount) + ', ' + \
15504
               'EnableCount:' + str(self.EnableCount) + ', ' + \
15505
               'DisableCount:' + str(self.DisableCount) + ', ' + \
15506
               'RepublishRequestCount:' + str(self.RepublishRequestCount) + ', ' + \
15507
               'RepublishMessageRequestCount:' + str(self.RepublishMessageRequestCount) + ', ' + \
15508
               'RepublishMessageCount:' + str(self.RepublishMessageCount) + ', ' + \
15509
               'TransferRequestCount:' + str(self.TransferRequestCount) + ', ' + \
15510
               'TransferredToAltClientCount:' + str(self.TransferredToAltClientCount) + ', ' + \
15511
               'TransferredToSameClientCount:' + str(self.TransferredToSameClientCount) + ', ' + \
15512
               'PublishRequestCount:' + str(self.PublishRequestCount) + ', ' + \
15513
               'DataChangeNotificationsCount:' + str(self.DataChangeNotificationsCount) + ', ' + \
15514
               'EventNotificationsCount:' + str(self.EventNotificationsCount) + ', ' + \
15515
               'NotificationsCount:' + str(self.NotificationsCount) + ', ' + \
15516
               'LatePublishRequestCount:' + str(self.LatePublishRequestCount) + ', ' + \
15517
               'CurrentKeepAliveCount:' + str(self.CurrentKeepAliveCount) + ', ' + \
15518
               'CurrentLifetimeCount:' + str(self.CurrentLifetimeCount) + ', ' + \
15519
               'UnacknowledgedMessageCount:' + str(self.UnacknowledgedMessageCount) + ', ' + \
15520
               'DiscardedMessageCount:' + str(self.DiscardedMessageCount) + ', ' + \
15521
               'MonitoredItemCount:' + str(self.MonitoredItemCount) + ', ' + \
15522
               'DisabledMonitoredItemCount:' + str(self.DisabledMonitoredItemCount) + ', ' + \
15523
               'MonitoringQueueOverflowCount:' + str(self.MonitoringQueueOverflowCount) + ', ' + \
15524
               'NextSequenceNumber:' + str(self.NextSequenceNumber) + ', ' + \
15525
               'EventQueueOverFlowCount:' + str(self.EventQueueOverFlowCount) + ')'
15526
15527 1
    __repr__ = __str__
15528
15529
15530 1 View Code Duplication
class ModelChangeStructureDataType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15531
    '''
15532
    :ivar Affected:
15533
    :vartype Affected: NodeId
15534
    :ivar AffectedType:
15535
    :vartype AffectedType: NodeId
15536
    :ivar Verb:
15537
    :vartype Verb: Byte
15538
    '''
15539
15540 1
    ua_types = {
15541
        'Affected': 'NodeId',
15542
        'AffectedType': 'NodeId',
15543
        'Verb': 'Byte',
15544
               }
15545
15546 1
    def __init__(self, binary=None):
15547
        if binary is not None:
15548
            self._binary_init(binary)
15549
            self._freeze = True
15550
            return
15551
        self.Affected = NodeId()
15552
        self.AffectedType = NodeId()
15553
        self.Verb = 0
15554
        self._freeze = True
15555
15556 1
    def to_binary(self):
15557
        packet = []
15558
        packet.append(self.Affected.to_binary())
15559
        packet.append(self.AffectedType.to_binary())
15560
        packet.append(uabin.Primitives.Byte.pack(self.Verb))
15561
        return b''.join(packet)
15562
15563 1
    @staticmethod
15564
    def from_binary(data):
15565
        return ModelChangeStructureDataType(data)
15566
15567 1
    def _binary_init(self, data):
15568
        self.Affected = NodeId.from_binary(data)
15569
        self.AffectedType = NodeId.from_binary(data)
15570
        self.Verb = uabin.Primitives.Byte.unpack(data)
15571
15572 1
    def __str__(self):
15573
        return 'ModelChangeStructureDataType(' + 'Affected:' + str(self.Affected) + ', ' + \
15574
               'AffectedType:' + str(self.AffectedType) + ', ' + \
15575
               'Verb:' + str(self.Verb) + ')'
15576
15577 1
    __repr__ = __str__
15578
15579
15580 1 View Code Duplication
class SemanticChangeStructureDataType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15581
    '''
15582
    :ivar Affected:
15583
    :vartype Affected: NodeId
15584
    :ivar AffectedType:
15585
    :vartype AffectedType: NodeId
15586
    '''
15587
15588 1
    ua_types = {
15589
        'Affected': 'NodeId',
15590
        'AffectedType': 'NodeId',
15591
               }
15592
15593 1
    def __init__(self, binary=None):
15594
        if binary is not None:
15595
            self._binary_init(binary)
15596
            self._freeze = True
15597
            return
15598
        self.Affected = NodeId()
15599
        self.AffectedType = NodeId()
15600
        self._freeze = True
15601
15602 1
    def to_binary(self):
15603
        packet = []
15604
        packet.append(self.Affected.to_binary())
15605
        packet.append(self.AffectedType.to_binary())
15606
        return b''.join(packet)
15607
15608 1
    @staticmethod
15609
    def from_binary(data):
15610
        return SemanticChangeStructureDataType(data)
15611
15612 1
    def _binary_init(self, data):
15613
        self.Affected = NodeId.from_binary(data)
15614
        self.AffectedType = NodeId.from_binary(data)
15615
15616 1
    def __str__(self):
15617
        return 'SemanticChangeStructureDataType(' + 'Affected:' + str(self.Affected) + ', ' + \
15618
               'AffectedType:' + str(self.AffectedType) + ')'
15619
15620 1
    __repr__ = __str__
15621
15622
15623 1 View Code Duplication
class Range(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15624
    '''
15625
    :ivar Low:
15626
    :vartype Low: Double
15627
    :ivar High:
15628
    :vartype High: Double
15629
    '''
15630
15631 1
    ua_types = {
15632
        'Low': 'Double',
15633
        'High': 'Double',
15634
               }
15635
15636 1
    def __init__(self, binary=None):
15637
        if binary is not None:
15638
            self._binary_init(binary)
15639
            self._freeze = True
15640
            return
15641
        self.Low = 0
15642
        self.High = 0
15643
        self._freeze = True
15644
15645 1
    def to_binary(self):
15646
        packet = []
15647
        packet.append(uabin.Primitives.Double.pack(self.Low))
15648
        packet.append(uabin.Primitives.Double.pack(self.High))
15649
        return b''.join(packet)
15650
15651 1
    @staticmethod
15652
    def from_binary(data):
15653
        return Range(data)
15654
15655 1
    def _binary_init(self, data):
15656
        self.Low = uabin.Primitives.Double.unpack(data)
15657
        self.High = uabin.Primitives.Double.unpack(data)
15658
15659 1
    def __str__(self):
15660
        return 'Range(' + 'Low:' + str(self.Low) + ', ' + \
15661
               'High:' + str(self.High) + ')'
15662
15663 1
    __repr__ = __str__
15664
15665
15666 1 View Code Duplication
class EUInformation(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15667
    '''
15668
    :ivar NamespaceUri:
15669
    :vartype NamespaceUri: String
15670
    :ivar UnitId:
15671
    :vartype UnitId: Int32
15672
    :ivar DisplayName:
15673
    :vartype DisplayName: LocalizedText
15674
    :ivar Description:
15675
    :vartype Description: LocalizedText
15676
    '''
15677
15678 1
    ua_types = {
15679
        'NamespaceUri': 'String',
15680
        'UnitId': 'Int32',
15681
        'DisplayName': 'LocalizedText',
15682
        'Description': 'LocalizedText',
15683
               }
15684
15685 1
    def __init__(self, binary=None):
15686
        if binary is not None:
15687
            self._binary_init(binary)
15688
            self._freeze = True
15689
            return
15690
        self.NamespaceUri = None
15691
        self.UnitId = 0
15692
        self.DisplayName = LocalizedText()
15693
        self.Description = LocalizedText()
15694
        self._freeze = True
15695
15696 1
    def to_binary(self):
15697
        packet = []
15698
        packet.append(uabin.Primitives.String.pack(self.NamespaceUri))
15699
        packet.append(uabin.Primitives.Int32.pack(self.UnitId))
15700
        packet.append(self.DisplayName.to_binary())
15701
        packet.append(self.Description.to_binary())
15702
        return b''.join(packet)
15703
15704 1
    @staticmethod
15705
    def from_binary(data):
15706
        return EUInformation(data)
15707
15708 1
    def _binary_init(self, data):
15709
        self.NamespaceUri = uabin.Primitives.String.unpack(data)
15710
        self.UnitId = uabin.Primitives.Int32.unpack(data)
15711
        self.DisplayName = LocalizedText.from_binary(data)
15712
        self.Description = LocalizedText.from_binary(data)
15713
15714 1
    def __str__(self):
15715
        return 'EUInformation(' + 'NamespaceUri:' + str(self.NamespaceUri) + ', ' + \
15716
               'UnitId:' + str(self.UnitId) + ', ' + \
15717
               'DisplayName:' + str(self.DisplayName) + ', ' + \
15718
               'Description:' + str(self.Description) + ')'
15719
15720 1
    __repr__ = __str__
15721
15722
15723 1 View Code Duplication
class ComplexNumberType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15724
    '''
15725
    :ivar Real:
15726
    :vartype Real: Float
15727
    :ivar Imaginary:
15728
    :vartype Imaginary: Float
15729
    '''
15730
15731 1
    ua_types = {
15732
        'Real': 'Float',
15733
        'Imaginary': 'Float',
15734
               }
15735
15736 1
    def __init__(self, binary=None):
15737
        if binary is not None:
15738
            self._binary_init(binary)
15739
            self._freeze = True
15740
            return
15741
        self.Real = 0
15742
        self.Imaginary = 0
15743
        self._freeze = True
15744
15745 1
    def to_binary(self):
15746
        packet = []
15747
        packet.append(uabin.Primitives.Float.pack(self.Real))
15748
        packet.append(uabin.Primitives.Float.pack(self.Imaginary))
15749
        return b''.join(packet)
15750
15751 1
    @staticmethod
15752
    def from_binary(data):
15753
        return ComplexNumberType(data)
15754
15755 1
    def _binary_init(self, data):
15756
        self.Real = uabin.Primitives.Float.unpack(data)
15757
        self.Imaginary = uabin.Primitives.Float.unpack(data)
15758
15759 1
    def __str__(self):
15760
        return 'ComplexNumberType(' + 'Real:' + str(self.Real) + ', ' + \
15761
               'Imaginary:' + str(self.Imaginary) + ')'
15762
15763 1
    __repr__ = __str__
15764
15765
15766 1 View Code Duplication
class DoubleComplexNumberType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15767
    '''
15768
    :ivar Real:
15769
    :vartype Real: Double
15770
    :ivar Imaginary:
15771
    :vartype Imaginary: Double
15772
    '''
15773
15774 1
    ua_types = {
15775
        'Real': 'Double',
15776
        'Imaginary': 'Double',
15777
               }
15778
15779 1
    def __init__(self, binary=None):
15780
        if binary is not None:
15781
            self._binary_init(binary)
15782
            self._freeze = True
15783
            return
15784
        self.Real = 0
15785
        self.Imaginary = 0
15786
        self._freeze = True
15787
15788 1
    def to_binary(self):
15789
        packet = []
15790
        packet.append(uabin.Primitives.Double.pack(self.Real))
15791
        packet.append(uabin.Primitives.Double.pack(self.Imaginary))
15792
        return b''.join(packet)
15793
15794 1
    @staticmethod
15795
    def from_binary(data):
15796
        return DoubleComplexNumberType(data)
15797
15798 1
    def _binary_init(self, data):
15799
        self.Real = uabin.Primitives.Double.unpack(data)
15800
        self.Imaginary = uabin.Primitives.Double.unpack(data)
15801
15802 1
    def __str__(self):
15803
        return 'DoubleComplexNumberType(' + 'Real:' + str(self.Real) + ', ' + \
15804
               'Imaginary:' + str(self.Imaginary) + ')'
15805
15806 1
    __repr__ = __str__
15807
15808
15809 1 View Code Duplication
class AxisInformation(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15810
    '''
15811
    :ivar EngineeringUnits:
15812
    :vartype EngineeringUnits: EUInformation
15813
    :ivar EURange:
15814
    :vartype EURange: Range
15815
    :ivar Title:
15816
    :vartype Title: LocalizedText
15817
    :ivar AxisScaleType:
15818
    :vartype AxisScaleType: AxisScaleEnumeration
15819
    :ivar AxisSteps:
15820
    :vartype AxisSteps: Double
15821
    '''
15822
15823 1
    ua_types = {
15824
        'EngineeringUnits': 'EUInformation',
15825
        'EURange': 'Range',
15826
        'Title': 'LocalizedText',
15827
        'AxisScaleType': 'AxisScaleEnumeration',
15828
        'AxisSteps': 'Double',
15829
               }
15830
15831 1
    def __init__(self, binary=None):
15832
        if binary is not None:
15833
            self._binary_init(binary)
15834
            self._freeze = True
15835
            return
15836
        self.EngineeringUnits = EUInformation()
15837
        self.EURange = Range()
15838
        self.Title = LocalizedText()
15839
        self.AxisScaleType = AxisScaleEnumeration(0)
15840
        self.AxisSteps = []
15841
        self._freeze = True
15842
15843 1
    def to_binary(self):
15844
        packet = []
15845
        packet.append(self.EngineeringUnits.to_binary())
15846
        packet.append(self.EURange.to_binary())
15847
        packet.append(self.Title.to_binary())
15848
        packet.append(uabin.Primitives.UInt32.pack(self.AxisScaleType.value))
15849
        packet.append(uabin.Primitives.Int32.pack(len(self.AxisSteps)))
15850
        for fieldname in self.AxisSteps:
15851
            packet.append(uabin.Primitives.Double.pack(fieldname))
15852
        return b''.join(packet)
15853
15854 1
    @staticmethod
15855
    def from_binary(data):
15856
        return AxisInformation(data)
15857
15858 1
    def _binary_init(self, data):
15859
        self.EngineeringUnits = EUInformation.from_binary(data)
15860
        self.EURange = Range.from_binary(data)
15861
        self.Title = LocalizedText.from_binary(data)
15862
        self.AxisScaleType = AxisScaleEnumeration(uabin.Primitives.UInt32.unpack(data))
15863
        self.AxisSteps = uabin.Primitives.Double.unpack_array(data)
15864
15865 1
    def __str__(self):
15866
        return 'AxisInformation(' + 'EngineeringUnits:' + str(self.EngineeringUnits) + ', ' + \
15867
               'EURange:' + str(self.EURange) + ', ' + \
15868
               'Title:' + str(self.Title) + ', ' + \
15869
               'AxisScaleType:' + str(self.AxisScaleType) + ', ' + \
15870
               'AxisSteps:' + str(self.AxisSteps) + ')'
15871
15872 1
    __repr__ = __str__
15873
15874
15875 1 View Code Duplication
class XVType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15876
    '''
15877
    :ivar X:
15878
    :vartype X: Double
15879
    :ivar Value:
15880
    :vartype Value: Float
15881
    '''
15882
15883 1
    ua_types = {
15884
        'X': 'Double',
15885
        'Value': 'Float',
15886
               }
15887
15888 1
    def __init__(self, binary=None):
15889
        if binary is not None:
15890
            self._binary_init(binary)
15891
            self._freeze = True
15892
            return
15893
        self.X = 0
15894
        self.Value = 0
15895
        self._freeze = True
15896
15897 1
    def to_binary(self):
15898
        packet = []
15899
        packet.append(uabin.Primitives.Double.pack(self.X))
15900
        packet.append(uabin.Primitives.Float.pack(self.Value))
15901
        return b''.join(packet)
15902
15903 1
    @staticmethod
15904
    def from_binary(data):
15905
        return XVType(data)
15906
15907 1
    def _binary_init(self, data):
15908
        self.X = uabin.Primitives.Double.unpack(data)
15909
        self.Value = uabin.Primitives.Float.unpack(data)
15910
15911 1
    def __str__(self):
15912
        return 'XVType(' + 'X:' + str(self.X) + ', ' + \
15913
               'Value:' + str(self.Value) + ')'
15914
15915 1
    __repr__ = __str__
15916
15917
15918 1
class ProgramDiagnosticDataType(FrozenClass):
15919
    '''
15920
    :ivar CreateSessionId:
15921
    :vartype CreateSessionId: NodeId
15922
    :ivar CreateClientName:
15923
    :vartype CreateClientName: String
15924
    :ivar InvocationCreationTime:
15925
    :vartype InvocationCreationTime: DateTime
15926
    :ivar LastTransitionTime:
15927
    :vartype LastTransitionTime: DateTime
15928
    :ivar LastMethodCall:
15929
    :vartype LastMethodCall: String
15930
    :ivar LastMethodSessionId:
15931
    :vartype LastMethodSessionId: NodeId
15932
    :ivar LastMethodInputArguments:
15933
    :vartype LastMethodInputArguments: Argument
15934
    :ivar LastMethodOutputArguments:
15935
    :vartype LastMethodOutputArguments: Argument
15936
    :ivar LastMethodCallTime:
15937
    :vartype LastMethodCallTime: DateTime
15938
    :ivar LastMethodReturnStatus:
15939
    :vartype LastMethodReturnStatus: StatusResult
15940
    '''
15941
15942 1
    ua_types = {
15943
        'CreateSessionId': 'NodeId',
15944
        'CreateClientName': 'String',
15945
        'InvocationCreationTime': 'DateTime',
15946
        'LastTransitionTime': 'DateTime',
15947
        'LastMethodCall': 'String',
15948
        'LastMethodSessionId': 'NodeId',
15949
        'LastMethodInputArguments': 'Argument',
15950
        'LastMethodOutputArguments': 'Argument',
15951
        'LastMethodCallTime': 'DateTime',
15952
        'LastMethodReturnStatus': 'StatusResult',
15953
               }
15954
15955 1
    def __init__(self, binary=None):
15956
        if binary is not None:
15957
            self._binary_init(binary)
15958
            self._freeze = True
15959
            return
15960
        self.CreateSessionId = NodeId()
15961
        self.CreateClientName = None
15962
        self.InvocationCreationTime = datetime.now()
15963
        self.LastTransitionTime = datetime.now()
15964
        self.LastMethodCall = None
15965
        self.LastMethodSessionId = NodeId()
15966
        self.LastMethodInputArguments = []
15967
        self.LastMethodOutputArguments = []
15968
        self.LastMethodCallTime = datetime.now()
15969
        self.LastMethodReturnStatus = StatusResult()
15970
        self._freeze = True
15971
15972 1
    def to_binary(self):
15973
        packet = []
15974
        packet.append(self.CreateSessionId.to_binary())
15975
        packet.append(uabin.Primitives.String.pack(self.CreateClientName))
15976
        packet.append(uabin.Primitives.DateTime.pack(self.InvocationCreationTime))
15977
        packet.append(uabin.Primitives.DateTime.pack(self.LastTransitionTime))
15978
        packet.append(uabin.Primitives.String.pack(self.LastMethodCall))
15979
        packet.append(self.LastMethodSessionId.to_binary())
15980
        packet.append(uabin.Primitives.Int32.pack(len(self.LastMethodInputArguments)))
15981
        for fieldname in self.LastMethodInputArguments:
15982
            packet.append(fieldname.to_binary())
15983
        packet.append(uabin.Primitives.Int32.pack(len(self.LastMethodOutputArguments)))
15984
        for fieldname in self.LastMethodOutputArguments:
15985
            packet.append(fieldname.to_binary())
15986
        packet.append(uabin.Primitives.DateTime.pack(self.LastMethodCallTime))
15987
        packet.append(self.LastMethodReturnStatus.to_binary())
15988
        return b''.join(packet)
15989
15990 1
    @staticmethod
15991
    def from_binary(data):
15992
        return ProgramDiagnosticDataType(data)
15993
15994 1
    def _binary_init(self, data):
15995
        self.CreateSessionId = NodeId.from_binary(data)
15996
        self.CreateClientName = uabin.Primitives.String.unpack(data)
15997
        self.InvocationCreationTime = uabin.Primitives.DateTime.unpack(data)
15998
        self.LastTransitionTime = uabin.Primitives.DateTime.unpack(data)
15999
        self.LastMethodCall = uabin.Primitives.String.unpack(data)
16000
        self.LastMethodSessionId = NodeId.from_binary(data)
16001
        length = uabin.Primitives.Int32.unpack(data)
16002
        array = []
16003
        if length != -1:
16004
            for _ in range(0, length):
16005
                array.append(Argument.from_binary(data))
16006
        self.LastMethodInputArguments = array
16007
        length = uabin.Primitives.Int32.unpack(data)
16008
        array = []
16009
        if length != -1:
16010
            for _ in range(0, length):
16011
                array.append(Argument.from_binary(data))
16012
        self.LastMethodOutputArguments = array
16013
        self.LastMethodCallTime = uabin.Primitives.DateTime.unpack(data)
16014
        self.LastMethodReturnStatus = StatusResult.from_binary(data)
16015
16016 1
    def __str__(self):
16017
        return 'ProgramDiagnosticDataType(' + 'CreateSessionId:' + str(self.CreateSessionId) + ', ' + \
16018
               'CreateClientName:' + str(self.CreateClientName) + ', ' + \
16019
               'InvocationCreationTime:' + str(self.InvocationCreationTime) + ', ' + \
16020
               'LastTransitionTime:' + str(self.LastTransitionTime) + ', ' + \
16021
               'LastMethodCall:' + str(self.LastMethodCall) + ', ' + \
16022
               'LastMethodSessionId:' + str(self.LastMethodSessionId) + ', ' + \
16023
               'LastMethodInputArguments:' + str(self.LastMethodInputArguments) + ', ' + \
16024
               'LastMethodOutputArguments:' + str(self.LastMethodOutputArguments) + ', ' + \
16025
               'LastMethodCallTime:' + str(self.LastMethodCallTime) + ', ' + \
16026
               'LastMethodReturnStatus:' + str(self.LastMethodReturnStatus) + ')'
16027
16028 1
    __repr__ = __str__
16029
16030
16031 1 View Code Duplication
class Annotation(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
16032
    '''
16033
    :ivar Message:
16034
    :vartype Message: String
16035
    :ivar UserName:
16036
    :vartype UserName: String
16037
    :ivar AnnotationTime:
16038
    :vartype AnnotationTime: DateTime
16039
    '''
16040
16041 1
    ua_types = {
16042
        'Message': 'String',
16043
        'UserName': 'String',
16044
        'AnnotationTime': 'DateTime',
16045
               }
16046
16047 1
    def __init__(self, binary=None):
16048
        if binary is not None:
16049
            self._binary_init(binary)
16050
            self._freeze = True
16051
            return
16052
        self.Message = None
16053
        self.UserName = None
16054
        self.AnnotationTime = datetime.now()
16055
        self._freeze = True
16056
16057 1
    def to_binary(self):
16058
        packet = []
16059
        packet.append(uabin.Primitives.String.pack(self.Message))
16060
        packet.append(uabin.Primitives.String.pack(self.UserName))
16061
        packet.append(uabin.Primitives.DateTime.pack(self.AnnotationTime))
16062
        return b''.join(packet)
16063
16064 1
    @staticmethod
16065
    def from_binary(data):
16066
        return Annotation(data)
16067
16068 1
    def _binary_init(self, data):
16069
        self.Message = uabin.Primitives.String.unpack(data)
16070
        self.UserName = uabin.Primitives.String.unpack(data)
16071
        self.AnnotationTime = uabin.Primitives.DateTime.unpack(data)
16072
16073 1
    def __str__(self):
16074
        return 'Annotation(' + 'Message:' + str(self.Message) + ', ' + \
16075
               'UserName:' + str(self.UserName) + ', ' + \
16076
               'AnnotationTime:' + str(self.AnnotationTime) + ')'
16077
16078 1
    __repr__ = __str__
16079
16080
16081 1
ExtensionClasses = {
16082
    ObjectIds.TrustListDataType_Encoding_DefaultBinary: TrustListDataType,
16083
    ObjectIds.Argument_Encoding_DefaultBinary: Argument,
16084
    ObjectIds.EnumValueType_Encoding_DefaultBinary: EnumValueType,
16085
    ObjectIds.OptionSet_Encoding_DefaultBinary: OptionSet,
16086
    ObjectIds.Union_Encoding_DefaultBinary: Union,
16087
    ObjectIds.TimeZoneDataType_Encoding_DefaultBinary: TimeZoneDataType,
16088
    ObjectIds.ApplicationDescription_Encoding_DefaultBinary: ApplicationDescription,
16089
    ObjectIds.RequestHeader_Encoding_DefaultBinary: RequestHeader,
16090
    ObjectIds.ResponseHeader_Encoding_DefaultBinary: ResponseHeader,
16091
    ObjectIds.ServiceFault_Encoding_DefaultBinary: ServiceFault,
16092
    ObjectIds.FindServersRequest_Encoding_DefaultBinary: FindServersRequest,
16093
    ObjectIds.FindServersResponse_Encoding_DefaultBinary: FindServersResponse,
16094
    ObjectIds.ServerOnNetwork_Encoding_DefaultBinary: ServerOnNetwork,
16095
    ObjectIds.FindServersOnNetworkRequest_Encoding_DefaultBinary: FindServersOnNetworkRequest,
16096
    ObjectIds.FindServersOnNetworkResponse_Encoding_DefaultBinary: FindServersOnNetworkResponse,
16097
    ObjectIds.UserTokenPolicy_Encoding_DefaultBinary: UserTokenPolicy,
16098
    ObjectIds.EndpointDescription_Encoding_DefaultBinary: EndpointDescription,
16099
    ObjectIds.GetEndpointsRequest_Encoding_DefaultBinary: GetEndpointsRequest,
16100
    ObjectIds.GetEndpointsResponse_Encoding_DefaultBinary: GetEndpointsResponse,
16101
    ObjectIds.RegisteredServer_Encoding_DefaultBinary: RegisteredServer,
16102
    ObjectIds.RegisterServerRequest_Encoding_DefaultBinary: RegisterServerRequest,
16103
    ObjectIds.RegisterServerResponse_Encoding_DefaultBinary: RegisterServerResponse,
16104
    ObjectIds.DiscoveryConfiguration_Encoding_DefaultBinary: DiscoveryConfiguration,
16105
    ObjectIds.MdnsDiscoveryConfiguration_Encoding_DefaultBinary: MdnsDiscoveryConfiguration,
16106
    ObjectIds.RegisterServer2Request_Encoding_DefaultBinary: RegisterServer2Request,
16107
    ObjectIds.RegisterServer2Response_Encoding_DefaultBinary: RegisterServer2Response,
16108
    ObjectIds.ChannelSecurityToken_Encoding_DefaultBinary: ChannelSecurityToken,
16109
    ObjectIds.OpenSecureChannelRequest_Encoding_DefaultBinary: OpenSecureChannelRequest,
16110
    ObjectIds.OpenSecureChannelResponse_Encoding_DefaultBinary: OpenSecureChannelResponse,
16111
    ObjectIds.CloseSecureChannelRequest_Encoding_DefaultBinary: CloseSecureChannelRequest,
16112
    ObjectIds.CloseSecureChannelResponse_Encoding_DefaultBinary: CloseSecureChannelResponse,
16113
    ObjectIds.SignedSoftwareCertificate_Encoding_DefaultBinary: SignedSoftwareCertificate,
16114
    ObjectIds.SignatureData_Encoding_DefaultBinary: SignatureData,
16115
    ObjectIds.CreateSessionRequest_Encoding_DefaultBinary: CreateSessionRequest,
16116
    ObjectIds.CreateSessionResponse_Encoding_DefaultBinary: CreateSessionResponse,
16117
    ObjectIds.UserIdentityToken_Encoding_DefaultBinary: UserIdentityToken,
16118
    ObjectIds.AnonymousIdentityToken_Encoding_DefaultBinary: AnonymousIdentityToken,
16119
    ObjectIds.UserNameIdentityToken_Encoding_DefaultBinary: UserNameIdentityToken,
16120
    ObjectIds.X509IdentityToken_Encoding_DefaultBinary: X509IdentityToken,
16121
    ObjectIds.KerberosIdentityToken_Encoding_DefaultBinary: KerberosIdentityToken,
16122
    ObjectIds.IssuedIdentityToken_Encoding_DefaultBinary: IssuedIdentityToken,
16123
    ObjectIds.ActivateSessionRequest_Encoding_DefaultBinary: ActivateSessionRequest,
16124
    ObjectIds.ActivateSessionResponse_Encoding_DefaultBinary: ActivateSessionResponse,
16125
    ObjectIds.CloseSessionRequest_Encoding_DefaultBinary: CloseSessionRequest,
16126
    ObjectIds.CloseSessionResponse_Encoding_DefaultBinary: CloseSessionResponse,
16127
    ObjectIds.CancelRequest_Encoding_DefaultBinary: CancelRequest,
16128
    ObjectIds.CancelResponse_Encoding_DefaultBinary: CancelResponse,
16129
    ObjectIds.NodeAttributes_Encoding_DefaultBinary: NodeAttributes,
16130
    ObjectIds.ObjectAttributes_Encoding_DefaultBinary: ObjectAttributes,
16131
    ObjectIds.VariableAttributes_Encoding_DefaultBinary: VariableAttributes,
16132
    ObjectIds.MethodAttributes_Encoding_DefaultBinary: MethodAttributes,
16133
    ObjectIds.ObjectTypeAttributes_Encoding_DefaultBinary: ObjectTypeAttributes,
16134
    ObjectIds.VariableTypeAttributes_Encoding_DefaultBinary: VariableTypeAttributes,
16135
    ObjectIds.ReferenceTypeAttributes_Encoding_DefaultBinary: ReferenceTypeAttributes,
16136
    ObjectIds.DataTypeAttributes_Encoding_DefaultBinary: DataTypeAttributes,
16137
    ObjectIds.ViewAttributes_Encoding_DefaultBinary: ViewAttributes,
16138
    ObjectIds.AddNodesItem_Encoding_DefaultBinary: AddNodesItem,
16139
    ObjectIds.AddNodesResult_Encoding_DefaultBinary: AddNodesResult,
16140
    ObjectIds.AddNodesRequest_Encoding_DefaultBinary: AddNodesRequest,
16141
    ObjectIds.AddNodesResponse_Encoding_DefaultBinary: AddNodesResponse,
16142
    ObjectIds.AddReferencesItem_Encoding_DefaultBinary: AddReferencesItem,
16143
    ObjectIds.AddReferencesRequest_Encoding_DefaultBinary: AddReferencesRequest,
16144
    ObjectIds.AddReferencesResponse_Encoding_DefaultBinary: AddReferencesResponse,
16145
    ObjectIds.DeleteNodesItem_Encoding_DefaultBinary: DeleteNodesItem,
16146
    ObjectIds.DeleteNodesRequest_Encoding_DefaultBinary: DeleteNodesRequest,
16147
    ObjectIds.DeleteNodesResponse_Encoding_DefaultBinary: DeleteNodesResponse,
16148
    ObjectIds.DeleteReferencesItem_Encoding_DefaultBinary: DeleteReferencesItem,
16149
    ObjectIds.DeleteReferencesRequest_Encoding_DefaultBinary: DeleteReferencesRequest,
16150
    ObjectIds.DeleteReferencesResponse_Encoding_DefaultBinary: DeleteReferencesResponse,
16151
    ObjectIds.ViewDescription_Encoding_DefaultBinary: ViewDescription,
16152
    ObjectIds.BrowseDescription_Encoding_DefaultBinary: BrowseDescription,
16153
    ObjectIds.ReferenceDescription_Encoding_DefaultBinary: ReferenceDescription,
16154
    ObjectIds.BrowseResult_Encoding_DefaultBinary: BrowseResult,
16155
    ObjectIds.BrowseRequest_Encoding_DefaultBinary: BrowseRequest,
16156
    ObjectIds.BrowseResponse_Encoding_DefaultBinary: BrowseResponse,
16157
    ObjectIds.BrowseNextRequest_Encoding_DefaultBinary: BrowseNextRequest,
16158
    ObjectIds.BrowseNextResponse_Encoding_DefaultBinary: BrowseNextResponse,
16159
    ObjectIds.RelativePathElement_Encoding_DefaultBinary: RelativePathElement,
16160
    ObjectIds.RelativePath_Encoding_DefaultBinary: RelativePath,
16161
    ObjectIds.BrowsePath_Encoding_DefaultBinary: BrowsePath,
16162
    ObjectIds.BrowsePathTarget_Encoding_DefaultBinary: BrowsePathTarget,
16163
    ObjectIds.BrowsePathResult_Encoding_DefaultBinary: BrowsePathResult,
16164
    ObjectIds.TranslateBrowsePathsToNodeIdsRequest_Encoding_DefaultBinary: TranslateBrowsePathsToNodeIdsRequest,
16165
    ObjectIds.TranslateBrowsePathsToNodeIdsResponse_Encoding_DefaultBinary: TranslateBrowsePathsToNodeIdsResponse,
16166
    ObjectIds.RegisterNodesRequest_Encoding_DefaultBinary: RegisterNodesRequest,
16167
    ObjectIds.RegisterNodesResponse_Encoding_DefaultBinary: RegisterNodesResponse,
16168
    ObjectIds.UnregisterNodesRequest_Encoding_DefaultBinary: UnregisterNodesRequest,
16169
    ObjectIds.UnregisterNodesResponse_Encoding_DefaultBinary: UnregisterNodesResponse,
16170
    ObjectIds.EndpointConfiguration_Encoding_DefaultBinary: EndpointConfiguration,
16171
    ObjectIds.SupportedProfile_Encoding_DefaultBinary: SupportedProfile,
16172
    ObjectIds.SoftwareCertificate_Encoding_DefaultBinary: SoftwareCertificate,
16173
    ObjectIds.QueryDataDescription_Encoding_DefaultBinary: QueryDataDescription,
16174
    ObjectIds.NodeTypeDescription_Encoding_DefaultBinary: NodeTypeDescription,
16175
    ObjectIds.QueryDataSet_Encoding_DefaultBinary: QueryDataSet,
16176
    ObjectIds.NodeReference_Encoding_DefaultBinary: NodeReference,
16177
    ObjectIds.ContentFilterElement_Encoding_DefaultBinary: ContentFilterElement,
16178
    ObjectIds.ContentFilter_Encoding_DefaultBinary: ContentFilter,
16179
    ObjectIds.ElementOperand_Encoding_DefaultBinary: ElementOperand,
16180
    ObjectIds.LiteralOperand_Encoding_DefaultBinary: LiteralOperand,
16181
    ObjectIds.AttributeOperand_Encoding_DefaultBinary: AttributeOperand,
16182
    ObjectIds.SimpleAttributeOperand_Encoding_DefaultBinary: SimpleAttributeOperand,
16183
    ObjectIds.ContentFilterElementResult_Encoding_DefaultBinary: ContentFilterElementResult,
16184
    ObjectIds.ContentFilterResult_Encoding_DefaultBinary: ContentFilterResult,
16185
    ObjectIds.ParsingResult_Encoding_DefaultBinary: ParsingResult,
16186
    ObjectIds.QueryFirstRequest_Encoding_DefaultBinary: QueryFirstRequest,
16187
    ObjectIds.QueryFirstResponse_Encoding_DefaultBinary: QueryFirstResponse,
16188
    ObjectIds.QueryNextRequest_Encoding_DefaultBinary: QueryNextRequest,
16189
    ObjectIds.QueryNextResponse_Encoding_DefaultBinary: QueryNextResponse,
16190
    ObjectIds.ReadValueId_Encoding_DefaultBinary: ReadValueId,
16191
    ObjectIds.ReadRequest_Encoding_DefaultBinary: ReadRequest,
16192
    ObjectIds.ReadResponse_Encoding_DefaultBinary: ReadResponse,
16193
    ObjectIds.HistoryReadValueId_Encoding_DefaultBinary: HistoryReadValueId,
16194
    ObjectIds.HistoryReadResult_Encoding_DefaultBinary: HistoryReadResult,
16195
    ObjectIds.HistoryReadDetails_Encoding_DefaultBinary: HistoryReadDetails,
16196
    ObjectIds.ReadEventDetails_Encoding_DefaultBinary: ReadEventDetails,
16197
    ObjectIds.ReadRawModifiedDetails_Encoding_DefaultBinary: ReadRawModifiedDetails,
16198
    ObjectIds.ReadProcessedDetails_Encoding_DefaultBinary: ReadProcessedDetails,
16199
    ObjectIds.ReadAtTimeDetails_Encoding_DefaultBinary: ReadAtTimeDetails,
16200
    ObjectIds.HistoryData_Encoding_DefaultBinary: HistoryData,
16201
    ObjectIds.ModificationInfo_Encoding_DefaultBinary: ModificationInfo,
16202
    ObjectIds.HistoryModifiedData_Encoding_DefaultBinary: HistoryModifiedData,
16203
    ObjectIds.HistoryEvent_Encoding_DefaultBinary: HistoryEvent,
16204
    ObjectIds.HistoryReadRequest_Encoding_DefaultBinary: HistoryReadRequest,
16205
    ObjectIds.HistoryReadResponse_Encoding_DefaultBinary: HistoryReadResponse,
16206
    ObjectIds.WriteValue_Encoding_DefaultBinary: WriteValue,
16207
    ObjectIds.WriteRequest_Encoding_DefaultBinary: WriteRequest,
16208
    ObjectIds.WriteResponse_Encoding_DefaultBinary: WriteResponse,
16209
    ObjectIds.HistoryUpdateDetails_Encoding_DefaultBinary: HistoryUpdateDetails,
16210
    ObjectIds.UpdateDataDetails_Encoding_DefaultBinary: UpdateDataDetails,
16211
    ObjectIds.UpdateStructureDataDetails_Encoding_DefaultBinary: UpdateStructureDataDetails,
16212
    ObjectIds.UpdateEventDetails_Encoding_DefaultBinary: UpdateEventDetails,
16213
    ObjectIds.DeleteRawModifiedDetails_Encoding_DefaultBinary: DeleteRawModifiedDetails,
16214
    ObjectIds.DeleteAtTimeDetails_Encoding_DefaultBinary: DeleteAtTimeDetails,
16215
    ObjectIds.DeleteEventDetails_Encoding_DefaultBinary: DeleteEventDetails,
16216
    ObjectIds.HistoryUpdateResult_Encoding_DefaultBinary: HistoryUpdateResult,
16217
    ObjectIds.HistoryUpdateRequest_Encoding_DefaultBinary: HistoryUpdateRequest,
16218
    ObjectIds.HistoryUpdateResponse_Encoding_DefaultBinary: HistoryUpdateResponse,
16219
    ObjectIds.CallMethodRequest_Encoding_DefaultBinary: CallMethodRequest,
16220
    ObjectIds.CallMethodResult_Encoding_DefaultBinary: CallMethodResult,
16221
    ObjectIds.CallRequest_Encoding_DefaultBinary: CallRequest,
16222
    ObjectIds.CallResponse_Encoding_DefaultBinary: CallResponse,
16223
    ObjectIds.MonitoringFilter_Encoding_DefaultBinary: MonitoringFilter,
16224
    ObjectIds.DataChangeFilter_Encoding_DefaultBinary: DataChangeFilter,
16225
    ObjectIds.EventFilter_Encoding_DefaultBinary: EventFilter,
16226
    ObjectIds.AggregateConfiguration_Encoding_DefaultBinary: AggregateConfiguration,
16227
    ObjectIds.AggregateFilter_Encoding_DefaultBinary: AggregateFilter,
16228
    ObjectIds.MonitoringFilterResult_Encoding_DefaultBinary: MonitoringFilterResult,
16229
    ObjectIds.EventFilterResult_Encoding_DefaultBinary: EventFilterResult,
16230
    ObjectIds.AggregateFilterResult_Encoding_DefaultBinary: AggregateFilterResult,
16231
    ObjectIds.MonitoringParameters_Encoding_DefaultBinary: MonitoringParameters,
16232
    ObjectIds.MonitoredItemCreateRequest_Encoding_DefaultBinary: MonitoredItemCreateRequest,
16233
    ObjectIds.MonitoredItemCreateResult_Encoding_DefaultBinary: MonitoredItemCreateResult,
16234
    ObjectIds.CreateMonitoredItemsRequest_Encoding_DefaultBinary: CreateMonitoredItemsRequest,
16235
    ObjectIds.CreateMonitoredItemsResponse_Encoding_DefaultBinary: CreateMonitoredItemsResponse,
16236
    ObjectIds.MonitoredItemModifyRequest_Encoding_DefaultBinary: MonitoredItemModifyRequest,
16237
    ObjectIds.MonitoredItemModifyResult_Encoding_DefaultBinary: MonitoredItemModifyResult,
16238
    ObjectIds.ModifyMonitoredItemsRequest_Encoding_DefaultBinary: ModifyMonitoredItemsRequest,
16239
    ObjectIds.ModifyMonitoredItemsResponse_Encoding_DefaultBinary: ModifyMonitoredItemsResponse,
16240
    ObjectIds.SetMonitoringModeRequest_Encoding_DefaultBinary: SetMonitoringModeRequest,
16241
    ObjectIds.SetMonitoringModeResponse_Encoding_DefaultBinary: SetMonitoringModeResponse,
16242
    ObjectIds.SetTriggeringRequest_Encoding_DefaultBinary: SetTriggeringRequest,
16243
    ObjectIds.SetTriggeringResponse_Encoding_DefaultBinary: SetTriggeringResponse,
16244
    ObjectIds.DeleteMonitoredItemsRequest_Encoding_DefaultBinary: DeleteMonitoredItemsRequest,
16245
    ObjectIds.DeleteMonitoredItemsResponse_Encoding_DefaultBinary: DeleteMonitoredItemsResponse,
16246
    ObjectIds.CreateSubscriptionRequest_Encoding_DefaultBinary: CreateSubscriptionRequest,
16247
    ObjectIds.CreateSubscriptionResponse_Encoding_DefaultBinary: CreateSubscriptionResponse,
16248
    ObjectIds.ModifySubscriptionRequest_Encoding_DefaultBinary: ModifySubscriptionRequest,
16249
    ObjectIds.ModifySubscriptionResponse_Encoding_DefaultBinary: ModifySubscriptionResponse,
16250
    ObjectIds.SetPublishingModeRequest_Encoding_DefaultBinary: SetPublishingModeRequest,
16251
    ObjectIds.SetPublishingModeResponse_Encoding_DefaultBinary: SetPublishingModeResponse,
16252
    ObjectIds.NotificationMessage_Encoding_DefaultBinary: NotificationMessage,
16253
    ObjectIds.NotificationData_Encoding_DefaultBinary: NotificationData,
16254
    ObjectIds.DataChangeNotification_Encoding_DefaultBinary: DataChangeNotification,
16255
    ObjectIds.MonitoredItemNotification_Encoding_DefaultBinary: MonitoredItemNotification,
16256
    ObjectIds.EventNotificationList_Encoding_DefaultBinary: EventNotificationList,
16257
    ObjectIds.EventFieldList_Encoding_DefaultBinary: EventFieldList,
16258
    ObjectIds.HistoryEventFieldList_Encoding_DefaultBinary: HistoryEventFieldList,
16259
    ObjectIds.StatusChangeNotification_Encoding_DefaultBinary: StatusChangeNotification,
16260
    ObjectIds.SubscriptionAcknowledgement_Encoding_DefaultBinary: SubscriptionAcknowledgement,
16261
    ObjectIds.PublishRequest_Encoding_DefaultBinary: PublishRequest,
16262
    ObjectIds.PublishResponse_Encoding_DefaultBinary: PublishResponse,
16263
    ObjectIds.RepublishRequest_Encoding_DefaultBinary: RepublishRequest,
16264
    ObjectIds.RepublishResponse_Encoding_DefaultBinary: RepublishResponse,
16265
    ObjectIds.TransferResult_Encoding_DefaultBinary: TransferResult,
16266
    ObjectIds.TransferSubscriptionsRequest_Encoding_DefaultBinary: TransferSubscriptionsRequest,
16267
    ObjectIds.TransferSubscriptionsResponse_Encoding_DefaultBinary: TransferSubscriptionsResponse,
16268
    ObjectIds.DeleteSubscriptionsRequest_Encoding_DefaultBinary: DeleteSubscriptionsRequest,
16269
    ObjectIds.DeleteSubscriptionsResponse_Encoding_DefaultBinary: DeleteSubscriptionsResponse,
16270
    ObjectIds.BuildInfo_Encoding_DefaultBinary: BuildInfo,
16271
    ObjectIds.RedundantServerDataType_Encoding_DefaultBinary: RedundantServerDataType,
16272
    ObjectIds.EndpointUrlListDataType_Encoding_DefaultBinary: EndpointUrlListDataType,
16273
    ObjectIds.NetworkGroupDataType_Encoding_DefaultBinary: NetworkGroupDataType,
16274
    ObjectIds.SamplingIntervalDiagnosticsDataType_Encoding_DefaultBinary: SamplingIntervalDiagnosticsDataType,
16275
    ObjectIds.ServerDiagnosticsSummaryDataType_Encoding_DefaultBinary: ServerDiagnosticsSummaryDataType,
16276
    ObjectIds.ServerStatusDataType_Encoding_DefaultBinary: ServerStatusDataType,
16277
    ObjectIds.SessionDiagnosticsDataType_Encoding_DefaultBinary: SessionDiagnosticsDataType,
16278
    ObjectIds.SessionSecurityDiagnosticsDataType_Encoding_DefaultBinary: SessionSecurityDiagnosticsDataType,
16279
    ObjectIds.ServiceCounterDataType_Encoding_DefaultBinary: ServiceCounterDataType,
16280
    ObjectIds.StatusResult_Encoding_DefaultBinary: StatusResult,
16281
    ObjectIds.SubscriptionDiagnosticsDataType_Encoding_DefaultBinary: SubscriptionDiagnosticsDataType,
16282
    ObjectIds.ModelChangeStructureDataType_Encoding_DefaultBinary: ModelChangeStructureDataType,
16283
    ObjectIds.SemanticChangeStructureDataType_Encoding_DefaultBinary: SemanticChangeStructureDataType,
16284
    ObjectIds.Range_Encoding_DefaultBinary: Range,
16285
    ObjectIds.EUInformation_Encoding_DefaultBinary: EUInformation,
16286
    ObjectIds.ComplexNumberType_Encoding_DefaultBinary: ComplexNumberType,
16287
    ObjectIds.DoubleComplexNumberType_Encoding_DefaultBinary: DoubleComplexNumberType,
16288
    ObjectIds.AxisInformation_Encoding_DefaultBinary: AxisInformation,
16289
    ObjectIds.XVType_Encoding_DefaultBinary: XVType,
16290
    ObjectIds.ProgramDiagnosticDataType_Encoding_DefaultBinary: ProgramDiagnosticDataType,
16291
    ObjectIds.Annotation_Encoding_DefaultBinary: Annotation,
16292
}
16293
16294
16295 1
def extensionobject_from_binary(data):
16296
    """
16297
    Convert binary-coded ExtensionObject to a Python object.
16298
    Returns an object, or None if TypeId is zero
16299
    """
16300 1
    TypeId = NodeId.from_binary(data)
16301 1
    Encoding = ord(data.read(1))
16302 1
    body = None
16303 1
    if Encoding & (1 << 0):
16304 1
        length = uabin.Primitives.Int32.unpack(data)
16305 1
        if length < 1:
16306
            body = Buffer(b"")
16307
        else:
16308 1
            body = data.copy(length)
16309 1
            data.skip(length)
16310 1
    if TypeId.Identifier == 0:
16311 1
        return None
16312 1
    elif TypeId.Identifier not in ExtensionClasses:
16313 1
        e = ExtensionObject()
16314 1
        e.TypeId = TypeId
16315 1
        e.Encoding = Encoding
16316 1
        if body is not None:
16317 1
            e.Body = body.read(len(body))
16318 1
        return e
16319 1
    klass = ExtensionClasses[TypeId.Identifier]
16320 1
    if body is None:
16321
        raise UaError("parsing ExtensionObject {0} without data".format(klass.__name__))
16322 1
    return klass.from_binary(body)
16323
16324
16325 1
def extensionobject_to_binary(obj):
16326
    """
16327
    Convert Python object to binary-coded ExtensionObject.
16328
    If obj is None, convert to empty ExtensionObject (TypeId = 0, no Body).
16329
    Returns a binary string
16330
    """
16331 1
    if isinstance(obj, ExtensionObject):
16332 1
        return obj.to_binary()
16333 1
    TypeId = NodeId()
16334 1
    Encoding = 0
16335 1
    Body = None
16336 1
    if obj is not None:
16337 1
        TypeId = FourByteNodeId(getattr(ObjectIds, "{0}_Encoding_DefaultBinary".format(obj.__class__.__name__)))
16338 1
        Encoding |= (1 << 0)
16339 1
        Body = obj.to_binary()
16340 1
    packet = []
16341 1
    packet.append(TypeId.to_binary())
16342 1
    packet.append(uabin.Primitives.UInt8.pack(Encoding))
16343 1
    if Body:
16344 1
        packet.append(uabin.Primitives.Bytes.pack(Body))
16345
    return b''.join(packet)
16346