Completed
Push — master ( 1f3680...dee454 )
by Olivier
04:42
created

RelativePath   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Test Coverage

Coverage 7.69%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 43
ccs 3
cts 39
cp 0.0769
rs 10
c 1
b 0
f 0
wmc 9
1
'''
2
Autogenerate code from xml spec
3
'''
4
5 1
from datetime import datetime
6 1
from enum import Enum, IntEnum
7
8 1
from opcua.common.utils import Buffer
9 1
from opcua.ua.uaerrors import UaError
10 1
from opcua.ua.uatypes import *
11 1
from opcua.ua import ua_binary as uabin
12
from opcua.ua.object_ids import ObjectIds
13
14 1
15
class NamingRuleType(IntEnum):
16
    '''
17
    :ivar Mandatory:
18
    :vartype Mandatory: 1
19
    :ivar Optional:
20
    :vartype Optional: 2
21
    :ivar Constraint:
22
    :vartype Constraint: 3
23 1
    '''
24 1
    Mandatory = 1
25 1
    Optional = 2
26
    Constraint = 3
27
28 1
29
class OpenFileMode(IntEnum):
30
    '''
31
    :ivar Read:
32
    :vartype Read: 1
33
    :ivar Write:
34
    :vartype Write: 2
35
    :ivar EraseExisting:
36
    :vartype EraseExisting: 4
37
    :ivar Append:
38
    :vartype Append: 8
39 1
    '''
40 1
    Read = 1
41 1
    Write = 2
42 1
    EraseExisting = 4
43
    Append = 8
44
45 1
46
class TrustListMasks(IntEnum):
47
    '''
48
    :ivar None_:
49
    :vartype None_: 0
50
    :ivar TrustedCertificates:
51
    :vartype TrustedCertificates: 1
52
    :ivar TrustedCrls:
53
    :vartype TrustedCrls: 2
54
    :ivar IssuerCertificates:
55
    :vartype IssuerCertificates: 4
56
    :ivar IssuerCrls:
57
    :vartype IssuerCrls: 8
58
    :ivar All:
59
    :vartype All: 15
60 1
    '''
61 1
    None_ = 0
62 1
    TrustedCertificates = 1
63 1
    TrustedCrls = 2
64 1
    IssuerCertificates = 4
65 1
    IssuerCrls = 8
66
    All = 15
67
68 1
69
class IdType(IntEnum):
70
    '''
71
    The type of identifier used in a node id.
72
73
    :ivar Numeric:
74
    :vartype Numeric: 0
75
    :ivar String:
76
    :vartype String: 1
77
    :ivar Guid:
78
    :vartype Guid: 2
79
    :ivar Opaque:
80
    :vartype Opaque: 3
81 1
    '''
82 1
    Numeric = 0
83 1
    String = 1
84 1
    Guid = 2
85
    Opaque = 3
86
87 1
88
class NodeClass(IntEnum):
89
    '''
90
    A mask specifying the class of the node.
91
92
    :ivar Unspecified:
93
    :vartype Unspecified: 0
94
    :ivar Object:
95
    :vartype Object: 1
96
    :ivar Variable:
97
    :vartype Variable: 2
98
    :ivar Method:
99
    :vartype Method: 4
100
    :ivar ObjectType:
101
    :vartype ObjectType: 8
102
    :ivar VariableType:
103
    :vartype VariableType: 16
104
    :ivar ReferenceType:
105
    :vartype ReferenceType: 32
106
    :ivar DataType:
107
    :vartype DataType: 64
108
    :ivar View:
109
    :vartype View: 128
110 1
    '''
111 1
    Unspecified = 0
112 1
    Object = 1
113 1
    Variable = 2
114 1
    Method = 4
115 1
    ObjectType = 8
116 1
    VariableType = 16
117 1
    ReferenceType = 32
118 1
    DataType = 64
119
    View = 128
120
121 1
122
class ApplicationType(IntEnum):
123
    '''
124
    The types of applications.
125
126
    :ivar Server:
127
    :vartype Server: 0
128
    :ivar Client:
129
    :vartype Client: 1
130
    :ivar ClientAndServer:
131
    :vartype ClientAndServer: 2
132
    :ivar DiscoveryServer:
133
    :vartype DiscoveryServer: 3
134 1
    '''
135 1
    Server = 0
136 1
    Client = 1
137 1
    ClientAndServer = 2
138
    DiscoveryServer = 3
139
140 1
141
class MessageSecurityMode(IntEnum):
142
    '''
143
    The type of security to use on a message.
144
145
    :ivar Invalid:
146
    :vartype Invalid: 0
147
    :ivar None_:
148
    :vartype None_: 1
149
    :ivar Sign:
150
    :vartype Sign: 2
151
    :ivar SignAndEncrypt:
152
    :vartype SignAndEncrypt: 3
153 1
    '''
154 1
    Invalid = 0
155 1
    None_ = 1
156 1
    Sign = 2
157
    SignAndEncrypt = 3
158
159 1
160
class UserTokenType(IntEnum):
161
    '''
162
    The possible user token types.
163
164
    :ivar Anonymous:
165
    :vartype Anonymous: 0
166
    :ivar UserName:
167
    :vartype UserName: 1
168
    :ivar Certificate:
169
    :vartype Certificate: 2
170
    :ivar IssuedToken:
171
    :vartype IssuedToken: 3
172
    :ivar Kerberos:
173
    :vartype Kerberos: 4
174 1
    '''
175 1
    Anonymous = 0
176 1
    UserName = 1
177 1
    Certificate = 2
178 1
    IssuedToken = 3
179
    Kerberos = 4
180
181 1
182
class SecurityTokenRequestType(IntEnum):
183
    '''
184
    Indicates whether a token if being created or renewed.
185
186
    :ivar Issue:
187
    :vartype Issue: 0
188
    :ivar Renew:
189
    :vartype Renew: 1
190 1
    '''
191 1
    Issue = 0
192
    Renew = 1
193
194 1
195
class NodeAttributesMask(IntEnum):
196
    '''
197
    The bits used to specify default attributes for a new node.
198
199
    :ivar None_:
200
    :vartype None_: 0
201
    :ivar AccessLevel:
202
    :vartype AccessLevel: 1
203
    :ivar ArrayDimensions:
204
    :vartype ArrayDimensions: 2
205
    :ivar BrowseName:
206
    :vartype BrowseName: 4
207
    :ivar ContainsNoLoops:
208
    :vartype ContainsNoLoops: 8
209
    :ivar DataType:
210
    :vartype DataType: 16
211
    :ivar Description:
212
    :vartype Description: 32
213
    :ivar DisplayName:
214
    :vartype DisplayName: 64
215
    :ivar EventNotifier:
216
    :vartype EventNotifier: 128
217
    :ivar Executable:
218
    :vartype Executable: 256
219
    :ivar Historizing:
220
    :vartype Historizing: 512
221
    :ivar InverseName:
222
    :vartype InverseName: 1024
223
    :ivar IsAbstract:
224
    :vartype IsAbstract: 2048
225
    :ivar MinimumSamplingInterval:
226
    :vartype MinimumSamplingInterval: 4096
227
    :ivar NodeClass:
228
    :vartype NodeClass: 8192
229
    :ivar NodeId:
230
    :vartype NodeId: 16384
231
    :ivar Symmetric:
232
    :vartype Symmetric: 32768
233
    :ivar UserAccessLevel:
234
    :vartype UserAccessLevel: 65536
235
    :ivar UserExecutable:
236
    :vartype UserExecutable: 131072
237
    :ivar UserWriteMask:
238
    :vartype UserWriteMask: 262144
239
    :ivar ValueRank:
240
    :vartype ValueRank: 524288
241
    :ivar WriteMask:
242
    :vartype WriteMask: 1048576
243
    :ivar Value:
244
    :vartype Value: 2097152
245
    :ivar All:
246
    :vartype All: 4194303
247
    :ivar BaseNode:
248
    :vartype BaseNode: 1335396
249
    :ivar Object:
250
    :vartype Object: 1335524
251
    :ivar ObjectTypeOrDataType:
252
    :vartype ObjectTypeOrDataType: 1337444
253
    :ivar Variable:
254
    :vartype Variable: 4026999
255
    :ivar VariableType:
256
    :vartype VariableType: 3958902
257
    :ivar Method:
258
    :vartype Method: 1466724
259
    :ivar ReferenceType:
260
    :vartype ReferenceType: 1371236
261
    :ivar View:
262
    :vartype View: 1335532
263 1
    '''
264 1
    None_ = 0
265 1
    AccessLevel = 1
266 1
    ArrayDimensions = 2
267 1
    BrowseName = 4
268 1
    ContainsNoLoops = 8
269 1
    DataType = 16
270 1
    Description = 32
271 1
    DisplayName = 64
272 1
    EventNotifier = 128
273 1
    Executable = 256
274 1
    Historizing = 512
275 1
    InverseName = 1024
276 1
    IsAbstract = 2048
277 1
    MinimumSamplingInterval = 4096
278 1
    NodeClass = 8192
279 1
    NodeId = 16384
280 1
    Symmetric = 32768
281 1
    UserAccessLevel = 65536
282 1
    UserExecutable = 131072
283 1
    UserWriteMask = 262144
284 1
    ValueRank = 524288
285 1
    WriteMask = 1048576
286 1
    Value = 2097152
287 1
    All = 4194303
288 1
    BaseNode = 1335396
289 1
    Object = 1335524
290 1
    ObjectTypeOrDataType = 1337444
291 1
    Variable = 4026999
292 1
    VariableType = 3958902
293 1
    Method = 1466724
294 1
    ReferenceType = 1371236
295
    View = 1335532
296
297 1 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
298
class AttributeWriteMask(IntEnum):
299
    '''
300
    Define bits used to indicate which attributes are writable.
301
302
    :ivar None_:
303
    :vartype None_: 0
304
    :ivar AccessLevel:
305
    :vartype AccessLevel: 1
306
    :ivar ArrayDimensions:
307
    :vartype ArrayDimensions: 2
308
    :ivar BrowseName:
309
    :vartype BrowseName: 4
310
    :ivar ContainsNoLoops:
311
    :vartype ContainsNoLoops: 8
312
    :ivar DataType:
313
    :vartype DataType: 16
314
    :ivar Description:
315
    :vartype Description: 32
316
    :ivar DisplayName:
317
    :vartype DisplayName: 64
318
    :ivar EventNotifier:
319
    :vartype EventNotifier: 128
320
    :ivar Executable:
321
    :vartype Executable: 256
322
    :ivar Historizing:
323
    :vartype Historizing: 512
324
    :ivar InverseName:
325
    :vartype InverseName: 1024
326
    :ivar IsAbstract:
327
    :vartype IsAbstract: 2048
328
    :ivar MinimumSamplingInterval:
329
    :vartype MinimumSamplingInterval: 4096
330
    :ivar NodeClass:
331
    :vartype NodeClass: 8192
332
    :ivar NodeId:
333
    :vartype NodeId: 16384
334
    :ivar Symmetric:
335
    :vartype Symmetric: 32768
336
    :ivar UserAccessLevel:
337
    :vartype UserAccessLevel: 65536
338
    :ivar UserExecutable:
339
    :vartype UserExecutable: 131072
340
    :ivar UserWriteMask:
341
    :vartype UserWriteMask: 262144
342
    :ivar ValueRank:
343
    :vartype ValueRank: 524288
344
    :ivar WriteMask:
345
    :vartype WriteMask: 1048576
346
    :ivar ValueForVariableType:
347
    :vartype ValueForVariableType: 2097152
348 1
    '''
349 1
    None_ = 0
350 1
    AccessLevel = 1
351 1
    ArrayDimensions = 2
352 1
    BrowseName = 4
353 1
    ContainsNoLoops = 8
354 1
    DataType = 16
355 1
    Description = 32
356 1
    DisplayName = 64
357 1
    EventNotifier = 128
358 1
    Executable = 256
359 1
    Historizing = 512
360 1
    InverseName = 1024
361 1
    IsAbstract = 2048
362 1
    MinimumSamplingInterval = 4096
363 1
    NodeClass = 8192
364 1
    NodeId = 16384
365 1
    Symmetric = 32768
366 1
    UserAccessLevel = 65536
367 1
    UserExecutable = 131072
368 1
    UserWriteMask = 262144
369 1
    ValueRank = 524288
370 1
    WriteMask = 1048576
371
    ValueForVariableType = 2097152
372
373 1
374
class BrowseDirection(IntEnum):
375
    '''
376
    The directions of the references to return.
377
378
    :ivar Forward:
379
    :vartype Forward: 0
380
    :ivar Inverse:
381
    :vartype Inverse: 1
382
    :ivar Both:
383
    :vartype Both: 2
384 1
    '''
385 1
    Forward = 0
386 1
    Inverse = 1
387
    Both = 2
388
389 1
390
class BrowseResultMask(IntEnum):
391
    '''
392
    A bit mask which specifies what should be returned in a browse response.
393
394
    :ivar None_:
395
    :vartype None_: 0
396
    :ivar ReferenceTypeId:
397
    :vartype ReferenceTypeId: 1
398
    :ivar IsForward:
399
    :vartype IsForward: 2
400
    :ivar NodeClass:
401
    :vartype NodeClass: 4
402
    :ivar BrowseName:
403
    :vartype BrowseName: 8
404
    :ivar DisplayName:
405
    :vartype DisplayName: 16
406
    :ivar TypeDefinition:
407
    :vartype TypeDefinition: 32
408
    :ivar All:
409
    :vartype All: 63
410
    :ivar ReferenceTypeInfo:
411
    :vartype ReferenceTypeInfo: 3
412
    :ivar TargetInfo:
413
    :vartype TargetInfo: 60
414 1
    '''
415 1
    None_ = 0
416 1
    ReferenceTypeId = 1
417 1
    IsForward = 2
418 1
    NodeClass = 4
419 1
    BrowseName = 8
420 1
    DisplayName = 16
421 1
    TypeDefinition = 32
422 1
    All = 63
423 1
    ReferenceTypeInfo = 3
424
    TargetInfo = 60
425
426 1
427
class ComplianceLevel(IntEnum):
428
    '''
429
    :ivar Untested:
430
    :vartype Untested: 0
431
    :ivar Partial:
432
    :vartype Partial: 1
433
    :ivar SelfTested:
434
    :vartype SelfTested: 2
435
    :ivar Certified:
436
    :vartype Certified: 3
437 1
    '''
438 1
    Untested = 0
439 1
    Partial = 1
440 1
    SelfTested = 2
441
    Certified = 3
442
443 1
444
class FilterOperator(IntEnum):
445
    '''
446
    :ivar Equals:
447
    :vartype Equals: 0
448
    :ivar IsNull:
449
    :vartype IsNull: 1
450
    :ivar GreaterThan:
451
    :vartype GreaterThan: 2
452
    :ivar LessThan:
453
    :vartype LessThan: 3
454
    :ivar GreaterThanOrEqual:
455
    :vartype GreaterThanOrEqual: 4
456
    :ivar LessThanOrEqual:
457
    :vartype LessThanOrEqual: 5
458
    :ivar Like:
459
    :vartype Like: 6
460
    :ivar Not:
461
    :vartype Not: 7
462
    :ivar Between:
463
    :vartype Between: 8
464
    :ivar InList:
465
    :vartype InList: 9
466
    :ivar And:
467
    :vartype And: 10
468
    :ivar Or:
469
    :vartype Or: 11
470
    :ivar Cast:
471
    :vartype Cast: 12
472
    :ivar InView:
473
    :vartype InView: 13
474
    :ivar OfType:
475
    :vartype OfType: 14
476
    :ivar RelatedTo:
477
    :vartype RelatedTo: 15
478
    :ivar BitwiseAnd:
479
    :vartype BitwiseAnd: 16
480
    :ivar BitwiseOr:
481
    :vartype BitwiseOr: 17
482 1
    '''
483 1
    Equals = 0
484 1
    IsNull = 1
485 1
    GreaterThan = 2
486 1
    LessThan = 3
487 1
    GreaterThanOrEqual = 4
488 1
    LessThanOrEqual = 5
489 1
    Like = 6
490 1
    Not = 7
491 1
    Between = 8
492 1
    InList = 9
493 1
    And = 10
494 1
    Or = 11
495 1
    Cast = 12
496 1
    InView = 13
497 1
    OfType = 14
498 1
    RelatedTo = 15
499 1
    BitwiseAnd = 16
500
    BitwiseOr = 17
501
502 1
503
class TimestampsToReturn(IntEnum):
504
    '''
505
    :ivar Source:
506
    :vartype Source: 0
507
    :ivar Server:
508
    :vartype Server: 1
509
    :ivar Both:
510
    :vartype Both: 2
511
    :ivar Neither:
512
    :vartype Neither: 3
513 1
    '''
514 1
    Source = 0
515 1
    Server = 1
516 1
    Both = 2
517
    Neither = 3
518
519 1
520
class HistoryUpdateType(IntEnum):
521
    '''
522
    :ivar Insert:
523
    :vartype Insert: 1
524
    :ivar Replace:
525
    :vartype Replace: 2
526
    :ivar Update:
527
    :vartype Update: 3
528
    :ivar Delete:
529
    :vartype Delete: 4
530 1
    '''
531 1
    Insert = 1
532 1
    Replace = 2
533 1
    Update = 3
534
    Delete = 4
535
536 1
537
class PerformUpdateType(IntEnum):
538
    '''
539
    :ivar Insert:
540
    :vartype Insert: 1
541
    :ivar Replace:
542
    :vartype Replace: 2
543
    :ivar Update:
544
    :vartype Update: 3
545
    :ivar Remove:
546
    :vartype Remove: 4
547 1
    '''
548 1
    Insert = 1
549 1
    Replace = 2
550 1
    Update = 3
551
    Remove = 4
552
553 1
554
class MonitoringMode(IntEnum):
555
    '''
556
    :ivar Disabled:
557
    :vartype Disabled: 0
558
    :ivar Sampling:
559
    :vartype Sampling: 1
560
    :ivar Reporting:
561
    :vartype Reporting: 2
562 1
    '''
563 1
    Disabled = 0
564 1
    Sampling = 1
565
    Reporting = 2
566
567 1
568
class DataChangeTrigger(IntEnum):
569
    '''
570
    :ivar Status:
571
    :vartype Status: 0
572
    :ivar StatusValue:
573
    :vartype StatusValue: 1
574
    :ivar StatusValueTimestamp:
575
    :vartype StatusValueTimestamp: 2
576 1
    '''
577 1
    Status = 0
578 1
    StatusValue = 1
579
    StatusValueTimestamp = 2
580
581 1
582
class DeadbandType(IntEnum):
583
    '''
584
    :ivar None_:
585
    :vartype None_: 0
586
    :ivar Absolute:
587
    :vartype Absolute: 1
588
    :ivar Percent:
589
    :vartype Percent: 2
590 1
    '''
591 1
    None_ = 0
592 1
    Absolute = 1
593
    Percent = 2
594
595 1
596
class EnumeratedTestType(IntEnum):
597
    '''
598
    A simple enumerated type used for testing.
599
600
    :ivar Red:
601
    :vartype Red: 1
602
    :ivar Yellow:
603
    :vartype Yellow: 4
604
    :ivar Green:
605
    :vartype Green: 5
606 1
    '''
607 1
    Red = 1
608 1
    Yellow = 4
609
    Green = 5
610
611 1
612
class RedundancySupport(IntEnum):
613
    '''
614
    :ivar None_:
615
    :vartype None_: 0
616
    :ivar Cold:
617
    :vartype Cold: 1
618
    :ivar Warm:
619
    :vartype Warm: 2
620
    :ivar Hot:
621
    :vartype Hot: 3
622
    :ivar Transparent:
623
    :vartype Transparent: 4
624
    :ivar HotAndMirrored:
625
    :vartype HotAndMirrored: 5
626 1
    '''
627 1
    None_ = 0
628 1
    Cold = 1
629 1
    Warm = 2
630 1
    Hot = 3
631 1
    Transparent = 4
632
    HotAndMirrored = 5
633
634 1
635
class ServerState(IntEnum):
636
    '''
637
    :ivar Running:
638
    :vartype Running: 0
639
    :ivar Failed:
640
    :vartype Failed: 1
641
    :ivar NoConfiguration:
642
    :vartype NoConfiguration: 2
643
    :ivar Suspended:
644
    :vartype Suspended: 3
645
    :ivar Shutdown:
646
    :vartype Shutdown: 4
647
    :ivar Test:
648
    :vartype Test: 5
649
    :ivar CommunicationFault:
650
    :vartype CommunicationFault: 6
651
    :ivar Unknown:
652
    :vartype Unknown: 7
653 1
    '''
654 1
    Running = 0
655 1
    Failed = 1
656 1
    NoConfiguration = 2
657 1
    Suspended = 3
658 1
    Shutdown = 4
659 1
    Test = 5
660 1
    CommunicationFault = 6
661
    Unknown = 7
662
663 1
664
class ModelChangeStructureVerbMask(IntEnum):
665
    '''
666
    :ivar NodeAdded:
667
    :vartype NodeAdded: 1
668
    :ivar NodeDeleted:
669
    :vartype NodeDeleted: 2
670
    :ivar ReferenceAdded:
671
    :vartype ReferenceAdded: 4
672
    :ivar ReferenceDeleted:
673
    :vartype ReferenceDeleted: 8
674
    :ivar DataTypeChanged:
675
    :vartype DataTypeChanged: 16
676 1
    '''
677 1
    NodeAdded = 1
678 1
    NodeDeleted = 2
679 1
    ReferenceAdded = 4
680 1
    ReferenceDeleted = 8
681
    DataTypeChanged = 16
682
683 1
684
class AxisScaleEnumeration(IntEnum):
685
    '''
686
    :ivar Linear:
687
    :vartype Linear: 0
688
    :ivar Log:
689
    :vartype Log: 1
690
    :ivar Ln:
691
    :vartype Ln: 2
692 1
    '''
693 1
    Linear = 0
694 1
    Log = 1
695
    Ln = 2
696
697 1
698
class ExceptionDeviationFormat(IntEnum):
699
    '''
700
    :ivar AbsoluteValue:
701
    :vartype AbsoluteValue: 0
702
    :ivar PercentOfValue:
703
    :vartype PercentOfValue: 1
704
    :ivar PercentOfRange:
705
    :vartype PercentOfRange: 2
706
    :ivar PercentOfEURange:
707
    :vartype PercentOfEURange: 3
708
    :ivar Unknown:
709
    :vartype Unknown: 4
710 1
    '''
711 1
    AbsoluteValue = 0
712 1
    PercentOfValue = 1
713 1
    PercentOfRange = 2
714 1
    PercentOfEURange = 3
715
    Unknown = 4
716
717 1
718
class DiagnosticInfo(FrozenClass):
719
    '''
720
    A recursive structure containing diagnostic information associated with a status code.
721
722
    :ivar Encoding:
723
    :vartype Encoding: UInt8
724
    :ivar SymbolicId:
725
    :vartype SymbolicId: Int32
726
    :ivar NamespaceURI:
727
    :vartype NamespaceURI: Int32
728
    :ivar Locale:
729
    :vartype Locale: Int32
730
    :ivar LocalizedText:
731
    :vartype LocalizedText: Int32
732
    :ivar AdditionalInfo:
733
    :vartype AdditionalInfo: CharArray
734
    :ivar InnerStatusCode:
735
    :vartype InnerStatusCode: StatusCode
736
    :ivar InnerDiagnosticInfo:
737
    :vartype InnerDiagnosticInfo: DiagnosticInfo
738 1
    '''
739 1
740 1
    ua_types = {
741 1
        'Encoding': 'UInt8',
742 1
        'SymbolicId': 'Int32',
743 1
        'NamespaceURI': 'Int32',
744 1
        'Locale': 'Int32',
745 1
        'LocalizedText': 'Int32',
746 1
        'AdditionalInfo': 'CharArray',
747 1
        'InnerStatusCode': 'StatusCode',
748 1
        'InnerDiagnosticInfo': 'DiagnosticInfo',
749 1
               }
750 1
751 1
    def __init__(self, binary=None):
752
        if binary is not None:
753 1
            self._binary_init(binary)
754 1
            self._freeze = True
755 1
            return
756 1
        self.Encoding = 0
757 1
        self.SymbolicId = 0
758 1
        self.NamespaceURI = 0
759 1
        self.Locale = 0
760 1
        self.LocalizedText = 0
761 1
        self.AdditionalInfo = None
762 1
        self.InnerStatusCode = StatusCode()
763 1
        self.InnerDiagnosticInfo = None
764
        self._freeze = True
765 1
766
    def to_binary(self):
767 1
        packet = []
768
        if self.SymbolicId: self.Encoding |= (1 << 0)
769 1
        if self.NamespaceURI: self.Encoding |= (1 << 1)
770
        if self.Locale: self.Encoding |= (1 << 2)
771 1
        if self.LocalizedText: self.Encoding |= (1 << 3)
772
        if self.AdditionalInfo: self.Encoding |= (1 << 4)
773 1
        if self.InnerStatusCode: self.Encoding |= (1 << 5)
774 1
        if self.InnerDiagnosticInfo: self.Encoding |= (1 << 6)
775 1
        packet.append(uabin.Primitives.UInt8.pack(self.Encoding))
776
        if self.SymbolicId: 
777 1
            packet.append(uabin.Primitives.Int32.pack(self.SymbolicId))
778
        if self.NamespaceURI: 
779 1
            packet.append(uabin.Primitives.Int32.pack(self.NamespaceURI))
780
        if self.Locale: 
781 1
            packet.append(uabin.Primitives.Int32.pack(self.Locale))
782
        if self.LocalizedText: 
783 1
            packet.append(uabin.Primitives.Int32.pack(self.LocalizedText))
784 1
        if self.AdditionalInfo: 
785 1
            packet.append(uabin.Primitives.CharArray.pack(self.AdditionalInfo))
786
        if self.InnerStatusCode: 
787
            packet.append(self.InnerStatusCode.to_binary())
788 1
        if self.InnerDiagnosticInfo: 
789 1
            packet.append(self.InnerDiagnosticInfo.to_binary())
790
        return b''.join(packet)
791
792 1
    @staticmethod
793 1
    def from_binary(data):
794
        return DiagnosticInfo(data)
795
796 1
    def _binary_init(self, data):
797 1
        self.Encoding = uabin.Primitives.UInt8.unpack(data)
798
        if self.Encoding & (1 << 0):
799
            self.SymbolicId = uabin.Primitives.Int32.unpack(data)
800 1
        else:
801 1
            self.SymbolicId = 0
802
        if self.Encoding & (1 << 1):
803
            self.NamespaceURI = uabin.Primitives.Int32.unpack(data)
804 1
        else:
805 1
            self.NamespaceURI = 0
806 1
        if self.Encoding & (1 << 2):
807
            self.Locale = uabin.Primitives.Int32.unpack(data)
808
        else:
809 1
            self.Locale = 0
810
        if self.Encoding & (1 << 3):
811
            self.LocalizedText = uabin.Primitives.Int32.unpack(data)
812 1
        else:
813
            self.LocalizedText = 0
814 1
        if self.Encoding & (1 << 4):
815
            self.AdditionalInfo = uabin.Primitives.CharArray.unpack(data)
816
        else:
817
            self.AdditionalInfo = None
818
        if self.Encoding & (1 << 5):
819
            self.InnerStatusCode = StatusCode.from_binary(data)
820
        else:
821
            self.InnerStatusCode = StatusCode()
822
        if self.Encoding & (1 << 6):
823
            self.InnerDiagnosticInfo = DiagnosticInfo.from_binary(data)
824 1
        else:
825
            self.InnerDiagnosticInfo = None
826
827 1
    def __str__(self):
828
        return 'DiagnosticInfo(' + 'Encoding:' + str(self.Encoding) + ', ' + \
829
               'SymbolicId:' + str(self.SymbolicId) + ', ' + \
830
               'NamespaceURI:' + str(self.NamespaceURI) + ', ' + \
831
               'Locale:' + str(self.Locale) + ', ' + \
832
               'LocalizedText:' + str(self.LocalizedText) + ', ' + \
833
               'AdditionalInfo:' + str(self.AdditionalInfo) + ', ' + \
834
               'InnerStatusCode:' + str(self.InnerStatusCode) + ', ' + \
835
               'InnerDiagnosticInfo:' + str(self.InnerDiagnosticInfo) + ')'
836
837
    __repr__ = __str__
838
839
840 1
class TrustListDataType(FrozenClass):
841
    '''
842
    :ivar SpecifiedLists:
843
    :vartype SpecifiedLists: UInt32
844
    :ivar TrustedCertificates:
845
    :vartype TrustedCertificates: ByteString
846
    :ivar TrustedCrls:
847
    :vartype TrustedCrls: ByteString
848
    :ivar IssuerCertificates:
849
    :vartype IssuerCertificates: ByteString
850
    :ivar IssuerCrls:
851
    :vartype IssuerCrls: ByteString
852 1
    '''
853
854
    ua_types = {
855
        'SpecifiedLists': 'UInt32',
856
        'TrustedCertificates': 'ByteString',
857
        'TrustedCrls': 'ByteString',
858
        'IssuerCertificates': 'ByteString',
859
        'IssuerCrls': 'ByteString',
860
               }
861
862
    def __init__(self, binary=None):
863
        if binary is not None:
864
            self._binary_init(binary)
865
            self._freeze = True
866
            return
867
        self.SpecifiedLists = 0
868
        self.TrustedCertificates = []
869 1
        self.TrustedCrls = []
870
        self.IssuerCertificates = []
871
        self.IssuerCrls = []
872
        self._freeze = True
873 1
874
    def to_binary(self):
875
        packet = []
876
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedLists))
877
        packet.append(uabin.Primitives.Int32.pack(len(self.TrustedCertificates)))
878
        for fieldname in self.TrustedCertificates:
879
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
880 1
        packet.append(uabin.Primitives.Int32.pack(len(self.TrustedCrls)))
881
        for fieldname in self.TrustedCrls:
882
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
883
        packet.append(uabin.Primitives.Int32.pack(len(self.IssuerCertificates)))
884
        for fieldname in self.IssuerCertificates:
885
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
886
        packet.append(uabin.Primitives.Int32.pack(len(self.IssuerCrls)))
887 1
        for fieldname in self.IssuerCrls:
888
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
889
        return b''.join(packet)
890 1
891
    @staticmethod
892
    def from_binary(data):
893
        return TrustListDataType(data)
894
895
    def _binary_init(self, data):
896
        self.SpecifiedLists = uabin.Primitives.UInt32.unpack(data)
897
        self.TrustedCertificates = uabin.Primitives.ByteString.unpack_array(data)
898
        self.TrustedCrls = uabin.Primitives.ByteString.unpack_array(data)
899
        self.IssuerCertificates = uabin.Primitives.ByteString.unpack_array(data)
900
        self.IssuerCrls = uabin.Primitives.ByteString.unpack_array(data)
901
902
    def __str__(self):
903
        return 'TrustListDataType(' + 'SpecifiedLists:' + str(self.SpecifiedLists) + ', ' + \
904
               'TrustedCertificates:' + str(self.TrustedCertificates) + ', ' + \
905 1
               'TrustedCrls:' + str(self.TrustedCrls) + ', ' + \
906 1
               'IssuerCertificates:' + str(self.IssuerCertificates) + ', ' + \
907
               'IssuerCrls:' + str(self.IssuerCrls) + ')'
908
909
    __repr__ = __str__
910 1
911 1
912 1 View Code Duplication
class Argument(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
913 1
    '''
914 1
    An argument for a method.
915 1
916
    :ivar Name:
917 1
    :vartype Name: String
918
    :ivar DataType:
919
    :vartype DataType: NodeId
920
    :ivar ValueRank:
921
    :vartype ValueRank: Int32
922
    :ivar ArrayDimensions:
923
    :vartype ArrayDimensions: UInt32
924
    :ivar Description:
925
    :vartype Description: LocalizedText
926
    '''
927
928 1
    ua_types = {
929
        'Name': 'String',
930
        'DataType': 'NodeId',
931
        'ValueRank': 'Int32',
932 1
        'ArrayDimensions': 'UInt32',
933
        'Description': 'LocalizedText',
934
               }
935
936
    def __init__(self, binary=None):
937
        if binary is not None:
938
            self._binary_init(binary)
939 1
            self._freeze = True
940
            return
941
        self.Name = None
942
        self.DataType = NodeId()
943
        self.ValueRank = 0
944
        self.ArrayDimensions = []
945
        self.Description = LocalizedText()
946 1
        self._freeze = True
947
948
    def to_binary(self):
949 1
        packet = []
950
        packet.append(uabin.Primitives.String.pack(self.Name))
951
        packet.append(self.DataType.to_binary())
952
        packet.append(uabin.Primitives.Int32.pack(self.ValueRank))
953
        packet.append(uabin.Primitives.Int32.pack(len(self.ArrayDimensions)))
954
        for fieldname in self.ArrayDimensions:
955
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
956
        packet.append(self.Description.to_binary())
957
        return b''.join(packet)
958
959
    @staticmethod
960 1
    def from_binary(data):
961
        return Argument(data)
962
963
    def _binary_init(self, data):
964
        self.Name = uabin.Primitives.String.unpack(data)
965
        self.DataType = NodeId.from_binary(data)
966
        self.ValueRank = uabin.Primitives.Int32.unpack(data)
967
        self.ArrayDimensions = uabin.Primitives.UInt32.unpack_array(data)
968
        self.Description = LocalizedText.from_binary(data)
969
970 1
    def __str__(self):
971
        return 'Argument(' + 'Name:' + str(self.Name) + ', ' + \
972
               'DataType:' + str(self.DataType) + ', ' + \
973
               'ValueRank:' + str(self.ValueRank) + ', ' + \
974
               'ArrayDimensions:' + str(self.ArrayDimensions) + ', ' + \
975
               'Description:' + str(self.Description) + ')'
976
977 1
    __repr__ = __str__
978
979
980 View Code Duplication
class EnumValueType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
981 1
    '''
982
    A mapping between a value of an enumerated type and a name and description.
983
984
    :ivar Value:
985
    :vartype Value: Int64
986 1
    :ivar DisplayName:
987
    :vartype DisplayName: LocalizedText
988
    :ivar Description:
989
    :vartype Description: LocalizedText
990
    '''
991 1
992
    ua_types = {
993
        'Value': 'Int64',
994 1
        'DisplayName': 'LocalizedText',
995
        'Description': 'LocalizedText',
996
               }
997
998
    def __init__(self, binary=None):
999
        if binary is not None:
1000
            self._binary_init(binary)
1001
            self._freeze = True
1002
            return
1003 1
        self.Value = 0
1004
        self.DisplayName = LocalizedText()
1005
        self.Description = LocalizedText()
1006
        self._freeze = True
1007
1008
    def to_binary(self):
1009
        packet = []
1010
        packet.append(uabin.Primitives.Int64.pack(self.Value))
1011
        packet.append(self.DisplayName.to_binary())
1012 1
        packet.append(self.Description.to_binary())
1013
        return b''.join(packet)
1014
1015
    @staticmethod
1016
    def from_binary(data):
1017
        return EnumValueType(data)
1018 1
1019
    def _binary_init(self, data):
1020
        self.Value = uabin.Primitives.Int64.unpack(data)
1021
        self.DisplayName = LocalizedText.from_binary(data)
1022 1
        self.Description = LocalizedText.from_binary(data)
1023
1024
    def __str__(self):
1025
        return 'EnumValueType(' + 'Value:' + str(self.Value) + ', ' + \
1026 1
               'DisplayName:' + str(self.DisplayName) + ', ' + \
1027
               'Description:' + str(self.Description) + ')'
1028
1029
    __repr__ = __str__
1030 1
1031
1032 View Code Duplication
class OptionSet(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1033 1
    '''
1034
    This abstract Structured DataType is the base DataType for all DataTypes representing a bit mask.
1035
1036
    :ivar Value:
1037
    :vartype Value: ByteString
1038 1
    :ivar ValidBits:
1039
    :vartype ValidBits: ByteString
1040
    '''
1041
1042
    ua_types = {
1043
        'Value': 'ByteString',
1044
        'ValidBits': 'ByteString',
1045 1
               }
1046
1047
    def __init__(self, binary=None):
1048
        if binary is not None:
1049 1
            self._binary_init(binary)
1050
            self._freeze = True
1051
            return
1052
        self.Value = None
1053 1
        self.ValidBits = None
1054
        self._freeze = True
1055
1056 1
    def to_binary(self):
1057
        packet = []
1058
        packet.append(uabin.Primitives.ByteString.pack(self.Value))
1059 1
        packet.append(uabin.Primitives.ByteString.pack(self.ValidBits))
1060
        return b''.join(packet)
1061
1062 1
    @staticmethod
1063
    def from_binary(data):
1064
        return OptionSet(data)
1065
1066
    def _binary_init(self, data):
1067
        self.Value = uabin.Primitives.ByteString.unpack(data)
1068
        self.ValidBits = uabin.Primitives.ByteString.unpack(data)
1069 1
1070
    def __str__(self):
1071
        return 'OptionSet(' + 'Value:' + str(self.Value) + ', ' + \
1072
               'ValidBits:' + str(self.ValidBits) + ')'
1073
1074
    __repr__ = __str__
1075
1076
1077 View Code Duplication
class Union(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1078 1
    '''
1079
    This abstract DataType is the base DataType for all union DataTypes.
1080
1081
    '''
1082
1083
    ua_types = {
1084 1
               }
1085
1086
    def __init__(self, binary=None):
1087
        if binary is not None:
1088 1
            self._binary_init(binary)
1089
            self._freeze = True
1090
            return
1091
        self._freeze = True
1092 1
1093
    def to_binary(self):
1094
        packet = []
1095
        return b''.join(packet)
1096 1
1097
    @staticmethod
1098
    def from_binary(data):
1099 1
        return Union(data)
1100
1101
    def _binary_init(self, data):
1102
        pass
1103
1104
    def __str__(self):
1105
        return 'Union(' +  + ')'
1106
1107
    __repr__ = __str__
1108
1109
1110 View Code Duplication
class TimeZoneDataType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1111
    '''
1112
    :ivar Offset:
1113
    :vartype Offset: Int16
1114
    :ivar DaylightSavingInOffset:
1115
    :vartype DaylightSavingInOffset: Boolean
1116
    '''
1117
1118 1
    ua_types = {
1119 1
        'Offset': 'Int16',
1120 1
        'DaylightSavingInOffset': 'Boolean',
1121 1
               }
1122 1
1123 1
    def __init__(self, binary=None):
1124 1
        if binary is not None:
1125 1
            self._binary_init(binary)
1126 1
            self._freeze = True
1127 1
            return
1128 1
        self.Offset = 0
1129 1
        self.DaylightSavingInOffset = True
1130 1
        self._freeze = True
1131
1132 1
    def to_binary(self):
1133 1
        packet = []
1134 1
        packet.append(uabin.Primitives.Int16.pack(self.Offset))
1135 1
        packet.append(uabin.Primitives.Boolean.pack(self.DaylightSavingInOffset))
1136 1
        return b''.join(packet)
1137 1
1138 1
    @staticmethod
1139 1
    def from_binary(data):
1140 1
        return TimeZoneDataType(data)
1141 1
1142 1
    def _binary_init(self, data):
1143 1
        self.Offset = uabin.Primitives.Int16.unpack(data)
1144
        self.DaylightSavingInOffset = uabin.Primitives.Boolean.unpack(data)
1145 1
1146
    def __str__(self):
1147 1
        return 'TimeZoneDataType(' + 'Offset:' + str(self.Offset) + ', ' + \
1148
               'DaylightSavingInOffset:' + str(self.DaylightSavingInOffset) + ')'
1149 1
1150 1
    __repr__ = __str__
1151 1
1152 1
1153 1
class ApplicationDescription(FrozenClass):
1154 1
    '''
1155 1
    Describes an application and how to find it.
1156 1
1157
    :ivar ApplicationUri:
1158 1
    :vartype ApplicationUri: String
1159
    :ivar ProductUri:
1160
    :vartype ProductUri: String
1161
    :ivar ApplicationName:
1162
    :vartype ApplicationName: LocalizedText
1163
    :ivar ApplicationType:
1164
    :vartype ApplicationType: ApplicationType
1165
    :ivar GatewayServerUri:
1166
    :vartype GatewayServerUri: String
1167 1
    :ivar DiscoveryProfileUri:
1168
    :vartype DiscoveryProfileUri: String
1169
    :ivar DiscoveryUrls:
1170 1
    :vartype DiscoveryUrls: String
1171
    '''
1172
1173
    ua_types = {
1174
        'ApplicationUri': 'String',
1175
        'ProductUri': 'String',
1176
        'ApplicationName': 'LocalizedText',
1177
        'ApplicationType': 'ApplicationType',
1178
        'GatewayServerUri': 'String',
1179
        'DiscoveryProfileUri': 'String',
1180
        'DiscoveryUrls': 'String',
1181
               }
1182
1183
    def __init__(self, binary=None):
1184
        if binary is not None:
1185
            self._binary_init(binary)
1186
            self._freeze = True
1187
            return
1188
        self.ApplicationUri = None
1189 1
        self.ProductUri = None
1190 1
        self.ApplicationName = LocalizedText()
1191 1
        self.ApplicationType = ApplicationType(0)
1192 1
        self.GatewayServerUri = None
1193 1
        self.DiscoveryProfileUri = None
1194 1
        self.DiscoveryUrls = []
1195 1
        self._freeze = True
1196 1
1197 1 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1198 1
        packet = []
1199 1
        packet.append(uabin.Primitives.String.pack(self.ApplicationUri))
1200 1
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
1201 1
        packet.append(self.ApplicationName.to_binary())
1202
        packet.append(uabin.Primitives.UInt32.pack(self.ApplicationType.value))
1203 1
        packet.append(uabin.Primitives.String.pack(self.GatewayServerUri))
1204 1
        packet.append(uabin.Primitives.String.pack(self.DiscoveryProfileUri))
1205 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiscoveryUrls)))
1206 1
        for fieldname in self.DiscoveryUrls:
1207 1
            packet.append(uabin.Primitives.String.pack(fieldname))
1208 1
        return b''.join(packet)
1209 1
1210 1
    @staticmethod
1211 1
    def from_binary(data):
1212 1
        return ApplicationDescription(data)
1213
1214 1
    def _binary_init(self, data):
1215
        self.ApplicationUri = uabin.Primitives.String.unpack(data)
1216 1
        self.ProductUri = uabin.Primitives.String.unpack(data)
1217
        self.ApplicationName = LocalizedText.from_binary(data)
1218 1
        self.ApplicationType = ApplicationType(uabin.Primitives.UInt32.unpack(data))
1219 1
        self.GatewayServerUri = uabin.Primitives.String.unpack(data)
1220 1
        self.DiscoveryProfileUri = uabin.Primitives.String.unpack(data)
1221 1
        self.DiscoveryUrls = uabin.Primitives.String.unpack_array(data)
1222 1
1223 1
    def __str__(self):
1224 1
        return 'ApplicationDescription(' + 'ApplicationUri:' + str(self.ApplicationUri) + ', ' + \
1225 1
               'ProductUri:' + str(self.ProductUri) + ', ' + \
1226
               'ApplicationName:' + str(self.ApplicationName) + ', ' + \
1227 1
               'ApplicationType:' + str(self.ApplicationType) + ', ' + \
1228
               'GatewayServerUri:' + str(self.GatewayServerUri) + ', ' + \
1229
               'DiscoveryProfileUri:' + str(self.DiscoveryProfileUri) + ', ' + \
1230
               'DiscoveryUrls:' + str(self.DiscoveryUrls) + ')'
1231
1232
    __repr__ = __str__
1233
1234
1235
class RequestHeader(FrozenClass):
1236 1
    '''
1237
    The header passed with every server request.
1238
1239 1
    :ivar AuthenticationToken:
1240
    :vartype AuthenticationToken: NodeId
1241
    :ivar Timestamp:
1242
    :vartype Timestamp: DateTime
1243
    :ivar RequestHandle:
1244
    :vartype RequestHandle: UInt32
1245
    :ivar ReturnDiagnostics:
1246
    :vartype ReturnDiagnostics: UInt32
1247
    :ivar AuditEntryId:
1248
    :vartype AuditEntryId: String
1249
    :ivar TimeoutHint:
1250
    :vartype TimeoutHint: UInt32
1251
    :ivar AdditionalHeader:
1252
    :vartype AdditionalHeader: ExtensionObject
1253
    '''
1254
1255
    ua_types = {
1256 1
        'AuthenticationToken': 'NodeId',
1257 1
        'Timestamp': 'DateTime',
1258 1
        'RequestHandle': 'UInt32',
1259 1
        'ReturnDiagnostics': 'UInt32',
1260 1
        'AuditEntryId': 'String',
1261 1
        'TimeoutHint': 'UInt32',
1262 1
        'AdditionalHeader': 'ExtensionObject',
1263 1
               }
1264 1
1265 1
    def __init__(self, binary=None):
1266 1
        if binary is not None:
1267 1
            self._binary_init(binary)
1268
            self._freeze = True
1269 1
            return
1270 1
        self.AuthenticationToken = NodeId()
1271 1
        self.Timestamp = datetime.now()
1272 1
        self.RequestHandle = 0
1273 1
        self.ReturnDiagnostics = 0
1274 1
        self.AuditEntryId = None
1275 1
        self.TimeoutHint = 0
1276 1
        self.AdditionalHeader = None
1277
        self._freeze = True
1278 1
1279 1
    def to_binary(self):
1280
        packet = []
1281 1
        packet.append(self.AuthenticationToken.to_binary())
1282
        packet.append(uabin.Primitives.DateTime.pack(self.Timestamp))
1283 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestHandle))
1284
        packet.append(uabin.Primitives.UInt32.pack(self.ReturnDiagnostics))
1285 1
        packet.append(uabin.Primitives.String.pack(self.AuditEntryId))
1286 1
        packet.append(uabin.Primitives.UInt32.pack(self.TimeoutHint))
1287 1
        packet.append(extensionobject_to_binary(self.AdditionalHeader))
1288 1
        return b''.join(packet)
1289 1
1290 1
    @staticmethod
1291 1
    def from_binary(data):
1292
        return RequestHeader(data)
1293 1
1294
    def _binary_init(self, data):
1295
        self.AuthenticationToken = NodeId.from_binary(data)
1296
        self.Timestamp = uabin.Primitives.DateTime.unpack(data)
1297
        self.RequestHandle = uabin.Primitives.UInt32.unpack(data)
1298
        self.ReturnDiagnostics = uabin.Primitives.UInt32.unpack(data)
1299
        self.AuditEntryId = uabin.Primitives.String.unpack(data)
1300
        self.TimeoutHint = uabin.Primitives.UInt32.unpack(data)
1301 1
        self.AdditionalHeader = extensionobject_from_binary(data)
1302
1303
    def __str__(self):
1304 1
        return 'RequestHeader(' + 'AuthenticationToken:' + str(self.AuthenticationToken) + ', ' + \
1305
               'Timestamp:' + str(self.Timestamp) + ', ' + \
1306
               'RequestHandle:' + str(self.RequestHandle) + ', ' + \
1307
               'ReturnDiagnostics:' + str(self.ReturnDiagnostics) + ', ' + \
1308
               'AuditEntryId:' + str(self.AuditEntryId) + ', ' + \
1309
               'TimeoutHint:' + str(self.TimeoutHint) + ', ' + \
1310
               'AdditionalHeader:' + str(self.AdditionalHeader) + ')'
1311
1312
    __repr__ = __str__
1313 1
1314 1
1315
class ResponseHeader(FrozenClass):
1316
    '''
1317
    The header passed with every server response.
1318 1
1319 1
    :ivar Timestamp:
1320 1
    :vartype Timestamp: DateTime
1321
    :ivar RequestHandle:
1322 1
    :vartype RequestHandle: UInt32
1323 1
    :ivar ServiceResult:
1324 1
    :vartype ServiceResult: StatusCode
1325 1
    :ivar ServiceDiagnostics:
1326 1
    :vartype ServiceDiagnostics: DiagnosticInfo
1327
    :ivar StringTable:
1328 1
    :vartype StringTable: String
1329
    :ivar AdditionalHeader:
1330
    :vartype AdditionalHeader: ExtensionObject
1331
    '''
1332 1
1333
    ua_types = {
1334
        'Timestamp': 'DateTime',
1335
        'RequestHandle': 'UInt32',
1336 1
        'ServiceResult': 'StatusCode',
1337
        'ServiceDiagnostics': 'DiagnosticInfo',
1338
        'StringTable': 'String',
1339
        'AdditionalHeader': 'ExtensionObject',
1340 1
               }
1341
1342
    def __init__(self, binary=None):
1343 1
        if binary is not None:
1344
            self._binary_init(binary)
1345
            self._freeze = True
1346
            return
1347
        self.Timestamp = datetime.now()
1348
        self.RequestHandle = 0
1349
        self.ServiceResult = StatusCode()
1350
        self.ServiceDiagnostics = DiagnosticInfo()
1351
        self.StringTable = []
1352 1
        self.AdditionalHeader = None
1353 1
        self._freeze = True
1354 1
1355 1
    def to_binary(self):
1356 1
        packet = []
1357 1
        packet.append(uabin.Primitives.DateTime.pack(self.Timestamp))
1358 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestHandle))
1359 1
        packet.append(self.ServiceResult.to_binary())
1360 1
        packet.append(self.ServiceDiagnostics.to_binary())
1361
        packet.append(uabin.Primitives.Int32.pack(len(self.StringTable)))
1362 1
        for fieldname in self.StringTable:
1363 1
            packet.append(uabin.Primitives.String.pack(fieldname))
1364 1
        packet.append(extensionobject_to_binary(self.AdditionalHeader))
1365 1
        return b''.join(packet)
1366 1
1367
    @staticmethod
1368 1
    def from_binary(data):
1369 1
        return ResponseHeader(data)
1370 1
1371 1
    def _binary_init(self, data):
1372
        self.Timestamp = uabin.Primitives.DateTime.unpack(data)
1373 1
        self.RequestHandle = uabin.Primitives.UInt32.unpack(data)
1374
        self.ServiceResult = StatusCode.from_binary(data)
1375 1
        self.ServiceDiagnostics = DiagnosticInfo.from_binary(data)
1376
        self.StringTable = uabin.Primitives.String.unpack_array(data)
1377 1
        self.AdditionalHeader = extensionobject_from_binary(data)
1378 1
1379 1
    def __str__(self):
1380 1
        return 'ResponseHeader(' + 'Timestamp:' + str(self.Timestamp) + ', ' + \
1381
               'RequestHandle:' + str(self.RequestHandle) + ', ' + \
1382 1
               'ServiceResult:' + str(self.ServiceResult) + ', ' + \
1383
               'ServiceDiagnostics:' + str(self.ServiceDiagnostics) + ', ' + \
1384
               'StringTable:' + str(self.StringTable) + ', ' + \
1385
               'AdditionalHeader:' + str(self.AdditionalHeader) + ')'
1386
1387 1
    __repr__ = __str__
1388
1389
1390 1 View Code Duplication
class ServiceFault(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1391
    '''
1392
    The response returned by all services when there is a service level error.
1393
1394
    :ivar TypeId:
1395
    :vartype TypeId: NodeId
1396
    :ivar ResponseHeader:
1397
    :vartype ResponseHeader: ResponseHeader
1398
    '''
1399
1400
    ua_types = {
1401 1
        'TypeId': 'NodeId',
1402 1
        'ResponseHeader': 'ResponseHeader',
1403
               }
1404
1405
    def __init__(self, binary=None):
1406 1
        if binary is not None:
1407 1
            self._binary_init(binary)
1408 1
            self._freeze = True
1409 1
            return
1410
        self.TypeId = FourByteNodeId(ObjectIds.ServiceFault_Encoding_DefaultBinary)
1411 1
        self.ResponseHeader = ResponseHeader()
1412 1
        self._freeze = True
1413 1
1414 1
    def to_binary(self):
1415 1
        packet = []
1416 1
        packet.append(self.TypeId.to_binary())
1417
        packet.append(self.ResponseHeader.to_binary())
1418 1
        return b''.join(packet)
1419
1420
    @staticmethod
1421
    def from_binary(data):
1422 1
        return ServiceFault(data)
1423
1424
    def _binary_init(self, data):
1425
        self.TypeId = NodeId.from_binary(data)
1426
        self.ResponseHeader = ResponseHeader.from_binary(data)
1427 1
1428
    def __str__(self):
1429
        return 'ServiceFault(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1430
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
1431
1432 1
    __repr__ = __str__
1433
1434
1435 1 View Code Duplication
class FindServersParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1436
    '''
1437
    :ivar EndpointUrl:
1438
    :vartype EndpointUrl: String
1439
    :ivar LocaleIds:
1440
    :vartype LocaleIds: String
1441
    :ivar ServerUris:
1442
    :vartype ServerUris: String
1443
    '''
1444
1445
    ua_types = {
1446 1
        'EndpointUrl': 'String',
1447 1
        'LocaleIds': 'String',
1448 1
        'ServerUris': 'String',
1449 1
               }
1450 1
1451 1
    def __init__(self, binary=None):
1452 1
        if binary is not None:
1453 1
            self._binary_init(binary)
1454 1
            self._freeze = True
1455
            return
1456 1
        self.EndpointUrl = None
1457 1
        self.LocaleIds = []
1458 1
        self.ServerUris = []
1459 1
        self._freeze = True
1460 1
1461 1
    def to_binary(self):
1462 1
        packet = []
1463 1
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
1464
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
1465 1
        for fieldname in self.LocaleIds:
1466
            packet.append(uabin.Primitives.String.pack(fieldname))
1467 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerUris)))
1468
        for fieldname in self.ServerUris:
1469 1
            packet.append(uabin.Primitives.String.pack(fieldname))
1470 1
        return b''.join(packet)
1471 1
1472 1
    @staticmethod
1473 1
    def from_binary(data):
1474 1
        return FindServersParameters(data)
1475 1
1476 1
    def _binary_init(self, data):
1477 1
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
1478
        self.LocaleIds = uabin.Primitives.String.unpack_array(data)
1479 1
        self.ServerUris = uabin.Primitives.String.unpack_array(data)
1480
1481
    def __str__(self):
1482
        return 'FindServersParameters(' + 'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
1483
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
1484 1
               'ServerUris:' + str(self.ServerUris) + ')'
1485
1486
    __repr__ = __str__
1487 1
1488
1489
class FindServersRequest(FrozenClass):
1490
    '''
1491
    Finds the servers known to the discovery server.
1492
1493
    :ivar TypeId:
1494
    :vartype TypeId: NodeId
1495
    :ivar RequestHeader:
1496
    :vartype RequestHeader: RequestHeader
1497
    :ivar Parameters:
1498 1
    :vartype Parameters: FindServersParameters
1499
    '''
1500
1501
    ua_types = {
1502
        'TypeId': 'NodeId',
1503
        'RequestHeader': 'RequestHeader',
1504
        'Parameters': 'FindServersParameters',
1505
               }
1506
1507
    def __init__(self, binary=None):
1508
        if binary is not None:
1509 1
            self._binary_init(binary)
1510
            self._freeze = True
1511
            return
1512
        self.TypeId = FourByteNodeId(ObjectIds.FindServersRequest_Encoding_DefaultBinary)
1513
        self.RequestHeader = RequestHeader()
1514
        self.Parameters = FindServersParameters()
1515
        self._freeze = True
1516
1517
    def to_binary(self):
1518
        packet = []
1519 1
        packet.append(self.TypeId.to_binary())
1520
        packet.append(self.RequestHeader.to_binary())
1521
        packet.append(self.Parameters.to_binary())
1522
        return b''.join(packet)
1523 1
1524
    @staticmethod
1525
    def from_binary(data):
1526
        return FindServersRequest(data)
1527
1528
    def _binary_init(self, data):
1529 1
        self.TypeId = NodeId.from_binary(data)
1530
        self.RequestHeader = RequestHeader.from_binary(data)
1531
        self.Parameters = FindServersParameters.from_binary(data)
1532
1533
    def __str__(self):
1534
        return 'FindServersRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1535 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
1536
               'Parameters:' + str(self.Parameters) + ')'
1537
1538 1
    __repr__ = __str__
1539
1540
1541 View Code Duplication
class FindServersResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1542
    '''
1543
    Finds the servers known to the discovery server.
1544
1545
    :ivar TypeId:
1546
    :vartype TypeId: NodeId
1547 1
    :ivar ResponseHeader:
1548
    :vartype ResponseHeader: ResponseHeader
1549
    :ivar Servers:
1550
    :vartype Servers: ApplicationDescription
1551
    '''
1552
1553
    ua_types = {
1554
        'TypeId': 'NodeId',
1555
        'ResponseHeader': 'ResponseHeader',
1556
        'Servers': 'ApplicationDescription',
1557 1
               }
1558
1559
    def __init__(self, binary=None):
1560
        if binary is not None:
1561
            self._binary_init(binary)
1562
            self._freeze = True
1563
            return
1564
        self.TypeId = FourByteNodeId(ObjectIds.FindServersResponse_Encoding_DefaultBinary)
1565
        self.ResponseHeader = ResponseHeader()
1566 1
        self.Servers = []
1567
        self._freeze = True
1568
1569
    def to_binary(self):
1570 1
        packet = []
1571
        packet.append(self.TypeId.to_binary())
1572
        packet.append(self.ResponseHeader.to_binary())
1573
        packet.append(uabin.Primitives.Int32.pack(len(self.Servers)))
1574
        for fieldname in self.Servers:
1575 1
            packet.append(fieldname.to_binary())
1576
        return b''.join(packet)
1577
1578
    @staticmethod
1579
    def from_binary(data):
1580 1
        return FindServersResponse(data)
1581
1582
    def _binary_init(self, data):
1583 1
        self.TypeId = NodeId.from_binary(data)
1584
        self.ResponseHeader = ResponseHeader.from_binary(data)
1585
        length = uabin.Primitives.Int32.unpack(data)
1586
        array = []
1587
        if length != -1:
1588
            for _ in range(0, length):
1589
                array.append(ApplicationDescription.from_binary(data))
1590
        self.Servers = array
1591
1592 1
    def __str__(self):
1593
        return 'FindServersResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1594
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
1595
               'Servers:' + str(self.Servers) + ')'
1596
1597
    __repr__ = __str__
1598
1599
1600 View Code Duplication
class ServerOnNetwork(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1601
    '''
1602 1
    :ivar RecordId:
1603
    :vartype RecordId: UInt32
1604
    :ivar ServerName:
1605
    :vartype ServerName: String
1606
    :ivar DiscoveryUrl:
1607
    :vartype DiscoveryUrl: String
1608
    :ivar ServerCapabilities:
1609 1
    :vartype ServerCapabilities: String
1610
    '''
1611
1612
    ua_types = {
1613 1
        'RecordId': 'UInt32',
1614
        'ServerName': 'String',
1615
        'DiscoveryUrl': 'String',
1616
        'ServerCapabilities': 'String',
1617
               }
1618 1
1619
    def __init__(self, binary=None):
1620
        if binary is not None:
1621
            self._binary_init(binary)
1622
            self._freeze = True
1623 1
            return
1624
        self.RecordId = 0
1625
        self.ServerName = None
1626 1
        self.DiscoveryUrl = None
1627
        self.ServerCapabilities = []
1628
        self._freeze = True
1629
1630
    def to_binary(self):
1631
        packet = []
1632
        packet.append(uabin.Primitives.UInt32.pack(self.RecordId))
1633 1
        packet.append(uabin.Primitives.String.pack(self.ServerName))
1634
        packet.append(uabin.Primitives.String.pack(self.DiscoveryUrl))
1635
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerCapabilities)))
1636
        for fieldname in self.ServerCapabilities:
1637
            packet.append(uabin.Primitives.String.pack(fieldname))
1638
        return b''.join(packet)
1639
1640
    @staticmethod
1641
    def from_binary(data):
1642 1
        return ServerOnNetwork(data)
1643
1644
    def _binary_init(self, data):
1645
        self.RecordId = uabin.Primitives.UInt32.unpack(data)
1646
        self.ServerName = uabin.Primitives.String.unpack(data)
1647
        self.DiscoveryUrl = uabin.Primitives.String.unpack(data)
1648
        self.ServerCapabilities = uabin.Primitives.String.unpack_array(data)
1649
1650 1
    def __str__(self):
1651
        return 'ServerOnNetwork(' + 'RecordId:' + str(self.RecordId) + ', ' + \
1652
               'ServerName:' + str(self.ServerName) + ', ' + \
1653
               'DiscoveryUrl:' + str(self.DiscoveryUrl) + ', ' + \
1654 1
               'ServerCapabilities:' + str(self.ServerCapabilities) + ')'
1655
1656
    __repr__ = __str__
1657
1658
1659 View Code Duplication
class FindServersOnNetworkParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1660
    '''
1661
    :ivar StartingRecordId:
1662
    :vartype StartingRecordId: UInt32
1663 1
    :ivar MaxRecordsToReturn:
1664
    :vartype MaxRecordsToReturn: UInt32
1665
    :ivar ServerCapabilityFilter:
1666
    :vartype ServerCapabilityFilter: String
1667 1
    '''
1668
1669
    ua_types = {
1670 1
        'StartingRecordId': 'UInt32',
1671
        'MaxRecordsToReturn': 'UInt32',
1672
        'ServerCapabilityFilter': 'String',
1673
               }
1674
1675
    def __init__(self, binary=None):
1676
        if binary is not None:
1677
            self._binary_init(binary)
1678
            self._freeze = True
1679 1
            return
1680
        self.StartingRecordId = 0
1681
        self.MaxRecordsToReturn = 0
1682
        self.ServerCapabilityFilter = []
1683
        self._freeze = True
1684
1685
    def to_binary(self):
1686
        packet = []
1687
        packet.append(uabin.Primitives.UInt32.pack(self.StartingRecordId))
1688
        packet.append(uabin.Primitives.UInt32.pack(self.MaxRecordsToReturn))
1689 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerCapabilityFilter)))
1690
        for fieldname in self.ServerCapabilityFilter:
1691
            packet.append(uabin.Primitives.String.pack(fieldname))
1692
        return b''.join(packet)
1693
1694
    @staticmethod
1695
    def from_binary(data):
1696 1
        return FindServersOnNetworkParameters(data)
1697
1698
    def _binary_init(self, data):
1699
        self.StartingRecordId = uabin.Primitives.UInt32.unpack(data)
1700 1
        self.MaxRecordsToReturn = uabin.Primitives.UInt32.unpack(data)
1701
        self.ServerCapabilityFilter = uabin.Primitives.String.unpack_array(data)
1702
1703
    def __str__(self):
1704
        return 'FindServersOnNetworkParameters(' + 'StartingRecordId:' + str(self.StartingRecordId) + ', ' + \
1705 1
               'MaxRecordsToReturn:' + str(self.MaxRecordsToReturn) + ', ' + \
1706
               'ServerCapabilityFilter:' + str(self.ServerCapabilityFilter) + ')'
1707
1708
    __repr__ = __str__
1709
1710 1
1711
class FindServersOnNetworkRequest(FrozenClass):
1712
    '''
1713 1
    :ivar TypeId:
1714
    :vartype TypeId: NodeId
1715
    :ivar RequestHeader:
1716
    :vartype RequestHeader: RequestHeader
1717
    :ivar Parameters:
1718
    :vartype Parameters: FindServersOnNetworkParameters
1719
    '''
1720
1721
    ua_types = {
1722
        'TypeId': 'NodeId',
1723
        'RequestHeader': 'RequestHeader',
1724
        'Parameters': 'FindServersOnNetworkParameters',
1725
               }
1726
1727
    def __init__(self, binary=None):
1728 1
        if binary is not None:
1729 1
            self._binary_init(binary)
1730 1
            self._freeze = True
1731 1
            return
1732 1
        self.TypeId = FourByteNodeId(ObjectIds.FindServersOnNetworkRequest_Encoding_DefaultBinary)
1733 1
        self.RequestHeader = RequestHeader()
1734 1
        self.Parameters = FindServersOnNetworkParameters()
1735 1
        self._freeze = True
1736 1
1737 1
    def to_binary(self):
1738 1
        packet = []
1739
        packet.append(self.TypeId.to_binary())
1740 1
        packet.append(self.RequestHeader.to_binary())
1741 1
        packet.append(self.Parameters.to_binary())
1742 1
        return b''.join(packet)
1743 1
1744 1
    @staticmethod
1745 1
    def from_binary(data):
1746 1
        return FindServersOnNetworkRequest(data)
1747 1
1748
    def _binary_init(self, data):
1749 1
        self.TypeId = NodeId.from_binary(data)
1750
        self.RequestHeader = RequestHeader.from_binary(data)
1751 1
        self.Parameters = FindServersOnNetworkParameters.from_binary(data)
1752
1753 1
    def __str__(self):
1754 1
        return 'FindServersOnNetworkRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1755 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
1756 1
               'Parameters:' + str(self.Parameters) + ')'
1757 1
1758 1
    __repr__ = __str__
1759
1760 1
1761 View Code Duplication
class FindServersOnNetworkResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1762
    '''
1763
    :ivar LastCounterResetTime:
1764
    :vartype LastCounterResetTime: DateTime
1765
    :ivar Servers:
1766
    :vartype Servers: ServerOnNetwork
1767 1
    '''
1768
1769
    ua_types = {
1770 1
        'LastCounterResetTime': 'DateTime',
1771
        'Servers': 'ServerOnNetwork',
1772
               }
1773
1774
    def __init__(self, binary=None):
1775
        if binary is not None:
1776
            self._binary_init(binary)
1777
            self._freeze = True
1778
            return
1779
        self.LastCounterResetTime = datetime.now()
1780
        self.Servers = []
1781
        self._freeze = True
1782
1783
    def to_binary(self):
1784
        packet = []
1785
        packet.append(uabin.Primitives.DateTime.pack(self.LastCounterResetTime))
1786
        packet.append(uabin.Primitives.Int32.pack(len(self.Servers)))
1787
        for fieldname in self.Servers:
1788
            packet.append(fieldname.to_binary())
1789
        return b''.join(packet)
1790
1791 1
    @staticmethod
1792 1
    def from_binary(data):
1793 1
        return FindServersOnNetworkResult(data)
1794 1
1795 1
    def _binary_init(self, data):
1796 1
        self.LastCounterResetTime = uabin.Primitives.DateTime.unpack(data)
1797 1
        length = uabin.Primitives.Int32.unpack(data)
1798 1
        array = []
1799 1
        if length != -1:
1800 1
            for _ in range(0, length):
1801 1
                array.append(ServerOnNetwork.from_binary(data))
1802 1
        self.Servers = array
1803 1
1804 1
    def __str__(self):
1805
        return 'FindServersOnNetworkResult(' + 'LastCounterResetTime:' + str(self.LastCounterResetTime) + ', ' + \
1806 1
               'Servers:' + str(self.Servers) + ')'
1807 1
1808 1
    __repr__ = __str__
1809 1
1810 1
1811 1
class FindServersOnNetworkResponse(FrozenClass):
1812 1
    '''
1813 1
    :ivar TypeId:
1814 1
    :vartype TypeId: NodeId
1815 1
    :ivar ResponseHeader:
1816 1
    :vartype ResponseHeader: ResponseHeader
1817 1
    :ivar Parameters:
1818 1
    :vartype Parameters: FindServersOnNetworkResult
1819
    '''
1820 1
1821
    ua_types = {
1822 1
        'TypeId': 'NodeId',
1823
        'ResponseHeader': 'ResponseHeader',
1824 1
        'Parameters': 'FindServersOnNetworkResult',
1825 1
               }
1826 1
1827 1
    def __init__(self, binary=None):
1828 1
        if binary is not None:
1829 1
            self._binary_init(binary)
1830 1
            self._freeze = True
1831 1
            return
1832 1
        self.TypeId = FourByteNodeId(ObjectIds.FindServersOnNetworkResponse_Encoding_DefaultBinary)
1833 1
        self.ResponseHeader = ResponseHeader()
1834 1
        self.Parameters = FindServersOnNetworkResult()
1835 1
        self._freeze = True
1836 1
1837 1
    def to_binary(self):
1838
        packet = []
1839 1
        packet.append(self.TypeId.to_binary())
1840
        packet.append(self.ResponseHeader.to_binary())
1841
        packet.append(self.Parameters.to_binary())
1842
        return b''.join(packet)
1843
1844
    @staticmethod
1845
    def from_binary(data):
1846
        return FindServersOnNetworkResponse(data)
1847
1848
    def _binary_init(self, data):
1849 1
        self.TypeId = NodeId.from_binary(data)
1850
        self.ResponseHeader = ResponseHeader.from_binary(data)
1851
        self.Parameters = FindServersOnNetworkResult.from_binary(data)
1852 1
1853
    def __str__(self):
1854
        return 'FindServersOnNetworkResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1855
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
1856
               'Parameters:' + str(self.Parameters) + ')'
1857
1858
    __repr__ = __str__
1859
1860
1861 1 View Code Duplication
class UserTokenPolicy(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1862 1
    '''
1863 1
    Describes a user token that can be used with a server.
1864 1
1865 1
    :ivar PolicyId:
1866 1
    :vartype PolicyId: String
1867 1
    :ivar TokenType:
1868 1
    :vartype TokenType: UserTokenType
1869 1
    :ivar IssuedTokenType:
1870
    :vartype IssuedTokenType: String
1871 1
    :ivar IssuerEndpointUrl:
1872 1
    :vartype IssuerEndpointUrl: String
1873 1
    :ivar SecurityPolicyUri:
1874 1
    :vartype SecurityPolicyUri: String
1875 1
    '''
1876
1877 1
    ua_types = {
1878 1
        'PolicyId': 'String',
1879
        'TokenType': 'UserTokenType',
1880 1
        'IssuedTokenType': 'String',
1881
        'IssuerEndpointUrl': 'String',
1882 1
        'SecurityPolicyUri': 'String',
1883
               }
1884 1
1885
    def __init__(self, binary=None):
1886 1
        if binary is not None:
1887 1
            self._binary_init(binary)
1888 1
            self._freeze = True
1889 1
            return
1890
        self.PolicyId = None
1891 1
        self.TokenType = UserTokenType(0)
1892
        self.IssuedTokenType = None
1893
        self.IssuerEndpointUrl = None
1894
        self.SecurityPolicyUri = None
1895
        self._freeze = True
1896 1
1897
    def to_binary(self):
1898
        packet = []
1899 1
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
1900
        packet.append(uabin.Primitives.UInt32.pack(self.TokenType.value))
1901
        packet.append(uabin.Primitives.String.pack(self.IssuedTokenType))
1902
        packet.append(uabin.Primitives.String.pack(self.IssuerEndpointUrl))
1903
        packet.append(uabin.Primitives.String.pack(self.SecurityPolicyUri))
1904
        return b''.join(packet)
1905
1906
    @staticmethod
1907
    def from_binary(data):
1908
        return UserTokenPolicy(data)
1909
1910 1
    def _binary_init(self, data):
1911 1
        self.PolicyId = uabin.Primitives.String.unpack(data)
1912
        self.TokenType = UserTokenType(uabin.Primitives.UInt32.unpack(data))
1913
        self.IssuedTokenType = uabin.Primitives.String.unpack(data)
1914
        self.IssuerEndpointUrl = uabin.Primitives.String.unpack(data)
1915 1
        self.SecurityPolicyUri = uabin.Primitives.String.unpack(data)
1916 1
1917 1
    def __str__(self):
1918 1
        return 'UserTokenPolicy(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
1919
               'TokenType:' + str(self.TokenType) + ', ' + \
1920 1
               'IssuedTokenType:' + str(self.IssuedTokenType) + ', ' + \
1921 1
               'IssuerEndpointUrl:' + str(self.IssuerEndpointUrl) + ', ' + \
1922 1
               'SecurityPolicyUri:' + str(self.SecurityPolicyUri) + ')'
1923 1
1924 1
    __repr__ = __str__
1925 1
1926
1927 1
class EndpointDescription(FrozenClass):
1928
    '''
1929
    The description of a endpoint that can be used to access a server.
1930
1931 1
    :ivar EndpointUrl:
1932
    :vartype EndpointUrl: String
1933
    :ivar Server:
1934
    :vartype Server: ApplicationDescription
1935
    :ivar ServerCertificate:
1936 1
    :vartype ServerCertificate: ByteString
1937
    :ivar SecurityMode:
1938
    :vartype SecurityMode: MessageSecurityMode
1939
    :ivar SecurityPolicyUri:
1940
    :vartype SecurityPolicyUri: String
1941 1
    :ivar UserIdentityTokens:
1942
    :vartype UserIdentityTokens: UserTokenPolicy
1943
    :ivar TransportProfileUri:
1944 1
    :vartype TransportProfileUri: String
1945
    :ivar SecurityLevel:
1946
    :vartype SecurityLevel: Byte
1947
    '''
1948
1949
    ua_types = {
1950
        'EndpointUrl': 'String',
1951
        'Server': 'ApplicationDescription',
1952
        'ServerCertificate': 'ByteString',
1953
        'SecurityMode': 'MessageSecurityMode',
1954
        'SecurityPolicyUri': 'String',
1955 1
        'UserIdentityTokens': 'UserTokenPolicy',
1956 1
        'TransportProfileUri': 'String',
1957 1
        'SecurityLevel': 'Byte',
1958 1
               }
1959 1
1960 1
    def __init__(self, binary=None):
1961 1
        if binary is not None:
1962 1
            self._binary_init(binary)
1963 1
            self._freeze = True
1964
            return
1965 1
        self.EndpointUrl = None
1966 1
        self.Server = ApplicationDescription()
1967 1
        self.ServerCertificate = None
1968 1
        self.SecurityMode = MessageSecurityMode(0)
1969 1
        self.SecurityPolicyUri = None
1970 1
        self.UserIdentityTokens = []
1971 1
        self.TransportProfileUri = None
1972 1
        self.SecurityLevel = 0
1973
        self._freeze = True
1974 1
1975 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1976 1
        packet = []
1977
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
1978 1
        packet.append(self.Server.to_binary())
1979 1
        packet.append(uabin.Primitives.ByteString.pack(self.ServerCertificate))
1980 1
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityMode.value))
1981 1
        packet.append(uabin.Primitives.String.pack(self.SecurityPolicyUri))
1982 1
        packet.append(uabin.Primitives.Int32.pack(len(self.UserIdentityTokens)))
1983 1
        for fieldname in self.UserIdentityTokens:
1984 1
            packet.append(fieldname.to_binary())
1985 1
        packet.append(uabin.Primitives.String.pack(self.TransportProfileUri))
1986 1
        packet.append(uabin.Primitives.Byte.pack(self.SecurityLevel))
1987
        return b''.join(packet)
1988 1
1989
    @staticmethod
1990
    def from_binary(data):
1991
        return EndpointDescription(data)
1992
1993 1 View Code Duplication
    def _binary_init(self, data):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1994
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
1995
        self.Server = ApplicationDescription.from_binary(data)
1996 1
        self.ServerCertificate = uabin.Primitives.ByteString.unpack(data)
1997
        self.SecurityMode = MessageSecurityMode(uabin.Primitives.UInt32.unpack(data))
1998
        self.SecurityPolicyUri = uabin.Primitives.String.unpack(data)
1999
        length = uabin.Primitives.Int32.unpack(data)
2000
        array = []
2001
        if length != -1:
2002
            for _ in range(0, length):
2003
                array.append(UserTokenPolicy.from_binary(data))
2004
        self.UserIdentityTokens = array
2005
        self.TransportProfileUri = uabin.Primitives.String.unpack(data)
2006
        self.SecurityLevel = uabin.Primitives.Byte.unpack(data)
2007
2008
    def __str__(self):
2009
        return 'EndpointDescription(' + 'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
2010
               'Server:' + str(self.Server) + ', ' + \
2011
               'ServerCertificate:' + str(self.ServerCertificate) + ', ' + \
2012
               'SecurityMode:' + str(self.SecurityMode) + ', ' + \
2013
               'SecurityPolicyUri:' + str(self.SecurityPolicyUri) + ', ' + \
2014
               'UserIdentityTokens:' + str(self.UserIdentityTokens) + ', ' + \
2015
               'TransportProfileUri:' + str(self.TransportProfileUri) + ', ' + \
2016
               'SecurityLevel:' + str(self.SecurityLevel) + ')'
2017 1
2018 1
    __repr__ = __str__
2019 1
2020 1
2021 1 View Code Duplication
class GetEndpointsParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2022 1
    '''
2023 1
    :ivar EndpointUrl:
2024 1
    :vartype EndpointUrl: String
2025 1
    :ivar LocaleIds:
2026 1
    :vartype LocaleIds: String
2027 1
    :ivar ProfileUris:
2028 1
    :vartype ProfileUris: String
2029 1
    '''
2030 1
2031
    ua_types = {
2032 1
        'EndpointUrl': 'String',
2033 1
        'LocaleIds': 'String',
2034 1
        'ProfileUris': 'String',
2035 1
               }
2036 1
2037 1
    def __init__(self, binary=None):
2038 1
        if binary is not None:
2039 1
            self._binary_init(binary)
2040 1
            self._freeze = True
2041 1
            return
2042 1
        self.EndpointUrl = None
2043 1
        self.LocaleIds = []
2044 1
        self.ProfileUris = []
2045 1
        self._freeze = True
2046 1
2047
    def to_binary(self):
2048 1
        packet = []
2049
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
2050 1
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
2051
        for fieldname in self.LocaleIds:
2052 1
            packet.append(uabin.Primitives.String.pack(fieldname))
2053 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ProfileUris)))
2054 1
        for fieldname in self.ProfileUris:
2055 1
            packet.append(uabin.Primitives.String.pack(fieldname))
2056 1
        return b''.join(packet)
2057 1
2058 1
    @staticmethod
2059 1
    def from_binary(data):
2060 1
        return GetEndpointsParameters(data)
2061 1
2062 1
    def _binary_init(self, data):
2063 1
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
2064 1
        self.LocaleIds = uabin.Primitives.String.unpack_array(data)
2065 1
        self.ProfileUris = uabin.Primitives.String.unpack_array(data)
2066
2067 1
    def __str__(self):
2068
        return 'GetEndpointsParameters(' + 'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
2069
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
2070
               'ProfileUris:' + str(self.ProfileUris) + ')'
2071
2072
    __repr__ = __str__
2073
2074
2075
class GetEndpointsRequest(FrozenClass):
2076
    '''
2077 1
    Gets the endpoints used by the server.
2078
2079
    :ivar TypeId:
2080 1
    :vartype TypeId: NodeId
2081
    :ivar RequestHeader:
2082
    :vartype RequestHeader: RequestHeader
2083
    :ivar Parameters:
2084
    :vartype Parameters: GetEndpointsParameters
2085
    '''
2086
2087
    ua_types = {
2088
        'TypeId': 'NodeId',
2089
        'RequestHeader': 'RequestHeader',
2090
        'Parameters': 'GetEndpointsParameters',
2091 1
               }
2092 1
2093
    def __init__(self, binary=None):
2094
        if binary is not None:
2095
            self._binary_init(binary)
2096 1
            self._freeze = True
2097 1
            return
2098 1
        self.TypeId = FourByteNodeId(ObjectIds.GetEndpointsRequest_Encoding_DefaultBinary)
2099 1
        self.RequestHeader = RequestHeader()
2100
        self.Parameters = GetEndpointsParameters()
2101 1
        self._freeze = True
2102 1
2103 1
    def to_binary(self):
2104 1
        packet = []
2105 1
        packet.append(self.TypeId.to_binary())
2106 1
        packet.append(self.RequestHeader.to_binary())
2107
        packet.append(self.Parameters.to_binary())
2108 1
        return b''.join(packet)
2109
2110
    @staticmethod
2111
    def from_binary(data):
2112 1
        return GetEndpointsRequest(data)
2113
2114
    def _binary_init(self, data):
2115
        self.TypeId = NodeId.from_binary(data)
2116
        self.RequestHeader = RequestHeader.from_binary(data)
2117 1
        self.Parameters = GetEndpointsParameters.from_binary(data)
2118
2119
    def __str__(self):
2120
        return 'GetEndpointsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2121
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2122 1
               'Parameters:' + str(self.Parameters) + ')'
2123
2124
    __repr__ = __str__
2125 1
2126
2127 View Code Duplication
class GetEndpointsResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2128
    '''
2129
    Gets the endpoints used by the server.
2130
2131
    :ivar TypeId:
2132
    :vartype TypeId: NodeId
2133
    :ivar ResponseHeader:
2134 1
    :vartype ResponseHeader: ResponseHeader
2135 1
    :ivar Endpoints:
2136 1
    :vartype Endpoints: EndpointDescription
2137 1
    '''
2138 1
2139 1
    ua_types = {
2140 1
        'TypeId': 'NodeId',
2141 1
        'ResponseHeader': 'ResponseHeader',
2142
        'Endpoints': 'EndpointDescription',
2143 1
               }
2144 1
2145 1
    def __init__(self, binary=None):
2146 1
        if binary is not None:
2147 1
            self._binary_init(binary)
2148
            self._freeze = True
2149 1
            return
2150
        self.TypeId = FourByteNodeId(ObjectIds.GetEndpointsResponse_Encoding_DefaultBinary)
2151 1
        self.ResponseHeader = ResponseHeader()
2152
        self.Endpoints = []
2153 1
        self._freeze = True
2154 1
2155 1
    def to_binary(self):
2156
        packet = []
2157 1
        packet.append(self.TypeId.to_binary())
2158
        packet.append(self.ResponseHeader.to_binary())
2159
        packet.append(uabin.Primitives.Int32.pack(len(self.Endpoints)))
2160
        for fieldname in self.Endpoints:
2161 1
            packet.append(fieldname.to_binary())
2162
        return b''.join(packet)
2163
2164 1
    @staticmethod
2165
    def from_binary(data):
2166
        return GetEndpointsResponse(data)
2167
2168
    def _binary_init(self, data):
2169 1
        self.TypeId = NodeId.from_binary(data)
2170
        self.ResponseHeader = ResponseHeader.from_binary(data)
2171
        length = uabin.Primitives.Int32.unpack(data)
2172
        array = []
2173
        if length != -1:
2174
            for _ in range(0, length):
2175
                array.append(EndpointDescription.from_binary(data))
2176 1
        self.Endpoints = array
2177
2178
    def __str__(self):
2179
        return 'GetEndpointsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2180 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
2181
               'Endpoints:' + str(self.Endpoints) + ')'
2182
2183
    __repr__ = __str__
2184 1
2185
2186
class RegisteredServer(FrozenClass):
2187 1
    '''
2188
    The information required to register a server with a discovery server.
2189
2190 1
    :ivar ServerUri:
2191
    :vartype ServerUri: String
2192
    :ivar ProductUri:
2193 1
    :vartype ProductUri: String
2194
    :ivar ServerNames:
2195
    :vartype ServerNames: LocalizedText
2196
    :ivar ServerType:
2197
    :vartype ServerType: ApplicationType
2198
    :ivar GatewayServerUri:
2199
    :vartype GatewayServerUri: String
2200
    :ivar DiscoveryUrls:
2201
    :vartype DiscoveryUrls: String
2202 1
    :ivar SemaphoreFilePath:
2203
    :vartype SemaphoreFilePath: String
2204
    :ivar IsOnline:
2205
    :vartype IsOnline: Boolean
2206
    '''
2207
2208
    ua_types = {
2209
        'ServerUri': 'String',
2210
        'ProductUri': 'String',
2211 1
        'ServerNames': 'LocalizedText',
2212
        'ServerType': 'ApplicationType',
2213
        'GatewayServerUri': 'String',
2214
        'DiscoveryUrls': 'String',
2215
        'SemaphoreFilePath': 'String',
2216
        'IsOnline': 'Boolean',
2217
               }
2218
2219 1
    def __init__(self, binary=None):
2220
        if binary is not None:
2221
            self._binary_init(binary)
2222
            self._freeze = True
2223 1
            return
2224
        self.ServerUri = None
2225
        self.ProductUri = None
2226
        self.ServerNames = []
2227 1
        self.ServerType = ApplicationType(0)
2228
        self.GatewayServerUri = None
2229
        self.DiscoveryUrls = []
2230
        self.SemaphoreFilePath = None
2231 1
        self.IsOnline = True
2232
        self._freeze = True
2233
2234 1
    def to_binary(self):
2235
        packet = []
2236
        packet.append(uabin.Primitives.String.pack(self.ServerUri))
2237
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
2238
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerNames)))
2239
        for fieldname in self.ServerNames:
2240
            packet.append(fieldname.to_binary())
2241 1
        packet.append(uabin.Primitives.UInt32.pack(self.ServerType.value))
2242
        packet.append(uabin.Primitives.String.pack(self.GatewayServerUri))
2243
        packet.append(uabin.Primitives.Int32.pack(len(self.DiscoveryUrls)))
2244
        for fieldname in self.DiscoveryUrls:
2245
            packet.append(uabin.Primitives.String.pack(fieldname))
2246
        packet.append(uabin.Primitives.String.pack(self.SemaphoreFilePath))
2247
        packet.append(uabin.Primitives.Boolean.pack(self.IsOnline))
2248
        return b''.join(packet)
2249
2250 1
    @staticmethod
2251
    def from_binary(data):
2252
        return RegisteredServer(data)
2253
2254 View Code Duplication
    def _binary_init(self, data):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2255
        self.ServerUri = uabin.Primitives.String.unpack(data)
2256
        self.ProductUri = uabin.Primitives.String.unpack(data)
2257
        length = uabin.Primitives.Int32.unpack(data)
2258 1
        array = []
2259
        if length != -1:
2260
            for _ in range(0, length):
2261
                array.append(LocalizedText.from_binary(data))
2262 1
        self.ServerNames = array
2263
        self.ServerType = ApplicationType(uabin.Primitives.UInt32.unpack(data))
2264
        self.GatewayServerUri = uabin.Primitives.String.unpack(data)
2265
        self.DiscoveryUrls = uabin.Primitives.String.unpack_array(data)
2266
        self.SemaphoreFilePath = uabin.Primitives.String.unpack(data)
2267
        self.IsOnline = uabin.Primitives.Boolean.unpack(data)
2268
2269
    def __str__(self):
2270
        return 'RegisteredServer(' + 'ServerUri:' + str(self.ServerUri) + ', ' + \
2271 1
               'ProductUri:' + str(self.ProductUri) + ', ' + \
2272
               'ServerNames:' + str(self.ServerNames) + ', ' + \
2273
               'ServerType:' + str(self.ServerType) + ', ' + \
2274
               'GatewayServerUri:' + str(self.GatewayServerUri) + ', ' + \
2275 1
               'DiscoveryUrls:' + str(self.DiscoveryUrls) + ', ' + \
2276
               'SemaphoreFilePath:' + str(self.SemaphoreFilePath) + ', ' + \
2277
               'IsOnline:' + str(self.IsOnline) + ')'
2278 1
2279
    __repr__ = __str__
2280
2281
2282
class RegisterServerRequest(FrozenClass):
2283
    '''
2284
    Registers a server with the discovery server.
2285
2286
    :ivar TypeId:
2287 1
    :vartype TypeId: NodeId
2288
    :ivar RequestHeader:
2289
    :vartype RequestHeader: RequestHeader
2290
    :ivar Server:
2291
    :vartype Server: RegisteredServer
2292
    '''
2293
2294
    ua_types = {
2295
        'TypeId': 'NodeId',
2296
        'RequestHeader': 'RequestHeader',
2297 1
        'Server': 'RegisteredServer',
2298
               }
2299
2300
    def __init__(self, binary=None):
2301
        if binary is not None:
2302
            self._binary_init(binary)
2303
            self._freeze = True
2304 1
            return
2305
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServerRequest_Encoding_DefaultBinary)
2306
        self.RequestHeader = RequestHeader()
2307
        self.Server = RegisteredServer()
2308 1
        self._freeze = True
2309
2310
    def to_binary(self):
2311
        packet = []
2312
        packet.append(self.TypeId.to_binary())
2313 1
        packet.append(self.RequestHeader.to_binary())
2314
        packet.append(self.Server.to_binary())
2315
        return b''.join(packet)
2316
2317
    @staticmethod
2318 1
    def from_binary(data):
2319
        return RegisterServerRequest(data)
2320
2321 1
    def _binary_init(self, data):
2322
        self.TypeId = NodeId.from_binary(data)
2323
        self.RequestHeader = RequestHeader.from_binary(data)
2324
        self.Server = RegisteredServer.from_binary(data)
2325
2326
    def __str__(self):
2327
        return 'RegisterServerRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2328
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2329
               'Server:' + str(self.Server) + ')'
2330
2331
    __repr__ = __str__
2332 1
2333
2334 View Code Duplication
class RegisterServerResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2335
    '''
2336
    Registers a server with the discovery server.
2337
2338
    :ivar TypeId:
2339
    :vartype TypeId: NodeId
2340
    :ivar ResponseHeader:
2341
    :vartype ResponseHeader: ResponseHeader
2342
    '''
2343 1
2344
    ua_types = {
2345
        'TypeId': 'NodeId',
2346
        'ResponseHeader': 'ResponseHeader',
2347
               }
2348
2349
    def __init__(self, binary=None):
2350
        if binary is not None:
2351
            self._binary_init(binary)
2352
            self._freeze = True
2353
            return
2354
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServerResponse_Encoding_DefaultBinary)
2355 1
        self.ResponseHeader = ResponseHeader()
2356
        self._freeze = True
2357
2358
    def to_binary(self):
2359 1
        packet = []
2360
        packet.append(self.TypeId.to_binary())
2361
        packet.append(self.ResponseHeader.to_binary())
2362
        return b''.join(packet)
2363
2364
    @staticmethod
2365
    def from_binary(data):
2366
        return RegisterServerResponse(data)
2367
2368
    def _binary_init(self, data):
2369
        self.TypeId = NodeId.from_binary(data)
2370
        self.ResponseHeader = ResponseHeader.from_binary(data)
2371
2372
    def __str__(self):
2373
        return 'RegisterServerResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2374
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
2375 1
2376
    __repr__ = __str__
2377
2378
2379 View Code Duplication
class DiscoveryConfiguration(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2380
    '''
2381 1
    A base type for discovery configuration information.
2382
2383
    '''
2384 1
2385
    ua_types = {
2386
               }
2387
2388
    def __init__(self, binary=None):
2389
        if binary is not None:
2390
            self._binary_init(binary)
2391
            self._freeze = True
2392
            return
2393
        self._freeze = True
2394
2395
    def to_binary(self):
2396
        packet = []
2397 1
        return b''.join(packet)
2398 1
2399 1
    @staticmethod
2400 1
    def from_binary(data):
2401 1
        return DiscoveryConfiguration(data)
2402 1
2403 1
    def _binary_init(self, data):
2404 1
        pass
2405 1
2406 1
    def __str__(self):
2407
        return 'DiscoveryConfiguration(' +  + ')'
2408 1
2409 1
    __repr__ = __str__
2410 1
2411 1
2412 1 View Code Duplication
class MdnsDiscoveryConfiguration(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2413 1
    '''
2414 1
    The discovery information needed for mDNS registration.
2415
2416 1
    :ivar MdnsServerName:
2417
    :vartype MdnsServerName: String
2418 1
    :ivar ServerCapabilities:
2419
    :vartype ServerCapabilities: String
2420 1
    '''
2421 1
2422 1
    ua_types = {
2423 1
        'MdnsServerName': 'String',
2424 1
        'ServerCapabilities': 'String',
2425
               }
2426 1
2427
    def __init__(self, binary=None):
2428
        if binary is not None:
2429
            self._binary_init(binary)
2430
            self._freeze = True
2431
            return
2432 1
        self.MdnsServerName = None
2433
        self.ServerCapabilities = []
2434
        self._freeze = True
2435 1
2436
    def to_binary(self):
2437
        packet = []
2438
        packet.append(uabin.Primitives.String.pack(self.MdnsServerName))
2439
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerCapabilities)))
2440
        for fieldname in self.ServerCapabilities:
2441
            packet.append(uabin.Primitives.String.pack(fieldname))
2442
        return b''.join(packet)
2443
2444
    @staticmethod
2445
    def from_binary(data):
2446
        return MdnsDiscoveryConfiguration(data)
2447
2448 1
    def _binary_init(self, data):
2449 1
        self.MdnsServerName = uabin.Primitives.String.unpack(data)
2450 1
        self.ServerCapabilities = uabin.Primitives.String.unpack_array(data)
2451 1
2452 1
    def __str__(self):
2453 1
        return 'MdnsDiscoveryConfiguration(' + 'MdnsServerName:' + str(self.MdnsServerName) + ', ' + \
2454 1
               'ServerCapabilities:' + str(self.ServerCapabilities) + ')'
2455 1
2456 1
    __repr__ = __str__
2457 1
2458 1
2459 View Code Duplication
class RegisterServer2Parameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2460 1
    '''
2461 1
    :ivar Server:
2462 1
    :vartype Server: RegisteredServer
2463 1
    :ivar DiscoveryConfiguration:
2464 1
    :vartype DiscoveryConfiguration: ExtensionObject
2465 1
    '''
2466 1
2467 1
    ua_types = {
2468
        'Server': 'RegisteredServer',
2469 1
        'DiscoveryConfiguration': 'ExtensionObject',
2470
               }
2471 1
2472
    def __init__(self, binary=None):
2473 1
        if binary is not None:
2474 1
            self._binary_init(binary)
2475 1
            self._freeze = True
2476 1
            return
2477 1
        self.Server = RegisteredServer()
2478 1
        self.DiscoveryConfiguration = []
2479
        self._freeze = True
2480 1
2481
    def to_binary(self):
2482
        packet = []
2483
        packet.append(self.Server.to_binary())
2484
        packet.append(uabin.Primitives.Int32.pack(len(self.DiscoveryConfiguration)))
2485
        for fieldname in self.DiscoveryConfiguration:
2486
            packet.append(extensionobject_to_binary(fieldname))
2487 1
        return b''.join(packet)
2488
2489
    @staticmethod
2490 1
    def from_binary(data):
2491
        return RegisterServer2Parameters(data)
2492
2493
    def _binary_init(self, data):
2494
        self.Server = RegisteredServer.from_binary(data)
2495
        length = uabin.Primitives.Int32.unpack(data)
2496
        array = []
2497
        if length != -1:
2498
            for _ in range(0, length):
2499
                array.append(extensionobject_from_binary(data))
2500
        self.DiscoveryConfiguration = array
2501 1
2502 1
    def __str__(self):
2503 1
        return 'RegisterServer2Parameters(' + 'Server:' + str(self.Server) + ', ' + \
2504 1
               'DiscoveryConfiguration:' + str(self.DiscoveryConfiguration) + ')'
2505 1
2506 1
    __repr__ = __str__
2507 1
2508 1
2509 1
class RegisterServer2Request(FrozenClass):
2510
    '''
2511 1
    :ivar TypeId:
2512 1
    :vartype TypeId: NodeId
2513 1
    :ivar RequestHeader:
2514 1
    :vartype RequestHeader: RequestHeader
2515 1
    :ivar Parameters:
2516 1
    :vartype Parameters: RegisterServer2Parameters
2517
    '''
2518 1
2519
    ua_types = {
2520 1
        'TypeId': 'NodeId',
2521
        'RequestHeader': 'RequestHeader',
2522 1
        'Parameters': 'RegisterServer2Parameters',
2523 1
               }
2524 1
2525 1
    def __init__(self, binary=None):
2526
        if binary is not None:
2527 1
            self._binary_init(binary)
2528
            self._freeze = True
2529
            return
2530
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServer2Request_Encoding_DefaultBinary)
2531
        self.RequestHeader = RequestHeader()
2532 1
        self.Parameters = RegisterServer2Parameters()
2533
        self._freeze = True
2534
2535 1
    def to_binary(self):
2536
        packet = []
2537
        packet.append(self.TypeId.to_binary())
2538
        packet.append(self.RequestHeader.to_binary())
2539
        packet.append(self.Parameters.to_binary())
2540
        return b''.join(packet)
2541
2542
    @staticmethod
2543
    def from_binary(data):
2544 1
        return RegisterServer2Request(data)
2545 1
2546 1
    def _binary_init(self, data):
2547 1
        self.TypeId = NodeId.from_binary(data)
2548 1
        self.RequestHeader = RequestHeader.from_binary(data)
2549 1
        self.Parameters = RegisterServer2Parameters.from_binary(data)
2550 1
2551 1
    def __str__(self):
2552 1
        return 'RegisterServer2Request(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2553
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2554 1
               'Parameters:' + str(self.Parameters) + ')'
2555 1
2556 1
    __repr__ = __str__
2557 1
2558 1
2559 1
class RegisterServer2Response(FrozenClass):
2560
    '''
2561 1
    :ivar TypeId:
2562
    :vartype TypeId: NodeId
2563 1
    :ivar ResponseHeader:
2564
    :vartype ResponseHeader: ResponseHeader
2565 1
    :ivar ConfigurationResults:
2566 1
    :vartype ConfigurationResults: StatusCode
2567 1
    :ivar DiagnosticInfos:
2568 1
    :vartype DiagnosticInfos: DiagnosticInfo
2569
    '''
2570 1
2571
    ua_types = {
2572
        'TypeId': 'NodeId',
2573
        'ResponseHeader': 'ResponseHeader',
2574
        'ConfigurationResults': 'StatusCode',
2575 1
        'DiagnosticInfos': 'DiagnosticInfo',
2576
               }
2577
2578 1
    def __init__(self, binary=None):
2579
        if binary is not None:
2580
            self._binary_init(binary)
2581
            self._freeze = True
2582
            return
2583
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServer2Response_Encoding_DefaultBinary)
2584
        self.ResponseHeader = ResponseHeader()
2585
        self.ConfigurationResults = []
2586
        self.DiagnosticInfos = []
2587
        self._freeze = True
2588
2589 1
    def to_binary(self):
2590 1
        packet = []
2591 1
        packet.append(self.TypeId.to_binary())
2592 1
        packet.append(self.ResponseHeader.to_binary())
2593 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ConfigurationResults)))
2594 1
        for fieldname in self.ConfigurationResults:
2595 1
            packet.append(fieldname.to_binary())
2596 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
2597 1
        for fieldname in self.DiagnosticInfos:
2598
            packet.append(fieldname.to_binary())
2599 1
        return b''.join(packet)
2600 1
2601 1
    @staticmethod
2602 1
    def from_binary(data):
2603 1
        return RegisterServer2Response(data)
2604 1
2605
    def _binary_init(self, data):
2606 1
        self.TypeId = NodeId.from_binary(data)
2607
        self.ResponseHeader = ResponseHeader.from_binary(data)
2608 1
        length = uabin.Primitives.Int32.unpack(data)
2609
        array = []
2610 1
        if length != -1:
2611 1
            for _ in range(0, length):
2612 1
                array.append(StatusCode.from_binary(data))
2613 1
        self.ConfigurationResults = array
2614
        length = uabin.Primitives.Int32.unpack(data)
2615 1
        array = []
2616
        if length != -1:
2617
            for _ in range(0, length):
2618
                array.append(DiagnosticInfo.from_binary(data))
2619
        self.DiagnosticInfos = array
2620 1
2621
    def __str__(self):
2622
        return 'RegisterServer2Response(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2623 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
2624
               'ConfigurationResults:' + str(self.ConfigurationResults) + ', ' + \
2625
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
2626
2627
    __repr__ = __str__
2628
2629
2630 View Code Duplication
class ChannelSecurityToken(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2631
    '''
2632 1
    The token that identifies a set of keys for an active secure channel.
2633 1
2634
    :ivar ChannelId:
2635
    :vartype ChannelId: UInt32
2636
    :ivar TokenId:
2637 1
    :vartype TokenId: UInt32
2638 1
    :ivar CreatedAt:
2639 1
    :vartype CreatedAt: DateTime
2640
    :ivar RevisedLifetime:
2641 1
    :vartype RevisedLifetime: UInt32
2642 1
    '''
2643 1
2644 1
    ua_types = {
2645 1
        'ChannelId': 'UInt32',
2646
        'TokenId': 'UInt32',
2647 1
        'CreatedAt': 'DateTime',
2648
        'RevisedLifetime': 'UInt32',
2649
               }
2650
2651 1
    def __init__(self, binary=None):
2652
        if binary is not None:
2653
            self._binary_init(binary)
2654
            self._freeze = True
2655 1
            return
2656
        self.ChannelId = 0
2657
        self.TokenId = 0
2658
        self.CreatedAt = datetime.now()
2659 1
        self.RevisedLifetime = 0
2660
        self._freeze = True
2661
2662 1
    def to_binary(self):
2663
        packet = []
2664
        packet.append(uabin.Primitives.UInt32.pack(self.ChannelId))
2665
        packet.append(uabin.Primitives.UInt32.pack(self.TokenId))
2666
        packet.append(uabin.Primitives.DateTime.pack(self.CreatedAt))
2667
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedLifetime))
2668
        return b''.join(packet)
2669
2670
    @staticmethod
2671 1
    def from_binary(data):
2672
        return ChannelSecurityToken(data)
2673
2674
    def _binary_init(self, data):
2675
        self.ChannelId = uabin.Primitives.UInt32.unpack(data)
2676
        self.TokenId = uabin.Primitives.UInt32.unpack(data)
2677
        self.CreatedAt = uabin.Primitives.DateTime.unpack(data)
2678
        self.RevisedLifetime = uabin.Primitives.UInt32.unpack(data)
2679
2680 1
    def __str__(self):
2681
        return 'ChannelSecurityToken(' + 'ChannelId:' + str(self.ChannelId) + ', ' + \
2682
               'TokenId:' + str(self.TokenId) + ', ' + \
2683
               'CreatedAt:' + str(self.CreatedAt) + ', ' + \
2684
               'RevisedLifetime:' + str(self.RevisedLifetime) + ')'
2685
2686 1
    __repr__ = __str__
2687
2688
2689 View Code Duplication
class OpenSecureChannelParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2690 1
    '''
2691
    :ivar ClientProtocolVersion:
2692
    :vartype ClientProtocolVersion: UInt32
2693
    :ivar RequestType:
2694 1
    :vartype RequestType: SecurityTokenRequestType
2695
    :ivar SecurityMode:
2696
    :vartype SecurityMode: MessageSecurityMode
2697
    :ivar ClientNonce:
2698 1
    :vartype ClientNonce: ByteString
2699
    :ivar RequestedLifetime:
2700
    :vartype RequestedLifetime: UInt32
2701 1
    '''
2702
2703
    ua_types = {
2704
        'ClientProtocolVersion': 'UInt32',
2705
        'RequestType': 'SecurityTokenRequestType',
2706
        'SecurityMode': 'MessageSecurityMode',
2707
        'ClientNonce': 'ByteString',
2708
        'RequestedLifetime': 'UInt32',
2709
               }
2710 1
2711
    def __init__(self, binary=None):
2712
        if binary is not None:
2713
            self._binary_init(binary)
2714
            self._freeze = True
2715
            return
2716
        self.ClientProtocolVersion = 0
2717
        self.RequestType = SecurityTokenRequestType(0)
2718
        self.SecurityMode = MessageSecurityMode(0)
2719 1
        self.ClientNonce = None
2720
        self.RequestedLifetime = 0
2721
        self._freeze = True
2722
2723
    def to_binary(self):
2724
        packet = []
2725 1
        packet.append(uabin.Primitives.UInt32.pack(self.ClientProtocolVersion))
2726
        packet.append(uabin.Primitives.UInt32.pack(self.RequestType.value))
2727
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityMode.value))
2728
        packet.append(uabin.Primitives.ByteString.pack(self.ClientNonce))
2729 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedLifetime))
2730
        return b''.join(packet)
2731
2732
    @staticmethod
2733 1
    def from_binary(data):
2734
        return OpenSecureChannelParameters(data)
2735
2736
    def _binary_init(self, data):
2737 1
        self.ClientProtocolVersion = uabin.Primitives.UInt32.unpack(data)
2738
        self.RequestType = SecurityTokenRequestType(uabin.Primitives.UInt32.unpack(data))
2739
        self.SecurityMode = MessageSecurityMode(uabin.Primitives.UInt32.unpack(data))
2740 1
        self.ClientNonce = uabin.Primitives.ByteString.unpack(data)
2741
        self.RequestedLifetime = uabin.Primitives.UInt32.unpack(data)
2742
2743
    def __str__(self):
2744
        return 'OpenSecureChannelParameters(' + 'ClientProtocolVersion:' + str(self.ClientProtocolVersion) + ', ' + \
2745
               'RequestType:' + str(self.RequestType) + ', ' + \
2746
               'SecurityMode:' + str(self.SecurityMode) + ', ' + \
2747
               'ClientNonce:' + str(self.ClientNonce) + ', ' + \
2748
               'RequestedLifetime:' + str(self.RequestedLifetime) + ')'
2749 1
2750 1
    __repr__ = __str__
2751 1
2752 1
2753 1
class OpenSecureChannelRequest(FrozenClass):
2754 1
    '''
2755 1
    Creates a secure channel with a server.
2756 1
2757
    :ivar TypeId:
2758 1
    :vartype TypeId: NodeId
2759 1
    :ivar RequestHeader:
2760 1
    :vartype RequestHeader: RequestHeader
2761 1
    :ivar Parameters:
2762 1
    :vartype Parameters: OpenSecureChannelParameters
2763
    '''
2764 1
2765
    ua_types = {
2766 1
        'TypeId': 'NodeId',
2767
        'RequestHeader': 'RequestHeader',
2768 1
        'Parameters': 'OpenSecureChannelParameters',
2769 1
               }
2770 1
2771
    def __init__(self, binary=None):
2772 1
        if binary is not None:
2773
            self._binary_init(binary)
2774
            self._freeze = True
2775
            return
2776 1
        self.TypeId = FourByteNodeId(ObjectIds.OpenSecureChannelRequest_Encoding_DefaultBinary)
2777
        self.RequestHeader = RequestHeader()
2778
        self.Parameters = OpenSecureChannelParameters()
2779 1
        self._freeze = True
2780
2781
    def to_binary(self):
2782
        packet = []
2783
        packet.append(self.TypeId.to_binary())
2784
        packet.append(self.RequestHeader.to_binary())
2785
        packet.append(self.Parameters.to_binary())
2786
        return b''.join(packet)
2787
2788
    @staticmethod
2789
    def from_binary(data):
2790
        return OpenSecureChannelRequest(data)
2791
2792
    def _binary_init(self, data):
2793
        self.TypeId = NodeId.from_binary(data)
2794
        self.RequestHeader = RequestHeader.from_binary(data)
2795
        self.Parameters = OpenSecureChannelParameters.from_binary(data)
2796
2797
    def __str__(self):
2798 1
        return 'OpenSecureChannelRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2799 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2800 1
               'Parameters:' + str(self.Parameters) + ')'
2801 1
2802 1
    __repr__ = __str__
2803 1
2804 1
2805 1 View Code Duplication
class OpenSecureChannelResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2806 1
    '''
2807 1
    :ivar ServerProtocolVersion:
2808 1
    :vartype ServerProtocolVersion: UInt32
2809 1
    :ivar SecurityToken:
2810 1
    :vartype SecurityToken: ChannelSecurityToken
2811 1
    :ivar ServerNonce:
2812
    :vartype ServerNonce: ByteString
2813 1
    '''
2814 1
2815 1
    ua_types = {
2816 1
        'ServerProtocolVersion': 'UInt32',
2817 1
        'SecurityToken': 'ChannelSecurityToken',
2818 1
        'ServerNonce': 'ByteString',
2819 1
               }
2820 1
2821 1
    def __init__(self, binary=None):
2822 1
        if binary is not None:
2823 1
            self._binary_init(binary)
2824
            self._freeze = True
2825 1
            return
2826
        self.ServerProtocolVersion = 0
2827 1
        self.SecurityToken = ChannelSecurityToken()
2828
        self.ServerNonce = None
2829 1
        self._freeze = True
2830 1
2831 1
    def to_binary(self):
2832 1
        packet = []
2833 1
        packet.append(uabin.Primitives.UInt32.pack(self.ServerProtocolVersion))
2834 1
        packet.append(self.SecurityToken.to_binary())
2835 1
        packet.append(uabin.Primitives.ByteString.pack(self.ServerNonce))
2836 1
        return b''.join(packet)
2837 1
2838
    @staticmethod
2839 1
    def from_binary(data):
2840
        return OpenSecureChannelResult(data)
2841
2842
    def _binary_init(self, data):
2843
        self.ServerProtocolVersion = uabin.Primitives.UInt32.unpack(data)
2844
        self.SecurityToken = ChannelSecurityToken.from_binary(data)
2845
        self.ServerNonce = uabin.Primitives.ByteString.unpack(data)
2846
2847
    def __str__(self):
2848
        return 'OpenSecureChannelResult(' + 'ServerProtocolVersion:' + str(self.ServerProtocolVersion) + ', ' + \
2849 1
               'SecurityToken:' + str(self.SecurityToken) + ', ' + \
2850
               'ServerNonce:' + str(self.ServerNonce) + ')'
2851
2852 1
    __repr__ = __str__
2853
2854
2855
class OpenSecureChannelResponse(FrozenClass):
2856
    '''
2857
    Creates a secure channel with a server.
2858
2859
    :ivar TypeId:
2860
    :vartype TypeId: NodeId
2861
    :ivar ResponseHeader:
2862
    :vartype ResponseHeader: ResponseHeader
2863 1
    :ivar Parameters:
2864 1
    :vartype Parameters: OpenSecureChannelResult
2865
    '''
2866
2867
    ua_types = {
2868 1
        'TypeId': 'NodeId',
2869 1
        'ResponseHeader': 'ResponseHeader',
2870 1
        'Parameters': 'OpenSecureChannelResult',
2871 1
               }
2872
2873 1
    def __init__(self, binary=None):
2874 1
        if binary is not None:
2875 1
            self._binary_init(binary)
2876 1
            self._freeze = True
2877 1
            return
2878 1
        self.TypeId = FourByteNodeId(ObjectIds.OpenSecureChannelResponse_Encoding_DefaultBinary)
2879
        self.ResponseHeader = ResponseHeader()
2880 1
        self.Parameters = OpenSecureChannelResult()
2881
        self._freeze = True
2882
2883
    def to_binary(self):
2884 1
        packet = []
2885
        packet.append(self.TypeId.to_binary())
2886
        packet.append(self.ResponseHeader.to_binary())
2887
        packet.append(self.Parameters.to_binary())
2888
        return b''.join(packet)
2889 1
2890
    @staticmethod
2891
    def from_binary(data):
2892
        return OpenSecureChannelResponse(data)
2893
2894 1
    def _binary_init(self, data):
2895
        self.TypeId = NodeId.from_binary(data)
2896
        self.ResponseHeader = ResponseHeader.from_binary(data)
2897 1
        self.Parameters = OpenSecureChannelResult.from_binary(data)
2898
2899
    def __str__(self):
2900
        return 'OpenSecureChannelResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2901
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
2902
               'Parameters:' + str(self.Parameters) + ')'
2903
2904
    __repr__ = __str__
2905
2906
2907 View Code Duplication
class CloseSecureChannelRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2908
    '''
2909
    Closes a secure channel.
2910
2911
    :ivar TypeId:
2912
    :vartype TypeId: NodeId
2913
    :ivar RequestHeader:
2914
    :vartype RequestHeader: RequestHeader
2915
    '''
2916
2917
    ua_types = {
2918 1
        'TypeId': 'NodeId',
2919 1
        'RequestHeader': 'RequestHeader',
2920 1
               }
2921 1
2922 1
    def __init__(self, binary=None):
2923 1
        if binary is not None:
2924 1
            self._binary_init(binary)
2925 1
            self._freeze = True
2926 1
            return
2927 1
        self.TypeId = FourByteNodeId(ObjectIds.CloseSecureChannelRequest_Encoding_DefaultBinary)
2928 1
        self.RequestHeader = RequestHeader()
2929 1
        self._freeze = True
2930 1
2931 1
    def to_binary(self):
2932 1
        packet = []
2933
        packet.append(self.TypeId.to_binary())
2934 1
        packet.append(self.RequestHeader.to_binary())
2935 1
        return b''.join(packet)
2936 1
2937 1
    @staticmethod
2938 1
    def from_binary(data):
2939 1
        return CloseSecureChannelRequest(data)
2940 1
2941 1
    def _binary_init(self, data):
2942 1
        self.TypeId = NodeId.from_binary(data)
2943 1
        self.RequestHeader = RequestHeader.from_binary(data)
2944 1
2945 1
    def __str__(self):
2946
        return 'CloseSecureChannelRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2947 1
               'RequestHeader:' + str(self.RequestHeader) + ')'
2948 1
2949 1
    __repr__ = __str__
2950
2951 1
2952 View Code Duplication
class CloseSecureChannelResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2953 1
    '''
2954
    Closes a secure channel.
2955 1
2956 1
    :ivar TypeId:
2957 1
    :vartype TypeId: NodeId
2958 1
    :ivar ResponseHeader:
2959 1
    :vartype ResponseHeader: ResponseHeader
2960 1
    '''
2961 1
2962 1
    ua_types = {
2963 1
        'TypeId': 'NodeId',
2964 1
        'ResponseHeader': 'ResponseHeader',
2965 1
               }
2966 1
2967 1
    def __init__(self, binary=None):
2968 1
        if binary is not None:
2969 1
            self._binary_init(binary)
2970 1
            self._freeze = True
2971
            return
2972 1
        self.TypeId = FourByteNodeId(ObjectIds.CloseSecureChannelResponse_Encoding_DefaultBinary)
2973 1
        self.ResponseHeader = ResponseHeader()
2974 1
        self._freeze = True
2975
2976 1
    def to_binary(self):
2977
        packet = []
2978
        packet.append(self.TypeId.to_binary())
2979
        packet.append(self.ResponseHeader.to_binary())
2980
        return b''.join(packet)
2981
2982
    @staticmethod
2983
    def from_binary(data):
2984
        return CloseSecureChannelResponse(data)
2985
2986
    def _binary_init(self, data):
2987 1
        self.TypeId = NodeId.from_binary(data)
2988
        self.ResponseHeader = ResponseHeader.from_binary(data)
2989
2990 1
    def __str__(self):
2991
        return 'CloseSecureChannelResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2992
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
2993
2994
    __repr__ = __str__
2995
2996
2997 View Code Duplication
class SignedSoftwareCertificate(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2998
    '''
2999
    A software certificate with a digital signature.
3000
3001 1
    :ivar CertificateData:
3002 1
    :vartype CertificateData: ByteString
3003 1
    :ivar Signature:
3004 1
    :vartype Signature: ByteString
3005 1
    '''
3006 1
3007 1
    ua_types = {
3008 1
        'CertificateData': 'ByteString',
3009 1
        'Signature': 'ByteString',
3010
               }
3011 1
3012 1
    def __init__(self, binary=None):
3013 1
        if binary is not None:
3014 1
            self._binary_init(binary)
3015 1
            self._freeze = True
3016 1
            return
3017
        self.CertificateData = None
3018 1
        self.Signature = None
3019
        self._freeze = True
3020 1
3021
    def to_binary(self):
3022 1
        packet = []
3023 1
        packet.append(uabin.Primitives.ByteString.pack(self.CertificateData))
3024 1
        packet.append(uabin.Primitives.ByteString.pack(self.Signature))
3025 1
        return b''.join(packet)
3026
3027 1
    @staticmethod
3028
    def from_binary(data):
3029
        return SignedSoftwareCertificate(data)
3030
3031
    def _binary_init(self, data):
3032 1
        self.CertificateData = uabin.Primitives.ByteString.unpack(data)
3033
        self.Signature = uabin.Primitives.ByteString.unpack(data)
3034
3035 1
    def __str__(self):
3036
        return 'SignedSoftwareCertificate(' + 'CertificateData:' + str(self.CertificateData) + ', ' + \
3037
               'Signature:' + str(self.Signature) + ')'
3038
3039
    __repr__ = __str__
3040
3041
3042 1 View Code Duplication
class SignatureData(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3043
    '''
3044
    A digital signature.
3045
3046
    :ivar Algorithm:
3047
    :vartype Algorithm: String
3048
    :ivar Signature:
3049
    :vartype Signature: ByteString
3050 1
    '''
3051
3052
    ua_types = {
3053
        'Algorithm': 'String',
3054
        'Signature': 'ByteString',
3055 1
               }
3056
3057
    def __init__(self, binary=None):
3058
        if binary is not None:
3059 1
            self._binary_init(binary)
3060
            self._freeze = True
3061
            return
3062 1
        self.Algorithm = None
3063
        self.Signature = None
3064
        self._freeze = True
3065 1
3066
    def to_binary(self):
3067
        packet = []
3068 1
        packet.append(uabin.Primitives.String.pack(self.Algorithm))
3069
        packet.append(uabin.Primitives.ByteString.pack(self.Signature))
3070
        return b''.join(packet)
3071
3072
    @staticmethod
3073
    def from_binary(data):
3074
        return SignatureData(data)
3075 1
3076 1
    def _binary_init(self, data):
3077 1
        self.Algorithm = uabin.Primitives.String.unpack(data)
3078 1
        self.Signature = uabin.Primitives.ByteString.unpack(data)
3079 1
3080 1
    def __str__(self):
3081 1
        return 'SignatureData(' + 'Algorithm:' + str(self.Algorithm) + ', ' + \
3082
               'Signature:' + str(self.Signature) + ')'
3083 1
3084 1
    __repr__ = __str__
3085 1
3086 1
3087
class CreateSessionParameters(FrozenClass):
3088 1
    '''
3089
    :ivar ClientDescription:
3090 1
    :vartype ClientDescription: ApplicationDescription
3091
    :ivar ServerUri:
3092 1
    :vartype ServerUri: String
3093 1
    :ivar EndpointUrl:
3094
    :vartype EndpointUrl: String
3095 1
    :ivar SessionName:
3096
    :vartype SessionName: String
3097
    :ivar ClientNonce:
3098 1
    :vartype ClientNonce: ByteString
3099
    :ivar ClientCertificate:
3100
    :vartype ClientCertificate: ByteString
3101 1
    :ivar RequestedSessionTimeout:
3102
    :vartype RequestedSessionTimeout: Double
3103
    :ivar MaxResponseMessageSize:
3104
    :vartype MaxResponseMessageSize: UInt32
3105
    '''
3106
3107
    ua_types = {
3108
        'ClientDescription': 'ApplicationDescription',
3109
        'ServerUri': 'String',
3110
        'EndpointUrl': 'String',
3111
        'SessionName': 'String',
3112
        'ClientNonce': 'ByteString',
3113
        'ClientCertificate': 'ByteString',
3114 1
        'RequestedSessionTimeout': 'Double',
3115 1
        'MaxResponseMessageSize': 'UInt32',
3116 1
               }
3117 1
3118 1
    def __init__(self, binary=None):
3119 1
        if binary is not None:
3120 1
            self._binary_init(binary)
3121 1
            self._freeze = True
3122 1
            return
3123 1
        self.ClientDescription = ApplicationDescription()
3124
        self.ServerUri = None
3125 1
        self.EndpointUrl = None
3126 1
        self.SessionName = None
3127 1
        self.ClientNonce = None
3128 1
        self.ClientCertificate = None
3129 1
        self.RequestedSessionTimeout = 0
3130 1
        self.MaxResponseMessageSize = 0
3131 1
        self._freeze = True
3132
3133 1
    def to_binary(self):
3134
        packet = []
3135 1
        packet.append(self.ClientDescription.to_binary())
3136
        packet.append(uabin.Primitives.String.pack(self.ServerUri))
3137 1
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
3138 1
        packet.append(uabin.Primitives.String.pack(self.SessionName))
3139 1
        packet.append(uabin.Primitives.ByteString.pack(self.ClientNonce))
3140 1
        packet.append(uabin.Primitives.ByteString.pack(self.ClientCertificate))
3141 1
        packet.append(uabin.Primitives.Double.pack(self.RequestedSessionTimeout))
3142
        packet.append(uabin.Primitives.UInt32.pack(self.MaxResponseMessageSize))
3143 1
        return b''.join(packet)
3144
3145
    @staticmethod
3146
    def from_binary(data):
3147
        return CreateSessionParameters(data)
3148
3149 1
    def _binary_init(self, data):
3150
        self.ClientDescription = ApplicationDescription.from_binary(data)
3151
        self.ServerUri = uabin.Primitives.String.unpack(data)
3152 1
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
3153
        self.SessionName = uabin.Primitives.String.unpack(data)
3154
        self.ClientNonce = uabin.Primitives.ByteString.unpack(data)
3155
        self.ClientCertificate = uabin.Primitives.ByteString.unpack(data)
3156
        self.RequestedSessionTimeout = uabin.Primitives.Double.unpack(data)
3157
        self.MaxResponseMessageSize = uabin.Primitives.UInt32.unpack(data)
3158
3159
    def __str__(self):
3160
        return 'CreateSessionParameters(' + 'ClientDescription:' + str(self.ClientDescription) + ', ' + \
3161 1
               'ServerUri:' + str(self.ServerUri) + ', ' + \
3162
               'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
3163
               'SessionName:' + str(self.SessionName) + ', ' + \
3164
               'ClientNonce:' + str(self.ClientNonce) + ', ' + \
3165
               'ClientCertificate:' + str(self.ClientCertificate) + ', ' + \
3166
               'RequestedSessionTimeout:' + str(self.RequestedSessionTimeout) + ', ' + \
3167
               'MaxResponseMessageSize:' + str(self.MaxResponseMessageSize) + ')'
3168
3169
    __repr__ = __str__
3170 1
3171
3172
class CreateSessionRequest(FrozenClass):
3173
    '''
3174
    Creates a new session with the server.
3175
3176 1
    :ivar TypeId:
3177
    :vartype TypeId: NodeId
3178
    :ivar RequestHeader:
3179
    :vartype RequestHeader: RequestHeader
3180 1
    :ivar Parameters:
3181
    :vartype Parameters: CreateSessionParameters
3182
    '''
3183
3184 1
    ua_types = {
3185
        'TypeId': 'NodeId',
3186
        'RequestHeader': 'RequestHeader',
3187
        'Parameters': 'CreateSessionParameters',
3188 1
               }
3189
3190
    def __init__(self, binary=None):
3191 1
        if binary is not None:
3192
            self._binary_init(binary)
3193
            self._freeze = True
3194
            return
3195
        self.TypeId = FourByteNodeId(ObjectIds.CreateSessionRequest_Encoding_DefaultBinary)
3196
        self.RequestHeader = RequestHeader()
3197
        self.Parameters = CreateSessionParameters()
3198 1
        self._freeze = True
3199
3200
    def to_binary(self):
3201
        packet = []
3202
        packet.append(self.TypeId.to_binary())
3203
        packet.append(self.RequestHeader.to_binary())
3204
        packet.append(self.Parameters.to_binary())
3205
        return b''.join(packet)
3206
3207 1
    @staticmethod
3208
    def from_binary(data):
3209
        return CreateSessionRequest(data)
3210
3211
    def _binary_init(self, data):
3212
        self.TypeId = NodeId.from_binary(data)
3213 1
        self.RequestHeader = RequestHeader.from_binary(data)
3214
        self.Parameters = CreateSessionParameters.from_binary(data)
3215
3216
    def __str__(self):
3217 1
        return 'CreateSessionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3218
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
3219
               'Parameters:' + str(self.Parameters) + ')'
3220
3221 1
    __repr__ = __str__
3222
3223
3224
class CreateSessionResult(FrozenClass):
3225 1
    '''
3226
    :ivar SessionId:
3227
    :vartype SessionId: NodeId
3228 1
    :ivar AuthenticationToken:
3229
    :vartype AuthenticationToken: NodeId
3230
    :ivar RevisedSessionTimeout:
3231
    :vartype RevisedSessionTimeout: Double
3232
    :ivar ServerNonce:
3233
    :vartype ServerNonce: ByteString
3234
    :ivar ServerCertificate:
3235
    :vartype ServerCertificate: ByteString
3236
    :ivar ServerEndpoints:
3237
    :vartype ServerEndpoints: EndpointDescription
3238
    :ivar ServerSoftwareCertificates:
3239 1
    :vartype ServerSoftwareCertificates: SignedSoftwareCertificate
3240
    :ivar ServerSignature:
3241
    :vartype ServerSignature: SignatureData
3242
    :ivar MaxRequestMessageSize:
3243
    :vartype MaxRequestMessageSize: UInt32
3244
    '''
3245
3246
    ua_types = {
3247
        'SessionId': 'NodeId',
3248
        'AuthenticationToken': 'NodeId',
3249 1
        'RevisedSessionTimeout': 'Double',
3250
        'ServerNonce': 'ByteString',
3251
        'ServerCertificate': 'ByteString',
3252
        'ServerEndpoints': 'EndpointDescription',
3253
        'ServerSoftwareCertificates': 'SignedSoftwareCertificate',
3254
        'ServerSignature': 'SignatureData',
3255
        'MaxRequestMessageSize': 'UInt32',
3256 1
               }
3257
3258
    def __init__(self, binary=None):
3259
        if binary is not None:
3260 1
            self._binary_init(binary)
3261
            self._freeze = True
3262
            return
3263
        self.SessionId = NodeId()
3264
        self.AuthenticationToken = NodeId()
3265 1
        self.RevisedSessionTimeout = 0
3266
        self.ServerNonce = None
3267
        self.ServerCertificate = None
3268
        self.ServerEndpoints = []
3269
        self.ServerSoftwareCertificates = []
3270 1
        self.ServerSignature = SignatureData()
3271
        self.MaxRequestMessageSize = 0
3272
        self._freeze = True
3273 1
3274
    def to_binary(self):
3275
        packet = []
3276
        packet.append(self.SessionId.to_binary())
3277
        packet.append(self.AuthenticationToken.to_binary())
3278
        packet.append(uabin.Primitives.Double.pack(self.RevisedSessionTimeout))
3279
        packet.append(uabin.Primitives.ByteString.pack(self.ServerNonce))
3280
        packet.append(uabin.Primitives.ByteString.pack(self.ServerCertificate))
3281
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerEndpoints)))
3282
        for fieldname in self.ServerEndpoints:
3283
            packet.append(fieldname.to_binary())
3284
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerSoftwareCertificates)))
3285
        for fieldname in self.ServerSoftwareCertificates:
3286 1
            packet.append(fieldname.to_binary())
3287 1
        packet.append(self.ServerSignature.to_binary())
3288 1
        packet.append(uabin.Primitives.UInt32.pack(self.MaxRequestMessageSize))
3289 1
        return b''.join(packet)
3290 1
3291 1
    @staticmethod
3292 1
    def from_binary(data):
3293 1
        return CreateSessionResult(data)
3294 1
3295 1
    def _binary_init(self, data):
3296 1
        self.SessionId = NodeId.from_binary(data)
3297
        self.AuthenticationToken = NodeId.from_binary(data)
3298 1
        self.RevisedSessionTimeout = uabin.Primitives.Double.unpack(data)
3299 1
        self.ServerNonce = uabin.Primitives.ByteString.unpack(data)
3300 1
        self.ServerCertificate = uabin.Primitives.ByteString.unpack(data)
3301 1
        length = uabin.Primitives.Int32.unpack(data)
3302 1
        array = []
3303
        if length != -1:
3304 1
            for _ in range(0, length):
3305 1
                array.append(EndpointDescription.from_binary(data))
3306 1
        self.ServerEndpoints = array
3307 1
        length = uabin.Primitives.Int32.unpack(data)
3308 1
        array = []
3309 1
        if length != -1:
3310
            for _ in range(0, length):
3311 1
                array.append(SignedSoftwareCertificate.from_binary(data))
3312
        self.ServerSoftwareCertificates = array
3313 1
        self.ServerSignature = SignatureData.from_binary(data)
3314
        self.MaxRequestMessageSize = uabin.Primitives.UInt32.unpack(data)
3315 1
3316 1
    def __str__(self):
3317 1
        return 'CreateSessionResult(' + 'SessionId:' + str(self.SessionId) + ', ' + \
3318 1
               'AuthenticationToken:' + str(self.AuthenticationToken) + ', ' + \
3319 1
               'RevisedSessionTimeout:' + str(self.RevisedSessionTimeout) + ', ' + \
3320 1
               'ServerNonce:' + str(self.ServerNonce) + ', ' + \
3321
               'ServerCertificate:' + str(self.ServerCertificate) + ', ' + \
3322 1
               'ServerEndpoints:' + str(self.ServerEndpoints) + ', ' + \
3323 1
               'ServerSoftwareCertificates:' + str(self.ServerSoftwareCertificates) + ', ' + \
3324 1
               'ServerSignature:' + str(self.ServerSignature) + ', ' + \
3325 1
               'MaxRequestMessageSize:' + str(self.MaxRequestMessageSize) + ')'
3326
3327 1
    __repr__ = __str__
3328
3329
3330
class CreateSessionResponse(FrozenClass):
3331
    '''
3332
    Creates a new session with the server.
3333
3334 1
    :ivar TypeId:
3335
    :vartype TypeId: NodeId
3336
    :ivar ResponseHeader:
3337 1
    :vartype ResponseHeader: ResponseHeader
3338
    :ivar Parameters:
3339
    :vartype Parameters: CreateSessionResult
3340
    '''
3341
3342
    ua_types = {
3343
        'TypeId': 'NodeId',
3344
        'ResponseHeader': 'ResponseHeader',
3345
        'Parameters': 'CreateSessionResult',
3346
               }
3347
3348 1
    def __init__(self, binary=None):
3349 1
        if binary is not None:
3350
            self._binary_init(binary)
3351
            self._freeze = True
3352
            return
3353 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateSessionResponse_Encoding_DefaultBinary)
3354 1
        self.ResponseHeader = ResponseHeader()
3355 1
        self.Parameters = CreateSessionResult()
3356 1
        self._freeze = True
3357
3358 1
    def to_binary(self):
3359 1
        packet = []
3360 1
        packet.append(self.TypeId.to_binary())
3361 1
        packet.append(self.ResponseHeader.to_binary())
3362 1
        packet.append(self.Parameters.to_binary())
3363 1
        return b''.join(packet)
3364
3365 1
    @staticmethod
3366
    def from_binary(data):
3367
        return CreateSessionResponse(data)
3368
3369 1
    def _binary_init(self, data):
3370
        self.TypeId = NodeId.from_binary(data)
3371
        self.ResponseHeader = ResponseHeader.from_binary(data)
3372
        self.Parameters = CreateSessionResult.from_binary(data)
3373
3374 1
    def __str__(self):
3375
        return 'CreateSessionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3376
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
3377
               'Parameters:' + str(self.Parameters) + ')'
3378
3379 1
    __repr__ = __str__
3380
3381
3382 1
class UserIdentityToken(FrozenClass):
3383
    '''
3384
    A base type for a user identity token.
3385
3386
    :ivar PolicyId:
3387
    :vartype PolicyId: String
3388
    '''
3389
3390
    ua_types = {
3391 1
        'PolicyId': 'String',
3392 1
               }
3393 1
3394 1
    def __init__(self, binary=None):
3395 1
        if binary is not None:
3396 1
            self._binary_init(binary)
3397 1
            self._freeze = True
3398 1
            return
3399 1
        self.PolicyId = None
3400
        self._freeze = True
3401 1
3402 1
    def to_binary(self):
3403 1
        packet = []
3404 1
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3405 1
        return b''.join(packet)
3406
3407 1
    @staticmethod
3408 1
    def from_binary(data):
3409
        return UserIdentityToken(data)
3410 1
3411
    def _binary_init(self, data):
3412 1
        self.PolicyId = uabin.Primitives.String.unpack(data)
3413
3414 1
    def __str__(self):
3415
        return 'UserIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ')'
3416 1
3417 1
    __repr__ = __str__
3418 1
3419 1
3420 1
class AnonymousIdentityToken(FrozenClass):
3421 1
    '''
3422
    A token representing an anonymous user.
3423 1
3424 1
    :ivar PolicyId:
3425 1
    :vartype PolicyId: String
3426 1
    '''
3427 1
3428
    ua_types = {
3429 1
        'PolicyId': 'String',
3430
               }
3431 1
3432
    def __init__(self, binary=None):
3433
        if binary is not None:
3434
            self._binary_init(binary)
3435
            self._freeze = True
3436 1
            return
3437
        self.PolicyId = None
3438
        self._freeze = True
3439 1
3440
    def to_binary(self):
3441
        packet = []
3442
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3443
        return b''.join(packet)
3444
3445
    @staticmethod
3446
    def from_binary(data):
3447
        return AnonymousIdentityToken(data)
3448
3449
    def _binary_init(self, data):
3450 1
        self.PolicyId = uabin.Primitives.String.unpack(data)
3451 1
3452 1
    def __str__(self):
3453 1
        return 'AnonymousIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ')'
3454 1
3455 1
    __repr__ = __str__
3456 1
3457 1
3458 1 View Code Duplication
class UserNameIdentityToken(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3459
    '''
3460 1
    A token representing a user identified by a user name and password.
3461 1
3462 1
    :ivar PolicyId:
3463 1
    :vartype PolicyId: String
3464 1
    :ivar UserName:
3465 1
    :vartype UserName: String
3466
    :ivar Password:
3467 1
    :vartype Password: ByteString
3468
    :ivar EncryptionAlgorithm:
3469 1
    :vartype EncryptionAlgorithm: String
3470
    '''
3471 1
3472 1
    ua_types = {
3473 1
        'PolicyId': 'String',
3474 1
        'UserName': 'String',
3475
        'Password': 'ByteString',
3476 1
        'EncryptionAlgorithm': 'String',
3477
               }
3478
3479
    def __init__(self, binary=None):
3480
        if binary is not None:
3481 1
            self._binary_init(binary)
3482
            self._freeze = True
3483
            return
3484 1
        self.PolicyId = None
3485
        self.UserName = None
3486
        self.Password = None
3487
        self.EncryptionAlgorithm = None
3488
        self._freeze = True
3489
3490
    def to_binary(self):
3491
        packet = []
3492
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3493
        packet.append(uabin.Primitives.String.pack(self.UserName))
3494
        packet.append(uabin.Primitives.ByteString.pack(self.Password))
3495 1
        packet.append(uabin.Primitives.String.pack(self.EncryptionAlgorithm))
3496 1
        return b''.join(packet)
3497
3498
    @staticmethod
3499
    def from_binary(data):
3500 1
        return UserNameIdentityToken(data)
3501 1
3502 1
    def _binary_init(self, data):
3503 1
        self.PolicyId = uabin.Primitives.String.unpack(data)
3504
        self.UserName = uabin.Primitives.String.unpack(data)
3505 1
        self.Password = uabin.Primitives.ByteString.unpack(data)
3506 1
        self.EncryptionAlgorithm = uabin.Primitives.String.unpack(data)
3507 1
3508 1
    def __str__(self):
3509 1
        return 'UserNameIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3510 1
               'UserName:' + str(self.UserName) + ', ' + \
3511
               'Password:' + str(self.Password) + ', ' + \
3512 1
               'EncryptionAlgorithm:' + str(self.EncryptionAlgorithm) + ')'
3513
3514
    __repr__ = __str__
3515
3516 1
3517 View Code Duplication
class X509IdentityToken(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3518
    '''
3519
    A token representing a user identified by an X509 certificate.
3520
3521 1
    :ivar PolicyId:
3522
    :vartype PolicyId: String
3523
    :ivar CertificateData:
3524
    :vartype CertificateData: ByteString
3525
    '''
3526 1
3527
    ua_types = {
3528
        'PolicyId': 'String',
3529 1
        'CertificateData': 'ByteString',
3530
               }
3531
3532
    def __init__(self, binary=None):
3533
        if binary is not None:
3534
            self._binary_init(binary)
3535
            self._freeze = True
3536
            return
3537
        self.PolicyId = None
3538 1
        self.CertificateData = None
3539 1
        self._freeze = True
3540 1
3541 1
    def to_binary(self):
3542 1
        packet = []
3543 1
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3544 1
        packet.append(uabin.Primitives.ByteString.pack(self.CertificateData))
3545 1
        return b''.join(packet)
3546
3547 1
    @staticmethod
3548 1
    def from_binary(data):
3549 1
        return X509IdentityToken(data)
3550 1
3551 1
    def _binary_init(self, data):
3552
        self.PolicyId = uabin.Primitives.String.unpack(data)
3553 1
        self.CertificateData = uabin.Primitives.ByteString.unpack(data)
3554
3555 1
    def __str__(self):
3556
        return 'X509IdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3557 1
               'CertificateData:' + str(self.CertificateData) + ')'
3558 1
3559 1
    __repr__ = __str__
3560
3561 1
3562 View Code Duplication
class KerberosIdentityToken(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3563
    '''
3564
    :ivar PolicyId:
3565 1
    :vartype PolicyId: String
3566
    :ivar TicketData:
3567
    :vartype TicketData: ByteString
3568 1
    '''
3569
3570
    ua_types = {
3571
        'PolicyId': 'String',
3572
        'TicketData': 'ByteString',
3573 1
               }
3574
3575
    def __init__(self, binary=None):
3576
        if binary is not None:
3577
            self._binary_init(binary)
3578
            self._freeze = True
3579
            return
3580
        self.PolicyId = None
3581 1
        self.TicketData = None
3582
        self._freeze = True
3583
3584
    def to_binary(self):
3585
        packet = []
3586 1
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3587
        packet.append(uabin.Primitives.ByteString.pack(self.TicketData))
3588
        return b''.join(packet)
3589
3590 1
    @staticmethod
3591
    def from_binary(data):
3592
        return KerberosIdentityToken(data)
3593 1
3594
    def _binary_init(self, data):
3595
        self.PolicyId = uabin.Primitives.String.unpack(data)
3596 1
        self.TicketData = uabin.Primitives.ByteString.unpack(data)
3597
3598
    def __str__(self):
3599 1
        return 'KerberosIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3600
               'TicketData:' + str(self.TicketData) + ')'
3601
3602
    __repr__ = __str__
3603
3604
3605
class IssuedIdentityToken(FrozenClass):
3606
    '''
3607
    A token representing a user identified by a WS-Security XML token.
3608
3609
    :ivar PolicyId:
3610 1
    :vartype PolicyId: String
3611
    :ivar TokenData:
3612
    :vartype TokenData: ByteString
3613
    :ivar EncryptionAlgorithm:
3614
    :vartype EncryptionAlgorithm: String
3615
    '''
3616
3617
    ua_types = {
3618
        'PolicyId': 'String',
3619
        'TokenData': 'ByteString',
3620 1
        'EncryptionAlgorithm': 'String',
3621
               }
3622
3623
    def __init__(self, binary=None):
3624
        if binary is not None:
3625
            self._binary_init(binary)
3626
            self._freeze = True
3627 1
            return
3628
        self.PolicyId = None
3629
        self.TokenData = None
3630
        self.EncryptionAlgorithm = None
3631 1
        self._freeze = True
3632
3633
    def to_binary(self):
3634
        packet = []
3635
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3636 1
        packet.append(uabin.Primitives.ByteString.pack(self.TokenData))
3637
        packet.append(uabin.Primitives.String.pack(self.EncryptionAlgorithm))
3638
        return b''.join(packet)
3639
3640
    @staticmethod
3641 1
    def from_binary(data):
3642
        return IssuedIdentityToken(data)
3643
3644 1
    def _binary_init(self, data):
3645
        self.PolicyId = uabin.Primitives.String.unpack(data)
3646
        self.TokenData = uabin.Primitives.ByteString.unpack(data)
3647
        self.EncryptionAlgorithm = uabin.Primitives.String.unpack(data)
3648
3649 1
    def __str__(self):
3650
        return 'IssuedIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3651
               'TokenData:' + str(self.TokenData) + ', ' + \
3652
               'EncryptionAlgorithm:' + str(self.EncryptionAlgorithm) + ')'
3653
3654
    __repr__ = __str__
3655
3656
3657 1 View Code Duplication
class ActivateSessionParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3658
    '''
3659
    :ivar ClientSignature:
3660
    :vartype ClientSignature: SignatureData
3661
    :ivar ClientSoftwareCertificates:
3662 1
    :vartype ClientSoftwareCertificates: SignedSoftwareCertificate
3663
    :ivar LocaleIds:
3664
    :vartype LocaleIds: String
3665
    :ivar UserIdentityToken:
3666 1
    :vartype UserIdentityToken: ExtensionObject
3667
    :ivar UserTokenSignature:
3668
    :vartype UserTokenSignature: SignatureData
3669 1
    '''
3670
3671
    ua_types = {
3672 1
        'ClientSignature': 'SignatureData',
3673
        'ClientSoftwareCertificates': 'SignedSoftwareCertificate',
3674
        'LocaleIds': 'String',
3675 1
        'UserIdentityToken': 'ExtensionObject',
3676
        'UserTokenSignature': 'SignatureData',
3677
               }
3678
3679
    def __init__(self, binary=None):
3680
        if binary is not None:
3681
            self._binary_init(binary)
3682
            self._freeze = True
3683
            return
3684
        self.ClientSignature = SignatureData()
3685
        self.ClientSoftwareCertificates = []
3686 1
        self.LocaleIds = []
3687
        self.UserIdentityToken = None
3688
        self.UserTokenSignature = SignatureData()
3689
        self._freeze = True
3690
3691
    def to_binary(self):
3692
        packet = []
3693
        packet.append(self.ClientSignature.to_binary())
3694
        packet.append(uabin.Primitives.Int32.pack(len(self.ClientSoftwareCertificates)))
3695
        for fieldname in self.ClientSoftwareCertificates:
3696 1
            packet.append(fieldname.to_binary())
3697
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
3698
        for fieldname in self.LocaleIds:
3699
            packet.append(uabin.Primitives.String.pack(fieldname))
3700
        packet.append(extensionobject_to_binary(self.UserIdentityToken))
3701
        packet.append(self.UserTokenSignature.to_binary())
3702
        return b''.join(packet)
3703 1
3704
    @staticmethod
3705
    def from_binary(data):
3706
        return ActivateSessionParameters(data)
3707 1
3708
    def _binary_init(self, data):
3709
        self.ClientSignature = SignatureData.from_binary(data)
3710
        length = uabin.Primitives.Int32.unpack(data)
3711
        array = []
3712 1
        if length != -1:
3713
            for _ in range(0, length):
3714
                array.append(SignedSoftwareCertificate.from_binary(data))
3715
        self.ClientSoftwareCertificates = array
3716
        self.LocaleIds = uabin.Primitives.String.unpack_array(data)
3717 1
        self.UserIdentityToken = extensionobject_from_binary(data)
3718
        self.UserTokenSignature = SignatureData.from_binary(data)
3719
3720 1
    def __str__(self):
3721
        return 'ActivateSessionParameters(' + 'ClientSignature:' + str(self.ClientSignature) + ', ' + \
3722
               'ClientSoftwareCertificates:' + str(self.ClientSoftwareCertificates) + ', ' + \
3723
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
3724
               'UserIdentityToken:' + str(self.UserIdentityToken) + ', ' + \
3725
               'UserTokenSignature:' + str(self.UserTokenSignature) + ')'
3726
3727
    __repr__ = __str__
3728
3729
3730
class ActivateSessionRequest(FrozenClass):
3731
    '''
3732
    Activates a session with the server.
3733
3734
    :ivar TypeId:
3735 1
    :vartype TypeId: NodeId
3736
    :ivar RequestHeader:
3737
    :vartype RequestHeader: RequestHeader
3738
    :ivar Parameters:
3739
    :vartype Parameters: ActivateSessionParameters
3740
    '''
3741
3742
    ua_types = {
3743
        'TypeId': 'NodeId',
3744
        'RequestHeader': 'RequestHeader',
3745
        'Parameters': 'ActivateSessionParameters',
3746
               }
3747 1
3748
    def __init__(self, binary=None):
3749
        if binary is not None:
3750
            self._binary_init(binary)
3751
            self._freeze = True
3752
            return
3753
        self.TypeId = FourByteNodeId(ObjectIds.ActivateSessionRequest_Encoding_DefaultBinary)
3754
        self.RequestHeader = RequestHeader()
3755
        self.Parameters = ActivateSessionParameters()
3756 1
        self._freeze = True
3757
3758
    def to_binary(self):
3759
        packet = []
3760 1
        packet.append(self.TypeId.to_binary())
3761
        packet.append(self.RequestHeader.to_binary())
3762
        packet.append(self.Parameters.to_binary())
3763
        return b''.join(packet)
3764
3765
    @staticmethod
3766
    def from_binary(data):
3767 1
        return ActivateSessionRequest(data)
3768
3769
    def _binary_init(self, data):
3770
        self.TypeId = NodeId.from_binary(data)
3771
        self.RequestHeader = RequestHeader.from_binary(data)
3772
        self.Parameters = ActivateSessionParameters.from_binary(data)
3773
3774 1
    def __str__(self):
3775
        return 'ActivateSessionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3776
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
3777 1
               'Parameters:' + str(self.Parameters) + ')'
3778
3779
    __repr__ = __str__
3780
3781
3782 View Code Duplication
class ActivateSessionResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3783
    '''
3784
    :ivar ServerNonce:
3785
    :vartype ServerNonce: ByteString
3786
    :ivar Results:
3787
    :vartype Results: StatusCode
3788
    :ivar DiagnosticInfos:
3789
    :vartype DiagnosticInfos: DiagnosticInfo
3790
    '''
3791
3792
    ua_types = {
3793
        'ServerNonce': 'ByteString',
3794 1
        'Results': 'StatusCode',
3795 1
        'DiagnosticInfos': 'DiagnosticInfo',
3796 1
               }
3797 1
3798 1
    def __init__(self, binary=None):
3799 1
        if binary is not None:
3800 1
            self._binary_init(binary)
3801 1
            self._freeze = True
3802 1
            return
3803 1
        self.ServerNonce = None
3804 1
        self.Results = []
3805 1
        self.DiagnosticInfos = []
3806
        self._freeze = True
3807 1
3808 1
    def to_binary(self):
3809 1
        packet = []
3810 1
        packet.append(uabin.Primitives.ByteString.pack(self.ServerNonce))
3811 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
3812 1
        for fieldname in self.Results:
3813 1
            packet.append(fieldname.to_binary())
3814 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
3815 1
        for fieldname in self.DiagnosticInfos:
3816
            packet.append(fieldname.to_binary())
3817 1
        return b''.join(packet)
3818
3819 1
    @staticmethod
3820
    def from_binary(data):
3821 1
        return ActivateSessionResult(data)
3822 1
3823 1
    def _binary_init(self, data):
3824 1
        self.ServerNonce = uabin.Primitives.ByteString.unpack(data)
3825 1
        length = uabin.Primitives.Int32.unpack(data)
3826 1
        array = []
3827 1
        if length != -1:
3828
            for _ in range(0, length):
3829 1
                array.append(StatusCode.from_binary(data))
3830
        self.Results = array
3831
        length = uabin.Primitives.Int32.unpack(data)
3832
        array = []
3833
        if length != -1:
3834
            for _ in range(0, length):
3835
                array.append(DiagnosticInfo.from_binary(data))
3836
        self.DiagnosticInfos = array
3837 1
3838
    def __str__(self):
3839
        return 'ActivateSessionResult(' + 'ServerNonce:' + str(self.ServerNonce) + ', ' + \
3840 1
               'Results:' + str(self.Results) + ', ' + \
3841
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
3842
3843
    __repr__ = __str__
3844
3845
3846
class ActivateSessionResponse(FrozenClass):
3847
    '''
3848
    Activates a session with the server.
3849
3850
    :ivar TypeId:
3851
    :vartype TypeId: NodeId
3852
    :ivar ResponseHeader:
3853
    :vartype ResponseHeader: ResponseHeader
3854
    :ivar Parameters:
3855
    :vartype Parameters: ActivateSessionResult
3856
    '''
3857
3858
    ua_types = {
3859
        'TypeId': 'NodeId',
3860
        'ResponseHeader': 'ResponseHeader',
3861
        'Parameters': 'ActivateSessionResult',
3862
               }
3863
3864
    def __init__(self, binary=None):
3865
        if binary is not None:
3866
            self._binary_init(binary)
3867
            self._freeze = True
3868
            return
3869
        self.TypeId = FourByteNodeId(ObjectIds.ActivateSessionResponse_Encoding_DefaultBinary)
3870
        self.ResponseHeader = ResponseHeader()
3871 1
        self.Parameters = ActivateSessionResult()
3872 1
        self._freeze = True
3873 1
3874 1
    def to_binary(self):
3875 1
        packet = []
3876 1
        packet.append(self.TypeId.to_binary())
3877 1
        packet.append(self.ResponseHeader.to_binary())
3878 1
        packet.append(self.Parameters.to_binary())
3879 1
        return b''.join(packet)
3880 1
3881 1
    @staticmethod
3882 1
    def from_binary(data):
3883 1
        return ActivateSessionResponse(data)
3884 1
3885 1
    def _binary_init(self, data):
3886 1
        self.TypeId = NodeId.from_binary(data)
3887 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
3888 1
        self.Parameters = ActivateSessionResult.from_binary(data)
3889 1
3890
    def __str__(self):
3891 1
        return 'ActivateSessionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3892 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
3893 1
               'Parameters:' + str(self.Parameters) + ')'
3894 1
3895 1
    __repr__ = __str__
3896 1
3897 1
3898 1
class CloseSessionRequest(FrozenClass):
3899 1
    '''
3900 1
    Closes a session with the server.
3901 1
3902 1
    :ivar TypeId:
3903
    :vartype TypeId: NodeId
3904 1
    :ivar RequestHeader:
3905 1
    :vartype RequestHeader: RequestHeader
3906 1
    :ivar DeleteSubscriptions:
3907 1
    :vartype DeleteSubscriptions: Boolean
3908 1
    '''
3909
3910 1
    ua_types = {
3911
        'TypeId': 'NodeId',
3912 1
        'RequestHeader': 'RequestHeader',
3913
        'DeleteSubscriptions': 'Boolean',
3914 1
               }
3915 1
3916 1
    def __init__(self, binary=None):
3917 1
        if binary is not None:
3918 1
            self._binary_init(binary)
3919 1
            self._freeze = True
3920 1
            return
3921 1
        self.TypeId = FourByteNodeId(ObjectIds.CloseSessionRequest_Encoding_DefaultBinary)
3922 1
        self.RequestHeader = RequestHeader()
3923 1
        self.DeleteSubscriptions = True
3924 1
        self._freeze = True
3925 1
3926 1
    def to_binary(self):
3927 1
        packet = []
3928
        packet.append(self.TypeId.to_binary())
3929 1
        packet.append(self.RequestHeader.to_binary())
3930
        packet.append(uabin.Primitives.Boolean.pack(self.DeleteSubscriptions))
3931
        return b''.join(packet)
3932
3933
    @staticmethod
3934
    def from_binary(data):
3935
        return CloseSessionRequest(data)
3936
3937
    def _binary_init(self, data):
3938
        self.TypeId = NodeId.from_binary(data)
3939
        self.RequestHeader = RequestHeader.from_binary(data)
3940
        self.DeleteSubscriptions = uabin.Primitives.Boolean.unpack(data)
3941
3942
    def __str__(self):
3943
        return 'CloseSessionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3944 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
3945
               'DeleteSubscriptions:' + str(self.DeleteSubscriptions) + ')'
3946
3947 1
    __repr__ = __str__
3948
3949
3950 View Code Duplication
class CloseSessionResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3951
    '''
3952
    Closes a session with the server.
3953
3954
    :ivar TypeId:
3955
    :vartype TypeId: NodeId
3956
    :ivar ResponseHeader:
3957
    :vartype ResponseHeader: ResponseHeader
3958
    '''
3959
3960
    ua_types = {
3961
        'TypeId': 'NodeId',
3962
        'ResponseHeader': 'ResponseHeader',
3963
               }
3964
3965
    def __init__(self, binary=None):
3966 1
        if binary is not None:
3967 1
            self._binary_init(binary)
3968
            self._freeze = True
3969
            return
3970
        self.TypeId = FourByteNodeId(ObjectIds.CloseSessionResponse_Encoding_DefaultBinary)
3971 1
        self.ResponseHeader = ResponseHeader()
3972 1
        self._freeze = True
3973 1
3974 1
    def to_binary(self):
3975 1
        packet = []
3976 1
        packet.append(self.TypeId.to_binary())
3977 1
        packet.append(self.ResponseHeader.to_binary())
3978 1
        return b''.join(packet)
3979
3980 1
    @staticmethod
3981
    def from_binary(data):
3982
        return CloseSessionResponse(data)
3983
3984
    def _binary_init(self, data):
3985
        self.TypeId = NodeId.from_binary(data)
3986
        self.ResponseHeader = ResponseHeader.from_binary(data)
3987
3988
    def __str__(self):
3989
        return 'CloseSessionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3990
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
3991 1
3992
    __repr__ = __str__
3993
3994
3995 1
class CancelParameters(FrozenClass):
3996
    '''
3997
    :ivar RequestHandle:
3998
    :vartype RequestHandle: UInt32
3999
    '''
4000
4001
    ua_types = {
4002
        'RequestHandle': 'UInt32',
4003
               }
4004 1
4005
    def __init__(self, binary=None):
4006
        if binary is not None:
4007
            self._binary_init(binary)
4008
            self._freeze = True
4009
            return
4010
        self.RequestHandle = 0
4011
        self._freeze = True
4012
4013 1
    def to_binary(self):
4014
        packet = []
4015
        packet.append(uabin.Primitives.UInt32.pack(self.RequestHandle))
4016 1
        return b''.join(packet)
4017
4018
    @staticmethod
4019
    def from_binary(data):
4020
        return CancelParameters(data)
4021
4022
    def _binary_init(self, data):
4023
        self.RequestHandle = uabin.Primitives.UInt32.unpack(data)
4024
4025
    def __str__(self):
4026
        return 'CancelParameters(' + 'RequestHandle:' + str(self.RequestHandle) + ')'
4027
4028
    __repr__ = __str__
4029
4030
4031
class CancelRequest(FrozenClass):
4032
    '''
4033 1
    Cancels an outstanding request.
4034 1
4035
    :ivar TypeId:
4036
    :vartype TypeId: NodeId
4037
    :ivar RequestHeader:
4038 1
    :vartype RequestHeader: RequestHeader
4039 1
    :ivar Parameters:
4040 1
    :vartype Parameters: CancelParameters
4041 1
    '''
4042 1
4043 1
    ua_types = {
4044 1
        'TypeId': 'NodeId',
4045
        'RequestHeader': 'RequestHeader',
4046 1
        'Parameters': 'CancelParameters',
4047
               }
4048
4049
    def __init__(self, binary=None):
4050
        if binary is not None:
4051
            self._binary_init(binary)
4052
            self._freeze = True
4053
            return
4054
        self.TypeId = FourByteNodeId(ObjectIds.CancelRequest_Encoding_DefaultBinary)
4055
        self.RequestHeader = RequestHeader()
4056 1
        self.Parameters = CancelParameters()
4057
        self._freeze = True
4058
4059
    def to_binary(self):
4060 1
        packet = []
4061
        packet.append(self.TypeId.to_binary())
4062
        packet.append(self.RequestHeader.to_binary())
4063
        packet.append(self.Parameters.to_binary())
4064
        return b''.join(packet)
4065
4066
    @staticmethod
4067
    def from_binary(data):
4068 1
        return CancelRequest(data)
4069
4070
    def _binary_init(self, data):
4071
        self.TypeId = NodeId.from_binary(data)
4072
        self.RequestHeader = RequestHeader.from_binary(data)
4073
        self.Parameters = CancelParameters.from_binary(data)
4074
4075
    def __str__(self):
4076 1
        return 'CancelRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
4077
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
4078
               'Parameters:' + str(self.Parameters) + ')'
4079 1
4080
    __repr__ = __str__
4081
4082
4083
class CancelResult(FrozenClass):
4084
    '''
4085
    :ivar CancelCount:
4086
    :vartype CancelCount: UInt32
4087
    '''
4088
4089
    ua_types = {
4090
        'CancelCount': 'UInt32',
4091
               }
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.CancelCount = 0
4099
        self._freeze = True
4100
4101
    def to_binary(self):
4102
        packet = []
4103
        packet.append(uabin.Primitives.UInt32.pack(self.CancelCount))
4104 1 View Code Duplication
        return b''.join(packet)
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4105 1
4106
    @staticmethod
4107
    def from_binary(data):
4108
        return CancelResult(data)
4109 1
4110 1
    def _binary_init(self, data):
4111 1
        self.CancelCount = uabin.Primitives.UInt32.unpack(data)
4112 1
4113 1
    def __str__(self):
4114 1
        return 'CancelResult(' + 'CancelCount:' + str(self.CancelCount) + ')'
4115 1
4116 1
    __repr__ = __str__
4117 1
4118 1
4119 1
class CancelResponse(FrozenClass):
4120
    '''
4121 1
    Cancels an outstanding request.
4122
4123
    :ivar TypeId:
4124
    :vartype TypeId: NodeId
4125
    :ivar ResponseHeader:
4126
    :vartype ResponseHeader: ResponseHeader
4127
    :ivar Parameters:
4128
    :vartype Parameters: CancelResult
4129
    '''
4130
4131
    ua_types = {
4132
        'TypeId': 'NodeId',
4133
        'ResponseHeader': 'ResponseHeader',
4134
        'Parameters': 'CancelResult',
4135
               }
4136
4137 1
    def __init__(self, binary=None):
4138
        if binary is not None:
4139
            self._binary_init(binary)
4140
            self._freeze = True
4141 1
            return
4142
        self.TypeId = FourByteNodeId(ObjectIds.CancelResponse_Encoding_DefaultBinary)
4143
        self.ResponseHeader = ResponseHeader()
4144
        self.Parameters = CancelResult()
4145
        self._freeze = True
4146
4147
    def to_binary(self):
4148
        packet = []
4149
        packet.append(self.TypeId.to_binary())
4150
        packet.append(self.ResponseHeader.to_binary())
4151
        packet.append(self.Parameters.to_binary())
4152
        return b''.join(packet)
4153 1
4154
    @staticmethod
4155
    def from_binary(data):
4156
        return CancelResponse(data)
4157
4158
    def _binary_init(self, data):
4159
        self.TypeId = NodeId.from_binary(data)
4160
        self.ResponseHeader = ResponseHeader.from_binary(data)
4161
        self.Parameters = CancelResult.from_binary(data)
4162
4163
    def __str__(self):
4164
        return 'CancelResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
4165 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
4166
               'Parameters:' + str(self.Parameters) + ')'
4167
4168 1
    __repr__ = __str__
4169
4170
4171
class NodeAttributes(FrozenClass):
4172
    '''
4173
    The base attributes for all nodes.
4174
4175
    :ivar SpecifiedAttributes:
4176
    :vartype SpecifiedAttributes: UInt32
4177
    :ivar DisplayName:
4178
    :vartype DisplayName: LocalizedText
4179
    :ivar Description:
4180
    :vartype Description: LocalizedText
4181
    :ivar WriteMask:
4182
    :vartype WriteMask: UInt32
4183
    :ivar UserWriteMask:
4184
    :vartype UserWriteMask: UInt32
4185
    '''
4186
4187
    ua_types = {
4188
        'SpecifiedAttributes': 'UInt32',
4189 1 View Code Duplication
        'DisplayName': 'LocalizedText',
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4190 1
        'Description': 'LocalizedText',
4191
        'WriteMask': 'UInt32',
4192
        'UserWriteMask': 'UInt32',
4193
               }
4194 1
4195 1
    def __init__(self, binary=None):
4196 1
        if binary is not None:
4197 1
            self._binary_init(binary)
4198 1
            self._freeze = True
4199 1
            return
4200 1
        self.SpecifiedAttributes = 0
4201 1
        self.DisplayName = LocalizedText()
4202 1
        self.Description = LocalizedText()
4203
        self.WriteMask = 0
4204 1
        self.UserWriteMask = 0
4205
        self._freeze = True
4206
4207
    def to_binary(self):
4208
        packet = []
4209
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4210
        packet.append(self.DisplayName.to_binary())
4211
        packet.append(self.Description.to_binary())
4212
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4213
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4214
        return b''.join(packet)
4215
4216 1
    @staticmethod
4217
    def from_binary(data):
4218
        return NodeAttributes(data)
4219
4220 1
    def _binary_init(self, data):
4221
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4222
        self.DisplayName = LocalizedText.from_binary(data)
4223
        self.Description = LocalizedText.from_binary(data)
4224
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4225
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4226
4227
    def __str__(self):
4228
        return 'NodeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4229
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4230 1
               'Description:' + str(self.Description) + ', ' + \
4231
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4232
               'UserWriteMask:' + str(self.UserWriteMask) + ')'
4233
4234
    __repr__ = __str__
4235
4236
4237 View Code Duplication
class ObjectAttributes(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4238
    '''
4239
    The attributes for an object node.
4240 1
4241
    :ivar SpecifiedAttributes:
4242
    :vartype SpecifiedAttributes: UInt32
4243 1
    :ivar DisplayName:
4244
    :vartype DisplayName: LocalizedText
4245
    :ivar Description:
4246
    :vartype Description: LocalizedText
4247
    :ivar WriteMask:
4248
    :vartype WriteMask: UInt32
4249
    :ivar UserWriteMask:
4250
    :vartype UserWriteMask: UInt32
4251
    :ivar EventNotifier:
4252
    :vartype EventNotifier: Byte
4253
    '''
4254
4255
    ua_types = {
4256
        'SpecifiedAttributes': 'UInt32',
4257
        'DisplayName': 'LocalizedText',
4258
        'Description': 'LocalizedText',
4259
        'WriteMask': 'UInt32',
4260 1
        'UserWriteMask': 'UInt32',
4261 1
        'EventNotifier': 'Byte',
4262
               }
4263
4264
    def __init__(self, binary=None):
4265 1
        if binary is not None:
4266 1
            self._binary_init(binary)
4267 1
            self._freeze = True
4268 1
            return
4269 1
        self.SpecifiedAttributes = 0
4270 1
        self.DisplayName = LocalizedText()
4271 1
        self.Description = LocalizedText()
4272
        self.WriteMask = 0
4273 1
        self.UserWriteMask = 0
4274
        self.EventNotifier = 0
4275
        self._freeze = True
4276
4277
    def to_binary(self):
4278
        packet = []
4279
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4280
        packet.append(self.DisplayName.to_binary())
4281
        packet.append(self.Description.to_binary())
4282
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4283 1
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4284
        packet.append(uabin.Primitives.Byte.pack(self.EventNotifier))
4285
        return b''.join(packet)
4286
4287 1
    @staticmethod
4288
    def from_binary(data):
4289
        return ObjectAttributes(data)
4290
4291
    def _binary_init(self, data):
4292
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4293
        self.DisplayName = LocalizedText.from_binary(data)
4294
        self.Description = LocalizedText.from_binary(data)
4295 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4296
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4297
        self.EventNotifier = uabin.Primitives.Byte.unpack(data)
4298
4299
    def __str__(self):
4300
        return 'ObjectAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4301
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4302
               'Description:' + str(self.Description) + ', ' + \
4303 1
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4304
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4305
               'EventNotifier:' + str(self.EventNotifier) + ')'
4306 1
4307
    __repr__ = __str__
4308
4309
4310
class VariableAttributes(FrozenClass):
4311
    '''
4312
    The attributes for a variable node.
4313
4314
    :ivar SpecifiedAttributes:
4315
    :vartype SpecifiedAttributes: UInt32
4316
    :ivar DisplayName:
4317
    :vartype DisplayName: LocalizedText
4318
    :ivar Description:
4319
    :vartype Description: LocalizedText
4320
    :ivar WriteMask:
4321
    :vartype WriteMask: UInt32
4322
    :ivar UserWriteMask:
4323
    :vartype UserWriteMask: UInt32
4324
    :ivar Value:
4325 1
    :vartype Value: Variant
4326
    :ivar DataType:
4327
    :vartype DataType: NodeId
4328
    :ivar ValueRank:
4329
    :vartype ValueRank: Int32
4330
    :ivar ArrayDimensions:
4331
    :vartype ArrayDimensions: UInt32
4332
    :ivar AccessLevel:
4333
    :vartype AccessLevel: Byte
4334
    :ivar UserAccessLevel:
4335
    :vartype UserAccessLevel: Byte
4336
    :ivar MinimumSamplingInterval:
4337
    :vartype MinimumSamplingInterval: Double
4338
    :ivar Historizing:
4339 1
    :vartype Historizing: Boolean
4340
    '''
4341
4342
    ua_types = {
4343
        'SpecifiedAttributes': 'UInt32',
4344
        'DisplayName': 'LocalizedText',
4345
        'Description': 'LocalizedText',
4346
        'WriteMask': 'UInt32',
4347
        'UserWriteMask': 'UInt32',
4348
        'Value': 'Variant',
4349
        'DataType': 'NodeId',
4350 1
        'ValueRank': 'Int32',
4351
        'ArrayDimensions': 'UInt32',
4352
        'AccessLevel': 'Byte',
4353
        'UserAccessLevel': 'Byte',
4354 1
        'MinimumSamplingInterval': 'Double',
4355
        'Historizing': 'Boolean',
4356
               }
4357
4358
    def __init__(self, binary=None):
4359
        if binary is not None:
4360
            self._binary_init(binary)
4361
            self._freeze = True
4362
            return
4363 1
        self.SpecifiedAttributes = 0
4364
        self.DisplayName = LocalizedText()
4365
        self.Description = LocalizedText()
4366
        self.WriteMask = 0
4367
        self.UserWriteMask = 0
4368
        self.Value = Variant()
4369
        self.DataType = NodeId()
4370
        self.ValueRank = 0
4371
        self.ArrayDimensions = []
4372 1
        self.AccessLevel = 0
4373
        self.UserAccessLevel = 0
4374
        self.MinimumSamplingInterval = 0
4375 1
        self.Historizing = True
4376
        self._freeze = True
4377
4378
    def to_binary(self):
4379
        packet = []
4380
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4381
        packet.append(self.DisplayName.to_binary())
4382
        packet.append(self.Description.to_binary())
4383
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4384
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4385
        packet.append(self.Value.to_binary())
4386
        packet.append(self.DataType.to_binary())
4387
        packet.append(uabin.Primitives.Int32.pack(self.ValueRank))
4388
        packet.append(uabin.Primitives.Int32.pack(len(self.ArrayDimensions)))
4389
        for fieldname in self.ArrayDimensions:
4390
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
4391
        packet.append(uabin.Primitives.Byte.pack(self.AccessLevel))
4392
        packet.append(uabin.Primitives.Byte.pack(self.UserAccessLevel))
4393
        packet.append(uabin.Primitives.Double.pack(self.MinimumSamplingInterval))
4394 1
        packet.append(uabin.Primitives.Boolean.pack(self.Historizing))
4395 1
        return b''.join(packet)
4396 1
4397 1
    @staticmethod
4398 1
    def from_binary(data):
4399 1
        return VariableAttributes(data)
4400 1
4401 1
    def _binary_init(self, data):
4402 1
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4403 1
        self.DisplayName = LocalizedText.from_binary(data)
4404 1
        self.Description = LocalizedText.from_binary(data)
4405 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4406 1
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4407
        self.Value = Variant.from_binary(data)
4408 1
        self.DataType = NodeId.from_binary(data)
4409 1
        self.ValueRank = uabin.Primitives.Int32.unpack(data)
4410 1
        self.ArrayDimensions = uabin.Primitives.UInt32.unpack_array(data)
4411 1
        self.AccessLevel = uabin.Primitives.Byte.unpack(data)
4412 1
        self.UserAccessLevel = uabin.Primitives.Byte.unpack(data)
4413 1
        self.MinimumSamplingInterval = uabin.Primitives.Double.unpack(data)
4414 1
        self.Historizing = uabin.Primitives.Boolean.unpack(data)
4415 1
4416 1
    def __str__(self):
4417 1
        return 'VariableAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4418
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4419 1
               'Description:' + str(self.Description) + ', ' + \
4420
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4421 1
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4422
               'Value:' + str(self.Value) + ', ' + \
4423 1
               'DataType:' + str(self.DataType) + ', ' + \
4424 1
               'ValueRank:' + str(self.ValueRank) + ', ' + \
4425 1
               'ArrayDimensions:' + str(self.ArrayDimensions) + ', ' + \
4426 1
               'AccessLevel:' + str(self.AccessLevel) + ', ' + \
4427 1
               'UserAccessLevel:' + str(self.UserAccessLevel) + ', ' + \
4428 1
               'MinimumSamplingInterval:' + str(self.MinimumSamplingInterval) + ', ' + \
4429 1
               'Historizing:' + str(self.Historizing) + ')'
4430 1
4431
    __repr__ = __str__
4432 1
4433
4434 View Code Duplication
class MethodAttributes(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4435
    '''
4436
    The attributes for a method node.
4437
4438
    :ivar SpecifiedAttributes:
4439
    :vartype SpecifiedAttributes: UInt32
4440
    :ivar DisplayName:
4441 1
    :vartype DisplayName: LocalizedText
4442
    :ivar Description:
4443
    :vartype Description: LocalizedText
4444 1
    :ivar WriteMask:
4445
    :vartype WriteMask: UInt32
4446
    :ivar UserWriteMask:
4447
    :vartype UserWriteMask: UInt32
4448
    :ivar Executable:
4449
    :vartype Executable: Boolean
4450
    :ivar UserExecutable:
4451
    :vartype UserExecutable: Boolean
4452
    '''
4453 1
4454 1
    ua_types = {
4455 1
        'SpecifiedAttributes': 'UInt32',
4456 1
        'DisplayName': 'LocalizedText',
4457 1
        'Description': 'LocalizedText',
4458 1
        'WriteMask': 'UInt32',
4459 1
        'UserWriteMask': 'UInt32',
4460 1
        'Executable': 'Boolean',
4461
        'UserExecutable': 'Boolean',
4462 1
               }
4463 1
4464 1
    def __init__(self, binary=None):
4465 1
        if binary is not None:
4466 1
            self._binary_init(binary)
4467
            self._freeze = True
4468 1
            return
4469
        self.SpecifiedAttributes = 0
4470 1
        self.DisplayName = LocalizedText()
4471
        self.Description = LocalizedText()
4472 1
        self.WriteMask = 0
4473 1
        self.UserWriteMask = 0
4474 1
        self.Executable = True
4475
        self.UserExecutable = True
4476 1
        self._freeze = True
4477
4478
    def to_binary(self):
4479
        packet = []
4480 1
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4481
        packet.append(self.DisplayName.to_binary())
4482
        packet.append(self.Description.to_binary())
4483 1
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4484
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4485
        packet.append(uabin.Primitives.Boolean.pack(self.Executable))
4486
        packet.append(uabin.Primitives.Boolean.pack(self.UserExecutable))
4487
        return b''.join(packet)
4488 1
4489 1
    @staticmethod
4490 1
    def from_binary(data):
4491 1
        return MethodAttributes(data)
4492 1
4493 1
    def _binary_init(self, data):
4494 1
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4495
        self.DisplayName = LocalizedText.from_binary(data)
4496 1
        self.Description = LocalizedText.from_binary(data)
4497 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4498 1
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4499 1
        self.Executable = uabin.Primitives.Boolean.unpack(data)
4500 1
        self.UserExecutable = uabin.Primitives.Boolean.unpack(data)
4501 1
4502
    def __str__(self):
4503 1
        return 'MethodAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4504
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4505 1
               'Description:' + str(self.Description) + ', ' + \
4506
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4507 1
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4508 1
               'Executable:' + str(self.Executable) + ', ' + \
4509 1
               'UserExecutable:' + str(self.UserExecutable) + ')'
4510 1
4511 1
    __repr__ = __str__
4512 1
4513 1
4514 View Code Duplication
class ObjectTypeAttributes(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4515 1
    '''
4516
    The attributes for an object type node.
4517
4518 1
    :ivar SpecifiedAttributes:
4519
    :vartype SpecifiedAttributes: UInt32
4520
    :ivar DisplayName:
4521 1
    :vartype DisplayName: LocalizedText
4522
    :ivar Description:
4523
    :vartype Description: LocalizedText
4524
    :ivar WriteMask:
4525
    :vartype WriteMask: UInt32
4526
    :ivar UserWriteMask:
4527
    :vartype UserWriteMask: UInt32
4528
    :ivar IsAbstract:
4529
    :vartype IsAbstract: Boolean
4530
    '''
4531
4532 1
    ua_types = {
4533 1
        'SpecifiedAttributes': 'UInt32',
4534
        'DisplayName': 'LocalizedText',
4535
        'Description': 'LocalizedText',
4536
        'WriteMask': 'UInt32',
4537 1
        'UserWriteMask': 'UInt32',
4538 1
        'IsAbstract': 'Boolean',
4539 1
               }
4540 1
4541
    def __init__(self, binary=None):
4542 1
        if binary is not None:
4543 1
            self._binary_init(binary)
4544 1
            self._freeze = True
4545 1
            return
4546 1
        self.SpecifiedAttributes = 0
4547 1
        self.DisplayName = LocalizedText()
4548
        self.Description = LocalizedText()
4549 1
        self.WriteMask = 0
4550
        self.UserWriteMask = 0
4551
        self.IsAbstract = True
4552
        self._freeze = True
4553 1
4554
    def to_binary(self):
4555
        packet = []
4556
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4557
        packet.append(self.DisplayName.to_binary())
4558 1
        packet.append(self.Description.to_binary())
4559
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4560
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4561
        packet.append(uabin.Primitives.Boolean.pack(self.IsAbstract))
4562
        return b''.join(packet)
4563 1
4564
    @staticmethod
4565
    def from_binary(data):
4566 1
        return ObjectTypeAttributes(data)
4567
4568
    def _binary_init(self, data):
4569
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4570
        self.DisplayName = LocalizedText.from_binary(data)
4571
        self.Description = LocalizedText.from_binary(data)
4572
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4573
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4574
        self.IsAbstract = uabin.Primitives.Boolean.unpack(data)
4575
4576
    def __str__(self):
4577
        return 'ObjectTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4578
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4579 1
               'Description:' + str(self.Description) + ', ' + \
4580 1
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4581 1
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4582 1
               'IsAbstract:' + str(self.IsAbstract) + ')'
4583 1
4584 1
    __repr__ = __str__
4585 1
4586 1
4587 1
class VariableTypeAttributes(FrozenClass):
4588 1
    '''
4589
    The attributes for a variable type node.
4590 1
4591 1
    :ivar SpecifiedAttributes:
4592 1
    :vartype SpecifiedAttributes: UInt32
4593 1
    :ivar DisplayName:
4594 1
    :vartype DisplayName: LocalizedText
4595 1
    :ivar Description:
4596 1
    :vartype Description: LocalizedText
4597 1
    :ivar WriteMask:
4598 1
    :vartype WriteMask: UInt32
4599
    :ivar UserWriteMask:
4600 1
    :vartype UserWriteMask: UInt32
4601
    :ivar Value:
4602 1
    :vartype Value: Variant
4603
    :ivar DataType:
4604 1
    :vartype DataType: NodeId
4605
    :ivar ValueRank:
4606 1
    :vartype ValueRank: Int32
4607 1
    :ivar ArrayDimensions:
4608 1
    :vartype ArrayDimensions: UInt32
4609 1
    :ivar IsAbstract:
4610 1
    :vartype IsAbstract: Boolean
4611 1
    '''
4612 1
4613 1
    ua_types = {
4614 1
        'SpecifiedAttributes': 'UInt32',
4615 1
        'DisplayName': 'LocalizedText',
4616 1
        'Description': 'LocalizedText',
4617 1
        'WriteMask': 'UInt32',
4618 1
        'UserWriteMask': 'UInt32',
4619
        'Value': 'Variant',
4620 1
        'DataType': 'NodeId',
4621
        'ValueRank': 'Int32',
4622 1
        'ArrayDimensions': 'UInt32',
4623
        'IsAbstract': 'Boolean',
4624
               }
4625
4626
    def __init__(self, binary=None):
4627
        if binary is not None:
4628 1
            self._binary_init(binary)
4629
            self._freeze = True
4630
            return
4631 1
        self.SpecifiedAttributes = 0
4632
        self.DisplayName = LocalizedText()
4633
        self.Description = LocalizedText()
4634
        self.WriteMask = 0
4635
        self.UserWriteMask = 0
4636
        self.Value = Variant()
4637
        self.DataType = NodeId()
4638
        self.ValueRank = 0
4639
        self.ArrayDimensions = []
4640
        self.IsAbstract = True
4641
        self._freeze = True
4642
4643
    def to_binary(self):
4644
        packet = []
4645
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4646
        packet.append(self.DisplayName.to_binary())
4647
        packet.append(self.Description.to_binary())
4648 1
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4649 1
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4650
        packet.append(self.Value.to_binary())
4651
        packet.append(self.DataType.to_binary())
4652
        packet.append(uabin.Primitives.Int32.pack(self.ValueRank))
4653 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ArrayDimensions)))
4654 1
        for fieldname in self.ArrayDimensions:
4655 1
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
4656 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsAbstract))
4657 1
        return b''.join(packet)
4658 1
4659 1
    @staticmethod
4660
    def from_binary(data):
4661 1
        return VariableTypeAttributes(data)
4662
4663 View Code Duplication
    def _binary_init(self, data):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4664
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4665
        self.DisplayName = LocalizedText.from_binary(data)
4666
        self.Description = LocalizedText.from_binary(data)
4667
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4668
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4669
        self.Value = Variant.from_binary(data)
4670
        self.DataType = NodeId.from_binary(data)
4671 1
        self.ValueRank = uabin.Primitives.Int32.unpack(data)
4672
        self.ArrayDimensions = uabin.Primitives.UInt32.unpack_array(data)
4673
        self.IsAbstract = uabin.Primitives.Boolean.unpack(data)
4674
4675 1
    def __str__(self):
4676
        return 'VariableTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4677
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4678
               'Description:' + str(self.Description) + ', ' + \
4679
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4680
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4681
               'Value:' + str(self.Value) + ', ' + \
4682
               'DataType:' + str(self.DataType) + ', ' + \
4683 1
               'ValueRank:' + str(self.ValueRank) + ', ' + \
4684
               'ArrayDimensions:' + str(self.ArrayDimensions) + ', ' + \
4685
               'IsAbstract:' + str(self.IsAbstract) + ')'
4686
4687
    __repr__ = __str__
4688
4689
4690
class ReferenceTypeAttributes(FrozenClass):
4691 1
    '''
4692
    The attributes for a reference type node.
4693
4694 1
    :ivar SpecifiedAttributes:
4695
    :vartype SpecifiedAttributes: UInt32
4696
    :ivar DisplayName:
4697
    :vartype DisplayName: LocalizedText
4698
    :ivar Description:
4699
    :vartype Description: LocalizedText
4700
    :ivar WriteMask:
4701
    :vartype WriteMask: UInt32
4702
    :ivar UserWriteMask:
4703
    :vartype UserWriteMask: UInt32
4704
    :ivar IsAbstract:
4705 1
    :vartype IsAbstract: Boolean
4706
    :ivar Symmetric:
4707
    :vartype Symmetric: Boolean
4708
    :ivar InverseName:
4709
    :vartype InverseName: LocalizedText
4710
    '''
4711
4712
    ua_types = {
4713
        'SpecifiedAttributes': 'UInt32',
4714
        'DisplayName': 'LocalizedText',
4715 1
        'Description': 'LocalizedText',
4716
        'WriteMask': 'UInt32',
4717
        'UserWriteMask': 'UInt32',
4718
        'IsAbstract': 'Boolean',
4719
        'Symmetric': 'Boolean',
4720
        'InverseName': 'LocalizedText',
4721
               }
4722
4723
    def __init__(self, binary=None):
4724 1
        if binary is not None:
4725
            self._binary_init(binary)
4726
            self._freeze = True
4727
            return
4728 1
        self.SpecifiedAttributes = 0
4729
        self.DisplayName = LocalizedText()
4730
        self.Description = LocalizedText()
4731
        self.WriteMask = 0
4732
        self.UserWriteMask = 0
4733
        self.IsAbstract = True
4734
        self.Symmetric = True
4735
        self.InverseName = LocalizedText()
4736
        self._freeze = True
4737
4738 1
    def to_binary(self):
4739
        packet = []
4740
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4741
        packet.append(self.DisplayName.to_binary())
4742
        packet.append(self.Description.to_binary())
4743 1
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4744
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4745
        packet.append(uabin.Primitives.Boolean.pack(self.IsAbstract))
4746 1
        packet.append(uabin.Primitives.Boolean.pack(self.Symmetric))
4747
        packet.append(self.InverseName.to_binary())
4748
        return b''.join(packet)
4749
4750
    @staticmethod
4751
    def from_binary(data):
4752
        return ReferenceTypeAttributes(data)
4753
4754
    def _binary_init(self, data):
4755
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4756
        self.DisplayName = LocalizedText.from_binary(data)
4757
        self.Description = LocalizedText.from_binary(data)
4758
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4759 1
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4760
        self.IsAbstract = uabin.Primitives.Boolean.unpack(data)
4761
        self.Symmetric = uabin.Primitives.Boolean.unpack(data)
4762
        self.InverseName = LocalizedText.from_binary(data)
4763
4764
    def __str__(self):
4765
        return 'ReferenceTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4766
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4767
               'Description:' + str(self.Description) + ', ' + \
4768
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4769
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4770 1
               'IsAbstract:' + str(self.IsAbstract) + ', ' + \
4771
               'Symmetric:' + str(self.Symmetric) + ', ' + \
4772
               'InverseName:' + str(self.InverseName) + ')'
4773
4774
    __repr__ = __str__
4775
4776
4777 View Code Duplication
class DataTypeAttributes(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4778
    '''
4779
    The attributes for a data type node.
4780
4781
    :ivar SpecifiedAttributes:
4782 1
    :vartype SpecifiedAttributes: UInt32
4783
    :ivar DisplayName:
4784
    :vartype DisplayName: LocalizedText
4785
    :ivar Description:
4786 1
    :vartype Description: LocalizedText
4787
    :ivar WriteMask:
4788
    :vartype WriteMask: UInt32
4789
    :ivar UserWriteMask:
4790
    :vartype UserWriteMask: UInt32
4791
    :ivar IsAbstract:
4792
    :vartype IsAbstract: Boolean
4793
    '''
4794
4795
    ua_types = {
4796
        'SpecifiedAttributes': 'UInt32',
4797
        'DisplayName': 'LocalizedText',
4798
        'Description': 'LocalizedText',
4799
        'WriteMask': 'UInt32',
4800
        'UserWriteMask': 'UInt32',
4801
        'IsAbstract': 'Boolean',
4802 1
               }
4803
4804
    def __init__(self, binary=None):
4805
        if binary is not None:
4806
            self._binary_init(binary)
4807
            self._freeze = True
4808 1
            return
4809
        self.SpecifiedAttributes = 0
4810
        self.DisplayName = LocalizedText()
4811 1
        self.Description = LocalizedText()
4812
        self.WriteMask = 0
4813
        self.UserWriteMask = 0
4814
        self.IsAbstract = True
4815
        self._freeze = True
4816
4817
    def to_binary(self):
4818
        packet = []
4819
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4820 1
        packet.append(self.DisplayName.to_binary())
4821 1
        packet.append(self.Description.to_binary())
4822 1
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4823 1
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4824 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsAbstract))
4825 1
        return b''.join(packet)
4826 1
4827 1
    @staticmethod
4828
    def from_binary(data):
4829 1
        return DataTypeAttributes(data)
4830 1
4831 1
    def _binary_init(self, data):
4832 1
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4833 1
        self.DisplayName = LocalizedText.from_binary(data)
4834
        self.Description = LocalizedText.from_binary(data)
4835 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4836
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4837 1
        self.IsAbstract = uabin.Primitives.Boolean.unpack(data)
4838
4839 1
    def __str__(self):
4840 1
        return 'DataTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4841 1
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4842
               'Description:' + str(self.Description) + ', ' + \
4843 1
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4844
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4845
               'IsAbstract:' + str(self.IsAbstract) + ')'
4846
4847 1
    __repr__ = __str__
4848
4849
4850 1 View Code Duplication
class ViewAttributes(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4851
    '''
4852
    The attributes for a view node.
4853
4854
    :ivar SpecifiedAttributes:
4855 1
    :vartype SpecifiedAttributes: UInt32
4856 1
    :ivar DisplayName:
4857 1
    :vartype DisplayName: LocalizedText
4858 1
    :ivar Description:
4859 1
    :vartype Description: LocalizedText
4860 1
    :ivar WriteMask:
4861 1
    :vartype WriteMask: UInt32
4862
    :ivar UserWriteMask:
4863 1
    :vartype UserWriteMask: UInt32
4864 1
    :ivar ContainsNoLoops:
4865 1
    :vartype ContainsNoLoops: Boolean
4866 1
    :ivar EventNotifier:
4867 1
    :vartype EventNotifier: Byte
4868 1
    '''
4869
4870 1
    ua_types = {
4871
        'SpecifiedAttributes': 'UInt32',
4872 1
        'DisplayName': 'LocalizedText',
4873
        'Description': 'LocalizedText',
4874 1
        'WriteMask': 'UInt32',
4875 1
        'UserWriteMask': 'UInt32',
4876 1
        'ContainsNoLoops': 'Boolean',
4877 1
        'EventNotifier': 'Byte',
4878 1
               }
4879 1
4880 1
    def __init__(self, binary=None):
4881
        if binary is not None:
4882 1
            self._binary_init(binary)
4883
            self._freeze = True
4884
            return
4885 1
        self.SpecifiedAttributes = 0
4886
        self.DisplayName = LocalizedText()
4887
        self.Description = LocalizedText()
4888 1
        self.WriteMask = 0
4889
        self.UserWriteMask = 0
4890
        self.ContainsNoLoops = True
4891
        self.EventNotifier = 0
4892
        self._freeze = True
4893
4894
    def to_binary(self):
4895
        packet = []
4896
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4897
        packet.append(self.DisplayName.to_binary())
4898
        packet.append(self.Description.to_binary())
4899 1
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4900 1
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4901
        packet.append(uabin.Primitives.Boolean.pack(self.ContainsNoLoops))
4902
        packet.append(uabin.Primitives.Byte.pack(self.EventNotifier))
4903
        return b''.join(packet)
4904 1
4905 1
    @staticmethod
4906 1
    def from_binary(data):
4907 1
        return ViewAttributes(data)
4908
4909 1
    def _binary_init(self, data):
4910 1
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4911 1
        self.DisplayName = LocalizedText.from_binary(data)
4912 1
        self.Description = LocalizedText.from_binary(data)
4913 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4914 1
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4915
        self.ContainsNoLoops = uabin.Primitives.Boolean.unpack(data)
4916 1
        self.EventNotifier = uabin.Primitives.Byte.unpack(data)
4917
4918
    def __str__(self):
4919
        return 'ViewAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4920 1
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4921
               'Description:' + str(self.Description) + ', ' + \
4922
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4923
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4924
               'ContainsNoLoops:' + str(self.ContainsNoLoops) + ', ' + \
4925 1
               'EventNotifier:' + str(self.EventNotifier) + ')'
4926
4927
    __repr__ = __str__
4928
4929
4930 1 View Code Duplication
class AddNodesItem(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4931
    '''
4932
    A request to add a node to the server address space.
4933 1
4934
    :ivar ParentNodeId:
4935
    :vartype ParentNodeId: ExpandedNodeId
4936
    :ivar ReferenceTypeId:
4937
    :vartype ReferenceTypeId: NodeId
4938
    :ivar RequestedNewNodeId:
4939
    :vartype RequestedNewNodeId: ExpandedNodeId
4940
    :ivar BrowseName:
4941
    :vartype BrowseName: QualifiedName
4942
    :ivar NodeClass:
4943
    :vartype NodeClass: NodeClass
4944
    :ivar NodeAttributes:
4945
    :vartype NodeAttributes: ExtensionObject
4946 1
    :ivar TypeDefinition:
4947 1
    :vartype TypeDefinition: ExpandedNodeId
4948 1
    '''
4949 1
4950 1
    ua_types = {
4951 1
        'ParentNodeId': 'ExpandedNodeId',
4952 1
        'ReferenceTypeId': 'NodeId',
4953 1
        'RequestedNewNodeId': 'ExpandedNodeId',
4954 1
        'BrowseName': 'QualifiedName',
4955 1
        'NodeClass': 'NodeClass',
4956
        'NodeAttributes': 'ExtensionObject',
4957 1
        'TypeDefinition': 'ExpandedNodeId',
4958 1
               }
4959 1
4960 1
    def __init__(self, binary=None):
4961 1
        if binary is not None:
4962 1
            self._binary_init(binary)
4963 1
            self._freeze = True
4964 1
            return
4965 1
        self.ParentNodeId = ExpandedNodeId()
4966
        self.ReferenceTypeId = NodeId()
4967 1
        self.RequestedNewNodeId = ExpandedNodeId()
4968
        self.BrowseName = QualifiedName()
4969 1
        self.NodeClass = NodeClass(0)
4970
        self.NodeAttributes = None
4971 1
        self.TypeDefinition = ExpandedNodeId()
4972
        self._freeze = True
4973 1
4974 1
    def to_binary(self):
4975 1
        packet = []
4976 1
        packet.append(self.ParentNodeId.to_binary())
4977 1
        packet.append(self.ReferenceTypeId.to_binary())
4978 1
        packet.append(self.RequestedNewNodeId.to_binary())
4979 1
        packet.append(self.BrowseName.to_binary())
4980 1
        packet.append(uabin.Primitives.UInt32.pack(self.NodeClass.value))
4981 1
        packet.append(extensionobject_to_binary(self.NodeAttributes))
4982 1
        packet.append(self.TypeDefinition.to_binary())
4983 1
        return b''.join(packet)
4984 1
4985 1
    @staticmethod
4986
    def from_binary(data):
4987 1
        return AddNodesItem(data)
4988
4989 1
    def _binary_init(self, data):
4990
        self.ParentNodeId = ExpandedNodeId.from_binary(data)
4991
        self.ReferenceTypeId = NodeId.from_binary(data)
4992
        self.RequestedNewNodeId = ExpandedNodeId.from_binary(data)
4993
        self.BrowseName = QualifiedName.from_binary(data)
4994
        self.NodeClass = NodeClass(uabin.Primitives.UInt32.unpack(data))
4995 1
        self.NodeAttributes = extensionobject_from_binary(data)
4996
        self.TypeDefinition = ExpandedNodeId.from_binary(data)
4997
4998 1
    def __str__(self):
4999
        return 'AddNodesItem(' + 'ParentNodeId:' + str(self.ParentNodeId) + ', ' + \
5000
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
5001
               'RequestedNewNodeId:' + str(self.RequestedNewNodeId) + ', ' + \
5002
               'BrowseName:' + str(self.BrowseName) + ', ' + \
5003
               'NodeClass:' + str(self.NodeClass) + ', ' + \
5004
               'NodeAttributes:' + str(self.NodeAttributes) + ', ' + \
5005
               'TypeDefinition:' + str(self.TypeDefinition) + ')'
5006
5007
    __repr__ = __str__
5008
5009
5010 View Code Duplication
class AddNodesResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5011
    '''
5012
    A result of an add node operation.
5013 1
5014
    :ivar StatusCode:
5015
    :vartype StatusCode: StatusCode
5016
    :ivar AddedNodeId:
5017
    :vartype AddedNodeId: NodeId
5018
    '''
5019
5020
    ua_types = {
5021
        'StatusCode': 'StatusCode',
5022
        'AddedNodeId': 'NodeId',
5023
               }
5024
5025 1
    def __init__(self, binary=None):
5026
        if binary is not None:
5027
            self._binary_init(binary)
5028
            self._freeze = True
5029
            return
5030
        self.StatusCode = StatusCode()
5031
        self.AddedNodeId = NodeId()
5032
        self._freeze = True
5033
5034 1
    def to_binary(self):
5035
        packet = []
5036
        packet.append(self.StatusCode.to_binary())
5037
        packet.append(self.AddedNodeId.to_binary())
5038 1
        return b''.join(packet)
5039
5040
    @staticmethod
5041
    def from_binary(data):
5042
        return AddNodesResult(data)
5043
5044
    def _binary_init(self, data):
5045 1
        self.StatusCode = StatusCode.from_binary(data)
5046
        self.AddedNodeId = NodeId.from_binary(data)
5047
5048
    def __str__(self):
5049
        return 'AddNodesResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
5050
               'AddedNodeId:' + str(self.AddedNodeId) + ')'
5051
5052 1
    __repr__ = __str__
5053
5054
5055 1
class AddNodesParameters(FrozenClass):
5056
    '''
5057
    :ivar NodesToAdd:
5058
    :vartype NodesToAdd: AddNodesItem
5059
    '''
5060 1
5061
    ua_types = {
5062
        'NodesToAdd': 'AddNodesItem',
5063
               }
5064
5065
    def __init__(self, binary=None):
5066
        if binary is not None:
5067
            self._binary_init(binary)
5068 1
            self._freeze = True
5069
            return
5070
        self.NodesToAdd = []
5071
        self._freeze = True
5072
5073
    def to_binary(self):
5074
        packet = []
5075 1
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToAdd)))
5076
        for fieldname in self.NodesToAdd:
5077
            packet.append(fieldname.to_binary())
5078
        return b''.join(packet)
5079 1
5080
    @staticmethod
5081
    def from_binary(data):
5082
        return AddNodesParameters(data)
5083
5084
    def _binary_init(self, data):
5085
        length = uabin.Primitives.Int32.unpack(data)
5086
        array = []
5087 1
        if length != -1:
5088
            for _ in range(0, length):
5089
                array.append(AddNodesItem.from_binary(data))
5090 1
        self.NodesToAdd = array
5091
5092
    def __str__(self):
5093 1
        return 'AddNodesParameters(' + 'NodesToAdd:' + str(self.NodesToAdd) + ')'
5094
5095
    __repr__ = __str__
5096
5097
5098
class AddNodesRequest(FrozenClass):
5099
    '''
5100
    Adds one or more nodes to the server address space.
5101
5102
    :ivar TypeId:
5103
    :vartype TypeId: NodeId
5104 1
    :ivar RequestHeader:
5105
    :vartype RequestHeader: RequestHeader
5106
    :ivar Parameters:
5107
    :vartype Parameters: AddNodesParameters
5108
    '''
5109
5110
    ua_types = {
5111
        'TypeId': 'NodeId',
5112
        'RequestHeader': 'RequestHeader',
5113
        'Parameters': 'AddNodesParameters',
5114 1
               }
5115
5116
    def __init__(self, binary=None):
5117
        if binary is not None:
5118
            self._binary_init(binary)
5119
            self._freeze = True
5120
            return
5121 1
        self.TypeId = FourByteNodeId(ObjectIds.AddNodesRequest_Encoding_DefaultBinary)
5122
        self.RequestHeader = RequestHeader()
5123
        self.Parameters = AddNodesParameters()
5124
        self._freeze = True
5125 1
5126
    def to_binary(self):
5127
        packet = []
5128
        packet.append(self.TypeId.to_binary())
5129
        packet.append(self.RequestHeader.to_binary())
5130 1
        packet.append(self.Parameters.to_binary())
5131
        return b''.join(packet)
5132
5133
    @staticmethod
5134
    def from_binary(data):
5135 1
        return AddNodesRequest(data)
5136
5137
    def _binary_init(self, data):
5138 1
        self.TypeId = NodeId.from_binary(data)
5139
        self.RequestHeader = RequestHeader.from_binary(data)
5140
        self.Parameters = AddNodesParameters.from_binary(data)
5141
5142
    def __str__(self):
5143
        return 'AddNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5144
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5145 1
               'Parameters:' + str(self.Parameters) + ')'
5146
5147
    __repr__ = __str__
5148
5149
5150
class AddNodesResponse(FrozenClass):
5151
    '''
5152
    Adds one or more nodes to the server address space.
5153
5154 1
    :ivar TypeId:
5155
    :vartype TypeId: NodeId
5156
    :ivar ResponseHeader:
5157
    :vartype ResponseHeader: ResponseHeader
5158
    :ivar Results:
5159
    :vartype Results: AddNodesResult
5160
    :ivar DiagnosticInfos:
5161
    :vartype DiagnosticInfos: DiagnosticInfo
5162
    '''
5163
5164 1
    ua_types = {
5165
        'TypeId': 'NodeId',
5166
        'ResponseHeader': 'ResponseHeader',
5167
        'Results': 'AddNodesResult',
5168 1
        'DiagnosticInfos': 'DiagnosticInfo',
5169
               }
5170
5171
    def __init__(self, binary=None):
5172
        if binary is not None:
5173
            self._binary_init(binary)
5174
            self._freeze = True
5175
            return
5176
        self.TypeId = FourByteNodeId(ObjectIds.AddNodesResponse_Encoding_DefaultBinary)
5177
        self.ResponseHeader = ResponseHeader()
5178
        self.Results = []
5179
        self.DiagnosticInfos = []
5180
        self._freeze = True
5181
5182 1
    def to_binary(self):
5183
        packet = []
5184
        packet.append(self.TypeId.to_binary())
5185
        packet.append(self.ResponseHeader.to_binary())
5186 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
5187
        for fieldname in self.Results:
5188
            packet.append(fieldname.to_binary())
5189 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
5190
        for fieldname in self.DiagnosticInfos:
5191
            packet.append(fieldname.to_binary())
5192
        return b''.join(packet)
5193
5194
    @staticmethod
5195
    def from_binary(data):
5196
        return AddNodesResponse(data)
5197
5198
    def _binary_init(self, data):
5199
        self.TypeId = NodeId.from_binary(data)
5200 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
5201
        length = uabin.Primitives.Int32.unpack(data)
5202
        array = []
5203
        if length != -1:
5204
            for _ in range(0, length):
5205
                array.append(AddNodesResult.from_binary(data))
5206
        self.Results = array
5207
        length = uabin.Primitives.Int32.unpack(data)
5208
        array = []
5209
        if length != -1:
5210 1
            for _ in range(0, length):
5211
                array.append(DiagnosticInfo.from_binary(data))
5212
        self.DiagnosticInfos = array
5213
5214
    def __str__(self):
5215
        return 'AddNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5216
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5217 1
               'Results:' + str(self.Results) + ', ' + \
5218
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5219
5220
    __repr__ = __str__
5221 1
5222
5223 View Code Duplication
class AddReferencesItem(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5224
    '''
5225
    A request to add a reference to the server address space.
5226 1
5227
    :ivar SourceNodeId:
5228
    :vartype SourceNodeId: NodeId
5229
    :ivar ReferenceTypeId:
5230
    :vartype ReferenceTypeId: NodeId
5231 1
    :ivar IsForward:
5232
    :vartype IsForward: Boolean
5233
    :ivar TargetServerUri:
5234 1
    :vartype TargetServerUri: String
5235
    :ivar TargetNodeId:
5236
    :vartype TargetNodeId: ExpandedNodeId
5237
    :ivar TargetNodeClass:
5238
    :vartype TargetNodeClass: NodeClass
5239
    '''
5240
5241
    ua_types = {
5242
        'SourceNodeId': 'NodeId',
5243
        'ReferenceTypeId': 'NodeId',
5244
        'IsForward': 'Boolean',
5245 1
        'TargetServerUri': 'String',
5246 1
        'TargetNodeId': 'ExpandedNodeId',
5247 1
        'TargetNodeClass': 'NodeClass',
5248 1
               }
5249 1
5250 1
    def __init__(self, binary=None):
5251 1
        if binary is not None:
5252 1
            self._binary_init(binary)
5253 1
            self._freeze = True
5254
            return
5255 1
        self.SourceNodeId = NodeId()
5256 1
        self.ReferenceTypeId = NodeId()
5257 1
        self.IsForward = True
5258 1
        self.TargetServerUri = None
5259 1
        self.TargetNodeId = ExpandedNodeId()
5260 1
        self.TargetNodeClass = NodeClass(0)
5261
        self._freeze = True
5262 1
5263
    def to_binary(self):
5264 1
        packet = []
5265
        packet.append(self.SourceNodeId.to_binary())
5266 1
        packet.append(self.ReferenceTypeId.to_binary())
5267 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsForward))
5268 1
        packet.append(uabin.Primitives.String.pack(self.TargetServerUri))
5269 1
        packet.append(self.TargetNodeId.to_binary())
5270
        packet.append(uabin.Primitives.UInt32.pack(self.TargetNodeClass.value))
5271 1
        return b''.join(packet)
5272
5273
    @staticmethod
5274
    def from_binary(data):
5275
        return AddReferencesItem(data)
5276 1
5277
    def _binary_init(self, data):
5278
        self.SourceNodeId = NodeId.from_binary(data)
5279 1
        self.ReferenceTypeId = NodeId.from_binary(data)
5280
        self.IsForward = uabin.Primitives.Boolean.unpack(data)
5281
        self.TargetServerUri = uabin.Primitives.String.unpack(data)
5282
        self.TargetNodeId = ExpandedNodeId.from_binary(data)
5283
        self.TargetNodeClass = NodeClass(uabin.Primitives.UInt32.unpack(data))
5284
5285
    def __str__(self):
5286
        return 'AddReferencesItem(' + 'SourceNodeId:' + str(self.SourceNodeId) + ', ' + \
5287
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
5288
               'IsForward:' + str(self.IsForward) + ', ' + \
5289
               'TargetServerUri:' + str(self.TargetServerUri) + ', ' + \
5290
               'TargetNodeId:' + str(self.TargetNodeId) + ', ' + \
5291
               'TargetNodeClass:' + str(self.TargetNodeClass) + ')'
5292
5293
    __repr__ = __str__
5294
5295
5296 1 View Code Duplication
class AddReferencesRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5297 1
    '''
5298 1
    Adds one or more references to the server address space.
5299 1
5300 1
    :ivar TypeId:
5301 1
    :vartype TypeId: NodeId
5302 1
    :ivar RequestHeader:
5303 1
    :vartype RequestHeader: RequestHeader
5304 1
    :ivar ReferencesToAdd:
5305 1
    :vartype ReferencesToAdd: AddReferencesItem
5306 1
    '''
5307 1
5308
    ua_types = {
5309 1
        'TypeId': 'NodeId',
5310 1
        'RequestHeader': 'RequestHeader',
5311 1
        'ReferencesToAdd': 'AddReferencesItem',
5312 1
               }
5313 1
5314 1
    def __init__(self, binary=None):
5315 1
        if binary is not None:
5316 1
            self._binary_init(binary)
5317 1
            self._freeze = True
5318
            return
5319 1
        self.TypeId = FourByteNodeId(ObjectIds.AddReferencesRequest_Encoding_DefaultBinary)
5320
        self.RequestHeader = RequestHeader()
5321 1
        self.ReferencesToAdd = []
5322
        self._freeze = True
5323 1
5324 1
    def to_binary(self):
5325 1
        packet = []
5326 1
        packet.append(self.TypeId.to_binary())
5327 1
        packet.append(self.RequestHeader.to_binary())
5328 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ReferencesToAdd)))
5329 1
        for fieldname in self.ReferencesToAdd:
5330
            packet.append(fieldname.to_binary())
5331 1
        return b''.join(packet)
5332
5333
    @staticmethod
5334
    def from_binary(data):
5335
        return AddReferencesRequest(data)
5336
5337
    def _binary_init(self, data):
5338
        self.TypeId = NodeId.from_binary(data)
5339 1
        self.RequestHeader = RequestHeader.from_binary(data)
5340
        length = uabin.Primitives.Int32.unpack(data)
5341
        array = []
5342 1
        if length != -1:
5343
            for _ in range(0, length):
5344
                array.append(AddReferencesItem.from_binary(data))
5345
        self.ReferencesToAdd = array
5346
5347
    def __str__(self):
5348
        return 'AddReferencesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5349
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5350
               'ReferencesToAdd:' + str(self.ReferencesToAdd) + ')'
5351
5352
    __repr__ = __str__
5353
5354
5355
class AddReferencesResponse(FrozenClass):
5356
    '''
5357
    Adds one or more references to the server address space.
5358
5359
    :ivar TypeId:
5360
    :vartype TypeId: NodeId
5361 1
    :ivar ResponseHeader:
5362 1
    :vartype ResponseHeader: ResponseHeader
5363 1
    :ivar Results:
5364 1
    :vartype Results: StatusCode
5365 1
    :ivar DiagnosticInfos:
5366 1
    :vartype DiagnosticInfos: DiagnosticInfo
5367 1
    '''
5368 1
5369 1
    ua_types = {
5370 1
        'TypeId': 'NodeId',
5371 1
        'ResponseHeader': 'ResponseHeader',
5372 1
        'Results': 'StatusCode',
5373 1
        'DiagnosticInfos': 'DiagnosticInfo',
5374
               }
5375 1
5376 1
    def __init__(self, binary=None):
5377 1
        if binary is not None:
5378 1
            self._binary_init(binary)
5379 1
            self._freeze = True
5380 1
            return
5381 1
        self.TypeId = FourByteNodeId(ObjectIds.AddReferencesResponse_Encoding_DefaultBinary)
5382 1
        self.ResponseHeader = ResponseHeader()
5383 1
        self.Results = []
5384 1
        self.DiagnosticInfos = []
5385
        self._freeze = True
5386 1
5387
    def to_binary(self):
5388 1
        packet = []
5389
        packet.append(self.TypeId.to_binary())
5390 1
        packet.append(self.ResponseHeader.to_binary())
5391 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
5392 1
        for fieldname in self.Results:
5393 1
            packet.append(fieldname.to_binary())
5394 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
5395 1
        for fieldname in self.DiagnosticInfos:
5396 1
            packet.append(fieldname.to_binary())
5397 1
        return b''.join(packet)
5398
5399 1
    @staticmethod
5400
    def from_binary(data):
5401
        return AddReferencesResponse(data)
5402
5403
    def _binary_init(self, data):
5404
        self.TypeId = NodeId.from_binary(data)
5405
        self.ResponseHeader = ResponseHeader.from_binary(data)
5406
        length = uabin.Primitives.Int32.unpack(data)
5407
        array = []
5408 1
        if length != -1:
5409
            for _ in range(0, length):
5410
                array.append(StatusCode.from_binary(data))
5411 1
        self.Results = array
5412
        length = uabin.Primitives.Int32.unpack(data)
5413
        array = []
5414
        if length != -1:
5415
            for _ in range(0, length):
5416
                array.append(DiagnosticInfo.from_binary(data))
5417
        self.DiagnosticInfos = array
5418
5419
    def __str__(self):
5420
        return 'AddReferencesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5421
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5422 1
               'Results:' + str(self.Results) + ', ' + \
5423 1
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5424 1
5425 1
    __repr__ = __str__
5426 1
5427 1
5428 1 View Code Duplication
class DeleteNodesItem(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5429 1
    '''
5430 1
    A request to delete a node to the server address space.
5431
5432 1
    :ivar NodeId:
5433 1
    :vartype NodeId: NodeId
5434 1
    :ivar DeleteTargetReferences:
5435 1
    :vartype DeleteTargetReferences: Boolean
5436 1
    '''
5437 1
5438 1
    ua_types = {
5439 1
        'NodeId': 'NodeId',
5440
        'DeleteTargetReferences': 'Boolean',
5441 1
               }
5442
5443 1
    def __init__(self, binary=None):
5444
        if binary is not None:
5445 1
            self._binary_init(binary)
5446 1
            self._freeze = True
5447 1
            return
5448 1
        self.NodeId = NodeId()
5449 1
        self.DeleteTargetReferences = True
5450 1
        self._freeze = True
5451 1
5452 1
    def to_binary(self):
5453 1
        packet = []
5454
        packet.append(self.NodeId.to_binary())
5455 1
        packet.append(uabin.Primitives.Boolean.pack(self.DeleteTargetReferences))
5456
        return b''.join(packet)
5457
5458
    @staticmethod
5459
    def from_binary(data):
5460 1
        return DeleteNodesItem(data)
5461
5462
    def _binary_init(self, data):
5463 1
        self.NodeId = NodeId.from_binary(data)
5464
        self.DeleteTargetReferences = uabin.Primitives.Boolean.unpack(data)
5465
5466
    def __str__(self):
5467
        return 'DeleteNodesItem(' + 'NodeId:' + str(self.NodeId) + ', ' + \
5468
               'DeleteTargetReferences:' + str(self.DeleteTargetReferences) + ')'
5469
5470
    __repr__ = __str__
5471
5472 1
5473 1
class DeleteNodesParameters(FrozenClass):
5474 1
    '''
5475 1
    :ivar NodesToDelete:
5476 1
    :vartype NodesToDelete: DeleteNodesItem
5477 1
    '''
5478 1
5479 1
    ua_types = {
5480 1
        'NodesToDelete': 'DeleteNodesItem',
5481
               }
5482 1
5483 1
    def __init__(self, binary=None):
5484 1
        if binary is not None:
5485 1
            self._binary_init(binary)
5486 1
            self._freeze = True
5487 1
            return
5488 1
        self.NodesToDelete = []
5489 1
        self._freeze = True
5490
5491 1
    def to_binary(self):
5492
        packet = []
5493 1
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToDelete)))
5494
        for fieldname in self.NodesToDelete:
5495 1
            packet.append(fieldname.to_binary())
5496 1
        return b''.join(packet)
5497 1
5498 1
    @staticmethod
5499 1
    def from_binary(data):
5500 1
        return DeleteNodesParameters(data)
5501 1
5502 1
    def _binary_init(self, data):
5503 1
        length = uabin.Primitives.Int32.unpack(data)
5504
        array = []
5505 1
        if length != -1:
5506
            for _ in range(0, length):
5507
                array.append(DeleteNodesItem.from_binary(data))
5508
        self.NodesToDelete = array
5509
5510 1
    def __str__(self):
5511
        return 'DeleteNodesParameters(' + 'NodesToDelete:' + str(self.NodesToDelete) + ')'
5512
5513 1
    __repr__ = __str__
5514
5515
5516
class DeleteNodesRequest(FrozenClass):
5517
    '''
5518
    Delete one or more nodes from the server address space.
5519
5520
    :ivar TypeId:
5521
    :vartype TypeId: NodeId
5522
    :ivar RequestHeader:
5523
    :vartype RequestHeader: RequestHeader
5524 1
    :ivar Parameters:
5525 1
    :vartype Parameters: DeleteNodesParameters
5526
    '''
5527
5528
    ua_types = {
5529 1
        'TypeId': 'NodeId',
5530 1
        'RequestHeader': 'RequestHeader',
5531 1
        'Parameters': 'DeleteNodesParameters',
5532 1
               }
5533
5534 1
    def __init__(self, binary=None):
5535 1
        if binary is not None:
5536 1
            self._binary_init(binary)
5537 1
            self._freeze = True
5538 1
            return
5539 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteNodesRequest_Encoding_DefaultBinary)
5540
        self.RequestHeader = RequestHeader()
5541 1
        self.Parameters = DeleteNodesParameters()
5542
        self._freeze = True
5543
5544
    def to_binary(self):
5545 1
        packet = []
5546
        packet.append(self.TypeId.to_binary())
5547
        packet.append(self.RequestHeader.to_binary())
5548
        packet.append(self.Parameters.to_binary())
5549
        return b''.join(packet)
5550 1
5551
    @staticmethod
5552
    def from_binary(data):
5553
        return DeleteNodesRequest(data)
5554
5555 1
    def _binary_init(self, data):
5556
        self.TypeId = NodeId.from_binary(data)
5557
        self.RequestHeader = RequestHeader.from_binary(data)
5558 1
        self.Parameters = DeleteNodesParameters.from_binary(data)
5559
5560
    def __str__(self):
5561
        return 'DeleteNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5562
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5563
               'Parameters:' + str(self.Parameters) + ')'
5564
5565
    __repr__ = __str__
5566
5567
5568
class DeleteNodesResponse(FrozenClass):
5569
    '''
5570
    Delete one or more nodes from the server address space.
5571 1
5572 1
    :ivar TypeId:
5573 1
    :vartype TypeId: NodeId
5574 1
    :ivar ResponseHeader:
5575 1
    :vartype ResponseHeader: ResponseHeader
5576 1
    :ivar Results:
5577 1
    :vartype Results: StatusCode
5578 1
    :ivar DiagnosticInfos:
5579 1
    :vartype DiagnosticInfos: DiagnosticInfo
5580 1
    '''
5581
5582 1
    ua_types = {
5583 1
        'TypeId': 'NodeId',
5584 1
        'ResponseHeader': 'ResponseHeader',
5585 1
        'Results': 'StatusCode',
5586 1
        'DiagnosticInfos': 'DiagnosticInfo',
5587 1
               }
5588 1
5589 1
    def __init__(self, binary=None):
5590 1
        if binary is not None:
5591
            self._binary_init(binary)
5592 1
            self._freeze = True
5593
            return
5594 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteNodesResponse_Encoding_DefaultBinary)
5595
        self.ResponseHeader = ResponseHeader()
5596 1
        self.Results = []
5597
        self.DiagnosticInfos = []
5598 1
        self._freeze = True
5599 1
5600 1
    def to_binary(self):
5601 1
        packet = []
5602 1
        packet.append(self.TypeId.to_binary())
5603 1
        packet.append(self.ResponseHeader.to_binary())
5604 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
5605 1
        for fieldname in self.Results:
5606 1
            packet.append(fieldname.to_binary())
5607 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
5608 1
        for fieldname in self.DiagnosticInfos:
5609 1
            packet.append(fieldname.to_binary())
5610 1
        return b''.join(packet)
5611
5612 1
    @staticmethod
5613
    def from_binary(data):
5614 1
        return DeleteNodesResponse(data)
5615
5616
    def _binary_init(self, data):
5617
        self.TypeId = NodeId.from_binary(data)
5618
        self.ResponseHeader = ResponseHeader.from_binary(data)
5619
        length = uabin.Primitives.Int32.unpack(data)
5620 1
        array = []
5621
        if length != -1:
5622
            for _ in range(0, length):
5623 1
                array.append(StatusCode.from_binary(data))
5624
        self.Results = array
5625
        length = uabin.Primitives.Int32.unpack(data)
5626
        array = []
5627
        if length != -1:
5628
            for _ in range(0, length):
5629
                array.append(DiagnosticInfo.from_binary(data))
5630 1
        self.DiagnosticInfos = array
5631
5632
    def __str__(self):
5633
        return 'DeleteNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5634
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5635
               'Results:' + str(self.Results) + ', ' + \
5636
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5637
5638
    __repr__ = __str__
5639 1
5640
5641
class DeleteReferencesItem(FrozenClass):
5642
    '''
5643
    A request to delete a node from the server address space.
5644
5645
    :ivar SourceNodeId:
5646
    :vartype SourceNodeId: NodeId
5647 1
    :ivar ReferenceTypeId:
5648
    :vartype ReferenceTypeId: NodeId
5649
    :ivar IsForward:
5650
    :vartype IsForward: Boolean
5651 1
    :ivar TargetNodeId:
5652
    :vartype TargetNodeId: ExpandedNodeId
5653
    :ivar DeleteBidirectional:
5654
    :vartype DeleteBidirectional: Boolean
5655 1
    '''
5656
5657
    ua_types = {
5658
        'SourceNodeId': 'NodeId',
5659 1
        'ReferenceTypeId': 'NodeId',
5660
        'IsForward': 'Boolean',
5661
        'TargetNodeId': 'ExpandedNodeId',
5662 1
        'DeleteBidirectional': 'Boolean',
5663
               }
5664
5665
    def __init__(self, binary=None):
5666
        if binary is not None:
5667
            self._binary_init(binary)
5668
            self._freeze = True
5669
            return
5670
        self.SourceNodeId = NodeId()
5671
        self.ReferenceTypeId = NodeId()
5672
        self.IsForward = True
5673 1
        self.TargetNodeId = ExpandedNodeId()
5674
        self.DeleteBidirectional = True
5675
        self._freeze = True
5676
5677
    def to_binary(self):
5678
        packet = []
5679
        packet.append(self.SourceNodeId.to_binary())
5680
        packet.append(self.ReferenceTypeId.to_binary())
5681
        packet.append(uabin.Primitives.Boolean.pack(self.IsForward))
5682
        packet.append(self.TargetNodeId.to_binary())
5683 1
        packet.append(uabin.Primitives.Boolean.pack(self.DeleteBidirectional))
5684
        return b''.join(packet)
5685
5686
    @staticmethod
5687
    def from_binary(data):
5688
        return DeleteReferencesItem(data)
5689
5690 1
    def _binary_init(self, data):
5691
        self.SourceNodeId = NodeId.from_binary(data)
5692
        self.ReferenceTypeId = NodeId.from_binary(data)
5693
        self.IsForward = uabin.Primitives.Boolean.unpack(data)
5694 1
        self.TargetNodeId = ExpandedNodeId.from_binary(data)
5695
        self.DeleteBidirectional = uabin.Primitives.Boolean.unpack(data)
5696
5697
    def __str__(self):
5698
        return 'DeleteReferencesItem(' + 'SourceNodeId:' + str(self.SourceNodeId) + ', ' + \
5699 1
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
5700
               'IsForward:' + str(self.IsForward) + ', ' + \
5701
               'TargetNodeId:' + str(self.TargetNodeId) + ', ' + \
5702
               'DeleteBidirectional:' + str(self.DeleteBidirectional) + ')'
5703
5704 1
    __repr__ = __str__
5705
5706
5707 1
class DeleteReferencesParameters(FrozenClass):
5708
    '''
5709
    :ivar ReferencesToDelete:
5710
    :vartype ReferencesToDelete: DeleteReferencesItem
5711
    '''
5712
5713
    ua_types = {
5714 1
        'ReferencesToDelete': 'DeleteReferencesItem',
5715
               }
5716
5717
    def __init__(self, binary=None):
5718
        if binary is not None:
5719
            self._binary_init(binary)
5720
            self._freeze = True
5721
            return
5722
        self.ReferencesToDelete = []
5723 1
        self._freeze = True
5724
5725
    def to_binary(self):
5726
        packet = []
5727
        packet.append(uabin.Primitives.Int32.pack(len(self.ReferencesToDelete)))
5728
        for fieldname in self.ReferencesToDelete:
5729
            packet.append(fieldname.to_binary())
5730
        return b''.join(packet)
5731
5732
    @staticmethod
5733 1
    def from_binary(data):
5734
        return DeleteReferencesParameters(data)
5735
5736
    def _binary_init(self, data):
5737 1
        length = uabin.Primitives.Int32.unpack(data)
5738
        array = []
5739
        if length != -1:
5740
            for _ in range(0, length):
5741
                array.append(DeleteReferencesItem.from_binary(data))
5742
        self.ReferencesToDelete = array
5743
5744
    def __str__(self):
5745
        return 'DeleteReferencesParameters(' + 'ReferencesToDelete:' + str(self.ReferencesToDelete) + ')'
5746
5747
    __repr__ = __str__
5748
5749
5750
class DeleteReferencesRequest(FrozenClass):
5751 1
    '''
5752
    Delete one or more references from the server address space.
5753
5754
    :ivar TypeId:
5755 1
    :vartype TypeId: NodeId
5756
    :ivar RequestHeader:
5757
    :vartype RequestHeader: RequestHeader
5758 1
    :ivar Parameters:
5759
    :vartype Parameters: DeleteReferencesParameters
5760
    '''
5761
5762
    ua_types = {
5763
        'TypeId': 'NodeId',
5764
        'RequestHeader': 'RequestHeader',
5765
        'Parameters': 'DeleteReferencesParameters',
5766
               }
5767
5768
    def __init__(self, binary=None):
5769 1
        if binary is not None:
5770
            self._binary_init(binary)
5771
            self._freeze = True
5772
            return
5773
        self.TypeId = FourByteNodeId(ObjectIds.DeleteReferencesRequest_Encoding_DefaultBinary)
5774
        self.RequestHeader = RequestHeader()
5775
        self.Parameters = DeleteReferencesParameters()
5776
        self._freeze = True
5777
5778
    def to_binary(self):
5779 1
        packet = []
5780
        packet.append(self.TypeId.to_binary())
5781
        packet.append(self.RequestHeader.to_binary())
5782
        packet.append(self.Parameters.to_binary())
5783
        return b''.join(packet)
5784
5785
    @staticmethod
5786 1
    def from_binary(data):
5787
        return DeleteReferencesRequest(data)
5788
5789
    def _binary_init(self, data):
5790 1
        self.TypeId = NodeId.from_binary(data)
5791
        self.RequestHeader = RequestHeader.from_binary(data)
5792
        self.Parameters = DeleteReferencesParameters.from_binary(data)
5793
5794
    def __str__(self):
5795 1
        return 'DeleteReferencesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5796
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5797
               'Parameters:' + str(self.Parameters) + ')'
5798
5799
    __repr__ = __str__
5800 1
5801
5802 View Code Duplication
class DeleteReferencesResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5803 1
    '''
5804
    :ivar Results:
5805
    :vartype Results: StatusCode
5806
    :ivar DiagnosticInfos:
5807
    :vartype DiagnosticInfos: DiagnosticInfo
5808
    '''
5809
5810
    ua_types = {
5811
        'Results': 'StatusCode',
5812
        'DiagnosticInfos': 'DiagnosticInfo',
5813
               }
5814
5815
    def __init__(self, binary=None):
5816 1
        if binary is not None:
5817 1
            self._binary_init(binary)
5818 1
            self._freeze = True
5819 1
            return
5820 1
        self.Results = []
5821 1
        self.DiagnosticInfos = []
5822 1
        self._freeze = True
5823 1
5824 1
    def to_binary(self):
5825 1
        packet = []
5826
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
5827 1
        for fieldname in self.Results:
5828 1
            packet.append(fieldname.to_binary())
5829 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
5830 1
        for fieldname in self.DiagnosticInfos:
5831 1
            packet.append(fieldname.to_binary())
5832 1
        return b''.join(packet)
5833 1
5834
    @staticmethod
5835 1
    def from_binary(data):
5836
        return DeleteReferencesResult(data)
5837 1
5838
    def _binary_init(self, data):
5839 1
        length = uabin.Primitives.Int32.unpack(data)
5840 1
        array = []
5841 1
        if length != -1:
5842 1
            for _ in range(0, length):
5843 1
                array.append(StatusCode.from_binary(data))
5844
        self.Results = array
5845 1
        length = uabin.Primitives.Int32.unpack(data)
5846
        array = []
5847
        if length != -1:
5848
            for _ in range(0, length):
5849
                array.append(DiagnosticInfo.from_binary(data))
5850
        self.DiagnosticInfos = array
5851 1
5852
    def __str__(self):
5853
        return 'DeleteReferencesResult(' + 'Results:' + str(self.Results) + ', ' + \
5854 1
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5855
5856
    __repr__ = __str__
5857
5858
5859
class DeleteReferencesResponse(FrozenClass):
5860
    '''
5861 1
    Delete one or more references from the server address space.
5862 1
5863 1
    :ivar TypeId:
5864 1
    :vartype TypeId: NodeId
5865 1
    :ivar ResponseHeader:
5866 1
    :vartype ResponseHeader: ResponseHeader
5867 1
    :ivar Parameters:
5868
    :vartype Parameters: DeleteReferencesResult
5869 1
    '''
5870 1
5871 1
    ua_types = {
5872 1
        'TypeId': 'NodeId',
5873 1
        'ResponseHeader': 'ResponseHeader',
5874 1
        'Parameters': 'DeleteReferencesResult',
5875
               }
5876 1
5877
    def __init__(self, binary=None):
5878 1
        if binary is not None:
5879
            self._binary_init(binary)
5880 1
            self._freeze = True
5881 1
            return
5882 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteReferencesResponse_Encoding_DefaultBinary)
5883 1
        self.ResponseHeader = ResponseHeader()
5884 1
        self.Parameters = DeleteReferencesResult()
5885 1
        self._freeze = True
5886 1
5887
    def to_binary(self):
5888 1
        packet = []
5889
        packet.append(self.TypeId.to_binary())
5890
        packet.append(self.ResponseHeader.to_binary())
5891 1
        packet.append(self.Parameters.to_binary())
5892
        return b''.join(packet)
5893
5894 1
    @staticmethod
5895
    def from_binary(data):
5896
        return DeleteReferencesResponse(data)
5897
5898
    def _binary_init(self, data):
5899
        self.TypeId = NodeId.from_binary(data)
5900
        self.ResponseHeader = ResponseHeader.from_binary(data)
5901
        self.Parameters = DeleteReferencesResult.from_binary(data)
5902
5903 1
    def __str__(self):
5904 1
        return 'DeleteReferencesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5905 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5906 1
               'Parameters:' + str(self.Parameters) + ')'
5907 1
5908 1
    __repr__ = __str__
5909 1
5910 1
5911 View Code Duplication
class ViewDescription(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5912 1
    '''
5913 1
    The view to browse.
5914 1
5915 1
    :ivar ViewId:
5916 1
    :vartype ViewId: NodeId
5917
    :ivar Timestamp:
5918 1
    :vartype Timestamp: DateTime
5919
    :ivar ViewVersion:
5920 1
    :vartype ViewVersion: UInt32
5921
    '''
5922 1
5923 1
    ua_types = {
5924 1
        'ViewId': 'NodeId',
5925
        'Timestamp': 'DateTime',
5926 1
        'ViewVersion': 'UInt32',
5927
               }
5928
5929
    def __init__(self, binary=None):
5930 1
        if binary is not None:
5931
            self._binary_init(binary)
5932
            self._freeze = True
5933 1
            return
5934
        self.ViewId = NodeId()
5935
        self.Timestamp = datetime.now()
5936
        self.ViewVersion = 0
5937
        self._freeze = True
5938
5939
    def to_binary(self):
5940
        packet = []
5941
        packet.append(self.ViewId.to_binary())
5942 1
        packet.append(uabin.Primitives.DateTime.pack(self.Timestamp))
5943 1
        packet.append(uabin.Primitives.UInt32.pack(self.ViewVersion))
5944 1
        return b''.join(packet)
5945 1
5946 1
    @staticmethod
5947 1
    def from_binary(data):
5948 1
        return ViewDescription(data)
5949 1
5950
    def _binary_init(self, data):
5951 1
        self.ViewId = NodeId.from_binary(data)
5952 1
        self.Timestamp = uabin.Primitives.DateTime.unpack(data)
5953 1
        self.ViewVersion = uabin.Primitives.UInt32.unpack(data)
5954 1
5955 1
    def __str__(self):
5956
        return 'ViewDescription(' + 'ViewId:' + str(self.ViewId) + ', ' + \
5957 1
               'Timestamp:' + str(self.Timestamp) + ', ' + \
5958
               'ViewVersion:' + str(self.ViewVersion) + ')'
5959 1
5960
    __repr__ = __str__
5961 1
5962 1
5963 1 View Code Duplication
class BrowseDescription(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5964
    '''
5965 1
    A request to browse the the references from a node.
5966
5967
    :ivar NodeId:
5968
    :vartype NodeId: NodeId
5969 1
    :ivar BrowseDirection:
5970
    :vartype BrowseDirection: BrowseDirection
5971
    :ivar ReferenceTypeId:
5972 1
    :vartype ReferenceTypeId: NodeId
5973
    :ivar IncludeSubtypes:
5974
    :vartype IncludeSubtypes: Boolean
5975
    :ivar NodeClassMask:
5976
    :vartype NodeClassMask: UInt32
5977
    :ivar ResultMask:
5978
    :vartype ResultMask: UInt32
5979
    '''
5980
5981 1
    ua_types = {
5982 1
        'NodeId': 'NodeId',
5983 1
        'BrowseDirection': 'BrowseDirection',
5984 1
        'ReferenceTypeId': 'NodeId',
5985 1
        'IncludeSubtypes': 'Boolean',
5986 1
        'NodeClassMask': 'UInt32',
5987 1
        'ResultMask': 'UInt32',
5988 1
               }
5989
5990 1
    def __init__(self, binary=None):
5991 1
        if binary is not None:
5992 1
            self._binary_init(binary)
5993 1
            self._freeze = True
5994 1
            return
5995 1
        self.NodeId = NodeId()
5996 1
        self.BrowseDirection = BrowseDirection(0)
5997
        self.ReferenceTypeId = NodeId()
5998 1
        self.IncludeSubtypes = True
5999
        self.NodeClassMask = 0
6000 1
        self.ResultMask = 0
6001
        self._freeze = True
6002 1
6003 1
    def to_binary(self):
6004 1
        packet = []
6005 1
        packet.append(self.NodeId.to_binary())
6006 1
        packet.append(uabin.Primitives.UInt32.pack(self.BrowseDirection.value))
6007 1
        packet.append(self.ReferenceTypeId.to_binary())
6008 1
        packet.append(uabin.Primitives.Boolean.pack(self.IncludeSubtypes))
6009 1
        packet.append(uabin.Primitives.UInt32.pack(self.NodeClassMask))
6010
        packet.append(uabin.Primitives.UInt32.pack(self.ResultMask))
6011 1
        return b''.join(packet)
6012
6013
    @staticmethod
6014
    def from_binary(data):
6015 1
        return BrowseDescription(data)
6016
6017
    def _binary_init(self, data):
6018 1
        self.NodeId = NodeId.from_binary(data)
6019
        self.BrowseDirection = BrowseDirection(uabin.Primitives.UInt32.unpack(data))
6020
        self.ReferenceTypeId = NodeId.from_binary(data)
6021
        self.IncludeSubtypes = uabin.Primitives.Boolean.unpack(data)
6022
        self.NodeClassMask = uabin.Primitives.UInt32.unpack(data)
6023 1
        self.ResultMask = uabin.Primitives.UInt32.unpack(data)
6024 1
6025 1
    def __str__(self):
6026 1
        return 'BrowseDescription(' + 'NodeId:' + str(self.NodeId) + ', ' + \
6027 1
               'BrowseDirection:' + str(self.BrowseDirection) + ', ' + \
6028 1
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
6029 1
               'IncludeSubtypes:' + str(self.IncludeSubtypes) + ', ' + \
6030
               'NodeClassMask:' + str(self.NodeClassMask) + ', ' + \
6031 1
               'ResultMask:' + str(self.ResultMask) + ')'
6032 1
6033 1
    __repr__ = __str__
6034 1
6035 1
6036 1 View Code Duplication
class ReferenceDescription(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6037
    '''
6038 1
    The description of a reference.
6039
6040 1
    :ivar ReferenceTypeId:
6041
    :vartype ReferenceTypeId: NodeId
6042 1
    :ivar IsForward:
6043 1
    :vartype IsForward: Boolean
6044 1
    :ivar NodeId:
6045 1
    :vartype NodeId: ExpandedNodeId
6046 1
    :ivar BrowseName:
6047 1
    :vartype BrowseName: QualifiedName
6048 1
    :ivar DisplayName:
6049
    :vartype DisplayName: LocalizedText
6050 1
    :ivar NodeClass:
6051
    :vartype NodeClass: NodeClass
6052
    :ivar TypeDefinition:
6053 1
    :vartype TypeDefinition: ExpandedNodeId
6054
    '''
6055
6056 1
    ua_types = {
6057
        'ReferenceTypeId': 'NodeId',
6058
        'IsForward': 'Boolean',
6059
        'NodeId': 'ExpandedNodeId',
6060
        'BrowseName': 'QualifiedName',
6061
        'DisplayName': 'LocalizedText',
6062
        'NodeClass': 'NodeClass',
6063
        'TypeDefinition': 'ExpandedNodeId',
6064
               }
6065
6066
    def __init__(self, binary=None):
6067 1
        if binary is not None:
6068 1
            self._binary_init(binary)
6069
            self._freeze = True
6070
            return
6071
        self.ReferenceTypeId = NodeId()
6072 1
        self.IsForward = True
6073 1
        self.NodeId = ExpandedNodeId()
6074 1
        self.BrowseName = QualifiedName()
6075 1
        self.DisplayName = LocalizedText()
6076
        self.NodeClass = NodeClass(0)
6077 1
        self.TypeDefinition = ExpandedNodeId()
6078 1
        self._freeze = True
6079 1
6080 1
    def to_binary(self):
6081 1
        packet = []
6082 1
        packet.append(self.ReferenceTypeId.to_binary())
6083
        packet.append(uabin.Primitives.Boolean.pack(self.IsForward))
6084 1
        packet.append(self.NodeId.to_binary())
6085
        packet.append(self.BrowseName.to_binary())
6086
        packet.append(self.DisplayName.to_binary())
6087
        packet.append(uabin.Primitives.UInt32.pack(self.NodeClass.value))
6088 1
        packet.append(self.TypeDefinition.to_binary())
6089
        return b''.join(packet)
6090
6091
    @staticmethod
6092
    def from_binary(data):
6093 1
        return ReferenceDescription(data)
6094
6095
    def _binary_init(self, data):
6096
        self.ReferenceTypeId = NodeId.from_binary(data)
6097
        self.IsForward = uabin.Primitives.Boolean.unpack(data)
6098 1
        self.NodeId = ExpandedNodeId.from_binary(data)
6099
        self.BrowseName = QualifiedName.from_binary(data)
6100
        self.DisplayName = LocalizedText.from_binary(data)
6101 1
        self.NodeClass = NodeClass(uabin.Primitives.UInt32.unpack(data))
6102
        self.TypeDefinition = ExpandedNodeId.from_binary(data)
6103
6104
    def __str__(self):
6105
        return 'ReferenceDescription(' + 'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
6106
               'IsForward:' + str(self.IsForward) + ', ' + \
6107
               'NodeId:' + str(self.NodeId) + ', ' + \
6108
               'BrowseName:' + str(self.BrowseName) + ', ' + \
6109
               'DisplayName:' + str(self.DisplayName) + ', ' + \
6110
               'NodeClass:' + str(self.NodeClass) + ', ' + \
6111
               'TypeDefinition:' + str(self.TypeDefinition) + ')'
6112
6113
    __repr__ = __str__
6114 1
6115 1
6116 1 View Code Duplication
class BrowseResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6117 1
    '''
6118 1
    The result of a browse operation.
6119 1
6120 1
    :ivar StatusCode:
6121 1
    :vartype StatusCode: StatusCode
6122 1
    :ivar ContinuationPoint:
6123 1
    :vartype ContinuationPoint: ByteString
6124
    :ivar References:
6125 1
    :vartype References: ReferenceDescription
6126 1
    '''
6127 1
6128 1
    ua_types = {
6129 1
        'StatusCode': 'StatusCode',
6130 1
        'ContinuationPoint': 'ByteString',
6131 1
        'References': 'ReferenceDescription',
6132 1
               }
6133 1
6134
    def __init__(self, binary=None):
6135 1
        if binary is not None:
6136
            self._binary_init(binary)
6137 1
            self._freeze = True
6138
            return
6139 1
        self.StatusCode = StatusCode()
6140
        self.ContinuationPoint = None
6141 1
        self.References = []
6142 1
        self._freeze = True
6143 1
6144 1
    def to_binary(self):
6145 1
        packet = []
6146 1
        packet.append(self.StatusCode.to_binary())
6147 1
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
6148 1
        packet.append(uabin.Primitives.Int32.pack(len(self.References)))
6149 1
        for fieldname in self.References:
6150 1
            packet.append(fieldname.to_binary())
6151 1
        return b''.join(packet)
6152 1
6153 1
    @staticmethod
6154
    def from_binary(data):
6155 1
        return BrowseResult(data)
6156
6157 1
    def _binary_init(self, data):
6158
        self.StatusCode = StatusCode.from_binary(data)
6159
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
6160
        length = uabin.Primitives.Int32.unpack(data)
6161
        array = []
6162
        if length != -1:
6163 1
            for _ in range(0, length):
6164
                array.append(ReferenceDescription.from_binary(data))
6165
        self.References = array
6166 1
6167
    def __str__(self):
6168
        return 'BrowseResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
6169
               'ContinuationPoint:' + str(self.ContinuationPoint) + ', ' + \
6170
               'References:' + str(self.References) + ')'
6171 1
6172
    __repr__ = __str__
6173
6174
6175 View Code Duplication
class BrowseParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6176
    '''
6177
    :ivar View:
6178
    :vartype View: ViewDescription
6179 1
    :ivar RequestedMaxReferencesPerNode:
6180
    :vartype RequestedMaxReferencesPerNode: UInt32
6181
    :ivar NodesToBrowse:
6182
    :vartype NodesToBrowse: BrowseDescription
6183
    '''
6184
6185
    ua_types = {
6186 1
        'View': 'ViewDescription',
6187
        'RequestedMaxReferencesPerNode': 'UInt32',
6188
        'NodesToBrowse': 'BrowseDescription',
6189
               }
6190 1
6191
    def __init__(self, binary=None):
6192
        if binary is not None:
6193
            self._binary_init(binary)
6194
            self._freeze = True
6195
            return
6196
        self.View = ViewDescription()
6197
        self.RequestedMaxReferencesPerNode = 0
6198 1
        self.NodesToBrowse = []
6199
        self._freeze = True
6200
6201 1
    def to_binary(self):
6202
        packet = []
6203
        packet.append(self.View.to_binary())
6204 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedMaxReferencesPerNode))
6205
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToBrowse)))
6206
        for fieldname in self.NodesToBrowse:
6207
            packet.append(fieldname.to_binary())
6208
        return b''.join(packet)
6209
6210
    @staticmethod
6211
    def from_binary(data):
6212
        return BrowseParameters(data)
6213
6214
    def _binary_init(self, data):
6215 1
        self.View = ViewDescription.from_binary(data)
6216
        self.RequestedMaxReferencesPerNode = uabin.Primitives.UInt32.unpack(data)
6217
        length = uabin.Primitives.Int32.unpack(data)
6218
        array = []
6219
        if length != -1:
6220
            for _ in range(0, length):
6221
                array.append(BrowseDescription.from_binary(data))
6222
        self.NodesToBrowse = array
6223
6224
    def __str__(self):
6225 1
        return 'BrowseParameters(' + 'View:' + str(self.View) + ', ' + \
6226
               'RequestedMaxReferencesPerNode:' + str(self.RequestedMaxReferencesPerNode) + ', ' + \
6227
               'NodesToBrowse:' + str(self.NodesToBrowse) + ')'
6228
6229
    __repr__ = __str__
6230
6231
6232 1
class BrowseRequest(FrozenClass):
6233
    '''
6234
    Browse the references for one or more nodes from the server address space.
6235
6236 1
    :ivar TypeId:
6237
    :vartype TypeId: NodeId
6238
    :ivar RequestHeader:
6239
    :vartype RequestHeader: RequestHeader
6240
    :ivar Parameters:
6241 1
    :vartype Parameters: BrowseParameters
6242
    '''
6243
6244
    ua_types = {
6245
        'TypeId': 'NodeId',
6246 1
        'RequestHeader': 'RequestHeader',
6247
        'Parameters': 'BrowseParameters',
6248
               }
6249 1
6250
    def __init__(self, binary=None):
6251
        if binary is not None:
6252
            self._binary_init(binary)
6253
            self._freeze = True
6254 1
            return
6255
        self.TypeId = FourByteNodeId(ObjectIds.BrowseRequest_Encoding_DefaultBinary)
6256
        self.RequestHeader = RequestHeader()
6257
        self.Parameters = BrowseParameters()
6258
        self._freeze = True
6259
6260
    def to_binary(self):
6261
        packet = []
6262 1
        packet.append(self.TypeId.to_binary())
6263
        packet.append(self.RequestHeader.to_binary())
6264
        packet.append(self.Parameters.to_binary())
6265
        return b''.join(packet)
6266
6267
    @staticmethod
6268
    def from_binary(data):
6269 1
        return BrowseRequest(data)
6270
6271
    def _binary_init(self, data):
6272
        self.TypeId = NodeId.from_binary(data)
6273 1
        self.RequestHeader = RequestHeader.from_binary(data)
6274
        self.Parameters = BrowseParameters.from_binary(data)
6275
6276
    def __str__(self):
6277
        return 'BrowseRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6278
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
6279
               'Parameters:' + str(self.Parameters) + ')'
6280
6281 1
    __repr__ = __str__
6282
6283
6284 1
class BrowseResponse(FrozenClass):
6285
    '''
6286
    Browse the references for one or more nodes from the server address space.
6287 1
6288
    :ivar TypeId:
6289
    :vartype TypeId: NodeId
6290
    :ivar ResponseHeader:
6291
    :vartype ResponseHeader: ResponseHeader
6292
    :ivar Results:
6293
    :vartype Results: BrowseResult
6294
    :ivar DiagnosticInfos:
6295
    :vartype DiagnosticInfos: DiagnosticInfo
6296
    '''
6297
6298 1
    ua_types = {
6299
        'TypeId': 'NodeId',
6300
        'ResponseHeader': 'ResponseHeader',
6301
        'Results': 'BrowseResult',
6302
        'DiagnosticInfos': 'DiagnosticInfo',
6303
               }
6304
6305
    def __init__(self, binary=None):
6306
        if binary is not None:
6307
            self._binary_init(binary)
6308 1
            self._freeze = True
6309
            return
6310
        self.TypeId = FourByteNodeId(ObjectIds.BrowseResponse_Encoding_DefaultBinary)
6311
        self.ResponseHeader = ResponseHeader()
6312
        self.Results = []
6313
        self.DiagnosticInfos = []
6314
        self._freeze = True
6315 1
6316
    def to_binary(self):
6317
        packet = []
6318
        packet.append(self.TypeId.to_binary())
6319 1
        packet.append(self.ResponseHeader.to_binary())
6320
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
6321
        for fieldname in self.Results:
6322
            packet.append(fieldname.to_binary())
6323
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
6324 1
        for fieldname in self.DiagnosticInfos:
6325
            packet.append(fieldname.to_binary())
6326
        return b''.join(packet)
6327
6328
    @staticmethod
6329 1
    def from_binary(data):
6330
        return BrowseResponse(data)
6331
6332 1
    def _binary_init(self, data):
6333
        self.TypeId = NodeId.from_binary(data)
6334
        self.ResponseHeader = ResponseHeader.from_binary(data)
6335
        length = uabin.Primitives.Int32.unpack(data)
6336
        array = []
6337 1
        if length != -1:
6338
            for _ in range(0, length):
6339
                array.append(BrowseResult.from_binary(data))
6340
        self.Results = array
6341
        length = uabin.Primitives.Int32.unpack(data)
6342
        array = []
6343
        if length != -1:
6344
            for _ in range(0, length):
6345 1
                array.append(DiagnosticInfo.from_binary(data))
6346
        self.DiagnosticInfos = array
6347
6348
    def __str__(self):
6349
        return 'BrowseResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6350
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
6351
               'Results:' + str(self.Results) + ', ' + \
6352 1
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
6353
6354
    __repr__ = __str__
6355
6356 1
6357 View Code Duplication
class BrowseNextParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6358
    '''
6359
    :ivar ReleaseContinuationPoints:
6360
    :vartype ReleaseContinuationPoints: Boolean
6361
    :ivar ContinuationPoints:
6362
    :vartype ContinuationPoints: ByteString
6363
    '''
6364 1
6365
    ua_types = {
6366
        'ReleaseContinuationPoints': 'Boolean',
6367 1
        'ContinuationPoints': 'ByteString',
6368
               }
6369
6370 1
    def __init__(self, binary=None):
6371
        if binary is not None:
6372
            self._binary_init(binary)
6373
            self._freeze = True
6374
            return
6375
        self.ReleaseContinuationPoints = True
6376
        self.ContinuationPoints = []
6377
        self._freeze = True
6378
6379
    def to_binary(self):
6380
        packet = []
6381 1
        packet.append(uabin.Primitives.Boolean.pack(self.ReleaseContinuationPoints))
6382
        packet.append(uabin.Primitives.Int32.pack(len(self.ContinuationPoints)))
6383
        for fieldname in self.ContinuationPoints:
6384
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
6385
        return b''.join(packet)
6386
6387
    @staticmethod
6388
    def from_binary(data):
6389
        return BrowseNextParameters(data)
6390
6391 1
    def _binary_init(self, data):
6392
        self.ReleaseContinuationPoints = uabin.Primitives.Boolean.unpack(data)
6393
        self.ContinuationPoints = uabin.Primitives.ByteString.unpack_array(data)
6394
6395
    def __str__(self):
6396
        return 'BrowseNextParameters(' + 'ReleaseContinuationPoints:' + str(self.ReleaseContinuationPoints) + ', ' + \
6397
               'ContinuationPoints:' + str(self.ContinuationPoints) + ')'
6398 1
6399
    __repr__ = __str__
6400
6401
6402 1
class BrowseNextRequest(FrozenClass):
6403
    '''
6404
    Continues one or more browse operations.
6405
6406
    :ivar TypeId:
6407 1
    :vartype TypeId: NodeId
6408
    :ivar RequestHeader:
6409
    :vartype RequestHeader: RequestHeader
6410
    :ivar Parameters:
6411
    :vartype Parameters: BrowseNextParameters
6412 1
    '''
6413
6414
    ua_types = {
6415 1
        'TypeId': 'NodeId',
6416
        'RequestHeader': 'RequestHeader',
6417
        'Parameters': 'BrowseNextParameters',
6418
               }
6419
6420
    def __init__(self, binary=None):
6421
        if binary is not None:
6422
            self._binary_init(binary)
6423
            self._freeze = True
6424 1
            return
6425
        self.TypeId = FourByteNodeId(ObjectIds.BrowseNextRequest_Encoding_DefaultBinary)
6426
        self.RequestHeader = RequestHeader()
6427
        self.Parameters = BrowseNextParameters()
6428
        self._freeze = True
6429
6430
    def to_binary(self):
6431
        packet = []
6432
        packet.append(self.TypeId.to_binary())
6433 1
        packet.append(self.RequestHeader.to_binary())
6434
        packet.append(self.Parameters.to_binary())
6435
        return b''.join(packet)
6436
6437
    @staticmethod
6438
    def from_binary(data):
6439 1
        return BrowseNextRequest(data)
6440
6441
    def _binary_init(self, data):
6442
        self.TypeId = NodeId.from_binary(data)
6443 1
        self.RequestHeader = RequestHeader.from_binary(data)
6444
        self.Parameters = BrowseNextParameters.from_binary(data)
6445
6446
    def __str__(self):
6447 1
        return 'BrowseNextRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6448
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
6449
               'Parameters:' + str(self.Parameters) + ')'
6450
6451 1
    __repr__ = __str__
6452
6453
6454 1 View Code Duplication
class BrowseNextResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6455
    '''
6456
    :ivar Results:
6457
    :vartype Results: BrowseResult
6458
    :ivar DiagnosticInfos:
6459
    :vartype DiagnosticInfos: DiagnosticInfo
6460
    '''
6461
6462
    ua_types = {
6463
        'Results': 'BrowseResult',
6464
        'DiagnosticInfos': 'DiagnosticInfo',
6465
               }
6466
6467
    def __init__(self, binary=None):
6468
        if binary is not None:
6469
            self._binary_init(binary)
6470
            self._freeze = True
6471
            return
6472
        self.Results = []
6473
        self.DiagnosticInfos = []
6474
        self._freeze = True
6475 1
6476
    def to_binary(self):
6477
        packet = []
6478
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
6479
        for fieldname in self.Results:
6480
            packet.append(fieldname.to_binary())
6481
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
6482
        for fieldname in self.DiagnosticInfos:
6483
            packet.append(fieldname.to_binary())
6484
        return b''.join(packet)
6485
6486
    @staticmethod
6487
    def from_binary(data):
6488
        return BrowseNextResult(data)
6489
6490
    def _binary_init(self, data):
6491 1
        length = uabin.Primitives.Int32.unpack(data)
6492
        array = []
6493
        if length != -1:
6494
            for _ in range(0, length):
6495
                array.append(BrowseResult.from_binary(data))
6496
        self.Results = array
6497
        length = uabin.Primitives.Int32.unpack(data)
6498
        array = []
6499
        if length != -1:
6500
            for _ in range(0, length):
6501
                array.append(DiagnosticInfo.from_binary(data))
6502
        self.DiagnosticInfos = array
6503
6504 1
    def __str__(self):
6505
        return 'BrowseNextResult(' + 'Results:' + str(self.Results) + ', ' + \
6506
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
6507
6508 1
    __repr__ = __str__
6509
6510
6511
class BrowseNextResponse(FrozenClass):
6512
    '''
6513
    Continues one or more browse operations.
6514
6515
    :ivar TypeId:
6516
    :vartype TypeId: NodeId
6517
    :ivar ResponseHeader:
6518
    :vartype ResponseHeader: ResponseHeader
6519 1
    :ivar Parameters:
6520
    :vartype Parameters: BrowseNextResult
6521
    '''
6522
6523
    ua_types = {
6524
        'TypeId': 'NodeId',
6525
        'ResponseHeader': 'ResponseHeader',
6526
        'Parameters': 'BrowseNextResult',
6527
               }
6528
6529
    def __init__(self, binary=None):
6530 1
        if binary is not None:
6531
            self._binary_init(binary)
6532
            self._freeze = True
6533 1
            return
6534
        self.TypeId = FourByteNodeId(ObjectIds.BrowseNextResponse_Encoding_DefaultBinary)
6535
        self.ResponseHeader = ResponseHeader()
6536
        self.Parameters = BrowseNextResult()
6537
        self._freeze = True
6538
6539
    def to_binary(self):
6540
        packet = []
6541
        packet.append(self.TypeId.to_binary())
6542
        packet.append(self.ResponseHeader.to_binary())
6543
        packet.append(self.Parameters.to_binary())
6544
        return b''.join(packet)
6545
6546
    @staticmethod
6547
    def from_binary(data):
6548 1
        return BrowseNextResponse(data)
6549
6550
    def _binary_init(self, data):
6551
        self.TypeId = NodeId.from_binary(data)
6552
        self.ResponseHeader = ResponseHeader.from_binary(data)
6553
        self.Parameters = BrowseNextResult.from_binary(data)
6554
6555
    def __str__(self):
6556
        return 'BrowseNextResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6557
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
6558
               'Parameters:' + str(self.Parameters) + ')'
6559
6560
    __repr__ = __str__
6561 1
6562
6563 View Code Duplication
class RelativePathElement(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6564
    '''
6565
    An element in a relative path.
6566
6567
    :ivar ReferenceTypeId:
6568
    :vartype ReferenceTypeId: NodeId
6569
    :ivar IsInverse:
6570
    :vartype IsInverse: Boolean
6571
    :ivar IncludeSubtypes:
6572
    :vartype IncludeSubtypes: Boolean
6573 1
    :ivar TargetName:
6574
    :vartype TargetName: QualifiedName
6575
    '''
6576
6577 1
    ua_types = {
6578
        'ReferenceTypeId': 'NodeId',
6579
        'IsInverse': 'Boolean',
6580
        'IncludeSubtypes': 'Boolean',
6581
        'TargetName': 'QualifiedName',
6582
               }
6583
6584
    def __init__(self, binary=None):
6585 1
        if binary is not None:
6586
            self._binary_init(binary)
6587
            self._freeze = True
6588
            return
6589
        self.ReferenceTypeId = NodeId()
6590
        self.IsInverse = True
6591
        self.IncludeSubtypes = True
6592
        self.TargetName = QualifiedName()
6593 1
        self._freeze = True
6594
6595
    def to_binary(self):
6596 1
        packet = []
6597
        packet.append(self.ReferenceTypeId.to_binary())
6598
        packet.append(uabin.Primitives.Boolean.pack(self.IsInverse))
6599
        packet.append(uabin.Primitives.Boolean.pack(self.IncludeSubtypes))
6600
        packet.append(self.TargetName.to_binary())
6601
        return b''.join(packet)
6602
6603
    @staticmethod
6604
    def from_binary(data):
6605
        return RelativePathElement(data)
6606
6607
    def _binary_init(self, data):
6608
        self.ReferenceTypeId = NodeId.from_binary(data)
6609
        self.IsInverse = uabin.Primitives.Boolean.unpack(data)
6610
        self.IncludeSubtypes = uabin.Primitives.Boolean.unpack(data)
6611
        self.TargetName = QualifiedName.from_binary(data)
6612
6613
    def __str__(self):
6614
        return 'RelativePathElement(' + 'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
6615
               'IsInverse:' + str(self.IsInverse) + ', ' + \
6616
               'IncludeSubtypes:' + str(self.IncludeSubtypes) + ', ' + \
6617
               'TargetName:' + str(self.TargetName) + ')'
6618
6619 1
    __repr__ = __str__
6620
6621
6622
class RelativePath(FrozenClass):
6623
    '''
6624
    A relative path constructed from reference types and browse names.
6625
6626
    :ivar Elements:
6627
    :vartype Elements: RelativePathElement
6628
    '''
6629
6630
    ua_types = {
6631
        'Elements': 'RelativePathElement',
6632
               }
6633
6634
    def __init__(self, binary=None):
6635
        if binary is not None:
6636 1
            self._binary_init(binary)
6637
            self._freeze = True
6638
            return
6639
        self.Elements = []
6640
        self._freeze = True
6641
6642
    def to_binary(self):
6643
        packet = []
6644
        packet.append(uabin.Primitives.Int32.pack(len(self.Elements)))
6645
        for fieldname in self.Elements:
6646
            packet.append(fieldname.to_binary())
6647
        return b''.join(packet)
6648
6649
    @staticmethod
6650
    def from_binary(data):
6651
        return RelativePath(data)
6652 1
6653
    def _binary_init(self, data):
6654
        length = uabin.Primitives.Int32.unpack(data)
6655
        array = []
6656 1
        if length != -1:
6657
            for _ in range(0, length):
6658
                array.append(RelativePathElement.from_binary(data))
6659
        self.Elements = array
6660
6661
    def __str__(self):
6662
        return 'RelativePath(' + 'Elements:' + str(self.Elements) + ')'
6663
6664
    __repr__ = __str__
6665
6666
6667 View Code Duplication
class BrowsePath(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6668
    '''
6669
    A request to translate a path into a node id.
6670
6671
    :ivar StartingNode:
6672
    :vartype StartingNode: NodeId
6673 1
    :ivar RelativePath:
6674
    :vartype RelativePath: RelativePath
6675
    '''
6676
6677
    ua_types = {
6678
        'StartingNode': 'NodeId',
6679
        'RelativePath': 'RelativePath',
6680
               }
6681
6682
    def __init__(self, binary=None):
6683
        if binary is not None:
6684
            self._binary_init(binary)
6685 1
            self._freeze = True
6686
            return
6687
        self.StartingNode = NodeId()
6688 1
        self.RelativePath = RelativePath()
6689
        self._freeze = True
6690
6691
    def to_binary(self):
6692
        packet = []
6693
        packet.append(self.StartingNode.to_binary())
6694
        packet.append(self.RelativePath.to_binary())
6695
        return b''.join(packet)
6696
6697 1
    @staticmethod
6698
    def from_binary(data):
6699
        return BrowsePath(data)
6700
6701
    def _binary_init(self, data):
6702
        self.StartingNode = NodeId.from_binary(data)
6703
        self.RelativePath = RelativePath.from_binary(data)
6704
6705
    def __str__(self):
6706
        return 'BrowsePath(' + 'StartingNode:' + str(self.StartingNode) + ', ' + \
6707 1
               'RelativePath:' + str(self.RelativePath) + ')'
6708
6709
    __repr__ = __str__
6710
6711
6712 View Code Duplication
class BrowsePathTarget(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6713
    '''
6714 1
    The target of the translated path.
6715
6716
    :ivar TargetId:
6717
    :vartype TargetId: ExpandedNodeId
6718 1
    :ivar RemainingPathIndex:
6719
    :vartype RemainingPathIndex: UInt32
6720
    '''
6721
6722
    ua_types = {
6723 1
        'TargetId': 'ExpandedNodeId',
6724
        'RemainingPathIndex': 'UInt32',
6725
               }
6726
6727
    def __init__(self, binary=None):
6728 1
        if binary is not None:
6729
            self._binary_init(binary)
6730
            self._freeze = True
6731 1
            return
6732
        self.TargetId = ExpandedNodeId()
6733
        self.RemainingPathIndex = 0
6734
        self._freeze = True
6735
6736
    def to_binary(self):
6737
        packet = []
6738
        packet.append(self.TargetId.to_binary())
6739
        packet.append(uabin.Primitives.UInt32.pack(self.RemainingPathIndex))
6740 1
        return b''.join(packet)
6741
6742
    @staticmethod
6743
    def from_binary(data):
6744
        return BrowsePathTarget(data)
6745
6746
    def _binary_init(self, data):
6747
        self.TargetId = ExpandedNodeId.from_binary(data)
6748
        self.RemainingPathIndex = uabin.Primitives.UInt32.unpack(data)
6749
6750 1
    def __str__(self):
6751
        return 'BrowsePathTarget(' + 'TargetId:' + str(self.TargetId) + ', ' + \
6752
               'RemainingPathIndex:' + str(self.RemainingPathIndex) + ')'
6753
6754
    __repr__ = __str__
6755
6756
6757 View Code Duplication
class BrowsePathResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6758
    '''
6759 1
    The result of a translate opearation.
6760
6761
    :ivar StatusCode:
6762
    :vartype StatusCode: StatusCode
6763 1
    :ivar Targets:
6764
    :vartype Targets: BrowsePathTarget
6765
    '''
6766
6767
    ua_types = {
6768
        'StatusCode': 'StatusCode',
6769
        'Targets': 'BrowsePathTarget',
6770
               }
6771
6772
    def __init__(self, binary=None):
6773 1
        if binary is not None:
6774
            self._binary_init(binary)
6775
            self._freeze = True
6776
            return
6777
        self.StatusCode = StatusCode()
6778 1
        self.Targets = []
6779
        self._freeze = True
6780
6781 1
    def to_binary(self):
6782
        packet = []
6783
        packet.append(self.StatusCode.to_binary())
6784
        packet.append(uabin.Primitives.Int32.pack(len(self.Targets)))
6785
        for fieldname in self.Targets:
6786
            packet.append(fieldname.to_binary())
6787
        return b''.join(packet)
6788
6789
    @staticmethod
6790 1
    def from_binary(data):
6791
        return BrowsePathResult(data)
6792
6793
    def _binary_init(self, data):
6794
        self.StatusCode = StatusCode.from_binary(data)
6795
        length = uabin.Primitives.Int32.unpack(data)
6796
        array = []
6797
        if length != -1:
6798
            for _ in range(0, length):
6799
                array.append(BrowsePathTarget.from_binary(data))
6800 1
        self.Targets = array
6801
6802
    def __str__(self):
6803
        return 'BrowsePathResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
6804
               'Targets:' + str(self.Targets) + ')'
6805
6806
    __repr__ = __str__
6807
6808
6809 1
class TranslateBrowsePathsToNodeIdsParameters(FrozenClass):
6810
    '''
6811
    :ivar BrowsePaths:
6812
    :vartype BrowsePaths: BrowsePath
6813 1
    '''
6814
6815
    ua_types = {
6816
        'BrowsePaths': 'BrowsePath',
6817
               }
6818
6819
    def __init__(self, binary=None):
6820
        if binary is not None:
6821
            self._binary_init(binary)
6822
            self._freeze = True
6823 1
            return
6824
        self.BrowsePaths = []
6825
        self._freeze = True
6826
6827
    def to_binary(self):
6828 1
        packet = []
6829
        packet.append(uabin.Primitives.Int32.pack(len(self.BrowsePaths)))
6830
        for fieldname in self.BrowsePaths:
6831 1
            packet.append(fieldname.to_binary())
6832
        return b''.join(packet)
6833
6834
    @staticmethod
6835
    def from_binary(data):
6836
        return TranslateBrowsePathsToNodeIdsParameters(data)
6837
6838
    def _binary_init(self, data):
6839
        length = uabin.Primitives.Int32.unpack(data)
6840
        array = []
6841
        if length != -1:
6842 1
            for _ in range(0, length):
6843
                array.append(BrowsePath.from_binary(data))
6844
        self.BrowsePaths = array
6845
6846
    def __str__(self):
6847
        return 'TranslateBrowsePathsToNodeIdsParameters(' + 'BrowsePaths:' + str(self.BrowsePaths) + ')'
6848
6849
    __repr__ = __str__
6850
6851
6852
class TranslateBrowsePathsToNodeIdsRequest(FrozenClass):
6853 1
    '''
6854
    Translates one or more paths in the server address space.
6855
6856
    :ivar TypeId:
6857
    :vartype TypeId: NodeId
6858
    :ivar RequestHeader:
6859
    :vartype RequestHeader: RequestHeader
6860
    :ivar Parameters:
6861
    :vartype Parameters: TranslateBrowsePathsToNodeIdsParameters
6862
    '''
6863 1
6864
    ua_types = {
6865
        'TypeId': 'NodeId',
6866
        'RequestHeader': 'RequestHeader',
6867 1
        'Parameters': 'TranslateBrowsePathsToNodeIdsParameters',
6868
               }
6869
6870
    def __init__(self, binary=None):
6871
        if binary is not None:
6872
            self._binary_init(binary)
6873
            self._freeze = True
6874
            return
6875
        self.TypeId = FourByteNodeId(ObjectIds.TranslateBrowsePathsToNodeIdsRequest_Encoding_DefaultBinary)
6876
        self.RequestHeader = RequestHeader()
6877
        self.Parameters = TranslateBrowsePathsToNodeIdsParameters()
6878 1
        self._freeze = True
6879
6880
    def to_binary(self):
6881
        packet = []
6882
        packet.append(self.TypeId.to_binary())
6883
        packet.append(self.RequestHeader.to_binary())
6884 1
        packet.append(self.Parameters.to_binary())
6885
        return b''.join(packet)
6886
6887 1
    @staticmethod
6888
    def from_binary(data):
6889
        return TranslateBrowsePathsToNodeIdsRequest(data)
6890
6891
    def _binary_init(self, data):
6892
        self.TypeId = NodeId.from_binary(data)
6893
        self.RequestHeader = RequestHeader.from_binary(data)
6894 1
        self.Parameters = TranslateBrowsePathsToNodeIdsParameters.from_binary(data)
6895
6896
    def __str__(self):
6897
        return 'TranslateBrowsePathsToNodeIdsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6898
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
6899
               'Parameters:' + str(self.Parameters) + ')'
6900
6901
    __repr__ = __str__
6902
6903 1
6904
class TranslateBrowsePathsToNodeIdsResponse(FrozenClass):
6905
    '''
6906
    Translates one or more paths in the server address space.
6907
6908
    :ivar TypeId:
6909
    :vartype TypeId: NodeId
6910
    :ivar ResponseHeader:
6911 1
    :vartype ResponseHeader: ResponseHeader
6912
    :ivar Results:
6913
    :vartype Results: BrowsePathResult
6914
    :ivar DiagnosticInfos:
6915 1
    :vartype DiagnosticInfos: DiagnosticInfo
6916
    '''
6917
6918
    ua_types = {
6919
        'TypeId': 'NodeId',
6920
        'ResponseHeader': 'ResponseHeader',
6921
        'Results': 'BrowsePathResult',
6922
        'DiagnosticInfos': 'DiagnosticInfo',
6923
               }
6924 1
6925
    def __init__(self, binary=None):
6926
        if binary is not None:
6927
            self._binary_init(binary)
6928 1
            self._freeze = True
6929
            return
6930
        self.TypeId = FourByteNodeId(ObjectIds.TranslateBrowsePathsToNodeIdsResponse_Encoding_DefaultBinary)
6931 1
        self.ResponseHeader = ResponseHeader()
6932
        self.Results = []
6933
        self.DiagnosticInfos = []
6934
        self._freeze = True
6935
6936 1
    def to_binary(self):
6937 1
        packet = []
6938 1
        packet.append(self.TypeId.to_binary())
6939 1
        packet.append(self.ResponseHeader.to_binary())
6940 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
6941 1
        for fieldname in self.Results:
6942 1
            packet.append(fieldname.to_binary())
6943
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
6944 1
        for fieldname in self.DiagnosticInfos:
6945 1
            packet.append(fieldname.to_binary())
6946 1
        return b''.join(packet)
6947 1
6948
    @staticmethod
6949 1
    def from_binary(data):
6950
        return TranslateBrowsePathsToNodeIdsResponse(data)
6951 1
6952
    def _binary_init(self, data):
6953 1
        self.TypeId = NodeId.from_binary(data)
6954
        self.ResponseHeader = ResponseHeader.from_binary(data)
6955 1
        length = uabin.Primitives.Int32.unpack(data)
6956 1
        array = []
6957 1
        if length != -1:
6958 1
            for _ in range(0, length):
6959 1
                array.append(BrowsePathResult.from_binary(data))
6960
        self.Results = array
6961 1
        length = uabin.Primitives.Int32.unpack(data)
6962
        array = []
6963 1
        if length != -1:
6964
            for _ in range(0, length):
6965
                array.append(DiagnosticInfo.from_binary(data))
6966 1
        self.DiagnosticInfos = array
6967
6968
    def __str__(self):
6969 1
        return 'TranslateBrowsePathsToNodeIdsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6970
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
6971
               'Results:' + str(self.Results) + ', ' + \
6972
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
6973
6974 1
    __repr__ = __str__
6975
6976
6977
class RegisterNodesParameters(FrozenClass):
6978
    '''
6979
    :ivar NodesToRegister:
6980
    :vartype NodesToRegister: NodeId
6981
    '''
6982 1
6983
    ua_types = {
6984
        'NodesToRegister': 'NodeId',
6985
               }
6986
6987 1
    def __init__(self, binary=None):
6988
        if binary is not None:
6989
            self._binary_init(binary)
6990
            self._freeze = True
6991 1
            return
6992
        self.NodesToRegister = []
6993
        self._freeze = True
6994 1
6995
    def to_binary(self):
6996
        packet = []
6997 1
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToRegister)))
6998
        for fieldname in self.NodesToRegister:
6999
            packet.append(fieldname.to_binary())
7000 1
        return b''.join(packet)
7001
7002
    @staticmethod
7003
    def from_binary(data):
7004
        return RegisterNodesParameters(data)
7005 1
7006
    def _binary_init(self, data):
7007
        length = uabin.Primitives.Int32.unpack(data)
7008
        array = []
7009
        if length != -1:
7010
            for _ in range(0, length):
7011
                array.append(NodeId.from_binary(data))
7012
        self.NodesToRegister = array
7013 1
7014
    def __str__(self):
7015
        return 'RegisterNodesParameters(' + 'NodesToRegister:' + str(self.NodesToRegister) + ')'
7016
7017
    __repr__ = __str__
7018 1
7019
7020
class RegisterNodesRequest(FrozenClass):
7021
    '''
7022 1
    Registers one or more nodes for repeated use within a session.
7023
7024
    :ivar TypeId:
7025 1
    :vartype TypeId: NodeId
7026
    :ivar RequestHeader:
7027
    :vartype RequestHeader: RequestHeader
7028 1
    :ivar Parameters:
7029
    :vartype Parameters: RegisterNodesParameters
7030
    '''
7031 1
7032
    ua_types = {
7033
        'TypeId': 'NodeId',
7034
        'RequestHeader': 'RequestHeader',
7035
        'Parameters': 'RegisterNodesParameters',
7036
               }
7037
7038
    def __init__(self, binary=None):
7039
        if binary is not None:
7040
            self._binary_init(binary)
7041
            self._freeze = True
7042
            return
7043
        self.TypeId = FourByteNodeId(ObjectIds.RegisterNodesRequest_Encoding_DefaultBinary)
7044 1
        self.RequestHeader = RequestHeader()
7045
        self.Parameters = RegisterNodesParameters()
7046
        self._freeze = True
7047
7048
    def to_binary(self):
7049
        packet = []
7050
        packet.append(self.TypeId.to_binary())
7051
        packet.append(self.RequestHeader.to_binary())
7052
        packet.append(self.Parameters.to_binary())
7053
        return b''.join(packet)
7054
7055
    @staticmethod
7056 1
    def from_binary(data):
7057
        return RegisterNodesRequest(data)
7058
7059
    def _binary_init(self, data):
7060
        self.TypeId = NodeId.from_binary(data)
7061
        self.RequestHeader = RequestHeader.from_binary(data)
7062
        self.Parameters = RegisterNodesParameters.from_binary(data)
7063
7064
    def __str__(self):
7065 1
        return 'RegisterNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7066
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
7067
               'Parameters:' + str(self.Parameters) + ')'
7068
7069 1
    __repr__ = __str__
7070
7071
7072
class RegisterNodesResult(FrozenClass):
7073
    '''
7074
    :ivar RegisteredNodeIds:
7075
    :vartype RegisteredNodeIds: NodeId
7076 1
    '''
7077
7078
    ua_types = {
7079
        'RegisteredNodeIds': 'NodeId',
7080
               }
7081
7082
    def __init__(self, binary=None):
7083 1
        if binary is not None:
7084
            self._binary_init(binary)
7085
            self._freeze = True
7086 1
            return
7087
        self.RegisteredNodeIds = []
7088
        self._freeze = True
7089
7090
    def to_binary(self):
7091
        packet = []
7092
        packet.append(uabin.Primitives.Int32.pack(len(self.RegisteredNodeIds)))
7093
        for fieldname in self.RegisteredNodeIds:
7094
            packet.append(fieldname.to_binary())
7095
        return b''.join(packet)
7096
7097 1
    @staticmethod
7098 1
    def from_binary(data):
7099 1
        return RegisterNodesResult(data)
7100 1
7101 1
    def _binary_init(self, data):
7102 1
        length = uabin.Primitives.Int32.unpack(data)
7103 1
        array = []
7104 1
        if length != -1:
7105 1
            for _ in range(0, length):
7106 1
                array.append(NodeId.from_binary(data))
7107
        self.RegisteredNodeIds = array
7108 1
7109 1
    def __str__(self):
7110 1
        return 'RegisterNodesResult(' + 'RegisteredNodeIds:' + str(self.RegisteredNodeIds) + ')'
7111 1
7112 1
    __repr__ = __str__
7113 1
7114 1
7115 1
class RegisterNodesResponse(FrozenClass):
7116 1
    '''
7117
    Registers one or more nodes for repeated use within a session.
7118 1
7119
    :ivar TypeId:
7120 1
    :vartype TypeId: NodeId
7121
    :ivar ResponseHeader:
7122 1
    :vartype ResponseHeader: ResponseHeader
7123 1
    :ivar Parameters:
7124 1
    :vartype Parameters: RegisterNodesResult
7125 1
    '''
7126 1
7127 1
    ua_types = {
7128 1
        'TypeId': 'NodeId',
7129 1
        'ResponseHeader': 'ResponseHeader',
7130 1
        'Parameters': 'RegisterNodesResult',
7131 1
               }
7132
7133 1
    def __init__(self, binary=None):
7134
        if binary is not None:
7135
            self._binary_init(binary)
7136
            self._freeze = True
7137
            return
7138
        self.TypeId = FourByteNodeId(ObjectIds.RegisterNodesResponse_Encoding_DefaultBinary)
7139 1
        self.ResponseHeader = ResponseHeader()
7140
        self.Parameters = RegisterNodesResult()
7141
        self._freeze = True
7142 1
7143
    def to_binary(self):
7144
        packet = []
7145
        packet.append(self.TypeId.to_binary())
7146
        packet.append(self.ResponseHeader.to_binary())
7147
        packet.append(self.Parameters.to_binary())
7148
        return b''.join(packet)
7149
7150
    @staticmethod
7151 1
    def from_binary(data):
7152
        return RegisterNodesResponse(data)
7153
7154
    def _binary_init(self, data):
7155
        self.TypeId = NodeId.from_binary(data)
7156
        self.ResponseHeader = ResponseHeader.from_binary(data)
7157
        self.Parameters = RegisterNodesResult.from_binary(data)
7158
7159
    def __str__(self):
7160
        return 'RegisterNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7161 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
7162
               'Parameters:' + str(self.Parameters) + ')'
7163
7164
    __repr__ = __str__
7165
7166
7167
class UnregisterNodesParameters(FrozenClass):
7168
    '''
7169
    :ivar NodesToUnregister:
7170
    :vartype NodesToUnregister: NodeId
7171
    '''
7172 1
7173
    ua_types = {
7174
        'NodesToUnregister': 'NodeId',
7175
               }
7176 1
7177
    def __init__(self, binary=None):
7178
        if binary is not None:
7179
            self._binary_init(binary)
7180
            self._freeze = True
7181
            return
7182
        self.NodesToUnregister = []
7183
        self._freeze = True
7184
7185
    def to_binary(self):
7186
        packet = []
7187
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToUnregister)))
7188
        for fieldname in self.NodesToUnregister:
7189
            packet.append(fieldname.to_binary())
7190
        return b''.join(packet)
7191 1
7192
    @staticmethod
7193
    def from_binary(data):
7194
        return UnregisterNodesParameters(data)
7195
7196 1
    def _binary_init(self, data):
7197
        length = uabin.Primitives.Int32.unpack(data)
7198
        array = []
7199 1
        if length != -1:
7200
            for _ in range(0, length):
7201
                array.append(NodeId.from_binary(data))
7202
        self.NodesToUnregister = array
7203
7204
    def __str__(self):
7205
        return 'UnregisterNodesParameters(' + 'NodesToUnregister:' + str(self.NodesToUnregister) + ')'
7206 1
7207 1
    __repr__ = __str__
7208 1
7209 1
7210 1
class UnregisterNodesRequest(FrozenClass):
7211 1
    '''
7212 1
    Unregisters one or more previously registered nodes.
7213 1
7214
    :ivar TypeId:
7215 1
    :vartype TypeId: NodeId
7216 1
    :ivar RequestHeader:
7217 1
    :vartype RequestHeader: RequestHeader
7218 1
    :ivar Parameters:
7219
    :vartype Parameters: UnregisterNodesParameters
7220 1
    '''
7221 1
7222
    ua_types = {
7223 1
        'TypeId': 'NodeId',
7224
        'RequestHeader': 'RequestHeader',
7225 1
        'Parameters': 'UnregisterNodesParameters',
7226
               }
7227 1
7228
    def __init__(self, binary=None):
7229 1
        if binary is not None:
7230 1
            self._binary_init(binary)
7231 1
            self._freeze = True
7232 1
            return
7233 1
        self.TypeId = FourByteNodeId(ObjectIds.UnregisterNodesRequest_Encoding_DefaultBinary)
7234
        self.RequestHeader = RequestHeader()
7235 1
        self.Parameters = UnregisterNodesParameters()
7236 1
        self._freeze = True
7237 1
7238 1
    def to_binary(self):
7239 1
        packet = []
7240
        packet.append(self.TypeId.to_binary())
7241 1
        packet.append(self.RequestHeader.to_binary())
7242
        packet.append(self.Parameters.to_binary())
7243 1
        return b''.join(packet)
7244
7245
    @staticmethod
7246
    def from_binary(data):
7247 1
        return UnregisterNodesRequest(data)
7248
7249
    def _binary_init(self, data):
7250 1
        self.TypeId = NodeId.from_binary(data)
7251
        self.RequestHeader = RequestHeader.from_binary(data)
7252
        self.Parameters = UnregisterNodesParameters.from_binary(data)
7253
7254
    def __str__(self):
7255
        return 'UnregisterNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7256
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
7257
               'Parameters:' + str(self.Parameters) + ')'
7258
7259 1
    __repr__ = __str__
7260
7261
7262 View Code Duplication
class UnregisterNodesResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7263
    '''
7264
    Unregisters one or more previously registered nodes.
7265
7266
    :ivar TypeId:
7267
    :vartype TypeId: NodeId
7268
    :ivar ResponseHeader:
7269 1
    :vartype ResponseHeader: ResponseHeader
7270
    '''
7271
7272
    ua_types = {
7273
        'TypeId': 'NodeId',
7274
        'ResponseHeader': 'ResponseHeader',
7275
               }
7276
7277
    def __init__(self, binary=None):
7278
        if binary is not None:
7279
            self._binary_init(binary)
7280 1
            self._freeze = True
7281
            return
7282
        self.TypeId = FourByteNodeId(ObjectIds.UnregisterNodesResponse_Encoding_DefaultBinary)
7283
        self.ResponseHeader = ResponseHeader()
7284 1
        self._freeze = True
7285
7286
    def to_binary(self):
7287
        packet = []
7288
        packet.append(self.TypeId.to_binary())
7289
        packet.append(self.ResponseHeader.to_binary())
7290
        return b''.join(packet)
7291
7292
    @staticmethod
7293
    def from_binary(data):
7294
        return UnregisterNodesResponse(data)
7295
7296
    def _binary_init(self, data):
7297
        self.TypeId = NodeId.from_binary(data)
7298
        self.ResponseHeader = ResponseHeader.from_binary(data)
7299 1
7300
    def __str__(self):
7301
        return 'UnregisterNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7302
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
7303
7304 1
    __repr__ = __str__
7305
7306
7307 1
class EndpointConfiguration(FrozenClass):
7308
    '''
7309
    :ivar OperationTimeout:
7310
    :vartype OperationTimeout: Int32
7311
    :ivar UseBinaryEncoding:
7312
    :vartype UseBinaryEncoding: Boolean
7313
    :ivar MaxStringLength:
7314
    :vartype MaxStringLength: Int32
7315
    :ivar MaxByteStringLength:
7316
    :vartype MaxByteStringLength: Int32
7317
    :ivar MaxArrayLength:
7318
    :vartype MaxArrayLength: Int32
7319
    :ivar MaxMessageSize:
7320 1
    :vartype MaxMessageSize: Int32
7321
    :ivar MaxBufferSize:
7322
    :vartype MaxBufferSize: Int32
7323
    :ivar ChannelLifetime:
7324
    :vartype ChannelLifetime: Int32
7325
    :ivar SecurityTokenLifetime:
7326
    :vartype SecurityTokenLifetime: Int32
7327
    '''
7328
7329
    ua_types = {
7330
        'OperationTimeout': 'Int32',
7331
        'UseBinaryEncoding': 'Boolean',
7332 1
        'MaxStringLength': 'Int32',
7333
        'MaxByteStringLength': 'Int32',
7334
        'MaxArrayLength': 'Int32',
7335
        'MaxMessageSize': 'Int32',
7336
        'MaxBufferSize': 'Int32',
7337
        'ChannelLifetime': 'Int32',
7338
        'SecurityTokenLifetime': 'Int32',
7339
               }
7340
7341
    def __init__(self, binary=None):
7342
        if binary is not None:
7343 1
            self._binary_init(binary)
7344
            self._freeze = True
7345
            return
7346
        self.OperationTimeout = 0
7347 1
        self.UseBinaryEncoding = True
7348
        self.MaxStringLength = 0
7349
        self.MaxByteStringLength = 0
7350
        self.MaxArrayLength = 0
7351
        self.MaxMessageSize = 0
7352
        self.MaxBufferSize = 0
7353
        self.ChannelLifetime = 0
7354
        self.SecurityTokenLifetime = 0
7355
        self._freeze = True
7356
7357
    def to_binary(self):
7358
        packet = []
7359 1
        packet.append(uabin.Primitives.Int32.pack(self.OperationTimeout))
7360
        packet.append(uabin.Primitives.Boolean.pack(self.UseBinaryEncoding))
7361
        packet.append(uabin.Primitives.Int32.pack(self.MaxStringLength))
7362
        packet.append(uabin.Primitives.Int32.pack(self.MaxByteStringLength))
7363
        packet.append(uabin.Primitives.Int32.pack(self.MaxArrayLength))
7364
        packet.append(uabin.Primitives.Int32.pack(self.MaxMessageSize))
7365
        packet.append(uabin.Primitives.Int32.pack(self.MaxBufferSize))
7366 1
        packet.append(uabin.Primitives.Int32.pack(self.ChannelLifetime))
7367
        packet.append(uabin.Primitives.Int32.pack(self.SecurityTokenLifetime))
7368
        return b''.join(packet)
7369 1
7370
    @staticmethod
7371
    def from_binary(data):
7372
        return EndpointConfiguration(data)
7373
7374
    def _binary_init(self, data):
7375
        self.OperationTimeout = uabin.Primitives.Int32.unpack(data)
7376
        self.UseBinaryEncoding = uabin.Primitives.Boolean.unpack(data)
7377
        self.MaxStringLength = uabin.Primitives.Int32.unpack(data)
7378 1
        self.MaxByteStringLength = uabin.Primitives.Int32.unpack(data)
7379
        self.MaxArrayLength = uabin.Primitives.Int32.unpack(data)
7380
        self.MaxMessageSize = uabin.Primitives.Int32.unpack(data)
7381
        self.MaxBufferSize = uabin.Primitives.Int32.unpack(data)
7382
        self.ChannelLifetime = uabin.Primitives.Int32.unpack(data)
7383
        self.SecurityTokenLifetime = uabin.Primitives.Int32.unpack(data)
7384
7385
    def __str__(self):
7386
        return 'EndpointConfiguration(' + 'OperationTimeout:' + str(self.OperationTimeout) + ', ' + \
7387
               'UseBinaryEncoding:' + str(self.UseBinaryEncoding) + ', ' + \
7388 1
               'MaxStringLength:' + str(self.MaxStringLength) + ', ' + \
7389
               'MaxByteStringLength:' + str(self.MaxByteStringLength) + ', ' + \
7390
               'MaxArrayLength:' + str(self.MaxArrayLength) + ', ' + \
7391
               'MaxMessageSize:' + str(self.MaxMessageSize) + ', ' + \
7392
               'MaxBufferSize:' + str(self.MaxBufferSize) + ', ' + \
7393
               'ChannelLifetime:' + str(self.ChannelLifetime) + ', ' + \
7394
               'SecurityTokenLifetime:' + str(self.SecurityTokenLifetime) + ')'
7395 1
7396
    __repr__ = __str__
7397
7398
7399 1
class SupportedProfile(FrozenClass):
7400
    '''
7401
    :ivar OrganizationUri:
7402
    :vartype OrganizationUri: String
7403
    :ivar ProfileId:
7404 1
    :vartype ProfileId: String
7405
    :ivar ComplianceTool:
7406
    :vartype ComplianceTool: String
7407
    :ivar ComplianceDate:
7408
    :vartype ComplianceDate: DateTime
7409 1
    :ivar ComplianceLevel:
7410
    :vartype ComplianceLevel: ComplianceLevel
7411
    :ivar UnsupportedUnitIds:
7412 1
    :vartype UnsupportedUnitIds: String
7413
    '''
7414
7415
    ua_types = {
7416
        'OrganizationUri': 'String',
7417
        'ProfileId': 'String',
7418
        'ComplianceTool': 'String',
7419
        'ComplianceDate': 'DateTime',
7420
        'ComplianceLevel': 'ComplianceLevel',
7421
        'UnsupportedUnitIds': 'String',
7422
               }
7423
7424
    def __init__(self, binary=None):
7425 1
        if binary is not None:
7426
            self._binary_init(binary)
7427
            self._freeze = True
7428
            return
7429
        self.OrganizationUri = None
7430
        self.ProfileId = None
7431
        self.ComplianceTool = None
7432
        self.ComplianceDate = datetime.now()
7433
        self.ComplianceLevel = ComplianceLevel(0)
7434
        self.UnsupportedUnitIds = []
7435
        self._freeze = True
7436
7437 1 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7438
        packet = []
7439
        packet.append(uabin.Primitives.String.pack(self.OrganizationUri))
7440
        packet.append(uabin.Primitives.String.pack(self.ProfileId))
7441
        packet.append(uabin.Primitives.String.pack(self.ComplianceTool))
7442
        packet.append(uabin.Primitives.DateTime.pack(self.ComplianceDate))
7443
        packet.append(uabin.Primitives.UInt32.pack(self.ComplianceLevel.value))
7444
        packet.append(uabin.Primitives.Int32.pack(len(self.UnsupportedUnitIds)))
7445
        for fieldname in self.UnsupportedUnitIds:
7446
            packet.append(uabin.Primitives.String.pack(fieldname))
7447
        return b''.join(packet)
7448
7449
    @staticmethod
7450
    def from_binary(data):
7451
        return SupportedProfile(data)
7452 1
7453
    def _binary_init(self, data):
7454
        self.OrganizationUri = uabin.Primitives.String.unpack(data)
7455
        self.ProfileId = uabin.Primitives.String.unpack(data)
7456 1
        self.ComplianceTool = uabin.Primitives.String.unpack(data)
7457 View Code Duplication
        self.ComplianceDate = uabin.Primitives.DateTime.unpack(data)
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7458
        self.ComplianceLevel = ComplianceLevel(uabin.Primitives.UInt32.unpack(data))
7459
        self.UnsupportedUnitIds = uabin.Primitives.String.unpack_array(data)
7460
7461
    def __str__(self):
7462
        return 'SupportedProfile(' + 'OrganizationUri:' + str(self.OrganizationUri) + ', ' + \
7463
               'ProfileId:' + str(self.ProfileId) + ', ' + \
7464
               'ComplianceTool:' + str(self.ComplianceTool) + ', ' + \
7465
               'ComplianceDate:' + str(self.ComplianceDate) + ', ' + \
7466
               'ComplianceLevel:' + str(self.ComplianceLevel) + ', ' + \
7467
               'UnsupportedUnitIds:' + str(self.UnsupportedUnitIds) + ')'
7468
7469
    __repr__ = __str__
7470
7471
7472
class SoftwareCertificate(FrozenClass):
7473
    '''
7474
    :ivar ProductName:
7475
    :vartype ProductName: String
7476
    :ivar ProductUri:
7477
    :vartype ProductUri: String
7478 1
    :ivar VendorName:
7479
    :vartype VendorName: String
7480
    :ivar VendorProductCertificate:
7481
    :vartype VendorProductCertificate: ByteString
7482
    :ivar SoftwareVersion:
7483
    :vartype SoftwareVersion: String
7484
    :ivar BuildNumber:
7485 1
    :vartype BuildNumber: String
7486
    :ivar BuildDate:
7487
    :vartype BuildDate: DateTime
7488 1
    :ivar IssuedBy:
7489
    :vartype IssuedBy: String
7490
    :ivar IssueDate:
7491
    :vartype IssueDate: DateTime
7492
    :ivar SupportedProfiles:
7493
    :vartype SupportedProfiles: SupportedProfile
7494
    '''
7495
7496
    ua_types = {
7497 1
        'ProductName': 'String',
7498
        'ProductUri': 'String',
7499
        'VendorName': 'String',
7500
        'VendorProductCertificate': 'ByteString',
7501
        'SoftwareVersion': 'String',
7502
        'BuildNumber': 'String',
7503
        'BuildDate': 'DateTime',
7504
        'IssuedBy': 'String',
7505
        'IssueDate': 'DateTime',
7506
        'SupportedProfiles': 'SupportedProfile',
7507 1
               }
7508
7509
    def __init__(self, binary=None):
7510
        if binary is not None:
7511
            self._binary_init(binary)
7512
            self._freeze = True
7513
            return
7514 1
        self.ProductName = None
7515
        self.ProductUri = None
7516
        self.VendorName = None
7517
        self.VendorProductCertificate = None
7518 1
        self.SoftwareVersion = None
7519
        self.BuildNumber = None
7520
        self.BuildDate = datetime.now()
7521
        self.IssuedBy = None
7522
        self.IssueDate = datetime.now()
7523 1
        self.SupportedProfiles = []
7524
        self._freeze = True
7525
7526
    def to_binary(self):
7527
        packet = []
7528 1
        packet.append(uabin.Primitives.String.pack(self.ProductName))
7529
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
7530
        packet.append(uabin.Primitives.String.pack(self.VendorName))
7531 1
        packet.append(uabin.Primitives.ByteString.pack(self.VendorProductCertificate))
7532
        packet.append(uabin.Primitives.String.pack(self.SoftwareVersion))
7533
        packet.append(uabin.Primitives.String.pack(self.BuildNumber))
7534
        packet.append(uabin.Primitives.DateTime.pack(self.BuildDate))
7535
        packet.append(uabin.Primitives.String.pack(self.IssuedBy))
7536
        packet.append(uabin.Primitives.DateTime.pack(self.IssueDate))
7537
        packet.append(uabin.Primitives.Int32.pack(len(self.SupportedProfiles)))
7538 1
        for fieldname in self.SupportedProfiles:
7539
            packet.append(fieldname.to_binary())
7540
        return b''.join(packet)
7541
7542
    @staticmethod
7543
    def from_binary(data):
7544
        return SoftwareCertificate(data)
7545
7546
    def _binary_init(self, data):
7547 1
        self.ProductName = uabin.Primitives.String.unpack(data)
7548
        self.ProductUri = uabin.Primitives.String.unpack(data)
7549
        self.VendorName = uabin.Primitives.String.unpack(data)
7550
        self.VendorProductCertificate = uabin.Primitives.ByteString.unpack(data)
7551
        self.SoftwareVersion = uabin.Primitives.String.unpack(data)
7552
        self.BuildNumber = uabin.Primitives.String.unpack(data)
7553 1
        self.BuildDate = uabin.Primitives.DateTime.unpack(data)
7554
        self.IssuedBy = uabin.Primitives.String.unpack(data)
7555
        self.IssueDate = uabin.Primitives.DateTime.unpack(data)
7556
        length = uabin.Primitives.Int32.unpack(data)
7557 1
        array = []
7558
        if length != -1:
7559
            for _ in range(0, length):
7560
                array.append(SupportedProfile.from_binary(data))
7561 1
        self.SupportedProfiles = array
7562
7563
    def __str__(self):
7564
        return 'SoftwareCertificate(' + 'ProductName:' + str(self.ProductName) + ', ' + \
7565 1
               'ProductUri:' + str(self.ProductUri) + ', ' + \
7566
               'VendorName:' + str(self.VendorName) + ', ' + \
7567
               'VendorProductCertificate:' + str(self.VendorProductCertificate) + ', ' + \
7568 1
               'SoftwareVersion:' + str(self.SoftwareVersion) + ', ' + \
7569
               'BuildNumber:' + str(self.BuildNumber) + ', ' + \
7570
               'BuildDate:' + str(self.BuildDate) + ', ' + \
7571
               'IssuedBy:' + str(self.IssuedBy) + ', ' + \
7572
               'IssueDate:' + str(self.IssueDate) + ', ' + \
7573
               'SupportedProfiles:' + str(self.SupportedProfiles) + ')'
7574
7575
    __repr__ = __str__
7576
7577 1
7578 View Code Duplication
class QueryDataDescription(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7579
    '''
7580
    :ivar RelativePath:
7581
    :vartype RelativePath: RelativePath
7582
    :ivar AttributeId:
7583
    :vartype AttributeId: UInt32
7584
    :ivar IndexRange:
7585
    :vartype IndexRange: String
7586
    '''
7587 1
7588
    ua_types = {
7589
        'RelativePath': 'RelativePath',
7590
        'AttributeId': 'UInt32',
7591
        'IndexRange': 'String',
7592
               }
7593
7594 1
    def __init__(self, binary=None):
7595
        if binary is not None:
7596
            self._binary_init(binary)
7597
            self._freeze = True
7598 1
            return
7599
        self.RelativePath = RelativePath()
7600
        self.AttributeId = 0
7601
        self.IndexRange = None
7602
        self._freeze = True
7603 1
7604
    def to_binary(self):
7605
        packet = []
7606
        packet.append(self.RelativePath.to_binary())
7607
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
7608 1
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
7609
        return b''.join(packet)
7610
7611 1
    @staticmethod
7612
    def from_binary(data):
7613
        return QueryDataDescription(data)
7614
7615
    def _binary_init(self, data):
7616
        self.RelativePath = RelativePath.from_binary(data)
7617
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
7618 1
        self.IndexRange = uabin.Primitives.String.unpack(data)
7619
7620
    def __str__(self):
7621
        return 'QueryDataDescription(' + 'RelativePath:' + str(self.RelativePath) + ', ' + \
7622
               'AttributeId:' + str(self.AttributeId) + ', ' + \
7623
               'IndexRange:' + str(self.IndexRange) + ')'
7624
7625
    __repr__ = __str__
7626
7627 1
7628 View Code Duplication
class NodeTypeDescription(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7629
    '''
7630
    :ivar TypeDefinitionNode:
7631
    :vartype TypeDefinitionNode: ExpandedNodeId
7632
    :ivar IncludeSubTypes:
7633
    :vartype IncludeSubTypes: Boolean
7634
    :ivar DataToReturn:
7635 1
    :vartype DataToReturn: QueryDataDescription
7636
    '''
7637
7638
    ua_types = {
7639 1
        'TypeDefinitionNode': 'ExpandedNodeId',
7640
        'IncludeSubTypes': 'Boolean',
7641
        'DataToReturn': 'QueryDataDescription',
7642
               }
7643
7644
    def __init__(self, binary=None):
7645
        if binary is not None:
7646
            self._binary_init(binary)
7647
            self._freeze = True
7648 1
            return
7649
        self.TypeDefinitionNode = ExpandedNodeId()
7650
        self.IncludeSubTypes = True
7651
        self.DataToReturn = []
7652 1
        self._freeze = True
7653
7654
    def to_binary(self):
7655 1
        packet = []
7656
        packet.append(self.TypeDefinitionNode.to_binary())
7657
        packet.append(uabin.Primitives.Boolean.pack(self.IncludeSubTypes))
7658
        packet.append(uabin.Primitives.Int32.pack(len(self.DataToReturn)))
7659
        for fieldname in self.DataToReturn:
7660
            packet.append(fieldname.to_binary())
7661
        return b''.join(packet)
7662
7663
    @staticmethod
7664 1
    def from_binary(data):
7665
        return NodeTypeDescription(data)
7666
7667
    def _binary_init(self, data):
7668
        self.TypeDefinitionNode = ExpandedNodeId.from_binary(data)
7669
        self.IncludeSubTypes = uabin.Primitives.Boolean.unpack(data)
7670
        length = uabin.Primitives.Int32.unpack(data)
7671
        array = []
7672
        if length != -1:
7673
            for _ in range(0, length):
7674 1
                array.append(QueryDataDescription.from_binary(data))
7675
        self.DataToReturn = array
7676
7677
    def __str__(self):
7678
        return 'NodeTypeDescription(' + 'TypeDefinitionNode:' + str(self.TypeDefinitionNode) + ', ' + \
7679
               'IncludeSubTypes:' + str(self.IncludeSubTypes) + ', ' + \
7680
               'DataToReturn:' + str(self.DataToReturn) + ')'
7681 1
7682
    __repr__ = __str__
7683
7684
7685 1 View Code Duplication
class QueryDataSet(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7686
    '''
7687
    :ivar NodeId:
7688
    :vartype NodeId: ExpandedNodeId
7689
    :ivar TypeDefinitionNode:
7690 1
    :vartype TypeDefinitionNode: ExpandedNodeId
7691
    :ivar Values:
7692
    :vartype Values: Variant
7693
    '''
7694
7695 1
    ua_types = {
7696
        'NodeId': 'ExpandedNodeId',
7697
        'TypeDefinitionNode': 'ExpandedNodeId',
7698 1
        'Values': 'Variant',
7699
               }
7700
7701
    def __init__(self, binary=None):
7702
        if binary is not None:
7703
            self._binary_init(binary)
7704
            self._freeze = True
7705
            return
7706
        self.NodeId = ExpandedNodeId()
7707
        self.TypeDefinitionNode = ExpandedNodeId()
7708
        self.Values = []
7709 1
        self._freeze = True
7710 1
7711 1
    def to_binary(self):
7712 1
        packet = []
7713 1
        packet.append(self.NodeId.to_binary())
7714 1
        packet.append(self.TypeDefinitionNode.to_binary())
7715 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Values)))
7716 1
        for fieldname in self.Values:
7717 1
            packet.append(fieldname.to_binary())
7718 1
        return b''.join(packet)
7719
7720 1
    @staticmethod
7721 1
    def from_binary(data):
7722 1
        return QueryDataSet(data)
7723 1
7724 1
    def _binary_init(self, data):
7725 1
        self.NodeId = ExpandedNodeId.from_binary(data)
7726 1
        self.TypeDefinitionNode = ExpandedNodeId.from_binary(data)
7727
        length = uabin.Primitives.Int32.unpack(data)
7728 1
        array = []
7729
        if length != -1:
7730 1
            for _ in range(0, length):
7731
                array.append(Variant.from_binary(data))
7732 1
        self.Values = array
7733 1
7734 1
    def __str__(self):
7735 1
        return 'QueryDataSet(' + 'NodeId:' + str(self.NodeId) + ', ' + \
7736 1
               'TypeDefinitionNode:' + str(self.TypeDefinitionNode) + ', ' + \
7737
               'Values:' + str(self.Values) + ')'
7738 1
7739
    __repr__ = __str__
7740
7741
7742 View Code Duplication
class NodeReference(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7743
    '''
7744 1
    :ivar NodeId:
7745
    :vartype NodeId: NodeId
7746
    :ivar ReferenceTypeId:
7747 1
    :vartype ReferenceTypeId: NodeId
7748
    :ivar IsForward:
7749
    :vartype IsForward: Boolean
7750
    :ivar ReferencedNodeIds:
7751
    :vartype ReferencedNodeIds: NodeId
7752
    '''
7753
7754
    ua_types = {
7755
        'NodeId': 'NodeId',
7756 1
        'ReferenceTypeId': 'NodeId',
7757 1
        'IsForward': 'Boolean',
7758 1
        'ReferencedNodeIds': 'NodeId',
7759 1
               }
7760 1
7761 1
    def __init__(self, binary=None):
7762 1
        if binary is not None:
7763 1
            self._binary_init(binary)
7764 1
            self._freeze = True
7765
            return
7766 1
        self.NodeId = NodeId()
7767 1
        self.ReferenceTypeId = NodeId()
7768 1
        self.IsForward = True
7769 1
        self.ReferencedNodeIds = []
7770 1
        self._freeze = True
7771 1
7772 1
    def to_binary(self):
7773 1
        packet = []
7774
        packet.append(self.NodeId.to_binary())
7775 1
        packet.append(self.ReferenceTypeId.to_binary())
7776
        packet.append(uabin.Primitives.Boolean.pack(self.IsForward))
7777 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ReferencedNodeIds)))
7778
        for fieldname in self.ReferencedNodeIds:
7779 1
            packet.append(fieldname.to_binary())
7780 1
        return b''.join(packet)
7781 1
7782 1
    @staticmethod
7783 1
    def from_binary(data):
7784 1
        return NodeReference(data)
7785 1
7786 1
    def _binary_init(self, data):
7787 1
        self.NodeId = NodeId.from_binary(data)
7788
        self.ReferenceTypeId = NodeId.from_binary(data)
7789 1
        self.IsForward = uabin.Primitives.Boolean.unpack(data)
7790
        length = uabin.Primitives.Int32.unpack(data)
7791
        array = []
7792
        if length != -1:
7793
            for _ in range(0, length):
7794 1
                array.append(NodeId.from_binary(data))
7795
        self.ReferencedNodeIds = array
7796
7797 1
    def __str__(self):
7798
        return 'NodeReference(' + 'NodeId:' + str(self.NodeId) + ', ' + \
7799
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
7800
               'IsForward:' + str(self.IsForward) + ', ' + \
7801
               'ReferencedNodeIds:' + str(self.ReferencedNodeIds) + ')'
7802
7803
    __repr__ = __str__
7804
7805
7806 1 View Code Duplication
class ContentFilterElement(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7807 1
    '''
7808
    :ivar FilterOperator:
7809
    :vartype FilterOperator: FilterOperator
7810
    :ivar FilterOperands:
7811 1
    :vartype FilterOperands: ExtensionObject
7812 1
    '''
7813 1
7814 1
    ua_types = {
7815
        'FilterOperator': 'FilterOperator',
7816 1
        'FilterOperands': 'ExtensionObject',
7817 1
               }
7818 1
7819 1
    def __init__(self, binary=None):
7820 1
        if binary is not None:
7821 1
            self._binary_init(binary)
7822
            self._freeze = True
7823 1
            return
7824
        self.FilterOperator = FilterOperator(0)
7825
        self.FilterOperands = []
7826
        self._freeze = True
7827 1
7828
    def to_binary(self):
7829
        packet = []
7830
        packet.append(uabin.Primitives.UInt32.pack(self.FilterOperator.value))
7831
        packet.append(uabin.Primitives.Int32.pack(len(self.FilterOperands)))
7832 1
        for fieldname in self.FilterOperands:
7833
            packet.append(extensionobject_to_binary(fieldname))
7834
        return b''.join(packet)
7835
7836
    @staticmethod
7837 1
    def from_binary(data):
7838
        return ContentFilterElement(data)
7839
7840 1
    def _binary_init(self, data):
7841
        self.FilterOperator = FilterOperator(uabin.Primitives.UInt32.unpack(data))
7842
        length = uabin.Primitives.Int32.unpack(data)
7843
        array = []
7844
        if length != -1:
7845
            for _ in range(0, length):
7846
                array.append(extensionobject_from_binary(data))
7847
        self.FilterOperands = array
7848
7849
    def __str__(self):
7850
        return 'ContentFilterElement(' + 'FilterOperator:' + str(self.FilterOperator) + ', ' + \
7851 1
               'FilterOperands:' + str(self.FilterOperands) + ')'
7852 1
7853 1
    __repr__ = __str__
7854 1
7855 1
7856 1
class ContentFilter(FrozenClass):
7857 1
    '''
7858 1
    :ivar Elements:
7859 1
    :vartype Elements: ContentFilterElement
7860 1
    '''
7861
7862 1
    ua_types = {
7863 1
        'Elements': 'ContentFilterElement',
7864 1
               }
7865 1
7866 1
    def __init__(self, binary=None):
7867 1
        if binary is not None:
7868 1
            self._binary_init(binary)
7869 1
            self._freeze = True
7870 1
            return
7871
        self.Elements = []
7872 1
        self._freeze = True
7873
7874 1
    def to_binary(self):
7875
        packet = []
7876 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Elements)))
7877
        for fieldname in self.Elements:
7878 1
            packet.append(fieldname.to_binary())
7879 1
        return b''.join(packet)
7880 1
7881 1
    @staticmethod
7882 1
    def from_binary(data):
7883 1
        return ContentFilter(data)
7884 1
7885 1
    def _binary_init(self, data):
7886 1
        length = uabin.Primitives.Int32.unpack(data)
7887 1
        array = []
7888 1
        if length != -1:
7889 1
            for _ in range(0, length):
7890 1
                array.append(ContentFilterElement.from_binary(data))
7891
        self.Elements = array
7892 1
7893
    def __str__(self):
7894 1
        return 'ContentFilter(' + 'Elements:' + str(self.Elements) + ')'
7895
7896
    __repr__ = __str__
7897
7898
7899
class ElementOperand(FrozenClass):
7900 1
    '''
7901
    :ivar Index:
7902
    :vartype Index: UInt32
7903 1
    '''
7904
7905
    ua_types = {
7906
        'Index': 'UInt32',
7907
               }
7908
7909
    def __init__(self, binary=None):
7910
        if binary is not None:
7911
            self._binary_init(binary)
7912
            self._freeze = True
7913
            return
7914 1
        self.Index = 0
7915 1
        self._freeze = True
7916
7917
    def to_binary(self):
7918
        packet = []
7919 1
        packet.append(uabin.Primitives.UInt32.pack(self.Index))
7920 1
        return b''.join(packet)
7921 1
7922 1
    @staticmethod
7923 1
    def from_binary(data):
7924
        return ElementOperand(data)
7925 1
7926
    def _binary_init(self, data):
7927
        self.Index = uabin.Primitives.UInt32.unpack(data)
7928
7929
    def __str__(self):
7930
        return 'ElementOperand(' + 'Index:' + str(self.Index) + ')'
7931
7932
    __repr__ = __str__
7933 1
7934
7935 View Code Duplication
class LiteralOperand(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7936
    '''
7937 1
    :ivar Value:
7938
    :vartype Value: Variant
7939
    '''
7940
7941
    ua_types = {
7942
        'Value': 'Variant',
7943 1
               }
7944
7945
    def __init__(self, binary=None):
7946
        if binary is not None:
7947
            self._binary_init(binary)
7948
            self._freeze = True
7949 1
            return
7950
        self.Value = Variant()
7951
        self._freeze = True
7952 1
7953
    def to_binary(self):
7954
        packet = []
7955
        packet.append(self.Value.to_binary())
7956
        return b''.join(packet)
7957
7958
    @staticmethod
7959
    def from_binary(data):
7960
        return LiteralOperand(data)
7961 1
7962 1
    def _binary_init(self, data):
7963
        self.Value = Variant.from_binary(data)
7964
7965
    def __str__(self):
7966 1
        return 'LiteralOperand(' + 'Value:' + str(self.Value) + ')'
7967 1
7968 1
    __repr__ = __str__
7969 1
7970
7971 1
class AttributeOperand(FrozenClass):
7972
    '''
7973
    :ivar NodeId:
7974
    :vartype NodeId: NodeId
7975
    :ivar Alias:
7976
    :vartype Alias: String
7977
    :ivar BrowsePath:
7978 1
    :vartype BrowsePath: RelativePath
7979
    :ivar AttributeId:
7980
    :vartype AttributeId: UInt32
7981
    :ivar IndexRange:
7982 1
    :vartype IndexRange: String
7983
    '''
7984
7985
    ua_types = {
7986
        'NodeId': 'NodeId',
7987 1
        'Alias': 'String',
7988
        'BrowsePath': 'RelativePath',
7989
        'AttributeId': 'UInt32',
7990
        'IndexRange': 'String',
7991
               }
7992 1
7993
    def __init__(self, binary=None):
7994
        if binary is not None:
7995 1
            self._binary_init(binary)
7996
            self._freeze = True
7997
            return
7998 1
        self.NodeId = NodeId()
7999
        self.Alias = None
8000
        self.BrowsePath = RelativePath()
8001
        self.AttributeId = 0
8002
        self.IndexRange = None
8003
        self._freeze = True
8004
8005 1
    def to_binary(self):
8006
        packet = []
8007
        packet.append(self.NodeId.to_binary())
8008
        packet.append(uabin.Primitives.String.pack(self.Alias))
8009 1
        packet.append(self.BrowsePath.to_binary())
8010
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
8011
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
8012
        return b''.join(packet)
8013 1
8014
    @staticmethod
8015
    def from_binary(data):
8016 1
        return AttributeOperand(data)
8017
8018
    def _binary_init(self, data):
8019 1
        self.NodeId = NodeId.from_binary(data)
8020
        self.Alias = uabin.Primitives.String.unpack(data)
8021
        self.BrowsePath = RelativePath.from_binary(data)
8022 1
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
8023
        self.IndexRange = uabin.Primitives.String.unpack(data)
8024
8025
    def __str__(self):
8026
        return 'AttributeOperand(' + 'NodeId:' + str(self.NodeId) + ', ' + \
8027
               'Alias:' + str(self.Alias) + ', ' + \
8028
               'BrowsePath:' + str(self.BrowsePath) + ', ' + \
8029
               'AttributeId:' + str(self.AttributeId) + ', ' + \
8030
               'IndexRange:' + str(self.IndexRange) + ')'
8031
8032
    __repr__ = __str__
8033 1
8034 1
8035 View Code Duplication
class SimpleAttributeOperand(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8036
    '''
8037
    :ivar TypeDefinitionId:
8038 1
    :vartype TypeDefinitionId: NodeId
8039 1
    :ivar BrowsePath:
8040 1
    :vartype BrowsePath: QualifiedName
8041 1
    :ivar AttributeId:
8042 1
    :vartype AttributeId: UInt32
8043
    :ivar IndexRange:
8044 1
    :vartype IndexRange: String
8045
    '''
8046
8047
    ua_types = {
8048
        'TypeDefinitionId': 'NodeId',
8049
        'BrowsePath': 'QualifiedName',
8050
        'AttributeId': 'UInt32',
8051
        'IndexRange': 'String',
8052 1
               }
8053
8054
    def __init__(self, binary=None):
8055
        if binary is not None:
8056 1
            self._binary_init(binary)
8057
            self._freeze = True
8058
            return
8059
        self.TypeDefinitionId = NodeId()
8060
        self.BrowsePath = []
8061
        self.AttributeId = 0
8062 1
        self.IndexRange = None
8063
        self._freeze = True
8064
8065
    def to_binary(self):
8066
        packet = []
8067
        packet.append(self.TypeDefinitionId.to_binary())
8068 1
        packet.append(uabin.Primitives.Int32.pack(len(self.BrowsePath)))
8069
        for fieldname in self.BrowsePath:
8070
            packet.append(fieldname.to_binary())
8071 1
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
8072
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
8073
        return b''.join(packet)
8074
8075
    @staticmethod
8076
    def from_binary(data):
8077
        return SimpleAttributeOperand(data)
8078
8079
    def _binary_init(self, data):
8080
        self.TypeDefinitionId = NodeId.from_binary(data)
8081
        length = uabin.Primitives.Int32.unpack(data)
8082
        array = []
8083
        if length != -1:
8084 1
            for _ in range(0, length):
8085 1
                array.append(QualifiedName.from_binary(data))
8086
        self.BrowsePath = array
8087
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
8088
        self.IndexRange = uabin.Primitives.String.unpack(data)
8089 1
8090 1
    def __str__(self):
8091 1
        return 'SimpleAttributeOperand(' + 'TypeDefinitionId:' + str(self.TypeDefinitionId) + ', ' + \
8092 1
               'BrowsePath:' + str(self.BrowsePath) + ', ' + \
8093 1
               'AttributeId:' + str(self.AttributeId) + ', ' + \
8094 1
               'IndexRange:' + str(self.IndexRange) + ')'
8095
8096 1
    __repr__ = __str__
8097
8098
8099 View Code Duplication
class ContentFilterElementResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8100
    '''
8101
    :ivar StatusCode:
8102
    :vartype StatusCode: StatusCode
8103
    :ivar OperandStatusCodes:
8104
    :vartype OperandStatusCodes: StatusCode
8105 1
    :ivar OperandDiagnosticInfos:
8106
    :vartype OperandDiagnosticInfos: DiagnosticInfo
8107
    '''
8108
8109 1
    ua_types = {
8110
        'StatusCode': 'StatusCode',
8111
        'OperandStatusCodes': 'StatusCode',
8112
        'OperandDiagnosticInfos': 'DiagnosticInfo',
8113
               }
8114
8115
    def __init__(self, binary=None):
8116 1
        if binary is not None:
8117
            self._binary_init(binary)
8118
            self._freeze = True
8119
            return
8120
        self.StatusCode = StatusCode()
8121
        self.OperandStatusCodes = []
8122
        self.OperandDiagnosticInfos = []
8123 1
        self._freeze = True
8124
8125
    def to_binary(self):
8126 1
        packet = []
8127
        packet.append(self.StatusCode.to_binary())
8128
        packet.append(uabin.Primitives.Int32.pack(len(self.OperandStatusCodes)))
8129
        for fieldname in self.OperandStatusCodes:
8130
            packet.append(fieldname.to_binary())
8131
        packet.append(uabin.Primitives.Int32.pack(len(self.OperandDiagnosticInfos)))
8132
        for fieldname in self.OperandDiagnosticInfos:
8133
            packet.append(fieldname.to_binary())
8134
        return b''.join(packet)
8135
8136
    @staticmethod
8137
    def from_binary(data):
8138
        return ContentFilterElementResult(data)
8139 1
8140
    def _binary_init(self, data):
8141
        self.StatusCode = StatusCode.from_binary(data)
8142
        length = uabin.Primitives.Int32.unpack(data)
8143
        array = []
8144
        if length != -1:
8145
            for _ in range(0, length):
8146
                array.append(StatusCode.from_binary(data))
8147
        self.OperandStatusCodes = array
8148
        length = uabin.Primitives.Int32.unpack(data)
8149
        array = []
8150
        if length != -1:
8151 1
            for _ in range(0, length):
8152
                array.append(DiagnosticInfo.from_binary(data))
8153
        self.OperandDiagnosticInfos = array
8154
8155
    def __str__(self):
8156
        return 'ContentFilterElementResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
8157
               'OperandStatusCodes:' + str(self.OperandStatusCodes) + ', ' + \
8158
               'OperandDiagnosticInfos:' + str(self.OperandDiagnosticInfos) + ')'
8159
8160
    __repr__ = __str__
8161
8162 1
8163 View Code Duplication
class ContentFilterResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8164
    '''
8165
    :ivar ElementResults:
8166 1
    :vartype ElementResults: ContentFilterElementResult
8167
    :ivar ElementDiagnosticInfos:
8168
    :vartype ElementDiagnosticInfos: DiagnosticInfo
8169
    '''
8170
8171
    ua_types = {
8172
        'ElementResults': 'ContentFilterElementResult',
8173
        'ElementDiagnosticInfos': 'DiagnosticInfo',
8174
               }
8175
8176
    def __init__(self, binary=None):
8177
        if binary is not None:
8178 1
            self._binary_init(binary)
8179
            self._freeze = True
8180
            return
8181
        self.ElementResults = []
8182
        self.ElementDiagnosticInfos = []
8183
        self._freeze = True
8184
8185 1
    def to_binary(self):
8186
        packet = []
8187
        packet.append(uabin.Primitives.Int32.pack(len(self.ElementResults)))
8188 1
        for fieldname in self.ElementResults:
8189
            packet.append(fieldname.to_binary())
8190
        packet.append(uabin.Primitives.Int32.pack(len(self.ElementDiagnosticInfos)))
8191
        for fieldname in self.ElementDiagnosticInfos:
8192
            packet.append(fieldname.to_binary())
8193
        return b''.join(packet)
8194
8195 1
    @staticmethod
8196
    def from_binary(data):
8197
        return ContentFilterResult(data)
8198
8199
    def _binary_init(self, data):
8200
        length = uabin.Primitives.Int32.unpack(data)
8201
        array = []
8202
        if length != -1:
8203
            for _ in range(0, length):
8204 1
                array.append(ContentFilterElementResult.from_binary(data))
8205
        self.ElementResults = array
8206
        length = uabin.Primitives.Int32.unpack(data)
8207
        array = []
8208
        if length != -1:
8209
            for _ in range(0, length):
8210
                array.append(DiagnosticInfo.from_binary(data))
8211
        self.ElementDiagnosticInfos = array
8212 1
8213
    def __str__(self):
8214
        return 'ContentFilterResult(' + 'ElementResults:' + str(self.ElementResults) + ', ' + \
8215
               'ElementDiagnosticInfos:' + str(self.ElementDiagnosticInfos) + ')'
8216 1
8217
    __repr__ = __str__
8218
8219
8220 1 View Code Duplication
class ParsingResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8221
    '''
8222
    :ivar StatusCode:
8223
    :vartype StatusCode: StatusCode
8224 1
    :ivar DataStatusCodes:
8225
    :vartype DataStatusCodes: StatusCode
8226
    :ivar DataDiagnosticInfos:
8227 1
    :vartype DataDiagnosticInfos: DiagnosticInfo
8228
    '''
8229
8230
    ua_types = {
8231
        'StatusCode': 'StatusCode',
8232 1
        'DataStatusCodes': 'StatusCode',
8233 1
        'DataDiagnosticInfos': 'DiagnosticInfo',
8234
               }
8235
8236
    def __init__(self, binary=None):
8237 1
        if binary is not None:
8238 1
            self._binary_init(binary)
8239
            self._freeze = True
8240 1
            return
8241
        self.StatusCode = StatusCode()
8242
        self.DataStatusCodes = []
8243
        self.DataDiagnosticInfos = []
8244
        self._freeze = True
8245
8246
    def to_binary(self):
8247 1
        packet = []
8248
        packet.append(self.StatusCode.to_binary())
8249
        packet.append(uabin.Primitives.Int32.pack(len(self.DataStatusCodes)))
8250
        for fieldname in self.DataStatusCodes:
8251 1
            packet.append(fieldname.to_binary())
8252
        packet.append(uabin.Primitives.Int32.pack(len(self.DataDiagnosticInfos)))
8253
        for fieldname in self.DataDiagnosticInfos:
8254
            packet.append(fieldname.to_binary())
8255
        return b''.join(packet)
8256
8257
    @staticmethod
8258
    def from_binary(data):
8259 1
        return ParsingResult(data)
8260
8261
    def _binary_init(self, data):
8262 1
        self.StatusCode = StatusCode.from_binary(data)
8263
        length = uabin.Primitives.Int32.unpack(data)
8264
        array = []
8265 1
        if length != -1:
8266
            for _ in range(0, length):
8267
                array.append(StatusCode.from_binary(data))
8268
        self.DataStatusCodes = array
8269
        length = uabin.Primitives.Int32.unpack(data)
8270
        array = []
8271
        if length != -1:
8272
            for _ in range(0, length):
8273
                array.append(DiagnosticInfo.from_binary(data))
8274 1
        self.DataDiagnosticInfos = array
8275
8276
    def __str__(self):
8277
        return 'ParsingResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
8278
               'DataStatusCodes:' + str(self.DataStatusCodes) + ', ' + \
8279
               'DataDiagnosticInfos:' + str(self.DataDiagnosticInfos) + ')'
8280
8281
    __repr__ = __str__
8282
8283
8284 1 View Code Duplication
class QueryFirstParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8285
    '''
8286
    :ivar View:
8287
    :vartype View: ViewDescription
8288
    :ivar NodeTypes:
8289
    :vartype NodeTypes: NodeTypeDescription
8290
    :ivar Filter:
8291 1
    :vartype Filter: ContentFilter
8292
    :ivar MaxDataSetsToReturn:
8293
    :vartype MaxDataSetsToReturn: UInt32
8294
    :ivar MaxReferencesToReturn:
8295 1
    :vartype MaxReferencesToReturn: UInt32
8296
    '''
8297
8298
    ua_types = {
8299
        'View': 'ViewDescription',
8300 1
        'NodeTypes': 'NodeTypeDescription',
8301
        'Filter': 'ContentFilter',
8302
        'MaxDataSetsToReturn': 'UInt32',
8303
        'MaxReferencesToReturn': 'UInt32',
8304
               }
8305 1
8306
    def __init__(self, binary=None):
8307
        if binary is not None:
8308 1
            self._binary_init(binary)
8309
            self._freeze = True
8310
            return
8311
        self.View = ViewDescription()
8312
        self.NodeTypes = []
8313
        self.Filter = ContentFilter()
8314
        self.MaxDataSetsToReturn = 0
8315 1
        self.MaxReferencesToReturn = 0
8316
        self._freeze = True
8317
8318
    def to_binary(self):
8319
        packet = []
8320
        packet.append(self.View.to_binary())
8321
        packet.append(uabin.Primitives.Int32.pack(len(self.NodeTypes)))
8322
        for fieldname in self.NodeTypes:
8323
            packet.append(fieldname.to_binary())
8324 1
        packet.append(self.Filter.to_binary())
8325
        packet.append(uabin.Primitives.UInt32.pack(self.MaxDataSetsToReturn))
8326
        packet.append(uabin.Primitives.UInt32.pack(self.MaxReferencesToReturn))
8327
        return b''.join(packet)
8328
8329
    @staticmethod
8330
    def from_binary(data):
8331
        return QueryFirstParameters(data)
8332
8333
    def _binary_init(self, data):
8334 1
        self.View = ViewDescription.from_binary(data)
8335
        length = uabin.Primitives.Int32.unpack(data)
8336
        array = []
8337
        if length != -1:
8338 1
            for _ in range(0, length):
8339
                array.append(NodeTypeDescription.from_binary(data))
8340
        self.NodeTypes = array
8341
        self.Filter = ContentFilter.from_binary(data)
8342
        self.MaxDataSetsToReturn = uabin.Primitives.UInt32.unpack(data)
8343
        self.MaxReferencesToReturn = uabin.Primitives.UInt32.unpack(data)
8344
8345
    def __str__(self):
8346
        return 'QueryFirstParameters(' + 'View:' + str(self.View) + ', ' + \
8347
               'NodeTypes:' + str(self.NodeTypes) + ', ' + \
8348
               'Filter:' + str(self.Filter) + ', ' + \
8349
               'MaxDataSetsToReturn:' + str(self.MaxDataSetsToReturn) + ', ' + \
8350
               'MaxReferencesToReturn:' + str(self.MaxReferencesToReturn) + ')'
8351
8352 1
    __repr__ = __str__
8353
8354
8355
class QueryFirstRequest(FrozenClass):
8356 1
    '''
8357
    :ivar TypeId:
8358
    :vartype TypeId: NodeId
8359 1
    :ivar RequestHeader:
8360
    :vartype RequestHeader: RequestHeader
8361
    :ivar Parameters:
8362
    :vartype Parameters: QueryFirstParameters
8363
    '''
8364 1
8365 1
    ua_types = {
8366
        'TypeId': 'NodeId',
8367
        'RequestHeader': 'RequestHeader',
8368
        'Parameters': 'QueryFirstParameters',
8369 1
               }
8370 1
8371
    def __init__(self, binary=None):
8372 1
        if binary is not None:
8373
            self._binary_init(binary)
8374
            self._freeze = True
8375
            return
8376
        self.TypeId = FourByteNodeId(ObjectIds.QueryFirstRequest_Encoding_DefaultBinary)
8377
        self.RequestHeader = RequestHeader()
8378
        self.Parameters = QueryFirstParameters()
8379 1
        self._freeze = True
8380
8381
    def to_binary(self):
8382
        packet = []
8383 1
        packet.append(self.TypeId.to_binary())
8384
        packet.append(self.RequestHeader.to_binary())
8385
        packet.append(self.Parameters.to_binary())
8386
        return b''.join(packet)
8387
8388
    @staticmethod
8389
    def from_binary(data):
8390
        return QueryFirstRequest(data)
8391 1
8392
    def _binary_init(self, data):
8393
        self.TypeId = NodeId.from_binary(data)
8394 1
        self.RequestHeader = RequestHeader.from_binary(data)
8395
        self.Parameters = QueryFirstParameters.from_binary(data)
8396
8397 1
    def __str__(self):
8398
        return 'QueryFirstRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8399
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
8400
               'Parameters:' + str(self.Parameters) + ')'
8401
8402
    __repr__ = __str__
8403
8404
8405
class QueryFirstResult(FrozenClass):
8406
    '''
8407
    :ivar QueryDataSets:
8408 1
    :vartype QueryDataSets: QueryDataSet
8409 1
    :ivar ContinuationPoint:
8410
    :vartype ContinuationPoint: ByteString
8411
    :ivar ParsingResults:
8412
    :vartype ParsingResults: ParsingResult
8413 1
    :ivar DiagnosticInfos:
8414 1
    :vartype DiagnosticInfos: DiagnosticInfo
8415 1
    :ivar FilterResult:
8416 1
    :vartype FilterResult: ContentFilterResult
8417 1
    '''
8418
8419 1
    ua_types = {
8420
        'QueryDataSets': 'QueryDataSet',
8421
        'ContinuationPoint': 'ByteString',
8422
        'ParsingResults': 'ParsingResult',
8423
        'DiagnosticInfos': 'DiagnosticInfo',
8424
        'FilterResult': 'ContentFilterResult',
8425
               }
8426
8427
    def __init__(self, binary=None):
8428
        if binary is not None:
8429 1
            self._binary_init(binary)
8430
            self._freeze = True
8431
            return
8432
        self.QueryDataSets = []
8433 1
        self.ContinuationPoint = None
8434
        self.ParsingResults = []
8435
        self.DiagnosticInfos = []
8436
        self.FilterResult = ContentFilterResult()
8437
        self._freeze = True
8438
8439 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8440
        packet = []
8441
        packet.append(uabin.Primitives.Int32.pack(len(self.QueryDataSets)))
8442
        for fieldname in self.QueryDataSets:
8443
            packet.append(fieldname.to_binary())
8444 1
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
8445
        packet.append(uabin.Primitives.Int32.pack(len(self.ParsingResults)))
8446
        for fieldname in self.ParsingResults:
8447
            packet.append(fieldname.to_binary())
8448
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
8449
        for fieldname in self.DiagnosticInfos:
8450 1
            packet.append(fieldname.to_binary())
8451
        packet.append(self.FilterResult.to_binary())
8452
        return b''.join(packet)
8453 1
8454
    @staticmethod
8455
    def from_binary(data):
8456
        return QueryFirstResult(data)
8457
8458
    def _binary_init(self, data):
8459
        length = uabin.Primitives.Int32.unpack(data)
8460
        array = []
8461
        if length != -1:
8462 1
            for _ in range(0, length):
8463
                array.append(QueryDataSet.from_binary(data))
8464
        self.QueryDataSets = array
8465
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
8466
        length = uabin.Primitives.Int32.unpack(data)
8467
        array = []
8468
        if length != -1:
8469
            for _ in range(0, length):
8470
                array.append(ParsingResult.from_binary(data))
8471
        self.ParsingResults = array
8472 1
        length = uabin.Primitives.Int32.unpack(data)
8473
        array = []
8474
        if length != -1:
8475
            for _ in range(0, length):
8476
                array.append(DiagnosticInfo.from_binary(data))
8477
        self.DiagnosticInfos = array
8478
        self.FilterResult = ContentFilterResult.from_binary(data)
8479 1
8480
    def __str__(self):
8481
        return 'QueryFirstResult(' + 'QueryDataSets:' + str(self.QueryDataSets) + ', ' + \
8482
               'ContinuationPoint:' + str(self.ContinuationPoint) + ', ' + \
8483 1
               'ParsingResults:' + str(self.ParsingResults) + ', ' + \
8484
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ', ' + \
8485
               'FilterResult:' + str(self.FilterResult) + ')'
8486
8487
    __repr__ = __str__
8488 1
8489
8490
class QueryFirstResponse(FrozenClass):
8491
    '''
8492
    :ivar TypeId:
8493 1
    :vartype TypeId: NodeId
8494
    :ivar ResponseHeader:
8495
    :vartype ResponseHeader: ResponseHeader
8496 1
    :ivar Parameters:
8497
    :vartype Parameters: QueryFirstResult
8498
    '''
8499
8500
    ua_types = {
8501
        'TypeId': 'NodeId',
8502
        'ResponseHeader': 'ResponseHeader',
8503
        'Parameters': 'QueryFirstResult',
8504
               }
8505
8506
    def __init__(self, binary=None):
8507 1
        if binary is not None:
8508
            self._binary_init(binary)
8509
            self._freeze = True
8510
            return
8511
        self.TypeId = FourByteNodeId(ObjectIds.QueryFirstResponse_Encoding_DefaultBinary)
8512
        self.ResponseHeader = ResponseHeader()
8513
        self.Parameters = QueryFirstResult()
8514
        self._freeze = True
8515
8516
    def to_binary(self):
8517
        packet = []
8518 1
        packet.append(self.TypeId.to_binary())
8519
        packet.append(self.ResponseHeader.to_binary())
8520
        packet.append(self.Parameters.to_binary())
8521
        return b''.join(packet)
8522
8523
    @staticmethod
8524
    def from_binary(data):
8525
        return QueryFirstResponse(data)
8526
8527
    def _binary_init(self, data):
8528
        self.TypeId = NodeId.from_binary(data)
8529
        self.ResponseHeader = ResponseHeader.from_binary(data)
8530 1
        self.Parameters = QueryFirstResult.from_binary(data)
8531
8532
    def __str__(self):
8533
        return 'QueryFirstResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8534 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
8535
               'Parameters:' + str(self.Parameters) + ')'
8536
8537
    __repr__ = __str__
8538
8539
8540 View Code Duplication
class QueryNextParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8541
    '''
8542
    :ivar ReleaseContinuationPoint:
8543
    :vartype ReleaseContinuationPoint: Boolean
8544
    :ivar ContinuationPoint:
8545
    :vartype ContinuationPoint: ByteString
8546
    '''
8547
8548
    ua_types = {
8549
        'ReleaseContinuationPoint': 'Boolean',
8550 1
        'ContinuationPoint': 'ByteString',
8551
               }
8552
8553
    def __init__(self, binary=None):
8554
        if binary is not None:
8555
            self._binary_init(binary)
8556 1
            self._freeze = True
8557
            return
8558
        self.ReleaseContinuationPoint = True
8559 1
        self.ContinuationPoint = None
8560
        self._freeze = True
8561
8562
    def to_binary(self):
8563
        packet = []
8564
        packet.append(uabin.Primitives.Boolean.pack(self.ReleaseContinuationPoint))
8565
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
8566
        return b''.join(packet)
8567
8568
    @staticmethod
8569
    def from_binary(data):
8570 1
        return QueryNextParameters(data)
8571 1
8572 1
    def _binary_init(self, data):
8573 1
        self.ReleaseContinuationPoint = uabin.Primitives.Boolean.unpack(data)
8574 1
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
8575 1
8576 1
    def __str__(self):
8577 1
        return 'QueryNextParameters(' + 'ReleaseContinuationPoint:' + str(self.ReleaseContinuationPoint) + ', ' + \
8578 1
               'ContinuationPoint:' + str(self.ContinuationPoint) + ')'
8579 1
8580
    __repr__ = __str__
8581 1
8582 1
8583 1
class QueryNextRequest(FrozenClass):
8584 1
    '''
8585 1
    :ivar TypeId:
8586 1
    :vartype TypeId: NodeId
8587 1
    :ivar RequestHeader:
8588
    :vartype RequestHeader: RequestHeader
8589 1
    :ivar Parameters:
8590
    :vartype Parameters: QueryNextParameters
8591 1
    '''
8592
8593 1
    ua_types = {
8594 1
        'TypeId': 'NodeId',
8595 1
        'RequestHeader': 'RequestHeader',
8596 1
        'Parameters': 'QueryNextParameters',
8597 1
               }
8598
8599 1
    def __init__(self, binary=None):
8600
        if binary is not None:
8601
            self._binary_init(binary)
8602
            self._freeze = True
8603
            return
8604
        self.TypeId = FourByteNodeId(ObjectIds.QueryNextRequest_Encoding_DefaultBinary)
8605 1
        self.RequestHeader = RequestHeader()
8606
        self.Parameters = QueryNextParameters()
8607
        self._freeze = True
8608 1
8609
    def to_binary(self):
8610
        packet = []
8611
        packet.append(self.TypeId.to_binary())
8612
        packet.append(self.RequestHeader.to_binary())
8613 1
        packet.append(self.Parameters.to_binary())
8614 1
        return b''.join(packet)
8615 1
8616 1
    @staticmethod
8617 1
    def from_binary(data):
8618 1
        return QueryNextRequest(data)
8619 1
8620
    def _binary_init(self, data):
8621 1
        self.TypeId = NodeId.from_binary(data)
8622 1
        self.RequestHeader = RequestHeader.from_binary(data)
8623 1
        self.Parameters = QueryNextParameters.from_binary(data)
8624 1
8625 1
    def __str__(self):
8626 1
        return 'QueryNextRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8627
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
8628 1
               'Parameters:' + str(self.Parameters) + ')'
8629
8630 1
    __repr__ = __str__
8631
8632 1
8633 1 View Code Duplication
class QueryNextResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8634 1
    '''
8635 1
    :ivar QueryDataSets:
8636 1
    :vartype QueryDataSets: QueryDataSet
8637 1
    :ivar RevisedContinuationPoint:
8638 1
    :vartype RevisedContinuationPoint: ByteString
8639
    '''
8640 1
8641
    ua_types = {
8642
        'QueryDataSets': 'QueryDataSet',
8643 1
        'RevisedContinuationPoint': 'ByteString',
8644
               }
8645
8646 1
    def __init__(self, binary=None):
8647
        if binary is not None:
8648
            self._binary_init(binary)
8649
            self._freeze = True
8650
            return
8651
        self.QueryDataSets = []
8652
        self.RevisedContinuationPoint = None
8653
        self._freeze = True
8654
8655 1
    def to_binary(self):
8656 1
        packet = []
8657
        packet.append(uabin.Primitives.Int32.pack(len(self.QueryDataSets)))
8658
        for fieldname in self.QueryDataSets:
8659
            packet.append(fieldname.to_binary())
8660 1
        packet.append(uabin.Primitives.ByteString.pack(self.RevisedContinuationPoint))
8661 1
        return b''.join(packet)
8662 1
8663 1
    @staticmethod
8664
    def from_binary(data):
8665 1
        return QueryNextResult(data)
8666 1
8667 1
    def _binary_init(self, data):
8668 1
        length = uabin.Primitives.Int32.unpack(data)
8669 1
        array = []
8670 1
        if length != -1:
8671
            for _ in range(0, length):
8672 1
                array.append(QueryDataSet.from_binary(data))
8673
        self.QueryDataSets = array
8674
        self.RevisedContinuationPoint = uabin.Primitives.ByteString.unpack(data)
8675
8676 1
    def __str__(self):
8677
        return 'QueryNextResult(' + 'QueryDataSets:' + str(self.QueryDataSets) + ', ' + \
8678
               'RevisedContinuationPoint:' + str(self.RevisedContinuationPoint) + ')'
8679
8680
    __repr__ = __str__
8681 1
8682
8683
class QueryNextResponse(FrozenClass):
8684
    '''
8685
    :ivar TypeId:
8686 1
    :vartype TypeId: NodeId
8687
    :ivar ResponseHeader:
8688
    :vartype ResponseHeader: ResponseHeader
8689 1
    :ivar Parameters:
8690
    :vartype Parameters: QueryNextResult
8691
    '''
8692
8693
    ua_types = {
8694
        'TypeId': 'NodeId',
8695
        'ResponseHeader': 'ResponseHeader',
8696
        'Parameters': 'QueryNextResult',
8697
               }
8698
8699
    def __init__(self, binary=None):
8700 1
        if binary is not None:
8701 1
            self._binary_init(binary)
8702 1
            self._freeze = True
8703 1
            return
8704 1
        self.TypeId = FourByteNodeId(ObjectIds.QueryNextResponse_Encoding_DefaultBinary)
8705 1
        self.ResponseHeader = ResponseHeader()
8706 1
        self.Parameters = QueryNextResult()
8707 1
        self._freeze = True
8708 1
8709 1
    def to_binary(self):
8710
        packet = []
8711 1
        packet.append(self.TypeId.to_binary())
8712 1
        packet.append(self.ResponseHeader.to_binary())
8713 1
        packet.append(self.Parameters.to_binary())
8714 1
        return b''.join(packet)
8715 1
8716 1
    @staticmethod
8717 1
    def from_binary(data):
8718 1
        return QueryNextResponse(data)
8719 1
8720
    def _binary_init(self, data):
8721 1
        self.TypeId = NodeId.from_binary(data)
8722
        self.ResponseHeader = ResponseHeader.from_binary(data)
8723 1
        self.Parameters = QueryNextResult.from_binary(data)
8724
8725 1
    def __str__(self):
8726
        return 'QueryNextResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8727 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
8728 1
               'Parameters:' + str(self.Parameters) + ')'
8729 1
8730 1
    __repr__ = __str__
8731 1
8732 1
8733 1 View Code Duplication
class ReadValueId(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8734 1
    '''
8735 1
    :ivar NodeId:
8736 1
    :vartype NodeId: NodeId
8737 1
    :ivar AttributeId:
8738 1
    :vartype AttributeId: UInt32
8739 1
    :ivar IndexRange:
8740
    :vartype IndexRange: String
8741 1
    :ivar DataEncoding:
8742
    :vartype DataEncoding: QualifiedName
8743 1
    '''
8744
8745
    ua_types = {
8746
        'NodeId': 'NodeId',
8747
        'AttributeId': 'UInt32',
8748
        'IndexRange': 'String',
8749 1
        'DataEncoding': 'QualifiedName',
8750
               }
8751
8752 1
    def __init__(self, binary=None):
8753
        if binary is not None:
8754
            self._binary_init(binary)
8755
            self._freeze = True
8756
            return
8757 1
        self.NodeId = NodeId()
8758
        self.AttributeId = 0
8759
        self.IndexRange = None
8760
        self.DataEncoding = QualifiedName()
8761
        self._freeze = True
8762
8763
    def to_binary(self):
8764
        packet = []
8765 1
        packet.append(self.NodeId.to_binary())
8766
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
8767
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
8768
        packet.append(self.DataEncoding.to_binary())
8769
        return b''.join(packet)
8770 1
8771
    @staticmethod
8772
    def from_binary(data):
8773
        return ReadValueId(data)
8774 1
8775
    def _binary_init(self, data):
8776
        self.NodeId = NodeId.from_binary(data)
8777 1
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
8778
        self.IndexRange = uabin.Primitives.String.unpack(data)
8779
        self.DataEncoding = QualifiedName.from_binary(data)
8780 1
8781
    def __str__(self):
8782
        return 'ReadValueId(' + 'NodeId:' + str(self.NodeId) + ', ' + \
8783 1
               'AttributeId:' + str(self.AttributeId) + ', ' + \
8784
               'IndexRange:' + str(self.IndexRange) + ', ' + \
8785
               'DataEncoding:' + str(self.DataEncoding) + ')'
8786
8787
    __repr__ = __str__
8788
8789
8790 View Code Duplication
class ReadParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8791
    '''
8792 1
    :ivar MaxAge:
8793
    :vartype MaxAge: Double
8794
    :ivar TimestampsToReturn:
8795
    :vartype TimestampsToReturn: TimestampsToReturn
8796
    :ivar NodesToRead:
8797
    :vartype NodesToRead: ReadValueId
8798
    '''
8799
8800
    ua_types = {
8801
        'MaxAge': 'Double',
8802 1
        'TimestampsToReturn': 'TimestampsToReturn',
8803
        'NodesToRead': 'ReadValueId',
8804
               }
8805
8806
    def __init__(self, binary=None):
8807
        if binary is not None:
8808
            self._binary_init(binary)
8809
            self._freeze = True
8810
            return
8811 1
        self.MaxAge = 0
8812
        self.TimestampsToReturn = TimestampsToReturn(0)
8813
        self.NodesToRead = []
8814
        self._freeze = True
8815 1
8816
    def to_binary(self):
8817
        packet = []
8818
        packet.append(uabin.Primitives.Double.pack(self.MaxAge))
8819
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
8820
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToRead)))
8821
        for fieldname in self.NodesToRead:
8822
            packet.append(fieldname.to_binary())
8823
        return b''.join(packet)
8824
8825 1
    @staticmethod
8826
    def from_binary(data):
8827
        return ReadParameters(data)
8828
8829
    def _binary_init(self, data):
8830 1
        self.MaxAge = uabin.Primitives.Double.unpack(data)
8831
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
8832
        length = uabin.Primitives.Int32.unpack(data)
8833 1
        array = []
8834
        if length != -1:
8835
            for _ in range(0, length):
8836
                array.append(ReadValueId.from_binary(data))
8837
        self.NodesToRead = array
8838
8839
    def __str__(self):
8840
        return 'ReadParameters(' + 'MaxAge:' + str(self.MaxAge) + ', ' + \
8841
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
8842 1
               'NodesToRead:' + str(self.NodesToRead) + ')'
8843
8844
    __repr__ = __str__
8845
8846
8847
class ReadRequest(FrozenClass):
8848
    '''
8849
    :ivar TypeId:
8850
    :vartype TypeId: NodeId
8851
    :ivar RequestHeader:
8852 1
    :vartype RequestHeader: RequestHeader
8853
    :ivar Parameters:
8854
    :vartype Parameters: ReadParameters
8855
    '''
8856
8857
    ua_types = {
8858
        'TypeId': 'NodeId',
8859
        'RequestHeader': 'RequestHeader',
8860
        'Parameters': 'ReadParameters',
8861 1
               }
8862
8863
    def __init__(self, binary=None):
8864
        if binary is not None:
8865 1
            self._binary_init(binary)
8866
            self._freeze = True
8867
            return
8868
        self.TypeId = FourByteNodeId(ObjectIds.ReadRequest_Encoding_DefaultBinary)
8869
        self.RequestHeader = RequestHeader()
8870
        self.Parameters = ReadParameters()
8871
        self._freeze = True
8872
8873
    def to_binary(self):
8874
        packet = []
8875 1
        packet.append(self.TypeId.to_binary())
8876
        packet.append(self.RequestHeader.to_binary())
8877
        packet.append(self.Parameters.to_binary())
8878
        return b''.join(packet)
8879
8880 1
    @staticmethod
8881
    def from_binary(data):
8882
        return ReadRequest(data)
8883 1
8884
    def _binary_init(self, data):
8885
        self.TypeId = NodeId.from_binary(data)
8886
        self.RequestHeader = RequestHeader.from_binary(data)
8887
        self.Parameters = ReadParameters.from_binary(data)
8888
8889
    def __str__(self):
8890
        return 'ReadRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8891
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
8892
               'Parameters:' + str(self.Parameters) + ')'
8893
8894 1
    __repr__ = __str__
8895
8896
8897
class ReadResponse(FrozenClass):
8898
    '''
8899
    :ivar TypeId:
8900
    :vartype TypeId: NodeId
8901
    :ivar ResponseHeader:
8902
    :vartype ResponseHeader: ResponseHeader
8903
    :ivar Results:
8904
    :vartype Results: DataValue
8905 1
    :ivar DiagnosticInfos:
8906
    :vartype DiagnosticInfos: DiagnosticInfo
8907
    '''
8908
8909
    ua_types = {
8910
        'TypeId': 'NodeId',
8911
        'ResponseHeader': 'ResponseHeader',
8912
        'Results': 'DataValue',
8913
        'DiagnosticInfos': 'DiagnosticInfo',
8914
               }
8915 1
8916
    def __init__(self, binary=None):
8917
        if binary is not None:
8918
            self._binary_init(binary)
8919 1
            self._freeze = True
8920
            return
8921
        self.TypeId = FourByteNodeId(ObjectIds.ReadResponse_Encoding_DefaultBinary)
8922
        self.ResponseHeader = ResponseHeader()
8923
        self.Results = []
8924
        self.DiagnosticInfos = []
8925
        self._freeze = True
8926
8927
    def to_binary(self):
8928
        packet = []
8929
        packet.append(self.TypeId.to_binary())
8930 1
        packet.append(self.ResponseHeader.to_binary())
8931
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
8932
        for fieldname in self.Results:
8933
            packet.append(fieldname.to_binary())
8934
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
8935
        for fieldname in self.DiagnosticInfos:
8936 1
            packet.append(fieldname.to_binary())
8937
        return b''.join(packet)
8938
8939 1
    @staticmethod
8940
    def from_binary(data):
8941
        return ReadResponse(data)
8942
8943
    def _binary_init(self, data):
8944
        self.TypeId = NodeId.from_binary(data)
8945
        self.ResponseHeader = ResponseHeader.from_binary(data)
8946
        length = uabin.Primitives.Int32.unpack(data)
8947
        array = []
8948
        if length != -1:
8949
            for _ in range(0, length):
8950 1
                array.append(DataValue.from_binary(data))
8951
        self.Results = array
8952
        length = uabin.Primitives.Int32.unpack(data)
8953
        array = []
8954
        if length != -1:
8955
            for _ in range(0, length):
8956
                array.append(DiagnosticInfo.from_binary(data))
8957
        self.DiagnosticInfos = array
8958
8959
    def __str__(self):
8960
        return 'ReadResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8961 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
8962
               'Results:' + str(self.Results) + ', ' + \
8963
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
8964
8965
    __repr__ = __str__
8966
8967
8968 View Code Duplication
class HistoryReadValueId(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8969 1
    '''
8970
    :ivar NodeId:
8971
    :vartype NodeId: NodeId
8972
    :ivar IndexRange:
8973 1
    :vartype IndexRange: String
8974
    :ivar DataEncoding:
8975
    :vartype DataEncoding: QualifiedName
8976
    :ivar ContinuationPoint:
8977
    :vartype ContinuationPoint: ByteString
8978
    '''
8979 1
8980
    ua_types = {
8981
        'NodeId': 'NodeId',
8982
        'IndexRange': 'String',
8983
        'DataEncoding': 'QualifiedName',
8984
        'ContinuationPoint': 'ByteString',
8985 1
               }
8986
8987
    def __init__(self, binary=None):
8988 1
        if binary is not None:
8989
            self._binary_init(binary)
8990
            self._freeze = True
8991
            return
8992
        self.NodeId = NodeId()
8993
        self.IndexRange = None
8994
        self.DataEncoding = QualifiedName()
8995 1
        self.ContinuationPoint = None
8996
        self._freeze = True
8997
8998
    def to_binary(self):
8999
        packet = []
9000
        packet.append(self.NodeId.to_binary())
9001
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
9002
        packet.append(self.DataEncoding.to_binary())
9003
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
9004 1
        return b''.join(packet)
9005
9006
    @staticmethod
9007
    def from_binary(data):
9008
        return HistoryReadValueId(data)
9009
9010
    def _binary_init(self, data):
9011
        self.NodeId = NodeId.from_binary(data)
9012 1
        self.IndexRange = uabin.Primitives.String.unpack(data)
9013
        self.DataEncoding = QualifiedName.from_binary(data)
9014
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
9015
9016 1
    def __str__(self):
9017
        return 'HistoryReadValueId(' + 'NodeId:' + str(self.NodeId) + ', ' + \
9018
               'IndexRange:' + str(self.IndexRange) + ', ' + \
9019
               'DataEncoding:' + str(self.DataEncoding) + ', ' + \
9020 1
               'ContinuationPoint:' + str(self.ContinuationPoint) + ')'
9021
9022
    __repr__ = __str__
9023
9024 1
9025 View Code Duplication
class HistoryReadResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9026
    '''
9027 1
    :ivar StatusCode:
9028
    :vartype StatusCode: StatusCode
9029
    :ivar ContinuationPoint:
9030
    :vartype ContinuationPoint: ByteString
9031
    :ivar HistoryData:
9032
    :vartype HistoryData: ExtensionObject
9033
    '''
9034 1
9035
    ua_types = {
9036
        'StatusCode': 'StatusCode',
9037
        'ContinuationPoint': 'ByteString',
9038
        'HistoryData': 'ExtensionObject',
9039
               }
9040
9041
    def __init__(self, binary=None):
9042
        if binary is not None:
9043 1
            self._binary_init(binary)
9044
            self._freeze = True
9045
            return
9046
        self.StatusCode = StatusCode()
9047
        self.ContinuationPoint = None
9048
        self.HistoryData = None
9049
        self._freeze = True
9050
9051 1
    def to_binary(self):
9052
        packet = []
9053
        packet.append(self.StatusCode.to_binary())
9054
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
9055 1
        packet.append(extensionobject_to_binary(self.HistoryData))
9056
        return b''.join(packet)
9057
9058
    @staticmethod
9059 1
    def from_binary(data):
9060
        return HistoryReadResult(data)
9061
9062
    def _binary_init(self, data):
9063 1
        self.StatusCode = StatusCode.from_binary(data)
9064
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
9065
        self.HistoryData = extensionobject_from_binary(data)
9066 1
9067
    def __str__(self):
9068
        return 'HistoryReadResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
9069
               'ContinuationPoint:' + str(self.ContinuationPoint) + ', ' + \
9070
               'HistoryData:' + str(self.HistoryData) + ')'
9071
9072
    __repr__ = __str__
9073
9074
9075 1 View Code Duplication
class HistoryReadDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9076
    '''
9077
    '''
9078
9079
    ua_types = {
9080
               }
9081
9082
    def __init__(self, binary=None):
9083
        if binary is not None:
9084
            self._binary_init(binary)
9085 1
            self._freeze = True
9086
            return
9087
        self._freeze = True
9088
9089
    def to_binary(self):
9090
        packet = []
9091
        return b''.join(packet)
9092
9093
    @staticmethod
9094
    def from_binary(data):
9095
        return HistoryReadDetails(data)
9096 1
9097
    def _binary_init(self, data):
9098
        pass
9099
9100 1
    def __str__(self):
9101
        return 'HistoryReadDetails(' +  + ')'
9102
9103
    __repr__ = __str__
9104
9105
9106 View Code Duplication
class ReadEventDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9107
    '''
9108
    :ivar NumValuesPerNode:
9109
    :vartype NumValuesPerNode: UInt32
9110
    :ivar StartTime:
9111
    :vartype StartTime: DateTime
9112
    :ivar EndTime:
9113
    :vartype EndTime: DateTime
9114
    :ivar Filter:
9115 1
    :vartype Filter: EventFilter
9116
    '''
9117
9118
    ua_types = {
9119
        'NumValuesPerNode': 'UInt32',
9120 1
        'StartTime': 'DateTime',
9121
        'EndTime': 'DateTime',
9122
        'Filter': 'EventFilter',
9123 1
               }
9124
9125
    def __init__(self, binary=None):
9126
        if binary is not None:
9127
            self._binary_init(binary)
9128 1
            self._freeze = True
9129
            return
9130
        self.NumValuesPerNode = 0
9131
        self.StartTime = datetime.now()
9132
        self.EndTime = datetime.now()
9133
        self.Filter = EventFilter()
9134
        self._freeze = True
9135
9136 1
    def to_binary(self):
9137
        packet = []
9138
        packet.append(uabin.Primitives.UInt32.pack(self.NumValuesPerNode))
9139
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
9140
        packet.append(uabin.Primitives.DateTime.pack(self.EndTime))
9141
        packet.append(self.Filter.to_binary())
9142
        return b''.join(packet)
9143 1
9144
    @staticmethod
9145
    def from_binary(data):
9146
        return ReadEventDetails(data)
9147 1
9148
    def _binary_init(self, data):
9149
        self.NumValuesPerNode = uabin.Primitives.UInt32.unpack(data)
9150
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
9151
        self.EndTime = uabin.Primitives.DateTime.unpack(data)
9152
        self.Filter = EventFilter.from_binary(data)
9153
9154
    def __str__(self):
9155 1
        return 'ReadEventDetails(' + 'NumValuesPerNode:' + str(self.NumValuesPerNode) + ', ' + \
9156
               'StartTime:' + str(self.StartTime) + ', ' + \
9157
               'EndTime:' + str(self.EndTime) + ', ' + \
9158 1
               'Filter:' + str(self.Filter) + ')'
9159
9160
    __repr__ = __str__
9161 1
9162
9163 View Code Duplication
class ReadRawModifiedDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9164
    '''
9165
    :ivar IsReadModified:
9166
    :vartype IsReadModified: Boolean
9167
    :ivar StartTime:
9168
    :vartype StartTime: DateTime
9169
    :ivar EndTime:
9170 1
    :vartype EndTime: DateTime
9171
    :ivar NumValuesPerNode:
9172
    :vartype NumValuesPerNode: UInt32
9173
    :ivar ReturnBounds:
9174
    :vartype ReturnBounds: Boolean
9175
    '''
9176
9177
    ua_types = {
9178
        'IsReadModified': 'Boolean',
9179
        'StartTime': 'DateTime',
9180 1
        'EndTime': 'DateTime',
9181
        'NumValuesPerNode': 'UInt32',
9182
        'ReturnBounds': 'Boolean',
9183
               }
9184
9185
    def __init__(self, binary=None):
9186
        if binary is not None:
9187 1
            self._binary_init(binary)
9188
            self._freeze = True
9189
            return
9190
        self.IsReadModified = True
9191 1
        self.StartTime = datetime.now()
9192
        self.EndTime = datetime.now()
9193
        self.NumValuesPerNode = 0
9194
        self.ReturnBounds = True
9195
        self._freeze = True
9196 1
9197
    def to_binary(self):
9198
        packet = []
9199
        packet.append(uabin.Primitives.Boolean.pack(self.IsReadModified))
9200
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
9201 1
        packet.append(uabin.Primitives.DateTime.pack(self.EndTime))
9202
        packet.append(uabin.Primitives.UInt32.pack(self.NumValuesPerNode))
9203
        packet.append(uabin.Primitives.Boolean.pack(self.ReturnBounds))
9204 1
        return b''.join(packet)
9205
9206
    @staticmethod
9207
    def from_binary(data):
9208
        return ReadRawModifiedDetails(data)
9209
9210
    def _binary_init(self, data):
9211
        self.IsReadModified = uabin.Primitives.Boolean.unpack(data)
9212
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
9213
        self.EndTime = uabin.Primitives.DateTime.unpack(data)
9214
        self.NumValuesPerNode = uabin.Primitives.UInt32.unpack(data)
9215 1
        self.ReturnBounds = uabin.Primitives.Boolean.unpack(data)
9216
9217
    def __str__(self):
9218
        return 'ReadRawModifiedDetails(' + 'IsReadModified:' + str(self.IsReadModified) + ', ' + \
9219
               'StartTime:' + str(self.StartTime) + ', ' + \
9220
               'EndTime:' + str(self.EndTime) + ', ' + \
9221
               'NumValuesPerNode:' + str(self.NumValuesPerNode) + ', ' + \
9222
               'ReturnBounds:' + str(self.ReturnBounds) + ')'
9223
9224
    __repr__ = __str__
9225
9226 1
9227 View Code Duplication
class ReadProcessedDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9228
    '''
9229
    :ivar StartTime:
9230
    :vartype StartTime: DateTime
9231
    :ivar EndTime:
9232
    :vartype EndTime: DateTime
9233
    :ivar ProcessingInterval:
9234
    :vartype ProcessingInterval: Double
9235
    :ivar AggregateType:
9236
    :vartype AggregateType: NodeId
9237
    :ivar AggregateConfiguration:
9238 1
    :vartype AggregateConfiguration: AggregateConfiguration
9239
    '''
9240
9241
    ua_types = {
9242 1
        'StartTime': 'DateTime',
9243
        'EndTime': 'DateTime',
9244
        'ProcessingInterval': 'Double',
9245
        'AggregateType': 'NodeId',
9246
        'AggregateConfiguration': 'AggregateConfiguration',
9247
               }
9248
9249
    def __init__(self, binary=None):
9250
        if binary is not None:
9251
            self._binary_init(binary)
9252
            self._freeze = True
9253
            return
9254
        self.StartTime = datetime.now()
9255
        self.EndTime = datetime.now()
9256
        self.ProcessingInterval = 0
9257
        self.AggregateType = []
9258 1
        self.AggregateConfiguration = AggregateConfiguration()
9259
        self._freeze = True
9260
9261
    def to_binary(self):
9262
        packet = []
9263
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
9264 1
        packet.append(uabin.Primitives.DateTime.pack(self.EndTime))
9265
        packet.append(uabin.Primitives.Double.pack(self.ProcessingInterval))
9266
        packet.append(uabin.Primitives.Int32.pack(len(self.AggregateType)))
9267 1
        for fieldname in self.AggregateType:
9268
            packet.append(fieldname.to_binary())
9269
        packet.append(self.AggregateConfiguration.to_binary())
9270
        return b''.join(packet)
9271
9272
    @staticmethod
9273
    def from_binary(data):
9274
        return ReadProcessedDetails(data)
9275
9276 1
    def _binary_init(self, data):
9277 1
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
9278 1
        self.EndTime = uabin.Primitives.DateTime.unpack(data)
9279 1
        self.ProcessingInterval = uabin.Primitives.Double.unpack(data)
9280 1
        length = uabin.Primitives.Int32.unpack(data)
9281 1
        array = []
9282 1
        if length != -1:
9283 1
            for _ in range(0, length):
9284 1
                array.append(NodeId.from_binary(data))
9285
        self.AggregateType = array
9286 1
        self.AggregateConfiguration = AggregateConfiguration.from_binary(data)
9287 1
9288 1
    def __str__(self):
9289 1
        return 'ReadProcessedDetails(' + 'StartTime:' + str(self.StartTime) + ', ' + \
9290 1
               'EndTime:' + str(self.EndTime) + ', ' + \
9291 1
               'ProcessingInterval:' + str(self.ProcessingInterval) + ', ' + \
9292 1
               'AggregateType:' + str(self.AggregateType) + ', ' + \
9293 1
               'AggregateConfiguration:' + str(self.AggregateConfiguration) + ')'
9294
9295 1
    __repr__ = __str__
9296
9297 1
9298 View Code Duplication
class ReadAtTimeDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9299 1
    '''
9300 1
    :ivar ReqTimes:
9301 1
    :vartype ReqTimes: DateTime
9302 1
    :ivar UseSimpleBounds:
9303 1
    :vartype UseSimpleBounds: Boolean
9304 1
    '''
9305 1
9306 1
    ua_types = {
9307 1
        'ReqTimes': 'DateTime',
9308
        'UseSimpleBounds': 'Boolean',
9309 1
               }
9310 1
9311
    def __init__(self, binary=None):
9312
        if binary is not None:
9313
            self._binary_init(binary)
9314 1
            self._freeze = True
9315
            return
9316
        self.ReqTimes = []
9317 1
        self.UseSimpleBounds = True
9318
        self._freeze = True
9319
9320
    def to_binary(self):
9321
        packet = []
9322
        packet.append(uabin.Primitives.Int32.pack(len(self.ReqTimes)))
9323
        for fieldname in self.ReqTimes:
9324
            packet.append(uabin.Primitives.DateTime.pack(fieldname))
9325
        packet.append(uabin.Primitives.Boolean.pack(self.UseSimpleBounds))
9326
        return b''.join(packet)
9327
9328 1
    @staticmethod
9329 1
    def from_binary(data):
9330 1
        return ReadAtTimeDetails(data)
9331 1
9332 1
    def _binary_init(self, data):
9333 1
        self.ReqTimes = uabin.Primitives.DateTime.unpack_array(data)
9334 1
        self.UseSimpleBounds = uabin.Primitives.Boolean.unpack(data)
9335 1
9336 1
    def __str__(self):
9337 1
        return 'ReadAtTimeDetails(' + 'ReqTimes:' + str(self.ReqTimes) + ', ' + \
9338
               'UseSimpleBounds:' + str(self.UseSimpleBounds) + ')'
9339 1
9340 1
    __repr__ = __str__
9341 1
9342 1
9343 1
class HistoryData(FrozenClass):
9344 1
    '''
9345 1
    :ivar DataValues:
9346 1
    :vartype DataValues: DataValue
9347
    '''
9348 1
9349 1
    ua_types = {
9350 1
        'DataValues': 'DataValue',
9351 1
               }
9352
9353 1
    def __init__(self, binary=None):
9354
        if binary is not None:
9355 1
            self._binary_init(binary)
9356
            self._freeze = True
9357 1
            return
9358 1 View Code Duplication
        self.DataValues = []
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9359 1
        self._freeze = True
9360 1
9361 1
    def to_binary(self):
9362 1
        packet = []
9363 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DataValues)))
9364 1
        for fieldname in self.DataValues:
9365 1
            packet.append(fieldname.to_binary())
9366 1
        return b''.join(packet)
9367 1
9368 1
    @staticmethod
9369
    def from_binary(data):
9370 1
        return HistoryData(data)
9371 1
9372 1
    def _binary_init(self, data):
9373 1
        length = uabin.Primitives.Int32.unpack(data)
9374 1
        array = []
9375 1
        if length != -1:
9376 1
            for _ in range(0, length):
9377
                array.append(DataValue.from_binary(data))
9378 1
        self.DataValues = array
9379
9380
    def __str__(self):
9381
        return 'HistoryData(' + 'DataValues:' + str(self.DataValues) + ')'
9382
9383
    __repr__ = __str__
9384 1
9385
9386
class ModificationInfo(FrozenClass):
9387 1
    '''
9388
    :ivar ModificationTime:
9389
    :vartype ModificationTime: DateTime
9390
    :ivar UpdateType:
9391
    :vartype UpdateType: HistoryUpdateType
9392 1
    :ivar UserName:
9393 1
    :vartype UserName: String
9394 1
    '''
9395 1
9396 1
    ua_types = {
9397 1
        'ModificationTime': 'DateTime',
9398 1
        'UpdateType': 'HistoryUpdateType',
9399
        'UserName': 'String',
9400 1
               }
9401 1
9402 1
    def __init__(self, binary=None):
9403 1
        if binary is not None:
9404 1
            self._binary_init(binary)
9405 1
            self._freeze = True
9406
            return
9407 1
        self.ModificationTime = datetime.now()
9408
        self.UpdateType = HistoryUpdateType(0)
9409 1
        self.UserName = None
9410
        self._freeze = True
9411 1
9412 1
    def to_binary(self):
9413 1
        packet = []
9414 1
        packet.append(uabin.Primitives.DateTime.pack(self.ModificationTime))
9415 1
        packet.append(uabin.Primitives.UInt32.pack(self.UpdateType.value))
9416 1
        packet.append(uabin.Primitives.String.pack(self.UserName))
9417 1
        return b''.join(packet)
9418
9419 1
    @staticmethod
9420
    def from_binary(data):
9421
        return ModificationInfo(data)
9422 1
9423
    def _binary_init(self, data):
9424
        self.ModificationTime = uabin.Primitives.DateTime.unpack(data)
9425 1
        self.UpdateType = HistoryUpdateType(uabin.Primitives.UInt32.unpack(data))
9426
        self.UserName = uabin.Primitives.String.unpack(data)
9427
9428
    def __str__(self):
9429
        return 'ModificationInfo(' + 'ModificationTime:' + str(self.ModificationTime) + ', ' + \
9430
               'UpdateType:' + str(self.UpdateType) + ', ' + \
9431
               'UserName:' + str(self.UserName) + ')'
9432
9433
    __repr__ = __str__
9434 1
9435 1
9436 View Code Duplication
class HistoryModifiedData(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9437
    '''
9438
    :ivar DataValues:
9439 1
    :vartype DataValues: DataValue
9440 1
    :ivar ModificationInfos:
9441 1
    :vartype ModificationInfos: ModificationInfo
9442 1
    '''
9443
9444 1
    ua_types = {
9445 1
        'DataValues': 'DataValue',
9446 1
        'ModificationInfos': 'ModificationInfo',
9447 1
               }
9448 1
9449 1
    def __init__(self, binary=None):
9450
        if binary is not None:
9451 1
            self._binary_init(binary)
9452
            self._freeze = True
9453
            return
9454
        self.DataValues = []
9455 1
        self.ModificationInfos = []
9456
        self._freeze = True
9457
9458
    def to_binary(self):
9459
        packet = []
9460 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DataValues)))
9461
        for fieldname in self.DataValues:
9462
            packet.append(fieldname.to_binary())
9463
        packet.append(uabin.Primitives.Int32.pack(len(self.ModificationInfos)))
9464
        for fieldname in self.ModificationInfos:
9465 1
            packet.append(fieldname.to_binary())
9466
        return b''.join(packet)
9467
9468 1
    @staticmethod
9469
    def from_binary(data):
9470
        return HistoryModifiedData(data)
9471
9472
    def _binary_init(self, data):
9473
        length = uabin.Primitives.Int32.unpack(data)
9474
        array = []
9475
        if length != -1:
9476
            for _ in range(0, length):
9477
                array.append(DataValue.from_binary(data))
9478
        self.DataValues = array
9479 1
        length = uabin.Primitives.Int32.unpack(data)
9480 1
        array = []
9481 1
        if length != -1:
9482 1
            for _ in range(0, length):
9483 1
                array.append(ModificationInfo.from_binary(data))
9484 1
        self.ModificationInfos = array
9485 1
9486 1
    def __str__(self):
9487 1
        return 'HistoryModifiedData(' + 'DataValues:' + str(self.DataValues) + ', ' + \
9488 1
               'ModificationInfos:' + str(self.ModificationInfos) + ')'
9489
9490 1
    __repr__ = __str__
9491 1
9492 1
9493 1
class HistoryEvent(FrozenClass):
9494 1
    '''
9495 1
    :ivar Events:
9496 1
    :vartype Events: HistoryEventFieldList
9497 1
    '''
9498 1
9499
    ua_types = {
9500 1
        'Events': 'HistoryEventFieldList',
9501
               }
9502 1
9503
    def __init__(self, binary=None):
9504 1
        if binary is not None:
9505
            self._binary_init(binary)
9506 1
            self._freeze = True
9507 1
            return
9508 1
        self.Events = []
9509 1
        self._freeze = True
9510 1
9511 1
    def to_binary(self):
9512 1
        packet = []
9513 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Events)))
9514 1
        for fieldname in self.Events:
9515 1
            packet.append(fieldname.to_binary())
9516 1
        return b''.join(packet)
9517 1
9518 1
    @staticmethod
9519
    def from_binary(data):
9520 1
        return HistoryEvent(data)
9521
9522 1
    def _binary_init(self, data):
9523
        length = uabin.Primitives.Int32.unpack(data)
9524
        array = []
9525
        if length != -1:
9526
            for _ in range(0, length):
9527
                array.append(HistoryEventFieldList.from_binary(data))
9528 1
        self.Events = array
9529
9530
    def __str__(self):
9531 1
        return 'HistoryEvent(' + 'Events:' + str(self.Events) + ')'
9532
9533
    __repr__ = __str__
9534 1
9535
9536 View Code Duplication
class HistoryReadParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9537
    '''
9538
    :ivar HistoryReadDetails:
9539
    :vartype HistoryReadDetails: ExtensionObject
9540
    :ivar TimestampsToReturn:
9541 1
    :vartype TimestampsToReturn: TimestampsToReturn
9542
    :ivar ReleaseContinuationPoints:
9543
    :vartype ReleaseContinuationPoints: Boolean
9544
    :ivar NodesToRead:
9545 1
    :vartype NodesToRead: HistoryReadValueId
9546
    '''
9547
9548
    ua_types = {
9549 1
        'HistoryReadDetails': 'ExtensionObject',
9550
        'TimestampsToReturn': 'TimestampsToReturn',
9551
        'ReleaseContinuationPoints': 'Boolean',
9552 1
        'NodesToRead': 'HistoryReadValueId',
9553
               }
9554
9555 1
    def __init__(self, binary=None):
9556
        if binary is not None:
9557
            self._binary_init(binary)
9558 1
            self._freeze = True
9559
            return
9560
        self.HistoryReadDetails = None
9561
        self.TimestampsToReturn = TimestampsToReturn(0)
9562
        self.ReleaseContinuationPoints = True
9563
        self.NodesToRead = []
9564
        self._freeze = True
9565
9566
    def to_binary(self):
9567 1
        packet = []
9568
        packet.append(extensionobject_to_binary(self.HistoryReadDetails))
9569
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
9570
        packet.append(uabin.Primitives.Boolean.pack(self.ReleaseContinuationPoints))
9571
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToRead)))
9572
        for fieldname in self.NodesToRead:
9573
            packet.append(fieldname.to_binary())
9574
        return b''.join(packet)
9575
9576
    @staticmethod
9577 1
    def from_binary(data):
9578
        return HistoryReadParameters(data)
9579
9580
    def _binary_init(self, data):
9581
        self.HistoryReadDetails = extensionobject_from_binary(data)
9582
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
9583
        self.ReleaseContinuationPoints = uabin.Primitives.Boolean.unpack(data)
9584 1
        length = uabin.Primitives.Int32.unpack(data)
9585
        array = []
9586
        if length != -1:
9587
            for _ in range(0, length):
9588 1
                array.append(HistoryReadValueId.from_binary(data))
9589
        self.NodesToRead = array
9590
9591
    def __str__(self):
9592
        return 'HistoryReadParameters(' + 'HistoryReadDetails:' + str(self.HistoryReadDetails) + ', ' + \
9593 1
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
9594
               'ReleaseContinuationPoints:' + str(self.ReleaseContinuationPoints) + ', ' + \
9595
               'NodesToRead:' + str(self.NodesToRead) + ')'
9596
9597
    __repr__ = __str__
9598 1
9599
9600
class HistoryReadRequest(FrozenClass):
9601 1
    '''
9602
    :ivar TypeId:
9603
    :vartype TypeId: NodeId
9604
    :ivar RequestHeader:
9605
    :vartype RequestHeader: RequestHeader
9606
    :ivar Parameters:
9607
    :vartype Parameters: HistoryReadParameters
9608 1
    '''
9609 1
9610 1
    ua_types = {
9611 1
        'TypeId': 'NodeId',
9612 1
        'RequestHeader': 'RequestHeader',
9613 1
        'Parameters': 'HistoryReadParameters',
9614 1
               }
9615 1
9616
    def __init__(self, binary=None):
9617 1
        if binary is not None:
9618 1
            self._binary_init(binary)
9619 1
            self._freeze = True
9620 1
            return
9621 1
        self.TypeId = FourByteNodeId(ObjectIds.HistoryReadRequest_Encoding_DefaultBinary)
9622 1
        self.RequestHeader = RequestHeader()
9623 1
        self.Parameters = HistoryReadParameters()
9624
        self._freeze = True
9625 1
9626
    def to_binary(self):
9627 1
        packet = []
9628
        packet.append(self.TypeId.to_binary())
9629 1
        packet.append(self.RequestHeader.to_binary())
9630 1
        packet.append(self.Parameters.to_binary())
9631 1
        return b''.join(packet)
9632 1
9633 1
    @staticmethod
9634 1
    def from_binary(data):
9635 1
        return HistoryReadRequest(data)
9636 1
9637
    def _binary_init(self, data):
9638 1
        self.TypeId = NodeId.from_binary(data)
9639
        self.RequestHeader = RequestHeader.from_binary(data)
9640
        self.Parameters = HistoryReadParameters.from_binary(data)
9641
9642 1
    def __str__(self):
9643
        return 'HistoryReadRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9644
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
9645 1
               'Parameters:' + str(self.Parameters) + ')'
9646
9647
    __repr__ = __str__
9648
9649
9650
class HistoryReadResponse(FrozenClass):
9651
    '''
9652
    :ivar TypeId:
9653
    :vartype TypeId: NodeId
9654
    :ivar ResponseHeader:
9655
    :vartype ResponseHeader: ResponseHeader
9656
    :ivar Results:
9657
    :vartype Results: HistoryReadResult
9658 1
    :ivar DiagnosticInfos:
9659
    :vartype DiagnosticInfos: DiagnosticInfo
9660
    '''
9661
9662
    ua_types = {
9663
        'TypeId': 'NodeId',
9664
        'ResponseHeader': 'ResponseHeader',
9665
        'Results': 'HistoryReadResult',
9666
        'DiagnosticInfos': 'DiagnosticInfo',
9667
               }
9668
9669
    def __init__(self, binary=None):
9670 1
        if binary is not None:
9671
            self._binary_init(binary)
9672
            self._freeze = True
9673
            return
9674
        self.TypeId = FourByteNodeId(ObjectIds.HistoryReadResponse_Encoding_DefaultBinary)
9675
        self.ResponseHeader = ResponseHeader()
9676
        self.Results = []
9677
        self.DiagnosticInfos = []
9678
        self._freeze = True
9679 1
9680
    def to_binary(self):
9681
        packet = []
9682
        packet.append(self.TypeId.to_binary())
9683 1
        packet.append(self.ResponseHeader.to_binary())
9684
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
9685
        for fieldname in self.Results:
9686
            packet.append(fieldname.to_binary())
9687
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
9688
        for fieldname in self.DiagnosticInfos:
9689
            packet.append(fieldname.to_binary())
9690 1
        return b''.join(packet)
9691
9692
    @staticmethod
9693
    def from_binary(data):
9694
        return HistoryReadResponse(data)
9695
9696
    def _binary_init(self, data):
9697 1
        self.TypeId = NodeId.from_binary(data)
9698
        self.ResponseHeader = ResponseHeader.from_binary(data)
9699
        length = uabin.Primitives.Int32.unpack(data)
9700 1
        array = []
9701
        if length != -1:
9702
            for _ in range(0, length):
9703
                array.append(HistoryReadResult.from_binary(data))
9704
        self.Results = array
9705
        length = uabin.Primitives.Int32.unpack(data)
9706
        array = []
9707
        if length != -1:
9708
            for _ in range(0, length):
9709
                array.append(DiagnosticInfo.from_binary(data))
9710
        self.DiagnosticInfos = array
9711 1
9712
    def __str__(self):
9713
        return 'HistoryReadResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9714
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
9715
               'Results:' + str(self.Results) + ', ' + \
9716
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
9717
9718
    __repr__ = __str__
9719
9720
9721 View Code Duplication
class WriteValue(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9722 1
    '''
9723
    :ivar NodeId:
9724
    :vartype NodeId: NodeId
9725
    :ivar AttributeId:
9726
    :vartype AttributeId: UInt32
9727
    :ivar IndexRange:
9728
    :vartype IndexRange: String
9729
    :ivar Value:
9730 1
    :vartype Value: DataValue
9731
    '''
9732
9733
    ua_types = {
9734 1
        'NodeId': 'NodeId',
9735
        'AttributeId': 'UInt32',
9736
        'IndexRange': 'String',
9737
        'Value': 'DataValue',
9738
               }
9739
9740 1
    def __init__(self, binary=None):
9741
        if binary is not None:
9742
            self._binary_init(binary)
9743
            self._freeze = True
9744
            return
9745
        self.NodeId = NodeId()
9746 1
        self.AttributeId = 0
9747
        self.IndexRange = None
9748
        self.Value = DataValue()
9749 1
        self._freeze = True
9750
9751
    def to_binary(self):
9752 1
        packet = []
9753
        packet.append(self.NodeId.to_binary())
9754
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
9755
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
9756
        packet.append(self.Value.to_binary())
9757
        return b''.join(packet)
9758
9759 1
    @staticmethod
9760
    def from_binary(data):
9761
        return WriteValue(data)
9762
9763 1
    def _binary_init(self, data):
9764
        self.NodeId = NodeId.from_binary(data)
9765
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
9766
        self.IndexRange = uabin.Primitives.String.unpack(data)
9767 1
        self.Value = DataValue.from_binary(data)
9768
9769
    def __str__(self):
9770 1
        return 'WriteValue(' + 'NodeId:' + str(self.NodeId) + ', ' + \
9771
               'AttributeId:' + str(self.AttributeId) + ', ' + \
9772
               'IndexRange:' + str(self.IndexRange) + ', ' + \
9773 1
               'Value:' + str(self.Value) + ')'
9774
9775
    __repr__ = __str__
9776 1
9777
9778
class WriteParameters(FrozenClass):
9779
    '''
9780
    :ivar NodesToWrite:
9781
    :vartype NodesToWrite: WriteValue
9782
    '''
9783
9784
    ua_types = {
9785 1
        'NodesToWrite': 'WriteValue',
9786 1
               }
9787 1
9788 1
    def __init__(self, binary=None):
9789 1
        if binary is not None:
9790 1
            self._binary_init(binary)
9791 1
            self._freeze = True
9792 1
            return
9793 1
        self.NodesToWrite = []
9794
        self._freeze = True
9795 1
9796 1
    def to_binary(self):
9797 1
        packet = []
9798 1
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToWrite)))
9799 1
        for fieldname in self.NodesToWrite:
9800 1
            packet.append(fieldname.to_binary())
9801 1
        return b''.join(packet)
9802
9803 1
    @staticmethod
9804 1
    def from_binary(data):
9805
        return WriteParameters(data)
9806 1
9807
    def _binary_init(self, data):
9808 1
        length = uabin.Primitives.Int32.unpack(data)
9809
        array = []
9810 1
        if length != -1:
9811 1
            for _ in range(0, length):
9812 1
                array.append(WriteValue.from_binary(data))
9813 1
        self.NodesToWrite = array
9814 1
9815 1
    def __str__(self):
9816 1
        return 'WriteParameters(' + 'NodesToWrite:' + str(self.NodesToWrite) + ')'
9817 1
9818 1
    __repr__ = __str__
9819 1
9820 1
9821
class WriteRequest(FrozenClass):
9822 1
    '''
9823 1
    :ivar TypeId:
9824
    :vartype TypeId: NodeId
9825 1
    :ivar RequestHeader:
9826
    :vartype RequestHeader: RequestHeader
9827
    :ivar Parameters:
9828
    :vartype Parameters: WriteParameters
9829
    '''
9830 1
9831
    ua_types = {
9832
        'TypeId': 'NodeId',
9833 1
        'RequestHeader': 'RequestHeader',
9834
        'Parameters': 'WriteParameters',
9835
               }
9836
9837
    def __init__(self, binary=None):
9838
        if binary is not None:
9839
            self._binary_init(binary)
9840
            self._freeze = True
9841
            return
9842 1
        self.TypeId = FourByteNodeId(ObjectIds.WriteRequest_Encoding_DefaultBinary)
9843
        self.RequestHeader = RequestHeader()
9844
        self.Parameters = WriteParameters()
9845
        self._freeze = True
9846
9847
    def to_binary(self):
9848
        packet = []
9849
        packet.append(self.TypeId.to_binary())
9850
        packet.append(self.RequestHeader.to_binary())
9851
        packet.append(self.Parameters.to_binary())
9852 1
        return b''.join(packet)
9853
9854
    @staticmethod
9855
    def from_binary(data):
9856
        return WriteRequest(data)
9857
9858
    def _binary_init(self, data):
9859 1
        self.TypeId = NodeId.from_binary(data)
9860
        self.RequestHeader = RequestHeader.from_binary(data)
9861
        self.Parameters = WriteParameters.from_binary(data)
9862
9863 1
    def __str__(self):
9864
        return 'WriteRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9865
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
9866
               'Parameters:' + str(self.Parameters) + ')'
9867
9868 1
    __repr__ = __str__
9869
9870
9871
class WriteResponse(FrozenClass):
9872
    '''
9873 1
    :ivar TypeId:
9874
    :vartype TypeId: NodeId
9875
    :ivar ResponseHeader:
9876 1
    :vartype ResponseHeader: ResponseHeader
9877
    :ivar Results:
9878
    :vartype Results: StatusCode
9879
    :ivar DiagnosticInfos:
9880
    :vartype DiagnosticInfos: DiagnosticInfo
9881
    '''
9882
9883
    ua_types = {
9884
        'TypeId': 'NodeId',
9885
        'ResponseHeader': 'ResponseHeader',
9886
        'Results': 'StatusCode',
9887
        'DiagnosticInfos': 'DiagnosticInfo',
9888
               }
9889 1
9890 1
    def __init__(self, binary=None):
9891 1
        if binary is not None:
9892 1
            self._binary_init(binary)
9893 1
            self._freeze = True
9894 1
            return
9895 1
        self.TypeId = FourByteNodeId(ObjectIds.WriteResponse_Encoding_DefaultBinary)
9896 1
        self.ResponseHeader = ResponseHeader()
9897 1
        self.Results = []
9898 1
        self.DiagnosticInfos = []
9899 1
        self._freeze = True
9900
9901 1
    def to_binary(self):
9902 1
        packet = []
9903 1
        packet.append(self.TypeId.to_binary())
9904 1
        packet.append(self.ResponseHeader.to_binary())
9905 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
9906 1
        for fieldname in self.Results:
9907 1
            packet.append(fieldname.to_binary())
9908 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
9909
        for fieldname in self.DiagnosticInfos:
9910 1
            packet.append(fieldname.to_binary())
9911
        return b''.join(packet)
9912 1
9913
    @staticmethod
9914 1
    def from_binary(data):
9915 1
        return WriteResponse(data)
9916 1
9917 1
    def _binary_init(self, data):
9918 1
        self.TypeId = NodeId.from_binary(data)
9919 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
9920
        length = uabin.Primitives.Int32.unpack(data)
9921 1
        array = []
9922
        if length != -1:
9923
            for _ in range(0, length):
9924
                array.append(StatusCode.from_binary(data))
9925
        self.Results = array
9926
        length = uabin.Primitives.Int32.unpack(data)
9927
        array = []
9928 1
        if length != -1:
9929
            for _ in range(0, length):
9930
                array.append(DiagnosticInfo.from_binary(data))
9931 1
        self.DiagnosticInfos = array
9932
9933
    def __str__(self):
9934
        return 'WriteResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9935
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
9936
               'Results:' + str(self.Results) + ', ' + \
9937
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
9938
9939
    __repr__ = __str__
9940 1
9941 1
9942 1 View Code Duplication
class HistoryUpdateDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9943 1
    '''
9944 1
    :ivar NodeId:
9945 1
    :vartype NodeId: NodeId
9946 1
    '''
9947 1
9948 1
    ua_types = {
9949
        'NodeId': 'NodeId',
9950 1
               }
9951 1
9952 1
    def __init__(self, binary=None):
9953 1
        if binary is not None:
9954 1
            self._binary_init(binary)
9955 1
            self._freeze = True
9956
            return
9957 1
        self.NodeId = NodeId()
9958
        self._freeze = True
9959 1
9960
    def to_binary(self):
9961 1
        packet = []
9962 1
        packet.append(self.NodeId.to_binary())
9963 1
        return b''.join(packet)
9964 1
9965
    @staticmethod
9966 1
    def from_binary(data):
9967
        return HistoryUpdateDetails(data)
9968
9969
    def _binary_init(self, data):
9970
        self.NodeId = NodeId.from_binary(data)
9971 1
9972
    def __str__(self):
9973
        return 'HistoryUpdateDetails(' + 'NodeId:' + str(self.NodeId) + ')'
9974 1
9975
    __repr__ = __str__
9976
9977
9978 View Code Duplication
class UpdateDataDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9979
    '''
9980
    :ivar NodeId:
9981
    :vartype NodeId: NodeId
9982
    :ivar PerformInsertReplace:
9983
    :vartype PerformInsertReplace: PerformUpdateType
9984
    :ivar UpdateValues:
9985
    :vartype UpdateValues: DataValue
9986
    '''
9987 1
9988 1
    ua_types = {
9989 1
        'NodeId': 'NodeId',
9990 1
        'PerformInsertReplace': 'PerformUpdateType',
9991 1
        'UpdateValues': 'DataValue',
9992 1
               }
9993 1
9994 1
    def __init__(self, binary=None):
9995 1
        if binary is not None:
9996 1
            self._binary_init(binary)
9997 1
            self._freeze = True
9998
            return
9999 1
        self.NodeId = NodeId()
10000 1
        self.PerformInsertReplace = PerformUpdateType(0)
10001 1
        self.UpdateValues = []
10002 1
        self._freeze = True
10003 1
10004 1
    def to_binary(self):
10005 1
        packet = []
10006 1
        packet.append(self.NodeId.to_binary())
10007
        packet.append(uabin.Primitives.UInt32.pack(self.PerformInsertReplace.value))
10008 1
        packet.append(uabin.Primitives.Int32.pack(len(self.UpdateValues)))
10009
        for fieldname in self.UpdateValues:
10010 1
            packet.append(fieldname.to_binary())
10011
        return b''.join(packet)
10012 1
10013 1
    @staticmethod
10014 1
    def from_binary(data):
10015 1
        return UpdateDataDetails(data)
10016 1
10017 1
    def _binary_init(self, data):
10018
        self.NodeId = NodeId.from_binary(data)
10019 1
        self.PerformInsertReplace = PerformUpdateType(uabin.Primitives.UInt32.unpack(data))
10020
        length = uabin.Primitives.Int32.unpack(data)
10021
        array = []
10022
        if length != -1:
10023
            for _ in range(0, length):
10024
                array.append(DataValue.from_binary(data))
10025
        self.UpdateValues = array
10026 1
10027
    def __str__(self):
10028
        return 'UpdateDataDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10029 1
               'PerformInsertReplace:' + str(self.PerformInsertReplace) + ', ' + \
10030
               'UpdateValues:' + str(self.UpdateValues) + ')'
10031
10032
    __repr__ = __str__
10033
10034
10035 View Code Duplication
class UpdateStructureDataDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10036
    '''
10037
    :ivar NodeId:
10038 1
    :vartype NodeId: NodeId
10039 1
    :ivar PerformInsertReplace:
10040 1
    :vartype PerformInsertReplace: PerformUpdateType
10041 1
    :ivar UpdateValues:
10042 1
    :vartype UpdateValues: DataValue
10043 1
    '''
10044 1
10045 1
    ua_types = {
10046 1
        'NodeId': 'NodeId',
10047
        'PerformInsertReplace': 'PerformUpdateType',
10048 1
        'UpdateValues': 'DataValue',
10049 1
               }
10050 1
10051 1
    def __init__(self, binary=None):
10052 1
        if binary is not None:
10053 1
            self._binary_init(binary)
10054 1
            self._freeze = True
10055 1
            return
10056
        self.NodeId = NodeId()
10057 1
        self.PerformInsertReplace = PerformUpdateType(0)
10058
        self.UpdateValues = []
10059 1
        self._freeze = True
10060
10061 1
    def to_binary(self):
10062 1
        packet = []
10063 1
        packet.append(self.NodeId.to_binary())
10064 1
        packet.append(uabin.Primitives.UInt32.pack(self.PerformInsertReplace.value))
10065 1
        packet.append(uabin.Primitives.Int32.pack(len(self.UpdateValues)))
10066 1
        for fieldname in self.UpdateValues:
10067 1
            packet.append(fieldname.to_binary())
10068 1
        return b''.join(packet)
10069 1
10070
    @staticmethod
10071 1
    def from_binary(data):
10072
        return UpdateStructureDataDetails(data)
10073
10074
    def _binary_init(self, data):
10075
        self.NodeId = NodeId.from_binary(data)
10076 1
        self.PerformInsertReplace = PerformUpdateType(uabin.Primitives.UInt32.unpack(data))
10077
        length = uabin.Primitives.Int32.unpack(data)
10078
        array = []
10079 1
        if length != -1:
10080
            for _ in range(0, length):
10081
                array.append(DataValue.from_binary(data))
10082
        self.UpdateValues = array
10083
10084
    def __str__(self):
10085
        return 'UpdateStructureDataDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10086
               'PerformInsertReplace:' + str(self.PerformInsertReplace) + ', ' + \
10087
               'UpdateValues:' + str(self.UpdateValues) + ')'
10088 1
10089 1
    __repr__ = __str__
10090
10091
10092 View Code Duplication
class UpdateEventDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10093 1
    '''
10094 1
    :ivar NodeId:
10095 1
    :vartype NodeId: NodeId
10096 1
    :ivar PerformInsertReplace:
10097
    :vartype PerformInsertReplace: PerformUpdateType
10098 1
    :ivar Filter:
10099 1
    :vartype Filter: EventFilter
10100 1
    :ivar EventData:
10101 1
    :vartype EventData: HistoryEventFieldList
10102 1
    '''
10103 1
10104
    ua_types = {
10105 1
        'NodeId': 'NodeId',
10106
        'PerformInsertReplace': 'PerformUpdateType',
10107
        'Filter': 'EventFilter',
10108
        'EventData': 'HistoryEventFieldList',
10109 1
               }
10110
10111
    def __init__(self, binary=None):
10112
        if binary is not None:
10113
            self._binary_init(binary)
10114 1
            self._freeze = True
10115
            return
10116
        self.NodeId = NodeId()
10117
        self.PerformInsertReplace = PerformUpdateType(0)
10118
        self.Filter = EventFilter()
10119 1
        self.EventData = []
10120
        self._freeze = True
10121
10122 1
    def to_binary(self):
10123
        packet = []
10124
        packet.append(self.NodeId.to_binary())
10125
        packet.append(uabin.Primitives.UInt32.pack(self.PerformInsertReplace.value))
10126
        packet.append(self.Filter.to_binary())
10127
        packet.append(uabin.Primitives.Int32.pack(len(self.EventData)))
10128
        for fieldname in self.EventData:
10129
            packet.append(fieldname.to_binary())
10130
        return b''.join(packet)
10131
10132
    @staticmethod
10133 1
    def from_binary(data):
10134 1
        return UpdateEventDetails(data)
10135 1
10136 1
    def _binary_init(self, data):
10137 1
        self.NodeId = NodeId.from_binary(data)
10138 1
        self.PerformInsertReplace = PerformUpdateType(uabin.Primitives.UInt32.unpack(data))
10139 1
        self.Filter = EventFilter.from_binary(data)
10140 1
        length = uabin.Primitives.Int32.unpack(data)
10141 1
        array = []
10142 1
        if length != -1:
10143
            for _ in range(0, length):
10144 1
                array.append(HistoryEventFieldList.from_binary(data))
10145 1
        self.EventData = array
10146 1
10147 1
    def __str__(self):
10148 1
        return 'UpdateEventDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10149 1
               'PerformInsertReplace:' + str(self.PerformInsertReplace) + ', ' + \
10150 1
               'Filter:' + str(self.Filter) + ', ' + \
10151 1
               'EventData:' + str(self.EventData) + ')'
10152 1
10153
    __repr__ = __str__
10154 1
10155
10156 1 View Code Duplication
class DeleteRawModifiedDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10157
    '''
10158 1
    :ivar NodeId:
10159
    :vartype NodeId: NodeId
10160 1
    :ivar IsDeleteModified:
10161 1
    :vartype IsDeleteModified: Boolean
10162 1
    :ivar StartTime:
10163 1
    :vartype StartTime: DateTime
10164 1
    :ivar EndTime:
10165 1
    :vartype EndTime: DateTime
10166 1
    '''
10167 1
10168 1
    ua_types = {
10169 1
        'NodeId': 'NodeId',
10170 1
        'IsDeleteModified': 'Boolean',
10171 1
        'StartTime': 'DateTime',
10172 1
        'EndTime': 'DateTime',
10173
               }
10174 1
10175
    def __init__(self, binary=None):
10176 1
        if binary is not None:
10177
            self._binary_init(binary)
10178
            self._freeze = True
10179
            return
10180
        self.NodeId = NodeId()
10181
        self.IsDeleteModified = True
10182 1
        self.StartTime = datetime.now()
10183
        self.EndTime = datetime.now()
10184
        self._freeze = True
10185 1
10186
    def to_binary(self):
10187
        packet = []
10188
        packet.append(self.NodeId.to_binary())
10189
        packet.append(uabin.Primitives.Boolean.pack(self.IsDeleteModified))
10190
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
10191
        packet.append(uabin.Primitives.DateTime.pack(self.EndTime))
10192 1
        return b''.join(packet)
10193
10194
    @staticmethod
10195
    def from_binary(data):
10196
        return DeleteRawModifiedDetails(data)
10197
10198
    def _binary_init(self, data):
10199
        self.NodeId = NodeId.from_binary(data)
10200
        self.IsDeleteModified = uabin.Primitives.Boolean.unpack(data)
10201 1
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
10202
        self.EndTime = uabin.Primitives.DateTime.unpack(data)
10203
10204
    def __str__(self):
10205
        return 'DeleteRawModifiedDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10206
               'IsDeleteModified:' + str(self.IsDeleteModified) + ', ' + \
10207 1
               'StartTime:' + str(self.StartTime) + ', ' + \
10208
               'EndTime:' + str(self.EndTime) + ')'
10209
10210
    __repr__ = __str__
10211 1
10212
10213 View Code Duplication
class DeleteAtTimeDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10214
    '''
10215 1
    :ivar NodeId:
10216
    :vartype NodeId: NodeId
10217
    :ivar ReqTimes:
10218
    :vartype ReqTimes: DateTime
10219 1
    '''
10220
10221
    ua_types = {
10222 1
        'NodeId': 'NodeId',
10223
        'ReqTimes': 'DateTime',
10224
               }
10225
10226
    def __init__(self, binary=None):
10227
        if binary is not None:
10228
            self._binary_init(binary)
10229
            self._freeze = True
10230
            return
10231
        self.NodeId = NodeId()
10232
        self.ReqTimes = []
10233 1
        self._freeze = True
10234
10235
    def to_binary(self):
10236
        packet = []
10237
        packet.append(self.NodeId.to_binary())
10238
        packet.append(uabin.Primitives.Int32.pack(len(self.ReqTimes)))
10239
        for fieldname in self.ReqTimes:
10240
            packet.append(uabin.Primitives.DateTime.pack(fieldname))
10241
        return b''.join(packet)
10242
10243
    @staticmethod
10244 1
    def from_binary(data):
10245
        return DeleteAtTimeDetails(data)
10246
10247
    def _binary_init(self, data):
10248
        self.NodeId = NodeId.from_binary(data)
10249
        self.ReqTimes = uabin.Primitives.DateTime.unpack_array(data)
10250
10251
    def __str__(self):
10252 1
        return 'DeleteAtTimeDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10253
               'ReqTimes:' + str(self.ReqTimes) + ')'
10254
10255
    __repr__ = __str__
10256 1
10257
10258 View Code Duplication
class DeleteEventDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10259
    '''
10260
    :ivar NodeId:
10261
    :vartype NodeId: NodeId
10262 1
    :ivar EventIds:
10263
    :vartype EventIds: ByteString
10264
    '''
10265
10266
    ua_types = {
10267
        'NodeId': 'NodeId',
10268 1
        'EventIds': 'ByteString',
10269
               }
10270
10271 1
    def __init__(self, binary=None):
10272
        if binary is not None:
10273
            self._binary_init(binary)
10274
            self._freeze = True
10275
            return
10276
        self.NodeId = NodeId()
10277
        self.EventIds = []
10278
        self._freeze = True
10279
10280 1
    def to_binary(self):
10281
        packet = []
10282
        packet.append(self.NodeId.to_binary())
10283
        packet.append(uabin.Primitives.Int32.pack(len(self.EventIds)))
10284
        for fieldname in self.EventIds:
10285
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
10286
        return b''.join(packet)
10287
10288
    @staticmethod
10289
    def from_binary(data):
10290 1
        return DeleteEventDetails(data)
10291
10292
    def _binary_init(self, data):
10293
        self.NodeId = NodeId.from_binary(data)
10294
        self.EventIds = uabin.Primitives.ByteString.unpack_array(data)
10295
10296
    def __str__(self):
10297
        return 'DeleteEventDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10298
               'EventIds:' + str(self.EventIds) + ')'
10299 1
10300
    __repr__ = __str__
10301
10302
10303 1 View Code Duplication
class HistoryUpdateResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10304
    '''
10305
    :ivar StatusCode:
10306
    :vartype StatusCode: StatusCode
10307
    :ivar OperationResults:
10308
    :vartype OperationResults: StatusCode
10309
    :ivar DiagnosticInfos:
10310
    :vartype DiagnosticInfos: DiagnosticInfo
10311
    '''
10312
10313 1
    ua_types = {
10314
        'StatusCode': 'StatusCode',
10315
        'OperationResults': 'StatusCode',
10316
        'DiagnosticInfos': 'DiagnosticInfo',
10317
               }
10318 1
10319
    def __init__(self, binary=None):
10320
        if binary is not None:
10321 1
            self._binary_init(binary)
10322
            self._freeze = True
10323
            return
10324
        self.StatusCode = StatusCode()
10325
        self.OperationResults = []
10326
        self.DiagnosticInfos = []
10327
        self._freeze = True
10328
10329
    def to_binary(self):
10330 1
        packet = []
10331
        packet.append(self.StatusCode.to_binary())
10332
        packet.append(uabin.Primitives.Int32.pack(len(self.OperationResults)))
10333
        for fieldname in self.OperationResults:
10334
            packet.append(fieldname.to_binary())
10335
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
10336
        for fieldname in self.DiagnosticInfos:
10337
            packet.append(fieldname.to_binary())
10338
        return b''.join(packet)
10339
10340 1
    @staticmethod
10341
    def from_binary(data):
10342
        return HistoryUpdateResult(data)
10343
10344
    def _binary_init(self, data):
10345
        self.StatusCode = StatusCode.from_binary(data)
10346
        length = uabin.Primitives.Int32.unpack(data)
10347 1
        array = []
10348
        if length != -1:
10349
            for _ in range(0, length):
10350
                array.append(StatusCode.from_binary(data))
10351 1
        self.OperationResults = array
10352
        length = uabin.Primitives.Int32.unpack(data)
10353
        array = []
10354
        if length != -1:
10355
            for _ in range(0, length):
10356 1
                array.append(DiagnosticInfo.from_binary(data))
10357
        self.DiagnosticInfos = array
10358
10359
    def __str__(self):
10360
        return 'HistoryUpdateResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
10361 1
               'OperationResults:' + str(self.OperationResults) + ', ' + \
10362
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
10363
10364 1
    __repr__ = __str__
10365
10366
10367
class HistoryUpdateParameters(FrozenClass):
10368
    '''
10369
    :ivar HistoryUpdateDetails:
10370
    :vartype HistoryUpdateDetails: ExtensionObject
10371
    '''
10372
10373
    ua_types = {
10374
        'HistoryUpdateDetails': 'ExtensionObject',
10375 1
               }
10376
10377
    def __init__(self, binary=None):
10378
        if binary is not None:
10379
            self._binary_init(binary)
10380
            self._freeze = True
10381
            return
10382
        self.HistoryUpdateDetails = []
10383
        self._freeze = True
10384
10385
    def to_binary(self):
10386 1
        packet = []
10387
        packet.append(uabin.Primitives.Int32.pack(len(self.HistoryUpdateDetails)))
10388
        for fieldname in self.HistoryUpdateDetails:
10389
            packet.append(extensionobject_to_binary(fieldname))
10390
        return b''.join(packet)
10391
10392
    @staticmethod
10393
    def from_binary(data):
10394
        return HistoryUpdateParameters(data)
10395
10396
    def _binary_init(self, data):
10397
        length = uabin.Primitives.Int32.unpack(data)
10398 1
        array = []
10399
        if length != -1:
10400
            for _ in range(0, length):
10401
                array.append(extensionobject_from_binary(data))
10402 1
        self.HistoryUpdateDetails = array
10403
10404
    def __str__(self):
10405
        return 'HistoryUpdateParameters(' + 'HistoryUpdateDetails:' + str(self.HistoryUpdateDetails) + ')'
10406
10407
    __repr__ = __str__
10408
10409
10410
class HistoryUpdateRequest(FrozenClass):
10411
    '''
10412
    :ivar TypeId:
10413
    :vartype TypeId: NodeId
10414
    :ivar RequestHeader:
10415
    :vartype RequestHeader: RequestHeader
10416
    :ivar Parameters:
10417
    :vartype Parameters: HistoryUpdateParameters
10418 1
    '''
10419
10420
    ua_types = {
10421
        'TypeId': 'NodeId',
10422
        'RequestHeader': 'RequestHeader',
10423
        'Parameters': 'HistoryUpdateParameters',
10424 1
               }
10425
10426
    def __init__(self, binary=None):
10427 1
        if binary is not None:
10428
            self._binary_init(binary)
10429
            self._freeze = True
10430
            return
10431
        self.TypeId = FourByteNodeId(ObjectIds.HistoryUpdateRequest_Encoding_DefaultBinary)
10432
        self.RequestHeader = RequestHeader()
10433
        self.Parameters = HistoryUpdateParameters()
10434
        self._freeze = True
10435
10436 1
    def to_binary(self):
10437
        packet = []
10438
        packet.append(self.TypeId.to_binary())
10439
        packet.append(self.RequestHeader.to_binary())
10440
        packet.append(self.Parameters.to_binary())
10441
        return b''.join(packet)
10442
10443
    @staticmethod
10444
    def from_binary(data):
10445
        return HistoryUpdateRequest(data)
10446 1
10447
    def _binary_init(self, data):
10448
        self.TypeId = NodeId.from_binary(data)
10449
        self.RequestHeader = RequestHeader.from_binary(data)
10450
        self.Parameters = HistoryUpdateParameters.from_binary(data)
10451
10452
    def __str__(self):
10453
        return 'HistoryUpdateRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10454
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
10455 1
               'Parameters:' + str(self.Parameters) + ')'
10456
10457
    __repr__ = __str__
10458
10459 1
10460
class HistoryUpdateResponse(FrozenClass):
10461
    '''
10462
    :ivar TypeId:
10463
    :vartype TypeId: NodeId
10464 1
    :ivar ResponseHeader:
10465
    :vartype ResponseHeader: ResponseHeader
10466
    :ivar Results:
10467
    :vartype Results: HistoryUpdateResult
10468
    :ivar DiagnosticInfos:
10469 1
    :vartype DiagnosticInfos: DiagnosticInfo
10470
    '''
10471
10472 1
    ua_types = {
10473
        'TypeId': 'NodeId',
10474
        'ResponseHeader': 'ResponseHeader',
10475
        'Results': 'HistoryUpdateResult',
10476
        'DiagnosticInfos': 'DiagnosticInfo',
10477
               }
10478
10479
    def __init__(self, binary=None):
10480
        if binary is not None:
10481 1
            self._binary_init(binary)
10482
            self._freeze = True
10483
            return
10484
        self.TypeId = FourByteNodeId(ObjectIds.HistoryUpdateResponse_Encoding_DefaultBinary)
10485
        self.ResponseHeader = ResponseHeader()
10486
        self.Results = []
10487
        self.DiagnosticInfos = []
10488
        self._freeze = True
10489
10490
    def to_binary(self):
10491 1
        packet = []
10492
        packet.append(self.TypeId.to_binary())
10493
        packet.append(self.ResponseHeader.to_binary())
10494
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
10495
        for fieldname in self.Results:
10496
            packet.append(fieldname.to_binary())
10497
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
10498 1
        for fieldname in self.DiagnosticInfos:
10499
            packet.append(fieldname.to_binary())
10500
        return b''.join(packet)
10501
10502 1
    @staticmethod
10503
    def from_binary(data):
10504
        return HistoryUpdateResponse(data)
10505
10506
    def _binary_init(self, data):
10507 1
        self.TypeId = NodeId.from_binary(data)
10508
        self.ResponseHeader = ResponseHeader.from_binary(data)
10509
        length = uabin.Primitives.Int32.unpack(data)
10510
        array = []
10511
        if length != -1:
10512 1
            for _ in range(0, length):
10513
                array.append(HistoryUpdateResult.from_binary(data))
10514
        self.Results = array
10515 1
        length = uabin.Primitives.Int32.unpack(data)
10516
        array = []
10517
        if length != -1:
10518
            for _ in range(0, length):
10519
                array.append(DiagnosticInfo.from_binary(data))
10520
        self.DiagnosticInfos = array
10521
10522 1
    def __str__(self):
10523
        return 'HistoryUpdateResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10524
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
10525
               'Results:' + str(self.Results) + ', ' + \
10526
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
10527
10528
    __repr__ = __str__
10529
10530
10531 1 View Code Duplication
class CallMethodRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10532
    '''
10533
    :ivar ObjectId:
10534
    :vartype ObjectId: NodeId
10535
    :ivar MethodId:
10536
    :vartype MethodId: NodeId
10537
    :ivar InputArguments:
10538
    :vartype InputArguments: Variant
10539
    '''
10540
10541 1
    ua_types = {
10542
        'ObjectId': 'NodeId',
10543
        'MethodId': 'NodeId',
10544
        'InputArguments': 'Variant',
10545 1
               }
10546
10547
    def __init__(self, binary=None):
10548
        if binary is not None:
10549
            self._binary_init(binary)
10550
            self._freeze = True
10551
            return
10552
        self.ObjectId = NodeId()
10553
        self.MethodId = NodeId()
10554
        self.InputArguments = []
10555
        self._freeze = True
10556
10557
    def to_binary(self):
10558
        packet = []
10559 1
        packet.append(self.ObjectId.to_binary())
10560
        packet.append(self.MethodId.to_binary())
10561
        packet.append(uabin.Primitives.Int32.pack(len(self.InputArguments)))
10562
        for fieldname in self.InputArguments:
10563 1
            packet.append(fieldname.to_binary())
10564
        return b''.join(packet)
10565
10566 1
    @staticmethod
10567
    def from_binary(data):
10568
        return CallMethodRequest(data)
10569
10570
    def _binary_init(self, data):
10571
        self.ObjectId = NodeId.from_binary(data)
10572
        self.MethodId = NodeId.from_binary(data)
10573
        length = uabin.Primitives.Int32.unpack(data)
10574
        array = []
10575 1
        if length != -1:
10576
            for _ in range(0, length):
10577
                array.append(Variant.from_binary(data))
10578
        self.InputArguments = array
10579
10580
    def __str__(self):
10581
        return 'CallMethodRequest(' + 'ObjectId:' + str(self.ObjectId) + ', ' + \
10582
               'MethodId:' + str(self.MethodId) + ', ' + \
10583
               'InputArguments:' + str(self.InputArguments) + ')'
10584
10585 1
    __repr__ = __str__
10586
10587
10588
class CallMethodResult(FrozenClass):
10589
    '''
10590
    :ivar StatusCode:
10591
    :vartype StatusCode: StatusCode
10592 1
    :ivar InputArgumentResults:
10593
    :vartype InputArgumentResults: StatusCode
10594
    :ivar InputArgumentDiagnosticInfos:
10595
    :vartype InputArgumentDiagnosticInfos: DiagnosticInfo
10596 1
    :ivar OutputArguments:
10597
    :vartype OutputArguments: Variant
10598
    '''
10599
10600
    ua_types = {
10601 1
        'StatusCode': 'StatusCode',
10602
        'InputArgumentResults': 'StatusCode',
10603
        'InputArgumentDiagnosticInfos': 'DiagnosticInfo',
10604
        'OutputArguments': 'Variant',
10605
               }
10606 1
10607
    def __init__(self, binary=None):
10608
        if binary is not None:
10609 1
            self._binary_init(binary)
10610
            self._freeze = True
10611
            return
10612
        self.StatusCode = StatusCode()
10613
        self.InputArgumentResults = []
10614
        self.InputArgumentDiagnosticInfos = []
10615
        self.OutputArguments = []
10616
        self._freeze = True
10617
10618 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10619
        packet = []
10620 1
        packet.append(self.StatusCode.to_binary())
10621
        packet.append(uabin.Primitives.Int32.pack(len(self.InputArgumentResults)))
10622
        for fieldname in self.InputArgumentResults:
10623
            packet.append(fieldname.to_binary())
10624
        packet.append(uabin.Primitives.Int32.pack(len(self.InputArgumentDiagnosticInfos)))
10625
        for fieldname in self.InputArgumentDiagnosticInfos:
10626
            packet.append(fieldname.to_binary())
10627
        packet.append(uabin.Primitives.Int32.pack(len(self.OutputArguments)))
10628
        for fieldname in self.OutputArguments:
10629
            packet.append(fieldname.to_binary())
10630
        return b''.join(packet)
10631 1
10632
    @staticmethod
10633
    def from_binary(data):
10634
        return CallMethodResult(data)
10635
10636
    def _binary_init(self, data):
10637
        self.StatusCode = StatusCode.from_binary(data)
10638
        length = uabin.Primitives.Int32.unpack(data)
10639
        array = []
10640
        if length != -1:
10641
            for _ in range(0, length):
10642
                array.append(StatusCode.from_binary(data))
10643 1
        self.InputArgumentResults = array
10644
        length = uabin.Primitives.Int32.unpack(data)
10645
        array = []
10646
        if length != -1:
10647 1
            for _ in range(0, length):
10648
                array.append(DiagnosticInfo.from_binary(data))
10649
        self.InputArgumentDiagnosticInfos = array
10650
        length = uabin.Primitives.Int32.unpack(data)
10651
        array = []
10652
        if length != -1:
10653 1
            for _ in range(0, length):
10654
                array.append(Variant.from_binary(data))
10655
        self.OutputArguments = array
10656
10657
    def __str__(self):
10658
        return 'CallMethodResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
10659 1
               'InputArgumentResults:' + str(self.InputArgumentResults) + ', ' + \
10660
               'InputArgumentDiagnosticInfos:' + str(self.InputArgumentDiagnosticInfos) + ', ' + \
10661
               'OutputArguments:' + str(self.OutputArguments) + ')'
10662 1
10663
    __repr__ = __str__
10664
10665
10666
class CallParameters(FrozenClass):
10667
    '''
10668
    :ivar MethodsToCall:
10669
    :vartype MethodsToCall: CallMethodRequest
10670
    '''
10671 1
10672
    ua_types = {
10673
        'MethodsToCall': 'CallMethodRequest',
10674
               }
10675
10676
    def __init__(self, binary=None):
10677
        if binary is not None:
10678
            self._binary_init(binary)
10679
            self._freeze = True
10680
            return
10681 1
        self.MethodsToCall = []
10682
        self._freeze = True
10683
10684
    def to_binary(self):
10685
        packet = []
10686
        packet.append(uabin.Primitives.Int32.pack(len(self.MethodsToCall)))
10687
        for fieldname in self.MethodsToCall:
10688 1
            packet.append(fieldname.to_binary())
10689
        return b''.join(packet)
10690
10691
    @staticmethod
10692 1
    def from_binary(data):
10693
        return CallParameters(data)
10694
10695
    def _binary_init(self, data):
10696
        length = uabin.Primitives.Int32.unpack(data)
10697 1
        array = []
10698
        if length != -1:
10699
            for _ in range(0, length):
10700
                array.append(CallMethodRequest.from_binary(data))
10701
        self.MethodsToCall = array
10702 1
10703
    def __str__(self):
10704
        return 'CallParameters(' + 'MethodsToCall:' + str(self.MethodsToCall) + ')'
10705 1
10706
    __repr__ = __str__
10707
10708
10709
class CallRequest(FrozenClass):
10710
    '''
10711
    :ivar TypeId:
10712
    :vartype TypeId: NodeId
10713
    :ivar RequestHeader:
10714
    :vartype RequestHeader: RequestHeader
10715
    :ivar Parameters:
10716 1
    :vartype Parameters: CallParameters
10717
    '''
10718
10719
    ua_types = {
10720
        'TypeId': 'NodeId',
10721
        'RequestHeader': 'RequestHeader',
10722
        'Parameters': 'CallParameters',
10723
               }
10724
10725
    def __init__(self, binary=None):
10726
        if binary is not None:
10727 1
            self._binary_init(binary)
10728
            self._freeze = True
10729
            return
10730
        self.TypeId = FourByteNodeId(ObjectIds.CallRequest_Encoding_DefaultBinary)
10731
        self.RequestHeader = RequestHeader()
10732
        self.Parameters = CallParameters()
10733
        self._freeze = True
10734
10735
    def to_binary(self):
10736
        packet = []
10737
        packet.append(self.TypeId.to_binary())
10738
        packet.append(self.RequestHeader.to_binary())
10739
        packet.append(self.Parameters.to_binary())
10740
        return b''.join(packet)
10741
10742
    @staticmethod
10743 1
    def from_binary(data):
10744
        return CallRequest(data)
10745
10746
    def _binary_init(self, data):
10747 1
        self.TypeId = NodeId.from_binary(data)
10748 View Code Duplication
        self.RequestHeader = RequestHeader.from_binary(data)
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10749
        self.Parameters = CallParameters.from_binary(data)
10750
10751
    def __str__(self):
10752
        return 'CallRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10753
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
10754
               'Parameters:' + str(self.Parameters) + ')'
10755
10756
    __repr__ = __str__
10757
10758
10759
class CallResponse(FrozenClass):
10760
    '''
10761
    :ivar TypeId:
10762
    :vartype TypeId: NodeId
10763
    :ivar ResponseHeader:
10764
    :vartype ResponseHeader: ResponseHeader
10765
    :ivar Results:
10766
    :vartype Results: CallMethodResult
10767
    :ivar DiagnosticInfos:
10768
    :vartype DiagnosticInfos: DiagnosticInfo
10769
    '''
10770
10771
    ua_types = {
10772
        'TypeId': 'NodeId',
10773 1
        'ResponseHeader': 'ResponseHeader',
10774
        'Results': 'CallMethodResult',
10775
        'DiagnosticInfos': 'DiagnosticInfo',
10776
               }
10777
10778
    def __init__(self, binary=None):
10779 1
        if binary is not None:
10780
            self._binary_init(binary)
10781
            self._freeze = True
10782 1
            return
10783
        self.TypeId = FourByteNodeId(ObjectIds.CallResponse_Encoding_DefaultBinary)
10784
        self.ResponseHeader = ResponseHeader()
10785
        self.Results = []
10786
        self.DiagnosticInfos = []
10787
        self._freeze = True
10788
10789
    def to_binary(self):
10790
        packet = []
10791 1
        packet.append(self.TypeId.to_binary())
10792
        packet.append(self.ResponseHeader.to_binary())
10793
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
10794
        for fieldname in self.Results:
10795
            packet.append(fieldname.to_binary())
10796
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
10797
        for fieldname in self.DiagnosticInfos:
10798
            packet.append(fieldname.to_binary())
10799
        return b''.join(packet)
10800
10801 1
    @staticmethod
10802
    def from_binary(data):
10803
        return CallResponse(data)
10804
10805
    def _binary_init(self, data):
10806
        self.TypeId = NodeId.from_binary(data)
10807
        self.ResponseHeader = ResponseHeader.from_binary(data)
10808 1
        length = uabin.Primitives.Int32.unpack(data)
10809
        array = []
10810
        if length != -1:
10811
            for _ in range(0, length):
10812 1
                array.append(CallMethodResult.from_binary(data))
10813
        self.Results = array
10814
        length = uabin.Primitives.Int32.unpack(data)
10815
        array = []
10816
        if length != -1:
10817 1
            for _ in range(0, length):
10818
                array.append(DiagnosticInfo.from_binary(data))
10819
        self.DiagnosticInfos = array
10820
10821
    def __str__(self):
10822 1
        return 'CallResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10823
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
10824
               'Results:' + str(self.Results) + ', ' + \
10825 1
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
10826
10827
    __repr__ = __str__
10828
10829
10830 View Code Duplication
class MonitoringFilter(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10831
    '''
10832 1
    '''
10833 1
10834 1
    ua_types = {
10835 1
               }
10836 1
10837 1
    def __init__(self, binary=None):
10838 1
        if binary is not None:
10839 1
            self._binary_init(binary)
10840
            self._freeze = True
10841 1
            return
10842 1
        self._freeze = True
10843 1
10844 1
    def to_binary(self):
10845 1
        packet = []
10846 1
        return b''.join(packet)
10847 1
10848
    @staticmethod
10849 1
    def from_binary(data):
10850
        return MonitoringFilter(data)
10851 1
10852
    def _binary_init(self, data):
10853 1
        pass
10854 1
10855 1
    def __str__(self):
10856
        return 'MonitoringFilter(' +  + ')'
10857 1
10858
    __repr__ = __str__
10859
10860
10861 1
class DataChangeFilter(FrozenClass):
10862
    '''
10863
    :ivar Trigger:
10864 1
    :vartype Trigger: DataChangeTrigger
10865
    :ivar DeadbandType:
10866
    :vartype DeadbandType: UInt32
10867
    :ivar DeadbandValue:
10868
    :vartype DeadbandValue: Double
10869
    '''
10870
10871
    ua_types = {
10872
        'Trigger': 'DataChangeTrigger',
10873 1
        'DeadbandType': 'UInt32',
10874 1
        'DeadbandValue': 'Double',
10875
               }
10876
10877
    def __init__(self, binary=None):
10878 1
        if binary is not None:
10879 1
            self._binary_init(binary)
10880 1
            self._freeze = True
10881 1
            return
10882
        self.Trigger = DataChangeTrigger(0)
10883 1
        self.DeadbandType = 0
10884 1
        self.DeadbandValue = 0
10885 1
        self._freeze = True
10886 1
10887 1
    def to_binary(self):
10888 1
        packet = []
10889
        packet.append(uabin.Primitives.UInt32.pack(self.Trigger.value))
10890 1
        packet.append(uabin.Primitives.UInt32.pack(self.DeadbandType))
10891
        packet.append(uabin.Primitives.Double.pack(self.DeadbandValue))
10892
        return b''.join(packet)
10893
10894 1
    @staticmethod
10895
    def from_binary(data):
10896
        return DataChangeFilter(data)
10897
10898
    def _binary_init(self, data):
10899 1
        self.Trigger = DataChangeTrigger(uabin.Primitives.UInt32.unpack(data))
10900
        self.DeadbandType = uabin.Primitives.UInt32.unpack(data)
10901
        self.DeadbandValue = uabin.Primitives.Double.unpack(data)
10902
10903
    def __str__(self):
10904 1
        return 'DataChangeFilter(' + 'Trigger:' + str(self.Trigger) + ', ' + \
10905
               'DeadbandType:' + str(self.DeadbandType) + ', ' + \
10906
               'DeadbandValue:' + str(self.DeadbandValue) + ')'
10907 1
10908
    __repr__ = __str__
10909
10910
10911 View Code Duplication
class EventFilter(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10912
    '''
10913
    :ivar SelectClauses:
10914
    :vartype SelectClauses: SimpleAttributeOperand
10915
    :ivar WhereClause:
10916
    :vartype WhereClause: ContentFilter
10917
    '''
10918 1
10919 1
    ua_types = {
10920 1
        'SelectClauses': 'SimpleAttributeOperand',
10921 1
        'WhereClause': 'ContentFilter',
10922 1
               }
10923 1
10924 1
    def __init__(self, binary=None):
10925 1
        if binary is not None:
10926 1
            self._binary_init(binary)
10927 1
            self._freeze = True
10928
            return
10929 1
        self.SelectClauses = []
10930 1
        self.WhereClause = ContentFilter()
10931 1
        self._freeze = True
10932 1
10933 1
    def to_binary(self):
10934 1
        packet = []
10935 1
        packet.append(uabin.Primitives.Int32.pack(len(self.SelectClauses)))
10936 1
        for fieldname in self.SelectClauses:
10937 1
            packet.append(fieldname.to_binary())
10938
        packet.append(self.WhereClause.to_binary())
10939 1
        return b''.join(packet)
10940
10941 1
    @staticmethod
10942
    def from_binary(data):
10943 1
        return EventFilter(data)
10944
10945 1
    def _binary_init(self, data):
10946 1
        length = uabin.Primitives.Int32.unpack(data)
10947 1
        array = []
10948 1
        if length != -1:
10949 1
            for _ in range(0, length):
10950 1
                array.append(SimpleAttributeOperand.from_binary(data))
10951 1
        self.SelectClauses = array
10952 1
        self.WhereClause = ContentFilter.from_binary(data)
10953 1
10954 1
    def __str__(self):
10955 1
        return 'EventFilter(' + 'SelectClauses:' + str(self.SelectClauses) + ', ' + \
10956 1
               'WhereClause:' + str(self.WhereClause) + ')'
10957 1
10958
    __repr__ = __str__
10959 1
10960
10961 1 View Code Duplication
class AggregateConfiguration(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10962
    '''
10963
    :ivar UseServerCapabilitiesDefaults:
10964
    :vartype UseServerCapabilitiesDefaults: Boolean
10965
    :ivar TreatUncertainAsBad:
10966
    :vartype TreatUncertainAsBad: Boolean
10967 1
    :ivar PercentDataBad:
10968
    :vartype PercentDataBad: Byte
10969
    :ivar PercentDataGood:
10970 1
    :vartype PercentDataGood: Byte
10971
    :ivar UseSlopedExtrapolation:
10972
    :vartype UseSlopedExtrapolation: Boolean
10973
    '''
10974
10975
    ua_types = {
10976
        'UseServerCapabilitiesDefaults': 'Boolean',
10977
        'TreatUncertainAsBad': 'Boolean',
10978
        'PercentDataBad': 'Byte',
10979
        'PercentDataGood': 'Byte',
10980
        'UseSlopedExtrapolation': 'Boolean',
10981
               }
10982
10983
    def __init__(self, binary=None):
10984
        if binary is not None:
10985 1
            self._binary_init(binary)
10986 1
            self._freeze = True
10987 1
            return
10988 1
        self.UseServerCapabilitiesDefaults = True
10989 1
        self.TreatUncertainAsBad = True
10990 1
        self.PercentDataBad = 0
10991 1
        self.PercentDataGood = 0
10992 1
        self.UseSlopedExtrapolation = True
10993 1
        self._freeze = True
10994 1
10995 1
    def to_binary(self):
10996 1
        packet = []
10997
        packet.append(uabin.Primitives.Boolean.pack(self.UseServerCapabilitiesDefaults))
10998 1
        packet.append(uabin.Primitives.Boolean.pack(self.TreatUncertainAsBad))
10999 1
        packet.append(uabin.Primitives.Byte.pack(self.PercentDataBad))
11000 1
        packet.append(uabin.Primitives.Byte.pack(self.PercentDataGood))
11001 1
        packet.append(uabin.Primitives.Boolean.pack(self.UseSlopedExtrapolation))
11002 1
        return b''.join(packet)
11003 1
11004 1
    @staticmethod
11005 1
    def from_binary(data):
11006 1
        return AggregateConfiguration(data)
11007
11008 1
    def _binary_init(self, data):
11009
        self.UseServerCapabilitiesDefaults = uabin.Primitives.Boolean.unpack(data)
11010 1
        self.TreatUncertainAsBad = uabin.Primitives.Boolean.unpack(data)
11011
        self.PercentDataBad = uabin.Primitives.Byte.unpack(data)
11012 1
        self.PercentDataGood = uabin.Primitives.Byte.unpack(data)
11013 1
        self.UseSlopedExtrapolation = uabin.Primitives.Boolean.unpack(data)
11014 1
11015 1
    def __str__(self):
11016 1
        return 'AggregateConfiguration(' + 'UseServerCapabilitiesDefaults:' + str(self.UseServerCapabilitiesDefaults) + ', ' + \
11017 1
               'TreatUncertainAsBad:' + str(self.TreatUncertainAsBad) + ', ' + \
11018 1
               'PercentDataBad:' + str(self.PercentDataBad) + ', ' + \
11019
               'PercentDataGood:' + str(self.PercentDataGood) + ', ' + \
11020 1
               'UseSlopedExtrapolation:' + str(self.UseSlopedExtrapolation) + ')'
11021
11022
    __repr__ = __str__
11023
11024
11025 View Code Duplication
class AggregateFilter(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11026
    '''
11027
    :ivar StartTime:
11028 1
    :vartype StartTime: DateTime
11029
    :ivar AggregateType:
11030
    :vartype AggregateType: NodeId
11031 1
    :ivar ProcessingInterval:
11032
    :vartype ProcessingInterval: Double
11033
    :ivar AggregateConfiguration:
11034
    :vartype AggregateConfiguration: AggregateConfiguration
11035
    '''
11036
11037
    ua_types = {
11038
        'StartTime': 'DateTime',
11039
        'AggregateType': 'NodeId',
11040 1
        'ProcessingInterval': 'Double',
11041 1
        'AggregateConfiguration': 'AggregateConfiguration',
11042
               }
11043
11044
    def __init__(self, binary=None):
11045 1
        if binary is not None:
11046 1
            self._binary_init(binary)
11047 1
            self._freeze = True
11048 1
            return
11049
        self.StartTime = datetime.now()
11050 1
        self.AggregateType = NodeId()
11051 1
        self.ProcessingInterval = 0
11052 1
        self.AggregateConfiguration = AggregateConfiguration()
11053 1
        self._freeze = True
11054 1
11055 1
    def to_binary(self):
11056
        packet = []
11057 1
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
11058
        packet.append(self.AggregateType.to_binary())
11059
        packet.append(uabin.Primitives.Double.pack(self.ProcessingInterval))
11060
        packet.append(self.AggregateConfiguration.to_binary())
11061 1
        return b''.join(packet)
11062
11063
    @staticmethod
11064
    def from_binary(data):
11065
        return AggregateFilter(data)
11066 1
11067
    def _binary_init(self, data):
11068
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
11069
        self.AggregateType = NodeId.from_binary(data)
11070
        self.ProcessingInterval = uabin.Primitives.Double.unpack(data)
11071 1
        self.AggregateConfiguration = AggregateConfiguration.from_binary(data)
11072
11073
    def __str__(self):
11074 1
        return 'AggregateFilter(' + 'StartTime:' + str(self.StartTime) + ', ' + \
11075
               'AggregateType:' + str(self.AggregateType) + ', ' + \
11076
               'ProcessingInterval:' + str(self.ProcessingInterval) + ', ' + \
11077
               'AggregateConfiguration:' + str(self.AggregateConfiguration) + ')'
11078
11079
    __repr__ = __str__
11080
11081
11082 View Code Duplication
class MonitoringFilterResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11083
    '''
11084
    '''
11085 1
11086 1
    ua_types = {
11087 1
               }
11088 1
11089 1
    def __init__(self, binary=None):
11090 1
        if binary is not None:
11091 1
            self._binary_init(binary)
11092 1
            self._freeze = True
11093 1
            return
11094 1
        self._freeze = True
11095
11096 1
    def to_binary(self):
11097 1
        packet = []
11098 1
        return b''.join(packet)
11099 1
11100 1
    @staticmethod
11101 1
    def from_binary(data):
11102 1
        return MonitoringFilterResult(data)
11103
11104 1
    def _binary_init(self, data):
11105
        pass
11106 1
11107
    def __str__(self):
11108 1
        return 'MonitoringFilterResult(' +  + ')'
11109 1
11110 1
    __repr__ = __str__
11111 1
11112 1
11113 View Code Duplication
class EventFilterResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11114 1
    '''
11115
    :ivar SelectClauseResults:
11116
    :vartype SelectClauseResults: StatusCode
11117
    :ivar SelectClauseDiagnosticInfos:
11118
    :vartype SelectClauseDiagnosticInfos: DiagnosticInfo
11119
    :ivar WhereClauseResult:
11120 1
    :vartype WhereClauseResult: ContentFilterResult
11121
    '''
11122
11123 1
    ua_types = {
11124
        'SelectClauseResults': 'StatusCode',
11125
        'SelectClauseDiagnosticInfos': 'DiagnosticInfo',
11126
        'WhereClauseResult': 'ContentFilterResult',
11127
               }
11128
11129
    def __init__(self, binary=None):
11130
        if binary is not None:
11131
            self._binary_init(binary)
11132 1
            self._freeze = True
11133 1
            return
11134 1
        self.SelectClauseResults = []
11135 1
        self.SelectClauseDiagnosticInfos = []
11136 1
        self.WhereClauseResult = ContentFilterResult()
11137 1
        self._freeze = True
11138 1
11139 1
    def to_binary(self):
11140 1
        packet = []
11141
        packet.append(uabin.Primitives.Int32.pack(len(self.SelectClauseResults)))
11142 1
        for fieldname in self.SelectClauseResults:
11143 1
            packet.append(fieldname.to_binary())
11144 1
        packet.append(uabin.Primitives.Int32.pack(len(self.SelectClauseDiagnosticInfos)))
11145 1
        for fieldname in self.SelectClauseDiagnosticInfos:
11146 1
            packet.append(fieldname.to_binary())
11147 1
        packet.append(self.WhereClauseResult.to_binary())
11148
        return b''.join(packet)
11149 1
11150
    @staticmethod
11151 1
    def from_binary(data):
11152
        return EventFilterResult(data)
11153 1
11154 1
    def _binary_init(self, data):
11155 1
        length = uabin.Primitives.Int32.unpack(data)
11156 1
        array = []
11157
        if length != -1:
11158 1
            for _ in range(0, length):
11159
                array.append(StatusCode.from_binary(data))
11160
        self.SelectClauseResults = array
11161
        length = uabin.Primitives.Int32.unpack(data)
11162
        array = []
11163 1
        if length != -1:
11164
            for _ in range(0, length):
11165
                array.append(DiagnosticInfo.from_binary(data))
11166 1
        self.SelectClauseDiagnosticInfos = array
11167
        self.WhereClauseResult = ContentFilterResult.from_binary(data)
11168
11169
    def __str__(self):
11170
        return 'EventFilterResult(' + 'SelectClauseResults:' + str(self.SelectClauseResults) + ', ' + \
11171
               'SelectClauseDiagnosticInfos:' + str(self.SelectClauseDiagnosticInfos) + ', ' + \
11172
               'WhereClauseResult:' + str(self.WhereClauseResult) + ')'
11173
11174
    __repr__ = __str__
11175
11176
11177 View Code Duplication
class AggregateFilterResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11178
    '''
11179
    :ivar RevisedStartTime:
11180
    :vartype RevisedStartTime: DateTime
11181 1
    :ivar RevisedProcessingInterval:
11182
    :vartype RevisedProcessingInterval: Double
11183
    :ivar RevisedAggregateConfiguration:
11184
    :vartype RevisedAggregateConfiguration: AggregateConfiguration
11185
    '''
11186
11187
    ua_types = {
11188
        'RevisedStartTime': 'DateTime',
11189
        'RevisedProcessingInterval': 'Double',
11190
        'RevisedAggregateConfiguration': 'AggregateConfiguration',
11191
               }
11192
11193
    def __init__(self, binary=None):
11194 1
        if binary is not None:
11195
            self._binary_init(binary)
11196
            self._freeze = True
11197
            return
11198
        self.RevisedStartTime = datetime.now()
11199
        self.RevisedProcessingInterval = 0
11200
        self.RevisedAggregateConfiguration = AggregateConfiguration()
11201
        self._freeze = True
11202
11203
    def to_binary(self):
11204 1
        packet = []
11205
        packet.append(uabin.Primitives.DateTime.pack(self.RevisedStartTime))
11206
        packet.append(uabin.Primitives.Double.pack(self.RevisedProcessingInterval))
11207
        packet.append(self.RevisedAggregateConfiguration.to_binary())
11208 1
        return b''.join(packet)
11209
11210
    @staticmethod
11211
    def from_binary(data):
11212
        return AggregateFilterResult(data)
11213
11214
    def _binary_init(self, data):
11215
        self.RevisedStartTime = uabin.Primitives.DateTime.unpack(data)
11216 1
        self.RevisedProcessingInterval = uabin.Primitives.Double.unpack(data)
11217
        self.RevisedAggregateConfiguration = AggregateConfiguration.from_binary(data)
11218
11219
    def __str__(self):
11220
        return 'AggregateFilterResult(' + 'RevisedStartTime:' + str(self.RevisedStartTime) + ', ' + \
11221
               'RevisedProcessingInterval:' + str(self.RevisedProcessingInterval) + ', ' + \
11222
               'RevisedAggregateConfiguration:' + str(self.RevisedAggregateConfiguration) + ')'
11223
11224 1
    __repr__ = __str__
11225
11226
11227 1
class MonitoringParameters(FrozenClass):
11228
    '''
11229
    :ivar ClientHandle:
11230
    :vartype ClientHandle: UInt32
11231
    :ivar SamplingInterval:
11232
    :vartype SamplingInterval: Double
11233
    :ivar Filter:
11234
    :vartype Filter: ExtensionObject
11235
    :ivar QueueSize:
11236 1
    :vartype QueueSize: UInt32
11237
    :ivar DiscardOldest:
11238
    :vartype DiscardOldest: Boolean
11239
    '''
11240
11241
    ua_types = {
11242
        'ClientHandle': 'UInt32',
11243
        'SamplingInterval': 'Double',
11244
        'Filter': 'ExtensionObject',
11245
        'QueueSize': 'UInt32',
11246 1
        'DiscardOldest': 'Boolean',
11247
               }
11248
11249
    def __init__(self, binary=None):
11250
        if binary is not None:
11251
            self._binary_init(binary)
11252
            self._freeze = True
11253 1
            return
11254
        self.ClientHandle = 0
11255
        self.SamplingInterval = 0
11256
        self.Filter = None
11257 1
        self.QueueSize = 0
11258
        self.DiscardOldest = True
11259
        self._freeze = True
11260
11261
    def to_binary(self):
11262 1
        packet = []
11263
        packet.append(uabin.Primitives.UInt32.pack(self.ClientHandle))
11264
        packet.append(uabin.Primitives.Double.pack(self.SamplingInterval))
11265
        packet.append(extensionobject_to_binary(self.Filter))
11266
        packet.append(uabin.Primitives.UInt32.pack(self.QueueSize))
11267 1
        packet.append(uabin.Primitives.Boolean.pack(self.DiscardOldest))
11268
        return b''.join(packet)
11269
11270 1
    @staticmethod
11271
    def from_binary(data):
11272
        return MonitoringParameters(data)
11273
11274
    def _binary_init(self, data):
11275
        self.ClientHandle = uabin.Primitives.UInt32.unpack(data)
11276
        self.SamplingInterval = uabin.Primitives.Double.unpack(data)
11277
        self.Filter = extensionobject_from_binary(data)
11278
        self.QueueSize = uabin.Primitives.UInt32.unpack(data)
11279 1
        self.DiscardOldest = uabin.Primitives.Boolean.unpack(data)
11280
11281
    def __str__(self):
11282
        return 'MonitoringParameters(' + 'ClientHandle:' + str(self.ClientHandle) + ', ' + \
11283
               'SamplingInterval:' + str(self.SamplingInterval) + ', ' + \
11284
               'Filter:' + str(self.Filter) + ', ' + \
11285
               'QueueSize:' + str(self.QueueSize) + ', ' + \
11286
               'DiscardOldest:' + str(self.DiscardOldest) + ')'
11287
11288
    __repr__ = __str__
11289 1
11290
11291
class MonitoredItemCreateRequest(FrozenClass):
11292
    '''
11293
    :ivar ItemToMonitor:
11294
    :vartype ItemToMonitor: ReadValueId
11295
    :ivar MonitoringMode:
11296 1
    :vartype MonitoringMode: MonitoringMode
11297
    :ivar RequestedParameters:
11298
    :vartype RequestedParameters: MonitoringParameters
11299
    '''
11300 1
11301
    ua_types = {
11302
        'ItemToMonitor': 'ReadValueId',
11303
        'MonitoringMode': 'MonitoringMode',
11304
        'RequestedParameters': 'MonitoringParameters',
11305 1
               }
11306
11307
    def __init__(self, binary=None):
11308
        if binary is not None:
11309
            self._binary_init(binary)
11310 1
            self._freeze = True
11311
            return
11312
        self.ItemToMonitor = ReadValueId()
11313 1
        self.MonitoringMode = MonitoringMode(0)
11314
        self.RequestedParameters = MonitoringParameters()
11315
        self._freeze = True
11316
11317
    def to_binary(self):
11318
        packet = []
11319
        packet.append(self.ItemToMonitor.to_binary())
11320
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoringMode.value))
11321
        packet.append(self.RequestedParameters.to_binary())
11322 1
        return b''.join(packet)
11323
11324
    @staticmethod
11325
    def from_binary(data):
11326
        return MonitoredItemCreateRequest(data)
11327
11328
    def _binary_init(self, data):
11329
        self.ItemToMonitor = ReadValueId.from_binary(data)
11330
        self.MonitoringMode = MonitoringMode(uabin.Primitives.UInt32.unpack(data))
11331
        self.RequestedParameters = MonitoringParameters.from_binary(data)
11332 1
11333
    def __str__(self):
11334
        return 'MonitoredItemCreateRequest(' + 'ItemToMonitor:' + str(self.ItemToMonitor) + ', ' + \
11335
               'MonitoringMode:' + str(self.MonitoringMode) + ', ' + \
11336
               'RequestedParameters:' + str(self.RequestedParameters) + ')'
11337
11338
    __repr__ = __str__
11339 1
11340
11341
class MonitoredItemCreateResult(FrozenClass):
11342
    '''
11343 1
    :ivar StatusCode:
11344
    :vartype StatusCode: StatusCode
11345
    :ivar MonitoredItemId:
11346
    :vartype MonitoredItemId: UInt32
11347
    :ivar RevisedSamplingInterval:
11348 1
    :vartype RevisedSamplingInterval: Double
11349
    :ivar RevisedQueueSize:
11350
    :vartype RevisedQueueSize: UInt32
11351
    :ivar FilterResult:
11352
    :vartype FilterResult: ExtensionObject
11353 1
    '''
11354
11355
    ua_types = {
11356 1
        'StatusCode': 'StatusCode',
11357
        'MonitoredItemId': 'UInt32',
11358
        'RevisedSamplingInterval': 'Double',
11359
        'RevisedQueueSize': 'UInt32',
11360
        'FilterResult': 'ExtensionObject',
11361
               }
11362
11363 1
    def __init__(self, binary=None):
11364
        if binary is not None:
11365
            self._binary_init(binary)
11366
            self._freeze = True
11367
            return
11368
        self.StatusCode = StatusCode()
11369
        self.MonitoredItemId = 0
11370
        self.RevisedSamplingInterval = 0
11371
        self.RevisedQueueSize = 0
11372 1
        self.FilterResult = None
11373
        self._freeze = True
11374
11375
    def to_binary(self):
11376
        packet = []
11377
        packet.append(self.StatusCode.to_binary())
11378
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoredItemId))
11379
        packet.append(uabin.Primitives.Double.pack(self.RevisedSamplingInterval))
11380 1
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedQueueSize))
11381
        packet.append(extensionobject_to_binary(self.FilterResult))
11382
        return b''.join(packet)
11383
11384 1
    @staticmethod
11385
    def from_binary(data):
11386
        return MonitoredItemCreateResult(data)
11387
11388 1
    def _binary_init(self, data):
11389
        self.StatusCode = StatusCode.from_binary(data)
11390
        self.MonitoredItemId = uabin.Primitives.UInt32.unpack(data)
11391
        self.RevisedSamplingInterval = uabin.Primitives.Double.unpack(data)
11392 1
        self.RevisedQueueSize = uabin.Primitives.UInt32.unpack(data)
11393
        self.FilterResult = extensionobject_from_binary(data)
11394
11395 1
    def __str__(self):
11396
        return 'MonitoredItemCreateResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
11397
               'MonitoredItemId:' + str(self.MonitoredItemId) + ', ' + \
11398
               'RevisedSamplingInterval:' + str(self.RevisedSamplingInterval) + ', ' + \
11399
               'RevisedQueueSize:' + str(self.RevisedQueueSize) + ', ' + \
11400
               'FilterResult:' + str(self.FilterResult) + ')'
11401
11402
    __repr__ = __str__
11403
11404 1
11405 View Code Duplication
class CreateMonitoredItemsParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11406
    '''
11407
    :ivar SubscriptionId:
11408
    :vartype SubscriptionId: UInt32
11409
    :ivar TimestampsToReturn:
11410
    :vartype TimestampsToReturn: TimestampsToReturn
11411
    :ivar ItemsToCreate:
11412
    :vartype ItemsToCreate: MonitoredItemCreateRequest
11413
    '''
11414 1
11415
    ua_types = {
11416
        'SubscriptionId': 'UInt32',
11417
        'TimestampsToReturn': 'TimestampsToReturn',
11418
        'ItemsToCreate': 'MonitoredItemCreateRequest',
11419
               }
11420
11421 1
    def __init__(self, binary=None):
11422
        if binary is not None:
11423
            self._binary_init(binary)
11424
            self._freeze = True
11425 1
            return
11426
        self.SubscriptionId = 0
11427
        self.TimestampsToReturn = TimestampsToReturn(0)
11428
        self.ItemsToCreate = []
11429
        self._freeze = True
11430 1
11431
    def to_binary(self):
11432
        packet = []
11433
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
11434
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
11435 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ItemsToCreate)))
11436
        for fieldname in self.ItemsToCreate:
11437
            packet.append(fieldname.to_binary())
11438 1
        return b''.join(packet)
11439
11440
    @staticmethod
11441
    def from_binary(data):
11442
        return CreateMonitoredItemsParameters(data)
11443
11444
    def _binary_init(self, data):
11445 1
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
11446
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
11447
        length = uabin.Primitives.Int32.unpack(data)
11448
        array = []
11449
        if length != -1:
11450
            for _ in range(0, length):
11451
                array.append(MonitoredItemCreateRequest.from_binary(data))
11452
        self.ItemsToCreate = array
11453
11454 1
    def __str__(self):
11455
        return 'CreateMonitoredItemsParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
11456
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
11457
               'ItemsToCreate:' + str(self.ItemsToCreate) + ')'
11458
11459
    __repr__ = __str__
11460
11461
11462
class CreateMonitoredItemsRequest(FrozenClass):
11463
    '''
11464 1
    :ivar TypeId:
11465
    :vartype TypeId: NodeId
11466
    :ivar RequestHeader:
11467
    :vartype RequestHeader: RequestHeader
11468 1
    :ivar Parameters:
11469
    :vartype Parameters: CreateMonitoredItemsParameters
11470
    '''
11471
11472
    ua_types = {
11473
        'TypeId': 'NodeId',
11474
        'RequestHeader': 'RequestHeader',
11475
        'Parameters': 'CreateMonitoredItemsParameters',
11476
               }
11477
11478
    def __init__(self, binary=None):
11479
        if binary is not None:
11480
            self._binary_init(binary)
11481
            self._freeze = True
11482 1
            return
11483
        self.TypeId = FourByteNodeId(ObjectIds.CreateMonitoredItemsRequest_Encoding_DefaultBinary)
11484
        self.RequestHeader = RequestHeader()
11485
        self.Parameters = CreateMonitoredItemsParameters()
11486 1
        self._freeze = True
11487
11488
    def to_binary(self):
11489 1
        packet = []
11490
        packet.append(self.TypeId.to_binary())
11491
        packet.append(self.RequestHeader.to_binary())
11492
        packet.append(self.Parameters.to_binary())
11493
        return b''.join(packet)
11494
11495
    @staticmethod
11496
    def from_binary(data):
11497
        return CreateMonitoredItemsRequest(data)
11498 1
11499
    def _binary_init(self, data):
11500
        self.TypeId = NodeId.from_binary(data)
11501
        self.RequestHeader = RequestHeader.from_binary(data)
11502
        self.Parameters = CreateMonitoredItemsParameters.from_binary(data)
11503
11504
    def __str__(self):
11505
        return 'CreateMonitoredItemsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11506
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
11507
               'Parameters:' + str(self.Parameters) + ')'
11508 1
11509
    __repr__ = __str__
11510
11511
11512
class CreateMonitoredItemsResponse(FrozenClass):
11513
    '''
11514
    :ivar TypeId:
11515 1
    :vartype TypeId: NodeId
11516
    :ivar ResponseHeader:
11517
    :vartype ResponseHeader: ResponseHeader
11518
    :ivar Results:
11519 1
    :vartype Results: MonitoredItemCreateResult
11520
    :ivar DiagnosticInfos:
11521
    :vartype DiagnosticInfos: DiagnosticInfo
11522
    '''
11523
11524 1
    ua_types = {
11525
        'TypeId': 'NodeId',
11526
        'ResponseHeader': 'ResponseHeader',
11527
        'Results': 'MonitoredItemCreateResult',
11528
        'DiagnosticInfos': 'DiagnosticInfo',
11529 1
               }
11530
11531
    def __init__(self, binary=None):
11532 1
        if binary is not None:
11533
            self._binary_init(binary)
11534
            self._freeze = True
11535
            return
11536
        self.TypeId = FourByteNodeId(ObjectIds.CreateMonitoredItemsResponse_Encoding_DefaultBinary)
11537
        self.ResponseHeader = ResponseHeader()
11538
        self.Results = []
11539
        self.DiagnosticInfos = []
11540
        self._freeze = True
11541 1
11542 1
    def to_binary(self):
11543 1
        packet = []
11544 1
        packet.append(self.TypeId.to_binary())
11545 1
        packet.append(self.ResponseHeader.to_binary())
11546 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
11547 1
        for fieldname in self.Results:
11548 1
            packet.append(fieldname.to_binary())
11549 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
11550
        for fieldname in self.DiagnosticInfos:
11551 1
            packet.append(fieldname.to_binary())
11552 1
        return b''.join(packet)
11553 1
11554 1
    @staticmethod
11555 1
    def from_binary(data):
11556 1
        return CreateMonitoredItemsResponse(data)
11557 1
11558 1
    def _binary_init(self, data):
11559
        self.TypeId = NodeId.from_binary(data)
11560 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
11561
        length = uabin.Primitives.Int32.unpack(data)
11562 1
        array = []
11563
        if length != -1:
11564 1
            for _ in range(0, length):
11565 1
                array.append(MonitoredItemCreateResult.from_binary(data))
11566 1
        self.Results = array
11567 1
        length = uabin.Primitives.Int32.unpack(data)
11568 1
        array = []
11569 1
        if length != -1:
11570 1
            for _ in range(0, length):
11571 1
                array.append(DiagnosticInfo.from_binary(data))
11572 1
        self.DiagnosticInfos = array
11573
11574 1
    def __str__(self):
11575
        return 'CreateMonitoredItemsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11576
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
11577
               'Results:' + str(self.Results) + ', ' + \
11578
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
11579 1
11580
    __repr__ = __str__
11581
11582 1
11583 View Code Duplication
class MonitoredItemModifyRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11584
    '''
11585 1
    :ivar MonitoredItemId:
11586
    :vartype MonitoredItemId: UInt32
11587
    :ivar RequestedParameters:
11588
    :vartype RequestedParameters: MonitoringParameters
11589
    '''
11590
11591
    ua_types = {
11592 1
        'MonitoredItemId': 'UInt32',
11593
        'RequestedParameters': 'MonitoringParameters',
11594
               }
11595
11596 1
    def __init__(self, binary=None):
11597
        if binary is not None:
11598
            self._binary_init(binary)
11599
            self._freeze = True
11600 1
            return
11601
        self.MonitoredItemId = 0
11602
        self.RequestedParameters = MonitoringParameters()
11603 1
        self._freeze = True
11604
11605
    def to_binary(self):
11606 1
        packet = []
11607
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoredItemId))
11608
        packet.append(self.RequestedParameters.to_binary())
11609 1
        return b''.join(packet)
11610
11611
    @staticmethod
11612
    def from_binary(data):
11613
        return MonitoredItemModifyRequest(data)
11614
11615
    def _binary_init(self, data):
11616 1
        self.MonitoredItemId = uabin.Primitives.UInt32.unpack(data)
11617 1
        self.RequestedParameters = MonitoringParameters.from_binary(data)
11618 1
11619 1
    def __str__(self):
11620 1
        return 'MonitoredItemModifyRequest(' + 'MonitoredItemId:' + str(self.MonitoredItemId) + ', ' + \
11621 1
               'RequestedParameters:' + str(self.RequestedParameters) + ')'
11622 1
11623 1
    __repr__ = __str__
11624
11625 1
11626 1 View Code Duplication
class MonitoredItemModifyResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11627 1
    '''
11628 1
    :ivar StatusCode:
11629 1
    :vartype StatusCode: StatusCode
11630 1
    :ivar RevisedSamplingInterval:
11631 1
    :vartype RevisedSamplingInterval: Double
11632
    :ivar RevisedQueueSize:
11633 1
    :vartype RevisedQueueSize: UInt32
11634
    :ivar FilterResult:
11635 1
    :vartype FilterResult: ExtensionObject
11636
    '''
11637 1
11638
    ua_types = {
11639 1
        'StatusCode': 'StatusCode',
11640 1
        'RevisedSamplingInterval': 'Double',
11641 1
        'RevisedQueueSize': 'UInt32',
11642 1
        'FilterResult': 'ExtensionObject',
11643 1
               }
11644 1
11645 1
    def __init__(self, binary=None):
11646 1
        if binary is not None:
11647 1
            self._binary_init(binary)
11648 1
            self._freeze = True
11649 1
            return
11650
        self.StatusCode = StatusCode()
11651 1
        self.RevisedSamplingInterval = 0
11652
        self.RevisedQueueSize = 0
11653 1
        self.FilterResult = None
11654
        self._freeze = True
11655
11656
    def to_binary(self):
11657 1
        packet = []
11658
        packet.append(self.StatusCode.to_binary())
11659
        packet.append(uabin.Primitives.Double.pack(self.RevisedSamplingInterval))
11660 1
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedQueueSize))
11661
        packet.append(extensionobject_to_binary(self.FilterResult))
11662
        return b''.join(packet)
11663
11664
    @staticmethod
11665
    def from_binary(data):
11666
        return MonitoredItemModifyResult(data)
11667 1
11668 1
    def _binary_init(self, data):
11669 1
        self.StatusCode = StatusCode.from_binary(data)
11670 1
        self.RevisedSamplingInterval = uabin.Primitives.Double.unpack(data)
11671 1
        self.RevisedQueueSize = uabin.Primitives.UInt32.unpack(data)
11672 1
        self.FilterResult = extensionobject_from_binary(data)
11673 1
11674 1
    def __str__(self):
11675
        return 'MonitoredItemModifyResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
11676 1
               'RevisedSamplingInterval:' + str(self.RevisedSamplingInterval) + ', ' + \
11677 1
               'RevisedQueueSize:' + str(self.RevisedQueueSize) + ', ' + \
11678 1
               'FilterResult:' + str(self.FilterResult) + ')'
11679 1
11680 1
    __repr__ = __str__
11681
11682 1
11683 View Code Duplication
class ModifyMonitoredItemsParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11684 1
    '''
11685
    :ivar SubscriptionId:
11686 1
    :vartype SubscriptionId: UInt32
11687 1
    :ivar TimestampsToReturn:
11688 1
    :vartype TimestampsToReturn: TimestampsToReturn
11689
    :ivar ItemsToModify:
11690 1
    :vartype ItemsToModify: MonitoredItemModifyRequest
11691
    '''
11692
11693
    ua_types = {
11694 1
        'SubscriptionId': 'UInt32',
11695
        'TimestampsToReturn': 'TimestampsToReturn',
11696
        'ItemsToModify': 'MonitoredItemModifyRequest',
11697 1
               }
11698
11699
    def __init__(self, binary=None):
11700
        if binary is not None:
11701
            self._binary_init(binary)
11702 1
            self._freeze = True
11703 1
            return
11704 1
        self.SubscriptionId = 0
11705 1
        self.TimestampsToReturn = TimestampsToReturn(0)
11706 1
        self.ItemsToModify = []
11707 1
        self._freeze = True
11708 1
11709
    def to_binary(self):
11710 1
        packet = []
11711 1
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
11712 1
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
11713 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ItemsToModify)))
11714 1
        for fieldname in self.ItemsToModify:
11715 1
            packet.append(fieldname.to_binary())
11716
        return b''.join(packet)
11717 1
11718
    @staticmethod
11719 1
    def from_binary(data):
11720
        return ModifyMonitoredItemsParameters(data)
11721 1
11722 1
    def _binary_init(self, data):
11723 1
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
11724 1
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
11725 1
        length = uabin.Primitives.Int32.unpack(data)
11726 1
        array = []
11727 1
        if length != -1:
11728
            for _ in range(0, length):
11729 1
                array.append(MonitoredItemModifyRequest.from_binary(data))
11730
        self.ItemsToModify = array
11731
11732 1
    def __str__(self):
11733
        return 'ModifyMonitoredItemsParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
11734
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
11735 1
               'ItemsToModify:' + str(self.ItemsToModify) + ')'
11736
11737
    __repr__ = __str__
11738
11739
11740
class ModifyMonitoredItemsRequest(FrozenClass):
11741
    '''
11742 1
    :ivar TypeId:
11743 1
    :vartype TypeId: NodeId
11744 1
    :ivar RequestHeader:
11745 1
    :vartype RequestHeader: RequestHeader
11746 1
    :ivar Parameters:
11747 1
    :vartype Parameters: ModifyMonitoredItemsParameters
11748 1
    '''
11749 1
11750
    ua_types = {
11751 1
        'TypeId': 'NodeId',
11752 1
        'RequestHeader': 'RequestHeader',
11753 1
        'Parameters': 'ModifyMonitoredItemsParameters',
11754 1
               }
11755 1
11756 1
    def __init__(self, binary=None):
11757 1
        if binary is not None:
11758
            self._binary_init(binary)
11759 1
            self._freeze = True
11760
            return
11761 1
        self.TypeId = FourByteNodeId(ObjectIds.ModifyMonitoredItemsRequest_Encoding_DefaultBinary)
11762
        self.RequestHeader = RequestHeader()
11763 1
        self.Parameters = ModifyMonitoredItemsParameters()
11764 1
        self._freeze = True
11765 1
11766 1
    def to_binary(self):
11767 1
        packet = []
11768 1
        packet.append(self.TypeId.to_binary())
11769 1
        packet.append(self.RequestHeader.to_binary())
11770 1
        packet.append(self.Parameters.to_binary())
11771
        return b''.join(packet)
11772 1
11773
    @staticmethod
11774
    def from_binary(data):
11775
        return ModifyMonitoredItemsRequest(data)
11776 1
11777
    def _binary_init(self, data):
11778
        self.TypeId = NodeId.from_binary(data)
11779 1
        self.RequestHeader = RequestHeader.from_binary(data)
11780
        self.Parameters = ModifyMonitoredItemsParameters.from_binary(data)
11781
11782
    def __str__(self):
11783
        return 'ModifyMonitoredItemsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11784 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
11785 1
               'Parameters:' + str(self.Parameters) + ')'
11786
11787
    __repr__ = __str__
11788
11789 1
11790 1
class ModifyMonitoredItemsResponse(FrozenClass):
11791
    '''
11792 1
    :ivar TypeId:
11793
    :vartype TypeId: NodeId
11794
    :ivar ResponseHeader:
11795
    :vartype ResponseHeader: ResponseHeader
11796
    :ivar Results:
11797
    :vartype Results: MonitoredItemModifyResult
11798
    :ivar DiagnosticInfos:
11799 1
    :vartype DiagnosticInfos: DiagnosticInfo
11800
    '''
11801
11802
    ua_types = {
11803 1
        'TypeId': 'NodeId',
11804
        'ResponseHeader': 'ResponseHeader',
11805
        'Results': 'MonitoredItemModifyResult',
11806
        'DiagnosticInfos': 'DiagnosticInfo',
11807
               }
11808
11809
    def __init__(self, binary=None):
11810
        if binary is not None:
11811 1
            self._binary_init(binary)
11812
            self._freeze = True
11813
            return
11814 1
        self.TypeId = FourByteNodeId(ObjectIds.ModifyMonitoredItemsResponse_Encoding_DefaultBinary)
11815
        self.ResponseHeader = ResponseHeader()
11816
        self.Results = []
11817 1
        self.DiagnosticInfos = []
11818
        self._freeze = True
11819
11820
    def to_binary(self):
11821
        packet = []
11822
        packet.append(self.TypeId.to_binary())
11823
        packet.append(self.ResponseHeader.to_binary())
11824 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
11825
        for fieldname in self.Results:
11826
            packet.append(fieldname.to_binary())
11827
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
11828
        for fieldname in self.DiagnosticInfos:
11829
            packet.append(fieldname.to_binary())
11830
        return b''.join(packet)
11831
11832
    @staticmethod
11833 1
    def from_binary(data):
11834
        return ModifyMonitoredItemsResponse(data)
11835
11836
    def _binary_init(self, data):
11837
        self.TypeId = NodeId.from_binary(data)
11838
        self.ResponseHeader = ResponseHeader.from_binary(data)
11839 1
        length = uabin.Primitives.Int32.unpack(data)
11840
        array = []
11841
        if length != -1:
11842
            for _ in range(0, length):
11843 1
                array.append(MonitoredItemModifyResult.from_binary(data))
11844
        self.Results = array
11845
        length = uabin.Primitives.Int32.unpack(data)
11846
        array = []
11847 1
        if length != -1:
11848
            for _ in range(0, length):
11849
                array.append(DiagnosticInfo.from_binary(data))
11850
        self.DiagnosticInfos = array
11851 1
11852
    def __str__(self):
11853
        return 'ModifyMonitoredItemsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11854 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
11855
               'Results:' + str(self.Results) + ', ' + \
11856
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
11857
11858
    __repr__ = __str__
11859
11860
11861 1 View Code Duplication
class SetMonitoringModeParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11862 1
    '''
11863 1
    :ivar SubscriptionId:
11864 1
    :vartype SubscriptionId: UInt32
11865 1
    :ivar MonitoringMode:
11866 1
    :vartype MonitoringMode: MonitoringMode
11867 1
    :ivar MonitoredItemIds:
11868 1
    :vartype MonitoredItemIds: UInt32
11869
    '''
11870 1
11871 1
    ua_types = {
11872 1
        'SubscriptionId': 'UInt32',
11873 1
        'MonitoringMode': 'MonitoringMode',
11874 1
        'MonitoredItemIds': 'UInt32',
11875
               }
11876 1
11877
    def __init__(self, binary=None):
11878 1
        if binary is not None:
11879
            self._binary_init(binary)
11880 1
            self._freeze = True
11881 1
            return
11882 1
        self.SubscriptionId = 0
11883
        self.MonitoringMode = MonitoringMode(0)
11884 1
        self.MonitoredItemIds = []
11885
        self._freeze = True
11886
11887
    def to_binary(self):
11888 1
        packet = []
11889
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
11890
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoringMode.value))
11891 1
        packet.append(uabin.Primitives.Int32.pack(len(self.MonitoredItemIds)))
11892
        for fieldname in self.MonitoredItemIds:
11893
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
11894
        return b''.join(packet)
11895
11896 1
    @staticmethod
11897 1
    def from_binary(data):
11898 1
        return SetMonitoringModeParameters(data)
11899 1
11900 1
    def _binary_init(self, data):
11901 1
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
11902 1
        self.MonitoringMode = MonitoringMode(uabin.Primitives.UInt32.unpack(data))
11903
        self.MonitoredItemIds = uabin.Primitives.UInt32.unpack_array(data)
11904 1
11905 1
    def __str__(self):
11906 1
        return 'SetMonitoringModeParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
11907 1
               'MonitoringMode:' + str(self.MonitoringMode) + ', ' + \
11908 1
               'MonitoredItemIds:' + str(self.MonitoredItemIds) + ')'
11909 1
11910
    __repr__ = __str__
11911 1
11912
11913 1
class SetMonitoringModeRequest(FrozenClass):
11914
    '''
11915 1
    :ivar TypeId:
11916 1
    :vartype TypeId: NodeId
11917 1
    :ivar RequestHeader:
11918 1
    :vartype RequestHeader: RequestHeader
11919 1
    :ivar Parameters:
11920 1
    :vartype Parameters: SetMonitoringModeParameters
11921 1
    '''
11922
11923 1
    ua_types = {
11924
        'TypeId': 'NodeId',
11925
        'RequestHeader': 'RequestHeader',
11926 1
        'Parameters': 'SetMonitoringModeParameters',
11927
               }
11928
11929 1
    def __init__(self, binary=None):
11930
        if binary is not None:
11931
            self._binary_init(binary)
11932
            self._freeze = True
11933
            return
11934
        self.TypeId = FourByteNodeId(ObjectIds.SetMonitoringModeRequest_Encoding_DefaultBinary)
11935
        self.RequestHeader = RequestHeader()
11936
        self.Parameters = SetMonitoringModeParameters()
11937
        self._freeze = True
11938 1
11939 1
    def to_binary(self):
11940
        packet = []
11941
        packet.append(self.TypeId.to_binary())
11942
        packet.append(self.RequestHeader.to_binary())
11943 1
        packet.append(self.Parameters.to_binary())
11944 1
        return b''.join(packet)
11945 1
11946 1
    @staticmethod
11947
    def from_binary(data):
11948 1
        return SetMonitoringModeRequest(data)
11949 1
11950 1
    def _binary_init(self, data):
11951 1
        self.TypeId = NodeId.from_binary(data)
11952 1
        self.RequestHeader = RequestHeader.from_binary(data)
11953 1
        self.Parameters = SetMonitoringModeParameters.from_binary(data)
11954
11955 1
    def __str__(self):
11956
        return 'SetMonitoringModeRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11957
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
11958
               'Parameters:' + str(self.Parameters) + ')'
11959 1
11960
    __repr__ = __str__
11961
11962
11963 View Code Duplication
class SetMonitoringModeResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11964 1
    '''
11965
    :ivar Results:
11966
    :vartype Results: StatusCode
11967
    :ivar DiagnosticInfos:
11968
    :vartype DiagnosticInfos: DiagnosticInfo
11969 1
    '''
11970
11971
    ua_types = {
11972 1
        'Results': 'StatusCode',
11973
        'DiagnosticInfos': 'DiagnosticInfo',
11974
               }
11975
11976
    def __init__(self, binary=None):
11977
        if binary is not None:
11978
            self._binary_init(binary)
11979
            self._freeze = True
11980
            return
11981
        self.Results = []
11982
        self.DiagnosticInfos = []
11983
        self._freeze = True
11984
11985
    def to_binary(self):
11986
        packet = []
11987 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
11988 1
        for fieldname in self.Results:
11989 1
            packet.append(fieldname.to_binary())
11990 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
11991 1
        for fieldname in self.DiagnosticInfos:
11992 1
            packet.append(fieldname.to_binary())
11993 1
        return b''.join(packet)
11994 1
11995 1
    @staticmethod
11996 1
    def from_binary(data):
11997 1
        return SetMonitoringModeResult(data)
11998 1
11999
    def _binary_init(self, data):
12000 1
        length = uabin.Primitives.Int32.unpack(data)
12001 1
        array = []
12002 1
        if length != -1:
12003 1
            for _ in range(0, length):
12004 1
                array.append(StatusCode.from_binary(data))
12005 1
        self.Results = array
12006 1
        length = uabin.Primitives.Int32.unpack(data)
12007 1
        array = []
12008 1
        if length != -1:
12009 1
            for _ in range(0, length):
12010
                array.append(DiagnosticInfo.from_binary(data))
12011 1
        self.DiagnosticInfos = array
12012 1
12013
    def __str__(self):
12014 1
        return 'SetMonitoringModeResult(' + 'Results:' + str(self.Results) + ', ' + \
12015
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
12016 1
12017
    __repr__ = __str__
12018 1
12019
12020 1
class SetMonitoringModeResponse(FrozenClass):
12021 1
    '''
12022 1
    :ivar TypeId:
12023 1
    :vartype TypeId: NodeId
12024 1
    :ivar ResponseHeader:
12025 1
    :vartype ResponseHeader: ResponseHeader
12026 1
    :ivar Parameters:
12027 1
    :vartype Parameters: SetMonitoringModeResult
12028 1
    '''
12029
12030 1
    ua_types = {
12031 1
        'TypeId': 'NodeId',
12032 1
        'ResponseHeader': 'ResponseHeader',
12033 1
        'Parameters': 'SetMonitoringModeResult',
12034 1
               }
12035
12036 1
    def __init__(self, binary=None):
12037
        if binary is not None:
12038 1
            self._binary_init(binary)
12039
            self._freeze = True
12040
            return
12041
        self.TypeId = FourByteNodeId(ObjectIds.SetMonitoringModeResponse_Encoding_DefaultBinary)
12042
        self.ResponseHeader = ResponseHeader()
12043
        self.Parameters = SetMonitoringModeResult()
12044
        self._freeze = True
12045
12046 1
    def to_binary(self):
12047
        packet = []
12048
        packet.append(self.TypeId.to_binary())
12049 1
        packet.append(self.ResponseHeader.to_binary())
12050
        packet.append(self.Parameters.to_binary())
12051
        return b''.join(packet)
12052
12053
    @staticmethod
12054
    def from_binary(data):
12055
        return SetMonitoringModeResponse(data)
12056
12057
    def _binary_init(self, data):
12058 1
        self.TypeId = NodeId.from_binary(data)
12059 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
12060 1
        self.Parameters = SetMonitoringModeResult.from_binary(data)
12061 1
12062 1
    def __str__(self):
12063 1
        return 'SetMonitoringModeResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12064 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12065 1
               'Parameters:' + str(self.Parameters) + ')'
12066 1
12067
    __repr__ = __str__
12068 1
12069 1
12070 1 View Code Duplication
class SetTriggeringParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12071 1
    '''
12072 1
    :ivar SubscriptionId:
12073 1
    :vartype SubscriptionId: UInt32
12074
    :ivar TriggeringItemId:
12075 1
    :vartype TriggeringItemId: UInt32
12076
    :ivar LinksToAdd:
12077 1
    :vartype LinksToAdd: UInt32
12078
    :ivar LinksToRemove:
12079 1
    :vartype LinksToRemove: UInt32
12080 1
    '''
12081 1
12082 1
    ua_types = {
12083
        'SubscriptionId': 'UInt32',
12084 1
        'TriggeringItemId': 'UInt32',
12085
        'LinksToAdd': 'UInt32',
12086
        'LinksToRemove': 'UInt32',
12087
               }
12088
12089 1
    def __init__(self, binary=None):
12090
        if binary is not None:
12091
            self._binary_init(binary)
12092 1
            self._freeze = True
12093
            return
12094
        self.SubscriptionId = 0
12095
        self.TriggeringItemId = 0
12096
        self.LinksToAdd = []
12097
        self.LinksToRemove = []
12098
        self._freeze = True
12099 1
12100
    def to_binary(self):
12101
        packet = []
12102
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
12103
        packet.append(uabin.Primitives.UInt32.pack(self.TriggeringItemId))
12104
        packet.append(uabin.Primitives.Int32.pack(len(self.LinksToAdd)))
12105
        for fieldname in self.LinksToAdd:
12106
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
12107
        packet.append(uabin.Primitives.Int32.pack(len(self.LinksToRemove)))
12108 1
        for fieldname in self.LinksToRemove:
12109
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
12110
        return b''.join(packet)
12111
12112
    @staticmethod
12113
    def from_binary(data):
12114 1
        return SetTriggeringParameters(data)
12115
12116
    def _binary_init(self, data):
12117
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
12118 1
        self.TriggeringItemId = uabin.Primitives.UInt32.unpack(data)
12119
        self.LinksToAdd = uabin.Primitives.UInt32.unpack_array(data)
12120
        self.LinksToRemove = uabin.Primitives.UInt32.unpack_array(data)
12121
12122 1
    def __str__(self):
12123
        return 'SetTriggeringParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12124
               'TriggeringItemId:' + str(self.TriggeringItemId) + ', ' + \
12125
               'LinksToAdd:' + str(self.LinksToAdd) + ', ' + \
12126 1
               'LinksToRemove:' + str(self.LinksToRemove) + ')'
12127
12128
    __repr__ = __str__
12129 1
12130
12131
class SetTriggeringRequest(FrozenClass):
12132
    '''
12133
    :ivar TypeId:
12134
    :vartype TypeId: NodeId
12135
    :ivar RequestHeader:
12136
    :vartype RequestHeader: RequestHeader
12137
    :ivar Parameters:
12138 1
    :vartype Parameters: SetTriggeringParameters
12139
    '''
12140
12141
    ua_types = {
12142
        'TypeId': 'NodeId',
12143
        'RequestHeader': 'RequestHeader',
12144
        'Parameters': 'SetTriggeringParameters',
12145
               }
12146
12147
    def __init__(self, binary=None):
12148 1
        if binary is not None:
12149
            self._binary_init(binary)
12150
            self._freeze = True
12151
            return
12152
        self.TypeId = FourByteNodeId(ObjectIds.SetTriggeringRequest_Encoding_DefaultBinary)
12153
        self.RequestHeader = RequestHeader()
12154
        self.Parameters = SetTriggeringParameters()
12155 1
        self._freeze = True
12156
12157
    def to_binary(self):
12158
        packet = []
12159 1
        packet.append(self.TypeId.to_binary())
12160
        packet.append(self.RequestHeader.to_binary())
12161
        packet.append(self.Parameters.to_binary())
12162
        return b''.join(packet)
12163
12164 1
    @staticmethod
12165
    def from_binary(data):
12166
        return SetTriggeringRequest(data)
12167
12168
    def _binary_init(self, data):
12169 1
        self.TypeId = NodeId.from_binary(data)
12170
        self.RequestHeader = RequestHeader.from_binary(data)
12171
        self.Parameters = SetTriggeringParameters.from_binary(data)
12172 1
12173
    def __str__(self):
12174
        return 'SetTriggeringRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12175
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12176
               'Parameters:' + str(self.Parameters) + ')'
12177
12178
    __repr__ = __str__
12179
12180
12181 1
class SetTriggeringResult(FrozenClass):
12182
    '''
12183
    :ivar AddResults:
12184
    :vartype AddResults: StatusCode
12185
    :ivar AddDiagnosticInfos:
12186
    :vartype AddDiagnosticInfos: DiagnosticInfo
12187
    :ivar RemoveResults:
12188
    :vartype RemoveResults: StatusCode
12189
    :ivar RemoveDiagnosticInfos:
12190
    :vartype RemoveDiagnosticInfos: DiagnosticInfo
12191 1
    '''
12192
12193
    ua_types = {
12194
        'AddResults': 'StatusCode',
12195
        'AddDiagnosticInfos': 'DiagnosticInfo',
12196
        'RemoveResults': 'StatusCode',
12197
        'RemoveDiagnosticInfos': 'DiagnosticInfo',
12198 1
               }
12199
12200
    def __init__(self, binary=None):
12201
        if binary is not None:
12202 1
            self._binary_init(binary)
12203
            self._freeze = True
12204
            return
12205
        self.AddResults = []
12206
        self.AddDiagnosticInfos = []
12207 1
        self.RemoveResults = []
12208
        self.RemoveDiagnosticInfos = []
12209
        self._freeze = True
12210
12211 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12212 1
        packet = []
12213
        packet.append(uabin.Primitives.Int32.pack(len(self.AddResults)))
12214
        for fieldname in self.AddResults:
12215 1
            packet.append(fieldname.to_binary())
12216
        packet.append(uabin.Primitives.Int32.pack(len(self.AddDiagnosticInfos)))
12217
        for fieldname in self.AddDiagnosticInfos:
12218
            packet.append(fieldname.to_binary())
12219
        packet.append(uabin.Primitives.Int32.pack(len(self.RemoveResults)))
12220
        for fieldname in self.RemoveResults:
12221
            packet.append(fieldname.to_binary())
12222 1
        packet.append(uabin.Primitives.Int32.pack(len(self.RemoveDiagnosticInfos)))
12223
        for fieldname in self.RemoveDiagnosticInfos:
12224
            packet.append(fieldname.to_binary())
12225
        return b''.join(packet)
12226
12227
    @staticmethod
12228
    def from_binary(data):
12229
        return SetTriggeringResult(data)
12230
12231 1
    def _binary_init(self, data):
12232
        length = uabin.Primitives.Int32.unpack(data)
12233
        array = []
12234
        if length != -1:
12235
            for _ in range(0, length):
12236
                array.append(StatusCode.from_binary(data))
12237
        self.AddResults = array
12238
        length = uabin.Primitives.Int32.unpack(data)
12239 1
        array = []
12240
        if length != -1:
12241
            for _ in range(0, length):
12242
                array.append(DiagnosticInfo.from_binary(data))
12243 1
        self.AddDiagnosticInfos = array
12244
        length = uabin.Primitives.Int32.unpack(data)
12245
        array = []
12246
        if length != -1:
12247 1
            for _ in range(0, length):
12248
                array.append(StatusCode.from_binary(data))
12249
        self.RemoveResults = array
12250
        length = uabin.Primitives.Int32.unpack(data)
12251 1
        array = []
12252
        if length != -1:
12253
            for _ in range(0, length):
12254 1
                array.append(DiagnosticInfo.from_binary(data))
12255
        self.RemoveDiagnosticInfos = array
12256
12257
    def __str__(self):
12258
        return 'SetTriggeringResult(' + 'AddResults:' + str(self.AddResults) + ', ' + \
12259
               'AddDiagnosticInfos:' + str(self.AddDiagnosticInfos) + ', ' + \
12260
               'RemoveResults:' + str(self.RemoveResults) + ', ' + \
12261 1
               'RemoveDiagnosticInfos:' + str(self.RemoveDiagnosticInfos) + ')'
12262
12263
    __repr__ = __str__
12264
12265
12266
class SetTriggeringResponse(FrozenClass):
12267
    '''
12268
    :ivar TypeId:
12269
    :vartype TypeId: NodeId
12270 1
    :ivar ResponseHeader:
12271
    :vartype ResponseHeader: ResponseHeader
12272
    :ivar Parameters:
12273
    :vartype Parameters: SetTriggeringResult
12274
    '''
12275
12276
    ua_types = {
12277
        'TypeId': 'NodeId',
12278 1
        'ResponseHeader': 'ResponseHeader',
12279
        'Parameters': 'SetTriggeringResult',
12280
               }
12281
12282 1
    def __init__(self, binary=None):
12283
        if binary is not None:
12284
            self._binary_init(binary)
12285
            self._freeze = True
12286 1
            return
12287
        self.TypeId = FourByteNodeId(ObjectIds.SetTriggeringResponse_Encoding_DefaultBinary)
12288
        self.ResponseHeader = ResponseHeader()
12289
        self.Parameters = SetTriggeringResult()
12290 1
        self._freeze = True
12291
12292
    def to_binary(self):
12293 1
        packet = []
12294
        packet.append(self.TypeId.to_binary())
12295
        packet.append(self.ResponseHeader.to_binary())
12296
        packet.append(self.Parameters.to_binary())
12297
        return b''.join(packet)
12298
12299
    @staticmethod
12300
    def from_binary(data):
12301
        return SetTriggeringResponse(data)
12302 1
12303
    def _binary_init(self, data):
12304
        self.TypeId = NodeId.from_binary(data)
12305
        self.ResponseHeader = ResponseHeader.from_binary(data)
12306
        self.Parameters = SetTriggeringResult.from_binary(data)
12307
12308
    def __str__(self):
12309
        return 'SetTriggeringResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12310
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12311
               'Parameters:' + str(self.Parameters) + ')'
12312 1
12313
    __repr__ = __str__
12314
12315
12316 View Code Duplication
class DeleteMonitoredItemsParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12317
    '''
12318
    :ivar SubscriptionId:
12319 1
    :vartype SubscriptionId: UInt32
12320
    :ivar MonitoredItemIds:
12321
    :vartype MonitoredItemIds: UInt32
12322
    '''
12323 1
12324
    ua_types = {
12325
        'SubscriptionId': 'UInt32',
12326
        'MonitoredItemIds': 'UInt32',
12327
               }
12328 1
12329
    def __init__(self, binary=None):
12330
        if binary is not None:
12331
            self._binary_init(binary)
12332
            self._freeze = True
12333 1
            return
12334
        self.SubscriptionId = 0
12335
        self.MonitoredItemIds = []
12336 1
        self._freeze = True
12337
12338
    def to_binary(self):
12339
        packet = []
12340
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
12341
        packet.append(uabin.Primitives.Int32.pack(len(self.MonitoredItemIds)))
12342
        for fieldname in self.MonitoredItemIds:
12343 1
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
12344
        return b''.join(packet)
12345
12346
    @staticmethod
12347
    def from_binary(data):
12348
        return DeleteMonitoredItemsParameters(data)
12349
12350
    def _binary_init(self, data):
12351
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
12352 1
        self.MonitoredItemIds = uabin.Primitives.UInt32.unpack_array(data)
12353
12354
    def __str__(self):
12355
        return 'DeleteMonitoredItemsParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12356
               'MonitoredItemIds:' + str(self.MonitoredItemIds) + ')'
12357
12358
    __repr__ = __str__
12359
12360
12361
class DeleteMonitoredItemsRequest(FrozenClass):
12362 1
    '''
12363
    :ivar TypeId:
12364
    :vartype TypeId: NodeId
12365
    :ivar RequestHeader:
12366 1
    :vartype RequestHeader: RequestHeader
12367
    :ivar Parameters:
12368
    :vartype Parameters: DeleteMonitoredItemsParameters
12369
    '''
12370
12371
    ua_types = {
12372
        'TypeId': 'NodeId',
12373
        'RequestHeader': 'RequestHeader',
12374
        'Parameters': 'DeleteMonitoredItemsParameters',
12375
               }
12376
12377
    def __init__(self, binary=None):
12378
        if binary is not None:
12379
            self._binary_init(binary)
12380 1
            self._freeze = True
12381
            return
12382
        self.TypeId = FourByteNodeId(ObjectIds.DeleteMonitoredItemsRequest_Encoding_DefaultBinary)
12383
        self.RequestHeader = RequestHeader()
12384 1
        self.Parameters = DeleteMonitoredItemsParameters()
12385
        self._freeze = True
12386
12387 1
    def to_binary(self):
12388
        packet = []
12389
        packet.append(self.TypeId.to_binary())
12390
        packet.append(self.RequestHeader.to_binary())
12391
        packet.append(self.Parameters.to_binary())
12392
        return b''.join(packet)
12393
12394
    @staticmethod
12395
    def from_binary(data):
12396 1
        return DeleteMonitoredItemsRequest(data)
12397
12398
    def _binary_init(self, data):
12399
        self.TypeId = NodeId.from_binary(data)
12400
        self.RequestHeader = RequestHeader.from_binary(data)
12401
        self.Parameters = DeleteMonitoredItemsParameters.from_binary(data)
12402
12403
    def __str__(self):
12404
        return 'DeleteMonitoredItemsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12405
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12406 1
               'Parameters:' + str(self.Parameters) + ')'
12407
12408
    __repr__ = __str__
12409
12410
12411
class DeleteMonitoredItemsResponse(FrozenClass):
12412
    '''
12413 1
    :ivar TypeId:
12414
    :vartype TypeId: NodeId
12415
    :ivar ResponseHeader:
12416
    :vartype ResponseHeader: ResponseHeader
12417 1
    :ivar Results:
12418
    :vartype Results: StatusCode
12419
    :ivar DiagnosticInfos:
12420
    :vartype DiagnosticInfos: DiagnosticInfo
12421
    '''
12422 1
12423
    ua_types = {
12424
        'TypeId': 'NodeId',
12425
        'ResponseHeader': 'ResponseHeader',
12426
        'Results': 'StatusCode',
12427 1
        'DiagnosticInfos': 'DiagnosticInfo',
12428
               }
12429
12430 1
    def __init__(self, binary=None):
12431
        if binary is not None:
12432
            self._binary_init(binary)
12433
            self._freeze = True
12434
            return
12435 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteMonitoredItemsResponse_Encoding_DefaultBinary)
12436 1
        self.ResponseHeader = ResponseHeader()
12437 1
        self.Results = []
12438 1
        self.DiagnosticInfos = []
12439 1
        self._freeze = True
12440 1
12441 1
    def to_binary(self):
12442
        packet = []
12443 1
        packet.append(self.TypeId.to_binary())
12444 1
        packet.append(self.ResponseHeader.to_binary())
12445 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
12446 1
        for fieldname in self.Results:
12447 1
            packet.append(fieldname.to_binary())
12448 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
12449
        for fieldname in self.DiagnosticInfos:
12450 1
            packet.append(fieldname.to_binary())
12451
        return b''.join(packet)
12452 1
12453
    @staticmethod
12454 1
    def from_binary(data):
12455 1
        return DeleteMonitoredItemsResponse(data)
12456
12457 1
    def _binary_init(self, data):
12458
        self.TypeId = NodeId.from_binary(data)
12459
        self.ResponseHeader = ResponseHeader.from_binary(data)
12460 1
        length = uabin.Primitives.Int32.unpack(data)
12461
        array = []
12462
        if length != -1:
12463 1
            for _ in range(0, length):
12464
                array.append(StatusCode.from_binary(data))
12465
        self.Results = array
12466
        length = uabin.Primitives.Int32.unpack(data)
12467
        array = []
12468
        if length != -1:
12469
            for _ in range(0, length):
12470
                array.append(DiagnosticInfo.from_binary(data))
12471
        self.DiagnosticInfos = array
12472 1
12473 1
    def __str__(self):
12474
        return 'DeleteMonitoredItemsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12475
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12476
               'Results:' + str(self.Results) + ', ' + \
12477 1
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
12478 1
12479 1
    __repr__ = __str__
12480 1
12481
12482 1 View Code Duplication
class CreateSubscriptionParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12483 1
    '''
12484 1
    :ivar RequestedPublishingInterval:
12485 1
    :vartype RequestedPublishingInterval: Double
12486 1
    :ivar RequestedLifetimeCount:
12487 1
    :vartype RequestedLifetimeCount: UInt32
12488
    :ivar RequestedMaxKeepAliveCount:
12489 1
    :vartype RequestedMaxKeepAliveCount: UInt32
12490
    :ivar MaxNotificationsPerPublish:
12491
    :vartype MaxNotificationsPerPublish: UInt32
12492
    :ivar PublishingEnabled:
12493 1
    :vartype PublishingEnabled: Boolean
12494
    :ivar Priority:
12495
    :vartype Priority: Byte
12496
    '''
12497
12498 1
    ua_types = {
12499
        'RequestedPublishingInterval': 'Double',
12500
        'RequestedLifetimeCount': 'UInt32',
12501
        'RequestedMaxKeepAliveCount': 'UInt32',
12502
        'MaxNotificationsPerPublish': 'UInt32',
12503 1
        'PublishingEnabled': 'Boolean',
12504
        'Priority': 'Byte',
12505
               }
12506 1
12507
    def __init__(self, binary=None):
12508
        if binary is not None:
12509
            self._binary_init(binary)
12510
            self._freeze = True
12511
            return
12512
        self.RequestedPublishingInterval = 0
12513
        self.RequestedLifetimeCount = 0
12514
        self.RequestedMaxKeepAliveCount = 0
12515
        self.MaxNotificationsPerPublish = 0
12516
        self.PublishingEnabled = True
12517 1
        self.Priority = 0
12518 1
        self._freeze = True
12519 1
12520 1
    def to_binary(self):
12521 1
        packet = []
12522 1
        packet.append(uabin.Primitives.Double.pack(self.RequestedPublishingInterval))
12523 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedLifetimeCount))
12524 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedMaxKeepAliveCount))
12525 1
        packet.append(uabin.Primitives.UInt32.pack(self.MaxNotificationsPerPublish))
12526 1
        packet.append(uabin.Primitives.Boolean.pack(self.PublishingEnabled))
12527
        packet.append(uabin.Primitives.Byte.pack(self.Priority))
12528 1
        return b''.join(packet)
12529 1
12530 1
    @staticmethod
12531 1
    def from_binary(data):
12532 1
        return CreateSubscriptionParameters(data)
12533 1
12534 1
    def _binary_init(self, data):
12535 1
        self.RequestedPublishingInterval = uabin.Primitives.Double.unpack(data)
12536 1
        self.RequestedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
12537
        self.RequestedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
12538 1
        self.MaxNotificationsPerPublish = uabin.Primitives.UInt32.unpack(data)
12539
        self.PublishingEnabled = uabin.Primitives.Boolean.unpack(data)
12540 1
        self.Priority = uabin.Primitives.Byte.unpack(data)
12541
12542 1
    def __str__(self):
12543
        return 'CreateSubscriptionParameters(' + 'RequestedPublishingInterval:' + str(self.RequestedPublishingInterval) + ', ' + \
12544 1
               'RequestedLifetimeCount:' + str(self.RequestedLifetimeCount) + ', ' + \
12545 1
               'RequestedMaxKeepAliveCount:' + str(self.RequestedMaxKeepAliveCount) + ', ' + \
12546 1
               'MaxNotificationsPerPublish:' + str(self.MaxNotificationsPerPublish) + ', ' + \
12547 1
               'PublishingEnabled:' + str(self.PublishingEnabled) + ', ' + \
12548 1
               'Priority:' + str(self.Priority) + ')'
12549 1
12550 1
    __repr__ = __str__
12551 1
12552 1
12553 1
class CreateSubscriptionRequest(FrozenClass):
12554 1
    '''
12555 1
    :ivar TypeId:
12556 1
    :vartype TypeId: NodeId
12557
    :ivar RequestHeader:
12558 1
    :vartype RequestHeader: RequestHeader
12559
    :ivar Parameters:
12560 1
    :vartype Parameters: CreateSubscriptionParameters
12561
    '''
12562
12563
    ua_types = {
12564
        'TypeId': 'NodeId',
12565
        'RequestHeader': 'RequestHeader',
12566 1
        'Parameters': 'CreateSubscriptionParameters',
12567
               }
12568
12569 1
    def __init__(self, binary=None):
12570
        if binary is not None:
12571
            self._binary_init(binary)
12572
            self._freeze = True
12573
            return
12574
        self.TypeId = FourByteNodeId(ObjectIds.CreateSubscriptionRequest_Encoding_DefaultBinary)
12575
        self.RequestHeader = RequestHeader()
12576
        self.Parameters = CreateSubscriptionParameters()
12577
        self._freeze = True
12578
12579
    def to_binary(self):
12580
        packet = []
12581
        packet.append(self.TypeId.to_binary())
12582
        packet.append(self.RequestHeader.to_binary())
12583
        packet.append(self.Parameters.to_binary())
12584 1
        return b''.join(packet)
12585
12586
    @staticmethod
12587
    def from_binary(data):
12588
        return CreateSubscriptionRequest(data)
12589
12590
    def _binary_init(self, data):
12591
        self.TypeId = NodeId.from_binary(data)
12592
        self.RequestHeader = RequestHeader.from_binary(data)
12593
        self.Parameters = CreateSubscriptionParameters.from_binary(data)
12594
12595
    def __str__(self):
12596
        return 'CreateSubscriptionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12597 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12598
               'Parameters:' + str(self.Parameters) + ')'
12599
12600
    __repr__ = __str__
12601
12602
12603 View Code Duplication
class CreateSubscriptionResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12604
    '''
12605
    :ivar SubscriptionId:
12606
    :vartype SubscriptionId: UInt32
12607 1
    :ivar RevisedPublishingInterval:
12608
    :vartype RevisedPublishingInterval: Double
12609
    :ivar RevisedLifetimeCount:
12610
    :vartype RevisedLifetimeCount: UInt32
12611 1
    :ivar RevisedMaxKeepAliveCount:
12612
    :vartype RevisedMaxKeepAliveCount: UInt32
12613
    '''
12614
12615
    ua_types = {
12616
        'SubscriptionId': 'UInt32',
12617
        'RevisedPublishingInterval': 'Double',
12618
        'RevisedLifetimeCount': 'UInt32',
12619 1
        'RevisedMaxKeepAliveCount': 'UInt32',
12620
               }
12621
12622
    def __init__(self, binary=None):
12623
        if binary is not None:
12624
            self._binary_init(binary)
12625
            self._freeze = True
12626
            return
12627 1
        self.SubscriptionId = 0
12628
        self.RevisedPublishingInterval = 0
12629
        self.RevisedLifetimeCount = 0
12630 1
        self.RevisedMaxKeepAliveCount = 0
12631
        self._freeze = True
12632
12633
    def to_binary(self):
12634
        packet = []
12635
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
12636
        packet.append(uabin.Primitives.Double.pack(self.RevisedPublishingInterval))
12637
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedLifetimeCount))
12638
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedMaxKeepAliveCount))
12639 1
        return b''.join(packet)
12640
12641
    @staticmethod
12642
    def from_binary(data):
12643
        return CreateSubscriptionResult(data)
12644
12645
    def _binary_init(self, data):
12646
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
12647
        self.RevisedPublishingInterval = uabin.Primitives.Double.unpack(data)
12648
        self.RevisedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
12649 1
        self.RevisedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
12650
12651
    def __str__(self):
12652
        return 'CreateSubscriptionResult(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12653
               'RevisedPublishingInterval:' + str(self.RevisedPublishingInterval) + ', ' + \
12654
               'RevisedLifetimeCount:' + str(self.RevisedLifetimeCount) + ', ' + \
12655
               'RevisedMaxKeepAliveCount:' + str(self.RevisedMaxKeepAliveCount) + ')'
12656 1
12657
    __repr__ = __str__
12658
12659
12660 1
class CreateSubscriptionResponse(FrozenClass):
12661
    '''
12662
    :ivar TypeId:
12663
    :vartype TypeId: NodeId
12664
    :ivar ResponseHeader:
12665 1
    :vartype ResponseHeader: ResponseHeader
12666
    :ivar Parameters:
12667
    :vartype Parameters: CreateSubscriptionResult
12668
    '''
12669
12670 1
    ua_types = {
12671
        'TypeId': 'NodeId',
12672
        'ResponseHeader': 'ResponseHeader',
12673 1
        'Parameters': 'CreateSubscriptionResult',
12674
               }
12675
12676
    def __init__(self, binary=None):
12677
        if binary is not None:
12678 1
            self._binary_init(binary)
12679
            self._freeze = True
12680
            return
12681
        self.TypeId = FourByteNodeId(ObjectIds.CreateSubscriptionResponse_Encoding_DefaultBinary)
12682
        self.ResponseHeader = ResponseHeader()
12683
        self.Parameters = CreateSubscriptionResult()
12684
        self._freeze = True
12685
12686 1
    def to_binary(self):
12687
        packet = []
12688
        packet.append(self.TypeId.to_binary())
12689
        packet.append(self.ResponseHeader.to_binary())
12690
        packet.append(self.Parameters.to_binary())
12691
        return b''.join(packet)
12692
12693 1
    @staticmethod
12694
    def from_binary(data):
12695
        return CreateSubscriptionResponse(data)
12696
12697 1
    def _binary_init(self, data):
12698
        self.TypeId = NodeId.from_binary(data)
12699
        self.ResponseHeader = ResponseHeader.from_binary(data)
12700 1
        self.Parameters = CreateSubscriptionResult.from_binary(data)
12701
12702
    def __str__(self):
12703 1
        return 'CreateSubscriptionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12704
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12705
               'Parameters:' + str(self.Parameters) + ')'
12706 1
12707
    __repr__ = __str__
12708
12709
12710 View Code Duplication
class ModifySubscriptionParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12711
    '''
12712
    :ivar SubscriptionId:
12713 1
    :vartype SubscriptionId: UInt32
12714
    :ivar RequestedPublishingInterval:
12715
    :vartype RequestedPublishingInterval: Double
12716
    :ivar RequestedLifetimeCount:
12717
    :vartype RequestedLifetimeCount: UInt32
12718
    :ivar RequestedMaxKeepAliveCount:
12719
    :vartype RequestedMaxKeepAliveCount: UInt32
12720
    :ivar MaxNotificationsPerPublish:
12721
    :vartype MaxNotificationsPerPublish: UInt32
12722 1
    :ivar Priority:
12723
    :vartype Priority: Byte
12724
    '''
12725
12726
    ua_types = {
12727
        'SubscriptionId': 'UInt32',
12728
        'RequestedPublishingInterval': 'Double',
12729
        'RequestedLifetimeCount': 'UInt32',
12730 1
        'RequestedMaxKeepAliveCount': 'UInt32',
12731
        'MaxNotificationsPerPublish': 'UInt32',
12732
        'Priority': 'Byte',
12733
               }
12734 1
12735
    def __init__(self, binary=None):
12736
        if binary is not None:
12737
            self._binary_init(binary)
12738
            self._freeze = True
12739
            return
12740
        self.SubscriptionId = 0
12741
        self.RequestedPublishingInterval = 0
12742
        self.RequestedLifetimeCount = 0
12743 1
        self.RequestedMaxKeepAliveCount = 0
12744
        self.MaxNotificationsPerPublish = 0
12745
        self.Priority = 0
12746
        self._freeze = True
12747 1
12748
    def to_binary(self):
12749
        packet = []
12750 1
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
12751
        packet.append(uabin.Primitives.Double.pack(self.RequestedPublishingInterval))
12752
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedLifetimeCount))
12753
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedMaxKeepAliveCount))
12754
        packet.append(uabin.Primitives.UInt32.pack(self.MaxNotificationsPerPublish))
12755
        packet.append(uabin.Primitives.Byte.pack(self.Priority))
12756
        return b''.join(packet)
12757
12758
    @staticmethod
12759
    def from_binary(data):
12760
        return ModifySubscriptionParameters(data)
12761 1
12762
    def _binary_init(self, data):
12763
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
12764
        self.RequestedPublishingInterval = uabin.Primitives.Double.unpack(data)
12765
        self.RequestedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
12766
        self.RequestedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
12767
        self.MaxNotificationsPerPublish = uabin.Primitives.UInt32.unpack(data)
12768
        self.Priority = uabin.Primitives.Byte.unpack(data)
12769
12770
    def __str__(self):
12771
        return 'ModifySubscriptionParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12772 1
               'RequestedPublishingInterval:' + str(self.RequestedPublishingInterval) + ', ' + \
12773
               'RequestedLifetimeCount:' + str(self.RequestedLifetimeCount) + ', ' + \
12774
               'RequestedMaxKeepAliveCount:' + str(self.RequestedMaxKeepAliveCount) + ', ' + \
12775
               'MaxNotificationsPerPublish:' + str(self.MaxNotificationsPerPublish) + ', ' + \
12776
               'Priority:' + str(self.Priority) + ')'
12777
12778
    __repr__ = __str__
12779
12780 1
12781
class ModifySubscriptionRequest(FrozenClass):
12782
    '''
12783
    :ivar TypeId:
12784 1
    :vartype TypeId: NodeId
12785
    :ivar RequestHeader:
12786
    :vartype RequestHeader: RequestHeader
12787
    :ivar Parameters:
12788
    :vartype Parameters: ModifySubscriptionParameters
12789
    '''
12790 1
12791
    ua_types = {
12792
        'TypeId': 'NodeId',
12793
        'RequestHeader': 'RequestHeader',
12794
        'Parameters': 'ModifySubscriptionParameters',
12795
               }
12796 1
12797
    def __init__(self, binary=None):
12798
        if binary is not None:
12799 1
            self._binary_init(binary)
12800
            self._freeze = True
12801
            return
12802
        self.TypeId = FourByteNodeId(ObjectIds.ModifySubscriptionRequest_Encoding_DefaultBinary)
12803
        self.RequestHeader = RequestHeader()
12804
        self.Parameters = ModifySubscriptionParameters()
12805
        self._freeze = True
12806
12807
    def to_binary(self):
12808
        packet = []
12809
        packet.append(self.TypeId.to_binary())
12810
        packet.append(self.RequestHeader.to_binary())
12811
        packet.append(self.Parameters.to_binary())
12812
        return b''.join(packet)
12813
12814
    @staticmethod
12815
    def from_binary(data):
12816
        return ModifySubscriptionRequest(data)
12817
12818
    def _binary_init(self, data):
12819
        self.TypeId = NodeId.from_binary(data)
12820
        self.RequestHeader = RequestHeader.from_binary(data)
12821
        self.Parameters = ModifySubscriptionParameters.from_binary(data)
12822
12823
    def __str__(self):
12824
        return 'ModifySubscriptionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12825
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12826 1
               'Parameters:' + str(self.Parameters) + ')'
12827
12828
    __repr__ = __str__
12829
12830
12831
class ModifySubscriptionResult(FrozenClass):
12832
    '''
12833
    :ivar RevisedPublishingInterval:
12834
    :vartype RevisedPublishingInterval: Double
12835
    :ivar RevisedLifetimeCount:
12836
    :vartype RevisedLifetimeCount: UInt32
12837
    :ivar RevisedMaxKeepAliveCount:
12838
    :vartype RevisedMaxKeepAliveCount: UInt32
12839
    '''
12840
12841
    ua_types = {
12842
        'RevisedPublishingInterval': 'Double',
12843
        'RevisedLifetimeCount': 'UInt32',
12844
        'RevisedMaxKeepAliveCount': 'UInt32',
12845 1
               }
12846
12847
    def __init__(self, binary=None):
12848
        if binary is not None:
12849
            self._binary_init(binary)
12850
            self._freeze = True
12851
            return
12852
        self.RevisedPublishingInterval = 0
12853
        self.RevisedLifetimeCount = 0
12854
        self.RevisedMaxKeepAliveCount = 0
12855
        self._freeze = True
12856
12857
    def to_binary(self):
12858
        packet = []
12859
        packet.append(uabin.Primitives.Double.pack(self.RevisedPublishingInterval))
12860
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedLifetimeCount))
12861 1
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedMaxKeepAliveCount))
12862
        return b''.join(packet)
12863
12864
    @staticmethod
12865 1
    def from_binary(data):
12866
        return ModifySubscriptionResult(data)
12867
12868
    def _binary_init(self, data):
12869
        self.RevisedPublishingInterval = uabin.Primitives.Double.unpack(data)
12870
        self.RevisedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
12871
        self.RevisedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
12872
12873
    def __str__(self):
12874
        return 'ModifySubscriptionResult(' + 'RevisedPublishingInterval:' + str(self.RevisedPublishingInterval) + ', ' + \
12875
               'RevisedLifetimeCount:' + str(self.RevisedLifetimeCount) + ', ' + \
12876
               'RevisedMaxKeepAliveCount:' + str(self.RevisedMaxKeepAliveCount) + ')'
12877
12878
    __repr__ = __str__
12879 1
12880
12881
class ModifySubscriptionResponse(FrozenClass):
12882
    '''
12883
    :ivar TypeId:
12884
    :vartype TypeId: NodeId
12885
    :ivar ResponseHeader:
12886
    :vartype ResponseHeader: ResponseHeader
12887
    :ivar Parameters:
12888
    :vartype Parameters: ModifySubscriptionResult
12889
    '''
12890
12891
    ua_types = {
12892
        'TypeId': 'NodeId',
12893 1
        'ResponseHeader': 'ResponseHeader',
12894
        'Parameters': 'ModifySubscriptionResult',
12895
               }
12896 1
12897
    def __init__(self, binary=None):
12898
        if binary is not None:
12899
            self._binary_init(binary)
12900
            self._freeze = True
12901
            return
12902
        self.TypeId = FourByteNodeId(ObjectIds.ModifySubscriptionResponse_Encoding_DefaultBinary)
12903
        self.ResponseHeader = ResponseHeader()
12904
        self.Parameters = ModifySubscriptionResult()
12905
        self._freeze = True
12906
12907
    def to_binary(self):
12908
        packet = []
12909
        packet.append(self.TypeId.to_binary())
12910
        packet.append(self.ResponseHeader.to_binary())
12911 1
        packet.append(self.Parameters.to_binary())
12912
        return b''.join(packet)
12913
12914
    @staticmethod
12915
    def from_binary(data):
12916
        return ModifySubscriptionResponse(data)
12917
12918
    def _binary_init(self, data):
12919
        self.TypeId = NodeId.from_binary(data)
12920
        self.ResponseHeader = ResponseHeader.from_binary(data)
12921
        self.Parameters = ModifySubscriptionResult.from_binary(data)
12922
12923
    def __str__(self):
12924 1
        return 'ModifySubscriptionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12925
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12926
               'Parameters:' + str(self.Parameters) + ')'
12927
12928
    __repr__ = __str__
12929
12930
12931 View Code Duplication
class SetPublishingModeParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12932
    '''
12933
    :ivar PublishingEnabled:
12934 1
    :vartype PublishingEnabled: Boolean
12935
    :ivar SubscriptionIds:
12936
    :vartype SubscriptionIds: UInt32
12937
    '''
12938 1
12939
    ua_types = {
12940
        'PublishingEnabled': 'Boolean',
12941
        'SubscriptionIds': 'UInt32',
12942
               }
12943
12944
    def __init__(self, binary=None):
12945
        if binary is not None:
12946 1
            self._binary_init(binary)
12947
            self._freeze = True
12948
            return
12949
        self.PublishingEnabled = True
12950
        self.SubscriptionIds = []
12951
        self._freeze = True
12952
12953
    def to_binary(self):
12954 1
        packet = []
12955
        packet.append(uabin.Primitives.Boolean.pack(self.PublishingEnabled))
12956
        packet.append(uabin.Primitives.Int32.pack(len(self.SubscriptionIds)))
12957 1
        for fieldname in self.SubscriptionIds:
12958
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
12959
        return b''.join(packet)
12960
12961
    @staticmethod
12962
    def from_binary(data):
12963
        return SetPublishingModeParameters(data)
12964
12965
    def _binary_init(self, data):
12966
        self.PublishingEnabled = uabin.Primitives.Boolean.unpack(data)
12967
        self.SubscriptionIds = uabin.Primitives.UInt32.unpack_array(data)
12968
12969
    def __str__(self):
12970
        return 'SetPublishingModeParameters(' + 'PublishingEnabled:' + str(self.PublishingEnabled) + ', ' + \
12971
               'SubscriptionIds:' + str(self.SubscriptionIds) + ')'
12972
12973
    __repr__ = __str__
12974
12975
12976
class SetPublishingModeRequest(FrozenClass):
12977
    '''
12978
    :ivar TypeId:
12979
    :vartype TypeId: NodeId
12980
    :ivar RequestHeader:
12981
    :vartype RequestHeader: RequestHeader
12982
    :ivar Parameters:
12983
    :vartype Parameters: SetPublishingModeParameters
12984
    '''
12985
12986
    ua_types = {
12987
        'TypeId': 'NodeId',
12988
        'RequestHeader': 'RequestHeader',
12989
        'Parameters': 'SetPublishingModeParameters',
12990
               }
12991
12992
    def __init__(self, binary=None):
12993
        if binary is not None:
12994
            self._binary_init(binary)
12995
            self._freeze = True
12996
            return
12997
        self.TypeId = FourByteNodeId(ObjectIds.SetPublishingModeRequest_Encoding_DefaultBinary)
12998
        self.RequestHeader = RequestHeader()
12999
        self.Parameters = SetPublishingModeParameters()
13000
        self._freeze = True
13001
13002
    def to_binary(self):
13003
        packet = []
13004
        packet.append(self.TypeId.to_binary())
13005
        packet.append(self.RequestHeader.to_binary())
13006
        packet.append(self.Parameters.to_binary())
13007
        return b''.join(packet)
13008
13009
    @staticmethod
13010
    def from_binary(data):
13011
        return SetPublishingModeRequest(data)
13012
13013
    def _binary_init(self, data):
13014
        self.TypeId = NodeId.from_binary(data)
13015
        self.RequestHeader = RequestHeader.from_binary(data)
13016
        self.Parameters = SetPublishingModeParameters.from_binary(data)
13017
13018
    def __str__(self):
13019
        return 'SetPublishingModeRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13020
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
13021
               'Parameters:' + str(self.Parameters) + ')'
13022
13023
    __repr__ = __str__
13024
13025
13026 View Code Duplication
class SetPublishingModeResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13027
    '''
13028
    :ivar Results:
13029
    :vartype Results: StatusCode
13030
    :ivar DiagnosticInfos:
13031
    :vartype DiagnosticInfos: DiagnosticInfo
13032
    '''
13033
13034
    ua_types = {
13035
        'Results': 'StatusCode',
13036
        'DiagnosticInfos': 'DiagnosticInfo',
13037
               }
13038
13039
    def __init__(self, binary=None):
13040
        if binary is not None:
13041
            self._binary_init(binary)
13042
            self._freeze = True
13043
            return
13044
        self.Results = []
13045
        self.DiagnosticInfos = []
13046 1
        self._freeze = True
13047
13048
    def to_binary(self):
13049
        packet = []
13050
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
13051
        for fieldname in self.Results:
13052
            packet.append(fieldname.to_binary())
13053
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
13054
        for fieldname in self.DiagnosticInfos:
13055
            packet.append(fieldname.to_binary())
13056
        return b''.join(packet)
13057
13058
    @staticmethod
13059
    def from_binary(data):
13060
        return SetPublishingModeResult(data)
13061
13062
    def _binary_init(self, data):
13063
        length = uabin.Primitives.Int32.unpack(data)
13064
        array = []
13065
        if length != -1:
13066
            for _ in range(0, length):
13067
                array.append(StatusCode.from_binary(data))
13068
        self.Results = array
13069
        length = uabin.Primitives.Int32.unpack(data)
13070
        array = []
13071
        if length != -1:
13072
            for _ in range(0, length):
13073
                array.append(DiagnosticInfo.from_binary(data))
13074
        self.DiagnosticInfos = array
13075
13076
    def __str__(self):
13077
        return 'SetPublishingModeResult(' + 'Results:' + str(self.Results) + ', ' + \
13078
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
13079
13080
    __repr__ = __str__
13081
13082
13083
class SetPublishingModeResponse(FrozenClass):
13084
    '''
13085
    :ivar TypeId:
13086
    :vartype TypeId: NodeId
13087
    :ivar ResponseHeader:
13088
    :vartype ResponseHeader: ResponseHeader
13089
    :ivar Parameters:
13090
    :vartype Parameters: SetPublishingModeResult
13091
    '''
13092
13093
    ua_types = {
13094
        'TypeId': 'NodeId',
13095
        'ResponseHeader': 'ResponseHeader',
13096 1
        'Parameters': 'SetPublishingModeResult',
13097
               }
13098
13099
    def __init__(self, binary=None):
13100
        if binary is not None:
13101
            self._binary_init(binary)
13102
            self._freeze = True
13103
            return
13104
        self.TypeId = FourByteNodeId(ObjectIds.SetPublishingModeResponse_Encoding_DefaultBinary)
13105
        self.ResponseHeader = ResponseHeader()
13106
        self.Parameters = SetPublishingModeResult()
13107
        self._freeze = True
13108
13109
    def to_binary(self):
13110
        packet = []
13111
        packet.append(self.TypeId.to_binary())
13112
        packet.append(self.ResponseHeader.to_binary())
13113
        packet.append(self.Parameters.to_binary())
13114
        return b''.join(packet)
13115
13116
    @staticmethod
13117
    def from_binary(data):
13118
        return SetPublishingModeResponse(data)
13119
13120
    def _binary_init(self, data):
13121
        self.TypeId = NodeId.from_binary(data)
13122
        self.ResponseHeader = ResponseHeader.from_binary(data)
13123
        self.Parameters = SetPublishingModeResult.from_binary(data)
13124
13125
    def __str__(self):
13126
        return 'SetPublishingModeResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13127
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
13128
               'Parameters:' + str(self.Parameters) + ')'
13129
13130
    __repr__ = __str__
13131
13132
13133 View Code Duplication
class NotificationMessage(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13134
    '''
13135
    :ivar SequenceNumber:
13136
    :vartype SequenceNumber: UInt32
13137
    :ivar PublishTime:
13138
    :vartype PublishTime: DateTime
13139
    :ivar NotificationData:
13140
    :vartype NotificationData: ExtensionObject
13141
    '''
13142
13143
    ua_types = {
13144
        'SequenceNumber': 'UInt32',
13145 1
        'PublishTime': 'DateTime',
13146
        'NotificationData': 'ExtensionObject',
13147
               }
13148
13149 1
    def __init__(self, binary=None):
13150
        if binary is not None:
13151
            self._binary_init(binary)
13152
            self._freeze = True
13153
            return
13154
        self.SequenceNumber = 0
13155
        self.PublishTime = datetime.now()
13156
        self.NotificationData = []
13157
        self._freeze = True
13158
13159
    def to_binary(self):
13160
        packet = []
13161
        packet.append(uabin.Primitives.UInt32.pack(self.SequenceNumber))
13162
        packet.append(uabin.Primitives.DateTime.pack(self.PublishTime))
13163
        packet.append(uabin.Primitives.Int32.pack(len(self.NotificationData)))
13164
        for fieldname in self.NotificationData:
13165
            packet.append(extensionobject_to_binary(fieldname))
13166
        return b''.join(packet)
13167
13168
    @staticmethod
13169
    def from_binary(data):
13170
        return NotificationMessage(data)
13171
13172
    def _binary_init(self, data):
13173
        self.SequenceNumber = uabin.Primitives.UInt32.unpack(data)
13174
        self.PublishTime = uabin.Primitives.DateTime.unpack(data)
13175
        length = uabin.Primitives.Int32.unpack(data)
13176
        array = []
13177
        if length != -1:
13178
            for _ in range(0, length):
13179
                array.append(extensionobject_from_binary(data))
13180
        self.NotificationData = array
13181
13182
    def __str__(self):
13183
        return 'NotificationMessage(' + 'SequenceNumber:' + str(self.SequenceNumber) + ', ' + \
13184
               'PublishTime:' + str(self.PublishTime) + ', ' + \
13185
               'NotificationData:' + str(self.NotificationData) + ')'
13186
13187
    __repr__ = __str__
13188
13189
13190 View Code Duplication
class NotificationData(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13191
    '''
13192
    '''
13193
13194 1
    ua_types = {
13195
               }
13196
13197
    def __init__(self, binary=None):
13198
        if binary is not None:
13199
            self._binary_init(binary)
13200
            self._freeze = True
13201
            return
13202
        self._freeze = True
13203
13204
    def to_binary(self):
13205
        packet = []
13206
        return b''.join(packet)
13207
13208
    @staticmethod
13209
    def from_binary(data):
13210
        return NotificationData(data)
13211
13212
    def _binary_init(self, data):
13213
        pass
13214
13215
    def __str__(self):
13216
        return 'NotificationData(' +  + ')'
13217
13218
    __repr__ = __str__
13219
13220
13221 View Code Duplication
class DataChangeNotification(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13222
    '''
13223
    :ivar MonitoredItems:
13224
    :vartype MonitoredItems: MonitoredItemNotification
13225
    :ivar DiagnosticInfos:
13226
    :vartype DiagnosticInfos: DiagnosticInfo
13227
    '''
13228
13229
    ua_types = {
13230
        'MonitoredItems': 'MonitoredItemNotification',
13231
        'DiagnosticInfos': 'DiagnosticInfo',
13232
               }
13233
13234
    def __init__(self, binary=None):
13235
        if binary is not None:
13236
            self._binary_init(binary)
13237
            self._freeze = True
13238
            return
13239 1
        self.MonitoredItems = []
13240
        self.DiagnosticInfos = []
13241
        self._freeze = True
13242 1
13243
    def to_binary(self):
13244
        packet = []
13245
        packet.append(uabin.Primitives.Int32.pack(len(self.MonitoredItems)))
13246
        for fieldname in self.MonitoredItems:
13247
            packet.append(fieldname.to_binary())
13248
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
13249
        for fieldname in self.DiagnosticInfos:
13250
            packet.append(fieldname.to_binary())
13251
        return b''.join(packet)
13252
13253
    @staticmethod
13254
    def from_binary(data):
13255
        return DataChangeNotification(data)
13256
13257
    def _binary_init(self, data):
13258
        length = uabin.Primitives.Int32.unpack(data)
13259
        array = []
13260
        if length != -1:
13261
            for _ in range(0, length):
13262
                array.append(MonitoredItemNotification.from_binary(data))
13263 1
        self.MonitoredItems = array
13264
        length = uabin.Primitives.Int32.unpack(data)
13265
        array = []
13266
        if length != -1:
13267
            for _ in range(0, length):
13268
                array.append(DiagnosticInfo.from_binary(data))
13269
        self.DiagnosticInfos = array
13270
13271
    def __str__(self):
13272
        return 'DataChangeNotification(' + 'MonitoredItems:' + str(self.MonitoredItems) + ', ' + \
13273
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
13274
13275
    __repr__ = __str__
13276
13277
13278 View Code Duplication
class MonitoredItemNotification(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13279 1
    '''
13280
    :ivar ClientHandle:
13281
    :vartype ClientHandle: UInt32
13282
    :ivar Value:
13283
    :vartype Value: DataValue
13284
    '''
13285
13286
    ua_types = {
13287
        'ClientHandle': 'UInt32',
13288
        'Value': 'DataValue',
13289
               }
13290
13291
    def __init__(self, binary=None):
13292
        if binary is not None:
13293
            self._binary_init(binary)
13294 1
            self._freeze = True
13295
            return
13296
        self.ClientHandle = 0
13297
        self.Value = DataValue()
13298 1
        self._freeze = True
13299
13300
    def to_binary(self):
13301
        packet = []
13302
        packet.append(uabin.Primitives.UInt32.pack(self.ClientHandle))
13303
        packet.append(self.Value.to_binary())
13304
        return b''.join(packet)
13305
13306
    @staticmethod
13307
    def from_binary(data):
13308
        return MonitoredItemNotification(data)
13309 1
13310
    def _binary_init(self, data):
13311
        self.ClientHandle = uabin.Primitives.UInt32.unpack(data)
13312
        self.Value = DataValue.from_binary(data)
13313
13314
    def __str__(self):
13315
        return 'MonitoredItemNotification(' + 'ClientHandle:' + str(self.ClientHandle) + ', ' + \
13316
               'Value:' + str(self.Value) + ')'
13317
13318
    __repr__ = __str__
13319
13320 1
13321
class EventNotificationList(FrozenClass):
13322
    '''
13323 1
    :ivar Events:
13324
    :vartype Events: EventFieldList
13325
    '''
13326
13327
    ua_types = {
13328
        'Events': 'EventFieldList',
13329
               }
13330 1
13331
    def __init__(self, binary=None):
13332
        if binary is not None:
13333
            self._binary_init(binary)
13334
            self._freeze = True
13335
            return
13336
        self.Events = []
13337
        self._freeze = True
13338
13339 1
    def to_binary(self):
13340
        packet = []
13341
        packet.append(uabin.Primitives.Int32.pack(len(self.Events)))
13342
        for fieldname in self.Events:
13343
            packet.append(fieldname.to_binary())
13344
        return b''.join(packet)
13345 1
13346
    @staticmethod
13347
    def from_binary(data):
13348
        return EventNotificationList(data)
13349 1
13350
    def _binary_init(self, data):
13351
        length = uabin.Primitives.Int32.unpack(data)
13352
        array = []
13353 1
        if length != -1:
13354
            for _ in range(0, length):
13355
                array.append(EventFieldList.from_binary(data))
13356
        self.Events = array
13357 1
13358
    def __str__(self):
13359
        return 'EventNotificationList(' + 'Events:' + str(self.Events) + ')'
13360 1
13361
    __repr__ = __str__
13362
13363
13364 View Code Duplication
class EventFieldList(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13365
    '''
13366
    :ivar ClientHandle:
13367 1
    :vartype ClientHandle: UInt32
13368
    :ivar EventFields:
13369
    :vartype EventFields: Variant
13370
    '''
13371
13372
    ua_types = {
13373
        'ClientHandle': 'UInt32',
13374
        'EventFields': 'Variant',
13375
               }
13376 1
13377
    def __init__(self, binary=None):
13378
        if binary is not None:
13379
            self._binary_init(binary)
13380
            self._freeze = True
13381
            return
13382 1
        self.ClientHandle = 0
13383
        self.EventFields = []
13384
        self._freeze = True
13385
13386 1
    def to_binary(self):
13387
        packet = []
13388
        packet.append(uabin.Primitives.UInt32.pack(self.ClientHandle))
13389
        packet.append(uabin.Primitives.Int32.pack(len(self.EventFields)))
13390 1
        for fieldname in self.EventFields:
13391
            packet.append(fieldname.to_binary())
13392
        return b''.join(packet)
13393
13394 1
    @staticmethod
13395
    def from_binary(data):
13396
        return EventFieldList(data)
13397 1
13398
    def _binary_init(self, data):
13399
        self.ClientHandle = uabin.Primitives.UInt32.unpack(data)
13400
        length = uabin.Primitives.Int32.unpack(data)
13401
        array = []
13402
        if length != -1:
13403
            for _ in range(0, length):
13404
                array.append(Variant.from_binary(data))
13405
        self.EventFields = array
13406
13407
    def __str__(self):
13408
        return 'EventFieldList(' + 'ClientHandle:' + str(self.ClientHandle) + ', ' + \
13409
               'EventFields:' + str(self.EventFields) + ')'
13410
13411
    __repr__ = __str__
13412
13413
13414
class HistoryEventFieldList(FrozenClass):
13415
    '''
13416
    :ivar EventFields:
13417
    :vartype EventFields: Variant
13418
    '''
13419
13420
    ua_types = {
13421
        'EventFields': 'Variant',
13422
               }
13423
13424
    def __init__(self, binary=None):
13425
        if binary is not None:
13426
            self._binary_init(binary)
13427
            self._freeze = True
13428
            return
13429
        self.EventFields = []
13430
        self._freeze = True
13431
13432
    def to_binary(self):
13433
        packet = []
13434
        packet.append(uabin.Primitives.Int32.pack(len(self.EventFields)))
13435
        for fieldname in self.EventFields:
13436
            packet.append(fieldname.to_binary())
13437
        return b''.join(packet)
13438
13439
    @staticmethod
13440
    def from_binary(data):
13441
        return HistoryEventFieldList(data)
13442
13443
    def _binary_init(self, data):
13444
        length = uabin.Primitives.Int32.unpack(data)
13445
        array = []
13446
        if length != -1:
13447
            for _ in range(0, length):
13448
                array.append(Variant.from_binary(data))
13449
        self.EventFields = array
13450
13451
    def __str__(self):
13452
        return 'HistoryEventFieldList(' + 'EventFields:' + str(self.EventFields) + ')'
13453
13454
    __repr__ = __str__
13455
13456
13457 View Code Duplication
class StatusChangeNotification(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13458
    '''
13459
    :ivar Status:
13460
    :vartype Status: StatusCode
13461
    :ivar DiagnosticInfo:
13462 1
    :vartype DiagnosticInfo: DiagnosticInfo
13463
    '''
13464
13465
    ua_types = {
13466
        'Status': 'StatusCode',
13467
        'DiagnosticInfo': 'DiagnosticInfo',
13468
               }
13469
13470
    def __init__(self, binary=None):
13471
        if binary is not None:
13472
            self._binary_init(binary)
13473
            self._freeze = True
13474
            return
13475
        self.Status = StatusCode()
13476
        self.DiagnosticInfo = DiagnosticInfo()
13477
        self._freeze = True
13478
13479
    def to_binary(self):
13480
        packet = []
13481
        packet.append(self.Status.to_binary())
13482
        packet.append(self.DiagnosticInfo.to_binary())
13483
        return b''.join(packet)
13484
13485
    @staticmethod
13486
    def from_binary(data):
13487
        return StatusChangeNotification(data)
13488
13489
    def _binary_init(self, data):
13490
        self.Status = StatusCode.from_binary(data)
13491
        self.DiagnosticInfo = DiagnosticInfo.from_binary(data)
13492
13493
    def __str__(self):
13494
        return 'StatusChangeNotification(' + 'Status:' + str(self.Status) + ', ' + \
13495
               'DiagnosticInfo:' + str(self.DiagnosticInfo) + ')'
13496
13497
    __repr__ = __str__
13498
13499
13500 1 View Code Duplication
class SubscriptionAcknowledgement(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13501
    '''
13502
    :ivar SubscriptionId:
13503
    :vartype SubscriptionId: UInt32
13504
    :ivar SequenceNumber:
13505
    :vartype SequenceNumber: UInt32
13506
    '''
13507
13508
    ua_types = {
13509
        'SubscriptionId': 'UInt32',
13510
        'SequenceNumber': 'UInt32',
13511
               }
13512
13513
    def __init__(self, binary=None):
13514
        if binary is not None:
13515
            self._binary_init(binary)
13516
            self._freeze = True
13517
            return
13518
        self.SubscriptionId = 0
13519
        self.SequenceNumber = 0
13520
        self._freeze = True
13521
13522
    def to_binary(self):
13523
        packet = []
13524
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
13525
        packet.append(uabin.Primitives.UInt32.pack(self.SequenceNumber))
13526
        return b''.join(packet)
13527
13528
    @staticmethod
13529
    def from_binary(data):
13530
        return SubscriptionAcknowledgement(data)
13531
13532
    def _binary_init(self, data):
13533
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
13534
        self.SequenceNumber = uabin.Primitives.UInt32.unpack(data)
13535 1
13536
    def __str__(self):
13537
        return 'SubscriptionAcknowledgement(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
13538
               'SequenceNumber:' + str(self.SequenceNumber) + ')'
13539 1
13540
    __repr__ = __str__
13541
13542
13543
class PublishParameters(FrozenClass):
13544
    '''
13545
    :ivar SubscriptionAcknowledgements:
13546
    :vartype SubscriptionAcknowledgements: SubscriptionAcknowledgement
13547
    '''
13548
13549
    ua_types = {
13550
        'SubscriptionAcknowledgements': 'SubscriptionAcknowledgement',
13551
               }
13552
13553
    def __init__(self, binary=None):
13554
        if binary is not None:
13555
            self._binary_init(binary)
13556
            self._freeze = True
13557
            return
13558
        self.SubscriptionAcknowledgements = []
13559
        self._freeze = True
13560
13561
    def to_binary(self):
13562
        packet = []
13563
        packet.append(uabin.Primitives.Int32.pack(len(self.SubscriptionAcknowledgements)))
13564
        for fieldname in self.SubscriptionAcknowledgements:
13565
            packet.append(fieldname.to_binary())
13566
        return b''.join(packet)
13567
13568
    @staticmethod
13569
    def from_binary(data):
13570
        return PublishParameters(data)
13571
13572 1
    def _binary_init(self, data):
13573
        length = uabin.Primitives.Int32.unpack(data)
13574
        array = []
13575
        if length != -1:
13576
            for _ in range(0, length):
13577
                array.append(SubscriptionAcknowledgement.from_binary(data))
13578
        self.SubscriptionAcknowledgements = array
13579
13580
    def __str__(self):
13581
        return 'PublishParameters(' + 'SubscriptionAcknowledgements:' + str(self.SubscriptionAcknowledgements) + ')'
13582
13583
    __repr__ = __str__
13584
13585
13586
class PublishRequest(FrozenClass):
13587
    '''
13588
    :ivar TypeId:
13589
    :vartype TypeId: NodeId
13590
    :ivar RequestHeader:
13591
    :vartype RequestHeader: RequestHeader
13592
    :ivar Parameters:
13593
    :vartype Parameters: PublishParameters
13594
    '''
13595
13596
    ua_types = {
13597
        'TypeId': 'NodeId',
13598
        'RequestHeader': 'RequestHeader',
13599
        'Parameters': 'PublishParameters',
13600
               }
13601
13602
    def __init__(self, binary=None):
13603
        if binary is not None:
13604
            self._binary_init(binary)
13605 1
            self._freeze = True
13606
            return
13607
        self.TypeId = FourByteNodeId(ObjectIds.PublishRequest_Encoding_DefaultBinary)
13608 1
        self.RequestHeader = RequestHeader()
13609
        self.Parameters = PublishParameters()
13610
        self._freeze = True
13611
13612
    def to_binary(self):
13613
        packet = []
13614
        packet.append(self.TypeId.to_binary())
13615
        packet.append(self.RequestHeader.to_binary())
13616
        packet.append(self.Parameters.to_binary())
13617 1
        return b''.join(packet)
13618
13619
    @staticmethod
13620
    def from_binary(data):
13621
        return PublishRequest(data)
13622
13623
    def _binary_init(self, data):
13624
        self.TypeId = NodeId.from_binary(data)
13625
        self.RequestHeader = RequestHeader.from_binary(data)
13626
        self.Parameters = PublishParameters.from_binary(data)
13627 1
13628
    def __str__(self):
13629
        return 'PublishRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13630
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
13631
               'Parameters:' + str(self.Parameters) + ')'
13632
13633
    __repr__ = __str__
13634 1
13635
13636
class PublishResult(FrozenClass):
13637
    '''
13638 1
    :ivar SubscriptionId:
13639
    :vartype SubscriptionId: UInt32
13640
    :ivar AvailableSequenceNumbers:
13641
    :vartype AvailableSequenceNumbers: UInt32
13642
    :ivar MoreNotifications:
13643 1
    :vartype MoreNotifications: Boolean
13644
    :ivar NotificationMessage:
13645
    :vartype NotificationMessage: NotificationMessage
13646
    :ivar Results:
13647
    :vartype Results: StatusCode
13648 1
    :ivar DiagnosticInfos:
13649
    :vartype DiagnosticInfos: DiagnosticInfo
13650
    '''
13651 1
13652
    ua_types = {
13653
        'SubscriptionId': 'UInt32',
13654
        'AvailableSequenceNumbers': 'UInt32',
13655
        'MoreNotifications': 'Boolean',
13656
        'NotificationMessage': 'NotificationMessage',
13657
        'Results': 'StatusCode',
13658 1
        'DiagnosticInfos': 'DiagnosticInfo',
13659
               }
13660
13661
    def __init__(self, binary=None):
13662
        if binary is not None:
13663
            self._binary_init(binary)
13664
            self._freeze = True
13665
            return
13666
        self.SubscriptionId = 0
13667 1
        self.AvailableSequenceNumbers = []
13668
        self.MoreNotifications = True
13669
        self.NotificationMessage = NotificationMessage()
13670
        self.Results = []
13671
        self.DiagnosticInfos = []
13672
        self._freeze = True
13673 1
13674 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13675
        packet = []
13676
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
13677 1
        packet.append(uabin.Primitives.Int32.pack(len(self.AvailableSequenceNumbers)))
13678
        for fieldname in self.AvailableSequenceNumbers:
13679
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
13680
        packet.append(uabin.Primitives.Boolean.pack(self.MoreNotifications))
13681 1
        packet.append(self.NotificationMessage.to_binary())
13682
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
13683
        for fieldname in self.Results:
13684
            packet.append(fieldname.to_binary())
13685 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
13686
        for fieldname in self.DiagnosticInfos:
13687
            packet.append(fieldname.to_binary())
13688 1
        return b''.join(packet)
13689
13690
    @staticmethod
13691
    def from_binary(data):
13692
        return PublishResult(data)
13693
13694
    def _binary_init(self, data):
13695 1
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
13696
        self.AvailableSequenceNumbers = uabin.Primitives.UInt32.unpack_array(data)
13697
        self.MoreNotifications = uabin.Primitives.Boolean.unpack(data)
13698
        self.NotificationMessage = NotificationMessage.from_binary(data)
13699
        length = uabin.Primitives.Int32.unpack(data)
13700
        array = []
13701
        if length != -1:
13702
            for _ in range(0, length):
13703
                array.append(StatusCode.from_binary(data))
13704 1
        self.Results = array
13705
        length = uabin.Primitives.Int32.unpack(data)
13706
        array = []
13707
        if length != -1:
13708
            for _ in range(0, length):
13709
                array.append(DiagnosticInfo.from_binary(data))
13710 1
        self.DiagnosticInfos = array
13711
13712
    def __str__(self):
13713
        return 'PublishResult(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
13714 1
               'AvailableSequenceNumbers:' + str(self.AvailableSequenceNumbers) + ', ' + \
13715
               'MoreNotifications:' + str(self.MoreNotifications) + ', ' + \
13716
               'NotificationMessage:' + str(self.NotificationMessage) + ', ' + \
13717
               'Results:' + str(self.Results) + ', ' + \
13718 1
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
13719
13720
    __repr__ = __str__
13721
13722 1
13723
class PublishResponse(FrozenClass):
13724
    '''
13725 1
    :ivar TypeId:
13726
    :vartype TypeId: NodeId
13727
    :ivar ResponseHeader:
13728
    :vartype ResponseHeader: ResponseHeader
13729
    :ivar Parameters:
13730
    :vartype Parameters: PublishResult
13731
    '''
13732
13733
    ua_types = {
13734
        'TypeId': 'NodeId',
13735
        'ResponseHeader': 'ResponseHeader',
13736 1
        'Parameters': 'PublishResult',
13737
               }
13738
13739
    def __init__(self, binary=None):
13740
        if binary is not None:
13741
            self._binary_init(binary)
13742
            self._freeze = True
13743
            return
13744
        self.TypeId = FourByteNodeId(ObjectIds.PublishResponse_Encoding_DefaultBinary)
13745
        self.ResponseHeader = ResponseHeader()
13746
        self.Parameters = PublishResult()
13747 1
        self._freeze = True
13748
13749
    def to_binary(self):
13750
        packet = []
13751
        packet.append(self.TypeId.to_binary())
13752
        packet.append(self.ResponseHeader.to_binary())
13753
        packet.append(self.Parameters.to_binary())
13754
        return b''.join(packet)
13755 1
13756
    @staticmethod
13757
    def from_binary(data):
13758
        return PublishResponse(data)
13759 1
13760
    def _binary_init(self, data):
13761
        self.TypeId = NodeId.from_binary(data)
13762
        self.ResponseHeader = ResponseHeader.from_binary(data)
13763
        self.Parameters = PublishResult.from_binary(data)
13764
13765 1
    def __str__(self):
13766
        return 'PublishResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13767
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
13768
               'Parameters:' + str(self.Parameters) + ')'
13769
13770
    __repr__ = __str__
13771 1
13772
13773 View Code Duplication
class RepublishParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13774 1
    '''
13775
    :ivar SubscriptionId:
13776
    :vartype SubscriptionId: UInt32
13777
    :ivar RetransmitSequenceNumber:
13778
    :vartype RetransmitSequenceNumber: UInt32
13779
    '''
13780
13781 1
    ua_types = {
13782
        'SubscriptionId': 'UInt32',
13783
        'RetransmitSequenceNumber': 'UInt32',
13784
               }
13785
13786
    def __init__(self, binary=None):
13787
        if binary is not None:
13788
            self._binary_init(binary)
13789
            self._freeze = True
13790 1
            return
13791
        self.SubscriptionId = 0
13792
        self.RetransmitSequenceNumber = 0
13793
        self._freeze = True
13794
13795
    def to_binary(self):
13796 1
        packet = []
13797
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
13798
        packet.append(uabin.Primitives.UInt32.pack(self.RetransmitSequenceNumber))
13799
        return b''.join(packet)
13800 1
13801
    @staticmethod
13802
    def from_binary(data):
13803
        return RepublishParameters(data)
13804 1
13805
    def _binary_init(self, data):
13806
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
13807
        self.RetransmitSequenceNumber = uabin.Primitives.UInt32.unpack(data)
13808 1
13809
    def __str__(self):
13810
        return 'RepublishParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
13811 1
               'RetransmitSequenceNumber:' + str(self.RetransmitSequenceNumber) + ')'
13812
13813
    __repr__ = __str__
13814
13815
13816
class RepublishRequest(FrozenClass):
13817
    '''
13818 1
    :ivar TypeId:
13819
    :vartype TypeId: NodeId
13820
    :ivar RequestHeader:
13821
    :vartype RequestHeader: RequestHeader
13822
    :ivar Parameters:
13823
    :vartype Parameters: RepublishParameters
13824
    '''
13825
13826
    ua_types = {
13827 1
        'TypeId': 'NodeId',
13828
        'RequestHeader': 'RequestHeader',
13829
        'Parameters': 'RepublishParameters',
13830
               }
13831
13832
    def __init__(self, binary=None):
13833 1
        if binary is not None:
13834
            self._binary_init(binary)
13835
            self._freeze = True
13836
            return
13837 1
        self.TypeId = FourByteNodeId(ObjectIds.RepublishRequest_Encoding_DefaultBinary)
13838
        self.RequestHeader = RequestHeader()
13839
        self.Parameters = RepublishParameters()
13840
        self._freeze = True
13841 1
13842
    def to_binary(self):
13843
        packet = []
13844
        packet.append(self.TypeId.to_binary())
13845 1
        packet.append(self.RequestHeader.to_binary())
13846
        packet.append(self.Parameters.to_binary())
13847
        return b''.join(packet)
13848 1
13849
    @staticmethod
13850
    def from_binary(data):
13851
        return RepublishRequest(data)
13852
13853
    def _binary_init(self, data):
13854
        self.TypeId = NodeId.from_binary(data)
13855
        self.RequestHeader = RequestHeader.from_binary(data)
13856
        self.Parameters = RepublishParameters.from_binary(data)
13857
13858
    def __str__(self):
13859
        return 'RepublishRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13860
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
13861 1
               'Parameters:' + str(self.Parameters) + ')'
13862
13863
    __repr__ = __str__
13864
13865
13866
class RepublishResponse(FrozenClass):
13867
    '''
13868
    :ivar TypeId:
13869
    :vartype TypeId: NodeId
13870
    :ivar ResponseHeader:
13871
    :vartype ResponseHeader: ResponseHeader
13872
    :ivar NotificationMessage:
13873 1
    :vartype NotificationMessage: NotificationMessage
13874
    '''
13875
13876
    ua_types = {
13877
        'TypeId': 'NodeId',
13878
        'ResponseHeader': 'ResponseHeader',
13879
        'NotificationMessage': 'NotificationMessage',
13880
               }
13881
13882
    def __init__(self, binary=None):
13883
        if binary is not None:
13884 1
            self._binary_init(binary)
13885
            self._freeze = True
13886
            return
13887
        self.TypeId = FourByteNodeId(ObjectIds.RepublishResponse_Encoding_DefaultBinary)
13888 1
        self.ResponseHeader = ResponseHeader()
13889
        self.NotificationMessage = NotificationMessage()
13890
        self._freeze = True
13891
13892
    def to_binary(self):
13893
        packet = []
13894
        packet.append(self.TypeId.to_binary())
13895 1
        packet.append(self.ResponseHeader.to_binary())
13896
        packet.append(self.NotificationMessage.to_binary())
13897
        return b''.join(packet)
13898
13899
    @staticmethod
13900
    def from_binary(data):
13901
        return RepublishResponse(data)
13902 1
13903
    def _binary_init(self, data):
13904
        self.TypeId = NodeId.from_binary(data)
13905 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
13906
        self.NotificationMessage = NotificationMessage.from_binary(data)
13907
13908
    def __str__(self):
13909
        return 'RepublishResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13910
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
13911
               'NotificationMessage:' + str(self.NotificationMessage) + ')'
13912 1
13913
    __repr__ = __str__
13914
13915
13916 View Code Duplication
class TransferResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13917
    '''
13918
    :ivar StatusCode:
13919
    :vartype StatusCode: StatusCode
13920
    :ivar AvailableSequenceNumbers:
13921 1
    :vartype AvailableSequenceNumbers: UInt32
13922
    '''
13923
13924
    ua_types = {
13925
        'StatusCode': 'StatusCode',
13926
        'AvailableSequenceNumbers': 'UInt32',
13927 1
               }
13928
13929
    def __init__(self, binary=None):
13930
        if binary is not None:
13931 1
            self._binary_init(binary)
13932
            self._freeze = True
13933
            return
13934
        self.StatusCode = StatusCode()
13935 1
        self.AvailableSequenceNumbers = []
13936
        self._freeze = True
13937
13938
    def to_binary(self):
13939 1
        packet = []
13940
        packet.append(self.StatusCode.to_binary())
13941
        packet.append(uabin.Primitives.Int32.pack(len(self.AvailableSequenceNumbers)))
13942 1
        for fieldname in self.AvailableSequenceNumbers:
13943
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
13944
        return b''.join(packet)
13945
13946
    @staticmethod
13947
    def from_binary(data):
13948
        return TransferResult(data)
13949
13950
    def _binary_init(self, data):
13951
        self.StatusCode = StatusCode.from_binary(data)
13952
        self.AvailableSequenceNumbers = uabin.Primitives.UInt32.unpack_array(data)
13953
13954
    def __str__(self):
13955
        return 'TransferResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
13956
               'AvailableSequenceNumbers:' + str(self.AvailableSequenceNumbers) + ')'
13957
13958
    __repr__ = __str__
13959
13960
13961 View Code Duplication
class TransferSubscriptionsParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13962
    '''
13963
    :ivar SubscriptionIds:
13964
    :vartype SubscriptionIds: UInt32
13965 1
    :ivar SendInitialValues:
13966
    :vartype SendInitialValues: Boolean
13967
    '''
13968
13969
    ua_types = {
13970
        'SubscriptionIds': 'UInt32',
13971
        'SendInitialValues': 'Boolean',
13972
               }
13973
13974
    def __init__(self, binary=None):
13975
        if binary is not None:
13976
            self._binary_init(binary)
13977
            self._freeze = True
13978
            return
13979
        self.SubscriptionIds = []
13980
        self.SendInitialValues = True
13981
        self._freeze = True
13982 1
13983
    def to_binary(self):
13984
        packet = []
13985
        packet.append(uabin.Primitives.Int32.pack(len(self.SubscriptionIds)))
13986
        for fieldname in self.SubscriptionIds:
13987
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
13988
        packet.append(uabin.Primitives.Boolean.pack(self.SendInitialValues))
13989
        return b''.join(packet)
13990
13991
    @staticmethod
13992
    def from_binary(data):
13993
        return TransferSubscriptionsParameters(data)
13994
13995
    def _binary_init(self, data):
13996
        self.SubscriptionIds = uabin.Primitives.UInt32.unpack_array(data)
13997
        self.SendInitialValues = uabin.Primitives.Boolean.unpack(data)
13998
13999
    def __str__(self):
14000 1
        return 'TransferSubscriptionsParameters(' + 'SubscriptionIds:' + str(self.SubscriptionIds) + ', ' + \
14001
               'SendInitialValues:' + str(self.SendInitialValues) + ')'
14002
14003
    __repr__ = __str__
14004 1
14005
14006
class TransferSubscriptionsRequest(FrozenClass):
14007
    '''
14008
    :ivar TypeId:
14009
    :vartype TypeId: NodeId
14010
    :ivar RequestHeader:
14011
    :vartype RequestHeader: RequestHeader
14012
    :ivar Parameters:
14013
    :vartype Parameters: TransferSubscriptionsParameters
14014
    '''
14015
14016
    ua_types = {
14017
        'TypeId': 'NodeId',
14018
        'RequestHeader': 'RequestHeader',
14019
        'Parameters': 'TransferSubscriptionsParameters',
14020
               }
14021
14022
    def __init__(self, binary=None):
14023
        if binary is not None:
14024
            self._binary_init(binary)
14025
            self._freeze = True
14026 1
            return
14027
        self.TypeId = FourByteNodeId(ObjectIds.TransferSubscriptionsRequest_Encoding_DefaultBinary)
14028
        self.RequestHeader = RequestHeader()
14029
        self.Parameters = TransferSubscriptionsParameters()
14030
        self._freeze = True
14031
14032
    def to_binary(self):
14033
        packet = []
14034
        packet.append(self.TypeId.to_binary())
14035
        packet.append(self.RequestHeader.to_binary())
14036
        packet.append(self.Parameters.to_binary())
14037
        return b''.join(packet)
14038 1
14039
    @staticmethod
14040
    def from_binary(data):
14041 1
        return TransferSubscriptionsRequest(data)
14042
14043
    def _binary_init(self, data):
14044
        self.TypeId = NodeId.from_binary(data)
14045
        self.RequestHeader = RequestHeader.from_binary(data)
14046
        self.Parameters = TransferSubscriptionsParameters.from_binary(data)
14047
14048
    def __str__(self):
14049
        return 'TransferSubscriptionsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
14050 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
14051
               'Parameters:' + str(self.Parameters) + ')'
14052
14053
    __repr__ = __str__
14054
14055
14056 View Code Duplication
class TransferSubscriptionsResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
14057
    '''
14058
    :ivar Results:
14059
    :vartype Results: TransferResult
14060 1
    :ivar DiagnosticInfos:
14061
    :vartype DiagnosticInfos: DiagnosticInfo
14062
    '''
14063
14064
    ua_types = {
14065
        'Results': 'TransferResult',
14066
        'DiagnosticInfos': 'DiagnosticInfo',
14067 1
               }
14068
14069
    def __init__(self, binary=None):
14070
        if binary is not None:
14071 1
            self._binary_init(binary)
14072
            self._freeze = True
14073
            return
14074
        self.Results = []
14075
        self.DiagnosticInfos = []
14076 1
        self._freeze = True
14077
14078
    def to_binary(self):
14079
        packet = []
14080
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
14081 1
        for fieldname in self.Results:
14082
            packet.append(fieldname.to_binary())
14083
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
14084 1
        for fieldname in self.DiagnosticInfos:
14085
            packet.append(fieldname.to_binary())
14086
        return b''.join(packet)
14087
14088
    @staticmethod
14089
    def from_binary(data):
14090
        return TransferSubscriptionsResult(data)
14091
14092
    def _binary_init(self, data):
14093
        length = uabin.Primitives.Int32.unpack(data)
14094
        array = []
14095
        if length != -1:
14096
            for _ in range(0, length):
14097
                array.append(TransferResult.from_binary(data))
14098
        self.Results = array
14099
        length = uabin.Primitives.Int32.unpack(data)
14100
        array = []
14101
        if length != -1:
14102
            for _ in range(0, length):
14103
                array.append(DiagnosticInfo.from_binary(data))
14104
        self.DiagnosticInfos = array
14105
14106
    def __str__(self):
14107
        return 'TransferSubscriptionsResult(' + 'Results:' + str(self.Results) + ', ' + \
14108
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
14109
14110
    __repr__ = __str__
14111
14112
14113
class TransferSubscriptionsResponse(FrozenClass):
14114
    '''
14115
    :ivar TypeId:
14116
    :vartype TypeId: NodeId
14117
    :ivar ResponseHeader:
14118
    :vartype ResponseHeader: ResponseHeader
14119
    :ivar Parameters:
14120
    :vartype Parameters: TransferSubscriptionsResult
14121
    '''
14122
14123
    ua_types = {
14124
        'TypeId': 'NodeId',
14125
        'ResponseHeader': 'ResponseHeader',
14126
        'Parameters': 'TransferSubscriptionsResult',
14127
               }
14128
14129
    def __init__(self, binary=None):
14130
        if binary is not None:
14131
            self._binary_init(binary)
14132
            self._freeze = True
14133
            return
14134
        self.TypeId = FourByteNodeId(ObjectIds.TransferSubscriptionsResponse_Encoding_DefaultBinary)
14135
        self.ResponseHeader = ResponseHeader()
14136
        self.Parameters = TransferSubscriptionsResult()
14137
        self._freeze = True
14138
14139
    def to_binary(self):
14140
        packet = []
14141
        packet.append(self.TypeId.to_binary())
14142
        packet.append(self.ResponseHeader.to_binary())
14143
        packet.append(self.Parameters.to_binary())
14144
        return b''.join(packet)
14145
14146
    @staticmethod
14147
    def from_binary(data):
14148
        return TransferSubscriptionsResponse(data)
14149
14150
    def _binary_init(self, data):
14151
        self.TypeId = NodeId.from_binary(data)
14152
        self.ResponseHeader = ResponseHeader.from_binary(data)
14153
        self.Parameters = TransferSubscriptionsResult.from_binary(data)
14154
14155
    def __str__(self):
14156
        return 'TransferSubscriptionsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
14157
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
14158
               'Parameters:' + str(self.Parameters) + ')'
14159
14160
    __repr__ = __str__
14161
14162
14163
class DeleteSubscriptionsParameters(FrozenClass):
14164
    '''
14165
    :ivar SubscriptionIds:
14166
    :vartype SubscriptionIds: UInt32
14167
    '''
14168
14169
    ua_types = {
14170
        'SubscriptionIds': 'UInt32',
14171
               }
14172
14173
    def __init__(self, binary=None):
14174
        if binary is not None:
14175
            self._binary_init(binary)
14176
            self._freeze = True
14177
            return
14178
        self.SubscriptionIds = []
14179
        self._freeze = True
14180
14181
    def to_binary(self):
14182
        packet = []
14183
        packet.append(uabin.Primitives.Int32.pack(len(self.SubscriptionIds)))
14184
        for fieldname in self.SubscriptionIds:
14185
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
14186
        return b''.join(packet)
14187
14188
    @staticmethod
14189
    def from_binary(data):
14190
        return DeleteSubscriptionsParameters(data)
14191
14192
    def _binary_init(self, data):
14193
        self.SubscriptionIds = uabin.Primitives.UInt32.unpack_array(data)
14194
14195
    def __str__(self):
14196
        return 'DeleteSubscriptionsParameters(' + 'SubscriptionIds:' + str(self.SubscriptionIds) + ')'
14197
14198
    __repr__ = __str__
14199
14200
14201
class DeleteSubscriptionsRequest(FrozenClass):
14202
    '''
14203
    :ivar TypeId:
14204
    :vartype TypeId: NodeId
14205
    :ivar RequestHeader:
14206
    :vartype RequestHeader: RequestHeader
14207
    :ivar Parameters:
14208
    :vartype Parameters: DeleteSubscriptionsParameters
14209
    '''
14210
14211
    ua_types = {
14212
        'TypeId': 'NodeId',
14213
        'RequestHeader': 'RequestHeader',
14214
        'Parameters': 'DeleteSubscriptionsParameters',
14215
               }
14216
14217
    def __init__(self, binary=None):
14218
        if binary is not None:
14219
            self._binary_init(binary)
14220
            self._freeze = True
14221
            return
14222
        self.TypeId = FourByteNodeId(ObjectIds.DeleteSubscriptionsRequest_Encoding_DefaultBinary)
14223
        self.RequestHeader = RequestHeader()
14224
        self.Parameters = DeleteSubscriptionsParameters()
14225
        self._freeze = True
14226
14227
    def to_binary(self):
14228
        packet = []
14229
        packet.append(self.TypeId.to_binary())
14230
        packet.append(self.RequestHeader.to_binary())
14231
        packet.append(self.Parameters.to_binary())
14232
        return b''.join(packet)
14233
14234
    @staticmethod
14235
    def from_binary(data):
14236
        return DeleteSubscriptionsRequest(data)
14237
14238
    def _binary_init(self, data):
14239
        self.TypeId = NodeId.from_binary(data)
14240
        self.RequestHeader = RequestHeader.from_binary(data)
14241
        self.Parameters = DeleteSubscriptionsParameters.from_binary(data)
14242
14243
    def __str__(self):
14244
        return 'DeleteSubscriptionsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
14245
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
14246
               'Parameters:' + str(self.Parameters) + ')'
14247
14248
    __repr__ = __str__
14249
14250
14251
class DeleteSubscriptionsResponse(FrozenClass):
14252
    '''
14253
    :ivar TypeId:
14254
    :vartype TypeId: NodeId
14255
    :ivar ResponseHeader:
14256
    :vartype ResponseHeader: ResponseHeader
14257
    :ivar Results:
14258
    :vartype Results: StatusCode
14259
    :ivar DiagnosticInfos:
14260
    :vartype DiagnosticInfos: DiagnosticInfo
14261
    '''
14262
14263
    ua_types = {
14264
        'TypeId': 'NodeId',
14265
        'ResponseHeader': 'ResponseHeader',
14266
        'Results': 'StatusCode',
14267
        'DiagnosticInfos': 'DiagnosticInfo',
14268
               }
14269
14270
    def __init__(self, binary=None):
14271
        if binary is not None:
14272
            self._binary_init(binary)
14273
            self._freeze = True
14274
            return
14275
        self.TypeId = FourByteNodeId(ObjectIds.DeleteSubscriptionsResponse_Encoding_DefaultBinary)
14276
        self.ResponseHeader = ResponseHeader()
14277
        self.Results = []
14278
        self.DiagnosticInfos = []
14279
        self._freeze = True
14280
14281
    def to_binary(self):
14282
        packet = []
14283
        packet.append(self.TypeId.to_binary())
14284
        packet.append(self.ResponseHeader.to_binary())
14285
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
14286
        for fieldname in self.Results:
14287
            packet.append(fieldname.to_binary())
14288
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
14289
        for fieldname in self.DiagnosticInfos:
14290
            packet.append(fieldname.to_binary())
14291
        return b''.join(packet)
14292
14293
    @staticmethod
14294
    def from_binary(data):
14295
        return DeleteSubscriptionsResponse(data)
14296
14297
    def _binary_init(self, data):
14298 1
        self.TypeId = NodeId.from_binary(data)
14299
        self.ResponseHeader = ResponseHeader.from_binary(data)
14300
        length = uabin.Primitives.Int32.unpack(data)
14301
        array = []
14302
        if length != -1:
14303 1
            for _ in range(0, length):
14304 1
                array.append(StatusCode.from_binary(data))
14305 1
        self.Results = array
14306 1
        length = uabin.Primitives.Int32.unpack(data)
14307 1
        array = []
14308 1
        if length != -1:
14309
            for _ in range(0, length):
14310
                array.append(DiagnosticInfo.from_binary(data))
14311 1
        self.DiagnosticInfos = array
14312 1
14313 1
    def __str__(self):
14314 1
        return 'DeleteSubscriptionsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
14315 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
14316 1
               'Results:' + str(self.Results) + ', ' + \
14317 1
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
14318 1
14319 1
    __repr__ = __str__
14320 1
14321 1
14322 1
class BuildInfo(FrozenClass):
14323 1
    '''
14324
    :ivar ProductUri:
14325 1
    :vartype ProductUri: String
14326
    :ivar ManufacturerName:
14327
    :vartype ManufacturerName: String
14328 1
    :ivar ProductName:
14329
    :vartype ProductName: String
14330
    :ivar SoftwareVersion:
14331
    :vartype SoftwareVersion: String
14332
    :ivar BuildNumber:
14333
    :vartype BuildNumber: String
14334 1
    :ivar BuildDate:
14335 1
    :vartype BuildDate: DateTime
14336 1
    '''
14337 1
14338 1
    ua_types = {
14339 1
        'ProductUri': 'String',
14340 1
        'ManufacturerName': 'String',
14341 1
        'ProductName': 'String',
14342 1
        'SoftwareVersion': 'String',
14343 1
        'BuildNumber': 'String',
14344 1
        'BuildDate': 'DateTime',
14345 1
               }
14346 1
14347 1
    def __init__(self, binary=None):
14348 1
        if binary is not None:
14349
            self._binary_init(binary)
14350
            self._freeze = True
14351
            return
14352
        self.ProductUri = None
14353
        self.ManufacturerName = None
14354
        self.ProductName = None
14355
        self.SoftwareVersion = None
14356
        self.BuildNumber = None
14357
        self.BuildDate = datetime.now()
14358
        self._freeze = True
14359
14360
    def to_binary(self):
14361
        packet = []
14362
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
14363
        packet.append(uabin.Primitives.String.pack(self.ManufacturerName))
14364
        packet.append(uabin.Primitives.String.pack(self.ProductName))
14365
        packet.append(uabin.Primitives.String.pack(self.SoftwareVersion))
14366
        packet.append(uabin.Primitives.String.pack(self.BuildNumber))
14367
        packet.append(uabin.Primitives.DateTime.pack(self.BuildDate))
14368
        return b''.join(packet)
14369
14370
    @staticmethod
14371
    def from_binary(data):
14372
        return BuildInfo(data)
14373
14374
    def _binary_init(self, data):
14375
        self.ProductUri = uabin.Primitives.String.unpack(data)
14376
        self.ManufacturerName = uabin.Primitives.String.unpack(data)
14377
        self.ProductName = uabin.Primitives.String.unpack(data)
14378
        self.SoftwareVersion = uabin.Primitives.String.unpack(data)
14379
        self.BuildNumber = uabin.Primitives.String.unpack(data)
14380
        self.BuildDate = uabin.Primitives.DateTime.unpack(data)
14381
14382
    def __str__(self):
14383
        return 'BuildInfo(' + 'ProductUri:' + str(self.ProductUri) + ', ' + \
14384
               'ManufacturerName:' + str(self.ManufacturerName) + ', ' + \
14385
               'ProductName:' + str(self.ProductName) + ', ' + \
14386
               'SoftwareVersion:' + str(self.SoftwareVersion) + ', ' + \
14387
               'BuildNumber:' + str(self.BuildNumber) + ', ' + \
14388
               'BuildDate:' + str(self.BuildDate) + ')'
14389
14390
    __repr__ = __str__
14391
14392
14393
class RedundantServerDataType(FrozenClass):
14394
    '''
14395
    :ivar ServerId:
14396
    :vartype ServerId: String
14397
    :ivar ServiceLevel:
14398
    :vartype ServiceLevel: Byte
14399
    :ivar ServerState:
14400
    :vartype ServerState: ServerState
14401
    '''
14402
14403
    ua_types = {
14404
        'ServerId': 'String',
14405
        'ServiceLevel': 'Byte',
14406
        'ServerState': 'ServerState',
14407
               }
14408
14409
    def __init__(self, binary=None):
14410
        if binary is not None:
14411
            self._binary_init(binary)
14412
            self._freeze = True
14413
            return
14414
        self.ServerId = None
14415
        self.ServiceLevel = 0
14416
        self.ServerState = ServerState(0)
14417
        self._freeze = True
14418
14419
    def to_binary(self):
14420
        packet = []
14421
        packet.append(uabin.Primitives.String.pack(self.ServerId))
14422
        packet.append(uabin.Primitives.Byte.pack(self.ServiceLevel))
14423
        packet.append(uabin.Primitives.UInt32.pack(self.ServerState.value))
14424
        return b''.join(packet)
14425
14426
    @staticmethod
14427
    def from_binary(data):
14428
        return RedundantServerDataType(data)
14429
14430
    def _binary_init(self, data):
14431
        self.ServerId = uabin.Primitives.String.unpack(data)
14432
        self.ServiceLevel = uabin.Primitives.Byte.unpack(data)
14433
        self.ServerState = ServerState(uabin.Primitives.UInt32.unpack(data))
14434
14435
    def __str__(self):
14436
        return 'RedundantServerDataType(' + 'ServerId:' + str(self.ServerId) + ', ' + \
14437
               'ServiceLevel:' + str(self.ServiceLevel) + ', ' + \
14438
               'ServerState:' + str(self.ServerState) + ')'
14439
14440
    __repr__ = __str__
14441
14442
14443
class EndpointUrlListDataType(FrozenClass):
14444
    '''
14445
    :ivar EndpointUrlList:
14446
    :vartype EndpointUrlList: String
14447
    '''
14448
14449
    ua_types = {
14450
        'EndpointUrlList': 'String',
14451
               }
14452
14453
    def __init__(self, binary=None):
14454
        if binary is not None:
14455
            self._binary_init(binary)
14456
            self._freeze = True
14457
            return
14458
        self.EndpointUrlList = []
14459
        self._freeze = True
14460
14461
    def to_binary(self):
14462
        packet = []
14463
        packet.append(uabin.Primitives.Int32.pack(len(self.EndpointUrlList)))
14464
        for fieldname in self.EndpointUrlList:
14465
            packet.append(uabin.Primitives.String.pack(fieldname))
14466
        return b''.join(packet)
14467
14468
    @staticmethod
14469
    def from_binary(data):
14470
        return EndpointUrlListDataType(data)
14471
14472
    def _binary_init(self, data):
14473
        self.EndpointUrlList = uabin.Primitives.String.unpack_array(data)
14474
14475
    def __str__(self):
14476
        return 'EndpointUrlListDataType(' + 'EndpointUrlList:' + str(self.EndpointUrlList) + ')'
14477
14478
    __repr__ = __str__
14479
14480
14481 View Code Duplication
class NetworkGroupDataType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
14482
    '''
14483
    :ivar ServerUri:
14484
    :vartype ServerUri: String
14485
    :ivar NetworkPaths:
14486
    :vartype NetworkPaths: EndpointUrlListDataType
14487
    '''
14488
14489
    ua_types = {
14490
        'ServerUri': 'String',
14491
        'NetworkPaths': 'EndpointUrlListDataType',
14492
               }
14493
14494
    def __init__(self, binary=None):
14495
        if binary is not None:
14496
            self._binary_init(binary)
14497
            self._freeze = True
14498
            return
14499
        self.ServerUri = None
14500
        self.NetworkPaths = []
14501
        self._freeze = True
14502
14503
    def to_binary(self):
14504
        packet = []
14505
        packet.append(uabin.Primitives.String.pack(self.ServerUri))
14506
        packet.append(uabin.Primitives.Int32.pack(len(self.NetworkPaths)))
14507
        for fieldname in self.NetworkPaths:
14508
            packet.append(fieldname.to_binary())
14509
        return b''.join(packet)
14510
14511
    @staticmethod
14512
    def from_binary(data):
14513
        return NetworkGroupDataType(data)
14514
14515
    def _binary_init(self, data):
14516
        self.ServerUri = uabin.Primitives.String.unpack(data)
14517
        length = uabin.Primitives.Int32.unpack(data)
14518
        array = []
14519
        if length != -1:
14520
            for _ in range(0, length):
14521
                array.append(EndpointUrlListDataType.from_binary(data))
14522
        self.NetworkPaths = array
14523
14524
    def __str__(self):
14525
        return 'NetworkGroupDataType(' + 'ServerUri:' + str(self.ServerUri) + ', ' + \
14526
               'NetworkPaths:' + str(self.NetworkPaths) + ')'
14527
14528
    __repr__ = __str__
14529
14530
14531 View Code Duplication
class SamplingIntervalDiagnosticsDataType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
14532
    '''
14533
    :ivar SamplingInterval:
14534
    :vartype SamplingInterval: Double
14535
    :ivar MonitoredItemCount:
14536
    :vartype MonitoredItemCount: UInt32
14537
    :ivar MaxMonitoredItemCount:
14538
    :vartype MaxMonitoredItemCount: UInt32
14539
    :ivar DisabledMonitoredItemCount:
14540
    :vartype DisabledMonitoredItemCount: UInt32
14541
    '''
14542
14543
    ua_types = {
14544
        'SamplingInterval': 'Double',
14545
        'MonitoredItemCount': 'UInt32',
14546
        'MaxMonitoredItemCount': 'UInt32',
14547
        'DisabledMonitoredItemCount': 'UInt32',
14548
               }
14549
14550
    def __init__(self, binary=None):
14551
        if binary is not None:
14552
            self._binary_init(binary)
14553
            self._freeze = True
14554
            return
14555
        self.SamplingInterval = 0
14556
        self.MonitoredItemCount = 0
14557
        self.MaxMonitoredItemCount = 0
14558
        self.DisabledMonitoredItemCount = 0
14559
        self._freeze = True
14560
14561
    def to_binary(self):
14562
        packet = []
14563
        packet.append(uabin.Primitives.Double.pack(self.SamplingInterval))
14564
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoredItemCount))
14565
        packet.append(uabin.Primitives.UInt32.pack(self.MaxMonitoredItemCount))
14566
        packet.append(uabin.Primitives.UInt32.pack(self.DisabledMonitoredItemCount))
14567
        return b''.join(packet)
14568
14569
    @staticmethod
14570
    def from_binary(data):
14571
        return SamplingIntervalDiagnosticsDataType(data)
14572
14573
    def _binary_init(self, data):
14574
        self.SamplingInterval = uabin.Primitives.Double.unpack(data)
14575
        self.MonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
14576
        self.MaxMonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
14577
        self.DisabledMonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
14578
14579
    def __str__(self):
14580
        return 'SamplingIntervalDiagnosticsDataType(' + 'SamplingInterval:' + str(self.SamplingInterval) + ', ' + \
14581
               'MonitoredItemCount:' + str(self.MonitoredItemCount) + ', ' + \
14582
               'MaxMonitoredItemCount:' + str(self.MaxMonitoredItemCount) + ', ' + \
14583
               'DisabledMonitoredItemCount:' + str(self.DisabledMonitoredItemCount) + ')'
14584
14585
    __repr__ = __str__
14586
14587
14588
class ServerDiagnosticsSummaryDataType(FrozenClass):
14589
    '''
14590
    :ivar ServerViewCount:
14591
    :vartype ServerViewCount: UInt32
14592
    :ivar CurrentSessionCount:
14593
    :vartype CurrentSessionCount: UInt32
14594
    :ivar CumulatedSessionCount:
14595
    :vartype CumulatedSessionCount: UInt32
14596
    :ivar SecurityRejectedSessionCount:
14597
    :vartype SecurityRejectedSessionCount: UInt32
14598
    :ivar RejectedSessionCount:
14599
    :vartype RejectedSessionCount: UInt32
14600
    :ivar SessionTimeoutCount:
14601
    :vartype SessionTimeoutCount: UInt32
14602
    :ivar SessionAbortCount:
14603
    :vartype SessionAbortCount: UInt32
14604
    :ivar CurrentSubscriptionCount:
14605
    :vartype CurrentSubscriptionCount: UInt32
14606
    :ivar CumulatedSubscriptionCount:
14607
    :vartype CumulatedSubscriptionCount: UInt32
14608
    :ivar PublishingIntervalCount:
14609
    :vartype PublishingIntervalCount: UInt32
14610
    :ivar SecurityRejectedRequestsCount:
14611
    :vartype SecurityRejectedRequestsCount: UInt32
14612
    :ivar RejectedRequestsCount:
14613
    :vartype RejectedRequestsCount: UInt32
14614
    '''
14615
14616
    ua_types = {
14617
        'ServerViewCount': 'UInt32',
14618
        'CurrentSessionCount': 'UInt32',
14619
        'CumulatedSessionCount': 'UInt32',
14620
        'SecurityRejectedSessionCount': 'UInt32',
14621
        'RejectedSessionCount': 'UInt32',
14622
        'SessionTimeoutCount': 'UInt32',
14623
        'SessionAbortCount': 'UInt32',
14624
        'CurrentSubscriptionCount': 'UInt32',
14625
        'CumulatedSubscriptionCount': 'UInt32',
14626
        'PublishingIntervalCount': 'UInt32',
14627
        'SecurityRejectedRequestsCount': 'UInt32',
14628
        'RejectedRequestsCount': 'UInt32',
14629
               }
14630
14631
    def __init__(self, binary=None):
14632
        if binary is not None:
14633
            self._binary_init(binary)
14634
            self._freeze = True
14635
            return
14636
        self.ServerViewCount = 0
14637
        self.CurrentSessionCount = 0
14638
        self.CumulatedSessionCount = 0
14639
        self.SecurityRejectedSessionCount = 0
14640
        self.RejectedSessionCount = 0
14641
        self.SessionTimeoutCount = 0
14642
        self.SessionAbortCount = 0
14643
        self.CurrentSubscriptionCount = 0
14644
        self.CumulatedSubscriptionCount = 0
14645
        self.PublishingIntervalCount = 0
14646
        self.SecurityRejectedRequestsCount = 0
14647
        self.RejectedRequestsCount = 0
14648
        self._freeze = True
14649
14650
    def to_binary(self):
14651
        packet = []
14652
        packet.append(uabin.Primitives.UInt32.pack(self.ServerViewCount))
14653
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentSessionCount))
14654
        packet.append(uabin.Primitives.UInt32.pack(self.CumulatedSessionCount))
14655
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityRejectedSessionCount))
14656
        packet.append(uabin.Primitives.UInt32.pack(self.RejectedSessionCount))
14657
        packet.append(uabin.Primitives.UInt32.pack(self.SessionTimeoutCount))
14658
        packet.append(uabin.Primitives.UInt32.pack(self.SessionAbortCount))
14659
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentSubscriptionCount))
14660
        packet.append(uabin.Primitives.UInt32.pack(self.CumulatedSubscriptionCount))
14661
        packet.append(uabin.Primitives.UInt32.pack(self.PublishingIntervalCount))
14662
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityRejectedRequestsCount))
14663
        packet.append(uabin.Primitives.UInt32.pack(self.RejectedRequestsCount))
14664
        return b''.join(packet)
14665
14666
    @staticmethod
14667
    def from_binary(data):
14668
        return ServerDiagnosticsSummaryDataType(data)
14669
14670
    def _binary_init(self, data):
14671
        self.ServerViewCount = uabin.Primitives.UInt32.unpack(data)
14672
        self.CurrentSessionCount = uabin.Primitives.UInt32.unpack(data)
14673
        self.CumulatedSessionCount = uabin.Primitives.UInt32.unpack(data)
14674
        self.SecurityRejectedSessionCount = uabin.Primitives.UInt32.unpack(data)
14675
        self.RejectedSessionCount = uabin.Primitives.UInt32.unpack(data)
14676
        self.SessionTimeoutCount = uabin.Primitives.UInt32.unpack(data)
14677
        self.SessionAbortCount = uabin.Primitives.UInt32.unpack(data)
14678
        self.CurrentSubscriptionCount = uabin.Primitives.UInt32.unpack(data)
14679
        self.CumulatedSubscriptionCount = uabin.Primitives.UInt32.unpack(data)
14680
        self.PublishingIntervalCount = uabin.Primitives.UInt32.unpack(data)
14681
        self.SecurityRejectedRequestsCount = uabin.Primitives.UInt32.unpack(data)
14682
        self.RejectedRequestsCount = uabin.Primitives.UInt32.unpack(data)
14683
14684
    def __str__(self):
14685
        return 'ServerDiagnosticsSummaryDataType(' + 'ServerViewCount:' + str(self.ServerViewCount) + ', ' + \
14686
               'CurrentSessionCount:' + str(self.CurrentSessionCount) + ', ' + \
14687
               'CumulatedSessionCount:' + str(self.CumulatedSessionCount) + ', ' + \
14688
               'SecurityRejectedSessionCount:' + str(self.SecurityRejectedSessionCount) + ', ' + \
14689
               'RejectedSessionCount:' + str(self.RejectedSessionCount) + ', ' + \
14690
               'SessionTimeoutCount:' + str(self.SessionTimeoutCount) + ', ' + \
14691
               'SessionAbortCount:' + str(self.SessionAbortCount) + ', ' + \
14692
               'CurrentSubscriptionCount:' + str(self.CurrentSubscriptionCount) + ', ' + \
14693
               'CumulatedSubscriptionCount:' + str(self.CumulatedSubscriptionCount) + ', ' + \
14694
               'PublishingIntervalCount:' + str(self.PublishingIntervalCount) + ', ' + \
14695
               'SecurityRejectedRequestsCount:' + str(self.SecurityRejectedRequestsCount) + ', ' + \
14696
               'RejectedRequestsCount:' + str(self.RejectedRequestsCount) + ')'
14697
14698
    __repr__ = __str__
14699
14700
14701 View Code Duplication
class ServerStatusDataType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
14702
    '''
14703
    :ivar StartTime:
14704
    :vartype StartTime: DateTime
14705
    :ivar CurrentTime:
14706
    :vartype CurrentTime: DateTime
14707
    :ivar State:
14708
    :vartype State: ServerState
14709
    :ivar BuildInfo:
14710
    :vartype BuildInfo: BuildInfo
14711
    :ivar SecondsTillShutdown:
14712
    :vartype SecondsTillShutdown: UInt32
14713
    :ivar ShutdownReason:
14714
    :vartype ShutdownReason: LocalizedText
14715
    '''
14716
14717
    ua_types = {
14718
        'StartTime': 'DateTime',
14719
        'CurrentTime': 'DateTime',
14720
        'State': 'ServerState',
14721
        'BuildInfo': 'BuildInfo',
14722
        'SecondsTillShutdown': 'UInt32',
14723
        'ShutdownReason': 'LocalizedText',
14724
               }
14725
14726
    def __init__(self, binary=None):
14727
        if binary is not None:
14728
            self._binary_init(binary)
14729
            self._freeze = True
14730
            return
14731
        self.StartTime = datetime.now()
14732
        self.CurrentTime = datetime.now()
14733
        self.State = ServerState(0)
14734
        self.BuildInfo = BuildInfo()
14735
        self.SecondsTillShutdown = 0
14736
        self.ShutdownReason = LocalizedText()
14737
        self._freeze = True
14738
14739
    def to_binary(self):
14740
        packet = []
14741
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
14742
        packet.append(uabin.Primitives.DateTime.pack(self.CurrentTime))
14743
        packet.append(uabin.Primitives.UInt32.pack(self.State.value))
14744
        packet.append(self.BuildInfo.to_binary())
14745
        packet.append(uabin.Primitives.UInt32.pack(self.SecondsTillShutdown))
14746
        packet.append(self.ShutdownReason.to_binary())
14747
        return b''.join(packet)
14748
14749
    @staticmethod
14750
    def from_binary(data):
14751
        return ServerStatusDataType(data)
14752
14753
    def _binary_init(self, data):
14754
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
14755
        self.CurrentTime = uabin.Primitives.DateTime.unpack(data)
14756
        self.State = ServerState(uabin.Primitives.UInt32.unpack(data))
14757
        self.BuildInfo = BuildInfo.from_binary(data)
14758
        self.SecondsTillShutdown = uabin.Primitives.UInt32.unpack(data)
14759
        self.ShutdownReason = LocalizedText.from_binary(data)
14760
14761
    def __str__(self):
14762
        return 'ServerStatusDataType(' + 'StartTime:' + str(self.StartTime) + ', ' + \
14763
               'CurrentTime:' + str(self.CurrentTime) + ', ' + \
14764
               'State:' + str(self.State) + ', ' + \
14765
               'BuildInfo:' + str(self.BuildInfo) + ', ' + \
14766
               'SecondsTillShutdown:' + str(self.SecondsTillShutdown) + ', ' + \
14767
               'ShutdownReason:' + str(self.ShutdownReason) + ')'
14768
14769
    __repr__ = __str__
14770
14771
14772
class SessionDiagnosticsDataType(FrozenClass):
14773
    '''
14774
    :ivar SessionId:
14775
    :vartype SessionId: NodeId
14776
    :ivar SessionName:
14777
    :vartype SessionName: String
14778
    :ivar ClientDescription:
14779
    :vartype ClientDescription: ApplicationDescription
14780
    :ivar ServerUri:
14781
    :vartype ServerUri: String
14782
    :ivar EndpointUrl:
14783
    :vartype EndpointUrl: String
14784
    :ivar LocaleIds:
14785
    :vartype LocaleIds: String
14786
    :ivar ActualSessionTimeout:
14787
    :vartype ActualSessionTimeout: Double
14788
    :ivar MaxResponseMessageSize:
14789
    :vartype MaxResponseMessageSize: UInt32
14790
    :ivar ClientConnectionTime:
14791
    :vartype ClientConnectionTime: DateTime
14792
    :ivar ClientLastContactTime:
14793
    :vartype ClientLastContactTime: DateTime
14794
    :ivar CurrentSubscriptionsCount:
14795
    :vartype CurrentSubscriptionsCount: UInt32
14796
    :ivar CurrentMonitoredItemsCount:
14797
    :vartype CurrentMonitoredItemsCount: UInt32
14798
    :ivar CurrentPublishRequestsInQueue:
14799
    :vartype CurrentPublishRequestsInQueue: UInt32
14800
    :ivar TotalRequestCount:
14801
    :vartype TotalRequestCount: ServiceCounterDataType
14802
    :ivar UnauthorizedRequestCount:
14803
    :vartype UnauthorizedRequestCount: UInt32
14804
    :ivar ReadCount:
14805
    :vartype ReadCount: ServiceCounterDataType
14806
    :ivar HistoryReadCount:
14807
    :vartype HistoryReadCount: ServiceCounterDataType
14808
    :ivar WriteCount:
14809
    :vartype WriteCount: ServiceCounterDataType
14810
    :ivar HistoryUpdateCount:
14811
    :vartype HistoryUpdateCount: ServiceCounterDataType
14812
    :ivar CallCount:
14813
    :vartype CallCount: ServiceCounterDataType
14814
    :ivar CreateMonitoredItemsCount:
14815
    :vartype CreateMonitoredItemsCount: ServiceCounterDataType
14816
    :ivar ModifyMonitoredItemsCount:
14817
    :vartype ModifyMonitoredItemsCount: ServiceCounterDataType
14818
    :ivar SetMonitoringModeCount:
14819
    :vartype SetMonitoringModeCount: ServiceCounterDataType
14820
    :ivar SetTriggeringCount:
14821
    :vartype SetTriggeringCount: ServiceCounterDataType
14822
    :ivar DeleteMonitoredItemsCount:
14823
    :vartype DeleteMonitoredItemsCount: ServiceCounterDataType
14824
    :ivar CreateSubscriptionCount:
14825
    :vartype CreateSubscriptionCount: ServiceCounterDataType
14826
    :ivar ModifySubscriptionCount:
14827
    :vartype ModifySubscriptionCount: ServiceCounterDataType
14828
    :ivar SetPublishingModeCount:
14829
    :vartype SetPublishingModeCount: ServiceCounterDataType
14830
    :ivar PublishCount:
14831
    :vartype PublishCount: ServiceCounterDataType
14832
    :ivar RepublishCount:
14833
    :vartype RepublishCount: ServiceCounterDataType
14834
    :ivar TransferSubscriptionsCount:
14835
    :vartype TransferSubscriptionsCount: ServiceCounterDataType
14836
    :ivar DeleteSubscriptionsCount:
14837
    :vartype DeleteSubscriptionsCount: ServiceCounterDataType
14838
    :ivar AddNodesCount:
14839
    :vartype AddNodesCount: ServiceCounterDataType
14840
    :ivar AddReferencesCount:
14841
    :vartype AddReferencesCount: ServiceCounterDataType
14842
    :ivar DeleteNodesCount:
14843
    :vartype DeleteNodesCount: ServiceCounterDataType
14844
    :ivar DeleteReferencesCount:
14845
    :vartype DeleteReferencesCount: ServiceCounterDataType
14846
    :ivar BrowseCount:
14847
    :vartype BrowseCount: ServiceCounterDataType
14848
    :ivar BrowseNextCount:
14849
    :vartype BrowseNextCount: ServiceCounterDataType
14850
    :ivar TranslateBrowsePathsToNodeIdsCount:
14851
    :vartype TranslateBrowsePathsToNodeIdsCount: ServiceCounterDataType
14852
    :ivar QueryFirstCount:
14853
    :vartype QueryFirstCount: ServiceCounterDataType
14854
    :ivar QueryNextCount:
14855
    :vartype QueryNextCount: ServiceCounterDataType
14856
    :ivar RegisterNodesCount:
14857
    :vartype RegisterNodesCount: ServiceCounterDataType
14858
    :ivar UnregisterNodesCount:
14859
    :vartype UnregisterNodesCount: ServiceCounterDataType
14860
    '''
14861
14862
    ua_types = {
14863
        'SessionId': 'NodeId',
14864
        'SessionName': 'String',
14865
        'ClientDescription': 'ApplicationDescription',
14866
        'ServerUri': 'String',
14867
        'EndpointUrl': 'String',
14868
        'LocaleIds': 'String',
14869
        'ActualSessionTimeout': 'Double',
14870
        'MaxResponseMessageSize': 'UInt32',
14871
        'ClientConnectionTime': 'DateTime',
14872
        'ClientLastContactTime': 'DateTime',
14873
        'CurrentSubscriptionsCount': 'UInt32',
14874
        'CurrentMonitoredItemsCount': 'UInt32',
14875
        'CurrentPublishRequestsInQueue': 'UInt32',
14876
        'TotalRequestCount': 'ServiceCounterDataType',
14877
        'UnauthorizedRequestCount': 'UInt32',
14878
        'ReadCount': 'ServiceCounterDataType',
14879
        'HistoryReadCount': 'ServiceCounterDataType',
14880
        'WriteCount': 'ServiceCounterDataType',
14881
        'HistoryUpdateCount': 'ServiceCounterDataType',
14882
        'CallCount': 'ServiceCounterDataType',
14883
        'CreateMonitoredItemsCount': 'ServiceCounterDataType',
14884
        'ModifyMonitoredItemsCount': 'ServiceCounterDataType',
14885
        'SetMonitoringModeCount': 'ServiceCounterDataType',
14886
        'SetTriggeringCount': 'ServiceCounterDataType',
14887
        'DeleteMonitoredItemsCount': 'ServiceCounterDataType',
14888
        'CreateSubscriptionCount': 'ServiceCounterDataType',
14889
        'ModifySubscriptionCount': 'ServiceCounterDataType',
14890
        'SetPublishingModeCount': 'ServiceCounterDataType',
14891
        'PublishCount': 'ServiceCounterDataType',
14892
        'RepublishCount': 'ServiceCounterDataType',
14893
        'TransferSubscriptionsCount': 'ServiceCounterDataType',
14894
        'DeleteSubscriptionsCount': 'ServiceCounterDataType',
14895
        'AddNodesCount': 'ServiceCounterDataType',
14896
        'AddReferencesCount': 'ServiceCounterDataType',
14897
        'DeleteNodesCount': 'ServiceCounterDataType',
14898
        'DeleteReferencesCount': 'ServiceCounterDataType',
14899
        'BrowseCount': 'ServiceCounterDataType',
14900
        'BrowseNextCount': 'ServiceCounterDataType',
14901
        'TranslateBrowsePathsToNodeIdsCount': 'ServiceCounterDataType',
14902
        'QueryFirstCount': 'ServiceCounterDataType',
14903
        'QueryNextCount': 'ServiceCounterDataType',
14904
        'RegisterNodesCount': 'ServiceCounterDataType',
14905
        'UnregisterNodesCount': 'ServiceCounterDataType',
14906
               }
14907
14908
    def __init__(self, binary=None):
14909
        if binary is not None:
14910
            self._binary_init(binary)
14911
            self._freeze = True
14912
            return
14913
        self.SessionId = NodeId()
14914
        self.SessionName = None
14915
        self.ClientDescription = ApplicationDescription()
14916
        self.ServerUri = None
14917
        self.EndpointUrl = None
14918
        self.LocaleIds = []
14919
        self.ActualSessionTimeout = 0
14920
        self.MaxResponseMessageSize = 0
14921
        self.ClientConnectionTime = datetime.now()
14922
        self.ClientLastContactTime = datetime.now()
14923
        self.CurrentSubscriptionsCount = 0
14924
        self.CurrentMonitoredItemsCount = 0
14925
        self.CurrentPublishRequestsInQueue = 0
14926
        self.TotalRequestCount = ServiceCounterDataType()
14927
        self.UnauthorizedRequestCount = 0
14928
        self.ReadCount = ServiceCounterDataType()
14929
        self.HistoryReadCount = ServiceCounterDataType()
14930
        self.WriteCount = ServiceCounterDataType()
14931
        self.HistoryUpdateCount = ServiceCounterDataType()
14932
        self.CallCount = ServiceCounterDataType()
14933
        self.CreateMonitoredItemsCount = ServiceCounterDataType()
14934
        self.ModifyMonitoredItemsCount = ServiceCounterDataType()
14935
        self.SetMonitoringModeCount = ServiceCounterDataType()
14936
        self.SetTriggeringCount = ServiceCounterDataType()
14937
        self.DeleteMonitoredItemsCount = ServiceCounterDataType()
14938
        self.CreateSubscriptionCount = ServiceCounterDataType()
14939
        self.ModifySubscriptionCount = ServiceCounterDataType()
14940
        self.SetPublishingModeCount = ServiceCounterDataType()
14941
        self.PublishCount = ServiceCounterDataType()
14942
        self.RepublishCount = ServiceCounterDataType()
14943
        self.TransferSubscriptionsCount = ServiceCounterDataType()
14944
        self.DeleteSubscriptionsCount = ServiceCounterDataType()
14945
        self.AddNodesCount = ServiceCounterDataType()
14946
        self.AddReferencesCount = ServiceCounterDataType()
14947
        self.DeleteNodesCount = ServiceCounterDataType()
14948
        self.DeleteReferencesCount = ServiceCounterDataType()
14949
        self.BrowseCount = ServiceCounterDataType()
14950
        self.BrowseNextCount = ServiceCounterDataType()
14951
        self.TranslateBrowsePathsToNodeIdsCount = ServiceCounterDataType()
14952
        self.QueryFirstCount = ServiceCounterDataType()
14953
        self.QueryNextCount = ServiceCounterDataType()
14954
        self.RegisterNodesCount = ServiceCounterDataType()
14955
        self.UnregisterNodesCount = ServiceCounterDataType()
14956
        self._freeze = True
14957
14958
    def to_binary(self):
14959
        packet = []
14960
        packet.append(self.SessionId.to_binary())
14961
        packet.append(uabin.Primitives.String.pack(self.SessionName))
14962
        packet.append(self.ClientDescription.to_binary())
14963
        packet.append(uabin.Primitives.String.pack(self.ServerUri))
14964
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
14965
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
14966
        for fieldname in self.LocaleIds:
14967
            packet.append(uabin.Primitives.String.pack(fieldname))
14968
        packet.append(uabin.Primitives.Double.pack(self.ActualSessionTimeout))
14969
        packet.append(uabin.Primitives.UInt32.pack(self.MaxResponseMessageSize))
14970
        packet.append(uabin.Primitives.DateTime.pack(self.ClientConnectionTime))
14971
        packet.append(uabin.Primitives.DateTime.pack(self.ClientLastContactTime))
14972
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentSubscriptionsCount))
14973
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentMonitoredItemsCount))
14974
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentPublishRequestsInQueue))
14975
        packet.append(self.TotalRequestCount.to_binary())
14976
        packet.append(uabin.Primitives.UInt32.pack(self.UnauthorizedRequestCount))
14977
        packet.append(self.ReadCount.to_binary())
14978
        packet.append(self.HistoryReadCount.to_binary())
14979
        packet.append(self.WriteCount.to_binary())
14980
        packet.append(self.HistoryUpdateCount.to_binary())
14981
        packet.append(self.CallCount.to_binary())
14982
        packet.append(self.CreateMonitoredItemsCount.to_binary())
14983
        packet.append(self.ModifyMonitoredItemsCount.to_binary())
14984
        packet.append(self.SetMonitoringModeCount.to_binary())
14985
        packet.append(self.SetTriggeringCount.to_binary())
14986
        packet.append(self.DeleteMonitoredItemsCount.to_binary())
14987
        packet.append(self.CreateSubscriptionCount.to_binary())
14988
        packet.append(self.ModifySubscriptionCount.to_binary())
14989
        packet.append(self.SetPublishingModeCount.to_binary())
14990
        packet.append(self.PublishCount.to_binary())
14991
        packet.append(self.RepublishCount.to_binary())
14992
        packet.append(self.TransferSubscriptionsCount.to_binary())
14993
        packet.append(self.DeleteSubscriptionsCount.to_binary())
14994
        packet.append(self.AddNodesCount.to_binary())
14995
        packet.append(self.AddReferencesCount.to_binary())
14996
        packet.append(self.DeleteNodesCount.to_binary())
14997
        packet.append(self.DeleteReferencesCount.to_binary())
14998
        packet.append(self.BrowseCount.to_binary())
14999
        packet.append(self.BrowseNextCount.to_binary())
15000
        packet.append(self.TranslateBrowsePathsToNodeIdsCount.to_binary())
15001
        packet.append(self.QueryFirstCount.to_binary())
15002
        packet.append(self.QueryNextCount.to_binary())
15003
        packet.append(self.RegisterNodesCount.to_binary())
15004
        packet.append(self.UnregisterNodesCount.to_binary())
15005
        return b''.join(packet)
15006
15007
    @staticmethod
15008
    def from_binary(data):
15009
        return SessionDiagnosticsDataType(data)
15010
15011
    def _binary_init(self, data):
15012
        self.SessionId = NodeId.from_binary(data)
15013
        self.SessionName = uabin.Primitives.String.unpack(data)
15014
        self.ClientDescription = ApplicationDescription.from_binary(data)
15015
        self.ServerUri = uabin.Primitives.String.unpack(data)
15016
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
15017
        self.LocaleIds = uabin.Primitives.String.unpack_array(data)
15018
        self.ActualSessionTimeout = uabin.Primitives.Double.unpack(data)
15019
        self.MaxResponseMessageSize = uabin.Primitives.UInt32.unpack(data)
15020
        self.ClientConnectionTime = uabin.Primitives.DateTime.unpack(data)
15021
        self.ClientLastContactTime = uabin.Primitives.DateTime.unpack(data)
15022
        self.CurrentSubscriptionsCount = uabin.Primitives.UInt32.unpack(data)
15023
        self.CurrentMonitoredItemsCount = uabin.Primitives.UInt32.unpack(data)
15024
        self.CurrentPublishRequestsInQueue = uabin.Primitives.UInt32.unpack(data)
15025
        self.TotalRequestCount = ServiceCounterDataType.from_binary(data)
15026
        self.UnauthorizedRequestCount = uabin.Primitives.UInt32.unpack(data)
15027
        self.ReadCount = ServiceCounterDataType.from_binary(data)
15028
        self.HistoryReadCount = ServiceCounterDataType.from_binary(data)
15029
        self.WriteCount = ServiceCounterDataType.from_binary(data)
15030
        self.HistoryUpdateCount = ServiceCounterDataType.from_binary(data)
15031
        self.CallCount = ServiceCounterDataType.from_binary(data)
15032
        self.CreateMonitoredItemsCount = ServiceCounterDataType.from_binary(data)
15033
        self.ModifyMonitoredItemsCount = ServiceCounterDataType.from_binary(data)
15034
        self.SetMonitoringModeCount = ServiceCounterDataType.from_binary(data)
15035
        self.SetTriggeringCount = ServiceCounterDataType.from_binary(data)
15036
        self.DeleteMonitoredItemsCount = ServiceCounterDataType.from_binary(data)
15037
        self.CreateSubscriptionCount = ServiceCounterDataType.from_binary(data)
15038
        self.ModifySubscriptionCount = ServiceCounterDataType.from_binary(data)
15039
        self.SetPublishingModeCount = ServiceCounterDataType.from_binary(data)
15040
        self.PublishCount = ServiceCounterDataType.from_binary(data)
15041
        self.RepublishCount = ServiceCounterDataType.from_binary(data)
15042
        self.TransferSubscriptionsCount = ServiceCounterDataType.from_binary(data)
15043
        self.DeleteSubscriptionsCount = ServiceCounterDataType.from_binary(data)
15044
        self.AddNodesCount = ServiceCounterDataType.from_binary(data)
15045
        self.AddReferencesCount = ServiceCounterDataType.from_binary(data)
15046
        self.DeleteNodesCount = ServiceCounterDataType.from_binary(data)
15047
        self.DeleteReferencesCount = ServiceCounterDataType.from_binary(data)
15048
        self.BrowseCount = ServiceCounterDataType.from_binary(data)
15049
        self.BrowseNextCount = ServiceCounterDataType.from_binary(data)
15050
        self.TranslateBrowsePathsToNodeIdsCount = ServiceCounterDataType.from_binary(data)
15051
        self.QueryFirstCount = ServiceCounterDataType.from_binary(data)
15052
        self.QueryNextCount = ServiceCounterDataType.from_binary(data)
15053
        self.RegisterNodesCount = ServiceCounterDataType.from_binary(data)
15054
        self.UnregisterNodesCount = ServiceCounterDataType.from_binary(data)
15055
15056
    def __str__(self):
15057
        return 'SessionDiagnosticsDataType(' + 'SessionId:' + str(self.SessionId) + ', ' + \
15058
               'SessionName:' + str(self.SessionName) + ', ' + \
15059
               'ClientDescription:' + str(self.ClientDescription) + ', ' + \
15060
               'ServerUri:' + str(self.ServerUri) + ', ' + \
15061
               'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
15062
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
15063
               'ActualSessionTimeout:' + str(self.ActualSessionTimeout) + ', ' + \
15064
               'MaxResponseMessageSize:' + str(self.MaxResponseMessageSize) + ', ' + \
15065
               'ClientConnectionTime:' + str(self.ClientConnectionTime) + ', ' + \
15066
               'ClientLastContactTime:' + str(self.ClientLastContactTime) + ', ' + \
15067
               'CurrentSubscriptionsCount:' + str(self.CurrentSubscriptionsCount) + ', ' + \
15068
               'CurrentMonitoredItemsCount:' + str(self.CurrentMonitoredItemsCount) + ', ' + \
15069
               'CurrentPublishRequestsInQueue:' + str(self.CurrentPublishRequestsInQueue) + ', ' + \
15070
               'TotalRequestCount:' + str(self.TotalRequestCount) + ', ' + \
15071
               'UnauthorizedRequestCount:' + str(self.UnauthorizedRequestCount) + ', ' + \
15072
               'ReadCount:' + str(self.ReadCount) + ', ' + \
15073
               'HistoryReadCount:' + str(self.HistoryReadCount) + ', ' + \
15074
               'WriteCount:' + str(self.WriteCount) + ', ' + \
15075
               'HistoryUpdateCount:' + str(self.HistoryUpdateCount) + ', ' + \
15076
               'CallCount:' + str(self.CallCount) + ', ' + \
15077
               'CreateMonitoredItemsCount:' + str(self.CreateMonitoredItemsCount) + ', ' + \
15078
               'ModifyMonitoredItemsCount:' + str(self.ModifyMonitoredItemsCount) + ', ' + \
15079
               'SetMonitoringModeCount:' + str(self.SetMonitoringModeCount) + ', ' + \
15080
               'SetTriggeringCount:' + str(self.SetTriggeringCount) + ', ' + \
15081
               'DeleteMonitoredItemsCount:' + str(self.DeleteMonitoredItemsCount) + ', ' + \
15082
               'CreateSubscriptionCount:' + str(self.CreateSubscriptionCount) + ', ' + \
15083
               'ModifySubscriptionCount:' + str(self.ModifySubscriptionCount) + ', ' + \
15084
               'SetPublishingModeCount:' + str(self.SetPublishingModeCount) + ', ' + \
15085
               'PublishCount:' + str(self.PublishCount) + ', ' + \
15086
               'RepublishCount:' + str(self.RepublishCount) + ', ' + \
15087
               'TransferSubscriptionsCount:' + str(self.TransferSubscriptionsCount) + ', ' + \
15088
               'DeleteSubscriptionsCount:' + str(self.DeleteSubscriptionsCount) + ', ' + \
15089
               'AddNodesCount:' + str(self.AddNodesCount) + ', ' + \
15090
               'AddReferencesCount:' + str(self.AddReferencesCount) + ', ' + \
15091
               'DeleteNodesCount:' + str(self.DeleteNodesCount) + ', ' + \
15092
               'DeleteReferencesCount:' + str(self.DeleteReferencesCount) + ', ' + \
15093
               'BrowseCount:' + str(self.BrowseCount) + ', ' + \
15094
               'BrowseNextCount:' + str(self.BrowseNextCount) + ', ' + \
15095
               'TranslateBrowsePathsToNodeIdsCount:' + str(self.TranslateBrowsePathsToNodeIdsCount) + ', ' + \
15096
               'QueryFirstCount:' + str(self.QueryFirstCount) + ', ' + \
15097
               'QueryNextCount:' + str(self.QueryNextCount) + ', ' + \
15098
               'RegisterNodesCount:' + str(self.RegisterNodesCount) + ', ' + \
15099
               'UnregisterNodesCount:' + str(self.UnregisterNodesCount) + ')'
15100
15101
    __repr__ = __str__
15102
15103
15104
class SessionSecurityDiagnosticsDataType(FrozenClass):
15105
    '''
15106
    :ivar SessionId:
15107
    :vartype SessionId: NodeId
15108
    :ivar ClientUserIdOfSession:
15109
    :vartype ClientUserIdOfSession: String
15110
    :ivar ClientUserIdHistory:
15111
    :vartype ClientUserIdHistory: String
15112
    :ivar AuthenticationMechanism:
15113
    :vartype AuthenticationMechanism: String
15114
    :ivar Encoding:
15115
    :vartype Encoding: String
15116
    :ivar TransportProtocol:
15117
    :vartype TransportProtocol: String
15118
    :ivar SecurityMode:
15119
    :vartype SecurityMode: MessageSecurityMode
15120
    :ivar SecurityPolicyUri:
15121
    :vartype SecurityPolicyUri: String
15122
    :ivar ClientCertificate:
15123
    :vartype ClientCertificate: ByteString
15124
    '''
15125
15126
    ua_types = {
15127
        'SessionId': 'NodeId',
15128
        'ClientUserIdOfSession': 'String',
15129
        'ClientUserIdHistory': 'String',
15130
        'AuthenticationMechanism': 'String',
15131
        'Encoding': 'String',
15132
        'TransportProtocol': 'String',
15133
        'SecurityMode': 'MessageSecurityMode',
15134
        'SecurityPolicyUri': 'String',
15135
        'ClientCertificate': 'ByteString',
15136
               }
15137
15138
    def __init__(self, binary=None):
15139
        if binary is not None:
15140
            self._binary_init(binary)
15141
            self._freeze = True
15142
            return
15143
        self.SessionId = NodeId()
15144
        self.ClientUserIdOfSession = None
15145
        self.ClientUserIdHistory = []
15146
        self.AuthenticationMechanism = None
15147
        self.Encoding = None
15148
        self.TransportProtocol = None
15149
        self.SecurityMode = MessageSecurityMode(0)
15150
        self.SecurityPolicyUri = None
15151
        self.ClientCertificate = None
15152
        self._freeze = True
15153
15154 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15155
        packet = []
15156
        packet.append(self.SessionId.to_binary())
15157
        packet.append(uabin.Primitives.String.pack(self.ClientUserIdOfSession))
15158
        packet.append(uabin.Primitives.Int32.pack(len(self.ClientUserIdHistory)))
15159
        for fieldname in self.ClientUserIdHistory:
15160
            packet.append(uabin.Primitives.String.pack(fieldname))
15161
        packet.append(uabin.Primitives.String.pack(self.AuthenticationMechanism))
15162
        packet.append(uabin.Primitives.String.pack(self.Encoding))
15163
        packet.append(uabin.Primitives.String.pack(self.TransportProtocol))
15164
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityMode.value))
15165
        packet.append(uabin.Primitives.String.pack(self.SecurityPolicyUri))
15166
        packet.append(uabin.Primitives.ByteString.pack(self.ClientCertificate))
15167
        return b''.join(packet)
15168
15169
    @staticmethod
15170
    def from_binary(data):
15171
        return SessionSecurityDiagnosticsDataType(data)
15172
15173
    def _binary_init(self, data):
15174
        self.SessionId = NodeId.from_binary(data)
15175
        self.ClientUserIdOfSession = uabin.Primitives.String.unpack(data)
15176
        self.ClientUserIdHistory = uabin.Primitives.String.unpack_array(data)
15177
        self.AuthenticationMechanism = uabin.Primitives.String.unpack(data)
15178
        self.Encoding = uabin.Primitives.String.unpack(data)
15179
        self.TransportProtocol = uabin.Primitives.String.unpack(data)
15180
        self.SecurityMode = MessageSecurityMode(uabin.Primitives.UInt32.unpack(data))
15181
        self.SecurityPolicyUri = uabin.Primitives.String.unpack(data)
15182
        self.ClientCertificate = uabin.Primitives.ByteString.unpack(data)
15183
15184
    def __str__(self):
15185
        return 'SessionSecurityDiagnosticsDataType(' + 'SessionId:' + str(self.SessionId) + ', ' + \
15186
               'ClientUserIdOfSession:' + str(self.ClientUserIdOfSession) + ', ' + \
15187
               'ClientUserIdHistory:' + str(self.ClientUserIdHistory) + ', ' + \
15188
               'AuthenticationMechanism:' + str(self.AuthenticationMechanism) + ', ' + \
15189
               'Encoding:' + str(self.Encoding) + ', ' + \
15190
               'TransportProtocol:' + str(self.TransportProtocol) + ', ' + \
15191
               'SecurityMode:' + str(self.SecurityMode) + ', ' + \
15192
               'SecurityPolicyUri:' + str(self.SecurityPolicyUri) + ', ' + \
15193
               'ClientCertificate:' + str(self.ClientCertificate) + ')'
15194
15195
    __repr__ = __str__
15196
15197
15198 View Code Duplication
class ServiceCounterDataType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15199
    '''
15200
    :ivar TotalCount:
15201
    :vartype TotalCount: UInt32
15202
    :ivar ErrorCount:
15203
    :vartype ErrorCount: UInt32
15204
    '''
15205
15206
    ua_types = {
15207
        'TotalCount': 'UInt32',
15208
        'ErrorCount': 'UInt32',
15209
               }
15210
15211
    def __init__(self, binary=None):
15212
        if binary is not None:
15213
            self._binary_init(binary)
15214
            self._freeze = True
15215
            return
15216
        self.TotalCount = 0
15217
        self.ErrorCount = 0
15218
        self._freeze = True
15219
15220
    def to_binary(self):
15221
        packet = []
15222
        packet.append(uabin.Primitives.UInt32.pack(self.TotalCount))
15223
        packet.append(uabin.Primitives.UInt32.pack(self.ErrorCount))
15224
        return b''.join(packet)
15225
15226
    @staticmethod
15227
    def from_binary(data):
15228
        return ServiceCounterDataType(data)
15229
15230
    def _binary_init(self, data):
15231
        self.TotalCount = uabin.Primitives.UInt32.unpack(data)
15232
        self.ErrorCount = uabin.Primitives.UInt32.unpack(data)
15233
15234
    def __str__(self):
15235
        return 'ServiceCounterDataType(' + 'TotalCount:' + str(self.TotalCount) + ', ' + \
15236
               'ErrorCount:' + str(self.ErrorCount) + ')'
15237
15238
    __repr__ = __str__
15239
15240
15241 View Code Duplication
class StatusResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15242
    '''
15243
    :ivar StatusCode:
15244
    :vartype StatusCode: StatusCode
15245
    :ivar DiagnosticInfo:
15246
    :vartype DiagnosticInfo: DiagnosticInfo
15247
    '''
15248
15249
    ua_types = {
15250
        'StatusCode': 'StatusCode',
15251
        'DiagnosticInfo': 'DiagnosticInfo',
15252
               }
15253
15254
    def __init__(self, binary=None):
15255
        if binary is not None:
15256
            self._binary_init(binary)
15257
            self._freeze = True
15258
            return
15259
        self.StatusCode = StatusCode()
15260
        self.DiagnosticInfo = DiagnosticInfo()
15261
        self._freeze = True
15262
15263
    def to_binary(self):
15264
        packet = []
15265
        packet.append(self.StatusCode.to_binary())
15266
        packet.append(self.DiagnosticInfo.to_binary())
15267
        return b''.join(packet)
15268
15269
    @staticmethod
15270
    def from_binary(data):
15271
        return StatusResult(data)
15272
15273
    def _binary_init(self, data):
15274
        self.StatusCode = StatusCode.from_binary(data)
15275
        self.DiagnosticInfo = DiagnosticInfo.from_binary(data)
15276
15277
    def __str__(self):
15278
        return 'StatusResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
15279
               'DiagnosticInfo:' + str(self.DiagnosticInfo) + ')'
15280
15281
    __repr__ = __str__
15282
15283
15284
class SubscriptionDiagnosticsDataType(FrozenClass):
15285
    '''
15286
    :ivar SessionId:
15287
    :vartype SessionId: NodeId
15288
    :ivar SubscriptionId:
15289
    :vartype SubscriptionId: UInt32
15290
    :ivar Priority:
15291
    :vartype Priority: Byte
15292
    :ivar PublishingInterval:
15293
    :vartype PublishingInterval: Double
15294
    :ivar MaxKeepAliveCount:
15295
    :vartype MaxKeepAliveCount: UInt32
15296
    :ivar MaxLifetimeCount:
15297
    :vartype MaxLifetimeCount: UInt32
15298
    :ivar MaxNotificationsPerPublish:
15299
    :vartype MaxNotificationsPerPublish: UInt32
15300
    :ivar PublishingEnabled:
15301
    :vartype PublishingEnabled: Boolean
15302
    :ivar ModifyCount:
15303
    :vartype ModifyCount: UInt32
15304
    :ivar EnableCount:
15305
    :vartype EnableCount: UInt32
15306
    :ivar DisableCount:
15307
    :vartype DisableCount: UInt32
15308
    :ivar RepublishRequestCount:
15309
    :vartype RepublishRequestCount: UInt32
15310
    :ivar RepublishMessageRequestCount:
15311
    :vartype RepublishMessageRequestCount: UInt32
15312
    :ivar RepublishMessageCount:
15313
    :vartype RepublishMessageCount: UInt32
15314
    :ivar TransferRequestCount:
15315
    :vartype TransferRequestCount: UInt32
15316
    :ivar TransferredToAltClientCount:
15317
    :vartype TransferredToAltClientCount: UInt32
15318
    :ivar TransferredToSameClientCount:
15319
    :vartype TransferredToSameClientCount: UInt32
15320
    :ivar PublishRequestCount:
15321
    :vartype PublishRequestCount: UInt32
15322
    :ivar DataChangeNotificationsCount:
15323
    :vartype DataChangeNotificationsCount: UInt32
15324
    :ivar EventNotificationsCount:
15325
    :vartype EventNotificationsCount: UInt32
15326
    :ivar NotificationsCount:
15327
    :vartype NotificationsCount: UInt32
15328
    :ivar LatePublishRequestCount:
15329
    :vartype LatePublishRequestCount: UInt32
15330
    :ivar CurrentKeepAliveCount:
15331
    :vartype CurrentKeepAliveCount: UInt32
15332
    :ivar CurrentLifetimeCount:
15333
    :vartype CurrentLifetimeCount: UInt32
15334
    :ivar UnacknowledgedMessageCount:
15335
    :vartype UnacknowledgedMessageCount: UInt32
15336
    :ivar DiscardedMessageCount:
15337
    :vartype DiscardedMessageCount: UInt32
15338
    :ivar MonitoredItemCount:
15339
    :vartype MonitoredItemCount: UInt32
15340
    :ivar DisabledMonitoredItemCount:
15341
    :vartype DisabledMonitoredItemCount: UInt32
15342
    :ivar MonitoringQueueOverflowCount:
15343
    :vartype MonitoringQueueOverflowCount: UInt32
15344
    :ivar NextSequenceNumber:
15345
    :vartype NextSequenceNumber: UInt32
15346
    :ivar EventQueueOverFlowCount:
15347
    :vartype EventQueueOverFlowCount: UInt32
15348
    '''
15349
15350
    ua_types = {
15351
        'SessionId': 'NodeId',
15352
        'SubscriptionId': 'UInt32',
15353
        'Priority': 'Byte',
15354
        'PublishingInterval': 'Double',
15355
        'MaxKeepAliveCount': 'UInt32',
15356
        'MaxLifetimeCount': 'UInt32',
15357
        'MaxNotificationsPerPublish': 'UInt32',
15358
        'PublishingEnabled': 'Boolean',
15359
        'ModifyCount': 'UInt32',
15360
        'EnableCount': 'UInt32',
15361
        'DisableCount': 'UInt32',
15362
        'RepublishRequestCount': 'UInt32',
15363
        'RepublishMessageRequestCount': 'UInt32',
15364
        'RepublishMessageCount': 'UInt32',
15365
        'TransferRequestCount': 'UInt32',
15366
        'TransferredToAltClientCount': 'UInt32',
15367
        'TransferredToSameClientCount': 'UInt32',
15368
        'PublishRequestCount': 'UInt32',
15369
        'DataChangeNotificationsCount': 'UInt32',
15370
        'EventNotificationsCount': 'UInt32',
15371
        'NotificationsCount': 'UInt32',
15372
        'LatePublishRequestCount': 'UInt32',
15373
        'CurrentKeepAliveCount': 'UInt32',
15374
        'CurrentLifetimeCount': 'UInt32',
15375
        'UnacknowledgedMessageCount': 'UInt32',
15376
        'DiscardedMessageCount': 'UInt32',
15377
        'MonitoredItemCount': 'UInt32',
15378
        'DisabledMonitoredItemCount': 'UInt32',
15379
        'MonitoringQueueOverflowCount': 'UInt32',
15380
        'NextSequenceNumber': 'UInt32',
15381
        'EventQueueOverFlowCount': 'UInt32',
15382
               }
15383
15384
    def __init__(self, binary=None):
15385
        if binary is not None:
15386
            self._binary_init(binary)
15387
            self._freeze = True
15388
            return
15389
        self.SessionId = NodeId()
15390
        self.SubscriptionId = 0
15391
        self.Priority = 0
15392
        self.PublishingInterval = 0
15393
        self.MaxKeepAliveCount = 0
15394
        self.MaxLifetimeCount = 0
15395
        self.MaxNotificationsPerPublish = 0
15396
        self.PublishingEnabled = True
15397
        self.ModifyCount = 0
15398
        self.EnableCount = 0
15399
        self.DisableCount = 0
15400
        self.RepublishRequestCount = 0
15401
        self.RepublishMessageRequestCount = 0
15402
        self.RepublishMessageCount = 0
15403
        self.TransferRequestCount = 0
15404
        self.TransferredToAltClientCount = 0
15405
        self.TransferredToSameClientCount = 0
15406
        self.PublishRequestCount = 0
15407
        self.DataChangeNotificationsCount = 0
15408
        self.EventNotificationsCount = 0
15409
        self.NotificationsCount = 0
15410
        self.LatePublishRequestCount = 0
15411
        self.CurrentKeepAliveCount = 0
15412
        self.CurrentLifetimeCount = 0
15413
        self.UnacknowledgedMessageCount = 0
15414
        self.DiscardedMessageCount = 0
15415
        self.MonitoredItemCount = 0
15416
        self.DisabledMonitoredItemCount = 0
15417
        self.MonitoringQueueOverflowCount = 0
15418
        self.NextSequenceNumber = 0
15419
        self.EventQueueOverFlowCount = 0
15420
        self._freeze = True
15421
15422
    def to_binary(self):
15423
        packet = []
15424
        packet.append(self.SessionId.to_binary())
15425
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
15426
        packet.append(uabin.Primitives.Byte.pack(self.Priority))
15427
        packet.append(uabin.Primitives.Double.pack(self.PublishingInterval))
15428
        packet.append(uabin.Primitives.UInt32.pack(self.MaxKeepAliveCount))
15429
        packet.append(uabin.Primitives.UInt32.pack(self.MaxLifetimeCount))
15430
        packet.append(uabin.Primitives.UInt32.pack(self.MaxNotificationsPerPublish))
15431
        packet.append(uabin.Primitives.Boolean.pack(self.PublishingEnabled))
15432
        packet.append(uabin.Primitives.UInt32.pack(self.ModifyCount))
15433
        packet.append(uabin.Primitives.UInt32.pack(self.EnableCount))
15434
        packet.append(uabin.Primitives.UInt32.pack(self.DisableCount))
15435
        packet.append(uabin.Primitives.UInt32.pack(self.RepublishRequestCount))
15436
        packet.append(uabin.Primitives.UInt32.pack(self.RepublishMessageRequestCount))
15437
        packet.append(uabin.Primitives.UInt32.pack(self.RepublishMessageCount))
15438
        packet.append(uabin.Primitives.UInt32.pack(self.TransferRequestCount))
15439
        packet.append(uabin.Primitives.UInt32.pack(self.TransferredToAltClientCount))
15440
        packet.append(uabin.Primitives.UInt32.pack(self.TransferredToSameClientCount))
15441
        packet.append(uabin.Primitives.UInt32.pack(self.PublishRequestCount))
15442
        packet.append(uabin.Primitives.UInt32.pack(self.DataChangeNotificationsCount))
15443
        packet.append(uabin.Primitives.UInt32.pack(self.EventNotificationsCount))
15444
        packet.append(uabin.Primitives.UInt32.pack(self.NotificationsCount))
15445
        packet.append(uabin.Primitives.UInt32.pack(self.LatePublishRequestCount))
15446
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentKeepAliveCount))
15447
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentLifetimeCount))
15448
        packet.append(uabin.Primitives.UInt32.pack(self.UnacknowledgedMessageCount))
15449
        packet.append(uabin.Primitives.UInt32.pack(self.DiscardedMessageCount))
15450
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoredItemCount))
15451
        packet.append(uabin.Primitives.UInt32.pack(self.DisabledMonitoredItemCount))
15452
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoringQueueOverflowCount))
15453
        packet.append(uabin.Primitives.UInt32.pack(self.NextSequenceNumber))
15454
        packet.append(uabin.Primitives.UInt32.pack(self.EventQueueOverFlowCount))
15455
        return b''.join(packet)
15456
15457
    @staticmethod
15458
    def from_binary(data):
15459
        return SubscriptionDiagnosticsDataType(data)
15460
15461
    def _binary_init(self, data):
15462
        self.SessionId = NodeId.from_binary(data)
15463
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
15464
        self.Priority = uabin.Primitives.Byte.unpack(data)
15465
        self.PublishingInterval = uabin.Primitives.Double.unpack(data)
15466
        self.MaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
15467
        self.MaxLifetimeCount = uabin.Primitives.UInt32.unpack(data)
15468
        self.MaxNotificationsPerPublish = uabin.Primitives.UInt32.unpack(data)
15469
        self.PublishingEnabled = uabin.Primitives.Boolean.unpack(data)
15470
        self.ModifyCount = uabin.Primitives.UInt32.unpack(data)
15471
        self.EnableCount = uabin.Primitives.UInt32.unpack(data)
15472
        self.DisableCount = uabin.Primitives.UInt32.unpack(data)
15473
        self.RepublishRequestCount = uabin.Primitives.UInt32.unpack(data)
15474
        self.RepublishMessageRequestCount = uabin.Primitives.UInt32.unpack(data)
15475
        self.RepublishMessageCount = uabin.Primitives.UInt32.unpack(data)
15476
        self.TransferRequestCount = uabin.Primitives.UInt32.unpack(data)
15477
        self.TransferredToAltClientCount = uabin.Primitives.UInt32.unpack(data)
15478
        self.TransferredToSameClientCount = uabin.Primitives.UInt32.unpack(data)
15479
        self.PublishRequestCount = uabin.Primitives.UInt32.unpack(data)
15480
        self.DataChangeNotificationsCount = uabin.Primitives.UInt32.unpack(data)
15481
        self.EventNotificationsCount = uabin.Primitives.UInt32.unpack(data)
15482
        self.NotificationsCount = uabin.Primitives.UInt32.unpack(data)
15483
        self.LatePublishRequestCount = uabin.Primitives.UInt32.unpack(data)
15484
        self.CurrentKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
15485
        self.CurrentLifetimeCount = uabin.Primitives.UInt32.unpack(data)
15486
        self.UnacknowledgedMessageCount = uabin.Primitives.UInt32.unpack(data)
15487
        self.DiscardedMessageCount = uabin.Primitives.UInt32.unpack(data)
15488
        self.MonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
15489
        self.DisabledMonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
15490
        self.MonitoringQueueOverflowCount = uabin.Primitives.UInt32.unpack(data)
15491
        self.NextSequenceNumber = uabin.Primitives.UInt32.unpack(data)
15492
        self.EventQueueOverFlowCount = uabin.Primitives.UInt32.unpack(data)
15493
15494
    def __str__(self):
15495
        return 'SubscriptionDiagnosticsDataType(' + 'SessionId:' + str(self.SessionId) + ', ' + \
15496
               'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
15497
               'Priority:' + str(self.Priority) + ', ' + \
15498
               'PublishingInterval:' + str(self.PublishingInterval) + ', ' + \
15499
               'MaxKeepAliveCount:' + str(self.MaxKeepAliveCount) + ', ' + \
15500
               'MaxLifetimeCount:' + str(self.MaxLifetimeCount) + ', ' + \
15501
               'MaxNotificationsPerPublish:' + str(self.MaxNotificationsPerPublish) + ', ' + \
15502
               'PublishingEnabled:' + str(self.PublishingEnabled) + ', ' + \
15503
               'ModifyCount:' + str(self.ModifyCount) + ', ' + \
15504
               'EnableCount:' + str(self.EnableCount) + ', ' + \
15505
               'DisableCount:' + str(self.DisableCount) + ', ' + \
15506
               'RepublishRequestCount:' + str(self.RepublishRequestCount) + ', ' + \
15507
               'RepublishMessageRequestCount:' + str(self.RepublishMessageRequestCount) + ', ' + \
15508
               'RepublishMessageCount:' + str(self.RepublishMessageCount) + ', ' + \
15509
               'TransferRequestCount:' + str(self.TransferRequestCount) + ', ' + \
15510
               'TransferredToAltClientCount:' + str(self.TransferredToAltClientCount) + ', ' + \
15511
               'TransferredToSameClientCount:' + str(self.TransferredToSameClientCount) + ', ' + \
15512
               'PublishRequestCount:' + str(self.PublishRequestCount) + ', ' + \
15513
               'DataChangeNotificationsCount:' + str(self.DataChangeNotificationsCount) + ', ' + \
15514
               'EventNotificationsCount:' + str(self.EventNotificationsCount) + ', ' + \
15515
               'NotificationsCount:' + str(self.NotificationsCount) + ', ' + \
15516
               'LatePublishRequestCount:' + str(self.LatePublishRequestCount) + ', ' + \
15517
               'CurrentKeepAliveCount:' + str(self.CurrentKeepAliveCount) + ', ' + \
15518
               'CurrentLifetimeCount:' + str(self.CurrentLifetimeCount) + ', ' + \
15519
               'UnacknowledgedMessageCount:' + str(self.UnacknowledgedMessageCount) + ', ' + \
15520
               'DiscardedMessageCount:' + str(self.DiscardedMessageCount) + ', ' + \
15521
               'MonitoredItemCount:' + str(self.MonitoredItemCount) + ', ' + \
15522
               'DisabledMonitoredItemCount:' + str(self.DisabledMonitoredItemCount) + ', ' + \
15523
               'MonitoringQueueOverflowCount:' + str(self.MonitoringQueueOverflowCount) + ', ' + \
15524
               'NextSequenceNumber:' + str(self.NextSequenceNumber) + ', ' + \
15525
               'EventQueueOverFlowCount:' + str(self.EventQueueOverFlowCount) + ')'
15526
15527
    __repr__ = __str__
15528
15529
15530 View Code Duplication
class ModelChangeStructureDataType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15531
    '''
15532
    :ivar Affected:
15533
    :vartype Affected: NodeId
15534
    :ivar AffectedType:
15535
    :vartype AffectedType: NodeId
15536
    :ivar Verb:
15537
    :vartype Verb: Byte
15538
    '''
15539
15540
    ua_types = {
15541
        'Affected': 'NodeId',
15542
        'AffectedType': 'NodeId',
15543
        'Verb': 'Byte',
15544
               }
15545
15546
    def __init__(self, binary=None):
15547
        if binary is not None:
15548
            self._binary_init(binary)
15549
            self._freeze = True
15550
            return
15551
        self.Affected = NodeId()
15552
        self.AffectedType = NodeId()
15553
        self.Verb = 0
15554
        self._freeze = True
15555
15556
    def to_binary(self):
15557
        packet = []
15558
        packet.append(self.Affected.to_binary())
15559
        packet.append(self.AffectedType.to_binary())
15560
        packet.append(uabin.Primitives.Byte.pack(self.Verb))
15561
        return b''.join(packet)
15562
15563
    @staticmethod
15564
    def from_binary(data):
15565
        return ModelChangeStructureDataType(data)
15566
15567
    def _binary_init(self, data):
15568
        self.Affected = NodeId.from_binary(data)
15569
        self.AffectedType = NodeId.from_binary(data)
15570
        self.Verb = uabin.Primitives.Byte.unpack(data)
15571
15572
    def __str__(self):
15573
        return 'ModelChangeStructureDataType(' + 'Affected:' + str(self.Affected) + ', ' + \
15574
               'AffectedType:' + str(self.AffectedType) + ', ' + \
15575
               'Verb:' + str(self.Verb) + ')'
15576
15577
    __repr__ = __str__
15578
15579
15580 View Code Duplication
class SemanticChangeStructureDataType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15581
    '''
15582
    :ivar Affected:
15583
    :vartype Affected: NodeId
15584
    :ivar AffectedType:
15585
    :vartype AffectedType: NodeId
15586
    '''
15587
15588
    ua_types = {
15589
        'Affected': 'NodeId',
15590
        'AffectedType': 'NodeId',
15591
               }
15592
15593
    def __init__(self, binary=None):
15594
        if binary is not None:
15595
            self._binary_init(binary)
15596
            self._freeze = True
15597
            return
15598
        self.Affected = NodeId()
15599
        self.AffectedType = NodeId()
15600
        self._freeze = True
15601
15602
    def to_binary(self):
15603
        packet = []
15604
        packet.append(self.Affected.to_binary())
15605
        packet.append(self.AffectedType.to_binary())
15606
        return b''.join(packet)
15607
15608
    @staticmethod
15609
    def from_binary(data):
15610
        return SemanticChangeStructureDataType(data)
15611
15612
    def _binary_init(self, data):
15613
        self.Affected = NodeId.from_binary(data)
15614
        self.AffectedType = NodeId.from_binary(data)
15615
15616
    def __str__(self):
15617
        return 'SemanticChangeStructureDataType(' + 'Affected:' + str(self.Affected) + ', ' + \
15618
               'AffectedType:' + str(self.AffectedType) + ')'
15619
15620
    __repr__ = __str__
15621
15622
15623 View Code Duplication
class Range(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15624
    '''
15625
    :ivar Low:
15626
    :vartype Low: Double
15627
    :ivar High:
15628
    :vartype High: Double
15629
    '''
15630
15631
    ua_types = {
15632
        'Low': 'Double',
15633
        'High': 'Double',
15634
               }
15635
15636
    def __init__(self, binary=None):
15637
        if binary is not None:
15638
            self._binary_init(binary)
15639
            self._freeze = True
15640
            return
15641
        self.Low = 0
15642
        self.High = 0
15643
        self._freeze = True
15644
15645
    def to_binary(self):
15646
        packet = []
15647
        packet.append(uabin.Primitives.Double.pack(self.Low))
15648
        packet.append(uabin.Primitives.Double.pack(self.High))
15649
        return b''.join(packet)
15650
15651
    @staticmethod
15652
    def from_binary(data):
15653
        return Range(data)
15654
15655
    def _binary_init(self, data):
15656
        self.Low = uabin.Primitives.Double.unpack(data)
15657
        self.High = uabin.Primitives.Double.unpack(data)
15658
15659
    def __str__(self):
15660
        return 'Range(' + 'Low:' + str(self.Low) + ', ' + \
15661
               'High:' + str(self.High) + ')'
15662
15663
    __repr__ = __str__
15664
15665
15666 View Code Duplication
class EUInformation(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15667
    '''
15668
    :ivar NamespaceUri:
15669
    :vartype NamespaceUri: String
15670
    :ivar UnitId:
15671
    :vartype UnitId: Int32
15672
    :ivar DisplayName:
15673
    :vartype DisplayName: LocalizedText
15674
    :ivar Description:
15675
    :vartype Description: LocalizedText
15676
    '''
15677
15678
    ua_types = {
15679
        'NamespaceUri': 'String',
15680
        'UnitId': 'Int32',
15681
        'DisplayName': 'LocalizedText',
15682
        'Description': 'LocalizedText',
15683
               }
15684
15685
    def __init__(self, binary=None):
15686
        if binary is not None:
15687
            self._binary_init(binary)
15688
            self._freeze = True
15689
            return
15690
        self.NamespaceUri = None
15691
        self.UnitId = 0
15692
        self.DisplayName = LocalizedText()
15693
        self.Description = LocalizedText()
15694
        self._freeze = True
15695
15696
    def to_binary(self):
15697
        packet = []
15698
        packet.append(uabin.Primitives.String.pack(self.NamespaceUri))
15699
        packet.append(uabin.Primitives.Int32.pack(self.UnitId))
15700
        packet.append(self.DisplayName.to_binary())
15701
        packet.append(self.Description.to_binary())
15702
        return b''.join(packet)
15703
15704
    @staticmethod
15705
    def from_binary(data):
15706
        return EUInformation(data)
15707
15708
    def _binary_init(self, data):
15709
        self.NamespaceUri = uabin.Primitives.String.unpack(data)
15710
        self.UnitId = uabin.Primitives.Int32.unpack(data)
15711
        self.DisplayName = LocalizedText.from_binary(data)
15712
        self.Description = LocalizedText.from_binary(data)
15713
15714
    def __str__(self):
15715
        return 'EUInformation(' + 'NamespaceUri:' + str(self.NamespaceUri) + ', ' + \
15716
               'UnitId:' + str(self.UnitId) + ', ' + \
15717
               'DisplayName:' + str(self.DisplayName) + ', ' + \
15718
               'Description:' + str(self.Description) + ')'
15719
15720
    __repr__ = __str__
15721
15722
15723 View Code Duplication
class ComplexNumberType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15724
    '''
15725
    :ivar Real:
15726
    :vartype Real: Float
15727
    :ivar Imaginary:
15728
    :vartype Imaginary: Float
15729
    '''
15730
15731
    ua_types = {
15732
        'Real': 'Float',
15733
        'Imaginary': 'Float',
15734
               }
15735
15736
    def __init__(self, binary=None):
15737
        if binary is not None:
15738
            self._binary_init(binary)
15739
            self._freeze = True
15740
            return
15741
        self.Real = 0
15742
        self.Imaginary = 0
15743
        self._freeze = True
15744
15745
    def to_binary(self):
15746
        packet = []
15747
        packet.append(uabin.Primitives.Float.pack(self.Real))
15748
        packet.append(uabin.Primitives.Float.pack(self.Imaginary))
15749
        return b''.join(packet)
15750
15751
    @staticmethod
15752
    def from_binary(data):
15753
        return ComplexNumberType(data)
15754
15755
    def _binary_init(self, data):
15756
        self.Real = uabin.Primitives.Float.unpack(data)
15757
        self.Imaginary = uabin.Primitives.Float.unpack(data)
15758
15759
    def __str__(self):
15760
        return 'ComplexNumberType(' + 'Real:' + str(self.Real) + ', ' + \
15761
               'Imaginary:' + str(self.Imaginary) + ')'
15762
15763
    __repr__ = __str__
15764
15765
15766 View Code Duplication
class DoubleComplexNumberType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15767
    '''
15768
    :ivar Real:
15769
    :vartype Real: Double
15770
    :ivar Imaginary:
15771
    :vartype Imaginary: Double
15772
    '''
15773
15774
    ua_types = {
15775
        'Real': 'Double',
15776
        'Imaginary': 'Double',
15777
               }
15778
15779
    def __init__(self, binary=None):
15780
        if binary is not None:
15781
            self._binary_init(binary)
15782
            self._freeze = True
15783
            return
15784
        self.Real = 0
15785
        self.Imaginary = 0
15786
        self._freeze = True
15787
15788
    def to_binary(self):
15789
        packet = []
15790
        packet.append(uabin.Primitives.Double.pack(self.Real))
15791
        packet.append(uabin.Primitives.Double.pack(self.Imaginary))
15792
        return b''.join(packet)
15793
15794
    @staticmethod
15795
    def from_binary(data):
15796
        return DoubleComplexNumberType(data)
15797
15798
    def _binary_init(self, data):
15799
        self.Real = uabin.Primitives.Double.unpack(data)
15800
        self.Imaginary = uabin.Primitives.Double.unpack(data)
15801
15802
    def __str__(self):
15803
        return 'DoubleComplexNumberType(' + 'Real:' + str(self.Real) + ', ' + \
15804
               'Imaginary:' + str(self.Imaginary) + ')'
15805
15806
    __repr__ = __str__
15807
15808
15809 View Code Duplication
class AxisInformation(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15810
    '''
15811
    :ivar EngineeringUnits:
15812
    :vartype EngineeringUnits: EUInformation
15813
    :ivar EURange:
15814
    :vartype EURange: Range
15815
    :ivar Title:
15816
    :vartype Title: LocalizedText
15817
    :ivar AxisScaleType:
15818
    :vartype AxisScaleType: AxisScaleEnumeration
15819
    :ivar AxisSteps:
15820
    :vartype AxisSteps: Double
15821
    '''
15822
15823
    ua_types = {
15824
        'EngineeringUnits': 'EUInformation',
15825
        'EURange': 'Range',
15826
        'Title': 'LocalizedText',
15827
        'AxisScaleType': 'AxisScaleEnumeration',
15828
        'AxisSteps': 'Double',
15829
               }
15830
15831
    def __init__(self, binary=None):
15832
        if binary is not None:
15833
            self._binary_init(binary)
15834
            self._freeze = True
15835
            return
15836
        self.EngineeringUnits = EUInformation()
15837
        self.EURange = Range()
15838
        self.Title = LocalizedText()
15839
        self.AxisScaleType = AxisScaleEnumeration(0)
15840
        self.AxisSteps = []
15841
        self._freeze = True
15842
15843
    def to_binary(self):
15844
        packet = []
15845
        packet.append(self.EngineeringUnits.to_binary())
15846
        packet.append(self.EURange.to_binary())
15847
        packet.append(self.Title.to_binary())
15848
        packet.append(uabin.Primitives.UInt32.pack(self.AxisScaleType.value))
15849
        packet.append(uabin.Primitives.Int32.pack(len(self.AxisSteps)))
15850
        for fieldname in self.AxisSteps:
15851
            packet.append(uabin.Primitives.Double.pack(fieldname))
15852
        return b''.join(packet)
15853
15854
    @staticmethod
15855
    def from_binary(data):
15856
        return AxisInformation(data)
15857
15858
    def _binary_init(self, data):
15859
        self.EngineeringUnits = EUInformation.from_binary(data)
15860
        self.EURange = Range.from_binary(data)
15861
        self.Title = LocalizedText.from_binary(data)
15862
        self.AxisScaleType = AxisScaleEnumeration(uabin.Primitives.UInt32.unpack(data))
15863
        self.AxisSteps = uabin.Primitives.Double.unpack_array(data)
15864
15865
    def __str__(self):
15866
        return 'AxisInformation(' + 'EngineeringUnits:' + str(self.EngineeringUnits) + ', ' + \
15867
               'EURange:' + str(self.EURange) + ', ' + \
15868
               'Title:' + str(self.Title) + ', ' + \
15869
               'AxisScaleType:' + str(self.AxisScaleType) + ', ' + \
15870
               'AxisSteps:' + str(self.AxisSteps) + ')'
15871
15872
    __repr__ = __str__
15873
15874
15875 View Code Duplication
class XVType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15876
    '''
15877
    :ivar X:
15878
    :vartype X: Double
15879
    :ivar Value:
15880
    :vartype Value: Float
15881
    '''
15882
15883
    ua_types = {
15884
        'X': 'Double',
15885
        'Value': 'Float',
15886
               }
15887
15888
    def __init__(self, binary=None):
15889
        if binary is not None:
15890
            self._binary_init(binary)
15891
            self._freeze = True
15892
            return
15893
        self.X = 0
15894
        self.Value = 0
15895
        self._freeze = True
15896
15897
    def to_binary(self):
15898
        packet = []
15899
        packet.append(uabin.Primitives.Double.pack(self.X))
15900
        packet.append(uabin.Primitives.Float.pack(self.Value))
15901
        return b''.join(packet)
15902
15903
    @staticmethod
15904
    def from_binary(data):
15905
        return XVType(data)
15906
15907
    def _binary_init(self, data):
15908
        self.X = uabin.Primitives.Double.unpack(data)
15909
        self.Value = uabin.Primitives.Float.unpack(data)
15910
15911
    def __str__(self):
15912
        return 'XVType(' + 'X:' + str(self.X) + ', ' + \
15913
               'Value:' + str(self.Value) + ')'
15914
15915
    __repr__ = __str__
15916
15917
15918
class ProgramDiagnosticDataType(FrozenClass):
15919
    '''
15920
    :ivar CreateSessionId:
15921
    :vartype CreateSessionId: NodeId
15922
    :ivar CreateClientName:
15923
    :vartype CreateClientName: String
15924
    :ivar InvocationCreationTime:
15925
    :vartype InvocationCreationTime: DateTime
15926
    :ivar LastTransitionTime:
15927
    :vartype LastTransitionTime: DateTime
15928
    :ivar LastMethodCall:
15929
    :vartype LastMethodCall: String
15930
    :ivar LastMethodSessionId:
15931
    :vartype LastMethodSessionId: NodeId
15932
    :ivar LastMethodInputArguments:
15933
    :vartype LastMethodInputArguments: Argument
15934
    :ivar LastMethodOutputArguments:
15935
    :vartype LastMethodOutputArguments: Argument
15936
    :ivar LastMethodCallTime:
15937
    :vartype LastMethodCallTime: DateTime
15938
    :ivar LastMethodReturnStatus:
15939
    :vartype LastMethodReturnStatus: StatusResult
15940
    '''
15941
15942
    ua_types = {
15943
        'CreateSessionId': 'NodeId',
15944
        'CreateClientName': 'String',
15945
        'InvocationCreationTime': 'DateTime',
15946
        'LastTransitionTime': 'DateTime',
15947
        'LastMethodCall': 'String',
15948
        'LastMethodSessionId': 'NodeId',
15949
        'LastMethodInputArguments': 'Argument',
15950
        'LastMethodOutputArguments': 'Argument',
15951
        'LastMethodCallTime': 'DateTime',
15952
        'LastMethodReturnStatus': 'StatusResult',
15953
               }
15954
15955
    def __init__(self, binary=None):
15956
        if binary is not None:
15957
            self._binary_init(binary)
15958
            self._freeze = True
15959
            return
15960
        self.CreateSessionId = NodeId()
15961
        self.CreateClientName = None
15962
        self.InvocationCreationTime = datetime.now()
15963
        self.LastTransitionTime = datetime.now()
15964
        self.LastMethodCall = None
15965
        self.LastMethodSessionId = NodeId()
15966
        self.LastMethodInputArguments = []
15967
        self.LastMethodOutputArguments = []
15968
        self.LastMethodCallTime = datetime.now()
15969
        self.LastMethodReturnStatus = StatusResult()
15970
        self._freeze = True
15971
15972
    def to_binary(self):
15973
        packet = []
15974
        packet.append(self.CreateSessionId.to_binary())
15975
        packet.append(uabin.Primitives.String.pack(self.CreateClientName))
15976
        packet.append(uabin.Primitives.DateTime.pack(self.InvocationCreationTime))
15977
        packet.append(uabin.Primitives.DateTime.pack(self.LastTransitionTime))
15978
        packet.append(uabin.Primitives.String.pack(self.LastMethodCall))
15979
        packet.append(self.LastMethodSessionId.to_binary())
15980
        packet.append(uabin.Primitives.Int32.pack(len(self.LastMethodInputArguments)))
15981
        for fieldname in self.LastMethodInputArguments:
15982
            packet.append(fieldname.to_binary())
15983
        packet.append(uabin.Primitives.Int32.pack(len(self.LastMethodOutputArguments)))
15984
        for fieldname in self.LastMethodOutputArguments:
15985
            packet.append(fieldname.to_binary())
15986
        packet.append(uabin.Primitives.DateTime.pack(self.LastMethodCallTime))
15987
        packet.append(self.LastMethodReturnStatus.to_binary())
15988
        return b''.join(packet)
15989
15990
    @staticmethod
15991
    def from_binary(data):
15992
        return ProgramDiagnosticDataType(data)
15993
15994
    def _binary_init(self, data):
15995
        self.CreateSessionId = NodeId.from_binary(data)
15996
        self.CreateClientName = uabin.Primitives.String.unpack(data)
15997
        self.InvocationCreationTime = uabin.Primitives.DateTime.unpack(data)
15998
        self.LastTransitionTime = uabin.Primitives.DateTime.unpack(data)
15999
        self.LastMethodCall = uabin.Primitives.String.unpack(data)
16000
        self.LastMethodSessionId = NodeId.from_binary(data)
16001
        length = uabin.Primitives.Int32.unpack(data)
16002
        array = []
16003
        if length != -1:
16004
            for _ in range(0, length):
16005
                array.append(Argument.from_binary(data))
16006
        self.LastMethodInputArguments = array
16007
        length = uabin.Primitives.Int32.unpack(data)
16008
        array = []
16009
        if length != -1:
16010
            for _ in range(0, length):
16011
                array.append(Argument.from_binary(data))
16012
        self.LastMethodOutputArguments = array
16013
        self.LastMethodCallTime = uabin.Primitives.DateTime.unpack(data)
16014
        self.LastMethodReturnStatus = StatusResult.from_binary(data)
16015
16016
    def __str__(self):
16017
        return 'ProgramDiagnosticDataType(' + 'CreateSessionId:' + str(self.CreateSessionId) + ', ' + \
16018
               'CreateClientName:' + str(self.CreateClientName) + ', ' + \
16019
               'InvocationCreationTime:' + str(self.InvocationCreationTime) + ', ' + \
16020
               'LastTransitionTime:' + str(self.LastTransitionTime) + ', ' + \
16021
               'LastMethodCall:' + str(self.LastMethodCall) + ', ' + \
16022
               'LastMethodSessionId:' + str(self.LastMethodSessionId) + ', ' + \
16023
               'LastMethodInputArguments:' + str(self.LastMethodInputArguments) + ', ' + \
16024
               'LastMethodOutputArguments:' + str(self.LastMethodOutputArguments) + ', ' + \
16025
               'LastMethodCallTime:' + str(self.LastMethodCallTime) + ', ' + \
16026
               'LastMethodReturnStatus:' + str(self.LastMethodReturnStatus) + ')'
16027
16028
    __repr__ = __str__
16029
16030
16031
class Annotation(FrozenClass):
16032
    '''
16033
    :ivar Message:
16034
    :vartype Message: String
16035
    :ivar UserName:
16036
    :vartype UserName: String
16037
    :ivar AnnotationTime:
16038
    :vartype AnnotationTime: DateTime
16039
    '''
16040
16041
    ua_types = {
16042
        'Message': 'String',
16043
        'UserName': 'String',
16044
        'AnnotationTime': 'DateTime',
16045
               }
16046
16047
    def __init__(self, binary=None):
16048
        if binary is not None:
16049
            self._binary_init(binary)
16050
            self._freeze = True
16051
            return
16052
        self.Message = None
16053
        self.UserName = None
16054
        self.AnnotationTime = datetime.now()
16055
        self._freeze = True
16056
16057
    def to_binary(self):
16058
        packet = []
16059
        packet.append(uabin.Primitives.String.pack(self.Message))
16060
        packet.append(uabin.Primitives.String.pack(self.UserName))
16061
        packet.append(uabin.Primitives.DateTime.pack(self.AnnotationTime))
16062
        return b''.join(packet)
16063
16064
    @staticmethod
16065
    def from_binary(data):
16066
        return Annotation(data)
16067
16068
    def _binary_init(self, data):
16069
        self.Message = uabin.Primitives.String.unpack(data)
16070
        self.UserName = uabin.Primitives.String.unpack(data)
16071
        self.AnnotationTime = uabin.Primitives.DateTime.unpack(data)
16072
16073
    def __str__(self):
16074
        return 'Annotation(' + 'Message:' + str(self.Message) + ', ' + \
16075
               'UserName:' + str(self.UserName) + ', ' + \
16076
               'AnnotationTime:' + str(self.AnnotationTime) + ')'
16077
16078
    __repr__ = __str__
16079
16080
16081
ExtensionClasses = {
16082
    ObjectIds.TrustListDataType_Encoding_DefaultBinary: TrustListDataType,
16083
    ObjectIds.Argument_Encoding_DefaultBinary: Argument,
16084
    ObjectIds.EnumValueType_Encoding_DefaultBinary: EnumValueType,
16085
    ObjectIds.OptionSet_Encoding_DefaultBinary: OptionSet,
16086
    ObjectIds.Union_Encoding_DefaultBinary: Union,
16087
    ObjectIds.TimeZoneDataType_Encoding_DefaultBinary: TimeZoneDataType,
16088
    ObjectIds.ApplicationDescription_Encoding_DefaultBinary: ApplicationDescription,
16089
    ObjectIds.RequestHeader_Encoding_DefaultBinary: RequestHeader,
16090
    ObjectIds.ResponseHeader_Encoding_DefaultBinary: ResponseHeader,
16091
    ObjectIds.ServiceFault_Encoding_DefaultBinary: ServiceFault,
16092
    ObjectIds.FindServersRequest_Encoding_DefaultBinary: FindServersRequest,
16093
    ObjectIds.FindServersResponse_Encoding_DefaultBinary: FindServersResponse,
16094
    ObjectIds.ServerOnNetwork_Encoding_DefaultBinary: ServerOnNetwork,
16095
    ObjectIds.FindServersOnNetworkRequest_Encoding_DefaultBinary: FindServersOnNetworkRequest,
16096
    ObjectIds.FindServersOnNetworkResponse_Encoding_DefaultBinary: FindServersOnNetworkResponse,
16097
    ObjectIds.UserTokenPolicy_Encoding_DefaultBinary: UserTokenPolicy,
16098
    ObjectIds.EndpointDescription_Encoding_DefaultBinary: EndpointDescription,
16099
    ObjectIds.GetEndpointsRequest_Encoding_DefaultBinary: GetEndpointsRequest,
16100
    ObjectIds.GetEndpointsResponse_Encoding_DefaultBinary: GetEndpointsResponse,
16101
    ObjectIds.RegisteredServer_Encoding_DefaultBinary: RegisteredServer,
16102
    ObjectIds.RegisterServerRequest_Encoding_DefaultBinary: RegisterServerRequest,
16103
    ObjectIds.RegisterServerResponse_Encoding_DefaultBinary: RegisterServerResponse,
16104
    ObjectIds.DiscoveryConfiguration_Encoding_DefaultBinary: DiscoveryConfiguration,
16105
    ObjectIds.MdnsDiscoveryConfiguration_Encoding_DefaultBinary: MdnsDiscoveryConfiguration,
16106
    ObjectIds.RegisterServer2Request_Encoding_DefaultBinary: RegisterServer2Request,
16107
    ObjectIds.RegisterServer2Response_Encoding_DefaultBinary: RegisterServer2Response,
16108
    ObjectIds.ChannelSecurityToken_Encoding_DefaultBinary: ChannelSecurityToken,
16109
    ObjectIds.OpenSecureChannelRequest_Encoding_DefaultBinary: OpenSecureChannelRequest,
16110
    ObjectIds.OpenSecureChannelResponse_Encoding_DefaultBinary: OpenSecureChannelResponse,
16111
    ObjectIds.CloseSecureChannelRequest_Encoding_DefaultBinary: CloseSecureChannelRequest,
16112
    ObjectIds.CloseSecureChannelResponse_Encoding_DefaultBinary: CloseSecureChannelResponse,
16113
    ObjectIds.SignedSoftwareCertificate_Encoding_DefaultBinary: SignedSoftwareCertificate,
16114
    ObjectIds.SignatureData_Encoding_DefaultBinary: SignatureData,
16115
    ObjectIds.CreateSessionRequest_Encoding_DefaultBinary: CreateSessionRequest,
16116
    ObjectIds.CreateSessionResponse_Encoding_DefaultBinary: CreateSessionResponse,
16117
    ObjectIds.UserIdentityToken_Encoding_DefaultBinary: UserIdentityToken,
16118
    ObjectIds.AnonymousIdentityToken_Encoding_DefaultBinary: AnonymousIdentityToken,
16119
    ObjectIds.UserNameIdentityToken_Encoding_DefaultBinary: UserNameIdentityToken,
16120
    ObjectIds.X509IdentityToken_Encoding_DefaultBinary: X509IdentityToken,
16121
    ObjectIds.KerberosIdentityToken_Encoding_DefaultBinary: KerberosIdentityToken,
16122
    ObjectIds.IssuedIdentityToken_Encoding_DefaultBinary: IssuedIdentityToken,
16123
    ObjectIds.ActivateSessionRequest_Encoding_DefaultBinary: ActivateSessionRequest,
16124
    ObjectIds.ActivateSessionResponse_Encoding_DefaultBinary: ActivateSessionResponse,
16125
    ObjectIds.CloseSessionRequest_Encoding_DefaultBinary: CloseSessionRequest,
16126
    ObjectIds.CloseSessionResponse_Encoding_DefaultBinary: CloseSessionResponse,
16127
    ObjectIds.CancelRequest_Encoding_DefaultBinary: CancelRequest,
16128
    ObjectIds.CancelResponse_Encoding_DefaultBinary: CancelResponse,
16129
    ObjectIds.NodeAttributes_Encoding_DefaultBinary: NodeAttributes,
16130
    ObjectIds.ObjectAttributes_Encoding_DefaultBinary: ObjectAttributes,
16131
    ObjectIds.VariableAttributes_Encoding_DefaultBinary: VariableAttributes,
16132
    ObjectIds.MethodAttributes_Encoding_DefaultBinary: MethodAttributes,
16133
    ObjectIds.ObjectTypeAttributes_Encoding_DefaultBinary: ObjectTypeAttributes,
16134
    ObjectIds.VariableTypeAttributes_Encoding_DefaultBinary: VariableTypeAttributes,
16135
    ObjectIds.ReferenceTypeAttributes_Encoding_DefaultBinary: ReferenceTypeAttributes,
16136
    ObjectIds.DataTypeAttributes_Encoding_DefaultBinary: DataTypeAttributes,
16137
    ObjectIds.ViewAttributes_Encoding_DefaultBinary: ViewAttributes,
16138
    ObjectIds.AddNodesItem_Encoding_DefaultBinary: AddNodesItem,
16139
    ObjectIds.AddNodesResult_Encoding_DefaultBinary: AddNodesResult,
16140
    ObjectIds.AddNodesRequest_Encoding_DefaultBinary: AddNodesRequest,
16141
    ObjectIds.AddNodesResponse_Encoding_DefaultBinary: AddNodesResponse,
16142
    ObjectIds.AddReferencesItem_Encoding_DefaultBinary: AddReferencesItem,
16143
    ObjectIds.AddReferencesRequest_Encoding_DefaultBinary: AddReferencesRequest,
16144
    ObjectIds.AddReferencesResponse_Encoding_DefaultBinary: AddReferencesResponse,
16145
    ObjectIds.DeleteNodesItem_Encoding_DefaultBinary: DeleteNodesItem,
16146
    ObjectIds.DeleteNodesRequest_Encoding_DefaultBinary: DeleteNodesRequest,
16147
    ObjectIds.DeleteNodesResponse_Encoding_DefaultBinary: DeleteNodesResponse,
16148
    ObjectIds.DeleteReferencesItem_Encoding_DefaultBinary: DeleteReferencesItem,
16149
    ObjectIds.DeleteReferencesRequest_Encoding_DefaultBinary: DeleteReferencesRequest,
16150
    ObjectIds.DeleteReferencesResponse_Encoding_DefaultBinary: DeleteReferencesResponse,
16151
    ObjectIds.ViewDescription_Encoding_DefaultBinary: ViewDescription,
16152
    ObjectIds.BrowseDescription_Encoding_DefaultBinary: BrowseDescription,
16153
    ObjectIds.ReferenceDescription_Encoding_DefaultBinary: ReferenceDescription,
16154
    ObjectIds.BrowseResult_Encoding_DefaultBinary: BrowseResult,
16155
    ObjectIds.BrowseRequest_Encoding_DefaultBinary: BrowseRequest,
16156
    ObjectIds.BrowseResponse_Encoding_DefaultBinary: BrowseResponse,
16157
    ObjectIds.BrowseNextRequest_Encoding_DefaultBinary: BrowseNextRequest,
16158
    ObjectIds.BrowseNextResponse_Encoding_DefaultBinary: BrowseNextResponse,
16159
    ObjectIds.RelativePathElement_Encoding_DefaultBinary: RelativePathElement,
16160
    ObjectIds.RelativePath_Encoding_DefaultBinary: RelativePath,
16161
    ObjectIds.BrowsePath_Encoding_DefaultBinary: BrowsePath,
16162
    ObjectIds.BrowsePathTarget_Encoding_DefaultBinary: BrowsePathTarget,
16163
    ObjectIds.BrowsePathResult_Encoding_DefaultBinary: BrowsePathResult,
16164
    ObjectIds.TranslateBrowsePathsToNodeIdsRequest_Encoding_DefaultBinary: TranslateBrowsePathsToNodeIdsRequest,
16165
    ObjectIds.TranslateBrowsePathsToNodeIdsResponse_Encoding_DefaultBinary: TranslateBrowsePathsToNodeIdsResponse,
16166
    ObjectIds.RegisterNodesRequest_Encoding_DefaultBinary: RegisterNodesRequest,
16167
    ObjectIds.RegisterNodesResponse_Encoding_DefaultBinary: RegisterNodesResponse,
16168
    ObjectIds.UnregisterNodesRequest_Encoding_DefaultBinary: UnregisterNodesRequest,
16169
    ObjectIds.UnregisterNodesResponse_Encoding_DefaultBinary: UnregisterNodesResponse,
16170
    ObjectIds.EndpointConfiguration_Encoding_DefaultBinary: EndpointConfiguration,
16171
    ObjectIds.SupportedProfile_Encoding_DefaultBinary: SupportedProfile,
16172
    ObjectIds.SoftwareCertificate_Encoding_DefaultBinary: SoftwareCertificate,
16173
    ObjectIds.QueryDataDescription_Encoding_DefaultBinary: QueryDataDescription,
16174
    ObjectIds.NodeTypeDescription_Encoding_DefaultBinary: NodeTypeDescription,
16175
    ObjectIds.QueryDataSet_Encoding_DefaultBinary: QueryDataSet,
16176
    ObjectIds.NodeReference_Encoding_DefaultBinary: NodeReference,
16177
    ObjectIds.ContentFilterElement_Encoding_DefaultBinary: ContentFilterElement,
16178
    ObjectIds.ContentFilter_Encoding_DefaultBinary: ContentFilter,
16179
    ObjectIds.ElementOperand_Encoding_DefaultBinary: ElementOperand,
16180
    ObjectIds.LiteralOperand_Encoding_DefaultBinary: LiteralOperand,
16181
    ObjectIds.AttributeOperand_Encoding_DefaultBinary: AttributeOperand,
16182
    ObjectIds.SimpleAttributeOperand_Encoding_DefaultBinary: SimpleAttributeOperand,
16183
    ObjectIds.ContentFilterElementResult_Encoding_DefaultBinary: ContentFilterElementResult,
16184
    ObjectIds.ContentFilterResult_Encoding_DefaultBinary: ContentFilterResult,
16185
    ObjectIds.ParsingResult_Encoding_DefaultBinary: ParsingResult,
16186
    ObjectIds.QueryFirstRequest_Encoding_DefaultBinary: QueryFirstRequest,
16187
    ObjectIds.QueryFirstResponse_Encoding_DefaultBinary: QueryFirstResponse,
16188
    ObjectIds.QueryNextRequest_Encoding_DefaultBinary: QueryNextRequest,
16189
    ObjectIds.QueryNextResponse_Encoding_DefaultBinary: QueryNextResponse,
16190
    ObjectIds.ReadValueId_Encoding_DefaultBinary: ReadValueId,
16191
    ObjectIds.ReadRequest_Encoding_DefaultBinary: ReadRequest,
16192
    ObjectIds.ReadResponse_Encoding_DefaultBinary: ReadResponse,
16193
    ObjectIds.HistoryReadValueId_Encoding_DefaultBinary: HistoryReadValueId,
16194
    ObjectIds.HistoryReadResult_Encoding_DefaultBinary: HistoryReadResult,
16195
    ObjectIds.HistoryReadDetails_Encoding_DefaultBinary: HistoryReadDetails,
16196
    ObjectIds.ReadEventDetails_Encoding_DefaultBinary: ReadEventDetails,
16197
    ObjectIds.ReadRawModifiedDetails_Encoding_DefaultBinary: ReadRawModifiedDetails,
16198
    ObjectIds.ReadProcessedDetails_Encoding_DefaultBinary: ReadProcessedDetails,
16199
    ObjectIds.ReadAtTimeDetails_Encoding_DefaultBinary: ReadAtTimeDetails,
16200
    ObjectIds.HistoryData_Encoding_DefaultBinary: HistoryData,
16201
    ObjectIds.ModificationInfo_Encoding_DefaultBinary: ModificationInfo,
16202
    ObjectIds.HistoryModifiedData_Encoding_DefaultBinary: HistoryModifiedData,
16203
    ObjectIds.HistoryEvent_Encoding_DefaultBinary: HistoryEvent,
16204
    ObjectIds.HistoryReadRequest_Encoding_DefaultBinary: HistoryReadRequest,
16205
    ObjectIds.HistoryReadResponse_Encoding_DefaultBinary: HistoryReadResponse,
16206
    ObjectIds.WriteValue_Encoding_DefaultBinary: WriteValue,
16207
    ObjectIds.WriteRequest_Encoding_DefaultBinary: WriteRequest,
16208
    ObjectIds.WriteResponse_Encoding_DefaultBinary: WriteResponse,
16209
    ObjectIds.HistoryUpdateDetails_Encoding_DefaultBinary: HistoryUpdateDetails,
16210
    ObjectIds.UpdateDataDetails_Encoding_DefaultBinary: UpdateDataDetails,
16211
    ObjectIds.UpdateStructureDataDetails_Encoding_DefaultBinary: UpdateStructureDataDetails,
16212
    ObjectIds.UpdateEventDetails_Encoding_DefaultBinary: UpdateEventDetails,
16213
    ObjectIds.DeleteRawModifiedDetails_Encoding_DefaultBinary: DeleteRawModifiedDetails,
16214
    ObjectIds.DeleteAtTimeDetails_Encoding_DefaultBinary: DeleteAtTimeDetails,
16215
    ObjectIds.DeleteEventDetails_Encoding_DefaultBinary: DeleteEventDetails,
16216
    ObjectIds.HistoryUpdateResult_Encoding_DefaultBinary: HistoryUpdateResult,
16217
    ObjectIds.HistoryUpdateRequest_Encoding_DefaultBinary: HistoryUpdateRequest,
16218
    ObjectIds.HistoryUpdateResponse_Encoding_DefaultBinary: HistoryUpdateResponse,
16219
    ObjectIds.CallMethodRequest_Encoding_DefaultBinary: CallMethodRequest,
16220
    ObjectIds.CallMethodResult_Encoding_DefaultBinary: CallMethodResult,
16221
    ObjectIds.CallRequest_Encoding_DefaultBinary: CallRequest,
16222
    ObjectIds.CallResponse_Encoding_DefaultBinary: CallResponse,
16223
    ObjectIds.MonitoringFilter_Encoding_DefaultBinary: MonitoringFilter,
16224
    ObjectIds.DataChangeFilter_Encoding_DefaultBinary: DataChangeFilter,
16225
    ObjectIds.EventFilter_Encoding_DefaultBinary: EventFilter,
16226
    ObjectIds.AggregateConfiguration_Encoding_DefaultBinary: AggregateConfiguration,
16227
    ObjectIds.AggregateFilter_Encoding_DefaultBinary: AggregateFilter,
16228
    ObjectIds.MonitoringFilterResult_Encoding_DefaultBinary: MonitoringFilterResult,
16229
    ObjectIds.EventFilterResult_Encoding_DefaultBinary: EventFilterResult,
16230
    ObjectIds.AggregateFilterResult_Encoding_DefaultBinary: AggregateFilterResult,
16231
    ObjectIds.MonitoringParameters_Encoding_DefaultBinary: MonitoringParameters,
16232
    ObjectIds.MonitoredItemCreateRequest_Encoding_DefaultBinary: MonitoredItemCreateRequest,
16233
    ObjectIds.MonitoredItemCreateResult_Encoding_DefaultBinary: MonitoredItemCreateResult,
16234
    ObjectIds.CreateMonitoredItemsRequest_Encoding_DefaultBinary: CreateMonitoredItemsRequest,
16235
    ObjectIds.CreateMonitoredItemsResponse_Encoding_DefaultBinary: CreateMonitoredItemsResponse,
16236
    ObjectIds.MonitoredItemModifyRequest_Encoding_DefaultBinary: MonitoredItemModifyRequest,
16237
    ObjectIds.MonitoredItemModifyResult_Encoding_DefaultBinary: MonitoredItemModifyResult,
16238
    ObjectIds.ModifyMonitoredItemsRequest_Encoding_DefaultBinary: ModifyMonitoredItemsRequest,
16239
    ObjectIds.ModifyMonitoredItemsResponse_Encoding_DefaultBinary: ModifyMonitoredItemsResponse,
16240
    ObjectIds.SetMonitoringModeRequest_Encoding_DefaultBinary: SetMonitoringModeRequest,
16241
    ObjectIds.SetMonitoringModeResponse_Encoding_DefaultBinary: SetMonitoringModeResponse,
16242
    ObjectIds.SetTriggeringRequest_Encoding_DefaultBinary: SetTriggeringRequest,
16243
    ObjectIds.SetTriggeringResponse_Encoding_DefaultBinary: SetTriggeringResponse,
16244
    ObjectIds.DeleteMonitoredItemsRequest_Encoding_DefaultBinary: DeleteMonitoredItemsRequest,
16245
    ObjectIds.DeleteMonitoredItemsResponse_Encoding_DefaultBinary: DeleteMonitoredItemsResponse,
16246
    ObjectIds.CreateSubscriptionRequest_Encoding_DefaultBinary: CreateSubscriptionRequest,
16247
    ObjectIds.CreateSubscriptionResponse_Encoding_DefaultBinary: CreateSubscriptionResponse,
16248
    ObjectIds.ModifySubscriptionRequest_Encoding_DefaultBinary: ModifySubscriptionRequest,
16249
    ObjectIds.ModifySubscriptionResponse_Encoding_DefaultBinary: ModifySubscriptionResponse,
16250
    ObjectIds.SetPublishingModeRequest_Encoding_DefaultBinary: SetPublishingModeRequest,
16251
    ObjectIds.SetPublishingModeResponse_Encoding_DefaultBinary: SetPublishingModeResponse,
16252
    ObjectIds.NotificationMessage_Encoding_DefaultBinary: NotificationMessage,
16253
    ObjectIds.NotificationData_Encoding_DefaultBinary: NotificationData,
16254
    ObjectIds.DataChangeNotification_Encoding_DefaultBinary: DataChangeNotification,
16255
    ObjectIds.MonitoredItemNotification_Encoding_DefaultBinary: MonitoredItemNotification,
16256
    ObjectIds.EventNotificationList_Encoding_DefaultBinary: EventNotificationList,
16257
    ObjectIds.EventFieldList_Encoding_DefaultBinary: EventFieldList,
16258
    ObjectIds.HistoryEventFieldList_Encoding_DefaultBinary: HistoryEventFieldList,
16259
    ObjectIds.StatusChangeNotification_Encoding_DefaultBinary: StatusChangeNotification,
16260
    ObjectIds.SubscriptionAcknowledgement_Encoding_DefaultBinary: SubscriptionAcknowledgement,
16261
    ObjectIds.PublishRequest_Encoding_DefaultBinary: PublishRequest,
16262
    ObjectIds.PublishResponse_Encoding_DefaultBinary: PublishResponse,
16263
    ObjectIds.RepublishRequest_Encoding_DefaultBinary: RepublishRequest,
16264
    ObjectIds.RepublishResponse_Encoding_DefaultBinary: RepublishResponse,
16265
    ObjectIds.TransferResult_Encoding_DefaultBinary: TransferResult,
16266
    ObjectIds.TransferSubscriptionsRequest_Encoding_DefaultBinary: TransferSubscriptionsRequest,
16267
    ObjectIds.TransferSubscriptionsResponse_Encoding_DefaultBinary: TransferSubscriptionsResponse,
16268
    ObjectIds.DeleteSubscriptionsRequest_Encoding_DefaultBinary: DeleteSubscriptionsRequest,
16269
    ObjectIds.DeleteSubscriptionsResponse_Encoding_DefaultBinary: DeleteSubscriptionsResponse,
16270
    ObjectIds.BuildInfo_Encoding_DefaultBinary: BuildInfo,
16271
    ObjectIds.RedundantServerDataType_Encoding_DefaultBinary: RedundantServerDataType,
16272
    ObjectIds.EndpointUrlListDataType_Encoding_DefaultBinary: EndpointUrlListDataType,
16273
    ObjectIds.NetworkGroupDataType_Encoding_DefaultBinary: NetworkGroupDataType,
16274
    ObjectIds.SamplingIntervalDiagnosticsDataType_Encoding_DefaultBinary: SamplingIntervalDiagnosticsDataType,
16275
    ObjectIds.ServerDiagnosticsSummaryDataType_Encoding_DefaultBinary: ServerDiagnosticsSummaryDataType,
16276
    ObjectIds.ServerStatusDataType_Encoding_DefaultBinary: ServerStatusDataType,
16277
    ObjectIds.SessionDiagnosticsDataType_Encoding_DefaultBinary: SessionDiagnosticsDataType,
16278
    ObjectIds.SessionSecurityDiagnosticsDataType_Encoding_DefaultBinary: SessionSecurityDiagnosticsDataType,
16279
    ObjectIds.ServiceCounterDataType_Encoding_DefaultBinary: ServiceCounterDataType,
16280
    ObjectIds.StatusResult_Encoding_DefaultBinary: StatusResult,
16281
    ObjectIds.SubscriptionDiagnosticsDataType_Encoding_DefaultBinary: SubscriptionDiagnosticsDataType,
16282
    ObjectIds.ModelChangeStructureDataType_Encoding_DefaultBinary: ModelChangeStructureDataType,
16283
    ObjectIds.SemanticChangeStructureDataType_Encoding_DefaultBinary: SemanticChangeStructureDataType,
16284
    ObjectIds.Range_Encoding_DefaultBinary: Range,
16285
    ObjectIds.EUInformation_Encoding_DefaultBinary: EUInformation,
16286
    ObjectIds.ComplexNumberType_Encoding_DefaultBinary: ComplexNumberType,
16287
    ObjectIds.DoubleComplexNumberType_Encoding_DefaultBinary: DoubleComplexNumberType,
16288
    ObjectIds.AxisInformation_Encoding_DefaultBinary: AxisInformation,
16289
    ObjectIds.XVType_Encoding_DefaultBinary: XVType,
16290
    ObjectIds.ProgramDiagnosticDataType_Encoding_DefaultBinary: ProgramDiagnosticDataType,
16291
    ObjectIds.Annotation_Encoding_DefaultBinary: Annotation,
16292
}
16293
16294
16295
def extensionobject_from_binary(data):
16296
    """
16297
    Convert binary-coded ExtensionObject to a Python object.
16298
    Returns an object, or None if TypeId is zero
16299
    """
16300
    TypeId = NodeId.from_binary(data)
16301
    Encoding = ord(data.read(1))
16302
    body = None
16303
    if Encoding & (1 << 0):
16304
        length = uabin.Primitives.Int32.unpack(data)
16305
        if length < 1:
16306
            body = Buffer(b"")
16307
        else:
16308
            body = data.copy(length)
16309
            data.skip(length)
16310
    if TypeId.Identifier == 0:
16311
        return None
16312
    elif TypeId.Identifier not in ExtensionClasses:
16313
        e = ExtensionObject()
16314
        e.TypeId = TypeId
16315
        e.Encoding = Encoding
16316
        if body is not None:
16317
            e.Body = body.read(len(body))
16318
        return e
16319
    klass = ExtensionClasses[TypeId.Identifier]
16320
    if body is None:
16321
        raise UaError("parsing ExtensionObject {} without data".format(klass.__name__))
16322
    return klass.from_binary(body)
16323
16324
16325
def extensionobject_to_binary(obj):
16326
    """
16327
    Convert Python object to binary-coded ExtensionObject.
16328
    If obj is None, convert to empty ExtensionObject (TypeId = 0, no Body).
16329
    Returns a binary string
16330
    """
16331
    if isinstance(obj, ExtensionObject):
16332
        return obj.to_binary()
16333
    TypeId = NodeId()
16334
    Encoding = 0
16335
    Body = None
16336
    if obj is not None:
16337
        TypeId = FourByteNodeId(getattr(ObjectIds, "{}_Encoding_DefaultBinary".format(obj.__class__.__name__)))
16338
        Encoding |= (1 << 0)
16339
        Body = obj.to_binary()
16340
    packet = []
16341
    packet.append(TypeId.to_binary())
16342
    packet.append(uabin.Primitives.UInt8.pack(Encoding))
16343
    if Body:
16344
        packet.append(uabin.Primitives.Bytes.pack(Body))
16345
    return b''.join(packet)
16346