Completed
Pull Request — master (#180)
by
unknown
03:21
created

ReadEventDetails.__str__()   A

Complexity

Conditions 1

Size

Total Lines 5

Duplication

Lines 5
Ratio 100 %

Code Coverage

Tests 1
CRAP Score 1.125
Metric Value
cc 1
dl 5
loc 5
rs 9.4285
ccs 1
cts 2
cp 0.5
crap 1.125
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.common.uaerrors import UaError
10 1
from opcua.ua.uatypes import *
11 1
from opcua.ua.object_ids import ObjectIds
12
13
14 1
class NamingRuleType(IntEnum):
15
    '''
16
    :ivar Mandatory:
17
    :vartype Mandatory: 1
18
    :ivar Optional:
19
    :vartype Optional: 2
20
    :ivar Constraint:
21
    :vartype Constraint: 3
22
    '''
23 1
    Mandatory = 1
24 1
    Optional = 2
25 1
    Constraint = 3
26
27
28 1
class OpenFileMode(IntEnum):
29
    '''
30
    :ivar Read:
31
    :vartype Read: 1
32
    :ivar Write:
33
    :vartype Write: 2
34
    :ivar EraseExisting:
35
    :vartype EraseExisting: 4
36
    :ivar Append:
37
    :vartype Append: 8
38
    '''
39 1
    Read = 1
40 1
    Write = 2
41 1
    EraseExisting = 4
42 1
    Append = 8
43
44
45 1
class TrustListMasks(IntEnum):
46
    '''
47
    :ivar None_:
48
    :vartype None_: 0
49
    :ivar TrustedCertificates:
50
    :vartype TrustedCertificates: 1
51
    :ivar TrustedCrls:
52
    :vartype TrustedCrls: 2
53
    :ivar IssuerCertificates:
54
    :vartype IssuerCertificates: 4
55
    :ivar IssuerCrls:
56
    :vartype IssuerCrls: 8
57
    :ivar All:
58
    :vartype All: 15
59
    '''
60 1
    None_ = 0
61 1
    TrustedCertificates = 1
62 1
    TrustedCrls = 2
63 1
    IssuerCertificates = 4
64 1
    IssuerCrls = 8
65 1
    All = 15
66
67
68 1
class IdType(IntEnum):
69
    '''
70
    The type of identifier used in a node id.
71
72
    :ivar Numeric:
73
    :vartype Numeric: 0
74
    :ivar String:
75
    :vartype String: 1
76
    :ivar Guid:
77
    :vartype Guid: 2
78
    :ivar Opaque:
79
    :vartype Opaque: 3
80
    '''
81 1
    Numeric = 0
82 1
    String = 1
83 1
    Guid = 2
84 1
    Opaque = 3
85
86
87 1
class NodeClass(IntEnum):
88
    '''
89
    A mask specifying the class of the node.
90
91
    :ivar Unspecified:
92
    :vartype Unspecified: 0
93
    :ivar Object:
94
    :vartype Object: 1
95
    :ivar Variable:
96
    :vartype Variable: 2
97
    :ivar Method:
98
    :vartype Method: 4
99
    :ivar ObjectType:
100
    :vartype ObjectType: 8
101
    :ivar VariableType:
102
    :vartype VariableType: 16
103
    :ivar ReferenceType:
104
    :vartype ReferenceType: 32
105
    :ivar DataType:
106
    :vartype DataType: 64
107
    :ivar View:
108
    :vartype View: 128
109
    '''
110 1
    Unspecified = 0
111 1
    Object = 1
112 1
    Variable = 2
113 1
    Method = 4
114 1
    ObjectType = 8
115 1
    VariableType = 16
116 1
    ReferenceType = 32
117 1
    DataType = 64
118 1
    View = 128
119
120
121 1
class ApplicationType(IntEnum):
122
    '''
123
    The types of applications.
124
125
    :ivar Server:
126
    :vartype Server: 0
127
    :ivar Client:
128
    :vartype Client: 1
129
    :ivar ClientAndServer:
130
    :vartype ClientAndServer: 2
131
    :ivar DiscoveryServer:
132
    :vartype DiscoveryServer: 3
133
    '''
134 1
    Server = 0
135 1
    Client = 1
136 1
    ClientAndServer = 2
137 1
    DiscoveryServer = 3
138
139
140 1
class MessageSecurityMode(IntEnum):
141
    '''
142
    The type of security to use on a message.
143
144
    :ivar Invalid:
145
    :vartype Invalid: 0
146
    :ivar None_:
147
    :vartype None_: 1
148
    :ivar Sign:
149
    :vartype Sign: 2
150
    :ivar SignAndEncrypt:
151
    :vartype SignAndEncrypt: 3
152
    '''
153 1
    Invalid = 0
154 1
    None_ = 1
155 1
    Sign = 2
156 1
    SignAndEncrypt = 3
157
158
159 1
class UserTokenType(IntEnum):
160
    '''
161
    The possible user token types.
162
163
    :ivar Anonymous:
164
    :vartype Anonymous: 0
165
    :ivar UserName:
166
    :vartype UserName: 1
167
    :ivar Certificate:
168
    :vartype Certificate: 2
169
    :ivar IssuedToken:
170
    :vartype IssuedToken: 3
171
    :ivar Kerberos:
172
    :vartype Kerberos: 4
173
    '''
174 1
    Anonymous = 0
175 1
    UserName = 1
176 1
    Certificate = 2
177 1
    IssuedToken = 3
178 1
    Kerberos = 4
179
180
181 1
class SecurityTokenRequestType(IntEnum):
182
    '''
183
    Indicates whether a token if being created or renewed.
184
185
    :ivar Issue:
186
    :vartype Issue: 0
187
    :ivar Renew:
188
    :vartype Renew: 1
189
    '''
190 1
    Issue = 0
191 1
    Renew = 1
192
193
194 1
class NodeAttributesMask(IntEnum):
195
    '''
196
    The bits used to specify default attributes for a new node.
197
198
    :ivar None_:
199
    :vartype None_: 0
200
    :ivar AccessLevel:
201
    :vartype AccessLevel: 1
202
    :ivar ArrayDimensions:
203
    :vartype ArrayDimensions: 2
204
    :ivar BrowseName:
205
    :vartype BrowseName: 4
206
    :ivar ContainsNoLoops:
207
    :vartype ContainsNoLoops: 8
208
    :ivar DataType:
209
    :vartype DataType: 16
210
    :ivar Description:
211
    :vartype Description: 32
212
    :ivar DisplayName:
213
    :vartype DisplayName: 64
214
    :ivar EventNotifier:
215
    :vartype EventNotifier: 128
216
    :ivar Executable:
217
    :vartype Executable: 256
218
    :ivar Historizing:
219
    :vartype Historizing: 512
220
    :ivar InverseName:
221
    :vartype InverseName: 1024
222
    :ivar IsAbstract:
223
    :vartype IsAbstract: 2048
224
    :ivar MinimumSamplingInterval:
225
    :vartype MinimumSamplingInterval: 4096
226
    :ivar NodeClass:
227
    :vartype NodeClass: 8192
228
    :ivar NodeId:
229
    :vartype NodeId: 16384
230
    :ivar Symmetric:
231
    :vartype Symmetric: 32768
232
    :ivar UserAccessLevel:
233
    :vartype UserAccessLevel: 65536
234
    :ivar UserExecutable:
235
    :vartype UserExecutable: 131072
236
    :ivar UserWriteMask:
237
    :vartype UserWriteMask: 262144
238
    :ivar ValueRank:
239
    :vartype ValueRank: 524288
240
    :ivar WriteMask:
241
    :vartype WriteMask: 1048576
242
    :ivar Value:
243
    :vartype Value: 2097152
244
    :ivar All:
245
    :vartype All: 4194303
246
    :ivar BaseNode:
247
    :vartype BaseNode: 1335396
248
    :ivar Object:
249
    :vartype Object: 1335524
250
    :ivar ObjectTypeOrDataType:
251
    :vartype ObjectTypeOrDataType: 1337444
252
    :ivar Variable:
253
    :vartype Variable: 4026999
254
    :ivar VariableType:
255
    :vartype VariableType: 3958902
256
    :ivar Method:
257
    :vartype Method: 1466724
258
    :ivar ReferenceType:
259
    :vartype ReferenceType: 1371236
260
    :ivar View:
261
    :vartype View: 1335532
262
    '''
263 1
    None_ = 0
264 1
    AccessLevel = 1
265 1
    ArrayDimensions = 2
266 1
    BrowseName = 4
267 1
    ContainsNoLoops = 8
268 1
    DataType = 16
269 1
    Description = 32
270 1
    DisplayName = 64
271 1
    EventNotifier = 128
272 1
    Executable = 256
273 1
    Historizing = 512
274 1
    InverseName = 1024
275 1
    IsAbstract = 2048
276 1
    MinimumSamplingInterval = 4096
277 1
    NodeClass = 8192
278 1
    NodeId = 16384
279 1
    Symmetric = 32768
280 1
    UserAccessLevel = 65536
281 1
    UserExecutable = 131072
282 1
    UserWriteMask = 262144
283 1
    ValueRank = 524288
284 1
    WriteMask = 1048576
285 1
    Value = 2097152
286 1
    All = 4194303
287 1
    BaseNode = 1335396
288 1
    Object = 1335524
289 1
    ObjectTypeOrDataType = 1337444
290 1
    Variable = 4026999
291 1
    VariableType = 3958902
292 1
    Method = 1466724
293 1
    ReferenceType = 1371236
294 1
    View = 1335532
295
296
297 1 View Code Duplication
class AttributeWriteMask(IntEnum):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
298
    '''
299
    Define bits used to indicate which attributes are writable.
300
301
    :ivar None_:
302
    :vartype None_: 0
303
    :ivar AccessLevel:
304
    :vartype AccessLevel: 1
305
    :ivar ArrayDimensions:
306
    :vartype ArrayDimensions: 2
307
    :ivar BrowseName:
308
    :vartype BrowseName: 4
309
    :ivar ContainsNoLoops:
310
    :vartype ContainsNoLoops: 8
311
    :ivar DataType:
312
    :vartype DataType: 16
313
    :ivar Description:
314
    :vartype Description: 32
315
    :ivar DisplayName:
316
    :vartype DisplayName: 64
317
    :ivar EventNotifier:
318
    :vartype EventNotifier: 128
319
    :ivar Executable:
320
    :vartype Executable: 256
321
    :ivar Historizing:
322
    :vartype Historizing: 512
323
    :ivar InverseName:
324
    :vartype InverseName: 1024
325
    :ivar IsAbstract:
326
    :vartype IsAbstract: 2048
327
    :ivar MinimumSamplingInterval:
328
    :vartype MinimumSamplingInterval: 4096
329
    :ivar NodeClass:
330
    :vartype NodeClass: 8192
331
    :ivar NodeId:
332
    :vartype NodeId: 16384
333
    :ivar Symmetric:
334
    :vartype Symmetric: 32768
335
    :ivar UserAccessLevel:
336
    :vartype UserAccessLevel: 65536
337
    :ivar UserExecutable:
338
    :vartype UserExecutable: 131072
339
    :ivar UserWriteMask:
340
    :vartype UserWriteMask: 262144
341
    :ivar ValueRank:
342
    :vartype ValueRank: 524288
343
    :ivar WriteMask:
344
    :vartype WriteMask: 1048576
345
    :ivar ValueForVariableType:
346
    :vartype ValueForVariableType: 2097152
347
    '''
348 1
    None_ = 0
349 1
    AccessLevel = 1
350 1
    ArrayDimensions = 2
351 1
    BrowseName = 4
352 1
    ContainsNoLoops = 8
353 1
    DataType = 16
354 1
    Description = 32
355 1
    DisplayName = 64
356 1
    EventNotifier = 128
357 1
    Executable = 256
358 1
    Historizing = 512
359 1
    InverseName = 1024
360 1
    IsAbstract = 2048
361 1
    MinimumSamplingInterval = 4096
362 1
    NodeClass = 8192
363 1
    NodeId = 16384
364 1
    Symmetric = 32768
365 1
    UserAccessLevel = 65536
366 1
    UserExecutable = 131072
367 1
    UserWriteMask = 262144
368 1
    ValueRank = 524288
369 1
    WriteMask = 1048576
370 1
    ValueForVariableType = 2097152
371
372
373 1
class BrowseDirection(IntEnum):
374
    '''
375
    The directions of the references to return.
376
377
    :ivar Forward:
378
    :vartype Forward: 0
379
    :ivar Inverse:
380
    :vartype Inverse: 1
381
    :ivar Both:
382
    :vartype Both: 2
383
    '''
384 1
    Forward = 0
385 1
    Inverse = 1
386 1
    Both = 2
387
388
389 1
class BrowseResultMask(IntEnum):
390
    '''
391
    A bit mask which specifies what should be returned in a browse response.
392
393
    :ivar None_:
394
    :vartype None_: 0
395
    :ivar ReferenceTypeId:
396
    :vartype ReferenceTypeId: 1
397
    :ivar IsForward:
398
    :vartype IsForward: 2
399
    :ivar NodeClass:
400
    :vartype NodeClass: 4
401
    :ivar BrowseName:
402
    :vartype BrowseName: 8
403
    :ivar DisplayName:
404
    :vartype DisplayName: 16
405
    :ivar TypeDefinition:
406
    :vartype TypeDefinition: 32
407
    :ivar All:
408
    :vartype All: 63
409
    :ivar ReferenceTypeInfo:
410
    :vartype ReferenceTypeInfo: 3
411
    :ivar TargetInfo:
412
    :vartype TargetInfo: 60
413
    '''
414 1
    None_ = 0
415 1
    ReferenceTypeId = 1
416 1
    IsForward = 2
417 1
    NodeClass = 4
418 1
    BrowseName = 8
419 1
    DisplayName = 16
420 1
    TypeDefinition = 32
421 1
    All = 63
422 1
    ReferenceTypeInfo = 3
423 1
    TargetInfo = 60
424
425
426 1
class ComplianceLevel(IntEnum):
427
    '''
428
    :ivar Untested:
429
    :vartype Untested: 0
430
    :ivar Partial:
431
    :vartype Partial: 1
432
    :ivar SelfTested:
433
    :vartype SelfTested: 2
434
    :ivar Certified:
435
    :vartype Certified: 3
436
    '''
437 1
    Untested = 0
438 1
    Partial = 1
439 1
    SelfTested = 2
440 1
    Certified = 3
441
442
443 1
class FilterOperator(IntEnum):
444
    '''
445
    :ivar Equals:
446
    :vartype Equals: 0
447
    :ivar IsNull:
448
    :vartype IsNull: 1
449
    :ivar GreaterThan:
450
    :vartype GreaterThan: 2
451
    :ivar LessThan:
452
    :vartype LessThan: 3
453
    :ivar GreaterThanOrEqual:
454
    :vartype GreaterThanOrEqual: 4
455
    :ivar LessThanOrEqual:
456
    :vartype LessThanOrEqual: 5
457
    :ivar Like:
458
    :vartype Like: 6
459
    :ivar Not:
460
    :vartype Not: 7
461
    :ivar Between:
462
    :vartype Between: 8
463
    :ivar InList:
464
    :vartype InList: 9
465
    :ivar And:
466
    :vartype And: 10
467
    :ivar Or:
468
    :vartype Or: 11
469
    :ivar Cast:
470
    :vartype Cast: 12
471
    :ivar InView:
472
    :vartype InView: 13
473
    :ivar OfType:
474
    :vartype OfType: 14
475
    :ivar RelatedTo:
476
    :vartype RelatedTo: 15
477
    :ivar BitwiseAnd:
478
    :vartype BitwiseAnd: 16
479
    :ivar BitwiseOr:
480
    :vartype BitwiseOr: 17
481
    '''
482 1
    Equals = 0
483 1
    IsNull = 1
484 1
    GreaterThan = 2
485 1
    LessThan = 3
486 1
    GreaterThanOrEqual = 4
487 1
    LessThanOrEqual = 5
488 1
    Like = 6
489 1
    Not = 7
490 1
    Between = 8
491 1
    InList = 9
492 1
    And = 10
493 1
    Or = 11
494 1
    Cast = 12
495 1
    InView = 13
496 1
    OfType = 14
497 1
    RelatedTo = 15
498 1
    BitwiseAnd = 16
499 1
    BitwiseOr = 17
500
501
502 1
class TimestampsToReturn(IntEnum):
503
    '''
504
    :ivar Source:
505
    :vartype Source: 0
506
    :ivar Server:
507
    :vartype Server: 1
508
    :ivar Both:
509
    :vartype Both: 2
510
    :ivar Neither:
511
    :vartype Neither: 3
512
    '''
513 1
    Source = 0
514 1
    Server = 1
515 1
    Both = 2
516 1
    Neither = 3
517
518
519 1
class HistoryUpdateType(IntEnum):
520
    '''
521
    :ivar Insert:
522
    :vartype Insert: 1
523
    :ivar Replace:
524
    :vartype Replace: 2
525
    :ivar Update:
526
    :vartype Update: 3
527
    :ivar Delete:
528
    :vartype Delete: 4
529
    '''
530 1
    Insert = 1
531 1
    Replace = 2
532 1
    Update = 3
533 1
    Delete = 4
534
535
536 1
class PerformUpdateType(IntEnum):
537
    '''
538
    :ivar Insert:
539
    :vartype Insert: 1
540
    :ivar Replace:
541
    :vartype Replace: 2
542
    :ivar Update:
543
    :vartype Update: 3
544
    :ivar Remove:
545
    :vartype Remove: 4
546
    '''
547 1
    Insert = 1
548 1
    Replace = 2
549 1
    Update = 3
550 1
    Remove = 4
551
552
553 1
class MonitoringMode(IntEnum):
554
    '''
555
    :ivar Disabled:
556
    :vartype Disabled: 0
557
    :ivar Sampling:
558
    :vartype Sampling: 1
559
    :ivar Reporting:
560
    :vartype Reporting: 2
561
    '''
562 1
    Disabled = 0
563 1
    Sampling = 1
564 1
    Reporting = 2
565
566
567 1
class DataChangeTrigger(IntEnum):
568
    '''
569
    :ivar Status:
570
    :vartype Status: 0
571
    :ivar StatusValue:
572
    :vartype StatusValue: 1
573
    :ivar StatusValueTimestamp:
574
    :vartype StatusValueTimestamp: 2
575
    '''
576 1
    Status = 0
577 1
    StatusValue = 1
578 1
    StatusValueTimestamp = 2
579
580
581 1
class DeadbandType(IntEnum):
582
    '''
583
    :ivar None_:
584
    :vartype None_: 0
585
    :ivar Absolute:
586
    :vartype Absolute: 1
587
    :ivar Percent:
588
    :vartype Percent: 2
589
    '''
590 1
    None_ = 0
591 1
    Absolute = 1
592 1
    Percent = 2
593
594
595 1
class EnumeratedTestType(IntEnum):
596
    '''
597
    A simple enumerated type used for testing.
598
599
    :ivar Red:
600
    :vartype Red: 1
601
    :ivar Yellow:
602
    :vartype Yellow: 4
603
    :ivar Green:
604
    :vartype Green: 5
605
    '''
606 1
    Red = 1
607 1
    Yellow = 4
608 1
    Green = 5
609
610
611 1
class RedundancySupport(IntEnum):
612
    '''
613
    :ivar None_:
614
    :vartype None_: 0
615
    :ivar Cold:
616
    :vartype Cold: 1
617
    :ivar Warm:
618
    :vartype Warm: 2
619
    :ivar Hot:
620
    :vartype Hot: 3
621
    :ivar Transparent:
622
    :vartype Transparent: 4
623
    :ivar HotAndMirrored:
624
    :vartype HotAndMirrored: 5
625
    '''
626 1
    None_ = 0
627 1
    Cold = 1
628 1
    Warm = 2
629 1
    Hot = 3
630 1
    Transparent = 4
631 1
    HotAndMirrored = 5
632
633
634 1
class ServerState(IntEnum):
635
    '''
636
    :ivar Running:
637
    :vartype Running: 0
638
    :ivar Failed:
639
    :vartype Failed: 1
640
    :ivar NoConfiguration:
641
    :vartype NoConfiguration: 2
642
    :ivar Suspended:
643
    :vartype Suspended: 3
644
    :ivar Shutdown:
645
    :vartype Shutdown: 4
646
    :ivar Test:
647
    :vartype Test: 5
648
    :ivar CommunicationFault:
649
    :vartype CommunicationFault: 6
650
    :ivar Unknown:
651
    :vartype Unknown: 7
652
    '''
653 1
    Running = 0
654 1
    Failed = 1
655 1
    NoConfiguration = 2
656 1
    Suspended = 3
657 1
    Shutdown = 4
658 1
    Test = 5
659 1
    CommunicationFault = 6
660 1
    Unknown = 7
661
662
663 1
class ModelChangeStructureVerbMask(IntEnum):
664
    '''
665
    :ivar NodeAdded:
666
    :vartype NodeAdded: 1
667
    :ivar NodeDeleted:
668
    :vartype NodeDeleted: 2
669
    :ivar ReferenceAdded:
670
    :vartype ReferenceAdded: 4
671
    :ivar ReferenceDeleted:
672
    :vartype ReferenceDeleted: 8
673
    :ivar DataTypeChanged:
674
    :vartype DataTypeChanged: 16
675
    '''
676 1
    NodeAdded = 1
677 1
    NodeDeleted = 2
678 1
    ReferenceAdded = 4
679 1
    ReferenceDeleted = 8
680 1
    DataTypeChanged = 16
681
682
683 1
class AxisScaleEnumeration(IntEnum):
684
    '''
685
    :ivar Linear:
686
    :vartype Linear: 0
687
    :ivar Log:
688
    :vartype Log: 1
689
    :ivar Ln:
690
    :vartype Ln: 2
691
    '''
692 1
    Linear = 0
693 1
    Log = 1
694 1
    Ln = 2
695
696
697 1
class ExceptionDeviationFormat(IntEnum):
698
    '''
699
    :ivar AbsoluteValue:
700
    :vartype AbsoluteValue: 0
701
    :ivar PercentOfValue:
702
    :vartype PercentOfValue: 1
703
    :ivar PercentOfRange:
704
    :vartype PercentOfRange: 2
705
    :ivar PercentOfEURange:
706
    :vartype PercentOfEURange: 3
707
    :ivar Unknown:
708
    :vartype Unknown: 4
709
    '''
710 1
    AbsoluteValue = 0
711 1
    PercentOfValue = 1
712 1
    PercentOfRange = 2
713 1
    PercentOfEURange = 3
714 1
    Unknown = 4
715
716
717 1
class DiagnosticInfo(FrozenClass):
718
    '''
719
    A recursive structure containing diagnostic information associated with a status code.
720
721
    :ivar Encoding:
722
    :vartype Encoding: UInt8
723
    :ivar SymbolicId:
724
    :vartype SymbolicId: Int32
725
    :ivar NamespaceURI:
726
    :vartype NamespaceURI: Int32
727
    :ivar Locale:
728
    :vartype Locale: Int32
729
    :ivar LocalizedText:
730
    :vartype LocalizedText: Int32
731
    :ivar AdditionalInfo:
732
    :vartype AdditionalInfo: CharArray
733
    :ivar InnerStatusCode:
734
    :vartype InnerStatusCode: StatusCode
735
    :ivar InnerDiagnosticInfo:
736
    :vartype InnerDiagnosticInfo: DiagnosticInfo
737
    '''
738 1
    def __init__(self, binary=None):
739 1
        if binary is not None:
740 1
            self._binary_init(binary)
741 1
            self._freeze = True
742 1
            return
743 1
        self.Encoding = 0
744 1
        self.SymbolicId = 0
745 1
        self.NamespaceURI = 0
746 1
        self.Locale = 0
747 1
        self.LocalizedText = 0
748 1
        self.AdditionalInfo = b''
749 1
        self.InnerStatusCode = StatusCode()
750 1
        self.InnerDiagnosticInfo = None
751 1
        self._freeze = True
752
753 1
    def to_binary(self):
754 1
        packet = []
755 1
        if self.SymbolicId: self.Encoding |= (1 << 0)
756 1
        if self.NamespaceURI: self.Encoding |= (1 << 1)
757 1
        if self.Locale: self.Encoding |= (1 << 2)
758 1
        if self.LocalizedText: self.Encoding |= (1 << 3)
759 1
        if self.AdditionalInfo: self.Encoding |= (1 << 4)
760 1
        if self.InnerStatusCode: self.Encoding |= (1 << 5)
761 1
        if self.InnerDiagnosticInfo: self.Encoding |= (1 << 6)
762 1
        packet.append(uatype_UInt8.pack(self.Encoding))
763 1
        if self.SymbolicId: 
764
            packet.append(uatype_Int32.pack(self.SymbolicId))
765 1
        if self.NamespaceURI: 
766
            packet.append(uatype_Int32.pack(self.NamespaceURI))
767 1
        if self.Locale: 
768
            packet.append(uatype_Int32.pack(self.Locale))
769 1
        if self.LocalizedText: 
770
            packet.append(uatype_Int32.pack(self.LocalizedText))
771 1
        if self.AdditionalInfo: 
772
            packet.append(pack_bytes(self.AdditionalInfo))
773 1
        if self.InnerStatusCode: 
774 1
            packet.append(self.InnerStatusCode.to_binary())
775 1
        if self.InnerDiagnosticInfo: 
776
            packet.append(self.InnerDiagnosticInfo.to_binary())
777 1
        return b''.join(packet)
778
779 1
    @staticmethod
780
    def from_binary(data):
781 1
        return DiagnosticInfo(data)
782
783 1
    def _binary_init(self, data):
784 1
        self.Encoding = uatype_UInt8.unpack(data.read(1))[0]
785 1
        if self.Encoding & (1 << 0):
786
            self.SymbolicId = uatype_Int32.unpack(data.read(4))[0]
787
        else:
788 1
            self.SymbolicId = 0
789 1
        if self.Encoding & (1 << 1):
790
            self.NamespaceURI = uatype_Int32.unpack(data.read(4))[0]
791
        else:
792 1
            self.NamespaceURI = 0
793 1
        if self.Encoding & (1 << 2):
794
            self.Locale = uatype_Int32.unpack(data.read(4))[0]
795
        else:
796 1
            self.Locale = 0
797 1
        if self.Encoding & (1 << 3):
798
            self.LocalizedText = uatype_Int32.unpack(data.read(4))[0]
799
        else:
800 1
            self.LocalizedText = 0
801 1
        if self.Encoding & (1 << 4):
802
            self.AdditionalInfo = unpack_bytes(data)
803
        else:
804 1
            self.AdditionalInfo = b''
805 1
        if self.Encoding & (1 << 5):
806 1
            self.InnerStatusCode = StatusCode.from_binary(data)
807
        else:
808
            self.InnerStatusCode = StatusCode()
809 1
        if self.Encoding & (1 << 6):
810
            self.InnerDiagnosticInfo = DiagnosticInfo.from_binary(data)
811
        else:
812 1
            self.InnerDiagnosticInfo = None
813
814 1
    def __str__(self):
815
        return 'DiagnosticInfo(' + 'Encoding:' + str(self.Encoding) + ', ' + \
816
               'SymbolicId:' + str(self.SymbolicId) + ', ' + \
817
               'NamespaceURI:' + str(self.NamespaceURI) + ', ' + \
818
               'Locale:' + str(self.Locale) + ', ' + \
819
               'LocalizedText:' + str(self.LocalizedText) + ', ' + \
820
               'AdditionalInfo:' + str(self.AdditionalInfo) + ', ' + \
821
               'InnerStatusCode:' + str(self.InnerStatusCode) + ', ' + \
822
               'InnerDiagnosticInfo:' + str(self.InnerDiagnosticInfo) + ')'
823
824 1
    __repr__ = __str__
825
826
827 1
class TrustListDataType(FrozenClass):
828
    '''
829
    :ivar SpecifiedLists:
830
    :vartype SpecifiedLists: UInt32
831
    :ivar TrustedCertificates:
832
    :vartype TrustedCertificates: ByteString
833
    :ivar TrustedCrls:
834
    :vartype TrustedCrls: ByteString
835
    :ivar IssuerCertificates:
836
    :vartype IssuerCertificates: ByteString
837
    :ivar IssuerCrls:
838
    :vartype IssuerCrls: ByteString
839
    '''
840 1
    def __init__(self, binary=None):
841
        if binary is not None:
842
            self._binary_init(binary)
843
            self._freeze = True
844
            return
845
        self.SpecifiedLists = 0
846
        self.TrustedCertificates = []
847
        self.TrustedCrls = []
848
        self.IssuerCertificates = []
849
        self.IssuerCrls = []
850
        self._freeze = True
851
852 1
    def to_binary(self):
853
        packet = []
854
        packet.append(uatype_UInt32.pack(self.SpecifiedLists))
855
        packet.append(uatype_Int32.pack(len(self.TrustedCertificates)))
856
        for fieldname in self.TrustedCertificates:
857
            packet.append(pack_bytes(fieldname))
858
        packet.append(uatype_Int32.pack(len(self.TrustedCrls)))
859
        for fieldname in self.TrustedCrls:
860
            packet.append(pack_bytes(fieldname))
861
        packet.append(uatype_Int32.pack(len(self.IssuerCertificates)))
862
        for fieldname in self.IssuerCertificates:
863
            packet.append(pack_bytes(fieldname))
864
        packet.append(uatype_Int32.pack(len(self.IssuerCrls)))
865
        for fieldname in self.IssuerCrls:
866
            packet.append(pack_bytes(fieldname))
867
        return b''.join(packet)
868
869 1
    @staticmethod
870
    def from_binary(data):
871
        return TrustListDataType(data)
872
873 1
    def _binary_init(self, data):
874
        self.SpecifiedLists = uatype_UInt32.unpack(data.read(4))[0]
875
        self.TrustedCertificates = unpack_uatype_array('ByteString', data)
876
        self.TrustedCrls = unpack_uatype_array('ByteString', data)
877
        self.IssuerCertificates = unpack_uatype_array('ByteString', data)
878
        self.IssuerCrls = unpack_uatype_array('ByteString', data)
879
880 1
    def __str__(self):
881
        return 'TrustListDataType(' + 'SpecifiedLists:' + str(self.SpecifiedLists) + ', ' + \
882
               'TrustedCertificates:' + str(self.TrustedCertificates) + ', ' + \
883
               'TrustedCrls:' + str(self.TrustedCrls) + ', ' + \
884
               'IssuerCertificates:' + str(self.IssuerCertificates) + ', ' + \
885
               'IssuerCrls:' + str(self.IssuerCrls) + ')'
886
887 1
    __repr__ = __str__
888
889
890 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...
891
    '''
892
    An argument for a method.
893
894
    :ivar Name:
895
    :vartype Name: String
896
    :ivar DataType:
897
    :vartype DataType: NodeId
898
    :ivar ValueRank:
899
    :vartype ValueRank: Int32
900
    :ivar ArrayDimensions:
901
    :vartype ArrayDimensions: UInt32
902
    :ivar Description:
903
    :vartype Description: LocalizedText
904
    '''
905 1
    def __init__(self, binary=None):
906 1
        if binary is not None:
907
            self._binary_init(binary)
908
            self._freeze = True
909
            return
910 1
        self.Name = ''
911 1
        self.DataType = NodeId()
912 1
        self.ValueRank = 0
913 1
        self.ArrayDimensions = []
914 1
        self.Description = LocalizedText()
915 1
        self._freeze = True
916
917 1
    def to_binary(self):
918
        packet = []
919
        packet.append(pack_string(self.Name))
920
        packet.append(self.DataType.to_binary())
921
        packet.append(uatype_Int32.pack(self.ValueRank))
922
        packet.append(uatype_Int32.pack(len(self.ArrayDimensions)))
923
        for fieldname in self.ArrayDimensions:
924
            packet.append(uatype_UInt32.pack(fieldname))
925
        packet.append(self.Description.to_binary())
926
        return b''.join(packet)
927
928 1
    @staticmethod
929
    def from_binary(data):
930
        return Argument(data)
931
932 1
    def _binary_init(self, data):
933
        self.Name = unpack_string(data)
934
        self.DataType = NodeId.from_binary(data)
935
        self.ValueRank = uatype_Int32.unpack(data.read(4))[0]
936
        self.ArrayDimensions = unpack_uatype_array('UInt32', data)
937
        self.Description = LocalizedText.from_binary(data)
938
939 1
    def __str__(self):
940
        return 'Argument(' + 'Name:' + str(self.Name) + ', ' + \
941
               'DataType:' + str(self.DataType) + ', ' + \
942
               'ValueRank:' + str(self.ValueRank) + ', ' + \
943
               'ArrayDimensions:' + str(self.ArrayDimensions) + ', ' + \
944
               'Description:' + str(self.Description) + ')'
945
946 1
    __repr__ = __str__
947
948
949 1
class EnumValueType(FrozenClass):
950
    '''
951
    A mapping between a value of an enumerated type and a name and description.
952
953
    :ivar Value:
954
    :vartype Value: Int64
955
    :ivar DisplayName:
956
    :vartype DisplayName: LocalizedText
957
    :ivar Description:
958
    :vartype Description: LocalizedText
959
    '''
960 1
    def __init__(self, binary=None):
961
        if binary is not None:
962
            self._binary_init(binary)
963
            self._freeze = True
964
            return
965
        self.Value = 0
966
        self.DisplayName = LocalizedText()
967
        self.Description = LocalizedText()
968
        self._freeze = True
969
970 1
    def to_binary(self):
971
        packet = []
972
        packet.append(uatype_Int64.pack(self.Value))
973
        packet.append(self.DisplayName.to_binary())
974
        packet.append(self.Description.to_binary())
975
        return b''.join(packet)
976
977 1
    @staticmethod
978
    def from_binary(data):
979
        return EnumValueType(data)
980
981 1
    def _binary_init(self, data):
982
        self.Value = uatype_Int64.unpack(data.read(8))[0]
983
        self.DisplayName = LocalizedText.from_binary(data)
984
        self.Description = LocalizedText.from_binary(data)
985
986 1
    def __str__(self):
987
        return 'EnumValueType(' + 'Value:' + str(self.Value) + ', ' + \
988
               'DisplayName:' + str(self.DisplayName) + ', ' + \
989
               'Description:' + str(self.Description) + ')'
990
991 1
    __repr__ = __str__
992
993
994 1
class OptionSet(FrozenClass):
995
    '''
996
    This abstract Structured DataType is the base DataType for all DataTypes representing a bit mask.
997
998
    :ivar Value:
999
    :vartype Value: ByteString
1000
    :ivar ValidBits:
1001
    :vartype ValidBits: ByteString
1002
    '''
1003 1
    def __init__(self, binary=None):
1004
        if binary is not None:
1005
            self._binary_init(binary)
1006
            self._freeze = True
1007
            return
1008
        self.Value = b''
1009
        self.ValidBits = b''
1010
        self._freeze = True
1011
1012 1
    def to_binary(self):
1013
        packet = []
1014
        packet.append(pack_bytes(self.Value))
1015
        packet.append(pack_bytes(self.ValidBits))
1016
        return b''.join(packet)
1017
1018 1
    @staticmethod
1019
    def from_binary(data):
1020
        return OptionSet(data)
1021
1022 1
    def _binary_init(self, data):
1023
        self.Value = unpack_bytes(data)
1024
        self.ValidBits = unpack_bytes(data)
1025
1026 1
    def __str__(self):
1027
        return 'OptionSet(' + 'Value:' + str(self.Value) + ', ' + \
1028
               'ValidBits:' + str(self.ValidBits) + ')'
1029
1030 1
    __repr__ = __str__
1031
1032
1033 1 View Code Duplication
class Union(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1034
    '''
1035
    This abstract DataType is the base DataType for all union DataTypes.
1036
1037
    '''
1038 1
    def __init__(self, binary=None):
1039
        if binary is not None:
1040
            self._binary_init(binary)
1041
            self._freeze = True
1042
            return
1043
        self._freeze = True
1044
1045 1
    def to_binary(self):
1046
        packet = []
1047
        return b''.join(packet)
1048
1049 1
    @staticmethod
1050
    def from_binary(data):
1051
        return Union(data)
1052
1053 1
    def _binary_init(self, data):
1054
        pass
1055
1056 1
    def __str__(self):
1057
        return 'Union(' +  + ')'
1058
1059 1
    __repr__ = __str__
1060
1061
1062 1
class TimeZoneDataType(FrozenClass):
1063
    '''
1064
    :ivar Offset:
1065
    :vartype Offset: Int16
1066
    :ivar DaylightSavingInOffset:
1067
    :vartype DaylightSavingInOffset: Boolean
1068
    '''
1069 1
    def __init__(self, binary=None):
1070
        if binary is not None:
1071
            self._binary_init(binary)
1072
            self._freeze = True
1073
            return
1074
        self.Offset = 0
1075
        self.DaylightSavingInOffset = True
1076
        self._freeze = True
1077
1078 1
    def to_binary(self):
1079
        packet = []
1080
        packet.append(uatype_Int16.pack(self.Offset))
1081
        packet.append(uatype_Boolean.pack(self.DaylightSavingInOffset))
1082
        return b''.join(packet)
1083
1084 1
    @staticmethod
1085
    def from_binary(data):
1086
        return TimeZoneDataType(data)
1087
1088 1
    def _binary_init(self, data):
1089
        self.Offset = uatype_Int16.unpack(data.read(2))[0]
1090
        self.DaylightSavingInOffset = uatype_Boolean.unpack(data.read(1))[0]
1091
1092 1
    def __str__(self):
1093
        return 'TimeZoneDataType(' + 'Offset:' + str(self.Offset) + ', ' + \
1094
               'DaylightSavingInOffset:' + str(self.DaylightSavingInOffset) + ')'
1095
1096 1
    __repr__ = __str__
1097
1098
1099 1
class ApplicationDescription(FrozenClass):
1100
    '''
1101
    Describes an application and how to find it.
1102
1103
    :ivar ApplicationUri:
1104
    :vartype ApplicationUri: String
1105
    :ivar ProductUri:
1106
    :vartype ProductUri: String
1107
    :ivar ApplicationName:
1108
    :vartype ApplicationName: LocalizedText
1109
    :ivar ApplicationType:
1110
    :vartype ApplicationType: ApplicationType
1111
    :ivar GatewayServerUri:
1112
    :vartype GatewayServerUri: String
1113
    :ivar DiscoveryProfileUri:
1114
    :vartype DiscoveryProfileUri: String
1115
    :ivar DiscoveryUrls:
1116
    :vartype DiscoveryUrls: String
1117
    '''
1118 1
    def __init__(self, binary=None):
1119 1
        if binary is not None:
1120 1
            self._binary_init(binary)
1121 1
            self._freeze = True
1122 1
            return
1123 1
        self.ApplicationUri = ''
1124 1
        self.ProductUri = ''
1125 1
        self.ApplicationName = LocalizedText()
1126 1
        self.ApplicationType = ApplicationType(0)
1127 1
        self.GatewayServerUri = ''
1128 1
        self.DiscoveryProfileUri = ''
1129 1
        self.DiscoveryUrls = []
1130 1
        self._freeze = True
1131
1132 1
    def to_binary(self):
1133 1
        packet = []
1134 1
        packet.append(pack_string(self.ApplicationUri))
1135 1
        packet.append(pack_string(self.ProductUri))
1136 1
        packet.append(self.ApplicationName.to_binary())
1137 1
        packet.append(uatype_UInt32.pack(self.ApplicationType.value))
1138 1
        packet.append(pack_string(self.GatewayServerUri))
1139 1
        packet.append(pack_string(self.DiscoveryProfileUri))
1140 1
        packet.append(uatype_Int32.pack(len(self.DiscoveryUrls)))
1141 1
        for fieldname in self.DiscoveryUrls:
1142 1
            packet.append(pack_string(fieldname))
1143 1
        return b''.join(packet)
1144
1145 1
    @staticmethod
1146
    def from_binary(data):
1147 1
        return ApplicationDescription(data)
1148
1149 1
    def _binary_init(self, data):
1150 1
        self.ApplicationUri = unpack_string(data)
1151 1
        self.ProductUri = unpack_string(data)
1152 1
        self.ApplicationName = LocalizedText.from_binary(data)
1153 1
        self.ApplicationType = ApplicationType(uatype_UInt32.unpack(data.read(4))[0])
1154 1
        self.GatewayServerUri = unpack_string(data)
1155 1
        self.DiscoveryProfileUri = unpack_string(data)
1156 1
        self.DiscoveryUrls = unpack_uatype_array('String', data)
1157
1158 1
    def __str__(self):
1159
        return 'ApplicationDescription(' + 'ApplicationUri:' + str(self.ApplicationUri) + ', ' + \
1160
               'ProductUri:' + str(self.ProductUri) + ', ' + \
1161
               'ApplicationName:' + str(self.ApplicationName) + ', ' + \
1162
               'ApplicationType:' + str(self.ApplicationType) + ', ' + \
1163
               'GatewayServerUri:' + str(self.GatewayServerUri) + ', ' + \
1164
               'DiscoveryProfileUri:' + str(self.DiscoveryProfileUri) + ', ' + \
1165
               'DiscoveryUrls:' + str(self.DiscoveryUrls) + ')'
1166
1167 1
    __repr__ = __str__
1168
1169
1170 1 View Code Duplication
class RequestHeader(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1171
    '''
1172
    The header passed with every server request.
1173
1174
    :ivar AuthenticationToken:
1175
    :vartype AuthenticationToken: NodeId
1176
    :ivar Timestamp:
1177
    :vartype Timestamp: DateTime
1178
    :ivar RequestHandle:
1179
    :vartype RequestHandle: UInt32
1180
    :ivar ReturnDiagnostics:
1181
    :vartype ReturnDiagnostics: UInt32
1182
    :ivar AuditEntryId:
1183
    :vartype AuditEntryId: String
1184
    :ivar TimeoutHint:
1185
    :vartype TimeoutHint: UInt32
1186
    :ivar AdditionalHeader:
1187
    :vartype AdditionalHeader: ExtensionObject
1188
    '''
1189 1
    def __init__(self, binary=None):
1190 1
        if binary is not None:
1191 1
            self._binary_init(binary)
1192 1
            self._freeze = True
1193 1
            return
1194 1
        self.AuthenticationToken = NodeId()
1195 1
        self.Timestamp = datetime.now()
1196 1
        self.RequestHandle = 0
1197 1
        self.ReturnDiagnostics = 0
1198 1
        self.AuditEntryId = ''
1199 1
        self.TimeoutHint = 0
1200 1
        self.AdditionalHeader = None
1201 1
        self._freeze = True
1202
1203 1
    def to_binary(self):
1204 1
        packet = []
1205 1
        packet.append(self.AuthenticationToken.to_binary())
1206 1
        packet.append(pack_datetime(self.Timestamp))
1207 1
        packet.append(uatype_UInt32.pack(self.RequestHandle))
1208 1
        packet.append(uatype_UInt32.pack(self.ReturnDiagnostics))
1209 1
        packet.append(pack_string(self.AuditEntryId))
1210 1
        packet.append(uatype_UInt32.pack(self.TimeoutHint))
1211 1
        packet.append(extensionobject_to_binary(self.AdditionalHeader))
1212 1
        return b''.join(packet)
1213
1214 1
    @staticmethod
1215
    def from_binary(data):
1216 1
        return RequestHeader(data)
1217
1218 1
    def _binary_init(self, data):
1219 1
        self.AuthenticationToken = NodeId.from_binary(data)
1220 1
        self.Timestamp = unpack_datetime(data)
1221 1
        self.RequestHandle = uatype_UInt32.unpack(data.read(4))[0]
1222 1
        self.ReturnDiagnostics = uatype_UInt32.unpack(data.read(4))[0]
1223 1
        self.AuditEntryId = unpack_string(data)
1224 1
        self.TimeoutHint = uatype_UInt32.unpack(data.read(4))[0]
1225 1
        self.AdditionalHeader = extensionobject_from_binary(data)
1226
1227 1
    def __str__(self):
1228
        return 'RequestHeader(' + 'AuthenticationToken:' + str(self.AuthenticationToken) + ', ' + \
1229
               'Timestamp:' + str(self.Timestamp) + ', ' + \
1230
               'RequestHandle:' + str(self.RequestHandle) + ', ' + \
1231
               'ReturnDiagnostics:' + str(self.ReturnDiagnostics) + ', ' + \
1232
               'AuditEntryId:' + str(self.AuditEntryId) + ', ' + \
1233
               'TimeoutHint:' + str(self.TimeoutHint) + ', ' + \
1234
               'AdditionalHeader:' + str(self.AdditionalHeader) + ')'
1235
1236 1
    __repr__ = __str__
1237
1238
1239 1
class ResponseHeader(FrozenClass):
1240
    '''
1241
    The header passed with every server response.
1242
1243
    :ivar Timestamp:
1244
    :vartype Timestamp: DateTime
1245
    :ivar RequestHandle:
1246
    :vartype RequestHandle: UInt32
1247
    :ivar ServiceResult:
1248
    :vartype ServiceResult: StatusCode
1249
    :ivar ServiceDiagnostics:
1250
    :vartype ServiceDiagnostics: DiagnosticInfo
1251
    :ivar StringTable:
1252
    :vartype StringTable: String
1253
    :ivar AdditionalHeader:
1254
    :vartype AdditionalHeader: ExtensionObject
1255
    '''
1256 1
    def __init__(self, binary=None):
1257 1
        if binary is not None:
1258 1
            self._binary_init(binary)
1259 1
            self._freeze = True
1260 1
            return
1261 1
        self.Timestamp = datetime.now()
1262 1
        self.RequestHandle = 0
1263 1
        self.ServiceResult = StatusCode()
1264 1
        self.ServiceDiagnostics = DiagnosticInfo()
1265 1
        self.StringTable = []
1266 1
        self.AdditionalHeader = None
1267 1
        self._freeze = True
1268
1269 1
    def to_binary(self):
1270 1
        packet = []
1271 1
        packet.append(pack_datetime(self.Timestamp))
1272 1
        packet.append(uatype_UInt32.pack(self.RequestHandle))
1273 1
        packet.append(self.ServiceResult.to_binary())
1274 1
        packet.append(self.ServiceDiagnostics.to_binary())
1275 1
        packet.append(uatype_Int32.pack(len(self.StringTable)))
1276 1
        for fieldname in self.StringTable:
1277
            packet.append(pack_string(fieldname))
1278 1
        packet.append(extensionobject_to_binary(self.AdditionalHeader))
1279 1
        return b''.join(packet)
1280
1281 1
    @staticmethod
1282
    def from_binary(data):
1283 1
        return ResponseHeader(data)
1284
1285 1
    def _binary_init(self, data):
1286 1
        self.Timestamp = unpack_datetime(data)
1287 1
        self.RequestHandle = uatype_UInt32.unpack(data.read(4))[0]
1288 1
        self.ServiceResult = StatusCode.from_binary(data)
1289 1
        self.ServiceDiagnostics = DiagnosticInfo.from_binary(data)
1290 1
        self.StringTable = unpack_uatype_array('String', data)
1291 1
        self.AdditionalHeader = extensionobject_from_binary(data)
1292
1293 1
    def __str__(self):
1294
        return 'ResponseHeader(' + 'Timestamp:' + str(self.Timestamp) + ', ' + \
1295
               'RequestHandle:' + str(self.RequestHandle) + ', ' + \
1296
               'ServiceResult:' + str(self.ServiceResult) + ', ' + \
1297
               'ServiceDiagnostics:' + str(self.ServiceDiagnostics) + ', ' + \
1298
               'StringTable:' + str(self.StringTable) + ', ' + \
1299
               'AdditionalHeader:' + str(self.AdditionalHeader) + ')'
1300
1301 1
    __repr__ = __str__
1302
1303
1304 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...
1305
    '''
1306
    The response returned by all services when there is a service level error.
1307
1308
    :ivar TypeId:
1309
    :vartype TypeId: NodeId
1310
    :ivar ResponseHeader:
1311
    :vartype ResponseHeader: ResponseHeader
1312
    '''
1313 1
    def __init__(self, binary=None):
1314 1
        if binary is not None:
1315
            self._binary_init(binary)
1316
            self._freeze = True
1317
            return
1318 1
        self.TypeId = FourByteNodeId(ObjectIds.ServiceFault_Encoding_DefaultBinary)
1319 1
        self.ResponseHeader = ResponseHeader()
1320 1
        self._freeze = True
1321
1322 1
    def to_binary(self):
1323 1
        packet = []
1324 1
        packet.append(self.TypeId.to_binary())
1325 1
        packet.append(self.ResponseHeader.to_binary())
1326 1
        return b''.join(packet)
1327
1328 1
    @staticmethod
1329
    def from_binary(data):
1330
        return ServiceFault(data)
1331
1332 1
    def _binary_init(self, data):
1333
        self.TypeId = NodeId.from_binary(data)
1334
        self.ResponseHeader = ResponseHeader.from_binary(data)
1335
1336 1
    def __str__(self):
1337
        return 'ServiceFault(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1338
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
1339
1340 1
    __repr__ = __str__
1341
1342
1343 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...
1344
    '''
1345
    :ivar EndpointUrl:
1346
    :vartype EndpointUrl: String
1347
    :ivar LocaleIds:
1348
    :vartype LocaleIds: String
1349
    :ivar ServerUris:
1350
    :vartype ServerUris: String
1351
    '''
1352 1
    def __init__(self, binary=None):
1353 1
        if binary is not None:
1354 1
            self._binary_init(binary)
1355 1
            self._freeze = True
1356 1
            return
1357 1
        self.EndpointUrl = ''
1358 1
        self.LocaleIds = []
1359 1
        self.ServerUris = []
1360 1
        self._freeze = True
1361
1362 1
    def to_binary(self):
1363 1
        packet = []
1364 1
        packet.append(pack_string(self.EndpointUrl))
1365 1
        packet.append(uatype_Int32.pack(len(self.LocaleIds)))
1366 1
        for fieldname in self.LocaleIds:
1367
            packet.append(pack_string(fieldname))
1368 1
        packet.append(uatype_Int32.pack(len(self.ServerUris)))
1369 1
        for fieldname in self.ServerUris:
1370 1
            packet.append(pack_string(fieldname))
1371 1
        return b''.join(packet)
1372
1373 1
    @staticmethod
1374
    def from_binary(data):
1375 1
        return FindServersParameters(data)
1376
1377 1
    def _binary_init(self, data):
1378 1
        self.EndpointUrl = unpack_string(data)
1379 1
        self.LocaleIds = unpack_uatype_array('String', data)
1380 1
        self.ServerUris = unpack_uatype_array('String', data)
1381
1382 1
    def __str__(self):
1383
        return 'FindServersParameters(' + 'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
1384
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
1385
               'ServerUris:' + str(self.ServerUris) + ')'
1386
1387 1
    __repr__ = __str__
1388
1389
1390 1 View Code Duplication
class FindServersRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1391
    '''
1392
    Finds the servers known to the discovery server.
1393
1394
    :ivar TypeId:
1395
    :vartype TypeId: NodeId
1396
    :ivar RequestHeader:
1397
    :vartype RequestHeader: RequestHeader
1398
    :ivar Parameters:
1399
    :vartype Parameters: FindServersParameters
1400
    '''
1401 1
    def __init__(self, binary=None):
1402 1
        if binary is not None:
1403
            self._binary_init(binary)
1404
            self._freeze = True
1405
            return
1406 1
        self.TypeId = FourByteNodeId(ObjectIds.FindServersRequest_Encoding_DefaultBinary)
1407 1
        self.RequestHeader = RequestHeader()
1408 1
        self.Parameters = FindServersParameters()
1409 1
        self._freeze = True
1410
1411 1
    def to_binary(self):
1412 1
        packet = []
1413 1
        packet.append(self.TypeId.to_binary())
1414 1
        packet.append(self.RequestHeader.to_binary())
1415 1
        packet.append(self.Parameters.to_binary())
1416 1
        return b''.join(packet)
1417
1418 1
    @staticmethod
1419
    def from_binary(data):
1420
        return FindServersRequest(data)
1421
1422 1
    def _binary_init(self, data):
1423
        self.TypeId = NodeId.from_binary(data)
1424
        self.RequestHeader = RequestHeader.from_binary(data)
1425
        self.Parameters = FindServersParameters.from_binary(data)
1426
1427 1
    def __str__(self):
1428
        return 'FindServersRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1429
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
1430
               'Parameters:' + str(self.Parameters) + ')'
1431
1432 1
    __repr__ = __str__
1433
1434
1435 1 View Code Duplication
class FindServersResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1436
    '''
1437
    Finds the servers known to the discovery server.
1438
1439
    :ivar TypeId:
1440
    :vartype TypeId: NodeId
1441
    :ivar ResponseHeader:
1442
    :vartype ResponseHeader: ResponseHeader
1443
    :ivar Servers:
1444
    :vartype Servers: ApplicationDescription
1445
    '''
1446 1
    def __init__(self, binary=None):
1447 1
        if binary is not None:
1448 1
            self._binary_init(binary)
1449 1
            self._freeze = True
1450 1
            return
1451 1
        self.TypeId = FourByteNodeId(ObjectIds.FindServersResponse_Encoding_DefaultBinary)
1452 1
        self.ResponseHeader = ResponseHeader()
1453 1
        self.Servers = []
1454 1
        self._freeze = True
1455
1456 1
    def to_binary(self):
1457 1
        packet = []
1458 1
        packet.append(self.TypeId.to_binary())
1459 1
        packet.append(self.ResponseHeader.to_binary())
1460 1
        packet.append(uatype_Int32.pack(len(self.Servers)))
1461 1
        for fieldname in self.Servers:
1462 1
            packet.append(fieldname.to_binary())
1463 1
        return b''.join(packet)
1464
1465 1
    @staticmethod
1466
    def from_binary(data):
1467 1
        return FindServersResponse(data)
1468
1469 1
    def _binary_init(self, data):
1470 1
        self.TypeId = NodeId.from_binary(data)
1471 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
1472 1
        length = uatype_Int32.unpack(data.read(4))[0]
1473 1
        array = []
1474 1
        if length != -1:
1475 1
            for _ in range(0, length):
1476 1
                array.append(ApplicationDescription.from_binary(data))
1477 1
        self.Servers = array
1478
1479 1
    def __str__(self):
1480
        return 'FindServersResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1481
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
1482
               'Servers:' + str(self.Servers) + ')'
1483
1484 1
    __repr__ = __str__
1485
1486
1487 1
class ServerOnNetwork(FrozenClass):
1488
    '''
1489
    :ivar RecordId:
1490
    :vartype RecordId: UInt32
1491
    :ivar ServerName:
1492
    :vartype ServerName: String
1493
    :ivar DiscoveryUrl:
1494
    :vartype DiscoveryUrl: String
1495
    :ivar ServerCapabilities:
1496
    :vartype ServerCapabilities: String
1497
    '''
1498 1
    def __init__(self, binary=None):
1499
        if binary is not None:
1500
            self._binary_init(binary)
1501
            self._freeze = True
1502
            return
1503
        self.RecordId = 0
1504
        self.ServerName = ''
1505
        self.DiscoveryUrl = ''
1506
        self.ServerCapabilities = []
1507
        self._freeze = True
1508
1509 1
    def to_binary(self):
1510
        packet = []
1511
        packet.append(uatype_UInt32.pack(self.RecordId))
1512
        packet.append(pack_string(self.ServerName))
1513
        packet.append(pack_string(self.DiscoveryUrl))
1514
        packet.append(uatype_Int32.pack(len(self.ServerCapabilities)))
1515
        for fieldname in self.ServerCapabilities:
1516
            packet.append(pack_string(fieldname))
1517
        return b''.join(packet)
1518
1519 1
    @staticmethod
1520
    def from_binary(data):
1521
        return ServerOnNetwork(data)
1522
1523 1
    def _binary_init(self, data):
1524
        self.RecordId = uatype_UInt32.unpack(data.read(4))[0]
1525
        self.ServerName = unpack_string(data)
1526
        self.DiscoveryUrl = unpack_string(data)
1527
        self.ServerCapabilities = unpack_uatype_array('String', data)
1528
1529 1
    def __str__(self):
1530
        return 'ServerOnNetwork(' + 'RecordId:' + str(self.RecordId) + ', ' + \
1531
               'ServerName:' + str(self.ServerName) + ', ' + \
1532
               'DiscoveryUrl:' + str(self.DiscoveryUrl) + ', ' + \
1533
               'ServerCapabilities:' + str(self.ServerCapabilities) + ')'
1534
1535 1
    __repr__ = __str__
1536
1537
1538 1
class FindServersOnNetworkParameters(FrozenClass):
1539
    '''
1540
    :ivar StartingRecordId:
1541
    :vartype StartingRecordId: UInt32
1542
    :ivar MaxRecordsToReturn:
1543
    :vartype MaxRecordsToReturn: UInt32
1544
    :ivar ServerCapabilityFilter:
1545
    :vartype ServerCapabilityFilter: String
1546
    '''
1547 1
    def __init__(self, binary=None):
1548
        if binary is not None:
1549
            self._binary_init(binary)
1550
            self._freeze = True
1551
            return
1552
        self.StartingRecordId = 0
1553
        self.MaxRecordsToReturn = 0
1554
        self.ServerCapabilityFilter = []
1555
        self._freeze = True
1556
1557 1
    def to_binary(self):
1558
        packet = []
1559
        packet.append(uatype_UInt32.pack(self.StartingRecordId))
1560
        packet.append(uatype_UInt32.pack(self.MaxRecordsToReturn))
1561
        packet.append(uatype_Int32.pack(len(self.ServerCapabilityFilter)))
1562
        for fieldname in self.ServerCapabilityFilter:
1563
            packet.append(pack_string(fieldname))
1564
        return b''.join(packet)
1565
1566 1
    @staticmethod
1567
    def from_binary(data):
1568
        return FindServersOnNetworkParameters(data)
1569
1570 1
    def _binary_init(self, data):
1571
        self.StartingRecordId = uatype_UInt32.unpack(data.read(4))[0]
1572
        self.MaxRecordsToReturn = uatype_UInt32.unpack(data.read(4))[0]
1573
        self.ServerCapabilityFilter = unpack_uatype_array('String', data)
1574
1575 1
    def __str__(self):
1576
        return 'FindServersOnNetworkParameters(' + 'StartingRecordId:' + str(self.StartingRecordId) + ', ' + \
1577
               'MaxRecordsToReturn:' + str(self.MaxRecordsToReturn) + ', ' + \
1578
               'ServerCapabilityFilter:' + str(self.ServerCapabilityFilter) + ')'
1579
1580 1
    __repr__ = __str__
1581
1582
1583 1 View Code Duplication
class FindServersOnNetworkRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1584
    '''
1585
    :ivar TypeId:
1586
    :vartype TypeId: NodeId
1587
    :ivar RequestHeader:
1588
    :vartype RequestHeader: RequestHeader
1589
    :ivar Parameters:
1590
    :vartype Parameters: FindServersOnNetworkParameters
1591
    '''
1592 1
    def __init__(self, binary=None):
1593
        if binary is not None:
1594
            self._binary_init(binary)
1595
            self._freeze = True
1596
            return
1597
        self.TypeId = FourByteNodeId(ObjectIds.FindServersOnNetworkRequest_Encoding_DefaultBinary)
1598
        self.RequestHeader = RequestHeader()
1599
        self.Parameters = FindServersOnNetworkParameters()
1600
        self._freeze = True
1601
1602 1
    def to_binary(self):
1603
        packet = []
1604
        packet.append(self.TypeId.to_binary())
1605
        packet.append(self.RequestHeader.to_binary())
1606
        packet.append(self.Parameters.to_binary())
1607
        return b''.join(packet)
1608
1609 1
    @staticmethod
1610
    def from_binary(data):
1611
        return FindServersOnNetworkRequest(data)
1612
1613 1
    def _binary_init(self, data):
1614
        self.TypeId = NodeId.from_binary(data)
1615
        self.RequestHeader = RequestHeader.from_binary(data)
1616
        self.Parameters = FindServersOnNetworkParameters.from_binary(data)
1617
1618 1
    def __str__(self):
1619
        return 'FindServersOnNetworkRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1620
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
1621
               'Parameters:' + str(self.Parameters) + ')'
1622
1623 1
    __repr__ = __str__
1624
1625
1626 1
class FindServersOnNetworkResult(FrozenClass):
1627
    '''
1628
    :ivar LastCounterResetTime:
1629
    :vartype LastCounterResetTime: DateTime
1630
    :ivar Servers:
1631
    :vartype Servers: ServerOnNetwork
1632
    '''
1633 1
    def __init__(self, binary=None):
1634
        if binary is not None:
1635
            self._binary_init(binary)
1636
            self._freeze = True
1637
            return
1638
        self.LastCounterResetTime = datetime.now()
1639
        self.Servers = []
1640
        self._freeze = True
1641
1642 1
    def to_binary(self):
1643
        packet = []
1644
        packet.append(pack_datetime(self.LastCounterResetTime))
1645
        packet.append(uatype_Int32.pack(len(self.Servers)))
1646
        for fieldname in self.Servers:
1647
            packet.append(fieldname.to_binary())
1648
        return b''.join(packet)
1649
1650 1
    @staticmethod
1651
    def from_binary(data):
1652
        return FindServersOnNetworkResult(data)
1653
1654 1
    def _binary_init(self, data):
1655
        self.LastCounterResetTime = unpack_datetime(data)
1656
        length = uatype_Int32.unpack(data.read(4))[0]
1657
        array = []
1658
        if length != -1:
1659
            for _ in range(0, length):
1660
                array.append(ServerOnNetwork.from_binary(data))
1661
        self.Servers = array
1662
1663 1
    def __str__(self):
1664
        return 'FindServersOnNetworkResult(' + 'LastCounterResetTime:' + str(self.LastCounterResetTime) + ', ' + \
1665
               'Servers:' + str(self.Servers) + ')'
1666
1667 1
    __repr__ = __str__
1668
1669
1670 1 View Code Duplication
class FindServersOnNetworkResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1671
    '''
1672
    :ivar TypeId:
1673
    :vartype TypeId: NodeId
1674
    :ivar ResponseHeader:
1675
    :vartype ResponseHeader: ResponseHeader
1676
    :ivar Parameters:
1677
    :vartype Parameters: FindServersOnNetworkResult
1678
    '''
1679 1
    def __init__(self, binary=None):
1680
        if binary is not None:
1681
            self._binary_init(binary)
1682
            self._freeze = True
1683
            return
1684
        self.TypeId = FourByteNodeId(ObjectIds.FindServersOnNetworkResponse_Encoding_DefaultBinary)
1685
        self.ResponseHeader = ResponseHeader()
1686
        self.Parameters = FindServersOnNetworkResult()
1687
        self._freeze = True
1688
1689 1
    def to_binary(self):
1690
        packet = []
1691
        packet.append(self.TypeId.to_binary())
1692
        packet.append(self.ResponseHeader.to_binary())
1693
        packet.append(self.Parameters.to_binary())
1694
        return b''.join(packet)
1695
1696 1
    @staticmethod
1697
    def from_binary(data):
1698
        return FindServersOnNetworkResponse(data)
1699
1700 1
    def _binary_init(self, data):
1701
        self.TypeId = NodeId.from_binary(data)
1702
        self.ResponseHeader = ResponseHeader.from_binary(data)
1703
        self.Parameters = FindServersOnNetworkResult.from_binary(data)
1704
1705 1
    def __str__(self):
1706
        return 'FindServersOnNetworkResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1707
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
1708
               'Parameters:' + str(self.Parameters) + ')'
1709
1710 1
    __repr__ = __str__
1711
1712
1713 1
class UserTokenPolicy(FrozenClass):
1714
    '''
1715
    Describes a user token that can be used with a server.
1716
1717
    :ivar PolicyId:
1718
    :vartype PolicyId: String
1719
    :ivar TokenType:
1720
    :vartype TokenType: UserTokenType
1721
    :ivar IssuedTokenType:
1722
    :vartype IssuedTokenType: String
1723
    :ivar IssuerEndpointUrl:
1724
    :vartype IssuerEndpointUrl: String
1725
    :ivar SecurityPolicyUri:
1726
    :vartype SecurityPolicyUri: String
1727
    '''
1728 1
    def __init__(self, binary=None):
1729 1
        if binary is not None:
1730 1
            self._binary_init(binary)
1731 1
            self._freeze = True
1732 1
            return
1733 1
        self.PolicyId = ''
1734 1
        self.TokenType = UserTokenType(0)
1735 1
        self.IssuedTokenType = ''
1736 1
        self.IssuerEndpointUrl = ''
1737 1
        self.SecurityPolicyUri = ''
1738 1
        self._freeze = True
1739
1740 1
    def to_binary(self):
1741 1
        packet = []
1742 1
        packet.append(pack_string(self.PolicyId))
1743 1
        packet.append(uatype_UInt32.pack(self.TokenType.value))
1744 1
        packet.append(pack_string(self.IssuedTokenType))
1745 1
        packet.append(pack_string(self.IssuerEndpointUrl))
1746 1
        packet.append(pack_string(self.SecurityPolicyUri))
1747 1
        return b''.join(packet)
1748
1749 1
    @staticmethod
1750
    def from_binary(data):
1751 1
        return UserTokenPolicy(data)
1752
1753 1
    def _binary_init(self, data):
1754 1
        self.PolicyId = unpack_string(data)
1755 1
        self.TokenType = UserTokenType(uatype_UInt32.unpack(data.read(4))[0])
1756 1
        self.IssuedTokenType = unpack_string(data)
1757 1
        self.IssuerEndpointUrl = unpack_string(data)
1758 1
        self.SecurityPolicyUri = unpack_string(data)
1759
1760 1
    def __str__(self):
1761
        return 'UserTokenPolicy(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
1762
               'TokenType:' + str(self.TokenType) + ', ' + \
1763
               'IssuedTokenType:' + str(self.IssuedTokenType) + ', ' + \
1764
               'IssuerEndpointUrl:' + str(self.IssuerEndpointUrl) + ', ' + \
1765
               'SecurityPolicyUri:' + str(self.SecurityPolicyUri) + ')'
1766
1767 1
    __repr__ = __str__
1768
1769
1770 1 View Code Duplication
class EndpointDescription(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1771
    '''
1772
    The description of a endpoint that can be used to access a server.
1773
1774
    :ivar EndpointUrl:
1775
    :vartype EndpointUrl: String
1776
    :ivar Server:
1777
    :vartype Server: ApplicationDescription
1778
    :ivar ServerCertificate:
1779
    :vartype ServerCertificate: ByteString
1780
    :ivar SecurityMode:
1781
    :vartype SecurityMode: MessageSecurityMode
1782
    :ivar SecurityPolicyUri:
1783
    :vartype SecurityPolicyUri: String
1784
    :ivar UserIdentityTokens:
1785
    :vartype UserIdentityTokens: UserTokenPolicy
1786
    :ivar TransportProfileUri:
1787
    :vartype TransportProfileUri: String
1788
    :ivar SecurityLevel:
1789
    :vartype SecurityLevel: Byte
1790
    '''
1791 1
    def __init__(self, binary=None):
1792 1
        if binary is not None:
1793 1
            self._binary_init(binary)
1794 1
            self._freeze = True
1795 1
            return
1796 1
        self.EndpointUrl = ''
1797 1
        self.Server = ApplicationDescription()
1798 1
        self.ServerCertificate = b''
1799 1
        self.SecurityMode = MessageSecurityMode(0)
1800 1
        self.SecurityPolicyUri = ''
1801 1
        self.UserIdentityTokens = []
1802 1
        self.TransportProfileUri = ''
1803 1
        self.SecurityLevel = 0
1804 1
        self._freeze = True
1805
1806 1
    def to_binary(self):
1807 1
        packet = []
1808 1
        packet.append(pack_string(self.EndpointUrl))
1809 1
        packet.append(self.Server.to_binary())
1810 1
        packet.append(pack_bytes(self.ServerCertificate))
1811 1
        packet.append(uatype_UInt32.pack(self.SecurityMode.value))
1812 1
        packet.append(pack_string(self.SecurityPolicyUri))
1813 1
        packet.append(uatype_Int32.pack(len(self.UserIdentityTokens)))
1814 1
        for fieldname in self.UserIdentityTokens:
1815 1
            packet.append(fieldname.to_binary())
1816 1
        packet.append(pack_string(self.TransportProfileUri))
1817 1
        packet.append(uatype_Byte.pack(self.SecurityLevel))
1818 1
        return b''.join(packet)
1819
1820 1
    @staticmethod
1821
    def from_binary(data):
1822 1
        return EndpointDescription(data)
1823
1824 1
    def _binary_init(self, data):
1825 1
        self.EndpointUrl = unpack_string(data)
1826 1
        self.Server = ApplicationDescription.from_binary(data)
1827 1
        self.ServerCertificate = unpack_bytes(data)
1828 1
        self.SecurityMode = MessageSecurityMode(uatype_UInt32.unpack(data.read(4))[0])
1829 1
        self.SecurityPolicyUri = unpack_string(data)
1830 1
        length = uatype_Int32.unpack(data.read(4))[0]
1831 1
        array = []
1832 1
        if length != -1:
1833 1
            for _ in range(0, length):
1834 1
                array.append(UserTokenPolicy.from_binary(data))
1835 1
        self.UserIdentityTokens = array
1836 1
        self.TransportProfileUri = unpack_string(data)
1837 1
        self.SecurityLevel = uatype_Byte.unpack(data.read(1))[0]
1838
1839 1
    def __str__(self):
1840
        return 'EndpointDescription(' + 'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
1841
               'Server:' + str(self.Server) + ', ' + \
1842
               'ServerCertificate:' + str(self.ServerCertificate) + ', ' + \
1843
               'SecurityMode:' + str(self.SecurityMode) + ', ' + \
1844
               'SecurityPolicyUri:' + str(self.SecurityPolicyUri) + ', ' + \
1845
               'UserIdentityTokens:' + str(self.UserIdentityTokens) + ', ' + \
1846
               'TransportProfileUri:' + str(self.TransportProfileUri) + ', ' + \
1847
               'SecurityLevel:' + str(self.SecurityLevel) + ')'
1848
1849 1
    __repr__ = __str__
1850
1851
1852 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...
1853
    '''
1854
    :ivar EndpointUrl:
1855
    :vartype EndpointUrl: String
1856
    :ivar LocaleIds:
1857
    :vartype LocaleIds: String
1858
    :ivar ProfileUris:
1859
    :vartype ProfileUris: String
1860
    '''
1861 1
    def __init__(self, binary=None):
1862 1
        if binary is not None:
1863 1
            self._binary_init(binary)
1864 1
            self._freeze = True
1865 1
            return
1866 1
        self.EndpointUrl = ''
1867 1
        self.LocaleIds = []
1868 1
        self.ProfileUris = []
1869 1
        self._freeze = True
1870
1871 1
    def to_binary(self):
1872 1
        packet = []
1873 1
        packet.append(pack_string(self.EndpointUrl))
1874 1
        packet.append(uatype_Int32.pack(len(self.LocaleIds)))
1875 1
        for fieldname in self.LocaleIds:
1876
            packet.append(pack_string(fieldname))
1877 1
        packet.append(uatype_Int32.pack(len(self.ProfileUris)))
1878 1
        for fieldname in self.ProfileUris:
1879
            packet.append(pack_string(fieldname))
1880 1
        return b''.join(packet)
1881
1882 1
    @staticmethod
1883
    def from_binary(data):
1884 1
        return GetEndpointsParameters(data)
1885
1886 1
    def _binary_init(self, data):
1887 1
        self.EndpointUrl = unpack_string(data)
1888 1
        self.LocaleIds = unpack_uatype_array('String', data)
1889 1
        self.ProfileUris = unpack_uatype_array('String', data)
1890
1891 1
    def __str__(self):
1892
        return 'GetEndpointsParameters(' + 'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
1893
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
1894
               'ProfileUris:' + str(self.ProfileUris) + ')'
1895
1896 1
    __repr__ = __str__
1897
1898
1899 1 View Code Duplication
class GetEndpointsRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1900
    '''
1901
    Gets the endpoints used by the server.
1902
1903
    :ivar TypeId:
1904
    :vartype TypeId: NodeId
1905
    :ivar RequestHeader:
1906
    :vartype RequestHeader: RequestHeader
1907
    :ivar Parameters:
1908
    :vartype Parameters: GetEndpointsParameters
1909
    '''
1910 1
    def __init__(self, binary=None):
1911 1
        if binary is not None:
1912
            self._binary_init(binary)
1913
            self._freeze = True
1914
            return
1915 1
        self.TypeId = FourByteNodeId(ObjectIds.GetEndpointsRequest_Encoding_DefaultBinary)
1916 1
        self.RequestHeader = RequestHeader()
1917 1
        self.Parameters = GetEndpointsParameters()
1918 1
        self._freeze = True
1919
1920 1
    def to_binary(self):
1921 1
        packet = []
1922 1
        packet.append(self.TypeId.to_binary())
1923 1
        packet.append(self.RequestHeader.to_binary())
1924 1
        packet.append(self.Parameters.to_binary())
1925 1
        return b''.join(packet)
1926
1927 1
    @staticmethod
1928
    def from_binary(data):
1929
        return GetEndpointsRequest(data)
1930
1931 1
    def _binary_init(self, data):
1932
        self.TypeId = NodeId.from_binary(data)
1933
        self.RequestHeader = RequestHeader.from_binary(data)
1934
        self.Parameters = GetEndpointsParameters.from_binary(data)
1935
1936 1
    def __str__(self):
1937
        return 'GetEndpointsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1938
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
1939
               'Parameters:' + str(self.Parameters) + ')'
1940
1941 1
    __repr__ = __str__
1942
1943
1944 1 View Code Duplication
class GetEndpointsResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1945
    '''
1946
    Gets the endpoints used by the server.
1947
1948
    :ivar TypeId:
1949
    :vartype TypeId: NodeId
1950
    :ivar ResponseHeader:
1951
    :vartype ResponseHeader: ResponseHeader
1952
    :ivar Endpoints:
1953
    :vartype Endpoints: EndpointDescription
1954
    '''
1955 1
    def __init__(self, binary=None):
1956 1
        if binary is not None:
1957 1
            self._binary_init(binary)
1958 1
            self._freeze = True
1959 1
            return
1960 1
        self.TypeId = FourByteNodeId(ObjectIds.GetEndpointsResponse_Encoding_DefaultBinary)
1961 1
        self.ResponseHeader = ResponseHeader()
1962 1
        self.Endpoints = []
1963 1
        self._freeze = True
1964
1965 1
    def to_binary(self):
1966 1
        packet = []
1967 1
        packet.append(self.TypeId.to_binary())
1968 1
        packet.append(self.ResponseHeader.to_binary())
1969 1
        packet.append(uatype_Int32.pack(len(self.Endpoints)))
1970 1
        for fieldname in self.Endpoints:
1971 1
            packet.append(fieldname.to_binary())
1972 1
        return b''.join(packet)
1973
1974 1
    @staticmethod
1975
    def from_binary(data):
1976 1
        return GetEndpointsResponse(data)
1977
1978 1
    def _binary_init(self, data):
1979 1
        self.TypeId = NodeId.from_binary(data)
1980 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
1981 1
        length = uatype_Int32.unpack(data.read(4))[0]
1982 1
        array = []
1983 1
        if length != -1:
1984 1
            for _ in range(0, length):
1985 1
                array.append(EndpointDescription.from_binary(data))
1986 1
        self.Endpoints = array
1987
1988 1
    def __str__(self):
1989
        return 'GetEndpointsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1990
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
1991
               'Endpoints:' + str(self.Endpoints) + ')'
1992
1993 1
    __repr__ = __str__
1994
1995
1996 1 View Code Duplication
class RegisteredServer(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1997
    '''
1998
    The information required to register a server with a discovery server.
1999
2000
    :ivar ServerUri:
2001
    :vartype ServerUri: String
2002
    :ivar ProductUri:
2003
    :vartype ProductUri: String
2004
    :ivar ServerNames:
2005
    :vartype ServerNames: LocalizedText
2006
    :ivar ServerType:
2007
    :vartype ServerType: ApplicationType
2008
    :ivar GatewayServerUri:
2009
    :vartype GatewayServerUri: String
2010
    :ivar DiscoveryUrls:
2011
    :vartype DiscoveryUrls: String
2012
    :ivar SemaphoreFilePath:
2013
    :vartype SemaphoreFilePath: String
2014
    :ivar IsOnline:
2015
    :vartype IsOnline: Boolean
2016
    '''
2017 1
    def __init__(self, binary=None):
2018 1
        if binary is not None:
2019 1
            self._binary_init(binary)
2020 1
            self._freeze = True
2021 1
            return
2022 1
        self.ServerUri = ''
2023 1
        self.ProductUri = ''
2024 1
        self.ServerNames = []
2025 1
        self.ServerType = ApplicationType(0)
2026 1
        self.GatewayServerUri = ''
2027 1
        self.DiscoveryUrls = []
2028 1
        self.SemaphoreFilePath = ''
2029 1
        self.IsOnline = True
2030 1
        self._freeze = True
2031
2032 1
    def to_binary(self):
2033 1
        packet = []
2034 1
        packet.append(pack_string(self.ServerUri))
2035 1
        packet.append(pack_string(self.ProductUri))
2036 1
        packet.append(uatype_Int32.pack(len(self.ServerNames)))
2037 1
        for fieldname in self.ServerNames:
2038 1
            packet.append(fieldname.to_binary())
2039 1
        packet.append(uatype_UInt32.pack(self.ServerType.value))
2040 1
        packet.append(pack_string(self.GatewayServerUri))
2041 1
        packet.append(uatype_Int32.pack(len(self.DiscoveryUrls)))
2042 1
        for fieldname in self.DiscoveryUrls:
2043 1
            packet.append(pack_string(fieldname))
2044 1
        packet.append(pack_string(self.SemaphoreFilePath))
2045 1
        packet.append(uatype_Boolean.pack(self.IsOnline))
2046 1
        return b''.join(packet)
2047
2048 1
    @staticmethod
2049
    def from_binary(data):
2050 1
        return RegisteredServer(data)
2051
2052 1
    def _binary_init(self, data):
2053 1
        self.ServerUri = unpack_string(data)
2054 1
        self.ProductUri = unpack_string(data)
2055 1
        length = uatype_Int32.unpack(data.read(4))[0]
2056 1
        array = []
2057 1
        if length != -1:
2058 1
            for _ in range(0, length):
2059 1
                array.append(LocalizedText.from_binary(data))
2060 1
        self.ServerNames = array
2061 1
        self.ServerType = ApplicationType(uatype_UInt32.unpack(data.read(4))[0])
2062 1
        self.GatewayServerUri = unpack_string(data)
2063 1
        self.DiscoveryUrls = unpack_uatype_array('String', data)
2064 1
        self.SemaphoreFilePath = unpack_string(data)
2065 1
        self.IsOnline = uatype_Boolean.unpack(data.read(1))[0]
2066
2067 1
    def __str__(self):
2068
        return 'RegisteredServer(' + 'ServerUri:' + str(self.ServerUri) + ', ' + \
2069
               'ProductUri:' + str(self.ProductUri) + ', ' + \
2070
               'ServerNames:' + str(self.ServerNames) + ', ' + \
2071
               'ServerType:' + str(self.ServerType) + ', ' + \
2072
               'GatewayServerUri:' + str(self.GatewayServerUri) + ', ' + \
2073
               'DiscoveryUrls:' + str(self.DiscoveryUrls) + ', ' + \
2074
               'SemaphoreFilePath:' + str(self.SemaphoreFilePath) + ', ' + \
2075
               'IsOnline:' + str(self.IsOnline) + ')'
2076
2077 1
    __repr__ = __str__
2078
2079
2080 1 View Code Duplication
class RegisterServerRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2081
    '''
2082
    Registers a server with the discovery server.
2083
2084
    :ivar TypeId:
2085
    :vartype TypeId: NodeId
2086
    :ivar RequestHeader:
2087
    :vartype RequestHeader: RequestHeader
2088
    :ivar Server:
2089
    :vartype Server: RegisteredServer
2090
    '''
2091 1
    def __init__(self, binary=None):
2092 1
        if binary is not None:
2093
            self._binary_init(binary)
2094
            self._freeze = True
2095
            return
2096 1
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServerRequest_Encoding_DefaultBinary)
2097 1
        self.RequestHeader = RequestHeader()
2098 1
        self.Server = RegisteredServer()
2099 1
        self._freeze = True
2100
2101 1
    def to_binary(self):
2102 1
        packet = []
2103 1
        packet.append(self.TypeId.to_binary())
2104 1
        packet.append(self.RequestHeader.to_binary())
2105 1
        packet.append(self.Server.to_binary())
2106 1
        return b''.join(packet)
2107
2108 1
    @staticmethod
2109
    def from_binary(data):
2110
        return RegisterServerRequest(data)
2111
2112 1
    def _binary_init(self, data):
2113
        self.TypeId = NodeId.from_binary(data)
2114
        self.RequestHeader = RequestHeader.from_binary(data)
2115
        self.Server = RegisteredServer.from_binary(data)
2116
2117 1
    def __str__(self):
2118
        return 'RegisterServerRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2119
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2120
               'Server:' + str(self.Server) + ')'
2121
2122 1
    __repr__ = __str__
2123
2124
2125 1 View Code Duplication
class RegisterServerResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2126
    '''
2127
    Registers a server with the discovery server.
2128
2129
    :ivar TypeId:
2130
    :vartype TypeId: NodeId
2131
    :ivar ResponseHeader:
2132
    :vartype ResponseHeader: ResponseHeader
2133
    '''
2134 1
    def __init__(self, binary=None):
2135 1
        if binary is not None:
2136 1
            self._binary_init(binary)
2137 1
            self._freeze = True
2138 1
            return
2139 1
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServerResponse_Encoding_DefaultBinary)
2140 1
        self.ResponseHeader = ResponseHeader()
2141 1
        self._freeze = True
2142
2143 1
    def to_binary(self):
2144 1
        packet = []
2145 1
        packet.append(self.TypeId.to_binary())
2146 1
        packet.append(self.ResponseHeader.to_binary())
2147 1
        return b''.join(packet)
2148
2149 1
    @staticmethod
2150
    def from_binary(data):
2151 1
        return RegisterServerResponse(data)
2152
2153 1
    def _binary_init(self, data):
2154 1
        self.TypeId = NodeId.from_binary(data)
2155 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
2156
2157 1
    def __str__(self):
2158
        return 'RegisterServerResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2159
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
2160
2161 1
    __repr__ = __str__
2162
2163
2164 1 View Code Duplication
class DiscoveryConfiguration(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2165
    '''
2166
    A base type for discovery configuration information.
2167
2168
    '''
2169 1
    def __init__(self, binary=None):
2170
        if binary is not None:
2171
            self._binary_init(binary)
2172
            self._freeze = True
2173
            return
2174
        self._freeze = True
2175
2176 1
    def to_binary(self):
2177
        packet = []
2178
        return b''.join(packet)
2179
2180 1
    @staticmethod
2181
    def from_binary(data):
2182
        return DiscoveryConfiguration(data)
2183
2184 1
    def _binary_init(self, data):
2185
        pass
2186
2187 1
    def __str__(self):
2188
        return 'DiscoveryConfiguration(' +  + ')'
2189
2190 1
    __repr__ = __str__
2191
2192
2193 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...
2194
    '''
2195
    The discovery information needed for mDNS registration.
2196
2197
    :ivar MdnsServerName:
2198
    :vartype MdnsServerName: String
2199
    :ivar ServerCapabilities:
2200
    :vartype ServerCapabilities: String
2201
    '''
2202 1
    def __init__(self, binary=None):
2203
        if binary is not None:
2204
            self._binary_init(binary)
2205
            self._freeze = True
2206
            return
2207
        self.MdnsServerName = ''
2208
        self.ServerCapabilities = []
2209
        self._freeze = True
2210
2211 1
    def to_binary(self):
2212
        packet = []
2213
        packet.append(pack_string(self.MdnsServerName))
2214
        packet.append(uatype_Int32.pack(len(self.ServerCapabilities)))
2215
        for fieldname in self.ServerCapabilities:
2216
            packet.append(pack_string(fieldname))
2217
        return b''.join(packet)
2218
2219 1
    @staticmethod
2220
    def from_binary(data):
2221
        return MdnsDiscoveryConfiguration(data)
2222
2223 1
    def _binary_init(self, data):
2224
        self.MdnsServerName = unpack_string(data)
2225
        self.ServerCapabilities = unpack_uatype_array('String', data)
2226
2227 1
    def __str__(self):
2228
        return 'MdnsDiscoveryConfiguration(' + 'MdnsServerName:' + str(self.MdnsServerName) + ', ' + \
2229
               'ServerCapabilities:' + str(self.ServerCapabilities) + ')'
2230
2231 1
    __repr__ = __str__
2232
2233
2234 1 View Code Duplication
class RegisterServer2Parameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2235
    '''
2236
    :ivar Server:
2237
    :vartype Server: RegisteredServer
2238
    :ivar DiscoveryConfiguration:
2239
    :vartype DiscoveryConfiguration: ExtensionObject
2240
    '''
2241 1
    def __init__(self, binary=None):
2242
        if binary is not None:
2243
            self._binary_init(binary)
2244
            self._freeze = True
2245
            return
2246
        self.Server = RegisteredServer()
2247
        self.DiscoveryConfiguration = []
2248
        self._freeze = True
2249
2250 1
    def to_binary(self):
2251
        packet = []
2252
        packet.append(self.Server.to_binary())
2253
        packet.append(uatype_Int32.pack(len(self.DiscoveryConfiguration)))
2254
        for fieldname in self.DiscoveryConfiguration:
2255
            packet.append(extensionobject_to_binary(fieldname))
2256
        return b''.join(packet)
2257
2258 1
    @staticmethod
2259
    def from_binary(data):
2260
        return RegisterServer2Parameters(data)
2261
2262 1
    def _binary_init(self, data):
2263
        self.Server = RegisteredServer.from_binary(data)
2264
        length = uatype_Int32.unpack(data.read(4))[0]
2265
        array = []
2266
        if length != -1:
2267
            for _ in range(0, length):
2268
                array.append(extensionobject_from_binary(data))
2269
        self.DiscoveryConfiguration = array
2270
2271 1
    def __str__(self):
2272
        return 'RegisterServer2Parameters(' + 'Server:' + str(self.Server) + ', ' + \
2273
               'DiscoveryConfiguration:' + str(self.DiscoveryConfiguration) + ')'
2274
2275 1
    __repr__ = __str__
2276
2277
2278 1 View Code Duplication
class RegisterServer2Request(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2279
    '''
2280
    :ivar TypeId:
2281
    :vartype TypeId: NodeId
2282
    :ivar RequestHeader:
2283
    :vartype RequestHeader: RequestHeader
2284
    :ivar Parameters:
2285
    :vartype Parameters: RegisterServer2Parameters
2286
    '''
2287 1
    def __init__(self, binary=None):
2288
        if binary is not None:
2289
            self._binary_init(binary)
2290
            self._freeze = True
2291
            return
2292
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServer2Request_Encoding_DefaultBinary)
2293
        self.RequestHeader = RequestHeader()
2294
        self.Parameters = RegisterServer2Parameters()
2295
        self._freeze = True
2296
2297 1
    def to_binary(self):
2298
        packet = []
2299
        packet.append(self.TypeId.to_binary())
2300
        packet.append(self.RequestHeader.to_binary())
2301
        packet.append(self.Parameters.to_binary())
2302
        return b''.join(packet)
2303
2304 1
    @staticmethod
2305
    def from_binary(data):
2306
        return RegisterServer2Request(data)
2307
2308 1
    def _binary_init(self, data):
2309
        self.TypeId = NodeId.from_binary(data)
2310
        self.RequestHeader = RequestHeader.from_binary(data)
2311
        self.Parameters = RegisterServer2Parameters.from_binary(data)
2312
2313 1
    def __str__(self):
2314
        return 'RegisterServer2Request(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2315
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2316
               'Parameters:' + str(self.Parameters) + ')'
2317
2318 1
    __repr__ = __str__
2319
2320
2321 1 View Code Duplication
class RegisterServer2Response(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2322
    '''
2323
    :ivar TypeId:
2324
    :vartype TypeId: NodeId
2325
    :ivar ResponseHeader:
2326
    :vartype ResponseHeader: ResponseHeader
2327
    :ivar ConfigurationResults:
2328
    :vartype ConfigurationResults: StatusCode
2329
    :ivar DiagnosticInfos:
2330
    :vartype DiagnosticInfos: DiagnosticInfo
2331
    '''
2332 1
    def __init__(self, binary=None):
2333
        if binary is not None:
2334
            self._binary_init(binary)
2335
            self._freeze = True
2336
            return
2337
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServer2Response_Encoding_DefaultBinary)
2338
        self.ResponseHeader = ResponseHeader()
2339
        self.ConfigurationResults = []
2340
        self.DiagnosticInfos = []
2341
        self._freeze = True
2342
2343 1
    def to_binary(self):
2344
        packet = []
2345
        packet.append(self.TypeId.to_binary())
2346
        packet.append(self.ResponseHeader.to_binary())
2347
        packet.append(uatype_Int32.pack(len(self.ConfigurationResults)))
2348
        for fieldname in self.ConfigurationResults:
2349
            packet.append(fieldname.to_binary())
2350
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
2351
        for fieldname in self.DiagnosticInfos:
2352
            packet.append(fieldname.to_binary())
2353
        return b''.join(packet)
2354
2355 1
    @staticmethod
2356
    def from_binary(data):
2357
        return RegisterServer2Response(data)
2358
2359 1
    def _binary_init(self, data):
2360
        self.TypeId = NodeId.from_binary(data)
2361
        self.ResponseHeader = ResponseHeader.from_binary(data)
2362
        length = uatype_Int32.unpack(data.read(4))[0]
2363
        array = []
2364
        if length != -1:
2365
            for _ in range(0, length):
2366
                array.append(StatusCode.from_binary(data))
2367
        self.ConfigurationResults = array
2368
        length = uatype_Int32.unpack(data.read(4))[0]
2369
        array = []
2370
        if length != -1:
2371
            for _ in range(0, length):
2372
                array.append(DiagnosticInfo.from_binary(data))
2373
        self.DiagnosticInfos = array
2374
2375 1
    def __str__(self):
2376
        return 'RegisterServer2Response(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2377
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
2378
               'ConfigurationResults:' + str(self.ConfigurationResults) + ', ' + \
2379
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
2380
2381 1
    __repr__ = __str__
2382
2383
2384 1
class ChannelSecurityToken(FrozenClass):
2385
    '''
2386
    The token that identifies a set of keys for an active secure channel.
2387
2388
    :ivar ChannelId:
2389
    :vartype ChannelId: UInt32
2390
    :ivar TokenId:
2391
    :vartype TokenId: UInt32
2392
    :ivar CreatedAt:
2393
    :vartype CreatedAt: DateTime
2394
    :ivar RevisedLifetime:
2395
    :vartype RevisedLifetime: UInt32
2396
    '''
2397 1
    def __init__(self, binary=None):
2398 1
        if binary is not None:
2399 1
            self._binary_init(binary)
2400 1
            self._freeze = True
2401 1
            return
2402 1
        self.ChannelId = 0
2403 1
        self.TokenId = 0
2404 1
        self.CreatedAt = datetime.now()
2405 1
        self.RevisedLifetime = 0
2406 1
        self._freeze = True
2407
2408 1
    def to_binary(self):
2409 1
        packet = []
2410 1
        packet.append(uatype_UInt32.pack(self.ChannelId))
2411 1
        packet.append(uatype_UInt32.pack(self.TokenId))
2412 1
        packet.append(pack_datetime(self.CreatedAt))
2413 1
        packet.append(uatype_UInt32.pack(self.RevisedLifetime))
2414 1
        return b''.join(packet)
2415
2416 1
    @staticmethod
2417
    def from_binary(data):
2418 1
        return ChannelSecurityToken(data)
2419
2420 1
    def _binary_init(self, data):
2421 1
        self.ChannelId = uatype_UInt32.unpack(data.read(4))[0]
2422 1
        self.TokenId = uatype_UInt32.unpack(data.read(4))[0]
2423 1
        self.CreatedAt = unpack_datetime(data)
2424 1
        self.RevisedLifetime = uatype_UInt32.unpack(data.read(4))[0]
2425
2426 1
    def __str__(self):
2427
        return 'ChannelSecurityToken(' + 'ChannelId:' + str(self.ChannelId) + ', ' + \
2428
               'TokenId:' + str(self.TokenId) + ', ' + \
2429
               'CreatedAt:' + str(self.CreatedAt) + ', ' + \
2430
               'RevisedLifetime:' + str(self.RevisedLifetime) + ')'
2431
2432 1
    __repr__ = __str__
2433
2434
2435 1
class OpenSecureChannelParameters(FrozenClass):
2436
    '''
2437
    :ivar ClientProtocolVersion:
2438
    :vartype ClientProtocolVersion: UInt32
2439
    :ivar RequestType:
2440
    :vartype RequestType: SecurityTokenRequestType
2441
    :ivar SecurityMode:
2442
    :vartype SecurityMode: MessageSecurityMode
2443
    :ivar ClientNonce:
2444
    :vartype ClientNonce: ByteString
2445
    :ivar RequestedLifetime:
2446
    :vartype RequestedLifetime: UInt32
2447
    '''
2448 1
    def __init__(self, binary=None):
2449 1
        if binary is not None:
2450 1
            self._binary_init(binary)
2451 1
            self._freeze = True
2452 1
            return
2453 1
        self.ClientProtocolVersion = 0
2454 1
        self.RequestType = SecurityTokenRequestType(0)
2455 1
        self.SecurityMode = MessageSecurityMode(0)
2456 1
        self.ClientNonce = b''
2457 1
        self.RequestedLifetime = 0
2458 1
        self._freeze = True
2459
2460 1
    def to_binary(self):
2461 1
        packet = []
2462 1
        packet.append(uatype_UInt32.pack(self.ClientProtocolVersion))
2463 1
        packet.append(uatype_UInt32.pack(self.RequestType.value))
2464 1
        packet.append(uatype_UInt32.pack(self.SecurityMode.value))
2465 1
        packet.append(pack_bytes(self.ClientNonce))
2466 1
        packet.append(uatype_UInt32.pack(self.RequestedLifetime))
2467 1
        return b''.join(packet)
2468
2469 1
    @staticmethod
2470
    def from_binary(data):
2471 1
        return OpenSecureChannelParameters(data)
2472
2473 1
    def _binary_init(self, data):
2474 1
        self.ClientProtocolVersion = uatype_UInt32.unpack(data.read(4))[0]
2475 1
        self.RequestType = SecurityTokenRequestType(uatype_UInt32.unpack(data.read(4))[0])
2476 1
        self.SecurityMode = MessageSecurityMode(uatype_UInt32.unpack(data.read(4))[0])
2477 1
        self.ClientNonce = unpack_bytes(data)
2478 1
        self.RequestedLifetime = uatype_UInt32.unpack(data.read(4))[0]
2479
2480 1
    def __str__(self):
2481
        return 'OpenSecureChannelParameters(' + 'ClientProtocolVersion:' + str(self.ClientProtocolVersion) + ', ' + \
2482
               'RequestType:' + str(self.RequestType) + ', ' + \
2483
               'SecurityMode:' + str(self.SecurityMode) + ', ' + \
2484
               'ClientNonce:' + str(self.ClientNonce) + ', ' + \
2485
               'RequestedLifetime:' + str(self.RequestedLifetime) + ')'
2486
2487 1
    __repr__ = __str__
2488
2489
2490 1 View Code Duplication
class OpenSecureChannelRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2491
    '''
2492
    Creates a secure channel with a server.
2493
2494
    :ivar TypeId:
2495
    :vartype TypeId: NodeId
2496
    :ivar RequestHeader:
2497
    :vartype RequestHeader: RequestHeader
2498
    :ivar Parameters:
2499
    :vartype Parameters: OpenSecureChannelParameters
2500
    '''
2501 1
    def __init__(self, binary=None):
2502 1
        if binary is not None:
2503 1
            self._binary_init(binary)
2504 1
            self._freeze = True
2505 1
            return
2506 1
        self.TypeId = FourByteNodeId(ObjectIds.OpenSecureChannelRequest_Encoding_DefaultBinary)
2507 1
        self.RequestHeader = RequestHeader()
2508 1
        self.Parameters = OpenSecureChannelParameters()
2509 1
        self._freeze = True
2510
2511 1
    def to_binary(self):
2512 1
        packet = []
2513 1
        packet.append(self.TypeId.to_binary())
2514 1
        packet.append(self.RequestHeader.to_binary())
2515 1
        packet.append(self.Parameters.to_binary())
2516 1
        return b''.join(packet)
2517
2518 1
    @staticmethod
2519
    def from_binary(data):
2520 1
        return OpenSecureChannelRequest(data)
2521
2522 1
    def _binary_init(self, data):
2523 1
        self.TypeId = NodeId.from_binary(data)
2524 1
        self.RequestHeader = RequestHeader.from_binary(data)
2525 1
        self.Parameters = OpenSecureChannelParameters.from_binary(data)
2526
2527 1
    def __str__(self):
2528
        return 'OpenSecureChannelRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2529
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2530
               'Parameters:' + str(self.Parameters) + ')'
2531
2532 1
    __repr__ = __str__
2533
2534
2535 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...
2536
    '''
2537
    :ivar ServerProtocolVersion:
2538
    :vartype ServerProtocolVersion: UInt32
2539
    :ivar SecurityToken:
2540
    :vartype SecurityToken: ChannelSecurityToken
2541
    :ivar ServerNonce:
2542
    :vartype ServerNonce: ByteString
2543
    '''
2544 1
    def __init__(self, binary=None):
2545 1
        if binary is not None:
2546 1
            self._binary_init(binary)
2547 1
            self._freeze = True
2548 1
            return
2549 1
        self.ServerProtocolVersion = 0
2550 1
        self.SecurityToken = ChannelSecurityToken()
2551 1
        self.ServerNonce = b''
2552 1
        self._freeze = True
2553
2554 1
    def to_binary(self):
2555 1
        packet = []
2556 1
        packet.append(uatype_UInt32.pack(self.ServerProtocolVersion))
2557 1
        packet.append(self.SecurityToken.to_binary())
2558 1
        packet.append(pack_bytes(self.ServerNonce))
2559 1
        return b''.join(packet)
2560
2561 1
    @staticmethod
2562
    def from_binary(data):
2563 1
        return OpenSecureChannelResult(data)
2564
2565 1
    def _binary_init(self, data):
2566 1
        self.ServerProtocolVersion = uatype_UInt32.unpack(data.read(4))[0]
2567 1
        self.SecurityToken = ChannelSecurityToken.from_binary(data)
2568 1
        self.ServerNonce = unpack_bytes(data)
2569
2570 1
    def __str__(self):
2571
        return 'OpenSecureChannelResult(' + 'ServerProtocolVersion:' + str(self.ServerProtocolVersion) + ', ' + \
2572
               'SecurityToken:' + str(self.SecurityToken) + ', ' + \
2573
               'ServerNonce:' + str(self.ServerNonce) + ')'
2574
2575 1
    __repr__ = __str__
2576
2577
2578 1 View Code Duplication
class OpenSecureChannelResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2579
    '''
2580
    Creates a secure channel with a server.
2581
2582
    :ivar TypeId:
2583
    :vartype TypeId: NodeId
2584
    :ivar ResponseHeader:
2585
    :vartype ResponseHeader: ResponseHeader
2586
    :ivar Parameters:
2587
    :vartype Parameters: OpenSecureChannelResult
2588
    '''
2589 1
    def __init__(self, binary=None):
2590 1
        if binary is not None:
2591 1
            self._binary_init(binary)
2592 1
            self._freeze = True
2593 1
            return
2594 1
        self.TypeId = FourByteNodeId(ObjectIds.OpenSecureChannelResponse_Encoding_DefaultBinary)
2595 1
        self.ResponseHeader = ResponseHeader()
2596 1
        self.Parameters = OpenSecureChannelResult()
2597 1
        self._freeze = True
2598
2599 1
    def to_binary(self):
2600 1
        packet = []
2601 1
        packet.append(self.TypeId.to_binary())
2602 1
        packet.append(self.ResponseHeader.to_binary())
2603 1
        packet.append(self.Parameters.to_binary())
2604 1
        return b''.join(packet)
2605
2606 1
    @staticmethod
2607
    def from_binary(data):
2608 1
        return OpenSecureChannelResponse(data)
2609
2610 1
    def _binary_init(self, data):
2611 1
        self.TypeId = NodeId.from_binary(data)
2612 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
2613 1
        self.Parameters = OpenSecureChannelResult.from_binary(data)
2614
2615 1
    def __str__(self):
2616
        return 'OpenSecureChannelResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2617
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
2618
               'Parameters:' + str(self.Parameters) + ')'
2619
2620 1
    __repr__ = __str__
2621
2622
2623 1 View Code Duplication
class CloseSecureChannelRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2624
    '''
2625
    Closes a secure channel.
2626
2627
    :ivar TypeId:
2628
    :vartype TypeId: NodeId
2629
    :ivar RequestHeader:
2630
    :vartype RequestHeader: RequestHeader
2631
    '''
2632 1
    def __init__(self, binary=None):
2633 1
        if binary is not None:
2634
            self._binary_init(binary)
2635
            self._freeze = True
2636
            return
2637 1
        self.TypeId = FourByteNodeId(ObjectIds.CloseSecureChannelRequest_Encoding_DefaultBinary)
2638 1
        self.RequestHeader = RequestHeader()
2639 1
        self._freeze = True
2640
2641 1
    def to_binary(self):
2642 1
        packet = []
2643 1
        packet.append(self.TypeId.to_binary())
2644 1
        packet.append(self.RequestHeader.to_binary())
2645 1
        return b''.join(packet)
2646
2647 1
    @staticmethod
2648
    def from_binary(data):
2649
        return CloseSecureChannelRequest(data)
2650
2651 1
    def _binary_init(self, data):
2652
        self.TypeId = NodeId.from_binary(data)
2653
        self.RequestHeader = RequestHeader.from_binary(data)
2654
2655 1
    def __str__(self):
2656
        return 'CloseSecureChannelRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2657
               'RequestHeader:' + str(self.RequestHeader) + ')'
2658
2659 1
    __repr__ = __str__
2660
2661
2662 1 View Code Duplication
class CloseSecureChannelResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2663
    '''
2664
    Closes a secure channel.
2665
2666
    :ivar TypeId:
2667
    :vartype TypeId: NodeId
2668
    :ivar ResponseHeader:
2669
    :vartype ResponseHeader: ResponseHeader
2670
    '''
2671 1
    def __init__(self, binary=None):
2672
        if binary is not None:
2673
            self._binary_init(binary)
2674
            self._freeze = True
2675
            return
2676
        self.TypeId = FourByteNodeId(ObjectIds.CloseSecureChannelResponse_Encoding_DefaultBinary)
2677
        self.ResponseHeader = ResponseHeader()
2678
        self._freeze = True
2679
2680 1
    def to_binary(self):
2681
        packet = []
2682
        packet.append(self.TypeId.to_binary())
2683
        packet.append(self.ResponseHeader.to_binary())
2684
        return b''.join(packet)
2685
2686 1
    @staticmethod
2687
    def from_binary(data):
2688
        return CloseSecureChannelResponse(data)
2689
2690 1
    def _binary_init(self, data):
2691
        self.TypeId = NodeId.from_binary(data)
2692
        self.ResponseHeader = ResponseHeader.from_binary(data)
2693
2694 1
    def __str__(self):
2695
        return 'CloseSecureChannelResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2696
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
2697
2698 1
    __repr__ = __str__
2699
2700
2701 1
class SignedSoftwareCertificate(FrozenClass):
2702
    '''
2703
    A software certificate with a digital signature.
2704
2705
    :ivar CertificateData:
2706
    :vartype CertificateData: ByteString
2707
    :ivar Signature:
2708
    :vartype Signature: ByteString
2709
    '''
2710 1
    def __init__(self, binary=None):
2711
        if binary is not None:
2712
            self._binary_init(binary)
2713
            self._freeze = True
2714
            return
2715
        self.CertificateData = b''
2716
        self.Signature = b''
2717
        self._freeze = True
2718
2719 1
    def to_binary(self):
2720
        packet = []
2721
        packet.append(pack_bytes(self.CertificateData))
2722
        packet.append(pack_bytes(self.Signature))
2723
        return b''.join(packet)
2724
2725 1
    @staticmethod
2726
    def from_binary(data):
2727
        return SignedSoftwareCertificate(data)
2728
2729 1
    def _binary_init(self, data):
2730
        self.CertificateData = unpack_bytes(data)
2731
        self.Signature = unpack_bytes(data)
2732
2733 1
    def __str__(self):
2734
        return 'SignedSoftwareCertificate(' + 'CertificateData:' + str(self.CertificateData) + ', ' + \
2735
               'Signature:' + str(self.Signature) + ')'
2736
2737 1
    __repr__ = __str__
2738
2739
2740 1
class SignatureData(FrozenClass):
2741
    '''
2742
    A digital signature.
2743
2744
    :ivar Algorithm:
2745
    :vartype Algorithm: String
2746
    :ivar Signature:
2747
    :vartype Signature: ByteString
2748
    '''
2749 1
    def __init__(self, binary=None):
2750 1
        if binary is not None:
2751 1
            self._binary_init(binary)
2752 1
            self._freeze = True
2753 1
            return
2754 1
        self.Algorithm = ''
2755 1
        self.Signature = b''
2756 1
        self._freeze = True
2757
2758 1
    def to_binary(self):
2759 1
        packet = []
2760 1
        packet.append(pack_string(self.Algorithm))
2761 1
        packet.append(pack_bytes(self.Signature))
2762 1
        return b''.join(packet)
2763
2764 1
    @staticmethod
2765
    def from_binary(data):
2766 1
        return SignatureData(data)
2767
2768 1
    def _binary_init(self, data):
2769 1
        self.Algorithm = unpack_string(data)
2770 1
        self.Signature = unpack_bytes(data)
2771
2772 1
    def __str__(self):
2773
        return 'SignatureData(' + 'Algorithm:' + str(self.Algorithm) + ', ' + \
2774
               'Signature:' + str(self.Signature) + ')'
2775
2776 1
    __repr__ = __str__
2777
2778
2779 1
class CreateSessionParameters(FrozenClass):
2780
    '''
2781
    :ivar ClientDescription:
2782
    :vartype ClientDescription: ApplicationDescription
2783
    :ivar ServerUri:
2784
    :vartype ServerUri: String
2785
    :ivar EndpointUrl:
2786
    :vartype EndpointUrl: String
2787
    :ivar SessionName:
2788
    :vartype SessionName: String
2789
    :ivar ClientNonce:
2790
    :vartype ClientNonce: ByteString
2791
    :ivar ClientCertificate:
2792
    :vartype ClientCertificate: ByteString
2793
    :ivar RequestedSessionTimeout:
2794
    :vartype RequestedSessionTimeout: Double
2795
    :ivar MaxResponseMessageSize:
2796
    :vartype MaxResponseMessageSize: UInt32
2797
    '''
2798 1
    def __init__(self, binary=None):
2799 1
        if binary is not None:
2800 1
            self._binary_init(binary)
2801 1
            self._freeze = True
2802 1
            return
2803 1
        self.ClientDescription = ApplicationDescription()
2804 1
        self.ServerUri = ''
2805 1
        self.EndpointUrl = ''
2806 1
        self.SessionName = ''
2807 1
        self.ClientNonce = b''
2808 1
        self.ClientCertificate = b''
2809 1
        self.RequestedSessionTimeout = 0
2810 1
        self.MaxResponseMessageSize = 0
2811 1
        self._freeze = True
2812
2813 1
    def to_binary(self):
2814 1
        packet = []
2815 1
        packet.append(self.ClientDescription.to_binary())
2816 1
        packet.append(pack_string(self.ServerUri))
2817 1
        packet.append(pack_string(self.EndpointUrl))
2818 1
        packet.append(pack_string(self.SessionName))
2819 1
        packet.append(pack_bytes(self.ClientNonce))
2820 1
        packet.append(pack_bytes(self.ClientCertificate))
2821 1
        packet.append(uatype_Double.pack(self.RequestedSessionTimeout))
2822 1
        packet.append(uatype_UInt32.pack(self.MaxResponseMessageSize))
2823 1
        return b''.join(packet)
2824
2825 1
    @staticmethod
2826
    def from_binary(data):
2827 1
        return CreateSessionParameters(data)
2828
2829 1
    def _binary_init(self, data):
2830 1
        self.ClientDescription = ApplicationDescription.from_binary(data)
2831 1
        self.ServerUri = unpack_string(data)
2832 1
        self.EndpointUrl = unpack_string(data)
2833 1
        self.SessionName = unpack_string(data)
2834 1
        self.ClientNonce = unpack_bytes(data)
2835 1
        self.ClientCertificate = unpack_bytes(data)
2836 1
        self.RequestedSessionTimeout = uatype_Double.unpack(data.read(8))[0]
2837 1
        self.MaxResponseMessageSize = uatype_UInt32.unpack(data.read(4))[0]
2838
2839 1
    def __str__(self):
2840
        return 'CreateSessionParameters(' + 'ClientDescription:' + str(self.ClientDescription) + ', ' + \
2841
               'ServerUri:' + str(self.ServerUri) + ', ' + \
2842
               'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
2843
               'SessionName:' + str(self.SessionName) + ', ' + \
2844
               'ClientNonce:' + str(self.ClientNonce) + ', ' + \
2845
               'ClientCertificate:' + str(self.ClientCertificate) + ', ' + \
2846
               'RequestedSessionTimeout:' + str(self.RequestedSessionTimeout) + ', ' + \
2847
               'MaxResponseMessageSize:' + str(self.MaxResponseMessageSize) + ')'
2848
2849 1
    __repr__ = __str__
2850
2851
2852 1 View Code Duplication
class CreateSessionRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2853
    '''
2854
    Creates a new session with the server.
2855
2856
    :ivar TypeId:
2857
    :vartype TypeId: NodeId
2858
    :ivar RequestHeader:
2859
    :vartype RequestHeader: RequestHeader
2860
    :ivar Parameters:
2861
    :vartype Parameters: CreateSessionParameters
2862
    '''
2863 1
    def __init__(self, binary=None):
2864 1
        if binary is not None:
2865
            self._binary_init(binary)
2866
            self._freeze = True
2867
            return
2868 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateSessionRequest_Encoding_DefaultBinary)
2869 1
        self.RequestHeader = RequestHeader()
2870 1
        self.Parameters = CreateSessionParameters()
2871 1
        self._freeze = True
2872
2873 1
    def to_binary(self):
2874 1
        packet = []
2875 1
        packet.append(self.TypeId.to_binary())
2876 1
        packet.append(self.RequestHeader.to_binary())
2877 1
        packet.append(self.Parameters.to_binary())
2878 1
        return b''.join(packet)
2879
2880 1
    @staticmethod
2881
    def from_binary(data):
2882
        return CreateSessionRequest(data)
2883
2884 1
    def _binary_init(self, data):
2885
        self.TypeId = NodeId.from_binary(data)
2886
        self.RequestHeader = RequestHeader.from_binary(data)
2887
        self.Parameters = CreateSessionParameters.from_binary(data)
2888
2889 1
    def __str__(self):
2890
        return 'CreateSessionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2891
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2892
               'Parameters:' + str(self.Parameters) + ')'
2893
2894 1
    __repr__ = __str__
2895
2896
2897 1
class CreateSessionResult(FrozenClass):
2898
    '''
2899
    :ivar SessionId:
2900
    :vartype SessionId: NodeId
2901
    :ivar AuthenticationToken:
2902
    :vartype AuthenticationToken: NodeId
2903
    :ivar RevisedSessionTimeout:
2904
    :vartype RevisedSessionTimeout: Double
2905
    :ivar ServerNonce:
2906
    :vartype ServerNonce: ByteString
2907
    :ivar ServerCertificate:
2908
    :vartype ServerCertificate: ByteString
2909
    :ivar ServerEndpoints:
2910
    :vartype ServerEndpoints: EndpointDescription
2911
    :ivar ServerSoftwareCertificates:
2912
    :vartype ServerSoftwareCertificates: SignedSoftwareCertificate
2913
    :ivar ServerSignature:
2914
    :vartype ServerSignature: SignatureData
2915
    :ivar MaxRequestMessageSize:
2916
    :vartype MaxRequestMessageSize: UInt32
2917
    '''
2918 1
    def __init__(self, binary=None):
2919 1
        if binary is not None:
2920 1
            self._binary_init(binary)
2921 1
            self._freeze = True
2922 1
            return
2923 1
        self.SessionId = NodeId()
2924 1
        self.AuthenticationToken = NodeId()
2925 1
        self.RevisedSessionTimeout = 0
2926 1
        self.ServerNonce = b''
2927 1
        self.ServerCertificate = b''
2928 1
        self.ServerEndpoints = []
2929 1
        self.ServerSoftwareCertificates = []
2930 1
        self.ServerSignature = SignatureData()
2931 1
        self.MaxRequestMessageSize = 0
2932 1
        self._freeze = True
2933
2934 1
    def to_binary(self):
2935 1
        packet = []
2936 1
        packet.append(self.SessionId.to_binary())
2937 1
        packet.append(self.AuthenticationToken.to_binary())
2938 1
        packet.append(uatype_Double.pack(self.RevisedSessionTimeout))
2939 1
        packet.append(pack_bytes(self.ServerNonce))
2940 1
        packet.append(pack_bytes(self.ServerCertificate))
2941 1
        packet.append(uatype_Int32.pack(len(self.ServerEndpoints)))
2942 1
        for fieldname in self.ServerEndpoints:
2943 1
            packet.append(fieldname.to_binary())
2944 1
        packet.append(uatype_Int32.pack(len(self.ServerSoftwareCertificates)))
2945 1
        for fieldname in self.ServerSoftwareCertificates:
2946
            packet.append(fieldname.to_binary())
2947 1
        packet.append(self.ServerSignature.to_binary())
2948 1
        packet.append(uatype_UInt32.pack(self.MaxRequestMessageSize))
2949 1
        return b''.join(packet)
2950
2951 1
    @staticmethod
2952
    def from_binary(data):
2953 1
        return CreateSessionResult(data)
2954
2955 1
    def _binary_init(self, data):
2956 1
        self.SessionId = NodeId.from_binary(data)
2957 1
        self.AuthenticationToken = NodeId.from_binary(data)
2958 1
        self.RevisedSessionTimeout = uatype_Double.unpack(data.read(8))[0]
2959 1
        self.ServerNonce = unpack_bytes(data)
2960 1
        self.ServerCertificate = unpack_bytes(data)
2961 1
        length = uatype_Int32.unpack(data.read(4))[0]
2962 1
        array = []
2963 1
        if length != -1:
2964 1
            for _ in range(0, length):
2965 1
                array.append(EndpointDescription.from_binary(data))
2966 1
        self.ServerEndpoints = array
2967 1
        length = uatype_Int32.unpack(data.read(4))[0]
2968 1
        array = []
2969 1
        if length != -1:
2970 1
            for _ in range(0, length):
2971
                array.append(SignedSoftwareCertificate.from_binary(data))
2972 1
        self.ServerSoftwareCertificates = array
2973 1
        self.ServerSignature = SignatureData.from_binary(data)
2974 1
        self.MaxRequestMessageSize = uatype_UInt32.unpack(data.read(4))[0]
2975
2976 1
    def __str__(self):
2977
        return 'CreateSessionResult(' + 'SessionId:' + str(self.SessionId) + ', ' + \
2978
               'AuthenticationToken:' + str(self.AuthenticationToken) + ', ' + \
2979
               'RevisedSessionTimeout:' + str(self.RevisedSessionTimeout) + ', ' + \
2980
               'ServerNonce:' + str(self.ServerNonce) + ', ' + \
2981
               'ServerCertificate:' + str(self.ServerCertificate) + ', ' + \
2982
               'ServerEndpoints:' + str(self.ServerEndpoints) + ', ' + \
2983
               'ServerSoftwareCertificates:' + str(self.ServerSoftwareCertificates) + ', ' + \
2984
               'ServerSignature:' + str(self.ServerSignature) + ', ' + \
2985
               'MaxRequestMessageSize:' + str(self.MaxRequestMessageSize) + ')'
2986
2987 1
    __repr__ = __str__
2988
2989
2990 1 View Code Duplication
class CreateSessionResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2991
    '''
2992
    Creates a new session with the server.
2993
2994
    :ivar TypeId:
2995
    :vartype TypeId: NodeId
2996
    :ivar ResponseHeader:
2997
    :vartype ResponseHeader: ResponseHeader
2998
    :ivar Parameters:
2999
    :vartype Parameters: CreateSessionResult
3000
    '''
3001 1
    def __init__(self, binary=None):
3002 1
        if binary is not None:
3003 1
            self._binary_init(binary)
3004 1
            self._freeze = True
3005 1
            return
3006 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateSessionResponse_Encoding_DefaultBinary)
3007 1
        self.ResponseHeader = ResponseHeader()
3008 1
        self.Parameters = CreateSessionResult()
3009 1
        self._freeze = True
3010
3011 1
    def to_binary(self):
3012 1
        packet = []
3013 1
        packet.append(self.TypeId.to_binary())
3014 1
        packet.append(self.ResponseHeader.to_binary())
3015 1
        packet.append(self.Parameters.to_binary())
3016 1
        return b''.join(packet)
3017
3018 1
    @staticmethod
3019
    def from_binary(data):
3020 1
        return CreateSessionResponse(data)
3021
3022 1
    def _binary_init(self, data):
3023 1
        self.TypeId = NodeId.from_binary(data)
3024 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
3025 1
        self.Parameters = CreateSessionResult.from_binary(data)
3026
3027 1
    def __str__(self):
3028
        return 'CreateSessionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3029
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
3030
               'Parameters:' + str(self.Parameters) + ')'
3031
3032 1
    __repr__ = __str__
3033
3034
3035 1 View Code Duplication
class UserIdentityToken(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3036
    '''
3037
    A base type for a user identity token.
3038
3039
    :ivar PolicyId:
3040
    :vartype PolicyId: String
3041
    '''
3042 1
    def __init__(self, binary=None):
3043
        if binary is not None:
3044
            self._binary_init(binary)
3045
            self._freeze = True
3046
            return
3047
        self.PolicyId = ''
3048
        self._freeze = True
3049
3050 1
    def to_binary(self):
3051
        packet = []
3052
        packet.append(pack_string(self.PolicyId))
3053
        return b''.join(packet)
3054
3055 1
    @staticmethod
3056
    def from_binary(data):
3057
        return UserIdentityToken(data)
3058
3059 1
    def _binary_init(self, data):
3060
        self.PolicyId = unpack_string(data)
3061
3062 1
    def __str__(self):
3063
        return 'UserIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ')'
3064
3065 1
    __repr__ = __str__
3066
3067
3068 1 View Code Duplication
class AnonymousIdentityToken(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3069
    '''
3070
    A token representing an anonymous user.
3071
3072
    :ivar PolicyId:
3073
    :vartype PolicyId: String
3074
    '''
3075 1
    def __init__(self, binary=None):
3076 1
        if binary is not None:
3077 1
            self._binary_init(binary)
3078 1
            self._freeze = True
3079 1
            return
3080 1
        self.PolicyId = ''
3081 1
        self._freeze = True
3082
3083 1
    def to_binary(self):
3084 1
        packet = []
3085 1
        packet.append(pack_string(self.PolicyId))
3086 1
        return b''.join(packet)
3087
3088 1
    @staticmethod
3089
    def from_binary(data):
3090 1
        return AnonymousIdentityToken(data)
3091
3092 1
    def _binary_init(self, data):
3093 1
        self.PolicyId = unpack_string(data)
3094
3095 1
    def __str__(self):
3096
        return 'AnonymousIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ')'
3097
3098 1
    __repr__ = __str__
3099
3100
3101 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...
3102
    '''
3103
    A token representing a user identified by a user name and password.
3104
3105
    :ivar PolicyId:
3106
    :vartype PolicyId: String
3107
    :ivar UserName:
3108
    :vartype UserName: String
3109
    :ivar Password:
3110
    :vartype Password: ByteString
3111
    :ivar EncryptionAlgorithm:
3112
    :vartype EncryptionAlgorithm: String
3113
    '''
3114 1
    def __init__(self, binary=None):
3115 1
        if binary is not None:
3116 1
            self._binary_init(binary)
3117 1
            self._freeze = True
3118 1
            return
3119 1
        self.PolicyId = ''
3120 1
        self.UserName = ''
3121 1
        self.Password = b''
3122 1
        self.EncryptionAlgorithm = ''
3123 1
        self._freeze = True
3124
3125 1
    def to_binary(self):
3126 1
        packet = []
3127 1
        packet.append(pack_string(self.PolicyId))
3128 1
        packet.append(pack_string(self.UserName))
3129 1
        packet.append(pack_bytes(self.Password))
3130 1
        packet.append(pack_string(self.EncryptionAlgorithm))
3131 1
        return b''.join(packet)
3132
3133 1
    @staticmethod
3134
    def from_binary(data):
3135 1
        return UserNameIdentityToken(data)
3136
3137 1
    def _binary_init(self, data):
3138 1
        self.PolicyId = unpack_string(data)
3139 1
        self.UserName = unpack_string(data)
3140 1
        self.Password = unpack_bytes(data)
3141 1
        self.EncryptionAlgorithm = unpack_string(data)
3142
3143 1
    def __str__(self):
3144
        return 'UserNameIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3145
               'UserName:' + str(self.UserName) + ', ' + \
3146
               'Password:' + str(self.Password) + ', ' + \
3147
               'EncryptionAlgorithm:' + str(self.EncryptionAlgorithm) + ')'
3148
3149 1
    __repr__ = __str__
3150
3151
3152 1
class X509IdentityToken(FrozenClass):
3153
    '''
3154
    A token representing a user identified by an X509 certificate.
3155
3156
    :ivar PolicyId:
3157
    :vartype PolicyId: String
3158
    :ivar CertificateData:
3159
    :vartype CertificateData: ByteString
3160
    '''
3161 1
    def __init__(self, binary=None):
3162
        if binary is not None:
3163
            self._binary_init(binary)
3164
            self._freeze = True
3165
            return
3166
        self.PolicyId = ''
3167
        self.CertificateData = b''
3168
        self._freeze = True
3169
3170 1
    def to_binary(self):
3171
        packet = []
3172
        packet.append(pack_string(self.PolicyId))
3173
        packet.append(pack_bytes(self.CertificateData))
3174
        return b''.join(packet)
3175
3176 1
    @staticmethod
3177
    def from_binary(data):
3178
        return X509IdentityToken(data)
3179
3180 1
    def _binary_init(self, data):
3181
        self.PolicyId = unpack_string(data)
3182
        self.CertificateData = unpack_bytes(data)
3183
3184 1
    def __str__(self):
3185
        return 'X509IdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3186
               'CertificateData:' + str(self.CertificateData) + ')'
3187
3188 1
    __repr__ = __str__
3189
3190
3191 1
class KerberosIdentityToken(FrozenClass):
3192
    '''
3193
    :ivar PolicyId:
3194
    :vartype PolicyId: String
3195
    :ivar TicketData:
3196
    :vartype TicketData: ByteString
3197
    '''
3198 1
    def __init__(self, binary=None):
3199
        if binary is not None:
3200
            self._binary_init(binary)
3201
            self._freeze = True
3202
            return
3203
        self.PolicyId = ''
3204
        self.TicketData = b''
3205
        self._freeze = True
3206
3207 1
    def to_binary(self):
3208
        packet = []
3209
        packet.append(pack_string(self.PolicyId))
3210
        packet.append(pack_bytes(self.TicketData))
3211
        return b''.join(packet)
3212
3213 1
    @staticmethod
3214
    def from_binary(data):
3215
        return KerberosIdentityToken(data)
3216
3217 1
    def _binary_init(self, data):
3218
        self.PolicyId = unpack_string(data)
3219
        self.TicketData = unpack_bytes(data)
3220
3221 1
    def __str__(self):
3222
        return 'KerberosIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3223
               'TicketData:' + str(self.TicketData) + ')'
3224
3225 1
    __repr__ = __str__
3226
3227
3228 1 View Code Duplication
class IssuedIdentityToken(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3229
    '''
3230
    A token representing a user identified by a WS-Security XML token.
3231
3232
    :ivar PolicyId:
3233
    :vartype PolicyId: String
3234
    :ivar TokenData:
3235
    :vartype TokenData: ByteString
3236
    :ivar EncryptionAlgorithm:
3237
    :vartype EncryptionAlgorithm: String
3238
    '''
3239 1
    def __init__(self, binary=None):
3240
        if binary is not None:
3241
            self._binary_init(binary)
3242
            self._freeze = True
3243
            return
3244
        self.PolicyId = ''
3245
        self.TokenData = b''
3246
        self.EncryptionAlgorithm = ''
3247
        self._freeze = True
3248
3249 1
    def to_binary(self):
3250
        packet = []
3251
        packet.append(pack_string(self.PolicyId))
3252
        packet.append(pack_bytes(self.TokenData))
3253
        packet.append(pack_string(self.EncryptionAlgorithm))
3254
        return b''.join(packet)
3255
3256 1
    @staticmethod
3257
    def from_binary(data):
3258
        return IssuedIdentityToken(data)
3259
3260 1
    def _binary_init(self, data):
3261
        self.PolicyId = unpack_string(data)
3262
        self.TokenData = unpack_bytes(data)
3263
        self.EncryptionAlgorithm = unpack_string(data)
3264
3265 1
    def __str__(self):
3266
        return 'IssuedIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3267
               'TokenData:' + str(self.TokenData) + ', ' + \
3268
               'EncryptionAlgorithm:' + str(self.EncryptionAlgorithm) + ')'
3269
3270 1
    __repr__ = __str__
3271
3272
3273 1
class ActivateSessionParameters(FrozenClass):
3274
    '''
3275
    :ivar ClientSignature:
3276
    :vartype ClientSignature: SignatureData
3277
    :ivar ClientSoftwareCertificates:
3278
    :vartype ClientSoftwareCertificates: SignedSoftwareCertificate
3279
    :ivar LocaleIds:
3280
    :vartype LocaleIds: String
3281
    :ivar UserIdentityToken:
3282
    :vartype UserIdentityToken: ExtensionObject
3283
    :ivar UserTokenSignature:
3284
    :vartype UserTokenSignature: SignatureData
3285
    '''
3286 1
    def __init__(self, binary=None):
3287 1
        if binary is not None:
3288 1
            self._binary_init(binary)
3289 1
            self._freeze = True
3290 1
            return
3291 1
        self.ClientSignature = SignatureData()
3292 1
        self.ClientSoftwareCertificates = []
3293 1
        self.LocaleIds = []
3294 1
        self.UserIdentityToken = None
3295 1
        self.UserTokenSignature = SignatureData()
3296 1
        self._freeze = True
3297
3298 1
    def to_binary(self):
3299 1
        packet = []
3300 1
        packet.append(self.ClientSignature.to_binary())
3301 1
        packet.append(uatype_Int32.pack(len(self.ClientSoftwareCertificates)))
3302 1
        for fieldname in self.ClientSoftwareCertificates:
3303
            packet.append(fieldname.to_binary())
3304 1
        packet.append(uatype_Int32.pack(len(self.LocaleIds)))
3305 1
        for fieldname in self.LocaleIds:
3306 1
            packet.append(pack_string(fieldname))
3307 1
        packet.append(extensionobject_to_binary(self.UserIdentityToken))
3308 1
        packet.append(self.UserTokenSignature.to_binary())
3309 1
        return b''.join(packet)
3310
3311 1
    @staticmethod
3312
    def from_binary(data):
3313 1
        return ActivateSessionParameters(data)
3314
3315 1
    def _binary_init(self, data):
3316 1
        self.ClientSignature = SignatureData.from_binary(data)
3317 1
        length = uatype_Int32.unpack(data.read(4))[0]
3318 1
        array = []
3319 1
        if length != -1:
3320 1
            for _ in range(0, length):
3321
                array.append(SignedSoftwareCertificate.from_binary(data))
3322 1
        self.ClientSoftwareCertificates = array
3323 1
        self.LocaleIds = unpack_uatype_array('String', data)
3324 1
        self.UserIdentityToken = extensionobject_from_binary(data)
3325 1
        self.UserTokenSignature = SignatureData.from_binary(data)
3326
3327 1
    def __str__(self):
3328
        return 'ActivateSessionParameters(' + 'ClientSignature:' + str(self.ClientSignature) + ', ' + \
3329
               'ClientSoftwareCertificates:' + str(self.ClientSoftwareCertificates) + ', ' + \
3330
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
3331
               'UserIdentityToken:' + str(self.UserIdentityToken) + ', ' + \
3332
               'UserTokenSignature:' + str(self.UserTokenSignature) + ')'
3333
3334 1
    __repr__ = __str__
3335
3336
3337 1 View Code Duplication
class ActivateSessionRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3338
    '''
3339
    Activates a session with the server.
3340
3341
    :ivar TypeId:
3342
    :vartype TypeId: NodeId
3343
    :ivar RequestHeader:
3344
    :vartype RequestHeader: RequestHeader
3345
    :ivar Parameters:
3346
    :vartype Parameters: ActivateSessionParameters
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.ActivateSessionRequest_Encoding_DefaultBinary)
3354 1
        self.RequestHeader = RequestHeader()
3355 1
        self.Parameters = ActivateSessionParameters()
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.RequestHeader.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 ActivateSessionRequest(data)
3368
3369 1
    def _binary_init(self, data):
3370
        self.TypeId = NodeId.from_binary(data)
3371
        self.RequestHeader = RequestHeader.from_binary(data)
3372
        self.Parameters = ActivateSessionParameters.from_binary(data)
3373
3374 1
    def __str__(self):
3375
        return 'ActivateSessionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3376
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
3377
               'Parameters:' + str(self.Parameters) + ')'
3378
3379 1
    __repr__ = __str__
3380
3381
3382 1 View Code Duplication
class ActivateSessionResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3383
    '''
3384
    :ivar ServerNonce:
3385
    :vartype ServerNonce: ByteString
3386
    :ivar Results:
3387
    :vartype Results: StatusCode
3388
    :ivar DiagnosticInfos:
3389
    :vartype DiagnosticInfos: DiagnosticInfo
3390
    '''
3391 1
    def __init__(self, binary=None):
3392 1
        if binary is not None:
3393 1
            self._binary_init(binary)
3394 1
            self._freeze = True
3395 1
            return
3396 1
        self.ServerNonce = b''
3397 1
        self.Results = []
3398 1
        self.DiagnosticInfos = []
3399 1
        self._freeze = True
3400
3401 1
    def to_binary(self):
3402 1
        packet = []
3403 1
        packet.append(pack_bytes(self.ServerNonce))
3404 1
        packet.append(uatype_Int32.pack(len(self.Results)))
3405 1
        for fieldname in self.Results:
3406
            packet.append(fieldname.to_binary())
3407 1
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
3408 1
        for fieldname in self.DiagnosticInfos:
3409
            packet.append(fieldname.to_binary())
3410 1
        return b''.join(packet)
3411
3412 1
    @staticmethod
3413
    def from_binary(data):
3414 1
        return ActivateSessionResult(data)
3415
3416 1
    def _binary_init(self, data):
3417 1
        self.ServerNonce = unpack_bytes(data)
3418 1
        length = uatype_Int32.unpack(data.read(4))[0]
3419 1
        array = []
3420 1
        if length != -1:
3421 1
            for _ in range(0, length):
3422
                array.append(StatusCode.from_binary(data))
3423 1
        self.Results = array
3424 1
        length = uatype_Int32.unpack(data.read(4))[0]
3425 1
        array = []
3426 1
        if length != -1:
3427 1
            for _ in range(0, length):
3428
                array.append(DiagnosticInfo.from_binary(data))
3429 1
        self.DiagnosticInfos = array
3430
3431 1
    def __str__(self):
3432
        return 'ActivateSessionResult(' + 'ServerNonce:' + str(self.ServerNonce) + ', ' + \
3433
               'Results:' + str(self.Results) + ', ' + \
3434
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
3435
3436 1
    __repr__ = __str__
3437
3438
3439 1 View Code Duplication
class ActivateSessionResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3440
    '''
3441
    Activates a session with the server.
3442
3443
    :ivar TypeId:
3444
    :vartype TypeId: NodeId
3445
    :ivar ResponseHeader:
3446
    :vartype ResponseHeader: ResponseHeader
3447
    :ivar Parameters:
3448
    :vartype Parameters: ActivateSessionResult
3449
    '''
3450 1
    def __init__(self, binary=None):
3451 1
        if binary is not None:
3452 1
            self._binary_init(binary)
3453 1
            self._freeze = True
3454 1
            return
3455 1
        self.TypeId = FourByteNodeId(ObjectIds.ActivateSessionResponse_Encoding_DefaultBinary)
3456 1
        self.ResponseHeader = ResponseHeader()
3457 1
        self.Parameters = ActivateSessionResult()
3458 1
        self._freeze = True
3459
3460 1
    def to_binary(self):
3461 1
        packet = []
3462 1
        packet.append(self.TypeId.to_binary())
3463 1
        packet.append(self.ResponseHeader.to_binary())
3464 1
        packet.append(self.Parameters.to_binary())
3465 1
        return b''.join(packet)
3466
3467 1
    @staticmethod
3468
    def from_binary(data):
3469 1
        return ActivateSessionResponse(data)
3470
3471 1
    def _binary_init(self, data):
3472 1
        self.TypeId = NodeId.from_binary(data)
3473 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
3474 1
        self.Parameters = ActivateSessionResult.from_binary(data)
3475
3476 1
    def __str__(self):
3477
        return 'ActivateSessionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3478
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
3479
               'Parameters:' + str(self.Parameters) + ')'
3480
3481 1
    __repr__ = __str__
3482
3483
3484 1 View Code Duplication
class CloseSessionRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3485
    '''
3486
    Closes a session with the server.
3487
3488
    :ivar TypeId:
3489
    :vartype TypeId: NodeId
3490
    :ivar RequestHeader:
3491
    :vartype RequestHeader: RequestHeader
3492
    :ivar DeleteSubscriptions:
3493
    :vartype DeleteSubscriptions: Boolean
3494
    '''
3495 1
    def __init__(self, binary=None):
3496 1
        if binary is not None:
3497
            self._binary_init(binary)
3498
            self._freeze = True
3499
            return
3500 1
        self.TypeId = FourByteNodeId(ObjectIds.CloseSessionRequest_Encoding_DefaultBinary)
3501 1
        self.RequestHeader = RequestHeader()
3502 1
        self.DeleteSubscriptions = True
3503 1
        self._freeze = True
3504
3505 1
    def to_binary(self):
3506 1
        packet = []
3507 1
        packet.append(self.TypeId.to_binary())
3508 1
        packet.append(self.RequestHeader.to_binary())
3509 1
        packet.append(uatype_Boolean.pack(self.DeleteSubscriptions))
3510 1
        return b''.join(packet)
3511
3512 1
    @staticmethod
3513
    def from_binary(data):
3514
        return CloseSessionRequest(data)
3515
3516 1
    def _binary_init(self, data):
3517
        self.TypeId = NodeId.from_binary(data)
3518
        self.RequestHeader = RequestHeader.from_binary(data)
3519
        self.DeleteSubscriptions = uatype_Boolean.unpack(data.read(1))[0]
3520
3521 1
    def __str__(self):
3522
        return 'CloseSessionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3523
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
3524
               'DeleteSubscriptions:' + str(self.DeleteSubscriptions) + ')'
3525
3526 1
    __repr__ = __str__
3527
3528
3529 1 View Code Duplication
class CloseSessionResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3530
    '''
3531
    Closes a session with the server.
3532
3533
    :ivar TypeId:
3534
    :vartype TypeId: NodeId
3535
    :ivar ResponseHeader:
3536
    :vartype ResponseHeader: ResponseHeader
3537
    '''
3538 1
    def __init__(self, binary=None):
3539 1
        if binary is not None:
3540 1
            self._binary_init(binary)
3541 1
            self._freeze = True
3542 1
            return
3543 1
        self.TypeId = FourByteNodeId(ObjectIds.CloseSessionResponse_Encoding_DefaultBinary)
3544 1
        self.ResponseHeader = ResponseHeader()
3545 1
        self._freeze = True
3546
3547 1
    def to_binary(self):
3548 1
        packet = []
3549 1
        packet.append(self.TypeId.to_binary())
3550 1
        packet.append(self.ResponseHeader.to_binary())
3551 1
        return b''.join(packet)
3552
3553 1
    @staticmethod
3554
    def from_binary(data):
3555 1
        return CloseSessionResponse(data)
3556
3557 1
    def _binary_init(self, data):
3558 1
        self.TypeId = NodeId.from_binary(data)
3559 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
3560
3561 1
    def __str__(self):
3562
        return 'CloseSessionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3563
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
3564
3565 1
    __repr__ = __str__
3566
3567
3568 1 View Code Duplication
class CancelParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3569
    '''
3570
    :ivar RequestHandle:
3571
    :vartype RequestHandle: UInt32
3572
    '''
3573 1
    def __init__(self, binary=None):
3574
        if binary is not None:
3575
            self._binary_init(binary)
3576
            self._freeze = True
3577
            return
3578
        self.RequestHandle = 0
3579
        self._freeze = True
3580
3581 1
    def to_binary(self):
3582
        packet = []
3583
        packet.append(uatype_UInt32.pack(self.RequestHandle))
3584
        return b''.join(packet)
3585
3586 1
    @staticmethod
3587
    def from_binary(data):
3588
        return CancelParameters(data)
3589
3590 1
    def _binary_init(self, data):
3591
        self.RequestHandle = uatype_UInt32.unpack(data.read(4))[0]
3592
3593 1
    def __str__(self):
3594
        return 'CancelParameters(' + 'RequestHandle:' + str(self.RequestHandle) + ')'
3595
3596 1
    __repr__ = __str__
3597
3598
3599 1 View Code Duplication
class CancelRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3600
    '''
3601
    Cancels an outstanding request.
3602
3603
    :ivar TypeId:
3604
    :vartype TypeId: NodeId
3605
    :ivar RequestHeader:
3606
    :vartype RequestHeader: RequestHeader
3607
    :ivar Parameters:
3608
    :vartype Parameters: CancelParameters
3609
    '''
3610 1
    def __init__(self, binary=None):
3611
        if binary is not None:
3612
            self._binary_init(binary)
3613
            self._freeze = True
3614
            return
3615
        self.TypeId = FourByteNodeId(ObjectIds.CancelRequest_Encoding_DefaultBinary)
3616
        self.RequestHeader = RequestHeader()
3617
        self.Parameters = CancelParameters()
3618
        self._freeze = True
3619
3620 1
    def to_binary(self):
3621
        packet = []
3622
        packet.append(self.TypeId.to_binary())
3623
        packet.append(self.RequestHeader.to_binary())
3624
        packet.append(self.Parameters.to_binary())
3625
        return b''.join(packet)
3626
3627 1
    @staticmethod
3628
    def from_binary(data):
3629
        return CancelRequest(data)
3630
3631 1
    def _binary_init(self, data):
3632
        self.TypeId = NodeId.from_binary(data)
3633
        self.RequestHeader = RequestHeader.from_binary(data)
3634
        self.Parameters = CancelParameters.from_binary(data)
3635
3636 1
    def __str__(self):
3637
        return 'CancelRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3638
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
3639
               'Parameters:' + str(self.Parameters) + ')'
3640
3641 1
    __repr__ = __str__
3642
3643
3644 1 View Code Duplication
class CancelResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3645
    '''
3646
    :ivar CancelCount:
3647
    :vartype CancelCount: UInt32
3648
    '''
3649 1
    def __init__(self, binary=None):
3650
        if binary is not None:
3651
            self._binary_init(binary)
3652
            self._freeze = True
3653
            return
3654
        self.CancelCount = 0
3655
        self._freeze = True
3656
3657 1
    def to_binary(self):
3658
        packet = []
3659
        packet.append(uatype_UInt32.pack(self.CancelCount))
3660
        return b''.join(packet)
3661
3662 1
    @staticmethod
3663
    def from_binary(data):
3664
        return CancelResult(data)
3665
3666 1
    def _binary_init(self, data):
3667
        self.CancelCount = uatype_UInt32.unpack(data.read(4))[0]
3668
3669 1
    def __str__(self):
3670
        return 'CancelResult(' + 'CancelCount:' + str(self.CancelCount) + ')'
3671
3672 1
    __repr__ = __str__
3673
3674
3675 1 View Code Duplication
class CancelResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3676
    '''
3677
    Cancels an outstanding request.
3678
3679
    :ivar TypeId:
3680
    :vartype TypeId: NodeId
3681
    :ivar ResponseHeader:
3682
    :vartype ResponseHeader: ResponseHeader
3683
    :ivar Parameters:
3684
    :vartype Parameters: CancelResult
3685
    '''
3686 1
    def __init__(self, binary=None):
3687
        if binary is not None:
3688
            self._binary_init(binary)
3689
            self._freeze = True
3690
            return
3691
        self.TypeId = FourByteNodeId(ObjectIds.CancelResponse_Encoding_DefaultBinary)
3692
        self.ResponseHeader = ResponseHeader()
3693
        self.Parameters = CancelResult()
3694
        self._freeze = True
3695
3696 1
    def to_binary(self):
3697
        packet = []
3698
        packet.append(self.TypeId.to_binary())
3699
        packet.append(self.ResponseHeader.to_binary())
3700
        packet.append(self.Parameters.to_binary())
3701
        return b''.join(packet)
3702
3703 1
    @staticmethod
3704
    def from_binary(data):
3705
        return CancelResponse(data)
3706
3707 1
    def _binary_init(self, data):
3708
        self.TypeId = NodeId.from_binary(data)
3709
        self.ResponseHeader = ResponseHeader.from_binary(data)
3710
        self.Parameters = CancelResult.from_binary(data)
3711
3712 1
    def __str__(self):
3713
        return 'CancelResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3714
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
3715
               'Parameters:' + str(self.Parameters) + ')'
3716
3717 1
    __repr__ = __str__
3718
3719
3720 1 View Code Duplication
class NodeAttributes(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3721
    '''
3722
    The base attributes for all nodes.
3723
3724
    :ivar SpecifiedAttributes:
3725
    :vartype SpecifiedAttributes: UInt32
3726
    :ivar DisplayName:
3727
    :vartype DisplayName: LocalizedText
3728
    :ivar Description:
3729
    :vartype Description: LocalizedText
3730
    :ivar WriteMask:
3731
    :vartype WriteMask: UInt32
3732
    :ivar UserWriteMask:
3733
    :vartype UserWriteMask: UInt32
3734
    '''
3735 1
    def __init__(self, binary=None):
3736
        if binary is not None:
3737
            self._binary_init(binary)
3738
            self._freeze = True
3739
            return
3740
        self.SpecifiedAttributes = 0
3741
        self.DisplayName = LocalizedText()
3742
        self.Description = LocalizedText()
3743
        self.WriteMask = 0
3744
        self.UserWriteMask = 0
3745
        self._freeze = True
3746
3747 1
    def to_binary(self):
3748
        packet = []
3749
        packet.append(uatype_UInt32.pack(self.SpecifiedAttributes))
3750
        packet.append(self.DisplayName.to_binary())
3751
        packet.append(self.Description.to_binary())
3752
        packet.append(uatype_UInt32.pack(self.WriteMask))
3753
        packet.append(uatype_UInt32.pack(self.UserWriteMask))
3754
        return b''.join(packet)
3755
3756 1
    @staticmethod
3757
    def from_binary(data):
3758
        return NodeAttributes(data)
3759
3760 1
    def _binary_init(self, data):
3761
        self.SpecifiedAttributes = uatype_UInt32.unpack(data.read(4))[0]
3762
        self.DisplayName = LocalizedText.from_binary(data)
3763
        self.Description = LocalizedText.from_binary(data)
3764
        self.WriteMask = uatype_UInt32.unpack(data.read(4))[0]
3765
        self.UserWriteMask = uatype_UInt32.unpack(data.read(4))[0]
3766
3767 1
    def __str__(self):
3768
        return 'NodeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
3769
               'DisplayName:' + str(self.DisplayName) + ', ' + \
3770
               'Description:' + str(self.Description) + ', ' + \
3771
               'WriteMask:' + str(self.WriteMask) + ', ' + \
3772
               'UserWriteMask:' + str(self.UserWriteMask) + ')'
3773
3774 1
    __repr__ = __str__
3775
3776
3777 1 View Code Duplication
class ObjectAttributes(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3778
    '''
3779
    The attributes for an object node.
3780
3781
    :ivar SpecifiedAttributes:
3782
    :vartype SpecifiedAttributes: UInt32
3783
    :ivar DisplayName:
3784
    :vartype DisplayName: LocalizedText
3785
    :ivar Description:
3786
    :vartype Description: LocalizedText
3787
    :ivar WriteMask:
3788
    :vartype WriteMask: UInt32
3789
    :ivar UserWriteMask:
3790
    :vartype UserWriteMask: UInt32
3791
    :ivar EventNotifier:
3792
    :vartype EventNotifier: Byte
3793
    '''
3794 1
    def __init__(self, binary=None):
3795 1
        if binary is not None:
3796 1
            self._binary_init(binary)
3797 1
            self._freeze = True
3798 1
            return
3799 1
        self.SpecifiedAttributes = 0
3800 1
        self.DisplayName = LocalizedText()
3801 1
        self.Description = LocalizedText()
3802 1
        self.WriteMask = 0
3803 1
        self.UserWriteMask = 0
3804 1
        self.EventNotifier = 0
3805 1
        self._freeze = True
3806
3807 1
    def to_binary(self):
3808 1
        packet = []
3809 1
        packet.append(uatype_UInt32.pack(self.SpecifiedAttributes))
3810 1
        packet.append(self.DisplayName.to_binary())
3811 1
        packet.append(self.Description.to_binary())
3812 1
        packet.append(uatype_UInt32.pack(self.WriteMask))
3813 1
        packet.append(uatype_UInt32.pack(self.UserWriteMask))
3814 1
        packet.append(uatype_Byte.pack(self.EventNotifier))
3815 1
        return b''.join(packet)
3816
3817 1
    @staticmethod
3818
    def from_binary(data):
3819 1
        return ObjectAttributes(data)
3820
3821 1
    def _binary_init(self, data):
3822 1
        self.SpecifiedAttributes = uatype_UInt32.unpack(data.read(4))[0]
3823 1
        self.DisplayName = LocalizedText.from_binary(data)
3824 1
        self.Description = LocalizedText.from_binary(data)
3825 1
        self.WriteMask = uatype_UInt32.unpack(data.read(4))[0]
3826 1
        self.UserWriteMask = uatype_UInt32.unpack(data.read(4))[0]
3827 1
        self.EventNotifier = uatype_Byte.unpack(data.read(1))[0]
3828
3829 1
    def __str__(self):
3830
        return 'ObjectAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
3831
               'DisplayName:' + str(self.DisplayName) + ', ' + \
3832
               'Description:' + str(self.Description) + ', ' + \
3833
               'WriteMask:' + str(self.WriteMask) + ', ' + \
3834
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
3835
               'EventNotifier:' + str(self.EventNotifier) + ')'
3836
3837 1
    __repr__ = __str__
3838
3839
3840 1
class VariableAttributes(FrozenClass):
3841
    '''
3842
    The attributes for a variable node.
3843
3844
    :ivar SpecifiedAttributes:
3845
    :vartype SpecifiedAttributes: UInt32
3846
    :ivar DisplayName:
3847
    :vartype DisplayName: LocalizedText
3848
    :ivar Description:
3849
    :vartype Description: LocalizedText
3850
    :ivar WriteMask:
3851
    :vartype WriteMask: UInt32
3852
    :ivar UserWriteMask:
3853
    :vartype UserWriteMask: UInt32
3854
    :ivar Value:
3855
    :vartype Value: Variant
3856
    :ivar DataType:
3857
    :vartype DataType: NodeId
3858
    :ivar ValueRank:
3859
    :vartype ValueRank: Int32
3860
    :ivar ArrayDimensions:
3861
    :vartype ArrayDimensions: UInt32
3862
    :ivar AccessLevel:
3863
    :vartype AccessLevel: Byte
3864
    :ivar UserAccessLevel:
3865
    :vartype UserAccessLevel: Byte
3866
    :ivar MinimumSamplingInterval:
3867
    :vartype MinimumSamplingInterval: Double
3868
    :ivar Historizing:
3869
    :vartype Historizing: Boolean
3870
    '''
3871 1
    def __init__(self, binary=None):
3872 1
        if binary is not None:
3873 1
            self._binary_init(binary)
3874 1
            self._freeze = True
3875 1
            return
3876 1
        self.SpecifiedAttributes = 0
3877 1
        self.DisplayName = LocalizedText()
3878 1
        self.Description = LocalizedText()
3879 1
        self.WriteMask = 0
3880 1
        self.UserWriteMask = 0
3881 1
        self.Value = Variant()
3882 1
        self.DataType = NodeId()
3883 1
        self.ValueRank = 0
3884 1
        self.ArrayDimensions = []
3885 1
        self.AccessLevel = 0
3886 1
        self.UserAccessLevel = 0
3887 1
        self.MinimumSamplingInterval = 0
3888 1
        self.Historizing = True
3889 1
        self._freeze = True
3890
3891 1
    def to_binary(self):
3892 1
        packet = []
3893 1
        packet.append(uatype_UInt32.pack(self.SpecifiedAttributes))
3894 1
        packet.append(self.DisplayName.to_binary())
3895 1
        packet.append(self.Description.to_binary())
3896 1
        packet.append(uatype_UInt32.pack(self.WriteMask))
3897 1
        packet.append(uatype_UInt32.pack(self.UserWriteMask))
3898 1
        packet.append(self.Value.to_binary())
3899 1
        packet.append(self.DataType.to_binary())
3900 1
        packet.append(uatype_Int32.pack(self.ValueRank))
3901 1
        packet.append(uatype_Int32.pack(len(self.ArrayDimensions)))
3902 1
        for fieldname in self.ArrayDimensions:
3903
            packet.append(uatype_UInt32.pack(fieldname))
3904 1
        packet.append(uatype_Byte.pack(self.AccessLevel))
3905 1
        packet.append(uatype_Byte.pack(self.UserAccessLevel))
3906 1
        packet.append(uatype_Double.pack(self.MinimumSamplingInterval))
3907 1
        packet.append(uatype_Boolean.pack(self.Historizing))
3908 1
        return b''.join(packet)
3909
3910 1
    @staticmethod
3911
    def from_binary(data):
3912 1
        return VariableAttributes(data)
3913
3914 1
    def _binary_init(self, data):
3915 1
        self.SpecifiedAttributes = uatype_UInt32.unpack(data.read(4))[0]
3916 1
        self.DisplayName = LocalizedText.from_binary(data)
3917 1
        self.Description = LocalizedText.from_binary(data)
3918 1
        self.WriteMask = uatype_UInt32.unpack(data.read(4))[0]
3919 1
        self.UserWriteMask = uatype_UInt32.unpack(data.read(4))[0]
3920 1
        self.Value = Variant.from_binary(data)
3921 1
        self.DataType = NodeId.from_binary(data)
3922 1
        self.ValueRank = uatype_Int32.unpack(data.read(4))[0]
3923 1
        self.ArrayDimensions = unpack_uatype_array('UInt32', data)
3924 1
        self.AccessLevel = uatype_Byte.unpack(data.read(1))[0]
3925 1
        self.UserAccessLevel = uatype_Byte.unpack(data.read(1))[0]
3926 1
        self.MinimumSamplingInterval = uatype_Double.unpack(data.read(8))[0]
3927 1
        self.Historizing = uatype_Boolean.unpack(data.read(1))[0]
3928
3929 1
    def __str__(self):
3930
        return 'VariableAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
3931
               'DisplayName:' + str(self.DisplayName) + ', ' + \
3932
               'Description:' + str(self.Description) + ', ' + \
3933
               'WriteMask:' + str(self.WriteMask) + ', ' + \
3934
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
3935
               'Value:' + str(self.Value) + ', ' + \
3936
               'DataType:' + str(self.DataType) + ', ' + \
3937
               'ValueRank:' + str(self.ValueRank) + ', ' + \
3938
               'ArrayDimensions:' + str(self.ArrayDimensions) + ', ' + \
3939
               'AccessLevel:' + str(self.AccessLevel) + ', ' + \
3940
               'UserAccessLevel:' + str(self.UserAccessLevel) + ', ' + \
3941
               'MinimumSamplingInterval:' + str(self.MinimumSamplingInterval) + ', ' + \
3942
               'Historizing:' + str(self.Historizing) + ')'
3943
3944 1
    __repr__ = __str__
3945
3946
3947 1 View Code Duplication
class MethodAttributes(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3948
    '''
3949
    The attributes for a method node.
3950
3951
    :ivar SpecifiedAttributes:
3952
    :vartype SpecifiedAttributes: UInt32
3953
    :ivar DisplayName:
3954
    :vartype DisplayName: LocalizedText
3955
    :ivar Description:
3956
    :vartype Description: LocalizedText
3957
    :ivar WriteMask:
3958
    :vartype WriteMask: UInt32
3959
    :ivar UserWriteMask:
3960
    :vartype UserWriteMask: UInt32
3961
    :ivar Executable:
3962
    :vartype Executable: Boolean
3963
    :ivar UserExecutable:
3964
    :vartype UserExecutable: Boolean
3965
    '''
3966 1
    def __init__(self, binary=None):
3967 1
        if binary is not None:
3968
            self._binary_init(binary)
3969
            self._freeze = True
3970
            return
3971 1
        self.SpecifiedAttributes = 0
3972 1
        self.DisplayName = LocalizedText()
3973 1
        self.Description = LocalizedText()
3974 1
        self.WriteMask = 0
3975 1
        self.UserWriteMask = 0
3976 1
        self.Executable = True
3977 1
        self.UserExecutable = True
3978 1
        self._freeze = True
3979
3980 1
    def to_binary(self):
3981
        packet = []
3982
        packet.append(uatype_UInt32.pack(self.SpecifiedAttributes))
3983
        packet.append(self.DisplayName.to_binary())
3984
        packet.append(self.Description.to_binary())
3985
        packet.append(uatype_UInt32.pack(self.WriteMask))
3986
        packet.append(uatype_UInt32.pack(self.UserWriteMask))
3987
        packet.append(uatype_Boolean.pack(self.Executable))
3988
        packet.append(uatype_Boolean.pack(self.UserExecutable))
3989
        return b''.join(packet)
3990
3991 1
    @staticmethod
3992
    def from_binary(data):
3993
        return MethodAttributes(data)
3994
3995 1
    def _binary_init(self, data):
3996
        self.SpecifiedAttributes = uatype_UInt32.unpack(data.read(4))[0]
3997
        self.DisplayName = LocalizedText.from_binary(data)
3998
        self.Description = LocalizedText.from_binary(data)
3999
        self.WriteMask = uatype_UInt32.unpack(data.read(4))[0]
4000
        self.UserWriteMask = uatype_UInt32.unpack(data.read(4))[0]
4001
        self.Executable = uatype_Boolean.unpack(data.read(1))[0]
4002
        self.UserExecutable = uatype_Boolean.unpack(data.read(1))[0]
4003
4004 1
    def __str__(self):
4005
        return 'MethodAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4006
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4007
               'Description:' + str(self.Description) + ', ' + \
4008
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4009
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4010
               'Executable:' + str(self.Executable) + ', ' + \
4011
               'UserExecutable:' + str(self.UserExecutable) + ')'
4012
4013 1
    __repr__ = __str__
4014
4015
4016 1 View Code Duplication
class ObjectTypeAttributes(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4017
    '''
4018
    The attributes for an object type node.
4019
4020
    :ivar SpecifiedAttributes:
4021
    :vartype SpecifiedAttributes: UInt32
4022
    :ivar DisplayName:
4023
    :vartype DisplayName: LocalizedText
4024
    :ivar Description:
4025
    :vartype Description: LocalizedText
4026
    :ivar WriteMask:
4027
    :vartype WriteMask: UInt32
4028
    :ivar UserWriteMask:
4029
    :vartype UserWriteMask: UInt32
4030
    :ivar IsAbstract:
4031
    :vartype IsAbstract: Boolean
4032
    '''
4033 1
    def __init__(self, binary=None):
4034 1
        if binary is not None:
4035
            self._binary_init(binary)
4036
            self._freeze = True
4037
            return
4038 1
        self.SpecifiedAttributes = 0
4039 1
        self.DisplayName = LocalizedText()
4040 1
        self.Description = LocalizedText()
4041 1
        self.WriteMask = 0
4042 1
        self.UserWriteMask = 0
4043 1
        self.IsAbstract = True
4044 1
        self._freeze = True
4045
4046 1
    def to_binary(self):
4047
        packet = []
4048
        packet.append(uatype_UInt32.pack(self.SpecifiedAttributes))
4049
        packet.append(self.DisplayName.to_binary())
4050
        packet.append(self.Description.to_binary())
4051
        packet.append(uatype_UInt32.pack(self.WriteMask))
4052
        packet.append(uatype_UInt32.pack(self.UserWriteMask))
4053
        packet.append(uatype_Boolean.pack(self.IsAbstract))
4054
        return b''.join(packet)
4055
4056 1
    @staticmethod
4057
    def from_binary(data):
4058
        return ObjectTypeAttributes(data)
4059
4060 1
    def _binary_init(self, data):
4061
        self.SpecifiedAttributes = uatype_UInt32.unpack(data.read(4))[0]
4062
        self.DisplayName = LocalizedText.from_binary(data)
4063
        self.Description = LocalizedText.from_binary(data)
4064
        self.WriteMask = uatype_UInt32.unpack(data.read(4))[0]
4065
        self.UserWriteMask = uatype_UInt32.unpack(data.read(4))[0]
4066
        self.IsAbstract = uatype_Boolean.unpack(data.read(1))[0]
4067
4068 1
    def __str__(self):
4069
        return 'ObjectTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4070
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4071
               'Description:' + str(self.Description) + ', ' + \
4072
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4073
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4074
               'IsAbstract:' + str(self.IsAbstract) + ')'
4075
4076 1
    __repr__ = __str__
4077
4078
4079 1
class VariableTypeAttributes(FrozenClass):
4080
    '''
4081
    The attributes for a variable type node.
4082
4083
    :ivar SpecifiedAttributes:
4084
    :vartype SpecifiedAttributes: UInt32
4085
    :ivar DisplayName:
4086
    :vartype DisplayName: LocalizedText
4087
    :ivar Description:
4088
    :vartype Description: LocalizedText
4089
    :ivar WriteMask:
4090
    :vartype WriteMask: UInt32
4091
    :ivar UserWriteMask:
4092
    :vartype UserWriteMask: UInt32
4093
    :ivar Value:
4094
    :vartype Value: Variant
4095
    :ivar DataType:
4096
    :vartype DataType: NodeId
4097
    :ivar ValueRank:
4098
    :vartype ValueRank: Int32
4099
    :ivar ArrayDimensions:
4100
    :vartype ArrayDimensions: UInt32
4101
    :ivar IsAbstract:
4102
    :vartype IsAbstract: Boolean
4103
    '''
4104 1 View Code Duplication
    def __init__(self, binary=None):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4105 1
        if binary is not None:
4106
            self._binary_init(binary)
4107
            self._freeze = True
4108
            return
4109 1
        self.SpecifiedAttributes = 0
4110 1
        self.DisplayName = LocalizedText()
4111 1
        self.Description = LocalizedText()
4112 1
        self.WriteMask = 0
4113 1
        self.UserWriteMask = 0
4114 1
        self.Value = Variant()
4115 1
        self.DataType = NodeId()
4116 1
        self.ValueRank = 0
4117 1
        self.ArrayDimensions = []
4118 1
        self.IsAbstract = True
4119 1
        self._freeze = True
4120
4121 1
    def to_binary(self):
4122
        packet = []
4123
        packet.append(uatype_UInt32.pack(self.SpecifiedAttributes))
4124
        packet.append(self.DisplayName.to_binary())
4125
        packet.append(self.Description.to_binary())
4126
        packet.append(uatype_UInt32.pack(self.WriteMask))
4127
        packet.append(uatype_UInt32.pack(self.UserWriteMask))
4128
        packet.append(self.Value.to_binary())
4129
        packet.append(self.DataType.to_binary())
4130
        packet.append(uatype_Int32.pack(self.ValueRank))
4131
        packet.append(uatype_Int32.pack(len(self.ArrayDimensions)))
4132
        for fieldname in self.ArrayDimensions:
4133
            packet.append(uatype_UInt32.pack(fieldname))
4134
        packet.append(uatype_Boolean.pack(self.IsAbstract))
4135
        return b''.join(packet)
4136
4137 1
    @staticmethod
4138
    def from_binary(data):
4139
        return VariableTypeAttributes(data)
4140
4141 1
    def _binary_init(self, data):
4142
        self.SpecifiedAttributes = uatype_UInt32.unpack(data.read(4))[0]
4143
        self.DisplayName = LocalizedText.from_binary(data)
4144
        self.Description = LocalizedText.from_binary(data)
4145
        self.WriteMask = uatype_UInt32.unpack(data.read(4))[0]
4146
        self.UserWriteMask = uatype_UInt32.unpack(data.read(4))[0]
4147
        self.Value = Variant.from_binary(data)
4148
        self.DataType = NodeId.from_binary(data)
4149
        self.ValueRank = uatype_Int32.unpack(data.read(4))[0]
4150
        self.ArrayDimensions = unpack_uatype_array('UInt32', data)
4151
        self.IsAbstract = uatype_Boolean.unpack(data.read(1))[0]
4152
4153 1
    def __str__(self):
4154
        return 'VariableTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4155
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4156
               'Description:' + str(self.Description) + ', ' + \
4157
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4158
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4159
               'Value:' + str(self.Value) + ', ' + \
4160
               'DataType:' + str(self.DataType) + ', ' + \
4161
               'ValueRank:' + str(self.ValueRank) + ', ' + \
4162
               'ArrayDimensions:' + str(self.ArrayDimensions) + ', ' + \
4163
               'IsAbstract:' + str(self.IsAbstract) + ')'
4164
4165 1
    __repr__ = __str__
4166
4167
4168 1
class ReferenceTypeAttributes(FrozenClass):
4169
    '''
4170
    The attributes for a reference type node.
4171
4172
    :ivar SpecifiedAttributes:
4173
    :vartype SpecifiedAttributes: UInt32
4174
    :ivar DisplayName:
4175
    :vartype DisplayName: LocalizedText
4176
    :ivar Description:
4177
    :vartype Description: LocalizedText
4178
    :ivar WriteMask:
4179
    :vartype WriteMask: UInt32
4180
    :ivar UserWriteMask:
4181
    :vartype UserWriteMask: UInt32
4182
    :ivar IsAbstract:
4183
    :vartype IsAbstract: Boolean
4184
    :ivar Symmetric:
4185
    :vartype Symmetric: Boolean
4186
    :ivar InverseName:
4187
    :vartype InverseName: LocalizedText
4188
    '''
4189 1 View Code Duplication
    def __init__(self, binary=None):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4190 1
        if binary is not None:
4191
            self._binary_init(binary)
4192
            self._freeze = True
4193
            return
4194 1
        self.SpecifiedAttributes = 0
4195 1
        self.DisplayName = LocalizedText()
4196 1
        self.Description = LocalizedText()
4197 1
        self.WriteMask = 0
4198 1
        self.UserWriteMask = 0
4199 1
        self.IsAbstract = True
4200 1
        self.Symmetric = True
4201 1
        self.InverseName = LocalizedText()
4202 1
        self._freeze = True
4203
4204 1
    def to_binary(self):
4205
        packet = []
4206
        packet.append(uatype_UInt32.pack(self.SpecifiedAttributes))
4207
        packet.append(self.DisplayName.to_binary())
4208
        packet.append(self.Description.to_binary())
4209
        packet.append(uatype_UInt32.pack(self.WriteMask))
4210
        packet.append(uatype_UInt32.pack(self.UserWriteMask))
4211
        packet.append(uatype_Boolean.pack(self.IsAbstract))
4212
        packet.append(uatype_Boolean.pack(self.Symmetric))
4213
        packet.append(self.InverseName.to_binary())
4214
        return b''.join(packet)
4215
4216 1
    @staticmethod
4217
    def from_binary(data):
4218
        return ReferenceTypeAttributes(data)
4219
4220 1
    def _binary_init(self, data):
4221
        self.SpecifiedAttributes = uatype_UInt32.unpack(data.read(4))[0]
4222
        self.DisplayName = LocalizedText.from_binary(data)
4223
        self.Description = LocalizedText.from_binary(data)
4224
        self.WriteMask = uatype_UInt32.unpack(data.read(4))[0]
4225
        self.UserWriteMask = uatype_UInt32.unpack(data.read(4))[0]
4226
        self.IsAbstract = uatype_Boolean.unpack(data.read(1))[0]
4227
        self.Symmetric = uatype_Boolean.unpack(data.read(1))[0]
4228
        self.InverseName = LocalizedText.from_binary(data)
4229
4230 1
    def __str__(self):
4231
        return 'ReferenceTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4232
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4233
               'Description:' + str(self.Description) + ', ' + \
4234
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4235
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4236
               'IsAbstract:' + str(self.IsAbstract) + ', ' + \
4237
               'Symmetric:' + str(self.Symmetric) + ', ' + \
4238
               'InverseName:' + str(self.InverseName) + ')'
4239
4240 1
    __repr__ = __str__
4241
4242
4243 1 View Code Duplication
class DataTypeAttributes(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4244
    '''
4245
    The attributes for a data type node.
4246
4247
    :ivar SpecifiedAttributes:
4248
    :vartype SpecifiedAttributes: UInt32
4249
    :ivar DisplayName:
4250
    :vartype DisplayName: LocalizedText
4251
    :ivar Description:
4252
    :vartype Description: LocalizedText
4253
    :ivar WriteMask:
4254
    :vartype WriteMask: UInt32
4255
    :ivar UserWriteMask:
4256
    :vartype UserWriteMask: UInt32
4257
    :ivar IsAbstract:
4258
    :vartype IsAbstract: Boolean
4259
    '''
4260 1
    def __init__(self, binary=None):
4261 1
        if binary is not None:
4262
            self._binary_init(binary)
4263
            self._freeze = True
4264
            return
4265 1
        self.SpecifiedAttributes = 0
4266 1
        self.DisplayName = LocalizedText()
4267 1
        self.Description = LocalizedText()
4268 1
        self.WriteMask = 0
4269 1
        self.UserWriteMask = 0
4270 1
        self.IsAbstract = True
4271 1
        self._freeze = True
4272
4273 1
    def to_binary(self):
4274
        packet = []
4275
        packet.append(uatype_UInt32.pack(self.SpecifiedAttributes))
4276
        packet.append(self.DisplayName.to_binary())
4277
        packet.append(self.Description.to_binary())
4278
        packet.append(uatype_UInt32.pack(self.WriteMask))
4279
        packet.append(uatype_UInt32.pack(self.UserWriteMask))
4280
        packet.append(uatype_Boolean.pack(self.IsAbstract))
4281
        return b''.join(packet)
4282
4283 1
    @staticmethod
4284
    def from_binary(data):
4285
        return DataTypeAttributes(data)
4286
4287 1
    def _binary_init(self, data):
4288
        self.SpecifiedAttributes = uatype_UInt32.unpack(data.read(4))[0]
4289
        self.DisplayName = LocalizedText.from_binary(data)
4290
        self.Description = LocalizedText.from_binary(data)
4291
        self.WriteMask = uatype_UInt32.unpack(data.read(4))[0]
4292
        self.UserWriteMask = uatype_UInt32.unpack(data.read(4))[0]
4293
        self.IsAbstract = uatype_Boolean.unpack(data.read(1))[0]
4294
4295 1
    def __str__(self):
4296
        return 'DataTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4297
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4298
               'Description:' + str(self.Description) + ', ' + \
4299
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4300
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4301
               'IsAbstract:' + str(self.IsAbstract) + ')'
4302
4303 1
    __repr__ = __str__
4304
4305
4306 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...
4307
    '''
4308
    The attributes for a view node.
4309
4310
    :ivar SpecifiedAttributes:
4311
    :vartype SpecifiedAttributes: UInt32
4312
    :ivar DisplayName:
4313
    :vartype DisplayName: LocalizedText
4314
    :ivar Description:
4315
    :vartype Description: LocalizedText
4316
    :ivar WriteMask:
4317
    :vartype WriteMask: UInt32
4318
    :ivar UserWriteMask:
4319
    :vartype UserWriteMask: UInt32
4320
    :ivar ContainsNoLoops:
4321
    :vartype ContainsNoLoops: Boolean
4322
    :ivar EventNotifier:
4323
    :vartype EventNotifier: Byte
4324
    '''
4325 1
    def __init__(self, binary=None):
4326
        if binary is not None:
4327
            self._binary_init(binary)
4328
            self._freeze = True
4329
            return
4330
        self.SpecifiedAttributes = 0
4331
        self.DisplayName = LocalizedText()
4332
        self.Description = LocalizedText()
4333
        self.WriteMask = 0
4334
        self.UserWriteMask = 0
4335
        self.ContainsNoLoops = True
4336
        self.EventNotifier = 0
4337
        self._freeze = True
4338
4339 1
    def to_binary(self):
4340
        packet = []
4341
        packet.append(uatype_UInt32.pack(self.SpecifiedAttributes))
4342
        packet.append(self.DisplayName.to_binary())
4343
        packet.append(self.Description.to_binary())
4344
        packet.append(uatype_UInt32.pack(self.WriteMask))
4345
        packet.append(uatype_UInt32.pack(self.UserWriteMask))
4346
        packet.append(uatype_Boolean.pack(self.ContainsNoLoops))
4347
        packet.append(uatype_Byte.pack(self.EventNotifier))
4348
        return b''.join(packet)
4349
4350 1
    @staticmethod
4351
    def from_binary(data):
4352
        return ViewAttributes(data)
4353
4354 1
    def _binary_init(self, data):
4355
        self.SpecifiedAttributes = uatype_UInt32.unpack(data.read(4))[0]
4356
        self.DisplayName = LocalizedText.from_binary(data)
4357
        self.Description = LocalizedText.from_binary(data)
4358
        self.WriteMask = uatype_UInt32.unpack(data.read(4))[0]
4359
        self.UserWriteMask = uatype_UInt32.unpack(data.read(4))[0]
4360
        self.ContainsNoLoops = uatype_Boolean.unpack(data.read(1))[0]
4361
        self.EventNotifier = uatype_Byte.unpack(data.read(1))[0]
4362
4363 1
    def __str__(self):
4364
        return 'ViewAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4365
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4366
               'Description:' + str(self.Description) + ', ' + \
4367
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4368
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4369
               'ContainsNoLoops:' + str(self.ContainsNoLoops) + ', ' + \
4370
               'EventNotifier:' + str(self.EventNotifier) + ')'
4371
4372 1
    __repr__ = __str__
4373
4374
4375 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...
4376
    '''
4377
    A request to add a node to the server address space.
4378
4379
    :ivar ParentNodeId:
4380
    :vartype ParentNodeId: ExpandedNodeId
4381
    :ivar ReferenceTypeId:
4382
    :vartype ReferenceTypeId: NodeId
4383
    :ivar RequestedNewNodeId:
4384
    :vartype RequestedNewNodeId: ExpandedNodeId
4385
    :ivar BrowseName:
4386
    :vartype BrowseName: QualifiedName
4387
    :ivar NodeClass:
4388
    :vartype NodeClass: NodeClass
4389
    :ivar NodeAttributes:
4390
    :vartype NodeAttributes: ExtensionObject
4391
    :ivar TypeDefinition:
4392
    :vartype TypeDefinition: ExpandedNodeId
4393
    '''
4394 1
    def __init__(self, binary=None):
4395 1
        if binary is not None:
4396 1
            self._binary_init(binary)
4397 1
            self._freeze = True
4398 1
            return
4399 1
        self.ParentNodeId = ExpandedNodeId()
4400 1
        self.ReferenceTypeId = NodeId()
4401 1
        self.RequestedNewNodeId = ExpandedNodeId()
4402 1
        self.BrowseName = QualifiedName()
4403 1
        self.NodeClass = NodeClass(0)
4404 1
        self.NodeAttributes = None
4405 1
        self.TypeDefinition = ExpandedNodeId()
4406 1
        self._freeze = True
4407
4408 1
    def to_binary(self):
4409 1
        packet = []
4410 1
        packet.append(self.ParentNodeId.to_binary())
4411 1
        packet.append(self.ReferenceTypeId.to_binary())
4412 1
        packet.append(self.RequestedNewNodeId.to_binary())
4413 1
        packet.append(self.BrowseName.to_binary())
4414 1
        packet.append(uatype_UInt32.pack(self.NodeClass.value))
4415 1
        packet.append(extensionobject_to_binary(self.NodeAttributes))
4416 1
        packet.append(self.TypeDefinition.to_binary())
4417 1
        return b''.join(packet)
4418
4419 1
    @staticmethod
4420
    def from_binary(data):
4421 1
        return AddNodesItem(data)
4422
4423 1
    def _binary_init(self, data):
4424 1
        self.ParentNodeId = ExpandedNodeId.from_binary(data)
4425 1
        self.ReferenceTypeId = NodeId.from_binary(data)
4426 1
        self.RequestedNewNodeId = ExpandedNodeId.from_binary(data)
4427 1
        self.BrowseName = QualifiedName.from_binary(data)
4428 1
        self.NodeClass = NodeClass(uatype_UInt32.unpack(data.read(4))[0])
4429 1
        self.NodeAttributes = extensionobject_from_binary(data)
4430 1
        self.TypeDefinition = ExpandedNodeId.from_binary(data)
4431
4432 1
    def __str__(self):
4433
        return 'AddNodesItem(' + 'ParentNodeId:' + str(self.ParentNodeId) + ', ' + \
4434
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
4435
               'RequestedNewNodeId:' + str(self.RequestedNewNodeId) + ', ' + \
4436
               'BrowseName:' + str(self.BrowseName) + ', ' + \
4437
               'NodeClass:' + str(self.NodeClass) + ', ' + \
4438
               'NodeAttributes:' + str(self.NodeAttributes) + ', ' + \
4439
               'TypeDefinition:' + str(self.TypeDefinition) + ')'
4440
4441 1
    __repr__ = __str__
4442
4443
4444 1 View Code Duplication
class AddNodesResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4445
    '''
4446
    A result of an add node operation.
4447
4448
    :ivar StatusCode:
4449
    :vartype StatusCode: StatusCode
4450
    :ivar AddedNodeId:
4451
    :vartype AddedNodeId: NodeId
4452
    '''
4453 1
    def __init__(self, binary=None):
4454 1
        if binary is not None:
4455 1
            self._binary_init(binary)
4456 1
            self._freeze = True
4457 1
            return
4458 1
        self.StatusCode = StatusCode()
4459 1
        self.AddedNodeId = NodeId()
4460 1
        self._freeze = True
4461
4462 1
    def to_binary(self):
4463 1
        packet = []
4464 1
        packet.append(self.StatusCode.to_binary())
4465 1
        packet.append(self.AddedNodeId.to_binary())
4466 1
        return b''.join(packet)
4467
4468 1
    @staticmethod
4469
    def from_binary(data):
4470 1
        return AddNodesResult(data)
4471
4472 1
    def _binary_init(self, data):
4473 1
        self.StatusCode = StatusCode.from_binary(data)
4474 1
        self.AddedNodeId = NodeId.from_binary(data)
4475
4476 1
    def __str__(self):
4477
        return 'AddNodesResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
4478
               'AddedNodeId:' + str(self.AddedNodeId) + ')'
4479
4480 1
    __repr__ = __str__
4481
4482
4483 1 View Code Duplication
class AddNodesParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4484
    '''
4485
    :ivar NodesToAdd:
4486
    :vartype NodesToAdd: AddNodesItem
4487
    '''
4488 1
    def __init__(self, binary=None):
4489 1
        if binary is not None:
4490 1
            self._binary_init(binary)
4491 1
            self._freeze = True
4492 1
            return
4493 1
        self.NodesToAdd = []
4494 1
        self._freeze = True
4495
4496 1
    def to_binary(self):
4497 1
        packet = []
4498 1
        packet.append(uatype_Int32.pack(len(self.NodesToAdd)))
4499 1
        for fieldname in self.NodesToAdd:
4500 1
            packet.append(fieldname.to_binary())
4501 1
        return b''.join(packet)
4502
4503 1
    @staticmethod
4504
    def from_binary(data):
4505 1
        return AddNodesParameters(data)
4506
4507 1
    def _binary_init(self, data):
4508 1
        length = uatype_Int32.unpack(data.read(4))[0]
4509 1
        array = []
4510 1
        if length != -1:
4511 1
            for _ in range(0, length):
4512 1
                array.append(AddNodesItem.from_binary(data))
4513 1
        self.NodesToAdd = array
4514
4515 1
    def __str__(self):
4516
        return 'AddNodesParameters(' + 'NodesToAdd:' + str(self.NodesToAdd) + ')'
4517
4518 1
    __repr__ = __str__
4519
4520
4521 1 View Code Duplication
class AddNodesRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4522
    '''
4523
    Adds one or more nodes to the server address space.
4524
4525
    :ivar TypeId:
4526
    :vartype TypeId: NodeId
4527
    :ivar RequestHeader:
4528
    :vartype RequestHeader: RequestHeader
4529
    :ivar Parameters:
4530
    :vartype Parameters: AddNodesParameters
4531
    '''
4532 1
    def __init__(self, binary=None):
4533 1
        if binary is not None:
4534
            self._binary_init(binary)
4535
            self._freeze = True
4536
            return
4537 1
        self.TypeId = FourByteNodeId(ObjectIds.AddNodesRequest_Encoding_DefaultBinary)
4538 1
        self.RequestHeader = RequestHeader()
4539 1
        self.Parameters = AddNodesParameters()
4540 1
        self._freeze = True
4541
4542 1
    def to_binary(self):
4543 1
        packet = []
4544 1
        packet.append(self.TypeId.to_binary())
4545 1
        packet.append(self.RequestHeader.to_binary())
4546 1
        packet.append(self.Parameters.to_binary())
4547 1
        return b''.join(packet)
4548
4549 1
    @staticmethod
4550
    def from_binary(data):
4551
        return AddNodesRequest(data)
4552
4553 1
    def _binary_init(self, data):
4554
        self.TypeId = NodeId.from_binary(data)
4555
        self.RequestHeader = RequestHeader.from_binary(data)
4556
        self.Parameters = AddNodesParameters.from_binary(data)
4557
4558 1
    def __str__(self):
4559
        return 'AddNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
4560
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
4561
               'Parameters:' + str(self.Parameters) + ')'
4562
4563 1
    __repr__ = __str__
4564
4565
4566 1 View Code Duplication
class AddNodesResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4567
    '''
4568
    Adds one or more nodes to the server address space.
4569
4570
    :ivar TypeId:
4571
    :vartype TypeId: NodeId
4572
    :ivar ResponseHeader:
4573
    :vartype ResponseHeader: ResponseHeader
4574
    :ivar Results:
4575
    :vartype Results: AddNodesResult
4576
    :ivar DiagnosticInfos:
4577
    :vartype DiagnosticInfos: DiagnosticInfo
4578
    '''
4579 1
    def __init__(self, binary=None):
4580 1
        if binary is not None:
4581 1
            self._binary_init(binary)
4582 1
            self._freeze = True
4583 1
            return
4584 1
        self.TypeId = FourByteNodeId(ObjectIds.AddNodesResponse_Encoding_DefaultBinary)
4585 1
        self.ResponseHeader = ResponseHeader()
4586 1
        self.Results = []
4587 1
        self.DiagnosticInfos = []
4588 1
        self._freeze = True
4589
4590 1
    def to_binary(self):
4591 1
        packet = []
4592 1
        packet.append(self.TypeId.to_binary())
4593 1
        packet.append(self.ResponseHeader.to_binary())
4594 1
        packet.append(uatype_Int32.pack(len(self.Results)))
4595 1
        for fieldname in self.Results:
4596 1
            packet.append(fieldname.to_binary())
4597 1
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
4598 1
        for fieldname in self.DiagnosticInfos:
4599
            packet.append(fieldname.to_binary())
4600 1
        return b''.join(packet)
4601
4602 1
    @staticmethod
4603
    def from_binary(data):
4604 1
        return AddNodesResponse(data)
4605
4606 1
    def _binary_init(self, data):
4607 1
        self.TypeId = NodeId.from_binary(data)
4608 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
4609 1
        length = uatype_Int32.unpack(data.read(4))[0]
4610 1
        array = []
4611 1
        if length != -1:
4612 1
            for _ in range(0, length):
4613 1
                array.append(AddNodesResult.from_binary(data))
4614 1
        self.Results = array
4615 1
        length = uatype_Int32.unpack(data.read(4))[0]
4616 1
        array = []
4617 1
        if length != -1:
4618 1
            for _ in range(0, length):
4619
                array.append(DiagnosticInfo.from_binary(data))
4620 1
        self.DiagnosticInfos = array
4621
4622 1
    def __str__(self):
4623
        return 'AddNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
4624
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
4625
               'Results:' + str(self.Results) + ', ' + \
4626
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
4627
4628 1
    __repr__ = __str__
4629
4630
4631 1 View Code Duplication
class AddReferencesItem(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4632
    '''
4633
    A request to add a reference to the server address space.
4634
4635
    :ivar SourceNodeId:
4636
    :vartype SourceNodeId: NodeId
4637
    :ivar ReferenceTypeId:
4638
    :vartype ReferenceTypeId: NodeId
4639
    :ivar IsForward:
4640
    :vartype IsForward: Boolean
4641
    :ivar TargetServerUri:
4642
    :vartype TargetServerUri: String
4643
    :ivar TargetNodeId:
4644
    :vartype TargetNodeId: ExpandedNodeId
4645
    :ivar TargetNodeClass:
4646
    :vartype TargetNodeClass: NodeClass
4647
    '''
4648 1
    def __init__(self, binary=None):
4649 1
        if binary is not None:
4650
            self._binary_init(binary)
4651
            self._freeze = True
4652
            return
4653 1
        self.SourceNodeId = NodeId()
4654 1
        self.ReferenceTypeId = NodeId()
4655 1
        self.IsForward = True
4656 1
        self.TargetServerUri = ''
4657 1
        self.TargetNodeId = ExpandedNodeId()
4658 1
        self.TargetNodeClass = NodeClass(0)
4659 1
        self._freeze = True
4660
4661 1
    def to_binary(self):
4662
        packet = []
4663
        packet.append(self.SourceNodeId.to_binary())
4664
        packet.append(self.ReferenceTypeId.to_binary())
4665
        packet.append(uatype_Boolean.pack(self.IsForward))
4666
        packet.append(pack_string(self.TargetServerUri))
4667
        packet.append(self.TargetNodeId.to_binary())
4668
        packet.append(uatype_UInt32.pack(self.TargetNodeClass.value))
4669
        return b''.join(packet)
4670
4671 1
    @staticmethod
4672
    def from_binary(data):
4673
        return AddReferencesItem(data)
4674
4675 1
    def _binary_init(self, data):
4676
        self.SourceNodeId = NodeId.from_binary(data)
4677
        self.ReferenceTypeId = NodeId.from_binary(data)
4678
        self.IsForward = uatype_Boolean.unpack(data.read(1))[0]
4679
        self.TargetServerUri = unpack_string(data)
4680
        self.TargetNodeId = ExpandedNodeId.from_binary(data)
4681
        self.TargetNodeClass = NodeClass(uatype_UInt32.unpack(data.read(4))[0])
4682
4683 1
    def __str__(self):
4684
        return 'AddReferencesItem(' + 'SourceNodeId:' + str(self.SourceNodeId) + ', ' + \
4685
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
4686
               'IsForward:' + str(self.IsForward) + ', ' + \
4687
               'TargetServerUri:' + str(self.TargetServerUri) + ', ' + \
4688
               'TargetNodeId:' + str(self.TargetNodeId) + ', ' + \
4689
               'TargetNodeClass:' + str(self.TargetNodeClass) + ')'
4690
4691 1
    __repr__ = __str__
4692
4693
4694 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...
4695
    '''
4696
    Adds one or more references to the server address space.
4697
4698
    :ivar TypeId:
4699
    :vartype TypeId: NodeId
4700
    :ivar RequestHeader:
4701
    :vartype RequestHeader: RequestHeader
4702
    :ivar ReferencesToAdd:
4703
    :vartype ReferencesToAdd: AddReferencesItem
4704
    '''
4705 1
    def __init__(self, binary=None):
4706
        if binary is not None:
4707
            self._binary_init(binary)
4708
            self._freeze = True
4709
            return
4710
        self.TypeId = FourByteNodeId(ObjectIds.AddReferencesRequest_Encoding_DefaultBinary)
4711
        self.RequestHeader = RequestHeader()
4712
        self.ReferencesToAdd = []
4713
        self._freeze = True
4714
4715 1
    def to_binary(self):
4716
        packet = []
4717
        packet.append(self.TypeId.to_binary())
4718
        packet.append(self.RequestHeader.to_binary())
4719
        packet.append(uatype_Int32.pack(len(self.ReferencesToAdd)))
4720
        for fieldname in self.ReferencesToAdd:
4721
            packet.append(fieldname.to_binary())
4722
        return b''.join(packet)
4723
4724 1
    @staticmethod
4725
    def from_binary(data):
4726
        return AddReferencesRequest(data)
4727
4728 1
    def _binary_init(self, data):
4729
        self.TypeId = NodeId.from_binary(data)
4730
        self.RequestHeader = RequestHeader.from_binary(data)
4731
        length = uatype_Int32.unpack(data.read(4))[0]
4732
        array = []
4733
        if length != -1:
4734
            for _ in range(0, length):
4735
                array.append(AddReferencesItem.from_binary(data))
4736
        self.ReferencesToAdd = array
4737
4738 1
    def __str__(self):
4739
        return 'AddReferencesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
4740
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
4741
               'ReferencesToAdd:' + str(self.ReferencesToAdd) + ')'
4742
4743 1
    __repr__ = __str__
4744
4745
4746 1 View Code Duplication
class AddReferencesResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4747
    '''
4748
    Adds one or more references to the server address space.
4749
4750
    :ivar TypeId:
4751
    :vartype TypeId: NodeId
4752
    :ivar ResponseHeader:
4753
    :vartype ResponseHeader: ResponseHeader
4754
    :ivar Results:
4755
    :vartype Results: StatusCode
4756
    :ivar DiagnosticInfos:
4757
    :vartype DiagnosticInfos: DiagnosticInfo
4758
    '''
4759 1
    def __init__(self, binary=None):
4760
        if binary is not None:
4761
            self._binary_init(binary)
4762
            self._freeze = True
4763
            return
4764
        self.TypeId = FourByteNodeId(ObjectIds.AddReferencesResponse_Encoding_DefaultBinary)
4765
        self.ResponseHeader = ResponseHeader()
4766
        self.Results = []
4767
        self.DiagnosticInfos = []
4768
        self._freeze = True
4769
4770 1
    def to_binary(self):
4771
        packet = []
4772
        packet.append(self.TypeId.to_binary())
4773
        packet.append(self.ResponseHeader.to_binary())
4774
        packet.append(uatype_Int32.pack(len(self.Results)))
4775
        for fieldname in self.Results:
4776
            packet.append(fieldname.to_binary())
4777
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
4778
        for fieldname in self.DiagnosticInfos:
4779
            packet.append(fieldname.to_binary())
4780
        return b''.join(packet)
4781
4782 1
    @staticmethod
4783
    def from_binary(data):
4784
        return AddReferencesResponse(data)
4785
4786 1
    def _binary_init(self, data):
4787
        self.TypeId = NodeId.from_binary(data)
4788
        self.ResponseHeader = ResponseHeader.from_binary(data)
4789
        length = uatype_Int32.unpack(data.read(4))[0]
4790
        array = []
4791
        if length != -1:
4792
            for _ in range(0, length):
4793
                array.append(StatusCode.from_binary(data))
4794
        self.Results = array
4795
        length = uatype_Int32.unpack(data.read(4))[0]
4796
        array = []
4797
        if length != -1:
4798
            for _ in range(0, length):
4799
                array.append(DiagnosticInfo.from_binary(data))
4800
        self.DiagnosticInfos = array
4801
4802 1
    def __str__(self):
4803
        return 'AddReferencesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
4804
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
4805
               'Results:' + str(self.Results) + ', ' + \
4806
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
4807
4808 1
    __repr__ = __str__
4809
4810
4811 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...
4812
    '''
4813
    A request to delete a node to the server address space.
4814
4815
    :ivar NodeId:
4816
    :vartype NodeId: NodeId
4817
    :ivar DeleteTargetReferences:
4818
    :vartype DeleteTargetReferences: Boolean
4819
    '''
4820 1
    def __init__(self, binary=None):
4821 1
        if binary is not None:
4822 1
            self._binary_init(binary)
4823 1
            self._freeze = True
4824 1
            return
4825 1
        self.NodeId = NodeId()
4826 1
        self.DeleteTargetReferences = True
4827 1
        self._freeze = True
4828
4829 1
    def to_binary(self):
4830 1
        packet = []
4831 1
        packet.append(self.NodeId.to_binary())
4832 1
        packet.append(uatype_Boolean.pack(self.DeleteTargetReferences))
4833 1
        return b''.join(packet)
4834
4835 1
    @staticmethod
4836
    def from_binary(data):
4837 1
        return DeleteNodesItem(data)
4838
4839 1
    def _binary_init(self, data):
4840 1
        self.NodeId = NodeId.from_binary(data)
4841 1
        self.DeleteTargetReferences = uatype_Boolean.unpack(data.read(1))[0]
4842
4843 1
    def __str__(self):
4844
        return 'DeleteNodesItem(' + 'NodeId:' + str(self.NodeId) + ', ' + \
4845
               'DeleteTargetReferences:' + str(self.DeleteTargetReferences) + ')'
4846
4847 1
    __repr__ = __str__
4848
4849
4850 1 View Code Duplication
class DeleteNodesParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4851
    '''
4852
    :ivar NodesToDelete:
4853
    :vartype NodesToDelete: DeleteNodesItem
4854
    '''
4855 1
    def __init__(self, binary=None):
4856 1
        if binary is not None:
4857 1
            self._binary_init(binary)
4858 1
            self._freeze = True
4859 1
            return
4860 1
        self.NodesToDelete = []
4861 1
        self._freeze = True
4862
4863 1
    def to_binary(self):
4864 1
        packet = []
4865 1
        packet.append(uatype_Int32.pack(len(self.NodesToDelete)))
4866 1
        for fieldname in self.NodesToDelete:
4867 1
            packet.append(fieldname.to_binary())
4868 1
        return b''.join(packet)
4869
4870 1
    @staticmethod
4871
    def from_binary(data):
4872 1
        return DeleteNodesParameters(data)
4873
4874 1
    def _binary_init(self, data):
4875 1
        length = uatype_Int32.unpack(data.read(4))[0]
4876 1
        array = []
4877 1
        if length != -1:
4878 1
            for _ in range(0, length):
4879 1
                array.append(DeleteNodesItem.from_binary(data))
4880 1
        self.NodesToDelete = array
4881
4882 1
    def __str__(self):
4883
        return 'DeleteNodesParameters(' + 'NodesToDelete:' + str(self.NodesToDelete) + ')'
4884
4885 1
    __repr__ = __str__
4886
4887
4888 1 View Code Duplication
class DeleteNodesRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4889
    '''
4890
    Delete one or more nodes from the server address space.
4891
4892
    :ivar TypeId:
4893
    :vartype TypeId: NodeId
4894
    :ivar RequestHeader:
4895
    :vartype RequestHeader: RequestHeader
4896
    :ivar Parameters:
4897
    :vartype Parameters: DeleteNodesParameters
4898
    '''
4899 1
    def __init__(self, binary=None):
4900 1
        if binary is not None:
4901
            self._binary_init(binary)
4902
            self._freeze = True
4903
            return
4904 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteNodesRequest_Encoding_DefaultBinary)
4905 1
        self.RequestHeader = RequestHeader()
4906 1
        self.Parameters = DeleteNodesParameters()
4907 1
        self._freeze = True
4908
4909 1
    def to_binary(self):
4910 1
        packet = []
4911 1
        packet.append(self.TypeId.to_binary())
4912 1
        packet.append(self.RequestHeader.to_binary())
4913 1
        packet.append(self.Parameters.to_binary())
4914 1
        return b''.join(packet)
4915
4916 1
    @staticmethod
4917
    def from_binary(data):
4918
        return DeleteNodesRequest(data)
4919
4920 1
    def _binary_init(self, data):
4921
        self.TypeId = NodeId.from_binary(data)
4922
        self.RequestHeader = RequestHeader.from_binary(data)
4923
        self.Parameters = DeleteNodesParameters.from_binary(data)
4924
4925 1
    def __str__(self):
4926
        return 'DeleteNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
4927
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
4928
               'Parameters:' + str(self.Parameters) + ')'
4929
4930 1
    __repr__ = __str__
4931
4932
4933 1 View Code Duplication
class DeleteNodesResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4934
    '''
4935
    Delete one or more nodes from the server address space.
4936
4937
    :ivar TypeId:
4938
    :vartype TypeId: NodeId
4939
    :ivar ResponseHeader:
4940
    :vartype ResponseHeader: ResponseHeader
4941
    :ivar Results:
4942
    :vartype Results: StatusCode
4943
    :ivar DiagnosticInfos:
4944
    :vartype DiagnosticInfos: DiagnosticInfo
4945
    '''
4946 1
    def __init__(self, binary=None):
4947 1
        if binary is not None:
4948 1
            self._binary_init(binary)
4949 1
            self._freeze = True
4950 1
            return
4951 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteNodesResponse_Encoding_DefaultBinary)
4952 1
        self.ResponseHeader = ResponseHeader()
4953 1
        self.Results = []
4954 1
        self.DiagnosticInfos = []
4955 1
        self._freeze = True
4956
4957 1
    def to_binary(self):
4958 1
        packet = []
4959 1
        packet.append(self.TypeId.to_binary())
4960 1
        packet.append(self.ResponseHeader.to_binary())
4961 1
        packet.append(uatype_Int32.pack(len(self.Results)))
4962 1
        for fieldname in self.Results:
4963 1
            packet.append(fieldname.to_binary())
4964 1
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
4965 1
        for fieldname in self.DiagnosticInfos:
4966
            packet.append(fieldname.to_binary())
4967 1
        return b''.join(packet)
4968
4969 1
    @staticmethod
4970
    def from_binary(data):
4971 1
        return DeleteNodesResponse(data)
4972
4973 1
    def _binary_init(self, data):
4974 1
        self.TypeId = NodeId.from_binary(data)
4975 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
4976 1
        length = uatype_Int32.unpack(data.read(4))[0]
4977 1
        array = []
4978 1
        if length != -1:
4979 1
            for _ in range(0, length):
4980 1
                array.append(StatusCode.from_binary(data))
4981 1
        self.Results = array
4982 1
        length = uatype_Int32.unpack(data.read(4))[0]
4983 1
        array = []
4984 1
        if length != -1:
4985 1
            for _ in range(0, length):
4986
                array.append(DiagnosticInfo.from_binary(data))
4987 1
        self.DiagnosticInfos = array
4988
4989 1
    def __str__(self):
4990
        return 'DeleteNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
4991
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
4992
               'Results:' + str(self.Results) + ', ' + \
4993
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
4994
4995 1
    __repr__ = __str__
4996
4997
4998 1
class DeleteReferencesItem(FrozenClass):
4999
    '''
5000
    A request to delete a node from the server address space.
5001
5002
    :ivar SourceNodeId:
5003
    :vartype SourceNodeId: NodeId
5004
    :ivar ReferenceTypeId:
5005
    :vartype ReferenceTypeId: NodeId
5006
    :ivar IsForward:
5007
    :vartype IsForward: Boolean
5008
    :ivar TargetNodeId:
5009
    :vartype TargetNodeId: ExpandedNodeId
5010
    :ivar DeleteBidirectional:
5011
    :vartype DeleteBidirectional: Boolean
5012
    '''
5013 1
    def __init__(self, binary=None):
5014
        if binary is not None:
5015
            self._binary_init(binary)
5016
            self._freeze = True
5017
            return
5018
        self.SourceNodeId = NodeId()
5019
        self.ReferenceTypeId = NodeId()
5020
        self.IsForward = True
5021
        self.TargetNodeId = ExpandedNodeId()
5022
        self.DeleteBidirectional = True
5023
        self._freeze = True
5024
5025 1
    def to_binary(self):
5026
        packet = []
5027
        packet.append(self.SourceNodeId.to_binary())
5028
        packet.append(self.ReferenceTypeId.to_binary())
5029
        packet.append(uatype_Boolean.pack(self.IsForward))
5030
        packet.append(self.TargetNodeId.to_binary())
5031
        packet.append(uatype_Boolean.pack(self.DeleteBidirectional))
5032
        return b''.join(packet)
5033
5034 1
    @staticmethod
5035
    def from_binary(data):
5036
        return DeleteReferencesItem(data)
5037
5038 1
    def _binary_init(self, data):
5039
        self.SourceNodeId = NodeId.from_binary(data)
5040
        self.ReferenceTypeId = NodeId.from_binary(data)
5041
        self.IsForward = uatype_Boolean.unpack(data.read(1))[0]
5042
        self.TargetNodeId = ExpandedNodeId.from_binary(data)
5043
        self.DeleteBidirectional = uatype_Boolean.unpack(data.read(1))[0]
5044
5045 1
    def __str__(self):
5046
        return 'DeleteReferencesItem(' + 'SourceNodeId:' + str(self.SourceNodeId) + ', ' + \
5047
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
5048
               'IsForward:' + str(self.IsForward) + ', ' + \
5049
               'TargetNodeId:' + str(self.TargetNodeId) + ', ' + \
5050
               'DeleteBidirectional:' + str(self.DeleteBidirectional) + ')'
5051
5052 1
    __repr__ = __str__
5053
5054
5055 1 View Code Duplication
class DeleteReferencesParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5056
    '''
5057
    :ivar ReferencesToDelete:
5058
    :vartype ReferencesToDelete: DeleteReferencesItem
5059
    '''
5060 1
    def __init__(self, binary=None):
5061
        if binary is not None:
5062
            self._binary_init(binary)
5063
            self._freeze = True
5064
            return
5065
        self.ReferencesToDelete = []
5066
        self._freeze = True
5067
5068 1
    def to_binary(self):
5069
        packet = []
5070
        packet.append(uatype_Int32.pack(len(self.ReferencesToDelete)))
5071
        for fieldname in self.ReferencesToDelete:
5072
            packet.append(fieldname.to_binary())
5073
        return b''.join(packet)
5074
5075 1
    @staticmethod
5076
    def from_binary(data):
5077
        return DeleteReferencesParameters(data)
5078
5079 1
    def _binary_init(self, data):
5080
        length = uatype_Int32.unpack(data.read(4))[0]
5081
        array = []
5082
        if length != -1:
5083
            for _ in range(0, length):
5084
                array.append(DeleteReferencesItem.from_binary(data))
5085
        self.ReferencesToDelete = array
5086
5087 1
    def __str__(self):
5088
        return 'DeleteReferencesParameters(' + 'ReferencesToDelete:' + str(self.ReferencesToDelete) + ')'
5089
5090 1
    __repr__ = __str__
5091
5092
5093 1 View Code Duplication
class DeleteReferencesRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5094
    '''
5095
    Delete one or more references from the server address space.
5096
5097
    :ivar TypeId:
5098
    :vartype TypeId: NodeId
5099
    :ivar RequestHeader:
5100
    :vartype RequestHeader: RequestHeader
5101
    :ivar Parameters:
5102
    :vartype Parameters: DeleteReferencesParameters
5103
    '''
5104 1
    def __init__(self, binary=None):
5105
        if binary is not None:
5106
            self._binary_init(binary)
5107
            self._freeze = True
5108
            return
5109
        self.TypeId = FourByteNodeId(ObjectIds.DeleteReferencesRequest_Encoding_DefaultBinary)
5110
        self.RequestHeader = RequestHeader()
5111
        self.Parameters = DeleteReferencesParameters()
5112
        self._freeze = True
5113
5114 1
    def to_binary(self):
5115
        packet = []
5116
        packet.append(self.TypeId.to_binary())
5117
        packet.append(self.RequestHeader.to_binary())
5118
        packet.append(self.Parameters.to_binary())
5119
        return b''.join(packet)
5120
5121 1
    @staticmethod
5122
    def from_binary(data):
5123
        return DeleteReferencesRequest(data)
5124
5125 1
    def _binary_init(self, data):
5126
        self.TypeId = NodeId.from_binary(data)
5127
        self.RequestHeader = RequestHeader.from_binary(data)
5128
        self.Parameters = DeleteReferencesParameters.from_binary(data)
5129
5130 1
    def __str__(self):
5131
        return 'DeleteReferencesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5132
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5133
               'Parameters:' + str(self.Parameters) + ')'
5134
5135 1
    __repr__ = __str__
5136
5137
5138 1 View Code Duplication
class DeleteReferencesResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5139
    '''
5140
    :ivar Results:
5141
    :vartype Results: StatusCode
5142
    :ivar DiagnosticInfos:
5143
    :vartype DiagnosticInfos: DiagnosticInfo
5144
    '''
5145 1
    def __init__(self, binary=None):
5146
        if binary is not None:
5147
            self._binary_init(binary)
5148
            self._freeze = True
5149
            return
5150
        self.Results = []
5151
        self.DiagnosticInfos = []
5152
        self._freeze = True
5153
5154 1
    def to_binary(self):
5155
        packet = []
5156
        packet.append(uatype_Int32.pack(len(self.Results)))
5157
        for fieldname in self.Results:
5158
            packet.append(fieldname.to_binary())
5159
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
5160
        for fieldname in self.DiagnosticInfos:
5161
            packet.append(fieldname.to_binary())
5162
        return b''.join(packet)
5163
5164 1
    @staticmethod
5165
    def from_binary(data):
5166
        return DeleteReferencesResult(data)
5167
5168 1
    def _binary_init(self, data):
5169
        length = uatype_Int32.unpack(data.read(4))[0]
5170
        array = []
5171
        if length != -1:
5172
            for _ in range(0, length):
5173
                array.append(StatusCode.from_binary(data))
5174
        self.Results = array
5175
        length = uatype_Int32.unpack(data.read(4))[0]
5176
        array = []
5177
        if length != -1:
5178
            for _ in range(0, length):
5179
                array.append(DiagnosticInfo.from_binary(data))
5180
        self.DiagnosticInfos = array
5181
5182 1
    def __str__(self):
5183
        return 'DeleteReferencesResult(' + 'Results:' + str(self.Results) + ', ' + \
5184
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5185
5186 1
    __repr__ = __str__
5187
5188
5189 1 View Code Duplication
class DeleteReferencesResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5190
    '''
5191
    Delete one or more references from the server address space.
5192
5193
    :ivar TypeId:
5194
    :vartype TypeId: NodeId
5195
    :ivar ResponseHeader:
5196
    :vartype ResponseHeader: ResponseHeader
5197
    :ivar Parameters:
5198
    :vartype Parameters: DeleteReferencesResult
5199
    '''
5200 1
    def __init__(self, binary=None):
5201
        if binary is not None:
5202
            self._binary_init(binary)
5203
            self._freeze = True
5204
            return
5205
        self.TypeId = FourByteNodeId(ObjectIds.DeleteReferencesResponse_Encoding_DefaultBinary)
5206
        self.ResponseHeader = ResponseHeader()
5207
        self.Parameters = DeleteReferencesResult()
5208
        self._freeze = True
5209
5210 1
    def to_binary(self):
5211
        packet = []
5212
        packet.append(self.TypeId.to_binary())
5213
        packet.append(self.ResponseHeader.to_binary())
5214
        packet.append(self.Parameters.to_binary())
5215
        return b''.join(packet)
5216
5217 1
    @staticmethod
5218
    def from_binary(data):
5219
        return DeleteReferencesResponse(data)
5220
5221 1
    def _binary_init(self, data):
5222
        self.TypeId = NodeId.from_binary(data)
5223
        self.ResponseHeader = ResponseHeader.from_binary(data)
5224
        self.Parameters = DeleteReferencesResult.from_binary(data)
5225
5226 1
    def __str__(self):
5227
        return 'DeleteReferencesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5228
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5229
               'Parameters:' + str(self.Parameters) + ')'
5230
5231 1
    __repr__ = __str__
5232
5233
5234 1
class ViewDescription(FrozenClass):
5235
    '''
5236
    The view to browse.
5237
5238
    :ivar ViewId:
5239
    :vartype ViewId: NodeId
5240
    :ivar Timestamp:
5241
    :vartype Timestamp: DateTime
5242
    :ivar ViewVersion:
5243
    :vartype ViewVersion: UInt32
5244
    '''
5245 1
    def __init__(self, binary=None):
5246 1
        if binary is not None:
5247 1
            self._binary_init(binary)
5248 1
            self._freeze = True
5249 1
            return
5250 1
        self.ViewId = NodeId()
5251 1
        self.Timestamp = datetime.now()
5252 1
        self.ViewVersion = 0
5253 1
        self._freeze = True
5254
5255 1
    def to_binary(self):
5256 1
        packet = []
5257 1
        packet.append(self.ViewId.to_binary())
5258 1
        packet.append(pack_datetime(self.Timestamp))
5259 1
        packet.append(uatype_UInt32.pack(self.ViewVersion))
5260 1
        return b''.join(packet)
5261
5262 1
    @staticmethod
5263
    def from_binary(data):
5264 1
        return ViewDescription(data)
5265
5266 1
    def _binary_init(self, data):
5267 1
        self.ViewId = NodeId.from_binary(data)
5268 1
        self.Timestamp = unpack_datetime(data)
5269 1
        self.ViewVersion = uatype_UInt32.unpack(data.read(4))[0]
5270
5271 1
    def __str__(self):
5272
        return 'ViewDescription(' + 'ViewId:' + str(self.ViewId) + ', ' + \
5273
               'Timestamp:' + str(self.Timestamp) + ', ' + \
5274
               'ViewVersion:' + str(self.ViewVersion) + ')'
5275
5276 1
    __repr__ = __str__
5277
5278
5279 1
class BrowseDescription(FrozenClass):
5280
    '''
5281
    A request to browse the the references from a node.
5282
5283
    :ivar NodeId:
5284
    :vartype NodeId: NodeId
5285
    :ivar BrowseDirection:
5286
    :vartype BrowseDirection: BrowseDirection
5287
    :ivar ReferenceTypeId:
5288
    :vartype ReferenceTypeId: NodeId
5289
    :ivar IncludeSubtypes:
5290
    :vartype IncludeSubtypes: Boolean
5291
    :ivar NodeClassMask:
5292
    :vartype NodeClassMask: UInt32
5293
    :ivar ResultMask:
5294
    :vartype ResultMask: UInt32
5295
    '''
5296 1
    def __init__(self, binary=None):
5297 1
        if binary is not None:
5298 1
            self._binary_init(binary)
5299 1
            self._freeze = True
5300 1
            return
5301 1
        self.NodeId = NodeId()
5302 1
        self.BrowseDirection = BrowseDirection(0)
5303 1
        self.ReferenceTypeId = NodeId()
5304 1
        self.IncludeSubtypes = True
5305 1
        self.NodeClassMask = 0
5306 1
        self.ResultMask = 0
5307 1
        self._freeze = True
5308
5309 1
    def to_binary(self):
5310 1
        packet = []
5311 1
        packet.append(self.NodeId.to_binary())
5312 1
        packet.append(uatype_UInt32.pack(self.BrowseDirection.value))
5313 1
        packet.append(self.ReferenceTypeId.to_binary())
5314 1
        packet.append(uatype_Boolean.pack(self.IncludeSubtypes))
5315 1
        packet.append(uatype_UInt32.pack(self.NodeClassMask))
5316 1
        packet.append(uatype_UInt32.pack(self.ResultMask))
5317 1
        return b''.join(packet)
5318
5319 1
    @staticmethod
5320
    def from_binary(data):
5321 1
        return BrowseDescription(data)
5322
5323 1
    def _binary_init(self, data):
5324 1
        self.NodeId = NodeId.from_binary(data)
5325 1
        self.BrowseDirection = BrowseDirection(uatype_UInt32.unpack(data.read(4))[0])
5326 1
        self.ReferenceTypeId = NodeId.from_binary(data)
5327 1
        self.IncludeSubtypes = uatype_Boolean.unpack(data.read(1))[0]
5328 1
        self.NodeClassMask = uatype_UInt32.unpack(data.read(4))[0]
5329 1
        self.ResultMask = uatype_UInt32.unpack(data.read(4))[0]
5330
5331 1
    def __str__(self):
5332
        return 'BrowseDescription(' + 'NodeId:' + str(self.NodeId) + ', ' + \
5333
               'BrowseDirection:' + str(self.BrowseDirection) + ', ' + \
5334
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
5335
               'IncludeSubtypes:' + str(self.IncludeSubtypes) + ', ' + \
5336
               'NodeClassMask:' + str(self.NodeClassMask) + ', ' + \
5337
               'ResultMask:' + str(self.ResultMask) + ')'
5338
5339 1
    __repr__ = __str__
5340
5341
5342 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...
5343
    '''
5344
    The description of a reference.
5345
5346
    :ivar ReferenceTypeId:
5347
    :vartype ReferenceTypeId: NodeId
5348
    :ivar IsForward:
5349
    :vartype IsForward: Boolean
5350
    :ivar NodeId:
5351
    :vartype NodeId: ExpandedNodeId
5352
    :ivar BrowseName:
5353
    :vartype BrowseName: QualifiedName
5354
    :ivar DisplayName:
5355
    :vartype DisplayName: LocalizedText
5356
    :ivar NodeClass:
5357
    :vartype NodeClass: NodeClass
5358
    :ivar TypeDefinition:
5359
    :vartype TypeDefinition: ExpandedNodeId
5360
    '''
5361 1
    def __init__(self, binary=None):
5362 1
        if binary is not None:
5363 1
            self._binary_init(binary)
5364 1
            self._freeze = True
5365 1
            return
5366 1
        self.ReferenceTypeId = NodeId()
5367 1
        self.IsForward = True
5368 1
        self.NodeId = ExpandedNodeId()
5369 1
        self.BrowseName = QualifiedName()
5370 1
        self.DisplayName = LocalizedText()
5371 1
        self.NodeClass = NodeClass(0)
5372 1
        self.TypeDefinition = ExpandedNodeId()
5373 1
        self._freeze = True
5374
5375 1
    def to_binary(self):
5376 1
        packet = []
5377 1
        packet.append(self.ReferenceTypeId.to_binary())
5378 1
        packet.append(uatype_Boolean.pack(self.IsForward))
5379 1
        packet.append(self.NodeId.to_binary())
5380 1
        packet.append(self.BrowseName.to_binary())
5381 1
        packet.append(self.DisplayName.to_binary())
5382 1
        packet.append(uatype_UInt32.pack(self.NodeClass.value))
5383 1
        packet.append(self.TypeDefinition.to_binary())
5384 1
        return b''.join(packet)
5385
5386 1
    @staticmethod
5387
    def from_binary(data):
5388 1
        return ReferenceDescription(data)
5389
5390 1
    def _binary_init(self, data):
5391 1
        self.ReferenceTypeId = NodeId.from_binary(data)
5392 1
        self.IsForward = uatype_Boolean.unpack(data.read(1))[0]
5393 1
        self.NodeId = ExpandedNodeId.from_binary(data)
5394 1
        self.BrowseName = QualifiedName.from_binary(data)
5395 1
        self.DisplayName = LocalizedText.from_binary(data)
5396 1
        self.NodeClass = NodeClass(uatype_UInt32.unpack(data.read(4))[0])
5397 1
        self.TypeDefinition = ExpandedNodeId.from_binary(data)
5398
5399 1
    def __str__(self):
5400
        return 'ReferenceDescription(' + 'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
5401
               'IsForward:' + str(self.IsForward) + ', ' + \
5402
               'NodeId:' + str(self.NodeId) + ', ' + \
5403
               'BrowseName:' + str(self.BrowseName) + ', ' + \
5404
               'DisplayName:' + str(self.DisplayName) + ', ' + \
5405
               'NodeClass:' + str(self.NodeClass) + ', ' + \
5406
               'TypeDefinition:' + str(self.TypeDefinition) + ')'
5407
5408 1
    __repr__ = __str__
5409
5410
5411 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...
5412
    '''
5413
    The result of a browse operation.
5414
5415
    :ivar StatusCode:
5416
    :vartype StatusCode: StatusCode
5417
    :ivar ContinuationPoint:
5418
    :vartype ContinuationPoint: ByteString
5419
    :ivar References:
5420
    :vartype References: ReferenceDescription
5421
    '''
5422 1
    def __init__(self, binary=None):
5423 1
        if binary is not None:
5424 1
            self._binary_init(binary)
5425 1
            self._freeze = True
5426 1
            return
5427 1
        self.StatusCode = StatusCode()
5428 1
        self.ContinuationPoint = b''
5429 1
        self.References = []
5430 1
        self._freeze = True
5431
5432 1
    def to_binary(self):
5433 1
        packet = []
5434 1
        packet.append(self.StatusCode.to_binary())
5435 1
        packet.append(pack_bytes(self.ContinuationPoint))
5436 1
        packet.append(uatype_Int32.pack(len(self.References)))
5437 1
        for fieldname in self.References:
5438 1
            packet.append(fieldname.to_binary())
5439 1
        return b''.join(packet)
5440
5441 1
    @staticmethod
5442
    def from_binary(data):
5443 1
        return BrowseResult(data)
5444
5445 1
    def _binary_init(self, data):
5446 1
        self.StatusCode = StatusCode.from_binary(data)
5447 1
        self.ContinuationPoint = unpack_bytes(data)
5448 1
        length = uatype_Int32.unpack(data.read(4))[0]
5449 1
        array = []
5450 1
        if length != -1:
5451 1
            for _ in range(0, length):
5452 1
                array.append(ReferenceDescription.from_binary(data))
5453 1
        self.References = array
5454
5455 1
    def __str__(self):
5456
        return 'BrowseResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
5457
               'ContinuationPoint:' + str(self.ContinuationPoint) + ', ' + \
5458
               'References:' + str(self.References) + ')'
5459
5460 1
    __repr__ = __str__
5461
5462
5463 1 View Code Duplication
class BrowseParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5464
    '''
5465
    :ivar View:
5466
    :vartype View: ViewDescription
5467
    :ivar RequestedMaxReferencesPerNode:
5468
    :vartype RequestedMaxReferencesPerNode: UInt32
5469
    :ivar NodesToBrowse:
5470
    :vartype NodesToBrowse: BrowseDescription
5471
    '''
5472 1
    def __init__(self, binary=None):
5473 1
        if binary is not None:
5474 1
            self._binary_init(binary)
5475 1
            self._freeze = True
5476 1
            return
5477 1
        self.View = ViewDescription()
5478 1
        self.RequestedMaxReferencesPerNode = 0
5479 1
        self.NodesToBrowse = []
5480 1
        self._freeze = True
5481
5482 1
    def to_binary(self):
5483 1
        packet = []
5484 1
        packet.append(self.View.to_binary())
5485 1
        packet.append(uatype_UInt32.pack(self.RequestedMaxReferencesPerNode))
5486 1
        packet.append(uatype_Int32.pack(len(self.NodesToBrowse)))
5487 1
        for fieldname in self.NodesToBrowse:
5488 1
            packet.append(fieldname.to_binary())
5489 1
        return b''.join(packet)
5490
5491 1
    @staticmethod
5492
    def from_binary(data):
5493 1
        return BrowseParameters(data)
5494
5495 1
    def _binary_init(self, data):
5496 1
        self.View = ViewDescription.from_binary(data)
5497 1
        self.RequestedMaxReferencesPerNode = uatype_UInt32.unpack(data.read(4))[0]
5498 1
        length = uatype_Int32.unpack(data.read(4))[0]
5499 1
        array = []
5500 1
        if length != -1:
5501 1
            for _ in range(0, length):
5502 1
                array.append(BrowseDescription.from_binary(data))
5503 1
        self.NodesToBrowse = array
5504
5505 1
    def __str__(self):
5506
        return 'BrowseParameters(' + 'View:' + str(self.View) + ', ' + \
5507
               'RequestedMaxReferencesPerNode:' + str(self.RequestedMaxReferencesPerNode) + ', ' + \
5508
               'NodesToBrowse:' + str(self.NodesToBrowse) + ')'
5509
5510 1
    __repr__ = __str__
5511
5512
5513 1 View Code Duplication
class BrowseRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5514
    '''
5515
    Browse the references for one or more nodes from the server address space.
5516
5517
    :ivar TypeId:
5518
    :vartype TypeId: NodeId
5519
    :ivar RequestHeader:
5520
    :vartype RequestHeader: RequestHeader
5521
    :ivar Parameters:
5522
    :vartype Parameters: BrowseParameters
5523
    '''
5524 1
    def __init__(self, binary=None):
5525 1
        if binary is not None:
5526
            self._binary_init(binary)
5527
            self._freeze = True
5528
            return
5529 1
        self.TypeId = FourByteNodeId(ObjectIds.BrowseRequest_Encoding_DefaultBinary)
5530 1
        self.RequestHeader = RequestHeader()
5531 1
        self.Parameters = BrowseParameters()
5532 1
        self._freeze = True
5533
5534 1
    def to_binary(self):
5535 1
        packet = []
5536 1
        packet.append(self.TypeId.to_binary())
5537 1
        packet.append(self.RequestHeader.to_binary())
5538 1
        packet.append(self.Parameters.to_binary())
5539 1
        return b''.join(packet)
5540
5541 1
    @staticmethod
5542
    def from_binary(data):
5543
        return BrowseRequest(data)
5544
5545 1
    def _binary_init(self, data):
5546
        self.TypeId = NodeId.from_binary(data)
5547
        self.RequestHeader = RequestHeader.from_binary(data)
5548
        self.Parameters = BrowseParameters.from_binary(data)
5549
5550 1
    def __str__(self):
5551
        return 'BrowseRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5552
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5553
               'Parameters:' + str(self.Parameters) + ')'
5554
5555 1
    __repr__ = __str__
5556
5557
5558 1 View Code Duplication
class BrowseResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5559
    '''
5560
    Browse the references for one or more nodes from the server address space.
5561
5562
    :ivar TypeId:
5563
    :vartype TypeId: NodeId
5564
    :ivar ResponseHeader:
5565
    :vartype ResponseHeader: ResponseHeader
5566
    :ivar Results:
5567
    :vartype Results: BrowseResult
5568
    :ivar DiagnosticInfos:
5569
    :vartype DiagnosticInfos: DiagnosticInfo
5570
    '''
5571 1
    def __init__(self, binary=None):
5572 1
        if binary is not None:
5573 1
            self._binary_init(binary)
5574 1
            self._freeze = True
5575 1
            return
5576 1
        self.TypeId = FourByteNodeId(ObjectIds.BrowseResponse_Encoding_DefaultBinary)
5577 1
        self.ResponseHeader = ResponseHeader()
5578 1
        self.Results = []
5579 1
        self.DiagnosticInfos = []
5580 1
        self._freeze = True
5581
5582 1
    def to_binary(self):
5583 1
        packet = []
5584 1
        packet.append(self.TypeId.to_binary())
5585 1
        packet.append(self.ResponseHeader.to_binary())
5586 1
        packet.append(uatype_Int32.pack(len(self.Results)))
5587 1
        for fieldname in self.Results:
5588 1
            packet.append(fieldname.to_binary())
5589 1
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
5590 1
        for fieldname in self.DiagnosticInfos:
5591
            packet.append(fieldname.to_binary())
5592 1
        return b''.join(packet)
5593
5594 1
    @staticmethod
5595
    def from_binary(data):
5596 1
        return BrowseResponse(data)
5597
5598 1
    def _binary_init(self, data):
5599 1
        self.TypeId = NodeId.from_binary(data)
5600 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
5601 1
        length = uatype_Int32.unpack(data.read(4))[0]
5602 1
        array = []
5603 1
        if length != -1:
5604 1
            for _ in range(0, length):
5605 1
                array.append(BrowseResult.from_binary(data))
5606 1
        self.Results = array
5607 1
        length = uatype_Int32.unpack(data.read(4))[0]
5608 1
        array = []
5609 1
        if length != -1:
5610 1
            for _ in range(0, length):
5611
                array.append(DiagnosticInfo.from_binary(data))
5612 1
        self.DiagnosticInfos = array
5613
5614 1
    def __str__(self):
5615
        return 'BrowseResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5616
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5617
               'Results:' + str(self.Results) + ', ' + \
5618
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5619
5620 1
    __repr__ = __str__
5621
5622
5623 1
class BrowseNextParameters(FrozenClass):
5624
    '''
5625
    :ivar ReleaseContinuationPoints:
5626
    :vartype ReleaseContinuationPoints: Boolean
5627
    :ivar ContinuationPoints:
5628
    :vartype ContinuationPoints: ByteString
5629
    '''
5630 1
    def __init__(self, binary=None):
5631
        if binary is not None:
5632
            self._binary_init(binary)
5633
            self._freeze = True
5634
            return
5635
        self.ReleaseContinuationPoints = True
5636
        self.ContinuationPoints = []
5637
        self._freeze = True
5638
5639 1
    def to_binary(self):
5640
        packet = []
5641
        packet.append(uatype_Boolean.pack(self.ReleaseContinuationPoints))
5642
        packet.append(uatype_Int32.pack(len(self.ContinuationPoints)))
5643
        for fieldname in self.ContinuationPoints:
5644
            packet.append(pack_bytes(fieldname))
5645
        return b''.join(packet)
5646
5647 1
    @staticmethod
5648
    def from_binary(data):
5649
        return BrowseNextParameters(data)
5650
5651 1
    def _binary_init(self, data):
5652
        self.ReleaseContinuationPoints = uatype_Boolean.unpack(data.read(1))[0]
5653
        self.ContinuationPoints = unpack_uatype_array('ByteString', data)
5654
5655 1
    def __str__(self):
5656
        return 'BrowseNextParameters(' + 'ReleaseContinuationPoints:' + str(self.ReleaseContinuationPoints) + ', ' + \
5657
               'ContinuationPoints:' + str(self.ContinuationPoints) + ')'
5658
5659 1
    __repr__ = __str__
5660
5661
5662 1 View Code Duplication
class BrowseNextRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5663
    '''
5664
    Continues one or more browse operations.
5665
5666
    :ivar TypeId:
5667
    :vartype TypeId: NodeId
5668
    :ivar RequestHeader:
5669
    :vartype RequestHeader: RequestHeader
5670
    :ivar Parameters:
5671
    :vartype Parameters: BrowseNextParameters
5672
    '''
5673 1
    def __init__(self, binary=None):
5674
        if binary is not None:
5675
            self._binary_init(binary)
5676
            self._freeze = True
5677
            return
5678
        self.TypeId = FourByteNodeId(ObjectIds.BrowseNextRequest_Encoding_DefaultBinary)
5679
        self.RequestHeader = RequestHeader()
5680
        self.Parameters = BrowseNextParameters()
5681
        self._freeze = True
5682
5683 1
    def to_binary(self):
5684
        packet = []
5685
        packet.append(self.TypeId.to_binary())
5686
        packet.append(self.RequestHeader.to_binary())
5687
        packet.append(self.Parameters.to_binary())
5688
        return b''.join(packet)
5689
5690 1
    @staticmethod
5691
    def from_binary(data):
5692
        return BrowseNextRequest(data)
5693
5694 1
    def _binary_init(self, data):
5695
        self.TypeId = NodeId.from_binary(data)
5696
        self.RequestHeader = RequestHeader.from_binary(data)
5697
        self.Parameters = BrowseNextParameters.from_binary(data)
5698
5699 1
    def __str__(self):
5700
        return 'BrowseNextRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5701
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5702
               'Parameters:' + str(self.Parameters) + ')'
5703
5704 1
    __repr__ = __str__
5705
5706
5707 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...
5708
    '''
5709
    :ivar Results:
5710
    :vartype Results: BrowseResult
5711
    :ivar DiagnosticInfos:
5712
    :vartype DiagnosticInfos: DiagnosticInfo
5713
    '''
5714 1
    def __init__(self, binary=None):
5715
        if binary is not None:
5716
            self._binary_init(binary)
5717
            self._freeze = True
5718
            return
5719
        self.Results = []
5720
        self.DiagnosticInfos = []
5721
        self._freeze = True
5722
5723 1
    def to_binary(self):
5724
        packet = []
5725
        packet.append(uatype_Int32.pack(len(self.Results)))
5726
        for fieldname in self.Results:
5727
            packet.append(fieldname.to_binary())
5728
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
5729
        for fieldname in self.DiagnosticInfos:
5730
            packet.append(fieldname.to_binary())
5731
        return b''.join(packet)
5732
5733 1
    @staticmethod
5734
    def from_binary(data):
5735
        return BrowseNextResult(data)
5736
5737 1
    def _binary_init(self, data):
5738
        length = uatype_Int32.unpack(data.read(4))[0]
5739
        array = []
5740
        if length != -1:
5741
            for _ in range(0, length):
5742
                array.append(BrowseResult.from_binary(data))
5743
        self.Results = array
5744
        length = uatype_Int32.unpack(data.read(4))[0]
5745
        array = []
5746
        if length != -1:
5747
            for _ in range(0, length):
5748
                array.append(DiagnosticInfo.from_binary(data))
5749
        self.DiagnosticInfos = array
5750
5751 1
    def __str__(self):
5752
        return 'BrowseNextResult(' + 'Results:' + str(self.Results) + ', ' + \
5753
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5754
5755 1
    __repr__ = __str__
5756
5757
5758 1 View Code Duplication
class BrowseNextResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5759
    '''
5760
    Continues one or more browse operations.
5761
5762
    :ivar TypeId:
5763
    :vartype TypeId: NodeId
5764
    :ivar ResponseHeader:
5765
    :vartype ResponseHeader: ResponseHeader
5766
    :ivar Parameters:
5767
    :vartype Parameters: BrowseNextResult
5768
    '''
5769 1
    def __init__(self, binary=None):
5770
        if binary is not None:
5771
            self._binary_init(binary)
5772
            self._freeze = True
5773
            return
5774
        self.TypeId = FourByteNodeId(ObjectIds.BrowseNextResponse_Encoding_DefaultBinary)
5775
        self.ResponseHeader = ResponseHeader()
5776
        self.Parameters = BrowseNextResult()
5777
        self._freeze = True
5778
5779 1
    def to_binary(self):
5780
        packet = []
5781
        packet.append(self.TypeId.to_binary())
5782
        packet.append(self.ResponseHeader.to_binary())
5783
        packet.append(self.Parameters.to_binary())
5784
        return b''.join(packet)
5785
5786 1
    @staticmethod
5787
    def from_binary(data):
5788
        return BrowseNextResponse(data)
5789
5790 1
    def _binary_init(self, data):
5791
        self.TypeId = NodeId.from_binary(data)
5792
        self.ResponseHeader = ResponseHeader.from_binary(data)
5793
        self.Parameters = BrowseNextResult.from_binary(data)
5794
5795 1
    def __str__(self):
5796
        return 'BrowseNextResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5797
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5798
               'Parameters:' + str(self.Parameters) + ')'
5799
5800 1
    __repr__ = __str__
5801
5802
5803 1 View Code Duplication
class RelativePathElement(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5804
    '''
5805
    An element in a relative path.
5806
5807
    :ivar ReferenceTypeId:
5808
    :vartype ReferenceTypeId: NodeId
5809
    :ivar IsInverse:
5810
    :vartype IsInverse: Boolean
5811
    :ivar IncludeSubtypes:
5812
    :vartype IncludeSubtypes: Boolean
5813
    :ivar TargetName:
5814
    :vartype TargetName: QualifiedName
5815
    '''
5816 1
    def __init__(self, binary=None):
5817 1
        if binary is not None:
5818 1
            self._binary_init(binary)
5819 1
            self._freeze = True
5820 1
            return
5821 1
        self.ReferenceTypeId = NodeId()
5822 1
        self.IsInverse = True
5823 1
        self.IncludeSubtypes = True
5824 1
        self.TargetName = QualifiedName()
5825 1
        self._freeze = True
5826
5827 1
    def to_binary(self):
5828 1
        packet = []
5829 1
        packet.append(self.ReferenceTypeId.to_binary())
5830 1
        packet.append(uatype_Boolean.pack(self.IsInverse))
5831 1
        packet.append(uatype_Boolean.pack(self.IncludeSubtypes))
5832 1
        packet.append(self.TargetName.to_binary())
5833 1
        return b''.join(packet)
5834
5835 1
    @staticmethod
5836
    def from_binary(data):
5837 1
        return RelativePathElement(data)
5838
5839 1
    def _binary_init(self, data):
5840 1
        self.ReferenceTypeId = NodeId.from_binary(data)
5841 1
        self.IsInverse = uatype_Boolean.unpack(data.read(1))[0]
5842 1
        self.IncludeSubtypes = uatype_Boolean.unpack(data.read(1))[0]
5843 1
        self.TargetName = QualifiedName.from_binary(data)
5844
5845 1
    def __str__(self):
5846
        return 'RelativePathElement(' + 'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
5847
               'IsInverse:' + str(self.IsInverse) + ', ' + \
5848
               'IncludeSubtypes:' + str(self.IncludeSubtypes) + ', ' + \
5849
               'TargetName:' + str(self.TargetName) + ')'
5850
5851 1
    __repr__ = __str__
5852
5853
5854 1 View Code Duplication
class RelativePath(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5855
    '''
5856
    A relative path constructed from reference types and browse names.
5857
5858
    :ivar Elements:
5859
    :vartype Elements: RelativePathElement
5860
    '''
5861 1
    def __init__(self, binary=None):
5862 1
        if binary is not None:
5863 1
            self._binary_init(binary)
5864 1
            self._freeze = True
5865 1
            return
5866 1
        self.Elements = []
5867 1
        self._freeze = True
5868
5869 1
    def to_binary(self):
5870 1
        packet = []
5871 1
        packet.append(uatype_Int32.pack(len(self.Elements)))
5872 1
        for fieldname in self.Elements:
5873 1
            packet.append(fieldname.to_binary())
5874 1
        return b''.join(packet)
5875
5876 1
    @staticmethod
5877
    def from_binary(data):
5878 1
        return RelativePath(data)
5879
5880 1
    def _binary_init(self, data):
5881 1
        length = uatype_Int32.unpack(data.read(4))[0]
5882 1
        array = []
5883 1
        if length != -1:
5884 1
            for _ in range(0, length):
5885 1
                array.append(RelativePathElement.from_binary(data))
5886 1
        self.Elements = array
5887
5888 1
    def __str__(self):
5889
        return 'RelativePath(' + 'Elements:' + str(self.Elements) + ')'
5890
5891 1
    __repr__ = __str__
5892
5893
5894 1 View Code Duplication
class BrowsePath(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5895
    '''
5896
    A request to translate a path into a node id.
5897
5898
    :ivar StartingNode:
5899
    :vartype StartingNode: NodeId
5900
    :ivar RelativePath:
5901
    :vartype RelativePath: RelativePath
5902
    '''
5903 1
    def __init__(self, binary=None):
5904 1
        if binary is not None:
5905 1
            self._binary_init(binary)
5906 1
            self._freeze = True
5907 1
            return
5908 1
        self.StartingNode = NodeId()
5909 1
        self.RelativePath = RelativePath()
5910 1
        self._freeze = True
5911
5912 1
    def to_binary(self):
5913 1
        packet = []
5914 1
        packet.append(self.StartingNode.to_binary())
5915 1
        packet.append(self.RelativePath.to_binary())
5916 1
        return b''.join(packet)
5917
5918 1
    @staticmethod
5919
    def from_binary(data):
5920 1
        return BrowsePath(data)
5921
5922 1
    def _binary_init(self, data):
5923 1
        self.StartingNode = NodeId.from_binary(data)
5924 1
        self.RelativePath = RelativePath.from_binary(data)
5925
5926 1
    def __str__(self):
5927
        return 'BrowsePath(' + 'StartingNode:' + str(self.StartingNode) + ', ' + \
5928
               'RelativePath:' + str(self.RelativePath) + ')'
5929
5930 1
    __repr__ = __str__
5931
5932
5933 1 View Code Duplication
class BrowsePathTarget(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5934
    '''
5935
    The target of the translated path.
5936
5937
    :ivar TargetId:
5938
    :vartype TargetId: ExpandedNodeId
5939
    :ivar RemainingPathIndex:
5940
    :vartype RemainingPathIndex: UInt32
5941
    '''
5942 1
    def __init__(self, binary=None):
5943 1
        if binary is not None:
5944 1
            self._binary_init(binary)
5945 1
            self._freeze = True
5946 1
            return
5947 1
        self.TargetId = ExpandedNodeId()
5948 1
        self.RemainingPathIndex = 0
5949 1
        self._freeze = True
5950
5951 1
    def to_binary(self):
5952 1
        packet = []
5953 1
        packet.append(self.TargetId.to_binary())
5954 1
        packet.append(uatype_UInt32.pack(self.RemainingPathIndex))
5955 1
        return b''.join(packet)
5956
5957 1
    @staticmethod
5958
    def from_binary(data):
5959 1
        return BrowsePathTarget(data)
5960
5961 1
    def _binary_init(self, data):
5962 1
        self.TargetId = ExpandedNodeId.from_binary(data)
5963 1
        self.RemainingPathIndex = uatype_UInt32.unpack(data.read(4))[0]
5964
5965 1
    def __str__(self):
5966
        return 'BrowsePathTarget(' + 'TargetId:' + str(self.TargetId) + ', ' + \
5967
               'RemainingPathIndex:' + str(self.RemainingPathIndex) + ')'
5968
5969 1
    __repr__ = __str__
5970
5971
5972 1 View Code Duplication
class BrowsePathResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5973
    '''
5974
    The result of a translate opearation.
5975
5976
    :ivar StatusCode:
5977
    :vartype StatusCode: StatusCode
5978
    :ivar Targets:
5979
    :vartype Targets: BrowsePathTarget
5980
    '''
5981 1
    def __init__(self, binary=None):
5982 1
        if binary is not None:
5983 1
            self._binary_init(binary)
5984 1
            self._freeze = True
5985 1
            return
5986 1
        self.StatusCode = StatusCode()
5987 1
        self.Targets = []
5988 1
        self._freeze = True
5989
5990 1
    def to_binary(self):
5991 1
        packet = []
5992 1
        packet.append(self.StatusCode.to_binary())
5993 1
        packet.append(uatype_Int32.pack(len(self.Targets)))
5994 1
        for fieldname in self.Targets:
5995 1
            packet.append(fieldname.to_binary())
5996 1
        return b''.join(packet)
5997
5998 1
    @staticmethod
5999
    def from_binary(data):
6000 1
        return BrowsePathResult(data)
6001
6002 1
    def _binary_init(self, data):
6003 1
        self.StatusCode = StatusCode.from_binary(data)
6004 1
        length = uatype_Int32.unpack(data.read(4))[0]
6005 1
        array = []
6006 1
        if length != -1:
6007 1
            for _ in range(0, length):
6008 1
                array.append(BrowsePathTarget.from_binary(data))
6009 1
        self.Targets = array
6010
6011 1
    def __str__(self):
6012
        return 'BrowsePathResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
6013
               'Targets:' + str(self.Targets) + ')'
6014
6015 1
    __repr__ = __str__
6016
6017
6018 1 View Code Duplication
class TranslateBrowsePathsToNodeIdsParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6019
    '''
6020
    :ivar BrowsePaths:
6021
    :vartype BrowsePaths: BrowsePath
6022
    '''
6023 1
    def __init__(self, binary=None):
6024 1
        if binary is not None:
6025 1
            self._binary_init(binary)
6026 1
            self._freeze = True
6027 1
            return
6028 1
        self.BrowsePaths = []
6029 1
        self._freeze = True
6030
6031 1
    def to_binary(self):
6032 1
        packet = []
6033 1
        packet.append(uatype_Int32.pack(len(self.BrowsePaths)))
6034 1
        for fieldname in self.BrowsePaths:
6035 1
            packet.append(fieldname.to_binary())
6036 1
        return b''.join(packet)
6037
6038 1
    @staticmethod
6039
    def from_binary(data):
6040 1
        return TranslateBrowsePathsToNodeIdsParameters(data)
6041
6042 1
    def _binary_init(self, data):
6043 1
        length = uatype_Int32.unpack(data.read(4))[0]
6044 1
        array = []
6045 1
        if length != -1:
6046 1
            for _ in range(0, length):
6047 1
                array.append(BrowsePath.from_binary(data))
6048 1
        self.BrowsePaths = array
6049
6050 1
    def __str__(self):
6051
        return 'TranslateBrowsePathsToNodeIdsParameters(' + 'BrowsePaths:' + str(self.BrowsePaths) + ')'
6052
6053 1
    __repr__ = __str__
6054
6055
6056 1 View Code Duplication
class TranslateBrowsePathsToNodeIdsRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6057
    '''
6058
    Translates one or more paths in the server address space.
6059
6060
    :ivar TypeId:
6061
    :vartype TypeId: NodeId
6062
    :ivar RequestHeader:
6063
    :vartype RequestHeader: RequestHeader
6064
    :ivar Parameters:
6065
    :vartype Parameters: TranslateBrowsePathsToNodeIdsParameters
6066
    '''
6067 1
    def __init__(self, binary=None):
6068 1
        if binary is not None:
6069
            self._binary_init(binary)
6070
            self._freeze = True
6071
            return
6072 1
        self.TypeId = FourByteNodeId(ObjectIds.TranslateBrowsePathsToNodeIdsRequest_Encoding_DefaultBinary)
6073 1
        self.RequestHeader = RequestHeader()
6074 1
        self.Parameters = TranslateBrowsePathsToNodeIdsParameters()
6075 1
        self._freeze = True
6076
6077 1
    def to_binary(self):
6078 1
        packet = []
6079 1
        packet.append(self.TypeId.to_binary())
6080 1
        packet.append(self.RequestHeader.to_binary())
6081 1
        packet.append(self.Parameters.to_binary())
6082 1
        return b''.join(packet)
6083
6084 1
    @staticmethod
6085
    def from_binary(data):
6086
        return TranslateBrowsePathsToNodeIdsRequest(data)
6087
6088 1
    def _binary_init(self, data):
6089
        self.TypeId = NodeId.from_binary(data)
6090
        self.RequestHeader = RequestHeader.from_binary(data)
6091
        self.Parameters = TranslateBrowsePathsToNodeIdsParameters.from_binary(data)
6092
6093 1
    def __str__(self):
6094
        return 'TranslateBrowsePathsToNodeIdsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6095
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
6096
               'Parameters:' + str(self.Parameters) + ')'
6097
6098 1
    __repr__ = __str__
6099
6100
6101 1 View Code Duplication
class TranslateBrowsePathsToNodeIdsResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6102
    '''
6103
    Translates one or more paths in the server address space.
6104
6105
    :ivar TypeId:
6106
    :vartype TypeId: NodeId
6107
    :ivar ResponseHeader:
6108
    :vartype ResponseHeader: ResponseHeader
6109
    :ivar Results:
6110
    :vartype Results: BrowsePathResult
6111
    :ivar DiagnosticInfos:
6112
    :vartype DiagnosticInfos: DiagnosticInfo
6113
    '''
6114 1
    def __init__(self, binary=None):
6115 1
        if binary is not None:
6116 1
            self._binary_init(binary)
6117 1
            self._freeze = True
6118 1
            return
6119 1
        self.TypeId = FourByteNodeId(ObjectIds.TranslateBrowsePathsToNodeIdsResponse_Encoding_DefaultBinary)
6120 1
        self.ResponseHeader = ResponseHeader()
6121 1
        self.Results = []
6122 1
        self.DiagnosticInfos = []
6123 1
        self._freeze = True
6124
6125 1
    def to_binary(self):
6126 1
        packet = []
6127 1
        packet.append(self.TypeId.to_binary())
6128 1
        packet.append(self.ResponseHeader.to_binary())
6129 1
        packet.append(uatype_Int32.pack(len(self.Results)))
6130 1
        for fieldname in self.Results:
6131 1
            packet.append(fieldname.to_binary())
6132 1
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
6133 1
        for fieldname in self.DiagnosticInfos:
6134
            packet.append(fieldname.to_binary())
6135 1
        return b''.join(packet)
6136
6137 1
    @staticmethod
6138
    def from_binary(data):
6139 1
        return TranslateBrowsePathsToNodeIdsResponse(data)
6140
6141 1
    def _binary_init(self, data):
6142 1
        self.TypeId = NodeId.from_binary(data)
6143 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
6144 1
        length = uatype_Int32.unpack(data.read(4))[0]
6145 1
        array = []
6146 1
        if length != -1:
6147 1
            for _ in range(0, length):
6148 1
                array.append(BrowsePathResult.from_binary(data))
6149 1
        self.Results = array
6150 1
        length = uatype_Int32.unpack(data.read(4))[0]
6151 1
        array = []
6152 1
        if length != -1:
6153 1
            for _ in range(0, length):
6154
                array.append(DiagnosticInfo.from_binary(data))
6155 1
        self.DiagnosticInfos = array
6156
6157 1
    def __str__(self):
6158
        return 'TranslateBrowsePathsToNodeIdsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6159
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
6160
               'Results:' + str(self.Results) + ', ' + \
6161
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
6162
6163 1
    __repr__ = __str__
6164
6165
6166 1 View Code Duplication
class RegisterNodesParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6167
    '''
6168
    :ivar NodesToRegister:
6169
    :vartype NodesToRegister: NodeId
6170
    '''
6171 1
    def __init__(self, binary=None):
6172
        if binary is not None:
6173
            self._binary_init(binary)
6174
            self._freeze = True
6175
            return
6176
        self.NodesToRegister = []
6177
        self._freeze = True
6178
6179 1
    def to_binary(self):
6180
        packet = []
6181
        packet.append(uatype_Int32.pack(len(self.NodesToRegister)))
6182
        for fieldname in self.NodesToRegister:
6183
            packet.append(fieldname.to_binary())
6184
        return b''.join(packet)
6185
6186 1
    @staticmethod
6187
    def from_binary(data):
6188
        return RegisterNodesParameters(data)
6189
6190 1
    def _binary_init(self, data):
6191
        length = uatype_Int32.unpack(data.read(4))[0]
6192
        array = []
6193
        if length != -1:
6194
            for _ in range(0, length):
6195
                array.append(NodeId.from_binary(data))
6196
        self.NodesToRegister = array
6197
6198 1
    def __str__(self):
6199
        return 'RegisterNodesParameters(' + 'NodesToRegister:' + str(self.NodesToRegister) + ')'
6200
6201 1
    __repr__ = __str__
6202
6203
6204 1 View Code Duplication
class RegisterNodesRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6205
    '''
6206
    Registers one or more nodes for repeated use within a session.
6207
6208
    :ivar TypeId:
6209
    :vartype TypeId: NodeId
6210
    :ivar RequestHeader:
6211
    :vartype RequestHeader: RequestHeader
6212
    :ivar Parameters:
6213
    :vartype Parameters: RegisterNodesParameters
6214
    '''
6215 1
    def __init__(self, binary=None):
6216
        if binary is not None:
6217
            self._binary_init(binary)
6218
            self._freeze = True
6219
            return
6220
        self.TypeId = FourByteNodeId(ObjectIds.RegisterNodesRequest_Encoding_DefaultBinary)
6221
        self.RequestHeader = RequestHeader()
6222
        self.Parameters = RegisterNodesParameters()
6223
        self._freeze = True
6224
6225 1
    def to_binary(self):
6226
        packet = []
6227
        packet.append(self.TypeId.to_binary())
6228
        packet.append(self.RequestHeader.to_binary())
6229
        packet.append(self.Parameters.to_binary())
6230
        return b''.join(packet)
6231
6232 1
    @staticmethod
6233
    def from_binary(data):
6234
        return RegisterNodesRequest(data)
6235
6236 1
    def _binary_init(self, data):
6237
        self.TypeId = NodeId.from_binary(data)
6238
        self.RequestHeader = RequestHeader.from_binary(data)
6239
        self.Parameters = RegisterNodesParameters.from_binary(data)
6240
6241 1
    def __str__(self):
6242
        return 'RegisterNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6243
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
6244
               'Parameters:' + str(self.Parameters) + ')'
6245
6246 1
    __repr__ = __str__
6247
6248
6249 1 View Code Duplication
class RegisterNodesResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6250
    '''
6251
    :ivar RegisteredNodeIds:
6252
    :vartype RegisteredNodeIds: NodeId
6253
    '''
6254 1
    def __init__(self, binary=None):
6255
        if binary is not None:
6256
            self._binary_init(binary)
6257
            self._freeze = True
6258
            return
6259
        self.RegisteredNodeIds = []
6260
        self._freeze = True
6261
6262 1
    def to_binary(self):
6263
        packet = []
6264
        packet.append(uatype_Int32.pack(len(self.RegisteredNodeIds)))
6265
        for fieldname in self.RegisteredNodeIds:
6266
            packet.append(fieldname.to_binary())
6267
        return b''.join(packet)
6268
6269 1
    @staticmethod
6270
    def from_binary(data):
6271
        return RegisterNodesResult(data)
6272
6273 1
    def _binary_init(self, data):
6274
        length = uatype_Int32.unpack(data.read(4))[0]
6275
        array = []
6276
        if length != -1:
6277
            for _ in range(0, length):
6278
                array.append(NodeId.from_binary(data))
6279
        self.RegisteredNodeIds = array
6280
6281 1
    def __str__(self):
6282
        return 'RegisterNodesResult(' + 'RegisteredNodeIds:' + str(self.RegisteredNodeIds) + ')'
6283
6284 1
    __repr__ = __str__
6285
6286
6287 1 View Code Duplication
class RegisterNodesResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6288
    '''
6289
    Registers one or more nodes for repeated use within a session.
6290
6291
    :ivar TypeId:
6292
    :vartype TypeId: NodeId
6293
    :ivar ResponseHeader:
6294
    :vartype ResponseHeader: ResponseHeader
6295
    :ivar Parameters:
6296
    :vartype Parameters: RegisterNodesResult
6297
    '''
6298 1
    def __init__(self, binary=None):
6299
        if binary is not None:
6300
            self._binary_init(binary)
6301
            self._freeze = True
6302
            return
6303
        self.TypeId = FourByteNodeId(ObjectIds.RegisterNodesResponse_Encoding_DefaultBinary)
6304
        self.ResponseHeader = ResponseHeader()
6305
        self.Parameters = RegisterNodesResult()
6306
        self._freeze = True
6307
6308 1
    def to_binary(self):
6309
        packet = []
6310
        packet.append(self.TypeId.to_binary())
6311
        packet.append(self.ResponseHeader.to_binary())
6312
        packet.append(self.Parameters.to_binary())
6313
        return b''.join(packet)
6314
6315 1
    @staticmethod
6316
    def from_binary(data):
6317
        return RegisterNodesResponse(data)
6318
6319 1
    def _binary_init(self, data):
6320
        self.TypeId = NodeId.from_binary(data)
6321
        self.ResponseHeader = ResponseHeader.from_binary(data)
6322
        self.Parameters = RegisterNodesResult.from_binary(data)
6323
6324 1
    def __str__(self):
6325
        return 'RegisterNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6326
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
6327
               'Parameters:' + str(self.Parameters) + ')'
6328
6329 1
    __repr__ = __str__
6330
6331
6332 1 View Code Duplication
class UnregisterNodesParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6333
    '''
6334
    :ivar NodesToUnregister:
6335
    :vartype NodesToUnregister: NodeId
6336
    '''
6337 1
    def __init__(self, binary=None):
6338
        if binary is not None:
6339
            self._binary_init(binary)
6340
            self._freeze = True
6341
            return
6342
        self.NodesToUnregister = []
6343
        self._freeze = True
6344
6345 1
    def to_binary(self):
6346
        packet = []
6347
        packet.append(uatype_Int32.pack(len(self.NodesToUnregister)))
6348
        for fieldname in self.NodesToUnregister:
6349
            packet.append(fieldname.to_binary())
6350
        return b''.join(packet)
6351
6352 1
    @staticmethod
6353
    def from_binary(data):
6354
        return UnregisterNodesParameters(data)
6355
6356 1
    def _binary_init(self, data):
6357
        length = uatype_Int32.unpack(data.read(4))[0]
6358
        array = []
6359
        if length != -1:
6360
            for _ in range(0, length):
6361
                array.append(NodeId.from_binary(data))
6362
        self.NodesToUnregister = array
6363
6364 1
    def __str__(self):
6365
        return 'UnregisterNodesParameters(' + 'NodesToUnregister:' + str(self.NodesToUnregister) + ')'
6366
6367 1
    __repr__ = __str__
6368
6369
6370 1 View Code Duplication
class UnregisterNodesRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6371
    '''
6372
    Unregisters one or more previously registered nodes.
6373
6374
    :ivar TypeId:
6375
    :vartype TypeId: NodeId
6376
    :ivar RequestHeader:
6377
    :vartype RequestHeader: RequestHeader
6378
    :ivar Parameters:
6379
    :vartype Parameters: UnregisterNodesParameters
6380
    '''
6381 1
    def __init__(self, binary=None):
6382
        if binary is not None:
6383
            self._binary_init(binary)
6384
            self._freeze = True
6385
            return
6386
        self.TypeId = FourByteNodeId(ObjectIds.UnregisterNodesRequest_Encoding_DefaultBinary)
6387
        self.RequestHeader = RequestHeader()
6388
        self.Parameters = UnregisterNodesParameters()
6389
        self._freeze = True
6390
6391 1
    def to_binary(self):
6392
        packet = []
6393
        packet.append(self.TypeId.to_binary())
6394
        packet.append(self.RequestHeader.to_binary())
6395
        packet.append(self.Parameters.to_binary())
6396
        return b''.join(packet)
6397
6398 1
    @staticmethod
6399
    def from_binary(data):
6400
        return UnregisterNodesRequest(data)
6401
6402 1
    def _binary_init(self, data):
6403
        self.TypeId = NodeId.from_binary(data)
6404
        self.RequestHeader = RequestHeader.from_binary(data)
6405
        self.Parameters = UnregisterNodesParameters.from_binary(data)
6406
6407 1
    def __str__(self):
6408
        return 'UnregisterNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6409
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
6410
               'Parameters:' + str(self.Parameters) + ')'
6411
6412 1
    __repr__ = __str__
6413
6414
6415 1 View Code Duplication
class UnregisterNodesResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6416
    '''
6417
    Unregisters one or more previously registered nodes.
6418
6419
    :ivar TypeId:
6420
    :vartype TypeId: NodeId
6421
    :ivar ResponseHeader:
6422
    :vartype ResponseHeader: ResponseHeader
6423
    '''
6424 1
    def __init__(self, binary=None):
6425
        if binary is not None:
6426
            self._binary_init(binary)
6427
            self._freeze = True
6428
            return
6429
        self.TypeId = FourByteNodeId(ObjectIds.UnregisterNodesResponse_Encoding_DefaultBinary)
6430
        self.ResponseHeader = ResponseHeader()
6431
        self._freeze = True
6432
6433 1
    def to_binary(self):
6434
        packet = []
6435
        packet.append(self.TypeId.to_binary())
6436
        packet.append(self.ResponseHeader.to_binary())
6437
        return b''.join(packet)
6438
6439 1
    @staticmethod
6440
    def from_binary(data):
6441
        return UnregisterNodesResponse(data)
6442
6443 1
    def _binary_init(self, data):
6444
        self.TypeId = NodeId.from_binary(data)
6445
        self.ResponseHeader = ResponseHeader.from_binary(data)
6446
6447 1
    def __str__(self):
6448
        return 'UnregisterNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6449
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
6450
6451 1
    __repr__ = __str__
6452
6453
6454 1
class EndpointConfiguration(FrozenClass):
6455
    '''
6456
    :ivar OperationTimeout:
6457
    :vartype OperationTimeout: Int32
6458
    :ivar UseBinaryEncoding:
6459
    :vartype UseBinaryEncoding: Boolean
6460
    :ivar MaxStringLength:
6461
    :vartype MaxStringLength: Int32
6462
    :ivar MaxByteStringLength:
6463
    :vartype MaxByteStringLength: Int32
6464
    :ivar MaxArrayLength:
6465
    :vartype MaxArrayLength: Int32
6466
    :ivar MaxMessageSize:
6467
    :vartype MaxMessageSize: Int32
6468
    :ivar MaxBufferSize:
6469
    :vartype MaxBufferSize: Int32
6470
    :ivar ChannelLifetime:
6471
    :vartype ChannelLifetime: Int32
6472
    :ivar SecurityTokenLifetime:
6473
    :vartype SecurityTokenLifetime: Int32
6474
    '''
6475 1
    def __init__(self, binary=None):
6476
        if binary is not None:
6477
            self._binary_init(binary)
6478
            self._freeze = True
6479
            return
6480
        self.OperationTimeout = 0
6481
        self.UseBinaryEncoding = True
6482
        self.MaxStringLength = 0
6483
        self.MaxByteStringLength = 0
6484
        self.MaxArrayLength = 0
6485
        self.MaxMessageSize = 0
6486
        self.MaxBufferSize = 0
6487
        self.ChannelLifetime = 0
6488
        self.SecurityTokenLifetime = 0
6489
        self._freeze = True
6490
6491 1
    def to_binary(self):
6492
        packet = []
6493
        packet.append(uatype_Int32.pack(self.OperationTimeout))
6494
        packet.append(uatype_Boolean.pack(self.UseBinaryEncoding))
6495
        packet.append(uatype_Int32.pack(self.MaxStringLength))
6496
        packet.append(uatype_Int32.pack(self.MaxByteStringLength))
6497
        packet.append(uatype_Int32.pack(self.MaxArrayLength))
6498
        packet.append(uatype_Int32.pack(self.MaxMessageSize))
6499
        packet.append(uatype_Int32.pack(self.MaxBufferSize))
6500
        packet.append(uatype_Int32.pack(self.ChannelLifetime))
6501
        packet.append(uatype_Int32.pack(self.SecurityTokenLifetime))
6502
        return b''.join(packet)
6503
6504 1
    @staticmethod
6505
    def from_binary(data):
6506
        return EndpointConfiguration(data)
6507
6508 1
    def _binary_init(self, data):
6509
        self.OperationTimeout = uatype_Int32.unpack(data.read(4))[0]
6510
        self.UseBinaryEncoding = uatype_Boolean.unpack(data.read(1))[0]
6511
        self.MaxStringLength = uatype_Int32.unpack(data.read(4))[0]
6512
        self.MaxByteStringLength = uatype_Int32.unpack(data.read(4))[0]
6513
        self.MaxArrayLength = uatype_Int32.unpack(data.read(4))[0]
6514
        self.MaxMessageSize = uatype_Int32.unpack(data.read(4))[0]
6515
        self.MaxBufferSize = uatype_Int32.unpack(data.read(4))[0]
6516
        self.ChannelLifetime = uatype_Int32.unpack(data.read(4))[0]
6517
        self.SecurityTokenLifetime = uatype_Int32.unpack(data.read(4))[0]
6518
6519 1
    def __str__(self):
6520
        return 'EndpointConfiguration(' + 'OperationTimeout:' + str(self.OperationTimeout) + ', ' + \
6521
               'UseBinaryEncoding:' + str(self.UseBinaryEncoding) + ', ' + \
6522
               'MaxStringLength:' + str(self.MaxStringLength) + ', ' + \
6523
               'MaxByteStringLength:' + str(self.MaxByteStringLength) + ', ' + \
6524
               'MaxArrayLength:' + str(self.MaxArrayLength) + ', ' + \
6525
               'MaxMessageSize:' + str(self.MaxMessageSize) + ', ' + \
6526
               'MaxBufferSize:' + str(self.MaxBufferSize) + ', ' + \
6527
               'ChannelLifetime:' + str(self.ChannelLifetime) + ', ' + \
6528
               'SecurityTokenLifetime:' + str(self.SecurityTokenLifetime) + ')'
6529
6530 1
    __repr__ = __str__
6531
6532
6533 1
class SupportedProfile(FrozenClass):
6534
    '''
6535
    :ivar OrganizationUri:
6536
    :vartype OrganizationUri: String
6537
    :ivar ProfileId:
6538
    :vartype ProfileId: String
6539
    :ivar ComplianceTool:
6540
    :vartype ComplianceTool: String
6541
    :ivar ComplianceDate:
6542
    :vartype ComplianceDate: DateTime
6543
    :ivar ComplianceLevel:
6544
    :vartype ComplianceLevel: ComplianceLevel
6545
    :ivar UnsupportedUnitIds:
6546
    :vartype UnsupportedUnitIds: String
6547
    '''
6548 1
    def __init__(self, binary=None):
6549
        if binary is not None:
6550
            self._binary_init(binary)
6551
            self._freeze = True
6552
            return
6553
        self.OrganizationUri = ''
6554
        self.ProfileId = ''
6555
        self.ComplianceTool = ''
6556
        self.ComplianceDate = datetime.now()
6557
        self.ComplianceLevel = ComplianceLevel(0)
6558
        self.UnsupportedUnitIds = []
6559
        self._freeze = True
6560
6561 1
    def to_binary(self):
6562
        packet = []
6563
        packet.append(pack_string(self.OrganizationUri))
6564
        packet.append(pack_string(self.ProfileId))
6565
        packet.append(pack_string(self.ComplianceTool))
6566
        packet.append(pack_datetime(self.ComplianceDate))
6567
        packet.append(uatype_UInt32.pack(self.ComplianceLevel.value))
6568
        packet.append(uatype_Int32.pack(len(self.UnsupportedUnitIds)))
6569
        for fieldname in self.UnsupportedUnitIds:
6570
            packet.append(pack_string(fieldname))
6571
        return b''.join(packet)
6572
6573 1
    @staticmethod
6574
    def from_binary(data):
6575
        return SupportedProfile(data)
6576
6577 1
    def _binary_init(self, data):
6578
        self.OrganizationUri = unpack_string(data)
6579
        self.ProfileId = unpack_string(data)
6580
        self.ComplianceTool = unpack_string(data)
6581
        self.ComplianceDate = unpack_datetime(data)
6582
        self.ComplianceLevel = ComplianceLevel(uatype_UInt32.unpack(data.read(4))[0])
6583
        self.UnsupportedUnitIds = unpack_uatype_array('String', data)
6584
6585 1
    def __str__(self):
6586
        return 'SupportedProfile(' + 'OrganizationUri:' + str(self.OrganizationUri) + ', ' + \
6587
               'ProfileId:' + str(self.ProfileId) + ', ' + \
6588
               'ComplianceTool:' + str(self.ComplianceTool) + ', ' + \
6589
               'ComplianceDate:' + str(self.ComplianceDate) + ', ' + \
6590
               'ComplianceLevel:' + str(self.ComplianceLevel) + ', ' + \
6591
               'UnsupportedUnitIds:' + str(self.UnsupportedUnitIds) + ')'
6592
6593 1
    __repr__ = __str__
6594
6595
6596 1
class SoftwareCertificate(FrozenClass):
6597
    '''
6598
    :ivar ProductName:
6599
    :vartype ProductName: String
6600
    :ivar ProductUri:
6601
    :vartype ProductUri: String
6602
    :ivar VendorName:
6603
    :vartype VendorName: String
6604
    :ivar VendorProductCertificate:
6605
    :vartype VendorProductCertificate: ByteString
6606
    :ivar SoftwareVersion:
6607
    :vartype SoftwareVersion: String
6608
    :ivar BuildNumber:
6609
    :vartype BuildNumber: String
6610
    :ivar BuildDate:
6611
    :vartype BuildDate: DateTime
6612
    :ivar IssuedBy:
6613
    :vartype IssuedBy: String
6614
    :ivar IssueDate:
6615
    :vartype IssueDate: DateTime
6616
    :ivar SupportedProfiles:
6617
    :vartype SupportedProfiles: SupportedProfile
6618
    '''
6619 1
    def __init__(self, binary=None):
6620
        if binary is not None:
6621
            self._binary_init(binary)
6622
            self._freeze = True
6623
            return
6624
        self.ProductName = ''
6625
        self.ProductUri = ''
6626
        self.VendorName = ''
6627
        self.VendorProductCertificate = b''
6628
        self.SoftwareVersion = ''
6629
        self.BuildNumber = ''
6630
        self.BuildDate = datetime.now()
6631
        self.IssuedBy = ''
6632
        self.IssueDate = datetime.now()
6633
        self.SupportedProfiles = []
6634
        self._freeze = True
6635
6636 1
    def to_binary(self):
6637
        packet = []
6638
        packet.append(pack_string(self.ProductName))
6639
        packet.append(pack_string(self.ProductUri))
6640
        packet.append(pack_string(self.VendorName))
6641
        packet.append(pack_bytes(self.VendorProductCertificate))
6642
        packet.append(pack_string(self.SoftwareVersion))
6643
        packet.append(pack_string(self.BuildNumber))
6644
        packet.append(pack_datetime(self.BuildDate))
6645
        packet.append(pack_string(self.IssuedBy))
6646
        packet.append(pack_datetime(self.IssueDate))
6647
        packet.append(uatype_Int32.pack(len(self.SupportedProfiles)))
6648
        for fieldname in self.SupportedProfiles:
6649
            packet.append(fieldname.to_binary())
6650
        return b''.join(packet)
6651
6652 1
    @staticmethod
6653
    def from_binary(data):
6654
        return SoftwareCertificate(data)
6655
6656 1
    def _binary_init(self, data):
6657
        self.ProductName = unpack_string(data)
6658
        self.ProductUri = unpack_string(data)
6659
        self.VendorName = unpack_string(data)
6660
        self.VendorProductCertificate = unpack_bytes(data)
6661
        self.SoftwareVersion = unpack_string(data)
6662
        self.BuildNumber = unpack_string(data)
6663
        self.BuildDate = unpack_datetime(data)
6664
        self.IssuedBy = unpack_string(data)
6665
        self.IssueDate = unpack_datetime(data)
6666
        length = uatype_Int32.unpack(data.read(4))[0]
6667
        array = []
6668
        if length != -1:
6669
            for _ in range(0, length):
6670
                array.append(SupportedProfile.from_binary(data))
6671
        self.SupportedProfiles = array
6672
6673 1
    def __str__(self):
6674
        return 'SoftwareCertificate(' + 'ProductName:' + str(self.ProductName) + ', ' + \
6675
               'ProductUri:' + str(self.ProductUri) + ', ' + \
6676
               'VendorName:' + str(self.VendorName) + ', ' + \
6677
               'VendorProductCertificate:' + str(self.VendorProductCertificate) + ', ' + \
6678
               'SoftwareVersion:' + str(self.SoftwareVersion) + ', ' + \
6679
               'BuildNumber:' + str(self.BuildNumber) + ', ' + \
6680
               'BuildDate:' + str(self.BuildDate) + ', ' + \
6681
               'IssuedBy:' + str(self.IssuedBy) + ', ' + \
6682
               'IssueDate:' + str(self.IssueDate) + ', ' + \
6683
               'SupportedProfiles:' + str(self.SupportedProfiles) + ')'
6684
6685 1
    __repr__ = __str__
6686
6687
6688 1
class QueryDataDescription(FrozenClass):
6689
    '''
6690
    :ivar RelativePath:
6691
    :vartype RelativePath: RelativePath
6692
    :ivar AttributeId:
6693
    :vartype AttributeId: UInt32
6694
    :ivar IndexRange:
6695
    :vartype IndexRange: String
6696
    '''
6697 1
    def __init__(self, binary=None):
6698
        if binary is not None:
6699
            self._binary_init(binary)
6700
            self._freeze = True
6701
            return
6702
        self.RelativePath = RelativePath()
6703
        self.AttributeId = 0
6704
        self.IndexRange = ''
6705
        self._freeze = True
6706
6707 1
    def to_binary(self):
6708
        packet = []
6709
        packet.append(self.RelativePath.to_binary())
6710
        packet.append(uatype_UInt32.pack(self.AttributeId))
6711
        packet.append(pack_string(self.IndexRange))
6712
        return b''.join(packet)
6713
6714 1
    @staticmethod
6715
    def from_binary(data):
6716
        return QueryDataDescription(data)
6717
6718 1
    def _binary_init(self, data):
6719
        self.RelativePath = RelativePath.from_binary(data)
6720
        self.AttributeId = uatype_UInt32.unpack(data.read(4))[0]
6721
        self.IndexRange = unpack_string(data)
6722
6723 1
    def __str__(self):
6724
        return 'QueryDataDescription(' + 'RelativePath:' + str(self.RelativePath) + ', ' + \
6725
               'AttributeId:' + str(self.AttributeId) + ', ' + \
6726
               'IndexRange:' + str(self.IndexRange) + ')'
6727
6728 1
    __repr__ = __str__
6729
6730
6731 1 View Code Duplication
class NodeTypeDescription(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6732
    '''
6733
    :ivar TypeDefinitionNode:
6734
    :vartype TypeDefinitionNode: ExpandedNodeId
6735
    :ivar IncludeSubTypes:
6736
    :vartype IncludeSubTypes: Boolean
6737
    :ivar DataToReturn:
6738
    :vartype DataToReturn: QueryDataDescription
6739
    '''
6740 1
    def __init__(self, binary=None):
6741
        if binary is not None:
6742
            self._binary_init(binary)
6743
            self._freeze = True
6744
            return
6745
        self.TypeDefinitionNode = ExpandedNodeId()
6746
        self.IncludeSubTypes = True
6747
        self.DataToReturn = []
6748
        self._freeze = True
6749
6750 1
    def to_binary(self):
6751
        packet = []
6752
        packet.append(self.TypeDefinitionNode.to_binary())
6753
        packet.append(uatype_Boolean.pack(self.IncludeSubTypes))
6754
        packet.append(uatype_Int32.pack(len(self.DataToReturn)))
6755
        for fieldname in self.DataToReturn:
6756
            packet.append(fieldname.to_binary())
6757
        return b''.join(packet)
6758
6759 1
    @staticmethod
6760
    def from_binary(data):
6761
        return NodeTypeDescription(data)
6762
6763 1
    def _binary_init(self, data):
6764
        self.TypeDefinitionNode = ExpandedNodeId.from_binary(data)
6765
        self.IncludeSubTypes = uatype_Boolean.unpack(data.read(1))[0]
6766
        length = uatype_Int32.unpack(data.read(4))[0]
6767
        array = []
6768
        if length != -1:
6769
            for _ in range(0, length):
6770
                array.append(QueryDataDescription.from_binary(data))
6771
        self.DataToReturn = array
6772
6773 1
    def __str__(self):
6774
        return 'NodeTypeDescription(' + 'TypeDefinitionNode:' + str(self.TypeDefinitionNode) + ', ' + \
6775
               'IncludeSubTypes:' + str(self.IncludeSubTypes) + ', ' + \
6776
               'DataToReturn:' + str(self.DataToReturn) + ')'
6777
6778 1
    __repr__ = __str__
6779
6780
6781 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...
6782
    '''
6783
    :ivar NodeId:
6784
    :vartype NodeId: ExpandedNodeId
6785
    :ivar TypeDefinitionNode:
6786
    :vartype TypeDefinitionNode: ExpandedNodeId
6787
    :ivar Values:
6788
    :vartype Values: Variant
6789
    '''
6790 1
    def __init__(self, binary=None):
6791
        if binary is not None:
6792
            self._binary_init(binary)
6793
            self._freeze = True
6794
            return
6795
        self.NodeId = ExpandedNodeId()
6796
        self.TypeDefinitionNode = ExpandedNodeId()
6797
        self.Values = []
6798
        self._freeze = True
6799
6800 1
    def to_binary(self):
6801
        packet = []
6802
        packet.append(self.NodeId.to_binary())
6803
        packet.append(self.TypeDefinitionNode.to_binary())
6804
        packet.append(uatype_Int32.pack(len(self.Values)))
6805
        for fieldname in self.Values:
6806
            packet.append(fieldname.to_binary())
6807
        return b''.join(packet)
6808
6809 1
    @staticmethod
6810
    def from_binary(data):
6811
        return QueryDataSet(data)
6812
6813 1
    def _binary_init(self, data):
6814
        self.NodeId = ExpandedNodeId.from_binary(data)
6815
        self.TypeDefinitionNode = ExpandedNodeId.from_binary(data)
6816
        length = uatype_Int32.unpack(data.read(4))[0]
6817
        array = []
6818
        if length != -1:
6819
            for _ in range(0, length):
6820
                array.append(Variant.from_binary(data))
6821
        self.Values = array
6822
6823 1
    def __str__(self):
6824
        return 'QueryDataSet(' + 'NodeId:' + str(self.NodeId) + ', ' + \
6825
               'TypeDefinitionNode:' + str(self.TypeDefinitionNode) + ', ' + \
6826
               'Values:' + str(self.Values) + ')'
6827
6828 1
    __repr__ = __str__
6829
6830
6831 1
class NodeReference(FrozenClass):
6832
    '''
6833
    :ivar NodeId:
6834
    :vartype NodeId: NodeId
6835
    :ivar ReferenceTypeId:
6836
    :vartype ReferenceTypeId: NodeId
6837
    :ivar IsForward:
6838
    :vartype IsForward: Boolean
6839
    :ivar ReferencedNodeIds:
6840
    :vartype ReferencedNodeIds: NodeId
6841
    '''
6842 1
    def __init__(self, binary=None):
6843
        if binary is not None:
6844
            self._binary_init(binary)
6845
            self._freeze = True
6846
            return
6847
        self.NodeId = NodeId()
6848
        self.ReferenceTypeId = NodeId()
6849
        self.IsForward = True
6850
        self.ReferencedNodeIds = []
6851
        self._freeze = True
6852
6853 1
    def to_binary(self):
6854
        packet = []
6855
        packet.append(self.NodeId.to_binary())
6856
        packet.append(self.ReferenceTypeId.to_binary())
6857
        packet.append(uatype_Boolean.pack(self.IsForward))
6858
        packet.append(uatype_Int32.pack(len(self.ReferencedNodeIds)))
6859
        for fieldname in self.ReferencedNodeIds:
6860
            packet.append(fieldname.to_binary())
6861
        return b''.join(packet)
6862
6863 1
    @staticmethod
6864
    def from_binary(data):
6865
        return NodeReference(data)
6866
6867 1
    def _binary_init(self, data):
6868
        self.NodeId = NodeId.from_binary(data)
6869
        self.ReferenceTypeId = NodeId.from_binary(data)
6870
        self.IsForward = uatype_Boolean.unpack(data.read(1))[0]
6871
        length = uatype_Int32.unpack(data.read(4))[0]
6872
        array = []
6873
        if length != -1:
6874
            for _ in range(0, length):
6875
                array.append(NodeId.from_binary(data))
6876
        self.ReferencedNodeIds = array
6877
6878 1
    def __str__(self):
6879
        return 'NodeReference(' + 'NodeId:' + str(self.NodeId) + ', ' + \
6880
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
6881
               'IsForward:' + str(self.IsForward) + ', ' + \
6882
               'ReferencedNodeIds:' + str(self.ReferencedNodeIds) + ')'
6883
6884 1
    __repr__ = __str__
6885
6886
6887 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...
6888
    '''
6889
    :ivar FilterOperator:
6890
    :vartype FilterOperator: FilterOperator
6891
    :ivar FilterOperands:
6892
    :vartype FilterOperands: ExtensionObject
6893
    '''
6894 1
    def __init__(self, binary=None):
6895
        if binary is not None:
6896
            self._binary_init(binary)
6897
            self._freeze = True
6898
            return
6899
        self.FilterOperator = FilterOperator(0)
6900
        self.FilterOperands = []
6901
        self._freeze = True
6902
6903 1
    def to_binary(self):
6904
        packet = []
6905
        packet.append(uatype_UInt32.pack(self.FilterOperator.value))
6906
        packet.append(uatype_Int32.pack(len(self.FilterOperands)))
6907
        for fieldname in self.FilterOperands:
6908
            packet.append(extensionobject_to_binary(fieldname))
6909
        return b''.join(packet)
6910
6911 1
    @staticmethod
6912
    def from_binary(data):
6913
        return ContentFilterElement(data)
6914
6915 1
    def _binary_init(self, data):
6916
        self.FilterOperator = FilterOperator(uatype_UInt32.unpack(data.read(4))[0])
6917
        length = uatype_Int32.unpack(data.read(4))[0]
6918
        array = []
6919
        if length != -1:
6920
            for _ in range(0, length):
6921
                array.append(extensionobject_from_binary(data))
6922
        self.FilterOperands = array
6923
6924 1
    def __str__(self):
6925
        return 'ContentFilterElement(' + 'FilterOperator:' + str(self.FilterOperator) + ', ' + \
6926
               'FilterOperands:' + str(self.FilterOperands) + ')'
6927
6928 1
    __repr__ = __str__
6929
6930
6931 1 View Code Duplication
class ContentFilter(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6932
    '''
6933
    :ivar Elements:
6934
    :vartype Elements: ContentFilterElement
6935
    '''
6936 1
    def __init__(self, binary=None):
6937 1
        if binary is not None:
6938 1
            self._binary_init(binary)
6939 1
            self._freeze = True
6940 1
            return
6941 1
        self.Elements = []
6942 1
        self._freeze = True
6943
6944 1
    def to_binary(self):
6945 1
        packet = []
6946 1
        packet.append(uatype_Int32.pack(len(self.Elements)))
6947 1
        for fieldname in self.Elements:
6948
            packet.append(fieldname.to_binary())
6949 1
        return b''.join(packet)
6950
6951 1
    @staticmethod
6952
    def from_binary(data):
6953 1
        return ContentFilter(data)
6954
6955 1
    def _binary_init(self, data):
6956 1
        length = uatype_Int32.unpack(data.read(4))[0]
6957 1
        array = []
6958 1
        if length != -1:
6959 1
            for _ in range(0, length):
6960
                array.append(ContentFilterElement.from_binary(data))
6961 1
        self.Elements = array
6962
6963 1
    def __str__(self):
6964
        return 'ContentFilter(' + 'Elements:' + str(self.Elements) + ')'
6965
6966 1
    __repr__ = __str__
6967
6968
6969 1 View Code Duplication
class ElementOperand(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6970
    '''
6971
    :ivar Index:
6972
    :vartype Index: UInt32
6973
    '''
6974 1
    def __init__(self, binary=None):
6975
        if binary is not None:
6976
            self._binary_init(binary)
6977
            self._freeze = True
6978
            return
6979
        self.Index = 0
6980
        self._freeze = True
6981
6982 1
    def to_binary(self):
6983
        packet = []
6984
        packet.append(uatype_UInt32.pack(self.Index))
6985
        return b''.join(packet)
6986
6987 1
    @staticmethod
6988
    def from_binary(data):
6989
        return ElementOperand(data)
6990
6991 1
    def _binary_init(self, data):
6992
        self.Index = uatype_UInt32.unpack(data.read(4))[0]
6993
6994 1
    def __str__(self):
6995
        return 'ElementOperand(' + 'Index:' + str(self.Index) + ')'
6996
6997 1
    __repr__ = __str__
6998
6999
7000 1 View Code Duplication
class LiteralOperand(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7001
    '''
7002
    :ivar Value:
7003
    :vartype Value: Variant
7004
    '''
7005 1
    def __init__(self, binary=None):
7006
        if binary is not None:
7007
            self._binary_init(binary)
7008
            self._freeze = True
7009
            return
7010
        self.Value = Variant()
7011
        self._freeze = True
7012
7013 1
    def to_binary(self):
7014
        packet = []
7015
        packet.append(self.Value.to_binary())
7016
        return b''.join(packet)
7017
7018 1
    @staticmethod
7019
    def from_binary(data):
7020
        return LiteralOperand(data)
7021
7022 1
    def _binary_init(self, data):
7023
        self.Value = Variant.from_binary(data)
7024
7025 1
    def __str__(self):
7026
        return 'LiteralOperand(' + 'Value:' + str(self.Value) + ')'
7027
7028 1
    __repr__ = __str__
7029
7030
7031 1
class AttributeOperand(FrozenClass):
7032
    '''
7033
    :ivar NodeId:
7034
    :vartype NodeId: NodeId
7035
    :ivar Alias:
7036
    :vartype Alias: String
7037
    :ivar BrowsePath:
7038
    :vartype BrowsePath: RelativePath
7039
    :ivar AttributeId:
7040
    :vartype AttributeId: UInt32
7041
    :ivar IndexRange:
7042
    :vartype IndexRange: String
7043
    '''
7044 1
    def __init__(self, binary=None):
7045
        if binary is not None:
7046
            self._binary_init(binary)
7047
            self._freeze = True
7048
            return
7049
        self.NodeId = NodeId()
7050
        self.Alias = ''
7051
        self.BrowsePath = RelativePath()
7052
        self.AttributeId = 0
7053
        self.IndexRange = ''
7054
        self._freeze = True
7055
7056 1
    def to_binary(self):
7057
        packet = []
7058
        packet.append(self.NodeId.to_binary())
7059
        packet.append(pack_string(self.Alias))
7060
        packet.append(self.BrowsePath.to_binary())
7061
        packet.append(uatype_UInt32.pack(self.AttributeId))
7062
        packet.append(pack_string(self.IndexRange))
7063
        return b''.join(packet)
7064
7065 1
    @staticmethod
7066
    def from_binary(data):
7067
        return AttributeOperand(data)
7068
7069 1
    def _binary_init(self, data):
7070
        self.NodeId = NodeId.from_binary(data)
7071
        self.Alias = unpack_string(data)
7072
        self.BrowsePath = RelativePath.from_binary(data)
7073
        self.AttributeId = uatype_UInt32.unpack(data.read(4))[0]
7074
        self.IndexRange = unpack_string(data)
7075
7076 1
    def __str__(self):
7077
        return 'AttributeOperand(' + 'NodeId:' + str(self.NodeId) + ', ' + \
7078
               'Alias:' + str(self.Alias) + ', ' + \
7079
               'BrowsePath:' + str(self.BrowsePath) + ', ' + \
7080
               'AttributeId:' + str(self.AttributeId) + ', ' + \
7081
               'IndexRange:' + str(self.IndexRange) + ')'
7082
7083 1
    __repr__ = __str__
7084
7085
7086 1
class SimpleAttributeOperand(FrozenClass):
7087
    '''
7088
    :ivar TypeDefinitionId:
7089
    :vartype TypeDefinitionId: NodeId
7090
    :ivar BrowsePath:
7091
    :vartype BrowsePath: QualifiedName
7092
    :ivar AttributeId:
7093
    :vartype AttributeId: UInt32
7094
    :ivar IndexRange:
7095
    :vartype IndexRange: String
7096
    '''
7097 1
    def __init__(self, binary=None):
7098 1
        if binary is not None:
7099 1
            self._binary_init(binary)
7100 1
            self._freeze = True
7101 1
            return
7102 1
        self.TypeDefinitionId = NodeId()
7103 1
        self.BrowsePath = []
7104 1
        self.AttributeId = 0
7105 1
        self.IndexRange = ''
7106 1
        self._freeze = True
7107
7108 1
    def to_binary(self):
7109 1
        packet = []
7110 1
        packet.append(self.TypeDefinitionId.to_binary())
7111 1
        packet.append(uatype_Int32.pack(len(self.BrowsePath)))
7112 1
        for fieldname in self.BrowsePath:
7113 1
            packet.append(fieldname.to_binary())
7114 1
        packet.append(uatype_UInt32.pack(self.AttributeId))
7115 1
        packet.append(pack_string(self.IndexRange))
7116 1
        return b''.join(packet)
7117
7118 1
    @staticmethod
7119
    def from_binary(data):
7120 1
        return SimpleAttributeOperand(data)
7121
7122 1
    def _binary_init(self, data):
7123 1
        self.TypeDefinitionId = NodeId.from_binary(data)
7124 1
        length = uatype_Int32.unpack(data.read(4))[0]
7125 1
        array = []
7126 1
        if length != -1:
7127 1
            for _ in range(0, length):
7128 1
                array.append(QualifiedName.from_binary(data))
7129 1
        self.BrowsePath = array
7130 1
        self.AttributeId = uatype_UInt32.unpack(data.read(4))[0]
7131 1
        self.IndexRange = unpack_string(data)
7132
7133 1
    def __str__(self):
7134
        return 'SimpleAttributeOperand(' + 'TypeDefinitionId:' + str(self.TypeDefinitionId) + ', ' + \
7135
               'BrowsePath:' + str(self.BrowsePath) + ', ' + \
7136
               'AttributeId:' + str(self.AttributeId) + ', ' + \
7137
               'IndexRange:' + str(self.IndexRange) + ')'
7138
7139 1
    __repr__ = __str__
7140
7141
7142 1 View Code Duplication
class ContentFilterElementResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7143
    '''
7144
    :ivar StatusCode:
7145
    :vartype StatusCode: StatusCode
7146
    :ivar OperandStatusCodes:
7147
    :vartype OperandStatusCodes: StatusCode
7148
    :ivar OperandDiagnosticInfos:
7149
    :vartype OperandDiagnosticInfos: DiagnosticInfo
7150
    '''
7151 1
    def __init__(self, binary=None):
7152
        if binary is not None:
7153
            self._binary_init(binary)
7154
            self._freeze = True
7155
            return
7156
        self.StatusCode = StatusCode()
7157
        self.OperandStatusCodes = []
7158
        self.OperandDiagnosticInfos = []
7159
        self._freeze = True
7160
7161 1
    def to_binary(self):
7162
        packet = []
7163
        packet.append(self.StatusCode.to_binary())
7164
        packet.append(uatype_Int32.pack(len(self.OperandStatusCodes)))
7165
        for fieldname in self.OperandStatusCodes:
7166
            packet.append(fieldname.to_binary())
7167
        packet.append(uatype_Int32.pack(len(self.OperandDiagnosticInfos)))
7168
        for fieldname in self.OperandDiagnosticInfos:
7169
            packet.append(fieldname.to_binary())
7170
        return b''.join(packet)
7171
7172 1
    @staticmethod
7173
    def from_binary(data):
7174
        return ContentFilterElementResult(data)
7175
7176 1
    def _binary_init(self, data):
7177
        self.StatusCode = StatusCode.from_binary(data)
7178
        length = uatype_Int32.unpack(data.read(4))[0]
7179
        array = []
7180
        if length != -1:
7181
            for _ in range(0, length):
7182
                array.append(StatusCode.from_binary(data))
7183
        self.OperandStatusCodes = array
7184
        length = uatype_Int32.unpack(data.read(4))[0]
7185
        array = []
7186
        if length != -1:
7187
            for _ in range(0, length):
7188
                array.append(DiagnosticInfo.from_binary(data))
7189
        self.OperandDiagnosticInfos = array
7190
7191 1
    def __str__(self):
7192
        return 'ContentFilterElementResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
7193
               'OperandStatusCodes:' + str(self.OperandStatusCodes) + ', ' + \
7194
               'OperandDiagnosticInfos:' + str(self.OperandDiagnosticInfos) + ')'
7195
7196 1
    __repr__ = __str__
7197
7198
7199 1 View Code Duplication
class ContentFilterResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7200
    '''
7201
    :ivar ElementResults:
7202
    :vartype ElementResults: ContentFilterElementResult
7203
    :ivar ElementDiagnosticInfos:
7204
    :vartype ElementDiagnosticInfos: DiagnosticInfo
7205
    '''
7206 1
    def __init__(self, binary=None):
7207 1
        if binary is not None:
7208 1
            self._binary_init(binary)
7209 1
            self._freeze = True
7210 1
            return
7211 1
        self.ElementResults = []
7212 1
        self.ElementDiagnosticInfos = []
7213 1
        self._freeze = True
7214
7215 1
    def to_binary(self):
7216 1
        packet = []
7217 1
        packet.append(uatype_Int32.pack(len(self.ElementResults)))
7218 1
        for fieldname in self.ElementResults:
7219
            packet.append(fieldname.to_binary())
7220 1
        packet.append(uatype_Int32.pack(len(self.ElementDiagnosticInfos)))
7221 1
        for fieldname in self.ElementDiagnosticInfos:
7222
            packet.append(fieldname.to_binary())
7223 1
        return b''.join(packet)
7224
7225 1
    @staticmethod
7226
    def from_binary(data):
7227 1
        return ContentFilterResult(data)
7228
7229 1
    def _binary_init(self, data):
7230 1
        length = uatype_Int32.unpack(data.read(4))[0]
7231 1
        array = []
7232 1
        if length != -1:
7233 1
            for _ in range(0, length):
7234
                array.append(ContentFilterElementResult.from_binary(data))
7235 1
        self.ElementResults = array
7236 1
        length = uatype_Int32.unpack(data.read(4))[0]
7237 1
        array = []
7238 1
        if length != -1:
7239 1
            for _ in range(0, length):
7240
                array.append(DiagnosticInfo.from_binary(data))
7241 1
        self.ElementDiagnosticInfos = array
7242
7243 1
    def __str__(self):
7244
        return 'ContentFilterResult(' + 'ElementResults:' + str(self.ElementResults) + ', ' + \
7245
               'ElementDiagnosticInfos:' + str(self.ElementDiagnosticInfos) + ')'
7246
7247 1
    __repr__ = __str__
7248
7249
7250 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...
7251
    '''
7252
    :ivar StatusCode:
7253
    :vartype StatusCode: StatusCode
7254
    :ivar DataStatusCodes:
7255
    :vartype DataStatusCodes: StatusCode
7256
    :ivar DataDiagnosticInfos:
7257
    :vartype DataDiagnosticInfos: DiagnosticInfo
7258
    '''
7259 1
    def __init__(self, binary=None):
7260
        if binary is not None:
7261
            self._binary_init(binary)
7262
            self._freeze = True
7263
            return
7264
        self.StatusCode = StatusCode()
7265
        self.DataStatusCodes = []
7266
        self.DataDiagnosticInfos = []
7267
        self._freeze = True
7268
7269 1
    def to_binary(self):
7270
        packet = []
7271
        packet.append(self.StatusCode.to_binary())
7272
        packet.append(uatype_Int32.pack(len(self.DataStatusCodes)))
7273
        for fieldname in self.DataStatusCodes:
7274
            packet.append(fieldname.to_binary())
7275
        packet.append(uatype_Int32.pack(len(self.DataDiagnosticInfos)))
7276
        for fieldname in self.DataDiagnosticInfos:
7277
            packet.append(fieldname.to_binary())
7278
        return b''.join(packet)
7279
7280 1
    @staticmethod
7281
    def from_binary(data):
7282
        return ParsingResult(data)
7283
7284 1
    def _binary_init(self, data):
7285
        self.StatusCode = StatusCode.from_binary(data)
7286
        length = uatype_Int32.unpack(data.read(4))[0]
7287
        array = []
7288
        if length != -1:
7289
            for _ in range(0, length):
7290
                array.append(StatusCode.from_binary(data))
7291
        self.DataStatusCodes = array
7292
        length = uatype_Int32.unpack(data.read(4))[0]
7293
        array = []
7294
        if length != -1:
7295
            for _ in range(0, length):
7296
                array.append(DiagnosticInfo.from_binary(data))
7297
        self.DataDiagnosticInfos = array
7298
7299 1
    def __str__(self):
7300
        return 'ParsingResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
7301
               'DataStatusCodes:' + str(self.DataStatusCodes) + ', ' + \
7302
               'DataDiagnosticInfos:' + str(self.DataDiagnosticInfos) + ')'
7303
7304 1
    __repr__ = __str__
7305
7306
7307 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...
7308
    '''
7309
    :ivar View:
7310
    :vartype View: ViewDescription
7311
    :ivar NodeTypes:
7312
    :vartype NodeTypes: NodeTypeDescription
7313
    :ivar Filter:
7314
    :vartype Filter: ContentFilter
7315
    :ivar MaxDataSetsToReturn:
7316
    :vartype MaxDataSetsToReturn: UInt32
7317
    :ivar MaxReferencesToReturn:
7318
    :vartype MaxReferencesToReturn: UInt32
7319
    '''
7320 1
    def __init__(self, binary=None):
7321
        if binary is not None:
7322
            self._binary_init(binary)
7323
            self._freeze = True
7324
            return
7325
        self.View = ViewDescription()
7326
        self.NodeTypes = []
7327
        self.Filter = ContentFilter()
7328
        self.MaxDataSetsToReturn = 0
7329
        self.MaxReferencesToReturn = 0
7330
        self._freeze = True
7331
7332 1
    def to_binary(self):
7333
        packet = []
7334
        packet.append(self.View.to_binary())
7335
        packet.append(uatype_Int32.pack(len(self.NodeTypes)))
7336
        for fieldname in self.NodeTypes:
7337
            packet.append(fieldname.to_binary())
7338
        packet.append(self.Filter.to_binary())
7339
        packet.append(uatype_UInt32.pack(self.MaxDataSetsToReturn))
7340
        packet.append(uatype_UInt32.pack(self.MaxReferencesToReturn))
7341
        return b''.join(packet)
7342
7343 1
    @staticmethod
7344
    def from_binary(data):
7345
        return QueryFirstParameters(data)
7346
7347 1
    def _binary_init(self, data):
7348
        self.View = ViewDescription.from_binary(data)
7349
        length = uatype_Int32.unpack(data.read(4))[0]
7350
        array = []
7351
        if length != -1:
7352
            for _ in range(0, length):
7353
                array.append(NodeTypeDescription.from_binary(data))
7354
        self.NodeTypes = array
7355
        self.Filter = ContentFilter.from_binary(data)
7356
        self.MaxDataSetsToReturn = uatype_UInt32.unpack(data.read(4))[0]
7357
        self.MaxReferencesToReturn = uatype_UInt32.unpack(data.read(4))[0]
7358
7359 1
    def __str__(self):
7360
        return 'QueryFirstParameters(' + 'View:' + str(self.View) + ', ' + \
7361
               'NodeTypes:' + str(self.NodeTypes) + ', ' + \
7362
               'Filter:' + str(self.Filter) + ', ' + \
7363
               'MaxDataSetsToReturn:' + str(self.MaxDataSetsToReturn) + ', ' + \
7364
               'MaxReferencesToReturn:' + str(self.MaxReferencesToReturn) + ')'
7365
7366 1
    __repr__ = __str__
7367
7368
7369 1 View Code Duplication
class QueryFirstRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7370
    '''
7371
    :ivar TypeId:
7372
    :vartype TypeId: NodeId
7373
    :ivar RequestHeader:
7374
    :vartype RequestHeader: RequestHeader
7375
    :ivar Parameters:
7376
    :vartype Parameters: QueryFirstParameters
7377
    '''
7378 1
    def __init__(self, binary=None):
7379
        if binary is not None:
7380
            self._binary_init(binary)
7381
            self._freeze = True
7382
            return
7383
        self.TypeId = FourByteNodeId(ObjectIds.QueryFirstRequest_Encoding_DefaultBinary)
7384
        self.RequestHeader = RequestHeader()
7385
        self.Parameters = QueryFirstParameters()
7386
        self._freeze = True
7387
7388 1
    def to_binary(self):
7389
        packet = []
7390
        packet.append(self.TypeId.to_binary())
7391
        packet.append(self.RequestHeader.to_binary())
7392
        packet.append(self.Parameters.to_binary())
7393
        return b''.join(packet)
7394
7395 1
    @staticmethod
7396
    def from_binary(data):
7397
        return QueryFirstRequest(data)
7398
7399 1
    def _binary_init(self, data):
7400
        self.TypeId = NodeId.from_binary(data)
7401
        self.RequestHeader = RequestHeader.from_binary(data)
7402
        self.Parameters = QueryFirstParameters.from_binary(data)
7403
7404 1
    def __str__(self):
7405
        return 'QueryFirstRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7406
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
7407
               'Parameters:' + str(self.Parameters) + ')'
7408
7409 1
    __repr__ = __str__
7410
7411
7412 1
class QueryFirstResult(FrozenClass):
7413
    '''
7414
    :ivar QueryDataSets:
7415
    :vartype QueryDataSets: QueryDataSet
7416
    :ivar ContinuationPoint:
7417
    :vartype ContinuationPoint: ByteString
7418
    :ivar ParsingResults:
7419
    :vartype ParsingResults: ParsingResult
7420
    :ivar DiagnosticInfos:
7421
    :vartype DiagnosticInfos: DiagnosticInfo
7422
    :ivar FilterResult:
7423
    :vartype FilterResult: ContentFilterResult
7424
    '''
7425 1
    def __init__(self, binary=None):
7426
        if binary is not None:
7427
            self._binary_init(binary)
7428
            self._freeze = True
7429
            return
7430
        self.QueryDataSets = []
7431
        self.ContinuationPoint = b''
7432
        self.ParsingResults = []
7433
        self.DiagnosticInfos = []
7434
        self.FilterResult = ContentFilterResult()
7435
        self._freeze = True
7436
7437 1
    def to_binary(self):
7438
        packet = []
7439
        packet.append(uatype_Int32.pack(len(self.QueryDataSets)))
7440
        for fieldname in self.QueryDataSets:
7441
            packet.append(fieldname.to_binary())
7442
        packet.append(pack_bytes(self.ContinuationPoint))
7443
        packet.append(uatype_Int32.pack(len(self.ParsingResults)))
7444
        for fieldname in self.ParsingResults:
7445
            packet.append(fieldname.to_binary())
7446
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
7447
        for fieldname in self.DiagnosticInfos:
7448
            packet.append(fieldname.to_binary())
7449
        packet.append(self.FilterResult.to_binary())
7450
        return b''.join(packet)
7451
7452 1
    @staticmethod
7453
    def from_binary(data):
7454
        return QueryFirstResult(data)
7455
7456 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...
7457
        length = uatype_Int32.unpack(data.read(4))[0]
7458
        array = []
7459
        if length != -1:
7460
            for _ in range(0, length):
7461
                array.append(QueryDataSet.from_binary(data))
7462
        self.QueryDataSets = array
7463
        self.ContinuationPoint = unpack_bytes(data)
7464
        length = uatype_Int32.unpack(data.read(4))[0]
7465
        array = []
7466
        if length != -1:
7467
            for _ in range(0, length):
7468
                array.append(ParsingResult.from_binary(data))
7469
        self.ParsingResults = array
7470
        length = uatype_Int32.unpack(data.read(4))[0]
7471
        array = []
7472
        if length != -1:
7473
            for _ in range(0, length):
7474
                array.append(DiagnosticInfo.from_binary(data))
7475
        self.DiagnosticInfos = array
7476
        self.FilterResult = ContentFilterResult.from_binary(data)
7477
7478 1
    def __str__(self):
7479
        return 'QueryFirstResult(' + 'QueryDataSets:' + str(self.QueryDataSets) + ', ' + \
7480
               'ContinuationPoint:' + str(self.ContinuationPoint) + ', ' + \
7481
               'ParsingResults:' + str(self.ParsingResults) + ', ' + \
7482
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ', ' + \
7483
               'FilterResult:' + str(self.FilterResult) + ')'
7484
7485 1
    __repr__ = __str__
7486
7487
7488 1 View Code Duplication
class QueryFirstResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7489
    '''
7490
    :ivar TypeId:
7491
    :vartype TypeId: NodeId
7492
    :ivar ResponseHeader:
7493
    :vartype ResponseHeader: ResponseHeader
7494
    :ivar Parameters:
7495
    :vartype Parameters: QueryFirstResult
7496
    '''
7497 1
    def __init__(self, binary=None):
7498
        if binary is not None:
7499
            self._binary_init(binary)
7500
            self._freeze = True
7501
            return
7502
        self.TypeId = FourByteNodeId(ObjectIds.QueryFirstResponse_Encoding_DefaultBinary)
7503
        self.ResponseHeader = ResponseHeader()
7504
        self.Parameters = QueryFirstResult()
7505
        self._freeze = True
7506
7507 1
    def to_binary(self):
7508
        packet = []
7509
        packet.append(self.TypeId.to_binary())
7510
        packet.append(self.ResponseHeader.to_binary())
7511
        packet.append(self.Parameters.to_binary())
7512
        return b''.join(packet)
7513
7514 1
    @staticmethod
7515
    def from_binary(data):
7516
        return QueryFirstResponse(data)
7517
7518 1
    def _binary_init(self, data):
7519
        self.TypeId = NodeId.from_binary(data)
7520
        self.ResponseHeader = ResponseHeader.from_binary(data)
7521
        self.Parameters = QueryFirstResult.from_binary(data)
7522
7523 1
    def __str__(self):
7524
        return 'QueryFirstResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7525
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
7526
               'Parameters:' + str(self.Parameters) + ')'
7527
7528 1
    __repr__ = __str__
7529
7530
7531 1
class QueryNextParameters(FrozenClass):
7532
    '''
7533
    :ivar ReleaseContinuationPoint:
7534
    :vartype ReleaseContinuationPoint: Boolean
7535
    :ivar ContinuationPoint:
7536
    :vartype ContinuationPoint: ByteString
7537
    '''
7538 1
    def __init__(self, binary=None):
7539
        if binary is not None:
7540
            self._binary_init(binary)
7541
            self._freeze = True
7542
            return
7543
        self.ReleaseContinuationPoint = True
7544
        self.ContinuationPoint = b''
7545
        self._freeze = True
7546
7547 1
    def to_binary(self):
7548
        packet = []
7549
        packet.append(uatype_Boolean.pack(self.ReleaseContinuationPoint))
7550
        packet.append(pack_bytes(self.ContinuationPoint))
7551
        return b''.join(packet)
7552
7553 1
    @staticmethod
7554
    def from_binary(data):
7555
        return QueryNextParameters(data)
7556
7557 1
    def _binary_init(self, data):
7558
        self.ReleaseContinuationPoint = uatype_Boolean.unpack(data.read(1))[0]
7559
        self.ContinuationPoint = unpack_bytes(data)
7560
7561 1
    def __str__(self):
7562
        return 'QueryNextParameters(' + 'ReleaseContinuationPoint:' + str(self.ReleaseContinuationPoint) + ', ' + \
7563
               'ContinuationPoint:' + str(self.ContinuationPoint) + ')'
7564
7565 1
    __repr__ = __str__
7566
7567
7568 1 View Code Duplication
class QueryNextRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7569
    '''
7570
    :ivar TypeId:
7571
    :vartype TypeId: NodeId
7572
    :ivar RequestHeader:
7573
    :vartype RequestHeader: RequestHeader
7574
    :ivar Parameters:
7575
    :vartype Parameters: QueryNextParameters
7576
    '''
7577 1
    def __init__(self, binary=None):
7578
        if binary is not None:
7579
            self._binary_init(binary)
7580
            self._freeze = True
7581
            return
7582
        self.TypeId = FourByteNodeId(ObjectIds.QueryNextRequest_Encoding_DefaultBinary)
7583
        self.RequestHeader = RequestHeader()
7584
        self.Parameters = QueryNextParameters()
7585
        self._freeze = True
7586
7587 1
    def to_binary(self):
7588
        packet = []
7589
        packet.append(self.TypeId.to_binary())
7590
        packet.append(self.RequestHeader.to_binary())
7591
        packet.append(self.Parameters.to_binary())
7592
        return b''.join(packet)
7593
7594 1
    @staticmethod
7595
    def from_binary(data):
7596
        return QueryNextRequest(data)
7597
7598 1
    def _binary_init(self, data):
7599
        self.TypeId = NodeId.from_binary(data)
7600
        self.RequestHeader = RequestHeader.from_binary(data)
7601
        self.Parameters = QueryNextParameters.from_binary(data)
7602
7603 1
    def __str__(self):
7604
        return 'QueryNextRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7605
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
7606
               'Parameters:' + str(self.Parameters) + ')'
7607
7608 1
    __repr__ = __str__
7609
7610
7611 1
class QueryNextResult(FrozenClass):
7612
    '''
7613
    :ivar QueryDataSets:
7614
    :vartype QueryDataSets: QueryDataSet
7615
    :ivar RevisedContinuationPoint:
7616
    :vartype RevisedContinuationPoint: ByteString
7617
    '''
7618 1
    def __init__(self, binary=None):
7619
        if binary is not None:
7620
            self._binary_init(binary)
7621
            self._freeze = True
7622
            return
7623
        self.QueryDataSets = []
7624
        self.RevisedContinuationPoint = b''
7625
        self._freeze = True
7626
7627 1
    def to_binary(self):
7628
        packet = []
7629
        packet.append(uatype_Int32.pack(len(self.QueryDataSets)))
7630
        for fieldname in self.QueryDataSets:
7631
            packet.append(fieldname.to_binary())
7632
        packet.append(pack_bytes(self.RevisedContinuationPoint))
7633
        return b''.join(packet)
7634
7635 1
    @staticmethod
7636
    def from_binary(data):
7637
        return QueryNextResult(data)
7638
7639 1
    def _binary_init(self, data):
7640
        length = uatype_Int32.unpack(data.read(4))[0]
7641
        array = []
7642
        if length != -1:
7643
            for _ in range(0, length):
7644
                array.append(QueryDataSet.from_binary(data))
7645
        self.QueryDataSets = array
7646
        self.RevisedContinuationPoint = unpack_bytes(data)
7647
7648 1
    def __str__(self):
7649
        return 'QueryNextResult(' + 'QueryDataSets:' + str(self.QueryDataSets) + ', ' + \
7650
               'RevisedContinuationPoint:' + str(self.RevisedContinuationPoint) + ')'
7651
7652 1
    __repr__ = __str__
7653
7654
7655 1 View Code Duplication
class QueryNextResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7656
    '''
7657
    :ivar TypeId:
7658
    :vartype TypeId: NodeId
7659
    :ivar ResponseHeader:
7660
    :vartype ResponseHeader: ResponseHeader
7661
    :ivar Parameters:
7662
    :vartype Parameters: QueryNextResult
7663
    '''
7664 1
    def __init__(self, binary=None):
7665
        if binary is not None:
7666
            self._binary_init(binary)
7667
            self._freeze = True
7668
            return
7669
        self.TypeId = FourByteNodeId(ObjectIds.QueryNextResponse_Encoding_DefaultBinary)
7670
        self.ResponseHeader = ResponseHeader()
7671
        self.Parameters = QueryNextResult()
7672
        self._freeze = True
7673
7674 1
    def to_binary(self):
7675
        packet = []
7676
        packet.append(self.TypeId.to_binary())
7677
        packet.append(self.ResponseHeader.to_binary())
7678
        packet.append(self.Parameters.to_binary())
7679
        return b''.join(packet)
7680
7681 1
    @staticmethod
7682
    def from_binary(data):
7683
        return QueryNextResponse(data)
7684
7685 1
    def _binary_init(self, data):
7686
        self.TypeId = NodeId.from_binary(data)
7687
        self.ResponseHeader = ResponseHeader.from_binary(data)
7688
        self.Parameters = QueryNextResult.from_binary(data)
7689
7690 1
    def __str__(self):
7691
        return 'QueryNextResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7692
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
7693
               'Parameters:' + str(self.Parameters) + ')'
7694
7695 1
    __repr__ = __str__
7696
7697
7698 1
class ReadValueId(FrozenClass):
7699
    '''
7700
    :ivar NodeId:
7701
    :vartype NodeId: NodeId
7702
    :ivar AttributeId:
7703
    :vartype AttributeId: UInt32
7704
    :ivar IndexRange:
7705
    :vartype IndexRange: String
7706
    :ivar DataEncoding:
7707
    :vartype DataEncoding: QualifiedName
7708
    '''
7709 1
    def __init__(self, binary=None):
7710 1
        if binary is not None:
7711 1
            self._binary_init(binary)
7712 1
            self._freeze = True
7713 1
            return
7714 1
        self.NodeId = NodeId()
7715 1
        self.AttributeId = 0
7716 1
        self.IndexRange = ''
7717 1
        self.DataEncoding = QualifiedName()
7718 1
        self._freeze = True
7719
7720 1
    def to_binary(self):
7721 1
        packet = []
7722 1
        packet.append(self.NodeId.to_binary())
7723 1
        packet.append(uatype_UInt32.pack(self.AttributeId))
7724 1
        packet.append(pack_string(self.IndexRange))
7725 1
        packet.append(self.DataEncoding.to_binary())
7726 1
        return b''.join(packet)
7727
7728 1
    @staticmethod
7729
    def from_binary(data):
7730 1
        return ReadValueId(data)
7731
7732 1
    def _binary_init(self, data):
7733 1
        self.NodeId = NodeId.from_binary(data)
7734 1
        self.AttributeId = uatype_UInt32.unpack(data.read(4))[0]
7735 1
        self.IndexRange = unpack_string(data)
7736 1
        self.DataEncoding = QualifiedName.from_binary(data)
7737
7738 1
    def __str__(self):
7739
        return 'ReadValueId(' + 'NodeId:' + str(self.NodeId) + ', ' + \
7740
               'AttributeId:' + str(self.AttributeId) + ', ' + \
7741
               'IndexRange:' + str(self.IndexRange) + ', ' + \
7742
               'DataEncoding:' + str(self.DataEncoding) + ')'
7743
7744 1
    __repr__ = __str__
7745
7746
7747 1
class ReadParameters(FrozenClass):
7748
    '''
7749
    :ivar MaxAge:
7750
    :vartype MaxAge: Double
7751
    :ivar TimestampsToReturn:
7752
    :vartype TimestampsToReturn: TimestampsToReturn
7753
    :ivar NodesToRead:
7754
    :vartype NodesToRead: ReadValueId
7755
    '''
7756 1
    def __init__(self, binary=None):
7757 1
        if binary is not None:
7758 1
            self._binary_init(binary)
7759 1
            self._freeze = True
7760 1
            return
7761 1
        self.MaxAge = 0
7762 1
        self.TimestampsToReturn = TimestampsToReturn(0)
7763 1
        self.NodesToRead = []
7764 1
        self._freeze = True
7765
7766 1
    def to_binary(self):
7767 1
        packet = []
7768 1
        packet.append(uatype_Double.pack(self.MaxAge))
7769 1
        packet.append(uatype_UInt32.pack(self.TimestampsToReturn.value))
7770 1
        packet.append(uatype_Int32.pack(len(self.NodesToRead)))
7771 1
        for fieldname in self.NodesToRead:
7772 1
            packet.append(fieldname.to_binary())
7773 1
        return b''.join(packet)
7774
7775 1
    @staticmethod
7776
    def from_binary(data):
7777 1
        return ReadParameters(data)
7778
7779 1
    def _binary_init(self, data):
7780 1
        self.MaxAge = uatype_Double.unpack(data.read(8))[0]
7781 1
        self.TimestampsToReturn = TimestampsToReturn(uatype_UInt32.unpack(data.read(4))[0])
7782 1
        length = uatype_Int32.unpack(data.read(4))[0]
7783 1
        array = []
7784 1
        if length != -1:
7785 1
            for _ in range(0, length):
7786 1
                array.append(ReadValueId.from_binary(data))
7787 1
        self.NodesToRead = array
7788
7789 1
    def __str__(self):
7790
        return 'ReadParameters(' + 'MaxAge:' + str(self.MaxAge) + ', ' + \
7791
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
7792
               'NodesToRead:' + str(self.NodesToRead) + ')'
7793
7794 1
    __repr__ = __str__
7795
7796
7797 1 View Code Duplication
class ReadRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7798
    '''
7799
    :ivar TypeId:
7800
    :vartype TypeId: NodeId
7801
    :ivar RequestHeader:
7802
    :vartype RequestHeader: RequestHeader
7803
    :ivar Parameters:
7804
    :vartype Parameters: ReadParameters
7805
    '''
7806 1
    def __init__(self, binary=None):
7807 1
        if binary is not None:
7808
            self._binary_init(binary)
7809
            self._freeze = True
7810
            return
7811 1
        self.TypeId = FourByteNodeId(ObjectIds.ReadRequest_Encoding_DefaultBinary)
7812 1
        self.RequestHeader = RequestHeader()
7813 1
        self.Parameters = ReadParameters()
7814 1
        self._freeze = True
7815
7816 1
    def to_binary(self):
7817 1
        packet = []
7818 1
        packet.append(self.TypeId.to_binary())
7819 1
        packet.append(self.RequestHeader.to_binary())
7820 1
        packet.append(self.Parameters.to_binary())
7821 1
        return b''.join(packet)
7822
7823 1
    @staticmethod
7824
    def from_binary(data):
7825
        return ReadRequest(data)
7826
7827 1
    def _binary_init(self, data):
7828
        self.TypeId = NodeId.from_binary(data)
7829
        self.RequestHeader = RequestHeader.from_binary(data)
7830
        self.Parameters = ReadParameters.from_binary(data)
7831
7832 1
    def __str__(self):
7833
        return 'ReadRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7834
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
7835
               'Parameters:' + str(self.Parameters) + ')'
7836
7837 1
    __repr__ = __str__
7838
7839
7840 1 View Code Duplication
class ReadResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7841
    '''
7842
    :ivar TypeId:
7843
    :vartype TypeId: NodeId
7844
    :ivar ResponseHeader:
7845
    :vartype ResponseHeader: ResponseHeader
7846
    :ivar Results:
7847
    :vartype Results: DataValue
7848
    :ivar DiagnosticInfos:
7849
    :vartype DiagnosticInfos: DiagnosticInfo
7850
    '''
7851 1
    def __init__(self, binary=None):
7852 1
        if binary is not None:
7853 1
            self._binary_init(binary)
7854 1
            self._freeze = True
7855 1
            return
7856 1
        self.TypeId = FourByteNodeId(ObjectIds.ReadResponse_Encoding_DefaultBinary)
7857 1
        self.ResponseHeader = ResponseHeader()
7858 1
        self.Results = []
7859 1
        self.DiagnosticInfos = []
7860 1
        self._freeze = True
7861
7862 1
    def to_binary(self):
7863 1
        packet = []
7864 1
        packet.append(self.TypeId.to_binary())
7865 1
        packet.append(self.ResponseHeader.to_binary())
7866 1
        packet.append(uatype_Int32.pack(len(self.Results)))
7867 1
        for fieldname in self.Results:
7868 1
            packet.append(fieldname.to_binary())
7869 1
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
7870 1
        for fieldname in self.DiagnosticInfos:
7871
            packet.append(fieldname.to_binary())
7872 1
        return b''.join(packet)
7873
7874 1
    @staticmethod
7875
    def from_binary(data):
7876 1
        return ReadResponse(data)
7877
7878 1
    def _binary_init(self, data):
7879 1
        self.TypeId = NodeId.from_binary(data)
7880 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
7881 1
        length = uatype_Int32.unpack(data.read(4))[0]
7882 1
        array = []
7883 1
        if length != -1:
7884 1
            for _ in range(0, length):
7885 1
                array.append(DataValue.from_binary(data))
7886 1
        self.Results = array
7887 1
        length = uatype_Int32.unpack(data.read(4))[0]
7888 1
        array = []
7889 1
        if length != -1:
7890 1
            for _ in range(0, length):
7891
                array.append(DiagnosticInfo.from_binary(data))
7892 1
        self.DiagnosticInfos = array
7893
7894 1
    def __str__(self):
7895
        return 'ReadResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7896
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
7897
               'Results:' + str(self.Results) + ', ' + \
7898
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
7899
7900 1
    __repr__ = __str__
7901
7902
7903 1 View Code Duplication
class HistoryReadValueId(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7904
    '''
7905
    :ivar NodeId:
7906
    :vartype NodeId: NodeId
7907
    :ivar IndexRange:
7908
    :vartype IndexRange: String
7909
    :ivar DataEncoding:
7910
    :vartype DataEncoding: QualifiedName
7911
    :ivar ContinuationPoint:
7912
    :vartype ContinuationPoint: ByteString
7913
    '''
7914 1
    def __init__(self, binary=None):
7915 1
        if binary is not None:
7916
            self._binary_init(binary)
7917
            self._freeze = True
7918
            return
7919 1
        self.NodeId = NodeId()
7920 1
        self.IndexRange = ''
7921 1
        self.DataEncoding = QualifiedName()
7922 1
        self.ContinuationPoint = b''
7923 1
        self._freeze = True
7924
7925 1
    def to_binary(self):
7926
        packet = []
7927
        packet.append(self.NodeId.to_binary())
7928
        packet.append(pack_string(self.IndexRange))
7929
        packet.append(self.DataEncoding.to_binary())
7930
        packet.append(pack_bytes(self.ContinuationPoint))
7931
        return b''.join(packet)
7932
7933 1
    @staticmethod
7934
    def from_binary(data):
7935
        return HistoryReadValueId(data)
7936
7937 1
    def _binary_init(self, data):
7938
        self.NodeId = NodeId.from_binary(data)
7939
        self.IndexRange = unpack_string(data)
7940
        self.DataEncoding = QualifiedName.from_binary(data)
7941
        self.ContinuationPoint = unpack_bytes(data)
7942
7943 1
    def __str__(self):
7944
        return 'HistoryReadValueId(' + 'NodeId:' + str(self.NodeId) + ', ' + \
7945
               'IndexRange:' + str(self.IndexRange) + ', ' + \
7946
               'DataEncoding:' + str(self.DataEncoding) + ', ' + \
7947
               'ContinuationPoint:' + str(self.ContinuationPoint) + ')'
7948
7949 1
    __repr__ = __str__
7950
7951
7952 1 View Code Duplication
class HistoryReadResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7953
    '''
7954
    :ivar StatusCode:
7955
    :vartype StatusCode: StatusCode
7956
    :ivar ContinuationPoint:
7957
    :vartype ContinuationPoint: ByteString
7958
    :ivar HistoryData:
7959
    :vartype HistoryData: ExtensionObject
7960
    '''
7961 1
    def __init__(self, binary=None):
7962 1
        if binary is not None:
7963
            self._binary_init(binary)
7964
            self._freeze = True
7965
            return
7966 1
        self.StatusCode = StatusCode()
7967 1
        self.ContinuationPoint = b''
7968 1
        self.HistoryData = None
7969 1
        self._freeze = True
7970
7971 1
    def to_binary(self):
7972
        packet = []
7973
        packet.append(self.StatusCode.to_binary())
7974
        packet.append(pack_bytes(self.ContinuationPoint))
7975
        packet.append(extensionobject_to_binary(self.HistoryData))
7976
        return b''.join(packet)
7977
7978 1
    @staticmethod
7979
    def from_binary(data):
7980
        return HistoryReadResult(data)
7981
7982 1
    def _binary_init(self, data):
7983
        self.StatusCode = StatusCode.from_binary(data)
7984
        self.ContinuationPoint = unpack_bytes(data)
7985
        self.HistoryData = extensionobject_from_binary(data)
7986
7987 1
    def __str__(self):
7988
        return 'HistoryReadResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
7989
               'ContinuationPoint:' + str(self.ContinuationPoint) + ', ' + \
7990
               'HistoryData:' + str(self.HistoryData) + ')'
7991
7992 1
    __repr__ = __str__
7993
7994
7995 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...
7996
    '''
7997
    '''
7998 1
    def __init__(self, binary=None):
7999
        if binary is not None:
8000
            self._binary_init(binary)
8001
            self._freeze = True
8002
            return
8003
        self._freeze = True
8004
8005 1
    def to_binary(self):
8006
        packet = []
8007
        return b''.join(packet)
8008
8009 1
    @staticmethod
8010
    def from_binary(data):
8011
        return HistoryReadDetails(data)
8012
8013 1
    def _binary_init(self, data):
8014
        pass
8015
8016 1
    def __str__(self):
8017
        return 'HistoryReadDetails(' +  + ')'
8018
8019 1
    __repr__ = __str__
8020
8021
8022 1 View Code Duplication
class ReadEventDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8023
    '''
8024
    :ivar NumValuesPerNode:
8025
    :vartype NumValuesPerNode: UInt32
8026
    :ivar StartTime:
8027
    :vartype StartTime: DateTime
8028
    :ivar EndTime:
8029
    :vartype EndTime: DateTime
8030
    :ivar Filter:
8031
    :vartype Filter: EventFilter
8032
    '''
8033 1
    def __init__(self, binary=None):
8034 1
        if binary is not None:
8035
            self._binary_init(binary)
8036
            self._freeze = True
8037
            return
8038 1
        self.NumValuesPerNode = 0
8039 1
        self.StartTime = datetime.now()
8040 1
        self.EndTime = datetime.now()
8041 1
        self.Filter = EventFilter()
8042 1
        self._freeze = True
8043
8044 1
    def to_binary(self):
8045
        packet = []
8046
        packet.append(uatype_UInt32.pack(self.NumValuesPerNode))
8047
        packet.append(pack_datetime(self.StartTime))
8048
        packet.append(pack_datetime(self.EndTime))
8049
        packet.append(self.Filter.to_binary())
8050
        return b''.join(packet)
8051
8052 1
    @staticmethod
8053
    def from_binary(data):
8054
        return ReadEventDetails(data)
8055
8056 1
    def _binary_init(self, data):
8057
        self.NumValuesPerNode = uatype_UInt32.unpack(data.read(4))[0]
8058
        self.StartTime = unpack_datetime(data)
8059
        self.EndTime = unpack_datetime(data)
8060
        self.Filter = EventFilter.from_binary(data)
8061
8062 1
    def __str__(self):
8063
        return 'ReadEventDetails(' + 'NumValuesPerNode:' + str(self.NumValuesPerNode) + ', ' + \
8064
               'StartTime:' + str(self.StartTime) + ', ' + \
8065
               'EndTime:' + str(self.EndTime) + ', ' + \
8066
               'Filter:' + str(self.Filter) + ')'
8067
8068 1
    __repr__ = __str__
8069
8070
8071 1
class ReadRawModifiedDetails(FrozenClass):
8072
    '''
8073
    :ivar IsReadModified:
8074
    :vartype IsReadModified: Boolean
8075
    :ivar StartTime:
8076
    :vartype StartTime: DateTime
8077
    :ivar EndTime:
8078
    :vartype EndTime: DateTime
8079
    :ivar NumValuesPerNode:
8080
    :vartype NumValuesPerNode: UInt32
8081
    :ivar ReturnBounds:
8082
    :vartype ReturnBounds: Boolean
8083
    '''
8084 1
    def __init__(self, binary=None):
8085 1
        if binary is not None:
8086
            self._binary_init(binary)
8087
            self._freeze = True
8088
            return
8089 1
        self.IsReadModified = True
8090 1
        self.StartTime = datetime.now()
8091 1
        self.EndTime = datetime.now()
8092 1
        self.NumValuesPerNode = 0
8093 1
        self.ReturnBounds = True
8094 1
        self._freeze = True
8095
8096 1
    def to_binary(self):
8097
        packet = []
8098
        packet.append(uatype_Boolean.pack(self.IsReadModified))
8099
        packet.append(pack_datetime(self.StartTime))
8100
        packet.append(pack_datetime(self.EndTime))
8101
        packet.append(uatype_UInt32.pack(self.NumValuesPerNode))
8102
        packet.append(uatype_Boolean.pack(self.ReturnBounds))
8103
        return b''.join(packet)
8104
8105 1
    @staticmethod
8106
    def from_binary(data):
8107
        return ReadRawModifiedDetails(data)
8108
8109 1
    def _binary_init(self, data):
8110
        self.IsReadModified = uatype_Boolean.unpack(data.read(1))[0]
8111
        self.StartTime = unpack_datetime(data)
8112
        self.EndTime = unpack_datetime(data)
8113
        self.NumValuesPerNode = uatype_UInt32.unpack(data.read(4))[0]
8114
        self.ReturnBounds = uatype_Boolean.unpack(data.read(1))[0]
8115
8116 1
    def __str__(self):
8117
        return 'ReadRawModifiedDetails(' + 'IsReadModified:' + str(self.IsReadModified) + ', ' + \
8118
               'StartTime:' + str(self.StartTime) + ', ' + \
8119
               'EndTime:' + str(self.EndTime) + ', ' + \
8120
               'NumValuesPerNode:' + str(self.NumValuesPerNode) + ', ' + \
8121
               'ReturnBounds:' + str(self.ReturnBounds) + ')'
8122
8123 1
    __repr__ = __str__
8124
8125
8126 1 View Code Duplication
class ReadProcessedDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8127
    '''
8128
    :ivar StartTime:
8129
    :vartype StartTime: DateTime
8130
    :ivar EndTime:
8131
    :vartype EndTime: DateTime
8132
    :ivar ProcessingInterval:
8133
    :vartype ProcessingInterval: Double
8134
    :ivar AggregateType:
8135
    :vartype AggregateType: NodeId
8136
    :ivar AggregateConfiguration:
8137
    :vartype AggregateConfiguration: AggregateConfiguration
8138
    '''
8139 1
    def __init__(self, binary=None):
8140
        if binary is not None:
8141
            self._binary_init(binary)
8142
            self._freeze = True
8143
            return
8144
        self.StartTime = datetime.now()
8145
        self.EndTime = datetime.now()
8146
        self.ProcessingInterval = 0
8147
        self.AggregateType = []
8148
        self.AggregateConfiguration = AggregateConfiguration()
8149
        self._freeze = True
8150
8151 1
    def to_binary(self):
8152
        packet = []
8153
        packet.append(pack_datetime(self.StartTime))
8154
        packet.append(pack_datetime(self.EndTime))
8155
        packet.append(uatype_Double.pack(self.ProcessingInterval))
8156
        packet.append(uatype_Int32.pack(len(self.AggregateType)))
8157
        for fieldname in self.AggregateType:
8158
            packet.append(fieldname.to_binary())
8159
        packet.append(self.AggregateConfiguration.to_binary())
8160
        return b''.join(packet)
8161
8162 1
    @staticmethod
8163
    def from_binary(data):
8164
        return ReadProcessedDetails(data)
8165
8166 1
    def _binary_init(self, data):
8167
        self.StartTime = unpack_datetime(data)
8168
        self.EndTime = unpack_datetime(data)
8169
        self.ProcessingInterval = uatype_Double.unpack(data.read(8))[0]
8170
        length = uatype_Int32.unpack(data.read(4))[0]
8171
        array = []
8172
        if length != -1:
8173
            for _ in range(0, length):
8174
                array.append(NodeId.from_binary(data))
8175
        self.AggregateType = array
8176
        self.AggregateConfiguration = AggregateConfiguration.from_binary(data)
8177
8178 1
    def __str__(self):
8179
        return 'ReadProcessedDetails(' + 'StartTime:' + str(self.StartTime) + ', ' + \
8180
               'EndTime:' + str(self.EndTime) + ', ' + \
8181
               'ProcessingInterval:' + str(self.ProcessingInterval) + ', ' + \
8182
               'AggregateType:' + str(self.AggregateType) + ', ' + \
8183
               'AggregateConfiguration:' + str(self.AggregateConfiguration) + ')'
8184
8185 1
    __repr__ = __str__
8186
8187
8188 1
class ReadAtTimeDetails(FrozenClass):
8189
    '''
8190
    :ivar ReqTimes:
8191
    :vartype ReqTimes: DateTime
8192
    :ivar UseSimpleBounds:
8193
    :vartype UseSimpleBounds: Boolean
8194
    '''
8195 1
    def __init__(self, binary=None):
8196
        if binary is not None:
8197
            self._binary_init(binary)
8198
            self._freeze = True
8199
            return
8200
        self.ReqTimes = []
8201
        self.UseSimpleBounds = True
8202
        self._freeze = True
8203
8204 1
    def to_binary(self):
8205
        packet = []
8206
        packet.append(uatype_Int32.pack(len(self.ReqTimes)))
8207
        for fieldname in self.ReqTimes:
8208
            packet.append(pack_datetime(fieldname))
8209
        packet.append(uatype_Boolean.pack(self.UseSimpleBounds))
8210
        return b''.join(packet)
8211
8212 1
    @staticmethod
8213
    def from_binary(data):
8214
        return ReadAtTimeDetails(data)
8215
8216 1
    def _binary_init(self, data):
8217
        self.ReqTimes = unpack_uatype_array('DateTime', data)
8218
        self.UseSimpleBounds = uatype_Boolean.unpack(data.read(1))[0]
8219
8220 1
    def __str__(self):
8221
        return 'ReadAtTimeDetails(' + 'ReqTimes:' + str(self.ReqTimes) + ', ' + \
8222
               'UseSimpleBounds:' + str(self.UseSimpleBounds) + ')'
8223
8224 1
    __repr__ = __str__
8225
8226
8227 1 View Code Duplication
class HistoryData(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8228
    '''
8229
    :ivar DataValues:
8230
    :vartype DataValues: DataValue
8231
    '''
8232 1
    def __init__(self, binary=None):
8233 1
        if binary is not None:
8234
            self._binary_init(binary)
8235
            self._freeze = True
8236
            return
8237 1
        self.DataValues = []
8238 1
        self._freeze = True
8239
8240 1
    def to_binary(self):
8241
        packet = []
8242
        packet.append(uatype_Int32.pack(len(self.DataValues)))
8243
        for fieldname in self.DataValues:
8244
            packet.append(fieldname.to_binary())
8245
        return b''.join(packet)
8246
8247 1
    @staticmethod
8248
    def from_binary(data):
8249
        return HistoryData(data)
8250
8251 1
    def _binary_init(self, data):
8252
        length = uatype_Int32.unpack(data.read(4))[0]
8253
        array = []
8254
        if length != -1:
8255
            for _ in range(0, length):
8256
                array.append(DataValue.from_binary(data))
8257
        self.DataValues = array
8258
8259 1
    def __str__(self):
8260
        return 'HistoryData(' + 'DataValues:' + str(self.DataValues) + ')'
8261
8262 1
    __repr__ = __str__
8263
8264
8265 1 View Code Duplication
class ModificationInfo(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8266
    '''
8267
    :ivar ModificationTime:
8268
    :vartype ModificationTime: DateTime
8269
    :ivar UpdateType:
8270
    :vartype UpdateType: HistoryUpdateType
8271
    :ivar UserName:
8272
    :vartype UserName: String
8273
    '''
8274 1
    def __init__(self, binary=None):
8275
        if binary is not None:
8276
            self._binary_init(binary)
8277
            self._freeze = True
8278
            return
8279
        self.ModificationTime = datetime.now()
8280
        self.UpdateType = HistoryUpdateType(0)
8281
        self.UserName = ''
8282
        self._freeze = True
8283
8284 1
    def to_binary(self):
8285
        packet = []
8286
        packet.append(pack_datetime(self.ModificationTime))
8287
        packet.append(uatype_UInt32.pack(self.UpdateType.value))
8288
        packet.append(pack_string(self.UserName))
8289
        return b''.join(packet)
8290
8291 1
    @staticmethod
8292
    def from_binary(data):
8293
        return ModificationInfo(data)
8294
8295 1
    def _binary_init(self, data):
8296
        self.ModificationTime = unpack_datetime(data)
8297
        self.UpdateType = HistoryUpdateType(uatype_UInt32.unpack(data.read(4))[0])
8298
        self.UserName = unpack_string(data)
8299
8300 1
    def __str__(self):
8301
        return 'ModificationInfo(' + 'ModificationTime:' + str(self.ModificationTime) + ', ' + \
8302
               'UpdateType:' + str(self.UpdateType) + ', ' + \
8303
               'UserName:' + str(self.UserName) + ')'
8304
8305 1
    __repr__ = __str__
8306
8307
8308 1 View Code Duplication
class HistoryModifiedData(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8309
    '''
8310
    :ivar DataValues:
8311
    :vartype DataValues: DataValue
8312
    :ivar ModificationInfos:
8313
    :vartype ModificationInfos: ModificationInfo
8314
    '''
8315 1
    def __init__(self, binary=None):
8316
        if binary is not None:
8317
            self._binary_init(binary)
8318
            self._freeze = True
8319
            return
8320
        self.DataValues = []
8321
        self.ModificationInfos = []
8322
        self._freeze = True
8323
8324 1
    def to_binary(self):
8325
        packet = []
8326
        packet.append(uatype_Int32.pack(len(self.DataValues)))
8327
        for fieldname in self.DataValues:
8328
            packet.append(fieldname.to_binary())
8329
        packet.append(uatype_Int32.pack(len(self.ModificationInfos)))
8330
        for fieldname in self.ModificationInfos:
8331
            packet.append(fieldname.to_binary())
8332
        return b''.join(packet)
8333
8334 1
    @staticmethod
8335
    def from_binary(data):
8336
        return HistoryModifiedData(data)
8337
8338 1
    def _binary_init(self, data):
8339
        length = uatype_Int32.unpack(data.read(4))[0]
8340
        array = []
8341
        if length != -1:
8342
            for _ in range(0, length):
8343
                array.append(DataValue.from_binary(data))
8344
        self.DataValues = array
8345
        length = uatype_Int32.unpack(data.read(4))[0]
8346
        array = []
8347
        if length != -1:
8348
            for _ in range(0, length):
8349
                array.append(ModificationInfo.from_binary(data))
8350
        self.ModificationInfos = array
8351
8352 1
    def __str__(self):
8353
        return 'HistoryModifiedData(' + 'DataValues:' + str(self.DataValues) + ', ' + \
8354
               'ModificationInfos:' + str(self.ModificationInfos) + ')'
8355
8356 1
    __repr__ = __str__
8357
8358
8359 1 View Code Duplication
class HistoryEvent(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8360
    '''
8361
    :ivar Events:
8362
    :vartype Events: HistoryEventFieldList
8363
    '''
8364 1
    def __init__(self, binary=None):
8365 1
        if binary is not None:
8366
            self._binary_init(binary)
8367
            self._freeze = True
8368
            return
8369 1
        self.Events = []
8370 1
        self._freeze = True
8371
8372 1
    def to_binary(self):
8373
        packet = []
8374
        packet.append(uatype_Int32.pack(len(self.Events)))
8375
        for fieldname in self.Events:
8376
            packet.append(fieldname.to_binary())
8377
        return b''.join(packet)
8378
8379 1
    @staticmethod
8380
    def from_binary(data):
8381
        return HistoryEvent(data)
8382
8383 1
    def _binary_init(self, data):
8384
        length = uatype_Int32.unpack(data.read(4))[0]
8385
        array = []
8386
        if length != -1:
8387
            for _ in range(0, length):
8388
                array.append(HistoryEventFieldList.from_binary(data))
8389
        self.Events = array
8390
8391 1
    def __str__(self):
8392
        return 'HistoryEvent(' + 'Events:' + str(self.Events) + ')'
8393
8394 1
    __repr__ = __str__
8395
8396
8397 1
class HistoryReadParameters(FrozenClass):
8398
    '''
8399
    :ivar HistoryReadDetails:
8400
    :vartype HistoryReadDetails: ExtensionObject
8401
    :ivar TimestampsToReturn:
8402
    :vartype TimestampsToReturn: TimestampsToReturn
8403
    :ivar ReleaseContinuationPoints:
8404
    :vartype ReleaseContinuationPoints: Boolean
8405
    :ivar NodesToRead:
8406
    :vartype NodesToRead: HistoryReadValueId
8407
    '''
8408 1
    def __init__(self, binary=None):
8409 1
        if binary is not None:
8410
            self._binary_init(binary)
8411
            self._freeze = True
8412
            return
8413 1
        self.HistoryReadDetails = None
8414 1
        self.TimestampsToReturn = TimestampsToReturn(0)
8415 1
        self.ReleaseContinuationPoints = True
8416 1
        self.NodesToRead = []
8417 1
        self._freeze = True
8418
8419 1
    def to_binary(self):
8420
        packet = []
8421
        packet.append(extensionobject_to_binary(self.HistoryReadDetails))
8422
        packet.append(uatype_UInt32.pack(self.TimestampsToReturn.value))
8423
        packet.append(uatype_Boolean.pack(self.ReleaseContinuationPoints))
8424
        packet.append(uatype_Int32.pack(len(self.NodesToRead)))
8425
        for fieldname in self.NodesToRead:
8426
            packet.append(fieldname.to_binary())
8427
        return b''.join(packet)
8428
8429 1
    @staticmethod
8430
    def from_binary(data):
8431
        return HistoryReadParameters(data)
8432
8433 1
    def _binary_init(self, data):
8434
        self.HistoryReadDetails = extensionobject_from_binary(data)
8435
        self.TimestampsToReturn = TimestampsToReturn(uatype_UInt32.unpack(data.read(4))[0])
8436
        self.ReleaseContinuationPoints = uatype_Boolean.unpack(data.read(1))[0]
8437
        length = uatype_Int32.unpack(data.read(4))[0]
8438
        array = []
8439
        if length != -1:
8440
            for _ in range(0, length):
8441
                array.append(HistoryReadValueId.from_binary(data))
8442
        self.NodesToRead = array
8443
8444 1
    def __str__(self):
8445
        return 'HistoryReadParameters(' + 'HistoryReadDetails:' + str(self.HistoryReadDetails) + ', ' + \
8446
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
8447
               'ReleaseContinuationPoints:' + str(self.ReleaseContinuationPoints) + ', ' + \
8448
               'NodesToRead:' + str(self.NodesToRead) + ')'
8449
8450 1
    __repr__ = __str__
8451
8452
8453 1 View Code Duplication
class HistoryReadRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8454
    '''
8455
    :ivar TypeId:
8456
    :vartype TypeId: NodeId
8457
    :ivar RequestHeader:
8458
    :vartype RequestHeader: RequestHeader
8459
    :ivar Parameters:
8460
    :vartype Parameters: HistoryReadParameters
8461
    '''
8462 1
    def __init__(self, binary=None):
8463
        if binary is not None:
8464
            self._binary_init(binary)
8465
            self._freeze = True
8466
            return
8467
        self.TypeId = FourByteNodeId(ObjectIds.HistoryReadRequest_Encoding_DefaultBinary)
8468
        self.RequestHeader = RequestHeader()
8469
        self.Parameters = HistoryReadParameters()
8470
        self._freeze = True
8471
8472 1
    def to_binary(self):
8473
        packet = []
8474
        packet.append(self.TypeId.to_binary())
8475
        packet.append(self.RequestHeader.to_binary())
8476
        packet.append(self.Parameters.to_binary())
8477
        return b''.join(packet)
8478
8479 1
    @staticmethod
8480
    def from_binary(data):
8481
        return HistoryReadRequest(data)
8482
8483 1
    def _binary_init(self, data):
8484
        self.TypeId = NodeId.from_binary(data)
8485
        self.RequestHeader = RequestHeader.from_binary(data)
8486
        self.Parameters = HistoryReadParameters.from_binary(data)
8487
8488 1
    def __str__(self):
8489
        return 'HistoryReadRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8490
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
8491
               'Parameters:' + str(self.Parameters) + ')'
8492
8493 1
    __repr__ = __str__
8494
8495
8496 1 View Code Duplication
class HistoryReadResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8497
    '''
8498
    :ivar TypeId:
8499
    :vartype TypeId: NodeId
8500
    :ivar ResponseHeader:
8501
    :vartype ResponseHeader: ResponseHeader
8502
    :ivar Results:
8503
    :vartype Results: HistoryReadResult
8504
    :ivar DiagnosticInfos:
8505
    :vartype DiagnosticInfos: DiagnosticInfo
8506
    '''
8507 1
    def __init__(self, binary=None):
8508
        if binary is not None:
8509
            self._binary_init(binary)
8510
            self._freeze = True
8511
            return
8512
        self.TypeId = FourByteNodeId(ObjectIds.HistoryReadResponse_Encoding_DefaultBinary)
8513
        self.ResponseHeader = ResponseHeader()
8514
        self.Results = []
8515
        self.DiagnosticInfos = []
8516
        self._freeze = True
8517
8518 1
    def to_binary(self):
8519
        packet = []
8520
        packet.append(self.TypeId.to_binary())
8521
        packet.append(self.ResponseHeader.to_binary())
8522
        packet.append(uatype_Int32.pack(len(self.Results)))
8523
        for fieldname in self.Results:
8524
            packet.append(fieldname.to_binary())
8525
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
8526
        for fieldname in self.DiagnosticInfos:
8527
            packet.append(fieldname.to_binary())
8528
        return b''.join(packet)
8529
8530 1
    @staticmethod
8531
    def from_binary(data):
8532
        return HistoryReadResponse(data)
8533
8534 1
    def _binary_init(self, data):
8535
        self.TypeId = NodeId.from_binary(data)
8536
        self.ResponseHeader = ResponseHeader.from_binary(data)
8537
        length = uatype_Int32.unpack(data.read(4))[0]
8538
        array = []
8539
        if length != -1:
8540
            for _ in range(0, length):
8541
                array.append(HistoryReadResult.from_binary(data))
8542
        self.Results = array
8543
        length = uatype_Int32.unpack(data.read(4))[0]
8544
        array = []
8545
        if length != -1:
8546
            for _ in range(0, length):
8547
                array.append(DiagnosticInfo.from_binary(data))
8548
        self.DiagnosticInfos = array
8549
8550 1
    def __str__(self):
8551
        return 'HistoryReadResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8552
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
8553
               'Results:' + str(self.Results) + ', ' + \
8554
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
8555
8556 1
    __repr__ = __str__
8557
8558
8559 1
class WriteValue(FrozenClass):
8560
    '''
8561
    :ivar NodeId:
8562
    :vartype NodeId: NodeId
8563
    :ivar AttributeId:
8564
    :vartype AttributeId: UInt32
8565
    :ivar IndexRange:
8566
    :vartype IndexRange: String
8567
    :ivar Value:
8568
    :vartype Value: DataValue
8569
    '''
8570 1
    def __init__(self, binary=None):
8571 1
        if binary is not None:
8572 1
            self._binary_init(binary)
8573 1
            self._freeze = True
8574 1
            return
8575 1
        self.NodeId = NodeId()
8576 1
        self.AttributeId = 0
8577 1
        self.IndexRange = ''
8578 1
        self.Value = DataValue()
8579 1
        self._freeze = True
8580
8581 1
    def to_binary(self):
8582 1
        packet = []
8583 1
        packet.append(self.NodeId.to_binary())
8584 1
        packet.append(uatype_UInt32.pack(self.AttributeId))
8585 1
        packet.append(pack_string(self.IndexRange))
8586 1
        packet.append(self.Value.to_binary())
8587 1
        return b''.join(packet)
8588
8589 1
    @staticmethod
8590
    def from_binary(data):
8591 1
        return WriteValue(data)
8592
8593 1
    def _binary_init(self, data):
8594 1
        self.NodeId = NodeId.from_binary(data)
8595 1
        self.AttributeId = uatype_UInt32.unpack(data.read(4))[0]
8596 1
        self.IndexRange = unpack_string(data)
8597 1
        self.Value = DataValue.from_binary(data)
8598
8599 1
    def __str__(self):
8600
        return 'WriteValue(' + 'NodeId:' + str(self.NodeId) + ', ' + \
8601
               'AttributeId:' + str(self.AttributeId) + ', ' + \
8602
               'IndexRange:' + str(self.IndexRange) + ', ' + \
8603
               'Value:' + str(self.Value) + ')'
8604
8605 1
    __repr__ = __str__
8606
8607
8608 1 View Code Duplication
class WriteParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8609
    '''
8610
    :ivar NodesToWrite:
8611
    :vartype NodesToWrite: WriteValue
8612
    '''
8613 1
    def __init__(self, binary=None):
8614 1
        if binary is not None:
8615 1
            self._binary_init(binary)
8616 1
            self._freeze = True
8617 1
            return
8618 1
        self.NodesToWrite = []
8619 1
        self._freeze = True
8620
8621 1
    def to_binary(self):
8622 1
        packet = []
8623 1
        packet.append(uatype_Int32.pack(len(self.NodesToWrite)))
8624 1
        for fieldname in self.NodesToWrite:
8625 1
            packet.append(fieldname.to_binary())
8626 1
        return b''.join(packet)
8627
8628 1
    @staticmethod
8629
    def from_binary(data):
8630 1
        return WriteParameters(data)
8631
8632 1
    def _binary_init(self, data):
8633 1
        length = uatype_Int32.unpack(data.read(4))[0]
8634 1
        array = []
8635 1
        if length != -1:
8636 1
            for _ in range(0, length):
8637 1
                array.append(WriteValue.from_binary(data))
8638 1
        self.NodesToWrite = array
8639
8640 1
    def __str__(self):
8641
        return 'WriteParameters(' + 'NodesToWrite:' + str(self.NodesToWrite) + ')'
8642
8643 1
    __repr__ = __str__
8644
8645
8646 1 View Code Duplication
class WriteRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8647
    '''
8648
    :ivar TypeId:
8649
    :vartype TypeId: NodeId
8650
    :ivar RequestHeader:
8651
    :vartype RequestHeader: RequestHeader
8652
    :ivar Parameters:
8653
    :vartype Parameters: WriteParameters
8654
    '''
8655 1
    def __init__(self, binary=None):
8656 1
        if binary is not None:
8657
            self._binary_init(binary)
8658
            self._freeze = True
8659
            return
8660 1
        self.TypeId = FourByteNodeId(ObjectIds.WriteRequest_Encoding_DefaultBinary)
8661 1
        self.RequestHeader = RequestHeader()
8662 1
        self.Parameters = WriteParameters()
8663 1
        self._freeze = True
8664
8665 1
    def to_binary(self):
8666 1
        packet = []
8667 1
        packet.append(self.TypeId.to_binary())
8668 1
        packet.append(self.RequestHeader.to_binary())
8669 1
        packet.append(self.Parameters.to_binary())
8670 1
        return b''.join(packet)
8671
8672 1
    @staticmethod
8673
    def from_binary(data):
8674
        return WriteRequest(data)
8675
8676 1
    def _binary_init(self, data):
8677
        self.TypeId = NodeId.from_binary(data)
8678
        self.RequestHeader = RequestHeader.from_binary(data)
8679
        self.Parameters = WriteParameters.from_binary(data)
8680
8681 1
    def __str__(self):
8682
        return 'WriteRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8683
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
8684
               'Parameters:' + str(self.Parameters) + ')'
8685
8686 1
    __repr__ = __str__
8687
8688
8689 1 View Code Duplication
class WriteResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8690
    '''
8691
    :ivar TypeId:
8692
    :vartype TypeId: NodeId
8693
    :ivar ResponseHeader:
8694
    :vartype ResponseHeader: ResponseHeader
8695
    :ivar Results:
8696
    :vartype Results: StatusCode
8697
    :ivar DiagnosticInfos:
8698
    :vartype DiagnosticInfos: DiagnosticInfo
8699
    '''
8700 1
    def __init__(self, binary=None):
8701 1
        if binary is not None:
8702 1
            self._binary_init(binary)
8703 1
            self._freeze = True
8704 1
            return
8705 1
        self.TypeId = FourByteNodeId(ObjectIds.WriteResponse_Encoding_DefaultBinary)
8706 1
        self.ResponseHeader = ResponseHeader()
8707 1
        self.Results = []
8708 1
        self.DiagnosticInfos = []
8709 1
        self._freeze = True
8710
8711 1
    def to_binary(self):
8712 1
        packet = []
8713 1
        packet.append(self.TypeId.to_binary())
8714 1
        packet.append(self.ResponseHeader.to_binary())
8715 1
        packet.append(uatype_Int32.pack(len(self.Results)))
8716 1
        for fieldname in self.Results:
8717 1
            packet.append(fieldname.to_binary())
8718 1
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
8719 1
        for fieldname in self.DiagnosticInfos:
8720
            packet.append(fieldname.to_binary())
8721 1
        return b''.join(packet)
8722
8723 1
    @staticmethod
8724
    def from_binary(data):
8725 1
        return WriteResponse(data)
8726
8727 1
    def _binary_init(self, data):
8728 1
        self.TypeId = NodeId.from_binary(data)
8729 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
8730 1
        length = uatype_Int32.unpack(data.read(4))[0]
8731 1
        array = []
8732 1
        if length != -1:
8733 1
            for _ in range(0, length):
8734 1
                array.append(StatusCode.from_binary(data))
8735 1
        self.Results = array
8736 1
        length = uatype_Int32.unpack(data.read(4))[0]
8737 1
        array = []
8738 1
        if length != -1:
8739 1
            for _ in range(0, length):
8740
                array.append(DiagnosticInfo.from_binary(data))
8741 1
        self.DiagnosticInfos = array
8742
8743 1
    def __str__(self):
8744
        return 'WriteResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8745
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
8746
               'Results:' + str(self.Results) + ', ' + \
8747
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
8748
8749 1
    __repr__ = __str__
8750
8751
8752 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...
8753
    '''
8754
    :ivar NodeId:
8755
    :vartype NodeId: NodeId
8756
    '''
8757 1
    def __init__(self, binary=None):
8758
        if binary is not None:
8759
            self._binary_init(binary)
8760
            self._freeze = True
8761
            return
8762
        self.NodeId = NodeId()
8763
        self._freeze = True
8764
8765 1
    def to_binary(self):
8766
        packet = []
8767
        packet.append(self.NodeId.to_binary())
8768
        return b''.join(packet)
8769
8770 1
    @staticmethod
8771
    def from_binary(data):
8772
        return HistoryUpdateDetails(data)
8773
8774 1
    def _binary_init(self, data):
8775
        self.NodeId = NodeId.from_binary(data)
8776
8777 1
    def __str__(self):
8778
        return 'HistoryUpdateDetails(' + 'NodeId:' + str(self.NodeId) + ')'
8779
8780 1
    __repr__ = __str__
8781
8782
8783 1 View Code Duplication
class UpdateDataDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8784
    '''
8785
    :ivar NodeId:
8786
    :vartype NodeId: NodeId
8787
    :ivar PerformInsertReplace:
8788
    :vartype PerformInsertReplace: PerformUpdateType
8789
    :ivar UpdateValues:
8790
    :vartype UpdateValues: DataValue
8791
    '''
8792 1
    def __init__(self, binary=None):
8793
        if binary is not None:
8794
            self._binary_init(binary)
8795
            self._freeze = True
8796
            return
8797
        self.NodeId = NodeId()
8798
        self.PerformInsertReplace = PerformUpdateType(0)
8799
        self.UpdateValues = []
8800
        self._freeze = True
8801
8802 1
    def to_binary(self):
8803
        packet = []
8804
        packet.append(self.NodeId.to_binary())
8805
        packet.append(uatype_UInt32.pack(self.PerformInsertReplace.value))
8806
        packet.append(uatype_Int32.pack(len(self.UpdateValues)))
8807
        for fieldname in self.UpdateValues:
8808
            packet.append(fieldname.to_binary())
8809
        return b''.join(packet)
8810
8811 1
    @staticmethod
8812
    def from_binary(data):
8813
        return UpdateDataDetails(data)
8814
8815 1
    def _binary_init(self, data):
8816
        self.NodeId = NodeId.from_binary(data)
8817
        self.PerformInsertReplace = PerformUpdateType(uatype_UInt32.unpack(data.read(4))[0])
8818
        length = uatype_Int32.unpack(data.read(4))[0]
8819
        array = []
8820
        if length != -1:
8821
            for _ in range(0, length):
8822
                array.append(DataValue.from_binary(data))
8823
        self.UpdateValues = array
8824
8825 1
    def __str__(self):
8826
        return 'UpdateDataDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
8827
               'PerformInsertReplace:' + str(self.PerformInsertReplace) + ', ' + \
8828
               'UpdateValues:' + str(self.UpdateValues) + ')'
8829
8830 1
    __repr__ = __str__
8831
8832
8833 1 View Code Duplication
class UpdateStructureDataDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8834
    '''
8835
    :ivar NodeId:
8836
    :vartype NodeId: NodeId
8837
    :ivar PerformInsertReplace:
8838
    :vartype PerformInsertReplace: PerformUpdateType
8839
    :ivar UpdateValues:
8840
    :vartype UpdateValues: DataValue
8841
    '''
8842 1
    def __init__(self, binary=None):
8843
        if binary is not None:
8844
            self._binary_init(binary)
8845
            self._freeze = True
8846
            return
8847
        self.NodeId = NodeId()
8848
        self.PerformInsertReplace = PerformUpdateType(0)
8849
        self.UpdateValues = []
8850
        self._freeze = True
8851
8852 1
    def to_binary(self):
8853
        packet = []
8854
        packet.append(self.NodeId.to_binary())
8855
        packet.append(uatype_UInt32.pack(self.PerformInsertReplace.value))
8856
        packet.append(uatype_Int32.pack(len(self.UpdateValues)))
8857
        for fieldname in self.UpdateValues:
8858
            packet.append(fieldname.to_binary())
8859
        return b''.join(packet)
8860
8861 1
    @staticmethod
8862
    def from_binary(data):
8863
        return UpdateStructureDataDetails(data)
8864
8865 1
    def _binary_init(self, data):
8866
        self.NodeId = NodeId.from_binary(data)
8867
        self.PerformInsertReplace = PerformUpdateType(uatype_UInt32.unpack(data.read(4))[0])
8868
        length = uatype_Int32.unpack(data.read(4))[0]
8869
        array = []
8870
        if length != -1:
8871
            for _ in range(0, length):
8872
                array.append(DataValue.from_binary(data))
8873
        self.UpdateValues = array
8874
8875 1
    def __str__(self):
8876
        return 'UpdateStructureDataDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
8877
               'PerformInsertReplace:' + str(self.PerformInsertReplace) + ', ' + \
8878
               'UpdateValues:' + str(self.UpdateValues) + ')'
8879
8880 1
    __repr__ = __str__
8881
8882
8883 1 View Code Duplication
class UpdateEventDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8884
    '''
8885
    :ivar NodeId:
8886
    :vartype NodeId: NodeId
8887
    :ivar PerformInsertReplace:
8888
    :vartype PerformInsertReplace: PerformUpdateType
8889
    :ivar Filter:
8890
    :vartype Filter: EventFilter
8891
    :ivar EventData:
8892
    :vartype EventData: HistoryEventFieldList
8893
    '''
8894 1
    def __init__(self, binary=None):
8895
        if binary is not None:
8896
            self._binary_init(binary)
8897
            self._freeze = True
8898
            return
8899
        self.NodeId = NodeId()
8900
        self.PerformInsertReplace = PerformUpdateType(0)
8901
        self.Filter = EventFilter()
8902
        self.EventData = []
8903
        self._freeze = True
8904
8905 1
    def to_binary(self):
8906
        packet = []
8907
        packet.append(self.NodeId.to_binary())
8908
        packet.append(uatype_UInt32.pack(self.PerformInsertReplace.value))
8909
        packet.append(self.Filter.to_binary())
8910
        packet.append(uatype_Int32.pack(len(self.EventData)))
8911
        for fieldname in self.EventData:
8912
            packet.append(fieldname.to_binary())
8913
        return b''.join(packet)
8914
8915 1
    @staticmethod
8916
    def from_binary(data):
8917
        return UpdateEventDetails(data)
8918
8919 1
    def _binary_init(self, data):
8920
        self.NodeId = NodeId.from_binary(data)
8921
        self.PerformInsertReplace = PerformUpdateType(uatype_UInt32.unpack(data.read(4))[0])
8922
        self.Filter = EventFilter.from_binary(data)
8923
        length = uatype_Int32.unpack(data.read(4))[0]
8924
        array = []
8925
        if length != -1:
8926
            for _ in range(0, length):
8927
                array.append(HistoryEventFieldList.from_binary(data))
8928
        self.EventData = array
8929
8930 1
    def __str__(self):
8931
        return 'UpdateEventDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
8932
               'PerformInsertReplace:' + str(self.PerformInsertReplace) + ', ' + \
8933
               'Filter:' + str(self.Filter) + ', ' + \
8934
               'EventData:' + str(self.EventData) + ')'
8935
8936 1
    __repr__ = __str__
8937
8938
8939 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...
8940
    '''
8941
    :ivar NodeId:
8942
    :vartype NodeId: NodeId
8943
    :ivar IsDeleteModified:
8944
    :vartype IsDeleteModified: Boolean
8945
    :ivar StartTime:
8946
    :vartype StartTime: DateTime
8947
    :ivar EndTime:
8948
    :vartype EndTime: DateTime
8949
    '''
8950 1
    def __init__(self, binary=None):
8951
        if binary is not None:
8952
            self._binary_init(binary)
8953
            self._freeze = True
8954
            return
8955
        self.NodeId = NodeId()
8956
        self.IsDeleteModified = True
8957
        self.StartTime = datetime.now()
8958
        self.EndTime = datetime.now()
8959
        self._freeze = True
8960
8961 1
    def to_binary(self):
8962
        packet = []
8963
        packet.append(self.NodeId.to_binary())
8964
        packet.append(uatype_Boolean.pack(self.IsDeleteModified))
8965
        packet.append(pack_datetime(self.StartTime))
8966
        packet.append(pack_datetime(self.EndTime))
8967
        return b''.join(packet)
8968
8969 1
    @staticmethod
8970
    def from_binary(data):
8971
        return DeleteRawModifiedDetails(data)
8972
8973 1
    def _binary_init(self, data):
8974
        self.NodeId = NodeId.from_binary(data)
8975
        self.IsDeleteModified = uatype_Boolean.unpack(data.read(1))[0]
8976
        self.StartTime = unpack_datetime(data)
8977
        self.EndTime = unpack_datetime(data)
8978
8979 1
    def __str__(self):
8980
        return 'DeleteRawModifiedDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
8981
               'IsDeleteModified:' + str(self.IsDeleteModified) + ', ' + \
8982
               'StartTime:' + str(self.StartTime) + ', ' + \
8983
               'EndTime:' + str(self.EndTime) + ')'
8984
8985 1
    __repr__ = __str__
8986
8987
8988 1 View Code Duplication
class DeleteAtTimeDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8989
    '''
8990
    :ivar NodeId:
8991
    :vartype NodeId: NodeId
8992
    :ivar ReqTimes:
8993
    :vartype ReqTimes: DateTime
8994
    '''
8995 1
    def __init__(self, binary=None):
8996
        if binary is not None:
8997
            self._binary_init(binary)
8998
            self._freeze = True
8999
            return
9000
        self.NodeId = NodeId()
9001
        self.ReqTimes = []
9002
        self._freeze = True
9003
9004 1
    def to_binary(self):
9005
        packet = []
9006
        packet.append(self.NodeId.to_binary())
9007
        packet.append(uatype_Int32.pack(len(self.ReqTimes)))
9008
        for fieldname in self.ReqTimes:
9009
            packet.append(pack_datetime(fieldname))
9010
        return b''.join(packet)
9011
9012 1
    @staticmethod
9013
    def from_binary(data):
9014
        return DeleteAtTimeDetails(data)
9015
9016 1
    def _binary_init(self, data):
9017
        self.NodeId = NodeId.from_binary(data)
9018
        self.ReqTimes = unpack_uatype_array('DateTime', data)
9019
9020 1
    def __str__(self):
9021
        return 'DeleteAtTimeDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
9022
               'ReqTimes:' + str(self.ReqTimes) + ')'
9023
9024 1
    __repr__ = __str__
9025
9026
9027 1 View Code Duplication
class DeleteEventDetails(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9028
    '''
9029
    :ivar NodeId:
9030
    :vartype NodeId: NodeId
9031
    :ivar EventIds:
9032
    :vartype EventIds: ByteString
9033
    '''
9034 1
    def __init__(self, binary=None):
9035
        if binary is not None:
9036
            self._binary_init(binary)
9037
            self._freeze = True
9038
            return
9039
        self.NodeId = NodeId()
9040
        self.EventIds = []
9041
        self._freeze = True
9042
9043 1
    def to_binary(self):
9044
        packet = []
9045
        packet.append(self.NodeId.to_binary())
9046
        packet.append(uatype_Int32.pack(len(self.EventIds)))
9047
        for fieldname in self.EventIds:
9048
            packet.append(pack_bytes(fieldname))
9049
        return b''.join(packet)
9050
9051 1
    @staticmethod
9052
    def from_binary(data):
9053
        return DeleteEventDetails(data)
9054
9055 1
    def _binary_init(self, data):
9056
        self.NodeId = NodeId.from_binary(data)
9057
        self.EventIds = unpack_uatype_array('ByteString', data)
9058
9059 1
    def __str__(self):
9060
        return 'DeleteEventDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
9061
               'EventIds:' + str(self.EventIds) + ')'
9062
9063 1
    __repr__ = __str__
9064
9065
9066 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...
9067
    '''
9068
    :ivar StatusCode:
9069
    :vartype StatusCode: StatusCode
9070
    :ivar OperationResults:
9071
    :vartype OperationResults: StatusCode
9072
    :ivar DiagnosticInfos:
9073
    :vartype DiagnosticInfos: DiagnosticInfo
9074
    '''
9075 1
    def __init__(self, binary=None):
9076
        if binary is not None:
9077
            self._binary_init(binary)
9078
            self._freeze = True
9079
            return
9080
        self.StatusCode = StatusCode()
9081
        self.OperationResults = []
9082
        self.DiagnosticInfos = []
9083
        self._freeze = True
9084
9085 1
    def to_binary(self):
9086
        packet = []
9087
        packet.append(self.StatusCode.to_binary())
9088
        packet.append(uatype_Int32.pack(len(self.OperationResults)))
9089
        for fieldname in self.OperationResults:
9090
            packet.append(fieldname.to_binary())
9091
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
9092
        for fieldname in self.DiagnosticInfos:
9093
            packet.append(fieldname.to_binary())
9094
        return b''.join(packet)
9095
9096 1
    @staticmethod
9097
    def from_binary(data):
9098
        return HistoryUpdateResult(data)
9099
9100 1
    def _binary_init(self, data):
9101
        self.StatusCode = StatusCode.from_binary(data)
9102
        length = uatype_Int32.unpack(data.read(4))[0]
9103
        array = []
9104
        if length != -1:
9105
            for _ in range(0, length):
9106
                array.append(StatusCode.from_binary(data))
9107
        self.OperationResults = array
9108
        length = uatype_Int32.unpack(data.read(4))[0]
9109
        array = []
9110
        if length != -1:
9111
            for _ in range(0, length):
9112
                array.append(DiagnosticInfo.from_binary(data))
9113
        self.DiagnosticInfos = array
9114
9115 1
    def __str__(self):
9116
        return 'HistoryUpdateResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
9117
               'OperationResults:' + str(self.OperationResults) + ', ' + \
9118
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
9119
9120 1
    __repr__ = __str__
9121
9122
9123 1 View Code Duplication
class HistoryUpdateParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9124
    '''
9125
    :ivar HistoryUpdateDetails:
9126
    :vartype HistoryUpdateDetails: ExtensionObject
9127
    '''
9128 1
    def __init__(self, binary=None):
9129
        if binary is not None:
9130
            self._binary_init(binary)
9131
            self._freeze = True
9132
            return
9133
        self.HistoryUpdateDetails = []
9134
        self._freeze = True
9135
9136 1
    def to_binary(self):
9137
        packet = []
9138
        packet.append(uatype_Int32.pack(len(self.HistoryUpdateDetails)))
9139
        for fieldname in self.HistoryUpdateDetails:
9140
            packet.append(extensionobject_to_binary(fieldname))
9141
        return b''.join(packet)
9142
9143 1
    @staticmethod
9144
    def from_binary(data):
9145
        return HistoryUpdateParameters(data)
9146
9147 1
    def _binary_init(self, data):
9148
        length = uatype_Int32.unpack(data.read(4))[0]
9149
        array = []
9150
        if length != -1:
9151
            for _ in range(0, length):
9152
                array.append(extensionobject_from_binary(data))
9153
        self.HistoryUpdateDetails = array
9154
9155 1
    def __str__(self):
9156
        return 'HistoryUpdateParameters(' + 'HistoryUpdateDetails:' + str(self.HistoryUpdateDetails) + ')'
9157
9158 1
    __repr__ = __str__
9159
9160
9161 1 View Code Duplication
class HistoryUpdateRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9162
    '''
9163
    :ivar TypeId:
9164
    :vartype TypeId: NodeId
9165
    :ivar RequestHeader:
9166
    :vartype RequestHeader: RequestHeader
9167
    :ivar Parameters:
9168
    :vartype Parameters: HistoryUpdateParameters
9169
    '''
9170 1
    def __init__(self, binary=None):
9171
        if binary is not None:
9172
            self._binary_init(binary)
9173
            self._freeze = True
9174
            return
9175
        self.TypeId = FourByteNodeId(ObjectIds.HistoryUpdateRequest_Encoding_DefaultBinary)
9176
        self.RequestHeader = RequestHeader()
9177
        self.Parameters = HistoryUpdateParameters()
9178
        self._freeze = True
9179
9180 1
    def to_binary(self):
9181
        packet = []
9182
        packet.append(self.TypeId.to_binary())
9183
        packet.append(self.RequestHeader.to_binary())
9184
        packet.append(self.Parameters.to_binary())
9185
        return b''.join(packet)
9186
9187 1
    @staticmethod
9188
    def from_binary(data):
9189
        return HistoryUpdateRequest(data)
9190
9191 1
    def _binary_init(self, data):
9192
        self.TypeId = NodeId.from_binary(data)
9193
        self.RequestHeader = RequestHeader.from_binary(data)
9194
        self.Parameters = HistoryUpdateParameters.from_binary(data)
9195
9196 1
    def __str__(self):
9197
        return 'HistoryUpdateRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9198
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
9199
               'Parameters:' + str(self.Parameters) + ')'
9200
9201 1
    __repr__ = __str__
9202
9203
9204 1 View Code Duplication
class HistoryUpdateResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9205
    '''
9206
    :ivar TypeId:
9207
    :vartype TypeId: NodeId
9208
    :ivar ResponseHeader:
9209
    :vartype ResponseHeader: ResponseHeader
9210
    :ivar Results:
9211
    :vartype Results: HistoryUpdateResult
9212
    :ivar DiagnosticInfos:
9213
    :vartype DiagnosticInfos: DiagnosticInfo
9214
    '''
9215 1
    def __init__(self, binary=None):
9216
        if binary is not None:
9217
            self._binary_init(binary)
9218
            self._freeze = True
9219
            return
9220
        self.TypeId = FourByteNodeId(ObjectIds.HistoryUpdateResponse_Encoding_DefaultBinary)
9221
        self.ResponseHeader = ResponseHeader()
9222
        self.Results = []
9223
        self.DiagnosticInfos = []
9224
        self._freeze = True
9225
9226 1
    def to_binary(self):
9227
        packet = []
9228
        packet.append(self.TypeId.to_binary())
9229
        packet.append(self.ResponseHeader.to_binary())
9230
        packet.append(uatype_Int32.pack(len(self.Results)))
9231
        for fieldname in self.Results:
9232
            packet.append(fieldname.to_binary())
9233
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
9234
        for fieldname in self.DiagnosticInfos:
9235
            packet.append(fieldname.to_binary())
9236
        return b''.join(packet)
9237
9238 1
    @staticmethod
9239
    def from_binary(data):
9240
        return HistoryUpdateResponse(data)
9241
9242 1
    def _binary_init(self, data):
9243
        self.TypeId = NodeId.from_binary(data)
9244
        self.ResponseHeader = ResponseHeader.from_binary(data)
9245
        length = uatype_Int32.unpack(data.read(4))[0]
9246
        array = []
9247
        if length != -1:
9248
            for _ in range(0, length):
9249
                array.append(HistoryUpdateResult.from_binary(data))
9250
        self.Results = array
9251
        length = uatype_Int32.unpack(data.read(4))[0]
9252
        array = []
9253
        if length != -1:
9254
            for _ in range(0, length):
9255
                array.append(DiagnosticInfo.from_binary(data))
9256
        self.DiagnosticInfos = array
9257
9258 1
    def __str__(self):
9259
        return 'HistoryUpdateResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9260
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
9261
               'Results:' + str(self.Results) + ', ' + \
9262
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
9263
9264 1
    __repr__ = __str__
9265
9266
9267 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...
9268
    '''
9269
    :ivar ObjectId:
9270
    :vartype ObjectId: NodeId
9271
    :ivar MethodId:
9272
    :vartype MethodId: NodeId
9273
    :ivar InputArguments:
9274
    :vartype InputArguments: Variant
9275
    '''
9276 1
    def __init__(self, binary=None):
9277 1
        if binary is not None:
9278 1
            self._binary_init(binary)
9279 1
            self._freeze = True
9280 1
            return
9281 1
        self.ObjectId = NodeId()
9282 1
        self.MethodId = NodeId()
9283 1
        self.InputArguments = []
9284 1
        self._freeze = True
9285
9286 1
    def to_binary(self):
9287 1
        packet = []
9288 1
        packet.append(self.ObjectId.to_binary())
9289 1
        packet.append(self.MethodId.to_binary())
9290 1
        packet.append(uatype_Int32.pack(len(self.InputArguments)))
9291 1
        for fieldname in self.InputArguments:
9292 1
            packet.append(fieldname.to_binary())
9293 1
        return b''.join(packet)
9294
9295 1
    @staticmethod
9296
    def from_binary(data):
9297 1
        return CallMethodRequest(data)
9298
9299 1
    def _binary_init(self, data):
9300 1
        self.ObjectId = NodeId.from_binary(data)
9301 1
        self.MethodId = NodeId.from_binary(data)
9302 1
        length = uatype_Int32.unpack(data.read(4))[0]
9303 1
        array = []
9304 1
        if length != -1:
9305 1
            for _ in range(0, length):
9306 1
                array.append(Variant.from_binary(data))
9307 1
        self.InputArguments = array
9308
9309 1
    def __str__(self):
9310 1
        return 'CallMethodRequest(' + 'ObjectId:' + str(self.ObjectId) + ', ' + \
9311
               'MethodId:' + str(self.MethodId) + ', ' + \
9312
               'InputArguments:' + str(self.InputArguments) + ')'
9313
9314 1
    __repr__ = __str__
9315
9316
9317 1
class CallMethodResult(FrozenClass):
9318
    '''
9319
    :ivar StatusCode:
9320
    :vartype StatusCode: StatusCode
9321
    :ivar InputArgumentResults:
9322
    :vartype InputArgumentResults: StatusCode
9323
    :ivar InputArgumentDiagnosticInfos:
9324
    :vartype InputArgumentDiagnosticInfos: DiagnosticInfo
9325
    :ivar OutputArguments:
9326
    :vartype OutputArguments: Variant
9327
    '''
9328 1
    def __init__(self, binary=None):
9329 1
        if binary is not None:
9330 1
            self._binary_init(binary)
9331 1
            self._freeze = True
9332 1
            return
9333 1
        self.StatusCode = StatusCode()
9334 1
        self.InputArgumentResults = []
9335 1
        self.InputArgumentDiagnosticInfos = []
9336 1
        self.OutputArguments = []
9337 1
        self._freeze = True
9338
9339 1
    def to_binary(self):
9340 1
        packet = []
9341 1
        packet.append(self.StatusCode.to_binary())
9342 1
        packet.append(uatype_Int32.pack(len(self.InputArgumentResults)))
9343 1
        for fieldname in self.InputArgumentResults:
9344 1
            packet.append(fieldname.to_binary())
9345 1
        packet.append(uatype_Int32.pack(len(self.InputArgumentDiagnosticInfos)))
9346 1
        for fieldname in self.InputArgumentDiagnosticInfos:
9347
            packet.append(fieldname.to_binary())
9348 1
        packet.append(uatype_Int32.pack(len(self.OutputArguments)))
9349 1
        for fieldname in self.OutputArguments:
9350 1
            packet.append(fieldname.to_binary())
9351 1
        return b''.join(packet)
9352
9353 1
    @staticmethod
9354
    def from_binary(data):
9355 1
        return CallMethodResult(data)
9356
9357 1
    def _binary_init(self, data):
9358 1
        self.StatusCode = StatusCode.from_binary(data)
9359 1
        length = uatype_Int32.unpack(data.read(4))[0]
9360 1
        array = []
9361 1
        if length != -1:
9362 1
            for _ in range(0, length):
9363 1
                array.append(StatusCode.from_binary(data))
9364 1
        self.InputArgumentResults = array
9365 1
        length = uatype_Int32.unpack(data.read(4))[0]
9366 1
        array = []
9367 1
        if length != -1:
9368 1
            for _ in range(0, length):
9369
                array.append(DiagnosticInfo.from_binary(data))
9370 1
        self.InputArgumentDiagnosticInfos = array
9371 1
        length = uatype_Int32.unpack(data.read(4))[0]
9372 1
        array = []
9373 1
        if length != -1:
9374 1
            for _ in range(0, length):
9375 1
                array.append(Variant.from_binary(data))
9376 1
        self.OutputArguments = array
9377
9378 1
    def __str__(self):
9379
        return 'CallMethodResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
9380
               'InputArgumentResults:' + str(self.InputArgumentResults) + ', ' + \
9381
               'InputArgumentDiagnosticInfos:' + str(self.InputArgumentDiagnosticInfos) + ', ' + \
9382
               'OutputArguments:' + str(self.OutputArguments) + ')'
9383
9384 1
    __repr__ = __str__
9385
9386
9387 1 View Code Duplication
class CallParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9388
    '''
9389
    :ivar MethodsToCall:
9390
    :vartype MethodsToCall: CallMethodRequest
9391
    '''
9392 1
    def __init__(self, binary=None):
9393 1
        if binary is not None:
9394 1
            self._binary_init(binary)
9395 1
            self._freeze = True
9396 1
            return
9397 1
        self.MethodsToCall = []
9398 1
        self._freeze = True
9399
9400 1
    def to_binary(self):
9401 1
        packet = []
9402 1
        packet.append(uatype_Int32.pack(len(self.MethodsToCall)))
9403 1
        for fieldname in self.MethodsToCall:
9404 1
            packet.append(fieldname.to_binary())
9405 1
        return b''.join(packet)
9406
9407 1
    @staticmethod
9408
    def from_binary(data):
9409 1
        return CallParameters(data)
9410
9411 1
    def _binary_init(self, data):
9412 1
        length = uatype_Int32.unpack(data.read(4))[0]
9413 1
        array = []
9414 1
        if length != -1:
9415 1
            for _ in range(0, length):
9416 1
                array.append(CallMethodRequest.from_binary(data))
9417 1
        self.MethodsToCall = array
9418
9419 1
    def __str__(self):
9420
        return 'CallParameters(' + 'MethodsToCall:' + str(self.MethodsToCall) + ')'
9421
9422 1
    __repr__ = __str__
9423
9424
9425 1 View Code Duplication
class CallRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9426
    '''
9427
    :ivar TypeId:
9428
    :vartype TypeId: NodeId
9429
    :ivar RequestHeader:
9430
    :vartype RequestHeader: RequestHeader
9431
    :ivar Parameters:
9432
    :vartype Parameters: CallParameters
9433
    '''
9434 1
    def __init__(self, binary=None):
9435 1
        if binary is not None:
9436
            self._binary_init(binary)
9437
            self._freeze = True
9438
            return
9439 1
        self.TypeId = FourByteNodeId(ObjectIds.CallRequest_Encoding_DefaultBinary)
9440 1
        self.RequestHeader = RequestHeader()
9441 1
        self.Parameters = CallParameters()
9442 1
        self._freeze = True
9443
9444 1
    def to_binary(self):
9445 1
        packet = []
9446 1
        packet.append(self.TypeId.to_binary())
9447 1
        packet.append(self.RequestHeader.to_binary())
9448 1
        packet.append(self.Parameters.to_binary())
9449 1
        return b''.join(packet)
9450
9451 1
    @staticmethod
9452
    def from_binary(data):
9453
        return CallRequest(data)
9454
9455 1
    def _binary_init(self, data):
9456
        self.TypeId = NodeId.from_binary(data)
9457
        self.RequestHeader = RequestHeader.from_binary(data)
9458
        self.Parameters = CallParameters.from_binary(data)
9459
9460 1
    def __str__(self):
9461
        return 'CallRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9462
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
9463
               'Parameters:' + str(self.Parameters) + ')'
9464
9465 1
    __repr__ = __str__
9466
9467
9468 1 View Code Duplication
class CallResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9469
    '''
9470
    :ivar TypeId:
9471
    :vartype TypeId: NodeId
9472
    :ivar ResponseHeader:
9473
    :vartype ResponseHeader: ResponseHeader
9474
    :ivar Results:
9475
    :vartype Results: CallMethodResult
9476
    :ivar DiagnosticInfos:
9477
    :vartype DiagnosticInfos: DiagnosticInfo
9478
    '''
9479 1
    def __init__(self, binary=None):
9480 1
        if binary is not None:
9481 1
            self._binary_init(binary)
9482 1
            self._freeze = True
9483 1
            return
9484 1
        self.TypeId = FourByteNodeId(ObjectIds.CallResponse_Encoding_DefaultBinary)
9485 1
        self.ResponseHeader = ResponseHeader()
9486 1
        self.Results = []
9487 1
        self.DiagnosticInfos = []
9488 1
        self._freeze = True
9489
9490 1
    def to_binary(self):
9491 1
        packet = []
9492 1
        packet.append(self.TypeId.to_binary())
9493 1
        packet.append(self.ResponseHeader.to_binary())
9494 1
        packet.append(uatype_Int32.pack(len(self.Results)))
9495 1
        for fieldname in self.Results:
9496 1
            packet.append(fieldname.to_binary())
9497 1
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
9498 1
        for fieldname in self.DiagnosticInfos:
9499
            packet.append(fieldname.to_binary())
9500 1
        return b''.join(packet)
9501
9502 1
    @staticmethod
9503
    def from_binary(data):
9504 1
        return CallResponse(data)
9505
9506 1
    def _binary_init(self, data):
9507 1
        self.TypeId = NodeId.from_binary(data)
9508 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
9509 1
        length = uatype_Int32.unpack(data.read(4))[0]
9510 1
        array = []
9511 1
        if length != -1:
9512 1
            for _ in range(0, length):
9513 1
                array.append(CallMethodResult.from_binary(data))
9514 1
        self.Results = array
9515 1
        length = uatype_Int32.unpack(data.read(4))[0]
9516 1
        array = []
9517 1
        if length != -1:
9518 1
            for _ in range(0, length):
9519
                array.append(DiagnosticInfo.from_binary(data))
9520 1
        self.DiagnosticInfos = array
9521
9522 1
    def __str__(self):
9523
        return 'CallResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9524
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
9525
               'Results:' + str(self.Results) + ', ' + \
9526
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
9527
9528 1
    __repr__ = __str__
9529
9530
9531 1 View Code Duplication
class MonitoringFilter(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9532
    '''
9533
    '''
9534 1
    def __init__(self, binary=None):
9535
        if binary is not None:
9536
            self._binary_init(binary)
9537
            self._freeze = True
9538
            return
9539
        self._freeze = True
9540
9541 1
    def to_binary(self):
9542
        packet = []
9543
        return b''.join(packet)
9544
9545 1
    @staticmethod
9546
    def from_binary(data):
9547
        return MonitoringFilter(data)
9548
9549 1
    def _binary_init(self, data):
9550
        pass
9551
9552 1
    def __str__(self):
9553
        return 'MonitoringFilter(' +  + ')'
9554
9555 1
    __repr__ = __str__
9556
9557
9558 1
class DataChangeFilter(FrozenClass):
9559
    '''
9560
    :ivar Trigger:
9561
    :vartype Trigger: DataChangeTrigger
9562
    :ivar DeadbandType:
9563
    :vartype DeadbandType: UInt32
9564
    :ivar DeadbandValue:
9565
    :vartype DeadbandValue: Double
9566
    '''
9567 1
    def __init__(self, binary=None):
9568
        if binary is not None:
9569
            self._binary_init(binary)
9570
            self._freeze = True
9571
            return
9572
        self.Trigger = DataChangeTrigger(0)
9573
        self.DeadbandType = 0
9574
        self.DeadbandValue = 0
9575
        self._freeze = True
9576
9577 1
    def to_binary(self):
9578
        packet = []
9579
        packet.append(uatype_UInt32.pack(self.Trigger.value))
9580
        packet.append(uatype_UInt32.pack(self.DeadbandType))
9581
        packet.append(uatype_Double.pack(self.DeadbandValue))
9582
        return b''.join(packet)
9583
9584 1
    @staticmethod
9585
    def from_binary(data):
9586
        return DataChangeFilter(data)
9587
9588 1
    def _binary_init(self, data):
9589
        self.Trigger = DataChangeTrigger(uatype_UInt32.unpack(data.read(4))[0])
9590
        self.DeadbandType = uatype_UInt32.unpack(data.read(4))[0]
9591
        self.DeadbandValue = uatype_Double.unpack(data.read(8))[0]
9592
9593 1
    def __str__(self):
9594
        return 'DataChangeFilter(' + 'Trigger:' + str(self.Trigger) + ', ' + \
9595
               'DeadbandType:' + str(self.DeadbandType) + ', ' + \
9596
               'DeadbandValue:' + str(self.DeadbandValue) + ')'
9597
9598 1
    __repr__ = __str__
9599
9600
9601 1 View Code Duplication
class EventFilter(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9602
    '''
9603
    :ivar SelectClauses:
9604
    :vartype SelectClauses: SimpleAttributeOperand
9605
    :ivar WhereClause:
9606
    :vartype WhereClause: ContentFilter
9607
    '''
9608 1
    def __init__(self, binary=None):
9609 1
        if binary is not None:
9610 1
            self._binary_init(binary)
9611 1
            self._freeze = True
9612 1
            return
9613 1
        self.SelectClauses = []
9614 1
        self.WhereClause = ContentFilter()
9615 1
        self._freeze = True
9616
9617 1
    def to_binary(self):
9618 1
        packet = []
9619 1
        packet.append(uatype_Int32.pack(len(self.SelectClauses)))
9620 1
        for fieldname in self.SelectClauses:
9621 1
            packet.append(fieldname.to_binary())
9622 1
        packet.append(self.WhereClause.to_binary())
9623 1
        return b''.join(packet)
9624
9625 1
    @staticmethod
9626
    def from_binary(data):
9627 1
        return EventFilter(data)
9628
9629 1
    def _binary_init(self, data):
9630 1
        length = uatype_Int32.unpack(data.read(4))[0]
9631 1
        array = []
9632 1
        if length != -1:
9633 1
            for _ in range(0, length):
9634 1
                array.append(SimpleAttributeOperand.from_binary(data))
9635 1
        self.SelectClauses = array
9636 1
        self.WhereClause = ContentFilter.from_binary(data)
9637
9638 1
    def __str__(self):
9639
        return 'EventFilter(' + 'SelectClauses:' + str(self.SelectClauses) + ', ' + \
9640
               'WhereClause:' + str(self.WhereClause) + ')'
9641
9642 1
    __repr__ = __str__
9643
9644
9645 1
class AggregateConfiguration(FrozenClass):
9646
    '''
9647
    :ivar UseServerCapabilitiesDefaults:
9648
    :vartype UseServerCapabilitiesDefaults: Boolean
9649
    :ivar TreatUncertainAsBad:
9650
    :vartype TreatUncertainAsBad: Boolean
9651
    :ivar PercentDataBad:
9652
    :vartype PercentDataBad: Byte
9653
    :ivar PercentDataGood:
9654
    :vartype PercentDataGood: Byte
9655
    :ivar UseSlopedExtrapolation:
9656
    :vartype UseSlopedExtrapolation: Boolean
9657
    '''
9658 1
    def __init__(self, binary=None):
9659
        if binary is not None:
9660
            self._binary_init(binary)
9661
            self._freeze = True
9662
            return
9663
        self.UseServerCapabilitiesDefaults = True
9664
        self.TreatUncertainAsBad = True
9665
        self.PercentDataBad = 0
9666
        self.PercentDataGood = 0
9667
        self.UseSlopedExtrapolation = True
9668
        self._freeze = True
9669
9670 1
    def to_binary(self):
9671
        packet = []
9672
        packet.append(uatype_Boolean.pack(self.UseServerCapabilitiesDefaults))
9673
        packet.append(uatype_Boolean.pack(self.TreatUncertainAsBad))
9674
        packet.append(uatype_Byte.pack(self.PercentDataBad))
9675
        packet.append(uatype_Byte.pack(self.PercentDataGood))
9676
        packet.append(uatype_Boolean.pack(self.UseSlopedExtrapolation))
9677
        return b''.join(packet)
9678
9679 1
    @staticmethod
9680
    def from_binary(data):
9681
        return AggregateConfiguration(data)
9682
9683 1
    def _binary_init(self, data):
9684
        self.UseServerCapabilitiesDefaults = uatype_Boolean.unpack(data.read(1))[0]
9685
        self.TreatUncertainAsBad = uatype_Boolean.unpack(data.read(1))[0]
9686
        self.PercentDataBad = uatype_Byte.unpack(data.read(1))[0]
9687
        self.PercentDataGood = uatype_Byte.unpack(data.read(1))[0]
9688
        self.UseSlopedExtrapolation = uatype_Boolean.unpack(data.read(1))[0]
9689
9690 1
    def __str__(self):
9691
        return 'AggregateConfiguration(' + 'UseServerCapabilitiesDefaults:' + str(self.UseServerCapabilitiesDefaults) + ', ' + \
9692
               'TreatUncertainAsBad:' + str(self.TreatUncertainAsBad) + ', ' + \
9693
               'PercentDataBad:' + str(self.PercentDataBad) + ', ' + \
9694
               'PercentDataGood:' + str(self.PercentDataGood) + ', ' + \
9695
               'UseSlopedExtrapolation:' + str(self.UseSlopedExtrapolation) + ')'
9696
9697 1
    __repr__ = __str__
9698
9699
9700 1 View Code Duplication
class AggregateFilter(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9701
    '''
9702
    :ivar StartTime:
9703
    :vartype StartTime: DateTime
9704
    :ivar AggregateType:
9705
    :vartype AggregateType: NodeId
9706
    :ivar ProcessingInterval:
9707
    :vartype ProcessingInterval: Double
9708
    :ivar AggregateConfiguration:
9709
    :vartype AggregateConfiguration: AggregateConfiguration
9710
    '''
9711 1
    def __init__(self, binary=None):
9712
        if binary is not None:
9713
            self._binary_init(binary)
9714
            self._freeze = True
9715
            return
9716
        self.StartTime = datetime.now()
9717
        self.AggregateType = NodeId()
9718
        self.ProcessingInterval = 0
9719
        self.AggregateConfiguration = AggregateConfiguration()
9720
        self._freeze = True
9721
9722 1
    def to_binary(self):
9723
        packet = []
9724
        packet.append(pack_datetime(self.StartTime))
9725
        packet.append(self.AggregateType.to_binary())
9726
        packet.append(uatype_Double.pack(self.ProcessingInterval))
9727
        packet.append(self.AggregateConfiguration.to_binary())
9728
        return b''.join(packet)
9729
9730 1
    @staticmethod
9731
    def from_binary(data):
9732
        return AggregateFilter(data)
9733
9734 1
    def _binary_init(self, data):
9735
        self.StartTime = unpack_datetime(data)
9736
        self.AggregateType = NodeId.from_binary(data)
9737
        self.ProcessingInterval = uatype_Double.unpack(data.read(8))[0]
9738
        self.AggregateConfiguration = AggregateConfiguration.from_binary(data)
9739
9740 1
    def __str__(self):
9741
        return 'AggregateFilter(' + 'StartTime:' + str(self.StartTime) + ', ' + \
9742
               'AggregateType:' + str(self.AggregateType) + ', ' + \
9743
               'ProcessingInterval:' + str(self.ProcessingInterval) + ', ' + \
9744
               'AggregateConfiguration:' + str(self.AggregateConfiguration) + ')'
9745
9746 1
    __repr__ = __str__
9747
9748
9749 1 View Code Duplication
class MonitoringFilterResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9750
    '''
9751
    '''
9752 1
    def __init__(self, binary=None):
9753
        if binary is not None:
9754
            self._binary_init(binary)
9755
            self._freeze = True
9756
            return
9757
        self._freeze = True
9758
9759 1
    def to_binary(self):
9760
        packet = []
9761
        return b''.join(packet)
9762
9763 1
    @staticmethod
9764
    def from_binary(data):
9765
        return MonitoringFilterResult(data)
9766
9767 1
    def _binary_init(self, data):
9768
        pass
9769
9770 1
    def __str__(self):
9771
        return 'MonitoringFilterResult(' +  + ')'
9772
9773 1
    __repr__ = __str__
9774
9775
9776 1 View Code Duplication
class EventFilterResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9777
    '''
9778
    :ivar SelectClauseResults:
9779
    :vartype SelectClauseResults: StatusCode
9780
    :ivar SelectClauseDiagnosticInfos:
9781
    :vartype SelectClauseDiagnosticInfos: DiagnosticInfo
9782
    :ivar WhereClauseResult:
9783
    :vartype WhereClauseResult: ContentFilterResult
9784
    '''
9785 1
    def __init__(self, binary=None):
9786 1
        if binary is not None:
9787 1
            self._binary_init(binary)
9788 1
            self._freeze = True
9789 1
            return
9790 1
        self.SelectClauseResults = []
9791 1
        self.SelectClauseDiagnosticInfos = []
9792 1
        self.WhereClauseResult = ContentFilterResult()
9793 1
        self._freeze = True
9794
9795 1
    def to_binary(self):
9796 1
        packet = []
9797 1
        packet.append(uatype_Int32.pack(len(self.SelectClauseResults)))
9798 1
        for fieldname in self.SelectClauseResults:
9799 1
            packet.append(fieldname.to_binary())
9800 1
        packet.append(uatype_Int32.pack(len(self.SelectClauseDiagnosticInfos)))
9801 1
        for fieldname in self.SelectClauseDiagnosticInfos:
9802
            packet.append(fieldname.to_binary())
9803 1
        packet.append(self.WhereClauseResult.to_binary())
9804 1
        return b''.join(packet)
9805
9806 1
    @staticmethod
9807
    def from_binary(data):
9808 1
        return EventFilterResult(data)
9809
9810 1
    def _binary_init(self, data):
9811 1
        length = uatype_Int32.unpack(data.read(4))[0]
9812 1
        array = []
9813 1
        if length != -1:
9814 1
            for _ in range(0, length):
9815 1
                array.append(StatusCode.from_binary(data))
9816 1
        self.SelectClauseResults = array
9817 1
        length = uatype_Int32.unpack(data.read(4))[0]
9818 1
        array = []
9819 1
        if length != -1:
9820 1
            for _ in range(0, length):
9821
                array.append(DiagnosticInfo.from_binary(data))
9822 1
        self.SelectClauseDiagnosticInfos = array
9823 1
        self.WhereClauseResult = ContentFilterResult.from_binary(data)
9824
9825 1
    def __str__(self):
9826
        return 'EventFilterResult(' + 'SelectClauseResults:' + str(self.SelectClauseResults) + ', ' + \
9827
               'SelectClauseDiagnosticInfos:' + str(self.SelectClauseDiagnosticInfos) + ', ' + \
9828
               'WhereClauseResult:' + str(self.WhereClauseResult) + ')'
9829
9830 1
    __repr__ = __str__
9831
9832
9833 1
class AggregateFilterResult(FrozenClass):
9834
    '''
9835
    :ivar RevisedStartTime:
9836
    :vartype RevisedStartTime: DateTime
9837
    :ivar RevisedProcessingInterval:
9838
    :vartype RevisedProcessingInterval: Double
9839
    :ivar RevisedAggregateConfiguration:
9840
    :vartype RevisedAggregateConfiguration: AggregateConfiguration
9841
    '''
9842 1
    def __init__(self, binary=None):
9843
        if binary is not None:
9844
            self._binary_init(binary)
9845
            self._freeze = True
9846
            return
9847
        self.RevisedStartTime = datetime.now()
9848
        self.RevisedProcessingInterval = 0
9849
        self.RevisedAggregateConfiguration = AggregateConfiguration()
9850
        self._freeze = True
9851
9852 1
    def to_binary(self):
9853
        packet = []
9854
        packet.append(pack_datetime(self.RevisedStartTime))
9855
        packet.append(uatype_Double.pack(self.RevisedProcessingInterval))
9856
        packet.append(self.RevisedAggregateConfiguration.to_binary())
9857
        return b''.join(packet)
9858
9859 1
    @staticmethod
9860
    def from_binary(data):
9861
        return AggregateFilterResult(data)
9862
9863 1
    def _binary_init(self, data):
9864
        self.RevisedStartTime = unpack_datetime(data)
9865
        self.RevisedProcessingInterval = uatype_Double.unpack(data.read(8))[0]
9866
        self.RevisedAggregateConfiguration = AggregateConfiguration.from_binary(data)
9867
9868 1
    def __str__(self):
9869
        return 'AggregateFilterResult(' + 'RevisedStartTime:' + str(self.RevisedStartTime) + ', ' + \
9870
               'RevisedProcessingInterval:' + str(self.RevisedProcessingInterval) + ', ' + \
9871
               'RevisedAggregateConfiguration:' + str(self.RevisedAggregateConfiguration) + ')'
9872
9873 1
    __repr__ = __str__
9874
9875
9876 1 View Code Duplication
class MonitoringParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9877
    '''
9878
    :ivar ClientHandle:
9879
    :vartype ClientHandle: UInt32
9880
    :ivar SamplingInterval:
9881
    :vartype SamplingInterval: Double
9882
    :ivar Filter:
9883
    :vartype Filter: ExtensionObject
9884
    :ivar QueueSize:
9885
    :vartype QueueSize: UInt32
9886
    :ivar DiscardOldest:
9887
    :vartype DiscardOldest: Boolean
9888
    '''
9889 1
    def __init__(self, binary=None):
9890 1
        if binary is not None:
9891 1
            self._binary_init(binary)
9892 1
            self._freeze = True
9893 1
            return
9894 1
        self.ClientHandle = 0
9895 1
        self.SamplingInterval = 0
9896 1
        self.Filter = None
9897 1
        self.QueueSize = 0
9898 1
        self.DiscardOldest = True
9899 1
        self._freeze = True
9900
9901 1
    def to_binary(self):
9902 1
        packet = []
9903 1
        packet.append(uatype_UInt32.pack(self.ClientHandle))
9904 1
        packet.append(uatype_Double.pack(self.SamplingInterval))
9905 1
        packet.append(extensionobject_to_binary(self.Filter))
9906 1
        packet.append(uatype_UInt32.pack(self.QueueSize))
9907 1
        packet.append(uatype_Boolean.pack(self.DiscardOldest))
9908 1
        return b''.join(packet)
9909
9910 1
    @staticmethod
9911
    def from_binary(data):
9912 1
        return MonitoringParameters(data)
9913
9914 1
    def _binary_init(self, data):
9915 1
        self.ClientHandle = uatype_UInt32.unpack(data.read(4))[0]
9916 1
        self.SamplingInterval = uatype_Double.unpack(data.read(8))[0]
9917 1
        self.Filter = extensionobject_from_binary(data)
9918 1
        self.QueueSize = uatype_UInt32.unpack(data.read(4))[0]
9919 1
        self.DiscardOldest = uatype_Boolean.unpack(data.read(1))[0]
9920
9921 1
    def __str__(self):
9922
        return 'MonitoringParameters(' + 'ClientHandle:' + str(self.ClientHandle) + ', ' + \
9923
               'SamplingInterval:' + str(self.SamplingInterval) + ', ' + \
9924
               'Filter:' + str(self.Filter) + ', ' + \
9925
               'QueueSize:' + str(self.QueueSize) + ', ' + \
9926
               'DiscardOldest:' + str(self.DiscardOldest) + ')'
9927
9928 1
    __repr__ = __str__
9929
9930
9931 1 View Code Duplication
class MonitoredItemCreateRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9932
    '''
9933
    :ivar ItemToMonitor:
9934
    :vartype ItemToMonitor: ReadValueId
9935
    :ivar MonitoringMode:
9936
    :vartype MonitoringMode: MonitoringMode
9937
    :ivar RequestedParameters:
9938
    :vartype RequestedParameters: MonitoringParameters
9939
    '''
9940 1
    def __init__(self, binary=None):
9941 1
        if binary is not None:
9942 1
            self._binary_init(binary)
9943 1
            self._freeze = True
9944 1
            return
9945 1
        self.ItemToMonitor = ReadValueId()
9946 1
        self.MonitoringMode = MonitoringMode(0)
9947 1
        self.RequestedParameters = MonitoringParameters()
9948 1
        self._freeze = True
9949
9950 1
    def to_binary(self):
9951 1
        packet = []
9952 1
        packet.append(self.ItemToMonitor.to_binary())
9953 1
        packet.append(uatype_UInt32.pack(self.MonitoringMode.value))
9954 1
        packet.append(self.RequestedParameters.to_binary())
9955 1
        return b''.join(packet)
9956
9957 1
    @staticmethod
9958
    def from_binary(data):
9959 1
        return MonitoredItemCreateRequest(data)
9960
9961 1
    def _binary_init(self, data):
9962 1
        self.ItemToMonitor = ReadValueId.from_binary(data)
9963 1
        self.MonitoringMode = MonitoringMode(uatype_UInt32.unpack(data.read(4))[0])
9964 1
        self.RequestedParameters = MonitoringParameters.from_binary(data)
9965
9966 1
    def __str__(self):
9967
        return 'MonitoredItemCreateRequest(' + 'ItemToMonitor:' + str(self.ItemToMonitor) + ', ' + \
9968
               'MonitoringMode:' + str(self.MonitoringMode) + ', ' + \
9969
               'RequestedParameters:' + str(self.RequestedParameters) + ')'
9970
9971 1
    __repr__ = __str__
9972
9973
9974 1 View Code Duplication
class MonitoredItemCreateResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9975
    '''
9976
    :ivar StatusCode:
9977
    :vartype StatusCode: StatusCode
9978
    :ivar MonitoredItemId:
9979
    :vartype MonitoredItemId: UInt32
9980
    :ivar RevisedSamplingInterval:
9981
    :vartype RevisedSamplingInterval: Double
9982
    :ivar RevisedQueueSize:
9983
    :vartype RevisedQueueSize: UInt32
9984
    :ivar FilterResult:
9985
    :vartype FilterResult: ExtensionObject
9986
    '''
9987 1
    def __init__(self, binary=None):
9988 1
        if binary is not None:
9989 1
            self._binary_init(binary)
9990 1
            self._freeze = True
9991 1
            return
9992 1
        self.StatusCode = StatusCode()
9993 1
        self.MonitoredItemId = 0
9994 1
        self.RevisedSamplingInterval = 0
9995 1
        self.RevisedQueueSize = 0
9996 1
        self.FilterResult = None
9997 1
        self._freeze = True
9998
9999 1
    def to_binary(self):
10000 1
        packet = []
10001 1
        packet.append(self.StatusCode.to_binary())
10002 1
        packet.append(uatype_UInt32.pack(self.MonitoredItemId))
10003 1
        packet.append(uatype_Double.pack(self.RevisedSamplingInterval))
10004 1
        packet.append(uatype_UInt32.pack(self.RevisedQueueSize))
10005 1
        packet.append(extensionobject_to_binary(self.FilterResult))
10006 1
        return b''.join(packet)
10007
10008 1
    @staticmethod
10009
    def from_binary(data):
10010 1
        return MonitoredItemCreateResult(data)
10011
10012 1
    def _binary_init(self, data):
10013 1
        self.StatusCode = StatusCode.from_binary(data)
10014 1
        self.MonitoredItemId = uatype_UInt32.unpack(data.read(4))[0]
10015 1
        self.RevisedSamplingInterval = uatype_Double.unpack(data.read(8))[0]
10016 1
        self.RevisedQueueSize = uatype_UInt32.unpack(data.read(4))[0]
10017 1
        self.FilterResult = extensionobject_from_binary(data)
10018
10019 1
    def __str__(self):
10020
        return 'MonitoredItemCreateResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
10021
               'MonitoredItemId:' + str(self.MonitoredItemId) + ', ' + \
10022
               'RevisedSamplingInterval:' + str(self.RevisedSamplingInterval) + ', ' + \
10023
               'RevisedQueueSize:' + str(self.RevisedQueueSize) + ', ' + \
10024
               'FilterResult:' + str(self.FilterResult) + ')'
10025
10026 1
    __repr__ = __str__
10027
10028
10029 1 View Code Duplication
class CreateMonitoredItemsParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10030
    '''
10031
    :ivar SubscriptionId:
10032
    :vartype SubscriptionId: UInt32
10033
    :ivar TimestampsToReturn:
10034
    :vartype TimestampsToReturn: TimestampsToReturn
10035
    :ivar ItemsToCreate:
10036
    :vartype ItemsToCreate: MonitoredItemCreateRequest
10037
    '''
10038 1
    def __init__(self, binary=None):
10039 1
        if binary is not None:
10040 1
            self._binary_init(binary)
10041 1
            self._freeze = True
10042 1
            return
10043 1
        self.SubscriptionId = 0
10044 1
        self.TimestampsToReturn = TimestampsToReturn(0)
10045 1
        self.ItemsToCreate = []
10046 1
        self._freeze = True
10047
10048 1
    def to_binary(self):
10049 1
        packet = []
10050 1
        packet.append(uatype_UInt32.pack(self.SubscriptionId))
10051 1
        packet.append(uatype_UInt32.pack(self.TimestampsToReturn.value))
10052 1
        packet.append(uatype_Int32.pack(len(self.ItemsToCreate)))
10053 1
        for fieldname in self.ItemsToCreate:
10054 1
            packet.append(fieldname.to_binary())
10055 1
        return b''.join(packet)
10056
10057 1
    @staticmethod
10058
    def from_binary(data):
10059 1
        return CreateMonitoredItemsParameters(data)
10060
10061 1
    def _binary_init(self, data):
10062 1
        self.SubscriptionId = uatype_UInt32.unpack(data.read(4))[0]
10063 1
        self.TimestampsToReturn = TimestampsToReturn(uatype_UInt32.unpack(data.read(4))[0])
10064 1
        length = uatype_Int32.unpack(data.read(4))[0]
10065 1
        array = []
10066 1
        if length != -1:
10067 1
            for _ in range(0, length):
10068 1
                array.append(MonitoredItemCreateRequest.from_binary(data))
10069 1
        self.ItemsToCreate = array
10070
10071 1
    def __str__(self):
10072
        return 'CreateMonitoredItemsParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
10073
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
10074
               'ItemsToCreate:' + str(self.ItemsToCreate) + ')'
10075
10076 1
    __repr__ = __str__
10077
10078
10079 1 View Code Duplication
class CreateMonitoredItemsRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10080
    '''
10081
    :ivar TypeId:
10082
    :vartype TypeId: NodeId
10083
    :ivar RequestHeader:
10084
    :vartype RequestHeader: RequestHeader
10085
    :ivar Parameters:
10086
    :vartype Parameters: CreateMonitoredItemsParameters
10087
    '''
10088 1
    def __init__(self, binary=None):
10089 1
        if binary is not None:
10090
            self._binary_init(binary)
10091
            self._freeze = True
10092
            return
10093 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateMonitoredItemsRequest_Encoding_DefaultBinary)
10094 1
        self.RequestHeader = RequestHeader()
10095 1
        self.Parameters = CreateMonitoredItemsParameters()
10096 1
        self._freeze = True
10097
10098 1
    def to_binary(self):
10099 1
        packet = []
10100 1
        packet.append(self.TypeId.to_binary())
10101 1
        packet.append(self.RequestHeader.to_binary())
10102 1
        packet.append(self.Parameters.to_binary())
10103 1
        return b''.join(packet)
10104
10105 1
    @staticmethod
10106
    def from_binary(data):
10107
        return CreateMonitoredItemsRequest(data)
10108
10109 1
    def _binary_init(self, data):
10110
        self.TypeId = NodeId.from_binary(data)
10111
        self.RequestHeader = RequestHeader.from_binary(data)
10112
        self.Parameters = CreateMonitoredItemsParameters.from_binary(data)
10113
10114 1
    def __str__(self):
10115
        return 'CreateMonitoredItemsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10116
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
10117
               'Parameters:' + str(self.Parameters) + ')'
10118
10119 1
    __repr__ = __str__
10120
10121
10122 1 View Code Duplication
class CreateMonitoredItemsResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10123
    '''
10124
    :ivar TypeId:
10125
    :vartype TypeId: NodeId
10126
    :ivar ResponseHeader:
10127
    :vartype ResponseHeader: ResponseHeader
10128
    :ivar Results:
10129
    :vartype Results: MonitoredItemCreateResult
10130
    :ivar DiagnosticInfos:
10131
    :vartype DiagnosticInfos: DiagnosticInfo
10132
    '''
10133 1
    def __init__(self, binary=None):
10134 1
        if binary is not None:
10135 1
            self._binary_init(binary)
10136 1
            self._freeze = True
10137 1
            return
10138 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateMonitoredItemsResponse_Encoding_DefaultBinary)
10139 1
        self.ResponseHeader = ResponseHeader()
10140 1
        self.Results = []
10141 1
        self.DiagnosticInfos = []
10142 1
        self._freeze = True
10143
10144 1
    def to_binary(self):
10145 1
        packet = []
10146 1
        packet.append(self.TypeId.to_binary())
10147 1
        packet.append(self.ResponseHeader.to_binary())
10148 1
        packet.append(uatype_Int32.pack(len(self.Results)))
10149 1
        for fieldname in self.Results:
10150 1
            packet.append(fieldname.to_binary())
10151 1
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
10152 1
        for fieldname in self.DiagnosticInfos:
10153
            packet.append(fieldname.to_binary())
10154 1
        return b''.join(packet)
10155
10156 1
    @staticmethod
10157
    def from_binary(data):
10158 1
        return CreateMonitoredItemsResponse(data)
10159
10160 1
    def _binary_init(self, data):
10161 1
        self.TypeId = NodeId.from_binary(data)
10162 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
10163 1
        length = uatype_Int32.unpack(data.read(4))[0]
10164 1
        array = []
10165 1
        if length != -1:
10166 1
            for _ in range(0, length):
10167 1
                array.append(MonitoredItemCreateResult.from_binary(data))
10168 1
        self.Results = array
10169 1
        length = uatype_Int32.unpack(data.read(4))[0]
10170 1
        array = []
10171 1
        if length != -1:
10172 1
            for _ in range(0, length):
10173
                array.append(DiagnosticInfo.from_binary(data))
10174 1
        self.DiagnosticInfos = array
10175
10176 1
    def __str__(self):
10177
        return 'CreateMonitoredItemsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10178
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
10179
               'Results:' + str(self.Results) + ', ' + \
10180
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
10181
10182 1
    __repr__ = __str__
10183
10184
10185 1 View Code Duplication
class MonitoredItemModifyRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10186
    '''
10187
    :ivar MonitoredItemId:
10188
    :vartype MonitoredItemId: UInt32
10189
    :ivar RequestedParameters:
10190
    :vartype RequestedParameters: MonitoringParameters
10191
    '''
10192 1
    def __init__(self, binary=None):
10193
        if binary is not None:
10194
            self._binary_init(binary)
10195
            self._freeze = True
10196
            return
10197
        self.MonitoredItemId = 0
10198
        self.RequestedParameters = MonitoringParameters()
10199
        self._freeze = True
10200
10201 1
    def to_binary(self):
10202
        packet = []
10203
        packet.append(uatype_UInt32.pack(self.MonitoredItemId))
10204
        packet.append(self.RequestedParameters.to_binary())
10205
        return b''.join(packet)
10206
10207 1
    @staticmethod
10208
    def from_binary(data):
10209
        return MonitoredItemModifyRequest(data)
10210
10211 1
    def _binary_init(self, data):
10212
        self.MonitoredItemId = uatype_UInt32.unpack(data.read(4))[0]
10213
        self.RequestedParameters = MonitoringParameters.from_binary(data)
10214
10215 1
    def __str__(self):
10216
        return 'MonitoredItemModifyRequest(' + 'MonitoredItemId:' + str(self.MonitoredItemId) + ', ' + \
10217
               'RequestedParameters:' + str(self.RequestedParameters) + ')'
10218
10219 1
    __repr__ = __str__
10220
10221
10222 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...
10223
    '''
10224
    :ivar StatusCode:
10225
    :vartype StatusCode: StatusCode
10226
    :ivar RevisedSamplingInterval:
10227
    :vartype RevisedSamplingInterval: Double
10228
    :ivar RevisedQueueSize:
10229
    :vartype RevisedQueueSize: UInt32
10230
    :ivar FilterResult:
10231
    :vartype FilterResult: ExtensionObject
10232
    '''
10233 1
    def __init__(self, binary=None):
10234
        if binary is not None:
10235
            self._binary_init(binary)
10236
            self._freeze = True
10237
            return
10238
        self.StatusCode = StatusCode()
10239
        self.RevisedSamplingInterval = 0
10240
        self.RevisedQueueSize = 0
10241
        self.FilterResult = None
10242
        self._freeze = True
10243
10244 1
    def to_binary(self):
10245
        packet = []
10246
        packet.append(self.StatusCode.to_binary())
10247
        packet.append(uatype_Double.pack(self.RevisedSamplingInterval))
10248
        packet.append(uatype_UInt32.pack(self.RevisedQueueSize))
10249
        packet.append(extensionobject_to_binary(self.FilterResult))
10250
        return b''.join(packet)
10251
10252 1
    @staticmethod
10253
    def from_binary(data):
10254
        return MonitoredItemModifyResult(data)
10255
10256 1
    def _binary_init(self, data):
10257
        self.StatusCode = StatusCode.from_binary(data)
10258
        self.RevisedSamplingInterval = uatype_Double.unpack(data.read(8))[0]
10259
        self.RevisedQueueSize = uatype_UInt32.unpack(data.read(4))[0]
10260
        self.FilterResult = extensionobject_from_binary(data)
10261
10262 1
    def __str__(self):
10263
        return 'MonitoredItemModifyResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
10264
               'RevisedSamplingInterval:' + str(self.RevisedSamplingInterval) + ', ' + \
10265
               'RevisedQueueSize:' + str(self.RevisedQueueSize) + ', ' + \
10266
               'FilterResult:' + str(self.FilterResult) + ')'
10267
10268 1
    __repr__ = __str__
10269
10270
10271 1 View Code Duplication
class ModifyMonitoredItemsParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10272
    '''
10273
    :ivar SubscriptionId:
10274
    :vartype SubscriptionId: UInt32
10275
    :ivar TimestampsToReturn:
10276
    :vartype TimestampsToReturn: TimestampsToReturn
10277
    :ivar ItemsToModify:
10278
    :vartype ItemsToModify: MonitoredItemModifyRequest
10279
    '''
10280 1
    def __init__(self, binary=None):
10281
        if binary is not None:
10282
            self._binary_init(binary)
10283
            self._freeze = True
10284
            return
10285
        self.SubscriptionId = 0
10286
        self.TimestampsToReturn = TimestampsToReturn(0)
10287
        self.ItemsToModify = []
10288
        self._freeze = True
10289
10290 1
    def to_binary(self):
10291
        packet = []
10292
        packet.append(uatype_UInt32.pack(self.SubscriptionId))
10293
        packet.append(uatype_UInt32.pack(self.TimestampsToReturn.value))
10294
        packet.append(uatype_Int32.pack(len(self.ItemsToModify)))
10295
        for fieldname in self.ItemsToModify:
10296
            packet.append(fieldname.to_binary())
10297
        return b''.join(packet)
10298
10299 1
    @staticmethod
10300
    def from_binary(data):
10301
        return ModifyMonitoredItemsParameters(data)
10302
10303 1
    def _binary_init(self, data):
10304
        self.SubscriptionId = uatype_UInt32.unpack(data.read(4))[0]
10305
        self.TimestampsToReturn = TimestampsToReturn(uatype_UInt32.unpack(data.read(4))[0])
10306
        length = uatype_Int32.unpack(data.read(4))[0]
10307
        array = []
10308
        if length != -1:
10309
            for _ in range(0, length):
10310
                array.append(MonitoredItemModifyRequest.from_binary(data))
10311
        self.ItemsToModify = array
10312
10313 1
    def __str__(self):
10314
        return 'ModifyMonitoredItemsParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
10315
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
10316
               'ItemsToModify:' + str(self.ItemsToModify) + ')'
10317
10318 1
    __repr__ = __str__
10319
10320
10321 1 View Code Duplication
class ModifyMonitoredItemsRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10322
    '''
10323
    :ivar TypeId:
10324
    :vartype TypeId: NodeId
10325
    :ivar RequestHeader:
10326
    :vartype RequestHeader: RequestHeader
10327
    :ivar Parameters:
10328
    :vartype Parameters: ModifyMonitoredItemsParameters
10329
    '''
10330 1
    def __init__(self, binary=None):
10331
        if binary is not None:
10332
            self._binary_init(binary)
10333
            self._freeze = True
10334
            return
10335
        self.TypeId = FourByteNodeId(ObjectIds.ModifyMonitoredItemsRequest_Encoding_DefaultBinary)
10336
        self.RequestHeader = RequestHeader()
10337
        self.Parameters = ModifyMonitoredItemsParameters()
10338
        self._freeze = True
10339
10340 1
    def to_binary(self):
10341
        packet = []
10342
        packet.append(self.TypeId.to_binary())
10343
        packet.append(self.RequestHeader.to_binary())
10344
        packet.append(self.Parameters.to_binary())
10345
        return b''.join(packet)
10346
10347 1
    @staticmethod
10348
    def from_binary(data):
10349
        return ModifyMonitoredItemsRequest(data)
10350
10351 1
    def _binary_init(self, data):
10352
        self.TypeId = NodeId.from_binary(data)
10353
        self.RequestHeader = RequestHeader.from_binary(data)
10354
        self.Parameters = ModifyMonitoredItemsParameters.from_binary(data)
10355
10356 1
    def __str__(self):
10357
        return 'ModifyMonitoredItemsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10358
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
10359
               'Parameters:' + str(self.Parameters) + ')'
10360
10361 1
    __repr__ = __str__
10362
10363
10364 1 View Code Duplication
class ModifyMonitoredItemsResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10365
    '''
10366
    :ivar TypeId:
10367
    :vartype TypeId: NodeId
10368
    :ivar ResponseHeader:
10369
    :vartype ResponseHeader: ResponseHeader
10370
    :ivar Results:
10371
    :vartype Results: MonitoredItemModifyResult
10372
    :ivar DiagnosticInfos:
10373
    :vartype DiagnosticInfos: DiagnosticInfo
10374
    '''
10375 1
    def __init__(self, binary=None):
10376
        if binary is not None:
10377
            self._binary_init(binary)
10378
            self._freeze = True
10379
            return
10380
        self.TypeId = FourByteNodeId(ObjectIds.ModifyMonitoredItemsResponse_Encoding_DefaultBinary)
10381
        self.ResponseHeader = ResponseHeader()
10382
        self.Results = []
10383
        self.DiagnosticInfos = []
10384
        self._freeze = True
10385
10386 1
    def to_binary(self):
10387
        packet = []
10388
        packet.append(self.TypeId.to_binary())
10389
        packet.append(self.ResponseHeader.to_binary())
10390
        packet.append(uatype_Int32.pack(len(self.Results)))
10391
        for fieldname in self.Results:
10392
            packet.append(fieldname.to_binary())
10393
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
10394
        for fieldname in self.DiagnosticInfos:
10395
            packet.append(fieldname.to_binary())
10396
        return b''.join(packet)
10397
10398 1
    @staticmethod
10399
    def from_binary(data):
10400
        return ModifyMonitoredItemsResponse(data)
10401
10402 1
    def _binary_init(self, data):
10403
        self.TypeId = NodeId.from_binary(data)
10404
        self.ResponseHeader = ResponseHeader.from_binary(data)
10405
        length = uatype_Int32.unpack(data.read(4))[0]
10406
        array = []
10407
        if length != -1:
10408
            for _ in range(0, length):
10409
                array.append(MonitoredItemModifyResult.from_binary(data))
10410
        self.Results = array
10411
        length = uatype_Int32.unpack(data.read(4))[0]
10412
        array = []
10413
        if length != -1:
10414
            for _ in range(0, length):
10415
                array.append(DiagnosticInfo.from_binary(data))
10416
        self.DiagnosticInfos = array
10417
10418 1
    def __str__(self):
10419
        return 'ModifyMonitoredItemsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10420
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
10421
               'Results:' + str(self.Results) + ', ' + \
10422
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
10423
10424 1
    __repr__ = __str__
10425
10426
10427 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...
10428
    '''
10429
    :ivar SubscriptionId:
10430
    :vartype SubscriptionId: UInt32
10431
    :ivar MonitoringMode:
10432
    :vartype MonitoringMode: MonitoringMode
10433
    :ivar MonitoredItemIds:
10434
    :vartype MonitoredItemIds: UInt32
10435
    '''
10436 1
    def __init__(self, binary=None):
10437
        if binary is not None:
10438
            self._binary_init(binary)
10439
            self._freeze = True
10440
            return
10441
        self.SubscriptionId = 0
10442
        self.MonitoringMode = MonitoringMode(0)
10443
        self.MonitoredItemIds = []
10444
        self._freeze = True
10445
10446 1
    def to_binary(self):
10447
        packet = []
10448
        packet.append(uatype_UInt32.pack(self.SubscriptionId))
10449
        packet.append(uatype_UInt32.pack(self.MonitoringMode.value))
10450
        packet.append(uatype_Int32.pack(len(self.MonitoredItemIds)))
10451
        for fieldname in self.MonitoredItemIds:
10452
            packet.append(uatype_UInt32.pack(fieldname))
10453
        return b''.join(packet)
10454
10455 1
    @staticmethod
10456
    def from_binary(data):
10457
        return SetMonitoringModeParameters(data)
10458
10459 1
    def _binary_init(self, data):
10460
        self.SubscriptionId = uatype_UInt32.unpack(data.read(4))[0]
10461
        self.MonitoringMode = MonitoringMode(uatype_UInt32.unpack(data.read(4))[0])
10462
        self.MonitoredItemIds = unpack_uatype_array('UInt32', data)
10463
10464 1
    def __str__(self):
10465
        return 'SetMonitoringModeParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
10466
               'MonitoringMode:' + str(self.MonitoringMode) + ', ' + \
10467
               'MonitoredItemIds:' + str(self.MonitoredItemIds) + ')'
10468
10469 1
    __repr__ = __str__
10470
10471
10472 1 View Code Duplication
class SetMonitoringModeRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10473
    '''
10474
    :ivar TypeId:
10475
    :vartype TypeId: NodeId
10476
    :ivar RequestHeader:
10477
    :vartype RequestHeader: RequestHeader
10478
    :ivar Parameters:
10479
    :vartype Parameters: SetMonitoringModeParameters
10480
    '''
10481 1
    def __init__(self, binary=None):
10482
        if binary is not None:
10483
            self._binary_init(binary)
10484
            self._freeze = True
10485
            return
10486
        self.TypeId = FourByteNodeId(ObjectIds.SetMonitoringModeRequest_Encoding_DefaultBinary)
10487
        self.RequestHeader = RequestHeader()
10488
        self.Parameters = SetMonitoringModeParameters()
10489
        self._freeze = True
10490
10491 1
    def to_binary(self):
10492
        packet = []
10493
        packet.append(self.TypeId.to_binary())
10494
        packet.append(self.RequestHeader.to_binary())
10495
        packet.append(self.Parameters.to_binary())
10496
        return b''.join(packet)
10497
10498 1
    @staticmethod
10499
    def from_binary(data):
10500
        return SetMonitoringModeRequest(data)
10501
10502 1
    def _binary_init(self, data):
10503
        self.TypeId = NodeId.from_binary(data)
10504
        self.RequestHeader = RequestHeader.from_binary(data)
10505
        self.Parameters = SetMonitoringModeParameters.from_binary(data)
10506
10507 1
    def __str__(self):
10508
        return 'SetMonitoringModeRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10509
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
10510
               'Parameters:' + str(self.Parameters) + ')'
10511
10512 1
    __repr__ = __str__
10513
10514
10515 1 View Code Duplication
class SetMonitoringModeResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10516
    '''
10517
    :ivar Results:
10518
    :vartype Results: StatusCode
10519
    :ivar DiagnosticInfos:
10520
    :vartype DiagnosticInfos: DiagnosticInfo
10521
    '''
10522 1
    def __init__(self, binary=None):
10523
        if binary is not None:
10524
            self._binary_init(binary)
10525
            self._freeze = True
10526
            return
10527
        self.Results = []
10528
        self.DiagnosticInfos = []
10529
        self._freeze = True
10530
10531 1
    def to_binary(self):
10532
        packet = []
10533
        packet.append(uatype_Int32.pack(len(self.Results)))
10534
        for fieldname in self.Results:
10535
            packet.append(fieldname.to_binary())
10536
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
10537
        for fieldname in self.DiagnosticInfos:
10538
            packet.append(fieldname.to_binary())
10539
        return b''.join(packet)
10540
10541 1
    @staticmethod
10542
    def from_binary(data):
10543
        return SetMonitoringModeResult(data)
10544
10545 1
    def _binary_init(self, data):
10546
        length = uatype_Int32.unpack(data.read(4))[0]
10547
        array = []
10548
        if length != -1:
10549
            for _ in range(0, length):
10550
                array.append(StatusCode.from_binary(data))
10551
        self.Results = array
10552
        length = uatype_Int32.unpack(data.read(4))[0]
10553
        array = []
10554
        if length != -1:
10555
            for _ in range(0, length):
10556
                array.append(DiagnosticInfo.from_binary(data))
10557
        self.DiagnosticInfos = array
10558
10559 1
    def __str__(self):
10560
        return 'SetMonitoringModeResult(' + 'Results:' + str(self.Results) + ', ' + \
10561
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
10562
10563 1
    __repr__ = __str__
10564
10565
10566 1 View Code Duplication
class SetMonitoringModeResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10567
    '''
10568
    :ivar TypeId:
10569
    :vartype TypeId: NodeId
10570
    :ivar ResponseHeader:
10571
    :vartype ResponseHeader: ResponseHeader
10572
    :ivar Parameters:
10573
    :vartype Parameters: SetMonitoringModeResult
10574
    '''
10575 1
    def __init__(self, binary=None):
10576
        if binary is not None:
10577
            self._binary_init(binary)
10578
            self._freeze = True
10579
            return
10580
        self.TypeId = FourByteNodeId(ObjectIds.SetMonitoringModeResponse_Encoding_DefaultBinary)
10581
        self.ResponseHeader = ResponseHeader()
10582
        self.Parameters = SetMonitoringModeResult()
10583
        self._freeze = True
10584
10585 1
    def to_binary(self):
10586
        packet = []
10587
        packet.append(self.TypeId.to_binary())
10588
        packet.append(self.ResponseHeader.to_binary())
10589
        packet.append(self.Parameters.to_binary())
10590
        return b''.join(packet)
10591
10592 1
    @staticmethod
10593
    def from_binary(data):
10594
        return SetMonitoringModeResponse(data)
10595
10596 1
    def _binary_init(self, data):
10597
        self.TypeId = NodeId.from_binary(data)
10598
        self.ResponseHeader = ResponseHeader.from_binary(data)
10599
        self.Parameters = SetMonitoringModeResult.from_binary(data)
10600
10601 1
    def __str__(self):
10602
        return 'SetMonitoringModeResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10603
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
10604
               'Parameters:' + str(self.Parameters) + ')'
10605
10606 1
    __repr__ = __str__
10607
10608
10609 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...
10610
    '''
10611
    :ivar SubscriptionId:
10612
    :vartype SubscriptionId: UInt32
10613
    :ivar TriggeringItemId:
10614
    :vartype TriggeringItemId: UInt32
10615
    :ivar LinksToAdd:
10616
    :vartype LinksToAdd: UInt32
10617
    :ivar LinksToRemove:
10618
    :vartype LinksToRemove: UInt32
10619
    '''
10620 1
    def __init__(self, binary=None):
10621
        if binary is not None:
10622
            self._binary_init(binary)
10623
            self._freeze = True
10624
            return
10625
        self.SubscriptionId = 0
10626
        self.TriggeringItemId = 0
10627
        self.LinksToAdd = []
10628
        self.LinksToRemove = []
10629
        self._freeze = True
10630
10631 1
    def to_binary(self):
10632
        packet = []
10633
        packet.append(uatype_UInt32.pack(self.SubscriptionId))
10634
        packet.append(uatype_UInt32.pack(self.TriggeringItemId))
10635
        packet.append(uatype_Int32.pack(len(self.LinksToAdd)))
10636
        for fieldname in self.LinksToAdd:
10637
            packet.append(uatype_UInt32.pack(fieldname))
10638
        packet.append(uatype_Int32.pack(len(self.LinksToRemove)))
10639
        for fieldname in self.LinksToRemove:
10640
            packet.append(uatype_UInt32.pack(fieldname))
10641
        return b''.join(packet)
10642
10643 1
    @staticmethod
10644
    def from_binary(data):
10645
        return SetTriggeringParameters(data)
10646
10647 1
    def _binary_init(self, data):
10648
        self.SubscriptionId = uatype_UInt32.unpack(data.read(4))[0]
10649
        self.TriggeringItemId = uatype_UInt32.unpack(data.read(4))[0]
10650
        self.LinksToAdd = unpack_uatype_array('UInt32', data)
10651
        self.LinksToRemove = unpack_uatype_array('UInt32', data)
10652
10653 1
    def __str__(self):
10654
        return 'SetTriggeringParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
10655
               'TriggeringItemId:' + str(self.TriggeringItemId) + ', ' + \
10656
               'LinksToAdd:' + str(self.LinksToAdd) + ', ' + \
10657
               'LinksToRemove:' + str(self.LinksToRemove) + ')'
10658
10659 1
    __repr__ = __str__
10660
10661
10662 1 View Code Duplication
class SetTriggeringRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10663
    '''
10664
    :ivar TypeId:
10665
    :vartype TypeId: NodeId
10666
    :ivar RequestHeader:
10667
    :vartype RequestHeader: RequestHeader
10668
    :ivar Parameters:
10669
    :vartype Parameters: SetTriggeringParameters
10670
    '''
10671 1
    def __init__(self, binary=None):
10672
        if binary is not None:
10673
            self._binary_init(binary)
10674
            self._freeze = True
10675
            return
10676
        self.TypeId = FourByteNodeId(ObjectIds.SetTriggeringRequest_Encoding_DefaultBinary)
10677
        self.RequestHeader = RequestHeader()
10678
        self.Parameters = SetTriggeringParameters()
10679
        self._freeze = True
10680
10681 1
    def to_binary(self):
10682
        packet = []
10683
        packet.append(self.TypeId.to_binary())
10684
        packet.append(self.RequestHeader.to_binary())
10685
        packet.append(self.Parameters.to_binary())
10686
        return b''.join(packet)
10687
10688 1
    @staticmethod
10689
    def from_binary(data):
10690
        return SetTriggeringRequest(data)
10691
10692 1
    def _binary_init(self, data):
10693
        self.TypeId = NodeId.from_binary(data)
10694
        self.RequestHeader = RequestHeader.from_binary(data)
10695
        self.Parameters = SetTriggeringParameters.from_binary(data)
10696
10697 1
    def __str__(self):
10698
        return 'SetTriggeringRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10699
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
10700
               'Parameters:' + str(self.Parameters) + ')'
10701
10702 1
    __repr__ = __str__
10703
10704
10705 1
class SetTriggeringResult(FrozenClass):
10706
    '''
10707
    :ivar AddResults:
10708
    :vartype AddResults: StatusCode
10709
    :ivar AddDiagnosticInfos:
10710
    :vartype AddDiagnosticInfos: DiagnosticInfo
10711
    :ivar RemoveResults:
10712
    :vartype RemoveResults: StatusCode
10713
    :ivar RemoveDiagnosticInfos:
10714
    :vartype RemoveDiagnosticInfos: DiagnosticInfo
10715
    '''
10716 1
    def __init__(self, binary=None):
10717
        if binary is not None:
10718
            self._binary_init(binary)
10719
            self._freeze = True
10720
            return
10721
        self.AddResults = []
10722
        self.AddDiagnosticInfos = []
10723
        self.RemoveResults = []
10724
        self.RemoveDiagnosticInfos = []
10725
        self._freeze = True
10726
10727 1
    def to_binary(self):
10728
        packet = []
10729
        packet.append(uatype_Int32.pack(len(self.AddResults)))
10730
        for fieldname in self.AddResults:
10731
            packet.append(fieldname.to_binary())
10732
        packet.append(uatype_Int32.pack(len(self.AddDiagnosticInfos)))
10733
        for fieldname in self.AddDiagnosticInfos:
10734
            packet.append(fieldname.to_binary())
10735
        packet.append(uatype_Int32.pack(len(self.RemoveResults)))
10736
        for fieldname in self.RemoveResults:
10737
            packet.append(fieldname.to_binary())
10738
        packet.append(uatype_Int32.pack(len(self.RemoveDiagnosticInfos)))
10739
        for fieldname in self.RemoveDiagnosticInfos:
10740
            packet.append(fieldname.to_binary())
10741
        return b''.join(packet)
10742
10743 1
    @staticmethod
10744
    def from_binary(data):
10745
        return SetTriggeringResult(data)
10746
10747 1
    def _binary_init(self, data):
10748
        length = uatype_Int32.unpack(data.read(4))[0]
10749
        array = []
10750
        if length != -1:
10751
            for _ in range(0, length):
10752
                array.append(StatusCode.from_binary(data))
10753
        self.AddResults = array
10754
        length = uatype_Int32.unpack(data.read(4))[0]
10755
        array = []
10756
        if length != -1:
10757
            for _ in range(0, length):
10758
                array.append(DiagnosticInfo.from_binary(data))
10759
        self.AddDiagnosticInfos = array
10760
        length = uatype_Int32.unpack(data.read(4))[0]
10761
        array = []
10762
        if length != -1:
10763
            for _ in range(0, length):
10764
                array.append(StatusCode.from_binary(data))
10765
        self.RemoveResults = array
10766
        length = uatype_Int32.unpack(data.read(4))[0]
10767
        array = []
10768
        if length != -1:
10769
            for _ in range(0, length):
10770
                array.append(DiagnosticInfo.from_binary(data))
10771
        self.RemoveDiagnosticInfos = array
10772
10773 1
    def __str__(self):
10774
        return 'SetTriggeringResult(' + 'AddResults:' + str(self.AddResults) + ', ' + \
10775
               'AddDiagnosticInfos:' + str(self.AddDiagnosticInfos) + ', ' + \
10776
               'RemoveResults:' + str(self.RemoveResults) + ', ' + \
10777
               'RemoveDiagnosticInfos:' + str(self.RemoveDiagnosticInfos) + ')'
10778
10779 1
    __repr__ = __str__
10780
10781
10782 1 View Code Duplication
class SetTriggeringResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10783
    '''
10784
    :ivar TypeId:
10785
    :vartype TypeId: NodeId
10786
    :ivar ResponseHeader:
10787
    :vartype ResponseHeader: ResponseHeader
10788
    :ivar Parameters:
10789
    :vartype Parameters: SetTriggeringResult
10790
    '''
10791 1
    def __init__(self, binary=None):
10792
        if binary is not None:
10793
            self._binary_init(binary)
10794
            self._freeze = True
10795
            return
10796
        self.TypeId = FourByteNodeId(ObjectIds.SetTriggeringResponse_Encoding_DefaultBinary)
10797
        self.ResponseHeader = ResponseHeader()
10798
        self.Parameters = SetTriggeringResult()
10799
        self._freeze = True
10800
10801 1
    def to_binary(self):
10802
        packet = []
10803
        packet.append(self.TypeId.to_binary())
10804
        packet.append(self.ResponseHeader.to_binary())
10805
        packet.append(self.Parameters.to_binary())
10806
        return b''.join(packet)
10807
10808 1
    @staticmethod
10809
    def from_binary(data):
10810
        return SetTriggeringResponse(data)
10811
10812 1
    def _binary_init(self, data):
10813
        self.TypeId = NodeId.from_binary(data)
10814
        self.ResponseHeader = ResponseHeader.from_binary(data)
10815
        self.Parameters = SetTriggeringResult.from_binary(data)
10816
10817 1
    def __str__(self):
10818
        return 'SetTriggeringResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10819
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
10820
               'Parameters:' + str(self.Parameters) + ')'
10821
10822 1
    __repr__ = __str__
10823
10824
10825 1 View Code Duplication
class DeleteMonitoredItemsParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10826
    '''
10827
    :ivar SubscriptionId:
10828
    :vartype SubscriptionId: UInt32
10829
    :ivar MonitoredItemIds:
10830
    :vartype MonitoredItemIds: UInt32
10831
    '''
10832 1
    def __init__(self, binary=None):
10833 1
        if binary is not None:
10834 1
            self._binary_init(binary)
10835 1
            self._freeze = True
10836 1
            return
10837 1
        self.SubscriptionId = 0
10838 1
        self.MonitoredItemIds = []
10839 1
        self._freeze = True
10840
10841 1
    def to_binary(self):
10842 1
        packet = []
10843 1
        packet.append(uatype_UInt32.pack(self.SubscriptionId))
10844 1
        packet.append(uatype_Int32.pack(len(self.MonitoredItemIds)))
10845 1
        for fieldname in self.MonitoredItemIds:
10846 1
            packet.append(uatype_UInt32.pack(fieldname))
10847 1
        return b''.join(packet)
10848
10849 1
    @staticmethod
10850
    def from_binary(data):
10851 1
        return DeleteMonitoredItemsParameters(data)
10852
10853 1
    def _binary_init(self, data):
10854 1
        self.SubscriptionId = uatype_UInt32.unpack(data.read(4))[0]
10855 1
        self.MonitoredItemIds = unpack_uatype_array('UInt32', data)
10856
10857 1
    def __str__(self):
10858
        return 'DeleteMonitoredItemsParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
10859
               'MonitoredItemIds:' + str(self.MonitoredItemIds) + ')'
10860
10861 1
    __repr__ = __str__
10862
10863
10864 1 View Code Duplication
class DeleteMonitoredItemsRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10865
    '''
10866
    :ivar TypeId:
10867
    :vartype TypeId: NodeId
10868
    :ivar RequestHeader:
10869
    :vartype RequestHeader: RequestHeader
10870
    :ivar Parameters:
10871
    :vartype Parameters: DeleteMonitoredItemsParameters
10872
    '''
10873 1
    def __init__(self, binary=None):
10874 1
        if binary is not None:
10875
            self._binary_init(binary)
10876
            self._freeze = True
10877
            return
10878 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteMonitoredItemsRequest_Encoding_DefaultBinary)
10879 1
        self.RequestHeader = RequestHeader()
10880 1
        self.Parameters = DeleteMonitoredItemsParameters()
10881 1
        self._freeze = True
10882
10883 1
    def to_binary(self):
10884 1
        packet = []
10885 1
        packet.append(self.TypeId.to_binary())
10886 1
        packet.append(self.RequestHeader.to_binary())
10887 1
        packet.append(self.Parameters.to_binary())
10888 1
        return b''.join(packet)
10889
10890 1
    @staticmethod
10891
    def from_binary(data):
10892
        return DeleteMonitoredItemsRequest(data)
10893
10894 1
    def _binary_init(self, data):
10895
        self.TypeId = NodeId.from_binary(data)
10896
        self.RequestHeader = RequestHeader.from_binary(data)
10897
        self.Parameters = DeleteMonitoredItemsParameters.from_binary(data)
10898
10899 1
    def __str__(self):
10900
        return 'DeleteMonitoredItemsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10901
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
10902
               'Parameters:' + str(self.Parameters) + ')'
10903
10904 1
    __repr__ = __str__
10905
10906
10907 1 View Code Duplication
class DeleteMonitoredItemsResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10908
    '''
10909
    :ivar TypeId:
10910
    :vartype TypeId: NodeId
10911
    :ivar ResponseHeader:
10912
    :vartype ResponseHeader: ResponseHeader
10913
    :ivar Results:
10914
    :vartype Results: StatusCode
10915
    :ivar DiagnosticInfos:
10916
    :vartype DiagnosticInfos: DiagnosticInfo
10917
    '''
10918 1
    def __init__(self, binary=None):
10919 1
        if binary is not None:
10920 1
            self._binary_init(binary)
10921 1
            self._freeze = True
10922 1
            return
10923 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteMonitoredItemsResponse_Encoding_DefaultBinary)
10924 1
        self.ResponseHeader = ResponseHeader()
10925 1
        self.Results = []
10926 1
        self.DiagnosticInfos = []
10927 1
        self._freeze = True
10928
10929 1
    def to_binary(self):
10930 1
        packet = []
10931 1
        packet.append(self.TypeId.to_binary())
10932 1
        packet.append(self.ResponseHeader.to_binary())
10933 1
        packet.append(uatype_Int32.pack(len(self.Results)))
10934 1
        for fieldname in self.Results:
10935 1
            packet.append(fieldname.to_binary())
10936 1
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
10937 1
        for fieldname in self.DiagnosticInfos:
10938
            packet.append(fieldname.to_binary())
10939 1
        return b''.join(packet)
10940
10941 1
    @staticmethod
10942
    def from_binary(data):
10943 1
        return DeleteMonitoredItemsResponse(data)
10944
10945 1
    def _binary_init(self, data):
10946 1
        self.TypeId = NodeId.from_binary(data)
10947 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
10948 1
        length = uatype_Int32.unpack(data.read(4))[0]
10949 1
        array = []
10950 1
        if length != -1:
10951 1
            for _ in range(0, length):
10952 1
                array.append(StatusCode.from_binary(data))
10953 1
        self.Results = array
10954 1
        length = uatype_Int32.unpack(data.read(4))[0]
10955 1
        array = []
10956 1
        if length != -1:
10957 1
            for _ in range(0, length):
10958
                array.append(DiagnosticInfo.from_binary(data))
10959 1
        self.DiagnosticInfos = array
10960
10961 1
    def __str__(self):
10962
        return 'DeleteMonitoredItemsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10963
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
10964
               'Results:' + str(self.Results) + ', ' + \
10965
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
10966
10967 1
    __repr__ = __str__
10968
10969
10970 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...
10971
    '''
10972
    :ivar RequestedPublishingInterval:
10973
    :vartype RequestedPublishingInterval: Double
10974
    :ivar RequestedLifetimeCount:
10975
    :vartype RequestedLifetimeCount: UInt32
10976
    :ivar RequestedMaxKeepAliveCount:
10977
    :vartype RequestedMaxKeepAliveCount: UInt32
10978
    :ivar MaxNotificationsPerPublish:
10979
    :vartype MaxNotificationsPerPublish: UInt32
10980
    :ivar PublishingEnabled:
10981
    :vartype PublishingEnabled: Boolean
10982
    :ivar Priority:
10983
    :vartype Priority: Byte
10984
    '''
10985 1
    def __init__(self, binary=None):
10986 1
        if binary is not None:
10987 1
            self._binary_init(binary)
10988 1
            self._freeze = True
10989 1
            return
10990 1
        self.RequestedPublishingInterval = 0
10991 1
        self.RequestedLifetimeCount = 0
10992 1
        self.RequestedMaxKeepAliveCount = 0
10993 1
        self.MaxNotificationsPerPublish = 0
10994 1
        self.PublishingEnabled = True
10995 1
        self.Priority = 0
10996 1
        self._freeze = True
10997
10998 1
    def to_binary(self):
10999 1
        packet = []
11000 1
        packet.append(uatype_Double.pack(self.RequestedPublishingInterval))
11001 1
        packet.append(uatype_UInt32.pack(self.RequestedLifetimeCount))
11002 1
        packet.append(uatype_UInt32.pack(self.RequestedMaxKeepAliveCount))
11003 1
        packet.append(uatype_UInt32.pack(self.MaxNotificationsPerPublish))
11004 1
        packet.append(uatype_Boolean.pack(self.PublishingEnabled))
11005 1
        packet.append(uatype_Byte.pack(self.Priority))
11006 1
        return b''.join(packet)
11007
11008 1
    @staticmethod
11009
    def from_binary(data):
11010 1
        return CreateSubscriptionParameters(data)
11011
11012 1
    def _binary_init(self, data):
11013 1
        self.RequestedPublishingInterval = uatype_Double.unpack(data.read(8))[0]
11014 1
        self.RequestedLifetimeCount = uatype_UInt32.unpack(data.read(4))[0]
11015 1
        self.RequestedMaxKeepAliveCount = uatype_UInt32.unpack(data.read(4))[0]
11016 1
        self.MaxNotificationsPerPublish = uatype_UInt32.unpack(data.read(4))[0]
11017 1
        self.PublishingEnabled = uatype_Boolean.unpack(data.read(1))[0]
11018 1
        self.Priority = uatype_Byte.unpack(data.read(1))[0]
11019
11020 1
    def __str__(self):
11021
        return 'CreateSubscriptionParameters(' + 'RequestedPublishingInterval:' + str(self.RequestedPublishingInterval) + ', ' + \
11022
               'RequestedLifetimeCount:' + str(self.RequestedLifetimeCount) + ', ' + \
11023
               'RequestedMaxKeepAliveCount:' + str(self.RequestedMaxKeepAliveCount) + ', ' + \
11024
               'MaxNotificationsPerPublish:' + str(self.MaxNotificationsPerPublish) + ', ' + \
11025
               'PublishingEnabled:' + str(self.PublishingEnabled) + ', ' + \
11026
               'Priority:' + str(self.Priority) + ')'
11027
11028 1
    __repr__ = __str__
11029
11030
11031 1 View Code Duplication
class CreateSubscriptionRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11032
    '''
11033
    :ivar TypeId:
11034
    :vartype TypeId: NodeId
11035
    :ivar RequestHeader:
11036
    :vartype RequestHeader: RequestHeader
11037
    :ivar Parameters:
11038
    :vartype Parameters: CreateSubscriptionParameters
11039
    '''
11040 1
    def __init__(self, binary=None):
11041 1
        if binary is not None:
11042
            self._binary_init(binary)
11043
            self._freeze = True
11044
            return
11045 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateSubscriptionRequest_Encoding_DefaultBinary)
11046 1
        self.RequestHeader = RequestHeader()
11047 1
        self.Parameters = CreateSubscriptionParameters()
11048 1
        self._freeze = True
11049
11050 1
    def to_binary(self):
11051 1
        packet = []
11052 1
        packet.append(self.TypeId.to_binary())
11053 1
        packet.append(self.RequestHeader.to_binary())
11054 1
        packet.append(self.Parameters.to_binary())
11055 1
        return b''.join(packet)
11056
11057 1
    @staticmethod
11058
    def from_binary(data):
11059
        return CreateSubscriptionRequest(data)
11060
11061 1
    def _binary_init(self, data):
11062
        self.TypeId = NodeId.from_binary(data)
11063
        self.RequestHeader = RequestHeader.from_binary(data)
11064
        self.Parameters = CreateSubscriptionParameters.from_binary(data)
11065
11066 1
    def __str__(self):
11067
        return 'CreateSubscriptionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11068
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
11069
               'Parameters:' + str(self.Parameters) + ')'
11070
11071 1
    __repr__ = __str__
11072
11073
11074 1
class CreateSubscriptionResult(FrozenClass):
11075
    '''
11076
    :ivar SubscriptionId:
11077
    :vartype SubscriptionId: UInt32
11078
    :ivar RevisedPublishingInterval:
11079
    :vartype RevisedPublishingInterval: Double
11080
    :ivar RevisedLifetimeCount:
11081
    :vartype RevisedLifetimeCount: UInt32
11082
    :ivar RevisedMaxKeepAliveCount:
11083
    :vartype RevisedMaxKeepAliveCount: UInt32
11084
    '''
11085 1
    def __init__(self, binary=None):
11086 1
        if binary is not None:
11087 1
            self._binary_init(binary)
11088 1
            self._freeze = True
11089 1
            return
11090 1
        self.SubscriptionId = 0
11091 1
        self.RevisedPublishingInterval = 0
11092 1
        self.RevisedLifetimeCount = 0
11093 1
        self.RevisedMaxKeepAliveCount = 0
11094 1
        self._freeze = True
11095
11096 1
    def to_binary(self):
11097 1
        packet = []
11098 1
        packet.append(uatype_UInt32.pack(self.SubscriptionId))
11099 1
        packet.append(uatype_Double.pack(self.RevisedPublishingInterval))
11100 1
        packet.append(uatype_UInt32.pack(self.RevisedLifetimeCount))
11101 1
        packet.append(uatype_UInt32.pack(self.RevisedMaxKeepAliveCount))
11102 1
        return b''.join(packet)
11103
11104 1
    @staticmethod
11105
    def from_binary(data):
11106 1
        return CreateSubscriptionResult(data)
11107
11108 1
    def _binary_init(self, data):
11109 1
        self.SubscriptionId = uatype_UInt32.unpack(data.read(4))[0]
11110 1
        self.RevisedPublishingInterval = uatype_Double.unpack(data.read(8))[0]
11111 1
        self.RevisedLifetimeCount = uatype_UInt32.unpack(data.read(4))[0]
11112 1
        self.RevisedMaxKeepAliveCount = uatype_UInt32.unpack(data.read(4))[0]
11113
11114 1
    def __str__(self):
11115
        return 'CreateSubscriptionResult(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
11116
               'RevisedPublishingInterval:' + str(self.RevisedPublishingInterval) + ', ' + \
11117
               'RevisedLifetimeCount:' + str(self.RevisedLifetimeCount) + ', ' + \
11118
               'RevisedMaxKeepAliveCount:' + str(self.RevisedMaxKeepAliveCount) + ')'
11119
11120 1
    __repr__ = __str__
11121
11122
11123 1 View Code Duplication
class CreateSubscriptionResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11124
    '''
11125
    :ivar TypeId:
11126
    :vartype TypeId: NodeId
11127
    :ivar ResponseHeader:
11128
    :vartype ResponseHeader: ResponseHeader
11129
    :ivar Parameters:
11130
    :vartype Parameters: CreateSubscriptionResult
11131
    '''
11132 1
    def __init__(self, binary=None):
11133 1
        if binary is not None:
11134 1
            self._binary_init(binary)
11135 1
            self._freeze = True
11136 1
            return
11137 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateSubscriptionResponse_Encoding_DefaultBinary)
11138 1
        self.ResponseHeader = ResponseHeader()
11139 1
        self.Parameters = CreateSubscriptionResult()
11140 1
        self._freeze = True
11141
11142 1
    def to_binary(self):
11143 1
        packet = []
11144 1
        packet.append(self.TypeId.to_binary())
11145 1
        packet.append(self.ResponseHeader.to_binary())
11146 1
        packet.append(self.Parameters.to_binary())
11147 1
        return b''.join(packet)
11148
11149 1
    @staticmethod
11150
    def from_binary(data):
11151 1
        return CreateSubscriptionResponse(data)
11152
11153 1
    def _binary_init(self, data):
11154 1
        self.TypeId = NodeId.from_binary(data)
11155 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
11156 1
        self.Parameters = CreateSubscriptionResult.from_binary(data)
11157
11158 1
    def __str__(self):
11159
        return 'CreateSubscriptionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11160
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
11161
               'Parameters:' + str(self.Parameters) + ')'
11162
11163 1
    __repr__ = __str__
11164
11165
11166 1 View Code Duplication
class ModifySubscriptionParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11167
    '''
11168
    :ivar SubscriptionId:
11169
    :vartype SubscriptionId: UInt32
11170
    :ivar RequestedPublishingInterval:
11171
    :vartype RequestedPublishingInterval: Double
11172
    :ivar RequestedLifetimeCount:
11173
    :vartype RequestedLifetimeCount: UInt32
11174
    :ivar RequestedMaxKeepAliveCount:
11175
    :vartype RequestedMaxKeepAliveCount: UInt32
11176
    :ivar MaxNotificationsPerPublish:
11177
    :vartype MaxNotificationsPerPublish: UInt32
11178
    :ivar Priority:
11179
    :vartype Priority: Byte
11180
    '''
11181 1
    def __init__(self, binary=None):
11182
        if binary is not None:
11183
            self._binary_init(binary)
11184
            self._freeze = True
11185
            return
11186
        self.SubscriptionId = 0
11187
        self.RequestedPublishingInterval = 0
11188
        self.RequestedLifetimeCount = 0
11189
        self.RequestedMaxKeepAliveCount = 0
11190
        self.MaxNotificationsPerPublish = 0
11191
        self.Priority = 0
11192
        self._freeze = True
11193
11194 1
    def to_binary(self):
11195
        packet = []
11196
        packet.append(uatype_UInt32.pack(self.SubscriptionId))
11197
        packet.append(uatype_Double.pack(self.RequestedPublishingInterval))
11198
        packet.append(uatype_UInt32.pack(self.RequestedLifetimeCount))
11199
        packet.append(uatype_UInt32.pack(self.RequestedMaxKeepAliveCount))
11200
        packet.append(uatype_UInt32.pack(self.MaxNotificationsPerPublish))
11201
        packet.append(uatype_Byte.pack(self.Priority))
11202
        return b''.join(packet)
11203
11204 1
    @staticmethod
11205
    def from_binary(data):
11206
        return ModifySubscriptionParameters(data)
11207
11208 1
    def _binary_init(self, data):
11209
        self.SubscriptionId = uatype_UInt32.unpack(data.read(4))[0]
11210
        self.RequestedPublishingInterval = uatype_Double.unpack(data.read(8))[0]
11211
        self.RequestedLifetimeCount = uatype_UInt32.unpack(data.read(4))[0]
11212
        self.RequestedMaxKeepAliveCount = uatype_UInt32.unpack(data.read(4))[0]
11213
        self.MaxNotificationsPerPublish = uatype_UInt32.unpack(data.read(4))[0]
11214
        self.Priority = uatype_Byte.unpack(data.read(1))[0]
11215
11216 1
    def __str__(self):
11217
        return 'ModifySubscriptionParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
11218
               'RequestedPublishingInterval:' + str(self.RequestedPublishingInterval) + ', ' + \
11219
               'RequestedLifetimeCount:' + str(self.RequestedLifetimeCount) + ', ' + \
11220
               'RequestedMaxKeepAliveCount:' + str(self.RequestedMaxKeepAliveCount) + ', ' + \
11221
               'MaxNotificationsPerPublish:' + str(self.MaxNotificationsPerPublish) + ', ' + \
11222
               'Priority:' + str(self.Priority) + ')'
11223
11224 1
    __repr__ = __str__
11225
11226
11227 1 View Code Duplication
class ModifySubscriptionRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11228
    '''
11229
    :ivar TypeId:
11230
    :vartype TypeId: NodeId
11231
    :ivar RequestHeader:
11232
    :vartype RequestHeader: RequestHeader
11233
    :ivar Parameters:
11234
    :vartype Parameters: ModifySubscriptionParameters
11235
    '''
11236 1
    def __init__(self, binary=None):
11237
        if binary is not None:
11238
            self._binary_init(binary)
11239
            self._freeze = True
11240
            return
11241
        self.TypeId = FourByteNodeId(ObjectIds.ModifySubscriptionRequest_Encoding_DefaultBinary)
11242
        self.RequestHeader = RequestHeader()
11243
        self.Parameters = ModifySubscriptionParameters()
11244
        self._freeze = True
11245
11246 1
    def to_binary(self):
11247
        packet = []
11248
        packet.append(self.TypeId.to_binary())
11249
        packet.append(self.RequestHeader.to_binary())
11250
        packet.append(self.Parameters.to_binary())
11251
        return b''.join(packet)
11252
11253 1
    @staticmethod
11254
    def from_binary(data):
11255
        return ModifySubscriptionRequest(data)
11256
11257 1
    def _binary_init(self, data):
11258
        self.TypeId = NodeId.from_binary(data)
11259
        self.RequestHeader = RequestHeader.from_binary(data)
11260
        self.Parameters = ModifySubscriptionParameters.from_binary(data)
11261
11262 1
    def __str__(self):
11263
        return 'ModifySubscriptionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11264
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
11265
               'Parameters:' + str(self.Parameters) + ')'
11266
11267 1
    __repr__ = __str__
11268
11269
11270 1
class ModifySubscriptionResult(FrozenClass):
11271
    '''
11272
    :ivar RevisedPublishingInterval:
11273
    :vartype RevisedPublishingInterval: Double
11274
    :ivar RevisedLifetimeCount:
11275
    :vartype RevisedLifetimeCount: UInt32
11276
    :ivar RevisedMaxKeepAliveCount:
11277
    :vartype RevisedMaxKeepAliveCount: UInt32
11278
    '''
11279 1
    def __init__(self, binary=None):
11280
        if binary is not None:
11281
            self._binary_init(binary)
11282
            self._freeze = True
11283
            return
11284
        self.RevisedPublishingInterval = 0
11285
        self.RevisedLifetimeCount = 0
11286
        self.RevisedMaxKeepAliveCount = 0
11287
        self._freeze = True
11288
11289 1
    def to_binary(self):
11290
        packet = []
11291
        packet.append(uatype_Double.pack(self.RevisedPublishingInterval))
11292
        packet.append(uatype_UInt32.pack(self.RevisedLifetimeCount))
11293
        packet.append(uatype_UInt32.pack(self.RevisedMaxKeepAliveCount))
11294
        return b''.join(packet)
11295
11296 1
    @staticmethod
11297
    def from_binary(data):
11298
        return ModifySubscriptionResult(data)
11299
11300 1
    def _binary_init(self, data):
11301
        self.RevisedPublishingInterval = uatype_Double.unpack(data.read(8))[0]
11302
        self.RevisedLifetimeCount = uatype_UInt32.unpack(data.read(4))[0]
11303
        self.RevisedMaxKeepAliveCount = uatype_UInt32.unpack(data.read(4))[0]
11304
11305 1
    def __str__(self):
11306
        return 'ModifySubscriptionResult(' + 'RevisedPublishingInterval:' + str(self.RevisedPublishingInterval) + ', ' + \
11307
               'RevisedLifetimeCount:' + str(self.RevisedLifetimeCount) + ', ' + \
11308
               'RevisedMaxKeepAliveCount:' + str(self.RevisedMaxKeepAliveCount) + ')'
11309
11310 1
    __repr__ = __str__
11311
11312
11313 1 View Code Duplication
class ModifySubscriptionResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11314
    '''
11315
    :ivar TypeId:
11316
    :vartype TypeId: NodeId
11317
    :ivar ResponseHeader:
11318
    :vartype ResponseHeader: ResponseHeader
11319
    :ivar Parameters:
11320
    :vartype Parameters: ModifySubscriptionResult
11321
    '''
11322 1
    def __init__(self, binary=None):
11323
        if binary is not None:
11324
            self._binary_init(binary)
11325
            self._freeze = True
11326
            return
11327
        self.TypeId = FourByteNodeId(ObjectIds.ModifySubscriptionResponse_Encoding_DefaultBinary)
11328
        self.ResponseHeader = ResponseHeader()
11329
        self.Parameters = ModifySubscriptionResult()
11330
        self._freeze = True
11331
11332 1
    def to_binary(self):
11333
        packet = []
11334
        packet.append(self.TypeId.to_binary())
11335
        packet.append(self.ResponseHeader.to_binary())
11336
        packet.append(self.Parameters.to_binary())
11337
        return b''.join(packet)
11338
11339 1
    @staticmethod
11340
    def from_binary(data):
11341
        return ModifySubscriptionResponse(data)
11342
11343 1
    def _binary_init(self, data):
11344
        self.TypeId = NodeId.from_binary(data)
11345
        self.ResponseHeader = ResponseHeader.from_binary(data)
11346
        self.Parameters = ModifySubscriptionResult.from_binary(data)
11347
11348 1
    def __str__(self):
11349
        return 'ModifySubscriptionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11350
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
11351
               'Parameters:' + str(self.Parameters) + ')'
11352
11353 1
    __repr__ = __str__
11354
11355
11356 1 View Code Duplication
class SetPublishingModeParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11357
    '''
11358
    :ivar PublishingEnabled:
11359
    :vartype PublishingEnabled: Boolean
11360
    :ivar SubscriptionIds:
11361
    :vartype SubscriptionIds: UInt32
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.PublishingEnabled = True
11369
        self.SubscriptionIds = []
11370
        self._freeze = True
11371
11372 1
    def to_binary(self):
11373
        packet = []
11374
        packet.append(uatype_Boolean.pack(self.PublishingEnabled))
11375
        packet.append(uatype_Int32.pack(len(self.SubscriptionIds)))
11376
        for fieldname in self.SubscriptionIds:
11377
            packet.append(uatype_UInt32.pack(fieldname))
11378
        return b''.join(packet)
11379
11380 1
    @staticmethod
11381
    def from_binary(data):
11382
        return SetPublishingModeParameters(data)
11383
11384 1
    def _binary_init(self, data):
11385
        self.PublishingEnabled = uatype_Boolean.unpack(data.read(1))[0]
11386
        self.SubscriptionIds = unpack_uatype_array('UInt32', data)
11387
11388 1
    def __str__(self):
11389
        return 'SetPublishingModeParameters(' + 'PublishingEnabled:' + str(self.PublishingEnabled) + ', ' + \
11390
               'SubscriptionIds:' + str(self.SubscriptionIds) + ')'
11391
11392 1
    __repr__ = __str__
11393
11394
11395 1 View Code Duplication
class SetPublishingModeRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11396
    '''
11397
    :ivar TypeId:
11398
    :vartype TypeId: NodeId
11399
    :ivar RequestHeader:
11400
    :vartype RequestHeader: RequestHeader
11401
    :ivar Parameters:
11402
    :vartype Parameters: SetPublishingModeParameters
11403
    '''
11404 1
    def __init__(self, binary=None):
11405
        if binary is not None:
11406
            self._binary_init(binary)
11407
            self._freeze = True
11408
            return
11409
        self.TypeId = FourByteNodeId(ObjectIds.SetPublishingModeRequest_Encoding_DefaultBinary)
11410
        self.RequestHeader = RequestHeader()
11411
        self.Parameters = SetPublishingModeParameters()
11412
        self._freeze = True
11413
11414 1
    def to_binary(self):
11415
        packet = []
11416
        packet.append(self.TypeId.to_binary())
11417
        packet.append(self.RequestHeader.to_binary())
11418
        packet.append(self.Parameters.to_binary())
11419
        return b''.join(packet)
11420
11421 1
    @staticmethod
11422
    def from_binary(data):
11423
        return SetPublishingModeRequest(data)
11424
11425 1
    def _binary_init(self, data):
11426
        self.TypeId = NodeId.from_binary(data)
11427
        self.RequestHeader = RequestHeader.from_binary(data)
11428
        self.Parameters = SetPublishingModeParameters.from_binary(data)
11429
11430 1
    def __str__(self):
11431
        return 'SetPublishingModeRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11432
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
11433
               'Parameters:' + str(self.Parameters) + ')'
11434
11435 1
    __repr__ = __str__
11436
11437
11438 1 View Code Duplication
class SetPublishingModeResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11439
    '''
11440
    :ivar Results:
11441
    :vartype Results: StatusCode
11442
    :ivar DiagnosticInfos:
11443
    :vartype DiagnosticInfos: DiagnosticInfo
11444
    '''
11445 1
    def __init__(self, binary=None):
11446
        if binary is not None:
11447
            self._binary_init(binary)
11448
            self._freeze = True
11449
            return
11450
        self.Results = []
11451
        self.DiagnosticInfos = []
11452
        self._freeze = True
11453
11454 1
    def to_binary(self):
11455
        packet = []
11456
        packet.append(uatype_Int32.pack(len(self.Results)))
11457
        for fieldname in self.Results:
11458
            packet.append(fieldname.to_binary())
11459
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
11460
        for fieldname in self.DiagnosticInfos:
11461
            packet.append(fieldname.to_binary())
11462
        return b''.join(packet)
11463
11464 1
    @staticmethod
11465
    def from_binary(data):
11466
        return SetPublishingModeResult(data)
11467
11468 1
    def _binary_init(self, data):
11469
        length = uatype_Int32.unpack(data.read(4))[0]
11470
        array = []
11471
        if length != -1:
11472
            for _ in range(0, length):
11473
                array.append(StatusCode.from_binary(data))
11474
        self.Results = array
11475
        length = uatype_Int32.unpack(data.read(4))[0]
11476
        array = []
11477
        if length != -1:
11478
            for _ in range(0, length):
11479
                array.append(DiagnosticInfo.from_binary(data))
11480
        self.DiagnosticInfos = array
11481
11482 1
    def __str__(self):
11483
        return 'SetPublishingModeResult(' + 'Results:' + str(self.Results) + ', ' + \
11484
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
11485
11486 1
    __repr__ = __str__
11487
11488
11489 1 View Code Duplication
class SetPublishingModeResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11490
    '''
11491
    :ivar TypeId:
11492
    :vartype TypeId: NodeId
11493
    :ivar ResponseHeader:
11494
    :vartype ResponseHeader: ResponseHeader
11495
    :ivar Parameters:
11496
    :vartype Parameters: SetPublishingModeResult
11497
    '''
11498 1
    def __init__(self, binary=None):
11499
        if binary is not None:
11500
            self._binary_init(binary)
11501
            self._freeze = True
11502
            return
11503
        self.TypeId = FourByteNodeId(ObjectIds.SetPublishingModeResponse_Encoding_DefaultBinary)
11504
        self.ResponseHeader = ResponseHeader()
11505
        self.Parameters = SetPublishingModeResult()
11506
        self._freeze = True
11507
11508 1
    def to_binary(self):
11509
        packet = []
11510
        packet.append(self.TypeId.to_binary())
11511
        packet.append(self.ResponseHeader.to_binary())
11512
        packet.append(self.Parameters.to_binary())
11513
        return b''.join(packet)
11514
11515 1
    @staticmethod
11516
    def from_binary(data):
11517
        return SetPublishingModeResponse(data)
11518
11519 1
    def _binary_init(self, data):
11520
        self.TypeId = NodeId.from_binary(data)
11521
        self.ResponseHeader = ResponseHeader.from_binary(data)
11522
        self.Parameters = SetPublishingModeResult.from_binary(data)
11523
11524 1
    def __str__(self):
11525
        return 'SetPublishingModeResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11526
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
11527
               'Parameters:' + str(self.Parameters) + ')'
11528
11529 1
    __repr__ = __str__
11530
11531
11532 1
class NotificationMessage(FrozenClass):
11533
    '''
11534
    :ivar SequenceNumber:
11535
    :vartype SequenceNumber: UInt32
11536
    :ivar PublishTime:
11537
    :vartype PublishTime: DateTime
11538
    :ivar NotificationData:
11539
    :vartype NotificationData: ExtensionObject
11540
    '''
11541 1
    def __init__(self, binary=None):
11542 1
        if binary is not None:
11543 1
            self._binary_init(binary)
11544 1
            self._freeze = True
11545 1
            return
11546 1
        self.SequenceNumber = 0
11547 1
        self.PublishTime = datetime.now()
11548 1
        self.NotificationData = []
11549 1
        self._freeze = True
11550
11551 1
    def to_binary(self):
11552 1
        packet = []
11553 1
        packet.append(uatype_UInt32.pack(self.SequenceNumber))
11554 1
        packet.append(pack_datetime(self.PublishTime))
11555 1
        packet.append(uatype_Int32.pack(len(self.NotificationData)))
11556 1
        for fieldname in self.NotificationData:
11557 1
            packet.append(extensionobject_to_binary(fieldname))
11558 1
        return b''.join(packet)
11559
11560 1
    @staticmethod
11561
    def from_binary(data):
11562 1
        return NotificationMessage(data)
11563
11564 1
    def _binary_init(self, data):
11565 1
        self.SequenceNumber = uatype_UInt32.unpack(data.read(4))[0]
11566 1
        self.PublishTime = unpack_datetime(data)
11567 1
        length = uatype_Int32.unpack(data.read(4))[0]
11568 1
        array = []
11569 1
        if length != -1:
11570 1
            for _ in range(0, length):
11571 1
                array.append(extensionobject_from_binary(data))
11572 1
        self.NotificationData = array
11573
11574 1
    def __str__(self):
11575
        return 'NotificationMessage(' + 'SequenceNumber:' + str(self.SequenceNumber) + ', ' + \
11576
               'PublishTime:' + str(self.PublishTime) + ', ' + \
11577
               'NotificationData:' + str(self.NotificationData) + ')'
11578
11579 1
    __repr__ = __str__
11580
11581
11582 1 View Code Duplication
class NotificationData(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11583
    '''
11584
    '''
11585 1
    def __init__(self, binary=None):
11586
        if binary is not None:
11587
            self._binary_init(binary)
11588
            self._freeze = True
11589
            return
11590
        self._freeze = True
11591
11592 1
    def to_binary(self):
11593
        packet = []
11594
        return b''.join(packet)
11595
11596 1
    @staticmethod
11597
    def from_binary(data):
11598
        return NotificationData(data)
11599
11600 1
    def _binary_init(self, data):
11601
        pass
11602
11603 1
    def __str__(self):
11604
        return 'NotificationData(' +  + ')'
11605
11606 1
    __repr__ = __str__
11607
11608
11609 1 View Code Duplication
class DataChangeNotification(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11610
    '''
11611
    :ivar MonitoredItems:
11612
    :vartype MonitoredItems: MonitoredItemNotification
11613
    :ivar DiagnosticInfos:
11614
    :vartype DiagnosticInfos: DiagnosticInfo
11615
    '''
11616 1
    def __init__(self, binary=None):
11617 1
        if binary is not None:
11618 1
            self._binary_init(binary)
11619 1
            self._freeze = True
11620 1
            return
11621 1
        self.MonitoredItems = []
11622 1
        self.DiagnosticInfos = []
11623 1
        self._freeze = True
11624
11625 1
    def to_binary(self):
11626 1
        packet = []
11627 1
        packet.append(uatype_Int32.pack(len(self.MonitoredItems)))
11628 1
        for fieldname in self.MonitoredItems:
11629 1
            packet.append(fieldname.to_binary())
11630 1
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
11631 1
        for fieldname in self.DiagnosticInfos:
11632
            packet.append(fieldname.to_binary())
11633 1
        return b''.join(packet)
11634
11635 1
    @staticmethod
11636
    def from_binary(data):
11637 1
        return DataChangeNotification(data)
11638
11639 1
    def _binary_init(self, data):
11640 1
        length = uatype_Int32.unpack(data.read(4))[0]
11641 1
        array = []
11642 1
        if length != -1:
11643 1
            for _ in range(0, length):
11644 1
                array.append(MonitoredItemNotification.from_binary(data))
11645 1
        self.MonitoredItems = array
11646 1
        length = uatype_Int32.unpack(data.read(4))[0]
11647 1
        array = []
11648 1
        if length != -1:
11649 1
            for _ in range(0, length):
11650
                array.append(DiagnosticInfo.from_binary(data))
11651 1
        self.DiagnosticInfos = array
11652
11653 1
    def __str__(self):
11654
        return 'DataChangeNotification(' + 'MonitoredItems:' + str(self.MonitoredItems) + ', ' + \
11655
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
11656
11657 1
    __repr__ = __str__
11658
11659
11660 1 View Code Duplication
class MonitoredItemNotification(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11661
    '''
11662
    :ivar ClientHandle:
11663
    :vartype ClientHandle: UInt32
11664
    :ivar Value:
11665
    :vartype Value: DataValue
11666
    '''
11667 1
    def __init__(self, binary=None):
11668 1
        if binary is not None:
11669 1
            self._binary_init(binary)
11670 1
            self._freeze = True
11671 1
            return
11672 1
        self.ClientHandle = 0
11673 1
        self.Value = DataValue()
11674 1
        self._freeze = True
11675
11676 1
    def to_binary(self):
11677 1
        packet = []
11678 1
        packet.append(uatype_UInt32.pack(self.ClientHandle))
11679 1
        packet.append(self.Value.to_binary())
11680 1
        return b''.join(packet)
11681
11682 1
    @staticmethod
11683
    def from_binary(data):
11684 1
        return MonitoredItemNotification(data)
11685
11686 1
    def _binary_init(self, data):
11687 1
        self.ClientHandle = uatype_UInt32.unpack(data.read(4))[0]
11688 1
        self.Value = DataValue.from_binary(data)
11689
11690 1
    def __str__(self):
11691
        return 'MonitoredItemNotification(' + 'ClientHandle:' + str(self.ClientHandle) + ', ' + \
11692
               'Value:' + str(self.Value) + ')'
11693
11694 1
    __repr__ = __str__
11695
11696
11697 1 View Code Duplication
class EventNotificationList(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11698
    '''
11699
    :ivar Events:
11700
    :vartype Events: EventFieldList
11701
    '''
11702 1
    def __init__(self, binary=None):
11703 1
        if binary is not None:
11704 1
            self._binary_init(binary)
11705 1
            self._freeze = True
11706 1
            return
11707 1
        self.Events = []
11708 1
        self._freeze = True
11709
11710 1
    def to_binary(self):
11711 1
        packet = []
11712 1
        packet.append(uatype_Int32.pack(len(self.Events)))
11713 1
        for fieldname in self.Events:
11714 1
            packet.append(fieldname.to_binary())
11715 1
        return b''.join(packet)
11716
11717 1
    @staticmethod
11718
    def from_binary(data):
11719 1
        return EventNotificationList(data)
11720
11721 1
    def _binary_init(self, data):
11722 1
        length = uatype_Int32.unpack(data.read(4))[0]
11723 1
        array = []
11724 1
        if length != -1:
11725 1
            for _ in range(0, length):
11726 1
                array.append(EventFieldList.from_binary(data))
11727 1
        self.Events = array
11728
11729 1
    def __str__(self):
11730
        return 'EventNotificationList(' + 'Events:' + str(self.Events) + ')'
11731
11732 1
    __repr__ = __str__
11733
11734
11735 1 View Code Duplication
class EventFieldList(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11736
    '''
11737
    :ivar ClientHandle:
11738
    :vartype ClientHandle: UInt32
11739
    :ivar EventFields:
11740
    :vartype EventFields: Variant
11741
    '''
11742 1
    def __init__(self, binary=None):
11743 1
        if binary is not None:
11744 1
            self._binary_init(binary)
11745 1
            self._freeze = True
11746 1
            return
11747 1
        self.ClientHandle = 0
11748 1
        self.EventFields = []
11749 1
        self._freeze = True
11750
11751 1
    def to_binary(self):
11752 1
        packet = []
11753 1
        packet.append(uatype_UInt32.pack(self.ClientHandle))
11754 1
        packet.append(uatype_Int32.pack(len(self.EventFields)))
11755 1
        for fieldname in self.EventFields:
11756 1
            packet.append(fieldname.to_binary())
11757 1
        return b''.join(packet)
11758
11759 1
    @staticmethod
11760
    def from_binary(data):
11761 1
        return EventFieldList(data)
11762
11763 1
    def _binary_init(self, data):
11764 1
        self.ClientHandle = uatype_UInt32.unpack(data.read(4))[0]
11765 1
        length = uatype_Int32.unpack(data.read(4))[0]
11766 1
        array = []
11767 1
        if length != -1:
11768 1
            for _ in range(0, length):
11769 1
                array.append(Variant.from_binary(data))
11770 1
        self.EventFields = array
11771
11772 1
    def __str__(self):
11773
        return 'EventFieldList(' + 'ClientHandle:' + str(self.ClientHandle) + ', ' + \
11774
               'EventFields:' + str(self.EventFields) + ')'
11775
11776 1
    __repr__ = __str__
11777
11778
11779 1 View Code Duplication
class HistoryEventFieldList(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11780
    '''
11781
    :ivar EventFields:
11782
    :vartype EventFields: Variant
11783
    '''
11784 1
    def __init__(self, binary=None):
11785 1
        if binary is not None:
11786
            self._binary_init(binary)
11787
            self._freeze = True
11788
            return
11789 1
        self.EventFields = []
11790 1
        self._freeze = True
11791
11792 1
    def to_binary(self):
11793
        packet = []
11794
        packet.append(uatype_Int32.pack(len(self.EventFields)))
11795
        for fieldname in self.EventFields:
11796
            packet.append(fieldname.to_binary())
11797
        return b''.join(packet)
11798
11799 1
    @staticmethod
11800
    def from_binary(data):
11801
        return HistoryEventFieldList(data)
11802
11803 1
    def _binary_init(self, data):
11804
        length = uatype_Int32.unpack(data.read(4))[0]
11805
        array = []
11806
        if length != -1:
11807
            for _ in range(0, length):
11808
                array.append(Variant.from_binary(data))
11809
        self.EventFields = array
11810
11811 1
    def __str__(self):
11812
        return 'HistoryEventFieldList(' + 'EventFields:' + str(self.EventFields) + ')'
11813
11814 1
    __repr__ = __str__
11815
11816
11817 1 View Code Duplication
class StatusChangeNotification(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11818
    '''
11819
    :ivar Status:
11820
    :vartype Status: StatusCode
11821
    :ivar DiagnosticInfo:
11822
    :vartype DiagnosticInfo: DiagnosticInfo
11823
    '''
11824 1
    def __init__(self, binary=None):
11825
        if binary is not None:
11826
            self._binary_init(binary)
11827
            self._freeze = True
11828
            return
11829
        self.Status = StatusCode()
11830
        self.DiagnosticInfo = DiagnosticInfo()
11831
        self._freeze = True
11832
11833 1
    def to_binary(self):
11834
        packet = []
11835
        packet.append(self.Status.to_binary())
11836
        packet.append(self.DiagnosticInfo.to_binary())
11837
        return b''.join(packet)
11838
11839 1
    @staticmethod
11840
    def from_binary(data):
11841
        return StatusChangeNotification(data)
11842
11843 1
    def _binary_init(self, data):
11844
        self.Status = StatusCode.from_binary(data)
11845
        self.DiagnosticInfo = DiagnosticInfo.from_binary(data)
11846
11847 1
    def __str__(self):
11848
        return 'StatusChangeNotification(' + 'Status:' + str(self.Status) + ', ' + \
11849
               'DiagnosticInfo:' + str(self.DiagnosticInfo) + ')'
11850
11851 1
    __repr__ = __str__
11852
11853
11854 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...
11855
    '''
11856
    :ivar SubscriptionId:
11857
    :vartype SubscriptionId: UInt32
11858
    :ivar SequenceNumber:
11859
    :vartype SequenceNumber: UInt32
11860
    '''
11861 1
    def __init__(self, binary=None):
11862 1
        if binary is not None:
11863 1
            self._binary_init(binary)
11864 1
            self._freeze = True
11865 1
            return
11866 1
        self.SubscriptionId = 0
11867 1
        self.SequenceNumber = 0
11868 1
        self._freeze = True
11869
11870 1
    def to_binary(self):
11871 1
        packet = []
11872 1
        packet.append(uatype_UInt32.pack(self.SubscriptionId))
11873 1
        packet.append(uatype_UInt32.pack(self.SequenceNumber))
11874 1
        return b''.join(packet)
11875
11876 1
    @staticmethod
11877
    def from_binary(data):
11878 1
        return SubscriptionAcknowledgement(data)
11879
11880 1
    def _binary_init(self, data):
11881 1
        self.SubscriptionId = uatype_UInt32.unpack(data.read(4))[0]
11882 1
        self.SequenceNumber = uatype_UInt32.unpack(data.read(4))[0]
11883
11884 1
    def __str__(self):
11885
        return 'SubscriptionAcknowledgement(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
11886
               'SequenceNumber:' + str(self.SequenceNumber) + ')'
11887
11888 1
    __repr__ = __str__
11889
11890
11891 1 View Code Duplication
class PublishParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11892
    '''
11893
    :ivar SubscriptionAcknowledgements:
11894
    :vartype SubscriptionAcknowledgements: SubscriptionAcknowledgement
11895
    '''
11896 1
    def __init__(self, binary=None):
11897 1
        if binary is not None:
11898 1
            self._binary_init(binary)
11899 1
            self._freeze = True
11900 1
            return
11901 1
        self.SubscriptionAcknowledgements = []
11902 1
        self._freeze = True
11903
11904 1
    def to_binary(self):
11905 1
        packet = []
11906 1
        packet.append(uatype_Int32.pack(len(self.SubscriptionAcknowledgements)))
11907 1
        for fieldname in self.SubscriptionAcknowledgements:
11908 1
            packet.append(fieldname.to_binary())
11909 1
        return b''.join(packet)
11910
11911 1
    @staticmethod
11912
    def from_binary(data):
11913 1
        return PublishParameters(data)
11914
11915 1
    def _binary_init(self, data):
11916 1
        length = uatype_Int32.unpack(data.read(4))[0]
11917 1
        array = []
11918 1
        if length != -1:
11919 1
            for _ in range(0, length):
11920 1
                array.append(SubscriptionAcknowledgement.from_binary(data))
11921 1
        self.SubscriptionAcknowledgements = array
11922
11923 1
    def __str__(self):
11924
        return 'PublishParameters(' + 'SubscriptionAcknowledgements:' + str(self.SubscriptionAcknowledgements) + ')'
11925
11926 1
    __repr__ = __str__
11927
11928
11929 1 View Code Duplication
class PublishRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11930
    '''
11931
    :ivar TypeId:
11932
    :vartype TypeId: NodeId
11933
    :ivar RequestHeader:
11934
    :vartype RequestHeader: RequestHeader
11935
    :ivar Parameters:
11936
    :vartype Parameters: PublishParameters
11937
    '''
11938 1
    def __init__(self, binary=None):
11939 1
        if binary is not None:
11940
            self._binary_init(binary)
11941
            self._freeze = True
11942
            return
11943 1
        self.TypeId = FourByteNodeId(ObjectIds.PublishRequest_Encoding_DefaultBinary)
11944 1
        self.RequestHeader = RequestHeader()
11945 1
        self.Parameters = PublishParameters()
11946 1
        self._freeze = True
11947
11948 1
    def to_binary(self):
11949 1
        packet = []
11950 1
        packet.append(self.TypeId.to_binary())
11951 1
        packet.append(self.RequestHeader.to_binary())
11952 1
        packet.append(self.Parameters.to_binary())
11953 1
        return b''.join(packet)
11954
11955 1
    @staticmethod
11956
    def from_binary(data):
11957
        return PublishRequest(data)
11958
11959 1
    def _binary_init(self, data):
11960
        self.TypeId = NodeId.from_binary(data)
11961
        self.RequestHeader = RequestHeader.from_binary(data)
11962
        self.Parameters = PublishParameters.from_binary(data)
11963
11964 1
    def __str__(self):
11965
        return 'PublishRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11966
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
11967
               'Parameters:' + str(self.Parameters) + ')'
11968
11969 1
    __repr__ = __str__
11970
11971
11972 1
class PublishResult(FrozenClass):
11973
    '''
11974
    :ivar SubscriptionId:
11975
    :vartype SubscriptionId: UInt32
11976
    :ivar AvailableSequenceNumbers:
11977
    :vartype AvailableSequenceNumbers: UInt32
11978
    :ivar MoreNotifications:
11979
    :vartype MoreNotifications: Boolean
11980
    :ivar NotificationMessage:
11981
    :vartype NotificationMessage: NotificationMessage
11982
    :ivar Results:
11983
    :vartype Results: StatusCode
11984
    :ivar DiagnosticInfos:
11985
    :vartype DiagnosticInfos: DiagnosticInfo
11986
    '''
11987 1
    def __init__(self, binary=None):
11988 1
        if binary is not None:
11989 1
            self._binary_init(binary)
11990 1
            self._freeze = True
11991 1
            return
11992 1
        self.SubscriptionId = 0
11993 1
        self.AvailableSequenceNumbers = []
11994 1
        self.MoreNotifications = True
11995 1
        self.NotificationMessage = NotificationMessage()
11996 1
        self.Results = []
11997 1
        self.DiagnosticInfos = []
11998 1
        self._freeze = True
11999
12000 1
    def to_binary(self):
12001 1
        packet = []
12002 1
        packet.append(uatype_UInt32.pack(self.SubscriptionId))
12003 1
        packet.append(uatype_Int32.pack(len(self.AvailableSequenceNumbers)))
12004 1
        for fieldname in self.AvailableSequenceNumbers:
12005 1
            packet.append(uatype_UInt32.pack(fieldname))
12006 1
        packet.append(uatype_Boolean.pack(self.MoreNotifications))
12007 1
        packet.append(self.NotificationMessage.to_binary())
12008 1
        packet.append(uatype_Int32.pack(len(self.Results)))
12009 1
        for fieldname in self.Results:
12010
            packet.append(fieldname.to_binary())
12011 1
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
12012 1
        for fieldname in self.DiagnosticInfos:
12013
            packet.append(fieldname.to_binary())
12014 1
        return b''.join(packet)
12015
12016 1
    @staticmethod
12017
    def from_binary(data):
12018 1
        return PublishResult(data)
12019
12020 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...
12021 1
        self.SubscriptionId = uatype_UInt32.unpack(data.read(4))[0]
12022 1
        self.AvailableSequenceNumbers = unpack_uatype_array('UInt32', data)
12023 1
        self.MoreNotifications = uatype_Boolean.unpack(data.read(1))[0]
12024 1
        self.NotificationMessage = NotificationMessage.from_binary(data)
12025 1
        length = uatype_Int32.unpack(data.read(4))[0]
12026 1
        array = []
12027 1
        if length != -1:
12028 1
            for _ in range(0, length):
12029
                array.append(StatusCode.from_binary(data))
12030 1
        self.Results = array
12031 1
        length = uatype_Int32.unpack(data.read(4))[0]
12032 1
        array = []
12033 1
        if length != -1:
12034 1
            for _ in range(0, length):
12035
                array.append(DiagnosticInfo.from_binary(data))
12036 1
        self.DiagnosticInfos = array
12037
12038 1
    def __str__(self):
12039
        return 'PublishResult(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12040
               'AvailableSequenceNumbers:' + str(self.AvailableSequenceNumbers) + ', ' + \
12041
               'MoreNotifications:' + str(self.MoreNotifications) + ', ' + \
12042
               'NotificationMessage:' + str(self.NotificationMessage) + ', ' + \
12043
               'Results:' + str(self.Results) + ', ' + \
12044
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
12045
12046 1
    __repr__ = __str__
12047
12048
12049 1 View Code Duplication
class PublishResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12050
    '''
12051
    :ivar TypeId:
12052
    :vartype TypeId: NodeId
12053
    :ivar ResponseHeader:
12054
    :vartype ResponseHeader: ResponseHeader
12055
    :ivar Parameters:
12056
    :vartype Parameters: PublishResult
12057
    '''
12058 1
    def __init__(self, binary=None):
12059 1
        if binary is not None:
12060 1
            self._binary_init(binary)
12061 1
            self._freeze = True
12062 1
            return
12063 1
        self.TypeId = FourByteNodeId(ObjectIds.PublishResponse_Encoding_DefaultBinary)
12064 1
        self.ResponseHeader = ResponseHeader()
12065 1
        self.Parameters = PublishResult()
12066 1
        self._freeze = True
12067
12068 1
    def to_binary(self):
12069 1
        packet = []
12070 1
        packet.append(self.TypeId.to_binary())
12071 1
        packet.append(self.ResponseHeader.to_binary())
12072 1
        packet.append(self.Parameters.to_binary())
12073 1
        return b''.join(packet)
12074
12075 1
    @staticmethod
12076
    def from_binary(data):
12077 1
        return PublishResponse(data)
12078
12079 1
    def _binary_init(self, data):
12080 1
        self.TypeId = NodeId.from_binary(data)
12081 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
12082 1
        self.Parameters = PublishResult.from_binary(data)
12083
12084 1
    def __str__(self):
12085
        return 'PublishResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12086
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12087
               'Parameters:' + str(self.Parameters) + ')'
12088
12089 1
    __repr__ = __str__
12090
12091
12092 1
class RepublishParameters(FrozenClass):
12093
    '''
12094
    :ivar SubscriptionId:
12095
    :vartype SubscriptionId: UInt32
12096
    :ivar RetransmitSequenceNumber:
12097
    :vartype RetransmitSequenceNumber: UInt32
12098
    '''
12099 1
    def __init__(self, binary=None):
12100
        if binary is not None:
12101
            self._binary_init(binary)
12102
            self._freeze = True
12103
            return
12104
        self.SubscriptionId = 0
12105
        self.RetransmitSequenceNumber = 0
12106
        self._freeze = True
12107
12108 1
    def to_binary(self):
12109
        packet = []
12110
        packet.append(uatype_UInt32.pack(self.SubscriptionId))
12111
        packet.append(uatype_UInt32.pack(self.RetransmitSequenceNumber))
12112
        return b''.join(packet)
12113
12114 1
    @staticmethod
12115
    def from_binary(data):
12116
        return RepublishParameters(data)
12117
12118 1
    def _binary_init(self, data):
12119
        self.SubscriptionId = uatype_UInt32.unpack(data.read(4))[0]
12120
        self.RetransmitSequenceNumber = uatype_UInt32.unpack(data.read(4))[0]
12121
12122 1
    def __str__(self):
12123
        return 'RepublishParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12124
               'RetransmitSequenceNumber:' + str(self.RetransmitSequenceNumber) + ')'
12125
12126 1
    __repr__ = __str__
12127
12128
12129 1 View Code Duplication
class RepublishRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12130
    '''
12131
    :ivar TypeId:
12132
    :vartype TypeId: NodeId
12133
    :ivar RequestHeader:
12134
    :vartype RequestHeader: RequestHeader
12135
    :ivar Parameters:
12136
    :vartype Parameters: RepublishParameters
12137
    '''
12138 1
    def __init__(self, binary=None):
12139
        if binary is not None:
12140
            self._binary_init(binary)
12141
            self._freeze = True
12142
            return
12143
        self.TypeId = FourByteNodeId(ObjectIds.RepublishRequest_Encoding_DefaultBinary)
12144
        self.RequestHeader = RequestHeader()
12145
        self.Parameters = RepublishParameters()
12146
        self._freeze = True
12147
12148 1
    def to_binary(self):
12149
        packet = []
12150
        packet.append(self.TypeId.to_binary())
12151
        packet.append(self.RequestHeader.to_binary())
12152
        packet.append(self.Parameters.to_binary())
12153
        return b''.join(packet)
12154
12155 1
    @staticmethod
12156
    def from_binary(data):
12157
        return RepublishRequest(data)
12158
12159 1
    def _binary_init(self, data):
12160
        self.TypeId = NodeId.from_binary(data)
12161
        self.RequestHeader = RequestHeader.from_binary(data)
12162
        self.Parameters = RepublishParameters.from_binary(data)
12163
12164 1
    def __str__(self):
12165
        return 'RepublishRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12166
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12167
               'Parameters:' + str(self.Parameters) + ')'
12168
12169 1
    __repr__ = __str__
12170
12171
12172 1 View Code Duplication
class RepublishResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12173
    '''
12174
    :ivar TypeId:
12175
    :vartype TypeId: NodeId
12176
    :ivar ResponseHeader:
12177
    :vartype ResponseHeader: ResponseHeader
12178
    :ivar NotificationMessage:
12179
    :vartype NotificationMessage: NotificationMessage
12180
    '''
12181 1
    def __init__(self, binary=None):
12182
        if binary is not None:
12183
            self._binary_init(binary)
12184
            self._freeze = True
12185
            return
12186
        self.TypeId = FourByteNodeId(ObjectIds.RepublishResponse_Encoding_DefaultBinary)
12187
        self.ResponseHeader = ResponseHeader()
12188
        self.NotificationMessage = NotificationMessage()
12189
        self._freeze = True
12190
12191 1
    def to_binary(self):
12192
        packet = []
12193
        packet.append(self.TypeId.to_binary())
12194
        packet.append(self.ResponseHeader.to_binary())
12195
        packet.append(self.NotificationMessage.to_binary())
12196
        return b''.join(packet)
12197
12198 1
    @staticmethod
12199
    def from_binary(data):
12200
        return RepublishResponse(data)
12201
12202 1
    def _binary_init(self, data):
12203
        self.TypeId = NodeId.from_binary(data)
12204
        self.ResponseHeader = ResponseHeader.from_binary(data)
12205
        self.NotificationMessage = NotificationMessage.from_binary(data)
12206
12207 1
    def __str__(self):
12208
        return 'RepublishResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12209
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12210
               'NotificationMessage:' + str(self.NotificationMessage) + ')'
12211
12212 1
    __repr__ = __str__
12213
12214
12215 1 View Code Duplication
class TransferResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12216
    '''
12217
    :ivar StatusCode:
12218
    :vartype StatusCode: StatusCode
12219
    :ivar AvailableSequenceNumbers:
12220
    :vartype AvailableSequenceNumbers: UInt32
12221
    '''
12222 1
    def __init__(self, binary=None):
12223
        if binary is not None:
12224
            self._binary_init(binary)
12225
            self._freeze = True
12226
            return
12227
        self.StatusCode = StatusCode()
12228
        self.AvailableSequenceNumbers = []
12229
        self._freeze = True
12230
12231 1
    def to_binary(self):
12232
        packet = []
12233
        packet.append(self.StatusCode.to_binary())
12234
        packet.append(uatype_Int32.pack(len(self.AvailableSequenceNumbers)))
12235
        for fieldname in self.AvailableSequenceNumbers:
12236
            packet.append(uatype_UInt32.pack(fieldname))
12237
        return b''.join(packet)
12238
12239 1
    @staticmethod
12240
    def from_binary(data):
12241
        return TransferResult(data)
12242
12243 1
    def _binary_init(self, data):
12244
        self.StatusCode = StatusCode.from_binary(data)
12245
        self.AvailableSequenceNumbers = unpack_uatype_array('UInt32', data)
12246
12247 1
    def __str__(self):
12248
        return 'TransferResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
12249
               'AvailableSequenceNumbers:' + str(self.AvailableSequenceNumbers) + ')'
12250
12251 1
    __repr__ = __str__
12252
12253
12254 1 View Code Duplication
class TransferSubscriptionsParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12255
    '''
12256
    :ivar SubscriptionIds:
12257
    :vartype SubscriptionIds: UInt32
12258
    :ivar SendInitialValues:
12259
    :vartype SendInitialValues: Boolean
12260
    '''
12261 1
    def __init__(self, binary=None):
12262
        if binary is not None:
12263
            self._binary_init(binary)
12264
            self._freeze = True
12265
            return
12266
        self.SubscriptionIds = []
12267
        self.SendInitialValues = True
12268
        self._freeze = True
12269
12270 1
    def to_binary(self):
12271
        packet = []
12272
        packet.append(uatype_Int32.pack(len(self.SubscriptionIds)))
12273
        for fieldname in self.SubscriptionIds:
12274
            packet.append(uatype_UInt32.pack(fieldname))
12275
        packet.append(uatype_Boolean.pack(self.SendInitialValues))
12276
        return b''.join(packet)
12277
12278 1
    @staticmethod
12279
    def from_binary(data):
12280
        return TransferSubscriptionsParameters(data)
12281
12282 1
    def _binary_init(self, data):
12283
        self.SubscriptionIds = unpack_uatype_array('UInt32', data)
12284
        self.SendInitialValues = uatype_Boolean.unpack(data.read(1))[0]
12285
12286 1
    def __str__(self):
12287
        return 'TransferSubscriptionsParameters(' + 'SubscriptionIds:' + str(self.SubscriptionIds) + ', ' + \
12288
               'SendInitialValues:' + str(self.SendInitialValues) + ')'
12289
12290 1
    __repr__ = __str__
12291
12292
12293 1 View Code Duplication
class TransferSubscriptionsRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12294
    '''
12295
    :ivar TypeId:
12296
    :vartype TypeId: NodeId
12297
    :ivar RequestHeader:
12298
    :vartype RequestHeader: RequestHeader
12299
    :ivar Parameters:
12300
    :vartype Parameters: TransferSubscriptionsParameters
12301
    '''
12302 1
    def __init__(self, binary=None):
12303
        if binary is not None:
12304
            self._binary_init(binary)
12305
            self._freeze = True
12306
            return
12307
        self.TypeId = FourByteNodeId(ObjectIds.TransferSubscriptionsRequest_Encoding_DefaultBinary)
12308
        self.RequestHeader = RequestHeader()
12309
        self.Parameters = TransferSubscriptionsParameters()
12310
        self._freeze = True
12311
12312 1
    def to_binary(self):
12313
        packet = []
12314
        packet.append(self.TypeId.to_binary())
12315
        packet.append(self.RequestHeader.to_binary())
12316
        packet.append(self.Parameters.to_binary())
12317
        return b''.join(packet)
12318
12319 1
    @staticmethod
12320
    def from_binary(data):
12321
        return TransferSubscriptionsRequest(data)
12322
12323 1
    def _binary_init(self, data):
12324
        self.TypeId = NodeId.from_binary(data)
12325
        self.RequestHeader = RequestHeader.from_binary(data)
12326
        self.Parameters = TransferSubscriptionsParameters.from_binary(data)
12327
12328 1
    def __str__(self):
12329
        return 'TransferSubscriptionsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12330
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12331
               'Parameters:' + str(self.Parameters) + ')'
12332
12333 1
    __repr__ = __str__
12334
12335
12336 1 View Code Duplication
class TransferSubscriptionsResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12337
    '''
12338
    :ivar Results:
12339
    :vartype Results: TransferResult
12340
    :ivar DiagnosticInfos:
12341
    :vartype DiagnosticInfos: DiagnosticInfo
12342
    '''
12343 1
    def __init__(self, binary=None):
12344
        if binary is not None:
12345
            self._binary_init(binary)
12346
            self._freeze = True
12347
            return
12348
        self.Results = []
12349
        self.DiagnosticInfos = []
12350
        self._freeze = True
12351
12352 1
    def to_binary(self):
12353
        packet = []
12354
        packet.append(uatype_Int32.pack(len(self.Results)))
12355
        for fieldname in self.Results:
12356
            packet.append(fieldname.to_binary())
12357
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
12358
        for fieldname in self.DiagnosticInfos:
12359
            packet.append(fieldname.to_binary())
12360
        return b''.join(packet)
12361
12362 1
    @staticmethod
12363
    def from_binary(data):
12364
        return TransferSubscriptionsResult(data)
12365
12366 1
    def _binary_init(self, data):
12367
        length = uatype_Int32.unpack(data.read(4))[0]
12368
        array = []
12369
        if length != -1:
12370
            for _ in range(0, length):
12371
                array.append(TransferResult.from_binary(data))
12372
        self.Results = array
12373
        length = uatype_Int32.unpack(data.read(4))[0]
12374
        array = []
12375
        if length != -1:
12376
            for _ in range(0, length):
12377
                array.append(DiagnosticInfo.from_binary(data))
12378
        self.DiagnosticInfos = array
12379
12380 1
    def __str__(self):
12381
        return 'TransferSubscriptionsResult(' + 'Results:' + str(self.Results) + ', ' + \
12382
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
12383
12384 1
    __repr__ = __str__
12385
12386
12387 1 View Code Duplication
class TransferSubscriptionsResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12388
    '''
12389
    :ivar TypeId:
12390
    :vartype TypeId: NodeId
12391
    :ivar ResponseHeader:
12392
    :vartype ResponseHeader: ResponseHeader
12393
    :ivar Parameters:
12394
    :vartype Parameters: TransferSubscriptionsResult
12395
    '''
12396 1
    def __init__(self, binary=None):
12397
        if binary is not None:
12398
            self._binary_init(binary)
12399
            self._freeze = True
12400
            return
12401
        self.TypeId = FourByteNodeId(ObjectIds.TransferSubscriptionsResponse_Encoding_DefaultBinary)
12402
        self.ResponseHeader = ResponseHeader()
12403
        self.Parameters = TransferSubscriptionsResult()
12404
        self._freeze = True
12405
12406 1
    def to_binary(self):
12407
        packet = []
12408
        packet.append(self.TypeId.to_binary())
12409
        packet.append(self.ResponseHeader.to_binary())
12410
        packet.append(self.Parameters.to_binary())
12411
        return b''.join(packet)
12412
12413 1
    @staticmethod
12414
    def from_binary(data):
12415
        return TransferSubscriptionsResponse(data)
12416
12417 1
    def _binary_init(self, data):
12418
        self.TypeId = NodeId.from_binary(data)
12419
        self.ResponseHeader = ResponseHeader.from_binary(data)
12420
        self.Parameters = TransferSubscriptionsResult.from_binary(data)
12421
12422 1
    def __str__(self):
12423
        return 'TransferSubscriptionsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12424
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12425
               'Parameters:' + str(self.Parameters) + ')'
12426
12427 1
    __repr__ = __str__
12428
12429
12430 1 View Code Duplication
class DeleteSubscriptionsParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12431
    '''
12432
    :ivar SubscriptionIds:
12433
    :vartype SubscriptionIds: UInt32
12434
    '''
12435 1
    def __init__(self, binary=None):
12436 1
        if binary is not None:
12437 1
            self._binary_init(binary)
12438 1
            self._freeze = True
12439 1
            return
12440 1
        self.SubscriptionIds = []
12441 1
        self._freeze = True
12442
12443 1
    def to_binary(self):
12444 1
        packet = []
12445 1
        packet.append(uatype_Int32.pack(len(self.SubscriptionIds)))
12446 1
        for fieldname in self.SubscriptionIds:
12447 1
            packet.append(uatype_UInt32.pack(fieldname))
12448 1
        return b''.join(packet)
12449
12450 1
    @staticmethod
12451
    def from_binary(data):
12452 1
        return DeleteSubscriptionsParameters(data)
12453
12454 1
    def _binary_init(self, data):
12455 1
        self.SubscriptionIds = unpack_uatype_array('UInt32', data)
12456
12457 1
    def __str__(self):
12458
        return 'DeleteSubscriptionsParameters(' + 'SubscriptionIds:' + str(self.SubscriptionIds) + ')'
12459
12460 1
    __repr__ = __str__
12461
12462
12463 1 View Code Duplication
class DeleteSubscriptionsRequest(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12464
    '''
12465
    :ivar TypeId:
12466
    :vartype TypeId: NodeId
12467
    :ivar RequestHeader:
12468
    :vartype RequestHeader: RequestHeader
12469
    :ivar Parameters:
12470
    :vartype Parameters: DeleteSubscriptionsParameters
12471
    '''
12472 1
    def __init__(self, binary=None):
12473 1
        if binary is not None:
12474
            self._binary_init(binary)
12475
            self._freeze = True
12476
            return
12477 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteSubscriptionsRequest_Encoding_DefaultBinary)
12478 1
        self.RequestHeader = RequestHeader()
12479 1
        self.Parameters = DeleteSubscriptionsParameters()
12480 1
        self._freeze = True
12481
12482 1
    def to_binary(self):
12483 1
        packet = []
12484 1
        packet.append(self.TypeId.to_binary())
12485 1
        packet.append(self.RequestHeader.to_binary())
12486 1
        packet.append(self.Parameters.to_binary())
12487 1
        return b''.join(packet)
12488
12489 1
    @staticmethod
12490
    def from_binary(data):
12491
        return DeleteSubscriptionsRequest(data)
12492
12493 1
    def _binary_init(self, data):
12494
        self.TypeId = NodeId.from_binary(data)
12495
        self.RequestHeader = RequestHeader.from_binary(data)
12496
        self.Parameters = DeleteSubscriptionsParameters.from_binary(data)
12497
12498 1
    def __str__(self):
12499
        return 'DeleteSubscriptionsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12500
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12501
               'Parameters:' + str(self.Parameters) + ')'
12502
12503 1
    __repr__ = __str__
12504
12505
12506 1 View Code Duplication
class DeleteSubscriptionsResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12507
    '''
12508
    :ivar TypeId:
12509
    :vartype TypeId: NodeId
12510
    :ivar ResponseHeader:
12511
    :vartype ResponseHeader: ResponseHeader
12512
    :ivar Results:
12513
    :vartype Results: StatusCode
12514
    :ivar DiagnosticInfos:
12515
    :vartype DiagnosticInfos: DiagnosticInfo
12516
    '''
12517 1
    def __init__(self, binary=None):
12518 1
        if binary is not None:
12519 1
            self._binary_init(binary)
12520 1
            self._freeze = True
12521 1
            return
12522 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteSubscriptionsResponse_Encoding_DefaultBinary)
12523 1
        self.ResponseHeader = ResponseHeader()
12524 1
        self.Results = []
12525 1
        self.DiagnosticInfos = []
12526 1
        self._freeze = True
12527
12528 1
    def to_binary(self):
12529 1
        packet = []
12530 1
        packet.append(self.TypeId.to_binary())
12531 1
        packet.append(self.ResponseHeader.to_binary())
12532 1
        packet.append(uatype_Int32.pack(len(self.Results)))
12533 1
        for fieldname in self.Results:
12534 1
            packet.append(fieldname.to_binary())
12535 1
        packet.append(uatype_Int32.pack(len(self.DiagnosticInfos)))
12536 1
        for fieldname in self.DiagnosticInfos:
12537
            packet.append(fieldname.to_binary())
12538 1
        return b''.join(packet)
12539
12540 1
    @staticmethod
12541
    def from_binary(data):
12542 1
        return DeleteSubscriptionsResponse(data)
12543
12544 1
    def _binary_init(self, data):
12545 1
        self.TypeId = NodeId.from_binary(data)
12546 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
12547 1
        length = uatype_Int32.unpack(data.read(4))[0]
12548 1
        array = []
12549 1
        if length != -1:
12550 1
            for _ in range(0, length):
12551 1
                array.append(StatusCode.from_binary(data))
12552 1
        self.Results = array
12553 1
        length = uatype_Int32.unpack(data.read(4))[0]
12554 1
        array = []
12555 1
        if length != -1:
12556 1
            for _ in range(0, length):
12557
                array.append(DiagnosticInfo.from_binary(data))
12558 1
        self.DiagnosticInfos = array
12559
12560 1
    def __str__(self):
12561
        return 'DeleteSubscriptionsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12562
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12563
               'Results:' + str(self.Results) + ', ' + \
12564
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
12565
12566 1
    __repr__ = __str__
12567
12568
12569 1
class BuildInfo(FrozenClass):
12570
    '''
12571
    :ivar ProductUri:
12572
    :vartype ProductUri: String
12573
    :ivar ManufacturerName:
12574
    :vartype ManufacturerName: String
12575
    :ivar ProductName:
12576
    :vartype ProductName: String
12577
    :ivar SoftwareVersion:
12578
    :vartype SoftwareVersion: String
12579
    :ivar BuildNumber:
12580
    :vartype BuildNumber: String
12581
    :ivar BuildDate:
12582
    :vartype BuildDate: DateTime
12583
    '''
12584 1
    def __init__(self, binary=None):
12585
        if binary is not None:
12586
            self._binary_init(binary)
12587
            self._freeze = True
12588
            return
12589
        self.ProductUri = ''
12590
        self.ManufacturerName = ''
12591
        self.ProductName = ''
12592
        self.SoftwareVersion = ''
12593
        self.BuildNumber = ''
12594
        self.BuildDate = datetime.now()
12595
        self._freeze = True
12596
12597 1
    def to_binary(self):
12598
        packet = []
12599
        packet.append(pack_string(self.ProductUri))
12600
        packet.append(pack_string(self.ManufacturerName))
12601
        packet.append(pack_string(self.ProductName))
12602
        packet.append(pack_string(self.SoftwareVersion))
12603
        packet.append(pack_string(self.BuildNumber))
12604
        packet.append(pack_datetime(self.BuildDate))
12605
        return b''.join(packet)
12606
12607 1
    @staticmethod
12608
    def from_binary(data):
12609
        return BuildInfo(data)
12610
12611 1
    def _binary_init(self, data):
12612
        self.ProductUri = unpack_string(data)
12613
        self.ManufacturerName = unpack_string(data)
12614
        self.ProductName = unpack_string(data)
12615
        self.SoftwareVersion = unpack_string(data)
12616
        self.BuildNumber = unpack_string(data)
12617
        self.BuildDate = unpack_datetime(data)
12618
12619 1
    def __str__(self):
12620
        return 'BuildInfo(' + 'ProductUri:' + str(self.ProductUri) + ', ' + \
12621
               'ManufacturerName:' + str(self.ManufacturerName) + ', ' + \
12622
               'ProductName:' + str(self.ProductName) + ', ' + \
12623
               'SoftwareVersion:' + str(self.SoftwareVersion) + ', ' + \
12624
               'BuildNumber:' + str(self.BuildNumber) + ', ' + \
12625
               'BuildDate:' + str(self.BuildDate) + ')'
12626
12627 1
    __repr__ = __str__
12628
12629
12630 1
class RedundantServerDataType(FrozenClass):
12631
    '''
12632
    :ivar ServerId:
12633
    :vartype ServerId: String
12634
    :ivar ServiceLevel:
12635
    :vartype ServiceLevel: Byte
12636
    :ivar ServerState:
12637
    :vartype ServerState: ServerState
12638
    '''
12639 1
    def __init__(self, binary=None):
12640
        if binary is not None:
12641
            self._binary_init(binary)
12642
            self._freeze = True
12643
            return
12644
        self.ServerId = ''
12645
        self.ServiceLevel = 0
12646
        self.ServerState = ServerState(0)
12647
        self._freeze = True
12648
12649 1
    def to_binary(self):
12650
        packet = []
12651
        packet.append(pack_string(self.ServerId))
12652
        packet.append(uatype_Byte.pack(self.ServiceLevel))
12653
        packet.append(uatype_UInt32.pack(self.ServerState.value))
12654
        return b''.join(packet)
12655
12656 1
    @staticmethod
12657
    def from_binary(data):
12658
        return RedundantServerDataType(data)
12659
12660 1
    def _binary_init(self, data):
12661
        self.ServerId = unpack_string(data)
12662
        self.ServiceLevel = uatype_Byte.unpack(data.read(1))[0]
12663
        self.ServerState = ServerState(uatype_UInt32.unpack(data.read(4))[0])
12664
12665 1
    def __str__(self):
12666
        return 'RedundantServerDataType(' + 'ServerId:' + str(self.ServerId) + ', ' + \
12667
               'ServiceLevel:' + str(self.ServiceLevel) + ', ' + \
12668
               'ServerState:' + str(self.ServerState) + ')'
12669
12670 1
    __repr__ = __str__
12671
12672
12673 1
class EndpointUrlListDataType(FrozenClass):
12674
    '''
12675
    :ivar EndpointUrlList:
12676
    :vartype EndpointUrlList: String
12677
    '''
12678 1
    def __init__(self, binary=None):
12679
        if binary is not None:
12680
            self._binary_init(binary)
12681
            self._freeze = True
12682
            return
12683
        self.EndpointUrlList = []
12684
        self._freeze = True
12685
12686 1
    def to_binary(self):
12687
        packet = []
12688
        packet.append(uatype_Int32.pack(len(self.EndpointUrlList)))
12689
        for fieldname in self.EndpointUrlList:
12690
            packet.append(pack_string(fieldname))
12691
        return b''.join(packet)
12692
12693 1
    @staticmethod
12694
    def from_binary(data):
12695
        return EndpointUrlListDataType(data)
12696
12697 1
    def _binary_init(self, data):
12698
        self.EndpointUrlList = unpack_uatype_array('String', data)
12699
12700 1
    def __str__(self):
12701
        return 'EndpointUrlListDataType(' + 'EndpointUrlList:' + str(self.EndpointUrlList) + ')'
12702
12703 1
    __repr__ = __str__
12704
12705
12706 1
class NetworkGroupDataType(FrozenClass):
12707
    '''
12708
    :ivar ServerUri:
12709
    :vartype ServerUri: String
12710
    :ivar NetworkPaths:
12711
    :vartype NetworkPaths: EndpointUrlListDataType
12712
    '''
12713 1
    def __init__(self, binary=None):
12714
        if binary is not None:
12715
            self._binary_init(binary)
12716
            self._freeze = True
12717
            return
12718
        self.ServerUri = ''
12719
        self.NetworkPaths = []
12720
        self._freeze = True
12721
12722 1
    def to_binary(self):
12723
        packet = []
12724
        packet.append(pack_string(self.ServerUri))
12725
        packet.append(uatype_Int32.pack(len(self.NetworkPaths)))
12726
        for fieldname in self.NetworkPaths:
12727
            packet.append(fieldname.to_binary())
12728
        return b''.join(packet)
12729
12730 1
    @staticmethod
12731
    def from_binary(data):
12732
        return NetworkGroupDataType(data)
12733
12734 1
    def _binary_init(self, data):
12735
        self.ServerUri = unpack_string(data)
12736
        length = uatype_Int32.unpack(data.read(4))[0]
12737
        array = []
12738
        if length != -1:
12739
            for _ in range(0, length):
12740
                array.append(EndpointUrlListDataType.from_binary(data))
12741
        self.NetworkPaths = array
12742
12743 1
    def __str__(self):
12744
        return 'NetworkGroupDataType(' + 'ServerUri:' + str(self.ServerUri) + ', ' + \
12745
               'NetworkPaths:' + str(self.NetworkPaths) + ')'
12746
12747 1
    __repr__ = __str__
12748
12749
12750 1
class SamplingIntervalDiagnosticsDataType(FrozenClass):
12751
    '''
12752
    :ivar SamplingInterval:
12753
    :vartype SamplingInterval: Double
12754
    :ivar MonitoredItemCount:
12755
    :vartype MonitoredItemCount: UInt32
12756
    :ivar MaxMonitoredItemCount:
12757
    :vartype MaxMonitoredItemCount: UInt32
12758
    :ivar DisabledMonitoredItemCount:
12759
    :vartype DisabledMonitoredItemCount: UInt32
12760
    '''
12761 1
    def __init__(self, binary=None):
12762
        if binary is not None:
12763
            self._binary_init(binary)
12764
            self._freeze = True
12765
            return
12766
        self.SamplingInterval = 0
12767
        self.MonitoredItemCount = 0
12768
        self.MaxMonitoredItemCount = 0
12769
        self.DisabledMonitoredItemCount = 0
12770
        self._freeze = True
12771
12772 1
    def to_binary(self):
12773
        packet = []
12774
        packet.append(uatype_Double.pack(self.SamplingInterval))
12775
        packet.append(uatype_UInt32.pack(self.MonitoredItemCount))
12776
        packet.append(uatype_UInt32.pack(self.MaxMonitoredItemCount))
12777
        packet.append(uatype_UInt32.pack(self.DisabledMonitoredItemCount))
12778
        return b''.join(packet)
12779
12780 1
    @staticmethod
12781
    def from_binary(data):
12782
        return SamplingIntervalDiagnosticsDataType(data)
12783
12784 1
    def _binary_init(self, data):
12785
        self.SamplingInterval = uatype_Double.unpack(data.read(8))[0]
12786
        self.MonitoredItemCount = uatype_UInt32.unpack(data.read(4))[0]
12787
        self.MaxMonitoredItemCount = uatype_UInt32.unpack(data.read(4))[0]
12788
        self.DisabledMonitoredItemCount = uatype_UInt32.unpack(data.read(4))[0]
12789
12790 1
    def __str__(self):
12791
        return 'SamplingIntervalDiagnosticsDataType(' + 'SamplingInterval:' + str(self.SamplingInterval) + ', ' + \
12792
               'MonitoredItemCount:' + str(self.MonitoredItemCount) + ', ' + \
12793
               'MaxMonitoredItemCount:' + str(self.MaxMonitoredItemCount) + ', ' + \
12794
               'DisabledMonitoredItemCount:' + str(self.DisabledMonitoredItemCount) + ')'
12795
12796 1
    __repr__ = __str__
12797
12798
12799 1
class ServerDiagnosticsSummaryDataType(FrozenClass):
12800
    '''
12801
    :ivar ServerViewCount:
12802
    :vartype ServerViewCount: UInt32
12803
    :ivar CurrentSessionCount:
12804
    :vartype CurrentSessionCount: UInt32
12805
    :ivar CumulatedSessionCount:
12806
    :vartype CumulatedSessionCount: UInt32
12807
    :ivar SecurityRejectedSessionCount:
12808
    :vartype SecurityRejectedSessionCount: UInt32
12809
    :ivar RejectedSessionCount:
12810
    :vartype RejectedSessionCount: UInt32
12811
    :ivar SessionTimeoutCount:
12812
    :vartype SessionTimeoutCount: UInt32
12813
    :ivar SessionAbortCount:
12814
    :vartype SessionAbortCount: UInt32
12815
    :ivar CurrentSubscriptionCount:
12816
    :vartype CurrentSubscriptionCount: UInt32
12817
    :ivar CumulatedSubscriptionCount:
12818
    :vartype CumulatedSubscriptionCount: UInt32
12819
    :ivar PublishingIntervalCount:
12820
    :vartype PublishingIntervalCount: UInt32
12821
    :ivar SecurityRejectedRequestsCount:
12822
    :vartype SecurityRejectedRequestsCount: UInt32
12823
    :ivar RejectedRequestsCount:
12824
    :vartype RejectedRequestsCount: UInt32
12825
    '''
12826 1
    def __init__(self, binary=None):
12827
        if binary is not None:
12828
            self._binary_init(binary)
12829
            self._freeze = True
12830
            return
12831
        self.ServerViewCount = 0
12832
        self.CurrentSessionCount = 0
12833
        self.CumulatedSessionCount = 0
12834
        self.SecurityRejectedSessionCount = 0
12835
        self.RejectedSessionCount = 0
12836
        self.SessionTimeoutCount = 0
12837
        self.SessionAbortCount = 0
12838
        self.CurrentSubscriptionCount = 0
12839
        self.CumulatedSubscriptionCount = 0
12840
        self.PublishingIntervalCount = 0
12841
        self.SecurityRejectedRequestsCount = 0
12842
        self.RejectedRequestsCount = 0
12843
        self._freeze = True
12844
12845 1
    def to_binary(self):
12846
        packet = []
12847
        packet.append(uatype_UInt32.pack(self.ServerViewCount))
12848
        packet.append(uatype_UInt32.pack(self.CurrentSessionCount))
12849
        packet.append(uatype_UInt32.pack(self.CumulatedSessionCount))
12850
        packet.append(uatype_UInt32.pack(self.SecurityRejectedSessionCount))
12851
        packet.append(uatype_UInt32.pack(self.RejectedSessionCount))
12852
        packet.append(uatype_UInt32.pack(self.SessionTimeoutCount))
12853
        packet.append(uatype_UInt32.pack(self.SessionAbortCount))
12854
        packet.append(uatype_UInt32.pack(self.CurrentSubscriptionCount))
12855
        packet.append(uatype_UInt32.pack(self.CumulatedSubscriptionCount))
12856
        packet.append(uatype_UInt32.pack(self.PublishingIntervalCount))
12857
        packet.append(uatype_UInt32.pack(self.SecurityRejectedRequestsCount))
12858
        packet.append(uatype_UInt32.pack(self.RejectedRequestsCount))
12859
        return b''.join(packet)
12860
12861 1
    @staticmethod
12862
    def from_binary(data):
12863
        return ServerDiagnosticsSummaryDataType(data)
12864
12865 1
    def _binary_init(self, data):
12866
        self.ServerViewCount = uatype_UInt32.unpack(data.read(4))[0]
12867
        self.CurrentSessionCount = uatype_UInt32.unpack(data.read(4))[0]
12868
        self.CumulatedSessionCount = uatype_UInt32.unpack(data.read(4))[0]
12869
        self.SecurityRejectedSessionCount = uatype_UInt32.unpack(data.read(4))[0]
12870
        self.RejectedSessionCount = uatype_UInt32.unpack(data.read(4))[0]
12871
        self.SessionTimeoutCount = uatype_UInt32.unpack(data.read(4))[0]
12872
        self.SessionAbortCount = uatype_UInt32.unpack(data.read(4))[0]
12873
        self.CurrentSubscriptionCount = uatype_UInt32.unpack(data.read(4))[0]
12874
        self.CumulatedSubscriptionCount = uatype_UInt32.unpack(data.read(4))[0]
12875
        self.PublishingIntervalCount = uatype_UInt32.unpack(data.read(4))[0]
12876
        self.SecurityRejectedRequestsCount = uatype_UInt32.unpack(data.read(4))[0]
12877
        self.RejectedRequestsCount = uatype_UInt32.unpack(data.read(4))[0]
12878
12879 1
    def __str__(self):
12880
        return 'ServerDiagnosticsSummaryDataType(' + 'ServerViewCount:' + str(self.ServerViewCount) + ', ' + \
12881
               'CurrentSessionCount:' + str(self.CurrentSessionCount) + ', ' + \
12882
               'CumulatedSessionCount:' + str(self.CumulatedSessionCount) + ', ' + \
12883
               'SecurityRejectedSessionCount:' + str(self.SecurityRejectedSessionCount) + ', ' + \
12884
               'RejectedSessionCount:' + str(self.RejectedSessionCount) + ', ' + \
12885
               'SessionTimeoutCount:' + str(self.SessionTimeoutCount) + ', ' + \
12886
               'SessionAbortCount:' + str(self.SessionAbortCount) + ', ' + \
12887
               'CurrentSubscriptionCount:' + str(self.CurrentSubscriptionCount) + ', ' + \
12888
               'CumulatedSubscriptionCount:' + str(self.CumulatedSubscriptionCount) + ', ' + \
12889
               'PublishingIntervalCount:' + str(self.PublishingIntervalCount) + ', ' + \
12890
               'SecurityRejectedRequestsCount:' + str(self.SecurityRejectedRequestsCount) + ', ' + \
12891
               'RejectedRequestsCount:' + str(self.RejectedRequestsCount) + ')'
12892
12893 1
    __repr__ = __str__
12894
12895
12896 1
class ServerStatusDataType(FrozenClass):
12897
    '''
12898
    :ivar StartTime:
12899
    :vartype StartTime: DateTime
12900
    :ivar CurrentTime:
12901
    :vartype CurrentTime: DateTime
12902
    :ivar State:
12903
    :vartype State: ServerState
12904
    :ivar BuildInfo:
12905
    :vartype BuildInfo: BuildInfo
12906
    :ivar SecondsTillShutdown:
12907
    :vartype SecondsTillShutdown: UInt32
12908
    :ivar ShutdownReason:
12909
    :vartype ShutdownReason: LocalizedText
12910
    '''
12911 1
    def __init__(self, binary=None):
12912
        if binary is not None:
12913
            self._binary_init(binary)
12914
            self._freeze = True
12915
            return
12916
        self.StartTime = datetime.now()
12917
        self.CurrentTime = datetime.now()
12918
        self.State = ServerState(0)
12919
        self.BuildInfo = BuildInfo()
12920
        self.SecondsTillShutdown = 0
12921
        self.ShutdownReason = LocalizedText()
12922
        self._freeze = True
12923
12924 1
    def to_binary(self):
12925
        packet = []
12926
        packet.append(pack_datetime(self.StartTime))
12927
        packet.append(pack_datetime(self.CurrentTime))
12928
        packet.append(uatype_UInt32.pack(self.State.value))
12929
        packet.append(self.BuildInfo.to_binary())
12930
        packet.append(uatype_UInt32.pack(self.SecondsTillShutdown))
12931
        packet.append(self.ShutdownReason.to_binary())
12932
        return b''.join(packet)
12933
12934 1
    @staticmethod
12935
    def from_binary(data):
12936
        return ServerStatusDataType(data)
12937
12938 1
    def _binary_init(self, data):
12939
        self.StartTime = unpack_datetime(data)
12940
        self.CurrentTime = unpack_datetime(data)
12941
        self.State = ServerState(uatype_UInt32.unpack(data.read(4))[0])
12942
        self.BuildInfo = BuildInfo.from_binary(data)
12943
        self.SecondsTillShutdown = uatype_UInt32.unpack(data.read(4))[0]
12944
        self.ShutdownReason = LocalizedText.from_binary(data)
12945
12946 1
    def __str__(self):
12947
        return 'ServerStatusDataType(' + 'StartTime:' + str(self.StartTime) + ', ' + \
12948
               'CurrentTime:' + str(self.CurrentTime) + ', ' + \
12949
               'State:' + str(self.State) + ', ' + \
12950
               'BuildInfo:' + str(self.BuildInfo) + ', ' + \
12951
               'SecondsTillShutdown:' + str(self.SecondsTillShutdown) + ', ' + \
12952
               'ShutdownReason:' + str(self.ShutdownReason) + ')'
12953
12954 1
    __repr__ = __str__
12955
12956
12957 1
class SessionDiagnosticsDataType(FrozenClass):
12958
    '''
12959
    :ivar SessionId:
12960
    :vartype SessionId: NodeId
12961
    :ivar SessionName:
12962
    :vartype SessionName: String
12963
    :ivar ClientDescription:
12964
    :vartype ClientDescription: ApplicationDescription
12965
    :ivar ServerUri:
12966
    :vartype ServerUri: String
12967
    :ivar EndpointUrl:
12968
    :vartype EndpointUrl: String
12969
    :ivar LocaleIds:
12970
    :vartype LocaleIds: String
12971
    :ivar ActualSessionTimeout:
12972
    :vartype ActualSessionTimeout: Double
12973
    :ivar MaxResponseMessageSize:
12974
    :vartype MaxResponseMessageSize: UInt32
12975
    :ivar ClientConnectionTime:
12976
    :vartype ClientConnectionTime: DateTime
12977
    :ivar ClientLastContactTime:
12978
    :vartype ClientLastContactTime: DateTime
12979
    :ivar CurrentSubscriptionsCount:
12980
    :vartype CurrentSubscriptionsCount: UInt32
12981
    :ivar CurrentMonitoredItemsCount:
12982
    :vartype CurrentMonitoredItemsCount: UInt32
12983
    :ivar CurrentPublishRequestsInQueue:
12984
    :vartype CurrentPublishRequestsInQueue: UInt32
12985
    :ivar TotalRequestCount:
12986
    :vartype TotalRequestCount: ServiceCounterDataType
12987
    :ivar UnauthorizedRequestCount:
12988
    :vartype UnauthorizedRequestCount: UInt32
12989
    :ivar ReadCount:
12990
    :vartype ReadCount: ServiceCounterDataType
12991
    :ivar HistoryReadCount:
12992
    :vartype HistoryReadCount: ServiceCounterDataType
12993
    :ivar WriteCount:
12994
    :vartype WriteCount: ServiceCounterDataType
12995
    :ivar HistoryUpdateCount:
12996
    :vartype HistoryUpdateCount: ServiceCounterDataType
12997
    :ivar CallCount:
12998
    :vartype CallCount: ServiceCounterDataType
12999
    :ivar CreateMonitoredItemsCount:
13000
    :vartype CreateMonitoredItemsCount: ServiceCounterDataType
13001
    :ivar ModifyMonitoredItemsCount:
13002
    :vartype ModifyMonitoredItemsCount: ServiceCounterDataType
13003
    :ivar SetMonitoringModeCount:
13004
    :vartype SetMonitoringModeCount: ServiceCounterDataType
13005
    :ivar SetTriggeringCount:
13006
    :vartype SetTriggeringCount: ServiceCounterDataType
13007
    :ivar DeleteMonitoredItemsCount:
13008
    :vartype DeleteMonitoredItemsCount: ServiceCounterDataType
13009
    :ivar CreateSubscriptionCount:
13010
    :vartype CreateSubscriptionCount: ServiceCounterDataType
13011
    :ivar ModifySubscriptionCount:
13012
    :vartype ModifySubscriptionCount: ServiceCounterDataType
13013
    :ivar SetPublishingModeCount:
13014
    :vartype SetPublishingModeCount: ServiceCounterDataType
13015
    :ivar PublishCount:
13016
    :vartype PublishCount: ServiceCounterDataType
13017
    :ivar RepublishCount:
13018
    :vartype RepublishCount: ServiceCounterDataType
13019
    :ivar TransferSubscriptionsCount:
13020
    :vartype TransferSubscriptionsCount: ServiceCounterDataType
13021
    :ivar DeleteSubscriptionsCount:
13022
    :vartype DeleteSubscriptionsCount: ServiceCounterDataType
13023
    :ivar AddNodesCount:
13024
    :vartype AddNodesCount: ServiceCounterDataType
13025
    :ivar AddReferencesCount:
13026
    :vartype AddReferencesCount: ServiceCounterDataType
13027
    :ivar DeleteNodesCount:
13028
    :vartype DeleteNodesCount: ServiceCounterDataType
13029
    :ivar DeleteReferencesCount:
13030
    :vartype DeleteReferencesCount: ServiceCounterDataType
13031
    :ivar BrowseCount:
13032
    :vartype BrowseCount: ServiceCounterDataType
13033
    :ivar BrowseNextCount:
13034
    :vartype BrowseNextCount: ServiceCounterDataType
13035
    :ivar TranslateBrowsePathsToNodeIdsCount:
13036
    :vartype TranslateBrowsePathsToNodeIdsCount: ServiceCounterDataType
13037
    :ivar QueryFirstCount:
13038
    :vartype QueryFirstCount: ServiceCounterDataType
13039
    :ivar QueryNextCount:
13040
    :vartype QueryNextCount: ServiceCounterDataType
13041
    :ivar RegisterNodesCount:
13042
    :vartype RegisterNodesCount: ServiceCounterDataType
13043
    :ivar UnregisterNodesCount:
13044
    :vartype UnregisterNodesCount: ServiceCounterDataType
13045
    '''
13046 1
    def __init__(self, binary=None):
13047
        if binary is not None:
13048
            self._binary_init(binary)
13049
            self._freeze = True
13050
            return
13051
        self.SessionId = NodeId()
13052
        self.SessionName = ''
13053
        self.ClientDescription = ApplicationDescription()
13054
        self.ServerUri = ''
13055
        self.EndpointUrl = ''
13056
        self.LocaleIds = []
13057
        self.ActualSessionTimeout = 0
13058
        self.MaxResponseMessageSize = 0
13059
        self.ClientConnectionTime = datetime.now()
13060
        self.ClientLastContactTime = datetime.now()
13061
        self.CurrentSubscriptionsCount = 0
13062
        self.CurrentMonitoredItemsCount = 0
13063
        self.CurrentPublishRequestsInQueue = 0
13064
        self.TotalRequestCount = ServiceCounterDataType()
13065
        self.UnauthorizedRequestCount = 0
13066
        self.ReadCount = ServiceCounterDataType()
13067
        self.HistoryReadCount = ServiceCounterDataType()
13068
        self.WriteCount = ServiceCounterDataType()
13069
        self.HistoryUpdateCount = ServiceCounterDataType()
13070
        self.CallCount = ServiceCounterDataType()
13071
        self.CreateMonitoredItemsCount = ServiceCounterDataType()
13072
        self.ModifyMonitoredItemsCount = ServiceCounterDataType()
13073
        self.SetMonitoringModeCount = ServiceCounterDataType()
13074
        self.SetTriggeringCount = ServiceCounterDataType()
13075
        self.DeleteMonitoredItemsCount = ServiceCounterDataType()
13076
        self.CreateSubscriptionCount = ServiceCounterDataType()
13077
        self.ModifySubscriptionCount = ServiceCounterDataType()
13078
        self.SetPublishingModeCount = ServiceCounterDataType()
13079
        self.PublishCount = ServiceCounterDataType()
13080
        self.RepublishCount = ServiceCounterDataType()
13081
        self.TransferSubscriptionsCount = ServiceCounterDataType()
13082
        self.DeleteSubscriptionsCount = ServiceCounterDataType()
13083
        self.AddNodesCount = ServiceCounterDataType()
13084
        self.AddReferencesCount = ServiceCounterDataType()
13085
        self.DeleteNodesCount = ServiceCounterDataType()
13086
        self.DeleteReferencesCount = ServiceCounterDataType()
13087
        self.BrowseCount = ServiceCounterDataType()
13088
        self.BrowseNextCount = ServiceCounterDataType()
13089
        self.TranslateBrowsePathsToNodeIdsCount = ServiceCounterDataType()
13090
        self.QueryFirstCount = ServiceCounterDataType()
13091
        self.QueryNextCount = ServiceCounterDataType()
13092
        self.RegisterNodesCount = ServiceCounterDataType()
13093
        self.UnregisterNodesCount = ServiceCounterDataType()
13094
        self._freeze = True
13095
13096 1
    def to_binary(self):
13097
        packet = []
13098
        packet.append(self.SessionId.to_binary())
13099
        packet.append(pack_string(self.SessionName))
13100
        packet.append(self.ClientDescription.to_binary())
13101
        packet.append(pack_string(self.ServerUri))
13102
        packet.append(pack_string(self.EndpointUrl))
13103
        packet.append(uatype_Int32.pack(len(self.LocaleIds)))
13104
        for fieldname in self.LocaleIds:
13105
            packet.append(pack_string(fieldname))
13106
        packet.append(uatype_Double.pack(self.ActualSessionTimeout))
13107
        packet.append(uatype_UInt32.pack(self.MaxResponseMessageSize))
13108
        packet.append(pack_datetime(self.ClientConnectionTime))
13109
        packet.append(pack_datetime(self.ClientLastContactTime))
13110
        packet.append(uatype_UInt32.pack(self.CurrentSubscriptionsCount))
13111
        packet.append(uatype_UInt32.pack(self.CurrentMonitoredItemsCount))
13112
        packet.append(uatype_UInt32.pack(self.CurrentPublishRequestsInQueue))
13113
        packet.append(self.TotalRequestCount.to_binary())
13114
        packet.append(uatype_UInt32.pack(self.UnauthorizedRequestCount))
13115
        packet.append(self.ReadCount.to_binary())
13116
        packet.append(self.HistoryReadCount.to_binary())
13117
        packet.append(self.WriteCount.to_binary())
13118
        packet.append(self.HistoryUpdateCount.to_binary())
13119
        packet.append(self.CallCount.to_binary())
13120
        packet.append(self.CreateMonitoredItemsCount.to_binary())
13121
        packet.append(self.ModifyMonitoredItemsCount.to_binary())
13122
        packet.append(self.SetMonitoringModeCount.to_binary())
13123
        packet.append(self.SetTriggeringCount.to_binary())
13124
        packet.append(self.DeleteMonitoredItemsCount.to_binary())
13125
        packet.append(self.CreateSubscriptionCount.to_binary())
13126
        packet.append(self.ModifySubscriptionCount.to_binary())
13127
        packet.append(self.SetPublishingModeCount.to_binary())
13128
        packet.append(self.PublishCount.to_binary())
13129
        packet.append(self.RepublishCount.to_binary())
13130
        packet.append(self.TransferSubscriptionsCount.to_binary())
13131
        packet.append(self.DeleteSubscriptionsCount.to_binary())
13132
        packet.append(self.AddNodesCount.to_binary())
13133
        packet.append(self.AddReferencesCount.to_binary())
13134
        packet.append(self.DeleteNodesCount.to_binary())
13135
        packet.append(self.DeleteReferencesCount.to_binary())
13136
        packet.append(self.BrowseCount.to_binary())
13137
        packet.append(self.BrowseNextCount.to_binary())
13138
        packet.append(self.TranslateBrowsePathsToNodeIdsCount.to_binary())
13139
        packet.append(self.QueryFirstCount.to_binary())
13140
        packet.append(self.QueryNextCount.to_binary())
13141
        packet.append(self.RegisterNodesCount.to_binary())
13142
        packet.append(self.UnregisterNodesCount.to_binary())
13143
        return b''.join(packet)
13144
13145 1
    @staticmethod
13146
    def from_binary(data):
13147
        return SessionDiagnosticsDataType(data)
13148
13149 1
    def _binary_init(self, data):
13150
        self.SessionId = NodeId.from_binary(data)
13151
        self.SessionName = unpack_string(data)
13152
        self.ClientDescription = ApplicationDescription.from_binary(data)
13153
        self.ServerUri = unpack_string(data)
13154
        self.EndpointUrl = unpack_string(data)
13155
        self.LocaleIds = unpack_uatype_array('String', data)
13156
        self.ActualSessionTimeout = uatype_Double.unpack(data.read(8))[0]
13157
        self.MaxResponseMessageSize = uatype_UInt32.unpack(data.read(4))[0]
13158
        self.ClientConnectionTime = unpack_datetime(data)
13159
        self.ClientLastContactTime = unpack_datetime(data)
13160
        self.CurrentSubscriptionsCount = uatype_UInt32.unpack(data.read(4))[0]
13161
        self.CurrentMonitoredItemsCount = uatype_UInt32.unpack(data.read(4))[0]
13162
        self.CurrentPublishRequestsInQueue = uatype_UInt32.unpack(data.read(4))[0]
13163
        self.TotalRequestCount = ServiceCounterDataType.from_binary(data)
13164
        self.UnauthorizedRequestCount = uatype_UInt32.unpack(data.read(4))[0]
13165
        self.ReadCount = ServiceCounterDataType.from_binary(data)
13166
        self.HistoryReadCount = ServiceCounterDataType.from_binary(data)
13167
        self.WriteCount = ServiceCounterDataType.from_binary(data)
13168
        self.HistoryUpdateCount = ServiceCounterDataType.from_binary(data)
13169
        self.CallCount = ServiceCounterDataType.from_binary(data)
13170
        self.CreateMonitoredItemsCount = ServiceCounterDataType.from_binary(data)
13171
        self.ModifyMonitoredItemsCount = ServiceCounterDataType.from_binary(data)
13172
        self.SetMonitoringModeCount = ServiceCounterDataType.from_binary(data)
13173
        self.SetTriggeringCount = ServiceCounterDataType.from_binary(data)
13174
        self.DeleteMonitoredItemsCount = ServiceCounterDataType.from_binary(data)
13175
        self.CreateSubscriptionCount = ServiceCounterDataType.from_binary(data)
13176
        self.ModifySubscriptionCount = ServiceCounterDataType.from_binary(data)
13177
        self.SetPublishingModeCount = ServiceCounterDataType.from_binary(data)
13178
        self.PublishCount = ServiceCounterDataType.from_binary(data)
13179
        self.RepublishCount = ServiceCounterDataType.from_binary(data)
13180
        self.TransferSubscriptionsCount = ServiceCounterDataType.from_binary(data)
13181
        self.DeleteSubscriptionsCount = ServiceCounterDataType.from_binary(data)
13182
        self.AddNodesCount = ServiceCounterDataType.from_binary(data)
13183
        self.AddReferencesCount = ServiceCounterDataType.from_binary(data)
13184
        self.DeleteNodesCount = ServiceCounterDataType.from_binary(data)
13185
        self.DeleteReferencesCount = ServiceCounterDataType.from_binary(data)
13186
        self.BrowseCount = ServiceCounterDataType.from_binary(data)
13187
        self.BrowseNextCount = ServiceCounterDataType.from_binary(data)
13188
        self.TranslateBrowsePathsToNodeIdsCount = ServiceCounterDataType.from_binary(data)
13189
        self.QueryFirstCount = ServiceCounterDataType.from_binary(data)
13190
        self.QueryNextCount = ServiceCounterDataType.from_binary(data)
13191
        self.RegisterNodesCount = ServiceCounterDataType.from_binary(data)
13192
        self.UnregisterNodesCount = ServiceCounterDataType.from_binary(data)
13193
13194 1
    def __str__(self):
13195
        return 'SessionDiagnosticsDataType(' + 'SessionId:' + str(self.SessionId) + ', ' + \
13196
               'SessionName:' + str(self.SessionName) + ', ' + \
13197
               'ClientDescription:' + str(self.ClientDescription) + ', ' + \
13198
               'ServerUri:' + str(self.ServerUri) + ', ' + \
13199
               'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
13200
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
13201
               'ActualSessionTimeout:' + str(self.ActualSessionTimeout) + ', ' + \
13202
               'MaxResponseMessageSize:' + str(self.MaxResponseMessageSize) + ', ' + \
13203
               'ClientConnectionTime:' + str(self.ClientConnectionTime) + ', ' + \
13204
               'ClientLastContactTime:' + str(self.ClientLastContactTime) + ', ' + \
13205
               'CurrentSubscriptionsCount:' + str(self.CurrentSubscriptionsCount) + ', ' + \
13206
               'CurrentMonitoredItemsCount:' + str(self.CurrentMonitoredItemsCount) + ', ' + \
13207
               'CurrentPublishRequestsInQueue:' + str(self.CurrentPublishRequestsInQueue) + ', ' + \
13208
               'TotalRequestCount:' + str(self.TotalRequestCount) + ', ' + \
13209
               'UnauthorizedRequestCount:' + str(self.UnauthorizedRequestCount) + ', ' + \
13210
               'ReadCount:' + str(self.ReadCount) + ', ' + \
13211
               'HistoryReadCount:' + str(self.HistoryReadCount) + ', ' + \
13212
               'WriteCount:' + str(self.WriteCount) + ', ' + \
13213
               'HistoryUpdateCount:' + str(self.HistoryUpdateCount) + ', ' + \
13214
               'CallCount:' + str(self.CallCount) + ', ' + \
13215
               'CreateMonitoredItemsCount:' + str(self.CreateMonitoredItemsCount) + ', ' + \
13216
               'ModifyMonitoredItemsCount:' + str(self.ModifyMonitoredItemsCount) + ', ' + \
13217
               'SetMonitoringModeCount:' + str(self.SetMonitoringModeCount) + ', ' + \
13218
               'SetTriggeringCount:' + str(self.SetTriggeringCount) + ', ' + \
13219
               'DeleteMonitoredItemsCount:' + str(self.DeleteMonitoredItemsCount) + ', ' + \
13220
               'CreateSubscriptionCount:' + str(self.CreateSubscriptionCount) + ', ' + \
13221
               'ModifySubscriptionCount:' + str(self.ModifySubscriptionCount) + ', ' + \
13222
               'SetPublishingModeCount:' + str(self.SetPublishingModeCount) + ', ' + \
13223
               'PublishCount:' + str(self.PublishCount) + ', ' + \
13224
               'RepublishCount:' + str(self.RepublishCount) + ', ' + \
13225
               'TransferSubscriptionsCount:' + str(self.TransferSubscriptionsCount) + ', ' + \
13226
               'DeleteSubscriptionsCount:' + str(self.DeleteSubscriptionsCount) + ', ' + \
13227
               'AddNodesCount:' + str(self.AddNodesCount) + ', ' + \
13228
               'AddReferencesCount:' + str(self.AddReferencesCount) + ', ' + \
13229
               'DeleteNodesCount:' + str(self.DeleteNodesCount) + ', ' + \
13230
               'DeleteReferencesCount:' + str(self.DeleteReferencesCount) + ', ' + \
13231
               'BrowseCount:' + str(self.BrowseCount) + ', ' + \
13232
               'BrowseNextCount:' + str(self.BrowseNextCount) + ', ' + \
13233
               'TranslateBrowsePathsToNodeIdsCount:' + str(self.TranslateBrowsePathsToNodeIdsCount) + ', ' + \
13234
               'QueryFirstCount:' + str(self.QueryFirstCount) + ', ' + \
13235
               'QueryNextCount:' + str(self.QueryNextCount) + ', ' + \
13236
               'RegisterNodesCount:' + str(self.RegisterNodesCount) + ', ' + \
13237
               'UnregisterNodesCount:' + str(self.UnregisterNodesCount) + ')'
13238
13239 1
    __repr__ = __str__
13240
13241
13242 1
class SessionSecurityDiagnosticsDataType(FrozenClass):
13243
    '''
13244
    :ivar SessionId:
13245
    :vartype SessionId: NodeId
13246
    :ivar ClientUserIdOfSession:
13247
    :vartype ClientUserIdOfSession: String
13248
    :ivar ClientUserIdHistory:
13249
    :vartype ClientUserIdHistory: String
13250
    :ivar AuthenticationMechanism:
13251
    :vartype AuthenticationMechanism: String
13252
    :ivar Encoding:
13253
    :vartype Encoding: String
13254
    :ivar TransportProtocol:
13255
    :vartype TransportProtocol: String
13256
    :ivar SecurityMode:
13257
    :vartype SecurityMode: MessageSecurityMode
13258
    :ivar SecurityPolicyUri:
13259
    :vartype SecurityPolicyUri: String
13260
    :ivar ClientCertificate:
13261
    :vartype ClientCertificate: ByteString
13262
    '''
13263 1
    def __init__(self, binary=None):
13264
        if binary is not None:
13265
            self._binary_init(binary)
13266
            self._freeze = True
13267
            return
13268
        self.SessionId = NodeId()
13269
        self.ClientUserIdOfSession = ''
13270
        self.ClientUserIdHistory = []
13271
        self.AuthenticationMechanism = ''
13272
        self.Encoding = ''
13273
        self.TransportProtocol = ''
13274
        self.SecurityMode = MessageSecurityMode(0)
13275
        self.SecurityPolicyUri = ''
13276
        self.ClientCertificate = b''
13277
        self._freeze = True
13278
13279 1
    def to_binary(self):
13280
        packet = []
13281
        packet.append(self.SessionId.to_binary())
13282
        packet.append(pack_string(self.ClientUserIdOfSession))
13283
        packet.append(uatype_Int32.pack(len(self.ClientUserIdHistory)))
13284
        for fieldname in self.ClientUserIdHistory:
13285
            packet.append(pack_string(fieldname))
13286
        packet.append(pack_string(self.AuthenticationMechanism))
13287
        packet.append(pack_string(self.Encoding))
13288
        packet.append(pack_string(self.TransportProtocol))
13289
        packet.append(uatype_UInt32.pack(self.SecurityMode.value))
13290
        packet.append(pack_string(self.SecurityPolicyUri))
13291
        packet.append(pack_bytes(self.ClientCertificate))
13292
        return b''.join(packet)
13293
13294 1
    @staticmethod
13295
    def from_binary(data):
13296
        return SessionSecurityDiagnosticsDataType(data)
13297
13298 1
    def _binary_init(self, data):
13299
        self.SessionId = NodeId.from_binary(data)
13300
        self.ClientUserIdOfSession = unpack_string(data)
13301
        self.ClientUserIdHistory = unpack_uatype_array('String', data)
13302
        self.AuthenticationMechanism = unpack_string(data)
13303
        self.Encoding = unpack_string(data)
13304
        self.TransportProtocol = unpack_string(data)
13305
        self.SecurityMode = MessageSecurityMode(uatype_UInt32.unpack(data.read(4))[0])
13306
        self.SecurityPolicyUri = unpack_string(data)
13307
        self.ClientCertificate = unpack_bytes(data)
13308
13309 1
    def __str__(self):
13310
        return 'SessionSecurityDiagnosticsDataType(' + 'SessionId:' + str(self.SessionId) + ', ' + \
13311
               'ClientUserIdOfSession:' + str(self.ClientUserIdOfSession) + ', ' + \
13312
               'ClientUserIdHistory:' + str(self.ClientUserIdHistory) + ', ' + \
13313
               'AuthenticationMechanism:' + str(self.AuthenticationMechanism) + ', ' + \
13314
               'Encoding:' + str(self.Encoding) + ', ' + \
13315
               'TransportProtocol:' + str(self.TransportProtocol) + ', ' + \
13316
               'SecurityMode:' + str(self.SecurityMode) + ', ' + \
13317
               'SecurityPolicyUri:' + str(self.SecurityPolicyUri) + ', ' + \
13318
               'ClientCertificate:' + str(self.ClientCertificate) + ')'
13319
13320 1
    __repr__ = __str__
13321
13322
13323 1
class ServiceCounterDataType(FrozenClass):
13324
    '''
13325
    :ivar TotalCount:
13326
    :vartype TotalCount: UInt32
13327
    :ivar ErrorCount:
13328
    :vartype ErrorCount: UInt32
13329
    '''
13330 1
    def __init__(self, binary=None):
13331
        if binary is not None:
13332
            self._binary_init(binary)
13333
            self._freeze = True
13334
            return
13335
        self.TotalCount = 0
13336
        self.ErrorCount = 0
13337
        self._freeze = True
13338
13339 1
    def to_binary(self):
13340
        packet = []
13341
        packet.append(uatype_UInt32.pack(self.TotalCount))
13342
        packet.append(uatype_UInt32.pack(self.ErrorCount))
13343
        return b''.join(packet)
13344
13345 1
    @staticmethod
13346
    def from_binary(data):
13347
        return ServiceCounterDataType(data)
13348
13349 1
    def _binary_init(self, data):
13350
        self.TotalCount = uatype_UInt32.unpack(data.read(4))[0]
13351
        self.ErrorCount = uatype_UInt32.unpack(data.read(4))[0]
13352
13353 1
    def __str__(self):
13354
        return 'ServiceCounterDataType(' + 'TotalCount:' + str(self.TotalCount) + ', ' + \
13355
               'ErrorCount:' + str(self.ErrorCount) + ')'
13356
13357 1
    __repr__ = __str__
13358
13359
13360 1 View Code Duplication
class StatusResult(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13361
    '''
13362
    :ivar StatusCode:
13363
    :vartype StatusCode: StatusCode
13364
    :ivar DiagnosticInfo:
13365
    :vartype DiagnosticInfo: DiagnosticInfo
13366
    '''
13367 1
    def __init__(self, binary=None):
13368
        if binary is not None:
13369
            self._binary_init(binary)
13370
            self._freeze = True
13371
            return
13372
        self.StatusCode = StatusCode()
13373
        self.DiagnosticInfo = DiagnosticInfo()
13374
        self._freeze = True
13375
13376 1
    def to_binary(self):
13377
        packet = []
13378
        packet.append(self.StatusCode.to_binary())
13379
        packet.append(self.DiagnosticInfo.to_binary())
13380
        return b''.join(packet)
13381
13382 1
    @staticmethod
13383
    def from_binary(data):
13384
        return StatusResult(data)
13385
13386 1
    def _binary_init(self, data):
13387
        self.StatusCode = StatusCode.from_binary(data)
13388
        self.DiagnosticInfo = DiagnosticInfo.from_binary(data)
13389
13390 1
    def __str__(self):
13391
        return 'StatusResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
13392
               'DiagnosticInfo:' + str(self.DiagnosticInfo) + ')'
13393
13394 1
    __repr__ = __str__
13395
13396
13397 1
class SubscriptionDiagnosticsDataType(FrozenClass):
13398
    '''
13399
    :ivar SessionId:
13400
    :vartype SessionId: NodeId
13401
    :ivar SubscriptionId:
13402
    :vartype SubscriptionId: UInt32
13403
    :ivar Priority:
13404
    :vartype Priority: Byte
13405
    :ivar PublishingInterval:
13406
    :vartype PublishingInterval: Double
13407
    :ivar MaxKeepAliveCount:
13408
    :vartype MaxKeepAliveCount: UInt32
13409
    :ivar MaxLifetimeCount:
13410
    :vartype MaxLifetimeCount: UInt32
13411
    :ivar MaxNotificationsPerPublish:
13412
    :vartype MaxNotificationsPerPublish: UInt32
13413
    :ivar PublishingEnabled:
13414
    :vartype PublishingEnabled: Boolean
13415
    :ivar ModifyCount:
13416
    :vartype ModifyCount: UInt32
13417
    :ivar EnableCount:
13418
    :vartype EnableCount: UInt32
13419
    :ivar DisableCount:
13420
    :vartype DisableCount: UInt32
13421
    :ivar RepublishRequestCount:
13422
    :vartype RepublishRequestCount: UInt32
13423
    :ivar RepublishMessageRequestCount:
13424
    :vartype RepublishMessageRequestCount: UInt32
13425
    :ivar RepublishMessageCount:
13426
    :vartype RepublishMessageCount: UInt32
13427
    :ivar TransferRequestCount:
13428
    :vartype TransferRequestCount: UInt32
13429
    :ivar TransferredToAltClientCount:
13430
    :vartype TransferredToAltClientCount: UInt32
13431
    :ivar TransferredToSameClientCount:
13432
    :vartype TransferredToSameClientCount: UInt32
13433
    :ivar PublishRequestCount:
13434
    :vartype PublishRequestCount: UInt32
13435
    :ivar DataChangeNotificationsCount:
13436
    :vartype DataChangeNotificationsCount: UInt32
13437
    :ivar EventNotificationsCount:
13438
    :vartype EventNotificationsCount: UInt32
13439
    :ivar NotificationsCount:
13440
    :vartype NotificationsCount: UInt32
13441
    :ivar LatePublishRequestCount:
13442
    :vartype LatePublishRequestCount: UInt32
13443
    :ivar CurrentKeepAliveCount:
13444
    :vartype CurrentKeepAliveCount: UInt32
13445
    :ivar CurrentLifetimeCount:
13446
    :vartype CurrentLifetimeCount: UInt32
13447
    :ivar UnacknowledgedMessageCount:
13448
    :vartype UnacknowledgedMessageCount: UInt32
13449
    :ivar DiscardedMessageCount:
13450
    :vartype DiscardedMessageCount: UInt32
13451
    :ivar MonitoredItemCount:
13452
    :vartype MonitoredItemCount: UInt32
13453
    :ivar DisabledMonitoredItemCount:
13454
    :vartype DisabledMonitoredItemCount: UInt32
13455
    :ivar MonitoringQueueOverflowCount:
13456
    :vartype MonitoringQueueOverflowCount: UInt32
13457
    :ivar NextSequenceNumber:
13458
    :vartype NextSequenceNumber: UInt32
13459
    :ivar EventQueueOverFlowCount:
13460
    :vartype EventQueueOverFlowCount: UInt32
13461
    '''
13462 1
    def __init__(self, binary=None):
13463
        if binary is not None:
13464
            self._binary_init(binary)
13465
            self._freeze = True
13466
            return
13467
        self.SessionId = NodeId()
13468
        self.SubscriptionId = 0
13469
        self.Priority = 0
13470
        self.PublishingInterval = 0
13471
        self.MaxKeepAliveCount = 0
13472
        self.MaxLifetimeCount = 0
13473
        self.MaxNotificationsPerPublish = 0
13474
        self.PublishingEnabled = True
13475
        self.ModifyCount = 0
13476
        self.EnableCount = 0
13477
        self.DisableCount = 0
13478
        self.RepublishRequestCount = 0
13479
        self.RepublishMessageRequestCount = 0
13480
        self.RepublishMessageCount = 0
13481
        self.TransferRequestCount = 0
13482
        self.TransferredToAltClientCount = 0
13483
        self.TransferredToSameClientCount = 0
13484
        self.PublishRequestCount = 0
13485
        self.DataChangeNotificationsCount = 0
13486
        self.EventNotificationsCount = 0
13487
        self.NotificationsCount = 0
13488
        self.LatePublishRequestCount = 0
13489
        self.CurrentKeepAliveCount = 0
13490
        self.CurrentLifetimeCount = 0
13491
        self.UnacknowledgedMessageCount = 0
13492
        self.DiscardedMessageCount = 0
13493
        self.MonitoredItemCount = 0
13494
        self.DisabledMonitoredItemCount = 0
13495
        self.MonitoringQueueOverflowCount = 0
13496
        self.NextSequenceNumber = 0
13497
        self.EventQueueOverFlowCount = 0
13498
        self._freeze = True
13499
13500 1
    def to_binary(self):
13501
        packet = []
13502
        packet.append(self.SessionId.to_binary())
13503
        packet.append(uatype_UInt32.pack(self.SubscriptionId))
13504
        packet.append(uatype_Byte.pack(self.Priority))
13505
        packet.append(uatype_Double.pack(self.PublishingInterval))
13506
        packet.append(uatype_UInt32.pack(self.MaxKeepAliveCount))
13507
        packet.append(uatype_UInt32.pack(self.MaxLifetimeCount))
13508
        packet.append(uatype_UInt32.pack(self.MaxNotificationsPerPublish))
13509
        packet.append(uatype_Boolean.pack(self.PublishingEnabled))
13510
        packet.append(uatype_UInt32.pack(self.ModifyCount))
13511
        packet.append(uatype_UInt32.pack(self.EnableCount))
13512
        packet.append(uatype_UInt32.pack(self.DisableCount))
13513
        packet.append(uatype_UInt32.pack(self.RepublishRequestCount))
13514
        packet.append(uatype_UInt32.pack(self.RepublishMessageRequestCount))
13515
        packet.append(uatype_UInt32.pack(self.RepublishMessageCount))
13516
        packet.append(uatype_UInt32.pack(self.TransferRequestCount))
13517
        packet.append(uatype_UInt32.pack(self.TransferredToAltClientCount))
13518
        packet.append(uatype_UInt32.pack(self.TransferredToSameClientCount))
13519
        packet.append(uatype_UInt32.pack(self.PublishRequestCount))
13520
        packet.append(uatype_UInt32.pack(self.DataChangeNotificationsCount))
13521
        packet.append(uatype_UInt32.pack(self.EventNotificationsCount))
13522
        packet.append(uatype_UInt32.pack(self.NotificationsCount))
13523
        packet.append(uatype_UInt32.pack(self.LatePublishRequestCount))
13524
        packet.append(uatype_UInt32.pack(self.CurrentKeepAliveCount))
13525
        packet.append(uatype_UInt32.pack(self.CurrentLifetimeCount))
13526
        packet.append(uatype_UInt32.pack(self.UnacknowledgedMessageCount))
13527
        packet.append(uatype_UInt32.pack(self.DiscardedMessageCount))
13528
        packet.append(uatype_UInt32.pack(self.MonitoredItemCount))
13529
        packet.append(uatype_UInt32.pack(self.DisabledMonitoredItemCount))
13530
        packet.append(uatype_UInt32.pack(self.MonitoringQueueOverflowCount))
13531
        packet.append(uatype_UInt32.pack(self.NextSequenceNumber))
13532
        packet.append(uatype_UInt32.pack(self.EventQueueOverFlowCount))
13533
        return b''.join(packet)
13534
13535 1
    @staticmethod
13536
    def from_binary(data):
13537
        return SubscriptionDiagnosticsDataType(data)
13538
13539 1
    def _binary_init(self, data):
13540
        self.SessionId = NodeId.from_binary(data)
13541
        self.SubscriptionId = uatype_UInt32.unpack(data.read(4))[0]
13542
        self.Priority = uatype_Byte.unpack(data.read(1))[0]
13543
        self.PublishingInterval = uatype_Double.unpack(data.read(8))[0]
13544
        self.MaxKeepAliveCount = uatype_UInt32.unpack(data.read(4))[0]
13545
        self.MaxLifetimeCount = uatype_UInt32.unpack(data.read(4))[0]
13546
        self.MaxNotificationsPerPublish = uatype_UInt32.unpack(data.read(4))[0]
13547
        self.PublishingEnabled = uatype_Boolean.unpack(data.read(1))[0]
13548
        self.ModifyCount = uatype_UInt32.unpack(data.read(4))[0]
13549
        self.EnableCount = uatype_UInt32.unpack(data.read(4))[0]
13550
        self.DisableCount = uatype_UInt32.unpack(data.read(4))[0]
13551
        self.RepublishRequestCount = uatype_UInt32.unpack(data.read(4))[0]
13552
        self.RepublishMessageRequestCount = uatype_UInt32.unpack(data.read(4))[0]
13553
        self.RepublishMessageCount = uatype_UInt32.unpack(data.read(4))[0]
13554
        self.TransferRequestCount = uatype_UInt32.unpack(data.read(4))[0]
13555
        self.TransferredToAltClientCount = uatype_UInt32.unpack(data.read(4))[0]
13556
        self.TransferredToSameClientCount = uatype_UInt32.unpack(data.read(4))[0]
13557
        self.PublishRequestCount = uatype_UInt32.unpack(data.read(4))[0]
13558
        self.DataChangeNotificationsCount = uatype_UInt32.unpack(data.read(4))[0]
13559
        self.EventNotificationsCount = uatype_UInt32.unpack(data.read(4))[0]
13560
        self.NotificationsCount = uatype_UInt32.unpack(data.read(4))[0]
13561
        self.LatePublishRequestCount = uatype_UInt32.unpack(data.read(4))[0]
13562
        self.CurrentKeepAliveCount = uatype_UInt32.unpack(data.read(4))[0]
13563
        self.CurrentLifetimeCount = uatype_UInt32.unpack(data.read(4))[0]
13564
        self.UnacknowledgedMessageCount = uatype_UInt32.unpack(data.read(4))[0]
13565
        self.DiscardedMessageCount = uatype_UInt32.unpack(data.read(4))[0]
13566
        self.MonitoredItemCount = uatype_UInt32.unpack(data.read(4))[0]
13567
        self.DisabledMonitoredItemCount = uatype_UInt32.unpack(data.read(4))[0]
13568
        self.MonitoringQueueOverflowCount = uatype_UInt32.unpack(data.read(4))[0]
13569
        self.NextSequenceNumber = uatype_UInt32.unpack(data.read(4))[0]
13570
        self.EventQueueOverFlowCount = uatype_UInt32.unpack(data.read(4))[0]
13571
13572 1
    def __str__(self):
13573
        return 'SubscriptionDiagnosticsDataType(' + 'SessionId:' + str(self.SessionId) + ', ' + \
13574
               'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
13575
               'Priority:' + str(self.Priority) + ', ' + \
13576
               'PublishingInterval:' + str(self.PublishingInterval) + ', ' + \
13577
               'MaxKeepAliveCount:' + str(self.MaxKeepAliveCount) + ', ' + \
13578
               'MaxLifetimeCount:' + str(self.MaxLifetimeCount) + ', ' + \
13579
               'MaxNotificationsPerPublish:' + str(self.MaxNotificationsPerPublish) + ', ' + \
13580
               'PublishingEnabled:' + str(self.PublishingEnabled) + ', ' + \
13581
               'ModifyCount:' + str(self.ModifyCount) + ', ' + \
13582
               'EnableCount:' + str(self.EnableCount) + ', ' + \
13583
               'DisableCount:' + str(self.DisableCount) + ', ' + \
13584
               'RepublishRequestCount:' + str(self.RepublishRequestCount) + ', ' + \
13585
               'RepublishMessageRequestCount:' + str(self.RepublishMessageRequestCount) + ', ' + \
13586
               'RepublishMessageCount:' + str(self.RepublishMessageCount) + ', ' + \
13587
               'TransferRequestCount:' + str(self.TransferRequestCount) + ', ' + \
13588
               'TransferredToAltClientCount:' + str(self.TransferredToAltClientCount) + ', ' + \
13589
               'TransferredToSameClientCount:' + str(self.TransferredToSameClientCount) + ', ' + \
13590
               'PublishRequestCount:' + str(self.PublishRequestCount) + ', ' + \
13591
               'DataChangeNotificationsCount:' + str(self.DataChangeNotificationsCount) + ', ' + \
13592
               'EventNotificationsCount:' + str(self.EventNotificationsCount) + ', ' + \
13593
               'NotificationsCount:' + str(self.NotificationsCount) + ', ' + \
13594
               'LatePublishRequestCount:' + str(self.LatePublishRequestCount) + ', ' + \
13595
               'CurrentKeepAliveCount:' + str(self.CurrentKeepAliveCount) + ', ' + \
13596
               'CurrentLifetimeCount:' + str(self.CurrentLifetimeCount) + ', ' + \
13597
               'UnacknowledgedMessageCount:' + str(self.UnacknowledgedMessageCount) + ', ' + \
13598
               'DiscardedMessageCount:' + str(self.DiscardedMessageCount) + ', ' + \
13599
               'MonitoredItemCount:' + str(self.MonitoredItemCount) + ', ' + \
13600
               'DisabledMonitoredItemCount:' + str(self.DisabledMonitoredItemCount) + ', ' + \
13601
               'MonitoringQueueOverflowCount:' + str(self.MonitoringQueueOverflowCount) + ', ' + \
13602
               'NextSequenceNumber:' + str(self.NextSequenceNumber) + ', ' + \
13603
               'EventQueueOverFlowCount:' + str(self.EventQueueOverFlowCount) + ')'
13604
13605 1
    __repr__ = __str__
13606
13607
13608 1 View Code Duplication
class ModelChangeStructureDataType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13609
    '''
13610
    :ivar Affected:
13611
    :vartype Affected: NodeId
13612
    :ivar AffectedType:
13613
    :vartype AffectedType: NodeId
13614
    :ivar Verb:
13615
    :vartype Verb: Byte
13616
    '''
13617 1
    def __init__(self, binary=None):
13618
        if binary is not None:
13619
            self._binary_init(binary)
13620
            self._freeze = True
13621
            return
13622
        self.Affected = NodeId()
13623
        self.AffectedType = NodeId()
13624
        self.Verb = 0
13625
        self._freeze = True
13626
13627 1
    def to_binary(self):
13628
        packet = []
13629
        packet.append(self.Affected.to_binary())
13630
        packet.append(self.AffectedType.to_binary())
13631
        packet.append(uatype_Byte.pack(self.Verb))
13632
        return b''.join(packet)
13633
13634 1
    @staticmethod
13635
    def from_binary(data):
13636
        return ModelChangeStructureDataType(data)
13637
13638 1
    def _binary_init(self, data):
13639
        self.Affected = NodeId.from_binary(data)
13640
        self.AffectedType = NodeId.from_binary(data)
13641
        self.Verb = uatype_Byte.unpack(data.read(1))[0]
13642
13643 1
    def __str__(self):
13644
        return 'ModelChangeStructureDataType(' + 'Affected:' + str(self.Affected) + ', ' + \
13645
               'AffectedType:' + str(self.AffectedType) + ', ' + \
13646
               'Verb:' + str(self.Verb) + ')'
13647
13648 1
    __repr__ = __str__
13649
13650
13651 1 View Code Duplication
class SemanticChangeStructureDataType(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13652
    '''
13653
    :ivar Affected:
13654
    :vartype Affected: NodeId
13655
    :ivar AffectedType:
13656
    :vartype AffectedType: NodeId
13657
    '''
13658 1
    def __init__(self, binary=None):
13659
        if binary is not None:
13660
            self._binary_init(binary)
13661
            self._freeze = True
13662
            return
13663
        self.Affected = NodeId()
13664
        self.AffectedType = NodeId()
13665
        self._freeze = True
13666
13667 1
    def to_binary(self):
13668
        packet = []
13669
        packet.append(self.Affected.to_binary())
13670
        packet.append(self.AffectedType.to_binary())
13671
        return b''.join(packet)
13672
13673 1
    @staticmethod
13674
    def from_binary(data):
13675
        return SemanticChangeStructureDataType(data)
13676
13677 1
    def _binary_init(self, data):
13678
        self.Affected = NodeId.from_binary(data)
13679
        self.AffectedType = NodeId.from_binary(data)
13680
13681 1
    def __str__(self):
13682
        return 'SemanticChangeStructureDataType(' + 'Affected:' + str(self.Affected) + ', ' + \
13683
               'AffectedType:' + str(self.AffectedType) + ')'
13684
13685 1
    __repr__ = __str__
13686
13687
13688 1
class Range(FrozenClass):
13689
    '''
13690
    :ivar Low:
13691
    :vartype Low: Double
13692
    :ivar High:
13693
    :vartype High: Double
13694
    '''
13695 1
    def __init__(self, binary=None):
13696
        if binary is not None:
13697
            self._binary_init(binary)
13698
            self._freeze = True
13699
            return
13700
        self.Low = 0
13701
        self.High = 0
13702
        self._freeze = True
13703
13704 1
    def to_binary(self):
13705
        packet = []
13706
        packet.append(uatype_Double.pack(self.Low))
13707
        packet.append(uatype_Double.pack(self.High))
13708
        return b''.join(packet)
13709
13710 1
    @staticmethod
13711
    def from_binary(data):
13712
        return Range(data)
13713
13714 1
    def _binary_init(self, data):
13715
        self.Low = uatype_Double.unpack(data.read(8))[0]
13716
        self.High = uatype_Double.unpack(data.read(8))[0]
13717
13718 1
    def __str__(self):
13719
        return 'Range(' + 'Low:' + str(self.Low) + ', ' + \
13720
               'High:' + str(self.High) + ')'
13721
13722 1
    __repr__ = __str__
13723
13724
13725 1
class EUInformation(FrozenClass):
13726
    '''
13727
    :ivar NamespaceUri:
13728
    :vartype NamespaceUri: String
13729
    :ivar UnitId:
13730
    :vartype UnitId: Int32
13731
    :ivar DisplayName:
13732
    :vartype DisplayName: LocalizedText
13733
    :ivar Description:
13734
    :vartype Description: LocalizedText
13735
    '''
13736 1
    def __init__(self, binary=None):
13737
        if binary is not None:
13738
            self._binary_init(binary)
13739
            self._freeze = True
13740
            return
13741
        self.NamespaceUri = ''
13742
        self.UnitId = 0
13743
        self.DisplayName = LocalizedText()
13744
        self.Description = LocalizedText()
13745
        self._freeze = True
13746
13747 1
    def to_binary(self):
13748
        packet = []
13749
        packet.append(pack_string(self.NamespaceUri))
13750
        packet.append(uatype_Int32.pack(self.UnitId))
13751
        packet.append(self.DisplayName.to_binary())
13752
        packet.append(self.Description.to_binary())
13753
        return b''.join(packet)
13754
13755 1
    @staticmethod
13756
    def from_binary(data):
13757
        return EUInformation(data)
13758
13759 1
    def _binary_init(self, data):
13760
        self.NamespaceUri = unpack_string(data)
13761
        self.UnitId = uatype_Int32.unpack(data.read(4))[0]
13762
        self.DisplayName = LocalizedText.from_binary(data)
13763
        self.Description = LocalizedText.from_binary(data)
13764
13765 1
    def __str__(self):
13766
        return 'EUInformation(' + 'NamespaceUri:' + str(self.NamespaceUri) + ', ' + \
13767
               'UnitId:' + str(self.UnitId) + ', ' + \
13768
               'DisplayName:' + str(self.DisplayName) + ', ' + \
13769
               'Description:' + str(self.Description) + ')'
13770
13771 1
    __repr__ = __str__
13772
13773
13774 1
class ComplexNumberType(FrozenClass):
13775
    '''
13776
    :ivar Real:
13777
    :vartype Real: Float
13778
    :ivar Imaginary:
13779
    :vartype Imaginary: Float
13780
    '''
13781 1
    def __init__(self, binary=None):
13782
        if binary is not None:
13783
            self._binary_init(binary)
13784
            self._freeze = True
13785
            return
13786
        self.Real = 0
13787
        self.Imaginary = 0
13788
        self._freeze = True
13789
13790 1
    def to_binary(self):
13791
        packet = []
13792
        packet.append(uatype_Float.pack(self.Real))
13793
        packet.append(uatype_Float.pack(self.Imaginary))
13794
        return b''.join(packet)
13795
13796 1
    @staticmethod
13797
    def from_binary(data):
13798
        return ComplexNumberType(data)
13799
13800 1
    def _binary_init(self, data):
13801
        self.Real = uatype_Float.unpack(data.read(4))[0]
13802
        self.Imaginary = uatype_Float.unpack(data.read(4))[0]
13803
13804 1
    def __str__(self):
13805
        return 'ComplexNumberType(' + 'Real:' + str(self.Real) + ', ' + \
13806
               'Imaginary:' + str(self.Imaginary) + ')'
13807
13808 1
    __repr__ = __str__
13809
13810
13811 1
class DoubleComplexNumberType(FrozenClass):
13812
    '''
13813
    :ivar Real:
13814
    :vartype Real: Double
13815
    :ivar Imaginary:
13816
    :vartype Imaginary: Double
13817
    '''
13818 1
    def __init__(self, binary=None):
13819
        if binary is not None:
13820
            self._binary_init(binary)
13821
            self._freeze = True
13822
            return
13823
        self.Real = 0
13824
        self.Imaginary = 0
13825
        self._freeze = True
13826
13827 1
    def to_binary(self):
13828
        packet = []
13829
        packet.append(uatype_Double.pack(self.Real))
13830
        packet.append(uatype_Double.pack(self.Imaginary))
13831
        return b''.join(packet)
13832
13833 1
    @staticmethod
13834
    def from_binary(data):
13835
        return DoubleComplexNumberType(data)
13836
13837 1
    def _binary_init(self, data):
13838
        self.Real = uatype_Double.unpack(data.read(8))[0]
13839
        self.Imaginary = uatype_Double.unpack(data.read(8))[0]
13840
13841 1
    def __str__(self):
13842
        return 'DoubleComplexNumberType(' + 'Real:' + str(self.Real) + ', ' + \
13843
               'Imaginary:' + str(self.Imaginary) + ')'
13844
13845 1
    __repr__ = __str__
13846
13847
13848 1 View Code Duplication
class AxisInformation(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13849
    '''
13850
    :ivar EngineeringUnits:
13851
    :vartype EngineeringUnits: EUInformation
13852
    :ivar EURange:
13853
    :vartype EURange: Range
13854
    :ivar Title:
13855
    :vartype Title: LocalizedText
13856
    :ivar AxisScaleType:
13857
    :vartype AxisScaleType: AxisScaleEnumeration
13858
    :ivar AxisSteps:
13859
    :vartype AxisSteps: Double
13860
    '''
13861 1
    def __init__(self, binary=None):
13862
        if binary is not None:
13863
            self._binary_init(binary)
13864
            self._freeze = True
13865
            return
13866
        self.EngineeringUnits = EUInformation()
13867
        self.EURange = Range()
13868
        self.Title = LocalizedText()
13869
        self.AxisScaleType = AxisScaleEnumeration(0)
13870
        self.AxisSteps = []
13871
        self._freeze = True
13872
13873 1
    def to_binary(self):
13874
        packet = []
13875
        packet.append(self.EngineeringUnits.to_binary())
13876
        packet.append(self.EURange.to_binary())
13877
        packet.append(self.Title.to_binary())
13878
        packet.append(uatype_UInt32.pack(self.AxisScaleType.value))
13879
        packet.append(uatype_Int32.pack(len(self.AxisSteps)))
13880
        for fieldname in self.AxisSteps:
13881
            packet.append(uatype_Double.pack(fieldname))
13882
        return b''.join(packet)
13883
13884 1
    @staticmethod
13885
    def from_binary(data):
13886
        return AxisInformation(data)
13887
13888 1
    def _binary_init(self, data):
13889
        self.EngineeringUnits = EUInformation.from_binary(data)
13890
        self.EURange = Range.from_binary(data)
13891
        self.Title = LocalizedText.from_binary(data)
13892
        self.AxisScaleType = AxisScaleEnumeration(uatype_UInt32.unpack(data.read(4))[0])
13893
        self.AxisSteps = unpack_uatype_array('Double', data)
13894
13895 1
    def __str__(self):
13896
        return 'AxisInformation(' + 'EngineeringUnits:' + str(self.EngineeringUnits) + ', ' + \
13897
               'EURange:' + str(self.EURange) + ', ' + \
13898
               'Title:' + str(self.Title) + ', ' + \
13899
               'AxisScaleType:' + str(self.AxisScaleType) + ', ' + \
13900
               'AxisSteps:' + str(self.AxisSteps) + ')'
13901
13902 1
    __repr__ = __str__
13903
13904
13905 1
class XVType(FrozenClass):
13906
    '''
13907
    :ivar X:
13908
    :vartype X: Double
13909
    :ivar Value:
13910
    :vartype Value: Float
13911
    '''
13912 1
    def __init__(self, binary=None):
13913
        if binary is not None:
13914
            self._binary_init(binary)
13915
            self._freeze = True
13916
            return
13917
        self.X = 0
13918
        self.Value = 0
13919
        self._freeze = True
13920
13921 1
    def to_binary(self):
13922
        packet = []
13923
        packet.append(uatype_Double.pack(self.X))
13924
        packet.append(uatype_Float.pack(self.Value))
13925
        return b''.join(packet)
13926
13927 1
    @staticmethod
13928
    def from_binary(data):
13929
        return XVType(data)
13930
13931 1
    def _binary_init(self, data):
13932
        self.X = uatype_Double.unpack(data.read(8))[0]
13933
        self.Value = uatype_Float.unpack(data.read(4))[0]
13934
13935 1
    def __str__(self):
13936
        return 'XVType(' + 'X:' + str(self.X) + ', ' + \
13937
               'Value:' + str(self.Value) + ')'
13938
13939 1
    __repr__ = __str__
13940
13941
13942 1
class ProgramDiagnosticDataType(FrozenClass):
13943
    '''
13944
    :ivar CreateSessionId:
13945
    :vartype CreateSessionId: NodeId
13946
    :ivar CreateClientName:
13947
    :vartype CreateClientName: String
13948
    :ivar InvocationCreationTime:
13949
    :vartype InvocationCreationTime: DateTime
13950
    :ivar LastTransitionTime:
13951
    :vartype LastTransitionTime: DateTime
13952
    :ivar LastMethodCall:
13953
    :vartype LastMethodCall: String
13954
    :ivar LastMethodSessionId:
13955
    :vartype LastMethodSessionId: NodeId
13956
    :ivar LastMethodInputArguments:
13957
    :vartype LastMethodInputArguments: Argument
13958
    :ivar LastMethodOutputArguments:
13959
    :vartype LastMethodOutputArguments: Argument
13960
    :ivar LastMethodCallTime:
13961
    :vartype LastMethodCallTime: DateTime
13962
    :ivar LastMethodReturnStatus:
13963
    :vartype LastMethodReturnStatus: StatusResult
13964
    '''
13965 1
    def __init__(self, binary=None):
13966
        if binary is not None:
13967
            self._binary_init(binary)
13968
            self._freeze = True
13969
            return
13970
        self.CreateSessionId = NodeId()
13971
        self.CreateClientName = ''
13972
        self.InvocationCreationTime = datetime.now()
13973
        self.LastTransitionTime = datetime.now()
13974
        self.LastMethodCall = ''
13975
        self.LastMethodSessionId = NodeId()
13976
        self.LastMethodInputArguments = []
13977
        self.LastMethodOutputArguments = []
13978
        self.LastMethodCallTime = datetime.now()
13979
        self.LastMethodReturnStatus = StatusResult()
13980
        self._freeze = True
13981
13982 1
    def to_binary(self):
13983
        packet = []
13984
        packet.append(self.CreateSessionId.to_binary())
13985
        packet.append(pack_string(self.CreateClientName))
13986
        packet.append(pack_datetime(self.InvocationCreationTime))
13987
        packet.append(pack_datetime(self.LastTransitionTime))
13988
        packet.append(pack_string(self.LastMethodCall))
13989
        packet.append(self.LastMethodSessionId.to_binary())
13990
        packet.append(uatype_Int32.pack(len(self.LastMethodInputArguments)))
13991
        for fieldname in self.LastMethodInputArguments:
13992
            packet.append(fieldname.to_binary())
13993
        packet.append(uatype_Int32.pack(len(self.LastMethodOutputArguments)))
13994
        for fieldname in self.LastMethodOutputArguments:
13995
            packet.append(fieldname.to_binary())
13996
        packet.append(pack_datetime(self.LastMethodCallTime))
13997
        packet.append(self.LastMethodReturnStatus.to_binary())
13998
        return b''.join(packet)
13999
14000 1
    @staticmethod
14001
    def from_binary(data):
14002
        return ProgramDiagnosticDataType(data)
14003
14004 1
    def _binary_init(self, data):
14005
        self.CreateSessionId = NodeId.from_binary(data)
14006
        self.CreateClientName = unpack_string(data)
14007
        self.InvocationCreationTime = unpack_datetime(data)
14008
        self.LastTransitionTime = unpack_datetime(data)
14009
        self.LastMethodCall = unpack_string(data)
14010
        self.LastMethodSessionId = NodeId.from_binary(data)
14011
        length = uatype_Int32.unpack(data.read(4))[0]
14012
        array = []
14013
        if length != -1:
14014
            for _ in range(0, length):
14015
                array.append(Argument.from_binary(data))
14016
        self.LastMethodInputArguments = array
14017
        length = uatype_Int32.unpack(data.read(4))[0]
14018
        array = []
14019
        if length != -1:
14020
            for _ in range(0, length):
14021
                array.append(Argument.from_binary(data))
14022
        self.LastMethodOutputArguments = array
14023
        self.LastMethodCallTime = unpack_datetime(data)
14024
        self.LastMethodReturnStatus = StatusResult.from_binary(data)
14025
14026 1
    def __str__(self):
14027
        return 'ProgramDiagnosticDataType(' + 'CreateSessionId:' + str(self.CreateSessionId) + ', ' + \
14028
               'CreateClientName:' + str(self.CreateClientName) + ', ' + \
14029
               'InvocationCreationTime:' + str(self.InvocationCreationTime) + ', ' + \
14030
               'LastTransitionTime:' + str(self.LastTransitionTime) + ', ' + \
14031
               'LastMethodCall:' + str(self.LastMethodCall) + ', ' + \
14032
               'LastMethodSessionId:' + str(self.LastMethodSessionId) + ', ' + \
14033
               'LastMethodInputArguments:' + str(self.LastMethodInputArguments) + ', ' + \
14034
               'LastMethodOutputArguments:' + str(self.LastMethodOutputArguments) + ', ' + \
14035
               'LastMethodCallTime:' + str(self.LastMethodCallTime) + ', ' + \
14036
               'LastMethodReturnStatus:' + str(self.LastMethodReturnStatus) + ')'
14037
14038 1
    __repr__ = __str__
14039
14040
14041 1 View Code Duplication
class Annotation(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
14042
    '''
14043
    :ivar Message:
14044
    :vartype Message: String
14045
    :ivar UserName:
14046
    :vartype UserName: String
14047
    :ivar AnnotationTime:
14048
    :vartype AnnotationTime: DateTime
14049
    '''
14050 1
    def __init__(self, binary=None):
14051
        if binary is not None:
14052
            self._binary_init(binary)
14053
            self._freeze = True
14054
            return
14055
        self.Message = ''
14056
        self.UserName = ''
14057
        self.AnnotationTime = datetime.now()
14058
        self._freeze = True
14059
14060 1
    def to_binary(self):
14061
        packet = []
14062
        packet.append(pack_string(self.Message))
14063
        packet.append(pack_string(self.UserName))
14064
        packet.append(pack_datetime(self.AnnotationTime))
14065
        return b''.join(packet)
14066
14067 1
    @staticmethod
14068
    def from_binary(data):
14069
        return Annotation(data)
14070
14071 1
    def _binary_init(self, data):
14072
        self.Message = unpack_string(data)
14073
        self.UserName = unpack_string(data)
14074
        self.AnnotationTime = unpack_datetime(data)
14075
14076 1
    def __str__(self):
14077
        return 'Annotation(' + 'Message:' + str(self.Message) + ', ' + \
14078
               'UserName:' + str(self.UserName) + ', ' + \
14079
               'AnnotationTime:' + str(self.AnnotationTime) + ')'
14080
14081 1
    __repr__ = __str__
14082
14083
14084 1
ExtensionClasses = {
14085
    ObjectIds.TrustListDataType_Encoding_DefaultBinary: TrustListDataType,
14086
    ObjectIds.Argument_Encoding_DefaultBinary: Argument,
14087
    ObjectIds.EnumValueType_Encoding_DefaultBinary: EnumValueType,
14088
    ObjectIds.OptionSet_Encoding_DefaultBinary: OptionSet,
14089
    ObjectIds.Union_Encoding_DefaultBinary: Union,
14090
    ObjectIds.TimeZoneDataType_Encoding_DefaultBinary: TimeZoneDataType,
14091
    ObjectIds.ApplicationDescription_Encoding_DefaultBinary: ApplicationDescription,
14092
    ObjectIds.RequestHeader_Encoding_DefaultBinary: RequestHeader,
14093
    ObjectIds.ResponseHeader_Encoding_DefaultBinary: ResponseHeader,
14094
    ObjectIds.ServiceFault_Encoding_DefaultBinary: ServiceFault,
14095
    ObjectIds.FindServersRequest_Encoding_DefaultBinary: FindServersRequest,
14096
    ObjectIds.FindServersResponse_Encoding_DefaultBinary: FindServersResponse,
14097
    ObjectIds.ServerOnNetwork_Encoding_DefaultBinary: ServerOnNetwork,
14098
    ObjectIds.FindServersOnNetworkRequest_Encoding_DefaultBinary: FindServersOnNetworkRequest,
14099
    ObjectIds.FindServersOnNetworkResponse_Encoding_DefaultBinary: FindServersOnNetworkResponse,
14100
    ObjectIds.UserTokenPolicy_Encoding_DefaultBinary: UserTokenPolicy,
14101
    ObjectIds.EndpointDescription_Encoding_DefaultBinary: EndpointDescription,
14102
    ObjectIds.GetEndpointsRequest_Encoding_DefaultBinary: GetEndpointsRequest,
14103
    ObjectIds.GetEndpointsResponse_Encoding_DefaultBinary: GetEndpointsResponse,
14104
    ObjectIds.RegisteredServer_Encoding_DefaultBinary: RegisteredServer,
14105
    ObjectIds.RegisterServerRequest_Encoding_DefaultBinary: RegisterServerRequest,
14106
    ObjectIds.RegisterServerResponse_Encoding_DefaultBinary: RegisterServerResponse,
14107
    ObjectIds.DiscoveryConfiguration_Encoding_DefaultBinary: DiscoveryConfiguration,
14108
    ObjectIds.MdnsDiscoveryConfiguration_Encoding_DefaultBinary: MdnsDiscoveryConfiguration,
14109
    ObjectIds.RegisterServer2Request_Encoding_DefaultBinary: RegisterServer2Request,
14110
    ObjectIds.RegisterServer2Response_Encoding_DefaultBinary: RegisterServer2Response,
14111
    ObjectIds.ChannelSecurityToken_Encoding_DefaultBinary: ChannelSecurityToken,
14112
    ObjectIds.OpenSecureChannelRequest_Encoding_DefaultBinary: OpenSecureChannelRequest,
14113
    ObjectIds.OpenSecureChannelResponse_Encoding_DefaultBinary: OpenSecureChannelResponse,
14114
    ObjectIds.CloseSecureChannelRequest_Encoding_DefaultBinary: CloseSecureChannelRequest,
14115
    ObjectIds.CloseSecureChannelResponse_Encoding_DefaultBinary: CloseSecureChannelResponse,
14116
    ObjectIds.SignedSoftwareCertificate_Encoding_DefaultBinary: SignedSoftwareCertificate,
14117
    ObjectIds.SignatureData_Encoding_DefaultBinary: SignatureData,
14118
    ObjectIds.CreateSessionRequest_Encoding_DefaultBinary: CreateSessionRequest,
14119
    ObjectIds.CreateSessionResponse_Encoding_DefaultBinary: CreateSessionResponse,
14120
    ObjectIds.UserIdentityToken_Encoding_DefaultBinary: UserIdentityToken,
14121
    ObjectIds.AnonymousIdentityToken_Encoding_DefaultBinary: AnonymousIdentityToken,
14122
    ObjectIds.UserNameIdentityToken_Encoding_DefaultBinary: UserNameIdentityToken,
14123
    ObjectIds.X509IdentityToken_Encoding_DefaultBinary: X509IdentityToken,
14124
    ObjectIds.KerberosIdentityToken_Encoding_DefaultBinary: KerberosIdentityToken,
14125
    ObjectIds.IssuedIdentityToken_Encoding_DefaultBinary: IssuedIdentityToken,
14126
    ObjectIds.ActivateSessionRequest_Encoding_DefaultBinary: ActivateSessionRequest,
14127
    ObjectIds.ActivateSessionResponse_Encoding_DefaultBinary: ActivateSessionResponse,
14128
    ObjectIds.CloseSessionRequest_Encoding_DefaultBinary: CloseSessionRequest,
14129
    ObjectIds.CloseSessionResponse_Encoding_DefaultBinary: CloseSessionResponse,
14130
    ObjectIds.CancelRequest_Encoding_DefaultBinary: CancelRequest,
14131
    ObjectIds.CancelResponse_Encoding_DefaultBinary: CancelResponse,
14132
    ObjectIds.NodeAttributes_Encoding_DefaultBinary: NodeAttributes,
14133
    ObjectIds.ObjectAttributes_Encoding_DefaultBinary: ObjectAttributes,
14134
    ObjectIds.VariableAttributes_Encoding_DefaultBinary: VariableAttributes,
14135
    ObjectIds.MethodAttributes_Encoding_DefaultBinary: MethodAttributes,
14136
    ObjectIds.ObjectTypeAttributes_Encoding_DefaultBinary: ObjectTypeAttributes,
14137
    ObjectIds.VariableTypeAttributes_Encoding_DefaultBinary: VariableTypeAttributes,
14138
    ObjectIds.ReferenceTypeAttributes_Encoding_DefaultBinary: ReferenceTypeAttributes,
14139
    ObjectIds.DataTypeAttributes_Encoding_DefaultBinary: DataTypeAttributes,
14140
    ObjectIds.ViewAttributes_Encoding_DefaultBinary: ViewAttributes,
14141
    ObjectIds.AddNodesItem_Encoding_DefaultBinary: AddNodesItem,
14142
    ObjectIds.AddNodesResult_Encoding_DefaultBinary: AddNodesResult,
14143
    ObjectIds.AddNodesRequest_Encoding_DefaultBinary: AddNodesRequest,
14144
    ObjectIds.AddNodesResponse_Encoding_DefaultBinary: AddNodesResponse,
14145
    ObjectIds.AddReferencesItem_Encoding_DefaultBinary: AddReferencesItem,
14146
    ObjectIds.AddReferencesRequest_Encoding_DefaultBinary: AddReferencesRequest,
14147
    ObjectIds.AddReferencesResponse_Encoding_DefaultBinary: AddReferencesResponse,
14148
    ObjectIds.DeleteNodesItem_Encoding_DefaultBinary: DeleteNodesItem,
14149
    ObjectIds.DeleteNodesRequest_Encoding_DefaultBinary: DeleteNodesRequest,
14150
    ObjectIds.DeleteNodesResponse_Encoding_DefaultBinary: DeleteNodesResponse,
14151
    ObjectIds.DeleteReferencesItem_Encoding_DefaultBinary: DeleteReferencesItem,
14152
    ObjectIds.DeleteReferencesRequest_Encoding_DefaultBinary: DeleteReferencesRequest,
14153
    ObjectIds.DeleteReferencesResponse_Encoding_DefaultBinary: DeleteReferencesResponse,
14154
    ObjectIds.ViewDescription_Encoding_DefaultBinary: ViewDescription,
14155
    ObjectIds.BrowseDescription_Encoding_DefaultBinary: BrowseDescription,
14156
    ObjectIds.ReferenceDescription_Encoding_DefaultBinary: ReferenceDescription,
14157
    ObjectIds.BrowseResult_Encoding_DefaultBinary: BrowseResult,
14158
    ObjectIds.BrowseRequest_Encoding_DefaultBinary: BrowseRequest,
14159
    ObjectIds.BrowseResponse_Encoding_DefaultBinary: BrowseResponse,
14160
    ObjectIds.BrowseNextRequest_Encoding_DefaultBinary: BrowseNextRequest,
14161
    ObjectIds.BrowseNextResponse_Encoding_DefaultBinary: BrowseNextResponse,
14162
    ObjectIds.RelativePathElement_Encoding_DefaultBinary: RelativePathElement,
14163
    ObjectIds.RelativePath_Encoding_DefaultBinary: RelativePath,
14164
    ObjectIds.BrowsePath_Encoding_DefaultBinary: BrowsePath,
14165
    ObjectIds.BrowsePathTarget_Encoding_DefaultBinary: BrowsePathTarget,
14166
    ObjectIds.BrowsePathResult_Encoding_DefaultBinary: BrowsePathResult,
14167
    ObjectIds.TranslateBrowsePathsToNodeIdsRequest_Encoding_DefaultBinary: TranslateBrowsePathsToNodeIdsRequest,
14168
    ObjectIds.TranslateBrowsePathsToNodeIdsResponse_Encoding_DefaultBinary: TranslateBrowsePathsToNodeIdsResponse,
14169
    ObjectIds.RegisterNodesRequest_Encoding_DefaultBinary: RegisterNodesRequest,
14170
    ObjectIds.RegisterNodesResponse_Encoding_DefaultBinary: RegisterNodesResponse,
14171
    ObjectIds.UnregisterNodesRequest_Encoding_DefaultBinary: UnregisterNodesRequest,
14172
    ObjectIds.UnregisterNodesResponse_Encoding_DefaultBinary: UnregisterNodesResponse,
14173
    ObjectIds.EndpointConfiguration_Encoding_DefaultBinary: EndpointConfiguration,
14174
    ObjectIds.SupportedProfile_Encoding_DefaultBinary: SupportedProfile,
14175
    ObjectIds.SoftwareCertificate_Encoding_DefaultBinary: SoftwareCertificate,
14176
    ObjectIds.QueryDataDescription_Encoding_DefaultBinary: QueryDataDescription,
14177
    ObjectIds.NodeTypeDescription_Encoding_DefaultBinary: NodeTypeDescription,
14178
    ObjectIds.QueryDataSet_Encoding_DefaultBinary: QueryDataSet,
14179
    ObjectIds.NodeReference_Encoding_DefaultBinary: NodeReference,
14180
    ObjectIds.ContentFilterElement_Encoding_DefaultBinary: ContentFilterElement,
14181
    ObjectIds.ContentFilter_Encoding_DefaultBinary: ContentFilter,
14182
    ObjectIds.ElementOperand_Encoding_DefaultBinary: ElementOperand,
14183
    ObjectIds.LiteralOperand_Encoding_DefaultBinary: LiteralOperand,
14184
    ObjectIds.AttributeOperand_Encoding_DefaultBinary: AttributeOperand,
14185
    ObjectIds.SimpleAttributeOperand_Encoding_DefaultBinary: SimpleAttributeOperand,
14186
    ObjectIds.ContentFilterElementResult_Encoding_DefaultBinary: ContentFilterElementResult,
14187
    ObjectIds.ContentFilterResult_Encoding_DefaultBinary: ContentFilterResult,
14188
    ObjectIds.ParsingResult_Encoding_DefaultBinary: ParsingResult,
14189
    ObjectIds.QueryFirstRequest_Encoding_DefaultBinary: QueryFirstRequest,
14190
    ObjectIds.QueryFirstResponse_Encoding_DefaultBinary: QueryFirstResponse,
14191
    ObjectIds.QueryNextRequest_Encoding_DefaultBinary: QueryNextRequest,
14192
    ObjectIds.QueryNextResponse_Encoding_DefaultBinary: QueryNextResponse,
14193
    ObjectIds.ReadValueId_Encoding_DefaultBinary: ReadValueId,
14194
    ObjectIds.ReadRequest_Encoding_DefaultBinary: ReadRequest,
14195
    ObjectIds.ReadResponse_Encoding_DefaultBinary: ReadResponse,
14196
    ObjectIds.HistoryReadValueId_Encoding_DefaultBinary: HistoryReadValueId,
14197
    ObjectIds.HistoryReadResult_Encoding_DefaultBinary: HistoryReadResult,
14198
    ObjectIds.HistoryReadDetails_Encoding_DefaultBinary: HistoryReadDetails,
14199
    ObjectIds.ReadEventDetails_Encoding_DefaultBinary: ReadEventDetails,
14200
    ObjectIds.ReadRawModifiedDetails_Encoding_DefaultBinary: ReadRawModifiedDetails,
14201
    ObjectIds.ReadProcessedDetails_Encoding_DefaultBinary: ReadProcessedDetails,
14202
    ObjectIds.ReadAtTimeDetails_Encoding_DefaultBinary: ReadAtTimeDetails,
14203
    ObjectIds.HistoryData_Encoding_DefaultBinary: HistoryData,
14204
    ObjectIds.ModificationInfo_Encoding_DefaultBinary: ModificationInfo,
14205
    ObjectIds.HistoryModifiedData_Encoding_DefaultBinary: HistoryModifiedData,
14206
    ObjectIds.HistoryEvent_Encoding_DefaultBinary: HistoryEvent,
14207
    ObjectIds.HistoryReadRequest_Encoding_DefaultBinary: HistoryReadRequest,
14208
    ObjectIds.HistoryReadResponse_Encoding_DefaultBinary: HistoryReadResponse,
14209
    ObjectIds.WriteValue_Encoding_DefaultBinary: WriteValue,
14210
    ObjectIds.WriteRequest_Encoding_DefaultBinary: WriteRequest,
14211
    ObjectIds.WriteResponse_Encoding_DefaultBinary: WriteResponse,
14212
    ObjectIds.HistoryUpdateDetails_Encoding_DefaultBinary: HistoryUpdateDetails,
14213
    ObjectIds.UpdateDataDetails_Encoding_DefaultBinary: UpdateDataDetails,
14214
    ObjectIds.UpdateStructureDataDetails_Encoding_DefaultBinary: UpdateStructureDataDetails,
14215
    ObjectIds.UpdateEventDetails_Encoding_DefaultBinary: UpdateEventDetails,
14216
    ObjectIds.DeleteRawModifiedDetails_Encoding_DefaultBinary: DeleteRawModifiedDetails,
14217
    ObjectIds.DeleteAtTimeDetails_Encoding_DefaultBinary: DeleteAtTimeDetails,
14218
    ObjectIds.DeleteEventDetails_Encoding_DefaultBinary: DeleteEventDetails,
14219
    ObjectIds.HistoryUpdateResult_Encoding_DefaultBinary: HistoryUpdateResult,
14220
    ObjectIds.HistoryUpdateRequest_Encoding_DefaultBinary: HistoryUpdateRequest,
14221
    ObjectIds.HistoryUpdateResponse_Encoding_DefaultBinary: HistoryUpdateResponse,
14222
    ObjectIds.CallMethodRequest_Encoding_DefaultBinary: CallMethodRequest,
14223
    ObjectIds.CallMethodResult_Encoding_DefaultBinary: CallMethodResult,
14224
    ObjectIds.CallRequest_Encoding_DefaultBinary: CallRequest,
14225
    ObjectIds.CallResponse_Encoding_DefaultBinary: CallResponse,
14226
    ObjectIds.MonitoringFilter_Encoding_DefaultBinary: MonitoringFilter,
14227
    ObjectIds.DataChangeFilter_Encoding_DefaultBinary: DataChangeFilter,
14228
    ObjectIds.EventFilter_Encoding_DefaultBinary: EventFilter,
14229
    ObjectIds.AggregateConfiguration_Encoding_DefaultBinary: AggregateConfiguration,
14230
    ObjectIds.AggregateFilter_Encoding_DefaultBinary: AggregateFilter,
14231
    ObjectIds.MonitoringFilterResult_Encoding_DefaultBinary: MonitoringFilterResult,
14232
    ObjectIds.EventFilterResult_Encoding_DefaultBinary: EventFilterResult,
14233
    ObjectIds.AggregateFilterResult_Encoding_DefaultBinary: AggregateFilterResult,
14234
    ObjectIds.MonitoringParameters_Encoding_DefaultBinary: MonitoringParameters,
14235
    ObjectIds.MonitoredItemCreateRequest_Encoding_DefaultBinary: MonitoredItemCreateRequest,
14236
    ObjectIds.MonitoredItemCreateResult_Encoding_DefaultBinary: MonitoredItemCreateResult,
14237
    ObjectIds.CreateMonitoredItemsRequest_Encoding_DefaultBinary: CreateMonitoredItemsRequest,
14238
    ObjectIds.CreateMonitoredItemsResponse_Encoding_DefaultBinary: CreateMonitoredItemsResponse,
14239
    ObjectIds.MonitoredItemModifyRequest_Encoding_DefaultBinary: MonitoredItemModifyRequest,
14240
    ObjectIds.MonitoredItemModifyResult_Encoding_DefaultBinary: MonitoredItemModifyResult,
14241
    ObjectIds.ModifyMonitoredItemsRequest_Encoding_DefaultBinary: ModifyMonitoredItemsRequest,
14242
    ObjectIds.ModifyMonitoredItemsResponse_Encoding_DefaultBinary: ModifyMonitoredItemsResponse,
14243
    ObjectIds.SetMonitoringModeRequest_Encoding_DefaultBinary: SetMonitoringModeRequest,
14244
    ObjectIds.SetMonitoringModeResponse_Encoding_DefaultBinary: SetMonitoringModeResponse,
14245
    ObjectIds.SetTriggeringRequest_Encoding_DefaultBinary: SetTriggeringRequest,
14246
    ObjectIds.SetTriggeringResponse_Encoding_DefaultBinary: SetTriggeringResponse,
14247
    ObjectIds.DeleteMonitoredItemsRequest_Encoding_DefaultBinary: DeleteMonitoredItemsRequest,
14248
    ObjectIds.DeleteMonitoredItemsResponse_Encoding_DefaultBinary: DeleteMonitoredItemsResponse,
14249
    ObjectIds.CreateSubscriptionRequest_Encoding_DefaultBinary: CreateSubscriptionRequest,
14250
    ObjectIds.CreateSubscriptionResponse_Encoding_DefaultBinary: CreateSubscriptionResponse,
14251
    ObjectIds.ModifySubscriptionRequest_Encoding_DefaultBinary: ModifySubscriptionRequest,
14252
    ObjectIds.ModifySubscriptionResponse_Encoding_DefaultBinary: ModifySubscriptionResponse,
14253
    ObjectIds.SetPublishingModeRequest_Encoding_DefaultBinary: SetPublishingModeRequest,
14254
    ObjectIds.SetPublishingModeResponse_Encoding_DefaultBinary: SetPublishingModeResponse,
14255
    ObjectIds.NotificationMessage_Encoding_DefaultBinary: NotificationMessage,
14256
    ObjectIds.NotificationData_Encoding_DefaultBinary: NotificationData,
14257
    ObjectIds.DataChangeNotification_Encoding_DefaultBinary: DataChangeNotification,
14258
    ObjectIds.MonitoredItemNotification_Encoding_DefaultBinary: MonitoredItemNotification,
14259
    ObjectIds.EventNotificationList_Encoding_DefaultBinary: EventNotificationList,
14260
    ObjectIds.EventFieldList_Encoding_DefaultBinary: EventFieldList,
14261
    ObjectIds.HistoryEventFieldList_Encoding_DefaultBinary: HistoryEventFieldList,
14262
    ObjectIds.StatusChangeNotification_Encoding_DefaultBinary: StatusChangeNotification,
14263
    ObjectIds.SubscriptionAcknowledgement_Encoding_DefaultBinary: SubscriptionAcknowledgement,
14264
    ObjectIds.PublishRequest_Encoding_DefaultBinary: PublishRequest,
14265
    ObjectIds.PublishResponse_Encoding_DefaultBinary: PublishResponse,
14266
    ObjectIds.RepublishRequest_Encoding_DefaultBinary: RepublishRequest,
14267
    ObjectIds.RepublishResponse_Encoding_DefaultBinary: RepublishResponse,
14268
    ObjectIds.TransferResult_Encoding_DefaultBinary: TransferResult,
14269
    ObjectIds.TransferSubscriptionsRequest_Encoding_DefaultBinary: TransferSubscriptionsRequest,
14270
    ObjectIds.TransferSubscriptionsResponse_Encoding_DefaultBinary: TransferSubscriptionsResponse,
14271
    ObjectIds.DeleteSubscriptionsRequest_Encoding_DefaultBinary: DeleteSubscriptionsRequest,
14272
    ObjectIds.DeleteSubscriptionsResponse_Encoding_DefaultBinary: DeleteSubscriptionsResponse,
14273
    ObjectIds.BuildInfo_Encoding_DefaultBinary: BuildInfo,
14274
    ObjectIds.RedundantServerDataType_Encoding_DefaultBinary: RedundantServerDataType,
14275
    ObjectIds.EndpointUrlListDataType_Encoding_DefaultBinary: EndpointUrlListDataType,
14276
    ObjectIds.NetworkGroupDataType_Encoding_DefaultBinary: NetworkGroupDataType,
14277
    ObjectIds.SamplingIntervalDiagnosticsDataType_Encoding_DefaultBinary: SamplingIntervalDiagnosticsDataType,
14278
    ObjectIds.ServerDiagnosticsSummaryDataType_Encoding_DefaultBinary: ServerDiagnosticsSummaryDataType,
14279
    ObjectIds.ServerStatusDataType_Encoding_DefaultBinary: ServerStatusDataType,
14280
    ObjectIds.SessionDiagnosticsDataType_Encoding_DefaultBinary: SessionDiagnosticsDataType,
14281
    ObjectIds.SessionSecurityDiagnosticsDataType_Encoding_DefaultBinary: SessionSecurityDiagnosticsDataType,
14282
    ObjectIds.ServiceCounterDataType_Encoding_DefaultBinary: ServiceCounterDataType,
14283
    ObjectIds.StatusResult_Encoding_DefaultBinary: StatusResult,
14284
    ObjectIds.SubscriptionDiagnosticsDataType_Encoding_DefaultBinary: SubscriptionDiagnosticsDataType,
14285
    ObjectIds.ModelChangeStructureDataType_Encoding_DefaultBinary: ModelChangeStructureDataType,
14286
    ObjectIds.SemanticChangeStructureDataType_Encoding_DefaultBinary: SemanticChangeStructureDataType,
14287
    ObjectIds.Range_Encoding_DefaultBinary: Range,
14288
    ObjectIds.EUInformation_Encoding_DefaultBinary: EUInformation,
14289
    ObjectIds.ComplexNumberType_Encoding_DefaultBinary: ComplexNumberType,
14290
    ObjectIds.DoubleComplexNumberType_Encoding_DefaultBinary: DoubleComplexNumberType,
14291
    ObjectIds.AxisInformation_Encoding_DefaultBinary: AxisInformation,
14292
    ObjectIds.XVType_Encoding_DefaultBinary: XVType,
14293
    ObjectIds.ProgramDiagnosticDataType_Encoding_DefaultBinary: ProgramDiagnosticDataType,
14294
    ObjectIds.Annotation_Encoding_DefaultBinary: Annotation,
14295
}
14296
14297
14298 1
def extensionobject_from_binary(data):
14299
    """
14300
    Convert binary-coded ExtensionObject to a Python object.
14301
    Returns an object, or None if TypeId is zero
14302
    """
14303 1
    TypeId = NodeId.from_binary(data)
14304 1
    Encoding = ord(data.read(1))
14305 1
    body = None
14306 1
    if Encoding & (1 << 0):
14307 1
        length = uatype_Int32.unpack(data.read(4))[0]
14308 1
        if length < 1:
14309
            body = Buffer(b"")
14310
        else:
14311 1
            body = data.copy(length)
14312 1
            data.skip(length)
14313 1
    if TypeId.Identifier == 0:
14314 1
        return None
14315 1
    elif TypeId.Identifier not in ExtensionClasses:
14316 1
        e = ExtensionObject()
14317 1
        e.TypeId = TypeId
14318 1
        e.Encoding = Encoding
14319 1
        if body is not None:
14320 1
            e.Body = body.read(len(body))
14321 1
        return e
14322 1
    klass = ExtensionClasses[TypeId.Identifier]
14323 1
    if body is None:
14324
        raise UaError("parsing ExtensionObject {} without data".format(klass.__name__))
14325 1
    return klass.from_binary(body)
14326
14327
14328 1
def extensionobject_to_binary(obj):
14329
    """
14330
    Convert Python object to binary-coded ExtensionObject.
14331
    If obj is None, convert to empty ExtensionObject (TypeId = 0, no Body).
14332
    Returns a binary string
14333
    """
14334 1
    if isinstance(obj, ExtensionObject):
14335 1
        return obj.to_binary()
14336 1
    TypeId = NodeId()
14337 1
    Encoding = 0
14338 1
    Body = None
14339 1
    if obj is not None:
14340 1
        TypeId = FourByteNodeId(getattr(ObjectIds, "{}_Encoding_DefaultBinary".format(obj.__class__.__name__)))
14341 1
        Encoding |= (1 << 0)
14342 1
        Body = obj.to_binary()
14343 1
    packet = []
14344 1
    packet.append(TypeId.to_binary())
14345 1
    packet.append(uatype_UInt8.pack(Encoding))
14346 1
    if Body:
14347 1
        packet.append(pack_bytes(Body))
14348
    return b''.join(packet)
14349