Test Failed
Pull Request — master (#490)
by Olivier
02:56
created

LocalizedText.from_binary()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
cc 1
dl 0
loc 3
ccs 3
cts 3
cp 1
crap 1
rs 10
c 0
b 0
f 0
1
'''
2
Autogenerate code from xml spec
3
'''
4
5 1
from datetime import datetime
6 1
from enum import IntEnum
7
8 1
from opcua.ua.uatypes import *
9 1
from opcua.ua import ua_binary as uabin
10 1
from opcua.ua.object_ids import ObjectIds
11
12
13 1
class NamingRuleType(IntEnum):
14
    '''
15
    :ivar Mandatory:
16
    :vartype Mandatory: 1
17
    :ivar Optional:
18
    :vartype Optional: 2
19
    :ivar Constraint:
20
    :vartype Constraint: 3
21
    '''
22 1
    Mandatory = 1
23 1
    Optional = 2
24 1
    Constraint = 3
25
26
27 1
class OpenFileMode(IntEnum):
28
    '''
29
    :ivar Read:
30
    :vartype Read: 1
31
    :ivar Write:
32
    :vartype Write: 2
33
    :ivar EraseExisting:
34
    :vartype EraseExisting: 4
35
    :ivar Append:
36
    :vartype Append: 8
37
    '''
38 1
    Read = 1
39 1
    Write = 2
40 1
    EraseExisting = 4
41 1
    Append = 8
42
43
44 1
class TrustListMasks(IntEnum):
45
    '''
46
    :ivar None_:
47
    :vartype None_: 0
48
    :ivar TrustedCertificates:
49
    :vartype TrustedCertificates: 1
50
    :ivar TrustedCrls:
51
    :vartype TrustedCrls: 2
52
    :ivar IssuerCertificates:
53
    :vartype IssuerCertificates: 4
54
    :ivar IssuerCrls:
55
    :vartype IssuerCrls: 8
56
    :ivar All:
57
    :vartype All: 15
58
    '''
59 1
    None_ = 0
60 1
    TrustedCertificates = 1
61 1
    TrustedCrls = 2
62 1
    IssuerCertificates = 4
63 1
    IssuerCrls = 8
64 1
    All = 15
65
66
67 1
class IdType(IntEnum):
68
    '''
69
    The type of identifier used in a node id.
70
71
    :ivar Numeric:
72
    :vartype Numeric: 0
73
    :ivar String:
74
    :vartype String: 1
75
    :ivar Guid:
76
    :vartype Guid: 2
77
    :ivar Opaque:
78
    :vartype Opaque: 3
79
    '''
80 1
    Numeric = 0
81 1
    String = 1
82 1
    Guid = 2
83 1
    Opaque = 3
84
85
86 1
class NodeClass(IntEnum):
87
    '''
88
    A mask specifying the class of the node.
89
90
    :ivar Unspecified:
91
    :vartype Unspecified: 0
92
    :ivar Object:
93
    :vartype Object: 1
94
    :ivar Variable:
95
    :vartype Variable: 2
96
    :ivar Method:
97
    :vartype Method: 4
98
    :ivar ObjectType:
99
    :vartype ObjectType: 8
100
    :ivar VariableType:
101
    :vartype VariableType: 16
102
    :ivar ReferenceType:
103
    :vartype ReferenceType: 32
104
    :ivar DataType:
105
    :vartype DataType: 64
106
    :ivar View:
107
    :vartype View: 128
108
    '''
109 1
    Unspecified = 0
110 1
    Object = 1
111 1
    Variable = 2
112 1
    Method = 4
113 1
    ObjectType = 8
114 1
    VariableType = 16
115 1
    ReferenceType = 32
116 1
    DataType = 64
117 1
    View = 128
118
119
120 1
class ApplicationType(IntEnum):
121
    '''
122
    The types of applications.
123
124
    :ivar Server:
125
    :vartype Server: 0
126
    :ivar Client:
127
    :vartype Client: 1
128
    :ivar ClientAndServer:
129
    :vartype ClientAndServer: 2
130
    :ivar DiscoveryServer:
131
    :vartype DiscoveryServer: 3
132
    '''
133 1
    Server = 0
134 1
    Client = 1
135 1
    ClientAndServer = 2
136 1
    DiscoveryServer = 3
137
138
139 1
class MessageSecurityMode(IntEnum):
140
    '''
141
    The type of security to use on a message.
142
143
    :ivar Invalid:
144
    :vartype Invalid: 0
145
    :ivar None_:
146
    :vartype None_: 1
147
    :ivar Sign:
148
    :vartype Sign: 2
149
    :ivar SignAndEncrypt:
150
    :vartype SignAndEncrypt: 3
151
    '''
152 1
    Invalid = 0
153 1
    None_ = 1
154 1
    Sign = 2
155 1
    SignAndEncrypt = 3
156
157
158 1
class UserTokenType(IntEnum):
159
    '''
160
    The possible user token types.
161
162
    :ivar Anonymous:
163
    :vartype Anonymous: 0
164
    :ivar UserName:
165
    :vartype UserName: 1
166
    :ivar Certificate:
167
    :vartype Certificate: 2
168
    :ivar IssuedToken:
169
    :vartype IssuedToken: 3
170
    :ivar Kerberos:
171
    :vartype Kerberos: 4
172
    '''
173 1
    Anonymous = 0
174 1
    UserName = 1
175 1
    Certificate = 2
176 1
    IssuedToken = 3
177 1
    Kerberos = 4
178
179
180 1
class SecurityTokenRequestType(IntEnum):
181
    '''
182
    Indicates whether a token if being created or renewed.
183
184
    :ivar Issue:
185
    :vartype Issue: 0
186
    :ivar Renew:
187
    :vartype Renew: 1
188
    '''
189 1
    Issue = 0
190 1
    Renew = 1
191
192
193 1
class NodeAttributesMask(IntEnum):
194
    '''
195
    The bits used to specify default attributes for a new node.
196
197
    :ivar None_:
198
    :vartype None_: 0
199
    :ivar AccessLevel:
200
    :vartype AccessLevel: 1
201
    :ivar ArrayDimensions:
202
    :vartype ArrayDimensions: 2
203
    :ivar BrowseName:
204
    :vartype BrowseName: 4
205
    :ivar ContainsNoLoops:
206
    :vartype ContainsNoLoops: 8
207
    :ivar DataType:
208
    :vartype DataType: 16
209
    :ivar Description:
210
    :vartype Description: 32
211
    :ivar DisplayName:
212
    :vartype DisplayName: 64
213
    :ivar EventNotifier:
214
    :vartype EventNotifier: 128
215
    :ivar Executable:
216
    :vartype Executable: 256
217
    :ivar Historizing:
218
    :vartype Historizing: 512
219
    :ivar InverseName:
220
    :vartype InverseName: 1024
221
    :ivar IsAbstract:
222
    :vartype IsAbstract: 2048
223
    :ivar MinimumSamplingInterval:
224
    :vartype MinimumSamplingInterval: 4096
225
    :ivar NodeClass:
226
    :vartype NodeClass: 8192
227
    :ivar NodeId:
228
    :vartype NodeId: 16384
229
    :ivar Symmetric:
230
    :vartype Symmetric: 32768
231
    :ivar UserAccessLevel:
232
    :vartype UserAccessLevel: 65536
233
    :ivar UserExecutable:
234
    :vartype UserExecutable: 131072
235
    :ivar UserWriteMask:
236
    :vartype UserWriteMask: 262144
237
    :ivar ValueRank:
238
    :vartype ValueRank: 524288
239
    :ivar WriteMask:
240
    :vartype WriteMask: 1048576
241
    :ivar Value:
242
    :vartype Value: 2097152
243
    :ivar All:
244
    :vartype All: 4194303
245
    :ivar BaseNode:
246
    :vartype BaseNode: 1335396
247
    :ivar Object:
248
    :vartype Object: 1335524
249
    :ivar ObjectTypeOrDataType:
250
    :vartype ObjectTypeOrDataType: 1337444
251
    :ivar Variable:
252
    :vartype Variable: 4026999
253
    :ivar VariableType:
254
    :vartype VariableType: 3958902
255
    :ivar Method:
256
    :vartype Method: 1466724
257
    :ivar ReferenceType:
258
    :vartype ReferenceType: 1371236
259
    :ivar View:
260
    :vartype View: 1335532
261
    '''
262 1
    None_ = 0
263 1
    AccessLevel = 1
264 1
    ArrayDimensions = 2
265 1
    BrowseName = 4
266 1
    ContainsNoLoops = 8
267 1
    DataType = 16
268 1
    Description = 32
269 1
    DisplayName = 64
270 1
    EventNotifier = 128
271 1
    Executable = 256
272 1
    Historizing = 512
273 1
    InverseName = 1024
274 1
    IsAbstract = 2048
275 1
    MinimumSamplingInterval = 4096
276 1
    NodeClass = 8192
277 1
    NodeId = 16384
278 1
    Symmetric = 32768
279 1
    UserAccessLevel = 65536
280 1
    UserExecutable = 131072
281 1
    UserWriteMask = 262144
282 1
    ValueRank = 524288
283 1
    WriteMask = 1048576
284 1
    Value = 2097152
285 1
    All = 4194303
286 1
    BaseNode = 1335396
287 1
    Object = 1335524
288 1
    ObjectTypeOrDataType = 1337444
289 1
    Variable = 4026999
290 1
    VariableType = 3958902
291 1
    Method = 1466724
292 1
    ReferenceType = 1371236
293 1
    View = 1335532
294
295
296 1
class AttributeWriteMask(IntEnum):
297 View Code Duplication
    '''
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
298
    Define bits used to indicate which attributes are writable.
299
300
    :ivar None_:
301
    :vartype None_: 0
302
    :ivar AccessLevel:
303
    :vartype AccessLevel: 1
304
    :ivar ArrayDimensions:
305
    :vartype ArrayDimensions: 2
306
    :ivar BrowseName:
307
    :vartype BrowseName: 4
308
    :ivar ContainsNoLoops:
309
    :vartype ContainsNoLoops: 8
310
    :ivar DataType:
311
    :vartype DataType: 16
312
    :ivar Description:
313
    :vartype Description: 32
314
    :ivar DisplayName:
315
    :vartype DisplayName: 64
316
    :ivar EventNotifier:
317
    :vartype EventNotifier: 128
318
    :ivar Executable:
319
    :vartype Executable: 256
320
    :ivar Historizing:
321
    :vartype Historizing: 512
322
    :ivar InverseName:
323
    :vartype InverseName: 1024
324
    :ivar IsAbstract:
325
    :vartype IsAbstract: 2048
326
    :ivar MinimumSamplingInterval:
327
    :vartype MinimumSamplingInterval: 4096
328
    :ivar NodeClass:
329
    :vartype NodeClass: 8192
330
    :ivar NodeId:
331
    :vartype NodeId: 16384
332
    :ivar Symmetric:
333
    :vartype Symmetric: 32768
334
    :ivar UserAccessLevel:
335
    :vartype UserAccessLevel: 65536
336
    :ivar UserExecutable:
337
    :vartype UserExecutable: 131072
338
    :ivar UserWriteMask:
339
    :vartype UserWriteMask: 262144
340
    :ivar ValueRank:
341
    :vartype ValueRank: 524288
342
    :ivar WriteMask:
343
    :vartype WriteMask: 1048576
344
    :ivar ValueForVariableType:
345
    :vartype ValueForVariableType: 2097152
346
    '''
347 1
    None_ = 0
348 1
    AccessLevel = 1
349 1
    ArrayDimensions = 2
350 1
    BrowseName = 4
351 1
    ContainsNoLoops = 8
352 1
    DataType = 16
353 1
    Description = 32
354 1
    DisplayName = 64
355 1
    EventNotifier = 128
356 1
    Executable = 256
357 1
    Historizing = 512
358 1
    InverseName = 1024
359 1
    IsAbstract = 2048
360 1
    MinimumSamplingInterval = 4096
361 1
    NodeClass = 8192
362 1
    NodeId = 16384
363 1
    Symmetric = 32768
364 1
    UserAccessLevel = 65536
365 1
    UserExecutable = 131072
366 1
    UserWriteMask = 262144
367 1
    ValueRank = 524288
368 1
    WriteMask = 1048576
369 1
    ValueForVariableType = 2097152
370
371
372 1
class BrowseDirection(IntEnum):
373
    '''
374
    The directions of the references to return.
375
376
    :ivar Forward:
377
    :vartype Forward: 0
378
    :ivar Inverse:
379
    :vartype Inverse: 1
380
    :ivar Both:
381
    :vartype Both: 2
382
    '''
383 1
    Forward = 0
384 1
    Inverse = 1
385 1
    Both = 2
386
387
388 1
class BrowseResultMask(IntEnum):
389
    '''
390
    A bit mask which specifies what should be returned in a browse response.
391
392
    :ivar None_:
393
    :vartype None_: 0
394
    :ivar ReferenceTypeId:
395
    :vartype ReferenceTypeId: 1
396
    :ivar IsForward:
397
    :vartype IsForward: 2
398
    :ivar NodeClass:
399
    :vartype NodeClass: 4
400
    :ivar BrowseName:
401
    :vartype BrowseName: 8
402
    :ivar DisplayName:
403
    :vartype DisplayName: 16
404
    :ivar TypeDefinition:
405
    :vartype TypeDefinition: 32
406
    :ivar All:
407
    :vartype All: 63
408
    :ivar ReferenceTypeInfo:
409
    :vartype ReferenceTypeInfo: 3
410
    :ivar TargetInfo:
411
    :vartype TargetInfo: 60
412
    '''
413 1
    None_ = 0
414 1
    ReferenceTypeId = 1
415 1
    IsForward = 2
416 1
    NodeClass = 4
417 1
    BrowseName = 8
418 1
    DisplayName = 16
419 1
    TypeDefinition = 32
420 1
    All = 63
421 1
    ReferenceTypeInfo = 3
422 1
    TargetInfo = 60
423
424
425 1
class ComplianceLevel(IntEnum):
426
    '''
427
    :ivar Untested:
428
    :vartype Untested: 0
429
    :ivar Partial:
430
    :vartype Partial: 1
431
    :ivar SelfTested:
432
    :vartype SelfTested: 2
433
    :ivar Certified:
434
    :vartype Certified: 3
435
    '''
436 1
    Untested = 0
437 1
    Partial = 1
438 1
    SelfTested = 2
439 1
    Certified = 3
440
441
442 1
class FilterOperator(IntEnum):
443
    '''
444
    :ivar Equals:
445
    :vartype Equals: 0
446
    :ivar IsNull:
447
    :vartype IsNull: 1
448
    :ivar GreaterThan:
449
    :vartype GreaterThan: 2
450
    :ivar LessThan:
451
    :vartype LessThan: 3
452
    :ivar GreaterThanOrEqual:
453
    :vartype GreaterThanOrEqual: 4
454
    :ivar LessThanOrEqual:
455
    :vartype LessThanOrEqual: 5
456
    :ivar Like:
457
    :vartype Like: 6
458
    :ivar Not:
459
    :vartype Not: 7
460
    :ivar Between:
461
    :vartype Between: 8
462
    :ivar InList:
463
    :vartype InList: 9
464
    :ivar And:
465
    :vartype And: 10
466
    :ivar Or:
467
    :vartype Or: 11
468
    :ivar Cast:
469
    :vartype Cast: 12
470
    :ivar InView:
471
    :vartype InView: 13
472
    :ivar OfType:
473
    :vartype OfType: 14
474
    :ivar RelatedTo:
475
    :vartype RelatedTo: 15
476
    :ivar BitwiseAnd:
477
    :vartype BitwiseAnd: 16
478
    :ivar BitwiseOr:
479
    :vartype BitwiseOr: 17
480
    '''
481 1
    Equals = 0
482 1
    IsNull = 1
483 1
    GreaterThan = 2
484 1
    LessThan = 3
485 1
    GreaterThanOrEqual = 4
486 1
    LessThanOrEqual = 5
487 1
    Like = 6
488 1
    Not = 7
489 1
    Between = 8
490 1
    InList = 9
491 1
    And = 10
492 1
    Or = 11
493 1
    Cast = 12
494 1
    InView = 13
495 1
    OfType = 14
496 1
    RelatedTo = 15
497 1
    BitwiseAnd = 16
498 1
    BitwiseOr = 17
499
500
501 1
class TimestampsToReturn(IntEnum):
502
    '''
503
    :ivar Source:
504
    :vartype Source: 0
505
    :ivar Server:
506
    :vartype Server: 1
507
    :ivar Both:
508
    :vartype Both: 2
509
    :ivar Neither:
510
    :vartype Neither: 3
511
    '''
512 1
    Source = 0
513 1
    Server = 1
514 1
    Both = 2
515 1
    Neither = 3
516
517
518 1
class HistoryUpdateType(IntEnum):
519
    '''
520
    :ivar Insert:
521
    :vartype Insert: 1
522
    :ivar Replace:
523
    :vartype Replace: 2
524
    :ivar Update:
525
    :vartype Update: 3
526
    :ivar Delete:
527
    :vartype Delete: 4
528
    '''
529 1
    Insert = 1
530 1
    Replace = 2
531 1
    Update = 3
532 1
    Delete = 4
533
534
535 1
class PerformUpdateType(IntEnum):
536
    '''
537
    :ivar Insert:
538
    :vartype Insert: 1
539
    :ivar Replace:
540
    :vartype Replace: 2
541
    :ivar Update:
542
    :vartype Update: 3
543
    :ivar Remove:
544
    :vartype Remove: 4
545
    '''
546 1
    Insert = 1
547 1
    Replace = 2
548 1
    Update = 3
549 1
    Remove = 4
550
551
552 1
class MonitoringMode(IntEnum):
553
    '''
554
    :ivar Disabled:
555
    :vartype Disabled: 0
556
    :ivar Sampling:
557
    :vartype Sampling: 1
558
    :ivar Reporting:
559
    :vartype Reporting: 2
560
    '''
561 1
    Disabled = 0
562 1
    Sampling = 1
563 1
    Reporting = 2
564
565
566 1
class DataChangeTrigger(IntEnum):
567
    '''
568
    :ivar Status:
569
    :vartype Status: 0
570
    :ivar StatusValue:
571
    :vartype StatusValue: 1
572
    :ivar StatusValueTimestamp:
573
    :vartype StatusValueTimestamp: 2
574
    '''
575 1
    Status = 0
576 1
    StatusValue = 1
577 1
    StatusValueTimestamp = 2
578
579
580 1
class DeadbandType(IntEnum):
581
    '''
582
    :ivar None_:
583
    :vartype None_: 0
584
    :ivar Absolute:
585
    :vartype Absolute: 1
586
    :ivar Percent:
587
    :vartype Percent: 2
588
    '''
589 1
    None_ = 0
590 1
    Absolute = 1
591 1
    Percent = 2
592
593
594 1
class EnumeratedTestType(IntEnum):
595
    '''
596
    A simple enumerated type used for testing.
597
598
    :ivar Red:
599
    :vartype Red: 1
600
    :ivar Yellow:
601
    :vartype Yellow: 4
602
    :ivar Green:
603
    :vartype Green: 5
604
    '''
605 1
    Red = 1
606 1
    Yellow = 4
607 1
    Green = 5
608
609
610 1
class RedundancySupport(IntEnum):
611
    '''
612
    :ivar None_:
613
    :vartype None_: 0
614
    :ivar Cold:
615
    :vartype Cold: 1
616
    :ivar Warm:
617
    :vartype Warm: 2
618
    :ivar Hot:
619
    :vartype Hot: 3
620
    :ivar Transparent:
621
    :vartype Transparent: 4
622
    :ivar HotAndMirrored:
623
    :vartype HotAndMirrored: 5
624
    '''
625 1
    None_ = 0
626 1
    Cold = 1
627 1
    Warm = 2
628 1
    Hot = 3
629 1
    Transparent = 4
630 1
    HotAndMirrored = 5
631
632
633 1
class ServerState(IntEnum):
634
    '''
635
    :ivar Running:
636
    :vartype Running: 0
637
    :ivar Failed:
638
    :vartype Failed: 1
639
    :ivar NoConfiguration:
640
    :vartype NoConfiguration: 2
641
    :ivar Suspended:
642
    :vartype Suspended: 3
643
    :ivar Shutdown:
644
    :vartype Shutdown: 4
645
    :ivar Test:
646
    :vartype Test: 5
647
    :ivar CommunicationFault:
648
    :vartype CommunicationFault: 6
649
    :ivar Unknown:
650
    :vartype Unknown: 7
651
    '''
652 1
    Running = 0
653 1
    Failed = 1
654 1
    NoConfiguration = 2
655 1
    Suspended = 3
656 1
    Shutdown = 4
657 1
    Test = 5
658 1
    CommunicationFault = 6
659 1
    Unknown = 7
660
661
662 1
class ModelChangeStructureVerbMask(IntEnum):
663
    '''
664
    :ivar NodeAdded:
665
    :vartype NodeAdded: 1
666
    :ivar NodeDeleted:
667
    :vartype NodeDeleted: 2
668
    :ivar ReferenceAdded:
669
    :vartype ReferenceAdded: 4
670
    :ivar ReferenceDeleted:
671
    :vartype ReferenceDeleted: 8
672
    :ivar DataTypeChanged:
673
    :vartype DataTypeChanged: 16
674
    '''
675 1
    NodeAdded = 1
676 1
    NodeDeleted = 2
677 1
    ReferenceAdded = 4
678 1
    ReferenceDeleted = 8
679 1
    DataTypeChanged = 16
680
681
682 1
class AxisScaleEnumeration(IntEnum):
683
    '''
684
    :ivar Linear:
685
    :vartype Linear: 0
686
    :ivar Log:
687
    :vartype Log: 1
688
    :ivar Ln:
689
    :vartype Ln: 2
690
    '''
691 1
    Linear = 0
692 1
    Log = 1
693 1
    Ln = 2
694
695
696 1
class ExceptionDeviationFormat(IntEnum):
697
    '''
698
    :ivar AbsoluteValue:
699
    :vartype AbsoluteValue: 0
700
    :ivar PercentOfValue:
701
    :vartype PercentOfValue: 1
702
    :ivar PercentOfRange:
703
    :vartype PercentOfRange: 2
704
    :ivar PercentOfEURange:
705
    :vartype PercentOfEURange: 3
706
    :ivar Unknown:
707
    :vartype Unknown: 4
708
    '''
709 1
    AbsoluteValue = 0
710 1
    PercentOfValue = 1
711 1
    PercentOfRange = 2
712 1
    PercentOfEURange = 3
713 1
    Unknown = 4
714
715
716 1
class XmlElement(FrozenClass):
717
    '''
718
    An XML element encoded as a UTF-8 string.
719
720
    :ivar Length:
721
    :vartype Length: Int32
722
    :ivar Value:
723
    :vartype Value: Char
724
    '''
725
726
    ua_types = (
727
728
        ('Length', 'Int32'),
729
        ('Value', 'ListOfChar'),
730
               )
731
732
    def __init__(self, binary=None):
733
        if binary is not None:
734
            self._binary_init(binary)
735
            self._freeze = True
736
            return
737
        self.Length = 0
738 1
        self.Value = []
739
        self._freeze = True
740
741
    def to_binary(self):
742
        packet = []
743
        packet.append(uabin.Primitives.Int32.pack(self.Length))
744
        packet.append(uabin.Primitives.Int32.pack(len(self.Value)))
745
        for fieldname in self.Value:
746
            packet.append(uabin.Primitives.Char.pack(fieldname))
747
        return b''.join(packet)
748
749 1
    @staticmethod
750 1
    def from_binary(data):
751 1
        return XmlElement(data)
752 1
753 1
    def _binary_init(self, data):
754 1
        self.Length = uabin.Primitives.Int32.unpack(data)
755 1
        self.Value = uabin.Primitives.Char.unpack_array(data)
756 1
757 1
    def __str__(self):
758 1
        return 'XmlElement(' + 'Length:' + str(self.Length) + ', ' + \
759 1
               'Value:' + str(self.Value) + ')'
760 1
761 1
    __repr__ = __str__
762 1
763
764 1
class DiagnosticInfo(FrozenClass):
765 1
    '''
766 1
    A recursive structure containing diagnostic information associated with a status code.
767 1
768 1
    :ivar Encoding:
769 1
    :vartype Encoding: UInt8
770 1
    :ivar SymbolicId:
771 1
    :vartype SymbolicId: Int32
772 1
    :ivar NamespaceURI:
773 1
    :vartype NamespaceURI: Int32
774 1
    :ivar Locale:
775
    :vartype Locale: Int32
776 1
    :ivar LocalizedText:
777
    :vartype LocalizedText: Int32
778 1
    :ivar AdditionalInfo:
779
    :vartype AdditionalInfo: CharArray
780 1
    :ivar InnerStatusCode:
781
    :vartype InnerStatusCode: StatusCode
782 1
    :ivar InnerDiagnosticInfo:
783
    :vartype InnerDiagnosticInfo: DiagnosticInfo
784 1
    '''
785 1
786 1
    ua_switches = {
787
        'SymbolicId': ('Encoding', 0),
788 1
        'NamespaceURI': ('Encoding', 1),
789
        'Locale': ('Encoding', 2),
790 1
        'LocalizedText': ('Encoding', 3),
791
        'AdditionalInfo': ('Encoding', 4),
792 1
        'InnerStatusCode': ('Encoding', 5),
793
        'InnerDiagnosticInfo': ('Encoding', 6),
794 1
               }
795 1
    ua_types = (
796 1
797
        ('Encoding', 'UInt8'),
798
        ('SymbolicId', 'Int32'),
799 1
        ('NamespaceURI', 'Int32'),
800 1
        ('Locale', 'Int32'),
801
        ('LocalizedText', 'Int32'),
802
        ('AdditionalInfo', 'CharArray'),
803 1
        ('InnerStatusCode', 'StatusCode'),
804 1
        ('InnerDiagnosticInfo', 'DiagnosticInfo'),
805
               )
806
807 1
    def __init__(self, binary=None):
808 1
        if binary is not None:
809
            self._binary_init(binary)
810
            self._freeze = True
811 1
            return
812 1
        self.Encoding = 0
813
        self.SymbolicId = 0
814
        self.NamespaceURI = 0
815 1
        self.Locale = 0
816 1
        self.LocalizedText = 0
817 1
        self.AdditionalInfo = None
818
        self.InnerStatusCode = StatusCode()
819
        self.InnerDiagnosticInfo = None
820 1
        self._freeze = True
821
822
    def to_binary(self):
823 1
        packet = []
824
        if self.SymbolicId: self.Encoding |= (1 << 0)
825 1
        if self.NamespaceURI: self.Encoding |= (1 << 1)
826
        if self.Locale: self.Encoding |= (1 << 2)
827
        if self.LocalizedText: self.Encoding |= (1 << 3)
828
        if self.AdditionalInfo: self.Encoding |= (1 << 4)
829
        if self.InnerStatusCode: self.Encoding |= (1 << 5)
830
        if self.InnerDiagnosticInfo: self.Encoding |= (1 << 6)
831
        packet.append(uabin.Primitives.UInt8.pack(self.Encoding))
832
        if self.SymbolicId: 
833
            packet.append(uabin.Primitives.Int32.pack(self.SymbolicId))
834
        if self.NamespaceURI: 
835 1
            packet.append(uabin.Primitives.Int32.pack(self.NamespaceURI))
836
        if self.Locale: 
837
            packet.append(uabin.Primitives.Int32.pack(self.Locale))
838 1
        if self.LocalizedText: 
839
            packet.append(uabin.Primitives.Int32.pack(self.LocalizedText))
840
        if self.AdditionalInfo: 
841
            packet.append(uabin.Primitives.CharArray.pack(self.AdditionalInfo))
842
        if self.InnerStatusCode: 
843
            packet.append(self.InnerStatusCode.to_binary())
844
        if self.InnerDiagnosticInfo: 
845
            packet.append(self.InnerDiagnosticInfo.to_binary())
846
        return b''.join(packet)
847
848
    @staticmethod
849
    def from_binary(data):
850
        return DiagnosticInfo(data)
851
852 1
    def _binary_init(self, data):
853
        self.Encoding = uabin.Primitives.UInt8.unpack(data)
854
        if self.Encoding & (1 << 0):
855
            self.SymbolicId = uabin.Primitives.Int32.unpack(data)
856
        else:
857
            self.SymbolicId = 0
858
        if self.Encoding & (1 << 1):
859
            self.NamespaceURI = uabin.Primitives.Int32.unpack(data)
860 1
        else:
861
            self.NamespaceURI = 0
862
        if self.Encoding & (1 << 2):
863
            self.Locale = uabin.Primitives.Int32.unpack(data)
864
        else:
865
            self.Locale = 0
866
        if self.Encoding & (1 << 3):
867
            self.LocalizedText = uabin.Primitives.Int32.unpack(data)
868
        else:
869
            self.LocalizedText = 0
870
        if self.Encoding & (1 << 4):
871
            self.AdditionalInfo = uabin.Primitives.CharArray.unpack(data)
872 1
        else:
873
            self.AdditionalInfo = None
874
        if self.Encoding & (1 << 5):
875
            self.InnerStatusCode = StatusCode.from_binary(data)
876
        else:
877
            self.InnerStatusCode = StatusCode()
878
        if self.Encoding & (1 << 6):
879
            self.InnerDiagnosticInfo = DiagnosticInfo.from_binary(data)
880
        else:
881
            self.InnerDiagnosticInfo = None
882
883
    def __str__(self):
884
        return 'DiagnosticInfo(' + 'Encoding:' + str(self.Encoding) + ', ' + \
885
               'SymbolicId:' + str(self.SymbolicId) + ', ' + \
886
               'NamespaceURI:' + str(self.NamespaceURI) + ', ' + \
887
               'Locale:' + str(self.Locale) + ', ' + \
888
               'LocalizedText:' + str(self.LocalizedText) + ', ' + \
889 1
               'AdditionalInfo:' + str(self.AdditionalInfo) + ', ' + \
890
               'InnerStatusCode:' + str(self.InnerStatusCode) + ', ' + \
891
               'InnerDiagnosticInfo:' + str(self.InnerDiagnosticInfo) + ')'
892
893 1
    __repr__ = __str__
894
895
896
class LocalizedText(FrozenClass):
897
    '''
898
    A string qualified with a namespace index.
899
900 1
    :ivar Encoding:
901
    :vartype Encoding: UInt8
902
    :ivar Locale:
903
    :vartype Locale: CharArray
904
    :ivar Text:
905
    :vartype Text: CharArray
906
    '''
907 1
908
    ua_switches = {
909
        'Locale': ('Encoding', 0),
910 1
        'Text': ('Encoding', 1),
911
               }
912
    ua_types = (
913
914
        ('Encoding', 'UInt8'),
915
        ('Locale', 'CharArray'),
916
        ('Text', 'CharArray'),
917
               )
918
919
    def __init__(self, binary=None):
920
        if binary is not None:
921
            self._binary_init(binary)
922
            self._freeze = True
923
            return
924
        self.Encoding = 0
925
        self.Locale = None
926 1
        self.Text = None
927
        self._freeze = True
928
929 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...
930
        packet = []
931
        if self.Locale: self.Encoding |= (1 << 0)
932
        if self.Text: self.Encoding |= (1 << 1)
933
        packet.append(uabin.Primitives.UInt8.pack(self.Encoding))
934 1
        if self.Locale: 
935 1
            packet.append(uabin.Primitives.CharArray.pack(self.Locale))
936 1
        if self.Text: 
937 1
            packet.append(uabin.Primitives.CharArray.pack(self.Text))
938 1
        return b''.join(packet)
939 1
940 1
    @staticmethod
941 1
    def from_binary(data):
942 1
        return LocalizedText(data)
943 1
944 1
    def _binary_init(self, data):
945
        self.Encoding = uabin.Primitives.UInt8.unpack(data)
946 1
        if self.Encoding & (1 << 0):
947 1
            self.Locale = uabin.Primitives.CharArray.unpack(data)
948 1
        else:
949 1
            self.Locale = None
950 1
        if self.Encoding & (1 << 1):
951 1
            self.Text = uabin.Primitives.CharArray.unpack(data)
952 1
        else:
953 1
            self.Text = None
954 1
955 1
    def __str__(self):
956
        return 'LocalizedText(' + 'Encoding:' + str(self.Encoding) + ', ' + \
957 1
               'Locale:' + str(self.Locale) + ', ' + \
958
               'Text:' + str(self.Text) + ')'
959 1
960
    __repr__ = __str__
961 1
962 1
963 1
class DataValue(FrozenClass):
964 1
    '''
965 1
    A value with an associated timestamp, and quality.
966 1
967
    :ivar Encoding:
968 1
    :vartype Encoding: UInt8
969
    :ivar Value:
970
    :vartype Value: Variant
971
    :ivar StatusCode:
972
    :vartype StatusCode: StatusCode
973
    :ivar SourceTimestamp:
974
    :vartype SourceTimestamp: DateTime
975 1
    :ivar SourcePicoseconds:
976
    :vartype SourcePicoseconds: UInt16
977
    :ivar ServerTimestamp:
978 1
    :vartype ServerTimestamp: DateTime
979
    :ivar ServerPicoseconds:
980
    :vartype ServerPicoseconds: UInt16
981
    '''
982
983
    ua_switches = {
984
        'Value': ('Encoding', 0),
985
        'StatusCode': ('Encoding', 1),
986
        'SourceTimestamp': ('Encoding', 2),
987
        'SourcePicoseconds': ('Encoding', 3),
988
        'ServerTimestamp': ('Encoding', 4),
989
        'ServerPicoseconds': ('Encoding', 5),
990 1
               }
991
    ua_types = (
992
993
        ('Encoding', 'UInt8'),
994
        ('Value', 'Variant'),
995
        ('StatusCode', 'StatusCode'),
996 1
        ('SourceTimestamp', 'DateTime'),
997 1
        ('SourcePicoseconds', 'UInt16'),
998 1
        ('ServerTimestamp', 'DateTime'),
999 1
        ('ServerPicoseconds', 'UInt16'),
1000 1
               )
1001 1
1002 1 View Code Duplication
    def __init__(self, binary=None):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1003 1
        if binary is not None:
1004 1
            self._binary_init(binary)
1005
            self._freeze = True
1006 1
            return
1007 1
        self.Encoding = 0
1008 1
        self.Value = Variant()
1009 1
        self.StatusCode = StatusCode()
1010 1
        self.SourceTimestamp = datetime.utcnow()
1011 1
        self.SourcePicoseconds = 0
1012
        self.ServerTimestamp = datetime.utcnow()
1013 1
        self.ServerPicoseconds = 0
1014
        self._freeze = True
1015 1
1016 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...
1017 1
        packet = []
1018 1
        if self.Value: self.Encoding |= (1 << 0)
1019 1
        if self.StatusCode: self.Encoding |= (1 << 1)
1020 1
        if self.SourceTimestamp: self.Encoding |= (1 << 2)
1021
        if self.SourcePicoseconds: self.Encoding |= (1 << 3)
1022 1
        if self.ServerTimestamp: self.Encoding |= (1 << 4)
1023
        if self.ServerPicoseconds: self.Encoding |= (1 << 5)
1024
        packet.append(uabin.Primitives.UInt8.pack(self.Encoding))
1025
        if self.Value: 
1026
            packet.append(self.Value.to_binary())
1027 1
        if self.StatusCode: 
1028
            packet.append(self.StatusCode.to_binary())
1029
        if self.SourceTimestamp: 
1030 1
            packet.append(uabin.Primitives.DateTime.pack(self.SourceTimestamp))
1031
        if self.SourcePicoseconds: 
1032
            packet.append(uabin.Primitives.UInt16.pack(self.SourcePicoseconds))
1033
        if self.ServerTimestamp: 
1034
            packet.append(uabin.Primitives.DateTime.pack(self.ServerTimestamp))
1035
        if self.ServerPicoseconds: 
1036
            packet.append(uabin.Primitives.UInt16.pack(self.ServerPicoseconds))
1037
        return b''.join(packet)
1038
1039
    @staticmethod
1040 1
    def from_binary(data):
1041
        return DataValue(data)
1042
1043
    def _binary_init(self, data):
1044
        self.Encoding = uabin.Primitives.UInt8.unpack(data)
1045 1
        if self.Encoding & (1 << 0):
1046
            self.Value = Variant.from_binary(data)
1047
        else:
1048
            self.Value = Variant()
1049
        if self.Encoding & (1 << 1):
1050
            self.StatusCode = StatusCode.from_binary(data)
1051
        else:
1052
            self.StatusCode = StatusCode()
1053
        if self.Encoding & (1 << 2):
1054 1
            self.SourceTimestamp = uabin.Primitives.DateTime.unpack(data)
1055
        else:
1056
            self.SourceTimestamp = datetime.utcnow()
1057
        if self.Encoding & (1 << 3):
1058
            self.SourcePicoseconds = uabin.Primitives.UInt16.unpack(data)
1059
        else:
1060 1
            self.SourcePicoseconds = 0
1061
        if self.Encoding & (1 << 4):
1062
            self.ServerTimestamp = uabin.Primitives.DateTime.unpack(data)
1063
        else:
1064 1
            self.ServerTimestamp = datetime.utcnow()
1065
        if self.Encoding & (1 << 5):
1066
            self.ServerPicoseconds = uabin.Primitives.UInt16.unpack(data)
1067
        else:
1068 1
            self.ServerPicoseconds = 0
1069
1070
    def __str__(self):
1071
        return 'DataValue(' + 'Encoding:' + str(self.Encoding) + ', ' + \
1072 1
               'Value:' + str(self.Value) + ', ' + \
1073
               'StatusCode:' + str(self.StatusCode) + ', ' + \
1074
               'SourceTimestamp:' + str(self.SourceTimestamp) + ', ' + \
1075 1
               'SourcePicoseconds:' + str(self.SourcePicoseconds) + ', ' + \
1076
               'ServerTimestamp:' + str(self.ServerTimestamp) + ', ' + \
1077
               'ServerPicoseconds:' + str(self.ServerPicoseconds) + ')'
1078
1079
    __repr__ = __str__
1080
1081 1
1082
class TrustListDataType(FrozenClass):
1083
    '''
1084 1 View Code Duplication
    :ivar SpecifiedLists:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1085
    :vartype SpecifiedLists: UInt32
1086
    :ivar TrustedCertificates:
1087
    :vartype TrustedCertificates: ByteString
1088
    :ivar TrustedCrls:
1089
    :vartype TrustedCrls: ByteString
1090
    :ivar IssuerCertificates:
1091 1
    :vartype IssuerCertificates: ByteString
1092
    :ivar IssuerCrls:
1093
    :vartype IssuerCrls: ByteString
1094
    '''
1095 1
1096
    ua_types = (
1097
1098
        ('SpecifiedLists', 'UInt32'),
1099 1
        ('TrustedCertificates', 'ListOfByteString'),
1100
        ('TrustedCrls', 'ListOfByteString'),
1101
        ('IssuerCertificates', 'ListOfByteString'),
1102 1
        ('IssuerCrls', 'ListOfByteString'),
1103
               )
1104
1105 1
    def __init__(self, binary=None):
1106
        if binary is not None:
1107
            self._binary_init(binary)
1108 1
            self._freeze = True
1109
            return
1110
        self.SpecifiedLists = 0
1111
        self.TrustedCertificates = []
1112
        self.TrustedCrls = []
1113
        self.IssuerCertificates = []
1114
        self.IssuerCrls = []
1115
        self._freeze = True
1116 1
1117
    def to_binary(self):
1118
        packet = []
1119
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedLists))
1120
        packet.append(uabin.Primitives.Int32.pack(len(self.TrustedCertificates)))
1121 1
        for fieldname in self.TrustedCertificates:
1122
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
1123
        packet.append(uabin.Primitives.Int32.pack(len(self.TrustedCrls)))
1124
        for fieldname in self.TrustedCrls:
1125
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
1126
        packet.append(uabin.Primitives.Int32.pack(len(self.IssuerCertificates)))
1127
        for fieldname in self.IssuerCertificates:
1128
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
1129
        packet.append(uabin.Primitives.Int32.pack(len(self.IssuerCrls)))
1130 1
        for fieldname in self.IssuerCrls:
1131
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
1132
        return b''.join(packet)
1133
1134
    @staticmethod
1135
    def from_binary(data):
1136 1
        return TrustListDataType(data)
1137
1138
    def _binary_init(self, data):
1139
        self.SpecifiedLists = uabin.Primitives.UInt32.unpack(data)
1140 1
        self.TrustedCertificates = uabin.Primitives.ByteString.unpack_array(data)
1141
        self.TrustedCrls = uabin.Primitives.ByteString.unpack_array(data)
1142
        self.IssuerCertificates = uabin.Primitives.ByteString.unpack_array(data)
1143
        self.IssuerCrls = uabin.Primitives.ByteString.unpack_array(data)
1144 1
1145
    def __str__(self):
1146
        return 'TrustListDataType(' + 'SpecifiedLists:' + str(self.SpecifiedLists) + ', ' + \
1147
               'TrustedCertificates:' + str(self.TrustedCertificates) + ', ' + \
1148 1
               'TrustedCrls:' + str(self.TrustedCrls) + ', ' + \
1149
               'IssuerCertificates:' + str(self.IssuerCertificates) + ', ' + \
1150
               'IssuerCrls:' + str(self.IssuerCrls) + ')'
1151 1
1152
    __repr__ = __str__
1153
1154
1155
class Argument(FrozenClass):
1156
    '''
1157
    An argument for a method.
1158
1159
    :ivar Name:
1160
    :vartype Name: String
1161
    :ivar DataType:
1162
    :vartype DataType: NodeId
1163
    :ivar ValueRank:
1164
    :vartype ValueRank: Int32
1165
    :ivar ArrayDimensions:
1166
    :vartype ArrayDimensions: UInt32
1167
    :ivar Description:
1168
    :vartype Description: LocalizedText
1169
    '''
1170
1171 1
    ua_types = (
1172
1173
        ('Name', 'String'),
1174
        ('DataType', 'NodeId'),
1175
        ('ValueRank', 'Int32'),
1176
        ('ArrayDimensions', 'ListOfUInt32'),
1177
        ('Description', 'LocalizedText'),
1178
               )
1179
1180
    def __init__(self, binary=None):
1181 1
        if binary is not None:
1182 1
            self._binary_init(binary)
1183 1
            self._freeze = True
1184 1
            return
1185 1
        self.Name = None
1186 1
        self.DataType = NodeId()
1187 1
        self.ValueRank = 0
1188 1
        self.ArrayDimensions = []
1189 1
        self.Description = LocalizedText()
1190 1
        self._freeze = True
1191 1
1192 1
    def to_binary(self):
1193 1
        packet = []
1194
        packet.append(uabin.Primitives.String.pack(self.Name))
1195 1
        packet.append(self.DataType.to_binary())
1196 1
        packet.append(uabin.Primitives.Int32.pack(self.ValueRank))
1197 1 View Code Duplication
        packet.append(uabin.Primitives.Int32.pack(len(self.ArrayDimensions)))
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1198 1
        for fieldname in self.ArrayDimensions:
1199 1
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
1200 1
        packet.append(self.Description.to_binary())
1201 1
        return b''.join(packet)
1202 1
1203 1
    @staticmethod
1204 1
    def from_binary(data):
1205 1
        return Argument(data)
1206 1
1207
    def _binary_init(self, data):
1208 1
        self.Name = uabin.Primitives.String.unpack(data)
1209
        self.DataType = NodeId.from_binary(data)
1210 1
        self.ValueRank = uabin.Primitives.Int32.unpack(data)
1211
        self.ArrayDimensions = uabin.Primitives.UInt32.unpack_array(data)
1212 1
        self.Description = LocalizedText.from_binary(data)
1213 1
1214 1
    def __str__(self):
1215 1
        return 'Argument(' + 'Name:' + str(self.Name) + ', ' + \
1216 1
               'DataType:' + str(self.DataType) + ', ' + \
1217 1
               'ValueRank:' + str(self.ValueRank) + ', ' + \
1218 1
               'ArrayDimensions:' + str(self.ArrayDimensions) + ', ' + \
1219 1
               'Description:' + str(self.Description) + ')'
1220
1221 1
    __repr__ = __str__
1222
1223
1224
class EnumValueType(FrozenClass):
1225
    '''
1226
    A mapping between a value of an enumerated type and a name and description.
1227
1228
    :ivar Value:
1229
    :vartype Value: Int64
1230 1
    :ivar DisplayName:
1231
    :vartype DisplayName: LocalizedText
1232
    :ivar Description:
1233 1
    :vartype Description: LocalizedText
1234
    '''
1235
1236
    ua_types = (
1237
1238
        ('Value', 'Int64'),
1239
        ('DisplayName', 'LocalizedText'),
1240
        ('Description', 'LocalizedText'),
1241
               )
1242
1243
    def __init__(self, binary=None):
1244
        if binary is not None:
1245
            self._binary_init(binary)
1246
            self._freeze = True
1247
            return
1248
        self.Value = 0
1249
        self.DisplayName = LocalizedText()
1250
        self.Description = LocalizedText()
1251
        self._freeze = True
1252
1253 1
    def to_binary(self):
1254
        packet = []
1255
        packet.append(uabin.Primitives.Int64.pack(self.Value))
1256
        packet.append(self.DisplayName.to_binary())
1257
        packet.append(self.Description.to_binary())
1258
        return b''.join(packet)
1259
1260
    @staticmethod
1261
    def from_binary(data):
1262
        return EnumValueType(data)
1263 1
1264 1
    def _binary_init(self, data):
1265 1
        self.Value = uabin.Primitives.Int64.unpack(data)
1266 1
        self.DisplayName = LocalizedText.from_binary(data)
1267 1
        self.Description = LocalizedText.from_binary(data)
1268 1
1269 1
    def __str__(self):
1270 1
        return 'EnumValueType(' + 'Value:' + str(self.Value) + ', ' + \
1271 1
               'DisplayName:' + str(self.DisplayName) + ', ' + \
1272 1
               'Description:' + str(self.Description) + ')'
1273 1
1274 1
    __repr__ = __str__
1275 1
1276
1277 1
class OptionSet(FrozenClass):
1278 1
    '''
1279 1
    This abstract Structured DataType is the base DataType for all DataTypes representing a bit mask.
1280 1
1281 1
    :ivar Value:
1282 1
    :vartype Value: ByteString
1283 1
    :ivar ValidBits:
1284 1
    :vartype ValidBits: ByteString
1285 1
    '''
1286 1
1287
    ua_types = (
1288 1
1289
        ('Value', 'ByteString'),
1290 1
        ('ValidBits', 'ByteString'),
1291
               )
1292 1
1293 1
    def __init__(self, binary=None):
1294 1
        if binary is not None:
1295 1
            self._binary_init(binary)
1296 1
            self._freeze = True
1297 1
            return
1298 1
        self.Value = None
1299 1
        self.ValidBits = None
1300
        self._freeze = True
1301 1
1302
    def to_binary(self):
1303
        packet = []
1304
        packet.append(uabin.Primitives.ByteString.pack(self.Value))
1305
        packet.append(uabin.Primitives.ByteString.pack(self.ValidBits))
1306
        return b''.join(packet)
1307
1308
    @staticmethod
1309
    def from_binary(data):
1310 1
        return OptionSet(data)
1311
1312
    def _binary_init(self, data):
1313 1
        self.Value = uabin.Primitives.ByteString.unpack(data)
1314
        self.ValidBits = uabin.Primitives.ByteString.unpack(data)
1315
1316
    def __str__(self):
1317
        return 'OptionSet(' + 'Value:' + str(self.Value) + ', ' + \
1318
               'ValidBits:' + str(self.ValidBits) + ')'
1319
1320
    __repr__ = __str__
1321
1322
1323
class Union(FrozenClass):
1324
    '''
1325
    This abstract DataType is the base DataType for all union DataTypes.
1326
1327
    '''
1328
1329
    ua_types = (
1330
1331 1
               )
1332
1333
    def __init__(self, binary=None):
1334
        if binary is not None:
1335
            self._binary_init(binary)
1336
            self._freeze = True
1337
            return
1338
        self._freeze = True
1339
1340 1
    def to_binary(self):
1341 1
        packet = []
1342 1
        return b''.join(packet)
1343 1
1344 1
    @staticmethod
1345 1
    def from_binary(data):
1346 1
        return Union(data)
1347 1
1348 1
    def _binary_init(self, data):
1349 1
        pass
1350 1
1351 1
    def __str__(self):
1352
        return 'Union(' +  + ')'
1353 1
1354 1
    __repr__ = __str__
1355 1
1356 1
1357 1
class TimeZoneDataType(FrozenClass):
1358 1
    '''
1359 1
    :ivar Offset:
1360 1
    :vartype Offset: Int16
1361
    :ivar DaylightSavingInOffset:
1362 1
    :vartype DaylightSavingInOffset: Boolean
1363 1
    '''
1364
1365 1
    ua_types = (
1366
1367 1
        ('Offset', 'Int16'),
1368
        ('DaylightSavingInOffset', 'Boolean'),
1369 1
               )
1370 1
1371 1
    def __init__(self, binary=None):
1372 1
        if binary is not None:
1373 1
            self._binary_init(binary)
1374 1
            self._freeze = True
1375 1
            return
1376
        self.Offset = 0
1377 1
        self.DaylightSavingInOffset = True
1378
        self._freeze = True
1379
1380
    def to_binary(self):
1381
        packet = []
1382
        packet.append(uabin.Primitives.Int16.pack(self.Offset))
1383
        packet.append(uabin.Primitives.Boolean.pack(self.DaylightSavingInOffset))
1384
        return b''.join(packet)
1385 1
1386
    @staticmethod
1387
    def from_binary(data):
1388 1
        return TimeZoneDataType(data)
1389
1390
    def _binary_init(self, data):
1391
        self.Offset = uabin.Primitives.Int16.unpack(data)
1392
        self.DaylightSavingInOffset = uabin.Primitives.Boolean.unpack(data)
1393
1394
    def __str__(self):
1395
        return 'TimeZoneDataType(' + 'Offset:' + str(self.Offset) + ', ' + \
1396
               'DaylightSavingInOffset:' + str(self.DaylightSavingInOffset) + ')'
1397
1398 1
    __repr__ = __str__
1399
1400
1401
class ApplicationDescription(FrozenClass):
1402
    '''
1403 1
    Describes an application and how to find it.
1404 1
1405
    :ivar ApplicationUri:
1406
    :vartype ApplicationUri: String
1407
    :ivar ProductUri:
1408 1
    :vartype ProductUri: String
1409 1
    :ivar ApplicationName:
1410 1
    :vartype ApplicationName: LocalizedText
1411
    :ivar ApplicationType:
1412 1
    :vartype ApplicationType: ApplicationType
1413 1
    :ivar GatewayServerUri:
1414 1
    :vartype GatewayServerUri: String
1415 1
    :ivar DiscoveryProfileUri:
1416 1
    :vartype DiscoveryProfileUri: String
1417
    :ivar DiscoveryUrls:
1418 1
    :vartype DiscoveryUrls: String
1419
    '''
1420
1421
    ua_types = (
1422 1
1423
        ('ApplicationUri', 'String'),
1424
        ('ProductUri', 'String'),
1425
        ('ApplicationName', 'LocalizedText'),
1426 1
        ('ApplicationType', 'ApplicationType'),
1427
        ('GatewayServerUri', 'String'),
1428
        ('DiscoveryProfileUri', 'String'),
1429
        ('DiscoveryUrls', 'ListOfString'),
1430 1
               )
1431
1432
    def __init__(self, binary=None):
1433 1
        if binary is not None:
1434
            self._binary_init(binary)
1435
            self._freeze = True
1436
            return
1437
        self.ApplicationUri = None
1438
        self.ProductUri = None
1439
        self.ApplicationName = LocalizedText()
1440
        self.ApplicationType = ApplicationType(0)
1441
        self.GatewayServerUri = None
1442
        self.DiscoveryProfileUri = None
1443 1
        self.DiscoveryUrls = []
1444
        self._freeze = True
1445
1446
    def to_binary(self):
1447
        packet = []
1448
        packet.append(uabin.Primitives.String.pack(self.ApplicationUri))
1449 1
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
1450 1
        packet.append(self.ApplicationName.to_binary())
1451 1
        packet.append(uabin.Primitives.UInt32.pack(self.ApplicationType.value))
1452 1
        packet.append(uabin.Primitives.String.pack(self.GatewayServerUri))
1453 1
        packet.append(uabin.Primitives.String.pack(self.DiscoveryProfileUri))
1454 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiscoveryUrls)))
1455 1
        for fieldname in self.DiscoveryUrls:
1456 1
            packet.append(uabin.Primitives.String.pack(fieldname))
1457 1
        return b''.join(packet)
1458
1459 1
    @staticmethod
1460 1
    def from_binary(data):
1461 1
        return ApplicationDescription(data)
1462 1
1463 1
    def _binary_init(self, data):
1464
        self.ApplicationUri = uabin.Primitives.String.unpack(data)
1465 1
        self.ProductUri = uabin.Primitives.String.unpack(data)
1466 1
        self.ApplicationName = LocalizedText.from_binary(data)
1467 1
        self.ApplicationType = ApplicationType(uabin.Primitives.UInt32.unpack(data))
1468 1
        self.GatewayServerUri = uabin.Primitives.String.unpack(data)
1469
        self.DiscoveryProfileUri = uabin.Primitives.String.unpack(data)
1470 1
        self.DiscoveryUrls = uabin.Primitives.String.unpack_array(data)
1471
1472 1
    def __str__(self):
1473
        return 'ApplicationDescription(' + 'ApplicationUri:' + str(self.ApplicationUri) + ', ' + \
1474 1
               'ProductUri:' + str(self.ProductUri) + ', ' + \
1475 1
               'ApplicationName:' + str(self.ApplicationName) + ', ' + \
1476 1
               'ApplicationType:' + str(self.ApplicationType) + ', ' + \
1477 1
               'GatewayServerUri:' + str(self.GatewayServerUri) + ', ' + \
1478
               'DiscoveryProfileUri:' + str(self.DiscoveryProfileUri) + ', ' + \
1479 1
               'DiscoveryUrls:' + str(self.DiscoveryUrls) + ')'
1480
1481
    __repr__ = __str__
1482
1483
1484 1
class RequestHeader(FrozenClass):
1485
    '''
1486
    The header passed with every server request.
1487 1
1488
    :ivar AuthenticationToken:
1489
    :vartype AuthenticationToken: NodeId
1490
    :ivar Timestamp:
1491
    :vartype Timestamp: DateTime
1492
    :ivar RequestHandle:
1493
    :vartype RequestHandle: UInt32
1494
    :ivar ReturnDiagnostics:
1495
    :vartype ReturnDiagnostics: UInt32
1496
    :ivar AuditEntryId:
1497
    :vartype AuditEntryId: String
1498
    :ivar TimeoutHint:
1499 1
    :vartype TimeoutHint: UInt32
1500
    :ivar AdditionalHeader:
1501
    :vartype AdditionalHeader: ExtensionObject
1502
    '''
1503
1504
    ua_types = (
1505 1
1506 1
        ('AuthenticationToken', 'NodeId'),
1507
        ('Timestamp', 'DateTime'),
1508
        ('RequestHandle', 'UInt32'),
1509
        ('ReturnDiagnostics', 'UInt32'),
1510 1
        ('AuditEntryId', 'String'),
1511 1
        ('TimeoutHint', 'UInt32'),
1512 1
        ('AdditionalHeader', 'ExtensionObject'),
1513 1
               )
1514
1515 1
    def __init__(self, binary=None):
1516 1
        if binary is not None:
1517 1
            self._binary_init(binary)
1518 1
            self._freeze = True
1519 1
            return
1520 1
        self.AuthenticationToken = NodeId()
1521
        self.Timestamp = datetime.utcnow()
1522 1
        self.RequestHandle = 0
1523
        self.ReturnDiagnostics = 0
1524
        self.AuditEntryId = None
1525
        self.TimeoutHint = 0
1526 1
        self.AdditionalHeader = None
1527
        self._freeze = True
1528
1529
    def to_binary(self):
1530
        packet = []
1531 1
        packet.append(self.AuthenticationToken.to_binary())
1532
        packet.append(uabin.Primitives.DateTime.pack(self.Timestamp))
1533
        packet.append(uabin.Primitives.UInt32.pack(self.RequestHandle))
1534
        packet.append(uabin.Primitives.UInt32.pack(self.ReturnDiagnostics))
1535
        packet.append(uabin.Primitives.String.pack(self.AuditEntryId))
1536 1
        packet.append(uabin.Primitives.UInt32.pack(self.TimeoutHint))
1537
        packet.append(extensionobject_to_binary(self.AdditionalHeader))
1538
        return b''.join(packet)
1539 1
1540
    @staticmethod
1541
    def from_binary(data):
1542
        return RequestHeader(data)
1543
1544
    def _binary_init(self, data):
1545
        self.AuthenticationToken = NodeId.from_binary(data)
1546
        self.Timestamp = uabin.Primitives.DateTime.unpack(data)
1547
        self.RequestHandle = uabin.Primitives.UInt32.unpack(data)
1548
        self.ReturnDiagnostics = uabin.Primitives.UInt32.unpack(data)
1549
        self.AuditEntryId = uabin.Primitives.String.unpack(data)
1550
        self.TimeoutHint = uabin.Primitives.UInt32.unpack(data)
1551 1
        self.AdditionalHeader = extensionobject_from_binary(data)
1552
1553
    def __str__(self):
1554
        return 'RequestHeader(' + 'AuthenticationToken:' + str(self.AuthenticationToken) + ', ' + \
1555
               'Timestamp:' + str(self.Timestamp) + ', ' + \
1556
               'RequestHandle:' + str(self.RequestHandle) + ', ' + \
1557 1
               'ReturnDiagnostics:' + str(self.ReturnDiagnostics) + ', ' + \
1558 1
               'AuditEntryId:' + str(self.AuditEntryId) + ', ' + \
1559 1
               'TimeoutHint:' + str(self.TimeoutHint) + ', ' + \
1560 1
               'AdditionalHeader:' + str(self.AdditionalHeader) + ')'
1561 1
1562 1
    __repr__ = __str__
1563 1
1564 1
1565 1
class ResponseHeader(FrozenClass):
1566
    '''
1567 1
    The header passed with every server response.
1568 1
1569 1
    :ivar Timestamp:
1570 1
    :vartype Timestamp: DateTime
1571 1
    :ivar RequestHandle:
1572 1
    :vartype RequestHandle: UInt32
1573 1
    :ivar ServiceResult:
1574 1
    :vartype ServiceResult: StatusCode
1575
    :ivar ServiceDiagnostics:
1576 1
    :vartype ServiceDiagnostics: DiagnosticInfo
1577
    :ivar StringTable:
1578 1
    :vartype StringTable: String
1579
    :ivar AdditionalHeader:
1580 1
    :vartype AdditionalHeader: ExtensionObject
1581 1
    '''
1582 1
1583 1
    ua_types = (
1584 1
1585 1
        ('Timestamp', 'DateTime'),
1586 1
        ('RequestHandle', 'UInt32'),
1587 1
        ('ServiceResult', 'StatusCode'),
1588 1
        ('ServiceDiagnostics', 'DiagnosticInfo'),
1589
        ('StringTable', 'ListOfString'),
1590 1
        ('AdditionalHeader', 'ExtensionObject'),
1591
               )
1592
1593
    def __init__(self, binary=None):
1594
        if binary is not None:
1595 1
            self._binary_init(binary)
1596
            self._freeze = True
1597
            return
1598 1
        self.Timestamp = datetime.utcnow()
1599
        self.RequestHandle = 0
1600
        self.ServiceResult = StatusCode()
1601
        self.ServiceDiagnostics = DiagnosticInfo()
1602
        self.StringTable = []
1603
        self.AdditionalHeader = None
1604
        self._freeze = True
1605
1606
    def to_binary(self):
1607 View Code Duplication
        packet = []
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1608
        packet.append(uabin.Primitives.DateTime.pack(self.Timestamp))
1609
        packet.append(uabin.Primitives.UInt32.pack(self.RequestHandle))
1610 1
        packet.append(self.ServiceResult.to_binary())
1611
        packet.append(self.ServiceDiagnostics.to_binary())
1612
        packet.append(uabin.Primitives.Int32.pack(len(self.StringTable)))
1613
        for fieldname in self.StringTable:
1614
            packet.append(uabin.Primitives.String.pack(fieldname))
1615
        packet.append(extensionobject_to_binary(self.AdditionalHeader))
1616
        return b''.join(packet)
1617 1
1618
    @staticmethod
1619
    def from_binary(data):
1620
        return ResponseHeader(data)
1621
1622
    def _binary_init(self, data):
1623
        self.Timestamp = uabin.Primitives.DateTime.unpack(data)
1624
        self.RequestHandle = uabin.Primitives.UInt32.unpack(data)
1625
        self.ServiceResult = StatusCode.from_binary(data)
1626
        self.ServiceDiagnostics = DiagnosticInfo.from_binary(data)
1627
        self.StringTable = uabin.Primitives.String.unpack_array(data)
1628 1
        self.AdditionalHeader = extensionobject_from_binary(data)
1629
1630
    def __str__(self):
1631
        return 'ResponseHeader(' + 'Timestamp:' + str(self.Timestamp) + ', ' + \
1632
               'RequestHandle:' + str(self.RequestHandle) + ', ' + \
1633
               'ServiceResult:' + str(self.ServiceResult) + ', ' + \
1634
               'ServiceDiagnostics:' + str(self.ServiceDiagnostics) + ', ' + \
1635
               'StringTable:' + str(self.StringTable) + ', ' + \
1636
               'AdditionalHeader:' + str(self.AdditionalHeader) + ')'
1637
1638 1
    __repr__ = __str__
1639
1640
1641
class ServiceFault(FrozenClass):
1642 1
    '''
1643
    The response returned by all services when there is a service level error.
1644
1645
    :ivar TypeId:
1646
    :vartype TypeId: NodeId
1647
    :ivar ResponseHeader:
1648 1
    :vartype ResponseHeader: ResponseHeader
1649
    '''
1650
1651
    ua_types = (
1652
1653
        ('TypeId', 'NodeId'),
1654 1
        ('ResponseHeader', 'ResponseHeader'),
1655
               )
1656
1657 1
    def __init__(self, binary=None):
1658
        if binary is not None:
1659
            self._binary_init(binary)
1660
            self._freeze = True
1661
            return
1662
        self.TypeId = FourByteNodeId(ObjectIds.ServiceFault_Encoding_DefaultBinary)
1663
        self.ResponseHeader = ResponseHeader()
1664
        self._freeze = True
1665
1666
    def to_binary(self):
1667 1
        packet = []
1668
        packet.append(self.TypeId.to_binary())
1669
        packet.append(self.ResponseHeader.to_binary())
1670
        return b''.join(packet)
1671
1672
    @staticmethod
1673 1
    def from_binary(data):
1674
        return ServiceFault(data)
1675
1676
    def _binary_init(self, data):
1677
        self.TypeId = NodeId.from_binary(data)
1678
        self.ResponseHeader = ResponseHeader.from_binary(data)
1679
1680
    def __str__(self):
1681
        return 'ServiceFault(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1682
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
1683 1
1684
    __repr__ = __str__
1685
1686
1687
class FindServersParameters(FrozenClass):
1688
    '''
1689
    :ivar EndpointUrl:
1690
    :vartype EndpointUrl: String
1691
    :ivar LocaleIds:
1692 1
    :vartype LocaleIds: String
1693
    :ivar ServerUris:
1694
    :vartype ServerUris: String
1695
    '''
1696 1
1697
    ua_types = (
1698
1699
        ('EndpointUrl', 'String'),
1700
        ('LocaleIds', 'ListOfString'),
1701 1
        ('ServerUris', 'ListOfString'),
1702
               )
1703
1704
    def __init__(self, binary=None):
1705
        if binary is not None:
1706 1
            self._binary_init(binary)
1707
            self._freeze = True
1708
            return
1709 1
        self.EndpointUrl = None
1710
        self.LocaleIds = []
1711
        self.ServerUris = []
1712
        self._freeze = True
1713
1714
    def to_binary(self):
1715
        packet = []
1716
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
1717
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
1718
        for fieldname in self.LocaleIds:
1719 1
            packet.append(uabin.Primitives.String.pack(fieldname))
1720
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerUris)))
1721
        for fieldname in self.ServerUris:
1722
            packet.append(uabin.Primitives.String.pack(fieldname))
1723
        return b''.join(packet)
1724
1725 1
    @staticmethod
1726
    def from_binary(data):
1727
        return FindServersParameters(data)
1728
1729
    def _binary_init(self, data):
1730
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
1731
        self.LocaleIds = uabin.Primitives.String.unpack_array(data)
1732
        self.ServerUris = uabin.Primitives.String.unpack_array(data)
1733
1734
    def __str__(self):
1735 1
        return 'FindServersParameters(' + 'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
1736
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
1737
               'ServerUris:' + str(self.ServerUris) + ')'
1738
1739
    __repr__ = __str__
1740
1741
1742 1
class FindServersRequest(FrozenClass):
1743
    '''
1744
    Finds the servers known to the discovery server.
1745
1746 1
    :ivar TypeId:
1747
    :vartype TypeId: NodeId
1748
    :ivar RequestHeader:
1749
    :vartype RequestHeader: RequestHeader
1750
    :ivar Parameters:
1751 1
    :vartype Parameters: FindServersParameters
1752
    '''
1753
1754
    ua_types = (
1755
1756 1
        ('TypeId', 'NodeId'),
1757
        ('RequestHeader', 'RequestHeader'),
1758
        ('Parameters', 'FindServersParameters'),
1759 1
               )
1760
1761
    def __init__(self, binary=None):
1762
        if binary is not None:
1763
            self._binary_init(binary)
1764
            self._freeze = True
1765
            return
1766
        self.TypeId = FourByteNodeId(ObjectIds.FindServersRequest_Encoding_DefaultBinary)
1767 1
        self.RequestHeader = RequestHeader()
1768
        self.Parameters = FindServersParameters()
1769
        self._freeze = True
1770
1771
    def to_binary(self):
1772 1
        packet = []
1773
        packet.append(self.TypeId.to_binary())
1774
        packet.append(self.RequestHeader.to_binary())
1775
        packet.append(self.Parameters.to_binary())
1776
        return b''.join(packet)
1777
1778
    @staticmethod
1779
    def from_binary(data):
1780
        return FindServersRequest(data)
1781 1
1782
    def _binary_init(self, data):
1783
        self.TypeId = NodeId.from_binary(data)
1784
        self.RequestHeader = RequestHeader.from_binary(data)
1785
        self.Parameters = FindServersParameters.from_binary(data)
1786
1787
    def __str__(self):
1788
        return 'FindServersRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1789 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
1790
               'Parameters:' + str(self.Parameters) + ')'
1791
1792
    __repr__ = __str__
1793 1
1794
1795
class FindServersResponse(FrozenClass):
1796
    '''
1797
    Finds the servers known to the discovery server.
1798
1799
    :ivar TypeId:
1800
    :vartype TypeId: NodeId
1801
    :ivar ResponseHeader:
1802 1
    :vartype ResponseHeader: ResponseHeader
1803
    :ivar Servers:
1804
    :vartype Servers: ApplicationDescription
1805
    '''
1806 1
1807
    ua_types = (
1808
1809 1
        ('TypeId', 'NodeId'),
1810
        ('ResponseHeader', 'ResponseHeader'),
1811
        ('Servers', 'ListOfApplicationDescription'),
1812
               )
1813
1814
    def __init__(self, binary=None):
1815
        if binary is not None:
1816
            self._binary_init(binary)
1817
            self._freeze = True
1818
            return
1819 1
        self.TypeId = FourByteNodeId(ObjectIds.FindServersResponse_Encoding_DefaultBinary)
1820
        self.ResponseHeader = ResponseHeader()
1821
        self.Servers = []
1822
        self._freeze = True
1823
1824
    def to_binary(self):
1825 1
        packet = []
1826
        packet.append(self.TypeId.to_binary())
1827
        packet.append(self.ResponseHeader.to_binary())
1828
        packet.append(uabin.Primitives.Int32.pack(len(self.Servers)))
1829
        for fieldname in self.Servers:
1830
            packet.append(fieldname.to_binary())
1831
        return b''.join(packet)
1832
1833
    @staticmethod
1834
    def from_binary(data):
1835 1
        return FindServersResponse(data)
1836
1837
    def _binary_init(self, data):
1838
        self.TypeId = NodeId.from_binary(data)
1839
        self.ResponseHeader = ResponseHeader.from_binary(data)
1840
        length = uabin.Primitives.Int32.unpack(data)
1841
        array = []
1842 1
        if length != -1:
1843
            for _ in range(0, length):
1844
                array.append(ApplicationDescription.from_binary(data))
1845
        self.Servers = array
1846 1
1847
    def __str__(self):
1848
        return 'FindServersResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1849
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
1850
               'Servers:' + str(self.Servers) + ')'
1851 1
1852
    __repr__ = __str__
1853
1854
1855
class ServerOnNetwork(FrozenClass):
1856 1
    '''
1857
    :ivar RecordId:
1858
    :vartype RecordId: UInt32
1859 1
    :ivar ServerName:
1860
    :vartype ServerName: String
1861
    :ivar DiscoveryUrl:
1862
    :vartype DiscoveryUrl: String
1863
    :ivar ServerCapabilities:
1864
    :vartype ServerCapabilities: String
1865
    '''
1866
1867
    ua_types = (
1868 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1869
        ('RecordId', 'UInt32'),
1870
        ('ServerName', 'String'),
1871
        ('DiscoveryUrl', 'String'),
1872
        ('ServerCapabilities', 'ListOfString'),
1873
               )
1874
1875 1
    def __init__(self, binary=None):
1876
        if binary is not None:
1877
            self._binary_init(binary)
1878
            self._freeze = True
1879
            return
1880
        self.RecordId = 0
1881
        self.ServerName = None
1882
        self.DiscoveryUrl = None
1883 1
        self.ServerCapabilities = []
1884 1
        self._freeze = True
1885 1
1886 1
    def to_binary(self):
1887 1
        packet = []
1888 1
        packet.append(uabin.Primitives.UInt32.pack(self.RecordId))
1889 1
        packet.append(uabin.Primitives.String.pack(self.ServerName))
1890 1
        packet.append(uabin.Primitives.String.pack(self.DiscoveryUrl))
1891 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerCapabilities)))
1892 1
        for fieldname in self.ServerCapabilities:
1893 1
            packet.append(uabin.Primitives.String.pack(fieldname))
1894
        return b''.join(packet)
1895 1
1896 1
    @staticmethod
1897 1
    def from_binary(data):
1898 1
        return ServerOnNetwork(data)
1899 1
1900 1
    def _binary_init(self, data):
1901 1
        self.RecordId = uabin.Primitives.UInt32.unpack(data)
1902 1
        self.ServerName = uabin.Primitives.String.unpack(data)
1903
        self.DiscoveryUrl = uabin.Primitives.String.unpack(data)
1904 1
        self.ServerCapabilities = uabin.Primitives.String.unpack_array(data)
1905
1906 1
    def __str__(self):
1907
        return 'ServerOnNetwork(' + 'RecordId:' + str(self.RecordId) + ', ' + \
1908 1
               'ServerName:' + str(self.ServerName) + ', ' + \
1909 1
               'DiscoveryUrl:' + str(self.DiscoveryUrl) + ', ' + \
1910 1
               'ServerCapabilities:' + str(self.ServerCapabilities) + ')'
1911 1
1912 1
    __repr__ = __str__
1913 1
1914
1915 1
class FindServersOnNetworkParameters(FrozenClass):
1916
    '''
1917
    :ivar StartingRecordId:
1918
    :vartype StartingRecordId: UInt32
1919
    :ivar MaxRecordsToReturn:
1920
    :vartype MaxRecordsToReturn: UInt32
1921
    :ivar ServerCapabilityFilter:
1922 1
    :vartype ServerCapabilityFilter: String
1923
    '''
1924
1925 1
    ua_types = (
1926
1927
        ('StartingRecordId', 'UInt32'),
1928
        ('MaxRecordsToReturn', 'UInt32'),
1929
        ('ServerCapabilityFilter', 'ListOfString'),
1930
               )
1931
1932
    def __init__(self, binary=None):
1933
        if binary is not None:
1934
            self._binary_init(binary)
1935
            self._freeze = True
1936
            return
1937
        self.StartingRecordId = 0
1938
        self.MaxRecordsToReturn = 0
1939
        self.ServerCapabilityFilter = []
1940
        self._freeze = True
1941
1942
    def to_binary(self):
1943
        packet = []
1944
        packet.append(uabin.Primitives.UInt32.pack(self.StartingRecordId))
1945
        packet.append(uabin.Primitives.UInt32.pack(self.MaxRecordsToReturn))
1946
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerCapabilityFilter)))
1947 1
        for fieldname in self.ServerCapabilityFilter:
1948
            packet.append(uabin.Primitives.String.pack(fieldname))
1949
        return b''.join(packet)
1950
1951
    @staticmethod
1952
    def from_binary(data):
1953
        return FindServersOnNetworkParameters(data)
1954
1955
    def _binary_init(self, data):
1956
        self.StartingRecordId = uabin.Primitives.UInt32.unpack(data)
1957
        self.MaxRecordsToReturn = uabin.Primitives.UInt32.unpack(data)
1958 1
        self.ServerCapabilityFilter = uabin.Primitives.String.unpack_array(data)
1959 1
1960 1
    def __str__(self):
1961 1
        return 'FindServersOnNetworkParameters(' + 'StartingRecordId:' + str(self.StartingRecordId) + ', ' + \
1962 1
               'MaxRecordsToReturn:' + str(self.MaxRecordsToReturn) + ', ' + \
1963 1
               'ServerCapabilityFilter:' + str(self.ServerCapabilityFilter) + ')'
1964 1
1965 1
    __repr__ = __str__
1966 1
1967 1
1968 1
class FindServersOnNetworkRequest(FrozenClass):
1969 1
    '''
1970 1
    :ivar TypeId:
1971 1
    :vartype TypeId: NodeId
1972
    :ivar RequestHeader:
1973 1
    :vartype RequestHeader: RequestHeader
1974 1
    :ivar Parameters:
1975 1 View Code Duplication
    :vartype Parameters: FindServersOnNetworkParameters
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1976 1
    '''
1977 1
1978 1
    ua_types = (
1979 1
1980 1
        ('TypeId', 'NodeId'),
1981 1
        ('RequestHeader', 'RequestHeader'),
1982 1
        ('Parameters', 'FindServersOnNetworkParameters'),
1983 1
               )
1984 1
1985 1
    def __init__(self, binary=None):
1986
        if binary is not None:
1987 1
            self._binary_init(binary)
1988
            self._freeze = True
1989 1
            return
1990
        self.TypeId = FourByteNodeId(ObjectIds.FindServersOnNetworkRequest_Encoding_DefaultBinary)
1991 1
        self.RequestHeader = RequestHeader()
1992 1
        self.Parameters = FindServersOnNetworkParameters()
1993 1 View Code Duplication
        self._freeze = True
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1994 1
1995 1
    def to_binary(self):
1996 1
        packet = []
1997 1
        packet.append(self.TypeId.to_binary())
1998 1
        packet.append(self.RequestHeader.to_binary())
1999 1
        packet.append(self.Parameters.to_binary())
2000 1
        return b''.join(packet)
2001 1
2002 1
    @staticmethod
2003 1
    def from_binary(data):
2004 1
        return FindServersOnNetworkRequest(data)
2005
2006 1
    def _binary_init(self, data):
2007
        self.TypeId = NodeId.from_binary(data)
2008
        self.RequestHeader = RequestHeader.from_binary(data)
2009
        self.Parameters = FindServersOnNetworkParameters.from_binary(data)
2010
2011
    def __str__(self):
2012
        return 'FindServersOnNetworkRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2013
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2014
               'Parameters:' + str(self.Parameters) + ')'
2015
2016 1
    __repr__ = __str__
2017
2018
2019 1
class FindServersOnNetworkResult(FrozenClass):
2020
    '''
2021
    :ivar LastCounterResetTime:
2022
    :vartype LastCounterResetTime: DateTime
2023
    :ivar Servers:
2024
    :vartype Servers: ServerOnNetwork
2025
    '''
2026
2027
    ua_types = (
2028
2029 1
        ('LastCounterResetTime', 'DateTime'),
2030
        ('Servers', 'ListOfServerOnNetwork'),
2031
               )
2032
2033
    def __init__(self, binary=None):
2034
        if binary is not None:
2035 1
            self._binary_init(binary)
2036 1
            self._freeze = True
2037 1
            return
2038 1
        self.LastCounterResetTime = datetime.utcnow()
2039 1
        self.Servers = []
2040 1
        self._freeze = True
2041 1
2042 1
    def to_binary(self):
2043 1
        packet = []
2044
        packet.append(uabin.Primitives.DateTime.pack(self.LastCounterResetTime))
2045 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Servers)))
2046 1
        for fieldname in self.Servers:
2047 1
            packet.append(fieldname.to_binary())
2048 1
        return b''.join(packet)
2049 1
2050
    @staticmethod
2051 1
    def from_binary(data):
2052 1
        return FindServersOnNetworkResult(data)
2053
2054 1
    def _binary_init(self, data):
2055
        self.LastCounterResetTime = uabin.Primitives.DateTime.unpack(data)
2056 1
        length = uabin.Primitives.Int32.unpack(data)
2057
        array = []
2058 1
        if length != -1:
2059
            for _ in range(0, length):
2060 1
                array.append(ServerOnNetwork.from_binary(data))
2061 1
        self.Servers = array
2062 1
2063 1
    def __str__(self):
2064
        return 'FindServersOnNetworkResult(' + 'LastCounterResetTime:' + str(self.LastCounterResetTime) + ', ' + \
2065 1
               'Servers:' + str(self.Servers) + ')'
2066
2067
    __repr__ = __str__
2068
2069
2070 1
class FindServersOnNetworkResponse(FrozenClass):
2071
    '''
2072
    :ivar TypeId:
2073 1
    :vartype TypeId: NodeId
2074
    :ivar ResponseHeader:
2075
    :vartype ResponseHeader: ResponseHeader
2076
    :ivar Parameters:
2077
    :vartype Parameters: FindServersOnNetworkResult
2078
    '''
2079
2080
    ua_types = (
2081
2082
        ('TypeId', 'NodeId'),
2083
        ('ResponseHeader', 'ResponseHeader'),
2084
        ('Parameters', 'FindServersOnNetworkResult'),
2085 1
               )
2086
2087
    def __init__(self, binary=None):
2088
        if binary is not None:
2089
            self._binary_init(binary)
2090
            self._freeze = True
2091 1
            return
2092 1
        self.TypeId = FourByteNodeId(ObjectIds.FindServersOnNetworkResponse_Encoding_DefaultBinary)
2093
        self.ResponseHeader = ResponseHeader()
2094
        self.Parameters = FindServersOnNetworkResult()
2095
        self._freeze = True
2096 1
2097 1
    def to_binary(self):
2098 1
        packet = []
2099 1
        packet.append(self.TypeId.to_binary())
2100
        packet.append(self.ResponseHeader.to_binary())
2101 1
        packet.append(self.Parameters.to_binary())
2102 1
        return b''.join(packet)
2103 1
2104 1
    @staticmethod
2105 1
    def from_binary(data):
2106 1
        return FindServersOnNetworkResponse(data)
2107
2108 1
    def _binary_init(self, data):
2109
        self.TypeId = NodeId.from_binary(data)
2110
        self.ResponseHeader = ResponseHeader.from_binary(data)
2111
        self.Parameters = FindServersOnNetworkResult.from_binary(data)
2112 1
2113
    def __str__(self):
2114
        return 'FindServersOnNetworkResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2115
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
2116
               'Parameters:' + str(self.Parameters) + ')'
2117 1
2118
    __repr__ = __str__
2119
2120
2121
class UserTokenPolicy(FrozenClass):
2122 1
    '''
2123
    Describes a user token that can be used with a server.
2124
2125 1
    :ivar PolicyId:
2126
    :vartype PolicyId: String
2127
    :ivar TokenType:
2128
    :vartype TokenType: UserTokenType
2129
    :ivar IssuedTokenType:
2130
    :vartype IssuedTokenType: String
2131
    :ivar IssuerEndpointUrl:
2132
    :vartype IssuerEndpointUrl: String
2133
    :ivar SecurityPolicyUri:
2134
    :vartype SecurityPolicyUri: String
2135
    '''
2136
2137 1
    ua_types = (
2138
2139
        ('PolicyId', 'String'),
2140
        ('TokenType', 'UserTokenType'),
2141
        ('IssuedTokenType', 'String'),
2142
        ('IssuerEndpointUrl', 'String'),
2143 1
        ('SecurityPolicyUri', 'String'),
2144 1
               )
2145 1
2146 1
    def __init__(self, binary=None):
2147 1
        if binary is not None:
2148 1
            self._binary_init(binary)
2149 1
            self._freeze = True
2150 1
            return
2151 1
        self.PolicyId = None
2152
        self.TokenType = UserTokenType(0)
2153 1
        self.IssuedTokenType = None
2154 1
        self.IssuerEndpointUrl = None
2155 1
        self.SecurityPolicyUri = None
2156 1
        self._freeze = True
2157 1
2158 1
    def to_binary(self):
2159 1
        packet = []
2160 1
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
2161
        packet.append(uabin.Primitives.UInt32.pack(self.TokenType.value))
2162 1
        packet.append(uabin.Primitives.String.pack(self.IssuedTokenType))
2163
        packet.append(uabin.Primitives.String.pack(self.IssuerEndpointUrl))
2164 1
        packet.append(uabin.Primitives.String.pack(self.SecurityPolicyUri))
2165
        return b''.join(packet)
2166 1
2167 1
    @staticmethod
2168 1
    def from_binary(data):
2169 1
        return UserTokenPolicy(data)
2170 1
2171 1
    def _binary_init(self, data):
2172 1
        self.PolicyId = uabin.Primitives.String.unpack(data)
2173 1
        self.TokenType = UserTokenType(uabin.Primitives.UInt32.unpack(data))
2174 1
        self.IssuedTokenType = uabin.Primitives.String.unpack(data)
2175
        self.IssuerEndpointUrl = uabin.Primitives.String.unpack(data)
2176 1
        self.SecurityPolicyUri = uabin.Primitives.String.unpack(data)
2177
2178
    def __str__(self):
2179
        return 'UserTokenPolicy(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
2180
               'TokenType:' + str(self.TokenType) + ', ' + \
2181 1
               'IssuedTokenType:' + str(self.IssuedTokenType) + ', ' + \
2182
               'IssuerEndpointUrl:' + str(self.IssuerEndpointUrl) + ', ' + \
2183
               'SecurityPolicyUri:' + str(self.SecurityPolicyUri) + ')'
2184 1
2185
    __repr__ = __str__
2186
2187
2188
class EndpointDescription(FrozenClass):
2189
    '''
2190
    The description of a endpoint that can be used to access a server.
2191
2192
    :ivar EndpointUrl:
2193
    :vartype EndpointUrl: String
2194
    :ivar Server:
2195
    :vartype Server: ApplicationDescription
2196
    :ivar ServerCertificate:
2197
    :vartype ServerCertificate: ByteString
2198
    :ivar SecurityMode:
2199
    :vartype SecurityMode: MessageSecurityMode
2200
    :ivar SecurityPolicyUri:
2201
    :vartype SecurityPolicyUri: String
2202
    :ivar UserIdentityTokens:
2203
    :vartype UserIdentityTokens: UserTokenPolicy
2204
    :ivar TransportProfileUri:
2205
    :vartype TransportProfileUri: String
2206 1
    :ivar SecurityLevel:
2207
    :vartype SecurityLevel: Byte
2208
    '''
2209
2210
    ua_types = (
2211
2212
        ('EndpointUrl', 'String'),
2213
        ('Server', 'ApplicationDescription'),
2214
        ('ServerCertificate', 'ByteString'),
2215
        ('SecurityMode', 'MessageSecurityMode'),
2216
        ('SecurityPolicyUri', 'String'),
2217 1
        ('UserIdentityTokens', 'ListOfUserTokenPolicy'),
2218 1
        ('TransportProfileUri', 'String'),
2219 1
        ('SecurityLevel', 'Byte'),
2220 1
               )
2221 1
2222 1
    def __init__(self, binary=None):
2223 1
        if binary is not None:
2224 1
            self._binary_init(binary)
2225 1
            self._freeze = True
2226 1
            return
2227 1
        self.EndpointUrl = None
2228 1
        self.Server = ApplicationDescription()
2229 1
        self.ServerCertificate = None
2230 1
        self.SecurityMode = MessageSecurityMode(0)
2231
        self.SecurityPolicyUri = None
2232 1
        self.UserIdentityTokens = []
2233 1
        self.TransportProfileUri = None
2234 1
        self.SecurityLevel = 0
2235 1
        self._freeze = True
2236 1
2237 1
    def to_binary(self):
2238 1
        packet = []
2239 1
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
2240 1
        packet.append(self.Server.to_binary())
2241 1
        packet.append(uabin.Primitives.ByteString.pack(self.ServerCertificate))
2242 1
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityMode.value))
2243 1
        packet.append(uabin.Primitives.String.pack(self.SecurityPolicyUri))
2244 1
        packet.append(uabin.Primitives.Int32.pack(len(self.UserIdentityTokens)))
2245 1
        for fieldname in self.UserIdentityTokens:
2246 1
            packet.append(fieldname.to_binary())
2247
        packet.append(uabin.Primitives.String.pack(self.TransportProfileUri))
2248 1
        packet.append(uabin.Primitives.Byte.pack(self.SecurityLevel))
2249
        return b''.join(packet)
2250 1
2251
    @staticmethod
2252 1
    def from_binary(data):
2253 1
        return EndpointDescription(data)
2254 1 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2255 1
    def _binary_init(self, data):
2256 1
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
2257 1
        self.Server = ApplicationDescription.from_binary(data)
2258 1
        self.ServerCertificate = uabin.Primitives.ByteString.unpack(data)
2259 1
        self.SecurityMode = MessageSecurityMode(uabin.Primitives.UInt32.unpack(data))
2260 1
        self.SecurityPolicyUri = uabin.Primitives.String.unpack(data)
2261 1
        length = uabin.Primitives.Int32.unpack(data)
2262 1
        array = []
2263 1
        if length != -1:
2264 1
            for _ in range(0, length):
2265 1
                array.append(UserTokenPolicy.from_binary(data))
2266
        self.UserIdentityTokens = array
2267 1
        self.TransportProfileUri = uabin.Primitives.String.unpack(data)
2268
        self.SecurityLevel = uabin.Primitives.Byte.unpack(data)
2269
2270
    def __str__(self):
2271
        return 'EndpointDescription(' + 'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
2272
               'Server:' + str(self.Server) + ', ' + \
2273
               'ServerCertificate:' + str(self.ServerCertificate) + ', ' + \
2274
               'SecurityMode:' + str(self.SecurityMode) + ', ' + \
2275
               'SecurityPolicyUri:' + str(self.SecurityPolicyUri) + ', ' + \
2276
               'UserIdentityTokens:' + str(self.UserIdentityTokens) + ', ' + \
2277 1
               'TransportProfileUri:' + str(self.TransportProfileUri) + ', ' + \
2278
               'SecurityLevel:' + str(self.SecurityLevel) + ')'
2279
2280 1
    __repr__ = __str__
2281
2282
2283
class GetEndpointsParameters(FrozenClass):
2284
    '''
2285
    :ivar EndpointUrl:
2286
    :vartype EndpointUrl: String
2287
    :ivar LocaleIds:
2288
    :vartype LocaleIds: String
2289
    :ivar ProfileUris:
2290
    :vartype ProfileUris: String
2291
    '''
2292 1
2293
    ua_types = (
2294
2295
        ('EndpointUrl', 'String'),
2296
        ('LocaleIds', 'ListOfString'),
2297
        ('ProfileUris', 'ListOfString'),
2298 1
               )
2299 1
2300
    def __init__(self, binary=None):
2301
        if binary is not None:
2302
            self._binary_init(binary)
2303 1
            self._freeze = True
2304 1
            return
2305 1
        self.EndpointUrl = None
2306 1
        self.LocaleIds = []
2307
        self.ProfileUris = []
2308 1
        self._freeze = True
2309 1
2310 1
    def to_binary(self):
2311 1
        packet = []
2312 1
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
2313 1
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
2314
        for fieldname in self.LocaleIds:
2315 1
            packet.append(uabin.Primitives.String.pack(fieldname))
2316
        packet.append(uabin.Primitives.Int32.pack(len(self.ProfileUris)))
2317
        for fieldname in self.ProfileUris:
2318
            packet.append(uabin.Primitives.String.pack(fieldname))
2319 1
        return b''.join(packet)
2320
2321
    @staticmethod
2322
    def from_binary(data):
2323
        return GetEndpointsParameters(data)
2324 1
2325
    def _binary_init(self, data):
2326
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
2327
        self.LocaleIds = uabin.Primitives.String.unpack_array(data)
2328
        self.ProfileUris = uabin.Primitives.String.unpack_array(data)
2329 1
2330
    def __str__(self):
2331
        return 'GetEndpointsParameters(' + 'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
2332 1
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
2333
               'ProfileUris:' + str(self.ProfileUris) + ')'
2334
2335
    __repr__ = __str__
2336
2337
2338
class GetEndpointsRequest(FrozenClass):
2339
    '''
2340
    Gets the endpoints used by the server.
2341
2342 1
    :ivar TypeId:
2343
    :vartype TypeId: NodeId
2344
    :ivar RequestHeader:
2345
    :vartype RequestHeader: RequestHeader
2346
    :ivar Parameters:
2347 1
    :vartype Parameters: GetEndpointsParameters
2348 1
    '''
2349 1
2350 1
    ua_types = (
2351 1
2352 1
        ('TypeId', 'NodeId'),
2353 1
        ('RequestHeader', 'RequestHeader'),
2354 1
        ('Parameters', 'GetEndpointsParameters'),
2355
               )
2356 1
2357 1
    def __init__(self, binary=None):
2358 1
        if binary is not None:
2359 1
            self._binary_init(binary)
2360 1
            self._freeze = True
2361
            return
2362 1
        self.TypeId = FourByteNodeId(ObjectIds.GetEndpointsRequest_Encoding_DefaultBinary)
2363
        self.RequestHeader = RequestHeader()
2364 1
        self.Parameters = GetEndpointsParameters()
2365
        self._freeze = True
2366 1
2367 1
    def to_binary(self):
2368 1
        packet = []
2369
        packet.append(self.TypeId.to_binary())
2370 1
        packet.append(self.RequestHeader.to_binary())
2371
        packet.append(self.Parameters.to_binary())
2372
        return b''.join(packet)
2373
2374 1
    @staticmethod
2375
    def from_binary(data):
2376
        return GetEndpointsRequest(data)
2377 1
2378
    def _binary_init(self, data):
2379
        self.TypeId = NodeId.from_binary(data)
2380
        self.RequestHeader = RequestHeader.from_binary(data)
2381
        self.Parameters = GetEndpointsParameters.from_binary(data)
2382
2383 1
    def __str__(self):
2384
        return 'GetEndpointsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2385
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2386 1 View Code Duplication
               'Parameters:' + str(self.Parameters) + ')'
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2387
2388
    __repr__ = __str__
2389
2390
2391
class GetEndpointsResponse(FrozenClass):
2392
    '''
2393 1
    Gets the endpoints used by the server.
2394
2395
    :ivar TypeId:
2396
    :vartype TypeId: NodeId
2397 1
    :ivar ResponseHeader:
2398
    :vartype ResponseHeader: ResponseHeader
2399
    :ivar Endpoints:
2400
    :vartype Endpoints: EndpointDescription
2401 1
    '''
2402
2403
    ua_types = (
2404 1
2405
        ('TypeId', 'NodeId'),
2406
        ('ResponseHeader', 'ResponseHeader'),
2407 1
        ('Endpoints', 'ListOfEndpointDescription'),
2408
               )
2409
2410 1
    def __init__(self, binary=None):
2411
        if binary is not None:
2412
            self._binary_init(binary)
2413
            self._freeze = True
2414
            return
2415
        self.TypeId = FourByteNodeId(ObjectIds.GetEndpointsResponse_Encoding_DefaultBinary)
2416
        self.ResponseHeader = ResponseHeader()
2417
        self.Endpoints = []
2418
        self._freeze = True
2419
2420 1
    def to_binary(self):
2421
        packet = []
2422
        packet.append(self.TypeId.to_binary())
2423
        packet.append(self.ResponseHeader.to_binary())
2424
        packet.append(uabin.Primitives.Int32.pack(len(self.Endpoints)))
2425 1
        for fieldname in self.Endpoints:
2426
            packet.append(fieldname.to_binary())
2427
        return b''.join(packet)
2428
2429
    @staticmethod
2430
    def from_binary(data):
2431
        return GetEndpointsResponse(data)
2432
2433
    def _binary_init(self, data):
2434 1
        self.TypeId = NodeId.from_binary(data)
2435
        self.ResponseHeader = ResponseHeader.from_binary(data)
2436
        length = uabin.Primitives.Int32.unpack(data)
2437
        array = []
2438
        if length != -1:
2439
            for _ in range(0, length):
2440
                array.append(EndpointDescription.from_binary(data))
2441
        self.Endpoints = array
2442 1
2443
    def __str__(self):
2444
        return 'GetEndpointsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2445
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
2446 1
               'Endpoints:' + str(self.Endpoints) + ')'
2447
2448
    __repr__ = __str__
2449
2450 1
2451
class RegisteredServer(FrozenClass):
2452
    '''
2453
    The information required to register a server with a discovery server.
2454 1
2455
    :ivar ServerUri:
2456
    :vartype ServerUri: String
2457 1
    :ivar ProductUri:
2458
    :vartype ProductUri: String
2459
    :ivar ServerNames:
2460
    :vartype ServerNames: LocalizedText
2461
    :ivar ServerType:
2462
    :vartype ServerType: ApplicationType
2463
    :ivar GatewayServerUri:
2464
    :vartype GatewayServerUri: String
2465 1
    :ivar DiscoveryUrls:
2466
    :vartype DiscoveryUrls: String
2467
    :ivar SemaphoreFilePath:
2468
    :vartype SemaphoreFilePath: String
2469
    :ivar IsOnline:
2470 1
    :vartype IsOnline: Boolean
2471
    '''
2472
2473
    ua_types = (
2474
2475
        ('ServerUri', 'String'),
2476
        ('ProductUri', 'String'),
2477
        ('ServerNames', 'ListOfLocalizedText'),
2478
        ('ServerType', 'ApplicationType'),
2479 1
        ('GatewayServerUri', 'String'),
2480
        ('DiscoveryUrls', 'ListOfString'),
2481
        ('SemaphoreFilePath', 'String'),
2482
        ('IsOnline', 'Boolean'),
2483
               )
2484
2485
    def __init__(self, binary=None):
2486
        if binary is not None:
2487 1
            self._binary_init(binary)
2488
            self._freeze = True
2489
            return
2490
        self.ServerUri = None
2491 1
        self.ProductUri = None
2492
        self.ServerNames = []
2493
        self.ServerType = ApplicationType(0)
2494
        self.GatewayServerUri = None
2495
        self.DiscoveryUrls = []
2496
        self.SemaphoreFilePath = None
2497
        self.IsOnline = True
2498
        self._freeze = True
2499
2500 1
    def to_binary(self):
2501
        packet = []
2502
        packet.append(uabin.Primitives.String.pack(self.ServerUri))
2503
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
2504 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerNames)))
2505
        for fieldname in self.ServerNames:
2506
            packet.append(fieldname.to_binary())
2507 1
        packet.append(uabin.Primitives.UInt32.pack(self.ServerType.value))
2508
        packet.append(uabin.Primitives.String.pack(self.GatewayServerUri))
2509
        packet.append(uabin.Primitives.Int32.pack(len(self.DiscoveryUrls)))
2510
        for fieldname in self.DiscoveryUrls:
2511
            packet.append(uabin.Primitives.String.pack(fieldname))
2512
        packet.append(uabin.Primitives.String.pack(self.SemaphoreFilePath))
2513
        packet.append(uabin.Primitives.Boolean.pack(self.IsOnline))
2514
        return b''.join(packet)
2515
2516
    @staticmethod
2517 1
    def from_binary(data):
2518
        return RegisteredServer(data)
2519
2520
    def _binary_init(self, data):
2521
        self.ServerUri = uabin.Primitives.String.unpack(data)
2522
        self.ProductUri = uabin.Primitives.String.unpack(data)
2523 1
        length = uabin.Primitives.Int32.unpack(data)
2524
        array = []
2525
        if length != -1:
2526
            for _ in range(0, length):
2527
                array.append(LocalizedText.from_binary(data))
2528
        self.ServerNames = array
2529
        self.ServerType = ApplicationType(uabin.Primitives.UInt32.unpack(data))
2530
        self.GatewayServerUri = uabin.Primitives.String.unpack(data)
2531
        self.DiscoveryUrls = uabin.Primitives.String.unpack_array(data)
2532
        self.SemaphoreFilePath = uabin.Primitives.String.unpack(data)
2533 1
        self.IsOnline = uabin.Primitives.Boolean.unpack(data)
2534
2535
    def __str__(self):
2536
        return 'RegisteredServer(' + 'ServerUri:' + str(self.ServerUri) + ', ' + \
2537
               'ProductUri:' + str(self.ProductUri) + ', ' + \
2538
               'ServerNames:' + str(self.ServerNames) + ', ' + \
2539
               'ServerType:' + str(self.ServerType) + ', ' + \
2540 1
               'GatewayServerUri:' + str(self.GatewayServerUri) + ', ' + \
2541
               'DiscoveryUrls:' + str(self.DiscoveryUrls) + ', ' + \
2542
               'SemaphoreFilePath:' + str(self.SemaphoreFilePath) + ', ' + \
2543
               'IsOnline:' + str(self.IsOnline) + ')'
2544 1
2545
    __repr__ = __str__
2546
2547
2548
class RegisterServerRequest(FrozenClass):
2549 1
    '''
2550
    Registers a server with the discovery server.
2551
2552
    :ivar TypeId:
2553
    :vartype TypeId: NodeId
2554 1
    :ivar RequestHeader:
2555
    :vartype RequestHeader: RequestHeader
2556
    :ivar Server:
2557 1
    :vartype Server: RegisteredServer
2558
    '''
2559
2560
    ua_types = (
2561
2562
        ('TypeId', 'NodeId'),
2563
        ('RequestHeader', 'RequestHeader'),
2564
        ('Server', 'RegisteredServer'),
2565
               )
2566 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2567
    def __init__(self, binary=None):
2568
        if binary is not None:
2569 1
            self._binary_init(binary)
2570
            self._freeze = True
2571
            return
2572
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServerRequest_Encoding_DefaultBinary)
2573
        self.RequestHeader = RequestHeader()
2574
        self.Server = RegisteredServer()
2575
        self._freeze = True
2576 1
2577
    def to_binary(self):
2578
        packet = []
2579
        packet.append(self.TypeId.to_binary())
2580
        packet.append(self.RequestHeader.to_binary())
2581
        packet.append(self.Server.to_binary())
2582
        return b''.join(packet)
2583
2584
    @staticmethod
2585
    def from_binary(data):
2586
        return RegisterServerRequest(data)
2587 1
2588
    def _binary_init(self, data):
2589
        self.TypeId = NodeId.from_binary(data)
2590
        self.RequestHeader = RequestHeader.from_binary(data)
2591
        self.Server = RegisteredServer.from_binary(data)
2592
2593
    def __str__(self):
2594
        return 'RegisterServerRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2595
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2596
               'Server:' + str(self.Server) + ')'
2597
2598
    __repr__ = __str__
2599 1
2600
2601
class RegisterServerResponse(FrozenClass):
2602
    '''
2603 1
    Registers a server with the discovery server.
2604
2605
    :ivar TypeId:
2606
    :vartype TypeId: NodeId
2607
    :ivar ResponseHeader:
2608
    :vartype ResponseHeader: ResponseHeader
2609
    '''
2610
2611
    ua_types = (
2612
2613
        ('TypeId', 'NodeId'),
2614
        ('ResponseHeader', 'ResponseHeader'),
2615
               )
2616
2617
    def __init__(self, binary=None):
2618
        if binary is not None:
2619 1
            self._binary_init(binary)
2620
            self._freeze = True
2621
            return
2622
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServerResponse_Encoding_DefaultBinary)
2623
        self.ResponseHeader = ResponseHeader()
2624
        self._freeze = True
2625 1
2626
    def to_binary(self):
2627
        packet = []
2628 1
        packet.append(self.TypeId.to_binary())
2629
        packet.append(self.ResponseHeader.to_binary())
2630
        return b''.join(packet)
2631
2632
    @staticmethod
2633
    def from_binary(data):
2634
        return RegisterServerResponse(data)
2635
2636
    def _binary_init(self, data):
2637
        self.TypeId = NodeId.from_binary(data)
2638
        self.ResponseHeader = ResponseHeader.from_binary(data)
2639
2640
    def __str__(self):
2641
        return 'RegisterServerResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2642 1
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
2643
2644
    __repr__ = __str__
2645
2646
2647
class DiscoveryConfiguration(FrozenClass):
2648
    '''
2649 1
    A base type for discovery configuration information.
2650 1
2651 1
    '''
2652 1
2653 1
    ua_types = (
2654 1
2655 1
               )
2656 1
2657 1
    def __init__(self, binary=None):
2658 1
        if binary is not None:
2659
            self._binary_init(binary)
2660 1
            self._freeze = True
2661 1
            return
2662 1
        self._freeze = True
2663 1
2664 1
    def to_binary(self):
2665 1
        packet = []
2666 1
        return b''.join(packet)
2667
2668 1
    @staticmethod
2669
    def from_binary(data):
2670 1
        return DiscoveryConfiguration(data)
2671
2672 1
    def _binary_init(self, data):
2673 1
        pass
2674 1
2675 1
    def __str__(self):
2676 1
        return 'DiscoveryConfiguration(' +  + ')'
2677
2678 1
    __repr__ = __str__
2679
2680
2681
class MdnsDiscoveryConfiguration(FrozenClass):
2682
    '''
2683
    The discovery information needed for mDNS registration.
2684 1
2685
    :ivar MdnsServerName:
2686
    :vartype MdnsServerName: String
2687 1
    :ivar ServerCapabilities:
2688
    :vartype ServerCapabilities: String
2689
    '''
2690
2691
    ua_types = (
2692
2693
        ('MdnsServerName', 'String'),
2694
        ('ServerCapabilities', 'ListOfString'),
2695
               )
2696 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2697
    def __init__(self, binary=None):
2698
        if binary is not None:
2699
            self._binary_init(binary)
2700
            self._freeze = True
2701 1
            return
2702
        self.MdnsServerName = None
2703
        self.ServerCapabilities = []
2704
        self._freeze = True
2705
2706
    def to_binary(self):
2707
        packet = []
2708
        packet.append(uabin.Primitives.String.pack(self.MdnsServerName))
2709 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerCapabilities)))
2710 1
        for fieldname in self.ServerCapabilities:
2711 1
            packet.append(uabin.Primitives.String.pack(fieldname))
2712 1
        return b''.join(packet)
2713 1
2714 1
    @staticmethod
2715 1
    def from_binary(data):
2716 1
        return MdnsDiscoveryConfiguration(data)
2717 1
2718 1
    def _binary_init(self, data):
2719 1
        self.MdnsServerName = uabin.Primitives.String.unpack(data)
2720
        self.ServerCapabilities = uabin.Primitives.String.unpack_array(data)
2721 1
2722 1
    def __str__(self):
2723 1
        return 'MdnsDiscoveryConfiguration(' + 'MdnsServerName:' + str(self.MdnsServerName) + ', ' + \
2724 1
               'ServerCapabilities:' + str(self.ServerCapabilities) + ')'
2725 1
2726 1
    __repr__ = __str__
2727 1
2728 1
2729
class RegisterServer2Parameters(FrozenClass):
2730 1
    '''
2731
    :ivar Server:
2732 1
    :vartype Server: RegisteredServer
2733
    :ivar DiscoveryConfiguration:
2734 1
    :vartype DiscoveryConfiguration: ExtensionObject
2735 1
    '''
2736 1
2737 1
    ua_types = (
2738 1
2739 1
        ('Server', 'RegisteredServer'),
2740
        ('DiscoveryConfiguration', 'ListOfExtensionObject'),
2741 1
               )
2742
2743
    def __init__(self, binary=None):
2744
        if binary is not None:
2745
            self._binary_init(binary)
2746
            self._freeze = True
2747
            return
2748 1
        self.Server = RegisteredServer()
2749
        self.DiscoveryConfiguration = []
2750
        self._freeze = True
2751 1
2752
    def to_binary(self):
2753
        packet = []
2754
        packet.append(self.Server.to_binary())
2755
        packet.append(uabin.Primitives.Int32.pack(len(self.DiscoveryConfiguration)))
2756
        for fieldname in self.DiscoveryConfiguration:
2757
            packet.append(extensionobject_to_binary(fieldname))
2758
        return b''.join(packet)
2759
2760
    @staticmethod
2761
    def from_binary(data):
2762
        return RegisterServer2Parameters(data)
2763 1
2764
    def _binary_init(self, data):
2765
        self.Server = RegisteredServer.from_binary(data)
2766
        length = uabin.Primitives.Int32.unpack(data)
2767
        array = []
2768
        if length != -1:
2769 1
            for _ in range(0, length):
2770 1
                array.append(extensionobject_from_binary(data))
2771 1
        self.DiscoveryConfiguration = array
2772 1
2773 1
    def __str__(self):
2774 1
        return 'RegisterServer2Parameters(' + 'Server:' + str(self.Server) + ', ' + \
2775 1
               'DiscoveryConfiguration:' + str(self.DiscoveryConfiguration) + ')'
2776 1
2777 1
    __repr__ = __str__
2778
2779 1
2780 1
class RegisterServer2Request(FrozenClass):
2781 1
    '''
2782 1
    :ivar TypeId:
2783 1
    :vartype TypeId: NodeId
2784 1
    :ivar RequestHeader:
2785
    :vartype RequestHeader: RequestHeader
2786 1
    :ivar Parameters:
2787
    :vartype Parameters: RegisterServer2Parameters
2788 1
    '''
2789
2790 1
    ua_types = (
2791 1
2792 1
        ('TypeId', 'NodeId'),
2793 1
        ('RequestHeader', 'RequestHeader'),
2794
        ('Parameters', 'RegisterServer2Parameters'),
2795 1
               )
2796
2797
    def __init__(self, binary=None):
2798
        if binary is not None:
2799
            self._binary_init(binary)
2800 1
            self._freeze = True
2801
            return
2802
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServer2Request_Encoding_DefaultBinary)
2803 1
        self.RequestHeader = RequestHeader()
2804
        self.Parameters = RegisterServer2Parameters()
2805
        self._freeze = True
2806
2807
    def to_binary(self):
2808
        packet = []
2809
        packet.append(self.TypeId.to_binary())
2810
        packet.append(self.RequestHeader.to_binary())
2811
        packet.append(self.Parameters.to_binary())
2812
        return b''.join(packet)
2813 1
2814
    @staticmethod
2815
    def from_binary(data):
2816
        return RegisterServer2Request(data)
2817
2818
    def _binary_init(self, data):
2819 1
        self.TypeId = NodeId.from_binary(data)
2820 1
        self.RequestHeader = RequestHeader.from_binary(data)
2821 1
        self.Parameters = RegisterServer2Parameters.from_binary(data)
2822 1
2823 1
    def __str__(self):
2824 1
        return 'RegisterServer2Request(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2825 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2826 1
               'Parameters:' + str(self.Parameters) + ')'
2827 1
2828
    __repr__ = __str__
2829 1
2830 1
2831 1
class RegisterServer2Response(FrozenClass):
2832 1
    '''
2833 1
    :ivar TypeId:
2834 1
    :vartype TypeId: NodeId
2835
    :ivar ResponseHeader:
2836 1
    :vartype ResponseHeader: ResponseHeader
2837
    :ivar ConfigurationResults:
2838 1
    :vartype ConfigurationResults: StatusCode
2839
    :ivar DiagnosticInfos:
2840 1
    :vartype DiagnosticInfos: DiagnosticInfo
2841 1
    '''
2842 1
2843 1
    ua_types = (
2844
2845 1
        ('TypeId', 'NodeId'),
2846
        ('ResponseHeader', 'ResponseHeader'),
2847
        ('ConfigurationResults', 'ListOfStatusCode'),
2848
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
2849
               )
2850 1
2851
    def __init__(self, binary=None):
2852
        if binary is not None:
2853 1
            self._binary_init(binary)
2854
            self._freeze = True
2855
            return
2856
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServer2Response_Encoding_DefaultBinary)
2857
        self.ResponseHeader = ResponseHeader()
2858
        self.ConfigurationResults = []
2859
        self.DiagnosticInfos = []
2860
        self._freeze = True
2861
2862
    def to_binary(self):
2863
        packet = []
2864
        packet.append(self.TypeId.to_binary())
2865 1
        packet.append(self.ResponseHeader.to_binary())
2866
        packet.append(uabin.Primitives.Int32.pack(len(self.ConfigurationResults)))
2867
        for fieldname in self.ConfigurationResults:
2868
            packet.append(fieldname.to_binary())
2869
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
2870
        for fieldname in self.DiagnosticInfos:
2871 1
            packet.append(fieldname.to_binary())
2872 1
        return b''.join(packet)
2873 1
2874 1
    @staticmethod
2875 1
    def from_binary(data):
2876 1
        return RegisterServer2Response(data)
2877 1
2878 1
    def _binary_init(self, data):
2879 1
        self.TypeId = NodeId.from_binary(data)
2880
        self.ResponseHeader = ResponseHeader.from_binary(data)
2881 1
        length = uabin.Primitives.Int32.unpack(data)
2882 1
        array = []
2883 1
        if length != -1:
2884 1
            for _ in range(0, length):
2885 1
                array.append(StatusCode.from_binary(data))
2886 1
        self.ConfigurationResults = array
2887
        length = uabin.Primitives.Int32.unpack(data)
2888 1
        array = []
2889
        if length != -1:
2890 1
            for _ in range(0, length):
2891
                array.append(DiagnosticInfo.from_binary(data))
2892 1
        self.DiagnosticInfos = array
2893 1
2894 1
    def __str__(self):
2895 1
        return 'RegisterServer2Response(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2896
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
2897 1
               'ConfigurationResults:' + str(self.ConfigurationResults) + ', ' + \
2898
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
2899
2900
    __repr__ = __str__
2901
2902 1
2903
class ChannelSecurityToken(FrozenClass):
2904
    '''
2905 1
    The token that identifies a set of keys for an active secure channel.
2906
2907
    :ivar ChannelId:
2908
    :vartype ChannelId: UInt32
2909
    :ivar TokenId:
2910
    :vartype TokenId: UInt32
2911
    :ivar CreatedAt:
2912
    :vartype CreatedAt: DateTime
2913
    :ivar RevisedLifetime:
2914
    :vartype RevisedLifetime: UInt32
2915 1
    '''
2916
2917
    ua_types = (
2918
2919
        ('ChannelId', 'UInt32'),
2920 1
        ('TokenId', 'UInt32'),
2921 1
        ('CreatedAt', 'DateTime'),
2922
        ('RevisedLifetime', 'UInt32'),
2923
               )
2924
2925 1
    def __init__(self, binary=None):
2926 1
        if binary is not None:
2927 1
            self._binary_init(binary)
2928
            self._freeze = True
2929 1
            return
2930 1
        self.ChannelId = 0
2931 1
        self.TokenId = 0
2932 1
        self.CreatedAt = datetime.utcnow()
2933 1
        self.RevisedLifetime = 0
2934
        self._freeze = True
2935 1
2936
    def to_binary(self):
2937
        packet = []
2938
        packet.append(uabin.Primitives.UInt32.pack(self.ChannelId))
2939 1
        packet.append(uabin.Primitives.UInt32.pack(self.TokenId))
2940
        packet.append(uabin.Primitives.DateTime.pack(self.CreatedAt))
2941
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedLifetime))
2942
        return b''.join(packet)
2943 1
2944
    @staticmethod
2945
    def from_binary(data):
2946
        return ChannelSecurityToken(data)
2947 1
2948
    def _binary_init(self, data):
2949
        self.ChannelId = uabin.Primitives.UInt32.unpack(data)
2950 1
        self.TokenId = uabin.Primitives.UInt32.unpack(data)
2951
        self.CreatedAt = uabin.Primitives.DateTime.unpack(data)
2952
        self.RevisedLifetime = uabin.Primitives.UInt32.unpack(data)
2953
2954
    def __str__(self):
2955
        return 'ChannelSecurityToken(' + 'ChannelId:' + str(self.ChannelId) + ', ' + \
2956
               'TokenId:' + str(self.TokenId) + ', ' + \
2957
               'CreatedAt:' + str(self.CreatedAt) + ', ' + \
2958
               'RevisedLifetime:' + str(self.RevisedLifetime) + ')'
2959
2960 1
    __repr__ = __str__
2961
2962
2963
class OpenSecureChannelParameters(FrozenClass):
2964
    '''
2965 1
    :ivar ClientProtocolVersion:
2966
    :vartype ClientProtocolVersion: UInt32
2967
    :ivar RequestType:
2968
    :vartype RequestType: SecurityTokenRequestType
2969
    :ivar SecurityMode:
2970
    :vartype SecurityMode: MessageSecurityMode
2971
    :ivar ClientNonce:
2972
    :vartype ClientNonce: ByteString
2973
    :ivar RequestedLifetime:
2974 1
    :vartype RequestedLifetime: UInt32
2975
    '''
2976
2977
    ua_types = (
2978
2979
        ('ClientProtocolVersion', 'UInt32'),
2980 1
        ('RequestType', 'SecurityTokenRequestType'),
2981
        ('SecurityMode', 'MessageSecurityMode'),
2982
        ('ClientNonce', 'ByteString'),
2983
        ('RequestedLifetime', 'UInt32'),
2984 1
               )
2985
2986
    def __init__(self, binary=None):
2987
        if binary is not None:
2988 1
            self._binary_init(binary)
2989
            self._freeze = True
2990
            return
2991
        self.ClientProtocolVersion = 0
2992 1
        self.RequestType = SecurityTokenRequestType(0)
2993
        self.SecurityMode = MessageSecurityMode(0)
2994
        self.ClientNonce = None
2995 1
        self.RequestedLifetime = 0
2996
        self._freeze = True
2997
2998
    def to_binary(self):
2999
        packet = []
3000
        packet.append(uabin.Primitives.UInt32.pack(self.ClientProtocolVersion))
3001
        packet.append(uabin.Primitives.UInt32.pack(self.RequestType.value))
3002
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityMode.value))
3003
        packet.append(uabin.Primitives.ByteString.pack(self.ClientNonce))
3004
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedLifetime))
3005 1
        return b''.join(packet)
3006
3007
    @staticmethod
3008
    def from_binary(data):
3009
        return OpenSecureChannelParameters(data)
3010 1
3011
    def _binary_init(self, data):
3012
        self.ClientProtocolVersion = uabin.Primitives.UInt32.unpack(data)
3013
        self.RequestType = SecurityTokenRequestType(uabin.Primitives.UInt32.unpack(data))
3014
        self.SecurityMode = MessageSecurityMode(uabin.Primitives.UInt32.unpack(data))
3015
        self.ClientNonce = uabin.Primitives.ByteString.unpack(data)
3016
        self.RequestedLifetime = uabin.Primitives.UInt32.unpack(data)
3017
3018
    def __str__(self):
3019 1
        return 'OpenSecureChannelParameters(' + 'ClientProtocolVersion:' + str(self.ClientProtocolVersion) + ', ' + \
3020
               'RequestType:' + str(self.RequestType) + ', ' + \
3021
               'SecurityMode:' + str(self.SecurityMode) + ', ' + \
3022
               'ClientNonce:' + str(self.ClientNonce) + ', ' + \
3023
               'RequestedLifetime:' + str(self.RequestedLifetime) + ')'
3024
3025 1
    __repr__ = __str__
3026
3027
3028
class OpenSecureChannelRequest(FrozenClass):
3029 1
    '''
3030
    Creates a secure channel with a server.
3031
3032
    :ivar TypeId:
3033 1
    :vartype TypeId: NodeId
3034
    :ivar RequestHeader:
3035
    :vartype RequestHeader: RequestHeader
3036
    :ivar Parameters:
3037 1
    :vartype Parameters: OpenSecureChannelParameters
3038
    '''
3039
3040 1
    ua_types = (
3041
3042
        ('TypeId', 'NodeId'),
3043
        ('RequestHeader', 'RequestHeader'),
3044
        ('Parameters', 'OpenSecureChannelParameters'),
3045
               )
3046
3047
    def __init__(self, binary=None):
3048
        if binary is not None:
3049
            self._binary_init(binary)
3050 1
            self._freeze = True
3051
            return
3052
        self.TypeId = FourByteNodeId(ObjectIds.OpenSecureChannelRequest_Encoding_DefaultBinary)
3053
        self.RequestHeader = RequestHeader()
3054
        self.Parameters = OpenSecureChannelParameters()
3055 1
        self._freeze = True
3056 1
3057 1
    def to_binary(self):
3058 1
        packet = []
3059 1
        packet.append(self.TypeId.to_binary())
3060 1
        packet.append(self.RequestHeader.to_binary())
3061 1
        packet.append(self.Parameters.to_binary())
3062 1
        return b''.join(packet)
3063
3064 1
    @staticmethod
3065 1
    def from_binary(data):
3066 1
        return OpenSecureChannelRequest(data)
3067 1
3068 1
    def _binary_init(self, data):
3069
        self.TypeId = NodeId.from_binary(data)
3070 1
        self.RequestHeader = RequestHeader.from_binary(data)
3071
        self.Parameters = OpenSecureChannelParameters.from_binary(data)
3072 1
3073
    def __str__(self):
3074 1
        return 'OpenSecureChannelRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3075 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
3076 1
               'Parameters:' + str(self.Parameters) + ')'
3077
3078 1
    __repr__ = __str__
3079
3080
3081
class OpenSecureChannelResult(FrozenClass):
3082 1
    '''
3083
    :ivar ServerProtocolVersion:
3084
    :vartype ServerProtocolVersion: UInt32
3085 1
    :ivar SecurityToken:
3086
    :vartype SecurityToken: ChannelSecurityToken
3087
    :ivar ServerNonce:
3088
    :vartype ServerNonce: ByteString
3089
    '''
3090
3091
    ua_types = (
3092
3093
        ('ServerProtocolVersion', 'UInt32'),
3094
        ('SecurityToken', 'ChannelSecurityToken'),
3095
        ('ServerNonce', 'ByteString'),
3096
               )
3097
3098
    def __init__(self, binary=None):
3099
        if binary is not None:
3100
            self._binary_init(binary)
3101
            self._freeze = True
3102
            return
3103
        self.ServerProtocolVersion = 0
3104
        self.SecurityToken = ChannelSecurityToken()
3105 1
        self.ServerNonce = None
3106
        self._freeze = True
3107
3108
    def to_binary(self):
3109
        packet = []
3110
        packet.append(uabin.Primitives.UInt32.pack(self.ServerProtocolVersion))
3111
        packet.append(self.SecurityToken.to_binary())
3112
        packet.append(uabin.Primitives.ByteString.pack(self.ServerNonce))
3113
        return b''.join(packet)
3114
3115
    @staticmethod
3116 1
    def from_binary(data):
3117 1
        return OpenSecureChannelResult(data)
3118 1
3119 1
    def _binary_init(self, data):
3120 1
        self.ServerProtocolVersion = uabin.Primitives.UInt32.unpack(data)
3121 1
        self.SecurityToken = ChannelSecurityToken.from_binary(data)
3122 1
        self.ServerNonce = uabin.Primitives.ByteString.unpack(data)
3123 1
3124 1
    def __str__(self):
3125 1
        return 'OpenSecureChannelResult(' + 'ServerProtocolVersion:' + str(self.ServerProtocolVersion) + ', ' + \
3126 1
               'SecurityToken:' + str(self.SecurityToken) + ', ' + \
3127 1
               'ServerNonce:' + str(self.ServerNonce) + ')'
3128 1
3129 1
    __repr__ = __str__
3130
3131 1
3132 1
class OpenSecureChannelResponse(FrozenClass):
3133 1 View Code Duplication
    '''
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3134 1
    Creates a secure channel with a server.
3135 1
3136 1
    :ivar TypeId:
3137 1
    :vartype TypeId: NodeId
3138 1
    :ivar ResponseHeader:
3139 1
    :vartype ResponseHeader: ResponseHeader
3140 1
    :ivar Parameters:
3141 1
    :vartype Parameters: OpenSecureChannelResult
3142
    '''
3143 1
3144
    ua_types = (
3145 1
3146
        ('TypeId', 'NodeId'),
3147 1
        ('ResponseHeader', 'ResponseHeader'),
3148 1
        ('Parameters', 'OpenSecureChannelResult'),
3149 1
               )
3150 1
3151 1
    def __init__(self, binary=None):
3152 1
        if binary is not None:
3153 1
            self._binary_init(binary)
3154 1
            self._freeze = True
3155 1
            return
3156
        self.TypeId = FourByteNodeId(ObjectIds.OpenSecureChannelResponse_Encoding_DefaultBinary)
3157 1
        self.ResponseHeader = ResponseHeader()
3158
        self.Parameters = OpenSecureChannelResult()
3159
        self._freeze = True
3160
3161
    def to_binary(self):
3162
        packet = []
3163
        packet.append(self.TypeId.to_binary())
3164
        packet.append(self.ResponseHeader.to_binary())
3165
        packet.append(self.Parameters.to_binary())
3166
        return b''.join(packet)
3167 1
3168
    @staticmethod
3169
    def from_binary(data):
3170 1
        return OpenSecureChannelResponse(data)
3171
3172
    def _binary_init(self, data):
3173
        self.TypeId = NodeId.from_binary(data)
3174
        self.ResponseHeader = ResponseHeader.from_binary(data)
3175
        self.Parameters = OpenSecureChannelResult.from_binary(data)
3176
3177
    def __str__(self):
3178
        return 'OpenSecureChannelResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3179
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
3180
               'Parameters:' + str(self.Parameters) + ')'
3181
3182 1
    __repr__ = __str__
3183
3184
3185
class CloseSecureChannelRequest(FrozenClass):
3186
    '''
3187
    Closes a secure channel.
3188 1
3189 1
    :ivar TypeId:
3190
    :vartype TypeId: NodeId
3191
    :ivar RequestHeader:
3192
    :vartype RequestHeader: RequestHeader
3193 1
    '''
3194 1
3195 1
    ua_types = (
3196 1
3197
        ('TypeId', 'NodeId'),
3198 1
        ('RequestHeader', 'RequestHeader'),
3199 1
               )
3200 1
3201 1
    def __init__(self, binary=None):
3202 1
        if binary is not None:
3203 1
            self._binary_init(binary)
3204
            self._freeze = True
3205 1
            return
3206
        self.TypeId = FourByteNodeId(ObjectIds.CloseSecureChannelRequest_Encoding_DefaultBinary)
3207
        self.RequestHeader = RequestHeader()
3208
        self._freeze = True
3209 1
3210
    def to_binary(self):
3211
        packet = []
3212
        packet.append(self.TypeId.to_binary())
3213
        packet.append(self.RequestHeader.to_binary())
3214 1
        return b''.join(packet)
3215
3216
    @staticmethod
3217
    def from_binary(data):
3218
        return CloseSecureChannelRequest(data)
3219 1
3220
    def _binary_init(self, data):
3221
        self.TypeId = NodeId.from_binary(data)
3222 1
        self.RequestHeader = RequestHeader.from_binary(data)
3223
3224
    def __str__(self):
3225
        return 'CloseSecureChannelRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3226
               'RequestHeader:' + str(self.RequestHeader) + ')'
3227
3228
    __repr__ = __str__
3229
3230
3231
class CloseSecureChannelResponse(FrozenClass):
3232
    '''
3233
    Closes a secure channel.
3234
3235
    :ivar TypeId:
3236
    :vartype TypeId: NodeId
3237
    :ivar ResponseHeader:
3238
    :vartype ResponseHeader: ResponseHeader
3239
    '''
3240
3241
    ua_types = (
3242
3243
        ('TypeId', 'NodeId'),
3244 1
        ('ResponseHeader', 'ResponseHeader'),
3245
               )
3246
3247
    def __init__(self, binary=None):
3248
        if binary is not None:
3249
            self._binary_init(binary)
3250
            self._freeze = True
3251
            return
3252
        self.TypeId = FourByteNodeId(ObjectIds.CloseSecureChannelResponse_Encoding_DefaultBinary)
3253
        self.ResponseHeader = ResponseHeader()
3254
        self._freeze = True
3255
3256 1
    def to_binary(self):
3257 1
        packet = []
3258 1
        packet.append(self.TypeId.to_binary())
3259 1
        packet.append(self.ResponseHeader.to_binary())
3260 1
        return b''.join(packet)
3261 1
3262 1
    @staticmethod
3263 1
    def from_binary(data):
3264 1
        return CloseSecureChannelResponse(data)
3265 1
3266 1
    def _binary_init(self, data):
3267 1
        self.TypeId = NodeId.from_binary(data)
3268 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
3269 1
3270 1
    def __str__(self):
3271
        return 'CloseSecureChannelResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3272 1
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
3273 1
3274 1
    __repr__ = __str__
3275 1
3276 1
3277 1
class SignedSoftwareCertificate(FrozenClass):
3278 1
    '''
3279 1
    A software certificate with a digital signature.
3280 1
3281 1
    :ivar CertificateData:
3282 1
    :vartype CertificateData: ByteString
3283 1
    :ivar Signature:
3284
    :vartype Signature: ByteString
3285 1
    '''
3286 1
3287 1
    ua_types = (
3288
3289 1
        ('CertificateData', 'ByteString'),
3290
        ('Signature', 'ByteString'),
3291 1
               )
3292
3293 1
    def __init__(self, binary=None):
3294 1
        if binary is not None:
3295 1
            self._binary_init(binary)
3296 1
            self._freeze = True
3297 1
            return
3298 1
        self.CertificateData = None
3299 1
        self.Signature = None
3300 1
        self._freeze = True
3301 1
3302 1
    def to_binary(self):
3303 1
        packet = []
3304 1
        packet.append(uabin.Primitives.ByteString.pack(self.CertificateData))
3305 1
        packet.append(uabin.Primitives.ByteString.pack(self.Signature))
3306 1
        return b''.join(packet)
3307 1
3308 1
    @staticmethod
3309
    def from_binary(data):
3310 1
        return SignedSoftwareCertificate(data)
3311 1
3312 1
    def _binary_init(self, data):
3313
        self.CertificateData = uabin.Primitives.ByteString.unpack(data)
3314 1
        self.Signature = uabin.Primitives.ByteString.unpack(data)
3315
3316
    def __str__(self):
3317
        return 'SignedSoftwareCertificate(' + 'CertificateData:' + str(self.CertificateData) + ', ' + \
3318
               'Signature:' + str(self.Signature) + ')'
3319
3320
    __repr__ = __str__
3321
3322
3323
class SignatureData(FrozenClass):
3324
    '''
3325 1
    A digital signature.
3326
3327
    :ivar Algorithm:
3328 1
    :vartype Algorithm: String
3329
    :ivar Signature:
3330
    :vartype Signature: ByteString
3331
    '''
3332
3333
    ua_types = (
3334
3335
        ('Algorithm', 'String'),
3336
        ('Signature', 'ByteString'),
3337
               )
3338
3339
    def __init__(self, binary=None):
3340 1
        if binary is not None:
3341
            self._binary_init(binary)
3342
            self._freeze = True
3343
            return
3344
        self.Algorithm = None
3345
        self.Signature = None
3346 1
        self._freeze = True
3347 1
3348 1
    def to_binary(self):
3349 1
        packet = []
3350 1
        packet.append(uabin.Primitives.String.pack(self.Algorithm))
3351 1
        packet.append(uabin.Primitives.ByteString.pack(self.Signature))
3352 1
        return b''.join(packet)
3353 1
3354 1
    @staticmethod
3355
    def from_binary(data):
3356 1
        return SignatureData(data)
3357 1
3358 1
    def _binary_init(self, data):
3359 1
        self.Algorithm = uabin.Primitives.String.unpack(data)
3360 1
        self.Signature = uabin.Primitives.ByteString.unpack(data)
3361 1
3362
    def __str__(self):
3363 1
        return 'SignatureData(' + 'Algorithm:' + str(self.Algorithm) + ', ' + \
3364
               'Signature:' + str(self.Signature) + ')'
3365 1
3366
    __repr__ = __str__
3367 1
3368 1
3369 1
class CreateSessionParameters(FrozenClass):
3370 1
    '''
3371
    :ivar ClientDescription:
3372 1
    :vartype ClientDescription: ApplicationDescription
3373
    :ivar ServerUri:
3374
    :vartype ServerUri: String
3375
    :ivar EndpointUrl:
3376
    :vartype EndpointUrl: String
3377 1
    :ivar SessionName:
3378
    :vartype SessionName: String
3379
    :ivar ClientNonce:
3380 1
    :vartype ClientNonce: ByteString
3381
    :ivar ClientCertificate:
3382
    :vartype ClientCertificate: ByteString
3383
    :ivar RequestedSessionTimeout:
3384
    :vartype RequestedSessionTimeout: Double
3385
    :ivar MaxResponseMessageSize:
3386
    :vartype MaxResponseMessageSize: UInt32
3387
    '''
3388 1
3389
    ua_types = (
3390
3391
        ('ClientDescription', 'ApplicationDescription'),
3392 1
        ('ServerUri', 'String'),
3393
        ('EndpointUrl', 'String'),
3394
        ('SessionName', 'String'),
3395
        ('ClientNonce', 'ByteString'),
3396
        ('ClientCertificate', 'ByteString'),
3397
        ('RequestedSessionTimeout', 'Double'),
3398
        ('MaxResponseMessageSize', 'UInt32'),
3399
               )
3400 1
3401
    def __init__(self, binary=None):
3402
        if binary is not None:
3403
            self._binary_init(binary)
3404
            self._freeze = True
3405 1
            return
3406
        self.ClientDescription = ApplicationDescription()
3407
        self.ServerUri = None
3408
        self.EndpointUrl = None
3409 1
        self.SessionName = None
3410
        self.ClientNonce = None
3411
        self.ClientCertificate = None
3412 1
        self.RequestedSessionTimeout = 0
3413
        self.MaxResponseMessageSize = 0
3414
        self._freeze = True
3415 1
3416
    def to_binary(self):
3417
        packet = []
3418 1
        packet.append(self.ClientDescription.to_binary())
3419
        packet.append(uabin.Primitives.String.pack(self.ServerUri))
3420
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
3421
        packet.append(uabin.Primitives.String.pack(self.SessionName))
3422
        packet.append(uabin.Primitives.ByteString.pack(self.ClientNonce))
3423
        packet.append(uabin.Primitives.ByteString.pack(self.ClientCertificate))
3424
        packet.append(uabin.Primitives.Double.pack(self.RequestedSessionTimeout))
3425
        packet.append(uabin.Primitives.UInt32.pack(self.MaxResponseMessageSize))
3426 1
        return b''.join(packet)
3427
3428
    @staticmethod
3429
    def from_binary(data):
3430 1
        return CreateSessionParameters(data)
3431 1
3432 1
    def _binary_init(self, data):
3433 1
        self.ClientDescription = ApplicationDescription.from_binary(data)
3434 1
        self.ServerUri = uabin.Primitives.String.unpack(data)
3435 1
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
3436 1
        self.SessionName = uabin.Primitives.String.unpack(data)
3437
        self.ClientNonce = uabin.Primitives.ByteString.unpack(data)
3438 1
        self.ClientCertificate = uabin.Primitives.ByteString.unpack(data)
3439 1
        self.RequestedSessionTimeout = uabin.Primitives.Double.unpack(data)
3440 1
        self.MaxResponseMessageSize = uabin.Primitives.UInt32.unpack(data)
3441 1
3442
    def __str__(self):
3443 1
        return 'CreateSessionParameters(' + 'ClientDescription:' + str(self.ClientDescription) + ', ' + \
3444
               'ServerUri:' + str(self.ServerUri) + ', ' + \
3445 1
               'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
3446
               'SessionName:' + str(self.SessionName) + ', ' + \
3447 1
               'ClientNonce:' + str(self.ClientNonce) + ', ' + \
3448 1
               'ClientCertificate:' + str(self.ClientCertificate) + ', ' + \
3449
               'RequestedSessionTimeout:' + str(self.RequestedSessionTimeout) + ', ' + \
3450 1
               'MaxResponseMessageSize:' + str(self.MaxResponseMessageSize) + ')'
3451
3452
    __repr__ = __str__
3453 1
3454
3455
class CreateSessionRequest(FrozenClass):
3456 1
    '''
3457
    Creates a new session with the server.
3458
3459
    :ivar TypeId:
3460
    :vartype TypeId: NodeId
3461
    :ivar RequestHeader:
3462
    :vartype RequestHeader: RequestHeader
3463
    :ivar Parameters:
3464
    :vartype Parameters: CreateSessionParameters
3465
    '''
3466
3467
    ua_types = (
3468
3469
        ('TypeId', 'NodeId'),
3470 1
        ('RequestHeader', 'RequestHeader'),
3471
        ('Parameters', 'CreateSessionParameters'),
3472
               )
3473
3474
    def __init__(self, binary=None):
3475
        if binary is not None:
3476
            self._binary_init(binary)
3477 1
            self._freeze = True
3478 1
            return
3479 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateSessionRequest_Encoding_DefaultBinary)
3480 1
        self.RequestHeader = RequestHeader()
3481 1
        self.Parameters = CreateSessionParameters()
3482 1
        self._freeze = True
3483 1
3484 1
    def to_binary(self):
3485 1
        packet = []
3486 1
        packet.append(self.TypeId.to_binary())
3487
        packet.append(self.RequestHeader.to_binary())
3488 1
        packet.append(self.Parameters.to_binary())
3489 1
        return b''.join(packet)
3490 1
3491 1
    @staticmethod
3492 1
    def from_binary(data):
3493 1
        return CreateSessionRequest(data)
3494 1
3495
    def _binary_init(self, data):
3496 1
        self.TypeId = NodeId.from_binary(data)
3497
        self.RequestHeader = RequestHeader.from_binary(data)
3498 1
        self.Parameters = CreateSessionParameters.from_binary(data)
3499
3500 1
    def __str__(self):
3501 1
        return 'CreateSessionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3502 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
3503 1
               'Parameters:' + str(self.Parameters) + ')'
3504 1
3505
    __repr__ = __str__
3506 1
3507
3508
class CreateSessionResult(FrozenClass):
3509
    '''
3510
    :ivar SessionId:
3511
    :vartype SessionId: NodeId
3512 1
    :ivar AuthenticationToken:
3513
    :vartype AuthenticationToken: NodeId
3514
    :ivar RevisedSessionTimeout:
3515 1
    :vartype RevisedSessionTimeout: Double
3516
    :ivar ServerNonce:
3517
    :vartype ServerNonce: ByteString
3518
    :ivar ServerCertificate:
3519
    :vartype ServerCertificate: ByteString
3520
    :ivar ServerEndpoints:
3521
    :vartype ServerEndpoints: EndpointDescription
3522
    :ivar ServerSoftwareCertificates:
3523
    :vartype ServerSoftwareCertificates: SignedSoftwareCertificate
3524
    :ivar ServerSignature:
3525 1
    :vartype ServerSignature: SignatureData
3526
    :ivar MaxRequestMessageSize:
3527
    :vartype MaxRequestMessageSize: UInt32
3528
    '''
3529
3530 1
    ua_types = (
3531
3532
        ('SessionId', 'NodeId'),
3533
        ('AuthenticationToken', 'NodeId'),
3534
        ('RevisedSessionTimeout', 'Double'),
3535
        ('ServerNonce', 'ByteString'),
3536
        ('ServerCertificate', 'ByteString'),
3537
        ('ServerEndpoints', 'ListOfEndpointDescription'),
3538
        ('ServerSoftwareCertificates', 'ListOfSignedSoftwareCertificate'),
3539 1
        ('ServerSignature', 'SignatureData'),
3540
        ('MaxRequestMessageSize', 'UInt32'),
3541
               )
3542
3543
    def __init__(self, binary=None):
3544
        if binary is not None:
3545 1
            self._binary_init(binary)
3546
            self._freeze = True
3547
            return
3548
        self.SessionId = NodeId()
3549 1
        self.AuthenticationToken = NodeId()
3550
        self.RevisedSessionTimeout = 0
3551
        self.ServerNonce = None
3552
        self.ServerCertificate = None
3553 1
        self.ServerEndpoints = []
3554
        self.ServerSoftwareCertificates = []
3555
        self.ServerSignature = SignatureData()
3556
        self.MaxRequestMessageSize = 0
3557 1
        self._freeze = True
3558
3559
    def to_binary(self):
3560 1
        packet = []
3561
        packet.append(self.SessionId.to_binary())
3562
        packet.append(self.AuthenticationToken.to_binary())
3563
        packet.append(uabin.Primitives.Double.pack(self.RevisedSessionTimeout))
3564
        packet.append(uabin.Primitives.ByteString.pack(self.ServerNonce))
3565
        packet.append(uabin.Primitives.ByteString.pack(self.ServerCertificate))
3566
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerEndpoints)))
3567
        for fieldname in self.ServerEndpoints:
3568 1
            packet.append(fieldname.to_binary())
3569
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerSoftwareCertificates)))
3570
        for fieldname in self.ServerSoftwareCertificates:
3571
            packet.append(fieldname.to_binary())
3572
        packet.append(self.ServerSignature.to_binary())
3573 1
        packet.append(uabin.Primitives.UInt32.pack(self.MaxRequestMessageSize))
3574
        return b''.join(packet)
3575
3576
    @staticmethod
3577
    def from_binary(data):
3578
        return CreateSessionResult(data)
3579
3580
    def _binary_init(self, data):
3581
        self.SessionId = NodeId.from_binary(data)
3582 1
        self.AuthenticationToken = NodeId.from_binary(data)
3583
        self.RevisedSessionTimeout = uabin.Primitives.Double.unpack(data)
3584
        self.ServerNonce = uabin.Primitives.ByteString.unpack(data)
3585
        self.ServerCertificate = uabin.Primitives.ByteString.unpack(data)
3586
        length = uabin.Primitives.Int32.unpack(data)
3587
        array = []
3588 1
        if length != -1:
3589
            for _ in range(0, length):
3590
                array.append(EndpointDescription.from_binary(data))
3591
        self.ServerEndpoints = array
3592 1
        length = uabin.Primitives.Int32.unpack(data)
3593
        array = []
3594
        if length != -1:
3595
            for _ in range(0, length):
3596 1
                array.append(SignedSoftwareCertificate.from_binary(data))
3597
        self.ServerSoftwareCertificates = array
3598
        self.ServerSignature = SignatureData.from_binary(data)
3599
        self.MaxRequestMessageSize = uabin.Primitives.UInt32.unpack(data)
3600 1
3601
    def __str__(self):
3602
        return 'CreateSessionResult(' + 'SessionId:' + str(self.SessionId) + ', ' + \
3603 1
               'AuthenticationToken:' + str(self.AuthenticationToken) + ', ' + \
3604
               'RevisedSessionTimeout:' + str(self.RevisedSessionTimeout) + ', ' + \
3605
               'ServerNonce:' + str(self.ServerNonce) + ', ' + \
3606
               'ServerCertificate:' + str(self.ServerCertificate) + ', ' + \
3607
               'ServerEndpoints:' + str(self.ServerEndpoints) + ', ' + \
3608
               'ServerSoftwareCertificates:' + str(self.ServerSoftwareCertificates) + ', ' + \
3609
               'ServerSignature:' + str(self.ServerSignature) + ', ' + \
3610
               'MaxRequestMessageSize:' + str(self.MaxRequestMessageSize) + ')'
3611
3612
    __repr__ = __str__
3613
3614
3615 1
class CreateSessionResponse(FrozenClass):
3616
    '''
3617
    Creates a new session with the server.
3618
3619
    :ivar TypeId:
3620
    :vartype TypeId: NodeId
3621 1
    :ivar ResponseHeader:
3622
    :vartype ResponseHeader: ResponseHeader
3623
    :ivar Parameters:
3624
    :vartype Parameters: CreateSessionResult
3625
    '''
3626
3627
    ua_types = (
3628
3629
        ('TypeId', 'NodeId'),
3630
        ('ResponseHeader', 'ResponseHeader'),
3631 1
        ('Parameters', 'CreateSessionResult'),
3632
               )
3633
3634
    def __init__(self, binary=None):
3635
        if binary is not None:
3636
            self._binary_init(binary)
3637
            self._freeze = True
3638 1
            return
3639
        self.TypeId = FourByteNodeId(ObjectIds.CreateSessionResponse_Encoding_DefaultBinary)
3640
        self.ResponseHeader = ResponseHeader()
3641
        self.Parameters = CreateSessionResult()
3642 1
        self._freeze = True
3643
3644
    def to_binary(self):
3645
        packet = []
3646
        packet.append(self.TypeId.to_binary())
3647 1
        packet.append(self.ResponseHeader.to_binary())
3648
        packet.append(self.Parameters.to_binary())
3649
        return b''.join(packet)
3650
3651
    @staticmethod
3652 1
    def from_binary(data):
3653
        return CreateSessionResponse(data)
3654
3655 1
    def _binary_init(self, data):
3656
        self.TypeId = NodeId.from_binary(data)
3657
        self.ResponseHeader = ResponseHeader.from_binary(data)
3658
        self.Parameters = CreateSessionResult.from_binary(data)
3659
3660
    def __str__(self):
3661
        return 'CreateSessionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3662
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
3663
               'Parameters:' + str(self.Parameters) + ')'
3664
3665
    __repr__ = __str__
3666
3667
3668
class UserIdentityToken(FrozenClass):
3669 1
    '''
3670
    A base type for a user identity token.
3671
3672
    :ivar PolicyId:
3673
    :vartype PolicyId: String
3674
    '''
3675
3676
    ua_types = (
3677 1
3678 1
        ('PolicyId', 'String'),
3679 1
               )
3680 1
3681 1
    def __init__(self, binary=None):
3682 1
        if binary is not None:
3683 1
            self._binary_init(binary)
3684 1
            self._freeze = True
3685 1
            return
3686 1
        self.PolicyId = None
3687 1
        self._freeze = True
3688
3689 1
    def to_binary(self):
3690 1
        packet = []
3691 1
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3692 1
        return b''.join(packet)
3693 1
3694
    @staticmethod
3695 1
    def from_binary(data):
3696 1
        return UserIdentityToken(data)
3697 1
3698 1
    def _binary_init(self, data):
3699 1
        self.PolicyId = uabin.Primitives.String.unpack(data)
3700 1
3701
    def __str__(self):
3702 1
        return 'UserIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ')'
3703
3704 1
    __repr__ = __str__
3705
3706 1
3707 1
class AnonymousIdentityToken(FrozenClass):
3708 1
    '''
3709 1
    A token representing an anonymous user.
3710 1
3711 1
    :ivar PolicyId:
3712
    :vartype PolicyId: String
3713 1
    '''
3714 1
3715 1
    ua_types = (
3716 1
3717
        ('PolicyId', 'String'),
3718 1
               )
3719
3720
    def __init__(self, binary=None):
3721
        if binary is not None:
3722
            self._binary_init(binary)
3723
            self._freeze = True
3724
            return
3725 1
        self.PolicyId = None
3726
        self._freeze = True
3727
3728 1
    def to_binary(self):
3729
        packet = []
3730
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3731
        return b''.join(packet)
3732
3733
    @staticmethod
3734
    def from_binary(data):
3735
        return AnonymousIdentityToken(data)
3736
3737
    def _binary_init(self, data):
3738
        self.PolicyId = uabin.Primitives.String.unpack(data)
3739
3740 1
    def __str__(self):
3741
        return 'AnonymousIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ')'
3742
3743
    __repr__ = __str__
3744
3745
3746 1
class UserNameIdentityToken(FrozenClass):
3747 1
    '''
3748
    A token representing a user identified by a user name and password.
3749
3750
    :ivar PolicyId:
3751 1
    :vartype PolicyId: String
3752 1
    :ivar UserName:
3753 1
    :vartype UserName: String
3754 1
    :ivar Password:
3755
    :vartype Password: ByteString
3756 1
    :ivar EncryptionAlgorithm:
3757 1
    :vartype EncryptionAlgorithm: String
3758 1
    '''
3759 1
3760 1
    ua_types = (
3761 1
3762
        ('PolicyId', 'String'),
3763 1
        ('UserName', 'String'),
3764
        ('Password', 'ByteString'),
3765
        ('EncryptionAlgorithm', 'String'),
3766
               )
3767 1
3768
    def __init__(self, binary=None):
3769
        if binary is not None:
3770
            self._binary_init(binary)
3771
            self._freeze = True
3772 1
            return
3773
        self.PolicyId = None
3774
        self.UserName = None
3775
        self.Password = None
3776
        self.EncryptionAlgorithm = None
3777 1
        self._freeze = True
3778
3779
    def to_binary(self):
3780 1
        packet = []
3781
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3782
        packet.append(uabin.Primitives.String.pack(self.UserName))
3783
        packet.append(uabin.Primitives.ByteString.pack(self.Password))
3784
        packet.append(uabin.Primitives.String.pack(self.EncryptionAlgorithm))
3785
        return b''.join(packet)
3786
3787
    @staticmethod
3788
    def from_binary(data):
3789
        return UserNameIdentityToken(data)
3790 1
3791
    def _binary_init(self, data):
3792
        self.PolicyId = uabin.Primitives.String.unpack(data)
3793
        self.UserName = uabin.Primitives.String.unpack(data)
3794
        self.Password = uabin.Primitives.ByteString.unpack(data)
3795
        self.EncryptionAlgorithm = uabin.Primitives.String.unpack(data)
3796 1
3797 1
    def __str__(self):
3798 1
        return 'UserNameIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3799 1
               'UserName:' + str(self.UserName) + ', ' + \
3800 1
               'Password:' + str(self.Password) + ', ' + \
3801 1
               'EncryptionAlgorithm:' + str(self.EncryptionAlgorithm) + ')'
3802 1
3803 1
    __repr__ = __str__
3804 1
3805
3806 1
class X509IdentityToken(FrozenClass):
3807 1
    '''
3808 1
    A token representing a user identified by an X509 certificate.
3809 1
3810 1
    :ivar PolicyId:
3811
    :vartype PolicyId: String
3812 1
    :ivar CertificateData:
3813 1
    :vartype CertificateData: ByteString
3814
    '''
3815 1
3816
    ua_types = (
3817 1
3818
        ('PolicyId', 'String'),
3819 1
        ('CertificateData', 'ByteString'),
3820
               )
3821 1
3822 1
    def __init__(self, binary=None):
3823 1
        if binary is not None:
3824 1
            self._binary_init(binary)
3825 1
            self._freeze = True
3826 1
            return
3827
        self.PolicyId = None
3828 1
        self.CertificateData = None
3829 1
        self._freeze = True
3830 1
3831 1
    def to_binary(self):
3832 1
        packet = []
3833
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3834 1
        packet.append(uabin.Primitives.ByteString.pack(self.CertificateData))
3835
        return b''.join(packet)
3836 1
3837
    @staticmethod
3838
    def from_binary(data):
3839
        return X509IdentityToken(data)
3840
3841 1
    def _binary_init(self, data):
3842
        self.PolicyId = uabin.Primitives.String.unpack(data)
3843
        self.CertificateData = uabin.Primitives.ByteString.unpack(data)
3844 1
3845
    def __str__(self):
3846
        return 'X509IdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3847
               'CertificateData:' + str(self.CertificateData) + ')'
3848
3849
    __repr__ = __str__
3850
3851
3852
class KerberosIdentityToken(FrozenClass):
3853
    '''
3854
    :ivar PolicyId:
3855
    :vartype PolicyId: String
3856 1
    :ivar TicketData:
3857
    :vartype TicketData: ByteString
3858
    '''
3859
3860
    ua_types = (
3861
3862 1
        ('PolicyId', 'String'),
3863 1
        ('TicketData', 'ByteString'),
3864 1
               )
3865 1
3866 1
    def __init__(self, binary=None):
3867 1
        if binary is not None:
3868 1
            self._binary_init(binary)
3869 1
            self._freeze = True
3870 1
            return
3871
        self.PolicyId = None
3872 1
        self.TicketData = None
3873 1
        self._freeze = True
3874 1
3875 1
    def to_binary(self):
3876 1
        packet = []
3877 1
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3878
        packet.append(uabin.Primitives.ByteString.pack(self.TicketData))
3879 1
        return b''.join(packet)
3880
3881 1
    @staticmethod
3882
    def from_binary(data):
3883 1
        return KerberosIdentityToken(data)
3884 1
3885 1
    def _binary_init(self, data):
3886 1
        self.PolicyId = uabin.Primitives.String.unpack(data)
3887
        self.TicketData = uabin.Primitives.ByteString.unpack(data)
3888 1
3889
    def __str__(self):
3890
        return 'KerberosIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3891
               'TicketData:' + str(self.TicketData) + ')'
3892
3893 1
    __repr__ = __str__
3894
3895
3896 1
class IssuedIdentityToken(FrozenClass):
3897
    '''
3898
    A token representing a user identified by a WS-Security XML token.
3899
3900
    :ivar PolicyId:
3901
    :vartype PolicyId: String
3902
    :ivar TokenData:
3903
    :vartype TokenData: ByteString
3904
    :ivar EncryptionAlgorithm:
3905
    :vartype EncryptionAlgorithm: String
3906
    '''
3907
3908 1
    ua_types = (
3909
3910
        ('PolicyId', 'String'),
3911
        ('TokenData', 'ByteString'),
3912
        ('EncryptionAlgorithm', 'String'),
3913
               )
3914 1
3915 1
    def __init__(self, binary=None):
3916
        if binary is not None:
3917
            self._binary_init(binary)
3918
            self._freeze = True
3919 1
            return
3920 1
        self.PolicyId = None
3921 1
        self.TokenData = None
3922 1
        self.EncryptionAlgorithm = None
3923
        self._freeze = True
3924 1
3925 1
    def to_binary(self):
3926 1
        packet = []
3927 1
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3928 1
        packet.append(uabin.Primitives.ByteString.pack(self.TokenData))
3929 1
        packet.append(uabin.Primitives.String.pack(self.EncryptionAlgorithm))
3930
        return b''.join(packet)
3931 1
3932
    @staticmethod
3933
    def from_binary(data):
3934
        return IssuedIdentityToken(data)
3935 1
3936
    def _binary_init(self, data):
3937
        self.PolicyId = uabin.Primitives.String.unpack(data)
3938
        self.TokenData = uabin.Primitives.ByteString.unpack(data)
3939
        self.EncryptionAlgorithm = uabin.Primitives.String.unpack(data)
3940 1
3941
    def __str__(self):
3942
        return 'IssuedIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3943
               'TokenData:' + str(self.TokenData) + ', ' + \
3944
               'EncryptionAlgorithm:' + str(self.EncryptionAlgorithm) + ')'
3945 1
3946
    __repr__ = __str__
3947
3948 1
3949
class ActivateSessionParameters(FrozenClass):
3950
    '''
3951
    :ivar ClientSignature:
3952
    :vartype ClientSignature: SignatureData
3953
    :ivar ClientSoftwareCertificates:
3954
    :vartype ClientSoftwareCertificates: SignedSoftwareCertificate
3955
    :ivar LocaleIds:
3956
    :vartype LocaleIds: String
3957
    :ivar UserIdentityToken:
3958 1
    :vartype UserIdentityToken: ExtensionObject
3959
    :ivar UserTokenSignature:
3960
    :vartype UserTokenSignature: SignatureData
3961
    '''
3962
3963 1
    ua_types = (
3964 1
3965 1
        ('ClientSignature', 'SignatureData'),
3966 1
        ('ClientSoftwareCertificates', 'ListOfSignedSoftwareCertificate'),
3967 1
        ('LocaleIds', 'ListOfString'),
3968 1
        ('UserIdentityToken', 'ExtensionObject'),
3969 1
        ('UserTokenSignature', 'SignatureData'),
3970 1
               )
3971
3972 1
    def __init__(self, binary=None):
3973 1
        if binary is not None:
3974 1
            self._binary_init(binary)
3975 1
            self._freeze = True
3976 1
            return
3977
        self.ClientSignature = SignatureData()
3978 1
        self.ClientSoftwareCertificates = []
3979
        self.LocaleIds = []
3980 1
        self.UserIdentityToken = None
3981
        self.UserTokenSignature = SignatureData()
3982 1
        self._freeze = True
3983 1
3984 1
    def to_binary(self):
3985
        packet = []
3986 1
        packet.append(self.ClientSignature.to_binary())
3987
        packet.append(uabin.Primitives.Int32.pack(len(self.ClientSoftwareCertificates)))
3988
        for fieldname in self.ClientSoftwareCertificates:
3989
            packet.append(fieldname.to_binary())
3990 1
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
3991
        for fieldname in self.LocaleIds:
3992
            packet.append(uabin.Primitives.String.pack(fieldname))
3993 1
        packet.append(extensionobject_to_binary(self.UserIdentityToken))
3994
        packet.append(self.UserTokenSignature.to_binary())
3995
        return b''.join(packet)
3996
3997
    @staticmethod
3998
    def from_binary(data):
3999 1
        return ActivateSessionParameters(data)
4000
4001
    def _binary_init(self, data):
4002
        self.ClientSignature = SignatureData.from_binary(data)
4003 1
        length = uabin.Primitives.Int32.unpack(data)
4004
        array = []
4005
        if length != -1:
4006
            for _ in range(0, length):
4007
                array.append(SignedSoftwareCertificate.from_binary(data))
4008
        self.ClientSoftwareCertificates = array
4009
        self.LocaleIds = uabin.Primitives.String.unpack_array(data)
4010
        self.UserIdentityToken = extensionobject_from_binary(data)
4011 1
        self.UserTokenSignature = SignatureData.from_binary(data)
4012
4013
    def __str__(self):
4014
        return 'ActivateSessionParameters(' + 'ClientSignature:' + str(self.ClientSignature) + ', ' + \
4015
               'ClientSoftwareCertificates:' + str(self.ClientSoftwareCertificates) + ', ' + \
4016 1
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
4017
               'UserIdentityToken:' + str(self.UserIdentityToken) + ', ' + \
4018
               'UserTokenSignature:' + str(self.UserTokenSignature) + ')'
4019
4020 1
    __repr__ = __str__
4021
4022
4023 1
class ActivateSessionRequest(FrozenClass):
4024
    '''
4025
    Activates a session with the server.
4026 1
4027
    :ivar TypeId:
4028
    :vartype TypeId: NodeId
4029 1
    :ivar RequestHeader:
4030
    :vartype RequestHeader: RequestHeader
4031
    :ivar Parameters:
4032
    :vartype Parameters: ActivateSessionParameters
4033
    '''
4034
4035
    ua_types = (
4036
4037
        ('TypeId', 'NodeId'),
4038
        ('RequestHeader', 'RequestHeader'),
4039
        ('Parameters', 'ActivateSessionParameters'),
4040
               )
4041 1
4042
    def __init__(self, binary=None):
4043
        if binary is not None:
4044
            self._binary_init(binary)
4045
            self._freeze = True
4046
            return
4047 1
        self.TypeId = FourByteNodeId(ObjectIds.ActivateSessionRequest_Encoding_DefaultBinary)
4048
        self.RequestHeader = RequestHeader()
4049
        self.Parameters = ActivateSessionParameters()
4050
        self._freeze = True
4051
4052
    def to_binary(self):
4053
        packet = []
4054
        packet.append(self.TypeId.to_binary())
4055
        packet.append(self.RequestHeader.to_binary())
4056
        packet.append(self.Parameters.to_binary())
4057 1
        return b''.join(packet)
4058
4059
    @staticmethod
4060
    def from_binary(data):
4061
        return ActivateSessionRequest(data)
4062
4063
    def _binary_init(self, data):
4064 1
        self.TypeId = NodeId.from_binary(data)
4065
        self.RequestHeader = RequestHeader.from_binary(data)
4066
        self.Parameters = ActivateSessionParameters.from_binary(data)
4067
4068 1
    def __str__(self):
4069
        return 'ActivateSessionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
4070
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
4071
               'Parameters:' + str(self.Parameters) + ')'
4072
4073 1
    __repr__ = __str__
4074
4075
4076
class ActivateSessionResult(FrozenClass):
4077
    '''
4078 1
    :ivar ServerNonce:
4079
    :vartype ServerNonce: ByteString
4080
    :ivar Results:
4081 1
    :vartype Results: StatusCode
4082
    :ivar DiagnosticInfos:
4083
    :vartype DiagnosticInfos: DiagnosticInfo
4084
    '''
4085
4086
    ua_types = (
4087 1
4088
        ('ServerNonce', 'ByteString'),
4089
        ('Results', 'ListOfStatusCode'),
4090
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
4091 1
               )
4092
4093
    def __init__(self, binary=None):
4094
        if binary is not None:
4095
            self._binary_init(binary)
4096
            self._freeze = True
4097
            return
4098
        self.ServerNonce = None
4099 1
        self.Results = []
4100
        self.DiagnosticInfos = []
4101
        self._freeze = True
4102
4103
    def to_binary(self):
4104 1
        packet = []
4105
        packet.append(uabin.Primitives.ByteString.pack(self.ServerNonce))
4106
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
4107
        for fieldname in self.Results:
4108 1
            packet.append(fieldname.to_binary())
4109
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
4110
        for fieldname in self.DiagnosticInfos:
4111 1
            packet.append(fieldname.to_binary())
4112
        return b''.join(packet)
4113
4114 1
    @staticmethod
4115
    def from_binary(data):
4116
        return ActivateSessionResult(data)
4117 1
4118
    def _binary_init(self, data):
4119
        self.ServerNonce = uabin.Primitives.ByteString.unpack(data)
4120
        length = uabin.Primitives.Int32.unpack(data)
4121
        array = []
4122
        if length != -1:
4123
            for _ in range(0, length):
4124
                array.append(StatusCode.from_binary(data))
4125
        self.Results = array
4126
        length = uabin.Primitives.Int32.unpack(data)
4127
        array = []
4128
        if length != -1:
4129 1
            for _ in range(0, length):
4130
                array.append(DiagnosticInfo.from_binary(data))
4131
        self.DiagnosticInfos = array
4132
4133
    def __str__(self):
4134
        return 'ActivateSessionResult(' + 'ServerNonce:' + str(self.ServerNonce) + ', ' + \
4135 1
               'Results:' + str(self.Results) + ', ' + \
4136
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
4137
4138
    __repr__ = __str__
4139
4140
4141
class ActivateSessionResponse(FrozenClass):
4142
    '''
4143
    Activates a session with the server.
4144
4145 1
    :ivar TypeId:
4146
    :vartype TypeId: NodeId
4147
    :ivar ResponseHeader:
4148
    :vartype ResponseHeader: ResponseHeader
4149
    :ivar Parameters:
4150
    :vartype Parameters: ActivateSessionResult
4151
    '''
4152 1
4153
    ua_types = (
4154
4155
        ('TypeId', 'NodeId'),
4156 1
        ('ResponseHeader', 'ResponseHeader'),
4157
        ('Parameters', 'ActivateSessionResult'),
4158
               )
4159
4160
    def __init__(self, binary=None):
4161 1
        if binary is not None:
4162
            self._binary_init(binary)
4163
            self._freeze = True
4164
            return
4165
        self.TypeId = FourByteNodeId(ObjectIds.ActivateSessionResponse_Encoding_DefaultBinary)
4166 1
        self.ResponseHeader = ResponseHeader()
4167
        self.Parameters = ActivateSessionResult()
4168
        self._freeze = True
4169 1
4170
    def to_binary(self):
4171
        packet = []
4172
        packet.append(self.TypeId.to_binary())
4173
        packet.append(self.ResponseHeader.to_binary())
4174
        packet.append(self.Parameters.to_binary())
4175
        return b''.join(packet)
4176
4177
    @staticmethod
4178 View Code Duplication
    def from_binary(data):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4179
        return ActivateSessionResponse(data)
4180
4181
    def _binary_init(self, data):
4182
        self.TypeId = NodeId.from_binary(data)
4183
        self.ResponseHeader = ResponseHeader.from_binary(data)
4184
        self.Parameters = ActivateSessionResult.from_binary(data)
4185 1
4186
    def __str__(self):
4187
        return 'ActivateSessionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
4188
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
4189
               'Parameters:' + str(self.Parameters) + ')'
4190
4191
    __repr__ = __str__
4192
4193 1
4194
class CloseSessionRequest(FrozenClass):
4195
    '''
4196
    Closes a session with the server.
4197
4198
    :ivar TypeId:
4199
    :vartype TypeId: NodeId
4200
    :ivar RequestHeader:
4201
    :vartype RequestHeader: RequestHeader
4202
    :ivar DeleteSubscriptions:
4203
    :vartype DeleteSubscriptions: Boolean
4204
    '''
4205 1
4206
    ua_types = (
4207
4208
        ('TypeId', 'NodeId'),
4209
        ('RequestHeader', 'RequestHeader'),
4210
        ('DeleteSubscriptions', 'Boolean'),
4211
               )
4212
4213
    def __init__(self, binary=None):
4214 1
        if binary is not None:
4215
            self._binary_init(binary)
4216
            self._freeze = True
4217
            return
4218 1
        self.TypeId = FourByteNodeId(ObjectIds.CloseSessionRequest_Encoding_DefaultBinary)
4219
        self.RequestHeader = RequestHeader()
4220
        self.DeleteSubscriptions = True
4221
        self._freeze = True
4222
4223
    def to_binary(self):
4224
        packet = []
4225 1
        packet.append(self.TypeId.to_binary())
4226
        packet.append(self.RequestHeader.to_binary())
4227
        packet.append(uabin.Primitives.Boolean.pack(self.DeleteSubscriptions))
4228
        return b''.join(packet)
4229
4230
    @staticmethod
4231
    def from_binary(data):
4232 1
        return CloseSessionRequest(data)
4233
4234
    def _binary_init(self, data):
4235 1
        self.TypeId = NodeId.from_binary(data)
4236
        self.RequestHeader = RequestHeader.from_binary(data)
4237
        self.DeleteSubscriptions = uabin.Primitives.Boolean.unpack(data)
4238
4239
    def __str__(self):
4240
        return 'CloseSessionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
4241
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
4242
               'DeleteSubscriptions:' + str(self.DeleteSubscriptions) + ')'
4243
4244
    __repr__ = __str__
4245
4246
4247
class CloseSessionResponse(FrozenClass):
4248
    '''
4249
    Closes a session with the server.
4250
4251
    :ivar TypeId:
4252
    :vartype TypeId: NodeId
4253 1
    :ivar ResponseHeader:
4254
    :vartype ResponseHeader: ResponseHeader
4255
    '''
4256
4257
    ua_types = (
4258
4259
        ('TypeId', 'NodeId'),
4260
        ('ResponseHeader', 'ResponseHeader'),
4261
               )
4262 1
4263 1
    def __init__(self, binary=None):
4264 1
        if binary is not None:
4265 1
            self._binary_init(binary)
4266 1
            self._freeze = True
4267 1
            return
4268 1
        self.TypeId = FourByteNodeId(ObjectIds.CloseSessionResponse_Encoding_DefaultBinary)
4269 1
        self.ResponseHeader = ResponseHeader()
4270 1
        self._freeze = True
4271 1
4272 1
    def to_binary(self):
4273 1
        packet = []
4274
        packet.append(self.TypeId.to_binary())
4275 1
        packet.append(self.ResponseHeader.to_binary())
4276 1
        return b''.join(packet)
4277 1
4278 1
    @staticmethod
4279 1
    def from_binary(data):
4280 1
        return CloseSessionResponse(data)
4281 1
4282 1
    def _binary_init(self, data):
4283 1
        self.TypeId = NodeId.from_binary(data)
4284
        self.ResponseHeader = ResponseHeader.from_binary(data)
4285 1
4286
    def __str__(self):
4287 1
        return 'CloseSessionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
4288
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
4289 1
4290 1
    __repr__ = __str__
4291 1
4292 1
4293 1
class CancelParameters(FrozenClass):
4294 1
    '''
4295 1
    :ivar RequestHandle:
4296
    :vartype RequestHandle: UInt32
4297 1
    '''
4298
4299
    ua_types = (
4300
4301
        ('RequestHandle', 'UInt32'),
4302
               )
4303
4304
    def __init__(self, binary=None):
4305 1
        if binary is not None:
4306
            self._binary_init(binary)
4307
            self._freeze = True
4308 1
            return
4309
        self.RequestHandle = 0
4310
        self._freeze = True
4311
4312
    def to_binary(self):
4313
        packet = []
4314
        packet.append(uabin.Primitives.UInt32.pack(self.RequestHandle))
4315
        return b''.join(packet)
4316
4317
    @staticmethod
4318
    def from_binary(data):
4319
        return CancelParameters(data)
4320
4321
    def _binary_init(self, data):
4322
        self.RequestHandle = uabin.Primitives.UInt32.unpack(data)
4323
4324
    def __str__(self):
4325
        return 'CancelParameters(' + 'RequestHandle:' + str(self.RequestHandle) + ')'
4326
4327
    __repr__ = __str__
4328
4329
4330
class CancelRequest(FrozenClass):
4331
    '''
4332
    Cancels an outstanding request.
4333
4334
    :ivar TypeId:
4335
    :vartype TypeId: NodeId
4336
    :ivar RequestHeader:
4337
    :vartype RequestHeader: RequestHeader
4338
    :ivar Parameters:
4339
    :vartype Parameters: CancelParameters
4340 1
    '''
4341
4342
    ua_types = (
4343
4344
        ('TypeId', 'NodeId'),
4345
        ('RequestHeader', 'RequestHeader'),
4346
        ('Parameters', 'CancelParameters'),
4347
               )
4348
4349
    def __init__(self, binary=None):
4350
        if binary is not None:
4351
            self._binary_init(binary)
4352
            self._freeze = True
4353
            return
4354
        self.TypeId = FourByteNodeId(ObjectIds.CancelRequest_Encoding_DefaultBinary)
4355
        self.RequestHeader = RequestHeader()
4356 1
        self.Parameters = CancelParameters()
4357 1
        self._freeze = True
4358 1
4359 1
    def to_binary(self):
4360 1
        packet = []
4361 1
        packet.append(self.TypeId.to_binary())
4362 1
        packet.append(self.RequestHeader.to_binary())
4363 1
        packet.append(self.Parameters.to_binary())
4364 1
        return b''.join(packet)
4365 1
4366 1
    @staticmethod
4367 1
    def from_binary(data):
4368 1
        return CancelRequest(data)
4369 1
4370 1
    def _binary_init(self, data):
4371 1
        self.TypeId = NodeId.from_binary(data)
4372 1
        self.RequestHeader = RequestHeader.from_binary(data)
4373 1
        self.Parameters = CancelParameters.from_binary(data)
4374 1
4375
    def __str__(self):
4376 1
        return 'CancelRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
4377 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
4378 1
               'Parameters:' + str(self.Parameters) + ')'
4379 1
4380 1
    __repr__ = __str__
4381 1
4382 1
4383 1
class CancelResult(FrozenClass):
4384 1
    '''
4385 1
    :ivar CancelCount:
4386 1
    :vartype CancelCount: UInt32
4387 1
    '''
4388 1
4389 1
    ua_types = (
4390 1
4391 1
        ('CancelCount', 'UInt32'),
4392 1
               )
4393 1
4394
    def __init__(self, binary=None):
4395 1
        if binary is not None:
4396
            self._binary_init(binary)
4397 1
            self._freeze = True
4398
            return
4399 1
        self.CancelCount = 0
4400 1
        self._freeze = True
4401 1
4402 1
    def to_binary(self):
4403 1
        packet = []
4404 1
        packet.append(uabin.Primitives.UInt32.pack(self.CancelCount))
4405 1
        return b''.join(packet)
4406 1
4407 1
    @staticmethod
4408 1
    def from_binary(data):
4409 1
        return CancelResult(data)
4410 1
4411 1
    def _binary_init(self, data):
4412 1
        self.CancelCount = uabin.Primitives.UInt32.unpack(data)
4413
4414 1
    def __str__(self):
4415
        return 'CancelResult(' + 'CancelCount:' + str(self.CancelCount) + ')'
4416
4417
    __repr__ = __str__
4418
4419
4420
class CancelResponse(FrozenClass):
4421
    '''
4422
    Cancels an outstanding request.
4423
4424
    :ivar TypeId:
4425
    :vartype TypeId: NodeId
4426
    :ivar ResponseHeader:
4427
    :vartype ResponseHeader: ResponseHeader
4428
    :ivar Parameters:
4429 1
    :vartype Parameters: CancelResult
4430
    '''
4431
4432 1
    ua_types = (
4433
4434
        ('TypeId', 'NodeId'),
4435
        ('ResponseHeader', 'ResponseHeader'),
4436
        ('Parameters', 'CancelResult'),
4437
               )
4438
4439
    def __init__(self, binary=None):
4440
        if binary is not None:
4441
            self._binary_init(binary)
4442
            self._freeze = True
4443
            return
4444
        self.TypeId = FourByteNodeId(ObjectIds.CancelResponse_Encoding_DefaultBinary)
4445
        self.ResponseHeader = ResponseHeader()
4446
        self.Parameters = CancelResult()
4447
        self._freeze = True
4448
4449
    def to_binary(self):
4450
        packet = []
4451
        packet.append(self.TypeId.to_binary())
4452 1
        packet.append(self.ResponseHeader.to_binary())
4453
        packet.append(self.Parameters.to_binary())
4454
        return b''.join(packet)
4455
4456
    @staticmethod
4457
    def from_binary(data):
4458
        return CancelResponse(data)
4459
4460
    def _binary_init(self, data):
4461
        self.TypeId = NodeId.from_binary(data)
4462 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
4463 1
        self.Parameters = CancelResult.from_binary(data)
4464 1
4465 1
    def __str__(self):
4466 1
        return 'CancelResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
4467 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
4468 1
               'Parameters:' + str(self.Parameters) + ')'
4469 1
4470 1
    __repr__ = __str__
4471 1
4472 1
4473 1
class NodeAttributes(FrozenClass):
4474 1
    '''
4475
    The base attributes for all nodes.
4476 1
4477 1
    :ivar SpecifiedAttributes:
4478 1
    :vartype SpecifiedAttributes: UInt32
4479 1
    :ivar DisplayName:
4480 1
    :vartype DisplayName: LocalizedText
4481 1
    :ivar Description:
4482 1
    :vartype Description: LocalizedText
4483 1
    :ivar WriteMask:
4484 1
    :vartype WriteMask: UInt32
4485 1
    :ivar UserWriteMask:
4486
    :vartype UserWriteMask: UInt32
4487 1
    '''
4488
4489 1
    ua_types = (
4490
4491 1
        ('SpecifiedAttributes', 'UInt32'),
4492 1
        ('DisplayName', 'LocalizedText'),
4493 1
        ('Description', 'LocalizedText'),
4494 1
        ('WriteMask', 'UInt32'),
4495 1
        ('UserWriteMask', 'UInt32'),
4496 1
               )
4497 1
4498 1
    def __init__(self, binary=None):
4499
        if binary is not None:
4500 1
            self._binary_init(binary)
4501
            self._freeze = True
4502
            return
4503
        self.SpecifiedAttributes = 0
4504
        self.DisplayName = LocalizedText()
4505
        self.Description = LocalizedText()
4506
        self.WriteMask = 0
4507
        self.UserWriteMask = 0
4508
        self._freeze = True
4509 1
4510
    def to_binary(self):
4511
        packet = []
4512 1
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4513
        packet.append(self.DisplayName.to_binary())
4514
        packet.append(self.Description.to_binary())
4515
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4516
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4517
        return b''.join(packet)
4518
4519
    @staticmethod
4520
    def from_binary(data):
4521
        return NodeAttributes(data)
4522
4523
    def _binary_init(self, data):
4524
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4525
        self.DisplayName = LocalizedText.from_binary(data)
4526
        self.Description = LocalizedText.from_binary(data)
4527
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4528
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4529
4530 1
    def __str__(self):
4531
        return 'NodeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4532
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4533
               'Description:' + str(self.Description) + ', ' + \
4534
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4535
               'UserWriteMask:' + str(self.UserWriteMask) + ')'
4536
4537
    __repr__ = __str__
4538
4539 1
4540 1
class ObjectAttributes(FrozenClass):
4541 1
    '''
4542 1
    The attributes for an object node.
4543 1
4544 1
    :ivar SpecifiedAttributes:
4545 1
    :vartype SpecifiedAttributes: UInt32
4546 1
    :ivar DisplayName:
4547 1
    :vartype DisplayName: LocalizedText
4548 1
    :ivar Description:
4549 1
    :vartype Description: LocalizedText
4550 1
    :ivar WriteMask:
4551
    :vartype WriteMask: UInt32
4552 1
    :ivar UserWriteMask:
4553 1
    :vartype UserWriteMask: UInt32
4554 1
    :ivar EventNotifier:
4555 1
    :vartype EventNotifier: Byte
4556 1
    '''
4557 1
4558 1
    ua_types = (
4559 1
4560 1
        ('SpecifiedAttributes', 'UInt32'),
4561
        ('DisplayName', 'LocalizedText'),
4562 1
        ('Description', 'LocalizedText'),
4563
        ('WriteMask', 'UInt32'),
4564 1
        ('UserWriteMask', 'UInt32'),
4565
        ('EventNotifier', 'Byte'),
4566 1
               )
4567 1
4568 1
    def __init__(self, binary=None):
4569 1
        if binary is not None:
4570 1
            self._binary_init(binary)
4571 1
            self._freeze = True
4572 1
            return
4573
        self.SpecifiedAttributes = 0
4574 1
        self.DisplayName = LocalizedText()
4575
        self.Description = LocalizedText()
4576
        self.WriteMask = 0
4577
        self.UserWriteMask = 0
4578
        self.EventNotifier = 0
4579
        self._freeze = True
4580
4581
    def to_binary(self):
4582 1
        packet = []
4583
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4584
        packet.append(self.DisplayName.to_binary())
4585 1
        packet.append(self.Description.to_binary())
4586
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4587
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4588
        packet.append(uabin.Primitives.Byte.pack(self.EventNotifier))
4589
        return b''.join(packet)
4590
4591
    @staticmethod
4592
    def from_binary(data):
4593
        return ObjectAttributes(data)
4594
4595
    def _binary_init(self, data):
4596
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4597
        self.DisplayName = LocalizedText.from_binary(data)
4598
        self.Description = LocalizedText.from_binary(data)
4599
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4600
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4601
        self.EventNotifier = uabin.Primitives.Byte.unpack(data)
4602
4603
    def __str__(self):
4604
        return 'ObjectAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4605
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4606
               'Description:' + str(self.Description) + ', ' + \
4607
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4608
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4609
               'EventNotifier:' + str(self.EventNotifier) + ')'
4610
4611 1
    __repr__ = __str__
4612
4613
4614
class VariableAttributes(FrozenClass):
4615
    '''
4616
    The attributes for a variable node.
4617
4618
    :ivar SpecifiedAttributes:
4619
    :vartype SpecifiedAttributes: UInt32
4620
    :ivar DisplayName:
4621
    :vartype DisplayName: LocalizedText
4622
    :ivar Description:
4623
    :vartype Description: LocalizedText
4624 1
    :ivar WriteMask:
4625 1
    :vartype WriteMask: UInt32
4626
    :ivar UserWriteMask:
4627
    :vartype UserWriteMask: UInt32
4628
    :ivar Value:
4629 1
    :vartype Value: Variant
4630 1
    :ivar DataType:
4631 1
    :vartype DataType: NodeId
4632 1
    :ivar ValueRank:
4633 1
    :vartype ValueRank: Int32
4634 1
    :ivar ArrayDimensions:
4635 1
    :vartype ArrayDimensions: UInt32
4636 1
    :ivar AccessLevel:
4637 1
    :vartype AccessLevel: Byte
4638 1
    :ivar UserAccessLevel:
4639 1
    :vartype UserAccessLevel: Byte
4640
    :ivar MinimumSamplingInterval:
4641 1
    :vartype MinimumSamplingInterval: Double
4642
    :ivar Historizing:
4643
    :vartype Historizing: Boolean
4644
    '''
4645
4646
    ua_types = (
4647
4648
        ('SpecifiedAttributes', 'UInt32'),
4649
        ('DisplayName', 'LocalizedText'),
4650
        ('Description', 'LocalizedText'),
4651
        ('WriteMask', 'UInt32'),
4652
        ('UserWriteMask', 'UInt32'),
4653
        ('Value', 'Variant'),
4654
        ('DataType', 'NodeId'),
4655
        ('ValueRank', 'Int32'),
4656
        ('ArrayDimensions', 'ListOfUInt32'),
4657 1
        ('AccessLevel', 'Byte'),
4658
        ('UserAccessLevel', 'Byte'),
4659
        ('MinimumSamplingInterval', 'Double'),
4660
        ('Historizing', 'Boolean'),
4661 1
               )
4662
4663 View Code Duplication
    def __init__(self, binary=None):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4664
        if binary is not None:
4665
            self._binary_init(binary)
4666
            self._freeze = True
4667
            return
4668
        self.SpecifiedAttributes = 0
4669
        self.DisplayName = LocalizedText()
4670
        self.Description = LocalizedText()
4671
        self.WriteMask = 0
4672
        self.UserWriteMask = 0
4673 1
        self.Value = Variant()
4674
        self.DataType = NodeId()
4675
        self.ValueRank = 0
4676
        self.ArrayDimensions = []
4677
        self.AccessLevel = 0
4678
        self.UserAccessLevel = 0
4679
        self.MinimumSamplingInterval = 0
4680
        self.Historizing = True
4681
        self._freeze = True
4682
4683
    def to_binary(self):
4684
        packet = []
4685 1
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4686
        packet.append(self.DisplayName.to_binary())
4687
        packet.append(self.Description.to_binary())
4688 1
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4689
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4690
        packet.append(self.Value.to_binary())
4691
        packet.append(self.DataType.to_binary())
4692
        packet.append(uabin.Primitives.Int32.pack(self.ValueRank))
4693
        packet.append(uabin.Primitives.Int32.pack(len(self.ArrayDimensions)))
4694
        for fieldname in self.ArrayDimensions:
4695
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
4696
        packet.append(uabin.Primitives.Byte.pack(self.AccessLevel))
4697
        packet.append(uabin.Primitives.Byte.pack(self.UserAccessLevel))
4698
        packet.append(uabin.Primitives.Double.pack(self.MinimumSamplingInterval))
4699
        packet.append(uabin.Primitives.Boolean.pack(self.Historizing))
4700
        return b''.join(packet)
4701
4702
    @staticmethod
4703
    def from_binary(data):
4704
        return VariableAttributes(data)
4705
4706
    def _binary_init(self, data):
4707
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4708
        self.DisplayName = LocalizedText.from_binary(data)
4709
        self.Description = LocalizedText.from_binary(data)
4710 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4711
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4712
        self.Value = Variant.from_binary(data)
4713
        self.DataType = NodeId.from_binary(data)
4714
        self.ValueRank = uabin.Primitives.Int32.unpack(data)
4715
        self.ArrayDimensions = uabin.Primitives.UInt32.unpack_array(data)
4716
        self.AccessLevel = uabin.Primitives.Byte.unpack(data)
4717
        self.UserAccessLevel = uabin.Primitives.Byte.unpack(data)
4718
        self.MinimumSamplingInterval = uabin.Primitives.Double.unpack(data)
4719
        self.Historizing = uabin.Primitives.Boolean.unpack(data)
4720
4721 1
    def __str__(self):
4722 1
        return 'VariableAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4723
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4724
               'Description:' + str(self.Description) + ', ' + \
4725
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4726 1
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4727 1
               'Value:' + str(self.Value) + ', ' + \
4728 1
               'DataType:' + str(self.DataType) + ', ' + \
4729 1
               'ValueRank:' + str(self.ValueRank) + ', ' + \
4730 1
               'ArrayDimensions:' + str(self.ArrayDimensions) + ', ' + \
4731 1
               'AccessLevel:' + str(self.AccessLevel) + ', ' + \
4732 1
               'UserAccessLevel:' + str(self.UserAccessLevel) + ', ' + \
4733 1
               'MinimumSamplingInterval:' + str(self.MinimumSamplingInterval) + ', ' + \
4734 1
               'Historizing:' + str(self.Historizing) + ')'
4735
4736 1
    __repr__ = __str__
4737
4738
4739
class MethodAttributes(FrozenClass):
4740
    '''
4741
    The attributes for a method node.
4742
4743
    :ivar SpecifiedAttributes:
4744
    :vartype SpecifiedAttributes: UInt32
4745
    :ivar DisplayName:
4746
    :vartype DisplayName: LocalizedText
4747
    :ivar Description:
4748 1
    :vartype Description: LocalizedText
4749
    :ivar WriteMask:
4750
    :vartype WriteMask: UInt32
4751
    :ivar UserWriteMask:
4752 1
    :vartype UserWriteMask: UInt32
4753
    :ivar Executable:
4754
    :vartype Executable: Boolean
4755
    :ivar UserExecutable:
4756
    :vartype UserExecutable: Boolean
4757
    '''
4758
4759
    ua_types = (
4760
4761
        ('SpecifiedAttributes', 'UInt32'),
4762 1
        ('DisplayName', 'LocalizedText'),
4763
        ('Description', 'LocalizedText'),
4764
        ('WriteMask', 'UInt32'),
4765
        ('UserWriteMask', 'UInt32'),
4766
        ('Executable', 'Boolean'),
4767
        ('UserExecutable', 'Boolean'),
4768
               )
4769
4770
    def __init__(self, binary=None):
4771
        if binary is not None:
4772 1
            self._binary_init(binary)
4773
            self._freeze = True
4774
            return
4775 1
        self.SpecifiedAttributes = 0
4776
        self.DisplayName = LocalizedText()
4777
        self.Description = LocalizedText()
4778
        self.WriteMask = 0
4779
        self.UserWriteMask = 0
4780
        self.Executable = True
4781
        self.UserExecutable = True
4782
        self._freeze = True
4783
4784
    def to_binary(self):
4785
        packet = []
4786
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4787
        packet.append(self.DisplayName.to_binary())
4788
        packet.append(self.Description.to_binary())
4789
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4790
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4791
        packet.append(uabin.Primitives.Boolean.pack(self.Executable))
4792
        packet.append(uabin.Primitives.Boolean.pack(self.UserExecutable))
4793 1
        return b''.join(packet)
4794
4795
    @staticmethod
4796
    def from_binary(data):
4797
        return MethodAttributes(data)
4798
4799
    def _binary_init(self, data):
4800
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4801
        self.DisplayName = LocalizedText.from_binary(data)
4802 1
        self.Description = LocalizedText.from_binary(data)
4803 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4804 1
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4805 1
        self.Executable = uabin.Primitives.Boolean.unpack(data)
4806 1
        self.UserExecutable = uabin.Primitives.Boolean.unpack(data)
4807 1
4808 1
    def __str__(self):
4809 1
        return 'MethodAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4810 1
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4811 1
               'Description:' + str(self.Description) + ', ' + \
4812 1
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4813 1
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4814
               'Executable:' + str(self.Executable) + ', ' + \
4815 1
               'UserExecutable:' + str(self.UserExecutable) + ')'
4816 1
4817 1
    __repr__ = __str__
4818 1
4819 1
4820 1
class ObjectTypeAttributes(FrozenClass):
4821 1
    '''
4822 1
    The attributes for an object type node.
4823 1
4824
    :ivar SpecifiedAttributes:
4825 1
    :vartype SpecifiedAttributes: UInt32
4826
    :ivar DisplayName:
4827 1
    :vartype DisplayName: LocalizedText
4828
    :ivar Description:
4829 1
    :vartype Description: LocalizedText
4830 1
    :ivar WriteMask:
4831 1
    :vartype WriteMask: UInt32
4832 1
    :ivar UserWriteMask:
4833 1
    :vartype UserWriteMask: UInt32
4834 1
    :ivar IsAbstract:
4835 1
    :vartype IsAbstract: Boolean
4836
    '''
4837 1
4838
    ua_types = (
4839
4840
        ('SpecifiedAttributes', 'UInt32'),
4841
        ('DisplayName', 'LocalizedText'),
4842
        ('Description', 'LocalizedText'),
4843
        ('WriteMask', 'UInt32'),
4844
        ('UserWriteMask', 'UInt32'),
4845 1
        ('IsAbstract', 'Boolean'),
4846
               )
4847
4848 1
    def __init__(self, binary=None):
4849
        if binary is not None:
4850
            self._binary_init(binary)
4851
            self._freeze = True
4852
            return
4853
        self.SpecifiedAttributes = 0
4854
        self.DisplayName = LocalizedText()
4855
        self.Description = LocalizedText()
4856
        self.WriteMask = 0
4857
        self.UserWriteMask = 0
4858
        self.IsAbstract = True
4859
        self._freeze = True
4860
4861
    def to_binary(self):
4862
        packet = []
4863
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4864
        packet.append(self.DisplayName.to_binary())
4865
        packet.append(self.Description.to_binary())
4866
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4867
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4868 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsAbstract))
4869
        return b''.join(packet)
4870
4871
    @staticmethod
4872
    def from_binary(data):
4873
        return ObjectTypeAttributes(data)
4874
4875
    def _binary_init(self, data):
4876
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4877
        self.DisplayName = LocalizedText.from_binary(data)
4878 1
        self.Description = LocalizedText.from_binary(data)
4879
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4880
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4881
        self.IsAbstract = uabin.Primitives.Boolean.unpack(data)
4882
4883
    def __str__(self):
4884
        return 'ObjectTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4885
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4886
               'Description:' + str(self.Description) + ', ' + \
4887
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4888
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4889
               'IsAbstract:' + str(self.IsAbstract) + ')'
4890
4891
    __repr__ = __str__
4892 1
4893
4894
class VariableTypeAttributes(FrozenClass):
4895
    '''
4896
    The attributes for a variable type node.
4897
4898
    :ivar SpecifiedAttributes:
4899
    :vartype SpecifiedAttributes: UInt32
4900
    :ivar DisplayName:
4901
    :vartype DisplayName: LocalizedText
4902
    :ivar Description:
4903 1
    :vartype Description: LocalizedText
4904
    :ivar WriteMask:
4905
    :vartype WriteMask: UInt32
4906
    :ivar UserWriteMask:
4907 1
    :vartype UserWriteMask: UInt32
4908
    :ivar Value:
4909
    :vartype Value: Variant
4910
    :ivar DataType:
4911
    :vartype DataType: NodeId
4912
    :ivar ValueRank:
4913
    :vartype ValueRank: Int32
4914
    :ivar ArrayDimensions:
4915
    :vartype ArrayDimensions: UInt32
4916 1
    :ivar IsAbstract:
4917
    :vartype IsAbstract: Boolean
4918
    '''
4919
4920
    ua_types = (
4921
4922
        ('SpecifiedAttributes', 'UInt32'),
4923
        ('DisplayName', 'LocalizedText'),
4924
        ('Description', 'LocalizedText'),
4925 1
        ('WriteMask', 'UInt32'),
4926
        ('UserWriteMask', 'UInt32'),
4927
        ('Value', 'Variant'),
4928 1
        ('DataType', 'NodeId'),
4929
        ('ValueRank', 'Int32'),
4930
        ('ArrayDimensions', 'ListOfUInt32'),
4931
        ('IsAbstract', 'Boolean'),
4932
               )
4933
4934
    def __init__(self, binary=None):
4935
        if binary is not None:
4936
            self._binary_init(binary)
4937 View Code Duplication
            self._freeze = True
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4938
            return
4939
        self.SpecifiedAttributes = 0
4940
        self.DisplayName = LocalizedText()
4941
        self.Description = LocalizedText()
4942
        self.WriteMask = 0
4943
        self.UserWriteMask = 0
4944
        self.Value = Variant()
4945
        self.DataType = NodeId()
4946
        self.ValueRank = 0
4947
        self.ArrayDimensions = []
4948 1
        self.IsAbstract = True
4949
        self._freeze = True
4950
4951
    def to_binary(self):
4952
        packet = []
4953
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4954
        packet.append(self.DisplayName.to_binary())
4955
        packet.append(self.Description.to_binary())
4956
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4957
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4958 1
        packet.append(self.Value.to_binary())
4959 1
        packet.append(self.DataType.to_binary())
4960 1
        packet.append(uabin.Primitives.Int32.pack(self.ValueRank))
4961 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ArrayDimensions)))
4962 1
        for fieldname in self.ArrayDimensions:
4963 1
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
4964 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsAbstract))
4965 1
        return b''.join(packet)
4966 1
4967 1
    @staticmethod
4968 1
    def from_binary(data):
4969 1
        return VariableTypeAttributes(data)
4970 1
4971
    def _binary_init(self, data):
4972 1
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4973 1
        self.DisplayName = LocalizedText.from_binary(data)
4974 1
        self.Description = LocalizedText.from_binary(data)
4975 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4976 1
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4977 1
        self.Value = Variant.from_binary(data)
4978 1
        self.DataType = NodeId.from_binary(data)
4979 1
        self.ValueRank = uabin.Primitives.Int32.unpack(data)
4980 1
        self.ArrayDimensions = uabin.Primitives.UInt32.unpack_array(data)
4981 1
        self.IsAbstract = uabin.Primitives.Boolean.unpack(data)
4982
4983 1
    def __str__(self):
4984
        return 'VariableTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4985 1
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4986
               'Description:' + str(self.Description) + ', ' + \
4987 1
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4988 1
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4989 1
               'Value:' + str(self.Value) + ', ' + \
4990 1
               'DataType:' + str(self.DataType) + ', ' + \
4991 1
               'ValueRank:' + str(self.ValueRank) + ', ' + \
4992 1
               'ArrayDimensions:' + str(self.ArrayDimensions) + ', ' + \
4993 1
               'IsAbstract:' + str(self.IsAbstract) + ')'
4994 1
4995
    __repr__ = __str__
4996 1
4997
4998
class ReferenceTypeAttributes(FrozenClass):
4999
    '''
5000
    The attributes for a reference type node.
5001
5002
    :ivar SpecifiedAttributes:
5003
    :vartype SpecifiedAttributes: UInt32
5004
    :ivar DisplayName:
5005 1
    :vartype DisplayName: LocalizedText
5006
    :ivar Description:
5007
    :vartype Description: LocalizedText
5008 1
    :ivar WriteMask:
5009
    :vartype WriteMask: UInt32
5010
    :ivar UserWriteMask:
5011
    :vartype UserWriteMask: UInt32
5012
    :ivar IsAbstract:
5013
    :vartype IsAbstract: Boolean
5014
    :ivar Symmetric:
5015
    :vartype Symmetric: Boolean
5016
    :ivar InverseName:
5017
    :vartype InverseName: LocalizedText
5018 1
    '''
5019
5020
    ua_types = (
5021
5022
        ('SpecifiedAttributes', 'UInt32'),
5023 1
        ('DisplayName', 'LocalizedText'),
5024 1
        ('Description', 'LocalizedText'),
5025 1
        ('WriteMask', 'UInt32'),
5026 1
        ('UserWriteMask', 'UInt32'),
5027 1
        ('IsAbstract', 'Boolean'),
5028 1
        ('Symmetric', 'Boolean'),
5029 1
        ('InverseName', 'LocalizedText'),
5030 1
               )
5031
5032 1
    def __init__(self, binary=None):
5033 1
        if binary is not None:
5034 1
            self._binary_init(binary)
5035 1
            self._freeze = True
5036 1
            return
5037
        self.SpecifiedAttributes = 0
5038 1
        self.DisplayName = LocalizedText()
5039
        self.Description = LocalizedText()
5040 1
        self.WriteMask = 0
5041
        self.UserWriteMask = 0
5042 1
        self.IsAbstract = True
5043 1
        self.Symmetric = True
5044 1
        self.InverseName = LocalizedText()
5045
        self._freeze = True
5046 1
5047
    def to_binary(self):
5048
        packet = []
5049
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
5050 1
        packet.append(self.DisplayName.to_binary())
5051
        packet.append(self.Description.to_binary())
5052
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
5053 1
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
5054
        packet.append(uabin.Primitives.Boolean.pack(self.IsAbstract))
5055
        packet.append(uabin.Primitives.Boolean.pack(self.Symmetric))
5056
        packet.append(self.InverseName.to_binary())
5057
        return b''.join(packet)
5058
5059 1
    @staticmethod
5060
    def from_binary(data):
5061
        return ReferenceTypeAttributes(data)
5062
5063 1
    def _binary_init(self, data):
5064 1
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
5065 1
        self.DisplayName = LocalizedText.from_binary(data)
5066 1
        self.Description = LocalizedText.from_binary(data)
5067 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
5068 1
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
5069 1
        self.IsAbstract = uabin.Primitives.Boolean.unpack(data)
5070
        self.Symmetric = uabin.Primitives.Boolean.unpack(data)
5071 1
        self.InverseName = LocalizedText.from_binary(data)
5072 1
5073 1
    def __str__(self):
5074 1
        return 'ReferenceTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
5075 1
               'DisplayName:' + str(self.DisplayName) + ', ' + \
5076 1
               'Description:' + str(self.Description) + ', ' + \
5077
               'WriteMask:' + str(self.WriteMask) + ', ' + \
5078 1
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
5079
               'IsAbstract:' + str(self.IsAbstract) + ', ' + \
5080 1
               'Symmetric:' + str(self.Symmetric) + ', ' + \
5081
               'InverseName:' + str(self.InverseName) + ')'
5082 1
5083 1
    __repr__ = __str__
5084 1
5085 1
5086 1
class DataTypeAttributes(FrozenClass):
5087 1
    '''
5088 1
    The attributes for a data type node.
5089
5090 1
    :ivar SpecifiedAttributes:
5091
    :vartype SpecifiedAttributes: UInt32
5092
    :ivar DisplayName:
5093 1
    :vartype DisplayName: LocalizedText
5094
    :ivar Description:
5095
    :vartype Description: LocalizedText
5096 1
    :ivar WriteMask:
5097
    :vartype WriteMask: UInt32
5098
    :ivar UserWriteMask:
5099
    :vartype UserWriteMask: UInt32
5100
    :ivar IsAbstract:
5101
    :vartype IsAbstract: Boolean
5102
    '''
5103
5104
    ua_types = (
5105
5106
        ('SpecifiedAttributes', 'UInt32'),
5107
        ('DisplayName', 'LocalizedText'),
5108 1
        ('Description', 'LocalizedText'),
5109
        ('WriteMask', 'UInt32'),
5110
        ('UserWriteMask', 'UInt32'),
5111
        ('IsAbstract', 'Boolean'),
5112
               )
5113
5114 1
    def __init__(self, binary=None):
5115 1
        if binary is not None:
5116
            self._binary_init(binary)
5117
            self._freeze = True
5118
            return
5119 1
        self.SpecifiedAttributes = 0
5120 1
        self.DisplayName = LocalizedText()
5121 1
        self.Description = LocalizedText()
5122 1
        self.WriteMask = 0
5123
        self.UserWriteMask = 0
5124 1
        self.IsAbstract = True
5125 1
        self._freeze = True
5126 1
5127 1
    def to_binary(self):
5128 1
        packet = []
5129 1
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
5130
        packet.append(self.DisplayName.to_binary())
5131 1
        packet.append(self.Description.to_binary())
5132
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
5133
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
5134
        packet.append(uabin.Primitives.Boolean.pack(self.IsAbstract))
5135 1
        return b''.join(packet)
5136
5137
    @staticmethod
5138
    def from_binary(data):
5139
        return DataTypeAttributes(data)
5140 1
5141
    def _binary_init(self, data):
5142
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
5143
        self.DisplayName = LocalizedText.from_binary(data)
5144
        self.Description = LocalizedText.from_binary(data)
5145 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
5146
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
5147
        self.IsAbstract = uabin.Primitives.Boolean.unpack(data)
5148 1
5149
    def __str__(self):
5150
        return 'DataTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
5151
               'DisplayName:' + str(self.DisplayName) + ', ' + \
5152
               'Description:' + str(self.Description) + ', ' + \
5153
               'WriteMask:' + str(self.WriteMask) + ', ' + \
5154
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
5155
               'IsAbstract:' + str(self.IsAbstract) + ')'
5156
5157 View Code Duplication
    __repr__ = __str__
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5158
5159
5160
class ViewAttributes(FrozenClass):
5161
    '''
5162 1
    The attributes for a view node.
5163
5164
    :ivar SpecifiedAttributes:
5165
    :vartype SpecifiedAttributes: UInt32
5166
    :ivar DisplayName:
5167
    :vartype DisplayName: LocalizedText
5168
    :ivar Description:
5169 1
    :vartype Description: LocalizedText
5170 1
    :ivar WriteMask:
5171 1
    :vartype WriteMask: UInt32
5172 1
    :ivar UserWriteMask:
5173 1
    :vartype UserWriteMask: UInt32
5174 1
    :ivar ContainsNoLoops:
5175 1
    :vartype ContainsNoLoops: Boolean
5176 1
    :ivar EventNotifier:
5177 1
    :vartype EventNotifier: Byte
5178 1
    '''
5179
5180 1
    ua_types = (
5181 1
5182 1
        ('SpecifiedAttributes', 'UInt32'),
5183 1
        ('DisplayName', 'LocalizedText'),
5184 1
        ('Description', 'LocalizedText'),
5185 1
        ('WriteMask', 'UInt32'),
5186 1
        ('UserWriteMask', 'UInt32'),
5187 1
        ('ContainsNoLoops', 'Boolean'),
5188 1
        ('EventNotifier', 'Byte'),
5189
               )
5190 1
5191
    def __init__(self, binary=None):
5192 1
        if binary is not None:
5193
            self._binary_init(binary)
5194 1
            self._freeze = True
5195
            return
5196 1
        self.SpecifiedAttributes = 0
5197 1
        self.DisplayName = LocalizedText()
5198 1
        self.Description = LocalizedText()
5199 1
        self.WriteMask = 0
5200 1
        self.UserWriteMask = 0
5201 1
        self.ContainsNoLoops = True
5202 1
        self.EventNotifier = 0
5203 1
        self._freeze = True
5204 1
5205 1
    def to_binary(self):
5206 1
        packet = []
5207 1
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
5208 1
        packet.append(self.DisplayName.to_binary())
5209
        packet.append(self.Description.to_binary())
5210 1
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
5211
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
5212 1
        packet.append(uabin.Primitives.Boolean.pack(self.ContainsNoLoops))
5213
        packet.append(uabin.Primitives.Byte.pack(self.EventNotifier))
5214
        return b''.join(packet)
5215
5216
    @staticmethod
5217
    def from_binary(data):
5218 1
        return ViewAttributes(data)
5219
5220
    def _binary_init(self, data):
5221 1
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
5222
        self.DisplayName = LocalizedText.from_binary(data)
5223
        self.Description = LocalizedText.from_binary(data)
5224
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
5225
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
5226
        self.ContainsNoLoops = uabin.Primitives.Boolean.unpack(data)
5227
        self.EventNotifier = uabin.Primitives.Byte.unpack(data)
5228
5229
    def __str__(self):
5230
        return 'ViewAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
5231
               'DisplayName:' + str(self.DisplayName) + ', ' + \
5232
               'Description:' + str(self.Description) + ', ' + \
5233
               'WriteMask:' + str(self.WriteMask) + ', ' + \
5234
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
5235
               'ContainsNoLoops:' + str(self.ContainsNoLoops) + ', ' + \
5236
               'EventNotifier:' + str(self.EventNotifier) + ')'
5237
5238
    __repr__ = __str__
5239 1
5240
5241
class AddNodesItem(FrozenClass):
5242
    '''
5243
    A request to add a node to the server address space.
5244
5245
    :ivar ParentNodeId:
5246
    :vartype ParentNodeId: ExpandedNodeId
5247
    :ivar ReferenceTypeId:
5248 1
    :vartype ReferenceTypeId: NodeId
5249 1
    :ivar RequestedNewNodeId:
5250 1
    :vartype RequestedNewNodeId: ExpandedNodeId
5251 1
    :ivar BrowseName:
5252 1
    :vartype BrowseName: QualifiedName
5253 1
    :ivar NodeClass:
5254 1
    :vartype NodeClass: NodeClass
5255 1
    :ivar NodeAttributes:
5256 1
    :vartype NodeAttributes: ExtensionObject
5257 1
    :ivar TypeDefinition:
5258 1
    :vartype TypeDefinition: ExpandedNodeId
5259 1
    '''
5260
5261 1
    ua_types = (
5262 1
5263 1
        ('ParentNodeId', 'ExpandedNodeId'),
5264 1
        ('ReferenceTypeId', 'NodeId'),
5265 1
        ('RequestedNewNodeId', 'ExpandedNodeId'),
5266 1
        ('BrowseName', 'QualifiedName'),
5267 1
        ('NodeClass', 'NodeClass'),
5268 1
        ('NodeAttributes', 'ExtensionObject'),
5269 1
        ('TypeDefinition', 'ExpandedNodeId'),
5270
               )
5271 1
5272
    def __init__(self, binary=None):
5273 1
        if binary is not None:
5274
            self._binary_init(binary)
5275 1
            self._freeze = True
5276 1
            return
5277 1
        self.ParentNodeId = ExpandedNodeId()
5278 1
        self.ReferenceTypeId = NodeId()
5279 1
        self.RequestedNewNodeId = ExpandedNodeId()
5280 1
        self.BrowseName = QualifiedName()
5281 1
        self.NodeClass = NodeClass(0)
5282
        self.NodeAttributes = None
5283 1
        self.TypeDefinition = ExpandedNodeId()
5284
        self._freeze = True
5285
5286 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...
5287
        packet = []
5288
        packet.append(self.ParentNodeId.to_binary())
5289
        packet.append(self.ReferenceTypeId.to_binary())
5290
        packet.append(self.RequestedNewNodeId.to_binary())
5291 1
        packet.append(self.BrowseName.to_binary())
5292
        packet.append(uabin.Primitives.UInt32.pack(self.NodeClass.value))
5293
        packet.append(extensionobject_to_binary(self.NodeAttributes))
5294 1
        packet.append(self.TypeDefinition.to_binary())
5295
        return b''.join(packet)
5296
5297
    @staticmethod
5298
    def from_binary(data):
5299
        return AddNodesItem(data)
5300 1
5301
    def _binary_init(self, data):
5302
        self.ParentNodeId = ExpandedNodeId.from_binary(data)
5303
        self.ReferenceTypeId = NodeId.from_binary(data)
5304 1
        self.RequestedNewNodeId = ExpandedNodeId.from_binary(data)
5305 1
        self.BrowseName = QualifiedName.from_binary(data)
5306 1
        self.NodeClass = NodeClass(uabin.Primitives.UInt32.unpack(data))
5307 1
        self.NodeAttributes = extensionobject_from_binary(data)
5308 1
        self.TypeDefinition = ExpandedNodeId.from_binary(data)
5309 1
5310 1
    def __str__(self):
5311
        return 'AddNodesItem(' + 'ParentNodeId:' + str(self.ParentNodeId) + ', ' + \
5312 1
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
5313 1
               'RequestedNewNodeId:' + str(self.RequestedNewNodeId) + ', ' + \
5314 1
               'BrowseName:' + str(self.BrowseName) + ', ' + \
5315 1
               'NodeClass:' + str(self.NodeClass) + ', ' + \
5316 1
               'NodeAttributes:' + str(self.NodeAttributes) + ', ' + \
5317 1
               'TypeDefinition:' + str(self.TypeDefinition) + ')'
5318
5319 1
    __repr__ = __str__
5320
5321 1
5322
class AddNodesResult(FrozenClass):
5323 1
    '''
5324 1
    A result of an add node operation.
5325 1
5326 1
    :ivar StatusCode:
5327 1
    :vartype StatusCode: StatusCode
5328 1
    :ivar AddedNodeId:
5329 1
    :vartype AddedNodeId: NodeId
5330
    '''
5331 1
5332
    ua_types = (
5333
5334 1
        ('StatusCode', 'StatusCode'),
5335
        ('AddedNodeId', 'NodeId'),
5336
               )
5337 1
5338
    def __init__(self, binary=None):
5339
        if binary is not None:
5340
            self._binary_init(binary)
5341
            self._freeze = True
5342
            return
5343
        self.StatusCode = StatusCode()
5344
        self.AddedNodeId = NodeId()
5345
        self._freeze = True
5346
5347
    def to_binary(self):
5348
        packet = []
5349 1
        packet.append(self.StatusCode.to_binary())
5350
        packet.append(self.AddedNodeId.to_binary())
5351
        return b''.join(packet)
5352
5353
    @staticmethod
5354
    def from_binary(data):
5355 1
        return AddNodesResult(data)
5356 1
5357
    def _binary_init(self, data):
5358
        self.StatusCode = StatusCode.from_binary(data)
5359
        self.AddedNodeId = NodeId.from_binary(data)
5360 1
5361 1
    def __str__(self):
5362 1
        return 'AddNodesResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
5363 1
               'AddedNodeId:' + str(self.AddedNodeId) + ')'
5364
5365 1
    __repr__ = __str__
5366 1
5367 1
5368 1
class AddNodesParameters(FrozenClass):
5369 1
    '''
5370 1
    :ivar NodesToAdd:
5371
    :vartype NodesToAdd: AddNodesItem
5372 1
    '''
5373
5374
    ua_types = (
5375
5376 1
        ('NodesToAdd', 'ListOfAddNodesItem'),
5377
               )
5378
5379
    def __init__(self, binary=None):
5380
        if binary is not None:
5381 1
            self._binary_init(binary)
5382
            self._freeze = True
5383
            return
5384
        self.NodesToAdd = []
5385
        self._freeze = True
5386 1
5387
    def to_binary(self):
5388
        packet = []
5389 1
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToAdd)))
5390
        for fieldname in self.NodesToAdd:
5391
            packet.append(fieldname.to_binary())
5392
        return b''.join(packet)
5393
5394
    @staticmethod
5395
    def from_binary(data):
5396
        return AddNodesParameters(data)
5397
5398 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...
5399
        length = uabin.Primitives.Int32.unpack(data)
5400
        array = []
5401
        if length != -1:
5402
            for _ in range(0, length):
5403 1
                array.append(AddNodesItem.from_binary(data))
5404
        self.NodesToAdd = array
5405
5406
    def __str__(self):
5407
        return 'AddNodesParameters(' + 'NodesToAdd:' + str(self.NodesToAdd) + ')'
5408
5409
    __repr__ = __str__
5410 1
5411 1
5412 1
class AddNodesRequest(FrozenClass):
5413 1
    '''
5414 1
    Adds one or more nodes to the server address space.
5415 1
5416 1
    :ivar TypeId:
5417 1
    :vartype TypeId: NodeId
5418 1
    :ivar RequestHeader:
5419 1
    :vartype RequestHeader: RequestHeader
5420
    :ivar Parameters:
5421 1
    :vartype Parameters: AddNodesParameters
5422 1
    '''
5423 1
5424 1
    ua_types = (
5425 1
5426 1
        ('TypeId', 'NodeId'),
5427 1
        ('RequestHeader', 'RequestHeader'),
5428 1
        ('Parameters', 'AddNodesParameters'),
5429 1
               )
5430
5431 1
    def __init__(self, binary=None):
5432
        if binary is not None:
5433 1
            self._binary_init(binary)
5434
            self._freeze = True
5435 1
            return
5436
        self.TypeId = FourByteNodeId(ObjectIds.AddNodesRequest_Encoding_DefaultBinary)
5437 1
        self.RequestHeader = RequestHeader()
5438 1
        self.Parameters = AddNodesParameters()
5439 1
        self._freeze = True
5440 1
5441 1
    def to_binary(self):
5442 1
        packet = []
5443 1
        packet.append(self.TypeId.to_binary())
5444 1
        packet.append(self.RequestHeader.to_binary())
5445 1
        packet.append(self.Parameters.to_binary())
5446 1
        return b''.join(packet)
5447 1
5448 1
    @staticmethod
5449 1
    def from_binary(data):
5450
        return AddNodesRequest(data)
5451 1
5452
    def _binary_init(self, data):
5453 1
        self.TypeId = NodeId.from_binary(data)
5454
        self.RequestHeader = RequestHeader.from_binary(data)
5455
        self.Parameters = AddNodesParameters.from_binary(data)
5456
5457
    def __str__(self):
5458
        return 'AddNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5459 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5460
               'Parameters:' + str(self.Parameters) + ')'
5461
5462 1
    __repr__ = __str__
5463
5464
5465
class AddNodesResponse(FrozenClass):
5466
    '''
5467
    Adds one or more nodes to the server address space.
5468
5469
    :ivar TypeId:
5470
    :vartype TypeId: NodeId
5471
    :ivar ResponseHeader:
5472 1
    :vartype ResponseHeader: ResponseHeader
5473
    :ivar Results:
5474
    :vartype Results: AddNodesResult
5475
    :ivar DiagnosticInfos:
5476
    :vartype DiagnosticInfos: DiagnosticInfo
5477 1
    '''
5478 1
5479 1
    ua_types = (
5480 1
5481 1
        ('TypeId', 'NodeId'),
5482 1
        ('ResponseHeader', 'ResponseHeader'),
5483 1
        ('Results', 'ListOfAddNodesResult'),
5484 1
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
5485
               )
5486 1
5487 1
    def __init__(self, binary=None):
5488 1
        if binary is not None:
5489 1
            self._binary_init(binary)
5490 1
            self._freeze = True
5491
            return
5492 1
        self.TypeId = FourByteNodeId(ObjectIds.AddNodesResponse_Encoding_DefaultBinary)
5493
        self.ResponseHeader = ResponseHeader()
5494 1
        self.Results = []
5495
        self.DiagnosticInfos = []
5496 1
        self._freeze = True
5497 1
5498 1
    def to_binary(self):
5499
        packet = []
5500 1
        packet.append(self.TypeId.to_binary())
5501
        packet.append(self.ResponseHeader.to_binary())
5502
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
5503
        for fieldname in self.Results:
5504 1
            packet.append(fieldname.to_binary())
5505
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
5506
        for fieldname in self.DiagnosticInfos:
5507 1
            packet.append(fieldname.to_binary())
5508
        return b''.join(packet)
5509
5510
    @staticmethod
5511
    def from_binary(data):
5512
        return AddNodesResponse(data)
5513 1
5514
    def _binary_init(self, data):
5515
        self.TypeId = NodeId.from_binary(data)
5516
        self.ResponseHeader = ResponseHeader.from_binary(data)
5517 1
        length = uabin.Primitives.Int32.unpack(data)
5518 1
        array = []
5519 1
        if length != -1:
5520 1
            for _ in range(0, length):
5521 1
                array.append(AddNodesResult.from_binary(data))
5522 1
        self.Results = array
5523 1
        length = uabin.Primitives.Int32.unpack(data)
5524
        array = []
5525 1
        if length != -1:
5526 1
            for _ in range(0, length):
5527 1
                array.append(DiagnosticInfo.from_binary(data))
5528 1
        self.DiagnosticInfos = array
5529 1
5530 1
    def __str__(self):
5531
        return 'AddNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5532 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5533
               'Results:' + str(self.Results) + ', ' + \
5534 1
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5535
5536 1
    __repr__ = __str__
5537 1
5538 1
5539 1
class AddReferencesItem(FrozenClass):
5540 1
    '''
5541 1
    A request to add a reference to the server address space.
5542 1
5543
    :ivar SourceNodeId:
5544 1
    :vartype SourceNodeId: NodeId
5545
    :ivar ReferenceTypeId:
5546
    :vartype ReferenceTypeId: NodeId
5547 1
    :ivar IsForward:
5548
    :vartype IsForward: Boolean
5549
    :ivar TargetServerUri:
5550 1
    :vartype TargetServerUri: String
5551
    :ivar TargetNodeId:
5552
    :vartype TargetNodeId: ExpandedNodeId
5553
    :ivar TargetNodeClass:
5554
    :vartype TargetNodeClass: NodeClass
5555
    '''
5556
5557
    ua_types = (
5558
5559
        ('SourceNodeId', 'NodeId'),
5560
        ('ReferenceTypeId', 'NodeId'),
5561
        ('IsForward', 'Boolean'),
5562 1
        ('TargetServerUri', 'String'),
5563
        ('TargetNodeId', 'ExpandedNodeId'),
5564
        ('TargetNodeClass', 'NodeClass'),
5565
               )
5566
5567
    def __init__(self, binary=None):
5568 1
        if binary is not None:
5569 1
            self._binary_init(binary)
5570
            self._freeze = True
5571
            return
5572
        self.SourceNodeId = NodeId()
5573 1
        self.ReferenceTypeId = NodeId()
5574 1
        self.IsForward = True
5575 1
        self.TargetServerUri = None
5576 1
        self.TargetNodeId = ExpandedNodeId()
5577
        self.TargetNodeClass = NodeClass(0)
5578 1
        self._freeze = True
5579 1
5580 1
    def to_binary(self):
5581 1
        packet = []
5582 1
        packet.append(self.SourceNodeId.to_binary())
5583 1
        packet.append(self.ReferenceTypeId.to_binary())
5584
        packet.append(uabin.Primitives.Boolean.pack(self.IsForward))
5585 1
        packet.append(uabin.Primitives.String.pack(self.TargetServerUri))
5586
        packet.append(self.TargetNodeId.to_binary())
5587
        packet.append(uabin.Primitives.UInt32.pack(self.TargetNodeClass.value))
5588
        return b''.join(packet)
5589 1
5590
    @staticmethod
5591
    def from_binary(data):
5592
        return AddReferencesItem(data)
5593
5594 1
    def _binary_init(self, data):
5595
        self.SourceNodeId = NodeId.from_binary(data)
5596
        self.ReferenceTypeId = NodeId.from_binary(data)
5597
        self.IsForward = uabin.Primitives.Boolean.unpack(data)
5598
        self.TargetServerUri = uabin.Primitives.String.unpack(data)
5599 1
        self.TargetNodeId = ExpandedNodeId.from_binary(data)
5600
        self.TargetNodeClass = NodeClass(uabin.Primitives.UInt32.unpack(data))
5601
5602 1
    def __str__(self):
5603
        return 'AddReferencesItem(' + 'SourceNodeId:' + str(self.SourceNodeId) + ', ' + \
5604
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
5605
               'IsForward:' + str(self.IsForward) + ', ' + \
5606
               'TargetServerUri:' + str(self.TargetServerUri) + ', ' + \
5607
               'TargetNodeId:' + str(self.TargetNodeId) + ', ' + \
5608
               'TargetNodeClass:' + str(self.TargetNodeClass) + ')'
5609
5610
    __repr__ = __str__
5611 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5612
5613
class AddReferencesParameters(FrozenClass):
5614
    '''
5615
    :ivar ReferencesToAdd:
5616 1
    :vartype ReferencesToAdd: AddReferencesItem
5617
    '''
5618
5619
    ua_types = (
5620
5621
        ('ReferencesToAdd', 'ListOfAddReferencesItem'),
5622
               )
5623 1
5624 1
    def __init__(self, binary=None):
5625 1
        if binary is not None:
5626 1
            self._binary_init(binary)
5627 1
            self._freeze = True
5628 1
            return
5629 1
        self.ReferencesToAdd = []
5630 1
        self._freeze = True
5631 1
5632 1
    def to_binary(self):
5633
        packet = []
5634 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ReferencesToAdd)))
5635 1
        for fieldname in self.ReferencesToAdd:
5636 1
            packet.append(fieldname.to_binary())
5637 1
        return b''.join(packet)
5638 1
5639 1
    @staticmethod
5640 1
    def from_binary(data):
5641 1
        return AddReferencesParameters(data)
5642 1
5643
    def _binary_init(self, data):
5644 1
        length = uabin.Primitives.Int32.unpack(data)
5645
        array = []
5646 1
        if length != -1:
5647
            for _ in range(0, length):
5648 1
                array.append(AddReferencesItem.from_binary(data))
5649
        self.ReferencesToAdd = array
5650 1
5651 1
    def __str__(self):
5652 1
        return 'AddReferencesParameters(' + 'ReferencesToAdd:' + str(self.ReferencesToAdd) + ')'
5653 1
5654 1
    __repr__ = __str__
5655 1
5656 1
5657 1
class AddReferencesRequest(FrozenClass):
5658 1
    '''
5659 1
    Adds one or more references to the server address space.
5660 1
5661 1
    :ivar TypeId:
5662 1
    :vartype TypeId: NodeId
5663
    :ivar RequestHeader:
5664 1
    :vartype RequestHeader: RequestHeader
5665
    :ivar Parameters:
5666 1
    :vartype Parameters: AddReferencesParameters
5667
    '''
5668
5669
    ua_types = (
5670
5671
        ('TypeId', 'NodeId'),
5672 1
        ('RequestHeader', 'RequestHeader'),
5673
        ('Parameters', 'AddReferencesParameters'),
5674
               )
5675 1
5676
    def __init__(self, binary=None):
5677
        if binary is not None:
5678
            self._binary_init(binary)
5679
            self._freeze = True
5680
            return
5681
        self.TypeId = FourByteNodeId(ObjectIds.AddReferencesRequest_Encoding_DefaultBinary)
5682
        self.RequestHeader = RequestHeader()
5683
        self.Parameters = AddReferencesParameters()
5684 View Code Duplication
        self._freeze = True
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5685
5686
    def to_binary(self):
5687
        packet = []
5688
        packet.append(self.TypeId.to_binary())
5689
        packet.append(self.RequestHeader.to_binary())
5690
        packet.append(self.Parameters.to_binary())
5691 1
        return b''.join(packet)
5692
5693
    @staticmethod
5694
    def from_binary(data):
5695
        return AddReferencesRequest(data)
5696
5697
    def _binary_init(self, data):
5698
        self.TypeId = NodeId.from_binary(data)
5699 1
        self.RequestHeader = RequestHeader.from_binary(data)
5700
        self.Parameters = AddReferencesParameters.from_binary(data)
5701
5702
    def __str__(self):
5703
        return 'AddReferencesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5704
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5705
               'Parameters:' + str(self.Parameters) + ')'
5706
5707
    __repr__ = __str__
5708
5709
5710
class AddReferencesResponse(FrozenClass):
5711 1
    '''
5712
    Adds one or more references to the server address space.
5713
5714
    :ivar TypeId:
5715
    :vartype TypeId: NodeId
5716
    :ivar ResponseHeader:
5717
    :vartype ResponseHeader: ResponseHeader
5718
    :ivar Results:
5719
    :vartype Results: StatusCode
5720 1
    :ivar DiagnosticInfos:
5721
    :vartype DiagnosticInfos: DiagnosticInfo
5722
    '''
5723
5724 1
    ua_types = (
5725
5726
        ('TypeId', 'NodeId'),
5727
        ('ResponseHeader', 'ResponseHeader'),
5728
        ('Results', 'ListOfStatusCode'),
5729
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
5730
               )
5731 1
5732
    def __init__(self, binary=None):
5733
        if binary is not None:
5734
            self._binary_init(binary)
5735
            self._freeze = True
5736
            return
5737
        self.TypeId = FourByteNodeId(ObjectIds.AddReferencesResponse_Encoding_DefaultBinary)
5738 1
        self.ResponseHeader = ResponseHeader()
5739
        self.Results = []
5740
        self.DiagnosticInfos = []
5741 1
        self._freeze = True
5742
5743
    def to_binary(self):
5744
        packet = []
5745
        packet.append(self.TypeId.to_binary())
5746
        packet.append(self.ResponseHeader.to_binary())
5747 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
5748
        for fieldname in self.Results:
5749
            packet.append(fieldname.to_binary())
5750
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
5751 1
        for fieldname in self.DiagnosticInfos:
5752
            packet.append(fieldname.to_binary())
5753
        return b''.join(packet)
5754
5755
    @staticmethod
5756
    def from_binary(data):
5757
        return AddReferencesResponse(data)
5758
5759 1
    def _binary_init(self, data):
5760
        self.TypeId = NodeId.from_binary(data)
5761
        self.ResponseHeader = ResponseHeader.from_binary(data)
5762
        length = uabin.Primitives.Int32.unpack(data)
5763
        array = []
5764
        if length != -1:
5765
            for _ in range(0, length):
5766 1
                array.append(StatusCode.from_binary(data))
5767
        self.Results = array
5768
        length = uabin.Primitives.Int32.unpack(data)
5769
        array = []
5770 1
        if length != -1:
5771
            for _ in range(0, length):
5772
                array.append(DiagnosticInfo.from_binary(data))
5773
        self.DiagnosticInfos = array
5774
5775
    def __str__(self):
5776
        return 'AddReferencesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5777
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5778 1
               'Results:' + str(self.Results) + ', ' + \
5779
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5780
5781 1
    __repr__ = __str__
5782
5783
5784 1
class DeleteNodesItem(FrozenClass):
5785
    '''
5786
    A request to delete a node to the server address space.
5787
5788
    :ivar NodeId:
5789
    :vartype NodeId: NodeId
5790
    :ivar DeleteTargetReferences:
5791
    :vartype DeleteTargetReferences: Boolean
5792
    '''
5793
5794
    ua_types = (
5795
5796 1
        ('NodeId', 'NodeId'),
5797
        ('DeleteTargetReferences', 'Boolean'),
5798
               )
5799
5800
    def __init__(self, binary=None):
5801
        if binary is not None:
5802 1
            self._binary_init(binary)
5803
            self._freeze = True
5804
            return
5805
        self.NodeId = NodeId()
5806
        self.DeleteTargetReferences = True
5807
        self._freeze = True
5808
5809
    def to_binary(self):
5810
        packet = []
5811
        packet.append(self.NodeId.to_binary())
5812 1
        packet.append(uabin.Primitives.Boolean.pack(self.DeleteTargetReferences))
5813
        return b''.join(packet)
5814
5815
    @staticmethod
5816
    def from_binary(data):
5817
        return DeleteNodesItem(data)
5818
5819 1
    def _binary_init(self, data):
5820
        self.NodeId = NodeId.from_binary(data)
5821
        self.DeleteTargetReferences = uabin.Primitives.Boolean.unpack(data)
5822
5823 1
    def __str__(self):
5824
        return 'DeleteNodesItem(' + 'NodeId:' + str(self.NodeId) + ', ' + \
5825
               'DeleteTargetReferences:' + str(self.DeleteTargetReferences) + ')'
5826
5827
    __repr__ = __str__
5828 1
5829
5830
class DeleteNodesParameters(FrozenClass):
5831
    '''
5832
    :ivar NodesToDelete:
5833 1
    :vartype NodesToDelete: DeleteNodesItem
5834
    '''
5835
5836 1
    ua_types = (
5837
5838
        ('NodesToDelete', 'ListOfDeleteNodesItem'),
5839
               )
5840
5841
    def __init__(self, binary=None):
5842
        if binary is not None:
5843
            self._binary_init(binary)
5844 1
            self._freeze = True
5845
            return
5846
        self.NodesToDelete = []
5847
        self._freeze = True
5848
5849 1
    def to_binary(self):
5850
        packet = []
5851
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToDelete)))
5852
        for fieldname in self.NodesToDelete:
5853
            packet.append(fieldname.to_binary())
5854
        return b''.join(packet)
5855
5856
    @staticmethod
5857
    def from_binary(data):
5858 1
        return DeleteNodesParameters(data)
5859
5860
    def _binary_init(self, data):
5861
        length = uabin.Primitives.Int32.unpack(data)
5862
        array = []
5863
        if length != -1:
5864
            for _ in range(0, length):
5865
                array.append(DeleteNodesItem.from_binary(data))
5866
        self.NodesToDelete = array
5867
5868 1
    def __str__(self):
5869
        return 'DeleteNodesParameters(' + 'NodesToDelete:' + str(self.NodesToDelete) + ')'
5870
5871
    __repr__ = __str__
5872 1
5873
5874
class DeleteNodesRequest(FrozenClass):
5875
    '''
5876
    Delete one or more nodes from the server address space.
5877
5878
    :ivar TypeId:
5879
    :vartype TypeId: NodeId
5880
    :ivar RequestHeader:
5881
    :vartype RequestHeader: RequestHeader
5882
    :ivar Parameters:
5883
    :vartype Parameters: DeleteNodesParameters
5884
    '''
5885
5886 1
    ua_types = (
5887
5888
        ('TypeId', 'NodeId'),
5889
        ('RequestHeader', 'RequestHeader'),
5890 1
        ('Parameters', 'DeleteNodesParameters'),
5891
               )
5892
5893 1
    def __init__(self, binary=None):
5894
        if binary is not None:
5895
            self._binary_init(binary)
5896
            self._freeze = True
5897
            return
5898
        self.TypeId = FourByteNodeId(ObjectIds.DeleteNodesRequest_Encoding_DefaultBinary)
5899
        self.RequestHeader = RequestHeader()
5900
        self.Parameters = DeleteNodesParameters()
5901
        self._freeze = True
5902
5903
    def to_binary(self):
5904
        packet = []
5905 1
        packet.append(self.TypeId.to_binary())
5906
        packet.append(self.RequestHeader.to_binary())
5907
        packet.append(self.Parameters.to_binary())
5908
        return b''.join(packet)
5909
5910
    @staticmethod
5911 1
    def from_binary(data):
5912
        return DeleteNodesRequest(data)
5913
5914
    def _binary_init(self, data):
5915
        self.TypeId = NodeId.from_binary(data)
5916
        self.RequestHeader = RequestHeader.from_binary(data)
5917
        self.Parameters = DeleteNodesParameters.from_binary(data)
5918
5919
    def __str__(self):
5920
        return 'DeleteNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5921 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5922
               'Parameters:' + str(self.Parameters) + ')'
5923
5924
    __repr__ = __str__
5925
5926
5927
class DeleteNodesResponse(FrozenClass):
5928 1
    '''
5929
    Delete one or more nodes from the server address space.
5930
5931
    :ivar TypeId:
5932 1
    :vartype TypeId: NodeId
5933
    :ivar ResponseHeader:
5934
    :vartype ResponseHeader: ResponseHeader
5935
    :ivar Results:
5936
    :vartype Results: StatusCode
5937 1
    :ivar DiagnosticInfos:
5938
    :vartype DiagnosticInfos: DiagnosticInfo
5939
    '''
5940
5941
    ua_types = (
5942 1
5943
        ('TypeId', 'NodeId'),
5944
        ('ResponseHeader', 'ResponseHeader'),
5945 1
        ('Results', 'ListOfStatusCode'),
5946
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
5947
               )
5948
5949
    def __init__(self, binary=None):
5950
        if binary is not None:
5951
            self._binary_init(binary)
5952
            self._freeze = True
5953
            return
5954
        self.TypeId = FourByteNodeId(ObjectIds.DeleteNodesResponse_Encoding_DefaultBinary)
5955
        self.ResponseHeader = ResponseHeader()
5956
        self.Results = []
5957 1
        self.DiagnosticInfos = []
5958
        self._freeze = True
5959
5960
    def to_binary(self):
5961
        packet = []
5962
        packet.append(self.TypeId.to_binary())
5963 1
        packet.append(self.ResponseHeader.to_binary())
5964 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
5965 1
        for fieldname in self.Results:
5966 1
            packet.append(fieldname.to_binary())
5967 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
5968 1
        for fieldname in self.DiagnosticInfos:
5969 1
            packet.append(fieldname.to_binary())
5970 1
        return b''.join(packet)
5971 1
5972
    @staticmethod
5973 1
    def from_binary(data):
5974 1
        return DeleteNodesResponse(data)
5975 1
5976 1
    def _binary_init(self, data):
5977 1
        self.TypeId = NodeId.from_binary(data)
5978 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
5979
        length = uabin.Primitives.Int32.unpack(data)
5980 1
        array = []
5981
        if length != -1:
5982 1
            for _ in range(0, length):
5983
                array.append(StatusCode.from_binary(data))
5984 1
        self.Results = array
5985 1
        length = uabin.Primitives.Int32.unpack(data)
5986 1
        array = []
5987 1
        if length != -1:
5988
            for _ in range(0, length):
5989 1
                array.append(DiagnosticInfo.from_binary(data))
5990
        self.DiagnosticInfos = array
5991
5992
    def __str__(self):
5993
        return 'DeleteNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5994 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5995
               'Results:' + str(self.Results) + ', ' + \
5996
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5997 1
5998
    __repr__ = __str__
5999
6000
6001
class DeleteReferencesItem(FrozenClass):
6002
    '''
6003
    A request to delete a node from the server address space.
6004
6005
    :ivar SourceNodeId:
6006
    :vartype SourceNodeId: NodeId
6007
    :ivar ReferenceTypeId:
6008
    :vartype ReferenceTypeId: NodeId
6009
    :ivar IsForward:
6010
    :vartype IsForward: Boolean
6011
    :ivar TargetNodeId:
6012
    :vartype TargetNodeId: ExpandedNodeId
6013
    :ivar DeleteBidirectional:
6014
    :vartype DeleteBidirectional: Boolean
6015 1
    '''
6016
6017
    ua_types = (
6018
6019
        ('SourceNodeId', 'NodeId'),
6020
        ('ReferenceTypeId', 'NodeId'),
6021
        ('IsForward', 'Boolean'),
6022
        ('TargetNodeId', 'ExpandedNodeId'),
6023
        ('DeleteBidirectional', 'Boolean'),
6024 1
               )
6025 1
6026 1
    def __init__(self, binary=None):
6027 1
        if binary is not None:
6028 1
            self._binary_init(binary)
6029 1
            self._freeze = True
6030 1
            return
6031 1
        self.SourceNodeId = NodeId()
6032 1
        self.ReferenceTypeId = NodeId()
6033 1
        self.IsForward = True
6034 1
        self.TargetNodeId = ExpandedNodeId()
6035 1
        self.DeleteBidirectional = True
6036
        self._freeze = True
6037 1
6038 1
    def to_binary(self):
6039 1
        packet = []
6040 1
        packet.append(self.SourceNodeId.to_binary())
6041 1
        packet.append(self.ReferenceTypeId.to_binary())
6042 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsForward))
6043 1
        packet.append(self.TargetNodeId.to_binary())
6044 1
        packet.append(uabin.Primitives.Boolean.pack(self.DeleteBidirectional))
6045 1
        return b''.join(packet)
6046
6047 1
    @staticmethod
6048
    def from_binary(data):
6049 1
        return DeleteReferencesItem(data)
6050
6051 1
    def _binary_init(self, data):
6052 1
        self.SourceNodeId = NodeId.from_binary(data)
6053 1
        self.ReferenceTypeId = NodeId.from_binary(data)
6054 1
        self.IsForward = uabin.Primitives.Boolean.unpack(data)
6055 1
        self.TargetNodeId = ExpandedNodeId.from_binary(data)
6056 1
        self.DeleteBidirectional = uabin.Primitives.Boolean.unpack(data)
6057 1
6058
    def __str__(self):
6059 1
        return 'DeleteReferencesItem(' + 'SourceNodeId:' + str(self.SourceNodeId) + ', ' + \
6060
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
6061
               'IsForward:' + str(self.IsForward) + ', ' + \
6062
               'TargetNodeId:' + str(self.TargetNodeId) + ', ' + \
6063
               'DeleteBidirectional:' + str(self.DeleteBidirectional) + ')'
6064
6065
    __repr__ = __str__
6066
6067 1
6068
class DeleteReferencesParameters(FrozenClass):
6069
    '''
6070 1
    :ivar ReferencesToDelete:
6071
    :vartype ReferencesToDelete: DeleteReferencesItem
6072
    '''
6073
6074
    ua_types = (
6075
6076
        ('ReferencesToDelete', 'ListOfDeleteReferencesItem'),
6077
               )
6078
6079 View Code Duplication
    def __init__(self, binary=None):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6080
        if binary is not None:
6081
            self._binary_init(binary)
6082
            self._freeze = True
6083
            return
6084
        self.ReferencesToDelete = []
6085
        self._freeze = True
6086
6087
    def to_binary(self):
6088
        packet = []
6089
        packet.append(uabin.Primitives.Int32.pack(len(self.ReferencesToDelete)))
6090 1
        for fieldname in self.ReferencesToDelete:
6091
            packet.append(fieldname.to_binary())
6092
        return b''.join(packet)
6093
6094
    @staticmethod
6095
    def from_binary(data):
6096
        return DeleteReferencesParameters(data)
6097
6098
    def _binary_init(self, data):
6099
        length = uabin.Primitives.Int32.unpack(data)
6100 1
        array = []
6101 1
        if length != -1:
6102 1
            for _ in range(0, length):
6103 1
                array.append(DeleteReferencesItem.from_binary(data))
6104 1
        self.ReferencesToDelete = array
6105 1
6106 1
    def __str__(self):
6107 1
        return 'DeleteReferencesParameters(' + 'ReferencesToDelete:' + str(self.ReferencesToDelete) + ')'
6108 1
6109 1
    __repr__ = __str__
6110 1
6111 1
6112 1
class DeleteReferencesRequest(FrozenClass):
6113
    '''
6114 1
    Delete one or more references from the server address space.
6115 1
6116 1
    :ivar TypeId:
6117 1
    :vartype TypeId: NodeId
6118 1
    :ivar RequestHeader:
6119 1
    :vartype RequestHeader: RequestHeader
6120 1
    :ivar Parameters:
6121 1
    :vartype Parameters: DeleteReferencesParameters
6122 1
    '''
6123 1
6124
    ua_types = (
6125 1
6126
        ('TypeId', 'NodeId'),
6127 1
        ('RequestHeader', 'RequestHeader'),
6128
        ('Parameters', 'DeleteReferencesParameters'),
6129 1
               )
6130 1
6131 1
    def __init__(self, binary=None):
6132 1
        if binary is not None:
6133 1
            self._binary_init(binary)
6134 1
            self._freeze = True
6135 1
            return
6136 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteReferencesRequest_Encoding_DefaultBinary)
6137
        self.RequestHeader = RequestHeader()
6138 1
        self.Parameters = DeleteReferencesParameters()
6139
        self._freeze = True
6140
6141
    def to_binary(self):
6142
        packet = []
6143
        packet.append(self.TypeId.to_binary())
6144
        packet.append(self.RequestHeader.to_binary())
6145
        packet.append(self.Parameters.to_binary())
6146
        return b''.join(packet)
6147 1
6148
    @staticmethod
6149
    def from_binary(data):
6150 1
        return DeleteReferencesRequest(data)
6151
6152
    def _binary_init(self, data):
6153
        self.TypeId = NodeId.from_binary(data)
6154
        self.RequestHeader = RequestHeader.from_binary(data)
6155
        self.Parameters = DeleteReferencesParameters.from_binary(data)
6156
6157
    def __str__(self):
6158
        return 'DeleteReferencesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6159
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
6160
               'Parameters:' + str(self.Parameters) + ')'
6161
6162 1
    __repr__ = __str__
6163
6164
6165
class DeleteReferencesResult(FrozenClass):
6166
    '''
6167
    :ivar Results:
6168 1
    :vartype Results: StatusCode
6169 1
    :ivar DiagnosticInfos:
6170 1
    :vartype DiagnosticInfos: DiagnosticInfo
6171 1
    '''
6172 1
6173 1
    ua_types = (
6174 1
6175 1
        ('Results', 'ListOfStatusCode'),
6176 1
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
6177
               )
6178 1
6179 1
    def __init__(self, binary=None):
6180 1
        if binary is not None:
6181 1
            self._binary_init(binary)
6182 1
            self._freeze = True
6183 1
            return
6184 1
        self.Results = []
6185 1
        self.DiagnosticInfos = []
6186
        self._freeze = True
6187 1
6188
    def to_binary(self):
6189 1
        packet = []
6190
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
6191 1
        for fieldname in self.Results:
6192 1
            packet.append(fieldname.to_binary())
6193 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
6194 1
        for fieldname in self.DiagnosticInfos:
6195 1
            packet.append(fieldname.to_binary())
6196 1
        return b''.join(packet)
6197 1
6198 1
    @staticmethod
6199 1
    def from_binary(data):
6200
        return DeleteReferencesResult(data)
6201 1
6202
    def _binary_init(self, data):
6203
        length = uabin.Primitives.Int32.unpack(data)
6204
        array = []
6205
        if length != -1:
6206 1
            for _ in range(0, length):
6207
                array.append(StatusCode.from_binary(data))
6208
        self.Results = array
6209 1
        length = uabin.Primitives.Int32.unpack(data)
6210
        array = []
6211
        if length != -1:
6212
            for _ in range(0, length):
6213
                array.append(DiagnosticInfo.from_binary(data))
6214
        self.DiagnosticInfos = array
6215
6216
    def __str__(self):
6217
        return 'DeleteReferencesResult(' + 'Results:' + str(self.Results) + ', ' + \
6218
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
6219 1
6220
    __repr__ = __str__
6221
6222
6223
class DeleteReferencesResponse(FrozenClass):
6224
    '''
6225 1
    Delete one or more references from the server address space.
6226 1
6227 1
    :ivar TypeId:
6228 1
    :vartype TypeId: NodeId
6229 1
    :ivar ResponseHeader:
6230 1
    :vartype ResponseHeader: ResponseHeader
6231 1
    :ivar Parameters:
6232 1
    :vartype Parameters: DeleteReferencesResult
6233 1
    '''
6234
6235 1
    ua_types = (
6236 1
6237 1
        ('TypeId', 'NodeId'),
6238 1
        ('ResponseHeader', 'ResponseHeader'),
6239 1
        ('Parameters', 'DeleteReferencesResult'),
6240 1
               )
6241 1
6242 1
    def __init__(self, binary=None):
6243
        if binary is not None:
6244 1
            self._binary_init(binary)
6245
            self._freeze = True
6246 1
            return
6247
        self.TypeId = FourByteNodeId(ObjectIds.DeleteReferencesResponse_Encoding_DefaultBinary)
6248 1
        self.ResponseHeader = ResponseHeader()
6249 1
        self.Parameters = DeleteReferencesResult()
6250 1
        self._freeze = True
6251 1
6252 1
    def to_binary(self):
6253 1
        packet = []
6254 1
        packet.append(self.TypeId.to_binary())
6255 1
        packet.append(self.ResponseHeader.to_binary())
6256 1
        packet.append(self.Parameters.to_binary())
6257
        return b''.join(packet)
6258 1
6259
    @staticmethod
6260
    def from_binary(data):
6261
        return DeleteReferencesResponse(data)
6262
6263 1
    def _binary_init(self, data):
6264
        self.TypeId = NodeId.from_binary(data)
6265
        self.ResponseHeader = ResponseHeader.from_binary(data)
6266 1
        self.Parameters = DeleteReferencesResult.from_binary(data)
6267
6268
    def __str__(self):
6269
        return 'DeleteReferencesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6270
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
6271
               'Parameters:' + str(self.Parameters) + ')'
6272
6273
    __repr__ = __str__
6274
6275
6276
class ViewDescription(FrozenClass):
6277
    '''
6278 1
    The view to browse.
6279
6280
    :ivar ViewId:
6281
    :vartype ViewId: NodeId
6282
    :ivar Timestamp:
6283
    :vartype Timestamp: DateTime
6284 1
    :ivar ViewVersion:
6285 1
    :vartype ViewVersion: UInt32
6286
    '''
6287
6288
    ua_types = (
6289 1
6290 1
        ('ViewId', 'NodeId'),
6291 1
        ('Timestamp', 'DateTime'),
6292 1
        ('ViewVersion', 'UInt32'),
6293
               )
6294 1
6295 1
    def __init__(self, binary=None):
6296 1
        if binary is not None:
6297 1
            self._binary_init(binary)
6298 1
            self._freeze = True
6299 1
            return
6300
        self.ViewId = NodeId()
6301 1
        self.Timestamp = datetime.utcnow()
6302
        self.ViewVersion = 0
6303
        self._freeze = True
6304
6305 1
    def to_binary(self):
6306
        packet = []
6307
        packet.append(self.ViewId.to_binary())
6308
        packet.append(uabin.Primitives.DateTime.pack(self.Timestamp))
6309
        packet.append(uabin.Primitives.UInt32.pack(self.ViewVersion))
6310 1
        return b''.join(packet)
6311
6312
    @staticmethod
6313
    def from_binary(data):
6314
        return ViewDescription(data)
6315 1
6316
    def _binary_init(self, data):
6317
        self.ViewId = NodeId.from_binary(data)
6318 1
        self.Timestamp = uabin.Primitives.DateTime.unpack(data)
6319
        self.ViewVersion = uabin.Primitives.UInt32.unpack(data)
6320
6321
    def __str__(self):
6322
        return 'ViewDescription(' + 'ViewId:' + str(self.ViewId) + ', ' + \
6323
               'Timestamp:' + str(self.Timestamp) + ', ' + \
6324
               'ViewVersion:' + str(self.ViewVersion) + ')'
6325
6326
    __repr__ = __str__
6327 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6328
6329
class BrowseDescription(FrozenClass):
6330
    '''
6331
    A request to browse the the references from a node.
6332 1
6333
    :ivar NodeId:
6334
    :vartype NodeId: NodeId
6335
    :ivar BrowseDirection:
6336
    :vartype BrowseDirection: BrowseDirection
6337
    :ivar ReferenceTypeId:
6338
    :vartype ReferenceTypeId: NodeId
6339 1
    :ivar IncludeSubtypes:
6340 1
    :vartype IncludeSubtypes: Boolean
6341 1
    :ivar NodeClassMask:
6342 1
    :vartype NodeClassMask: UInt32
6343 1
    :ivar ResultMask:
6344 1
    :vartype ResultMask: UInt32
6345 1
    '''
6346 1
6347 1
    ua_types = (
6348 1
6349
        ('NodeId', 'NodeId'),
6350 1
        ('BrowseDirection', 'BrowseDirection'),
6351 1
        ('ReferenceTypeId', 'NodeId'),
6352 1
        ('IncludeSubtypes', 'Boolean'),
6353 1
        ('NodeClassMask', 'UInt32'),
6354 1
        ('ResultMask', 'UInt32'),
6355 1
               )
6356 1
6357 1
    def __init__(self, binary=None):
6358 1
        if binary is not None:
6359
            self._binary_init(binary)
6360 1
            self._freeze = True
6361
            return
6362 1
        self.NodeId = NodeId()
6363
        self.BrowseDirection = BrowseDirection(0)
6364 1
        self.ReferenceTypeId = NodeId()
6365
        self.IncludeSubtypes = True
6366 1
        self.NodeClassMask = 0
6367 1
        self.ResultMask = 0
6368 1
        self._freeze = True
6369 1
6370 1
    def to_binary(self):
6371 1
        packet = []
6372 1
        packet.append(self.NodeId.to_binary())
6373 1
        packet.append(uabin.Primitives.UInt32.pack(self.BrowseDirection.value))
6374 1
        packet.append(self.ReferenceTypeId.to_binary())
6375 1
        packet.append(uabin.Primitives.Boolean.pack(self.IncludeSubtypes))
6376 1
        packet.append(uabin.Primitives.UInt32.pack(self.NodeClassMask))
6377 1
        packet.append(uabin.Primitives.UInt32.pack(self.ResultMask))
6378 1
        return b''.join(packet)
6379
6380 1
    @staticmethod
6381
    def from_binary(data):
6382 1
        return BrowseDescription(data)
6383
6384
    def _binary_init(self, data):
6385
        self.NodeId = NodeId.from_binary(data)
6386
        self.BrowseDirection = BrowseDirection(uabin.Primitives.UInt32.unpack(data))
6387
        self.ReferenceTypeId = NodeId.from_binary(data)
6388 1
        self.IncludeSubtypes = uabin.Primitives.Boolean.unpack(data)
6389
        self.NodeClassMask = uabin.Primitives.UInt32.unpack(data)
6390
        self.ResultMask = uabin.Primitives.UInt32.unpack(data)
6391 1
6392
    def __str__(self):
6393
        return 'BrowseDescription(' + 'NodeId:' + str(self.NodeId) + ', ' + \
6394
               'BrowseDirection:' + str(self.BrowseDirection) + ', ' + \
6395
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
6396
               'IncludeSubtypes:' + str(self.IncludeSubtypes) + ', ' + \
6397
               'NodeClassMask:' + str(self.NodeClassMask) + ', ' + \
6398
               'ResultMask:' + str(self.ResultMask) + ')'
6399 1
6400
    __repr__ = __str__
6401
6402
6403
class ReferenceDescription(FrozenClass):
6404 1
    '''
6405
    The description of a reference.
6406
6407
    :ivar ReferenceTypeId:
6408
    :vartype ReferenceTypeId: NodeId
6409
    :ivar IsForward:
6410
    :vartype IsForward: Boolean
6411
    :ivar NodeId:
6412
    :vartype NodeId: ExpandedNodeId
6413 1
    :ivar BrowseName:
6414
    :vartype BrowseName: QualifiedName
6415
    :ivar DisplayName:
6416
    :vartype DisplayName: LocalizedText
6417
    :ivar NodeClass:
6418
    :vartype NodeClass: NodeClass
6419
    :ivar TypeDefinition:
6420
    :vartype TypeDefinition: ExpandedNodeId
6421 1
    '''
6422
6423
    ua_types = (
6424
6425 1
        ('ReferenceTypeId', 'NodeId'),
6426
        ('IsForward', 'Boolean'),
6427
        ('NodeId', 'ExpandedNodeId'),
6428
        ('BrowseName', 'QualifiedName'),
6429 1
        ('DisplayName', 'LocalizedText'),
6430
        ('NodeClass', 'NodeClass'),
6431
        ('TypeDefinition', 'ExpandedNodeId'),
6432
               )
6433 1
6434
    def __init__(self, binary=None):
6435
        if binary is not None:
6436 1
            self._binary_init(binary)
6437
            self._freeze = True
6438
            return
6439
        self.ReferenceTypeId = NodeId()
6440
        self.IsForward = True
6441
        self.NodeId = ExpandedNodeId()
6442
        self.BrowseName = QualifiedName()
6443
        self.DisplayName = LocalizedText()
6444
        self.NodeClass = NodeClass(0)
6445
        self.TypeDefinition = ExpandedNodeId()
6446
        self._freeze = True
6447
6448 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...
6449
        packet = []
6450
        packet.append(self.ReferenceTypeId.to_binary())
6451
        packet.append(uabin.Primitives.Boolean.pack(self.IsForward))
6452
        packet.append(self.NodeId.to_binary())
6453
        packet.append(self.BrowseName.to_binary())
6454 1
        packet.append(self.DisplayName.to_binary())
6455
        packet.append(uabin.Primitives.UInt32.pack(self.NodeClass.value))
6456
        packet.append(self.TypeDefinition.to_binary())
6457
        return b''.join(packet)
6458
6459
    @staticmethod
6460
    def from_binary(data):
6461
        return ReferenceDescription(data)
6462
6463
    def _binary_init(self, data):
6464 1
        self.ReferenceTypeId = NodeId.from_binary(data)
6465
        self.IsForward = uabin.Primitives.Boolean.unpack(data)
6466
        self.NodeId = ExpandedNodeId.from_binary(data)
6467
        self.BrowseName = QualifiedName.from_binary(data)
6468
        self.DisplayName = LocalizedText.from_binary(data)
6469
        self.NodeClass = NodeClass(uabin.Primitives.UInt32.unpack(data))
6470
        self.TypeDefinition = ExpandedNodeId.from_binary(data)
6471 1
6472
    def __str__(self):
6473
        return 'ReferenceDescription(' + 'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
6474
               'IsForward:' + str(self.IsForward) + ', ' + \
6475 1
               'NodeId:' + str(self.NodeId) + ', ' + \
6476
               'BrowseName:' + str(self.BrowseName) + ', ' + \
6477
               'DisplayName:' + str(self.DisplayName) + ', ' + \
6478
               'NodeClass:' + str(self.NodeClass) + ', ' + \
6479
               'TypeDefinition:' + str(self.TypeDefinition) + ')'
6480 1
6481
    __repr__ = __str__
6482
6483
6484
class BrowseResult(FrozenClass):
6485 1
    '''
6486
    The result of a browse operation.
6487
6488 1
    :ivar StatusCode:
6489
    :vartype StatusCode: StatusCode
6490
    :ivar ContinuationPoint:
6491
    :vartype ContinuationPoint: ByteString
6492
    :ivar References:
6493
    :vartype References: ReferenceDescription
6494
    '''
6495
6496 1
    ua_types = (
6497
6498
        ('StatusCode', 'StatusCode'),
6499
        ('ContinuationPoint', 'ByteString'),
6500
        ('References', 'ListOfReferenceDescription'),
6501 1
               )
6502
6503
    def __init__(self, binary=None):
6504
        if binary is not None:
6505
            self._binary_init(binary)
6506
            self._freeze = True
6507
            return
6508
        self.StatusCode = StatusCode()
6509
        self.ContinuationPoint = None
6510 1
        self.References = []
6511
        self._freeze = True
6512
6513
    def to_binary(self):
6514
        packet = []
6515
        packet.append(self.StatusCode.to_binary())
6516
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
6517
        packet.append(uabin.Primitives.Int32.pack(len(self.References)))
6518
        for fieldname in self.References:
6519
            packet.append(fieldname.to_binary())
6520 1
        return b''.join(packet)
6521
6522
    @staticmethod
6523
    def from_binary(data):
6524 1
        return BrowseResult(data)
6525
6526
    def _binary_init(self, data):
6527
        self.StatusCode = StatusCode.from_binary(data)
6528
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
6529
        length = uabin.Primitives.Int32.unpack(data)
6530
        array = []
6531
        if length != -1:
6532
            for _ in range(0, length):
6533
                array.append(ReferenceDescription.from_binary(data))
6534
        self.References = array
6535
6536
    def __str__(self):
6537
        return 'BrowseResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
6538 1
               'ContinuationPoint:' + str(self.ContinuationPoint) + ', ' + \
6539
               'References:' + str(self.References) + ')'
6540
6541
    __repr__ = __str__
6542 1
6543
6544
class BrowseParameters(FrozenClass):
6545 1
    '''
6546
    :ivar View:
6547
    :vartype View: ViewDescription
6548
    :ivar RequestedMaxReferencesPerNode:
6549
    :vartype RequestedMaxReferencesPerNode: UInt32
6550
    :ivar NodesToBrowse:
6551
    :vartype NodesToBrowse: BrowseDescription
6552
    '''
6553
6554
    ua_types = (
6555
6556
        ('View', 'ViewDescription'),
6557 1
        ('RequestedMaxReferencesPerNode', 'UInt32'),
6558
        ('NodesToBrowse', 'ListOfBrowseDescription'),
6559
               )
6560
6561
    def __init__(self, binary=None):
6562
        if binary is not None:
6563 1
            self._binary_init(binary)
6564
            self._freeze = True
6565
            return
6566
        self.View = ViewDescription()
6567
        self.RequestedMaxReferencesPerNode = 0
6568
        self.NodesToBrowse = []
6569
        self._freeze = True
6570
6571
    def to_binary(self):
6572
        packet = []
6573 1
        packet.append(self.View.to_binary())
6574
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedMaxReferencesPerNode))
6575
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToBrowse)))
6576
        for fieldname in self.NodesToBrowse:
6577
            packet.append(fieldname.to_binary())
6578
        return b''.join(packet)
6579
6580 1
    @staticmethod
6581
    def from_binary(data):
6582
        return BrowseParameters(data)
6583
6584 1
    def _binary_init(self, data):
6585
        self.View = ViewDescription.from_binary(data)
6586
        self.RequestedMaxReferencesPerNode = uabin.Primitives.UInt32.unpack(data)
6587
        length = uabin.Primitives.Int32.unpack(data)
6588
        array = []
6589 1
        if length != -1:
6590
            for _ in range(0, length):
6591
                array.append(BrowseDescription.from_binary(data))
6592
        self.NodesToBrowse = array
6593
6594 1
    def __str__(self):
6595
        return 'BrowseParameters(' + 'View:' + str(self.View) + ', ' + \
6596
               'RequestedMaxReferencesPerNode:' + str(self.RequestedMaxReferencesPerNode) + ', ' + \
6597 1
               'NodesToBrowse:' + str(self.NodesToBrowse) + ')'
6598
6599
    __repr__ = __str__
6600
6601
6602
class BrowseRequest(FrozenClass):
6603
    '''
6604
    Browse the references for one or more nodes from the server address space.
6605
6606 View Code Duplication
    :ivar TypeId:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6607
    :vartype TypeId: NodeId
6608
    :ivar RequestHeader:
6609
    :vartype RequestHeader: RequestHeader
6610
    :ivar Parameters:
6611 1
    :vartype Parameters: BrowseParameters
6612
    '''
6613
6614
    ua_types = (
6615
6616
        ('TypeId', 'NodeId'),
6617
        ('RequestHeader', 'RequestHeader'),
6618 1
        ('Parameters', 'BrowseParameters'),
6619 1
               )
6620 1
6621 1
    def __init__(self, binary=None):
6622 1
        if binary is not None:
6623 1
            self._binary_init(binary)
6624 1
            self._freeze = True
6625 1
            return
6626 1
        self.TypeId = FourByteNodeId(ObjectIds.BrowseRequest_Encoding_DefaultBinary)
6627 1
        self.RequestHeader = RequestHeader()
6628
        self.Parameters = BrowseParameters()
6629 1
        self._freeze = True
6630 1
6631 1
    def to_binary(self):
6632 1
        packet = []
6633 1
        packet.append(self.TypeId.to_binary())
6634 1
        packet.append(self.RequestHeader.to_binary())
6635 1
        packet.append(self.Parameters.to_binary())
6636
        return b''.join(packet)
6637 1
6638
    @staticmethod
6639 1
    def from_binary(data):
6640
        return BrowseRequest(data)
6641 1
6642 1
    def _binary_init(self, data):
6643 1
        self.TypeId = NodeId.from_binary(data)
6644 1
        self.RequestHeader = RequestHeader.from_binary(data)
6645 1
        self.Parameters = BrowseParameters.from_binary(data)
6646
6647 1
    def __str__(self):
6648
        return 'BrowseRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6649
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
6650
               'Parameters:' + str(self.Parameters) + ')'
6651
6652
    __repr__ = __str__
6653 1
6654
6655
class BrowseResponse(FrozenClass):
6656 1
    '''
6657
    Browse the references for one or more nodes from the server address space.
6658
6659
    :ivar TypeId:
6660
    :vartype TypeId: NodeId
6661
    :ivar ResponseHeader:
6662
    :vartype ResponseHeader: ResponseHeader
6663
    :ivar Results:
6664 1
    :vartype Results: BrowseResult
6665
    :ivar DiagnosticInfos:
6666
    :vartype DiagnosticInfos: DiagnosticInfo
6667
    '''
6668 1
6669 1
    ua_types = (
6670 1
6671 1
        ('TypeId', 'NodeId'),
6672 1
        ('ResponseHeader', 'ResponseHeader'),
6673 1
        ('Results', 'ListOfBrowseResult'),
6674 1
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
6675
               )
6676 1
6677 1
    def __init__(self, binary=None):
6678 1
        if binary is not None:
6679 1
            self._binary_init(binary)
6680 1
            self._freeze = True
6681 1
            return
6682
        self.TypeId = FourByteNodeId(ObjectIds.BrowseResponse_Encoding_DefaultBinary)
6683 1
        self.ResponseHeader = ResponseHeader()
6684
        self.Results = []
6685 1
        self.DiagnosticInfos = []
6686
        self._freeze = True
6687 1
6688 1
    def to_binary(self):
6689 1
        packet = []
6690 1
        packet.append(self.TypeId.to_binary())
6691 1
        packet.append(self.ResponseHeader.to_binary())
6692 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
6693 1
        for fieldname in self.Results:
6694
            packet.append(fieldname.to_binary())
6695 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
6696
        for fieldname in self.DiagnosticInfos:
6697
            packet.append(fieldname.to_binary())
6698 1
        return b''.join(packet)
6699
6700
    @staticmethod
6701 1
    def from_binary(data):
6702
        return BrowseResponse(data)
6703
6704
    def _binary_init(self, data):
6705
        self.TypeId = NodeId.from_binary(data)
6706
        self.ResponseHeader = ResponseHeader.from_binary(data)
6707
        length = uabin.Primitives.Int32.unpack(data)
6708
        array = []
6709
        if length != -1:
6710
            for _ in range(0, length):
6711 1
                array.append(BrowseResult.from_binary(data))
6712
        self.Results = array
6713
        length = uabin.Primitives.Int32.unpack(data)
6714
        array = []
6715
        if length != -1:
6716 1
            for _ in range(0, length):
6717 1
                array.append(DiagnosticInfo.from_binary(data))
6718 1
        self.DiagnosticInfos = array
6719 1
6720 1
    def __str__(self):
6721 1
        return 'BrowseResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6722 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
6723 1
               'Results:' + str(self.Results) + ', ' + \
6724
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
6725 1
6726 1
    __repr__ = __str__
6727 1
6728 1
6729 1
class BrowseNextParameters(FrozenClass):
6730
    '''
6731 1
    :ivar ReleaseContinuationPoints:
6732
    :vartype ReleaseContinuationPoints: Boolean
6733 1
    :ivar ContinuationPoints:
6734
    :vartype ContinuationPoints: ByteString
6735 1
    '''
6736 1
6737 1
    ua_types = (
6738
6739 1
        ('ReleaseContinuationPoints', 'Boolean'),
6740
        ('ContinuationPoints', 'ListOfByteString'),
6741
               )
6742
6743 1
    def __init__(self, binary=None):
6744
        if binary is not None:
6745
            self._binary_init(binary)
6746 1
            self._freeze = True
6747
            return
6748
        self.ReleaseContinuationPoints = True
6749
        self.ContinuationPoints = []
6750
        self._freeze = True
6751
6752
    def to_binary(self):
6753
        packet = []
6754
        packet.append(uabin.Primitives.Boolean.pack(self.ReleaseContinuationPoints))
6755
        packet.append(uabin.Primitives.Int32.pack(len(self.ContinuationPoints)))
6756 1
        for fieldname in self.ContinuationPoints:
6757
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
6758
        return b''.join(packet)
6759
6760
    @staticmethod
6761 1
    def from_binary(data):
6762 1
        return BrowseNextParameters(data)
6763 1
6764 1
    def _binary_init(self, data):
6765 1
        self.ReleaseContinuationPoints = uabin.Primitives.Boolean.unpack(data)
6766 1
        self.ContinuationPoints = uabin.Primitives.ByteString.unpack_array(data)
6767 1
6768 1
    def __str__(self):
6769
        return 'BrowseNextParameters(' + 'ReleaseContinuationPoints:' + str(self.ReleaseContinuationPoints) + ', ' + \
6770 1
               'ContinuationPoints:' + str(self.ContinuationPoints) + ')'
6771 1
6772 1
    __repr__ = __str__
6773 1
6774 1
6775
class BrowseNextRequest(FrozenClass):
6776 1
    '''
6777
    Continues one or more browse operations.
6778 1
6779
    :ivar TypeId:
6780 1
    :vartype TypeId: NodeId
6781 1
    :ivar RequestHeader:
6782 1
    :vartype RequestHeader: RequestHeader
6783
    :ivar Parameters:
6784 1
    :vartype Parameters: BrowseNextParameters
6785
    '''
6786
6787
    ua_types = (
6788 1
6789
        ('TypeId', 'NodeId'),
6790
        ('RequestHeader', 'RequestHeader'),
6791 1
        ('Parameters', 'BrowseNextParameters'),
6792
               )
6793
6794
    def __init__(self, binary=None):
6795
        if binary is not None:
6796
            self._binary_init(binary)
6797
            self._freeze = True
6798
            return
6799
        self.TypeId = FourByteNodeId(ObjectIds.BrowseNextRequest_Encoding_DefaultBinary)
6800
        self.RequestHeader = RequestHeader()
6801 1
        self.Parameters = BrowseNextParameters()
6802
        self._freeze = True
6803
6804
    def to_binary(self):
6805
        packet = []
6806 1
        packet.append(self.TypeId.to_binary())
6807 1
        packet.append(self.RequestHeader.to_binary())
6808 1
        packet.append(self.Parameters.to_binary())
6809 1
        return b''.join(packet)
6810 1
6811 1
    @staticmethod
6812 1
    def from_binary(data):
6813 1
        return BrowseNextRequest(data)
6814
6815 1
    def _binary_init(self, data):
6816 1
        self.TypeId = NodeId.from_binary(data)
6817 1
        self.RequestHeader = RequestHeader.from_binary(data)
6818 1
        self.Parameters = BrowseNextParameters.from_binary(data)
6819 1
6820 1
    def __str__(self):
6821 1
        return 'BrowseNextRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6822
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
6823 1
               'Parameters:' + str(self.Parameters) + ')'
6824
6825 1
    __repr__ = __str__
6826
6827 1
6828 1
class BrowseNextResult(FrozenClass):
6829 1
    '''
6830 1
    :ivar Results:
6831 1
    :vartype Results: BrowseResult
6832 1
    :ivar DiagnosticInfos:
6833 1
    :vartype DiagnosticInfos: DiagnosticInfo
6834 1
    '''
6835
6836 1
    ua_types = (
6837
6838
        ('Results', 'ListOfBrowseResult'),
6839
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
6840 1
               )
6841
6842
    def __init__(self, binary=None):
6843 1
        if binary is not None:
6844
            self._binary_init(binary)
6845
            self._freeze = True
6846
            return
6847
        self.Results = []
6848
        self.DiagnosticInfos = []
6849 1
        self._freeze = True
6850
6851
    def to_binary(self):
6852
        packet = []
6853 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
6854 1
        for fieldname in self.Results:
6855 1
            packet.append(fieldname.to_binary())
6856 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
6857 1
        for fieldname in self.DiagnosticInfos:
6858 1
            packet.append(fieldname.to_binary())
6859 1
        return b''.join(packet)
6860
6861 1
    @staticmethod
6862 1
    def from_binary(data):
6863 1
        return BrowseNextResult(data)
6864 1
6865 1
    def _binary_init(self, data):
6866 1
        length = uabin.Primitives.Int32.unpack(data)
6867
        array = []
6868 1
        if length != -1:
6869
            for _ in range(0, length):
6870 1
                array.append(BrowseResult.from_binary(data))
6871
        self.Results = array
6872 1
        length = uabin.Primitives.Int32.unpack(data)
6873 1
        array = []
6874 1
        if length != -1:
6875 1
            for _ in range(0, length):
6876 1
                array.append(DiagnosticInfo.from_binary(data))
6877 1
        self.DiagnosticInfos = array
6878 1
6879
    def __str__(self):
6880 1
        return 'BrowseNextResult(' + 'Results:' + str(self.Results) + ', ' + \
6881
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
6882
6883 1
    __repr__ = __str__
6884
6885
6886 1
class BrowseNextResponse(FrozenClass):
6887
    '''
6888
    Continues one or more browse operations.
6889
6890
    :ivar TypeId:
6891
    :vartype TypeId: NodeId
6892
    :ivar ResponseHeader:
6893
    :vartype ResponseHeader: ResponseHeader
6894
    :ivar Parameters:
6895
    :vartype Parameters: BrowseNextResult
6896
    '''
6897
6898 1
    ua_types = (
6899
6900
        ('TypeId', 'NodeId'),
6901
        ('ResponseHeader', 'ResponseHeader'),
6902
        ('Parameters', 'BrowseNextResult'),
6903
               )
6904 1
6905 1
    def __init__(self, binary=None):
6906
        if binary is not None:
6907
            self._binary_init(binary)
6908
            self._freeze = True
6909 1
            return
6910 1
        self.TypeId = FourByteNodeId(ObjectIds.BrowseNextResponse_Encoding_DefaultBinary)
6911 1
        self.ResponseHeader = ResponseHeader()
6912 1
        self.Parameters = BrowseNextResult()
6913
        self._freeze = True
6914 1
6915 1
    def to_binary(self):
6916 1
        packet = []
6917 1
        packet.append(self.TypeId.to_binary())
6918 1
        packet.append(self.ResponseHeader.to_binary())
6919 1
        packet.append(self.Parameters.to_binary())
6920
        return b''.join(packet)
6921 1
6922
    @staticmethod
6923
    def from_binary(data):
6924
        return BrowseNextResponse(data)
6925 1
6926
    def _binary_init(self, data):
6927
        self.TypeId = NodeId.from_binary(data)
6928
        self.ResponseHeader = ResponseHeader.from_binary(data)
6929
        self.Parameters = BrowseNextResult.from_binary(data)
6930 1
6931
    def __str__(self):
6932
        return 'BrowseNextResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6933
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
6934
               'Parameters:' + str(self.Parameters) + ')'
6935 1
6936
    __repr__ = __str__
6937
6938 1
6939
class RelativePathElement(FrozenClass):
6940
    '''
6941
    An element in a relative path.
6942
6943
    :ivar ReferenceTypeId:
6944
    :vartype ReferenceTypeId: NodeId
6945
    :ivar IsInverse:
6946
    :vartype IsInverse: Boolean
6947 View Code Duplication
    :ivar IncludeSubtypes:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6948
    :vartype IncludeSubtypes: Boolean
6949
    :ivar TargetName:
6950
    :vartype TargetName: QualifiedName
6951
    '''
6952 1
6953
    ua_types = (
6954
6955
        ('ReferenceTypeId', 'NodeId'),
6956
        ('IsInverse', 'Boolean'),
6957
        ('IncludeSubtypes', 'Boolean'),
6958
        ('TargetName', 'QualifiedName'),
6959 1
               )
6960 1
6961 1
    def __init__(self, binary=None):
6962 1
        if binary is not None:
6963 1
            self._binary_init(binary)
6964 1
            self._freeze = True
6965 1
            return
6966 1
        self.ReferenceTypeId = NodeId()
6967 1
        self.IsInverse = True
6968 1
        self.IncludeSubtypes = True
6969
        self.TargetName = QualifiedName()
6970 1
        self._freeze = True
6971 1
6972 1
    def to_binary(self):
6973 1
        packet = []
6974 1
        packet.append(self.ReferenceTypeId.to_binary())
6975 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsInverse))
6976 1
        packet.append(uabin.Primitives.Boolean.pack(self.IncludeSubtypes))
6977 1
        packet.append(self.TargetName.to_binary())
6978 1
        return b''.join(packet)
6979
6980 1
    @staticmethod
6981
    def from_binary(data):
6982 1
        return RelativePathElement(data)
6983
6984 1
    def _binary_init(self, data):
6985
        self.ReferenceTypeId = NodeId.from_binary(data)
6986 1
        self.IsInverse = uabin.Primitives.Boolean.unpack(data)
6987 1
        self.IncludeSubtypes = uabin.Primitives.Boolean.unpack(data)
6988 1
        self.TargetName = QualifiedName.from_binary(data)
6989 1
6990 1
    def __str__(self):
6991 1
        return 'RelativePathElement(' + 'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
6992 1
               'IsInverse:' + str(self.IsInverse) + ', ' + \
6993 1
               'IncludeSubtypes:' + str(self.IncludeSubtypes) + ', ' + \
6994 1
               'TargetName:' + str(self.TargetName) + ')'
6995 1
6996 1
    __repr__ = __str__
6997 1
6998 1
6999
class RelativePath(FrozenClass):
7000 1
    '''
7001
    A relative path constructed from reference types and browse names.
7002 1
7003
    :ivar Elements:
7004
    :vartype Elements: RelativePathElement
7005
    '''
7006
7007
    ua_types = (
7008 1
7009
        ('Elements', 'ListOfRelativePathElement'),
7010
               )
7011 1
7012
    def __init__(self, binary=None):
7013
        if binary is not None:
7014
            self._binary_init(binary)
7015
            self._freeze = True
7016
            return
7017 1
        self.Elements = []
7018
        self._freeze = True
7019
7020
    def to_binary(self):
7021 1
        packet = []
7022
        packet.append(uabin.Primitives.Int32.pack(len(self.Elements)))
7023
        for fieldname in self.Elements:
7024
            packet.append(fieldname.to_binary())
7025
        return b''.join(packet)
7026
7027
    @staticmethod
7028
    def from_binary(data):
7029 1
        return RelativePath(data)
7030
7031
    def _binary_init(self, data):
7032
        length = uabin.Primitives.Int32.unpack(data)
7033
        array = []
7034
        if length != -1:
7035
            for _ in range(0, length):
7036 1
                array.append(RelativePathElement.from_binary(data))
7037
        self.Elements = array
7038
7039
    def __str__(self):
7040 1
        return 'RelativePath(' + 'Elements:' + str(self.Elements) + ')'
7041
7042
    __repr__ = __str__
7043
7044
7045
class BrowsePath(FrozenClass):
7046
    '''
7047
    A request to translate a path into a node id.
7048 1
7049
    :ivar StartingNode:
7050
    :vartype StartingNode: NodeId
7051 1
    :ivar RelativePath:
7052
    :vartype RelativePath: RelativePath
7053
    '''
7054 1
7055
    ua_types = (
7056
7057
        ('StartingNode', 'NodeId'),
7058
        ('RelativePath', 'RelativePath'),
7059
               )
7060
7061
    def __init__(self, binary=None):
7062
        if binary is not None:
7063
            self._binary_init(binary)
7064
            self._freeze = True
7065
            return
7066 1
        self.StartingNode = NodeId()
7067
        self.RelativePath = RelativePath()
7068
        self._freeze = True
7069
7070
    def to_binary(self):
7071
        packet = []
7072 1
        packet.append(self.StartingNode.to_binary())
7073
        packet.append(self.RelativePath.to_binary())
7074
        return b''.join(packet)
7075
7076
    @staticmethod
7077
    def from_binary(data):
7078
        return BrowsePath(data)
7079
7080
    def _binary_init(self, data):
7081
        self.StartingNode = NodeId.from_binary(data)
7082 1
        self.RelativePath = RelativePath.from_binary(data)
7083
7084
    def __str__(self):
7085
        return 'BrowsePath(' + 'StartingNode:' + str(self.StartingNode) + ', ' + \
7086
               'RelativePath:' + str(self.RelativePath) + ')'
7087
7088
    __repr__ = __str__
7089 1
7090
7091
class BrowsePathTarget(FrozenClass):
7092
    '''
7093 1
    The target of the translated path.
7094
7095
    :ivar TargetId:
7096
    :vartype TargetId: ExpandedNodeId
7097
    :ivar RemainingPathIndex:
7098 1
    :vartype RemainingPathIndex: UInt32
7099
    '''
7100
7101
    ua_types = (
7102
7103 1
        ('TargetId', 'ExpandedNodeId'),
7104
        ('RemainingPathIndex', 'UInt32'),
7105
               )
7106 1
7107
    def __init__(self, binary=None):
7108
        if binary is not None:
7109
            self._binary_init(binary)
7110
            self._freeze = True
7111
            return
7112 1
        self.TargetId = ExpandedNodeId()
7113
        self.RemainingPathIndex = 0
7114
        self._freeze = True
7115
7116 1
    def to_binary(self):
7117
        packet = []
7118
        packet.append(self.TargetId.to_binary())
7119
        packet.append(uabin.Primitives.UInt32.pack(self.RemainingPathIndex))
7120
        return b''.join(packet)
7121
7122
    @staticmethod
7123
    def from_binary(data):
7124 1
        return BrowsePathTarget(data)
7125
7126
    def _binary_init(self, data):
7127
        self.TargetId = ExpandedNodeId.from_binary(data)
7128
        self.RemainingPathIndex = uabin.Primitives.UInt32.unpack(data)
7129
7130
    def __str__(self):
7131 1
        return 'BrowsePathTarget(' + 'TargetId:' + str(self.TargetId) + ', ' + \
7132
               'RemainingPathIndex:' + str(self.RemainingPathIndex) + ')'
7133
7134
    __repr__ = __str__
7135 1
7136
7137
class BrowsePathResult(FrozenClass):
7138
    '''
7139
    The result of a translate opearation.
7140
7141
    :ivar StatusCode:
7142
    :vartype StatusCode: StatusCode
7143 1
    :ivar Targets:
7144
    :vartype Targets: BrowsePathTarget
7145
    '''
7146 1
7147
    ua_types = (
7148
7149 1
        ('StatusCode', 'StatusCode'),
7150
        ('Targets', 'ListOfBrowsePathTarget'),
7151
               )
7152
7153
    def __init__(self, binary=None):
7154
        if binary is not None:
7155
            self._binary_init(binary)
7156
            self._freeze = True
7157
            return
7158
        self.StatusCode = StatusCode()
7159
        self.Targets = []
7160
        self._freeze = True
7161 1
7162
    def to_binary(self):
7163
        packet = []
7164
        packet.append(self.StatusCode.to_binary())
7165
        packet.append(uabin.Primitives.Int32.pack(len(self.Targets)))
7166
        for fieldname in self.Targets:
7167 1
            packet.append(fieldname.to_binary())
7168
        return b''.join(packet)
7169
7170
    @staticmethod
7171
    def from_binary(data):
7172
        return BrowsePathResult(data)
7173
7174
    def _binary_init(self, data):
7175
        self.StatusCode = StatusCode.from_binary(data)
7176
        length = uabin.Primitives.Int32.unpack(data)
7177 1
        array = []
7178
        if length != -1:
7179
            for _ in range(0, length):
7180
                array.append(BrowsePathTarget.from_binary(data))
7181
        self.Targets = array
7182
7183
    def __str__(self):
7184 1
        return 'BrowsePathResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
7185
               'Targets:' + str(self.Targets) + ')'
7186
7187
    __repr__ = __str__
7188 1
7189
7190
class TranslateBrowsePathsToNodeIdsParameters(FrozenClass):
7191
    '''
7192
    :ivar BrowsePaths:
7193 1
    :vartype BrowsePaths: BrowsePath
7194
    '''
7195
7196
    ua_types = (
7197
7198 1
        ('BrowsePaths', 'ListOfBrowsePath'),
7199
               )
7200
7201 1
    def __init__(self, binary=None):
7202
        if binary is not None:
7203
            self._binary_init(binary)
7204
            self._freeze = True
7205
            return
7206
        self.BrowsePaths = []
7207 1
        self._freeze = True
7208
7209
    def to_binary(self):
7210
        packet = []
7211 1
        packet.append(uabin.Primitives.Int32.pack(len(self.BrowsePaths)))
7212
        for fieldname in self.BrowsePaths:
7213
            packet.append(fieldname.to_binary())
7214
        return b''.join(packet)
7215
7216
    @staticmethod
7217
    def from_binary(data):
7218
        return TranslateBrowsePathsToNodeIdsParameters(data)
7219 1
7220
    def _binary_init(self, data):
7221
        length = uabin.Primitives.Int32.unpack(data)
7222
        array = []
7223
        if length != -1:
7224
            for _ in range(0, length):
7225
                array.append(BrowsePath.from_binary(data))
7226 1
        self.BrowsePaths = array
7227
7228
    def __str__(self):
7229
        return 'TranslateBrowsePathsToNodeIdsParameters(' + 'BrowsePaths:' + str(self.BrowsePaths) + ')'
7230 1
7231
    __repr__ = __str__
7232
7233
7234
class TranslateBrowsePathsToNodeIdsRequest(FrozenClass):
7235
    '''
7236
    Translates one or more paths in the server address space.
7237
7238 1
    :ivar TypeId:
7239
    :vartype TypeId: NodeId
7240
    :ivar RequestHeader:
7241 1
    :vartype RequestHeader: RequestHeader
7242
    :ivar Parameters:
7243
    :vartype Parameters: TranslateBrowsePathsToNodeIdsParameters
7244 1
    '''
7245
7246
    ua_types = (
7247
7248
        ('TypeId', 'NodeId'),
7249
        ('RequestHeader', 'RequestHeader'),
7250
        ('Parameters', 'TranslateBrowsePathsToNodeIdsParameters'),
7251
               )
7252
7253
    def __init__(self, binary=None):
7254
        if binary is not None:
7255
            self._binary_init(binary)
7256 1
            self._freeze = True
7257
            return
7258
        self.TypeId = FourByteNodeId(ObjectIds.TranslateBrowsePathsToNodeIdsRequest_Encoding_DefaultBinary)
7259
        self.RequestHeader = RequestHeader()
7260
        self.Parameters = TranslateBrowsePathsToNodeIdsParameters()
7261
        self._freeze = True
7262 1
7263
    def to_binary(self):
7264
        packet = []
7265
        packet.append(self.TypeId.to_binary())
7266
        packet.append(self.RequestHeader.to_binary())
7267
        packet.append(self.Parameters.to_binary())
7268
        return b''.join(packet)
7269
7270
    @staticmethod
7271
    def from_binary(data):
7272 1
        return TranslateBrowsePathsToNodeIdsRequest(data)
7273
7274
    def _binary_init(self, data):
7275
        self.TypeId = NodeId.from_binary(data)
7276
        self.RequestHeader = RequestHeader.from_binary(data)
7277
        self.Parameters = TranslateBrowsePathsToNodeIdsParameters.from_binary(data)
7278
7279 1
    def __str__(self):
7280
        return 'TranslateBrowsePathsToNodeIdsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7281
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
7282
               'Parameters:' + str(self.Parameters) + ')'
7283 1
7284
    __repr__ = __str__
7285
7286
7287
class TranslateBrowsePathsToNodeIdsResponse(FrozenClass):
7288 1
    '''
7289
    Translates one or more paths in the server address space.
7290
7291
    :ivar TypeId:
7292
    :vartype TypeId: NodeId
7293 1
    :ivar ResponseHeader:
7294
    :vartype ResponseHeader: ResponseHeader
7295
    :ivar Results:
7296 1
    :vartype Results: BrowsePathResult
7297
    :ivar DiagnosticInfos:
7298
    :vartype DiagnosticInfos: DiagnosticInfo
7299
    '''
7300
7301
    ua_types = (
7302
7303
        ('TypeId', 'NodeId'),
7304
        ('ResponseHeader', 'ResponseHeader'),
7305
        ('Results', 'ListOfBrowsePathResult'),
7306 1
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
7307
               )
7308
7309
    def __init__(self, binary=None):
7310
        if binary is not None:
7311 1
            self._binary_init(binary)
7312
            self._freeze = True
7313
            return
7314
        self.TypeId = FourByteNodeId(ObjectIds.TranslateBrowsePathsToNodeIdsResponse_Encoding_DefaultBinary)
7315
        self.ResponseHeader = ResponseHeader()
7316
        self.Results = []
7317
        self.DiagnosticInfos = []
7318
        self._freeze = True
7319
7320 1
    def to_binary(self):
7321
        packet = []
7322
        packet.append(self.TypeId.to_binary())
7323
        packet.append(self.ResponseHeader.to_binary())
7324
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
7325
        for fieldname in self.Results:
7326 1
            packet.append(fieldname.to_binary())
7327
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
7328
        for fieldname in self.DiagnosticInfos:
7329
            packet.append(fieldname.to_binary())
7330 1
        return b''.join(packet)
7331
7332
    @staticmethod
7333
    def from_binary(data):
7334 1
        return TranslateBrowsePathsToNodeIdsResponse(data)
7335
7336
    def _binary_init(self, data):
7337
        self.TypeId = NodeId.from_binary(data)
7338 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
7339
        length = uabin.Primitives.Int32.unpack(data)
7340
        array = []
7341 1
        if length != -1:
7342
            for _ in range(0, length):
7343
                array.append(BrowsePathResult.from_binary(data))
7344
        self.Results = array
7345
        length = uabin.Primitives.Int32.unpack(data)
7346
        array = []
7347
        if length != -1:
7348
            for _ in range(0, length):
7349
                array.append(DiagnosticInfo.from_binary(data))
7350
        self.DiagnosticInfos = array
7351
7352
    def __str__(self):
7353
        return 'TranslateBrowsePathsToNodeIdsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7354
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
7355
               'Results:' + str(self.Results) + ', ' + \
7356
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
7357
7358
    __repr__ = __str__
7359
7360
7361
class RegisterNodesParameters(FrozenClass):
7362
    '''
7363 1
    :ivar NodesToRegister:
7364
    :vartype NodesToRegister: NodeId
7365
    '''
7366
7367
    ua_types = (
7368
7369
        ('NodesToRegister', 'ListOfNodeId'),
7370
               )
7371
7372
    def __init__(self, binary=None):
7373
        if binary is not None:
7374
            self._binary_init(binary)
7375 1
            self._freeze = True
7376
            return
7377
        self.NodesToRegister = []
7378
        self._freeze = True
7379
7380
    def to_binary(self):
7381
        packet = []
7382
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToRegister)))
7383
        for fieldname in self.NodesToRegister:
7384
            packet.append(fieldname.to_binary())
7385
        return b''.join(packet)
7386
7387
    @staticmethod
7388
    def from_binary(data):
7389
        return RegisterNodesParameters(data)
7390
7391 1
    def _binary_init(self, data):
7392
        length = uabin.Primitives.Int32.unpack(data)
7393
        array = []
7394
        if length != -1:
7395
            for _ in range(0, length):
7396
                array.append(NodeId.from_binary(data))
7397
        self.NodesToRegister = array
7398
7399
    def __str__(self):
7400
        return 'RegisterNodesParameters(' + 'NodesToRegister:' + str(self.NodesToRegister) + ')'
7401
7402
    __repr__ = __str__
7403
7404 1
7405
class RegisterNodesRequest(FrozenClass):
7406
    '''
7407
    Registers one or more nodes for repeated use within a session.
7408 1
7409
    :ivar TypeId:
7410
    :vartype TypeId: NodeId
7411
    :ivar RequestHeader:
7412
    :vartype RequestHeader: RequestHeader
7413
    :ivar Parameters:
7414
    :vartype Parameters: RegisterNodesParameters
7415
    '''
7416
7417
    ua_types = (
7418
7419 1
        ('TypeId', 'NodeId'),
7420
        ('RequestHeader', 'RequestHeader'),
7421
        ('Parameters', 'RegisterNodesParameters'),
7422
               )
7423
7424
    def __init__(self, binary=None):
7425
        if binary is not None:
7426
            self._binary_init(binary)
7427
            self._freeze = True
7428
            return
7429
        self.TypeId = FourByteNodeId(ObjectIds.RegisterNodesRequest_Encoding_DefaultBinary)
7430 1
        self.RequestHeader = RequestHeader()
7431
        self.Parameters = RegisterNodesParameters()
7432
        self._freeze = True
7433 1
7434
    def to_binary(self):
7435
        packet = []
7436
        packet.append(self.TypeId.to_binary())
7437 View Code Duplication
        packet.append(self.RequestHeader.to_binary())
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7438
        packet.append(self.Parameters.to_binary())
7439
        return b''.join(packet)
7440
7441
    @staticmethod
7442
    def from_binary(data):
7443
        return RegisterNodesRequest(data)
7444
7445
    def _binary_init(self, data):
7446
        self.TypeId = NodeId.from_binary(data)
7447
        self.RequestHeader = RequestHeader.from_binary(data)
7448
        self.Parameters = RegisterNodesParameters.from_binary(data)
7449 1
7450
    def __str__(self):
7451
        return 'RegisterNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7452
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
7453
               'Parameters:' + str(self.Parameters) + ')'
7454
7455
    __repr__ = __str__
7456
7457
7458 1
class RegisterNodesResult(FrozenClass):
7459
    '''
7460
    :ivar RegisteredNodeIds:
7461
    :vartype RegisteredNodeIds: NodeId
7462
    '''
7463
7464
    ua_types = (
7465
7466
        ('RegisteredNodeIds', 'ListOfNodeId'),
7467
               )
7468
7469
    def __init__(self, binary=None):
7470
        if binary is not None:
7471 1
            self._binary_init(binary)
7472
            self._freeze = True
7473
            return
7474
        self.RegisteredNodeIds = []
7475
        self._freeze = True
7476
7477
    def to_binary(self):
7478
        packet = []
7479
        packet.append(uabin.Primitives.Int32.pack(len(self.RegisteredNodeIds)))
7480
        for fieldname in self.RegisteredNodeIds:
7481
            packet.append(fieldname.to_binary())
7482
        return b''.join(packet)
7483 1
7484
    @staticmethod
7485
    def from_binary(data):
7486
        return RegisterNodesResult(data)
7487 1
7488
    def _binary_init(self, data):
7489
        length = uabin.Primitives.Int32.unpack(data)
7490
        array = []
7491
        if length != -1:
7492
            for _ in range(0, length):
7493
                array.append(NodeId.from_binary(data))
7494
        self.RegisteredNodeIds = array
7495 1
7496
    def __str__(self):
7497
        return 'RegisterNodesResult(' + 'RegisteredNodeIds:' + str(self.RegisteredNodeIds) + ')'
7498
7499
    __repr__ = __str__
7500
7501
7502
class RegisterNodesResponse(FrozenClass):
7503 1
    '''
7504
    Registers one or more nodes for repeated use within a session.
7505
7506 1
    :ivar TypeId:
7507
    :vartype TypeId: NodeId
7508
    :ivar ResponseHeader:
7509
    :vartype ResponseHeader: ResponseHeader
7510
    :ivar Parameters:
7511
    :vartype Parameters: RegisterNodesResult
7512
    '''
7513
7514
    ua_types = (
7515
7516
        ('TypeId', 'NodeId'),
7517
        ('ResponseHeader', 'ResponseHeader'),
7518
        ('Parameters', 'RegisterNodesResult'),
7519
               )
7520
7521
    def __init__(self, binary=None):
7522
        if binary is not None:
7523
            self._binary_init(binary)
7524
            self._freeze = True
7525
            return
7526
        self.TypeId = FourByteNodeId(ObjectIds.RegisterNodesResponse_Encoding_DefaultBinary)
7527
        self.ResponseHeader = ResponseHeader()
7528
        self.Parameters = RegisterNodesResult()
7529
        self._freeze = True
7530 1
7531
    def to_binary(self):
7532
        packet = []
7533
        packet.append(self.TypeId.to_binary())
7534
        packet.append(self.ResponseHeader.to_binary())
7535
        packet.append(self.Parameters.to_binary())
7536
        return b''.join(packet)
7537
7538
    @staticmethod
7539
    def from_binary(data):
7540
        return RegisterNodesResponse(data)
7541
7542
    def _binary_init(self, data):
7543 1
        self.TypeId = NodeId.from_binary(data)
7544
        self.ResponseHeader = ResponseHeader.from_binary(data)
7545
        self.Parameters = RegisterNodesResult.from_binary(data)
7546
7547
    def __str__(self):
7548
        return 'RegisterNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7549
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
7550
               'Parameters:' + str(self.Parameters) + ')'
7551
7552
    __repr__ = __str__
7553
7554
7555
class UnregisterNodesParameters(FrozenClass):
7556
    '''
7557
    :ivar NodesToUnregister:
7558
    :vartype NodesToUnregister: NodeId
7559
    '''
7560 1
7561
    ua_types = (
7562
7563
        ('NodesToUnregister', 'ListOfNodeId'),
7564
               )
7565
7566
    def __init__(self, binary=None):
7567
        if binary is not None:
7568
            self._binary_init(binary)
7569
            self._freeze = True
7570
            return
7571
        self.NodesToUnregister = []
7572
        self._freeze = True
7573
7574
    def to_binary(self):
7575
        packet = []
7576 1
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToUnregister)))
7577
        for fieldname in self.NodesToUnregister:
7578
            packet.append(fieldname.to_binary())
7579
        return b''.join(packet)
7580 1
7581
    @staticmethod
7582
    def from_binary(data):
7583
        return UnregisterNodesParameters(data)
7584
7585
    def _binary_init(self, data):
7586
        length = uabin.Primitives.Int32.unpack(data)
7587
        array = []
7588
        if length != -1:
7589
            for _ in range(0, length):
7590
                array.append(NodeId.from_binary(data))
7591
        self.NodesToUnregister = array
7592
7593
    def __str__(self):
7594
        return 'UnregisterNodesParameters(' + 'NodesToUnregister:' + str(self.NodesToUnregister) + ')'
7595
7596
    __repr__ = __str__
7597 1
7598
7599
class UnregisterNodesRequest(FrozenClass):
7600
    '''
7601
    Unregisters one or more previously registered nodes.
7602
7603
    :ivar TypeId:
7604
    :vartype TypeId: NodeId
7605
    :ivar RequestHeader:
7606
    :vartype RequestHeader: RequestHeader
7607
    :ivar Parameters:
7608
    :vartype Parameters: UnregisterNodesParameters
7609 1
    '''
7610
7611
    ua_types = (
7612 1
7613
        ('TypeId', 'NodeId'),
7614
        ('RequestHeader', 'RequestHeader'),
7615
        ('Parameters', 'UnregisterNodesParameters'),
7616
               )
7617
7618
    def __init__(self, binary=None):
7619
        if binary is not None:
7620
            self._binary_init(binary)
7621
            self._freeze = True
7622 1
            return
7623
        self.TypeId = FourByteNodeId(ObjectIds.UnregisterNodesRequest_Encoding_DefaultBinary)
7624
        self.RequestHeader = RequestHeader()
7625
        self.Parameters = UnregisterNodesParameters()
7626
        self._freeze = True
7627
7628 1
    def to_binary(self):
7629
        packet = []
7630
        packet.append(self.TypeId.to_binary())
7631
        packet.append(self.RequestHeader.to_binary())
7632
        packet.append(self.Parameters.to_binary())
7633
        return b''.join(packet)
7634
7635
    @staticmethod
7636
    def from_binary(data):
7637
        return UnregisterNodesRequest(data)
7638 1
7639
    def _binary_init(self, data):
7640
        self.TypeId = NodeId.from_binary(data)
7641
        self.RequestHeader = RequestHeader.from_binary(data)
7642
        self.Parameters = UnregisterNodesParameters.from_binary(data)
7643
7644
    def __str__(self):
7645 1
        return 'UnregisterNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7646
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
7647
               'Parameters:' + str(self.Parameters) + ')'
7648
7649 1
    __repr__ = __str__
7650
7651
7652
class UnregisterNodesResponse(FrozenClass):
7653
    '''
7654 1
    Unregisters one or more previously registered nodes.
7655
7656
    :ivar TypeId:
7657
    :vartype TypeId: NodeId
7658
    :ivar ResponseHeader:
7659 1
    :vartype ResponseHeader: ResponseHeader
7660
    '''
7661
7662 1
    ua_types = (
7663
7664
        ('TypeId', 'NodeId'),
7665
        ('ResponseHeader', 'ResponseHeader'),
7666
               )
7667
7668
    def __init__(self, binary=None):
7669
        if binary is not None:
7670
            self._binary_init(binary)
7671
            self._freeze = True
7672 1
            return
7673
        self.TypeId = FourByteNodeId(ObjectIds.UnregisterNodesResponse_Encoding_DefaultBinary)
7674
        self.ResponseHeader = ResponseHeader()
7675
        self._freeze = True
7676
7677
    def to_binary(self):
7678 1
        packet = []
7679
        packet.append(self.TypeId.to_binary())
7680
        packet.append(self.ResponseHeader.to_binary())
7681
        return b''.join(packet)
7682
7683
    @staticmethod
7684
    def from_binary(data):
7685
        return UnregisterNodesResponse(data)
7686
7687
    def _binary_init(self, data):
7688 1
        self.TypeId = NodeId.from_binary(data)
7689
        self.ResponseHeader = ResponseHeader.from_binary(data)
7690
7691
    def __str__(self):
7692
        return 'UnregisterNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7693
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
7694
7695
    __repr__ = __str__
7696
7697 1
7698
class EndpointConfiguration(FrozenClass):
7699
    '''
7700
    :ivar OperationTimeout:
7701 1
    :vartype OperationTimeout: Int32
7702
    :ivar UseBinaryEncoding:
7703
    :vartype UseBinaryEncoding: Boolean
7704
    :ivar MaxStringLength:
7705
    :vartype MaxStringLength: Int32
7706
    :ivar MaxByteStringLength:
7707
    :vartype MaxByteStringLength: Int32
7708
    :ivar MaxArrayLength:
7709
    :vartype MaxArrayLength: Int32
7710
    :ivar MaxMessageSize:
7711 1
    :vartype MaxMessageSize: Int32
7712
    :ivar MaxBufferSize:
7713
    :vartype MaxBufferSize: Int32
7714
    :ivar ChannelLifetime:
7715
    :vartype ChannelLifetime: Int32
7716 1
    :ivar SecurityTokenLifetime:
7717
    :vartype SecurityTokenLifetime: Int32
7718
    '''
7719 1
7720
    ua_types = (
7721
7722
        ('OperationTimeout', 'Int32'),
7723
        ('UseBinaryEncoding', 'Boolean'),
7724
        ('MaxStringLength', 'Int32'),
7725
        ('MaxByteStringLength', 'Int32'),
7726
        ('MaxArrayLength', 'Int32'),
7727
        ('MaxMessageSize', 'Int32'),
7728
        ('MaxBufferSize', 'Int32'),
7729 1
        ('ChannelLifetime', 'Int32'),
7730
        ('SecurityTokenLifetime', 'Int32'),
7731
               )
7732
7733
    def __init__(self, binary=None):
7734
        if binary is not None:
7735 1
            self._binary_init(binary)
7736
            self._freeze = True
7737
            return
7738
        self.OperationTimeout = 0
7739
        self.UseBinaryEncoding = True
7740
        self.MaxStringLength = 0
7741
        self.MaxByteStringLength = 0
7742
        self.MaxArrayLength = 0
7743
        self.MaxMessageSize = 0
7744
        self.MaxBufferSize = 0
7745 1
        self.ChannelLifetime = 0
7746
        self.SecurityTokenLifetime = 0
7747
        self._freeze = True
7748
7749
    def to_binary(self):
7750
        packet = []
7751
        packet.append(uabin.Primitives.Int32.pack(self.OperationTimeout))
7752
        packet.append(uabin.Primitives.Boolean.pack(self.UseBinaryEncoding))
7753
        packet.append(uabin.Primitives.Int32.pack(self.MaxStringLength))
7754 1
        packet.append(uabin.Primitives.Int32.pack(self.MaxByteStringLength))
7755
        packet.append(uabin.Primitives.Int32.pack(self.MaxArrayLength))
7756
        packet.append(uabin.Primitives.Int32.pack(self.MaxMessageSize))
7757
        packet.append(uabin.Primitives.Int32.pack(self.MaxBufferSize))
7758 1
        packet.append(uabin.Primitives.Int32.pack(self.ChannelLifetime))
7759
        packet.append(uabin.Primitives.Int32.pack(self.SecurityTokenLifetime))
7760
        return b''.join(packet)
7761
7762
    @staticmethod
7763
    def from_binary(data):
7764
        return EndpointConfiguration(data)
7765
7766
    def _binary_init(self, data):
7767
        self.OperationTimeout = uabin.Primitives.Int32.unpack(data)
7768 1
        self.UseBinaryEncoding = uabin.Primitives.Boolean.unpack(data)
7769
        self.MaxStringLength = uabin.Primitives.Int32.unpack(data)
7770
        self.MaxByteStringLength = uabin.Primitives.Int32.unpack(data)
7771
        self.MaxArrayLength = uabin.Primitives.Int32.unpack(data)
7772
        self.MaxMessageSize = uabin.Primitives.Int32.unpack(data)
7773 1
        self.MaxBufferSize = uabin.Primitives.Int32.unpack(data)
7774
        self.ChannelLifetime = uabin.Primitives.Int32.unpack(data)
7775
        self.SecurityTokenLifetime = uabin.Primitives.Int32.unpack(data)
7776 1
7777
    def __str__(self):
7778
        return 'EndpointConfiguration(' + 'OperationTimeout:' + str(self.OperationTimeout) + ', ' + \
7779
               'UseBinaryEncoding:' + str(self.UseBinaryEncoding) + ', ' + \
7780
               'MaxStringLength:' + str(self.MaxStringLength) + ', ' + \
7781
               'MaxByteStringLength:' + str(self.MaxByteStringLength) + ', ' + \
7782
               'MaxArrayLength:' + str(self.MaxArrayLength) + ', ' + \
7783
               'MaxMessageSize:' + str(self.MaxMessageSize) + ', ' + \
7784
               'MaxBufferSize:' + str(self.MaxBufferSize) + ', ' + \
7785
               'ChannelLifetime:' + str(self.ChannelLifetime) + ', ' + \
7786
               'SecurityTokenLifetime:' + str(self.SecurityTokenLifetime) + ')'
7787
7788 1
    __repr__ = __str__
7789
7790
7791
class SupportedProfile(FrozenClass):
7792
    '''
7793
    :ivar OrganizationUri:
7794
    :vartype OrganizationUri: String
7795 1
    :ivar ProfileId:
7796
    :vartype ProfileId: String
7797
    :ivar ComplianceTool:
7798
    :vartype ComplianceTool: String
7799
    :ivar ComplianceDate:
7800
    :vartype ComplianceDate: DateTime
7801
    :ivar ComplianceLevel:
7802
    :vartype ComplianceLevel: ComplianceLevel
7803
    :ivar UnsupportedUnitIds:
7804
    :vartype UnsupportedUnitIds: String
7805
    '''
7806 1
7807
    ua_types = (
7808
7809
        ('OrganizationUri', 'String'),
7810
        ('ProfileId', 'String'),
7811
        ('ComplianceTool', 'String'),
7812
        ('ComplianceDate', 'DateTime'),
7813
        ('ComplianceLevel', 'ComplianceLevel'),
7814
        ('UnsupportedUnitIds', 'ListOfString'),
7815
               )
7816 1
7817
    def __init__(self, binary=None):
7818
        if binary is not None:
7819
            self._binary_init(binary)
7820 1
            self._freeze = True
7821
            return
7822
        self.OrganizationUri = None
7823
        self.ProfileId = None
7824
        self.ComplianceTool = None
7825
        self.ComplianceDate = datetime.utcnow()
7826
        self.ComplianceLevel = ComplianceLevel(0)
7827
        self.UnsupportedUnitIds = []
7828
        self._freeze = True
7829
7830
    def to_binary(self):
7831 1
        packet = []
7832
        packet.append(uabin.Primitives.String.pack(self.OrganizationUri))
7833
        packet.append(uabin.Primitives.String.pack(self.ProfileId))
7834
        packet.append(uabin.Primitives.String.pack(self.ComplianceTool))
7835
        packet.append(uabin.Primitives.DateTime.pack(self.ComplianceDate))
7836
        packet.append(uabin.Primitives.UInt32.pack(self.ComplianceLevel.value))
7837 1
        packet.append(uabin.Primitives.Int32.pack(len(self.UnsupportedUnitIds)))
7838
        for fieldname in self.UnsupportedUnitIds:
7839
            packet.append(uabin.Primitives.String.pack(fieldname))
7840 1
        return b''.join(packet)
7841
7842
    @staticmethod
7843
    def from_binary(data):
7844
        return SupportedProfile(data)
7845
7846
    def _binary_init(self, data):
7847
        self.OrganizationUri = uabin.Primitives.String.unpack(data)
7848 1
        self.ProfileId = uabin.Primitives.String.unpack(data)
7849
        self.ComplianceTool = uabin.Primitives.String.unpack(data)
7850
        self.ComplianceDate = uabin.Primitives.DateTime.unpack(data)
7851
        self.ComplianceLevel = ComplianceLevel(uabin.Primitives.UInt32.unpack(data))
7852
        self.UnsupportedUnitIds = uabin.Primitives.String.unpack_array(data)
7853 1
7854 1
    def __str__(self):
7855 1
        return 'SupportedProfile(' + 'OrganizationUri:' + str(self.OrganizationUri) + ', ' + \
7856 1
               'ProfileId:' + str(self.ProfileId) + ', ' + \
7857 1
               'ComplianceTool:' + str(self.ComplianceTool) + ', ' + \
7858 1
               'ComplianceDate:' + str(self.ComplianceDate) + ', ' + \
7859 1
               'ComplianceLevel:' + str(self.ComplianceLevel) + ', ' + \
7860 1
               'UnsupportedUnitIds:' + str(self.UnsupportedUnitIds) + ')'
7861
7862 1
    __repr__ = __str__
7863 1
7864 1
7865 1
class SoftwareCertificate(FrozenClass):
7866 1
    '''
7867 1
    :ivar ProductName:
7868 1
    :vartype ProductName: String
7869
    :ivar ProductUri:
7870 1
    :vartype ProductUri: String
7871
    :ivar VendorName:
7872 1
    :vartype VendorName: String
7873
    :ivar VendorProductCertificate:
7874 1
    :vartype VendorProductCertificate: ByteString
7875 1
    :ivar SoftwareVersion:
7876 1
    :vartype SoftwareVersion: String
7877 1
    :ivar BuildNumber:
7878 1
    :vartype BuildNumber: String
7879 1
    :ivar BuildDate:
7880 1
    :vartype BuildDate: DateTime
7881 1
    :ivar IssuedBy:
7882
    :vartype IssuedBy: String
7883 1
    :ivar IssueDate:
7884
    :vartype IssueDate: DateTime
7885
    :ivar SupportedProfiles:
7886
    :vartype SupportedProfiles: SupportedProfile
7887 1
    '''
7888
7889
    ua_types = (
7890 1
7891
        ('ProductName', 'String'),
7892
        ('ProductUri', 'String'),
7893
        ('VendorName', 'String'),
7894
        ('VendorProductCertificate', 'ByteString'),
7895
        ('SoftwareVersion', 'String'),
7896 1
        ('BuildNumber', 'String'),
7897
        ('BuildDate', 'DateTime'),
7898
        ('IssuedBy', 'String'),
7899
        ('IssueDate', 'DateTime'),
7900 1
        ('SupportedProfiles', 'ListOfSupportedProfile'),
7901 1
               )
7902 1
7903 1
    def __init__(self, binary=None):
7904 1
        if binary is not None:
7905 1
            self._binary_init(binary)
7906 1
            self._freeze = True
7907
            return
7908 1
        self.ProductName = None
7909 1
        self.ProductUri = None
7910 1
        self.VendorName = None
7911 1
        self.VendorProductCertificate = None
7912 1
        self.SoftwareVersion = None
7913 1
        self.BuildNumber = None
7914
        self.BuildDate = datetime.utcnow()
7915 1
        self.IssuedBy = None
7916
        self.IssueDate = datetime.utcnow()
7917 1
        self.SupportedProfiles = []
7918
        self._freeze = True
7919 1
7920 1
    def to_binary(self):
7921 1
        packet = []
7922 1
        packet.append(uabin.Primitives.String.pack(self.ProductName))
7923 1
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
7924 1
        packet.append(uabin.Primitives.String.pack(self.VendorName))
7925 1
        packet.append(uabin.Primitives.ByteString.pack(self.VendorProductCertificate))
7926
        packet.append(uabin.Primitives.String.pack(self.SoftwareVersion))
7927 1
        packet.append(uabin.Primitives.String.pack(self.BuildNumber))
7928
        packet.append(uabin.Primitives.DateTime.pack(self.BuildDate))
7929
        packet.append(uabin.Primitives.String.pack(self.IssuedBy))
7930 1
        packet.append(uabin.Primitives.DateTime.pack(self.IssueDate))
7931
        packet.append(uabin.Primitives.Int32.pack(len(self.SupportedProfiles)))
7932
        for fieldname in self.SupportedProfiles:
7933 1
            packet.append(fieldname.to_binary())
7934
        return b''.join(packet)
7935
7936
    @staticmethod
7937
    def from_binary(data):
7938
        return SoftwareCertificate(data)
7939 1
7940
    def _binary_init(self, data):
7941
        self.ProductName = uabin.Primitives.String.unpack(data)
7942
        self.ProductUri = uabin.Primitives.String.unpack(data)
7943 1
        self.VendorName = uabin.Primitives.String.unpack(data)
7944
        self.VendorProductCertificate = uabin.Primitives.ByteString.unpack(data)
7945
        self.SoftwareVersion = uabin.Primitives.String.unpack(data)
7946
        self.BuildNumber = uabin.Primitives.String.unpack(data)
7947
        self.BuildDate = uabin.Primitives.DateTime.unpack(data)
7948
        self.IssuedBy = uabin.Primitives.String.unpack(data)
7949
        self.IssueDate = uabin.Primitives.DateTime.unpack(data)
7950
        length = uabin.Primitives.Int32.unpack(data)
7951 1
        array = []
7952
        if length != -1:
7953
            for _ in range(0, length):
7954
                array.append(SupportedProfile.from_binary(data))
7955
        self.SupportedProfiles = array
7956 1
7957
    def __str__(self):
7958
        return 'SoftwareCertificate(' + 'ProductName:' + str(self.ProductName) + ', ' + \
7959
               'ProductUri:' + str(self.ProductUri) + ', ' + \
7960 1
               'VendorName:' + str(self.VendorName) + ', ' + \
7961
               'VendorProductCertificate:' + str(self.VendorProductCertificate) + ', ' + \
7962
               'SoftwareVersion:' + str(self.SoftwareVersion) + ', ' + \
7963 1
               'BuildNumber:' + str(self.BuildNumber) + ', ' + \
7964
               'BuildDate:' + str(self.BuildDate) + ', ' + \
7965
               'IssuedBy:' + str(self.IssuedBy) + ', ' + \
7966 1
               'IssueDate:' + str(self.IssueDate) + ', ' + \
7967
               'SupportedProfiles:' + str(self.SupportedProfiles) + ')'
7968
7969 1
    __repr__ = __str__
7970
7971
7972
class QueryDataDescription(FrozenClass):
7973
    '''
7974
    :ivar RelativePath:
7975 1
    :vartype RelativePath: RelativePath
7976
    :ivar AttributeId:
7977
    :vartype AttributeId: UInt32
7978 View Code Duplication
    :ivar IndexRange:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7979 1
    :vartype IndexRange: String
7980 1
    '''
7981 1
7982 1
    ua_types = (
7983 1
7984 1
        ('RelativePath', 'RelativePath'),
7985 1
        ('AttributeId', 'UInt32'),
7986
        ('IndexRange', 'String'),
7987 1
               )
7988 1
7989 1
    def __init__(self, binary=None):
7990 1
        if binary is not None:
7991
            self._binary_init(binary)
7992 1
            self._freeze = True
7993
            return
7994 1
        self.RelativePath = RelativePath()
7995
        self.AttributeId = 0
7996 1
        self.IndexRange = None
7997 1
        self._freeze = True
7998
7999 1
    def to_binary(self):
8000
        packet = []
8001
        packet.append(self.RelativePath.to_binary())
8002 1
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
8003
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
8004
        return b''.join(packet)
8005 1
8006
    @staticmethod
8007
    def from_binary(data):
8008
        return QueryDataDescription(data)
8009
8010
    def _binary_init(self, data):
8011
        self.RelativePath = RelativePath.from_binary(data)
8012
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
8013
        self.IndexRange = uabin.Primitives.String.unpack(data)
8014 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8015
    def __str__(self):
8016
        return 'QueryDataDescription(' + 'RelativePath:' + str(self.RelativePath) + ', ' + \
8017
               'AttributeId:' + str(self.AttributeId) + ', ' + \
8018
               'IndexRange:' + str(self.IndexRange) + ')'
8019 1
8020
    __repr__ = __str__
8021
8022
8023
class NodeTypeDescription(FrozenClass):
8024
    '''
8025
    :ivar TypeDefinitionNode:
8026
    :vartype TypeDefinitionNode: ExpandedNodeId
8027 1
    :ivar IncludeSubTypes:
8028
    :vartype IncludeSubTypes: Boolean
8029
    :ivar DataToReturn:
8030
    :vartype DataToReturn: QueryDataDescription
8031
    '''
8032
8033
    ua_types = (
8034
8035
        ('TypeDefinitionNode', 'ExpandedNodeId'),
8036
        ('IncludeSubTypes', 'Boolean'),
8037
        ('DataToReturn', 'ListOfQueryDataDescription'),
8038
               )
8039 1
8040
    def __init__(self, binary=None):
8041
        if binary is not None:
8042
            self._binary_init(binary)
8043
            self._freeze = True
8044
            return
8045
        self.TypeDefinitionNode = ExpandedNodeId()
8046
        self.IncludeSubTypes = True
8047
        self.DataToReturn = []
8048 1
        self._freeze = True
8049
8050
    def to_binary(self):
8051
        packet = []
8052 1
        packet.append(self.TypeDefinitionNode.to_binary())
8053
        packet.append(uabin.Primitives.Boolean.pack(self.IncludeSubTypes))
8054
        packet.append(uabin.Primitives.Int32.pack(len(self.DataToReturn)))
8055
        for fieldname in self.DataToReturn:
8056
            packet.append(fieldname.to_binary())
8057
        return b''.join(packet)
8058
8059 1
    @staticmethod
8060
    def from_binary(data):
8061
        return NodeTypeDescription(data)
8062
8063
    def _binary_init(self, data):
8064
        self.TypeDefinitionNode = ExpandedNodeId.from_binary(data)
8065
        self.IncludeSubTypes = uabin.Primitives.Boolean.unpack(data)
8066 1
        length = uabin.Primitives.Int32.unpack(data)
8067
        array = []
8068
        if length != -1:
8069 1
            for _ in range(0, length):
8070
                array.append(QueryDataDescription.from_binary(data))
8071
        self.DataToReturn = array
8072
8073
    def __str__(self):
8074
        return 'NodeTypeDescription(' + 'TypeDefinitionNode:' + str(self.TypeDefinitionNode) + ', ' + \
8075
               'IncludeSubTypes:' + str(self.IncludeSubTypes) + ', ' + \
8076
               'DataToReturn:' + str(self.DataToReturn) + ')'
8077
8078
    __repr__ = __str__
8079
8080
8081 1
class QueryDataSet(FrozenClass):
8082
    '''
8083
    :ivar NodeId:
8084
    :vartype NodeId: ExpandedNodeId
8085
    :ivar TypeDefinitionNode:
8086
    :vartype TypeDefinitionNode: ExpandedNodeId
8087
    :ivar Values:
8088 1
    :vartype Values: Variant
8089 1
    '''
8090 1
8091 1
    ua_types = (
8092 1
8093 1
        ('NodeId', 'ExpandedNodeId'),
8094 1
        ('TypeDefinitionNode', 'ExpandedNodeId'),
8095 1
        ('Values', 'ListOfVariant'),
8096 1
               )
8097 1
8098
    def __init__(self, binary=None):
8099 1
        if binary is not None:
8100 1
            self._binary_init(binary)
8101 1
            self._freeze = True
8102 1
            return
8103 1
        self.NodeId = ExpandedNodeId()
8104 1
        self.TypeDefinitionNode = ExpandedNodeId()
8105 1
        self.Values = []
8106 1
        self._freeze = True
8107 1
8108
    def to_binary(self):
8109 1
        packet = []
8110
        packet.append(self.NodeId.to_binary())
8111 1
        packet.append(self.TypeDefinitionNode.to_binary())
8112
        packet.append(uabin.Primitives.Int32.pack(len(self.Values)))
8113 1
        for fieldname in self.Values:
8114 1
            packet.append(fieldname.to_binary())
8115 1
        return b''.join(packet)
8116 1
8117 1
    @staticmethod
8118 1
    def from_binary(data):
8119 1
        return QueryDataSet(data)
8120 1
8121 1
    def _binary_init(self, data):
8122 1
        self.NodeId = ExpandedNodeId.from_binary(data)
8123
        self.TypeDefinitionNode = ExpandedNodeId.from_binary(data)
8124 1
        length = uabin.Primitives.Int32.unpack(data)
8125
        array = []
8126
        if length != -1:
8127
            for _ in range(0, length):
8128
                array.append(Variant.from_binary(data))
8129
        self.Values = array
8130 1
8131
    def __str__(self):
8132
        return 'QueryDataSet(' + 'NodeId:' + str(self.NodeId) + ', ' + \
8133 1
               'TypeDefinitionNode:' + str(self.TypeDefinitionNode) + ', ' + \
8134
               'Values:' + str(self.Values) + ')'
8135
8136
    __repr__ = __str__
8137
8138
8139
class NodeReference(FrozenClass):
8140
    '''
8141
    :ivar NodeId:
8142
    :vartype NodeId: NodeId
8143 1
    :ivar ReferenceTypeId:
8144
    :vartype ReferenceTypeId: NodeId
8145
    :ivar IsForward:
8146
    :vartype IsForward: Boolean
8147
    :ivar ReferencedNodeIds:
8148
    :vartype ReferencedNodeIds: NodeId
8149 1
    '''
8150
8151
    ua_types = (
8152
8153
        ('NodeId', 'NodeId'),
8154
        ('ReferenceTypeId', 'NodeId'),
8155
        ('IsForward', 'Boolean'),
8156
        ('ReferencedNodeIds', 'ListOfNodeId'),
8157
               )
8158
8159 1
    def __init__(self, binary=None):
8160
        if binary is not None:
8161
            self._binary_init(binary)
8162
            self._freeze = True
8163
            return
8164
        self.NodeId = NodeId()
8165
        self.ReferenceTypeId = NodeId()
8166
        self.IsForward = True
8167
        self.ReferencedNodeIds = []
8168
        self._freeze = True
8169
8170 1
    def to_binary(self):
8171
        packet = []
8172
        packet.append(self.NodeId.to_binary())
8173
        packet.append(self.ReferenceTypeId.to_binary())
8174 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsForward))
8175
        packet.append(uabin.Primitives.Int32.pack(len(self.ReferencedNodeIds)))
8176
        for fieldname in self.ReferencedNodeIds:
8177
            packet.append(fieldname.to_binary())
8178
        return b''.join(packet)
8179
8180
    @staticmethod
8181
    def from_binary(data):
8182
        return NodeReference(data)
8183
8184
    def _binary_init(self, data):
8185
        self.NodeId = NodeId.from_binary(data)
8186
        self.ReferenceTypeId = NodeId.from_binary(data)
8187
        self.IsForward = uabin.Primitives.Boolean.unpack(data)
8188
        length = uabin.Primitives.Int32.unpack(data)
8189 1
        array = []
8190
        if length != -1:
8191
            for _ in range(0, length):
8192
                array.append(NodeId.from_binary(data))
8193
        self.ReferencedNodeIds = array
8194 1
8195
    def __str__(self):
8196
        return 'NodeReference(' + 'NodeId:' + str(self.NodeId) + ', ' + \
8197 1
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
8198
               'IsForward:' + str(self.IsForward) + ', ' + \
8199
               'ReferencedNodeIds:' + str(self.ReferencedNodeIds) + ')'
8200
8201
    __repr__ = __str__
8202
8203
8204
class ContentFilterElement(FrozenClass):
8205 1
    '''
8206
    :ivar FilterOperator:
8207
    :vartype FilterOperator: FilterOperator
8208
    :ivar FilterOperands:
8209
    :vartype FilterOperands: ExtensionObject
8210 1
    '''
8211
8212
    ua_types = (
8213
8214
        ('FilterOperator', 'FilterOperator'),
8215
        ('FilterOperands', 'ListOfExtensionObject'),
8216
               )
8217
8218
    def __init__(self, binary=None):
8219 1
        if binary is not None:
8220
            self._binary_init(binary)
8221
            self._freeze = True
8222
            return
8223
        self.FilterOperator = FilterOperator(0)
8224
        self.FilterOperands = []
8225
        self._freeze = True
8226
8227
    def to_binary(self):
8228
        packet = []
8229 1
        packet.append(uabin.Primitives.UInt32.pack(self.FilterOperator.value))
8230
        packet.append(uabin.Primitives.Int32.pack(len(self.FilterOperands)))
8231
        for fieldname in self.FilterOperands:
8232
            packet.append(extensionobject_to_binary(fieldname))
8233 1
        return b''.join(packet)
8234
8235
    @staticmethod
8236
    def from_binary(data):
8237
        return ContentFilterElement(data)
8238
8239
    def _binary_init(self, data):
8240
        self.FilterOperator = FilterOperator(uabin.Primitives.UInt32.unpack(data))
8241
        length = uabin.Primitives.Int32.unpack(data)
8242
        array = []
8243
        if length != -1:
8244
            for _ in range(0, length):
8245
                array.append(extensionobject_from_binary(data))
8246
        self.FilterOperands = array
8247 1
8248
    def __str__(self):
8249
        return 'ContentFilterElement(' + 'FilterOperator:' + str(self.FilterOperator) + ', ' + \
8250
               'FilterOperands:' + str(self.FilterOperands) + ')'
8251 1
8252
    __repr__ = __str__
8253
8254 1
8255
class ContentFilter(FrozenClass):
8256
    '''
8257
    :ivar Elements:
8258
    :vartype Elements: ContentFilterElement
8259
    '''
8260
8261
    ua_types = (
8262
8263
        ('Elements', 'ListOfContentFilterElement'),
8264 1
               )
8265
8266
    def __init__(self, binary=None):
8267
        if binary is not None:
8268
            self._binary_init(binary)
8269
            self._freeze = True
8270 1
            return
8271
        self.Elements = []
8272
        self._freeze = True
8273
8274
    def to_binary(self):
8275
        packet = []
8276
        packet.append(uabin.Primitives.Int32.pack(len(self.Elements)))
8277
        for fieldname in self.Elements:
8278
            packet.append(fieldname.to_binary())
8279
        return b''.join(packet)
8280 1
8281
    @staticmethod
8282
    def from_binary(data):
8283
        return ContentFilter(data)
8284
8285
    def _binary_init(self, data):
8286
        length = uabin.Primitives.Int32.unpack(data)
8287
        array = []
8288
        if length != -1:
8289
            for _ in range(0, length):
8290
                array.append(ContentFilterElement.from_binary(data))
8291 1
        self.Elements = array
8292
8293
    def __str__(self):
8294
        return 'ContentFilter(' + 'Elements:' + str(self.Elements) + ')'
8295 1
8296
    __repr__ = __str__
8297
8298
8299
class ElementOperand(FrozenClass):
8300
    '''
8301
    :ivar Index:
8302
    :vartype Index: UInt32
8303
    '''
8304
8305
    ua_types = (
8306
8307
        ('Index', 'UInt32'),
8308
               )
8309
8310 1
    def __init__(self, binary=None):
8311
        if binary is not None:
8312
            self._binary_init(binary)
8313
            self._freeze = True
8314
            return
8315 1
        self.Index = 0
8316
        self._freeze = True
8317
8318 1
    def to_binary(self):
8319
        packet = []
8320
        packet.append(uabin.Primitives.UInt32.pack(self.Index))
8321
        return b''.join(packet)
8322
8323
    @staticmethod
8324
    def from_binary(data):
8325
        return ElementOperand(data)
8326
8327
    def _binary_init(self, data):
8328
        self.Index = uabin.Primitives.UInt32.unpack(data)
8329
8330
    def __str__(self):
8331
        return 'ElementOperand(' + 'Index:' + str(self.Index) + ')'
8332 1
8333
    __repr__ = __str__
8334
8335
8336
class LiteralOperand(FrozenClass):
8337
    '''
8338
    :ivar Value:
8339
    :vartype Value: Variant
8340 1
    '''
8341
8342
    ua_types = (
8343
8344
        ('Value', 'Variant'),
8345
               )
8346
8347
    def __init__(self, binary=None):
8348
        if binary is not None:
8349
            self._binary_init(binary)
8350
            self._freeze = True
8351
            return
8352 1
        self.Value = Variant()
8353
        self._freeze = True
8354
8355
    def to_binary(self):
8356
        packet = []
8357
        packet.append(self.Value.to_binary())
8358
        return b''.join(packet)
8359
8360
    @staticmethod
8361
    def from_binary(data):
8362
        return LiteralOperand(data)
8363 1
8364
    def _binary_init(self, data):
8365
        self.Value = Variant.from_binary(data)
8366
8367 1
    def __str__(self):
8368
        return 'LiteralOperand(' + 'Value:' + str(self.Value) + ')'
8369
8370
    __repr__ = __str__
8371
8372
8373
class AttributeOperand(FrozenClass):
8374
    '''
8375
    :ivar NodeId:
8376
    :vartype NodeId: NodeId
8377
    :ivar Alias:
8378
    :vartype Alias: String
8379 1
    :ivar BrowsePath:
8380
    :vartype BrowsePath: RelativePath
8381
    :ivar AttributeId:
8382
    :vartype AttributeId: UInt32
8383
    :ivar IndexRange:
8384
    :vartype IndexRange: String
8385
    '''
8386 1
8387
    ua_types = (
8388
8389 1
        ('NodeId', 'NodeId'),
8390
        ('Alias', 'String'),
8391
        ('BrowsePath', 'RelativePath'),
8392
        ('AttributeId', 'UInt32'),
8393
        ('IndexRange', 'String'),
8394
               )
8395
8396
    def __init__(self, binary=None):
8397
        if binary is not None:
8398
            self._binary_init(binary)
8399 1
            self._freeze = True
8400
            return
8401
        self.NodeId = NodeId()
8402
        self.Alias = None
8403
        self.BrowsePath = RelativePath()
8404
        self.AttributeId = 0
8405 1
        self.IndexRange = None
8406
        self._freeze = True
8407
8408
    def to_binary(self):
8409
        packet = []
8410
        packet.append(self.NodeId.to_binary())
8411
        packet.append(uabin.Primitives.String.pack(self.Alias))
8412
        packet.append(self.BrowsePath.to_binary())
8413
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
8414
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
8415 1
        return b''.join(packet)
8416
8417
    @staticmethod
8418
    def from_binary(data):
8419
        return AttributeOperand(data)
8420
8421
    def _binary_init(self, data):
8422 1
        self.NodeId = NodeId.from_binary(data)
8423
        self.Alias = uabin.Primitives.String.unpack(data)
8424
        self.BrowsePath = RelativePath.from_binary(data)
8425
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
8426 1
        self.IndexRange = uabin.Primitives.String.unpack(data)
8427
8428
    def __str__(self):
8429
        return 'AttributeOperand(' + 'NodeId:' + str(self.NodeId) + ', ' + \
8430
               'Alias:' + str(self.Alias) + ', ' + \
8431 1
               'BrowsePath:' + str(self.BrowsePath) + ', ' + \
8432
               'AttributeId:' + str(self.AttributeId) + ', ' + \
8433
               'IndexRange:' + str(self.IndexRange) + ')'
8434
8435
    __repr__ = __str__
8436 1
8437
8438
class SimpleAttributeOperand(FrozenClass):
8439 1
    '''
8440
    :ivar TypeDefinitionId:
8441
    :vartype TypeDefinitionId: NodeId
8442
    :ivar BrowsePath:
8443
    :vartype BrowsePath: QualifiedName
8444
    :ivar AttributeId:
8445
    :vartype AttributeId: UInt32
8446
    :ivar IndexRange:
8447
    :vartype IndexRange: String
8448
    '''
8449
8450
    ua_types = (
8451
8452
        ('TypeDefinitionId', 'NodeId'),
8453 1
        ('BrowsePath', 'ListOfQualifiedName'),
8454
        ('AttributeId', 'UInt32'),
8455
        ('IndexRange', 'String'),
8456
               )
8457
8458
    def __init__(self, binary=None):
8459
        if binary is not None:
8460
            self._binary_init(binary)
8461 1
            self._freeze = True
8462
            return
8463
        self.TypeDefinitionId = NodeId()
8464
        self.BrowsePath = []
8465
        self.AttributeId = 0
8466
        self.IndexRange = None
8467
        self._freeze = True
8468
8469
    def to_binary(self):
8470
        packet = []
8471
        packet.append(self.TypeDefinitionId.to_binary())
8472
        packet.append(uabin.Primitives.Int32.pack(len(self.BrowsePath)))
8473 1
        for fieldname in self.BrowsePath:
8474
            packet.append(fieldname.to_binary())
8475
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
8476
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
8477
        return b''.join(packet)
8478
8479
    @staticmethod
8480
    def from_binary(data):
8481
        return SimpleAttributeOperand(data)
8482
8483
    def _binary_init(self, data):
8484
        self.TypeDefinitionId = NodeId.from_binary(data)
8485
        length = uabin.Primitives.Int32.unpack(data)
8486
        array = []
8487
        if length != -1:
8488 1
            for _ in range(0, length):
8489
                array.append(QualifiedName.from_binary(data))
8490
        self.BrowsePath = array
8491
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
8492 1 View Code Duplication
        self.IndexRange = uabin.Primitives.String.unpack(data)
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8493
8494
    def __str__(self):
8495
        return 'SimpleAttributeOperand(' + 'TypeDefinitionId:' + str(self.TypeDefinitionId) + ', ' + \
8496
               'BrowsePath:' + str(self.BrowsePath) + ', ' + \
8497
               'AttributeId:' + str(self.AttributeId) + ', ' + \
8498
               'IndexRange:' + str(self.IndexRange) + ')'
8499
8500
    __repr__ = __str__
8501
8502
8503
class ContentFilterElementResult(FrozenClass):
8504
    '''
8505
    :ivar StatusCode:
8506
    :vartype StatusCode: StatusCode
8507
    :ivar OperandStatusCodes:
8508
    :vartype OperandStatusCodes: StatusCode
8509
    :ivar OperandDiagnosticInfos:
8510
    :vartype OperandDiagnosticInfos: DiagnosticInfo
8511
    '''
8512
8513
    ua_types = (
8514 1
8515
        ('StatusCode', 'StatusCode'),
8516
        ('OperandStatusCodes', 'ListOfStatusCode'),
8517
        ('OperandDiagnosticInfos', 'ListOfDiagnosticInfo'),
8518
               )
8519
8520
    def __init__(self, binary=None):
8521 1
        if binary is not None:
8522
            self._binary_init(binary)
8523
            self._freeze = True
8524 1
            return
8525
        self.StatusCode = StatusCode()
8526
        self.OperandStatusCodes = []
8527
        self.OperandDiagnosticInfos = []
8528
        self._freeze = True
8529
8530
    def to_binary(self):
8531
        packet = []
8532
        packet.append(self.StatusCode.to_binary())
8533
        packet.append(uabin.Primitives.Int32.pack(len(self.OperandStatusCodes)))
8534 1
        for fieldname in self.OperandStatusCodes:
8535
            packet.append(fieldname.to_binary())
8536
        packet.append(uabin.Primitives.Int32.pack(len(self.OperandDiagnosticInfos)))
8537
        for fieldname in self.OperandDiagnosticInfos:
8538
            packet.append(fieldname.to_binary())
8539
        return b''.join(packet)
8540 1
8541
    @staticmethod
8542
    def from_binary(data):
8543
        return ContentFilterElementResult(data)
8544
8545
    def _binary_init(self, data):
8546
        self.StatusCode = StatusCode.from_binary(data)
8547
        length = uabin.Primitives.Int32.unpack(data)
8548
        array = []
8549
        if length != -1:
8550 1
            for _ in range(0, length):
8551
                array.append(StatusCode.from_binary(data))
8552
        self.OperandStatusCodes = array
8553
        length = uabin.Primitives.Int32.unpack(data)
8554
        array = []
8555
        if length != -1:
8556
            for _ in range(0, length):
8557 1
                array.append(DiagnosticInfo.from_binary(data))
8558
        self.OperandDiagnosticInfos = array
8559
8560
    def __str__(self):
8561 1
        return 'ContentFilterElementResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
8562
               'OperandStatusCodes:' + str(self.OperandStatusCodes) + ', ' + \
8563
               'OperandDiagnosticInfos:' + str(self.OperandDiagnosticInfos) + ')'
8564
8565
    __repr__ = __str__
8566 1
8567
8568
class ContentFilterResult(FrozenClass):
8569
    '''
8570
    :ivar ElementResults:
8571 1
    :vartype ElementResults: ContentFilterElementResult
8572
    :ivar ElementDiagnosticInfos:
8573
    :vartype ElementDiagnosticInfos: DiagnosticInfo
8574 1
    '''
8575
8576
    ua_types = (
8577
8578
        ('ElementResults', 'ListOfContentFilterElementResult'),
8579
        ('ElementDiagnosticInfos', 'ListOfDiagnosticInfo'),
8580
               )
8581
8582 1
    def __init__(self, binary=None):
8583
        if binary is not None:
8584
            self._binary_init(binary)
8585
            self._freeze = True
8586
            return
8587 1
        self.ElementResults = []
8588
        self.ElementDiagnosticInfos = []
8589
        self._freeze = True
8590
8591
    def to_binary(self):
8592
        packet = []
8593
        packet.append(uabin.Primitives.Int32.pack(len(self.ElementResults)))
8594
        for fieldname in self.ElementResults:
8595
            packet.append(fieldname.to_binary())
8596 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ElementDiagnosticInfos)))
8597
        for fieldname in self.ElementDiagnosticInfos:
8598
            packet.append(fieldname.to_binary())
8599
        return b''.join(packet)
8600
8601
    @staticmethod
8602 1
    def from_binary(data):
8603
        return ContentFilterResult(data)
8604
8605
    def _binary_init(self, data):
8606 1
        length = uabin.Primitives.Int32.unpack(data)
8607
        array = []
8608
        if length != -1:
8609
            for _ in range(0, length):
8610 1
                array.append(ContentFilterElementResult.from_binary(data))
8611
        self.ElementResults = array
8612
        length = uabin.Primitives.Int32.unpack(data)
8613
        array = []
8614 1
        if length != -1:
8615
            for _ in range(0, length):
8616
                array.append(DiagnosticInfo.from_binary(data))
8617 1
        self.ElementDiagnosticInfos = array
8618
8619
    def __str__(self):
8620
        return 'ContentFilterResult(' + 'ElementResults:' + str(self.ElementResults) + ', ' + \
8621
               'ElementDiagnosticInfos:' + str(self.ElementDiagnosticInfos) + ')'
8622
8623
    __repr__ = __str__
8624
8625
8626
class ParsingResult(FrozenClass):
8627 1
    '''
8628
    :ivar StatusCode:
8629
    :vartype StatusCode: StatusCode
8630
    :ivar DataStatusCodes:
8631
    :vartype DataStatusCodes: StatusCode
8632
    :ivar DataDiagnosticInfos:
8633 1
    :vartype DataDiagnosticInfos: DiagnosticInfo
8634
    '''
8635
8636
    ua_types = (
8637
8638
        ('StatusCode', 'StatusCode'),
8639
        ('DataStatusCodes', 'ListOfStatusCode'),
8640
        ('DataDiagnosticInfos', 'ListOfDiagnosticInfo'),
8641
               )
8642
8643 1
    def __init__(self, binary=None):
8644
        if binary is not None:
8645
            self._binary_init(binary)
8646
            self._freeze = True
8647
            return
8648
        self.StatusCode = StatusCode()
8649
        self.DataStatusCodes = []
8650 1
        self.DataDiagnosticInfos = []
8651
        self._freeze = True
8652
8653
    def to_binary(self):
8654 1
        packet = []
8655
        packet.append(self.StatusCode.to_binary())
8656
        packet.append(uabin.Primitives.Int32.pack(len(self.DataStatusCodes)))
8657
        for fieldname in self.DataStatusCodes:
8658
            packet.append(fieldname.to_binary())
8659 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DataDiagnosticInfos)))
8660
        for fieldname in self.DataDiagnosticInfos:
8661
            packet.append(fieldname.to_binary())
8662
        return b''.join(packet)
8663
8664 1
    @staticmethod
8665
    def from_binary(data):
8666
        return ParsingResult(data)
8667 1
8668
    def _binary_init(self, data):
8669
        self.StatusCode = StatusCode.from_binary(data)
8670
        length = uabin.Primitives.Int32.unpack(data)
8671
        array = []
8672
        if length != -1:
8673
            for _ in range(0, length):
8674
                array.append(StatusCode.from_binary(data))
8675 1
        self.DataStatusCodes = array
8676
        length = uabin.Primitives.Int32.unpack(data)
8677
        array = []
8678
        if length != -1:
8679
            for _ in range(0, length):
8680 1
                array.append(DiagnosticInfo.from_binary(data))
8681
        self.DataDiagnosticInfos = array
8682
8683
    def __str__(self):
8684
        return 'ParsingResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
8685
               'DataStatusCodes:' + str(self.DataStatusCodes) + ', ' + \
8686
               'DataDiagnosticInfos:' + str(self.DataDiagnosticInfos) + ')'
8687
8688
    __repr__ = __str__
8689 1
8690
8691
class QueryFirstParameters(FrozenClass):
8692
    '''
8693
    :ivar View:
8694
    :vartype View: ViewDescription
8695
    :ivar NodeTypes:
8696
    :vartype NodeTypes: NodeTypeDescription
8697 1
    :ivar Filter:
8698
    :vartype Filter: ContentFilter
8699
    :ivar MaxDataSetsToReturn:
8700
    :vartype MaxDataSetsToReturn: UInt32
8701 1
    :ivar MaxReferencesToReturn:
8702
    :vartype MaxReferencesToReturn: UInt32
8703
    '''
8704
8705
    ua_types = (
8706
8707
        ('View', 'ViewDescription'),
8708
        ('NodeTypes', 'ListOfNodeTypeDescription'),
8709
        ('Filter', 'ContentFilter'),
8710 1
        ('MaxDataSetsToReturn', 'UInt32'),
8711
        ('MaxReferencesToReturn', 'UInt32'),
8712
               )
8713
8714 1
    def __init__(self, binary=None):
8715
        if binary is not None:
8716
            self._binary_init(binary)
8717 1
            self._freeze = True
8718
            return
8719
        self.View = ViewDescription()
8720
        self.NodeTypes = []
8721
        self.Filter = ContentFilter()
8722
        self.MaxDataSetsToReturn = 0
8723
        self.MaxReferencesToReturn = 0
8724
        self._freeze = True
8725
8726
    def to_binary(self):
8727 1
        packet = []
8728
        packet.append(self.View.to_binary())
8729
        packet.append(uabin.Primitives.Int32.pack(len(self.NodeTypes)))
8730
        for fieldname in self.NodeTypes:
8731
            packet.append(fieldname.to_binary())
8732
        packet.append(self.Filter.to_binary())
8733 1
        packet.append(uabin.Primitives.UInt32.pack(self.MaxDataSetsToReturn))
8734
        packet.append(uabin.Primitives.UInt32.pack(self.MaxReferencesToReturn))
8735
        return b''.join(packet)
8736
8737
    @staticmethod
8738
    def from_binary(data):
8739
        return QueryFirstParameters(data)
8740
8741
    def _binary_init(self, data):
8742
        self.View = ViewDescription.from_binary(data)
8743 1
        length = uabin.Primitives.Int32.unpack(data)
8744
        array = []
8745
        if length != -1:
8746
            for _ in range(0, length):
8747
                array.append(NodeTypeDescription.from_binary(data))
8748
        self.NodeTypes = array
8749
        self.Filter = ContentFilter.from_binary(data)
8750 1
        self.MaxDataSetsToReturn = uabin.Primitives.UInt32.unpack(data)
8751
        self.MaxReferencesToReturn = uabin.Primitives.UInt32.unpack(data)
8752
8753
    def __str__(self):
8754 1
        return 'QueryFirstParameters(' + 'View:' + str(self.View) + ', ' + \
8755
               'NodeTypes:' + str(self.NodeTypes) + ', ' + \
8756
               'Filter:' + str(self.Filter) + ', ' + \
8757
               'MaxDataSetsToReturn:' + str(self.MaxDataSetsToReturn) + ', ' + \
8758
               'MaxReferencesToReturn:' + str(self.MaxReferencesToReturn) + ')'
8759 1
8760
    __repr__ = __str__
8761
8762
8763
class QueryFirstRequest(FrozenClass):
8764 1
    '''
8765
    :ivar TypeId:
8766
    :vartype TypeId: NodeId
8767 1
    :ivar RequestHeader:
8768
    :vartype RequestHeader: RequestHeader
8769
    :ivar Parameters:
8770
    :vartype Parameters: QueryFirstParameters
8771
    '''
8772
8773
    ua_types = (
8774
8775
        ('TypeId', 'NodeId'),
8776 View Code Duplication
        ('RequestHeader', 'RequestHeader'),
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8777
        ('Parameters', 'QueryFirstParameters'),
8778
               )
8779 1
8780
    def __init__(self, binary=None):
8781
        if binary is not None:
8782
            self._binary_init(binary)
8783
            self._freeze = True
8784
            return
8785
        self.TypeId = FourByteNodeId(ObjectIds.QueryFirstRequest_Encoding_DefaultBinary)
8786 1
        self.RequestHeader = RequestHeader()
8787 1
        self.Parameters = QueryFirstParameters()
8788 1
        self._freeze = True
8789 1
8790 1
    def to_binary(self):
8791 1
        packet = []
8792 1
        packet.append(self.TypeId.to_binary())
8793 1
        packet.append(self.RequestHeader.to_binary())
8794 1
        packet.append(self.Parameters.to_binary())
8795 1
        return b''.join(packet)
8796
8797 1
    @staticmethod
8798 1
    def from_binary(data):
8799 1
        return QueryFirstRequest(data)
8800 1
8801 1
    def _binary_init(self, data):
8802 1
        self.TypeId = NodeId.from_binary(data)
8803 1
        self.RequestHeader = RequestHeader.from_binary(data)
8804
        self.Parameters = QueryFirstParameters.from_binary(data)
8805 1
8806
    def __str__(self):
8807 1
        return 'QueryFirstRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8808
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
8809 1
               'Parameters:' + str(self.Parameters) + ')'
8810 1
8811 1
    __repr__ = __str__
8812 1
8813 1
8814
class QueryFirstResult(FrozenClass):
8815 1
    '''
8816
    :ivar QueryDataSets:
8817
    :vartype QueryDataSets: QueryDataSet
8818
    :ivar ContinuationPoint:
8819
    :vartype ContinuationPoint: ByteString
8820
    :ivar ParsingResults:
8821 1
    :vartype ParsingResults: ParsingResult
8822
    :ivar DiagnosticInfos:
8823
    :vartype DiagnosticInfos: DiagnosticInfo
8824 1
    :ivar FilterResult:
8825
    :vartype FilterResult: ContentFilterResult
8826
    '''
8827
8828
    ua_types = (
8829
8830
        ('QueryDataSets', 'ListOfQueryDataSet'),
8831
        ('ContinuationPoint', 'ByteString'),
8832
        ('ParsingResults', 'ListOfParsingResult'),
8833 View Code Duplication
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8834 1
        ('FilterResult', 'ContentFilterResult'),
8835
               )
8836
8837
    def __init__(self, binary=None):
8838
        if binary is not None:
8839
            self._binary_init(binary)
8840 1
            self._freeze = True
8841 1
            return
8842 1
        self.QueryDataSets = []
8843 1
        self.ContinuationPoint = None
8844 1
        self.ParsingResults = []
8845 1
        self.DiagnosticInfos = []
8846 1
        self.FilterResult = ContentFilterResult()
8847 1
        self._freeze = True
8848 1
8849
    def to_binary(self):
8850 1
        packet = []
8851 1
        packet.append(uabin.Primitives.Int32.pack(len(self.QueryDataSets)))
8852 1
        for fieldname in self.QueryDataSets:
8853 1
            packet.append(fieldname.to_binary())
8854 1
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
8855 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ParsingResults)))
8856 1
        for fieldname in self.ParsingResults:
8857 1
            packet.append(fieldname.to_binary())
8858
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
8859 1
        for fieldname in self.DiagnosticInfos:
8860
            packet.append(fieldname.to_binary())
8861 1
        packet.append(self.FilterResult.to_binary())
8862
        return b''.join(packet)
8863 1
8864 1
    @staticmethod
8865 1
    def from_binary(data):
8866 1
        return QueryFirstResult(data)
8867 1
8868 1
    def _binary_init(self, data):
8869 1
        length = uabin.Primitives.Int32.unpack(data)
8870 1
        array = []
8871 1
        if length != -1:
8872
            for _ in range(0, length):
8873 1
                array.append(QueryDataSet.from_binary(data))
8874
        self.QueryDataSets = array
8875
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
8876
        length = uabin.Primitives.Int32.unpack(data)
8877
        array = []
8878 1
        if length != -1:
8879
            for _ in range(0, length):
8880
                array.append(ParsingResult.from_binary(data))
8881 1
        self.ParsingResults = array
8882
        length = uabin.Primitives.Int32.unpack(data)
8883
        array = []
8884
        if length != -1:
8885
            for _ in range(0, length):
8886
                array.append(DiagnosticInfo.from_binary(data))
8887
        self.DiagnosticInfos = array
8888
        self.FilterResult = ContentFilterResult.from_binary(data)
8889
8890
    def __str__(self):
8891 1
        return 'QueryFirstResult(' + 'QueryDataSets:' + str(self.QueryDataSets) + ', ' + \
8892
               'ContinuationPoint:' + str(self.ContinuationPoint) + ', ' + \
8893
               'ParsingResults:' + str(self.ParsingResults) + ', ' + \
8894
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ', ' + \
8895
               'FilterResult:' + str(self.FilterResult) + ')'
8896
8897 1
    __repr__ = __str__
8898 1
8899
8900
class QueryFirstResponse(FrozenClass):
8901
    '''
8902 1
    :ivar TypeId:
8903 1
    :vartype TypeId: NodeId
8904 1
    :ivar ResponseHeader:
8905 1
    :vartype ResponseHeader: ResponseHeader
8906
    :ivar Parameters:
8907 1
    :vartype Parameters: QueryFirstResult
8908 1
    '''
8909 1
8910 1
    ua_types = (
8911 1
8912 1
        ('TypeId', 'NodeId'),
8913
        ('ResponseHeader', 'ResponseHeader'),
8914 1
        ('Parameters', 'QueryFirstResult'),
8915
               )
8916
8917
    def __init__(self, binary=None):
8918 1
        if binary is not None:
8919
            self._binary_init(binary)
8920
            self._freeze = True
8921
            return
8922
        self.TypeId = FourByteNodeId(ObjectIds.QueryFirstResponse_Encoding_DefaultBinary)
8923 1
        self.ResponseHeader = ResponseHeader()
8924
        self.Parameters = QueryFirstResult()
8925
        self._freeze = True
8926
8927
    def to_binary(self):
8928 1
        packet = []
8929
        packet.append(self.TypeId.to_binary())
8930
        packet.append(self.ResponseHeader.to_binary())
8931 1
        packet.append(self.Parameters.to_binary())
8932
        return b''.join(packet)
8933
8934
    @staticmethod
8935
    def from_binary(data):
8936
        return QueryFirstResponse(data)
8937
8938
    def _binary_init(self, data):
8939
        self.TypeId = NodeId.from_binary(data)
8940 View Code Duplication
        self.ResponseHeader = ResponseHeader.from_binary(data)
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8941
        self.Parameters = QueryFirstResult.from_binary(data)
8942
8943 1
    def __str__(self):
8944
        return 'QueryFirstResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8945
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
8946
               'Parameters:' + str(self.Parameters) + ')'
8947
8948
    __repr__ = __str__
8949
8950 1
8951 1
class QueryNextParameters(FrozenClass):
8952 1
    '''
8953 1
    :ivar ReleaseContinuationPoint:
8954 1
    :vartype ReleaseContinuationPoint: Boolean
8955 1
    :ivar ContinuationPoint:
8956 1
    :vartype ContinuationPoint: ByteString
8957 1
    '''
8958 1
8959 1
    ua_types = (
8960
8961 1
        ('ReleaseContinuationPoint', 'Boolean'),
8962 1
        ('ContinuationPoint', 'ByteString'),
8963 1
               )
8964 1
8965 1
    def __init__(self, binary=None):
8966 1
        if binary is not None:
8967 1
            self._binary_init(binary)
8968 1
            self._freeze = True
8969 1
            return
8970
        self.ReleaseContinuationPoint = True
8971 1
        self.ContinuationPoint = None
8972
        self._freeze = True
8973 1
8974
    def to_binary(self):
8975 1
        packet = []
8976
        packet.append(uabin.Primitives.Boolean.pack(self.ReleaseContinuationPoint))
8977 1
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
8978 1
        return b''.join(packet)
8979 1
8980 1
    @staticmethod
8981 1
    def from_binary(data):
8982 1
        return QueryNextParameters(data)
8983 1
8984 1
    def _binary_init(self, data):
8985 1
        self.ReleaseContinuationPoint = uabin.Primitives.Boolean.unpack(data)
8986 1
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
8987 1
8988 1
    def __str__(self):
8989 1
        return 'QueryNextParameters(' + 'ReleaseContinuationPoint:' + str(self.ReleaseContinuationPoint) + ', ' + \
8990
               'ContinuationPoint:' + str(self.ContinuationPoint) + ')'
8991 1
8992
    __repr__ = __str__
8993 1
8994
8995
class QueryNextRequest(FrozenClass):
8996
    '''
8997
    :ivar TypeId:
8998
    :vartype TypeId: NodeId
8999 1
    :ivar RequestHeader:
9000
    :vartype RequestHeader: RequestHeader
9001
    :ivar Parameters:
9002 1
    :vartype Parameters: QueryNextParameters
9003
    '''
9004
9005
    ua_types = (
9006
9007
        ('TypeId', 'NodeId'),
9008
        ('RequestHeader', 'RequestHeader'),
9009
        ('Parameters', 'QueryNextParameters'),
9010
               )
9011 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9012
    def __init__(self, binary=None):
9013
        if binary is not None:
9014 1
            self._binary_init(binary)
9015
            self._freeze = True
9016
            return
9017
        self.TypeId = FourByteNodeId(ObjectIds.QueryNextRequest_Encoding_DefaultBinary)
9018
        self.RequestHeader = RequestHeader()
9019
        self.Parameters = QueryNextParameters()
9020
        self._freeze = True
9021 1
9022 1
    def to_binary(self):
9023
        packet = []
9024
        packet.append(self.TypeId.to_binary())
9025
        packet.append(self.RequestHeader.to_binary())
9026 1
        packet.append(self.Parameters.to_binary())
9027 1
        return b''.join(packet)
9028 1
9029 1
    @staticmethod
9030 1
    def from_binary(data):
9031
        return QueryNextRequest(data)
9032 1
9033
    def _binary_init(self, data):
9034
        self.TypeId = NodeId.from_binary(data)
9035
        self.RequestHeader = RequestHeader.from_binary(data)
9036
        self.Parameters = QueryNextParameters.from_binary(data)
9037
9038
    def __str__(self):
9039
        return 'QueryNextRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9040 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
9041
               'Parameters:' + str(self.Parameters) + ')'
9042
9043
    __repr__ = __str__
9044 1
9045
9046
class QueryNextResult(FrozenClass):
9047
    '''
9048
    :ivar QueryDataSets:
9049
    :vartype QueryDataSets: QueryDataSet
9050 1
    :ivar RevisedContinuationPoint:
9051
    :vartype RevisedContinuationPoint: ByteString
9052
    '''
9053
9054
    ua_types = (
9055
9056 1
        ('QueryDataSets', 'ListOfQueryDataSet'),
9057
        ('RevisedContinuationPoint', 'ByteString'),
9058
               )
9059 1
9060
    def __init__(self, binary=None):
9061
        if binary is not None:
9062
            self._binary_init(binary)
9063
            self._freeze = True
9064
            return
9065
        self.QueryDataSets = []
9066
        self.RevisedContinuationPoint = None
9067
        self._freeze = True
9068
9069 1
    def to_binary(self):
9070
        packet = []
9071
        packet.append(uabin.Primitives.Int32.pack(len(self.QueryDataSets)))
9072
        for fieldname in self.QueryDataSets:
9073
            packet.append(fieldname.to_binary())
9074
        packet.append(uabin.Primitives.ByteString.pack(self.RevisedContinuationPoint))
9075 1
        return b''.join(packet)
9076 1
9077
    @staticmethod
9078
    def from_binary(data):
9079
        return QueryNextResult(data)
9080 1
9081 1
    def _binary_init(self, data):
9082 1
        length = uabin.Primitives.Int32.unpack(data)
9083 1
        array = []
9084
        if length != -1:
9085 1
            for _ in range(0, length):
9086
                array.append(QueryDataSet.from_binary(data))
9087
        self.QueryDataSets = array
9088
        self.RevisedContinuationPoint = uabin.Primitives.ByteString.unpack(data)
9089
9090
    def __str__(self):
9091
        return 'QueryNextResult(' + 'QueryDataSets:' + str(self.QueryDataSets) + ', ' + \
9092 1
               'RevisedContinuationPoint:' + str(self.RevisedContinuationPoint) + ')'
9093
9094
    __repr__ = __str__
9095
9096 1
9097
class QueryNextResponse(FrozenClass):
9098
    '''
9099
    :ivar TypeId:
9100
    :vartype TypeId: NodeId
9101 1
    :ivar ResponseHeader:
9102
    :vartype ResponseHeader: ResponseHeader
9103
    :ivar Parameters:
9104
    :vartype Parameters: QueryNextResult
9105
    '''
9106 1
9107
    ua_types = (
9108
9109 1
        ('TypeId', 'NodeId'),
9110
        ('ResponseHeader', 'ResponseHeader'),
9111
        ('Parameters', 'QueryNextResult'),
9112
               )
9113 1
9114
    def __init__(self, binary=None):
9115
        if binary is not None:
9116 1
            self._binary_init(binary)
9117
            self._freeze = True
9118 View Code Duplication
            return
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9119
        self.TypeId = FourByteNodeId(ObjectIds.QueryNextResponse_Encoding_DefaultBinary)
9120
        self.ResponseHeader = ResponseHeader()
9121
        self.Parameters = QueryNextResult()
9122
        self._freeze = True
9123 1
9124
    def to_binary(self):
9125
        packet = []
9126
        packet.append(self.TypeId.to_binary())
9127 1
        packet.append(self.ResponseHeader.to_binary())
9128
        packet.append(self.Parameters.to_binary())
9129
        return b''.join(packet)
9130
9131 1
    @staticmethod
9132
    def from_binary(data):
9133
        return QueryNextResponse(data)
9134 1
9135
    def _binary_init(self, data):
9136
        self.TypeId = NodeId.from_binary(data)
9137 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
9138
        self.Parameters = QueryNextResult.from_binary(data)
9139
9140 1
    def __str__(self):
9141
        return 'QueryNextResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9142
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
9143
               'Parameters:' + str(self.Parameters) + ')'
9144
9145
    __repr__ = __str__
9146
9147
9148
class ReadValueId(FrozenClass):
9149
    '''
9150
    :ivar NodeId:
9151
    :vartype NodeId: NodeId
9152 1
    :ivar AttributeId:
9153
    :vartype AttributeId: UInt32
9154
    :ivar IndexRange:
9155
    :vartype IndexRange: String
9156
    :ivar DataEncoding:
9157
    :vartype DataEncoding: QualifiedName
9158
    '''
9159 1
9160 1
    ua_types = (
9161
9162
        ('NodeId', 'NodeId'),
9163
        ('AttributeId', 'UInt32'),
9164 1
        ('IndexRange', 'String'),
9165 1
        ('DataEncoding', 'QualifiedName'),
9166 1
               )
9167 1
9168 1
    def __init__(self, binary=None):
9169
        if binary is not None:
9170 1
            self._binary_init(binary)
9171
            self._freeze = True
9172
            return
9173
        self.NodeId = NodeId()
9174
        self.AttributeId = 0
9175
        self.IndexRange = None
9176
        self.DataEncoding = QualifiedName()
9177
        self._freeze = True
9178 1
9179
    def to_binary(self):
9180
        packet = []
9181
        packet.append(self.NodeId.to_binary())
9182 1
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
9183
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
9184
        packet.append(self.DataEncoding.to_binary())
9185
        return b''.join(packet)
9186
9187
    @staticmethod
9188 1
    def from_binary(data):
9189
        return ReadValueId(data)
9190
9191
    def _binary_init(self, data):
9192
        self.NodeId = NodeId.from_binary(data)
9193
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
9194 1
        self.IndexRange = uabin.Primitives.String.unpack(data)
9195
        self.DataEncoding = QualifiedName.from_binary(data)
9196
9197 1
    def __str__(self):
9198
        return 'ReadValueId(' + 'NodeId:' + str(self.NodeId) + ', ' + \
9199
               'AttributeId:' + str(self.AttributeId) + ', ' + \
9200
               'IndexRange:' + str(self.IndexRange) + ', ' + \
9201
               'DataEncoding:' + str(self.DataEncoding) + ')'
9202
9203
    __repr__ = __str__
9204
9205
9206 View Code Duplication
class ReadParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9207
    '''
9208
    :ivar MaxAge:
9209
    :vartype MaxAge: Double
9210
    :ivar TimestampsToReturn:
9211 1
    :vartype TimestampsToReturn: TimestampsToReturn
9212
    :ivar NodesToRead:
9213
    :vartype NodesToRead: ReadValueId
9214
    '''
9215
9216
    ua_types = (
9217
9218
        ('MaxAge', 'Double'),
9219 1
        ('TimestampsToReturn', 'TimestampsToReturn'),
9220 1
        ('NodesToRead', 'ListOfReadValueId'),
9221
               )
9222
9223
    def __init__(self, binary=None):
9224 1
        if binary is not None:
9225 1
            self._binary_init(binary)
9226 1
            self._freeze = True
9227 1
            return
9228 1
        self.MaxAge = 0
9229 1
        self.TimestampsToReturn = TimestampsToReturn(0)
9230
        self.NodesToRead = []
9231 1
        self._freeze = True
9232
9233
    def to_binary(self):
9234
        packet = []
9235
        packet.append(uabin.Primitives.Double.pack(self.MaxAge))
9236
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
9237
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToRead)))
9238
        for fieldname in self.NodesToRead:
9239
            packet.append(fieldname.to_binary())
9240 1
        return b''.join(packet)
9241
9242
    @staticmethod
9243
    def from_binary(data):
9244 1
        return ReadParameters(data)
9245
9246
    def _binary_init(self, data):
9247
        self.MaxAge = uabin.Primitives.Double.unpack(data)
9248
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
9249
        length = uabin.Primitives.Int32.unpack(data)
9250
        array = []
9251 1
        if length != -1:
9252
            for _ in range(0, length):
9253
                array.append(ReadValueId.from_binary(data))
9254
        self.NodesToRead = array
9255
9256
    def __str__(self):
9257
        return 'ReadParameters(' + 'MaxAge:' + str(self.MaxAge) + ', ' + \
9258 1
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
9259
               'NodesToRead:' + str(self.NodesToRead) + ')'
9260
9261 1
    __repr__ = __str__
9262
9263
9264
class ReadRequest(FrozenClass):
9265
    '''
9266
    :ivar TypeId:
9267
    :vartype TypeId: NodeId
9268
    :ivar RequestHeader:
9269
    :vartype RequestHeader: RequestHeader
9270
    :ivar Parameters:
9271
    :vartype Parameters: ReadParameters
9272
    '''
9273
9274
    ua_types = (
9275 1
9276
        ('TypeId', 'NodeId'),
9277
        ('RequestHeader', 'RequestHeader'),
9278
        ('Parameters', 'ReadParameters'),
9279
               )
9280
9281
    def __init__(self, binary=None):
9282
        if binary is not None:
9283 1
            self._binary_init(binary)
9284
            self._freeze = True
9285
            return
9286
        self.TypeId = FourByteNodeId(ObjectIds.ReadRequest_Encoding_DefaultBinary)
9287
        self.RequestHeader = RequestHeader()
9288
        self.Parameters = ReadParameters()
9289
        self._freeze = True
9290
9291
    def to_binary(self):
9292
        packet = []
9293
        packet.append(self.TypeId.to_binary())
9294
        packet.append(self.RequestHeader.to_binary())
9295 1
        packet.append(self.Parameters.to_binary())
9296
        return b''.join(packet)
9297
9298
    @staticmethod
9299
    def from_binary(data):
9300
        return ReadRequest(data)
9301
9302
    def _binary_init(self, data):
9303
        self.TypeId = NodeId.from_binary(data)
9304
        self.RequestHeader = RequestHeader.from_binary(data)
9305
        self.Parameters = ReadParameters.from_binary(data)
9306 1
9307
    def __str__(self):
9308
        return 'ReadRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9309
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
9310 1
               'Parameters:' + str(self.Parameters) + ')'
9311
9312
    __repr__ = __str__
9313
9314
9315
class ReadResponse(FrozenClass):
9316
    '''
9317
    :ivar TypeId:
9318
    :vartype TypeId: NodeId
9319
    :ivar ResponseHeader:
9320
    :vartype ResponseHeader: ResponseHeader
9321
    :ivar Results:
9322 1
    :vartype Results: DataValue
9323
    :ivar DiagnosticInfos:
9324
    :vartype DiagnosticInfos: DiagnosticInfo
9325
    '''
9326
9327
    ua_types = (
9328
9329 1
        ('TypeId', 'NodeId'),
9330
        ('ResponseHeader', 'ResponseHeader'),
9331
        ('Results', 'ListOfDataValue'),
9332 1
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
9333
               )
9334
9335
    def __init__(self, binary=None):
9336
        if binary is not None:
9337
            self._binary_init(binary)
9338
            self._freeze = True
9339
            return
9340 1
        self.TypeId = FourByteNodeId(ObjectIds.ReadResponse_Encoding_DefaultBinary)
9341
        self.ResponseHeader = ResponseHeader()
9342
        self.Results = []
9343
        self.DiagnosticInfos = []
9344
        self._freeze = True
9345 1
9346
    def to_binary(self):
9347
        packet = []
9348
        packet.append(self.TypeId.to_binary())
9349
        packet.append(self.ResponseHeader.to_binary())
9350
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
9351
        for fieldname in self.Results:
9352
            packet.append(fieldname.to_binary())
9353
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
9354 1
        for fieldname in self.DiagnosticInfos:
9355
            packet.append(fieldname.to_binary())
9356
        return b''.join(packet)
9357
9358
    @staticmethod
9359
    def from_binary(data):
9360
        return ReadResponse(data)
9361
9362 1
    def _binary_init(self, data):
9363
        self.TypeId = NodeId.from_binary(data)
9364
        self.ResponseHeader = ResponseHeader.from_binary(data)
9365
        length = uabin.Primitives.Int32.unpack(data)
9366 1
        array = []
9367
        if length != -1:
9368
            for _ in range(0, length):
9369
                array.append(DataValue.from_binary(data))
9370 1
        self.Results = array
9371
        length = uabin.Primitives.Int32.unpack(data)
9372
        array = []
9373
        if length != -1:
9374 1
            for _ in range(0, length):
9375
                array.append(DiagnosticInfo.from_binary(data))
9376
        self.DiagnosticInfos = array
9377 1
9378
    def __str__(self):
9379
        return 'ReadResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9380
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
9381
               'Results:' + str(self.Results) + ', ' + \
9382
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
9383 1
9384
    __repr__ = __str__
9385
9386
9387 1
class HistoryReadValueId(FrozenClass):
9388 1
    '''
9389
    :ivar NodeId:
9390
    :vartype NodeId: NodeId
9391
    :ivar IndexRange:
9392 1
    :vartype IndexRange: String
9393 1
    :ivar DataEncoding:
9394
    :vartype DataEncoding: QualifiedName
9395 1
    :ivar ContinuationPoint:
9396
    :vartype ContinuationPoint: ByteString
9397
    '''
9398
9399
    ua_types = (
9400
9401
        ('NodeId', 'NodeId'),
9402 1
        ('IndexRange', 'String'),
9403
        ('DataEncoding', 'QualifiedName'),
9404
        ('ContinuationPoint', 'ByteString'),
9405
               )
9406 1
9407
    def __init__(self, binary=None):
9408
        if binary is not None:
9409
            self._binary_init(binary)
9410
            self._freeze = True
9411
            return
9412
        self.NodeId = NodeId()
9413
        self.IndexRange = None
9414 1
        self.DataEncoding = QualifiedName()
9415
        self.ContinuationPoint = None
9416
        self._freeze = True
9417 1
9418
    def to_binary(self):
9419
        packet = []
9420 1
        packet.append(self.NodeId.to_binary())
9421
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
9422
        packet.append(self.DataEncoding.to_binary())
9423
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
9424
        return b''.join(packet)
9425
9426
    @staticmethod
9427
    def from_binary(data):
9428
        return HistoryReadValueId(data)
9429
9430 1
    def _binary_init(self, data):
9431
        self.NodeId = NodeId.from_binary(data)
9432
        self.IndexRange = uabin.Primitives.String.unpack(data)
9433
        self.DataEncoding = QualifiedName.from_binary(data)
9434
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
9435
9436 1
    def __str__(self):
9437
        return 'HistoryReadValueId(' + 'NodeId:' + str(self.NodeId) + ', ' + \
9438
               'IndexRange:' + str(self.IndexRange) + ', ' + \
9439
               'DataEncoding:' + str(self.DataEncoding) + ', ' + \
9440
               'ContinuationPoint:' + str(self.ContinuationPoint) + ')'
9441
9442
    __repr__ = __str__
9443
9444
9445
class HistoryReadResult(FrozenClass):
9446 1
    '''
9447
    :ivar StatusCode:
9448
    :vartype StatusCode: StatusCode
9449
    :ivar ContinuationPoint:
9450
    :vartype ContinuationPoint: ByteString
9451
    :ivar HistoryData:
9452
    :vartype HistoryData: ExtensionObject
9453 1
    '''
9454
9455
    ua_types = (
9456
9457 1
        ('StatusCode', 'StatusCode'),
9458
        ('ContinuationPoint', 'ByteString'),
9459
        ('HistoryData', 'ExtensionObject'),
9460
               )
9461
9462 1
    def __init__(self, binary=None):
9463
        if binary is not None:
9464
            self._binary_init(binary)
9465
            self._freeze = True
9466
            return
9467 1
        self.StatusCode = StatusCode()
9468
        self.ContinuationPoint = None
9469
        self.HistoryData = None
9470 1
        self._freeze = True
9471
9472
    def to_binary(self):
9473
        packet = []
9474
        packet.append(self.StatusCode.to_binary())
9475
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
9476
        packet.append(extensionobject_to_binary(self.HistoryData))
9477
        return b''.join(packet)
9478 1
9479
    @staticmethod
9480
    def from_binary(data):
9481
        return HistoryReadResult(data)
9482
9483 1
    def _binary_init(self, data):
9484
        self.StatusCode = StatusCode.from_binary(data)
9485
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
9486
        self.HistoryData = extensionobject_from_binary(data)
9487
9488
    def __str__(self):
9489
        return 'HistoryReadResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
9490
               'ContinuationPoint:' + str(self.ContinuationPoint) + ', ' + \
9491
               'HistoryData:' + str(self.HistoryData) + ')'
9492 1
9493
    __repr__ = __str__
9494
9495
9496
class HistoryReadDetails(FrozenClass):
9497
    '''
9498
    '''
9499
9500
    ua_types = (
9501
9502 1
               )
9503
9504
    def __init__(self, binary=None):
9505
        if binary is not None:
9506 1
            self._binary_init(binary)
9507
            self._freeze = True
9508
            return
9509
        self._freeze = True
9510
9511
    def to_binary(self):
9512
        packet = []
9513
        return b''.join(packet)
9514
9515
    @staticmethod
9516
    def from_binary(data):
9517
        return HistoryReadDetails(data)
9518
9519
    def _binary_init(self, data):
9520 1
        pass
9521
9522
    def __str__(self):
9523
        return 'HistoryReadDetails(' +  + ')'
9524 1
9525
    __repr__ = __str__
9526
9527 1
9528
class ReadEventDetails(FrozenClass):
9529
    '''
9530
    :ivar NumValuesPerNode:
9531
    :vartype NumValuesPerNode: UInt32
9532
    :ivar StartTime:
9533 1
    :vartype StartTime: DateTime
9534
    :ivar EndTime:
9535
    :vartype EndTime: DateTime
9536
    :ivar Filter:
9537 1
    :vartype Filter: EventFilter
9538 1
    '''
9539
9540
    ua_types = (
9541
9542 1
        ('NumValuesPerNode', 'UInt32'),
9543 1
        ('StartTime', 'DateTime'),
9544
        ('EndTime', 'DateTime'),
9545 1
        ('Filter', 'EventFilter'),
9546
               )
9547
9548
    def __init__(self, binary=None):
9549
        if binary is not None:
9550
            self._binary_init(binary)
9551
            self._freeze = True
9552 1
            return
9553
        self.NumValuesPerNode = 0
9554
        self.StartTime = datetime.utcnow()
9555
        self.EndTime = datetime.utcnow()
9556 1
        self.Filter = EventFilter()
9557
        self._freeze = True
9558
9559
    def to_binary(self):
9560
        packet = []
9561
        packet.append(uabin.Primitives.UInt32.pack(self.NumValuesPerNode))
9562
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
9563
        packet.append(uabin.Primitives.DateTime.pack(self.EndTime))
9564 1
        packet.append(self.Filter.to_binary())
9565
        return b''.join(packet)
9566
9567 1
    @staticmethod
9568
    def from_binary(data):
9569
        return ReadEventDetails(data)
9570 1
9571
    def _binary_init(self, data):
9572
        self.NumValuesPerNode = uabin.Primitives.UInt32.unpack(data)
9573
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
9574
        self.EndTime = uabin.Primitives.DateTime.unpack(data)
9575
        self.Filter = EventFilter.from_binary(data)
9576
9577
    def __str__(self):
9578
        return 'ReadEventDetails(' + 'NumValuesPerNode:' + str(self.NumValuesPerNode) + ', ' + \
9579
               'StartTime:' + str(self.StartTime) + ', ' + \
9580
               'EndTime:' + str(self.EndTime) + ', ' + \
9581
               'Filter:' + str(self.Filter) + ')'
9582 1
9583
    __repr__ = __str__
9584
9585
9586
class ReadRawModifiedDetails(FrozenClass):
9587
    '''
9588
    :ivar IsReadModified:
9589 1
    :vartype IsReadModified: Boolean
9590 1
    :ivar StartTime:
9591
    :vartype StartTime: DateTime
9592
    :ivar EndTime:
9593
    :vartype EndTime: DateTime
9594 1
    :ivar NumValuesPerNode:
9595 1
    :vartype NumValuesPerNode: UInt32
9596 1
    :ivar ReturnBounds:
9597 1
    :vartype ReturnBounds: Boolean
9598 1
    '''
9599
9600 1
    ua_types = (
9601
9602
        ('IsReadModified', 'Boolean'),
9603
        ('StartTime', 'DateTime'),
9604
        ('EndTime', 'DateTime'),
9605
        ('NumValuesPerNode', 'UInt32'),
9606
        ('ReturnBounds', 'Boolean'),
9607
               )
9608
9609
    def __init__(self, binary=None):
9610 1
        if binary is not None:
9611
            self._binary_init(binary)
9612
            self._freeze = True
9613
            return
9614 1
        self.IsReadModified = True
9615
        self.StartTime = datetime.utcnow()
9616
        self.EndTime = datetime.utcnow()
9617
        self.NumValuesPerNode = 0
9618
        self.ReturnBounds = True
9619
        self._freeze = True
9620
9621
    def to_binary(self):
9622
        packet = []
9623
        packet.append(uabin.Primitives.Boolean.pack(self.IsReadModified))
9624
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
9625 1
        packet.append(uabin.Primitives.DateTime.pack(self.EndTime))
9626
        packet.append(uabin.Primitives.UInt32.pack(self.NumValuesPerNode))
9627
        packet.append(uabin.Primitives.Boolean.pack(self.ReturnBounds))
9628
        return b''.join(packet)
9629
9630
    @staticmethod
9631 1
    def from_binary(data):
9632
        return ReadRawModifiedDetails(data)
9633
9634 1
    def _binary_init(self, data):
9635
        self.IsReadModified = uabin.Primitives.Boolean.unpack(data)
9636
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
9637
        self.EndTime = uabin.Primitives.DateTime.unpack(data)
9638
        self.NumValuesPerNode = uabin.Primitives.UInt32.unpack(data)
9639
        self.ReturnBounds = uabin.Primitives.Boolean.unpack(data)
9640
9641
    def __str__(self):
9642
        return 'ReadRawModifiedDetails(' + 'IsReadModified:' + str(self.IsReadModified) + ', ' + \
9643
               'StartTime:' + str(self.StartTime) + ', ' + \
9644 1
               'EndTime:' + str(self.EndTime) + ', ' + \
9645
               'NumValuesPerNode:' + str(self.NumValuesPerNode) + ', ' + \
9646
               'ReturnBounds:' + str(self.ReturnBounds) + ')'
9647
9648
    __repr__ = __str__
9649
9650 1
9651
class ReadProcessedDetails(FrozenClass):
9652
    '''
9653
    :ivar StartTime:
9654
    :vartype StartTime: DateTime
9655
    :ivar EndTime:
9656
    :vartype EndTime: DateTime
9657
    :ivar ProcessingInterval:
9658
    :vartype ProcessingInterval: Double
9659
    :ivar AggregateType:
9660 1
    :vartype AggregateType: NodeId
9661
    :ivar AggregateConfiguration:
9662
    :vartype AggregateConfiguration: AggregateConfiguration
9663
    '''
9664
9665
    ua_types = (
9666
9667 1
        ('StartTime', 'DateTime'),
9668
        ('EndTime', 'DateTime'),
9669
        ('ProcessingInterval', 'Double'),
9670
        ('AggregateType', 'ListOfNodeId'),
9671 1
        ('AggregateConfiguration', 'AggregateConfiguration'),
9672
               )
9673
9674
    def __init__(self, binary=None):
9675
        if binary is not None:
9676 1
            self._binary_init(binary)
9677
            self._freeze = True
9678
            return
9679
        self.StartTime = datetime.utcnow()
9680
        self.EndTime = datetime.utcnow()
9681 1
        self.ProcessingInterval = 0
9682
        self.AggregateType = []
9683
        self.AggregateConfiguration = AggregateConfiguration()
9684 1
        self._freeze = True
9685
9686
    def to_binary(self):
9687
        packet = []
9688
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
9689
        packet.append(uabin.Primitives.DateTime.pack(self.EndTime))
9690
        packet.append(uabin.Primitives.Double.pack(self.ProcessingInterval))
9691
        packet.append(uabin.Primitives.Int32.pack(len(self.AggregateType)))
9692
        for fieldname in self.AggregateType:
9693 View Code Duplication
            packet.append(fieldname.to_binary())
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9694
        packet.append(self.AggregateConfiguration.to_binary())
9695
        return b''.join(packet)
9696 1
9697
    @staticmethod
9698
    def from_binary(data):
9699
        return ReadProcessedDetails(data)
9700
9701
    def _binary_init(self, data):
9702
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
9703 1
        self.EndTime = uabin.Primitives.DateTime.unpack(data)
9704
        self.ProcessingInterval = uabin.Primitives.Double.unpack(data)
9705
        length = uabin.Primitives.Int32.unpack(data)
9706
        array = []
9707
        if length != -1:
9708
            for _ in range(0, length):
9709
                array.append(NodeId.from_binary(data))
9710
        self.AggregateType = array
9711
        self.AggregateConfiguration = AggregateConfiguration.from_binary(data)
9712
9713
    def __str__(self):
9714 1
        return 'ReadProcessedDetails(' + 'StartTime:' + str(self.StartTime) + ', ' + \
9715
               'EndTime:' + str(self.EndTime) + ', ' + \
9716
               'ProcessingInterval:' + str(self.ProcessingInterval) + ', ' + \
9717
               'AggregateType:' + str(self.AggregateType) + ', ' + \
9718
               'AggregateConfiguration:' + str(self.AggregateConfiguration) + ')'
9719
9720
    __repr__ = __str__
9721
9722
9723
class ReadAtTimeDetails(FrozenClass):
9724
    '''
9725
    :ivar ReqTimes:
9726 1
    :vartype ReqTimes: DateTime
9727
    :ivar UseSimpleBounds:
9728
    :vartype UseSimpleBounds: Boolean
9729
    '''
9730 1
9731
    ua_types = (
9732
9733
        ('ReqTimes', 'ListOfDateTime'),
9734
        ('UseSimpleBounds', 'Boolean'),
9735
               )
9736
9737
    def __init__(self, binary=None):
9738
        if binary is not None:
9739
            self._binary_init(binary)
9740
            self._freeze = True
9741
            return
9742
        self.ReqTimes = []
9743
        self.UseSimpleBounds = True
9744
        self._freeze = True
9745
9746 1
    def to_binary(self):
9747
        packet = []
9748
        packet.append(uabin.Primitives.Int32.pack(len(self.ReqTimes)))
9749
        for fieldname in self.ReqTimes:
9750
            packet.append(uabin.Primitives.DateTime.pack(fieldname))
9751
        packet.append(uabin.Primitives.Boolean.pack(self.UseSimpleBounds))
9752 1
        return b''.join(packet)
9753
9754
    @staticmethod
9755 1
    def from_binary(data):
9756
        return ReadAtTimeDetails(data)
9757
9758
    def _binary_init(self, data):
9759
        self.ReqTimes = uabin.Primitives.DateTime.unpack_array(data)
9760
        self.UseSimpleBounds = uabin.Primitives.Boolean.unpack(data)
9761
9762
    def __str__(self):
9763
        return 'ReadAtTimeDetails(' + 'ReqTimes:' + str(self.ReqTimes) + ', ' + \
9764 View Code Duplication
               'UseSimpleBounds:' + str(self.UseSimpleBounds) + ')'
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9765
9766
    __repr__ = __str__
9767 1
9768
9769
class HistoryData(FrozenClass):
9770
    '''
9771
    :ivar DataValues:
9772
    :vartype DataValues: DataValue
9773
    '''
9774 1
9775 1
    ua_types = (
9776 1
9777 1
        ('DataValues', 'ListOfDataValue'),
9778 1
               )
9779 1
9780 1
    def __init__(self, binary=None):
9781 1
        if binary is not None:
9782 1
            self._binary_init(binary)
9783 1
            self._freeze = True
9784
            return
9785 1
        self.DataValues = []
9786 1
        self._freeze = True
9787 1
9788 1
    def to_binary(self):
9789 1
        packet = []
9790 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DataValues)))
9791 1
        for fieldname in self.DataValues:
9792
            packet.append(fieldname.to_binary())
9793 1
        return b''.join(packet)
9794
9795 1
    @staticmethod
9796
    def from_binary(data):
9797 1
        return HistoryData(data)
9798 1
9799 1
    def _binary_init(self, data):
9800 1
        length = uabin.Primitives.Int32.unpack(data)
9801 1
        array = []
9802
        if length != -1:
9803 1
            for _ in range(0, length):
9804
                array.append(DataValue.from_binary(data))
9805
        self.DataValues = array
9806
9807
    def __str__(self):
9808
        return 'HistoryData(' + 'DataValues:' + str(self.DataValues) + ')'
9809 1
9810
    __repr__ = __str__
9811
9812 1
9813
class ModificationInfo(FrozenClass):
9814
    '''
9815
    :ivar ModificationTime:
9816
    :vartype ModificationTime: DateTime
9817
    :ivar UpdateType:
9818 1
    :vartype UpdateType: HistoryUpdateType
9819
    :ivar UserName:
9820
    :vartype UserName: String
9821
    '''
9822 1
9823 1
    ua_types = (
9824 1
9825 1
        ('ModificationTime', 'DateTime'),
9826 1
        ('UpdateType', 'HistoryUpdateType'),
9827 1
        ('UserName', 'String'),
9828 1
               )
9829
9830 1
    def __init__(self, binary=None):
9831 1
        if binary is not None:
9832 1
            self._binary_init(binary)
9833 1
            self._freeze = True
9834 1
            return
9835 1
        self.ModificationTime = datetime.utcnow()
9836
        self.UpdateType = HistoryUpdateType(0)
9837 1
        self.UserName = None
9838
        self._freeze = True
9839 1
9840
    def to_binary(self):
9841 1
        packet = []
9842 1
        packet.append(uabin.Primitives.DateTime.pack(self.ModificationTime))
9843 1
        packet.append(uabin.Primitives.UInt32.pack(self.UpdateType.value))
9844 1
        packet.append(uabin.Primitives.String.pack(self.UserName))
9845 1
        return b''.join(packet)
9846 1
9847 1
    @staticmethod
9848
    def from_binary(data):
9849 1
        return ModificationInfo(data)
9850
9851
    def _binary_init(self, data):
9852 1
        self.ModificationTime = uabin.Primitives.DateTime.unpack(data)
9853
        self.UpdateType = HistoryUpdateType(uabin.Primitives.UInt32.unpack(data))
9854
        self.UserName = uabin.Primitives.String.unpack(data)
9855 1
9856
    def __str__(self):
9857
        return 'ModificationInfo(' + 'ModificationTime:' + str(self.ModificationTime) + ', ' + \
9858
               'UpdateType:' + str(self.UpdateType) + ', ' + \
9859
               'UserName:' + str(self.UserName) + ')'
9860
9861
    __repr__ = __str__
9862
9863
9864
class HistoryModifiedData(FrozenClass):
9865 1
    '''
9866
    :ivar DataValues:
9867
    :vartype DataValues: DataValue
9868
    :ivar ModificationInfos:
9869
    :vartype ModificationInfos: ModificationInfo
9870
    '''
9871 1
9872 1
    ua_types = (
9873
9874
        ('DataValues', 'ListOfDataValue'),
9875
        ('ModificationInfos', 'ListOfModificationInfo'),
9876 1
               )
9877 1
9878 1
    def __init__(self, binary=None):
9879 1
        if binary is not None:
9880
            self._binary_init(binary)
9881 1
            self._freeze = True
9882 1
            return
9883 1
        self.DataValues = []
9884 1
        self.ModificationInfos = []
9885 1
        self._freeze = True
9886 1
9887
    def to_binary(self):
9888 1
        packet = []
9889
        packet.append(uabin.Primitives.Int32.pack(len(self.DataValues)))
9890
        for fieldname in self.DataValues:
9891
            packet.append(fieldname.to_binary())
9892 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ModificationInfos)))
9893
        for fieldname in self.ModificationInfos:
9894
            packet.append(fieldname.to_binary())
9895
        return b''.join(packet)
9896
9897 1
    @staticmethod
9898
    def from_binary(data):
9899
        return HistoryModifiedData(data)
9900
9901
    def _binary_init(self, data):
9902 1
        length = uabin.Primitives.Int32.unpack(data)
9903
        array = []
9904
        if length != -1:
9905 1
            for _ in range(0, length):
9906
                array.append(DataValue.from_binary(data))
9907
        self.DataValues = array
9908
        length = uabin.Primitives.Int32.unpack(data)
9909
        array = []
9910
        if length != -1:
9911
            for _ in range(0, length):
9912
                array.append(ModificationInfo.from_binary(data))
9913
        self.ModificationInfos = array
9914 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9915
    def __str__(self):
9916
        return 'HistoryModifiedData(' + 'DataValues:' + str(self.DataValues) + ', ' + \
9917 1
               'ModificationInfos:' + str(self.ModificationInfos) + ')'
9918
9919
    __repr__ = __str__
9920
9921
9922
class HistoryEvent(FrozenClass):
9923
    '''
9924 1
    :ivar Events:
9925 1
    :vartype Events: HistoryEventFieldList
9926 1
    '''
9927 1
9928 1
    ua_types = (
9929 1
9930 1
        ('Events', 'ListOfHistoryEventFieldList'),
9931 1
               )
9932 1
9933 1
    def __init__(self, binary=None):
9934
        if binary is not None:
9935 1
            self._binary_init(binary)
9936 1
            self._freeze = True
9937 1
            return
9938 1
        self.Events = []
9939 1
        self._freeze = True
9940 1
9941 1
    def to_binary(self):
9942 1
        packet = []
9943 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Events)))
9944
        for fieldname in self.Events:
9945 1
            packet.append(fieldname.to_binary())
9946
        return b''.join(packet)
9947 1
9948
    @staticmethod
9949 1
    def from_binary(data):
9950
        return HistoryEvent(data)
9951 1
9952 1
    def _binary_init(self, data):
9953 1
        length = uabin.Primitives.Int32.unpack(data)
9954 1
        array = []
9955 1
        if length != -1:
9956 1
            for _ in range(0, length):
9957 1
                array.append(HistoryEventFieldList.from_binary(data))
9958 1
        self.Events = array
9959 1
9960 1
    def __str__(self):
9961 1
        return 'HistoryEvent(' + 'Events:' + str(self.Events) + ')'
9962 1
9963 1
    __repr__ = __str__
9964
9965 1
9966
class HistoryReadParameters(FrozenClass):
9967 1
    '''
9968
    :ivar HistoryReadDetails:
9969
    :vartype HistoryReadDetails: ExtensionObject
9970
    :ivar TimestampsToReturn:
9971
    :vartype TimestampsToReturn: TimestampsToReturn
9972
    :ivar ReleaseContinuationPoints:
9973 1
    :vartype ReleaseContinuationPoints: Boolean
9974
    :ivar NodesToRead:
9975
    :vartype NodesToRead: HistoryReadValueId
9976 1
    '''
9977
9978
    ua_types = (
9979
9980
        ('HistoryReadDetails', 'ExtensionObject'),
9981
        ('TimestampsToReturn', 'TimestampsToReturn'),
9982 1
        ('ReleaseContinuationPoints', 'Boolean'),
9983
        ('NodesToRead', 'ListOfHistoryReadValueId'),
9984
               )
9985 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9986 1
    def __init__(self, binary=None):
9987
        if binary is not None:
9988
            self._binary_init(binary)
9989
            self._freeze = True
9990
            return
9991
        self.HistoryReadDetails = None
9992
        self.TimestampsToReturn = TimestampsToReturn(0)
9993
        self.ReleaseContinuationPoints = True
9994 1
        self.NodesToRead = []
9995
        self._freeze = True
9996
9997
    def to_binary(self):
9998
        packet = []
9999 1
        packet.append(extensionobject_to_binary(self.HistoryReadDetails))
10000
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
10001
        packet.append(uabin.Primitives.Boolean.pack(self.ReleaseContinuationPoints))
10002
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToRead)))
10003 1
        for fieldname in self.NodesToRead:
10004
            packet.append(fieldname.to_binary())
10005
        return b''.join(packet)
10006 1
10007
    @staticmethod
10008
    def from_binary(data):
10009 1
        return HistoryReadParameters(data)
10010
10011
    def _binary_init(self, data):
10012 1
        self.HistoryReadDetails = extensionobject_from_binary(data)
10013
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
10014
        self.ReleaseContinuationPoints = uabin.Primitives.Boolean.unpack(data)
10015
        length = uabin.Primitives.Int32.unpack(data)
10016
        array = []
10017
        if length != -1:
10018
            for _ in range(0, length):
10019
                array.append(HistoryReadValueId.from_binary(data))
10020
        self.NodesToRead = array
10021
10022 1
    def __str__(self):
10023
        return 'HistoryReadParameters(' + 'HistoryReadDetails:' + str(self.HistoryReadDetails) + ', ' + \
10024
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
10025
               'ReleaseContinuationPoints:' + str(self.ReleaseContinuationPoints) + ', ' + \
10026
               'NodesToRead:' + str(self.NodesToRead) + ')'
10027
10028 1
    __repr__ = __str__
10029
10030
10031
class HistoryReadRequest(FrozenClass):
10032
    '''
10033
    :ivar TypeId:
10034
    :vartype TypeId: NodeId
10035
    :ivar RequestHeader:
10036
    :vartype RequestHeader: RequestHeader
10037
    :ivar Parameters:
10038 1
    :vartype Parameters: HistoryReadParameters
10039
    '''
10040
10041
    ua_types = (
10042
10043
        ('TypeId', 'NodeId'),
10044
        ('RequestHeader', 'RequestHeader'),
10045
        ('Parameters', 'HistoryReadParameters'),
10046
               )
10047 1
10048
    def __init__(self, binary=None):
10049
        if binary is not None:
10050
            self._binary_init(binary)
10051 1
            self._freeze = True
10052
            return
10053
        self.TypeId = FourByteNodeId(ObjectIds.HistoryReadRequest_Encoding_DefaultBinary)
10054
        self.RequestHeader = RequestHeader()
10055
        self.Parameters = HistoryReadParameters()
10056
        self._freeze = True
10057
10058
    def to_binary(self):
10059
        packet = []
10060
        packet.append(self.TypeId.to_binary())
10061 1
        packet.append(self.RequestHeader.to_binary())
10062
        packet.append(self.Parameters.to_binary())
10063
        return b''.join(packet)
10064
10065
    @staticmethod
10066 1
    def from_binary(data):
10067
        return HistoryReadRequest(data)
10068
10069 1
    def _binary_init(self, data):
10070
        self.TypeId = NodeId.from_binary(data)
10071
        self.RequestHeader = RequestHeader.from_binary(data)
10072
        self.Parameters = HistoryReadParameters.from_binary(data)
10073
10074
    def __str__(self):
10075
        return 'HistoryReadRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10076
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
10077
               'Parameters:' + str(self.Parameters) + ')'
10078
10079 1
    __repr__ = __str__
10080
10081
10082
class HistoryReadResponse(FrozenClass):
10083
    '''
10084
    :ivar TypeId:
10085 1
    :vartype TypeId: NodeId
10086
    :ivar ResponseHeader:
10087
    :vartype ResponseHeader: ResponseHeader
10088
    :ivar Results:
10089
    :vartype Results: HistoryReadResult
10090
    :ivar DiagnosticInfos:
10091
    :vartype DiagnosticInfos: DiagnosticInfo
10092
    '''
10093
10094
    ua_types = (
10095 1
10096
        ('TypeId', 'NodeId'),
10097
        ('ResponseHeader', 'ResponseHeader'),
10098
        ('Results', 'ListOfHistoryReadResult'),
10099
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
10100
               )
10101
10102
    def __init__(self, binary=None):
10103
        if binary is not None:
10104 1
            self._binary_init(binary)
10105
            self._freeze = True
10106
            return
10107
        self.TypeId = FourByteNodeId(ObjectIds.HistoryReadResponse_Encoding_DefaultBinary)
10108 1
        self.ResponseHeader = ResponseHeader()
10109
        self.Results = []
10110
        self.DiagnosticInfos = []
10111
        self._freeze = True
10112
10113
    def to_binary(self):
10114
        packet = []
10115
        packet.append(self.TypeId.to_binary())
10116
        packet.append(self.ResponseHeader.to_binary())
10117
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
10118 1
        for fieldname in self.Results:
10119
            packet.append(fieldname.to_binary())
10120
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
10121
        for fieldname in self.DiagnosticInfos:
10122
            packet.append(fieldname.to_binary())
10123 1
        return b''.join(packet)
10124
10125
    @staticmethod
10126 1
    def from_binary(data):
10127
        return HistoryReadResponse(data)
10128
10129
    def _binary_init(self, data):
10130
        self.TypeId = NodeId.from_binary(data)
10131
        self.ResponseHeader = ResponseHeader.from_binary(data)
10132
        length = uabin.Primitives.Int32.unpack(data)
10133
        array = []
10134
        if length != -1:
10135
            for _ in range(0, length):
10136
                array.append(HistoryReadResult.from_binary(data))
10137
        self.Results = array
10138 1
        length = uabin.Primitives.Int32.unpack(data)
10139
        array = []
10140
        if length != -1:
10141
            for _ in range(0, length):
10142
                array.append(DiagnosticInfo.from_binary(data))
10143
        self.DiagnosticInfos = array
10144
10145 1
    def __str__(self):
10146
        return 'HistoryReadResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10147
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
10148
               'Results:' + str(self.Results) + ', ' + \
10149
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
10150
10151
    __repr__ = __str__
10152
10153
10154
class WriteValue(FrozenClass):
10155
    '''
10156 1
    :ivar NodeId:
10157
    :vartype NodeId: NodeId
10158
    :ivar AttributeId:
10159
    :vartype AttributeId: UInt32
10160
    :ivar IndexRange:
10161
    :vartype IndexRange: String
10162
    :ivar Value:
10163
    :vartype Value: DataValue
10164
    '''
10165
10166 1
    ua_types = (
10167
10168
        ('NodeId', 'NodeId'),
10169
        ('AttributeId', 'UInt32'),
10170 1
        ('IndexRange', 'String'),
10171
        ('Value', 'DataValue'),
10172
               )
10173
10174
    def __init__(self, binary=None):
10175
        if binary is not None:
10176
            self._binary_init(binary)
10177
            self._freeze = True
10178
            return
10179
        self.NodeId = NodeId()
10180
        self.AttributeId = 0
10181 1
        self.IndexRange = None
10182
        self.Value = DataValue()
10183
        self._freeze = True
10184
10185
    def to_binary(self):
10186
        packet = []
10187 1
        packet.append(self.NodeId.to_binary())
10188
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
10189
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
10190 1
        packet.append(self.Value.to_binary())
10191
        return b''.join(packet)
10192
10193
    @staticmethod
10194
    def from_binary(data):
10195
        return WriteValue(data)
10196
10197
    def _binary_init(self, data):
10198
        self.NodeId = NodeId.from_binary(data)
10199
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
10200
        self.IndexRange = uabin.Primitives.String.unpack(data)
10201
        self.Value = DataValue.from_binary(data)
10202 1
10203
    def __str__(self):
10204
        return 'WriteValue(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10205
               'AttributeId:' + str(self.AttributeId) + ', ' + \
10206
               'IndexRange:' + str(self.IndexRange) + ', ' + \
10207
               'Value:' + str(self.Value) + ')'
10208
10209 1
    __repr__ = __str__
10210
10211
10212
class WriteParameters(FrozenClass):
10213
    '''
10214
    :ivar NodesToWrite:
10215
    :vartype NodesToWrite: WriteValue
10216
    '''
10217
10218
    ua_types = (
10219
10220 1
        ('NodesToWrite', 'ListOfWriteValue'),
10221
               )
10222
10223
    def __init__(self, binary=None):
10224
        if binary is not None:
10225
            self._binary_init(binary)
10226
            self._freeze = True
10227
            return
10228 1
        self.NodesToWrite = []
10229
        self._freeze = True
10230
10231
    def to_binary(self):
10232 1
        packet = []
10233
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToWrite)))
10234
        for fieldname in self.NodesToWrite:
10235
            packet.append(fieldname.to_binary())
10236
        return b''.join(packet)
10237
10238 1
    @staticmethod
10239
    def from_binary(data):
10240
        return WriteParameters(data)
10241
10242
    def _binary_init(self, data):
10243
        length = uabin.Primitives.Int32.unpack(data)
10244 1
        array = []
10245
        if length != -1:
10246
            for _ in range(0, length):
10247 1
                array.append(WriteValue.from_binary(data))
10248
        self.NodesToWrite = array
10249
10250
    def __str__(self):
10251
        return 'WriteParameters(' + 'NodesToWrite:' + str(self.NodesToWrite) + ')'
10252
10253
    __repr__ = __str__
10254
10255 1
10256
class WriteRequest(FrozenClass):
10257
    '''
10258
    :ivar TypeId:
10259
    :vartype TypeId: NodeId
10260 1
    :ivar RequestHeader:
10261
    :vartype RequestHeader: RequestHeader
10262
    :ivar Parameters:
10263
    :vartype Parameters: WriteParameters
10264
    '''
10265
10266
    ua_types = (
10267
10268
        ('TypeId', 'NodeId'),
10269 1
        ('RequestHeader', 'RequestHeader'),
10270
        ('Parameters', 'WriteParameters'),
10271
               )
10272
10273
    def __init__(self, binary=None):
10274
        if binary is not None:
10275
            self._binary_init(binary)
10276
            self._freeze = True
10277 1
            return
10278
        self.TypeId = FourByteNodeId(ObjectIds.WriteRequest_Encoding_DefaultBinary)
10279
        self.RequestHeader = RequestHeader()
10280
        self.Parameters = WriteParameters()
10281 1
        self._freeze = True
10282
10283
    def to_binary(self):
10284
        packet = []
10285 1
        packet.append(self.TypeId.to_binary())
10286
        packet.append(self.RequestHeader.to_binary())
10287
        packet.append(self.Parameters.to_binary())
10288
        return b''.join(packet)
10289 1
10290
    @staticmethod
10291
    def from_binary(data):
10292 1
        return WriteRequest(data)
10293
10294
    def _binary_init(self, data):
10295
        self.TypeId = NodeId.from_binary(data)
10296
        self.RequestHeader = RequestHeader.from_binary(data)
10297
        self.Parameters = WriteParameters.from_binary(data)
10298
10299
    def __str__(self):
10300 1
        return 'WriteRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10301
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
10302
               'Parameters:' + str(self.Parameters) + ')'
10303
10304
    __repr__ = __str__
10305 1
10306
10307
class WriteResponse(FrozenClass):
10308
    '''
10309
    :ivar TypeId:
10310
    :vartype TypeId: NodeId
10311
    :ivar ResponseHeader:
10312
    :vartype ResponseHeader: ResponseHeader
10313
    :ivar Results:
10314 1
    :vartype Results: StatusCode
10315
    :ivar DiagnosticInfos:
10316
    :vartype DiagnosticInfos: DiagnosticInfo
10317
    '''
10318
10319
    ua_types = (
10320
10321
        ('TypeId', 'NodeId'),
10322 1
        ('ResponseHeader', 'ResponseHeader'),
10323
        ('Results', 'ListOfStatusCode'),
10324
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
10325
               )
10326 1
10327
    def __init__(self, binary=None):
10328
        if binary is not None:
10329
            self._binary_init(binary)
10330 1
            self._freeze = True
10331
            return
10332
        self.TypeId = FourByteNodeId(ObjectIds.WriteResponse_Encoding_DefaultBinary)
10333
        self.ResponseHeader = ResponseHeader()
10334 1
        self.Results = []
10335
        self.DiagnosticInfos = []
10336
        self._freeze = True
10337 1
10338
    def to_binary(self):
10339
        packet = []
10340
        packet.append(self.TypeId.to_binary())
10341
        packet.append(self.ResponseHeader.to_binary())
10342
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
10343
        for fieldname in self.Results:
10344
            packet.append(fieldname.to_binary())
10345
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
10346
        for fieldname in self.DiagnosticInfos:
10347 1
            packet.append(fieldname.to_binary())
10348
        return b''.join(packet)
10349
10350
    @staticmethod
10351
    def from_binary(data):
10352
        return WriteResponse(data)
10353 1
10354
    def _binary_init(self, data):
10355
        self.TypeId = NodeId.from_binary(data)
10356
        self.ResponseHeader = ResponseHeader.from_binary(data)
10357
        length = uabin.Primitives.Int32.unpack(data)
10358
        array = []
10359
        if length != -1:
10360
            for _ in range(0, length):
10361
                array.append(StatusCode.from_binary(data))
10362
        self.Results = array
10363 1
        length = uabin.Primitives.Int32.unpack(data)
10364
        array = []
10365
        if length != -1:
10366
            for _ in range(0, length):
10367
                array.append(DiagnosticInfo.from_binary(data))
10368
        self.DiagnosticInfos = array
10369
10370
    def __str__(self):
10371
        return 'WriteResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10372
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
10373
               'Results:' + str(self.Results) + ', ' + \
10374 1
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
10375
10376
    __repr__ = __str__
10377
10378 1
10379
class HistoryUpdateDetails(FrozenClass):
10380
    '''
10381
    :ivar NodeId:
10382
    :vartype NodeId: NodeId
10383
    '''
10384
10385
    ua_types = (
10386
10387
        ('NodeId', 'NodeId'),
10388
               )
10389
10390
    def __init__(self, binary=None):
10391
        if binary is not None:
10392
            self._binary_init(binary)
10393 1
            self._freeze = True
10394
            return
10395
        self.NodeId = NodeId()
10396
        self._freeze = True
10397
10398 1
    def to_binary(self):
10399
        packet = []
10400
        packet.append(self.NodeId.to_binary())
10401 1
        return b''.join(packet)
10402
10403
    @staticmethod
10404
    def from_binary(data):
10405
        return HistoryUpdateDetails(data)
10406
10407 1
    def _binary_init(self, data):
10408
        self.NodeId = NodeId.from_binary(data)
10409
10410
    def __str__(self):
10411 1
        return 'HistoryUpdateDetails(' + 'NodeId:' + str(self.NodeId) + ')'
10412
10413
    __repr__ = __str__
10414
10415
10416
class UpdateDataDetails(FrozenClass):
10417
    '''
10418
    :ivar NodeId:
10419 1
    :vartype NodeId: NodeId
10420
    :ivar PerformInsertReplace:
10421
    :vartype PerformInsertReplace: PerformUpdateType
10422
    :ivar UpdateValues:
10423
    :vartype UpdateValues: DataValue
10424
    '''
10425
10426 1
    ua_types = (
10427
10428
        ('NodeId', 'NodeId'),
10429
        ('PerformInsertReplace', 'PerformUpdateType'),
10430 1
        ('UpdateValues', 'ListOfDataValue'),
10431
               )
10432
10433
    def __init__(self, binary=None):
10434
        if binary is not None:
10435
            self._binary_init(binary)
10436
            self._freeze = True
10437
            return
10438 1
        self.NodeId = NodeId()
10439
        self.PerformInsertReplace = PerformUpdateType(0)
10440
        self.UpdateValues = []
10441 1
        self._freeze = True
10442
10443
    def to_binary(self):
10444 1
        packet = []
10445
        packet.append(self.NodeId.to_binary())
10446
        packet.append(uabin.Primitives.UInt32.pack(self.PerformInsertReplace.value))
10447
        packet.append(uabin.Primitives.Int32.pack(len(self.UpdateValues)))
10448
        for fieldname in self.UpdateValues:
10449
            packet.append(fieldname.to_binary())
10450
        return b''.join(packet)
10451
10452
    @staticmethod
10453
    def from_binary(data):
10454 1
        return UpdateDataDetails(data)
10455
10456
    def _binary_init(self, data):
10457
        self.NodeId = NodeId.from_binary(data)
10458
        self.PerformInsertReplace = PerformUpdateType(uabin.Primitives.UInt32.unpack(data))
10459
        length = uabin.Primitives.Int32.unpack(data)
10460 1
        array = []
10461
        if length != -1:
10462
            for _ in range(0, length):
10463
                array.append(DataValue.from_binary(data))
10464
        self.UpdateValues = array
10465
10466
    def __str__(self):
10467
        return 'UpdateDataDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10468
               'PerformInsertReplace:' + str(self.PerformInsertReplace) + ', ' + \
10469
               'UpdateValues:' + str(self.UpdateValues) + ')'
10470 1
10471
    __repr__ = __str__
10472
10473
10474
class UpdateStructureDataDetails(FrozenClass):
10475
    '''
10476
    :ivar NodeId:
10477 1
    :vartype NodeId: NodeId
10478
    :ivar PerformInsertReplace:
10479
    :vartype PerformInsertReplace: PerformUpdateType
10480
    :ivar UpdateValues:
10481 1
    :vartype UpdateValues: DataValue
10482
    '''
10483
10484
    ua_types = (
10485
10486 1
        ('NodeId', 'NodeId'),
10487
        ('PerformInsertReplace', 'PerformUpdateType'),
10488
        ('UpdateValues', 'ListOfDataValue'),
10489
               )
10490
10491 1
    def __init__(self, binary=None):
10492
        if binary is not None:
10493
            self._binary_init(binary)
10494 1
            self._freeze = True
10495
            return
10496
        self.NodeId = NodeId()
10497
        self.PerformInsertReplace = PerformUpdateType(0)
10498
        self.UpdateValues = []
10499
        self._freeze = True
10500
10501
    def to_binary(self):
10502
        packet = []
10503 View Code Duplication
        packet.append(self.NodeId.to_binary())
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10504
        packet.append(uabin.Primitives.UInt32.pack(self.PerformInsertReplace.value))
10505
        packet.append(uabin.Primitives.Int32.pack(len(self.UpdateValues)))
10506 1
        for fieldname in self.UpdateValues:
10507
            packet.append(fieldname.to_binary())
10508
        return b''.join(packet)
10509
10510
    @staticmethod
10511
    def from_binary(data):
10512
        return UpdateStructureDataDetails(data)
10513 1
10514
    def _binary_init(self, data):
10515
        self.NodeId = NodeId.from_binary(data)
10516
        self.PerformInsertReplace = PerformUpdateType(uabin.Primitives.UInt32.unpack(data))
10517
        length = uabin.Primitives.Int32.unpack(data)
10518
        array = []
10519
        if length != -1:
10520
            for _ in range(0, length):
10521
                array.append(DataValue.from_binary(data))
10522
        self.UpdateValues = array
10523
10524 1
    def __str__(self):
10525
        return 'UpdateStructureDataDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10526
               'PerformInsertReplace:' + str(self.PerformInsertReplace) + ', ' + \
10527
               'UpdateValues:' + str(self.UpdateValues) + ')'
10528
10529
    __repr__ = __str__
10530
10531
10532
class UpdateEventDetails(FrozenClass):
10533
    '''
10534
    :ivar NodeId:
10535
    :vartype NodeId: NodeId
10536 1
    :ivar PerformInsertReplace:
10537
    :vartype PerformInsertReplace: PerformUpdateType
10538
    :ivar Filter:
10539
    :vartype Filter: EventFilter
10540 1
    :ivar EventData:
10541
    :vartype EventData: HistoryEventFieldList
10542
    '''
10543
10544
    ua_types = (
10545
10546
        ('NodeId', 'NodeId'),
10547
        ('PerformInsertReplace', 'PerformUpdateType'),
10548
        ('Filter', 'EventFilter'),
10549
        ('EventData', 'ListOfHistoryEventFieldList'),
10550
               )
10551
10552
    def __init__(self, binary=None):
10553
        if binary is not None:
10554
            self._binary_init(binary)
10555
            self._freeze = True
10556 1
            return
10557
        self.NodeId = NodeId()
10558
        self.PerformInsertReplace = PerformUpdateType(0)
10559
        self.Filter = EventFilter()
10560
        self.EventData = []
10561
        self._freeze = True
10562 1
10563
    def to_binary(self):
10564
        packet = []
10565 1
        packet.append(self.NodeId.to_binary())
10566
        packet.append(uabin.Primitives.UInt32.pack(self.PerformInsertReplace.value))
10567
        packet.append(self.Filter.to_binary())
10568
        packet.append(uabin.Primitives.Int32.pack(len(self.EventData)))
10569
        for fieldname in self.EventData:
10570
            packet.append(fieldname.to_binary())
10571
        return b''.join(packet)
10572
10573
    @staticmethod
10574
    def from_binary(data):
10575 1
        return UpdateEventDetails(data)
10576
10577
    def _binary_init(self, data):
10578
        self.NodeId = NodeId.from_binary(data)
10579
        self.PerformInsertReplace = PerformUpdateType(uabin.Primitives.UInt32.unpack(data))
10580
        self.Filter = EventFilter.from_binary(data)
10581 1
        length = uabin.Primitives.Int32.unpack(data)
10582 1
        array = []
10583 1
        if length != -1:
10584 1
            for _ in range(0, length):
10585 1
                array.append(HistoryEventFieldList.from_binary(data))
10586 1
        self.EventData = array
10587 1
10588 1
    def __str__(self):
10589 1
        return 'UpdateEventDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10590
               'PerformInsertReplace:' + str(self.PerformInsertReplace) + ', ' + \
10591 1
               'Filter:' + str(self.Filter) + ', ' + \
10592 1
               'EventData:' + str(self.EventData) + ')'
10593 1
10594 1
    __repr__ = __str__
10595 1
10596 1
10597 1
class DeleteRawModifiedDetails(FrozenClass):
10598 1
    '''
10599
    :ivar NodeId:
10600 1
    :vartype NodeId: NodeId
10601
    :ivar IsDeleteModified:
10602 1
    :vartype IsDeleteModified: Boolean
10603
    :ivar StartTime:
10604 1
    :vartype StartTime: DateTime
10605 1
    :ivar EndTime:
10606 1
    :vartype EndTime: DateTime
10607 1
    '''
10608 1
10609 1
    ua_types = (
10610 1
10611 1
        ('NodeId', 'NodeId'),
10612 1
        ('IsDeleteModified', 'Boolean'),
10613
        ('StartTime', 'DateTime'),
10614 1
        ('EndTime', 'DateTime'),
10615 1
               )
10616
10617
    def __init__(self, binary=None):
10618
        if binary is not None:
10619 1
            self._binary_init(binary)
10620
            self._freeze = True
10621
            return
10622 1
        self.NodeId = NodeId()
10623
        self.IsDeleteModified = True
10624
        self.StartTime = datetime.utcnow()
10625
        self.EndTime = datetime.utcnow()
10626
        self._freeze = True
10627
10628
    def to_binary(self):
10629
        packet = []
10630
        packet.append(self.NodeId.to_binary())
10631
        packet.append(uabin.Primitives.Boolean.pack(self.IsDeleteModified))
10632
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
10633
        packet.append(uabin.Primitives.DateTime.pack(self.EndTime))
10634 1
        return b''.join(packet)
10635
10636
    @staticmethod
10637
    def from_binary(data):
10638
        return DeleteRawModifiedDetails(data)
10639
10640
    def _binary_init(self, data):
10641 1
        self.NodeId = NodeId.from_binary(data)
10642 1
        self.IsDeleteModified = uabin.Primitives.Boolean.unpack(data)
10643 1
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
10644 1
        self.EndTime = uabin.Primitives.DateTime.unpack(data)
10645 1
10646 1
    def __str__(self):
10647 1
        return 'DeleteRawModifiedDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10648 1
               'IsDeleteModified:' + str(self.IsDeleteModified) + ', ' + \
10649 1
               'StartTime:' + str(self.StartTime) + ', ' + \
10650 1
               'EndTime:' + str(self.EndTime) + ')'
10651
10652 1
    __repr__ = __str__
10653 1
10654 1
10655 1
class DeleteAtTimeDetails(FrozenClass):
10656 1
    '''
10657 1
    :ivar NodeId:
10658 1
    :vartype NodeId: NodeId
10659 1
    :ivar ReqTimes:
10660
    :vartype ReqTimes: DateTime
10661 1
    '''
10662 1
10663 1
    ua_types = (
10664 1
10665
        ('NodeId', 'NodeId'),
10666 1
        ('ReqTimes', 'ListOfDateTime'),
10667
               )
10668 1
10669
    def __init__(self, binary=None):
10670 1
        if binary is not None:
10671 1
            self._binary_init(binary)
10672 1
            self._freeze = True
10673 1
            return
10674 1
        self.NodeId = NodeId()
10675 1
        self.ReqTimes = []
10676 1
        self._freeze = True
10677 1
10678 1
    def to_binary(self):
10679 1
        packet = []
10680 1
        packet.append(self.NodeId.to_binary())
10681 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ReqTimes)))
10682
        for fieldname in self.ReqTimes:
10683 1
            packet.append(uabin.Primitives.DateTime.pack(fieldname))
10684 1
        return b''.join(packet)
10685 1
10686 1
    @staticmethod
10687 1
    def from_binary(data):
10688 1
        return DeleteAtTimeDetails(data)
10689 1
10690
    def _binary_init(self, data):
10691 1
        self.NodeId = NodeId.from_binary(data)
10692
        self.ReqTimes = uabin.Primitives.DateTime.unpack_array(data)
10693
10694
    def __str__(self):
10695
        return 'DeleteAtTimeDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10696
               'ReqTimes:' + str(self.ReqTimes) + ')'
10697 1
10698
    __repr__ = __str__
10699
10700 1
10701
class DeleteEventDetails(FrozenClass):
10702
    '''
10703
    :ivar NodeId:
10704
    :vartype NodeId: NodeId
10705
    :ivar EventIds:
10706 1
    :vartype EventIds: ByteString
10707
    '''
10708
10709
    ua_types = (
10710 1
10711 1
        ('NodeId', 'NodeId'),
10712 1
        ('EventIds', 'ListOfByteString'),
10713 1
               )
10714 1
10715 1
    def __init__(self, binary=None):
10716 1
        if binary is not None:
10717
            self._binary_init(binary)
10718 1
            self._freeze = True
10719 1
            return
10720 1
        self.NodeId = NodeId()
10721 1
        self.EventIds = []
10722 1
        self._freeze = True
10723 1
10724
    def to_binary(self):
10725 1
        packet = []
10726
        packet.append(self.NodeId.to_binary())
10727 1
        packet.append(uabin.Primitives.Int32.pack(len(self.EventIds)))
10728
        for fieldname in self.EventIds:
10729 1
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
10730 1
        return b''.join(packet)
10731 1
10732 1
    @staticmethod
10733 1
    def from_binary(data):
10734 1
        return DeleteEventDetails(data)
10735 1
10736
    def _binary_init(self, data):
10737 1
        self.NodeId = NodeId.from_binary(data)
10738
        self.EventIds = uabin.Primitives.ByteString.unpack_array(data)
10739
10740 1
    def __str__(self):
10741
        return 'DeleteEventDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10742
               'EventIds:' + str(self.EventIds) + ')'
10743 1
10744
    __repr__ = __str__
10745
10746
10747
class HistoryUpdateResult(FrozenClass):
10748
    '''
10749
    :ivar StatusCode:
10750
    :vartype StatusCode: StatusCode
10751
    :ivar OperationResults:
10752
    :vartype OperationResults: StatusCode
10753 1
    :ivar DiagnosticInfos:
10754
    :vartype DiagnosticInfos: DiagnosticInfo
10755
    '''
10756
10757
    ua_types = (
10758
10759 1
        ('StatusCode', 'StatusCode'),
10760 1
        ('OperationResults', 'ListOfStatusCode'),
10761
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
10762
               )
10763
10764 1
    def __init__(self, binary=None):
10765 1
        if binary is not None:
10766 1
            self._binary_init(binary)
10767 1
            self._freeze = True
10768
            return
10769 1
        self.StatusCode = StatusCode()
10770 1
        self.OperationResults = []
10771 1
        self.DiagnosticInfos = []
10772 1
        self._freeze = True
10773 1
10774 1
    def to_binary(self):
10775
        packet = []
10776 1
        packet.append(self.StatusCode.to_binary())
10777
        packet.append(uabin.Primitives.Int32.pack(len(self.OperationResults)))
10778
        for fieldname in self.OperationResults:
10779
            packet.append(fieldname.to_binary())
10780 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
10781
        for fieldname in self.DiagnosticInfos:
10782
            packet.append(fieldname.to_binary())
10783
        return b''.join(packet)
10784
10785 1
    @staticmethod
10786
    def from_binary(data):
10787
        return HistoryUpdateResult(data)
10788
10789
    def _binary_init(self, data):
10790 1
        self.StatusCode = StatusCode.from_binary(data)
10791
        length = uabin.Primitives.Int32.unpack(data)
10792
        array = []
10793 1
        if length != -1:
10794
            for _ in range(0, length):
10795
                array.append(StatusCode.from_binary(data))
10796
        self.OperationResults = array
10797
        length = uabin.Primitives.Int32.unpack(data)
10798
        array = []
10799
        if length != -1:
10800
            for _ in range(0, length):
10801
                array.append(DiagnosticInfo.from_binary(data))
10802 View Code Duplication
        self.DiagnosticInfos = array
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10803
10804
    def __str__(self):
10805 1
        return 'HistoryUpdateResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
10806
               'OperationResults:' + str(self.OperationResults) + ', ' + \
10807
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
10808
10809
    __repr__ = __str__
10810
10811
10812 1
class HistoryUpdateParameters(FrozenClass):
10813 1
    '''
10814 1
    :ivar HistoryUpdateDetails:
10815 1
    :vartype HistoryUpdateDetails: ExtensionObject
10816 1
    '''
10817 1
10818 1
    ua_types = (
10819 1
10820 1
        ('HistoryUpdateDetails', 'ListOfExtensionObject'),
10821 1
               )
10822
10823 1
    def __init__(self, binary=None):
10824 1
        if binary is not None:
10825 1
            self._binary_init(binary)
10826 1
            self._freeze = True
10827 1
            return
10828 1
        self.HistoryUpdateDetails = []
10829 1
        self._freeze = True
10830 1
10831 1
    def to_binary(self):
10832
        packet = []
10833 1
        packet.append(uabin.Primitives.Int32.pack(len(self.HistoryUpdateDetails)))
10834
        for fieldname in self.HistoryUpdateDetails:
10835 1
            packet.append(extensionobject_to_binary(fieldname))
10836
        return b''.join(packet)
10837 1
10838
    @staticmethod
10839 1
    def from_binary(data):
10840 1
        return HistoryUpdateParameters(data)
10841 1
10842 1
    def _binary_init(self, data):
10843 1
        length = uabin.Primitives.Int32.unpack(data)
10844 1
        array = []
10845 1
        if length != -1:
10846 1
            for _ in range(0, length):
10847 1
                array.append(extensionobject_from_binary(data))
10848 1
        self.HistoryUpdateDetails = array
10849 1
10850 1
    def __str__(self):
10851 1
        return 'HistoryUpdateParameters(' + 'HistoryUpdateDetails:' + str(self.HistoryUpdateDetails) + ')'
10852
10853 1
    __repr__ = __str__
10854
10855 1
10856
class HistoryUpdateRequest(FrozenClass):
10857
    '''
10858
    :ivar TypeId:
10859
    :vartype TypeId: NodeId
10860
    :ivar RequestHeader:
10861 1
    :vartype RequestHeader: RequestHeader
10862
    :ivar Parameters:
10863
    :vartype Parameters: HistoryUpdateParameters
10864 1
    '''
10865
10866
    ua_types = (
10867
10868 1
        ('TypeId', 'NodeId'),
10869
        ('RequestHeader', 'RequestHeader'),
10870
        ('Parameters', 'HistoryUpdateParameters'),
10871 1
               )
10872
10873 View Code Duplication
    def __init__(self, binary=None):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10874
        if binary is not None:
10875
            self._binary_init(binary)
10876
            self._freeze = True
10877
            return
10878 1
        self.TypeId = FourByteNodeId(ObjectIds.HistoryUpdateRequest_Encoding_DefaultBinary)
10879
        self.RequestHeader = RequestHeader()
10880
        self.Parameters = HistoryUpdateParameters()
10881
        self._freeze = True
10882 1
10883
    def to_binary(self):
10884
        packet = []
10885
        packet.append(self.TypeId.to_binary())
10886 1
        packet.append(self.RequestHeader.to_binary())
10887
        packet.append(self.Parameters.to_binary())
10888
        return b''.join(packet)
10889 1
10890
    @staticmethod
10891
    def from_binary(data):
10892 1
        return HistoryUpdateRequest(data)
10893
10894
    def _binary_init(self, data):
10895 1
        self.TypeId = NodeId.from_binary(data)
10896
        self.RequestHeader = RequestHeader.from_binary(data)
10897
        self.Parameters = HistoryUpdateParameters.from_binary(data)
10898
10899
    def __str__(self):
10900
        return 'HistoryUpdateRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10901
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
10902
               'Parameters:' + str(self.Parameters) + ')'
10903
10904
    __repr__ = __str__
10905 1
10906
10907
class HistoryUpdateResponse(FrozenClass):
10908
    '''
10909
    :ivar TypeId:
10910
    :vartype TypeId: NodeId
10911 1
    :ivar ResponseHeader:
10912
    :vartype ResponseHeader: ResponseHeader
10913
    :ivar Results:
10914
    :vartype Results: HistoryUpdateResult
10915
    :ivar DiagnosticInfos:
10916
    :vartype DiagnosticInfos: DiagnosticInfo
10917
    '''
10918
10919
    ua_types = (
10920
10921 1
        ('TypeId', 'NodeId'),
10922
        ('ResponseHeader', 'ResponseHeader'),
10923
        ('Results', 'ListOfHistoryUpdateResult'),
10924
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
10925
               )
10926
10927
    def __init__(self, binary=None):
10928 1
        if binary is not None:
10929
            self._binary_init(binary)
10930
            self._freeze = True
10931
            return
10932 1
        self.TypeId = FourByteNodeId(ObjectIds.HistoryUpdateResponse_Encoding_DefaultBinary)
10933
        self.ResponseHeader = ResponseHeader()
10934
        self.Results = []
10935
        self.DiagnosticInfos = []
10936
        self._freeze = True
10937 1
10938
    def to_binary(self):
10939
        packet = []
10940
        packet.append(self.TypeId.to_binary())
10941
        packet.append(self.ResponseHeader.to_binary())
10942 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
10943
        for fieldname in self.Results:
10944
            packet.append(fieldname.to_binary())
10945 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
10946
        for fieldname in self.DiagnosticInfos:
10947
            packet.append(fieldname.to_binary())
10948
        return b''.join(packet)
10949
10950
    @staticmethod
10951
    def from_binary(data):
10952
        return HistoryUpdateResponse(data)
10953 1
10954
    def _binary_init(self, data):
10955
        self.TypeId = NodeId.from_binary(data)
10956
        self.ResponseHeader = ResponseHeader.from_binary(data)
10957
        length = uabin.Primitives.Int32.unpack(data)
10958 1
        array = []
10959 1
        if length != -1:
10960 1
            for _ in range(0, length):
10961 1
                array.append(HistoryUpdateResult.from_binary(data))
10962 1
        self.Results = array
10963 1
        length = uabin.Primitives.Int32.unpack(data)
10964 1
        array = []
10965 1
        if length != -1:
10966
            for _ in range(0, length):
10967 1
                array.append(DiagnosticInfo.from_binary(data))
10968 1
        self.DiagnosticInfos = array
10969 1
10970 1
    def __str__(self):
10971 1
        return 'HistoryUpdateResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10972 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
10973 1
               'Results:' + str(self.Results) + ', ' + \
10974
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
10975 1
10976
    __repr__ = __str__
10977 1
10978
10979 1
class CallMethodRequest(FrozenClass):
10980 1
    '''
10981 1
    :ivar ObjectId:
10982 1
    :vartype ObjectId: NodeId
10983 1
    :ivar MethodId:
10984 1
    :vartype MethodId: NodeId
10985 1
    :ivar InputArguments:
10986 1
    :vartype InputArguments: Variant
10987
    '''
10988 1
10989
    ua_types = (
10990
10991
        ('ObjectId', 'NodeId'),
10992 1
        ('MethodId', 'NodeId'),
10993
        ('InputArguments', 'ListOfVariant'),
10994
               )
10995 1
10996
    def __init__(self, binary=None):
10997
        if binary is not None:
10998
            self._binary_init(binary)
10999
            self._freeze = True
11000
            return
11001
        self.ObjectId = NodeId()
11002
        self.MethodId = NodeId()
11003
        self.InputArguments = []
11004 View Code Duplication
        self._freeze = True
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11005
11006
    def to_binary(self):
11007
        packet = []
11008
        packet.append(self.ObjectId.to_binary())
11009 1
        packet.append(self.MethodId.to_binary())
11010
        packet.append(uabin.Primitives.Int32.pack(len(self.InputArguments)))
11011
        for fieldname in self.InputArguments:
11012
            packet.append(fieldname.to_binary())
11013
        return b''.join(packet)
11014
11015
    @staticmethod
11016
    def from_binary(data):
11017 1
        return CallMethodRequest(data)
11018
11019
    def _binary_init(self, data):
11020
        self.ObjectId = NodeId.from_binary(data)
11021
        self.MethodId = NodeId.from_binary(data)
11022
        length = uabin.Primitives.Int32.unpack(data)
11023
        array = []
11024
        if length != -1:
11025
            for _ in range(0, length):
11026
                array.append(Variant.from_binary(data))
11027
        self.InputArguments = array
11028
11029 1
    def __str__(self):
11030
        return 'CallMethodRequest(' + 'ObjectId:' + str(self.ObjectId) + ', ' + \
11031
               'MethodId:' + str(self.MethodId) + ', ' + \
11032
               'InputArguments:' + str(self.InputArguments) + ')'
11033
11034
    __repr__ = __str__
11035
11036
11037
class CallMethodResult(FrozenClass):
11038 1
    '''
11039
    :ivar StatusCode:
11040
    :vartype StatusCode: StatusCode
11041
    :ivar InputArgumentResults:
11042 1
    :vartype InputArgumentResults: StatusCode
11043
    :ivar InputArgumentDiagnosticInfos:
11044
    :vartype InputArgumentDiagnosticInfos: DiagnosticInfo
11045
    :ivar OutputArguments:
11046
    :vartype OutputArguments: Variant
11047
    '''
11048
11049 1
    ua_types = (
11050
11051
        ('StatusCode', 'StatusCode'),
11052
        ('InputArgumentResults', 'ListOfStatusCode'),
11053
        ('InputArgumentDiagnosticInfos', 'ListOfDiagnosticInfo'),
11054
        ('OutputArguments', 'ListOfVariant'),
11055
               )
11056 1
11057
    def __init__(self, binary=None):
11058
        if binary is not None:
11059 1
            self._binary_init(binary)
11060
            self._freeze = True
11061
            return
11062
        self.StatusCode = StatusCode()
11063
        self.InputArgumentResults = []
11064
        self.InputArgumentDiagnosticInfos = []
11065
        self.OutputArguments = []
11066
        self._freeze = True
11067
11068 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...
11069
        packet = []
11070
        packet.append(self.StatusCode.to_binary())
11071 1
        packet.append(uabin.Primitives.Int32.pack(len(self.InputArgumentResults)))
11072
        for fieldname in self.InputArgumentResults:
11073
            packet.append(fieldname.to_binary())
11074
        packet.append(uabin.Primitives.Int32.pack(len(self.InputArgumentDiagnosticInfos)))
11075
        for fieldname in self.InputArgumentDiagnosticInfos:
11076
            packet.append(fieldname.to_binary())
11077
        packet.append(uabin.Primitives.Int32.pack(len(self.OutputArguments)))
11078 1
        for fieldname in self.OutputArguments:
11079
            packet.append(fieldname.to_binary())
11080
        return b''.join(packet)
11081
11082
    @staticmethod
11083
    def from_binary(data):
11084
        return CallMethodResult(data)
11085
11086
    def _binary_init(self, data):
11087
        self.StatusCode = StatusCode.from_binary(data)
11088
        length = uabin.Primitives.Int32.unpack(data)
11089 1
        array = []
11090
        if length != -1:
11091
            for _ in range(0, length):
11092
                array.append(StatusCode.from_binary(data))
11093
        self.InputArgumentResults = array
11094
        length = uabin.Primitives.Int32.unpack(data)
11095
        array = []
11096
        if length != -1:
11097 1
            for _ in range(0, length):
11098
                array.append(DiagnosticInfo.from_binary(data))
11099
        self.InputArgumentDiagnosticInfos = array
11100
        length = uabin.Primitives.Int32.unpack(data)
11101 1
        array = []
11102
        if length != -1:
11103
            for _ in range(0, length):
11104
                array.append(Variant.from_binary(data))
11105
        self.OutputArguments = array
11106
11107 1
    def __str__(self):
11108
        return 'CallMethodResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
11109
               'InputArgumentResults:' + str(self.InputArgumentResults) + ', ' + \
11110
               'InputArgumentDiagnosticInfos:' + str(self.InputArgumentDiagnosticInfos) + ', ' + \
11111
               'OutputArguments:' + str(self.OutputArguments) + ')'
11112
11113 1
    __repr__ = __str__
11114
11115
11116 1
class CallParameters(FrozenClass):
11117
    '''
11118
    :ivar MethodsToCall:
11119
    :vartype MethodsToCall: CallMethodRequest
11120 1
    '''
11121
11122
    ua_types = (
11123 1
11124
        ('MethodsToCall', 'ListOfCallMethodRequest'),
11125 View Code Duplication
               )
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11126
11127
    def __init__(self, binary=None):
11128
        if binary is not None:
11129
            self._binary_init(binary)
11130 1
            self._freeze = True
11131
            return
11132
        self.MethodsToCall = []
11133
        self._freeze = True
11134 1
11135
    def to_binary(self):
11136
        packet = []
11137
        packet.append(uabin.Primitives.Int32.pack(len(self.MethodsToCall)))
11138 1
        for fieldname in self.MethodsToCall:
11139
            packet.append(fieldname.to_binary())
11140
        return b''.join(packet)
11141 1
11142
    @staticmethod
11143
    def from_binary(data):
11144 1
        return CallParameters(data)
11145
11146
    def _binary_init(self, data):
11147 1
        length = uabin.Primitives.Int32.unpack(data)
11148
        array = []
11149
        if length != -1:
11150
            for _ in range(0, length):
11151
                array.append(CallMethodRequest.from_binary(data))
11152
        self.MethodsToCall = array
11153
11154
    def __str__(self):
11155
        return 'CallParameters(' + 'MethodsToCall:' + str(self.MethodsToCall) + ')'
11156
11157 1
    __repr__ = __str__
11158
11159
11160
class CallRequest(FrozenClass):
11161
    '''
11162
    :ivar TypeId:
11163 1
    :vartype TypeId: NodeId
11164
    :ivar RequestHeader:
11165
    :vartype RequestHeader: RequestHeader
11166
    :ivar Parameters:
11167
    :vartype Parameters: CallParameters
11168
    '''
11169
11170
    ua_types = (
11171
11172
        ('TypeId', 'NodeId'),
11173 1
        ('RequestHeader', 'RequestHeader'),
11174
        ('Parameters', 'CallParameters'),
11175
               )
11176
11177
    def __init__(self, binary=None):
11178
        if binary is not None:
11179
            self._binary_init(binary)
11180
            self._freeze = True
11181
            return
11182
        self.TypeId = FourByteNodeId(ObjectIds.CallRequest_Encoding_DefaultBinary)
11183
        self.RequestHeader = RequestHeader()
11184 1
        self.Parameters = CallParameters()
11185
        self._freeze = True
11186
11187
    def to_binary(self):
11188 1
        packet = []
11189
        packet.append(self.TypeId.to_binary())
11190
        packet.append(self.RequestHeader.to_binary())
11191
        packet.append(self.Parameters.to_binary())
11192
        return b''.join(packet)
11193
11194
    @staticmethod
11195
    def from_binary(data):
11196
        return CallRequest(data)
11197
11198
    def _binary_init(self, data):
11199
        self.TypeId = NodeId.from_binary(data)
11200
        self.RequestHeader = RequestHeader.from_binary(data)
11201
        self.Parameters = CallParameters.from_binary(data)
11202
11203 1
    def __str__(self):
11204
        return 'CallRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11205
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
11206
               'Parameters:' + str(self.Parameters) + ')'
11207
11208 1
    __repr__ = __str__
11209
11210
11211 1
class CallResponse(FrozenClass):
11212
    '''
11213
    :ivar TypeId:
11214
    :vartype TypeId: NodeId
11215
    :ivar ResponseHeader:
11216
    :vartype ResponseHeader: ResponseHeader
11217
    :ivar Results:
11218
    :vartype Results: CallMethodResult
11219
    :ivar DiagnosticInfos:
11220
    :vartype DiagnosticInfos: DiagnosticInfo
11221 1
    '''
11222
11223
    ua_types = (
11224
11225
        ('TypeId', 'NodeId'),
11226
        ('ResponseHeader', 'ResponseHeader'),
11227 1
        ('Results', 'ListOfCallMethodResult'),
11228
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
11229
               )
11230
11231
    def __init__(self, binary=None):
11232
        if binary is not None:
11233
            self._binary_init(binary)
11234
            self._freeze = True
11235
            return
11236
        self.TypeId = FourByteNodeId(ObjectIds.CallResponse_Encoding_DefaultBinary)
11237 1
        self.ResponseHeader = ResponseHeader()
11238
        self.Results = []
11239
        self.DiagnosticInfos = []
11240
        self._freeze = True
11241
11242
    def to_binary(self):
11243
        packet = []
11244 1
        packet.append(self.TypeId.to_binary())
11245
        packet.append(self.ResponseHeader.to_binary())
11246
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
11247
        for fieldname in self.Results:
11248 1
            packet.append(fieldname.to_binary())
11249
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
11250
        for fieldname in self.DiagnosticInfos:
11251
            packet.append(fieldname.to_binary())
11252
        return b''.join(packet)
11253 1
11254
    @staticmethod
11255
    def from_binary(data):
11256
        return CallResponse(data)
11257
11258 1
    def _binary_init(self, data):
11259
        self.TypeId = NodeId.from_binary(data)
11260
        self.ResponseHeader = ResponseHeader.from_binary(data)
11261 1
        length = uabin.Primitives.Int32.unpack(data)
11262
        array = []
11263
        if length != -1:
11264
            for _ in range(0, length):
11265
                array.append(CallMethodResult.from_binary(data))
11266
        self.Results = array
11267
        length = uabin.Primitives.Int32.unpack(data)
11268
        array = []
11269
        if length != -1:
11270
            for _ in range(0, length):
11271
                array.append(DiagnosticInfo.from_binary(data))
11272
        self.DiagnosticInfos = array
11273
11274
    def __str__(self):
11275 1
        return 'CallResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11276
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
11277
               'Results:' + str(self.Results) + ', ' + \
11278
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
11279
11280
    __repr__ = __str__
11281
11282
11283 1
class MonitoringFilter(FrozenClass):
11284 1
    '''
11285 1
    '''
11286 1
11287 1
    ua_types = (
11288 1
11289 1
               )
11290 1
11291 1
    def __init__(self, binary=None):
11292 1
        if binary is not None:
11293 1
            self._binary_init(binary)
11294
            self._freeze = True
11295 1
            return
11296 1
        self._freeze = True
11297 1
11298 1
    def to_binary(self):
11299 1
        packet = []
11300 1
        return b''.join(packet)
11301 1
11302 1
    @staticmethod
11303
    def from_binary(data):
11304 1
        return MonitoringFilter(data)
11305
11306 1
    def _binary_init(self, data):
11307
        pass
11308 1
11309 1
    def __str__(self):
11310 1
        return 'MonitoringFilter(' +  + ')'
11311 1
11312 1
    __repr__ = __str__
11313 1
11314
11315 1
class DataChangeFilter(FrozenClass):
11316
    '''
11317
    :ivar Trigger:
11318
    :vartype Trigger: DataChangeTrigger
11319
    :ivar DeadbandType:
11320
    :vartype DeadbandType: UInt32
11321
    :ivar DeadbandValue:
11322 1
    :vartype DeadbandValue: Double
11323
    '''
11324
11325 1
    ua_types = (
11326
11327
        ('Trigger', 'DataChangeTrigger'),
11328
        ('DeadbandType', 'UInt32'),
11329
        ('DeadbandValue', 'Double'),
11330
               )
11331
11332
    def __init__(self, binary=None):
11333
        if binary is not None:
11334
            self._binary_init(binary)
11335 1
            self._freeze = True
11336
            return
11337
        self.Trigger = DataChangeTrigger(0)
11338
        self.DeadbandType = 0
11339
        self.DeadbandValue = 0
11340
        self._freeze = True
11341 1
11342 1
    def to_binary(self):
11343 1
        packet = []
11344 1
        packet.append(uabin.Primitives.UInt32.pack(self.Trigger.value))
11345 1
        packet.append(uabin.Primitives.UInt32.pack(self.DeadbandType))
11346 1
        packet.append(uabin.Primitives.Double.pack(self.DeadbandValue))
11347 1
        return b''.join(packet)
11348 1
11349 1
    @staticmethod
11350
    def from_binary(data):
11351 1
        return DataChangeFilter(data)
11352 1
11353 1
    def _binary_init(self, data):
11354 1
        self.Trigger = DataChangeTrigger(uabin.Primitives.UInt32.unpack(data))
11355 1
        self.DeadbandType = uabin.Primitives.UInt32.unpack(data)
11356 1
        self.DeadbandValue = uabin.Primitives.Double.unpack(data)
11357
11358 1
    def __str__(self):
11359
        return 'DataChangeFilter(' + 'Trigger:' + str(self.Trigger) + ', ' + \
11360 1
               'DeadbandType:' + str(self.DeadbandType) + ', ' + \
11361
               'DeadbandValue:' + str(self.DeadbandValue) + ')'
11362 1
11363 1
    __repr__ = __str__
11364 1
11365 1
11366
class EventFilter(FrozenClass):
11367 1
    '''
11368
    :ivar SelectClauses:
11369
    :vartype SelectClauses: SimpleAttributeOperand
11370
    :ivar WhereClause:
11371
    :vartype WhereClause: ContentFilter
11372 1
    '''
11373
11374
    ua_types = (
11375 1
11376
        ('SelectClauses', 'ListOfSimpleAttributeOperand'),
11377
        ('WhereClause', 'ContentFilter'),
11378
               )
11379
11380
    def __init__(self, binary=None):
11381
        if binary is not None:
11382
            self._binary_init(binary)
11383
            self._freeze = True
11384
            return
11385
        self.SelectClauses = []
11386
        self.WhereClause = ContentFilter()
11387
        self._freeze = True
11388
11389 1
    def to_binary(self):
11390
        packet = []
11391
        packet.append(uabin.Primitives.Int32.pack(len(self.SelectClauses)))
11392
        for fieldname in self.SelectClauses:
11393
            packet.append(fieldname.to_binary())
11394
        packet.append(self.WhereClause.to_binary())
11395
        return b''.join(packet)
11396
11397 1
    @staticmethod
11398 1
    def from_binary(data):
11399 1
        return EventFilter(data)
11400 1
11401 1
    def _binary_init(self, data):
11402 1
        length = uabin.Primitives.Int32.unpack(data)
11403 1
        array = []
11404 1
        if length != -1:
11405 1
            for _ in range(0, length):
11406 1
                array.append(SimpleAttributeOperand.from_binary(data))
11407 1
        self.SelectClauses = array
11408
        self.WhereClause = ContentFilter.from_binary(data)
11409 1
11410 1
    def __str__(self):
11411 1
        return 'EventFilter(' + 'SelectClauses:' + str(self.SelectClauses) + ', ' + \
11412 1
               'WhereClause:' + str(self.WhereClause) + ')'
11413 1
11414 1
    __repr__ = __str__
11415 1
11416 1
11417
class AggregateConfiguration(FrozenClass):
11418 1
    '''
11419
    :ivar UseServerCapabilitiesDefaults:
11420 1
    :vartype UseServerCapabilitiesDefaults: Boolean
11421
    :ivar TreatUncertainAsBad:
11422 1
    :vartype TreatUncertainAsBad: Boolean
11423 1
    :ivar PercentDataBad:
11424 1
    :vartype PercentDataBad: Byte
11425 1
    :ivar PercentDataGood:
11426 1
    :vartype PercentDataGood: Byte
11427 1
    :ivar UseSlopedExtrapolation:
11428
    :vartype UseSlopedExtrapolation: Boolean
11429 1
    '''
11430
11431
    ua_types = (
11432
11433
        ('UseServerCapabilitiesDefaults', 'Boolean'),
11434
        ('TreatUncertainAsBad', 'Boolean'),
11435
        ('PercentDataBad', 'Byte'),
11436 1
        ('PercentDataGood', 'Byte'),
11437
        ('UseSlopedExtrapolation', 'Boolean'),
11438
               )
11439 1
11440
    def __init__(self, binary=None):
11441
        if binary is not None:
11442
            self._binary_init(binary)
11443
            self._freeze = True
11444
            return
11445
        self.UseServerCapabilitiesDefaults = True
11446
        self.TreatUncertainAsBad = True
11447
        self.PercentDataBad = 0
11448 View Code Duplication
        self.PercentDataGood = 0
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11449 1
        self.UseSlopedExtrapolation = True
11450
        self._freeze = True
11451
11452
    def to_binary(self):
11453
        packet = []
11454
        packet.append(uabin.Primitives.Boolean.pack(self.UseServerCapabilitiesDefaults))
11455 1
        packet.append(uabin.Primitives.Boolean.pack(self.TreatUncertainAsBad))
11456 1
        packet.append(uabin.Primitives.Byte.pack(self.PercentDataBad))
11457 1
        packet.append(uabin.Primitives.Byte.pack(self.PercentDataGood))
11458 1
        packet.append(uabin.Primitives.Boolean.pack(self.UseSlopedExtrapolation))
11459 1
        return b''.join(packet)
11460 1
11461 1
    @staticmethod
11462 1
    def from_binary(data):
11463 1
        return AggregateConfiguration(data)
11464
11465 1
    def _binary_init(self, data):
11466 1
        self.UseServerCapabilitiesDefaults = uabin.Primitives.Boolean.unpack(data)
11467 1
        self.TreatUncertainAsBad = uabin.Primitives.Boolean.unpack(data)
11468 1
        self.PercentDataBad = uabin.Primitives.Byte.unpack(data)
11469 1
        self.PercentDataGood = uabin.Primitives.Byte.unpack(data)
11470 1
        self.UseSlopedExtrapolation = uabin.Primitives.Boolean.unpack(data)
11471 1
11472 1
    def __str__(self):
11473
        return 'AggregateConfiguration(' + 'UseServerCapabilitiesDefaults:' + str(self.UseServerCapabilitiesDefaults) + ', ' + \
11474 1
               'TreatUncertainAsBad:' + str(self.TreatUncertainAsBad) + ', ' + \
11475
               'PercentDataBad:' + str(self.PercentDataBad) + ', ' + \
11476 1
               'PercentDataGood:' + str(self.PercentDataGood) + ', ' + \
11477
               'UseSlopedExtrapolation:' + str(self.UseSlopedExtrapolation) + ')'
11478 1
11479 1
    __repr__ = __str__
11480 1
11481 1
11482 1
class AggregateFilter(FrozenClass):
11483 1
    '''
11484 1
    :ivar StartTime:
11485 1
    :vartype StartTime: DateTime
11486 1
    :ivar AggregateType:
11487
    :vartype AggregateType: NodeId
11488 1
    :ivar ProcessingInterval:
11489
    :vartype ProcessingInterval: Double
11490
    :ivar AggregateConfiguration:
11491
    :vartype AggregateConfiguration: AggregateConfiguration
11492
    '''
11493 1
11494
    ua_types = (
11495
11496 1
        ('StartTime', 'DateTime'),
11497
        ('AggregateType', 'NodeId'),
11498
        ('ProcessingInterval', 'Double'),
11499
        ('AggregateConfiguration', 'AggregateConfiguration'),
11500
               )
11501
11502
    def __init__(self, binary=None):
11503
        if binary is not None:
11504
            self._binary_init(binary)
11505
            self._freeze = True
11506 1
            return
11507
        self.StartTime = datetime.utcnow()
11508
        self.AggregateType = NodeId()
11509
        self.ProcessingInterval = 0
11510
        self.AggregateConfiguration = AggregateConfiguration()
11511
        self._freeze = True
11512 1
11513 1
    def to_binary(self):
11514
        packet = []
11515
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
11516
        packet.append(self.AggregateType.to_binary())
11517 1
        packet.append(uabin.Primitives.Double.pack(self.ProcessingInterval))
11518 1
        packet.append(self.AggregateConfiguration.to_binary())
11519 1
        return b''.join(packet)
11520 1
11521
    @staticmethod
11522 1
    def from_binary(data):
11523 1
        return AggregateFilter(data)
11524 1
11525 1
    def _binary_init(self, data):
11526 1
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
11527 1
        self.AggregateType = NodeId.from_binary(data)
11528
        self.ProcessingInterval = uabin.Primitives.Double.unpack(data)
11529 1
        self.AggregateConfiguration = AggregateConfiguration.from_binary(data)
11530
11531
    def __str__(self):
11532
        return 'AggregateFilter(' + 'StartTime:' + str(self.StartTime) + ', ' + \
11533 1
               'AggregateType:' + str(self.AggregateType) + ', ' + \
11534
               'ProcessingInterval:' + str(self.ProcessingInterval) + ', ' + \
11535
               'AggregateConfiguration:' + str(self.AggregateConfiguration) + ')'
11536
11537
    __repr__ = __str__
11538 1
11539
11540
class MonitoringFilterResult(FrozenClass):
11541
    '''
11542
    '''
11543 1
11544
    ua_types = (
11545
11546 1
               )
11547
11548
    def __init__(self, binary=None):
11549
        if binary is not None:
11550
            self._binary_init(binary)
11551
            self._freeze = True
11552
            return
11553
        self._freeze = True
11554
11555 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...
11556
        packet = []
11557
        return b''.join(packet)
11558 1
11559
    @staticmethod
11560
    def from_binary(data):
11561
        return MonitoringFilterResult(data)
11562
11563
    def _binary_init(self, data):
11564
        pass
11565 1
11566 1
    def __str__(self):
11567 1
        return 'MonitoringFilterResult(' +  + ')'
11568 1
11569 1
    __repr__ = __str__
11570 1
11571 1
11572 1
class EventFilterResult(FrozenClass):
11573 1
    '''
11574 1
    :ivar SelectClauseResults:
11575
    :vartype SelectClauseResults: StatusCode
11576 1
    :ivar SelectClauseDiagnosticInfos:
11577 1
    :vartype SelectClauseDiagnosticInfos: DiagnosticInfo
11578 1
    :ivar WhereClauseResult:
11579 1
    :vartype WhereClauseResult: ContentFilterResult
11580 1
    '''
11581 1
11582 1
    ua_types = (
11583 1
11584 1
        ('SelectClauseResults', 'ListOfStatusCode'),
11585
        ('SelectClauseDiagnosticInfos', 'ListOfDiagnosticInfo'),
11586 1
        ('WhereClauseResult', 'ContentFilterResult'),
11587
               )
11588 1
11589
    def __init__(self, binary=None):
11590 1
        if binary is not None:
11591
            self._binary_init(binary)
11592 1
            self._freeze = True
11593 1
            return
11594 1
        self.SelectClauseResults = []
11595 1
        self.SelectClauseDiagnosticInfos = []
11596 1
        self.WhereClauseResult = ContentFilterResult()
11597 1
        self._freeze = True
11598 1
11599 1
    def to_binary(self):
11600 1
        packet = []
11601 1
        packet.append(uabin.Primitives.Int32.pack(len(self.SelectClauseResults)))
11602 1
        for fieldname in self.SelectClauseResults:
11603 1
            packet.append(fieldname.to_binary())
11604 1
        packet.append(uabin.Primitives.Int32.pack(len(self.SelectClauseDiagnosticInfos)))
11605
        for fieldname in self.SelectClauseDiagnosticInfos:
11606 1
            packet.append(fieldname.to_binary())
11607
        packet.append(self.WhereClauseResult.to_binary())
11608 1
        return b''.join(packet)
11609
11610
    @staticmethod
11611
    def from_binary(data):
11612
        return EventFilterResult(data)
11613
11614 1
    def _binary_init(self, data):
11615
        length = uabin.Primitives.Int32.unpack(data)
11616
        array = []
11617 1
        if length != -1:
11618
            for _ in range(0, length):
11619
                array.append(StatusCode.from_binary(data))
11620
        self.SelectClauseResults = array
11621
        length = uabin.Primitives.Int32.unpack(data)
11622
        array = []
11623
        if length != -1:
11624
            for _ in range(0, length):
11625 1
                array.append(DiagnosticInfo.from_binary(data))
11626
        self.SelectClauseDiagnosticInfos = array
11627
        self.WhereClauseResult = ContentFilterResult.from_binary(data)
11628
11629
    def __str__(self):
11630 1
        return 'EventFilterResult(' + 'SelectClauseResults:' + str(self.SelectClauseResults) + ', ' + \
11631
               'SelectClauseDiagnosticInfos:' + str(self.SelectClauseDiagnosticInfos) + ', ' + \
11632
               'WhereClauseResult:' + str(self.WhereClauseResult) + ')'
11633
11634
    __repr__ = __str__
11635
11636
11637
class AggregateFilterResult(FrozenClass):
11638
    '''
11639 1
    :ivar RevisedStartTime:
11640
    :vartype RevisedStartTime: DateTime
11641
    :ivar RevisedProcessingInterval:
11642
    :vartype RevisedProcessingInterval: Double
11643
    :ivar RevisedAggregateConfiguration:
11644
    :vartype RevisedAggregateConfiguration: AggregateConfiguration
11645 1
    '''
11646
11647
    ua_types = (
11648
11649 1
        ('RevisedStartTime', 'DateTime'),
11650
        ('RevisedProcessingInterval', 'Double'),
11651
        ('RevisedAggregateConfiguration', 'AggregateConfiguration'),
11652
               )
11653 1
11654
    def __init__(self, binary=None):
11655
        if binary is not None:
11656
            self._binary_init(binary)
11657 1
            self._freeze = True
11658
            return
11659
        self.RevisedStartTime = datetime.utcnow()
11660 1
        self.RevisedProcessingInterval = 0
11661
        self.RevisedAggregateConfiguration = AggregateConfiguration()
11662
        self._freeze = True
11663
11664
    def to_binary(self):
11665
        packet = []
11666
        packet.append(uabin.Primitives.DateTime.pack(self.RevisedStartTime))
11667
        packet.append(uabin.Primitives.Double.pack(self.RevisedProcessingInterval))
11668
        packet.append(self.RevisedAggregateConfiguration.to_binary())
11669 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...
11670
11671
    @staticmethod
11672 1
    def from_binary(data):
11673
        return AggregateFilterResult(data)
11674
11675
    def _binary_init(self, data):
11676
        self.RevisedStartTime = uabin.Primitives.DateTime.unpack(data)
11677
        self.RevisedProcessingInterval = uabin.Primitives.Double.unpack(data)
11678
        self.RevisedAggregateConfiguration = AggregateConfiguration.from_binary(data)
11679 1
11680
    def __str__(self):
11681
        return 'AggregateFilterResult(' + 'RevisedStartTime:' + str(self.RevisedStartTime) + ', ' + \
11682
               'RevisedProcessingInterval:' + str(self.RevisedProcessingInterval) + ', ' + \
11683
               'RevisedAggregateConfiguration:' + str(self.RevisedAggregateConfiguration) + ')'
11684
11685
    __repr__ = __str__
11686
11687
11688
class MonitoringParameters(FrozenClass):
11689
    '''
11690 1
    :ivar ClientHandle:
11691
    :vartype ClientHandle: UInt32
11692
    :ivar SamplingInterval:
11693
    :vartype SamplingInterval: Double
11694
    :ivar Filter:
11695
    :vartype Filter: ExtensionObject
11696
    :ivar QueueSize:
11697
    :vartype QueueSize: UInt32
11698 1
    :ivar DiscardOldest:
11699
    :vartype DiscardOldest: Boolean
11700
    '''
11701
11702 1
    ua_types = (
11703
11704
        ('ClientHandle', 'UInt32'),
11705
        ('SamplingInterval', 'Double'),
11706
        ('Filter', 'ExtensionObject'),
11707
        ('QueueSize', 'UInt32'),
11708 1
        ('DiscardOldest', 'Boolean'),
11709
               )
11710
11711
    def __init__(self, binary=None):
11712
        if binary is not None:
11713
            self._binary_init(binary)
11714 1
            self._freeze = True
11715
            return
11716
        self.ClientHandle = 0
11717 1
        self.SamplingInterval = 0
11718
        self.Filter = None
11719
        self.QueueSize = 0
11720
        self.DiscardOldest = True
11721
        self._freeze = True
11722
11723
    def to_binary(self):
11724
        packet = []
11725
        packet.append(uabin.Primitives.UInt32.pack(self.ClientHandle))
11726 View Code Duplication
        packet.append(uabin.Primitives.Double.pack(self.SamplingInterval))
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11727 1
        packet.append(extensionobject_to_binary(self.Filter))
11728
        packet.append(uabin.Primitives.UInt32.pack(self.QueueSize))
11729
        packet.append(uabin.Primitives.Boolean.pack(self.DiscardOldest))
11730
        return b''.join(packet)
11731
11732
    @staticmethod
11733 1
    def from_binary(data):
11734
        return MonitoringParameters(data)
11735
11736
    def _binary_init(self, data):
11737
        self.ClientHandle = uabin.Primitives.UInt32.unpack(data)
11738
        self.SamplingInterval = uabin.Primitives.Double.unpack(data)
11739
        self.Filter = extensionobject_from_binary(data)
11740
        self.QueueSize = uabin.Primitives.UInt32.unpack(data)
11741
        self.DiscardOldest = uabin.Primitives.Boolean.unpack(data)
11742
11743 1
    def __str__(self):
11744
        return 'MonitoringParameters(' + 'ClientHandle:' + str(self.ClientHandle) + ', ' + \
11745
               'SamplingInterval:' + str(self.SamplingInterval) + ', ' + \
11746
               'Filter:' + str(self.Filter) + ', ' + \
11747
               'QueueSize:' + str(self.QueueSize) + ', ' + \
11748
               'DiscardOldest:' + str(self.DiscardOldest) + ')'
11749
11750
    __repr__ = __str__
11751
11752 1
11753
class MonitoredItemCreateRequest(FrozenClass):
11754
    '''
11755
    :ivar ItemToMonitor:
11756 1
    :vartype ItemToMonitor: ReadValueId
11757
    :ivar MonitoringMode:
11758
    :vartype MonitoringMode: MonitoringMode
11759
    :ivar RequestedParameters:
11760
    :vartype RequestedParameters: MonitoringParameters
11761
    '''
11762
11763
    ua_types = (
11764
11765
        ('ItemToMonitor', 'ReadValueId'),
11766 1
        ('MonitoringMode', 'MonitoringMode'),
11767
        ('RequestedParameters', 'MonitoringParameters'),
11768
               )
11769
11770
    def __init__(self, binary=None):
11771 1
        if binary is not None:
11772
            self._binary_init(binary)
11773
            self._freeze = True
11774 1
            return
11775
        self.ItemToMonitor = ReadValueId()
11776
        self.MonitoringMode = MonitoringMode(0)
11777
        self.RequestedParameters = MonitoringParameters()
11778
        self._freeze = True
11779
11780
    def to_binary(self):
11781
        packet = []
11782
        packet.append(self.ItemToMonitor.to_binary())
11783
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoringMode.value))
11784 1
        packet.append(self.RequestedParameters.to_binary())
11785
        return b''.join(packet)
11786
11787
    @staticmethod
11788
    def from_binary(data):
11789
        return MonitoredItemCreateRequest(data)
11790 1
11791
    def _binary_init(self, data):
11792
        self.ItemToMonitor = ReadValueId.from_binary(data)
11793
        self.MonitoringMode = MonitoringMode(uabin.Primitives.UInt32.unpack(data))
11794
        self.RequestedParameters = MonitoringParameters.from_binary(data)
11795
11796
    def __str__(self):
11797
        return 'MonitoredItemCreateRequest(' + 'ItemToMonitor:' + str(self.ItemToMonitor) + ', ' + \
11798
               'MonitoringMode:' + str(self.MonitoringMode) + ', ' + \
11799
               'RequestedParameters:' + str(self.RequestedParameters) + ')'
11800 1
11801
    __repr__ = __str__
11802
11803
11804
class MonitoredItemCreateResult(FrozenClass):
11805
    '''
11806
    :ivar StatusCode:
11807 1
    :vartype StatusCode: StatusCode
11808
    :ivar MonitoredItemId:
11809
    :vartype MonitoredItemId: UInt32
11810
    :ivar RevisedSamplingInterval:
11811 1
    :vartype RevisedSamplingInterval: Double
11812
    :ivar RevisedQueueSize:
11813
    :vartype RevisedQueueSize: UInt32
11814
    :ivar FilterResult:
11815
    :vartype FilterResult: ExtensionObject
11816 1
    '''
11817
11818
    ua_types = (
11819
11820
        ('StatusCode', 'StatusCode'),
11821 1
        ('MonitoredItemId', 'UInt32'),
11822
        ('RevisedSamplingInterval', 'Double'),
11823
        ('RevisedQueueSize', 'UInt32'),
11824 1
        ('FilterResult', 'ExtensionObject'),
11825
               )
11826
11827
    def __init__(self, binary=None):
11828
        if binary is not None:
11829
            self._binary_init(binary)
11830
            self._freeze = True
11831
            return
11832
        self.StatusCode = StatusCode()
11833 View Code Duplication
        self.MonitoredItemId = 0
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11834
        self.RevisedSamplingInterval = 0
11835
        self.RevisedQueueSize = 0
11836 1
        self.FilterResult = None
11837
        self._freeze = True
11838
11839
    def to_binary(self):
11840
        packet = []
11841
        packet.append(self.StatusCode.to_binary())
11842
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoredItemId))
11843 1
        packet.append(uabin.Primitives.Double.pack(self.RevisedSamplingInterval))
11844
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedQueueSize))
11845
        packet.append(extensionobject_to_binary(self.FilterResult))
11846
        return b''.join(packet)
11847
11848
    @staticmethod
11849
    def from_binary(data):
11850
        return MonitoredItemCreateResult(data)
11851
11852
    def _binary_init(self, data):
11853
        self.StatusCode = StatusCode.from_binary(data)
11854 1
        self.MonitoredItemId = uabin.Primitives.UInt32.unpack(data)
11855
        self.RevisedSamplingInterval = uabin.Primitives.Double.unpack(data)
11856
        self.RevisedQueueSize = uabin.Primitives.UInt32.unpack(data)
11857
        self.FilterResult = extensionobject_from_binary(data)
11858
11859
    def __str__(self):
11860
        return 'MonitoredItemCreateResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
11861
               'MonitoredItemId:' + str(self.MonitoredItemId) + ', ' + \
11862
               'RevisedSamplingInterval:' + str(self.RevisedSamplingInterval) + ', ' + \
11863
               'RevisedQueueSize:' + str(self.RevisedQueueSize) + ', ' + \
11864
               'FilterResult:' + str(self.FilterResult) + ')'
11865
11866 1
    __repr__ = __str__
11867
11868
11869
class CreateMonitoredItemsParameters(FrozenClass):
11870 1
    '''
11871
    :ivar SubscriptionId:
11872
    :vartype SubscriptionId: UInt32
11873
    :ivar TimestampsToReturn:
11874
    :vartype TimestampsToReturn: TimestampsToReturn
11875
    :ivar ItemsToCreate:
11876
    :vartype ItemsToCreate: MonitoredItemCreateRequest
11877
    '''
11878
11879
    ua_types = (
11880
11881
        ('SubscriptionId', 'UInt32'),
11882
        ('TimestampsToReturn', 'TimestampsToReturn'),
11883
        ('ItemsToCreate', 'ListOfMonitoredItemCreateRequest'),
11884
               )
11885
11886 1
    def __init__(self, binary=None):
11887
        if binary is not None:
11888
            self._binary_init(binary)
11889
            self._freeze = True
11890
            return
11891
        self.SubscriptionId = 0
11892 1
        self.TimestampsToReturn = TimestampsToReturn(0)
11893
        self.ItemsToCreate = []
11894
        self._freeze = True
11895 1
11896
    def to_binary(self):
11897
        packet = []
11898
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
11899
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
11900
        packet.append(uabin.Primitives.Int32.pack(len(self.ItemsToCreate)))
11901
        for fieldname in self.ItemsToCreate:
11902
            packet.append(fieldname.to_binary())
11903
        return b''.join(packet)
11904
11905 1
    @staticmethod
11906
    def from_binary(data):
11907
        return CreateMonitoredItemsParameters(data)
11908
11909
    def _binary_init(self, data):
11910
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
11911 1
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
11912
        length = uabin.Primitives.Int32.unpack(data)
11913
        array = []
11914
        if length != -1:
11915
            for _ in range(0, length):
11916
                array.append(MonitoredItemCreateRequest.from_binary(data))
11917
        self.ItemsToCreate = array
11918
11919
    def __str__(self):
11920
        return 'CreateMonitoredItemsParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
11921 1
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
11922
               'ItemsToCreate:' + str(self.ItemsToCreate) + ')'
11923
11924
    __repr__ = __str__
11925
11926
11927
class CreateMonitoredItemsRequest(FrozenClass):
11928
    '''
11929
    :ivar TypeId:
11930 1
    :vartype TypeId: NodeId
11931
    :ivar RequestHeader:
11932
    :vartype RequestHeader: RequestHeader
11933
    :ivar Parameters:
11934 1
    :vartype Parameters: CreateMonitoredItemsParameters
11935
    '''
11936
11937
    ua_types = (
11938
11939 1
        ('TypeId', 'NodeId'),
11940
        ('RequestHeader', 'RequestHeader'),
11941
        ('Parameters', 'CreateMonitoredItemsParameters'),
11942
               )
11943
11944 1
    def __init__(self, binary=None):
11945
        if binary is not None:
11946
            self._binary_init(binary)
11947 1
            self._freeze = True
11948
            return
11949
        self.TypeId = FourByteNodeId(ObjectIds.CreateMonitoredItemsRequest_Encoding_DefaultBinary)
11950
        self.RequestHeader = RequestHeader()
11951
        self.Parameters = CreateMonitoredItemsParameters()
11952
        self._freeze = True
11953
11954
    def to_binary(self):
11955
        packet = []
11956
        packet.append(self.TypeId.to_binary())
11957 1
        packet.append(self.RequestHeader.to_binary())
11958
        packet.append(self.Parameters.to_binary())
11959
        return b''.join(packet)
11960
11961
    @staticmethod
11962
    def from_binary(data):
11963 1
        return CreateMonitoredItemsRequest(data)
11964
11965
    def _binary_init(self, data):
11966
        self.TypeId = NodeId.from_binary(data)
11967
        self.RequestHeader = RequestHeader.from_binary(data)
11968
        self.Parameters = CreateMonitoredItemsParameters.from_binary(data)
11969
11970
    def __str__(self):
11971
        return 'CreateMonitoredItemsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11972
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
11973 1
               'Parameters:' + str(self.Parameters) + ')'
11974
11975
    __repr__ = __str__
11976
11977
11978
class CreateMonitoredItemsResponse(FrozenClass):
11979
    '''
11980 1
    :ivar TypeId:
11981
    :vartype TypeId: NodeId
11982
    :ivar ResponseHeader:
11983
    :vartype ResponseHeader: ResponseHeader
11984 1
    :ivar Results:
11985
    :vartype Results: MonitoredItemCreateResult
11986
    :ivar DiagnosticInfos:
11987
    :vartype DiagnosticInfos: DiagnosticInfo
11988
    '''
11989 1
11990
    ua_types = (
11991
11992
        ('TypeId', 'NodeId'),
11993
        ('ResponseHeader', 'ResponseHeader'),
11994 1
        ('Results', 'ListOfMonitoredItemCreateResult'),
11995
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
11996
               )
11997 1
11998
    def __init__(self, binary=None):
11999
        if binary is not None:
12000
            self._binary_init(binary)
12001
            self._freeze = True
12002
            return
12003
        self.TypeId = FourByteNodeId(ObjectIds.CreateMonitoredItemsResponse_Encoding_DefaultBinary)
12004
        self.ResponseHeader = ResponseHeader()
12005 1
        self.Results = []
12006
        self.DiagnosticInfos = []
12007
        self._freeze = True
12008
12009
    def to_binary(self):
12010 1
        packet = []
12011
        packet.append(self.TypeId.to_binary())
12012
        packet.append(self.ResponseHeader.to_binary())
12013
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
12014
        for fieldname in self.Results:
12015
            packet.append(fieldname.to_binary())
12016
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
12017
        for fieldname in self.DiagnosticInfos:
12018
            packet.append(fieldname.to_binary())
12019 1
        return b''.join(packet)
12020
12021
    @staticmethod
12022
    def from_binary(data):
12023
        return CreateMonitoredItemsResponse(data)
12024
12025
    def _binary_init(self, data):
12026
        self.TypeId = NodeId.from_binary(data)
12027
        self.ResponseHeader = ResponseHeader.from_binary(data)
12028
        length = uabin.Primitives.Int32.unpack(data)
12029 1
        array = []
12030
        if length != -1:
12031
            for _ in range(0, length):
12032
                array.append(MonitoredItemCreateResult.from_binary(data))
12033 1
        self.Results = array
12034
        length = uabin.Primitives.Int32.unpack(data)
12035
        array = []
12036
        if length != -1:
12037
            for _ in range(0, length):
12038
                array.append(DiagnosticInfo.from_binary(data))
12039
        self.DiagnosticInfos = array
12040
12041
    def __str__(self):
12042
        return 'CreateMonitoredItemsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12043
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12044
               'Results:' + str(self.Results) + ', ' + \
12045
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
12046
12047 1
    __repr__ = __str__
12048
12049
12050
class MonitoredItemModifyRequest(FrozenClass):
12051 1
    '''
12052
    :ivar MonitoredItemId:
12053
    :vartype MonitoredItemId: UInt32
12054 1
    :ivar RequestedParameters:
12055
    :vartype RequestedParameters: MonitoringParameters
12056
    '''
12057
12058
    ua_types = (
12059
12060
        ('MonitoredItemId', 'UInt32'),
12061
        ('RequestedParameters', 'MonitoringParameters'),
12062
               )
12063
12064 1
    def __init__(self, binary=None):
12065
        if binary is not None:
12066
            self._binary_init(binary)
12067
            self._freeze = True
12068
            return
12069
        self.MonitoredItemId = 0
12070 1
        self.RequestedParameters = MonitoringParameters()
12071
        self._freeze = True
12072
12073
    def to_binary(self):
12074
        packet = []
12075
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoredItemId))
12076
        packet.append(self.RequestedParameters.to_binary())
12077
        return b''.join(packet)
12078
12079
    @staticmethod
12080 1
    def from_binary(data):
12081
        return MonitoredItemModifyRequest(data)
12082
12083
    def _binary_init(self, data):
12084
        self.MonitoredItemId = uabin.Primitives.UInt32.unpack(data)
12085
        self.RequestedParameters = MonitoringParameters.from_binary(data)
12086
12087 1
    def __str__(self):
12088
        return 'MonitoredItemModifyRequest(' + 'MonitoredItemId:' + str(self.MonitoredItemId) + ', ' + \
12089
               'RequestedParameters:' + str(self.RequestedParameters) + ')'
12090
12091 1
    __repr__ = __str__
12092
12093
12094
class MonitoredItemModifyResult(FrozenClass):
12095
    '''
12096 1
    :ivar StatusCode:
12097
    :vartype StatusCode: StatusCode
12098
    :ivar RevisedSamplingInterval:
12099
    :vartype RevisedSamplingInterval: Double
12100
    :ivar RevisedQueueSize:
12101 1
    :vartype RevisedQueueSize: UInt32
12102
    :ivar FilterResult:
12103
    :vartype FilterResult: ExtensionObject
12104 1
    '''
12105
12106
    ua_types = (
12107
12108
        ('StatusCode', 'StatusCode'),
12109
        ('RevisedSamplingInterval', 'Double'),
12110
        ('RevisedQueueSize', 'UInt32'),
12111
        ('FilterResult', 'ExtensionObject'),
12112
               )
12113 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12114
    def __init__(self, binary=None):
12115
        if binary is not None:
12116 1
            self._binary_init(binary)
12117
            self._freeze = True
12118
            return
12119
        self.StatusCode = StatusCode()
12120
        self.RevisedSamplingInterval = 0
12121
        self.RevisedQueueSize = 0
12122
        self.FilterResult = None
12123 1
        self._freeze = True
12124
12125
    def to_binary(self):
12126
        packet = []
12127
        packet.append(self.StatusCode.to_binary())
12128
        packet.append(uabin.Primitives.Double.pack(self.RevisedSamplingInterval))
12129
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedQueueSize))
12130
        packet.append(extensionobject_to_binary(self.FilterResult))
12131
        return b''.join(packet)
12132
12133
    @staticmethod
12134 1
    def from_binary(data):
12135
        return MonitoredItemModifyResult(data)
12136
12137
    def _binary_init(self, data):
12138
        self.StatusCode = StatusCode.from_binary(data)
12139
        self.RevisedSamplingInterval = uabin.Primitives.Double.unpack(data)
12140
        self.RevisedQueueSize = uabin.Primitives.UInt32.unpack(data)
12141
        self.FilterResult = extensionobject_from_binary(data)
12142
12143
    def __str__(self):
12144
        return 'MonitoredItemModifyResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
12145
               'RevisedSamplingInterval:' + str(self.RevisedSamplingInterval) + ', ' + \
12146 1
               'RevisedQueueSize:' + str(self.RevisedQueueSize) + ', ' + \
12147
               'FilterResult:' + str(self.FilterResult) + ')'
12148
12149
    __repr__ = __str__
12150 1
12151
12152
class ModifyMonitoredItemsParameters(FrozenClass):
12153
    '''
12154
    :ivar SubscriptionId:
12155
    :vartype SubscriptionId: UInt32
12156 1
    :ivar TimestampsToReturn:
12157
    :vartype TimestampsToReturn: TimestampsToReturn
12158
    :ivar ItemsToModify:
12159
    :vartype ItemsToModify: MonitoredItemModifyRequest
12160
    '''
12161
12162 1
    ua_types = (
12163
12164
        ('SubscriptionId', 'UInt32'),
12165 1
        ('TimestampsToReturn', 'TimestampsToReturn'),
12166
        ('ItemsToModify', 'ListOfMonitoredItemModifyRequest'),
12167
               )
12168
12169
    def __init__(self, binary=None):
12170
        if binary is not None:
12171
            self._binary_init(binary)
12172
            self._freeze = True
12173
            return
12174
        self.SubscriptionId = 0
12175 1
        self.TimestampsToReturn = TimestampsToReturn(0)
12176
        self.ItemsToModify = []
12177
        self._freeze = True
12178
12179
    def to_binary(self):
12180
        packet = []
12181 1
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
12182
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
12183
        packet.append(uabin.Primitives.Int32.pack(len(self.ItemsToModify)))
12184
        for fieldname in self.ItemsToModify:
12185
            packet.append(fieldname.to_binary())
12186
        return b''.join(packet)
12187
12188
    @staticmethod
12189
    def from_binary(data):
12190
        return ModifyMonitoredItemsParameters(data)
12191 1
12192
    def _binary_init(self, data):
12193
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
12194
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
12195
        length = uabin.Primitives.Int32.unpack(data)
12196
        array = []
12197
        if length != -1:
12198 1
            for _ in range(0, length):
12199
                array.append(MonitoredItemModifyRequest.from_binary(data))
12200
        self.ItemsToModify = array
12201
12202 1
    def __str__(self):
12203
        return 'ModifyMonitoredItemsParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12204
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
12205
               'ItemsToModify:' + str(self.ItemsToModify) + ')'
12206
12207 1
    __repr__ = __str__
12208
12209
12210
class ModifyMonitoredItemsRequest(FrozenClass):
12211
    '''
12212 1
    :ivar TypeId:
12213
    :vartype TypeId: NodeId
12214
    :ivar RequestHeader:
12215 1
    :vartype RequestHeader: RequestHeader
12216
    :ivar Parameters:
12217
    :vartype Parameters: ModifyMonitoredItemsParameters
12218
    '''
12219
12220
    ua_types = (
12221
12222
        ('TypeId', 'NodeId'),
12223
        ('RequestHeader', 'RequestHeader'),
12224
        ('Parameters', 'ModifyMonitoredItemsParameters'),
12225
               )
12226
12227 1
    def __init__(self, binary=None):
12228
        if binary is not None:
12229
            self._binary_init(binary)
12230
            self._freeze = True
12231
            return
12232
        self.TypeId = FourByteNodeId(ObjectIds.ModifyMonitoredItemsRequest_Encoding_DefaultBinary)
12233
        self.RequestHeader = RequestHeader()
12234 1
        self.Parameters = ModifyMonitoredItemsParameters()
12235
        self._freeze = True
12236
12237
    def to_binary(self):
12238
        packet = []
12239
        packet.append(self.TypeId.to_binary())
12240
        packet.append(self.RequestHeader.to_binary())
12241
        packet.append(self.Parameters.to_binary())
12242
        return b''.join(packet)
12243
12244
    @staticmethod
12245 1
    def from_binary(data):
12246
        return ModifyMonitoredItemsRequest(data)
12247
12248
    def _binary_init(self, data):
12249
        self.TypeId = NodeId.from_binary(data)
12250
        self.RequestHeader = RequestHeader.from_binary(data)
12251
        self.Parameters = ModifyMonitoredItemsParameters.from_binary(data)
12252
12253
    def __str__(self):
12254
        return 'ModifyMonitoredItemsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12255
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12256
               'Parameters:' + str(self.Parameters) + ')'
12257
12258
    __repr__ = __str__
12259
12260
12261 1
class ModifyMonitoredItemsResponse(FrozenClass):
12262
    '''
12263
    :ivar TypeId:
12264
    :vartype TypeId: NodeId
12265 1 View Code Duplication
    :ivar ResponseHeader:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12266
    :vartype ResponseHeader: ResponseHeader
12267
    :ivar Results:
12268
    :vartype Results: MonitoredItemModifyResult
12269
    :ivar DiagnosticInfos:
12270
    :vartype DiagnosticInfos: DiagnosticInfo
12271
    '''
12272
12273
    ua_types = (
12274
12275
        ('TypeId', 'NodeId'),
12276
        ('ResponseHeader', 'ResponseHeader'),
12277
        ('Results', 'ListOfMonitoredItemModifyResult'),
12278
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
12279
               )
12280
12281
    def __init__(self, binary=None):
12282
        if binary is not None:
12283
            self._binary_init(binary)
12284
            self._freeze = True
12285
            return
12286
        self.TypeId = FourByteNodeId(ObjectIds.ModifyMonitoredItemsResponse_Encoding_DefaultBinary)
12287
        self.ResponseHeader = ResponseHeader()
12288
        self.Results = []
12289
        self.DiagnosticInfos = []
12290
        self._freeze = True
12291 1
12292
    def to_binary(self):
12293
        packet = []
12294
        packet.append(self.TypeId.to_binary())
12295
        packet.append(self.ResponseHeader.to_binary())
12296
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
12297 1
        for fieldname in self.Results:
12298
            packet.append(fieldname.to_binary())
12299
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
12300 1
        for fieldname in self.DiagnosticInfos:
12301
            packet.append(fieldname.to_binary())
12302
        return b''.join(packet)
12303
12304
    @staticmethod
12305
    def from_binary(data):
12306
        return ModifyMonitoredItemsResponse(data)
12307
12308
    def _binary_init(self, data):
12309
        self.TypeId = NodeId.from_binary(data)
12310 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
12311
        length = uabin.Primitives.Int32.unpack(data)
12312
        array = []
12313
        if length != -1:
12314
            for _ in range(0, length):
12315
                array.append(MonitoredItemModifyResult.from_binary(data))
12316 1
        self.Results = array
12317
        length = uabin.Primitives.Int32.unpack(data)
12318
        array = []
12319
        if length != -1:
12320
            for _ in range(0, length):
12321
                array.append(DiagnosticInfo.from_binary(data))
12322
        self.DiagnosticInfos = array
12323
12324
    def __str__(self):
12325
        return 'ModifyMonitoredItemsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12326 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12327
               'Results:' + str(self.Results) + ', ' + \
12328
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
12329
12330
    __repr__ = __str__
12331
12332
12333 1
class SetMonitoringModeParameters(FrozenClass):
12334
    '''
12335
    :ivar SubscriptionId:
12336
    :vartype SubscriptionId: UInt32
12337 1
    :ivar MonitoringMode:
12338
    :vartype MonitoringMode: MonitoringMode
12339
    :ivar MonitoredItemIds:
12340
    :vartype MonitoredItemIds: UInt32
12341
    '''
12342 1
12343
    ua_types = (
12344
12345
        ('SubscriptionId', 'UInt32'),
12346
        ('MonitoringMode', 'MonitoringMode'),
12347 1
        ('MonitoredItemIds', 'ListOfUInt32'),
12348
               )
12349
12350 1
    def __init__(self, binary=None):
12351
        if binary is not None:
12352
            self._binary_init(binary)
12353
            self._freeze = True
12354
            return
12355
        self.SubscriptionId = 0
12356
        self.MonitoringMode = MonitoringMode(0)
12357
        self.MonitoredItemIds = []
12358 1
        self._freeze = True
12359
12360
    def to_binary(self):
12361
        packet = []
12362
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
12363 1
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoringMode.value))
12364 1
        packet.append(uabin.Primitives.Int32.pack(len(self.MonitoredItemIds)))
12365 1
        for fieldname in self.MonitoredItemIds:
12366 1
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
12367 1
        return b''.join(packet)
12368 1
12369 1
    @staticmethod
12370 1
    def from_binary(data):
12371
        return SetMonitoringModeParameters(data)
12372 1
12373 1
    def _binary_init(self, data):
12374 1
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
12375 1
        self.MonitoringMode = MonitoringMode(uabin.Primitives.UInt32.unpack(data))
12376 1
        self.MonitoredItemIds = uabin.Primitives.UInt32.unpack_array(data)
12377 1
12378 1
    def __str__(self):
12379
        return 'SetMonitoringModeParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12380 1
               'MonitoringMode:' + str(self.MonitoringMode) + ', ' + \
12381
               'MonitoredItemIds:' + str(self.MonitoredItemIds) + ')'
12382 1
12383
    __repr__ = __str__
12384 1
12385 1
12386 1
class SetMonitoringModeRequest(FrozenClass):
12387
    '''
12388 1
    :ivar TypeId:
12389
    :vartype TypeId: NodeId
12390
    :ivar RequestHeader:
12391
    :vartype RequestHeader: RequestHeader
12392 1
    :ivar Parameters:
12393
    :vartype Parameters: SetMonitoringModeParameters
12394
    '''
12395 1
12396
    ua_types = (
12397
12398
        ('TypeId', 'NodeId'),
12399
        ('RequestHeader', 'RequestHeader'),
12400
        ('Parameters', 'SetMonitoringModeParameters'),
12401
               )
12402
12403
    def __init__(self, binary=None):
12404
        if binary is not None:
12405 1
            self._binary_init(binary)
12406
            self._freeze = True
12407
            return
12408
        self.TypeId = FourByteNodeId(ObjectIds.SetMonitoringModeRequest_Encoding_DefaultBinary)
12409
        self.RequestHeader = RequestHeader()
12410
        self.Parameters = SetMonitoringModeParameters()
12411 1
        self._freeze = True
12412 1
12413
    def to_binary(self):
12414
        packet = []
12415
        packet.append(self.TypeId.to_binary())
12416 1
        packet.append(self.RequestHeader.to_binary())
12417 1
        packet.append(self.Parameters.to_binary())
12418 1
        return b''.join(packet)
12419 1
12420
    @staticmethod
12421 1
    def from_binary(data):
12422 1
        return SetMonitoringModeRequest(data)
12423 1
12424 1
    def _binary_init(self, data):
12425 1
        self.TypeId = NodeId.from_binary(data)
12426 1
        self.RequestHeader = RequestHeader.from_binary(data)
12427
        self.Parameters = SetMonitoringModeParameters.from_binary(data)
12428 1
12429
    def __str__(self):
12430
        return 'SetMonitoringModeRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12431
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12432 1
               'Parameters:' + str(self.Parameters) + ')'
12433
12434
    __repr__ = __str__
12435
12436
12437 1
class SetMonitoringModeResult(FrozenClass):
12438
    '''
12439
    :ivar Results:
12440
    :vartype Results: StatusCode
12441
    :ivar DiagnosticInfos:
12442 1
    :vartype DiagnosticInfos: DiagnosticInfo
12443
    '''
12444
12445 1
    ua_types = (
12446
12447
        ('Results', 'ListOfStatusCode'),
12448
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
12449
               )
12450
12451
    def __init__(self, binary=None):
12452
        if binary is not None:
12453
            self._binary_init(binary)
12454 View Code Duplication
            self._freeze = True
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12455
            return
12456
        self.Results = []
12457 1
        self.DiagnosticInfos = []
12458
        self._freeze = True
12459
12460
    def to_binary(self):
12461
        packet = []
12462
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
12463
        for fieldname in self.Results:
12464 1
            packet.append(fieldname.to_binary())
12465 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
12466 1
        for fieldname in self.DiagnosticInfos:
12467 1
            packet.append(fieldname.to_binary())
12468 1
        return b''.join(packet)
12469 1
12470 1
    @staticmethod
12471 1
    def from_binary(data):
12472 1
        return SetMonitoringModeResult(data)
12473 1
12474
    def _binary_init(self, data):
12475 1
        length = uabin.Primitives.Int32.unpack(data)
12476 1
        array = []
12477 1
        if length != -1:
12478 1
            for _ in range(0, length):
12479 1
                array.append(StatusCode.from_binary(data))
12480 1
        self.Results = array
12481 1
        length = uabin.Primitives.Int32.unpack(data)
12482 1
        array = []
12483 1
        if length != -1:
12484
            for _ in range(0, length):
12485 1
                array.append(DiagnosticInfo.from_binary(data))
12486
        self.DiagnosticInfos = array
12487 1
12488
    def __str__(self):
12489 1
        return 'SetMonitoringModeResult(' + 'Results:' + str(self.Results) + ', ' + \
12490
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
12491 1
12492 1
    __repr__ = __str__
12493 1
12494 1
12495 1
class SetMonitoringModeResponse(FrozenClass):
12496 1
    '''
12497 1
    :ivar TypeId:
12498 1
    :vartype TypeId: NodeId
12499 1
    :ivar ResponseHeader:
12500 1
    :vartype ResponseHeader: ResponseHeader
12501 1
    :ivar Parameters:
12502 1
    :vartype Parameters: SetMonitoringModeResult
12503 1
    '''
12504
12505 1
    ua_types = (
12506
12507 1
        ('TypeId', 'NodeId'),
12508
        ('ResponseHeader', 'ResponseHeader'),
12509
        ('Parameters', 'SetMonitoringModeResult'),
12510
               )
12511
12512
    def __init__(self, binary=None):
12513 1
        if binary is not None:
12514
            self._binary_init(binary)
12515
            self._freeze = True
12516 1
            return
12517
        self.TypeId = FourByteNodeId(ObjectIds.SetMonitoringModeResponse_Encoding_DefaultBinary)
12518
        self.ResponseHeader = ResponseHeader()
12519
        self.Parameters = SetMonitoringModeResult()
12520
        self._freeze = True
12521
12522
    def to_binary(self):
12523
        packet = []
12524
        packet.append(self.TypeId.to_binary())
12525
        packet.append(self.ResponseHeader.to_binary())
12526
        packet.append(self.Parameters.to_binary())
12527
        return b''.join(packet)
12528
12529
    @staticmethod
12530
    def from_binary(data):
12531
        return SetMonitoringModeResponse(data)
12532 1
12533
    def _binary_init(self, data):
12534
        self.TypeId = NodeId.from_binary(data)
12535
        self.ResponseHeader = ResponseHeader.from_binary(data)
12536
        self.Parameters = SetMonitoringModeResult.from_binary(data)
12537
12538
    def __str__(self):
12539
        return 'SetMonitoringModeResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12540
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12541 1
               'Parameters:' + str(self.Parameters) + ')'
12542 1
12543 1
    __repr__ = __str__
12544 1
12545 1
12546 1
class SetTriggeringParameters(FrozenClass):
12547 1
    '''
12548 1
    :ivar SubscriptionId:
12549 1
    :vartype SubscriptionId: UInt32
12550 1
    :ivar TriggeringItemId:
12551 1
    :vartype TriggeringItemId: UInt32
12552 1
    :ivar LinksToAdd:
12553
    :vartype LinksToAdd: UInt32
12554 1
    :ivar LinksToRemove:
12555 1
    :vartype LinksToRemove: UInt32
12556 1
    '''
12557 1
12558 1
    ua_types = (
12559 1
12560 1
        ('SubscriptionId', 'UInt32'),
12561 1
        ('TriggeringItemId', 'UInt32'),
12562 1
        ('LinksToAdd', 'ListOfUInt32'),
12563
        ('LinksToRemove', 'ListOfUInt32'),
12564 1
               )
12565
12566 1
    def __init__(self, binary=None):
12567
        if binary is not None:
12568 1
            self._binary_init(binary)
12569 1
            self._freeze = True
12570 1
            return
12571 1
        self.SubscriptionId = 0
12572 1
        self.TriggeringItemId = 0
12573 1
        self.LinksToAdd = []
12574 1
        self.LinksToRemove = []
12575
        self._freeze = True
12576 1
12577
    def to_binary(self):
12578
        packet = []
12579
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
12580
        packet.append(uabin.Primitives.UInt32.pack(self.TriggeringItemId))
12581
        packet.append(uabin.Primitives.Int32.pack(len(self.LinksToAdd)))
12582
        for fieldname in self.LinksToAdd:
12583
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
12584 1
        packet.append(uabin.Primitives.Int32.pack(len(self.LinksToRemove)))
12585
        for fieldname in self.LinksToRemove:
12586
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
12587 1
        return b''.join(packet)
12588
12589
    @staticmethod
12590
    def from_binary(data):
12591
        return SetTriggeringParameters(data)
12592
12593
    def _binary_init(self, data):
12594
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
12595
        self.TriggeringItemId = uabin.Primitives.UInt32.unpack(data)
12596
        self.LinksToAdd = uabin.Primitives.UInt32.unpack_array(data)
12597 1
        self.LinksToRemove = uabin.Primitives.UInt32.unpack_array(data)
12598
12599
    def __str__(self):
12600
        return 'SetTriggeringParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12601
               'TriggeringItemId:' + str(self.TriggeringItemId) + ', ' + \
12602
               'LinksToAdd:' + str(self.LinksToAdd) + ', ' + \
12603 1
               'LinksToRemove:' + str(self.LinksToRemove) + ')'
12604 1
12605
    __repr__ = __str__
12606
12607
12608 1
class SetTriggeringRequest(FrozenClass):
12609 1
    '''
12610 1
    :ivar TypeId:
12611 1
    :vartype TypeId: NodeId
12612
    :ivar RequestHeader:
12613 1
    :vartype RequestHeader: RequestHeader
12614 1
    :ivar Parameters:
12615 1
    :vartype Parameters: SetTriggeringParameters
12616 1
    '''
12617 1
12618 1
    ua_types = (
12619
12620 1
        ('TypeId', 'NodeId'),
12621
        ('RequestHeader', 'RequestHeader'),
12622
        ('Parameters', 'SetTriggeringParameters'),
12623
               )
12624 1
12625
    def __init__(self, binary=None):
12626
        if binary is not None:
12627
            self._binary_init(binary)
12628
            self._freeze = True
12629 1
            return
12630
        self.TypeId = FourByteNodeId(ObjectIds.SetTriggeringRequest_Encoding_DefaultBinary)
12631
        self.RequestHeader = RequestHeader()
12632
        self.Parameters = SetTriggeringParameters()
12633
        self._freeze = True
12634 1
12635
    def to_binary(self):
12636
        packet = []
12637 1
        packet.append(self.TypeId.to_binary())
12638
        packet.append(self.RequestHeader.to_binary())
12639
        packet.append(self.Parameters.to_binary())
12640
        return b''.join(packet)
12641
12642
    @staticmethod
12643
    def from_binary(data):
12644
        return SetTriggeringRequest(data)
12645
12646
    def _binary_init(self, data):
12647
        self.TypeId = NodeId.from_binary(data)
12648
        self.RequestHeader = RequestHeader.from_binary(data)
12649 1
        self.Parameters = SetTriggeringParameters.from_binary(data)
12650
12651
    def __str__(self):
12652
        return 'SetTriggeringRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12653
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12654
               'Parameters:' + str(self.Parameters) + ')'
12655
12656 1
    __repr__ = __str__
12657 1
12658 1
12659 1
class SetTriggeringResult(FrozenClass):
12660 1
    '''
12661 1
    :ivar AddResults:
12662 1
    :vartype AddResults: StatusCode
12663 1
    :ivar AddDiagnosticInfos:
12664 1
    :vartype AddDiagnosticInfos: DiagnosticInfo
12665 1
    :ivar RemoveResults:
12666
    :vartype RemoveResults: StatusCode
12667 1
    :ivar RemoveDiagnosticInfos:
12668 1
    :vartype RemoveDiagnosticInfos: DiagnosticInfo
12669 1
    '''
12670 1
12671 1
    ua_types = (
12672 1
12673 1
        ('AddResults', 'ListOfStatusCode'),
12674
        ('AddDiagnosticInfos', 'ListOfDiagnosticInfo'),
12675 1
        ('RemoveResults', 'ListOfStatusCode'),
12676
        ('RemoveDiagnosticInfos', 'ListOfDiagnosticInfo'),
12677 1
               )
12678
12679 1
    def __init__(self, binary=None):
12680 1
        if binary is not None:
12681 1
            self._binary_init(binary)
12682 1
            self._freeze = True
12683 1
            return
12684
        self.AddResults = []
12685 1
        self.AddDiagnosticInfos = []
12686
        self.RemoveResults = []
12687
        self.RemoveDiagnosticInfos = []
12688
        self._freeze = True
12689
12690
    def to_binary(self):
12691 1
        packet = []
12692
        packet.append(uabin.Primitives.Int32.pack(len(self.AddResults)))
12693
        for fieldname in self.AddResults:
12694 1
            packet.append(fieldname.to_binary())
12695
        packet.append(uabin.Primitives.Int32.pack(len(self.AddDiagnosticInfos)))
12696
        for fieldname in self.AddDiagnosticInfos:
12697
            packet.append(fieldname.to_binary())
12698
        packet.append(uabin.Primitives.Int32.pack(len(self.RemoveResults)))
12699
        for fieldname in self.RemoveResults:
12700
            packet.append(fieldname.to_binary())
12701
        packet.append(uabin.Primitives.Int32.pack(len(self.RemoveDiagnosticInfos)))
12702
        for fieldname in self.RemoveDiagnosticInfos:
12703
            packet.append(fieldname.to_binary())
12704 1
        return b''.join(packet)
12705
12706
    @staticmethod
12707
    def from_binary(data):
12708
        return SetTriggeringResult(data)
12709
12710 1
    def _binary_init(self, data):
12711 1
        length = uabin.Primitives.Int32.unpack(data)
12712 1
        array = []
12713 1
        if length != -1:
12714 1
            for _ in range(0, length):
12715 1
                array.append(StatusCode.from_binary(data))
12716 1
        self.AddResults = array
12717 1
        length = uabin.Primitives.Int32.unpack(data)
12718 1
        array = []
12719
        if length != -1:
12720 1
            for _ in range(0, length):
12721 1
                array.append(DiagnosticInfo.from_binary(data))
12722 1
        self.AddDiagnosticInfos = array
12723 1
        length = uabin.Primitives.Int32.unpack(data)
12724 1
        array = []
12725 1
        if length != -1:
12726
            for _ in range(0, length):
12727 1
                array.append(StatusCode.from_binary(data))
12728
        self.RemoveResults = array
12729 1
        length = uabin.Primitives.Int32.unpack(data)
12730
        array = []
12731 1
        if length != -1:
12732 1
            for _ in range(0, length):
12733 1
                array.append(DiagnosticInfo.from_binary(data))
12734 1
        self.RemoveDiagnosticInfos = array
12735
12736 1
    def __str__(self):
12737
        return 'SetTriggeringResult(' + 'AddResults:' + str(self.AddResults) + ', ' + \
12738
               'AddDiagnosticInfos:' + str(self.AddDiagnosticInfos) + ', ' + \
12739
               'RemoveResults:' + str(self.RemoveResults) + ', ' + \
12740
               'RemoveDiagnosticInfos:' + str(self.RemoveDiagnosticInfos) + ')'
12741 1
12742
    __repr__ = __str__
12743
12744 1
12745
class SetTriggeringResponse(FrozenClass):
12746
    '''
12747
    :ivar TypeId:
12748
    :vartype TypeId: NodeId
12749
    :ivar ResponseHeader:
12750
    :vartype ResponseHeader: ResponseHeader
12751
    :ivar Parameters:
12752
    :vartype Parameters: SetTriggeringResult
12753
    '''
12754
12755
    ua_types = (
12756
12757
        ('TypeId', 'NodeId'),
12758
        ('ResponseHeader', 'ResponseHeader'),
12759
        ('Parameters', 'SetTriggeringResult'),
12760 1
               )
12761
12762
    def __init__(self, binary=None):
12763
        if binary is not None:
12764
            self._binary_init(binary)
12765
            self._freeze = True
12766
            return
12767
        self.TypeId = FourByteNodeId(ObjectIds.SetTriggeringResponse_Encoding_DefaultBinary)
12768
        self.ResponseHeader = ResponseHeader()
12769 1
        self.Parameters = SetTriggeringResult()
12770
        self._freeze = True
12771
12772
    def to_binary(self):
12773
        packet = []
12774
        packet.append(self.TypeId.to_binary())
12775
        packet.append(self.ResponseHeader.to_binary())
12776
        packet.append(self.Parameters.to_binary())
12777
        return b''.join(packet)
12778
12779
    @staticmethod
12780
    def from_binary(data):
12781
        return SetTriggeringResponse(data)
12782 1
12783
    def _binary_init(self, data):
12784
        self.TypeId = NodeId.from_binary(data)
12785
        self.ResponseHeader = ResponseHeader.from_binary(data)
12786
        self.Parameters = SetTriggeringResult.from_binary(data)
12787
12788
    def __str__(self):
12789
        return 'SetTriggeringResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12790
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12791
               'Parameters:' + str(self.Parameters) + ')'
12792 1
12793
    __repr__ = __str__
12794
12795
12796 1
class DeleteMonitoredItemsParameters(FrozenClass):
12797
    '''
12798
    :ivar SubscriptionId:
12799
    :vartype SubscriptionId: UInt32
12800
    :ivar MonitoredItemIds:
12801
    :vartype MonitoredItemIds: UInt32
12802
    '''
12803
12804 1
    ua_types = (
12805
12806
        ('SubscriptionId', 'UInt32'),
12807
        ('MonitoredItemIds', 'ListOfUInt32'),
12808
               )
12809
12810
    def __init__(self, binary=None):
12811
        if binary is not None:
12812 1
            self._binary_init(binary)
12813
            self._freeze = True
12814
            return
12815 1
        self.SubscriptionId = 0
12816
        self.MonitoredItemIds = []
12817
        self._freeze = True
12818
12819
    def to_binary(self):
12820
        packet = []
12821
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
12822
        packet.append(uabin.Primitives.Int32.pack(len(self.MonitoredItemIds)))
12823
        for fieldname in self.MonitoredItemIds:
12824
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
12825 1
        return b''.join(packet)
12826
12827
    @staticmethod
12828
    def from_binary(data):
12829
        return DeleteMonitoredItemsParameters(data)
12830
12831 1
    def _binary_init(self, data):
12832
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
12833
        self.MonitoredItemIds = uabin.Primitives.UInt32.unpack_array(data)
12834
12835
    def __str__(self):
12836
        return 'DeleteMonitoredItemsParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12837
               'MonitoredItemIds:' + str(self.MonitoredItemIds) + ')'
12838
12839
    __repr__ = __str__
12840
12841 1
12842
class DeleteMonitoredItemsRequest(FrozenClass):
12843
    '''
12844
    :ivar TypeId:
12845
    :vartype TypeId: NodeId
12846
    :ivar RequestHeader:
12847
    :vartype RequestHeader: RequestHeader
12848 1
    :ivar Parameters:
12849
    :vartype Parameters: DeleteMonitoredItemsParameters
12850
    '''
12851
12852 1
    ua_types = (
12853
12854
        ('TypeId', 'NodeId'),
12855
        ('RequestHeader', 'RequestHeader'),
12856
        ('Parameters', 'DeleteMonitoredItemsParameters'),
12857 1
               )
12858
12859
    def __init__(self, binary=None):
12860
        if binary is not None:
12861
            self._binary_init(binary)
12862 1
            self._freeze = True
12863
            return
12864
        self.TypeId = FourByteNodeId(ObjectIds.DeleteMonitoredItemsRequest_Encoding_DefaultBinary)
12865 1
        self.RequestHeader = RequestHeader()
12866
        self.Parameters = DeleteMonitoredItemsParameters()
12867
        self._freeze = True
12868
12869
    def to_binary(self):
12870
        packet = []
12871
        packet.append(self.TypeId.to_binary())
12872
        packet.append(self.RequestHeader.to_binary())
12873
        packet.append(self.Parameters.to_binary())
12874
        return b''.join(packet)
12875 1
12876
    @staticmethod
12877
    def from_binary(data):
12878
        return DeleteMonitoredItemsRequest(data)
12879
12880
    def _binary_init(self, data):
12881 1
        self.TypeId = NodeId.from_binary(data)
12882
        self.RequestHeader = RequestHeader.from_binary(data)
12883
        self.Parameters = DeleteMonitoredItemsParameters.from_binary(data)
12884
12885
    def __str__(self):
12886
        return 'DeleteMonitoredItemsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12887
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12888
               'Parameters:' + str(self.Parameters) + ')'
12889
12890
    __repr__ = __str__
12891 1
12892
12893
class DeleteMonitoredItemsResponse(FrozenClass):
12894
    '''
12895
    :ivar TypeId:
12896
    :vartype TypeId: NodeId
12897
    :ivar ResponseHeader:
12898 1
    :vartype ResponseHeader: ResponseHeader
12899
    :ivar Results:
12900
    :vartype Results: StatusCode
12901
    :ivar DiagnosticInfos:
12902 1
    :vartype DiagnosticInfos: DiagnosticInfo
12903
    '''
12904
12905
    ua_types = (
12906
12907 1
        ('TypeId', 'NodeId'),
12908
        ('ResponseHeader', 'ResponseHeader'),
12909
        ('Results', 'ListOfStatusCode'),
12910
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
12911
               )
12912 1
12913
    def __init__(self, binary=None):
12914
        if binary is not None:
12915 1
            self._binary_init(binary)
12916
            self._freeze = True
12917
            return
12918
        self.TypeId = FourByteNodeId(ObjectIds.DeleteMonitoredItemsResponse_Encoding_DefaultBinary)
12919
        self.ResponseHeader = ResponseHeader()
12920
        self.Results = []
12921
        self.DiagnosticInfos = []
12922
        self._freeze = True
12923
12924
    def to_binary(self):
12925 1
        packet = []
12926
        packet.append(self.TypeId.to_binary())
12927
        packet.append(self.ResponseHeader.to_binary())
12928
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
12929
        for fieldname in self.Results:
12930
            packet.append(fieldname.to_binary())
12931 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
12932
        for fieldname in self.DiagnosticInfos:
12933
            packet.append(fieldname.to_binary())
12934
        return b''.join(packet)
12935
12936
    @staticmethod
12937
    def from_binary(data):
12938
        return DeleteMonitoredItemsResponse(data)
12939
12940
    def _binary_init(self, data):
12941 1
        self.TypeId = NodeId.from_binary(data)
12942
        self.ResponseHeader = ResponseHeader.from_binary(data)
12943
        length = uabin.Primitives.Int32.unpack(data)
12944
        array = []
12945
        if length != -1:
12946
            for _ in range(0, length):
12947
                array.append(StatusCode.from_binary(data))
12948 1
        self.Results = array
12949
        length = uabin.Primitives.Int32.unpack(data)
12950
        array = []
12951
        if length != -1:
12952 1
            for _ in range(0, length):
12953
                array.append(DiagnosticInfo.from_binary(data))
12954
        self.DiagnosticInfos = array
12955
12956
    def __str__(self):
12957 1
        return 'DeleteMonitoredItemsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12958
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12959
               'Results:' + str(self.Results) + ', ' + \
12960
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
12961
12962 1
    __repr__ = __str__
12963
12964
12965 1
class CreateSubscriptionParameters(FrozenClass):
12966
    '''
12967
    :ivar RequestedPublishingInterval:
12968
    :vartype RequestedPublishingInterval: Double
12969
    :ivar RequestedLifetimeCount:
12970
    :vartype RequestedLifetimeCount: UInt32
12971
    :ivar RequestedMaxKeepAliveCount:
12972
    :vartype RequestedMaxKeepAliveCount: UInt32
12973 1
    :ivar MaxNotificationsPerPublish:
12974
    :vartype MaxNotificationsPerPublish: UInt32
12975
    :ivar PublishingEnabled:
12976
    :vartype PublishingEnabled: Boolean
12977
    :ivar Priority:
12978 1
    :vartype Priority: Byte
12979
    '''
12980
12981
    ua_types = (
12982
12983
        ('RequestedPublishingInterval', 'Double'),
12984
        ('RequestedLifetimeCount', 'UInt32'),
12985
        ('RequestedMaxKeepAliveCount', 'UInt32'),
12986
        ('MaxNotificationsPerPublish', 'UInt32'),
12987 1
        ('PublishingEnabled', 'Boolean'),
12988
        ('Priority', 'Byte'),
12989
               )
12990
12991
    def __init__(self, binary=None):
12992
        if binary is not None:
12993
            self._binary_init(binary)
12994
            self._freeze = True
12995 1
            return
12996
        self.RequestedPublishingInterval = 0
12997
        self.RequestedLifetimeCount = 0
12998
        self.RequestedMaxKeepAliveCount = 0
12999 1
        self.MaxNotificationsPerPublish = 0
13000
        self.PublishingEnabled = True
13001
        self.Priority = 0
13002
        self._freeze = True
13003 1
13004
    def to_binary(self):
13005
        packet = []
13006
        packet.append(uabin.Primitives.Double.pack(self.RequestedPublishingInterval))
13007 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedLifetimeCount))
13008
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedMaxKeepAliveCount))
13009
        packet.append(uabin.Primitives.UInt32.pack(self.MaxNotificationsPerPublish))
13010 1
        packet.append(uabin.Primitives.Boolean.pack(self.PublishingEnabled))
13011
        packet.append(uabin.Primitives.Byte.pack(self.Priority))
13012
        return b''.join(packet)
13013
13014
    @staticmethod
13015
    def from_binary(data):
13016
        return CreateSubscriptionParameters(data)
13017
13018
    def _binary_init(self, data):
13019
        self.RequestedPublishingInterval = uabin.Primitives.Double.unpack(data)
13020 1
        self.RequestedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
13021
        self.RequestedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
13022
        self.MaxNotificationsPerPublish = uabin.Primitives.UInt32.unpack(data)
13023
        self.PublishingEnabled = uabin.Primitives.Boolean.unpack(data)
13024
        self.Priority = uabin.Primitives.Byte.unpack(data)
13025
13026 1
    def __str__(self):
13027
        return 'CreateSubscriptionParameters(' + 'RequestedPublishingInterval:' + str(self.RequestedPublishingInterval) + ', ' + \
13028
               'RequestedLifetimeCount:' + str(self.RequestedLifetimeCount) + ', ' + \
13029
               'RequestedMaxKeepAliveCount:' + str(self.RequestedMaxKeepAliveCount) + ', ' + \
13030
               'MaxNotificationsPerPublish:' + str(self.MaxNotificationsPerPublish) + ', ' + \
13031
               'PublishingEnabled:' + str(self.PublishingEnabled) + ', ' + \
13032
               'Priority:' + str(self.Priority) + ')'
13033
13034
    __repr__ = __str__
13035
13036 1
13037
class CreateSubscriptionRequest(FrozenClass):
13038
    '''
13039
    :ivar TypeId:
13040
    :vartype TypeId: NodeId
13041
    :ivar RequestHeader:
13042
    :vartype RequestHeader: RequestHeader
13043 1
    :ivar Parameters:
13044
    :vartype Parameters: CreateSubscriptionParameters
13045
    '''
13046
13047 1
    ua_types = (
13048
13049
        ('TypeId', 'NodeId'),
13050
        ('RequestHeader', 'RequestHeader'),
13051
        ('Parameters', 'CreateSubscriptionParameters'),
13052 1
               )
13053
13054
    def __init__(self, binary=None):
13055
        if binary is not None:
13056
            self._binary_init(binary)
13057 1
            self._freeze = True
13058
            return
13059
        self.TypeId = FourByteNodeId(ObjectIds.CreateSubscriptionRequest_Encoding_DefaultBinary)
13060 1
        self.RequestHeader = RequestHeader()
13061
        self.Parameters = CreateSubscriptionParameters()
13062
        self._freeze = True
13063
13064
    def to_binary(self):
13065
        packet = []
13066
        packet.append(self.TypeId.to_binary())
13067
        packet.append(self.RequestHeader.to_binary())
13068 1
        packet.append(self.Parameters.to_binary())
13069
        return b''.join(packet)
13070
13071
    @staticmethod
13072
    def from_binary(data):
13073 1
        return CreateSubscriptionRequest(data)
13074
13075
    def _binary_init(self, data):
13076
        self.TypeId = NodeId.from_binary(data)
13077
        self.RequestHeader = RequestHeader.from_binary(data)
13078
        self.Parameters = CreateSubscriptionParameters.from_binary(data)
13079
13080
    def __str__(self):
13081
        return 'CreateSubscriptionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13082 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
13083
               'Parameters:' + str(self.Parameters) + ')'
13084
13085
    __repr__ = __str__
13086
13087
13088
class CreateSubscriptionResult(FrozenClass):
13089
    '''
13090
    :ivar SubscriptionId:
13091
    :vartype SubscriptionId: UInt32
13092 1
    :ivar RevisedPublishingInterval:
13093
    :vartype RevisedPublishingInterval: Double
13094
    :ivar RevisedLifetimeCount:
13095
    :vartype RevisedLifetimeCount: UInt32
13096 1
    :ivar RevisedMaxKeepAliveCount:
13097
    :vartype RevisedMaxKeepAliveCount: UInt32
13098
    '''
13099
13100
    ua_types = (
13101
13102
        ('SubscriptionId', 'UInt32'),
13103
        ('RevisedPublishingInterval', 'Double'),
13104
        ('RevisedLifetimeCount', 'UInt32'),
13105
        ('RevisedMaxKeepAliveCount', 'UInt32'),
13106
               )
13107
13108
    def __init__(self, binary=None):
13109
        if binary is not None:
13110 1
            self._binary_init(binary)
13111
            self._freeze = True
13112
            return
13113
        self.SubscriptionId = 0
13114 1
        self.RevisedPublishingInterval = 0
13115
        self.RevisedLifetimeCount = 0
13116
        self.RevisedMaxKeepAliveCount = 0
13117 1
        self._freeze = True
13118
13119
    def to_binary(self):
13120
        packet = []
13121
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
13122
        packet.append(uabin.Primitives.Double.pack(self.RevisedPublishingInterval))
13123
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedLifetimeCount))
13124
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedMaxKeepAliveCount))
13125
        return b''.join(packet)
13126
13127 1
    @staticmethod
13128
    def from_binary(data):
13129
        return CreateSubscriptionResult(data)
13130
13131
    def _binary_init(self, data):
13132
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
13133 1
        self.RevisedPublishingInterval = uabin.Primitives.Double.unpack(data)
13134
        self.RevisedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
13135
        self.RevisedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
13136
13137
    def __str__(self):
13138
        return 'CreateSubscriptionResult(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
13139
               'RevisedPublishingInterval:' + str(self.RevisedPublishingInterval) + ', ' + \
13140
               'RevisedLifetimeCount:' + str(self.RevisedLifetimeCount) + ', ' + \
13141
               'RevisedMaxKeepAliveCount:' + str(self.RevisedMaxKeepAliveCount) + ')'
13142
13143 1
    __repr__ = __str__
13144
13145
13146
class CreateSubscriptionResponse(FrozenClass):
13147
    '''
13148
    :ivar TypeId:
13149
    :vartype TypeId: NodeId
13150 1
    :ivar ResponseHeader:
13151
    :vartype ResponseHeader: ResponseHeader
13152
    :ivar Parameters:
13153
    :vartype Parameters: CreateSubscriptionResult
13154 1
    '''
13155
13156
    ua_types = (
13157
13158
        ('TypeId', 'NodeId'),
13159 1
        ('ResponseHeader', 'ResponseHeader'),
13160
        ('Parameters', 'CreateSubscriptionResult'),
13161
               )
13162
13163
    def __init__(self, binary=None):
13164 1
        if binary is not None:
13165
            self._binary_init(binary)
13166
            self._freeze = True
13167 1
            return
13168
        self.TypeId = FourByteNodeId(ObjectIds.CreateSubscriptionResponse_Encoding_DefaultBinary)
13169
        self.ResponseHeader = ResponseHeader()
13170
        self.Parameters = CreateSubscriptionResult()
13171
        self._freeze = True
13172
13173
    def to_binary(self):
13174
        packet = []
13175
        packet.append(self.TypeId.to_binary())
13176
        packet.append(self.ResponseHeader.to_binary())
13177 1
        packet.append(self.Parameters.to_binary())
13178
        return b''.join(packet)
13179
13180
    @staticmethod
13181
    def from_binary(data):
13182
        return CreateSubscriptionResponse(data)
13183 1
13184 1
    def _binary_init(self, data):
13185 1
        self.TypeId = NodeId.from_binary(data)
13186 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
13187 1
        self.Parameters = CreateSubscriptionResult.from_binary(data)
13188 1
13189 1
    def __str__(self):
13190 1
        return 'CreateSubscriptionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13191 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
13192
               'Parameters:' + str(self.Parameters) + ')'
13193 1
13194 1
    __repr__ = __str__
13195 1
13196 1
13197 1
class ModifySubscriptionParameters(FrozenClass):
13198 1
    '''
13199 1
    :ivar SubscriptionId:
13200 1
    :vartype SubscriptionId: UInt32
13201
    :ivar RequestedPublishingInterval:
13202 1
    :vartype RequestedPublishingInterval: Double
13203
    :ivar RequestedLifetimeCount:
13204 1
    :vartype RequestedLifetimeCount: UInt32
13205
    :ivar RequestedMaxKeepAliveCount:
13206 1
    :vartype RequestedMaxKeepAliveCount: UInt32
13207 1
    :ivar MaxNotificationsPerPublish:
13208 1
    :vartype MaxNotificationsPerPublish: UInt32
13209 1
    :ivar Priority:
13210 1
    :vartype Priority: Byte
13211 1
    '''
13212 1
13213 1
    ua_types = (
13214 1
13215
        ('SubscriptionId', 'UInt32'),
13216 1
        ('RequestedPublishingInterval', 'Double'),
13217
        ('RequestedLifetimeCount', 'UInt32'),
13218
        ('RequestedMaxKeepAliveCount', 'UInt32'),
13219
        ('MaxNotificationsPerPublish', 'UInt32'),
13220
        ('Priority', 'Byte'),
13221 1
               )
13222
13223
    def __init__(self, binary=None):
13224 1
        if binary is not None:
13225
            self._binary_init(binary)
13226
            self._freeze = True
13227
            return
13228 1
        self.SubscriptionId = 0
13229
        self.RequestedPublishingInterval = 0
13230
        self.RequestedLifetimeCount = 0
13231 1
        self.RequestedMaxKeepAliveCount = 0
13232
        self.MaxNotificationsPerPublish = 0
13233 View Code Duplication
        self.Priority = 0
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13234
        self._freeze = True
13235
13236
    def to_binary(self):
13237
        packet = []
13238 1
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
13239
        packet.append(uabin.Primitives.Double.pack(self.RequestedPublishingInterval))
13240
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedLifetimeCount))
13241
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedMaxKeepAliveCount))
13242 1
        packet.append(uabin.Primitives.UInt32.pack(self.MaxNotificationsPerPublish))
13243
        packet.append(uabin.Primitives.Byte.pack(self.Priority))
13244
        return b''.join(packet)
13245
13246 1
    @staticmethod
13247
    def from_binary(data):
13248
        return ModifySubscriptionParameters(data)
13249 1
13250
    def _binary_init(self, data):
13251
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
13252 1
        self.RequestedPublishingInterval = uabin.Primitives.Double.unpack(data)
13253
        self.RequestedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
13254
        self.RequestedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
13255 1
        self.MaxNotificationsPerPublish = uabin.Primitives.UInt32.unpack(data)
13256
        self.Priority = uabin.Primitives.Byte.unpack(data)
13257
13258
    def __str__(self):
13259
        return 'ModifySubscriptionParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
13260
               'RequestedPublishingInterval:' + str(self.RequestedPublishingInterval) + ', ' + \
13261
               'RequestedLifetimeCount:' + str(self.RequestedLifetimeCount) + ', ' + \
13262
               'RequestedMaxKeepAliveCount:' + str(self.RequestedMaxKeepAliveCount) + ', ' + \
13263 1
               'MaxNotificationsPerPublish:' + str(self.MaxNotificationsPerPublish) + ', ' + \
13264
               'Priority:' + str(self.Priority) + ')'
13265
13266
    __repr__ = __str__
13267
13268 1
13269 1
class ModifySubscriptionRequest(FrozenClass):
13270 1
    '''
13271 1
    :ivar TypeId:
13272 1
    :vartype TypeId: NodeId
13273 1
    :ivar RequestHeader:
13274 1
    :vartype RequestHeader: RequestHeader
13275 1
    :ivar Parameters:
13276
    :vartype Parameters: ModifySubscriptionParameters
13277 1
    '''
13278 1
13279 1
    ua_types = (
13280 1
13281 1
        ('TypeId', 'NodeId'),
13282 1
        ('RequestHeader', 'RequestHeader'),
13283 1
        ('Parameters', 'ModifySubscriptionParameters'),
13284
               )
13285 1
13286
    def __init__(self, binary=None):
13287 1
        if binary is not None:
13288
            self._binary_init(binary)
13289 1
            self._freeze = True
13290
            return
13291 1
        self.TypeId = FourByteNodeId(ObjectIds.ModifySubscriptionRequest_Encoding_DefaultBinary)
13292 1
        self.RequestHeader = RequestHeader()
13293 1
        self.Parameters = ModifySubscriptionParameters()
13294 1
        self._freeze = True
13295 1
13296 1
    def to_binary(self):
13297 1
        packet = []
13298 1
        packet.append(self.TypeId.to_binary())
13299 1
        packet.append(self.RequestHeader.to_binary())
13300 1
        packet.append(self.Parameters.to_binary())
13301 1
        return b''.join(packet)
13302
13303 1
    @staticmethod
13304
    def from_binary(data):
13305 1
        return ModifySubscriptionRequest(data)
13306
13307
    def _binary_init(self, data):
13308
        self.TypeId = NodeId.from_binary(data)
13309 1
        self.RequestHeader = RequestHeader.from_binary(data)
13310
        self.Parameters = ModifySubscriptionParameters.from_binary(data)
13311
13312 1
    def __str__(self):
13313
        return 'ModifySubscriptionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13314
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
13315
               'Parameters:' + str(self.Parameters) + ')'
13316
13317
    __repr__ = __str__
13318
13319
13320 1
class ModifySubscriptionResult(FrozenClass):
13321
    '''
13322
    :ivar RevisedPublishingInterval:
13323
    :vartype RevisedPublishingInterval: Double
13324
    :ivar RevisedLifetimeCount:
13325 1
    :vartype RevisedLifetimeCount: UInt32
13326 1
    :ivar RevisedMaxKeepAliveCount:
13327 1
    :vartype RevisedMaxKeepAliveCount: UInt32
13328 1
    '''
13329 1
13330 1
    ua_types = (
13331 1
13332 1
        ('RevisedPublishingInterval', 'Double'),
13333
        ('RevisedLifetimeCount', 'UInt32'),
13334 1
        ('RevisedMaxKeepAliveCount', 'UInt32'),
13335 1
               )
13336 1
13337 1
    def __init__(self, binary=None):
13338 1
        if binary is not None:
13339
            self._binary_init(binary)
13340 1
            self._freeze = True
13341
            return
13342 1
        self.RevisedPublishingInterval = 0
13343
        self.RevisedLifetimeCount = 0
13344 1
        self.RevisedMaxKeepAliveCount = 0
13345 1
        self._freeze = True
13346 1
13347
    def to_binary(self):
13348 1
        packet = []
13349
        packet.append(uabin.Primitives.Double.pack(self.RevisedPublishingInterval))
13350
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedLifetimeCount))
13351
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedMaxKeepAliveCount))
13352 1
        return b''.join(packet)
13353
13354
    @staticmethod
13355 1
    def from_binary(data):
13356
        return ModifySubscriptionResult(data)
13357
13358
    def _binary_init(self, data):
13359
        self.RevisedPublishingInterval = uabin.Primitives.Double.unpack(data)
13360
        self.RevisedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
13361 1
        self.RevisedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
13362
13363
    def __str__(self):
13364
        return 'ModifySubscriptionResult(' + 'RevisedPublishingInterval:' + str(self.RevisedPublishingInterval) + ', ' + \
13365 1
               'RevisedLifetimeCount:' + str(self.RevisedLifetimeCount) + ', ' + \
13366 1
               'RevisedMaxKeepAliveCount:' + str(self.RevisedMaxKeepAliveCount) + ')'
13367 1
13368 1
    __repr__ = __str__
13369 1
13370 1
13371 1
class ModifySubscriptionResponse(FrozenClass):
13372
    '''
13373 1
    :ivar TypeId:
13374 1
    :vartype TypeId: NodeId
13375 1
    :ivar ResponseHeader:
13376 1
    :vartype ResponseHeader: ResponseHeader
13377 1
    :ivar Parameters:
13378 1
    :vartype Parameters: ModifySubscriptionResult
13379
    '''
13380 1
13381
    ua_types = (
13382 1
13383
        ('TypeId', 'NodeId'),
13384 1
        ('ResponseHeader', 'ResponseHeader'),
13385 1
        ('Parameters', 'ModifySubscriptionResult'),
13386 1
               )
13387 1
13388 1
    def __init__(self, binary=None):
13389 1
        if binary is not None:
13390 1
            self._binary_init(binary)
13391
            self._freeze = True
13392 1
            return
13393
        self.TypeId = FourByteNodeId(ObjectIds.ModifySubscriptionResponse_Encoding_DefaultBinary)
13394
        self.ResponseHeader = ResponseHeader()
13395 1
        self.Parameters = ModifySubscriptionResult()
13396
        self._freeze = True
13397
13398 1
    def to_binary(self):
13399
        packet = []
13400
        packet.append(self.TypeId.to_binary())
13401
        packet.append(self.ResponseHeader.to_binary())
13402
        packet.append(self.Parameters.to_binary())
13403
        return b''.join(packet)
13404
13405
    @staticmethod
13406 1
    def from_binary(data):
13407
        return ModifySubscriptionResponse(data)
13408
13409
    def _binary_init(self, data):
13410
        self.TypeId = NodeId.from_binary(data)
13411 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
13412 1
        self.Parameters = ModifySubscriptionResult.from_binary(data)
13413 1
13414 1
    def __str__(self):
13415 1
        return 'ModifySubscriptionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13416 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
13417 1
               'Parameters:' + str(self.Parameters) + ')'
13418 1
13419
    __repr__ = __str__
13420 1
13421 1
13422 1
class SetPublishingModeParameters(FrozenClass):
13423 1
    '''
13424 1
    :ivar PublishingEnabled:
13425 1
    :vartype PublishingEnabled: Boolean
13426 1
    :ivar SubscriptionIds:
13427
    :vartype SubscriptionIds: UInt32
13428 1
    '''
13429
13430 1
    ua_types = (
13431
13432 1
        ('PublishingEnabled', 'Boolean'),
13433 1
        ('SubscriptionIds', 'ListOfUInt32'),
13434 1
               )
13435 1
13436 1
    def __init__(self, binary=None):
13437 1
        if binary is not None:
13438 1
            self._binary_init(binary)
13439 1
            self._freeze = True
13440
            return
13441 1
        self.PublishingEnabled = True
13442
        self.SubscriptionIds = []
13443
        self._freeze = True
13444
13445 1
    def to_binary(self):
13446
        packet = []
13447
        packet.append(uabin.Primitives.Boolean.pack(self.PublishingEnabled))
13448 1
        packet.append(uabin.Primitives.Int32.pack(len(self.SubscriptionIds)))
13449
        for fieldname in self.SubscriptionIds:
13450
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
13451
        return b''.join(packet)
13452
13453
    @staticmethod
13454 1
    def from_binary(data):
13455
        return SetPublishingModeParameters(data)
13456
13457
    def _binary_init(self, data):
13458 1
        self.PublishingEnabled = uabin.Primitives.Boolean.unpack(data)
13459 1
        self.SubscriptionIds = uabin.Primitives.UInt32.unpack_array(data)
13460
13461
    def __str__(self):
13462
        return 'SetPublishingModeParameters(' + 'PublishingEnabled:' + str(self.PublishingEnabled) + ', ' + \
13463 1
               'SubscriptionIds:' + str(self.SubscriptionIds) + ')'
13464 1
13465
    __repr__ = __str__
13466 1
13467
13468
class SetPublishingModeRequest(FrozenClass):
13469
    '''
13470
    :ivar TypeId:
13471
    :vartype TypeId: NodeId
13472
    :ivar RequestHeader:
13473 1
    :vartype RequestHeader: RequestHeader
13474
    :ivar Parameters:
13475
    :vartype Parameters: SetPublishingModeParameters
13476
    '''
13477 1
13478
    ua_types = (
13479
13480
        ('TypeId', 'NodeId'),
13481
        ('RequestHeader', 'RequestHeader'),
13482
        ('Parameters', 'SetPublishingModeParameters'),
13483
               )
13484
13485 1
    def __init__(self, binary=None):
13486
        if binary is not None:
13487
            self._binary_init(binary)
13488 1
            self._freeze = True
13489
            return
13490
        self.TypeId = FourByteNodeId(ObjectIds.SetPublishingModeRequest_Encoding_DefaultBinary)
13491 1
        self.RequestHeader = RequestHeader()
13492
        self.Parameters = SetPublishingModeParameters()
13493
        self._freeze = True
13494
13495
    def to_binary(self):
13496
        packet = []
13497
        packet.append(self.TypeId.to_binary())
13498
        packet.append(self.RequestHeader.to_binary())
13499 1
        packet.append(self.Parameters.to_binary())
13500
        return b''.join(packet)
13501
13502
    @staticmethod
13503
    def from_binary(data):
13504 1
        return SetPublishingModeRequest(data)
13505
13506
    def _binary_init(self, data):
13507
        self.TypeId = NodeId.from_binary(data)
13508
        self.RequestHeader = RequestHeader.from_binary(data)
13509
        self.Parameters = SetPublishingModeParameters.from_binary(data)
13510
13511
    def __str__(self):
13512
        return 'SetPublishingModeRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13513 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
13514
               'Parameters:' + str(self.Parameters) + ')'
13515
13516
    __repr__ = __str__
13517
13518
13519 1
class SetPublishingModeResult(FrozenClass):
13520
    '''
13521
    :ivar Results:
13522
    :vartype Results: StatusCode
13523 1
    :ivar DiagnosticInfos:
13524
    :vartype DiagnosticInfos: DiagnosticInfo
13525
    '''
13526
13527 1
    ua_types = (
13528
13529
        ('Results', 'ListOfStatusCode'),
13530
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
13531 1
               )
13532
13533
    def __init__(self, binary=None):
13534 1
        if binary is not None:
13535
            self._binary_init(binary)
13536
            self._freeze = True
13537
            return
13538
        self.Results = []
13539
        self.DiagnosticInfos = []
13540
        self._freeze = True
13541
13542 1
    def to_binary(self):
13543
        packet = []
13544
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
13545
        for fieldname in self.Results:
13546
            packet.append(fieldname.to_binary())
13547 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
13548 1
        for fieldname in self.DiagnosticInfos:
13549 1
            packet.append(fieldname.to_binary())
13550 1
        return b''.join(packet)
13551 1
13552 1
    @staticmethod
13553 1
    def from_binary(data):
13554 1
        return SetPublishingModeResult(data)
13555
13556 1
    def _binary_init(self, data):
13557 1
        length = uabin.Primitives.Int32.unpack(data)
13558 1
        array = []
13559 1
        if length != -1:
13560 1
            for _ in range(0, length):
13561
                array.append(StatusCode.from_binary(data))
13562 1
        self.Results = array
13563
        length = uabin.Primitives.Int32.unpack(data)
13564 1
        array = []
13565
        if length != -1:
13566 1
            for _ in range(0, length):
13567 1
                array.append(DiagnosticInfo.from_binary(data))
13568 1
        self.DiagnosticInfos = array
13569
13570 1
    def __str__(self):
13571
        return 'SetPublishingModeResult(' + 'Results:' + str(self.Results) + ', ' + \
13572
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
13573
13574 1
    __repr__ = __str__
13575
13576
13577 1
class SetPublishingModeResponse(FrozenClass):
13578
    '''
13579
    :ivar TypeId:
13580
    :vartype TypeId: NodeId
13581
    :ivar ResponseHeader:
13582
    :vartype ResponseHeader: ResponseHeader
13583 1
    :ivar Parameters:
13584
    :vartype Parameters: SetPublishingModeResult
13585
    '''
13586
13587 1
    ua_types = (
13588 1
13589 1
        ('TypeId', 'NodeId'),
13590 1
        ('ResponseHeader', 'ResponseHeader'),
13591 1
        ('Parameters', 'SetPublishingModeResult'),
13592 1
               )
13593 1
13594
    def __init__(self, binary=None):
13595 1
        if binary is not None:
13596 1
            self._binary_init(binary)
13597 1
            self._freeze = True
13598 1
            return
13599 1
        self.TypeId = FourByteNodeId(ObjectIds.SetPublishingModeResponse_Encoding_DefaultBinary)
13600 1
        self.ResponseHeader = ResponseHeader()
13601
        self.Parameters = SetPublishingModeResult()
13602 1
        self._freeze = True
13603
13604 1
    def to_binary(self):
13605
        packet = []
13606 1
        packet.append(self.TypeId.to_binary())
13607 1
        packet.append(self.ResponseHeader.to_binary())
13608 1
        packet.append(self.Parameters.to_binary())
13609 1
        return b''.join(packet)
13610 1
13611 1
    @staticmethod
13612 1
    def from_binary(data):
13613
        return SetPublishingModeResponse(data)
13614 1
13615
    def _binary_init(self, data):
13616
        self.TypeId = NodeId.from_binary(data)
13617 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
13618
        self.Parameters = SetPublishingModeResult.from_binary(data)
13619
13620 1
    def __str__(self):
13621
        return 'SetPublishingModeResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13622
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
13623
               'Parameters:' + str(self.Parameters) + ')'
13624
13625
    __repr__ = __str__
13626
13627
13628
class NotificationMessage(FrozenClass):
13629
    '''
13630 1
    :ivar SequenceNumber:
13631
    :vartype SequenceNumber: UInt32
13632
    :ivar PublishTime:
13633
    :vartype PublishTime: DateTime
13634
    :ivar NotificationData:
13635
    :vartype NotificationData: ExtensionObject
13636 1
    '''
13637 1
13638
    ua_types = (
13639
13640
        ('SequenceNumber', 'UInt32'),
13641 1
        ('PublishTime', 'DateTime'),
13642 1
        ('NotificationData', 'ListOfExtensionObject'),
13643 1
               )
13644 1
13645
    def __init__(self, binary=None):
13646 1
        if binary is not None:
13647 1
            self._binary_init(binary)
13648 1
            self._freeze = True
13649 1
            return
13650 1
        self.SequenceNumber = 0
13651 1
        self.PublishTime = datetime.utcnow()
13652
        self.NotificationData = []
13653 1
        self._freeze = True
13654
13655
    def to_binary(self):
13656
        packet = []
13657 1
        packet.append(uabin.Primitives.UInt32.pack(self.SequenceNumber))
13658
        packet.append(uabin.Primitives.DateTime.pack(self.PublishTime))
13659
        packet.append(uabin.Primitives.Int32.pack(len(self.NotificationData)))
13660
        for fieldname in self.NotificationData:
13661
            packet.append(extensionobject_to_binary(fieldname))
13662 1
        return b''.join(packet)
13663
13664
    @staticmethod
13665
    def from_binary(data):
13666
        return NotificationMessage(data)
13667 1
13668
    def _binary_init(self, data):
13669
        self.SequenceNumber = uabin.Primitives.UInt32.unpack(data)
13670 1
        self.PublishTime = uabin.Primitives.DateTime.unpack(data)
13671
        length = uabin.Primitives.Int32.unpack(data)
13672
        array = []
13673
        if length != -1:
13674
            for _ in range(0, length):
13675
                array.append(extensionobject_from_binary(data))
13676
        self.NotificationData = array
13677
13678
    def __str__(self):
13679
        return 'NotificationMessage(' + 'SequenceNumber:' + str(self.SequenceNumber) + ', ' + \
13680
               'PublishTime:' + str(self.PublishTime) + ', ' + \
13681
               'NotificationData:' + str(self.NotificationData) + ')'
13682
13683
    __repr__ = __str__
13684
13685
13686 1
class NotificationData(FrozenClass):
13687
    '''
13688
    '''
13689
13690
    ua_types = (
13691
13692
               )
13693
13694
    def __init__(self, binary=None):
13695 1
        if binary is not None:
13696 1
            self._binary_init(binary)
13697 1
            self._freeze = True
13698 1
            return
13699 1
        self._freeze = True
13700 1
13701 1
    def to_binary(self):
13702 1
        packet = []
13703 1
        return b''.join(packet)
13704 1
13705 1
    @staticmethod
13706 1
    def from_binary(data):
13707
        return NotificationData(data)
13708 1
13709 1
    def _binary_init(self, data):
13710 1
        pass
13711 1
13712 1
    def __str__(self):
13713 1
        return 'NotificationData(' +  + ')'
13714 1
13715 1
    __repr__ = __str__
13716 1
13717 1
13718
class DataChangeNotification(FrozenClass):
13719 1
    '''
13720 1
    :ivar MonitoredItems:
13721
    :vartype MonitoredItems: MonitoredItemNotification
13722 1
    :ivar DiagnosticInfos:
13723
    :vartype DiagnosticInfos: DiagnosticInfo
13724 1
    '''
13725
13726 1
    ua_types = (
13727
13728 1
        ('MonitoredItems', 'ListOfMonitoredItemNotification'),
13729 1
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
13730 1
               )
13731 1
13732 1
    def __init__(self, binary=None):
13733 1
        if binary is not None:
13734 1
            self._binary_init(binary)
13735 1
            self._freeze = True
13736 1
            return
13737
        self.MonitoredItems = []
13738 1
        self.DiagnosticInfos = []
13739 1
        self._freeze = True
13740 1
13741 1
    def to_binary(self):
13742 1
        packet = []
13743
        packet.append(uabin.Primitives.Int32.pack(len(self.MonitoredItems)))
13744 1
        for fieldname in self.MonitoredItems:
13745
            packet.append(fieldname.to_binary())
13746 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
13747
        for fieldname in self.DiagnosticInfos:
13748
            packet.append(fieldname.to_binary())
13749
        return b''.join(packet)
13750
13751
    @staticmethod
13752
    def from_binary(data):
13753
        return DataChangeNotification(data)
13754 1
13755
    def _binary_init(self, data):
13756
        length = uabin.Primitives.Int32.unpack(data)
13757 1
        array = []
13758
        if length != -1:
13759
            for _ in range(0, length):
13760
                array.append(MonitoredItemNotification.from_binary(data))
13761
        self.MonitoredItems = array
13762
        length = uabin.Primitives.Int32.unpack(data)
13763
        array = []
13764
        if length != -1:
13765
            for _ in range(0, length):
13766
                array.append(DiagnosticInfo.from_binary(data))
13767 1
        self.DiagnosticInfos = array
13768
13769
    def __str__(self):
13770
        return 'DataChangeNotification(' + 'MonitoredItems:' + str(self.MonitoredItems) + ', ' + \
13771
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
13772
13773 1
    __repr__ = __str__
13774 1
13775 1
13776 1
class MonitoredItemNotification(FrozenClass):
13777 1
    '''
13778 1
    :ivar ClientHandle:
13779 1
    :vartype ClientHandle: UInt32
13780 1
    :ivar Value:
13781 1
    :vartype Value: DataValue
13782
    '''
13783 1
13784 1
    ua_types = (
13785 1
13786 1
        ('ClientHandle', 'UInt32'),
13787 1
        ('Value', 'DataValue'),
13788 1
               )
13789
13790 1
    def __init__(self, binary=None):
13791
        if binary is not None:
13792 1
            self._binary_init(binary)
13793
            self._freeze = True
13794 1
            return
13795 1
        self.ClientHandle = 0
13796 1
        self.Value = DataValue()
13797 1
        self._freeze = True
13798
13799 1
    def to_binary(self):
13800
        packet = []
13801
        packet.append(uabin.Primitives.UInt32.pack(self.ClientHandle))
13802
        packet.append(self.Value.to_binary())
13803
        return b''.join(packet)
13804 1
13805
    @staticmethod
13806
    def from_binary(data):
13807 1
        return MonitoredItemNotification(data)
13808
13809
    def _binary_init(self, data):
13810
        self.ClientHandle = uabin.Primitives.UInt32.unpack(data)
13811
        self.Value = DataValue.from_binary(data)
13812
13813
    def __str__(self):
13814
        return 'MonitoredItemNotification(' + 'ClientHandle:' + str(self.ClientHandle) + ', ' + \
13815 1
               'Value:' + str(self.Value) + ')'
13816
13817
    __repr__ = __str__
13818
13819
13820 1
class EventNotificationList(FrozenClass):
13821
    '''
13822
    :ivar Events:
13823
    :vartype Events: EventFieldList
13824
    '''
13825
13826
    ua_types = (
13827
13828
        ('Events', 'ListOfEventFieldList'),
13829 1
               )
13830
13831
    def __init__(self, binary=None):
13832
        if binary is not None:
13833
            self._binary_init(binary)
13834
            self._freeze = True
13835 1
            return
13836
        self.Events = []
13837
        self._freeze = True
13838
13839 1
    def to_binary(self):
13840
        packet = []
13841
        packet.append(uabin.Primitives.Int32.pack(len(self.Events)))
13842
        for fieldname in self.Events:
13843 1
            packet.append(fieldname.to_binary())
13844
        return b''.join(packet)
13845
13846
    @staticmethod
13847 1
    def from_binary(data):
13848
        return EventNotificationList(data)
13849
13850 1
    def _binary_init(self, data):
13851
        length = uabin.Primitives.Int32.unpack(data)
13852
        array = []
13853
        if length != -1:
13854
            for _ in range(0, length):
13855
                array.append(EventFieldList.from_binary(data))
13856
        self.Events = array
13857
13858
    def __str__(self):
13859
        return 'EventNotificationList(' + 'Events:' + str(self.Events) + ')'
13860 1
13861
    __repr__ = __str__
13862
13863
13864
class EventFieldList(FrozenClass):
13865
    '''
13866 1
    :ivar ClientHandle:
13867
    :vartype ClientHandle: UInt32
13868
    :ivar EventFields:
13869
    :vartype EventFields: Variant
13870
    '''
13871
13872
    ua_types = (
13873
13874
        ('ClientHandle', 'UInt32'),
13875
        ('EventFields', 'ListOfVariant'),
13876 1
               )
13877
13878
    def __init__(self, binary=None):
13879
        if binary is not None:
13880
            self._binary_init(binary)
13881
            self._freeze = True
13882
            return
13883 1
        self.ClientHandle = 0
13884
        self.EventFields = []
13885
        self._freeze = True
13886
13887 1
    def to_binary(self):
13888
        packet = []
13889
        packet.append(uabin.Primitives.UInt32.pack(self.ClientHandle))
13890
        packet.append(uabin.Primitives.Int32.pack(len(self.EventFields)))
13891
        for fieldname in self.EventFields:
13892 1
            packet.append(fieldname.to_binary())
13893
        return b''.join(packet)
13894
13895
    @staticmethod
13896
    def from_binary(data):
13897 1
        return EventFieldList(data)
13898
13899
    def _binary_init(self, data):
13900 1
        self.ClientHandle = uabin.Primitives.UInt32.unpack(data)
13901
        length = uabin.Primitives.Int32.unpack(data)
13902
        array = []
13903
        if length != -1:
13904
            for _ in range(0, length):
13905
                array.append(Variant.from_binary(data))
13906
        self.EventFields = array
13907
13908
    def __str__(self):
13909
        return 'EventFieldList(' + 'ClientHandle:' + str(self.ClientHandle) + ', ' + \
13910 1
               'EventFields:' + str(self.EventFields) + ')'
13911
13912
    __repr__ = __str__
13913
13914
13915
class HistoryEventFieldList(FrozenClass):
13916 1
    '''
13917
    :ivar EventFields:
13918
    :vartype EventFields: Variant
13919
    '''
13920
13921
    ua_types = (
13922
13923
        ('EventFields', 'ListOfVariant'),
13924
               )
13925
13926 1
    def __init__(self, binary=None):
13927
        if binary is not None:
13928
            self._binary_init(binary)
13929
            self._freeze = True
13930
            return
13931
        self.EventFields = []
13932
        self._freeze = True
13933 1
13934
    def to_binary(self):
13935
        packet = []
13936
        packet.append(uabin.Primitives.Int32.pack(len(self.EventFields)))
13937 1
        for fieldname in self.EventFields:
13938
            packet.append(fieldname.to_binary())
13939
        return b''.join(packet)
13940
13941
    @staticmethod
13942 1
    def from_binary(data):
13943
        return HistoryEventFieldList(data)
13944
13945
    def _binary_init(self, data):
13946
        length = uabin.Primitives.Int32.unpack(data)
13947 1
        array = []
13948
        if length != -1:
13949
            for _ in range(0, length):
13950 1
                array.append(Variant.from_binary(data))
13951
        self.EventFields = array
13952
13953
    def __str__(self):
13954
        return 'HistoryEventFieldList(' + 'EventFields:' + str(self.EventFields) + ')'
13955
13956
    __repr__ = __str__
13957
13958 1
13959
class StatusChangeNotification(FrozenClass):
13960
    '''
13961
    :ivar Status:
13962
    :vartype Status: StatusCode
13963 1
    :ivar DiagnosticInfo:
13964
    :vartype DiagnosticInfo: DiagnosticInfo
13965
    '''
13966
13967
    ua_types = (
13968
13969
        ('Status', 'StatusCode'),
13970
        ('DiagnosticInfo', 'DiagnosticInfo'),
13971
               )
13972 1
13973
    def __init__(self, binary=None):
13974
        if binary is not None:
13975
            self._binary_init(binary)
13976
            self._freeze = True
13977
            return
13978
        self.Status = StatusCode()
13979
        self.DiagnosticInfo = DiagnosticInfo()
13980 1
        self._freeze = True
13981
13982
    def to_binary(self):
13983
        packet = []
13984 1
        packet.append(self.Status.to_binary())
13985
        packet.append(self.DiagnosticInfo.to_binary())
13986
        return b''.join(packet)
13987
13988 1
    @staticmethod
13989
    def from_binary(data):
13990
        return StatusChangeNotification(data)
13991
13992 1
    def _binary_init(self, data):
13993
        self.Status = StatusCode.from_binary(data)
13994
        self.DiagnosticInfo = DiagnosticInfo.from_binary(data)
13995 1
13996
    def __str__(self):
13997
        return 'StatusChangeNotification(' + 'Status:' + str(self.Status) + ', ' + \
13998
               'DiagnosticInfo:' + str(self.DiagnosticInfo) + ')'
13999
14000
    __repr__ = __str__
14001
14002
14003 1
class SubscriptionAcknowledgement(FrozenClass):
14004
    '''
14005
    :ivar SubscriptionId:
14006
    :vartype SubscriptionId: UInt32
14007
    :ivar SequenceNumber:
14008 1
    :vartype SequenceNumber: UInt32
14009
    '''
14010
14011
    ua_types = (
14012
14013
        ('SubscriptionId', 'UInt32'),
14014
        ('SequenceNumber', 'UInt32'),
14015
               )
14016
14017 1
    def __init__(self, binary=None):
14018
        if binary is not None:
14019
            self._binary_init(binary)
14020
            self._freeze = True
14021
            return
14022
        self.SubscriptionId = 0
14023
        self.SequenceNumber = 0
14024
        self._freeze = True
14025 1
14026
    def to_binary(self):
14027
        packet = []
14028
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
14029 1
        packet.append(uabin.Primitives.UInt32.pack(self.SequenceNumber))
14030
        return b''.join(packet)
14031
14032
    @staticmethod
14033 1
    def from_binary(data):
14034
        return SubscriptionAcknowledgement(data)
14035
14036
    def _binary_init(self, data):
14037 1
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
14038
        self.SequenceNumber = uabin.Primitives.UInt32.unpack(data)
14039
14040 1
    def __str__(self):
14041
        return 'SubscriptionAcknowledgement(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
14042
               'SequenceNumber:' + str(self.SequenceNumber) + ')'
14043
14044
    __repr__ = __str__
14045
14046
14047
class PublishParameters(FrozenClass):
14048
    '''
14049
    :ivar SubscriptionAcknowledgements:
14050 1
    :vartype SubscriptionAcknowledgements: SubscriptionAcknowledgement
14051
    '''
14052
14053
    ua_types = (
14054
14055
        ('SubscriptionAcknowledgements', 'ListOfSubscriptionAcknowledgement'),
14056 1
               )
14057
14058
    def __init__(self, binary=None):
14059
        if binary is not None:
14060
            self._binary_init(binary)
14061
            self._freeze = True
14062
            return
14063
        self.SubscriptionAcknowledgements = []
14064
        self._freeze = True
14065
14066 1
    def to_binary(self):
14067
        packet = []
14068
        packet.append(uabin.Primitives.Int32.pack(len(self.SubscriptionAcknowledgements)))
14069
        for fieldname in self.SubscriptionAcknowledgements:
14070
            packet.append(fieldname.to_binary())
14071
        return b''.join(packet)
14072
14073 1
    @staticmethod
14074
    def from_binary(data):
14075
        return PublishParameters(data)
14076
14077 1
    def _binary_init(self, data):
14078
        length = uabin.Primitives.Int32.unpack(data)
14079
        array = []
14080
        if length != -1:
14081
            for _ in range(0, length):
14082 1
                array.append(SubscriptionAcknowledgement.from_binary(data))
14083
        self.SubscriptionAcknowledgements = array
14084
14085
    def __str__(self):
14086
        return 'PublishParameters(' + 'SubscriptionAcknowledgements:' + str(self.SubscriptionAcknowledgements) + ')'
14087 1
14088
    __repr__ = __str__
14089
14090 1
14091
class PublishRequest(FrozenClass):
14092
    '''
14093
    :ivar TypeId:
14094
    :vartype TypeId: NodeId
14095
    :ivar RequestHeader:
14096
    :vartype RequestHeader: RequestHeader
14097
    :ivar Parameters:
14098 1
    :vartype Parameters: PublishParameters
14099
    '''
14100
14101
    ua_types = (
14102
14103 1
        ('TypeId', 'NodeId'),
14104
        ('RequestHeader', 'RequestHeader'),
14105
        ('Parameters', 'PublishParameters'),
14106
               )
14107
14108
    def __init__(self, binary=None):
14109
        if binary is not None:
14110
            self._binary_init(binary)
14111
            self._freeze = True
14112 1
            return
14113
        self.TypeId = FourByteNodeId(ObjectIds.PublishRequest_Encoding_DefaultBinary)
14114
        self.RequestHeader = RequestHeader()
14115
        self.Parameters = PublishParameters()
14116
        self._freeze = True
14117
14118
    def to_binary(self):
14119
        packet = []
14120
        packet.append(self.TypeId.to_binary())
14121
        packet.append(self.RequestHeader.to_binary())
14122 1
        packet.append(self.Parameters.to_binary())
14123
        return b''.join(packet)
14124
14125
    @staticmethod
14126 1
    def from_binary(data):
14127
        return PublishRequest(data)
14128
14129
    def _binary_init(self, data):
14130
        self.TypeId = NodeId.from_binary(data)
14131
        self.RequestHeader = RequestHeader.from_binary(data)
14132
        self.Parameters = PublishParameters.from_binary(data)
14133
14134
    def __str__(self):
14135
        return 'PublishRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
14136
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
14137
               'Parameters:' + str(self.Parameters) + ')'
14138
14139
    __repr__ = __str__
14140 1
14141
14142
class PublishResult(FrozenClass):
14143
    '''
14144 1
    :ivar SubscriptionId:
14145
    :vartype SubscriptionId: UInt32
14146
    :ivar AvailableSequenceNumbers:
14147 1
    :vartype AvailableSequenceNumbers: UInt32
14148
    :ivar MoreNotifications:
14149
    :vartype MoreNotifications: Boolean
14150
    :ivar NotificationMessage:
14151
    :vartype NotificationMessage: NotificationMessage
14152
    :ivar Results:
14153
    :vartype Results: StatusCode
14154
    :ivar DiagnosticInfos:
14155
    :vartype DiagnosticInfos: DiagnosticInfo
14156
    '''
14157 1
14158
    ua_types = (
14159
14160
        ('SubscriptionId', 'UInt32'),
14161
        ('AvailableSequenceNumbers', 'ListOfUInt32'),
14162
        ('MoreNotifications', 'Boolean'),
14163 1
        ('NotificationMessage', 'NotificationMessage'),
14164
        ('Results', 'ListOfStatusCode'),
14165
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
14166
               )
14167
14168
    def __init__(self, binary=None):
14169
        if binary is not None:
14170
            self._binary_init(binary)
14171
            self._freeze = True
14172
            return
14173 1
        self.SubscriptionId = 0
14174
        self.AvailableSequenceNumbers = []
14175
        self.MoreNotifications = True
14176
        self.NotificationMessage = NotificationMessage()
14177
        self.Results = []
14178
        self.DiagnosticInfos = []
14179
        self._freeze = True
14180 1
14181
    def to_binary(self):
14182
        packet = []
14183
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
14184 1
        packet.append(uabin.Primitives.Int32.pack(len(self.AvailableSequenceNumbers)))
14185
        for fieldname in self.AvailableSequenceNumbers:
14186
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
14187
        packet.append(uabin.Primitives.Boolean.pack(self.MoreNotifications))
14188
        packet.append(self.NotificationMessage.to_binary())
14189 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
14190
        for fieldname in self.Results:
14191
            packet.append(fieldname.to_binary())
14192
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
14193
        for fieldname in self.DiagnosticInfos:
14194 1
            packet.append(fieldname.to_binary())
14195
        return b''.join(packet)
14196
14197 1
    @staticmethod
14198
    def from_binary(data):
14199
        return PublishResult(data)
14200
14201
    def _binary_init(self, data):
14202
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
14203 1
        self.AvailableSequenceNumbers = uabin.Primitives.UInt32.unpack_array(data)
14204
        self.MoreNotifications = uabin.Primitives.Boolean.unpack(data)
14205
        self.NotificationMessage = NotificationMessage.from_binary(data)
14206
        length = uabin.Primitives.Int32.unpack(data)
14207 1
        array = []
14208 1
        if length != -1:
14209 1
            for _ in range(0, length):
14210 1
                array.append(StatusCode.from_binary(data))
14211 1
        self.Results = array
14212 1
        length = uabin.Primitives.Int32.unpack(data)
14213 1
        array = []
14214
        if length != -1:
14215 1
            for _ in range(0, length):
14216 1
                array.append(DiagnosticInfo.from_binary(data))
14217 1
        self.DiagnosticInfos = array
14218 1
14219 1
    def __str__(self):
14220 1
        return 'PublishResult(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
14221
               'AvailableSequenceNumbers:' + str(self.AvailableSequenceNumbers) + ', ' + \
14222 1
               'MoreNotifications:' + str(self.MoreNotifications) + ', ' + \
14223
               'NotificationMessage:' + str(self.NotificationMessage) + ', ' + \
14224 1
               'Results:' + str(self.Results) + ', ' + \
14225
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
14226 1
14227 1
    __repr__ = __str__
14228
14229 1
14230
class PublishResponse(FrozenClass):
14231
    '''
14232 1
    :ivar TypeId:
14233
    :vartype TypeId: NodeId
14234
    :ivar ResponseHeader:
14235 1
    :vartype ResponseHeader: ResponseHeader
14236
    :ivar Parameters:
14237
    :vartype Parameters: PublishResult
14238
    '''
14239
14240
    ua_types = (
14241
14242
        ('TypeId', 'NodeId'),
14243
        ('ResponseHeader', 'ResponseHeader'),
14244
        ('Parameters', 'PublishResult'),
14245 1
               )
14246
14247
    def __init__(self, binary=None):
14248
        if binary is not None:
14249
            self._binary_init(binary)
14250
            self._freeze = True
14251 1
            return
14252 1
        self.TypeId = FourByteNodeId(ObjectIds.PublishResponse_Encoding_DefaultBinary)
14253
        self.ResponseHeader = ResponseHeader()
14254
        self.Parameters = PublishResult()
14255
        self._freeze = True
14256 1
14257 1
    def to_binary(self):
14258 1
        packet = []
14259 1
        packet.append(self.TypeId.to_binary())
14260
        packet.append(self.ResponseHeader.to_binary())
14261 1
        packet.append(self.Parameters.to_binary())
14262 1
        return b''.join(packet)
14263 1
14264 1
    @staticmethod
14265 1
    def from_binary(data):
14266 1
        return PublishResponse(data)
14267
14268 1
    def _binary_init(self, data):
14269
        self.TypeId = NodeId.from_binary(data)
14270
        self.ResponseHeader = ResponseHeader.from_binary(data)
14271
        self.Parameters = PublishResult.from_binary(data)
14272 1
14273
    def __str__(self):
14274
        return 'PublishResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
14275
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
14276
               'Parameters:' + str(self.Parameters) + ')'
14277 1
14278
    __repr__ = __str__
14279
14280
14281
class RepublishParameters(FrozenClass):
14282 1
    '''
14283
    :ivar SubscriptionId:
14284
    :vartype SubscriptionId: UInt32
14285 1
    :ivar RetransmitSequenceNumber:
14286
    :vartype RetransmitSequenceNumber: UInt32
14287
    '''
14288
14289
    ua_types = (
14290
14291
        ('SubscriptionId', 'UInt32'),
14292
        ('RetransmitSequenceNumber', 'UInt32'),
14293
               )
14294 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
14295
    def __init__(self, binary=None):
14296
        if binary is not None:
14297 1
            self._binary_init(binary)
14298
            self._freeze = True
14299
            return
14300
        self.SubscriptionId = 0
14301
        self.RetransmitSequenceNumber = 0
14302
        self._freeze = True
14303
14304 1
    def to_binary(self):
14305 1
        packet = []
14306 1
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
14307 1
        packet.append(uabin.Primitives.UInt32.pack(self.RetransmitSequenceNumber))
14308 1
        return b''.join(packet)
14309 1
14310 1
    @staticmethod
14311 1
    def from_binary(data):
14312 1
        return RepublishParameters(data)
14313 1
14314
    def _binary_init(self, data):
14315 1
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
14316 1
        self.RetransmitSequenceNumber = uabin.Primitives.UInt32.unpack(data)
14317 1
14318 1
    def __str__(self):
14319 1
        return 'RepublishParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
14320 1
               'RetransmitSequenceNumber:' + str(self.RetransmitSequenceNumber) + ')'
14321 1
14322 1
    __repr__ = __str__
14323 1
14324
14325 1
class RepublishRequest(FrozenClass):
14326
    '''
14327 1
    :ivar TypeId:
14328
    :vartype TypeId: NodeId
14329 1
    :ivar RequestHeader:
14330
    :vartype RequestHeader: RequestHeader
14331 1
    :ivar Parameters:
14332 1
    :vartype Parameters: RepublishParameters
14333 1
    '''
14334 1
14335 1
    ua_types = (
14336 1
14337 1
        ('TypeId', 'NodeId'),
14338 1
        ('RequestHeader', 'RequestHeader'),
14339 1
        ('Parameters', 'RepublishParameters'),
14340 1
               )
14341 1
14342 1
    def __init__(self, binary=None):
14343 1
        if binary is not None:
14344
            self._binary_init(binary)
14345 1
            self._freeze = True
14346
            return
14347 1
        self.TypeId = FourByteNodeId(ObjectIds.RepublishRequest_Encoding_DefaultBinary)
14348
        self.RequestHeader = RequestHeader()
14349
        self.Parameters = RepublishParameters()
14350
        self._freeze = True
14351
14352
    def to_binary(self):
14353 1
        packet = []
14354
        packet.append(self.TypeId.to_binary())
14355
        packet.append(self.RequestHeader.to_binary())
14356 1
        packet.append(self.Parameters.to_binary())
14357
        return b''.join(packet)
14358
14359
    @staticmethod
14360
    def from_binary(data):
14361
        return RepublishRequest(data)
14362
14363
    def _binary_init(self, data):
14364
        self.TypeId = NodeId.from_binary(data)
14365
        self.RequestHeader = RequestHeader.from_binary(data)
14366
        self.Parameters = RepublishParameters.from_binary(data)
14367
14368
    def __str__(self):
14369
        return 'RepublishRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
14370
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
14371
               'Parameters:' + str(self.Parameters) + ')'
14372 1
14373
    __repr__ = __str__
14374
14375
14376
class RepublishResponse(FrozenClass):
14377
    '''
14378
    :ivar TypeId:
14379
    :vartype TypeId: NodeId
14380
    :ivar ResponseHeader:
14381 1
    :vartype ResponseHeader: ResponseHeader
14382
    :ivar NotificationMessage:
14383
    :vartype NotificationMessage: NotificationMessage
14384
    '''
14385
14386
    ua_types = (
14387
14388
        ('TypeId', 'NodeId'),
14389
        ('ResponseHeader', 'ResponseHeader'),
14390
        ('NotificationMessage', 'NotificationMessage'),
14391
               )
14392
14393
    def __init__(self, binary=None):
14394 1
        if binary is not None:
14395
            self._binary_init(binary)
14396
            self._freeze = True
14397
            return
14398
        self.TypeId = FourByteNodeId(ObjectIds.RepublishResponse_Encoding_DefaultBinary)
14399
        self.ResponseHeader = ResponseHeader()
14400
        self.NotificationMessage = NotificationMessage()
14401
        self._freeze = True
14402
14403
    def to_binary(self):
14404 1
        packet = []
14405
        packet.append(self.TypeId.to_binary())
14406
        packet.append(self.ResponseHeader.to_binary())
14407
        packet.append(self.NotificationMessage.to_binary())
14408 1
        return b''.join(packet)
14409
14410
    @staticmethod
14411
    def from_binary(data):
14412
        return RepublishResponse(data)
14413
14414
    def _binary_init(self, data):
14415
        self.TypeId = NodeId.from_binary(data)
14416 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
14417
        self.NotificationMessage = NotificationMessage.from_binary(data)
14418
14419
    def __str__(self):
14420
        return 'RepublishResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
14421
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
14422
               'NotificationMessage:' + str(self.NotificationMessage) + ')'
14423
14424 1
    __repr__ = __str__
14425
14426
14427 1
class TransferResult(FrozenClass):
14428
    '''
14429
    :ivar StatusCode:
14430
    :vartype StatusCode: StatusCode
14431
    :ivar AvailableSequenceNumbers:
14432
    :vartype AvailableSequenceNumbers: UInt32
14433
    '''
14434
14435
    ua_types = (
14436
14437 1
        ('StatusCode', 'StatusCode'),
14438
        ('AvailableSequenceNumbers', 'ListOfUInt32'),
14439
               )
14440
14441
    def __init__(self, binary=None):
14442
        if binary is not None:
14443 1
            self._binary_init(binary)
14444
            self._freeze = True
14445
            return
14446
        self.StatusCode = StatusCode()
14447
        self.AvailableSequenceNumbers = []
14448
        self._freeze = True
14449
14450
    def to_binary(self):
14451
        packet = []
14452
        packet.append(self.StatusCode.to_binary())
14453 1
        packet.append(uabin.Primitives.Int32.pack(len(self.AvailableSequenceNumbers)))
14454
        for fieldname in self.AvailableSequenceNumbers:
14455
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
14456
        return b''.join(packet)
14457
14458
    @staticmethod
14459
    def from_binary(data):
14460 1
        return TransferResult(data)
14461
14462
    def _binary_init(self, data):
14463
        self.StatusCode = StatusCode.from_binary(data)
14464 1
        self.AvailableSequenceNumbers = uabin.Primitives.UInt32.unpack_array(data)
14465
14466
    def __str__(self):
14467
        return 'TransferResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
14468
               'AvailableSequenceNumbers:' + str(self.AvailableSequenceNumbers) + ')'
14469 1
14470
    __repr__ = __str__
14471
14472
14473
class TransferSubscriptionsParameters(FrozenClass):
14474 1
    '''
14475
    :ivar SubscriptionIds:
14476
    :vartype SubscriptionIds: UInt32
14477 1
    :ivar SendInitialValues:
14478
    :vartype SendInitialValues: Boolean
14479
    '''
14480
14481
    ua_types = (
14482
14483 1
        ('SubscriptionIds', 'ListOfUInt32'),
14484
        ('SendInitialValues', 'Boolean'),
14485
               )
14486
14487 1
    def __init__(self, binary=None):
14488
        if binary is not None:
14489
            self._binary_init(binary)
14490
            self._freeze = True
14491
            return
14492
        self.SubscriptionIds = []
14493
        self.SendInitialValues = True
14494
        self._freeze = True
14495 1
14496
    def to_binary(self):
14497
        packet = []
14498
        packet.append(uabin.Primitives.Int32.pack(len(self.SubscriptionIds)))
14499
        for fieldname in self.SubscriptionIds:
14500
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
14501
        packet.append(uabin.Primitives.Boolean.pack(self.SendInitialValues))
14502 1
        return b''.join(packet)
14503
14504
    @staticmethod
14505
    def from_binary(data):
14506 1
        return TransferSubscriptionsParameters(data)
14507
14508
    def _binary_init(self, data):
14509 1
        self.SubscriptionIds = uabin.Primitives.UInt32.unpack_array(data)
14510
        self.SendInitialValues = uabin.Primitives.Boolean.unpack(data)
14511
14512 1
    def __str__(self):
14513
        return 'TransferSubscriptionsParameters(' + 'SubscriptionIds:' + str(self.SubscriptionIds) + ', ' + \
14514
               'SendInitialValues:' + str(self.SendInitialValues) + ')'
14515 1
14516
    __repr__ = __str__
14517
14518
14519
class TransferSubscriptionsRequest(FrozenClass):
14520
    '''
14521
    :ivar TypeId:
14522
    :vartype TypeId: NodeId
14523 1
    :ivar RequestHeader:
14524
    :vartype RequestHeader: RequestHeader
14525
    :ivar Parameters:
14526
    :vartype Parameters: TransferSubscriptionsParameters
14527
    '''
14528 1
14529
    ua_types = (
14530
14531
        ('TypeId', 'NodeId'),
14532
        ('RequestHeader', 'RequestHeader'),
14533
        ('Parameters', 'TransferSubscriptionsParameters'),
14534
               )
14535
14536
    def __init__(self, binary=None):
14537 1
        if binary is not None:
14538
            self._binary_init(binary)
14539
            self._freeze = True
14540
            return
14541
        self.TypeId = FourByteNodeId(ObjectIds.TransferSubscriptionsRequest_Encoding_DefaultBinary)
14542
        self.RequestHeader = RequestHeader()
14543
        self.Parameters = TransferSubscriptionsParameters()
14544
        self._freeze = True
14545 1
14546
    def to_binary(self):
14547
        packet = []
14548
        packet.append(self.TypeId.to_binary())
14549 1
        packet.append(self.RequestHeader.to_binary())
14550
        packet.append(self.Parameters.to_binary())
14551
        return b''.join(packet)
14552
14553
    @staticmethod
14554
    def from_binary(data):
14555
        return TransferSubscriptionsRequest(data)
14556
14557
    def _binary_init(self, data):
14558 1
        self.TypeId = NodeId.from_binary(data)
14559
        self.RequestHeader = RequestHeader.from_binary(data)
14560
        self.Parameters = TransferSubscriptionsParameters.from_binary(data)
14561
14562 1
    def __str__(self):
14563
        return 'TransferSubscriptionsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
14564
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
14565 1
               'Parameters:' + str(self.Parameters) + ')'
14566
14567
    __repr__ = __str__
14568
14569
14570
class TransferSubscriptionsResult(FrozenClass):
14571
    '''
14572
    :ivar Results:
14573
    :vartype Results: TransferResult
14574
    :ivar DiagnosticInfos:
14575
    :vartype DiagnosticInfos: DiagnosticInfo
14576
    '''
14577 1
14578
    ua_types = (
14579
14580
        ('Results', 'ListOfTransferResult'),
14581
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
14582
               )
14583
14584 1
    def __init__(self, binary=None):
14585
        if binary is not None:
14586
            self._binary_init(binary)
14587
            self._freeze = True
14588
            return
14589
        self.Results = []
14590
        self.DiagnosticInfos = []
14591
        self._freeze = True
14592
14593
    def to_binary(self):
14594
        packet = []
14595 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
14596
        for fieldname in self.Results:
14597
            packet.append(fieldname.to_binary())
14598
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
14599
        for fieldname in self.DiagnosticInfos:
14600
            packet.append(fieldname.to_binary())
14601
        return b''.join(packet)
14602
14603 1
    @staticmethod
14604
    def from_binary(data):
14605
        return TransferSubscriptionsResult(data)
14606
14607 1
    def _binary_init(self, data):
14608
        length = uabin.Primitives.Int32.unpack(data)
14609
        array = []
14610
        if length != -1:
14611
            for _ in range(0, length):
14612
                array.append(TransferResult.from_binary(data))
14613 1
        self.Results = array
14614
        length = uabin.Primitives.Int32.unpack(data)
14615
        array = []
14616
        if length != -1:
14617
            for _ in range(0, length):
14618
                array.append(DiagnosticInfo.from_binary(data))
14619 1
        self.DiagnosticInfos = array
14620
14621
    def __str__(self):
14622 1
        return 'TransferSubscriptionsResult(' + 'Results:' + str(self.Results) + ', ' + \
14623
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
14624
14625
    __repr__ = __str__
14626
14627
14628
class TransferSubscriptionsResponse(FrozenClass):
14629
    '''
14630
    :ivar TypeId:
14631
    :vartype TypeId: NodeId
14632
    :ivar ResponseHeader:
14633
    :vartype ResponseHeader: ResponseHeader
14634
    :ivar Parameters:
14635
    :vartype Parameters: TransferSubscriptionsResult
14636
    '''
14637
14638
    ua_types = (
14639
14640
        ('TypeId', 'NodeId'),
14641
        ('ResponseHeader', 'ResponseHeader'),
14642
        ('Parameters', 'TransferSubscriptionsResult'),
14643
               )
14644
14645
    def __init__(self, binary=None):
14646
        if binary is not None:
14647
            self._binary_init(binary)
14648
            self._freeze = True
14649
            return
14650 1
        self.TypeId = FourByteNodeId(ObjectIds.TransferSubscriptionsResponse_Encoding_DefaultBinary)
14651
        self.ResponseHeader = ResponseHeader()
14652
        self.Parameters = TransferSubscriptionsResult()
14653
        self._freeze = True
14654
14655
    def to_binary(self):
14656
        packet = []
14657
        packet.append(self.TypeId.to_binary())
14658
        packet.append(self.ResponseHeader.to_binary())
14659
        packet.append(self.Parameters.to_binary())
14660
        return b''.join(packet)
14661
14662
    @staticmethod
14663
    def from_binary(data):
14664
        return TransferSubscriptionsResponse(data)
14665 1
14666
    def _binary_init(self, data):
14667
        self.TypeId = NodeId.from_binary(data)
14668
        self.ResponseHeader = ResponseHeader.from_binary(data)
14669
        self.Parameters = TransferSubscriptionsResult.from_binary(data)
14670
14671
    def __str__(self):
14672
        return 'TransferSubscriptionsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
14673
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
14674
               'Parameters:' + str(self.Parameters) + ')'
14675
14676
    __repr__ = __str__
14677
14678
14679
class DeleteSubscriptionsParameters(FrozenClass):
14680
    '''
14681
    :ivar SubscriptionIds:
14682
    :vartype SubscriptionIds: UInt32
14683
    '''
14684 1
14685
    ua_types = (
14686
14687
        ('SubscriptionIds', 'ListOfUInt32'),
14688
               )
14689
14690
    def __init__(self, binary=None):
14691
        if binary is not None:
14692
            self._binary_init(binary)
14693
            self._freeze = True
14694
            return
14695
        self.SubscriptionIds = []
14696
        self._freeze = True
14697
14698
    def to_binary(self):
14699
        packet = []
14700 1
        packet.append(uabin.Primitives.Int32.pack(len(self.SubscriptionIds)))
14701
        for fieldname in self.SubscriptionIds:
14702
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
14703
        return b''.join(packet)
14704 1
14705
    @staticmethod
14706
    def from_binary(data):
14707
        return DeleteSubscriptionsParameters(data)
14708
14709
    def _binary_init(self, data):
14710
        self.SubscriptionIds = uabin.Primitives.UInt32.unpack_array(data)
14711
14712
    def __str__(self):
14713
        return 'DeleteSubscriptionsParameters(' + 'SubscriptionIds:' + str(self.SubscriptionIds) + ')'
14714
14715
    __repr__ = __str__
14716
14717
14718 1
class DeleteSubscriptionsRequest(FrozenClass):
14719
    '''
14720
    :ivar TypeId:
14721
    :vartype TypeId: NodeId
14722
    :ivar RequestHeader:
14723
    :vartype RequestHeader: RequestHeader
14724
    :ivar Parameters:
14725
    :vartype Parameters: DeleteSubscriptionsParameters
14726
    '''
14727
14728
    ua_types = (
14729
14730
        ('TypeId', 'NodeId'),
14731
        ('RequestHeader', 'RequestHeader'),
14732 1
        ('Parameters', 'DeleteSubscriptionsParameters'),
14733
               )
14734
14735 1
    def __init__(self, binary=None):
14736
        if binary is not None:
14737
            self._binary_init(binary)
14738
            self._freeze = True
14739
            return
14740
        self.TypeId = FourByteNodeId(ObjectIds.DeleteSubscriptionsRequest_Encoding_DefaultBinary)
14741
        self.RequestHeader = RequestHeader()
14742
        self.Parameters = DeleteSubscriptionsParameters()
14743
        self._freeze = True
14744
14745
    def to_binary(self):
14746
        packet = []
14747
        packet.append(self.TypeId.to_binary())
14748
        packet.append(self.RequestHeader.to_binary())
14749
        packet.append(self.Parameters.to_binary())
14750
        return b''.join(packet)
14751 1
14752
    @staticmethod
14753
    def from_binary(data):
14754
        return DeleteSubscriptionsRequest(data)
14755
14756
    def _binary_init(self, data):
14757
        self.TypeId = NodeId.from_binary(data)
14758
        self.RequestHeader = RequestHeader.from_binary(data)
14759
        self.Parameters = DeleteSubscriptionsParameters.from_binary(data)
14760 1
14761
    def __str__(self):
14762
        return 'DeleteSubscriptionsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
14763
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
14764
               'Parameters:' + str(self.Parameters) + ')'
14765
14766
    __repr__ = __str__
14767
14768
14769
class DeleteSubscriptionsResponse(FrozenClass):
14770
    '''
14771
    :ivar TypeId:
14772
    :vartype TypeId: NodeId
14773 1
    :ivar ResponseHeader:
14774
    :vartype ResponseHeader: ResponseHeader
14775
    :ivar Results:
14776
    :vartype Results: StatusCode
14777
    :ivar DiagnosticInfos:
14778
    :vartype DiagnosticInfos: DiagnosticInfo
14779
    '''
14780
14781
    ua_types = (
14782
14783 1
        ('TypeId', 'NodeId'),
14784
        ('ResponseHeader', 'ResponseHeader'),
14785
        ('Results', 'ListOfStatusCode'),
14786
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
14787 1
               )
14788
14789
    def __init__(self, binary=None):
14790
        if binary is not None:
14791
            self._binary_init(binary)
14792
            self._freeze = True
14793
            return
14794
        self.TypeId = FourByteNodeId(ObjectIds.DeleteSubscriptionsResponse_Encoding_DefaultBinary)
14795 1
        self.ResponseHeader = ResponseHeader()
14796
        self.Results = []
14797
        self.DiagnosticInfos = []
14798
        self._freeze = True
14799
14800
    def to_binary(self):
14801
        packet = []
14802
        packet.append(self.TypeId.to_binary())
14803 1
        packet.append(self.ResponseHeader.to_binary())
14804
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
14805
        for fieldname in self.Results:
14806 1
            packet.append(fieldname.to_binary())
14807
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
14808
        for fieldname in self.DiagnosticInfos:
14809
            packet.append(fieldname.to_binary())
14810
        return b''.join(packet)
14811
14812
    @staticmethod
14813
    def from_binary(data):
14814
        return DeleteSubscriptionsResponse(data)
14815
14816
    def _binary_init(self, data):
14817
        self.TypeId = NodeId.from_binary(data)
14818
        self.ResponseHeader = ResponseHeader.from_binary(data)
14819
        length = uabin.Primitives.Int32.unpack(data)
14820
        array = []
14821
        if length != -1:
14822
            for _ in range(0, length):
14823
                array.append(StatusCode.from_binary(data))
14824
        self.Results = array
14825
        length = uabin.Primitives.Int32.unpack(data)
14826
        array = []
14827
        if length != -1:
14828
            for _ in range(0, length):
14829
                array.append(DiagnosticInfo.from_binary(data))
14830
        self.DiagnosticInfos = array
14831
14832
    def __str__(self):
14833
        return 'DeleteSubscriptionsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
14834
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
14835
               'Results:' + str(self.Results) + ', ' + \
14836
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
14837
14838
    __repr__ = __str__
14839
14840
14841
class BuildInfo(FrozenClass):
14842
    '''
14843
    :ivar ProductUri:
14844
    :vartype ProductUri: String
14845
    :ivar ManufacturerName:
14846
    :vartype ManufacturerName: String
14847
    :ivar ProductName:
14848
    :vartype ProductName: String
14849
    :ivar SoftwareVersion:
14850
    :vartype SoftwareVersion: String
14851
    :ivar BuildNumber:
14852
    :vartype BuildNumber: String
14853
    :ivar BuildDate:
14854
    :vartype BuildDate: DateTime
14855
    '''
14856
14857
    ua_types = (
14858
14859
        ('ProductUri', 'String'),
14860
        ('ManufacturerName', 'String'),
14861
        ('ProductName', 'String'),
14862
        ('SoftwareVersion', 'String'),
14863
        ('BuildNumber', 'String'),
14864
        ('BuildDate', 'DateTime'),
14865
               )
14866
14867
    def __init__(self, binary=None):
14868
        if binary is not None:
14869
            self._binary_init(binary)
14870
            self._freeze = True
14871
            return
14872
        self.ProductUri = None
14873
        self.ManufacturerName = None
14874
        self.ProductName = None
14875
        self.SoftwareVersion = None
14876
        self.BuildNumber = None
14877
        self.BuildDate = datetime.utcnow()
14878
        self._freeze = True
14879
14880
    def to_binary(self):
14881
        packet = []
14882
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
14883
        packet.append(uabin.Primitives.String.pack(self.ManufacturerName))
14884
        packet.append(uabin.Primitives.String.pack(self.ProductName))
14885
        packet.append(uabin.Primitives.String.pack(self.SoftwareVersion))
14886
        packet.append(uabin.Primitives.String.pack(self.BuildNumber))
14887
        packet.append(uabin.Primitives.DateTime.pack(self.BuildDate))
14888
        return b''.join(packet)
14889
14890
    @staticmethod
14891
    def from_binary(data):
14892
        return BuildInfo(data)
14893
14894
    def _binary_init(self, data):
14895
        self.ProductUri = uabin.Primitives.String.unpack(data)
14896 1
        self.ManufacturerName = uabin.Primitives.String.unpack(data)
14897
        self.ProductName = uabin.Primitives.String.unpack(data)
14898
        self.SoftwareVersion = uabin.Primitives.String.unpack(data)
14899
        self.BuildNumber = uabin.Primitives.String.unpack(data)
14900
        self.BuildDate = uabin.Primitives.DateTime.unpack(data)
14901
14902
    def __str__(self):
14903
        return 'BuildInfo(' + 'ProductUri:' + str(self.ProductUri) + ', ' + \
14904
               'ManufacturerName:' + str(self.ManufacturerName) + ', ' + \
14905
               'ProductName:' + str(self.ProductName) + ', ' + \
14906
               'SoftwareVersion:' + str(self.SoftwareVersion) + ', ' + \
14907
               'BuildNumber:' + str(self.BuildNumber) + ', ' + \
14908
               'BuildDate:' + str(self.BuildDate) + ')'
14909
14910
    __repr__ = __str__
14911
14912
14913
class RedundantServerDataType(FrozenClass):
14914
    '''
14915
    :ivar ServerId:
14916
    :vartype ServerId: String
14917
    :ivar ServiceLevel:
14918
    :vartype ServiceLevel: Byte
14919
    :ivar ServerState:
14920
    :vartype ServerState: ServerState
14921
    '''
14922
14923
    ua_types = (
14924
14925
        ('ServerId', 'String'),
14926
        ('ServiceLevel', 'Byte'),
14927
        ('ServerState', 'ServerState'),
14928
               )
14929
14930
    def __init__(self, binary=None):
14931
        if binary is not None:
14932
            self._binary_init(binary)
14933
            self._freeze = True
14934
            return
14935
        self.ServerId = None
14936
        self.ServiceLevel = 0
14937
        self.ServerState = ServerState(0)
14938
        self._freeze = True
14939
14940
    def to_binary(self):
14941
        packet = []
14942 1
        packet.append(uabin.Primitives.String.pack(self.ServerId))
14943
        packet.append(uabin.Primitives.Byte.pack(self.ServiceLevel))
14944
        packet.append(uabin.Primitives.UInt32.pack(self.ServerState.value))
14945
        return b''.join(packet)
14946
14947
    @staticmethod
14948
    def from_binary(data):
14949
        return RedundantServerDataType(data)
14950
14951
    def _binary_init(self, data):
14952
        self.ServerId = uabin.Primitives.String.unpack(data)
14953
        self.ServiceLevel = uabin.Primitives.Byte.unpack(data)
14954
        self.ServerState = ServerState(uabin.Primitives.UInt32.unpack(data))
14955
14956
    def __str__(self):
14957
        return 'RedundantServerDataType(' + 'ServerId:' + str(self.ServerId) + ', ' + \
14958
               'ServiceLevel:' + str(self.ServiceLevel) + ', ' + \
14959
               'ServerState:' + str(self.ServerState) + ')'
14960
14961
    __repr__ = __str__
14962
14963
14964
class EndpointUrlListDataType(FrozenClass):
14965
    '''
14966
    :ivar EndpointUrlList:
14967
    :vartype EndpointUrlList: String
14968
    '''
14969
14970
    ua_types = (
14971
14972
        ('EndpointUrlList', 'ListOfString'),
14973
               )
14974
14975
    def __init__(self, binary=None):
14976
        if binary is not None:
14977
            self._binary_init(binary)
14978
            self._freeze = True
14979
            return
14980
        self.EndpointUrlList = []
14981
        self._freeze = True
14982
14983
    def to_binary(self):
14984
        packet = []
14985
        packet.append(uabin.Primitives.Int32.pack(len(self.EndpointUrlList)))
14986
        for fieldname in self.EndpointUrlList:
14987
            packet.append(uabin.Primitives.String.pack(fieldname))
14988
        return b''.join(packet)
14989
14990
    @staticmethod
14991
    def from_binary(data):
14992 1
        return EndpointUrlListDataType(data)
14993
14994
    def _binary_init(self, data):
14995
        self.EndpointUrlList = uabin.Primitives.String.unpack_array(data)
14996
14997
    def __str__(self):
14998
        return 'EndpointUrlListDataType(' + 'EndpointUrlList:' + str(self.EndpointUrlList) + ')'
14999
15000
    __repr__ = __str__
15001
15002
15003
class NetworkGroupDataType(FrozenClass):
15004
    '''
15005
    :ivar ServerUri:
15006
    :vartype ServerUri: String
15007
    :ivar NetworkPaths:
15008
    :vartype NetworkPaths: EndpointUrlListDataType
15009
    '''
15010
15011
    ua_types = (
15012
15013
        ('ServerUri', 'String'),
15014
        ('NetworkPaths', 'ListOfEndpointUrlListDataType'),
15015
               )
15016
15017
    def __init__(self, binary=None):
15018
        if binary is not None:
15019
            self._binary_init(binary)
15020
            self._freeze = True
15021
            return
15022
        self.ServerUri = None
15023
        self.NetworkPaths = []
15024
        self._freeze = True
15025
15026
    def to_binary(self):
15027
        packet = []
15028
        packet.append(uabin.Primitives.String.pack(self.ServerUri))
15029
        packet.append(uabin.Primitives.Int32.pack(len(self.NetworkPaths)))
15030
        for fieldname in self.NetworkPaths:
15031
            packet.append(fieldname.to_binary())
15032
        return b''.join(packet)
15033
15034
    @staticmethod
15035
    def from_binary(data):
15036
        return NetworkGroupDataType(data)
15037
15038
    def _binary_init(self, data):
15039
        self.ServerUri = uabin.Primitives.String.unpack(data)
15040
        length = uabin.Primitives.Int32.unpack(data)
15041 1
        array = []
15042
        if length != -1:
15043
            for _ in range(0, length):
15044
                array.append(EndpointUrlListDataType.from_binary(data))
15045 1
        self.NetworkPaths = array
15046
15047
    def __str__(self):
15048
        return 'NetworkGroupDataType(' + 'ServerUri:' + str(self.ServerUri) + ', ' + \
15049
               'NetworkPaths:' + str(self.NetworkPaths) + ')'
15050
15051
    __repr__ = __str__
15052
15053
15054
class SamplingIntervalDiagnosticsDataType(FrozenClass):
15055
    '''
15056
    :ivar SamplingInterval:
15057
    :vartype SamplingInterval: Double
15058
    :ivar MonitoredItemCount:
15059
    :vartype MonitoredItemCount: UInt32
15060
    :ivar MaxMonitoredItemCount:
15061
    :vartype MaxMonitoredItemCount: UInt32
15062
    :ivar DisabledMonitoredItemCount:
15063
    :vartype DisabledMonitoredItemCount: UInt32
15064
    '''
15065
15066
    ua_types = (
15067
15068
        ('SamplingInterval', 'Double'),
15069
        ('MonitoredItemCount', 'UInt32'),
15070
        ('MaxMonitoredItemCount', 'UInt32'),
15071
        ('DisabledMonitoredItemCount', 'UInt32'),
15072
               )
15073
15074
    def __init__(self, binary=None):
15075
        if binary is not None:
15076
            self._binary_init(binary)
15077
            self._freeze = True
15078
            return
15079
        self.SamplingInterval = 0
15080
        self.MonitoredItemCount = 0
15081
        self.MaxMonitoredItemCount = 0
15082
        self.DisabledMonitoredItemCount = 0
15083
        self._freeze = True
15084
15085
    def to_binary(self):
15086
        packet = []
15087
        packet.append(uabin.Primitives.Double.pack(self.SamplingInterval))
15088
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoredItemCount))
15089
        packet.append(uabin.Primitives.UInt32.pack(self.MaxMonitoredItemCount))
15090 1
        packet.append(uabin.Primitives.UInt32.pack(self.DisabledMonitoredItemCount))
15091
        return b''.join(packet)
15092
15093
    @staticmethod
15094
    def from_binary(data):
15095
        return SamplingIntervalDiagnosticsDataType(data)
15096
15097
    def _binary_init(self, data):
15098
        self.SamplingInterval = uabin.Primitives.Double.unpack(data)
15099
        self.MonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
15100
        self.MaxMonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
15101
        self.DisabledMonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
15102
15103
    def __str__(self):
15104
        return 'SamplingIntervalDiagnosticsDataType(' + 'SamplingInterval:' + str(self.SamplingInterval) + ', ' + \
15105
               'MonitoredItemCount:' + str(self.MonitoredItemCount) + ', ' + \
15106
               'MaxMonitoredItemCount:' + str(self.MaxMonitoredItemCount) + ', ' + \
15107
               'DisabledMonitoredItemCount:' + str(self.DisabledMonitoredItemCount) + ')'
15108
15109
    __repr__ = __str__
15110
15111
15112
class ServerDiagnosticsSummaryDataType(FrozenClass):
15113
    '''
15114
    :ivar ServerViewCount:
15115
    :vartype ServerViewCount: UInt32
15116
    :ivar CurrentSessionCount:
15117
    :vartype CurrentSessionCount: UInt32
15118
    :ivar CumulatedSessionCount:
15119
    :vartype CumulatedSessionCount: UInt32
15120
    :ivar SecurityRejectedSessionCount:
15121
    :vartype SecurityRejectedSessionCount: UInt32
15122
    :ivar RejectedSessionCount:
15123
    :vartype RejectedSessionCount: UInt32
15124
    :ivar SessionTimeoutCount:
15125
    :vartype SessionTimeoutCount: UInt32
15126
    :ivar SessionAbortCount:
15127
    :vartype SessionAbortCount: UInt32
15128
    :ivar CurrentSubscriptionCount:
15129
    :vartype CurrentSubscriptionCount: UInt32
15130
    :ivar CumulatedSubscriptionCount:
15131
    :vartype CumulatedSubscriptionCount: UInt32
15132
    :ivar PublishingIntervalCount:
15133
    :vartype PublishingIntervalCount: UInt32
15134
    :ivar SecurityRejectedRequestsCount:
15135 1
    :vartype SecurityRejectedRequestsCount: UInt32
15136
    :ivar RejectedRequestsCount:
15137
    :vartype RejectedRequestsCount: UInt32
15138 1
    '''
15139
15140
    ua_types = (
15141
15142
        ('ServerViewCount', 'UInt32'),
15143
        ('CurrentSessionCount', 'UInt32'),
15144
        ('CumulatedSessionCount', 'UInt32'),
15145
        ('SecurityRejectedSessionCount', 'UInt32'),
15146
        ('RejectedSessionCount', 'UInt32'),
15147
        ('SessionTimeoutCount', 'UInt32'),
15148
        ('SessionAbortCount', 'UInt32'),
15149
        ('CurrentSubscriptionCount', 'UInt32'),
15150
        ('CumulatedSubscriptionCount', 'UInt32'),
15151
        ('PublishingIntervalCount', 'UInt32'),
15152
        ('SecurityRejectedRequestsCount', 'UInt32'),
15153
        ('RejectedRequestsCount', 'UInt32'),
15154 View Code Duplication
               )
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15155
15156
    def __init__(self, binary=None):
15157
        if binary is not None:
15158
            self._binary_init(binary)
15159
            self._freeze = True
15160 1
            return
15161
        self.ServerViewCount = 0
15162
        self.CurrentSessionCount = 0
15163
        self.CumulatedSessionCount = 0
15164
        self.SecurityRejectedSessionCount = 0
15165
        self.RejectedSessionCount = 0
15166
        self.SessionTimeoutCount = 0
15167
        self.SessionAbortCount = 0
15168
        self.CurrentSubscriptionCount = 0
15169
        self.CumulatedSubscriptionCount = 0
15170
        self.PublishingIntervalCount = 0
15171
        self.SecurityRejectedRequestsCount = 0
15172 1
        self.RejectedRequestsCount = 0
15173
        self._freeze = True
15174
15175
    def to_binary(self):
15176
        packet = []
15177
        packet.append(uabin.Primitives.UInt32.pack(self.ServerViewCount))
15178
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentSessionCount))
15179
        packet.append(uabin.Primitives.UInt32.pack(self.CumulatedSessionCount))
15180
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityRejectedSessionCount))
15181
        packet.append(uabin.Primitives.UInt32.pack(self.RejectedSessionCount))
15182
        packet.append(uabin.Primitives.UInt32.pack(self.SessionTimeoutCount))
15183
        packet.append(uabin.Primitives.UInt32.pack(self.SessionAbortCount))
15184
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentSubscriptionCount))
15185
        packet.append(uabin.Primitives.UInt32.pack(self.CumulatedSubscriptionCount))
15186
        packet.append(uabin.Primitives.UInt32.pack(self.PublishingIntervalCount))
15187
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityRejectedRequestsCount))
15188 1
        packet.append(uabin.Primitives.UInt32.pack(self.RejectedRequestsCount))
15189
        return b''.join(packet)
15190
15191
    @staticmethod
15192
    def from_binary(data):
15193
        return ServerDiagnosticsSummaryDataType(data)
15194
15195
    def _binary_init(self, data):
15196
        self.ServerViewCount = uabin.Primitives.UInt32.unpack(data)
15197
        self.CurrentSessionCount = uabin.Primitives.UInt32.unpack(data)
15198
        self.CumulatedSessionCount = uabin.Primitives.UInt32.unpack(data)
15199
        self.SecurityRejectedSessionCount = uabin.Primitives.UInt32.unpack(data)
15200
        self.RejectedSessionCount = uabin.Primitives.UInt32.unpack(data)
15201
        self.SessionTimeoutCount = uabin.Primitives.UInt32.unpack(data)
15202
        self.SessionAbortCount = uabin.Primitives.UInt32.unpack(data)
15203 1
        self.CurrentSubscriptionCount = uabin.Primitives.UInt32.unpack(data)
15204
        self.CumulatedSubscriptionCount = uabin.Primitives.UInt32.unpack(data)
15205
        self.PublishingIntervalCount = uabin.Primitives.UInt32.unpack(data)
15206
        self.SecurityRejectedRequestsCount = uabin.Primitives.UInt32.unpack(data)
15207 1
        self.RejectedRequestsCount = uabin.Primitives.UInt32.unpack(data)
15208
15209
    def __str__(self):
15210
        return 'ServerDiagnosticsSummaryDataType(' + 'ServerViewCount:' + str(self.ServerViewCount) + ', ' + \
15211
               'CurrentSessionCount:' + str(self.CurrentSessionCount) + ', ' + \
15212
               'CumulatedSessionCount:' + str(self.CumulatedSessionCount) + ', ' + \
15213
               'SecurityRejectedSessionCount:' + str(self.SecurityRejectedSessionCount) + ', ' + \
15214
               'RejectedSessionCount:' + str(self.RejectedSessionCount) + ', ' + \
15215
               'SessionTimeoutCount:' + str(self.SessionTimeoutCount) + ', ' + \
15216
               'SessionAbortCount:' + str(self.SessionAbortCount) + ', ' + \
15217
               'CurrentSubscriptionCount:' + str(self.CurrentSubscriptionCount) + ', ' + \
15218 1
               'CumulatedSubscriptionCount:' + str(self.CumulatedSubscriptionCount) + ', ' + \
15219
               'PublishingIntervalCount:' + str(self.PublishingIntervalCount) + ', ' + \
15220
               'SecurityRejectedRequestsCount:' + str(self.SecurityRejectedRequestsCount) + ', ' + \
15221
               'RejectedRequestsCount:' + str(self.RejectedRequestsCount) + ')'
15222
15223
    __repr__ = __str__
15224
15225
15226
class ServerStatusDataType(FrozenClass):
15227
    '''
15228
    :ivar StartTime:
15229 1
    :vartype StartTime: DateTime
15230
    :ivar CurrentTime:
15231
    :vartype CurrentTime: DateTime
15232 1
    :ivar State:
15233
    :vartype State: ServerState
15234
    :ivar BuildInfo:
15235
    :vartype BuildInfo: BuildInfo
15236
    :ivar SecondsTillShutdown:
15237
    :vartype SecondsTillShutdown: UInt32
15238
    :ivar ShutdownReason:
15239
    :vartype ShutdownReason: LocalizedText
15240 1
    '''
15241
15242
    ua_types = (
15243
15244
        ('StartTime', 'DateTime'),
15245 1
        ('CurrentTime', 'DateTime'),
15246
        ('State', 'ServerState'),
15247
        ('BuildInfo', 'BuildInfo'),
15248
        ('SecondsTillShutdown', 'UInt32'),
15249
        ('ShutdownReason', 'LocalizedText'),
15250
               )
15251
15252
    def __init__(self, binary=None):
15253
        if binary is not None:
15254 1
            self._binary_init(binary)
15255
            self._freeze = True
15256
            return
15257
        self.StartTime = datetime.utcnow()
15258
        self.CurrentTime = datetime.utcnow()
15259
        self.State = ServerState(0)
15260 1
        self.BuildInfo = BuildInfo()
15261
        self.SecondsTillShutdown = 0
15262
        self.ShutdownReason = LocalizedText()
15263
        self._freeze = True
15264 1
15265
    def to_binary(self):
15266
        packet = []
15267
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
15268 1
        packet.append(uabin.Primitives.DateTime.pack(self.CurrentTime))
15269
        packet.append(uabin.Primitives.UInt32.pack(self.State.value))
15270
        packet.append(self.BuildInfo.to_binary())
15271
        packet.append(uabin.Primitives.UInt32.pack(self.SecondsTillShutdown))
15272 1
        packet.append(self.ShutdownReason.to_binary())
15273
        return b''.join(packet)
15274
15275 1
    @staticmethod
15276
    def from_binary(data):
15277
        return ServerStatusDataType(data)
15278
15279
    def _binary_init(self, data):
15280
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
15281
        self.CurrentTime = uabin.Primitives.DateTime.unpack(data)
15282
        self.State = ServerState(uabin.Primitives.UInt32.unpack(data))
15283 1
        self.BuildInfo = BuildInfo.from_binary(data)
15284
        self.SecondsTillShutdown = uabin.Primitives.UInt32.unpack(data)
15285
        self.ShutdownReason = LocalizedText.from_binary(data)
15286
15287
    def __str__(self):
15288 1
        return 'ServerStatusDataType(' + 'StartTime:' + str(self.StartTime) + ', ' + \
15289
               'CurrentTime:' + str(self.CurrentTime) + ', ' + \
15290
               'State:' + str(self.State) + ', ' + \
15291
               'BuildInfo:' + str(self.BuildInfo) + ', ' + \
15292
               'SecondsTillShutdown:' + str(self.SecondsTillShutdown) + ', ' + \
15293
               'ShutdownReason:' + str(self.ShutdownReason) + ')'
15294
15295
    __repr__ = __str__
15296
15297 1
15298
class SessionDiagnosticsDataType(FrozenClass):
15299
    '''
15300
    :ivar SessionId:
15301
    :vartype SessionId: NodeId
15302
    :ivar SessionName:
15303 1
    :vartype SessionName: String
15304
    :ivar ClientDescription:
15305
    :vartype ClientDescription: ApplicationDescription
15306
    :ivar ServerUri:
15307 1
    :vartype ServerUri: String
15308
    :ivar EndpointUrl:
15309
    :vartype EndpointUrl: String
15310
    :ivar LocaleIds:
15311 1
    :vartype LocaleIds: String
15312
    :ivar ActualSessionTimeout:
15313
    :vartype ActualSessionTimeout: Double
15314
    :ivar MaxResponseMessageSize:
15315 1
    :vartype MaxResponseMessageSize: UInt32
15316
    :ivar ClientConnectionTime:
15317
    :vartype ClientConnectionTime: DateTime
15318 1
    :ivar ClientLastContactTime:
15319
    :vartype ClientLastContactTime: DateTime
15320
    :ivar CurrentSubscriptionsCount:
15321
    :vartype CurrentSubscriptionsCount: UInt32
15322
    :ivar CurrentMonitoredItemsCount:
15323
    :vartype CurrentMonitoredItemsCount: UInt32
15324
    :ivar CurrentPublishRequestsInQueue:
15325
    :vartype CurrentPublishRequestsInQueue: UInt32
15326
    :ivar TotalRequestCount:
15327
    :vartype TotalRequestCount: ServiceCounterDataType
15328
    :ivar UnauthorizedRequestCount:
15329
    :vartype UnauthorizedRequestCount: UInt32
15330
    :ivar ReadCount:
15331
    :vartype ReadCount: ServiceCounterDataType
15332
    :ivar HistoryReadCount:
15333
    :vartype HistoryReadCount: ServiceCounterDataType
15334
    :ivar WriteCount:
15335
    :vartype WriteCount: ServiceCounterDataType
15336
    :ivar HistoryUpdateCount:
15337
    :vartype HistoryUpdateCount: ServiceCounterDataType
15338
    :ivar CallCount:
15339
    :vartype CallCount: ServiceCounterDataType
15340
    :ivar CreateMonitoredItemsCount:
15341
    :vartype CreateMonitoredItemsCount: ServiceCounterDataType
15342
    :ivar ModifyMonitoredItemsCount:
15343
    :vartype ModifyMonitoredItemsCount: ServiceCounterDataType
15344
    :ivar SetMonitoringModeCount:
15345
    :vartype SetMonitoringModeCount: ServiceCounterDataType
15346
    :ivar SetTriggeringCount:
15347
    :vartype SetTriggeringCount: ServiceCounterDataType
15348
    :ivar DeleteMonitoredItemsCount:
15349
    :vartype DeleteMonitoredItemsCount: ServiceCounterDataType
15350
    :ivar CreateSubscriptionCount:
15351
    :vartype CreateSubscriptionCount: ServiceCounterDataType
15352
    :ivar ModifySubscriptionCount:
15353
    :vartype ModifySubscriptionCount: ServiceCounterDataType
15354
    :ivar SetPublishingModeCount:
15355
    :vartype SetPublishingModeCount: ServiceCounterDataType
15356
    :ivar PublishCount:
15357
    :vartype PublishCount: ServiceCounterDataType
15358
    :ivar RepublishCount:
15359
    :vartype RepublishCount: ServiceCounterDataType
15360
    :ivar TransferSubscriptionsCount:
15361
    :vartype TransferSubscriptionsCount: ServiceCounterDataType
15362
    :ivar DeleteSubscriptionsCount:
15363
    :vartype DeleteSubscriptionsCount: ServiceCounterDataType
15364
    :ivar AddNodesCount:
15365
    :vartype AddNodesCount: ServiceCounterDataType
15366
    :ivar AddReferencesCount:
15367
    :vartype AddReferencesCount: ServiceCounterDataType
15368
    :ivar DeleteNodesCount:
15369
    :vartype DeleteNodesCount: ServiceCounterDataType
15370
    :ivar DeleteReferencesCount:
15371
    :vartype DeleteReferencesCount: ServiceCounterDataType
15372
    :ivar BrowseCount:
15373
    :vartype BrowseCount: ServiceCounterDataType
15374
    :ivar BrowseNextCount:
15375
    :vartype BrowseNextCount: ServiceCounterDataType
15376
    :ivar TranslateBrowsePathsToNodeIdsCount:
15377
    :vartype TranslateBrowsePathsToNodeIdsCount: ServiceCounterDataType
15378
    :ivar QueryFirstCount:
15379
    :vartype QueryFirstCount: ServiceCounterDataType
15380
    :ivar QueryNextCount:
15381
    :vartype QueryNextCount: ServiceCounterDataType
15382
    :ivar RegisterNodesCount:
15383
    :vartype RegisterNodesCount: ServiceCounterDataType
15384 1
    :ivar UnregisterNodesCount:
15385
    :vartype UnregisterNodesCount: ServiceCounterDataType
15386
    '''
15387
15388
    ua_types = (
15389
15390
        ('SessionId', 'NodeId'),
15391
        ('SessionName', 'String'),
15392
        ('ClientDescription', 'ApplicationDescription'),
15393
        ('ServerUri', 'String'),
15394
        ('EndpointUrl', 'String'),
15395
        ('LocaleIds', 'ListOfString'),
15396
        ('ActualSessionTimeout', 'Double'),
15397
        ('MaxResponseMessageSize', 'UInt32'),
15398
        ('ClientConnectionTime', 'DateTime'),
15399
        ('ClientLastContactTime', 'DateTime'),
15400
        ('CurrentSubscriptionsCount', 'UInt32'),
15401
        ('CurrentMonitoredItemsCount', 'UInt32'),
15402
        ('CurrentPublishRequestsInQueue', 'UInt32'),
15403
        ('TotalRequestCount', 'ServiceCounterDataType'),
15404
        ('UnauthorizedRequestCount', 'UInt32'),
15405
        ('ReadCount', 'ServiceCounterDataType'),
15406
        ('HistoryReadCount', 'ServiceCounterDataType'),
15407
        ('WriteCount', 'ServiceCounterDataType'),
15408
        ('HistoryUpdateCount', 'ServiceCounterDataType'),
15409
        ('CallCount', 'ServiceCounterDataType'),
15410
        ('CreateMonitoredItemsCount', 'ServiceCounterDataType'),
15411
        ('ModifyMonitoredItemsCount', 'ServiceCounterDataType'),
15412
        ('SetMonitoringModeCount', 'ServiceCounterDataType'),
15413
        ('SetTriggeringCount', 'ServiceCounterDataType'),
15414
        ('DeleteMonitoredItemsCount', 'ServiceCounterDataType'),
15415
        ('CreateSubscriptionCount', 'ServiceCounterDataType'),
15416
        ('ModifySubscriptionCount', 'ServiceCounterDataType'),
15417
        ('SetPublishingModeCount', 'ServiceCounterDataType'),
15418 1
        ('PublishCount', 'ServiceCounterDataType'),
15419
        ('RepublishCount', 'ServiceCounterDataType'),
15420
        ('TransferSubscriptionsCount', 'ServiceCounterDataType'),
15421
        ('DeleteSubscriptionsCount', 'ServiceCounterDataType'),
15422
        ('AddNodesCount', 'ServiceCounterDataType'),
15423
        ('AddReferencesCount', 'ServiceCounterDataType'),
15424
        ('DeleteNodesCount', 'ServiceCounterDataType'),
15425
        ('DeleteReferencesCount', 'ServiceCounterDataType'),
15426
        ('BrowseCount', 'ServiceCounterDataType'),
15427
        ('BrowseNextCount', 'ServiceCounterDataType'),
15428
        ('TranslateBrowsePathsToNodeIdsCount', 'ServiceCounterDataType'),
15429
        ('QueryFirstCount', 'ServiceCounterDataType'),
15430
        ('QueryNextCount', 'ServiceCounterDataType'),
15431
        ('RegisterNodesCount', 'ServiceCounterDataType'),
15432
        ('UnregisterNodesCount', 'ServiceCounterDataType'),
15433
               )
15434
15435
    def __init__(self, binary=None):
15436
        if binary is not None:
15437
            self._binary_init(binary)
15438
            self._freeze = True
15439
            return
15440
        self.SessionId = NodeId()
15441
        self.SessionName = None
15442
        self.ClientDescription = ApplicationDescription()
15443
        self.ServerUri = None
15444
        self.EndpointUrl = None
15445
        self.LocaleIds = []
15446
        self.ActualSessionTimeout = 0
15447
        self.MaxResponseMessageSize = 0
15448
        self.ClientConnectionTime = datetime.utcnow()
15449
        self.ClientLastContactTime = datetime.utcnow()
15450
        self.CurrentSubscriptionsCount = 0
15451
        self.CurrentMonitoredItemsCount = 0
15452
        self.CurrentPublishRequestsInQueue = 0
15453
        self.TotalRequestCount = ServiceCounterDataType()
15454
        self.UnauthorizedRequestCount = 0
15455
        self.ReadCount = ServiceCounterDataType()
15456 1
        self.HistoryReadCount = ServiceCounterDataType()
15457
        self.WriteCount = ServiceCounterDataType()
15458
        self.HistoryUpdateCount = ServiceCounterDataType()
15459
        self.CallCount = ServiceCounterDataType()
15460
        self.CreateMonitoredItemsCount = ServiceCounterDataType()
15461
        self.ModifyMonitoredItemsCount = ServiceCounterDataType()
15462
        self.SetMonitoringModeCount = ServiceCounterDataType()
15463
        self.SetTriggeringCount = ServiceCounterDataType()
15464
        self.DeleteMonitoredItemsCount = ServiceCounterDataType()
15465
        self.CreateSubscriptionCount = ServiceCounterDataType()
15466
        self.ModifySubscriptionCount = ServiceCounterDataType()
15467
        self.SetPublishingModeCount = ServiceCounterDataType()
15468
        self.PublishCount = ServiceCounterDataType()
15469
        self.RepublishCount = ServiceCounterDataType()
15470
        self.TransferSubscriptionsCount = ServiceCounterDataType()
15471
        self.DeleteSubscriptionsCount = ServiceCounterDataType()
15472
        self.AddNodesCount = ServiceCounterDataType()
15473
        self.AddReferencesCount = ServiceCounterDataType()
15474
        self.DeleteNodesCount = ServiceCounterDataType()
15475
        self.DeleteReferencesCount = ServiceCounterDataType()
15476
        self.BrowseCount = ServiceCounterDataType()
15477
        self.BrowseNextCount = ServiceCounterDataType()
15478
        self.TranslateBrowsePathsToNodeIdsCount = ServiceCounterDataType()
15479
        self.QueryFirstCount = ServiceCounterDataType()
15480
        self.QueryNextCount = ServiceCounterDataType()
15481
        self.RegisterNodesCount = ServiceCounterDataType()
15482
        self.UnregisterNodesCount = ServiceCounterDataType()
15483
        self._freeze = True
15484
15485
    def to_binary(self):
15486
        packet = []
15487
        packet.append(self.SessionId.to_binary())
15488
        packet.append(uabin.Primitives.String.pack(self.SessionName))
15489
        packet.append(self.ClientDescription.to_binary())
15490
        packet.append(uabin.Primitives.String.pack(self.ServerUri))
15491 1
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
15492
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
15493
        for fieldname in self.LocaleIds:
15494
            packet.append(uabin.Primitives.String.pack(fieldname))
15495 1
        packet.append(uabin.Primitives.Double.pack(self.ActualSessionTimeout))
15496
        packet.append(uabin.Primitives.UInt32.pack(self.MaxResponseMessageSize))
15497
        packet.append(uabin.Primitives.DateTime.pack(self.ClientConnectionTime))
15498
        packet.append(uabin.Primitives.DateTime.pack(self.ClientLastContactTime))
15499
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentSubscriptionsCount))
15500
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentMonitoredItemsCount))
15501
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentPublishRequestsInQueue))
15502
        packet.append(self.TotalRequestCount.to_binary())
15503
        packet.append(uabin.Primitives.UInt32.pack(self.UnauthorizedRequestCount))
15504
        packet.append(self.ReadCount.to_binary())
15505
        packet.append(self.HistoryReadCount.to_binary())
15506
        packet.append(self.WriteCount.to_binary())
15507
        packet.append(self.HistoryUpdateCount.to_binary())
15508
        packet.append(self.CallCount.to_binary())
15509
        packet.append(self.CreateMonitoredItemsCount.to_binary())
15510
        packet.append(self.ModifyMonitoredItemsCount.to_binary())
15511
        packet.append(self.SetMonitoringModeCount.to_binary())
15512
        packet.append(self.SetTriggeringCount.to_binary())
15513
        packet.append(self.DeleteMonitoredItemsCount.to_binary())
15514
        packet.append(self.CreateSubscriptionCount.to_binary())
15515
        packet.append(self.ModifySubscriptionCount.to_binary())
15516
        packet.append(self.SetPublishingModeCount.to_binary())
15517
        packet.append(self.PublishCount.to_binary())
15518
        packet.append(self.RepublishCount.to_binary())
15519
        packet.append(self.TransferSubscriptionsCount.to_binary())
15520
        packet.append(self.DeleteSubscriptionsCount.to_binary())
15521
        packet.append(self.AddNodesCount.to_binary())
15522
        packet.append(self.AddReferencesCount.to_binary())
15523
        packet.append(self.DeleteNodesCount.to_binary())
15524
        packet.append(self.DeleteReferencesCount.to_binary())
15525
        packet.append(self.BrowseCount.to_binary())
15526
        packet.append(self.BrowseNextCount.to_binary())
15527
        packet.append(self.TranslateBrowsePathsToNodeIdsCount.to_binary())
15528 1
        packet.append(self.QueryFirstCount.to_binary())
15529
        packet.append(self.QueryNextCount.to_binary())
15530
        packet.append(self.RegisterNodesCount.to_binary())
15531
        packet.append(self.UnregisterNodesCount.to_binary())
15532
        return b''.join(packet)
15533
15534
    @staticmethod
15535
    def from_binary(data):
15536
        return SessionDiagnosticsDataType(data)
15537
15538
    def _binary_init(self, data):
15539
        self.SessionId = NodeId.from_binary(data)
15540
        self.SessionName = uabin.Primitives.String.unpack(data)
15541
        self.ClientDescription = ApplicationDescription.from_binary(data)
15542
        self.ServerUri = uabin.Primitives.String.unpack(data)
15543
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
15544
        self.LocaleIds = uabin.Primitives.String.unpack_array(data)
15545
        self.ActualSessionTimeout = uabin.Primitives.Double.unpack(data)
15546
        self.MaxResponseMessageSize = uabin.Primitives.UInt32.unpack(data)
15547
        self.ClientConnectionTime = uabin.Primitives.DateTime.unpack(data)
15548
        self.ClientLastContactTime = uabin.Primitives.DateTime.unpack(data)
15549
        self.CurrentSubscriptionsCount = uabin.Primitives.UInt32.unpack(data)
15550
        self.CurrentMonitoredItemsCount = uabin.Primitives.UInt32.unpack(data)
15551
        self.CurrentPublishRequestsInQueue = uabin.Primitives.UInt32.unpack(data)
15552
        self.TotalRequestCount = ServiceCounterDataType.from_binary(data)
15553
        self.UnauthorizedRequestCount = uabin.Primitives.UInt32.unpack(data)
15554
        self.ReadCount = ServiceCounterDataType.from_binary(data)
15555
        self.HistoryReadCount = ServiceCounterDataType.from_binary(data)
15556
        self.WriteCount = ServiceCounterDataType.from_binary(data)
15557
        self.HistoryUpdateCount = ServiceCounterDataType.from_binary(data)
15558
        self.CallCount = ServiceCounterDataType.from_binary(data)
15559
        self.CreateMonitoredItemsCount = ServiceCounterDataType.from_binary(data)
15560
        self.ModifyMonitoredItemsCount = ServiceCounterDataType.from_binary(data)
15561 1
        self.SetMonitoringModeCount = ServiceCounterDataType.from_binary(data)
15562
        self.SetTriggeringCount = ServiceCounterDataType.from_binary(data)
15563
        self.DeleteMonitoredItemsCount = ServiceCounterDataType.from_binary(data)
15564 1
        self.CreateSubscriptionCount = ServiceCounterDataType.from_binary(data)
15565
        self.ModifySubscriptionCount = ServiceCounterDataType.from_binary(data)
15566
        self.SetPublishingModeCount = ServiceCounterDataType.from_binary(data)
15567
        self.PublishCount = ServiceCounterDataType.from_binary(data)
15568
        self.RepublishCount = ServiceCounterDataType.from_binary(data)
15569
        self.TransferSubscriptionsCount = ServiceCounterDataType.from_binary(data)
15570
        self.DeleteSubscriptionsCount = ServiceCounterDataType.from_binary(data)
15571
        self.AddNodesCount = ServiceCounterDataType.from_binary(data)
15572
        self.AddReferencesCount = ServiceCounterDataType.from_binary(data)
15573
        self.DeleteNodesCount = ServiceCounterDataType.from_binary(data)
15574 1
        self.DeleteReferencesCount = ServiceCounterDataType.from_binary(data)
15575
        self.BrowseCount = ServiceCounterDataType.from_binary(data)
15576
        self.BrowseNextCount = ServiceCounterDataType.from_binary(data)
15577
        self.TranslateBrowsePathsToNodeIdsCount = ServiceCounterDataType.from_binary(data)
15578
        self.QueryFirstCount = ServiceCounterDataType.from_binary(data)
15579
        self.QueryNextCount = ServiceCounterDataType.from_binary(data)
15580 1
        self.RegisterNodesCount = ServiceCounterDataType.from_binary(data)
15581
        self.UnregisterNodesCount = ServiceCounterDataType.from_binary(data)
15582
15583
    def __str__(self):
15584
        return 'SessionDiagnosticsDataType(' + 'SessionId:' + str(self.SessionId) + ', ' + \
15585
               'SessionName:' + str(self.SessionName) + ', ' + \
15586
               'ClientDescription:' + str(self.ClientDescription) + ', ' + \
15587
               'ServerUri:' + str(self.ServerUri) + ', ' + \
15588
               'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
15589
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
15590 1
               'ActualSessionTimeout:' + str(self.ActualSessionTimeout) + ', ' + \
15591
               'MaxResponseMessageSize:' + str(self.MaxResponseMessageSize) + ', ' + \
15592
               'ClientConnectionTime:' + str(self.ClientConnectionTime) + ', ' + \
15593
               'ClientLastContactTime:' + str(self.ClientLastContactTime) + ', ' + \
15594
               'CurrentSubscriptionsCount:' + str(self.CurrentSubscriptionsCount) + ', ' + \
15595
               'CurrentMonitoredItemsCount:' + str(self.CurrentMonitoredItemsCount) + ', ' + \
15596
               'CurrentPublishRequestsInQueue:' + str(self.CurrentPublishRequestsInQueue) + ', ' + \
15597 1
               'TotalRequestCount:' + str(self.TotalRequestCount) + ', ' + \
15598
               'UnauthorizedRequestCount:' + str(self.UnauthorizedRequestCount) + ', ' + \
15599
               'ReadCount:' + str(self.ReadCount) + ', ' + \
15600
               'HistoryReadCount:' + str(self.HistoryReadCount) + ', ' + \
15601 1
               'WriteCount:' + str(self.WriteCount) + ', ' + \
15602
               'HistoryUpdateCount:' + str(self.HistoryUpdateCount) + ', ' + \
15603
               'CallCount:' + str(self.CallCount) + ', ' + \
15604
               'CreateMonitoredItemsCount:' + str(self.CreateMonitoredItemsCount) + ', ' + \
15605
               'ModifyMonitoredItemsCount:' + str(self.ModifyMonitoredItemsCount) + ', ' + \
15606 1
               'SetMonitoringModeCount:' + str(self.SetMonitoringModeCount) + ', ' + \
15607
               'SetTriggeringCount:' + str(self.SetTriggeringCount) + ', ' + \
15608
               'DeleteMonitoredItemsCount:' + str(self.DeleteMonitoredItemsCount) + ', ' + \
15609
               'CreateSubscriptionCount:' + str(self.CreateSubscriptionCount) + ', ' + \
15610
               'ModifySubscriptionCount:' + str(self.ModifySubscriptionCount) + ', ' + \
15611 1
               'SetPublishingModeCount:' + str(self.SetPublishingModeCount) + ', ' + \
15612
               'PublishCount:' + str(self.PublishCount) + ', ' + \
15613
               'RepublishCount:' + str(self.RepublishCount) + ', ' + \
15614 1
               'TransferSubscriptionsCount:' + str(self.TransferSubscriptionsCount) + ', ' + \
15615
               'DeleteSubscriptionsCount:' + str(self.DeleteSubscriptionsCount) + ', ' + \
15616
               'AddNodesCount:' + str(self.AddNodesCount) + ', ' + \
15617
               'AddReferencesCount:' + str(self.AddReferencesCount) + ', ' + \
15618
               'DeleteNodesCount:' + str(self.DeleteNodesCount) + ', ' + \
15619
               'DeleteReferencesCount:' + str(self.DeleteReferencesCount) + ', ' + \
15620
               'BrowseCount:' + str(self.BrowseCount) + ', ' + \
15621
               'BrowseNextCount:' + str(self.BrowseNextCount) + ', ' + \
15622 1
               'TranslateBrowsePathsToNodeIdsCount:' + str(self.TranslateBrowsePathsToNodeIdsCount) + ', ' + \
15623
               'QueryFirstCount:' + str(self.QueryFirstCount) + ', ' + \
15624
               'QueryNextCount:' + str(self.QueryNextCount) + ', ' + \
15625
               'RegisterNodesCount:' + str(self.RegisterNodesCount) + ', ' + \
15626
               'UnregisterNodesCount:' + str(self.UnregisterNodesCount) + ')'
15627 1
15628
    __repr__ = __str__
15629
15630
15631
class SessionSecurityDiagnosticsDataType(FrozenClass):
15632
    '''
15633
    :ivar SessionId:
15634
    :vartype SessionId: NodeId
15635
    :ivar ClientUserIdOfSession:
15636 1
    :vartype ClientUserIdOfSession: String
15637
    :ivar ClientUserIdHistory:
15638
    :vartype ClientUserIdHistory: String
15639
    :ivar AuthenticationMechanism:
15640
    :vartype AuthenticationMechanism: String
15641
    :ivar Encoding:
15642 1
    :vartype Encoding: String
15643
    :ivar TransportProtocol:
15644
    :vartype TransportProtocol: String
15645
    :ivar SecurityMode:
15646 1
    :vartype SecurityMode: MessageSecurityMode
15647
    :ivar SecurityPolicyUri:
15648
    :vartype SecurityPolicyUri: String
15649
    :ivar ClientCertificate:
15650 1
    :vartype ClientCertificate: ByteString
15651
    '''
15652
15653
    ua_types = (
15654 1
15655
        ('SessionId', 'NodeId'),
15656
        ('ClientUserIdOfSession', 'String'),
15657 1
        ('ClientUserIdHistory', 'ListOfString'),
15658
        ('AuthenticationMechanism', 'String'),
15659
        ('Encoding', 'String'),
15660
        ('TransportProtocol', 'String'),
15661
        ('SecurityMode', 'MessageSecurityMode'),
15662
        ('SecurityPolicyUri', 'String'),
15663
        ('ClientCertificate', 'ByteString'),
15664
               )
15665 1
15666
    def __init__(self, binary=None):
15667
        if binary is not None:
15668
            self._binary_init(binary)
15669
            self._freeze = True
15670 1
            return
15671
        self.SessionId = NodeId()
15672
        self.ClientUserIdOfSession = None
15673
        self.ClientUserIdHistory = []
15674
        self.AuthenticationMechanism = None
15675
        self.Encoding = None
15676
        self.TransportProtocol = None
15677
        self.SecurityMode = MessageSecurityMode(0)
15678
        self.SecurityPolicyUri = None
15679 1
        self.ClientCertificate = None
15680
        self._freeze = True
15681
15682
    def to_binary(self):
15683
        packet = []
15684
        packet.append(self.SessionId.to_binary())
15685 1
        packet.append(uabin.Primitives.String.pack(self.ClientUserIdOfSession))
15686
        packet.append(uabin.Primitives.Int32.pack(len(self.ClientUserIdHistory)))
15687
        for fieldname in self.ClientUserIdHistory:
15688
            packet.append(uabin.Primitives.String.pack(fieldname))
15689 1
        packet.append(uabin.Primitives.String.pack(self.AuthenticationMechanism))
15690
        packet.append(uabin.Primitives.String.pack(self.Encoding))
15691
        packet.append(uabin.Primitives.String.pack(self.TransportProtocol))
15692
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityMode.value))
15693 1
        packet.append(uabin.Primitives.String.pack(self.SecurityPolicyUri))
15694
        packet.append(uabin.Primitives.ByteString.pack(self.ClientCertificate))
15695
        return b''.join(packet)
15696
15697 1
    @staticmethod
15698
    def from_binary(data):
15699
        return SessionSecurityDiagnosticsDataType(data)
15700 1
15701
    def _binary_init(self, data):
15702
        self.SessionId = NodeId.from_binary(data)
15703
        self.ClientUserIdOfSession = uabin.Primitives.String.unpack(data)
15704
        self.ClientUserIdHistory = uabin.Primitives.String.unpack_array(data)
15705
        self.AuthenticationMechanism = uabin.Primitives.String.unpack(data)
15706
        self.Encoding = uabin.Primitives.String.unpack(data)
15707
        self.TransportProtocol = uabin.Primitives.String.unpack(data)
15708
        self.SecurityMode = MessageSecurityMode(uabin.Primitives.UInt32.unpack(data))
15709 View Code Duplication
        self.SecurityPolicyUri = uabin.Primitives.String.unpack(data)
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15710
        self.ClientCertificate = uabin.Primitives.ByteString.unpack(data)
15711
15712 1
    def __str__(self):
15713
        return 'SessionSecurityDiagnosticsDataType(' + 'SessionId:' + str(self.SessionId) + ', ' + \
15714
               'ClientUserIdOfSession:' + str(self.ClientUserIdOfSession) + ', ' + \
15715
               'ClientUserIdHistory:' + str(self.ClientUserIdHistory) + ', ' + \
15716
               'AuthenticationMechanism:' + str(self.AuthenticationMechanism) + ', ' + \
15717
               'Encoding:' + str(self.Encoding) + ', ' + \
15718
               'TransportProtocol:' + str(self.TransportProtocol) + ', ' + \
15719 1
               'SecurityMode:' + str(self.SecurityMode) + ', ' + \
15720
               'SecurityPolicyUri:' + str(self.SecurityPolicyUri) + ', ' + \
15721
               'ClientCertificate:' + str(self.ClientCertificate) + ')'
15722
15723
    __repr__ = __str__
15724
15725
15726
class ServiceCounterDataType(FrozenClass):
15727
    '''
15728
    :ivar TotalCount:
15729
    :vartype TotalCount: UInt32
15730 1
    :ivar ErrorCount:
15731
    :vartype ErrorCount: UInt32
15732
    '''
15733
15734
    ua_types = (
15735
15736
        ('TotalCount', 'UInt32'),
15737
        ('ErrorCount', 'UInt32'),
15738 1
               )
15739
15740
    def __init__(self, binary=None):
15741
        if binary is not None:
15742 1
            self._binary_init(binary)
15743
            self._freeze = True
15744
            return
15745
        self.TotalCount = 0
15746
        self.ErrorCount = 0
15747
        self._freeze = True
15748 1
15749
    def to_binary(self):
15750
        packet = []
15751
        packet.append(uabin.Primitives.UInt32.pack(self.TotalCount))
15752
        packet.append(uabin.Primitives.UInt32.pack(self.ErrorCount))
15753
        return b''.join(packet)
15754 1
15755
    @staticmethod
15756
    def from_binary(data):
15757 1
        return ServiceCounterDataType(data)
15758
15759
    def _binary_init(self, data):
15760
        self.TotalCount = uabin.Primitives.UInt32.unpack(data)
15761
        self.ErrorCount = uabin.Primitives.UInt32.unpack(data)
15762
15763
    def __str__(self):
15764
        return 'ServiceCounterDataType(' + 'TotalCount:' + str(self.TotalCount) + ', ' + \
15765 1
               'ErrorCount:' + str(self.ErrorCount) + ')'
15766
15767
    __repr__ = __str__
15768
15769
15770 1
class StatusResult(FrozenClass):
15771
    '''
15772
    :ivar StatusCode:
15773
    :vartype StatusCode: StatusCode
15774
    :ivar DiagnosticInfo:
15775
    :vartype DiagnosticInfo: DiagnosticInfo
15776
    '''
15777
15778
    ua_types = (
15779 1
15780
        ('StatusCode', 'StatusCode'),
15781
        ('DiagnosticInfo', 'DiagnosticInfo'),
15782
               )
15783
15784
    def __init__(self, binary=None):
15785 1
        if binary is not None:
15786
            self._binary_init(binary)
15787
            self._freeze = True
15788
            return
15789 1
        self.StatusCode = StatusCode()
15790
        self.DiagnosticInfo = DiagnosticInfo()
15791
        self._freeze = True
15792
15793 1
    def to_binary(self):
15794
        packet = []
15795
        packet.append(self.StatusCode.to_binary())
15796
        packet.append(self.DiagnosticInfo.to_binary())
15797 1
        return b''.join(packet)
15798
15799
    @staticmethod
15800 1
    def from_binary(data):
15801
        return StatusResult(data)
15802
15803
    def _binary_init(self, data):
15804
        self.StatusCode = StatusCode.from_binary(data)
15805
        self.DiagnosticInfo = DiagnosticInfo.from_binary(data)
15806
15807
    def __str__(self):
15808 1
        return 'StatusResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
15809
               'DiagnosticInfo:' + str(self.DiagnosticInfo) + ')'
15810
15811
    __repr__ = __str__
15812
15813 1
15814
class SubscriptionDiagnosticsDataType(FrozenClass):
15815
    '''
15816
    :ivar SessionId:
15817
    :vartype SessionId: NodeId
15818
    :ivar SubscriptionId:
15819
    :vartype SubscriptionId: UInt32
15820
    :ivar Priority:
15821
    :vartype Priority: Byte
15822 1
    :ivar PublishingInterval:
15823
    :vartype PublishingInterval: Double
15824
    :ivar MaxKeepAliveCount:
15825
    :vartype MaxKeepAliveCount: UInt32
15826
    :ivar MaxLifetimeCount:
15827
    :vartype MaxLifetimeCount: UInt32
15828 1
    :ivar MaxNotificationsPerPublish:
15829
    :vartype MaxNotificationsPerPublish: UInt32
15830
    :ivar PublishingEnabled:
15831
    :vartype PublishingEnabled: Boolean
15832 1
    :ivar ModifyCount:
15833
    :vartype ModifyCount: UInt32
15834
    :ivar EnableCount:
15835
    :vartype EnableCount: UInt32
15836 1
    :ivar DisableCount:
15837
    :vartype DisableCount: UInt32
15838
    :ivar RepublishRequestCount:
15839
    :vartype RepublishRequestCount: UInt32
15840 1
    :ivar RepublishMessageRequestCount:
15841
    :vartype RepublishMessageRequestCount: UInt32
15842
    :ivar RepublishMessageCount:
15843 1
    :vartype RepublishMessageCount: UInt32
15844
    :ivar TransferRequestCount:
15845
    :vartype TransferRequestCount: UInt32
15846
    :ivar TransferredToAltClientCount:
15847
    :vartype TransferredToAltClientCount: UInt32
15848
    :ivar TransferredToSameClientCount:
15849
    :vartype TransferredToSameClientCount: UInt32
15850
    :ivar PublishRequestCount:
15851
    :vartype PublishRequestCount: UInt32
15852
    :ivar DataChangeNotificationsCount:
15853
    :vartype DataChangeNotificationsCount: UInt32
15854
    :ivar EventNotificationsCount:
15855
    :vartype EventNotificationsCount: UInt32
15856
    :ivar NotificationsCount:
15857 1
    :vartype NotificationsCount: UInt32
15858
    :ivar LatePublishRequestCount:
15859
    :vartype LatePublishRequestCount: UInt32
15860
    :ivar CurrentKeepAliveCount:
15861
    :vartype CurrentKeepAliveCount: UInt32
15862
    :ivar CurrentLifetimeCount:
15863
    :vartype CurrentLifetimeCount: UInt32
15864
    :ivar UnacknowledgedMessageCount:
15865 1
    :vartype UnacknowledgedMessageCount: UInt32
15866
    :ivar DiscardedMessageCount:
15867
    :vartype DiscardedMessageCount: UInt32
15868
    :ivar MonitoredItemCount:
15869
    :vartype MonitoredItemCount: UInt32
15870
    :ivar DisabledMonitoredItemCount:
15871
    :vartype DisabledMonitoredItemCount: UInt32
15872
    :ivar MonitoringQueueOverflowCount:
15873
    :vartype MonitoringQueueOverflowCount: UInt32
15874
    :ivar NextSequenceNumber:
15875
    :vartype NextSequenceNumber: UInt32
15876
    :ivar EventQueueOverFlowCount:
15877 1
    :vartype EventQueueOverFlowCount: UInt32
15878
    '''
15879
15880
    ua_types = (
15881
15882
        ('SessionId', 'NodeId'),
15883
        ('SubscriptionId', 'UInt32'),
15884
        ('Priority', 'Byte'),
15885
        ('PublishingInterval', 'Double'),
15886
        ('MaxKeepAliveCount', 'UInt32'),
15887
        ('MaxLifetimeCount', 'UInt32'),
15888 1
        ('MaxNotificationsPerPublish', 'UInt32'),
15889
        ('PublishingEnabled', 'Boolean'),
15890
        ('ModifyCount', 'UInt32'),
15891
        ('EnableCount', 'UInt32'),
15892 1
        ('DisableCount', 'UInt32'),
15893
        ('RepublishRequestCount', 'UInt32'),
15894
        ('RepublishMessageRequestCount', 'UInt32'),
15895
        ('RepublishMessageCount', 'UInt32'),
15896
        ('TransferRequestCount', 'UInt32'),
15897
        ('TransferredToAltClientCount', 'UInt32'),
15898
        ('TransferredToSameClientCount', 'UInt32'),
15899 1
        ('PublishRequestCount', 'UInt32'),
15900
        ('DataChangeNotificationsCount', 'UInt32'),
15901
        ('EventNotificationsCount', 'UInt32'),
15902
        ('NotificationsCount', 'UInt32'),
15903
        ('LatePublishRequestCount', 'UInt32'),
15904
        ('CurrentKeepAliveCount', 'UInt32'),
15905
        ('CurrentLifetimeCount', 'UInt32'),
15906 1
        ('UnacknowledgedMessageCount', 'UInt32'),
15907
        ('DiscardedMessageCount', 'UInt32'),
15908
        ('MonitoredItemCount', 'UInt32'),
15909 1
        ('DisabledMonitoredItemCount', 'UInt32'),
15910
        ('MonitoringQueueOverflowCount', 'UInt32'),
15911
        ('NextSequenceNumber', 'UInt32'),
15912
        ('EventQueueOverFlowCount', 'UInt32'),
15913
               )
15914
15915
    def __init__(self, binary=None):
15916
        if binary is not None:
15917 1
            self._binary_init(binary)
15918
            self._freeze = True
15919
            return
15920
        self.SessionId = NodeId()
15921
        self.SubscriptionId = 0
15922 1
        self.Priority = 0
15923
        self.PublishingInterval = 0
15924
        self.MaxKeepAliveCount = 0
15925
        self.MaxLifetimeCount = 0
15926
        self.MaxNotificationsPerPublish = 0
15927
        self.PublishingEnabled = True
15928
        self.ModifyCount = 0
15929
        self.EnableCount = 0
15930
        self.DisableCount = 0
15931 1
        self.RepublishRequestCount = 0
15932
        self.RepublishMessageRequestCount = 0
15933
        self.RepublishMessageCount = 0
15934
        self.TransferRequestCount = 0
15935
        self.TransferredToAltClientCount = 0
15936
        self.TransferredToSameClientCount = 0
15937 1
        self.PublishRequestCount = 0
15938
        self.DataChangeNotificationsCount = 0
15939
        self.EventNotificationsCount = 0
15940
        self.NotificationsCount = 0
15941 1
        self.LatePublishRequestCount = 0
15942
        self.CurrentKeepAliveCount = 0
15943
        self.CurrentLifetimeCount = 0
15944
        self.UnacknowledgedMessageCount = 0
15945 1
        self.DiscardedMessageCount = 0
15946
        self.MonitoredItemCount = 0
15947
        self.DisabledMonitoredItemCount = 0
15948
        self.MonitoringQueueOverflowCount = 0
15949 1
        self.NextSequenceNumber = 0
15950
        self.EventQueueOverFlowCount = 0
15951
        self._freeze = True
15952 1
15953
    def to_binary(self):
15954
        packet = []
15955
        packet.append(self.SessionId.to_binary())
15956
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
15957
        packet.append(uabin.Primitives.Byte.pack(self.Priority))
15958
        packet.append(uabin.Primitives.Double.pack(self.PublishingInterval))
15959
        packet.append(uabin.Primitives.UInt32.pack(self.MaxKeepAliveCount))
15960
        packet.append(uabin.Primitives.UInt32.pack(self.MaxLifetimeCount))
15961
        packet.append(uabin.Primitives.UInt32.pack(self.MaxNotificationsPerPublish))
15962
        packet.append(uabin.Primitives.Boolean.pack(self.PublishingEnabled))
15963
        packet.append(uabin.Primitives.UInt32.pack(self.ModifyCount))
15964
        packet.append(uabin.Primitives.UInt32.pack(self.EnableCount))
15965
        packet.append(uabin.Primitives.UInt32.pack(self.DisableCount))
15966
        packet.append(uabin.Primitives.UInt32.pack(self.RepublishRequestCount))
15967
        packet.append(uabin.Primitives.UInt32.pack(self.RepublishMessageRequestCount))
15968
        packet.append(uabin.Primitives.UInt32.pack(self.RepublishMessageCount))
15969
        packet.append(uabin.Primitives.UInt32.pack(self.TransferRequestCount))
15970
        packet.append(uabin.Primitives.UInt32.pack(self.TransferredToAltClientCount))
15971
        packet.append(uabin.Primitives.UInt32.pack(self.TransferredToSameClientCount))
15972
        packet.append(uabin.Primitives.UInt32.pack(self.PublishRequestCount))
15973
        packet.append(uabin.Primitives.UInt32.pack(self.DataChangeNotificationsCount))
15974
        packet.append(uabin.Primitives.UInt32.pack(self.EventNotificationsCount))
15975
        packet.append(uabin.Primitives.UInt32.pack(self.NotificationsCount))
15976 1
        packet.append(uabin.Primitives.UInt32.pack(self.LatePublishRequestCount))
15977
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentKeepAliveCount))
15978
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentLifetimeCount))
15979
        packet.append(uabin.Primitives.UInt32.pack(self.UnacknowledgedMessageCount))
15980
        packet.append(uabin.Primitives.UInt32.pack(self.DiscardedMessageCount))
15981
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoredItemCount))
15982
        packet.append(uabin.Primitives.UInt32.pack(self.DisabledMonitoredItemCount))
15983
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoringQueueOverflowCount))
15984
        packet.append(uabin.Primitives.UInt32.pack(self.NextSequenceNumber))
15985
        packet.append(uabin.Primitives.UInt32.pack(self.EventQueueOverFlowCount))
15986
        return b''.join(packet)
15987
15988
    @staticmethod
15989 1
    def from_binary(data):
15990
        return SubscriptionDiagnosticsDataType(data)
15991
15992
    def _binary_init(self, data):
15993
        self.SessionId = NodeId.from_binary(data)
15994
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
15995
        self.Priority = uabin.Primitives.Byte.unpack(data)
15996
        self.PublishingInterval = uabin.Primitives.Double.unpack(data)
15997
        self.MaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
15998
        self.MaxLifetimeCount = uabin.Primitives.UInt32.unpack(data)
15999
        self.MaxNotificationsPerPublish = uabin.Primitives.UInt32.unpack(data)
16000
        self.PublishingEnabled = uabin.Primitives.Boolean.unpack(data)
16001
        self.ModifyCount = uabin.Primitives.UInt32.unpack(data)
16002
        self.EnableCount = uabin.Primitives.UInt32.unpack(data)
16003
        self.DisableCount = uabin.Primitives.UInt32.unpack(data)
16004
        self.RepublishRequestCount = uabin.Primitives.UInt32.unpack(data)
16005
        self.RepublishMessageRequestCount = uabin.Primitives.UInt32.unpack(data)
16006 1
        self.RepublishMessageCount = uabin.Primitives.UInt32.unpack(data)
16007
        self.TransferRequestCount = uabin.Primitives.UInt32.unpack(data)
16008
        self.TransferredToAltClientCount = uabin.Primitives.UInt32.unpack(data)
16009
        self.TransferredToSameClientCount = uabin.Primitives.UInt32.unpack(data)
16010
        self.PublishRequestCount = uabin.Primitives.UInt32.unpack(data)
16011
        self.DataChangeNotificationsCount = uabin.Primitives.UInt32.unpack(data)
16012
        self.EventNotificationsCount = uabin.Primitives.UInt32.unpack(data)
16013
        self.NotificationsCount = uabin.Primitives.UInt32.unpack(data)
16014
        self.LatePublishRequestCount = uabin.Primitives.UInt32.unpack(data)
16015
        self.CurrentKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
16016
        self.CurrentLifetimeCount = uabin.Primitives.UInt32.unpack(data)
16017
        self.UnacknowledgedMessageCount = uabin.Primitives.UInt32.unpack(data)
16018
        self.DiscardedMessageCount = uabin.Primitives.UInt32.unpack(data)
16019
        self.MonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
16020
        self.DisabledMonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
16021
        self.MonitoringQueueOverflowCount = uabin.Primitives.UInt32.unpack(data)
16022
        self.NextSequenceNumber = uabin.Primitives.UInt32.unpack(data)
16023
        self.EventQueueOverFlowCount = uabin.Primitives.UInt32.unpack(data)
16024 1
16025
    def __str__(self):
16026
        return 'SubscriptionDiagnosticsDataType(' + 'SessionId:' + str(self.SessionId) + ', ' + \
16027
               'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
16028 1
               'Priority:' + str(self.Priority) + ', ' + \
16029
               'PublishingInterval:' + str(self.PublishingInterval) + ', ' + \
16030
               'MaxKeepAliveCount:' + str(self.MaxKeepAliveCount) + ', ' + \
16031
               'MaxLifetimeCount:' + str(self.MaxLifetimeCount) + ', ' + \
16032
               'MaxNotificationsPerPublish:' + str(self.MaxNotificationsPerPublish) + ', ' + \
16033
               'PublishingEnabled:' + str(self.PublishingEnabled) + ', ' + \
16034
               'ModifyCount:' + str(self.ModifyCount) + ', ' + \
16035
               'EnableCount:' + str(self.EnableCount) + ', ' + \
16036
               'DisableCount:' + str(self.DisableCount) + ', ' + \
16037
               'RepublishRequestCount:' + str(self.RepublishRequestCount) + ', ' + \
16038
               'RepublishMessageRequestCount:' + str(self.RepublishMessageRequestCount) + ', ' + \
16039
               'RepublishMessageCount:' + str(self.RepublishMessageCount) + ', ' + \
16040
               'TransferRequestCount:' + str(self.TransferRequestCount) + ', ' + \
16041
               'TransferredToAltClientCount:' + str(self.TransferredToAltClientCount) + ', ' + \
16042
               'TransferredToSameClientCount:' + str(self.TransferredToSameClientCount) + ', ' + \
16043
               'PublishRequestCount:' + str(self.PublishRequestCount) + ', ' + \
16044
               'DataChangeNotificationsCount:' + str(self.DataChangeNotificationsCount) + ', ' + \
16045
               'EventNotificationsCount:' + str(self.EventNotificationsCount) + ', ' + \
16046
               'NotificationsCount:' + str(self.NotificationsCount) + ', ' + \
16047
               'LatePublishRequestCount:' + str(self.LatePublishRequestCount) + ', ' + \
16048
               'CurrentKeepAliveCount:' + str(self.CurrentKeepAliveCount) + ', ' + \
16049
               'CurrentLifetimeCount:' + str(self.CurrentLifetimeCount) + ', ' + \
16050 1
               'UnacknowledgedMessageCount:' + str(self.UnacknowledgedMessageCount) + ', ' + \
16051
               'DiscardedMessageCount:' + str(self.DiscardedMessageCount) + ', ' + \
16052
               'MonitoredItemCount:' + str(self.MonitoredItemCount) + ', ' + \
16053
               'DisabledMonitoredItemCount:' + str(self.DisabledMonitoredItemCount) + ', ' + \
16054
               'MonitoringQueueOverflowCount:' + str(self.MonitoringQueueOverflowCount) + ', ' + \
16055
               'NextSequenceNumber:' + str(self.NextSequenceNumber) + ', ' + \
16056
               'EventQueueOverFlowCount:' + str(self.EventQueueOverFlowCount) + ')'
16057
16058
    __repr__ = __str__
16059
16060
16061
class ModelChangeStructureDataType(FrozenClass):
16062 1
    '''
16063
    :ivar Affected:
16064
    :vartype Affected: NodeId
16065 1
    :ivar AffectedType:
16066
    :vartype AffectedType: NodeId
16067
    :ivar Verb:
16068
    :vartype Verb: Byte
16069
    '''
16070
16071
    ua_types = (
16072
16073
        ('Affected', 'NodeId'),
16074
        ('AffectedType', 'NodeId'),
16075 1
        ('Verb', 'Byte'),
16076
               )
16077
16078
    def __init__(self, binary=None):
16079
        if binary is not None:
16080
            self._binary_init(binary)
16081 1
            self._freeze = True
16082
            return
16083
        self.Affected = NodeId()
16084
        self.AffectedType = NodeId()
16085
        self.Verb = 0
16086
        self._freeze = True
16087
16088
    def to_binary(self):
16089
        packet = []
16090
        packet.append(self.Affected.to_binary())
16091 1
        packet.append(self.AffectedType.to_binary())
16092
        packet.append(uabin.Primitives.Byte.pack(self.Verb))
16093
        return b''.join(packet)
16094
16095
    @staticmethod
16096
    def from_binary(data):
16097
        return ModelChangeStructureDataType(data)
16098 1
16099
    def _binary_init(self, data):
16100
        self.Affected = NodeId.from_binary(data)
16101
        self.AffectedType = NodeId.from_binary(data)
16102 1
        self.Verb = uabin.Primitives.Byte.unpack(data)
16103
16104
    def __str__(self):
16105
        return 'ModelChangeStructureDataType(' + 'Affected:' + str(self.Affected) + ', ' + \
16106
               'AffectedType:' + str(self.AffectedType) + ', ' + \
16107 1
               'Verb:' + str(self.Verb) + ')'
16108
16109
    __repr__ = __str__
16110
16111
16112 1
class SemanticChangeStructureDataType(FrozenClass):
16113
    '''
16114
    :ivar Affected:
16115 1
    :vartype Affected: NodeId
16116 1
    :ivar AffectedType:
16117 1
    :vartype AffectedType: NodeId
16118 1
    '''
16119 1
16120 1
    ua_types = (
16121 1
16122 1
        ('Affected', 'NodeId'),
16123 1
        ('AffectedType', 'NodeId'),
16124 1
               )
16125 1
16126 1
    def __init__(self, binary=None):
16127 1
        if binary is not None:
16128 1
            self._binary_init(binary)
16129 1
            self._freeze = True
16130 1
            return
16131 1
        self.Affected = NodeId()
16132 1
        self.AffectedType = NodeId()
16133 1
        self._freeze = True
16134 1
16135 1
    def to_binary(self):
16136 1
        packet = []
16137 1
        packet.append(self.Affected.to_binary())
16138 1
        packet.append(self.AffectedType.to_binary())
16139 1
        return b''.join(packet)
16140 1
16141 1
    @staticmethod
16142 1
    def from_binary(data):
16143 1
        return SemanticChangeStructureDataType(data)
16144 1
16145 1
    def _binary_init(self, data):
16146 1
        self.Affected = NodeId.from_binary(data)
16147 1
        self.AffectedType = NodeId.from_binary(data)
16148 1
16149 1
    def __str__(self):
16150 1
        return 'SemanticChangeStructureDataType(' + 'Affected:' + str(self.Affected) + ', ' + \
16151 1
               'AffectedType:' + str(self.AffectedType) + ')'
16152 1
16153 1
    __repr__ = __str__
16154 1
16155 1
16156 1
class Range(FrozenClass):
16157 1
    '''
16158 1
    :ivar Low:
16159 1
    :vartype Low: Double
16160 1
    :ivar High:
16161 1
    :vartype High: Double
16162 1
    '''
16163 1
16164 1
    ua_types = (
16165 1
16166 1
        ('Low', 'Double'),
16167 1
        ('High', 'Double'),
16168 1
               )
16169 1
16170 1
    def __init__(self, binary=None):
16171 1
        if binary is not None:
16172 1
            self._binary_init(binary)
16173 1
            self._freeze = True
16174 1
            return
16175 1
        self.Low = 0
16176 1
        self.High = 0
16177 1
        self._freeze = True
16178 1
16179 1
    def to_binary(self):
16180 1
        packet = []
16181 1
        packet.append(uabin.Primitives.Double.pack(self.Low))
16182 1
        packet.append(uabin.Primitives.Double.pack(self.High))
16183 1
        return b''.join(packet)
16184 1
16185 1
    @staticmethod
16186 1
    def from_binary(data):
16187 1
        return Range(data)
16188 1
16189 1
    def _binary_init(self, data):
16190 1
        self.Low = uabin.Primitives.Double.unpack(data)
16191 1
        self.High = uabin.Primitives.Double.unpack(data)
16192 1
16193 1
    def __str__(self):
16194 1
        return 'Range(' + 'Low:' + str(self.Low) + ', ' + \
16195 1
               'High:' + str(self.High) + ')'
16196 1
16197 1
    __repr__ = __str__
16198 1
16199 1
16200 1
class EUInformation(FrozenClass):
16201 1
    '''
16202 1
    :ivar NamespaceUri:
16203 1
    :vartype NamespaceUri: String
16204 1
    :ivar UnitId:
16205 1
    :vartype UnitId: Int32
16206 1
    :ivar DisplayName:
16207 1
    :vartype DisplayName: LocalizedText
16208 1
    :ivar Description:
16209 1
    :vartype Description: LocalizedText
16210 1
    '''
16211 1
16212 1
    ua_types = (
16213 1
16214 1
        ('NamespaceUri', 'String'),
16215 1
        ('UnitId', 'Int32'),
16216 1
        ('DisplayName', 'LocalizedText'),
16217 1
        ('Description', 'LocalizedText'),
16218 1
               )
16219 1
16220 1
    def __init__(self, binary=None):
16221 1
        if binary is not None:
16222 1
            self._binary_init(binary)
16223 1
            self._freeze = True
16224 1
            return
16225 1
        self.NamespaceUri = None
16226 1
        self.UnitId = 0
16227 1
        self.DisplayName = LocalizedText()
16228 1
        self.Description = LocalizedText()
16229 1
        self._freeze = True
16230 1
16231 1
    def to_binary(self):
16232 1
        packet = []
16233 1
        packet.append(uabin.Primitives.String.pack(self.NamespaceUri))
16234 1
        packet.append(uabin.Primitives.Int32.pack(self.UnitId))
16235 1
        packet.append(self.DisplayName.to_binary())
16236 1
        packet.append(self.Description.to_binary())
16237 1
        return b''.join(packet)
16238 1
16239 1
    @staticmethod
16240 1
    def from_binary(data):
16241 1
        return EUInformation(data)
16242 1
16243 1
    def _binary_init(self, data):
16244 1
        self.NamespaceUri = uabin.Primitives.String.unpack(data)
16245 1
        self.UnitId = uabin.Primitives.Int32.unpack(data)
16246 1
        self.DisplayName = LocalizedText.from_binary(data)
16247 1
        self.Description = LocalizedText.from_binary(data)
16248 1
16249 1
    def __str__(self):
16250 1
        return 'EUInformation(' + 'NamespaceUri:' + str(self.NamespaceUri) + ', ' + \
16251 1
               'UnitId:' + str(self.UnitId) + ', ' + \
16252 1
               'DisplayName:' + str(self.DisplayName) + ', ' + \
16253 1
               'Description:' + str(self.Description) + ')'
16254 1
16255 1
    __repr__ = __str__
16256 1
16257 1
16258 1
class ComplexNumberType(FrozenClass):
16259 1
    '''
16260 1
    :ivar Real:
16261 1
    :vartype Real: Float
16262 1
    :ivar Imaginary:
16263 1
    :vartype Imaginary: Float
16264 1
    '''
16265 1
16266 1
    ua_types = (
16267 1
16268 1
        ('Real', 'Float'),
16269 1
        ('Imaginary', 'Float'),
16270 1
               )
16271 1
16272 1
    def __init__(self, binary=None):
16273 1
        if binary is not None:
16274 1
            self._binary_init(binary)
16275 1
            self._freeze = True
16276 1
            return
16277 1
        self.Real = 0
16278 1
        self.Imaginary = 0
16279 1
        self._freeze = True
16280 1
16281 1
    def to_binary(self):
16282 1
        packet = []
16283 1
        packet.append(uabin.Primitives.Float.pack(self.Real))
16284 1
        packet.append(uabin.Primitives.Float.pack(self.Imaginary))
16285 1
        return b''.join(packet)
16286 1
16287 1
    @staticmethod
16288 1
    def from_binary(data):
16289 1
        return ComplexNumberType(data)
16290 1
16291 1
    def _binary_init(self, data):
16292 1
        self.Real = uabin.Primitives.Float.unpack(data)
16293 1
        self.Imaginary = uabin.Primitives.Float.unpack(data)
16294 1
16295 1
    def __str__(self):
16296 1
        return 'ComplexNumberType(' + 'Real:' + str(self.Real) + ', ' + \
16297 1
               'Imaginary:' + str(self.Imaginary) + ')'
16298 1
16299 1
    __repr__ = __str__
16300 1
16301 1
16302 1
class DoubleComplexNumberType(FrozenClass):
16303 1
    '''
16304 1
    :ivar Real:
16305 1
    :vartype Real: Double
16306 1
    :ivar Imaginary:
16307 1
    :vartype Imaginary: Double
16308 1
    '''
16309 1
16310 1
    ua_types = (
16311 1
16312 1
        ('Real', 'Double'),
16313 1
        ('Imaginary', 'Double'),
16314 1
               )
16315 1
16316 1
    def __init__(self, binary=None):
16317 1
        if binary is not None:
16318 1
            self._binary_init(binary)
16319 1
            self._freeze = True
16320 1
            return
16321 1
        self.Real = 0
16322 1
        self.Imaginary = 0
16323 1
        self._freeze = True
16324 1
16325 1
    def to_binary(self):
16326 1
        packet = []
16327 1
        packet.append(uabin.Primitives.Double.pack(self.Real))
16328 1
        packet.append(uabin.Primitives.Double.pack(self.Imaginary))
16329 1
        return b''.join(packet)
16330 1
16331 1
    @staticmethod
16332 1
    def from_binary(data):
16333 1
        return DoubleComplexNumberType(data)
16334 1
16335 1
    def _binary_init(self, data):
16336 1
        self.Real = uabin.Primitives.Double.unpack(data)
16337 1
        self.Imaginary = uabin.Primitives.Double.unpack(data)
16338 1
16339 1
    def __str__(self):
16340 1
        return 'DoubleComplexNumberType(' + 'Real:' + str(self.Real) + ', ' + \
16341 1
               'Imaginary:' + str(self.Imaginary) + ')'
16342 1
16343 1
    __repr__ = __str__
16344 1
16345 1
16346 1
class AxisInformation(FrozenClass):
16347 1
    '''
16348 1
    :ivar EngineeringUnits:
16349 1
    :vartype EngineeringUnits: EUInformation
16350 1
    :ivar EURange:
16351 1
    :vartype EURange: Range
16352 1
    :ivar Title:
16353 1
    :vartype Title: LocalizedText
16354 1
    :ivar AxisScaleType:
16355 1
    :vartype AxisScaleType: AxisScaleEnumeration
16356 1
    :ivar AxisSteps:
16357 1
    :vartype AxisSteps: Double
16358 1
    '''
16359 1
16360 1
    ua_types = (
16361 1
16362 1
        ('EngineeringUnits', 'EUInformation'),
16363 1
        ('EURange', 'Range'),
16364 1
        ('Title', 'LocalizedText'),
16365 1
        ('AxisScaleType', 'AxisScaleEnumeration'),
16366 1
        ('AxisSteps', 'ListOfDouble'),
16367 1
               )
16368 1
16369 1
    def __init__(self, binary=None):
16370 1
        if binary is not None:
16371 1
            self._binary_init(binary)
16372 1
            self._freeze = True
16373 1
            return
16374 1
        self.EngineeringUnits = EUInformation()
16375 1
        self.EURange = Range()
16376 1
        self.Title = LocalizedText()
16377 1
        self.AxisScaleType = AxisScaleEnumeration(0)
16378 1
        self.AxisSteps = []
16379 1
        self._freeze = True
16380 1
16381 1
    def to_binary(self):
16382 1
        packet = []
16383 1
        packet.append(self.EngineeringUnits.to_binary())
16384 1
        packet.append(self.EURange.to_binary())
16385 1
        packet.append(self.Title.to_binary())
16386 1
        packet.append(uabin.Primitives.UInt32.pack(self.AxisScaleType.value))
16387 1
        packet.append(uabin.Primitives.Int32.pack(len(self.AxisSteps)))
16388 1
        for fieldname in self.AxisSteps:
16389 1
            packet.append(uabin.Primitives.Double.pack(fieldname))
16390 1
        return b''.join(packet)
16391 1
16392 1
    @staticmethod
16393 1
    def from_binary(data):
16394 1
        return AxisInformation(data)
16395 1
16396 1
    def _binary_init(self, data):
16397 1
        self.EngineeringUnits = EUInformation.from_binary(data)
16398 1
        self.EURange = Range.from_binary(data)
16399 1
        self.Title = LocalizedText.from_binary(data)
16400 1
        self.AxisScaleType = AxisScaleEnumeration(uabin.Primitives.UInt32.unpack(data))
16401 1
        self.AxisSteps = uabin.Primitives.Double.unpack_array(data)
16402 1
16403 1
    def __str__(self):
16404 1
        return 'AxisInformation(' + 'EngineeringUnits:' + str(self.EngineeringUnits) + ', ' + \
16405 1
               'EURange:' + str(self.EURange) + ', ' + \
16406 1
               'Title:' + str(self.Title) + ', ' + \
16407 1
               'AxisScaleType:' + str(self.AxisScaleType) + ', ' + \
16408 1
               'AxisSteps:' + str(self.AxisSteps) + ')'
16409 1
16410 1
    __repr__ = __str__
16411 1
16412 1
16413 1
class XVType(FrozenClass):
16414 1
    '''
16415 1
    :ivar X:
16416 1
    :vartype X: Double
16417 1
    :ivar Value:
16418 1
    :vartype Value: Float
16419 1
    '''
16420 1
16421 1
    ua_types = (
16422 1
16423 1
        ('X', 'Double'),
16424 1
        ('Value', 'Float'),
16425 1
               )
16426 1
16427 1
    def __init__(self, binary=None):
16428 1
        if binary is not None:
16429 1
            self._binary_init(binary)
16430 1
            self._freeze = True
16431 1
            return
16432 1
        self.X = 0
16433 1
        self.Value = 0
16434 1
        self._freeze = True
16435 1
16436 1
    def to_binary(self):
16437 1
        packet = []
16438 1
        packet.append(uabin.Primitives.Double.pack(self.X))
16439 1
        packet.append(uabin.Primitives.Float.pack(self.Value))
16440 1
        return b''.join(packet)
16441 1
16442 1
    @staticmethod
16443 1
    def from_binary(data):
16444 1
        return XVType(data)
16445 1
16446 1
    def _binary_init(self, data):
16447 1
        self.X = uabin.Primitives.Double.unpack(data)
16448 1
        self.Value = uabin.Primitives.Float.unpack(data)
16449 1
16450 1
    def __str__(self):
16451 1
        return 'XVType(' + 'X:' + str(self.X) + ', ' + \
16452 1
               'Value:' + str(self.Value) + ')'
16453 1
16454 1
    __repr__ = __str__
16455 1
16456 1
16457 1
class ProgramDiagnosticDataType(FrozenClass):
16458 1
    '''
16459 1
    :ivar CreateSessionId:
16460 1
    :vartype CreateSessionId: NodeId
16461 1
    :ivar CreateClientName:
16462 1
    :vartype CreateClientName: String
16463 1
    :ivar InvocationCreationTime:
16464 1
    :vartype InvocationCreationTime: DateTime
16465 1
    :ivar LastTransitionTime:
16466 1
    :vartype LastTransitionTime: DateTime
16467 1
    :ivar LastMethodCall:
16468 1
    :vartype LastMethodCall: String
16469 1
    :ivar LastMethodSessionId:
16470 1
    :vartype LastMethodSessionId: NodeId
16471 1
    :ivar LastMethodInputArguments:
16472 1
    :vartype LastMethodInputArguments: Argument
16473 1
    :ivar LastMethodOutputArguments:
16474 1
    :vartype LastMethodOutputArguments: Argument
16475 1
    :ivar LastMethodCallTime:
16476 1
    :vartype LastMethodCallTime: DateTime
16477 1
    :ivar LastMethodReturnStatus:
16478 1
    :vartype LastMethodReturnStatus: StatusResult
16479 1
    '''
16480 1
16481 1
    ua_types = (
16482 1
16483 1
        ('CreateSessionId', 'NodeId'),
16484 1
        ('CreateClientName', 'String'),
16485 1
        ('InvocationCreationTime', 'DateTime'),
16486 1
        ('LastTransitionTime', 'DateTime'),
16487 1
        ('LastMethodCall', 'String'),
16488 1
        ('LastMethodSessionId', 'NodeId'),
16489 1
        ('LastMethodInputArguments', 'ListOfArgument'),
16490 1
        ('LastMethodOutputArguments', 'ListOfArgument'),
16491 1
        ('LastMethodCallTime', 'DateTime'),
16492 1
        ('LastMethodReturnStatus', 'StatusResult'),
16493 1
               )
16494 1
16495 1
    def __init__(self, binary=None):
16496 1
        if binary is not None:
16497 1
            self._binary_init(binary)
16498 1
            self._freeze = True
16499 1
            return
16500 1
        self.CreateSessionId = NodeId()
16501 1
        self.CreateClientName = None
16502 1
        self.InvocationCreationTime = datetime.utcnow()
16503 1
        self.LastTransitionTime = datetime.utcnow()
16504 1
        self.LastMethodCall = None
16505 1
        self.LastMethodSessionId = NodeId()
16506 1
        self.LastMethodInputArguments = []
16507 1
        self.LastMethodOutputArguments = []
16508 1
        self.LastMethodCallTime = datetime.utcnow()
16509 1
        self.LastMethodReturnStatus = StatusResult()
16510 1
        self._freeze = True
16511 1
16512 1
    def to_binary(self):
16513 1
        packet = []
16514 1
        packet.append(self.CreateSessionId.to_binary())
16515 1
        packet.append(uabin.Primitives.String.pack(self.CreateClientName))
16516 1
        packet.append(uabin.Primitives.DateTime.pack(self.InvocationCreationTime))
16517 1
        packet.append(uabin.Primitives.DateTime.pack(self.LastTransitionTime))
16518 1
        packet.append(uabin.Primitives.String.pack(self.LastMethodCall))
16519 1
        packet.append(self.LastMethodSessionId.to_binary())
16520 1
        packet.append(uabin.Primitives.Int32.pack(len(self.LastMethodInputArguments)))
16521 1
        for fieldname in self.LastMethodInputArguments:
16522 1
            packet.append(fieldname.to_binary())
16523 1
        packet.append(uabin.Primitives.Int32.pack(len(self.LastMethodOutputArguments)))
16524 1
        for fieldname in self.LastMethodOutputArguments:
16525 1
            packet.append(fieldname.to_binary())
16526 1
        packet.append(uabin.Primitives.DateTime.pack(self.LastMethodCallTime))
16527 1
        packet.append(self.LastMethodReturnStatus.to_binary())
16528 1
        return b''.join(packet)
16529 1
16530 1
    @staticmethod
16531 1
    def from_binary(data):
16532 1
        return ProgramDiagnosticDataType(data)
16533 1
16534 1
    def _binary_init(self, data):
16535 1
        self.CreateSessionId = NodeId.from_binary(data)
16536 1
        self.CreateClientName = uabin.Primitives.String.unpack(data)
16537 1
        self.InvocationCreationTime = uabin.Primitives.DateTime.unpack(data)
16538 1
        self.LastTransitionTime = uabin.Primitives.DateTime.unpack(data)
16539 1
        self.LastMethodCall = uabin.Primitives.String.unpack(data)
16540 1
        self.LastMethodSessionId = NodeId.from_binary(data)
16541 1
        length = uabin.Primitives.Int32.unpack(data)
16542 1
        array = []
16543 1
        if length != -1:
16544 1
            for _ in range(0, length):
16545 1
                array.append(Argument.from_binary(data))
16546 1
        self.LastMethodInputArguments = array
16547 1
        length = uabin.Primitives.Int32.unpack(data)
16548 1
        array = []
16549 1
        if length != -1:
16550 1
            for _ in range(0, length):
16551 1
                array.append(Argument.from_binary(data))
16552 1
        self.LastMethodOutputArguments = array
16553 1
        self.LastMethodCallTime = uabin.Primitives.DateTime.unpack(data)
16554 1
        self.LastMethodReturnStatus = StatusResult.from_binary(data)
16555 1
16556 1
    def __str__(self):
16557 1
        return 'ProgramDiagnosticDataType(' + 'CreateSessionId:' + str(self.CreateSessionId) + ', ' + \
16558 1
               'CreateClientName:' + str(self.CreateClientName) + ', ' + \
16559 1
               'InvocationCreationTime:' + str(self.InvocationCreationTime) + ', ' + \
16560 1
               'LastTransitionTime:' + str(self.LastTransitionTime) + ', ' + \
16561 1
               'LastMethodCall:' + str(self.LastMethodCall) + ', ' + \
16562 1
               'LastMethodSessionId:' + str(self.LastMethodSessionId) + ', ' + \
16563 1
               'LastMethodInputArguments:' + str(self.LastMethodInputArguments) + ', ' + \
16564 1
               'LastMethodOutputArguments:' + str(self.LastMethodOutputArguments) + ', ' + \
16565 1
               'LastMethodCallTime:' + str(self.LastMethodCallTime) + ', ' + \
16566 1
               'LastMethodReturnStatus:' + str(self.LastMethodReturnStatus) + ')'
16567 1
16568 1
    __repr__ = __str__
16569 1
16570 1
16571 1
class Annotation(FrozenClass):
16572 1
    '''
16573 1
    :ivar Message:
16574 1
    :vartype Message: String
16575 1
    :ivar UserName:
16576 1
    :vartype UserName: String
16577 1
    :ivar AnnotationTime:
16578 1
    :vartype AnnotationTime: DateTime
16579 1
    '''
16580 1
16581 1
    ua_types = (
16582 1
16583 1
        ('Message', 'String'),
16584 1
        ('UserName', 'String'),
16585 1
        ('AnnotationTime', 'DateTime'),
16586 1
               )
16587 1
16588 1
    def __init__(self, binary=None):
16589 1
        if binary is not None:
16590 1
            self._binary_init(binary)
16591 1
            self._freeze = True
16592 1
            return
16593 1
        self.Message = None
16594 1
        self.UserName = None
16595 1
        self.AnnotationTime = datetime.utcnow()
16596 1
        self._freeze = True
16597 1
16598 1
    def to_binary(self):
16599 1
        packet = []
16600 1
        packet.append(uabin.Primitives.String.pack(self.Message))
16601 1
        packet.append(uabin.Primitives.String.pack(self.UserName))
16602 1
        packet.append(uabin.Primitives.DateTime.pack(self.AnnotationTime))
16603 1
        return b''.join(packet)
16604 1
16605 1
    @staticmethod
16606 1
    def from_binary(data):
16607 1
        return Annotation(data)
16608 1
16609 1
    def _binary_init(self, data):
16610 1
        self.Message = uabin.Primitives.String.unpack(data)
16611 1
        self.UserName = uabin.Primitives.String.unpack(data)
16612 1
        self.AnnotationTime = uabin.Primitives.DateTime.unpack(data)
16613 1
16614 1
    def __str__(self):
16615 1
        return 'Annotation(' + 'Message:' + str(self.Message) + ', ' + \
16616 1
               'UserName:' + str(self.UserName) + ', ' + \
16617 1
               'AnnotationTime:' + str(self.AnnotationTime) + ')'
16618 1
16619 1
    __repr__ = __str__
16620 1
16621 1
16622 1
nid = FourByteNodeId(ObjectIds.TrustListDataType_Encoding_DefaultBinary)
16623 1
extension_object_classes[nid] = TrustListDataType
16624 1
extension_object_ids['TrustListDataType'] = nid
16625 1
nid = FourByteNodeId(ObjectIds.Argument_Encoding_DefaultBinary)
16626 1
extension_object_classes[nid] = Argument
16627 1
extension_object_ids['Argument'] = nid
16628 1
nid = FourByteNodeId(ObjectIds.EnumValueType_Encoding_DefaultBinary)
16629 1
extension_object_classes[nid] = EnumValueType
16630 1
extension_object_ids['EnumValueType'] = nid
16631 1
nid = FourByteNodeId(ObjectIds.OptionSet_Encoding_DefaultBinary)
16632 1
extension_object_classes[nid] = OptionSet
16633 1
extension_object_ids['OptionSet'] = nid
16634 1
nid = FourByteNodeId(ObjectIds.Union_Encoding_DefaultBinary)
16635 1
extension_object_classes[nid] = Union
16636 1
extension_object_ids['Union'] = nid
16637 1
nid = FourByteNodeId(ObjectIds.TimeZoneDataType_Encoding_DefaultBinary)
16638 1
extension_object_classes[nid] = TimeZoneDataType
16639 1
extension_object_ids['TimeZoneDataType'] = nid
16640 1
nid = FourByteNodeId(ObjectIds.ApplicationDescription_Encoding_DefaultBinary)
16641 1
extension_object_classes[nid] = ApplicationDescription
16642 1
extension_object_ids['ApplicationDescription'] = nid
16643 1
nid = FourByteNodeId(ObjectIds.RequestHeader_Encoding_DefaultBinary)
16644 1
extension_object_classes[nid] = RequestHeader
16645 1
extension_object_ids['RequestHeader'] = nid
16646 1
nid = FourByteNodeId(ObjectIds.ResponseHeader_Encoding_DefaultBinary)
16647 1
extension_object_classes[nid] = ResponseHeader
16648 1
extension_object_ids['ResponseHeader'] = nid
16649 1
nid = FourByteNodeId(ObjectIds.ServiceFault_Encoding_DefaultBinary)
16650 1
extension_object_classes[nid] = ServiceFault
16651 1
extension_object_ids['ServiceFault'] = nid
16652 1
nid = FourByteNodeId(ObjectIds.FindServersRequest_Encoding_DefaultBinary)
16653 1
extension_object_classes[nid] = FindServersRequest
16654 1
extension_object_ids['FindServersRequest'] = nid
16655 1
nid = FourByteNodeId(ObjectIds.FindServersResponse_Encoding_DefaultBinary)
16656 1
extension_object_classes[nid] = FindServersResponse
16657 1
extension_object_ids['FindServersResponse'] = nid
16658 1
nid = FourByteNodeId(ObjectIds.ServerOnNetwork_Encoding_DefaultBinary)
16659 1
extension_object_classes[nid] = ServerOnNetwork
16660 1
extension_object_ids['ServerOnNetwork'] = nid
16661 1
nid = FourByteNodeId(ObjectIds.FindServersOnNetworkRequest_Encoding_DefaultBinary)
16662 1
extension_object_classes[nid] = FindServersOnNetworkRequest
16663 1
extension_object_ids['FindServersOnNetworkRequest'] = nid
16664 1
nid = FourByteNodeId(ObjectIds.FindServersOnNetworkResponse_Encoding_DefaultBinary)
16665 1
extension_object_classes[nid] = FindServersOnNetworkResponse
16666 1
extension_object_ids['FindServersOnNetworkResponse'] = nid
16667 1
nid = FourByteNodeId(ObjectIds.UserTokenPolicy_Encoding_DefaultBinary)
16668 1
extension_object_classes[nid] = UserTokenPolicy
16669 1
extension_object_ids['UserTokenPolicy'] = nid
16670 1
nid = FourByteNodeId(ObjectIds.EndpointDescription_Encoding_DefaultBinary)
16671 1
extension_object_classes[nid] = EndpointDescription
16672 1
extension_object_ids['EndpointDescription'] = nid
16673 1
nid = FourByteNodeId(ObjectIds.GetEndpointsRequest_Encoding_DefaultBinary)
16674 1
extension_object_classes[nid] = GetEndpointsRequest
16675 1
extension_object_ids['GetEndpointsRequest'] = nid
16676 1
nid = FourByteNodeId(ObjectIds.GetEndpointsResponse_Encoding_DefaultBinary)
16677 1
extension_object_classes[nid] = GetEndpointsResponse
16678 1
extension_object_ids['GetEndpointsResponse'] = nid
16679 1
nid = FourByteNodeId(ObjectIds.RegisteredServer_Encoding_DefaultBinary)
16680 1
extension_object_classes[nid] = RegisteredServer
16681 1
extension_object_ids['RegisteredServer'] = nid
16682 1
nid = FourByteNodeId(ObjectIds.RegisterServerRequest_Encoding_DefaultBinary)
16683 1
extension_object_classes[nid] = RegisterServerRequest
16684 1
extension_object_ids['RegisterServerRequest'] = nid
16685 1
nid = FourByteNodeId(ObjectIds.RegisterServerResponse_Encoding_DefaultBinary)
16686 1
extension_object_classes[nid] = RegisterServerResponse
16687 1
extension_object_ids['RegisterServerResponse'] = nid
16688 1
nid = FourByteNodeId(ObjectIds.DiscoveryConfiguration_Encoding_DefaultBinary)
16689 1
extension_object_classes[nid] = DiscoveryConfiguration
16690 1
extension_object_ids['DiscoveryConfiguration'] = nid
16691 1
nid = FourByteNodeId(ObjectIds.MdnsDiscoveryConfiguration_Encoding_DefaultBinary)
16692 1
extension_object_classes[nid] = MdnsDiscoveryConfiguration
16693 1
extension_object_ids['MdnsDiscoveryConfiguration'] = nid
16694 1
nid = FourByteNodeId(ObjectIds.RegisterServer2Request_Encoding_DefaultBinary)
16695 1
extension_object_classes[nid] = RegisterServer2Request
16696 1
extension_object_ids['RegisterServer2Request'] = nid
16697 1
nid = FourByteNodeId(ObjectIds.RegisterServer2Response_Encoding_DefaultBinary)
16698 1
extension_object_classes[nid] = RegisterServer2Response
16699 1
extension_object_ids['RegisterServer2Response'] = nid
16700 1
nid = FourByteNodeId(ObjectIds.ChannelSecurityToken_Encoding_DefaultBinary)
16701 1
extension_object_classes[nid] = ChannelSecurityToken
16702 1
extension_object_ids['ChannelSecurityToken'] = nid
16703 1
nid = FourByteNodeId(ObjectIds.OpenSecureChannelRequest_Encoding_DefaultBinary)
16704 1
extension_object_classes[nid] = OpenSecureChannelRequest
16705 1
extension_object_ids['OpenSecureChannelRequest'] = nid
16706 1
nid = FourByteNodeId(ObjectIds.OpenSecureChannelResponse_Encoding_DefaultBinary)
16707 1
extension_object_classes[nid] = OpenSecureChannelResponse
16708 1
extension_object_ids['OpenSecureChannelResponse'] = nid
16709 1
nid = FourByteNodeId(ObjectIds.CloseSecureChannelRequest_Encoding_DefaultBinary)
16710 1
extension_object_classes[nid] = CloseSecureChannelRequest
16711 1
extension_object_ids['CloseSecureChannelRequest'] = nid
16712 1
nid = FourByteNodeId(ObjectIds.CloseSecureChannelResponse_Encoding_DefaultBinary)
16713 1
extension_object_classes[nid] = CloseSecureChannelResponse
16714 1
extension_object_ids['CloseSecureChannelResponse'] = nid
16715 1
nid = FourByteNodeId(ObjectIds.SignedSoftwareCertificate_Encoding_DefaultBinary)
16716 1
extension_object_classes[nid] = SignedSoftwareCertificate
16717 1
extension_object_ids['SignedSoftwareCertificate'] = nid
16718 1
nid = FourByteNodeId(ObjectIds.SignatureData_Encoding_DefaultBinary)
16719 1
extension_object_classes[nid] = SignatureData
16720 1
extension_object_ids['SignatureData'] = nid
16721 1
nid = FourByteNodeId(ObjectIds.CreateSessionRequest_Encoding_DefaultBinary)
16722 1
extension_object_classes[nid] = CreateSessionRequest
16723 1
extension_object_ids['CreateSessionRequest'] = nid
16724 1
nid = FourByteNodeId(ObjectIds.CreateSessionResponse_Encoding_DefaultBinary)
16725 1
extension_object_classes[nid] = CreateSessionResponse
16726 1
extension_object_ids['CreateSessionResponse'] = nid
16727 1
nid = FourByteNodeId(ObjectIds.UserIdentityToken_Encoding_DefaultBinary)
16728 1
extension_object_classes[nid] = UserIdentityToken
16729 1
extension_object_ids['UserIdentityToken'] = nid
16730 1
nid = FourByteNodeId(ObjectIds.AnonymousIdentityToken_Encoding_DefaultBinary)
16731 1
extension_object_classes[nid] = AnonymousIdentityToken
16732 1
extension_object_ids['AnonymousIdentityToken'] = nid
16733 1
nid = FourByteNodeId(ObjectIds.UserNameIdentityToken_Encoding_DefaultBinary)
16734 1
extension_object_classes[nid] = UserNameIdentityToken
16735 1
extension_object_ids['UserNameIdentityToken'] = nid
16736 1
nid = FourByteNodeId(ObjectIds.X509IdentityToken_Encoding_DefaultBinary)
16737 1
extension_object_classes[nid] = X509IdentityToken
16738 1
extension_object_ids['X509IdentityToken'] = nid
16739 1
nid = FourByteNodeId(ObjectIds.KerberosIdentityToken_Encoding_DefaultBinary)
16740 1
extension_object_classes[nid] = KerberosIdentityToken
16741 1
extension_object_ids['KerberosIdentityToken'] = nid
16742 1
nid = FourByteNodeId(ObjectIds.IssuedIdentityToken_Encoding_DefaultBinary)
16743 1
extension_object_classes[nid] = IssuedIdentityToken
16744 1
extension_object_ids['IssuedIdentityToken'] = nid
16745
nid = FourByteNodeId(ObjectIds.ActivateSessionRequest_Encoding_DefaultBinary)
16746
extension_object_classes[nid] = ActivateSessionRequest
16747
extension_object_ids['ActivateSessionRequest'] = nid
16748
nid = FourByteNodeId(ObjectIds.ActivateSessionResponse_Encoding_DefaultBinary)
16749
extension_object_classes[nid] = ActivateSessionResponse
16750
extension_object_ids['ActivateSessionResponse'] = nid
16751
nid = FourByteNodeId(ObjectIds.CloseSessionRequest_Encoding_DefaultBinary)
16752
extension_object_classes[nid] = CloseSessionRequest
16753
extension_object_ids['CloseSessionRequest'] = nid
16754
nid = FourByteNodeId(ObjectIds.CloseSessionResponse_Encoding_DefaultBinary)
16755
extension_object_classes[nid] = CloseSessionResponse
16756
extension_object_ids['CloseSessionResponse'] = nid
16757
nid = FourByteNodeId(ObjectIds.CancelRequest_Encoding_DefaultBinary)
16758
extension_object_classes[nid] = CancelRequest
16759
extension_object_ids['CancelRequest'] = nid
16760
nid = FourByteNodeId(ObjectIds.CancelResponse_Encoding_DefaultBinary)
16761
extension_object_classes[nid] = CancelResponse
16762
extension_object_ids['CancelResponse'] = nid
16763
nid = FourByteNodeId(ObjectIds.NodeAttributes_Encoding_DefaultBinary)
16764
extension_object_classes[nid] = NodeAttributes
16765
extension_object_ids['NodeAttributes'] = nid
16766
nid = FourByteNodeId(ObjectIds.ObjectAttributes_Encoding_DefaultBinary)
16767
extension_object_classes[nid] = ObjectAttributes
16768
extension_object_ids['ObjectAttributes'] = nid
16769
nid = FourByteNodeId(ObjectIds.VariableAttributes_Encoding_DefaultBinary)
16770
extension_object_classes[nid] = VariableAttributes
16771
extension_object_ids['VariableAttributes'] = nid
16772
nid = FourByteNodeId(ObjectIds.MethodAttributes_Encoding_DefaultBinary)
16773
extension_object_classes[nid] = MethodAttributes
16774
extension_object_ids['MethodAttributes'] = nid
16775
nid = FourByteNodeId(ObjectIds.ObjectTypeAttributes_Encoding_DefaultBinary)
16776
extension_object_classes[nid] = ObjectTypeAttributes
16777
extension_object_ids['ObjectTypeAttributes'] = nid
16778
nid = FourByteNodeId(ObjectIds.VariableTypeAttributes_Encoding_DefaultBinary)
16779
extension_object_classes[nid] = VariableTypeAttributes
16780
extension_object_ids['VariableTypeAttributes'] = nid
16781
nid = FourByteNodeId(ObjectIds.ReferenceTypeAttributes_Encoding_DefaultBinary)
16782
extension_object_classes[nid] = ReferenceTypeAttributes
16783
extension_object_ids['ReferenceTypeAttributes'] = nid
16784
nid = FourByteNodeId(ObjectIds.DataTypeAttributes_Encoding_DefaultBinary)
16785
extension_object_classes[nid] = DataTypeAttributes
16786
extension_object_ids['DataTypeAttributes'] = nid
16787
nid = FourByteNodeId(ObjectIds.ViewAttributes_Encoding_DefaultBinary)
16788
extension_object_classes[nid] = ViewAttributes
16789
extension_object_ids['ViewAttributes'] = nid
16790
nid = FourByteNodeId(ObjectIds.AddNodesItem_Encoding_DefaultBinary)
16791
extension_object_classes[nid] = AddNodesItem
16792
extension_object_ids['AddNodesItem'] = nid
16793
nid = FourByteNodeId(ObjectIds.AddNodesResult_Encoding_DefaultBinary)
16794
extension_object_classes[nid] = AddNodesResult
16795
extension_object_ids['AddNodesResult'] = nid
16796
nid = FourByteNodeId(ObjectIds.AddNodesRequest_Encoding_DefaultBinary)
16797
extension_object_classes[nid] = AddNodesRequest
16798
extension_object_ids['AddNodesRequest'] = nid
16799
nid = FourByteNodeId(ObjectIds.AddNodesResponse_Encoding_DefaultBinary)
16800
extension_object_classes[nid] = AddNodesResponse
16801
extension_object_ids['AddNodesResponse'] = nid
16802
nid = FourByteNodeId(ObjectIds.AddReferencesItem_Encoding_DefaultBinary)
16803
extension_object_classes[nid] = AddReferencesItem
16804
extension_object_ids['AddReferencesItem'] = nid
16805
nid = FourByteNodeId(ObjectIds.AddReferencesRequest_Encoding_DefaultBinary)
16806
extension_object_classes[nid] = AddReferencesRequest
16807
extension_object_ids['AddReferencesRequest'] = nid
16808
nid = FourByteNodeId(ObjectIds.AddReferencesResponse_Encoding_DefaultBinary)
16809
extension_object_classes[nid] = AddReferencesResponse
16810
extension_object_ids['AddReferencesResponse'] = nid
16811
nid = FourByteNodeId(ObjectIds.DeleteNodesItem_Encoding_DefaultBinary)
16812
extension_object_classes[nid] = DeleteNodesItem
16813
extension_object_ids['DeleteNodesItem'] = nid
16814
nid = FourByteNodeId(ObjectIds.DeleteNodesRequest_Encoding_DefaultBinary)
16815
extension_object_classes[nid] = DeleteNodesRequest
16816
extension_object_ids['DeleteNodesRequest'] = nid
16817
nid = FourByteNodeId(ObjectIds.DeleteNodesResponse_Encoding_DefaultBinary)
16818
extension_object_classes[nid] = DeleteNodesResponse
16819
extension_object_ids['DeleteNodesResponse'] = nid
16820
nid = FourByteNodeId(ObjectIds.DeleteReferencesItem_Encoding_DefaultBinary)
16821
extension_object_classes[nid] = DeleteReferencesItem
16822
extension_object_ids['DeleteReferencesItem'] = nid
16823
nid = FourByteNodeId(ObjectIds.DeleteReferencesRequest_Encoding_DefaultBinary)
16824
extension_object_classes[nid] = DeleteReferencesRequest
16825
extension_object_ids['DeleteReferencesRequest'] = nid
16826
nid = FourByteNodeId(ObjectIds.DeleteReferencesResponse_Encoding_DefaultBinary)
16827
extension_object_classes[nid] = DeleteReferencesResponse
16828
extension_object_ids['DeleteReferencesResponse'] = nid
16829
nid = FourByteNodeId(ObjectIds.ViewDescription_Encoding_DefaultBinary)
16830
extension_object_classes[nid] = ViewDescription
16831
extension_object_ids['ViewDescription'] = nid
16832
nid = FourByteNodeId(ObjectIds.BrowseDescription_Encoding_DefaultBinary)
16833
extension_object_classes[nid] = BrowseDescription
16834
extension_object_ids['BrowseDescription'] = nid
16835
nid = FourByteNodeId(ObjectIds.ReferenceDescription_Encoding_DefaultBinary)
16836
extension_object_classes[nid] = ReferenceDescription
16837
extension_object_ids['ReferenceDescription'] = nid
16838
nid = FourByteNodeId(ObjectIds.BrowseResult_Encoding_DefaultBinary)
16839
extension_object_classes[nid] = BrowseResult
16840
extension_object_ids['BrowseResult'] = nid
16841
nid = FourByteNodeId(ObjectIds.BrowseRequest_Encoding_DefaultBinary)
16842
extension_object_classes[nid] = BrowseRequest
16843
extension_object_ids['BrowseRequest'] = nid
16844
nid = FourByteNodeId(ObjectIds.BrowseResponse_Encoding_DefaultBinary)
16845
extension_object_classes[nid] = BrowseResponse
16846
extension_object_ids['BrowseResponse'] = nid
16847
nid = FourByteNodeId(ObjectIds.BrowseNextRequest_Encoding_DefaultBinary)
16848
extension_object_classes[nid] = BrowseNextRequest
16849
extension_object_ids['BrowseNextRequest'] = nid
16850
nid = FourByteNodeId(ObjectIds.BrowseNextResponse_Encoding_DefaultBinary)
16851
extension_object_classes[nid] = BrowseNextResponse
16852
extension_object_ids['BrowseNextResponse'] = nid
16853
nid = FourByteNodeId(ObjectIds.RelativePathElement_Encoding_DefaultBinary)
16854
extension_object_classes[nid] = RelativePathElement
16855
extension_object_ids['RelativePathElement'] = nid
16856
nid = FourByteNodeId(ObjectIds.RelativePath_Encoding_DefaultBinary)
16857
extension_object_classes[nid] = RelativePath
16858
extension_object_ids['RelativePath'] = nid
16859
nid = FourByteNodeId(ObjectIds.BrowsePath_Encoding_DefaultBinary)
16860
extension_object_classes[nid] = BrowsePath
16861
extension_object_ids['BrowsePath'] = nid
16862
nid = FourByteNodeId(ObjectIds.BrowsePathTarget_Encoding_DefaultBinary)
16863
extension_object_classes[nid] = BrowsePathTarget
16864
extension_object_ids['BrowsePathTarget'] = nid
16865
nid = FourByteNodeId(ObjectIds.BrowsePathResult_Encoding_DefaultBinary)
16866
extension_object_classes[nid] = BrowsePathResult
16867
extension_object_ids['BrowsePathResult'] = nid
16868
nid = FourByteNodeId(ObjectIds.TranslateBrowsePathsToNodeIdsRequest_Encoding_DefaultBinary)
16869
extension_object_classes[nid] = TranslateBrowsePathsToNodeIdsRequest
16870
extension_object_ids['TranslateBrowsePathsToNodeIdsRequest'] = nid
16871
nid = FourByteNodeId(ObjectIds.TranslateBrowsePathsToNodeIdsResponse_Encoding_DefaultBinary)
16872
extension_object_classes[nid] = TranslateBrowsePathsToNodeIdsResponse
16873
extension_object_ids['TranslateBrowsePathsToNodeIdsResponse'] = nid
16874
nid = FourByteNodeId(ObjectIds.RegisterNodesRequest_Encoding_DefaultBinary)
16875
extension_object_classes[nid] = RegisterNodesRequest
16876
extension_object_ids['RegisterNodesRequest'] = nid
16877
nid = FourByteNodeId(ObjectIds.RegisterNodesResponse_Encoding_DefaultBinary)
16878
extension_object_classes[nid] = RegisterNodesResponse
16879
extension_object_ids['RegisterNodesResponse'] = nid
16880
nid = FourByteNodeId(ObjectIds.UnregisterNodesRequest_Encoding_DefaultBinary)
16881
extension_object_classes[nid] = UnregisterNodesRequest
16882
extension_object_ids['UnregisterNodesRequest'] = nid
16883
nid = FourByteNodeId(ObjectIds.UnregisterNodesResponse_Encoding_DefaultBinary)
16884
extension_object_classes[nid] = UnregisterNodesResponse
16885
extension_object_ids['UnregisterNodesResponse'] = nid
16886
nid = FourByteNodeId(ObjectIds.EndpointConfiguration_Encoding_DefaultBinary)
16887
extension_object_classes[nid] = EndpointConfiguration
16888
extension_object_ids['EndpointConfiguration'] = nid
16889
nid = FourByteNodeId(ObjectIds.SupportedProfile_Encoding_DefaultBinary)
16890
extension_object_classes[nid] = SupportedProfile
16891
extension_object_ids['SupportedProfile'] = nid
16892
nid = FourByteNodeId(ObjectIds.SoftwareCertificate_Encoding_DefaultBinary)
16893
extension_object_classes[nid] = SoftwareCertificate
16894
extension_object_ids['SoftwareCertificate'] = nid
16895
nid = FourByteNodeId(ObjectIds.QueryDataDescription_Encoding_DefaultBinary)
16896
extension_object_classes[nid] = QueryDataDescription
16897
extension_object_ids['QueryDataDescription'] = nid
16898
nid = FourByteNodeId(ObjectIds.NodeTypeDescription_Encoding_DefaultBinary)
16899
extension_object_classes[nid] = NodeTypeDescription
16900
extension_object_ids['NodeTypeDescription'] = nid
16901
nid = FourByteNodeId(ObjectIds.QueryDataSet_Encoding_DefaultBinary)
16902
extension_object_classes[nid] = QueryDataSet
16903
extension_object_ids['QueryDataSet'] = nid
16904
nid = FourByteNodeId(ObjectIds.NodeReference_Encoding_DefaultBinary)
16905
extension_object_classes[nid] = NodeReference
16906
extension_object_ids['NodeReference'] = nid
16907
nid = FourByteNodeId(ObjectIds.ContentFilterElement_Encoding_DefaultBinary)
16908
extension_object_classes[nid] = ContentFilterElement
16909
extension_object_ids['ContentFilterElement'] = nid
16910
nid = FourByteNodeId(ObjectIds.ContentFilter_Encoding_DefaultBinary)
16911
extension_object_classes[nid] = ContentFilter
16912
extension_object_ids['ContentFilter'] = nid
16913
nid = FourByteNodeId(ObjectIds.ElementOperand_Encoding_DefaultBinary)
16914
extension_object_classes[nid] = ElementOperand
16915
extension_object_ids['ElementOperand'] = nid
16916
nid = FourByteNodeId(ObjectIds.LiteralOperand_Encoding_DefaultBinary)
16917
extension_object_classes[nid] = LiteralOperand
16918
extension_object_ids['LiteralOperand'] = nid
16919
nid = FourByteNodeId(ObjectIds.AttributeOperand_Encoding_DefaultBinary)
16920
extension_object_classes[nid] = AttributeOperand
16921
extension_object_ids['AttributeOperand'] = nid
16922
nid = FourByteNodeId(ObjectIds.SimpleAttributeOperand_Encoding_DefaultBinary)
16923
extension_object_classes[nid] = SimpleAttributeOperand
16924
extension_object_ids['SimpleAttributeOperand'] = nid
16925
nid = FourByteNodeId(ObjectIds.ContentFilterElementResult_Encoding_DefaultBinary)
16926
extension_object_classes[nid] = ContentFilterElementResult
16927
extension_object_ids['ContentFilterElementResult'] = nid
16928
nid = FourByteNodeId(ObjectIds.ContentFilterResult_Encoding_DefaultBinary)
16929
extension_object_classes[nid] = ContentFilterResult
16930
extension_object_ids['ContentFilterResult'] = nid
16931
nid = FourByteNodeId(ObjectIds.ParsingResult_Encoding_DefaultBinary)
16932
extension_object_classes[nid] = ParsingResult
16933
extension_object_ids['ParsingResult'] = nid
16934
nid = FourByteNodeId(ObjectIds.QueryFirstRequest_Encoding_DefaultBinary)
16935
extension_object_classes[nid] = QueryFirstRequest
16936
extension_object_ids['QueryFirstRequest'] = nid
16937
nid = FourByteNodeId(ObjectIds.QueryFirstResponse_Encoding_DefaultBinary)
16938
extension_object_classes[nid] = QueryFirstResponse
16939
extension_object_ids['QueryFirstResponse'] = nid
16940
nid = FourByteNodeId(ObjectIds.QueryNextRequest_Encoding_DefaultBinary)
16941
extension_object_classes[nid] = QueryNextRequest
16942
extension_object_ids['QueryNextRequest'] = nid
16943
nid = FourByteNodeId(ObjectIds.QueryNextResponse_Encoding_DefaultBinary)
16944
extension_object_classes[nid] = QueryNextResponse
16945
extension_object_ids['QueryNextResponse'] = nid
16946
nid = FourByteNodeId(ObjectIds.ReadValueId_Encoding_DefaultBinary)
16947
extension_object_classes[nid] = ReadValueId
16948
extension_object_ids['ReadValueId'] = nid
16949
nid = FourByteNodeId(ObjectIds.ReadRequest_Encoding_DefaultBinary)
16950
extension_object_classes[nid] = ReadRequest
16951
extension_object_ids['ReadRequest'] = nid
16952
nid = FourByteNodeId(ObjectIds.ReadResponse_Encoding_DefaultBinary)
16953
extension_object_classes[nid] = ReadResponse
16954
extension_object_ids['ReadResponse'] = nid
16955
nid = FourByteNodeId(ObjectIds.HistoryReadValueId_Encoding_DefaultBinary)
16956
extension_object_classes[nid] = HistoryReadValueId
16957
extension_object_ids['HistoryReadValueId'] = nid
16958
nid = FourByteNodeId(ObjectIds.HistoryReadResult_Encoding_DefaultBinary)
16959
extension_object_classes[nid] = HistoryReadResult
16960
extension_object_ids['HistoryReadResult'] = nid
16961
nid = FourByteNodeId(ObjectIds.HistoryReadDetails_Encoding_DefaultBinary)
16962
extension_object_classes[nid] = HistoryReadDetails
16963
extension_object_ids['HistoryReadDetails'] = nid
16964
nid = FourByteNodeId(ObjectIds.ReadEventDetails_Encoding_DefaultBinary)
16965
extension_object_classes[nid] = ReadEventDetails
16966
extension_object_ids['ReadEventDetails'] = nid
16967
nid = FourByteNodeId(ObjectIds.ReadRawModifiedDetails_Encoding_DefaultBinary)
16968
extension_object_classes[nid] = ReadRawModifiedDetails
16969
extension_object_ids['ReadRawModifiedDetails'] = nid
16970
nid = FourByteNodeId(ObjectIds.ReadProcessedDetails_Encoding_DefaultBinary)
16971
extension_object_classes[nid] = ReadProcessedDetails
16972
extension_object_ids['ReadProcessedDetails'] = nid
16973
nid = FourByteNodeId(ObjectIds.ReadAtTimeDetails_Encoding_DefaultBinary)
16974
extension_object_classes[nid] = ReadAtTimeDetails
16975
extension_object_ids['ReadAtTimeDetails'] = nid
16976
nid = FourByteNodeId(ObjectIds.HistoryData_Encoding_DefaultBinary)
16977
extension_object_classes[nid] = HistoryData
16978
extension_object_ids['HistoryData'] = nid
16979
nid = FourByteNodeId(ObjectIds.ModificationInfo_Encoding_DefaultBinary)
16980
extension_object_classes[nid] = ModificationInfo
16981
extension_object_ids['ModificationInfo'] = nid
16982
nid = FourByteNodeId(ObjectIds.HistoryModifiedData_Encoding_DefaultBinary)
16983
extension_object_classes[nid] = HistoryModifiedData
16984
extension_object_ids['HistoryModifiedData'] = nid
16985
nid = FourByteNodeId(ObjectIds.HistoryEvent_Encoding_DefaultBinary)
16986
extension_object_classes[nid] = HistoryEvent
16987
extension_object_ids['HistoryEvent'] = nid
16988
nid = FourByteNodeId(ObjectIds.HistoryReadRequest_Encoding_DefaultBinary)
16989
extension_object_classes[nid] = HistoryReadRequest
16990
extension_object_ids['HistoryReadRequest'] = nid
16991
nid = FourByteNodeId(ObjectIds.HistoryReadResponse_Encoding_DefaultBinary)
16992
extension_object_classes[nid] = HistoryReadResponse
16993
extension_object_ids['HistoryReadResponse'] = nid
16994
nid = FourByteNodeId(ObjectIds.WriteValue_Encoding_DefaultBinary)
16995
extension_object_classes[nid] = WriteValue
16996
extension_object_ids['WriteValue'] = nid
16997
nid = FourByteNodeId(ObjectIds.WriteRequest_Encoding_DefaultBinary)
16998
extension_object_classes[nid] = WriteRequest
16999
extension_object_ids['WriteRequest'] = nid
17000
nid = FourByteNodeId(ObjectIds.WriteResponse_Encoding_DefaultBinary)
17001
extension_object_classes[nid] = WriteResponse
17002
extension_object_ids['WriteResponse'] = nid
17003
nid = FourByteNodeId(ObjectIds.HistoryUpdateDetails_Encoding_DefaultBinary)
17004
extension_object_classes[nid] = HistoryUpdateDetails
17005
extension_object_ids['HistoryUpdateDetails'] = nid
17006
nid = FourByteNodeId(ObjectIds.UpdateDataDetails_Encoding_DefaultBinary)
17007
extension_object_classes[nid] = UpdateDataDetails
17008
extension_object_ids['UpdateDataDetails'] = nid
17009
nid = FourByteNodeId(ObjectIds.UpdateStructureDataDetails_Encoding_DefaultBinary)
17010
extension_object_classes[nid] = UpdateStructureDataDetails
17011
extension_object_ids['UpdateStructureDataDetails'] = nid
17012
nid = FourByteNodeId(ObjectIds.UpdateEventDetails_Encoding_DefaultBinary)
17013
extension_object_classes[nid] = UpdateEventDetails
17014
extension_object_ids['UpdateEventDetails'] = nid
17015
nid = FourByteNodeId(ObjectIds.DeleteRawModifiedDetails_Encoding_DefaultBinary)
17016
extension_object_classes[nid] = DeleteRawModifiedDetails
17017
extension_object_ids['DeleteRawModifiedDetails'] = nid
17018
nid = FourByteNodeId(ObjectIds.DeleteAtTimeDetails_Encoding_DefaultBinary)
17019
extension_object_classes[nid] = DeleteAtTimeDetails
17020
extension_object_ids['DeleteAtTimeDetails'] = nid
17021
nid = FourByteNodeId(ObjectIds.DeleteEventDetails_Encoding_DefaultBinary)
17022
extension_object_classes[nid] = DeleteEventDetails
17023
extension_object_ids['DeleteEventDetails'] = nid
17024
nid = FourByteNodeId(ObjectIds.HistoryUpdateResult_Encoding_DefaultBinary)
17025
extension_object_classes[nid] = HistoryUpdateResult
17026
extension_object_ids['HistoryUpdateResult'] = nid
17027
nid = FourByteNodeId(ObjectIds.HistoryUpdateRequest_Encoding_DefaultBinary)
17028
extension_object_classes[nid] = HistoryUpdateRequest
17029
extension_object_ids['HistoryUpdateRequest'] = nid
17030
nid = FourByteNodeId(ObjectIds.HistoryUpdateResponse_Encoding_DefaultBinary)
17031
extension_object_classes[nid] = HistoryUpdateResponse
17032
extension_object_ids['HistoryUpdateResponse'] = nid
17033
nid = FourByteNodeId(ObjectIds.CallMethodRequest_Encoding_DefaultBinary)
17034
extension_object_classes[nid] = CallMethodRequest
17035
extension_object_ids['CallMethodRequest'] = nid
17036
nid = FourByteNodeId(ObjectIds.CallMethodResult_Encoding_DefaultBinary)
17037
extension_object_classes[nid] = CallMethodResult
17038
extension_object_ids['CallMethodResult'] = nid
17039
nid = FourByteNodeId(ObjectIds.CallRequest_Encoding_DefaultBinary)
17040
extension_object_classes[nid] = CallRequest
17041
extension_object_ids['CallRequest'] = nid
17042
nid = FourByteNodeId(ObjectIds.CallResponse_Encoding_DefaultBinary)
17043
extension_object_classes[nid] = CallResponse
17044
extension_object_ids['CallResponse'] = nid
17045
nid = FourByteNodeId(ObjectIds.MonitoringFilter_Encoding_DefaultBinary)
17046
extension_object_classes[nid] = MonitoringFilter
17047
extension_object_ids['MonitoringFilter'] = nid
17048
nid = FourByteNodeId(ObjectIds.DataChangeFilter_Encoding_DefaultBinary)
17049
extension_object_classes[nid] = DataChangeFilter
17050
extension_object_ids['DataChangeFilter'] = nid
17051
nid = FourByteNodeId(ObjectIds.EventFilter_Encoding_DefaultBinary)
17052
extension_object_classes[nid] = EventFilter
17053
extension_object_ids['EventFilter'] = nid
17054
nid = FourByteNodeId(ObjectIds.AggregateConfiguration_Encoding_DefaultBinary)
17055
extension_object_classes[nid] = AggregateConfiguration
17056
extension_object_ids['AggregateConfiguration'] = nid
17057
nid = FourByteNodeId(ObjectIds.AggregateFilter_Encoding_DefaultBinary)
17058
extension_object_classes[nid] = AggregateFilter
17059
extension_object_ids['AggregateFilter'] = nid
17060
nid = FourByteNodeId(ObjectIds.MonitoringFilterResult_Encoding_DefaultBinary)
17061
extension_object_classes[nid] = MonitoringFilterResult
17062
extension_object_ids['MonitoringFilterResult'] = nid
17063
nid = FourByteNodeId(ObjectIds.EventFilterResult_Encoding_DefaultBinary)
17064
extension_object_classes[nid] = EventFilterResult
17065
extension_object_ids['EventFilterResult'] = nid
17066
nid = FourByteNodeId(ObjectIds.AggregateFilterResult_Encoding_DefaultBinary)
17067
extension_object_classes[nid] = AggregateFilterResult
17068
extension_object_ids['AggregateFilterResult'] = nid
17069
nid = FourByteNodeId(ObjectIds.MonitoringParameters_Encoding_DefaultBinary)
17070
extension_object_classes[nid] = MonitoringParameters
17071
extension_object_ids['MonitoringParameters'] = nid
17072
nid = FourByteNodeId(ObjectIds.MonitoredItemCreateRequest_Encoding_DefaultBinary)
17073
extension_object_classes[nid] = MonitoredItemCreateRequest
17074
extension_object_ids['MonitoredItemCreateRequest'] = nid
17075
nid = FourByteNodeId(ObjectIds.MonitoredItemCreateResult_Encoding_DefaultBinary)
17076
extension_object_classes[nid] = MonitoredItemCreateResult
17077
extension_object_ids['MonitoredItemCreateResult'] = nid
17078
nid = FourByteNodeId(ObjectIds.CreateMonitoredItemsRequest_Encoding_DefaultBinary)
17079
extension_object_classes[nid] = CreateMonitoredItemsRequest
17080
extension_object_ids['CreateMonitoredItemsRequest'] = nid
17081
nid = FourByteNodeId(ObjectIds.CreateMonitoredItemsResponse_Encoding_DefaultBinary)
17082
extension_object_classes[nid] = CreateMonitoredItemsResponse
17083
extension_object_ids['CreateMonitoredItemsResponse'] = nid
17084
nid = FourByteNodeId(ObjectIds.MonitoredItemModifyRequest_Encoding_DefaultBinary)
17085
extension_object_classes[nid] = MonitoredItemModifyRequest
17086
extension_object_ids['MonitoredItemModifyRequest'] = nid
17087
nid = FourByteNodeId(ObjectIds.MonitoredItemModifyResult_Encoding_DefaultBinary)
17088
extension_object_classes[nid] = MonitoredItemModifyResult
17089
extension_object_ids['MonitoredItemModifyResult'] = nid
17090
nid = FourByteNodeId(ObjectIds.ModifyMonitoredItemsRequest_Encoding_DefaultBinary)
17091
extension_object_classes[nid] = ModifyMonitoredItemsRequest
17092
extension_object_ids['ModifyMonitoredItemsRequest'] = nid
17093
nid = FourByteNodeId(ObjectIds.ModifyMonitoredItemsResponse_Encoding_DefaultBinary)
17094
extension_object_classes[nid] = ModifyMonitoredItemsResponse
17095
extension_object_ids['ModifyMonitoredItemsResponse'] = nid
17096
nid = FourByteNodeId(ObjectIds.SetMonitoringModeRequest_Encoding_DefaultBinary)
17097
extension_object_classes[nid] = SetMonitoringModeRequest
17098
extension_object_ids['SetMonitoringModeRequest'] = nid
17099
nid = FourByteNodeId(ObjectIds.SetMonitoringModeResponse_Encoding_DefaultBinary)
17100
extension_object_classes[nid] = SetMonitoringModeResponse
17101
extension_object_ids['SetMonitoringModeResponse'] = nid
17102
nid = FourByteNodeId(ObjectIds.SetTriggeringRequest_Encoding_DefaultBinary)
17103
extension_object_classes[nid] = SetTriggeringRequest
17104
extension_object_ids['SetTriggeringRequest'] = nid
17105
nid = FourByteNodeId(ObjectIds.SetTriggeringResponse_Encoding_DefaultBinary)
17106
extension_object_classes[nid] = SetTriggeringResponse
17107
extension_object_ids['SetTriggeringResponse'] = nid
17108
nid = FourByteNodeId(ObjectIds.DeleteMonitoredItemsRequest_Encoding_DefaultBinary)
17109
extension_object_classes[nid] = DeleteMonitoredItemsRequest
17110
extension_object_ids['DeleteMonitoredItemsRequest'] = nid
17111
nid = FourByteNodeId(ObjectIds.DeleteMonitoredItemsResponse_Encoding_DefaultBinary)
17112
extension_object_classes[nid] = DeleteMonitoredItemsResponse
17113
extension_object_ids['DeleteMonitoredItemsResponse'] = nid
17114
nid = FourByteNodeId(ObjectIds.CreateSubscriptionRequest_Encoding_DefaultBinary)
17115
extension_object_classes[nid] = CreateSubscriptionRequest
17116
extension_object_ids['CreateSubscriptionRequest'] = nid
17117
nid = FourByteNodeId(ObjectIds.CreateSubscriptionResponse_Encoding_DefaultBinary)
17118
extension_object_classes[nid] = CreateSubscriptionResponse
17119
extension_object_ids['CreateSubscriptionResponse'] = nid
17120
nid = FourByteNodeId(ObjectIds.ModifySubscriptionRequest_Encoding_DefaultBinary)
17121
extension_object_classes[nid] = ModifySubscriptionRequest
17122
extension_object_ids['ModifySubscriptionRequest'] = nid
17123
nid = FourByteNodeId(ObjectIds.ModifySubscriptionResponse_Encoding_DefaultBinary)
17124
extension_object_classes[nid] = ModifySubscriptionResponse
17125
extension_object_ids['ModifySubscriptionResponse'] = nid
17126
nid = FourByteNodeId(ObjectIds.SetPublishingModeRequest_Encoding_DefaultBinary)
17127
extension_object_classes[nid] = SetPublishingModeRequest
17128
extension_object_ids['SetPublishingModeRequest'] = nid
17129
nid = FourByteNodeId(ObjectIds.SetPublishingModeResponse_Encoding_DefaultBinary)
17130
extension_object_classes[nid] = SetPublishingModeResponse
17131
extension_object_ids['SetPublishingModeResponse'] = nid
17132
nid = FourByteNodeId(ObjectIds.NotificationMessage_Encoding_DefaultBinary)
17133
extension_object_classes[nid] = NotificationMessage
17134
extension_object_ids['NotificationMessage'] = nid
17135
nid = FourByteNodeId(ObjectIds.NotificationData_Encoding_DefaultBinary)
17136
extension_object_classes[nid] = NotificationData
17137
extension_object_ids['NotificationData'] = nid
17138
nid = FourByteNodeId(ObjectIds.DataChangeNotification_Encoding_DefaultBinary)
17139
extension_object_classes[nid] = DataChangeNotification
17140
extension_object_ids['DataChangeNotification'] = nid
17141
nid = FourByteNodeId(ObjectIds.MonitoredItemNotification_Encoding_DefaultBinary)
17142
extension_object_classes[nid] = MonitoredItemNotification
17143
extension_object_ids['MonitoredItemNotification'] = nid
17144
nid = FourByteNodeId(ObjectIds.EventNotificationList_Encoding_DefaultBinary)
17145
extension_object_classes[nid] = EventNotificationList
17146
extension_object_ids['EventNotificationList'] = nid
17147
nid = FourByteNodeId(ObjectIds.EventFieldList_Encoding_DefaultBinary)
17148
extension_object_classes[nid] = EventFieldList
17149
extension_object_ids['EventFieldList'] = nid
17150
nid = FourByteNodeId(ObjectIds.HistoryEventFieldList_Encoding_DefaultBinary)
17151
extension_object_classes[nid] = HistoryEventFieldList
17152
extension_object_ids['HistoryEventFieldList'] = nid
17153
nid = FourByteNodeId(ObjectIds.StatusChangeNotification_Encoding_DefaultBinary)
17154
extension_object_classes[nid] = StatusChangeNotification
17155
extension_object_ids['StatusChangeNotification'] = nid
17156
nid = FourByteNodeId(ObjectIds.SubscriptionAcknowledgement_Encoding_DefaultBinary)
17157
extension_object_classes[nid] = SubscriptionAcknowledgement
17158
extension_object_ids['SubscriptionAcknowledgement'] = nid
17159
nid = FourByteNodeId(ObjectIds.PublishRequest_Encoding_DefaultBinary)
17160
extension_object_classes[nid] = PublishRequest
17161
extension_object_ids['PublishRequest'] = nid
17162
nid = FourByteNodeId(ObjectIds.PublishResponse_Encoding_DefaultBinary)
17163
extension_object_classes[nid] = PublishResponse
17164
extension_object_ids['PublishResponse'] = nid
17165
nid = FourByteNodeId(ObjectIds.RepublishRequest_Encoding_DefaultBinary)
17166
extension_object_classes[nid] = RepublishRequest
17167
extension_object_ids['RepublishRequest'] = nid
17168
nid = FourByteNodeId(ObjectIds.RepublishResponse_Encoding_DefaultBinary)
17169
extension_object_classes[nid] = RepublishResponse
17170
extension_object_ids['RepublishResponse'] = nid
17171
nid = FourByteNodeId(ObjectIds.TransferResult_Encoding_DefaultBinary)
17172
extension_object_classes[nid] = TransferResult
17173
extension_object_ids['TransferResult'] = nid
17174
nid = FourByteNodeId(ObjectIds.TransferSubscriptionsRequest_Encoding_DefaultBinary)
17175
extension_object_classes[nid] = TransferSubscriptionsRequest
17176
extension_object_ids['TransferSubscriptionsRequest'] = nid
17177
nid = FourByteNodeId(ObjectIds.TransferSubscriptionsResponse_Encoding_DefaultBinary)
17178
extension_object_classes[nid] = TransferSubscriptionsResponse
17179
extension_object_ids['TransferSubscriptionsResponse'] = nid
17180
nid = FourByteNodeId(ObjectIds.DeleteSubscriptionsRequest_Encoding_DefaultBinary)
17181
extension_object_classes[nid] = DeleteSubscriptionsRequest
17182
extension_object_ids['DeleteSubscriptionsRequest'] = nid
17183
nid = FourByteNodeId(ObjectIds.DeleteSubscriptionsResponse_Encoding_DefaultBinary)
17184
extension_object_classes[nid] = DeleteSubscriptionsResponse
17185
extension_object_ids['DeleteSubscriptionsResponse'] = nid
17186
nid = FourByteNodeId(ObjectIds.BuildInfo_Encoding_DefaultBinary)
17187
extension_object_classes[nid] = BuildInfo
17188
extension_object_ids['BuildInfo'] = nid
17189
nid = FourByteNodeId(ObjectIds.RedundantServerDataType_Encoding_DefaultBinary)
17190
extension_object_classes[nid] = RedundantServerDataType
17191
extension_object_ids['RedundantServerDataType'] = nid
17192
nid = FourByteNodeId(ObjectIds.EndpointUrlListDataType_Encoding_DefaultBinary)
17193
extension_object_classes[nid] = EndpointUrlListDataType
17194
extension_object_ids['EndpointUrlListDataType'] = nid
17195
nid = FourByteNodeId(ObjectIds.NetworkGroupDataType_Encoding_DefaultBinary)
17196
extension_object_classes[nid] = NetworkGroupDataType
17197
extension_object_ids['NetworkGroupDataType'] = nid
17198
nid = FourByteNodeId(ObjectIds.SamplingIntervalDiagnosticsDataType_Encoding_DefaultBinary)
17199
extension_object_classes[nid] = SamplingIntervalDiagnosticsDataType
17200
extension_object_ids['SamplingIntervalDiagnosticsDataType'] = nid
17201
nid = FourByteNodeId(ObjectIds.ServerDiagnosticsSummaryDataType_Encoding_DefaultBinary)
17202
extension_object_classes[nid] = ServerDiagnosticsSummaryDataType
17203
extension_object_ids['ServerDiagnosticsSummaryDataType'] = nid
17204
nid = FourByteNodeId(ObjectIds.ServerStatusDataType_Encoding_DefaultBinary)
17205
extension_object_classes[nid] = ServerStatusDataType
17206
extension_object_ids['ServerStatusDataType'] = nid
17207
nid = FourByteNodeId(ObjectIds.SessionDiagnosticsDataType_Encoding_DefaultBinary)
17208
extension_object_classes[nid] = SessionDiagnosticsDataType
17209
extension_object_ids['SessionDiagnosticsDataType'] = nid
17210
nid = FourByteNodeId(ObjectIds.SessionSecurityDiagnosticsDataType_Encoding_DefaultBinary)
17211
extension_object_classes[nid] = SessionSecurityDiagnosticsDataType
17212
extension_object_ids['SessionSecurityDiagnosticsDataType'] = nid
17213
nid = FourByteNodeId(ObjectIds.ServiceCounterDataType_Encoding_DefaultBinary)
17214
extension_object_classes[nid] = ServiceCounterDataType
17215
extension_object_ids['ServiceCounterDataType'] = nid
17216
nid = FourByteNodeId(ObjectIds.StatusResult_Encoding_DefaultBinary)
17217
extension_object_classes[nid] = StatusResult
17218
extension_object_ids['StatusResult'] = nid
17219
nid = FourByteNodeId(ObjectIds.SubscriptionDiagnosticsDataType_Encoding_DefaultBinary)
17220
extension_object_classes[nid] = SubscriptionDiagnosticsDataType
17221
extension_object_ids['SubscriptionDiagnosticsDataType'] = nid
17222
nid = FourByteNodeId(ObjectIds.ModelChangeStructureDataType_Encoding_DefaultBinary)
17223
extension_object_classes[nid] = ModelChangeStructureDataType
17224
extension_object_ids['ModelChangeStructureDataType'] = nid
17225
nid = FourByteNodeId(ObjectIds.SemanticChangeStructureDataType_Encoding_DefaultBinary)
17226
extension_object_classes[nid] = SemanticChangeStructureDataType
17227
extension_object_ids['SemanticChangeStructureDataType'] = nid
17228
nid = FourByteNodeId(ObjectIds.Range_Encoding_DefaultBinary)
17229
extension_object_classes[nid] = Range
17230
extension_object_ids['Range'] = nid
17231
nid = FourByteNodeId(ObjectIds.EUInformation_Encoding_DefaultBinary)
17232
extension_object_classes[nid] = EUInformation
17233
extension_object_ids['EUInformation'] = nid
17234
nid = FourByteNodeId(ObjectIds.ComplexNumberType_Encoding_DefaultBinary)
17235
extension_object_classes[nid] = ComplexNumberType
17236
extension_object_ids['ComplexNumberType'] = nid
17237
nid = FourByteNodeId(ObjectIds.DoubleComplexNumberType_Encoding_DefaultBinary)
17238
extension_object_classes[nid] = DoubleComplexNumberType
17239
extension_object_ids['DoubleComplexNumberType'] = nid
17240
nid = FourByteNodeId(ObjectIds.AxisInformation_Encoding_DefaultBinary)
17241
extension_object_classes[nid] = AxisInformation
17242
extension_object_ids['AxisInformation'] = nid
17243
nid = FourByteNodeId(ObjectIds.XVType_Encoding_DefaultBinary)
17244
extension_object_classes[nid] = XVType
17245
extension_object_ids['XVType'] = nid
17246
nid = FourByteNodeId(ObjectIds.ProgramDiagnosticDataType_Encoding_DefaultBinary)
17247
extension_object_classes[nid] = ProgramDiagnosticDataType
17248
extension_object_ids['ProgramDiagnosticDataType'] = nid
17249
nid = FourByteNodeId(ObjectIds.Annotation_Encoding_DefaultBinary)
17250
extension_object_classes[nid] = Annotation
17251
extension_object_ids['Annotation'] = nid
17252