Test Failed
Pull Request — master (#490)
by Olivier
03:12
created

from_binary()   B

Complexity

Conditions 5

Size

Total Lines 18

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 21.2759

Importance

Changes 0
Metric Value
cc 5
c 0
b 0
f 0
dl 0
loc 18
ccs 2
cts 15
cp 0.1333
crap 21.2759
rs 8.5454
1
'''
2
Autogenerate code from xml spec
3
'''
4
5 1
from datetime import datetime
6 1
from enum import IntEnum
7
8 1
from opcua.ua.uatypes import *
9 1
from opcua.ua import ua_binary as uabin
10 1
from opcua.ua.object_ids import ObjectIds
11
12
13 1
class NamingRuleType(IntEnum):
14
    '''
15
    :ivar Mandatory:
16
    :vartype Mandatory: 1
17
    :ivar Optional:
18
    :vartype Optional: 2
19
    :ivar Constraint:
20
    :vartype Constraint: 3
21
    '''
22 1
    Mandatory = 1
23 1
    Optional = 2
24 1
    Constraint = 3
25
26
27 1
class OpenFileMode(IntEnum):
28
    '''
29
    :ivar Read:
30
    :vartype Read: 1
31
    :ivar Write:
32
    :vartype Write: 2
33
    :ivar EraseExisting:
34
    :vartype EraseExisting: 4
35
    :ivar Append:
36
    :vartype Append: 8
37
    '''
38 1
    Read = 1
39 1
    Write = 2
40 1
    EraseExisting = 4
41 1
    Append = 8
42
43
44 1
class TrustListMasks(IntEnum):
45
    '''
46
    :ivar None_:
47
    :vartype None_: 0
48
    :ivar TrustedCertificates:
49
    :vartype TrustedCertificates: 1
50
    :ivar TrustedCrls:
51
    :vartype TrustedCrls: 2
52
    :ivar IssuerCertificates:
53
    :vartype IssuerCertificates: 4
54
    :ivar IssuerCrls:
55
    :vartype IssuerCrls: 8
56
    :ivar All:
57
    :vartype All: 15
58
    '''
59 1
    None_ = 0
60 1
    TrustedCertificates = 1
61 1
    TrustedCrls = 2
62 1
    IssuerCertificates = 4
63 1
    IssuerCrls = 8
64 1
    All = 15
65
66
67 1
class IdType(IntEnum):
68
    '''
69
    The type of identifier used in a node id.
70
71
    :ivar Numeric:
72
    :vartype Numeric: 0
73
    :ivar String:
74
    :vartype String: 1
75
    :ivar Guid:
76
    :vartype Guid: 2
77
    :ivar Opaque:
78
    :vartype Opaque: 3
79
    '''
80 1
    Numeric = 0
81 1
    String = 1
82 1
    Guid = 2
83 1
    Opaque = 3
84
85
86 1
class NodeClass(IntEnum):
87
    '''
88
    A mask specifying the class of the node.
89
90
    :ivar Unspecified:
91
    :vartype Unspecified: 0
92
    :ivar Object:
93
    :vartype Object: 1
94
    :ivar Variable:
95
    :vartype Variable: 2
96
    :ivar Method:
97
    :vartype Method: 4
98
    :ivar ObjectType:
99
    :vartype ObjectType: 8
100
    :ivar VariableType:
101
    :vartype VariableType: 16
102
    :ivar ReferenceType:
103
    :vartype ReferenceType: 32
104
    :ivar DataType:
105
    :vartype DataType: 64
106
    :ivar View:
107
    :vartype View: 128
108
    '''
109 1
    Unspecified = 0
110 1
    Object = 1
111 1
    Variable = 2
112 1
    Method = 4
113 1
    ObjectType = 8
114 1
    VariableType = 16
115 1
    ReferenceType = 32
116 1
    DataType = 64
117 1
    View = 128
118
119
120 1
class ApplicationType(IntEnum):
121
    '''
122
    The types of applications.
123
124
    :ivar Server:
125
    :vartype Server: 0
126
    :ivar Client:
127
    :vartype Client: 1
128
    :ivar ClientAndServer:
129
    :vartype ClientAndServer: 2
130
    :ivar DiscoveryServer:
131
    :vartype DiscoveryServer: 3
132
    '''
133 1
    Server = 0
134 1
    Client = 1
135 1
    ClientAndServer = 2
136 1
    DiscoveryServer = 3
137
138
139 1
class MessageSecurityMode(IntEnum):
140
    '''
141
    The type of security to use on a message.
142
143
    :ivar Invalid:
144
    :vartype Invalid: 0
145
    :ivar None_:
146
    :vartype None_: 1
147
    :ivar Sign:
148
    :vartype Sign: 2
149
    :ivar SignAndEncrypt:
150
    :vartype SignAndEncrypt: 3
151
    '''
152 1
    Invalid = 0
153 1
    None_ = 1
154 1
    Sign = 2
155 1
    SignAndEncrypt = 3
156
157
158 1
class UserTokenType(IntEnum):
159
    '''
160
    The possible user token types.
161
162
    :ivar Anonymous:
163
    :vartype Anonymous: 0
164
    :ivar UserName:
165
    :vartype UserName: 1
166
    :ivar Certificate:
167
    :vartype Certificate: 2
168
    :ivar IssuedToken:
169
    :vartype IssuedToken: 3
170
    :ivar Kerberos:
171
    :vartype Kerberos: 4
172
    '''
173 1
    Anonymous = 0
174 1
    UserName = 1
175 1
    Certificate = 2
176 1
    IssuedToken = 3
177 1
    Kerberos = 4
178
179
180 1
class SecurityTokenRequestType(IntEnum):
181
    '''
182
    Indicates whether a token if being created or renewed.
183
184
    :ivar Issue:
185
    :vartype Issue: 0
186
    :ivar Renew:
187
    :vartype Renew: 1
188
    '''
189 1
    Issue = 0
190 1
    Renew = 1
191
192
193 1
class NodeAttributesMask(IntEnum):
194
    '''
195
    The bits used to specify default attributes for a new node.
196
197
    :ivar None_:
198
    :vartype None_: 0
199
    :ivar AccessLevel:
200
    :vartype AccessLevel: 1
201
    :ivar ArrayDimensions:
202
    :vartype ArrayDimensions: 2
203
    :ivar BrowseName:
204
    :vartype BrowseName: 4
205
    :ivar ContainsNoLoops:
206
    :vartype ContainsNoLoops: 8
207
    :ivar DataType:
208
    :vartype DataType: 16
209
    :ivar Description:
210
    :vartype Description: 32
211
    :ivar DisplayName:
212
    :vartype DisplayName: 64
213
    :ivar EventNotifier:
214
    :vartype EventNotifier: 128
215
    :ivar Executable:
216
    :vartype Executable: 256
217
    :ivar Historizing:
218
    :vartype Historizing: 512
219
    :ivar InverseName:
220
    :vartype InverseName: 1024
221
    :ivar IsAbstract:
222
    :vartype IsAbstract: 2048
223
    :ivar MinimumSamplingInterval:
224
    :vartype MinimumSamplingInterval: 4096
225
    :ivar NodeClass:
226
    :vartype NodeClass: 8192
227
    :ivar NodeId:
228
    :vartype NodeId: 16384
229
    :ivar Symmetric:
230
    :vartype Symmetric: 32768
231
    :ivar UserAccessLevel:
232
    :vartype UserAccessLevel: 65536
233
    :ivar UserExecutable:
234
    :vartype UserExecutable: 131072
235
    :ivar UserWriteMask:
236
    :vartype UserWriteMask: 262144
237
    :ivar ValueRank:
238
    :vartype ValueRank: 524288
239
    :ivar WriteMask:
240
    :vartype WriteMask: 1048576
241
    :ivar Value:
242
    :vartype Value: 2097152
243
    :ivar All:
244
    :vartype All: 4194303
245
    :ivar BaseNode:
246
    :vartype BaseNode: 1335396
247
    :ivar Object:
248
    :vartype Object: 1335524
249
    :ivar ObjectTypeOrDataType:
250
    :vartype ObjectTypeOrDataType: 1337444
251
    :ivar Variable:
252
    :vartype Variable: 4026999
253
    :ivar VariableType:
254
    :vartype VariableType: 3958902
255
    :ivar Method:
256
    :vartype Method: 1466724
257
    :ivar ReferenceType:
258
    :vartype ReferenceType: 1371236
259
    :ivar View:
260
    :vartype View: 1335532
261
    '''
262 1
    None_ = 0
263 1
    AccessLevel = 1
264 1
    ArrayDimensions = 2
265 1
    BrowseName = 4
266 1
    ContainsNoLoops = 8
267 1
    DataType = 16
268 1
    Description = 32
269 1
    DisplayName = 64
270 1
    EventNotifier = 128
271 1
    Executable = 256
272 1
    Historizing = 512
273 1
    InverseName = 1024
274 1
    IsAbstract = 2048
275 1
    MinimumSamplingInterval = 4096
276 1
    NodeClass = 8192
277 1
    NodeId = 16384
278 1
    Symmetric = 32768
279 1
    UserAccessLevel = 65536
280 1
    UserExecutable = 131072
281 1
    UserWriteMask = 262144
282 1
    ValueRank = 524288
283 1
    WriteMask = 1048576
284 1
    Value = 2097152
285 1
    All = 4194303
286 1
    BaseNode = 1335396
287 1
    Object = 1335524
288 1
    ObjectTypeOrDataType = 1337444
289 1
    Variable = 4026999
290 1
    VariableType = 3958902
291 1
    Method = 1466724
292 1
    ReferenceType = 1371236
293 1
    View = 1335532
294
295
296 1
class AttributeWriteMask(IntEnum):
297 View Code Duplication
    '''
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
298
    Define bits used to indicate which attributes are writable.
299
300
    :ivar None_:
301
    :vartype None_: 0
302
    :ivar AccessLevel:
303
    :vartype AccessLevel: 1
304
    :ivar ArrayDimensions:
305
    :vartype ArrayDimensions: 2
306
    :ivar BrowseName:
307
    :vartype BrowseName: 4
308
    :ivar ContainsNoLoops:
309
    :vartype ContainsNoLoops: 8
310
    :ivar DataType:
311
    :vartype DataType: 16
312
    :ivar Description:
313
    :vartype Description: 32
314
    :ivar DisplayName:
315
    :vartype DisplayName: 64
316
    :ivar EventNotifier:
317
    :vartype EventNotifier: 128
318
    :ivar Executable:
319
    :vartype Executable: 256
320
    :ivar Historizing:
321
    :vartype Historizing: 512
322
    :ivar InverseName:
323
    :vartype InverseName: 1024
324
    :ivar IsAbstract:
325
    :vartype IsAbstract: 2048
326
    :ivar MinimumSamplingInterval:
327
    :vartype MinimumSamplingInterval: 4096
328
    :ivar NodeClass:
329
    :vartype NodeClass: 8192
330
    :ivar NodeId:
331
    :vartype NodeId: 16384
332
    :ivar Symmetric:
333
    :vartype Symmetric: 32768
334
    :ivar UserAccessLevel:
335
    :vartype UserAccessLevel: 65536
336
    :ivar UserExecutable:
337
    :vartype UserExecutable: 131072
338
    :ivar UserWriteMask:
339
    :vartype UserWriteMask: 262144
340
    :ivar ValueRank:
341
    :vartype ValueRank: 524288
342
    :ivar WriteMask:
343
    :vartype WriteMask: 1048576
344
    :ivar ValueForVariableType:
345
    :vartype ValueForVariableType: 2097152
346
    '''
347 1
    None_ = 0
348 1
    AccessLevel = 1
349 1
    ArrayDimensions = 2
350 1
    BrowseName = 4
351 1
    ContainsNoLoops = 8
352 1
    DataType = 16
353 1
    Description = 32
354 1
    DisplayName = 64
355 1
    EventNotifier = 128
356 1
    Executable = 256
357 1
    Historizing = 512
358 1
    InverseName = 1024
359 1
    IsAbstract = 2048
360 1
    MinimumSamplingInterval = 4096
361 1
    NodeClass = 8192
362 1
    NodeId = 16384
363 1
    Symmetric = 32768
364 1
    UserAccessLevel = 65536
365 1
    UserExecutable = 131072
366 1
    UserWriteMask = 262144
367 1
    ValueRank = 524288
368 1
    WriteMask = 1048576
369 1
    ValueForVariableType = 2097152
370
371
372 1
class BrowseDirection(IntEnum):
373
    '''
374
    The directions of the references to return.
375
376
    :ivar Forward:
377
    :vartype Forward: 0
378
    :ivar Inverse:
379
    :vartype Inverse: 1
380
    :ivar Both:
381
    :vartype Both: 2
382
    '''
383 1
    Forward = 0
384 1
    Inverse = 1
385 1
    Both = 2
386
387
388 1
class BrowseResultMask(IntEnum):
389
    '''
390
    A bit mask which specifies what should be returned in a browse response.
391
392
    :ivar None_:
393
    :vartype None_: 0
394
    :ivar ReferenceTypeId:
395
    :vartype ReferenceTypeId: 1
396
    :ivar IsForward:
397
    :vartype IsForward: 2
398
    :ivar NodeClass:
399
    :vartype NodeClass: 4
400
    :ivar BrowseName:
401
    :vartype BrowseName: 8
402
    :ivar DisplayName:
403
    :vartype DisplayName: 16
404
    :ivar TypeDefinition:
405
    :vartype TypeDefinition: 32
406
    :ivar All:
407
    :vartype All: 63
408
    :ivar ReferenceTypeInfo:
409
    :vartype ReferenceTypeInfo: 3
410
    :ivar TargetInfo:
411
    :vartype TargetInfo: 60
412
    '''
413 1
    None_ = 0
414 1
    ReferenceTypeId = 1
415 1
    IsForward = 2
416 1
    NodeClass = 4
417 1
    BrowseName = 8
418 1
    DisplayName = 16
419 1
    TypeDefinition = 32
420 1
    All = 63
421 1
    ReferenceTypeInfo = 3
422 1
    TargetInfo = 60
423
424
425 1
class ComplianceLevel(IntEnum):
426
    '''
427
    :ivar Untested:
428
    :vartype Untested: 0
429
    :ivar Partial:
430
    :vartype Partial: 1
431
    :ivar SelfTested:
432
    :vartype SelfTested: 2
433
    :ivar Certified:
434
    :vartype Certified: 3
435
    '''
436 1
    Untested = 0
437 1
    Partial = 1
438 1
    SelfTested = 2
439 1
    Certified = 3
440
441
442 1
class FilterOperator(IntEnum):
443
    '''
444
    :ivar Equals:
445
    :vartype Equals: 0
446
    :ivar IsNull:
447
    :vartype IsNull: 1
448
    :ivar GreaterThan:
449
    :vartype GreaterThan: 2
450
    :ivar LessThan:
451
    :vartype LessThan: 3
452
    :ivar GreaterThanOrEqual:
453
    :vartype GreaterThanOrEqual: 4
454
    :ivar LessThanOrEqual:
455
    :vartype LessThanOrEqual: 5
456
    :ivar Like:
457
    :vartype Like: 6
458
    :ivar Not:
459
    :vartype Not: 7
460
    :ivar Between:
461
    :vartype Between: 8
462
    :ivar InList:
463
    :vartype InList: 9
464
    :ivar And:
465
    :vartype And: 10
466
    :ivar Or:
467
    :vartype Or: 11
468
    :ivar Cast:
469
    :vartype Cast: 12
470
    :ivar InView:
471
    :vartype InView: 13
472
    :ivar OfType:
473
    :vartype OfType: 14
474
    :ivar RelatedTo:
475
    :vartype RelatedTo: 15
476
    :ivar BitwiseAnd:
477
    :vartype BitwiseAnd: 16
478
    :ivar BitwiseOr:
479
    :vartype BitwiseOr: 17
480
    '''
481 1
    Equals = 0
482 1
    IsNull = 1
483 1
    GreaterThan = 2
484 1
    LessThan = 3
485 1
    GreaterThanOrEqual = 4
486 1
    LessThanOrEqual = 5
487 1
    Like = 6
488 1
    Not = 7
489 1
    Between = 8
490 1
    InList = 9
491 1
    And = 10
492 1
    Or = 11
493 1
    Cast = 12
494 1
    InView = 13
495 1
    OfType = 14
496 1
    RelatedTo = 15
497 1
    BitwiseAnd = 16
498 1
    BitwiseOr = 17
499
500
501 1
class TimestampsToReturn(IntEnum):
502
    '''
503
    :ivar Source:
504
    :vartype Source: 0
505
    :ivar Server:
506
    :vartype Server: 1
507
    :ivar Both:
508
    :vartype Both: 2
509
    :ivar Neither:
510
    :vartype Neither: 3
511
    '''
512 1
    Source = 0
513 1
    Server = 1
514 1
    Both = 2
515 1
    Neither = 3
516
517
518 1
class HistoryUpdateType(IntEnum):
519
    '''
520
    :ivar Insert:
521
    :vartype Insert: 1
522
    :ivar Replace:
523
    :vartype Replace: 2
524
    :ivar Update:
525
    :vartype Update: 3
526
    :ivar Delete:
527
    :vartype Delete: 4
528
    '''
529 1
    Insert = 1
530 1
    Replace = 2
531 1
    Update = 3
532 1
    Delete = 4
533
534
535 1
class PerformUpdateType(IntEnum):
536
    '''
537
    :ivar Insert:
538
    :vartype Insert: 1
539
    :ivar Replace:
540
    :vartype Replace: 2
541
    :ivar Update:
542
    :vartype Update: 3
543
    :ivar Remove:
544
    :vartype Remove: 4
545
    '''
546 1
    Insert = 1
547 1
    Replace = 2
548 1
    Update = 3
549 1
    Remove = 4
550
551
552 1
class MonitoringMode(IntEnum):
553
    '''
554
    :ivar Disabled:
555
    :vartype Disabled: 0
556
    :ivar Sampling:
557
    :vartype Sampling: 1
558
    :ivar Reporting:
559
    :vartype Reporting: 2
560
    '''
561 1
    Disabled = 0
562 1
    Sampling = 1
563 1
    Reporting = 2
564
565
566 1
class DataChangeTrigger(IntEnum):
567
    '''
568
    :ivar Status:
569
    :vartype Status: 0
570
    :ivar StatusValue:
571
    :vartype StatusValue: 1
572
    :ivar StatusValueTimestamp:
573
    :vartype StatusValueTimestamp: 2
574
    '''
575 1
    Status = 0
576 1
    StatusValue = 1
577 1
    StatusValueTimestamp = 2
578
579
580 1
class DeadbandType(IntEnum):
581
    '''
582
    :ivar None_:
583
    :vartype None_: 0
584
    :ivar Absolute:
585
    :vartype Absolute: 1
586
    :ivar Percent:
587
    :vartype Percent: 2
588
    '''
589 1
    None_ = 0
590 1
    Absolute = 1
591 1
    Percent = 2
592
593
594 1
class EnumeratedTestType(IntEnum):
595
    '''
596
    A simple enumerated type used for testing.
597
598
    :ivar Red:
599
    :vartype Red: 1
600
    :ivar Yellow:
601
    :vartype Yellow: 4
602
    :ivar Green:
603
    :vartype Green: 5
604
    '''
605 1
    Red = 1
606 1
    Yellow = 4
607 1
    Green = 5
608
609
610 1
class RedundancySupport(IntEnum):
611
    '''
612
    :ivar None_:
613
    :vartype None_: 0
614
    :ivar Cold:
615
    :vartype Cold: 1
616
    :ivar Warm:
617
    :vartype Warm: 2
618
    :ivar Hot:
619
    :vartype Hot: 3
620
    :ivar Transparent:
621
    :vartype Transparent: 4
622
    :ivar HotAndMirrored:
623
    :vartype HotAndMirrored: 5
624
    '''
625 1
    None_ = 0
626 1
    Cold = 1
627 1
    Warm = 2
628 1
    Hot = 3
629 1
    Transparent = 4
630 1
    HotAndMirrored = 5
631
632
633 1
class ServerState(IntEnum):
634
    '''
635
    :ivar Running:
636
    :vartype Running: 0
637
    :ivar Failed:
638
    :vartype Failed: 1
639
    :ivar NoConfiguration:
640
    :vartype NoConfiguration: 2
641
    :ivar Suspended:
642
    :vartype Suspended: 3
643
    :ivar Shutdown:
644
    :vartype Shutdown: 4
645
    :ivar Test:
646
    :vartype Test: 5
647
    :ivar CommunicationFault:
648
    :vartype CommunicationFault: 6
649
    :ivar Unknown:
650
    :vartype Unknown: 7
651
    '''
652 1
    Running = 0
653 1
    Failed = 1
654 1
    NoConfiguration = 2
655 1
    Suspended = 3
656 1
    Shutdown = 4
657 1
    Test = 5
658 1
    CommunicationFault = 6
659 1
    Unknown = 7
660
661
662 1
class ModelChangeStructureVerbMask(IntEnum):
663
    '''
664
    :ivar NodeAdded:
665
    :vartype NodeAdded: 1
666
    :ivar NodeDeleted:
667
    :vartype NodeDeleted: 2
668
    :ivar ReferenceAdded:
669
    :vartype ReferenceAdded: 4
670
    :ivar ReferenceDeleted:
671
    :vartype ReferenceDeleted: 8
672
    :ivar DataTypeChanged:
673
    :vartype DataTypeChanged: 16
674
    '''
675 1
    NodeAdded = 1
676 1
    NodeDeleted = 2
677 1
    ReferenceAdded = 4
678 1
    ReferenceDeleted = 8
679 1
    DataTypeChanged = 16
680
681
682 1
class AxisScaleEnumeration(IntEnum):
683
    '''
684
    :ivar Linear:
685
    :vartype Linear: 0
686
    :ivar Log:
687
    :vartype Log: 1
688
    :ivar Ln:
689
    :vartype Ln: 2
690
    '''
691 1
    Linear = 0
692 1
    Log = 1
693 1
    Ln = 2
694
695
696 1
class ExceptionDeviationFormat(IntEnum):
697
    '''
698
    :ivar AbsoluteValue:
699
    :vartype AbsoluteValue: 0
700
    :ivar PercentOfValue:
701
    :vartype PercentOfValue: 1
702
    :ivar PercentOfRange:
703
    :vartype PercentOfRange: 2
704
    :ivar PercentOfEURange:
705
    :vartype PercentOfEURange: 3
706
    :ivar Unknown:
707
    :vartype Unknown: 4
708
    '''
709 1
    AbsoluteValue = 0
710 1
    PercentOfValue = 1
711 1
    PercentOfRange = 2
712 1
    PercentOfEURange = 3
713 1
    Unknown = 4
714
715
716 1
class DiagnosticInfo(FrozenClass):
717
    '''
718
    A recursive structure containing diagnostic information associated with a status code.
719
720
    :ivar Encoding:
721
    :vartype Encoding: UInt8
722
    :ivar SymbolicId:
723
    :vartype SymbolicId: Int32
724
    :ivar NamespaceURI:
725
    :vartype NamespaceURI: Int32
726
    :ivar Locale:
727
    :vartype Locale: Int32
728
    :ivar LocalizedText:
729
    :vartype LocalizedText: Int32
730
    :ivar AdditionalInfo:
731
    :vartype AdditionalInfo: CharArray
732
    :ivar InnerStatusCode:
733
    :vartype InnerStatusCode: StatusCode
734
    :ivar InnerDiagnosticInfo:
735
    :vartype InnerDiagnosticInfo: DiagnosticInfo
736
    '''
737
738 1
    ua_switches = {
739
        'SymbolicId': ('Encoding', 0),
740
        'NamespaceURI': ('Encoding', 1),
741
        'Locale': ('Encoding', 2),
742
        'LocalizedText': ('Encoding', 3),
743
        'AdditionalInfo': ('Encoding', 4),
744
        'InnerStatusCode': ('Encoding', 5),
745
        'InnerDiagnosticInfo': ('Encoding', 6),
746
               }
747
    ua_types = [
748
        ('Encoding', 'UInt8'),
749 1
        ('SymbolicId', 'Int32'),
750 1
        ('NamespaceURI', 'Int32'),
751 1
        ('Locale', 'Int32'),
752 1
        ('LocalizedText', 'Int32'),
753 1
        ('AdditionalInfo', 'CharArray'),
754 1
        ('InnerStatusCode', 'StatusCode'),
755 1
        ('InnerDiagnosticInfo', 'DiagnosticInfo'),
756 1
               ]
757 1
758 1
    def __init__(self):
759 1
        self.Encoding = 0
760 1
        self.SymbolicId = None
761 1
        self.NamespaceURI = None
762 1
        self.Locale = None
763
        self.LocalizedText = None
764 1
        self.AdditionalInfo = None
765 1
        self.InnerStatusCode = None
766 1
        self.InnerDiagnosticInfo = None
767 1
        self._freeze = True
768 1
769 1
    def to_binary(self):
770 1
        packet = []
771 1
        if self.SymbolicId: self.Encoding |= (1 << 0)
772 1
        if self.NamespaceURI: self.Encoding |= (1 << 1)
773 1
        if self.Locale: self.Encoding |= (1 << 2)
774 1
        if self.LocalizedText: self.Encoding |= (1 << 3)
775
        if self.AdditionalInfo: self.Encoding |= (1 << 4)
776 1
        if self.InnerStatusCode: self.Encoding |= (1 << 5)
777
        if self.InnerDiagnosticInfo: self.Encoding |= (1 << 6)
778 1
        packet.append(uabin.Primitives.UInt8.pack(self.Encoding))
779
        if self.SymbolicId: 
780 1
            packet.append(uabin.Primitives.Int32.pack(self.SymbolicId))
781
        if self.NamespaceURI: 
782 1
            packet.append(uabin.Primitives.Int32.pack(self.NamespaceURI))
783
        if self.Locale: 
784 1
            packet.append(uabin.Primitives.Int32.pack(self.Locale))
785 1
        if self.LocalizedText: 
786 1
            packet.append(uabin.Primitives.Int32.pack(self.LocalizedText))
787
        if self.AdditionalInfo: 
788 1
            packet.append(uabin.Primitives.CharArray.pack(self.AdditionalInfo))
789
        if self.InnerStatusCode: 
790 1
            packet.append(self.InnerStatusCode.to_binary())
791
        if self.InnerDiagnosticInfo: 
792 1
            packet.append(self.InnerDiagnosticInfo.to_binary())
793
        return b''.join(packet)
794 1
795 1
    @staticmethod
796 1
    def from_binary(data):
797
        obj = DiagnosticInfo()
798
        self.Encoding = uabin.Primitives.UInt8.unpack(data)
799 1
        if obj.Encoding & (1 << 0):
800 1
            self.SymbolicId = uabin.Primitives.Int32.unpack(data)
801
        else:
802
            obj.SymbolicId = None
803 1
        if obj.Encoding & (1 << 1):
804 1
            self.NamespaceURI = uabin.Primitives.Int32.unpack(data)
805
        else:
806
            obj.NamespaceURI = None
807 1
        if obj.Encoding & (1 << 2):
808 1
            self.Locale = uabin.Primitives.Int32.unpack(data)
809
        else:
810
            obj.Locale = None
811 1
        if obj.Encoding & (1 << 3):
812 1
            self.LocalizedText = uabin.Primitives.Int32.unpack(data)
813
        else:
814
            obj.LocalizedText = None
815 1
        if obj.Encoding & (1 << 4):
816 1
            self.AdditionalInfo = uabin.Primitives.CharArray.unpack(data)
817 1
        else:
818
            obj.AdditionalInfo = None
819
        if obj.Encoding & (1 << 5):
820 1
            obj.InnerStatusCode = StatusCode.from_binary(data)
821
        else:
822
            obj.InnerStatusCode = None
823 1
        if obj.Encoding & (1 << 6):
824
            obj.InnerDiagnosticInfo = DiagnosticInfo.from_binary(data)
825 1
        else:
826
            obj.InnerDiagnosticInfo = None
827
            return obj
828
829
    def __str__(self):
830
        return 'DiagnosticInfo(' + 'Encoding:' + str(self.Encoding) + ', ' + \
831
               'SymbolicId:' + str(self.SymbolicId) + ', ' + \
832
               'NamespaceURI:' + str(self.NamespaceURI) + ', ' + \
833
               'Locale:' + str(self.Locale) + ', ' + \
834
               'LocalizedText:' + str(self.LocalizedText) + ', ' + \
835 1
               'AdditionalInfo:' + str(self.AdditionalInfo) + ', ' + \
836
               'InnerStatusCode:' + str(self.InnerStatusCode) + ', ' + \
837
               'InnerDiagnosticInfo:' + str(self.InnerDiagnosticInfo) + ')'
838 1
839
    __repr__ = __str__
840
841
842
class LocalizedText(FrozenClass):
843
    '''
844
    A string qualified with a namespace index.
845
846
    :ivar Encoding:
847
    :vartype Encoding: UInt8
848
    :ivar Locale:
849
    :vartype Locale: CharArray
850
    :ivar Text:
851
    :vartype Text: CharArray
852 1
    '''
853
854
    ua_switches = {
855
        'Locale': ('Encoding', 0),
856
        'Text': ('Encoding', 1),
857
               }
858
    ua_types = [
859
        ('Encoding', 'UInt8'),
860 1
        ('Locale', 'CharArray'),
861
        ('Text', 'CharArray'),
862
               ]
863
864
    def __init__(self):
865
        self.Encoding = 0
866
        self.Locale = None
867
        self.Text = None
868
        self._freeze = True
869
870
    def to_binary(self):
871
        packet = []
872 1
        if self.Locale: self.Encoding |= (1 << 0)
873
        if self.Text: self.Encoding |= (1 << 1)
874
        packet.append(uabin.Primitives.UInt8.pack(self.Encoding))
875
        if self.Locale: 
876
            packet.append(uabin.Primitives.CharArray.pack(self.Locale))
877
        if self.Text: 
878
            packet.append(uabin.Primitives.CharArray.pack(self.Text))
879
        return b''.join(packet)
880
881
    @staticmethod
882
    def from_binary(data):
883
        obj = LocalizedText()
884
        self.Encoding = uabin.Primitives.UInt8.unpack(data)
885
        if obj.Encoding & (1 << 0):
886
            self.Locale = uabin.Primitives.CharArray.unpack(data)
887
        else:
888
            obj.Locale = None
889 1
        if obj.Encoding & (1 << 1):
890
            self.Text = uabin.Primitives.CharArray.unpack(data)
891
        else:
892
            obj.Text = None
893 1
            return obj
894
895
    def __str__(self):
896
        return 'LocalizedText(' + 'Encoding:' + str(self.Encoding) + ', ' + \
897
               'Locale:' + str(self.Locale) + ', ' + \
898
               'Text:' + str(self.Text) + ')'
899
900 1
    __repr__ = __str__
901
902
903
class TrustListDataType(FrozenClass):
904
    '''
905
    :ivar SpecifiedLists:
906
    :vartype SpecifiedLists: UInt32
907 1
    :ivar TrustedCertificates:
908
    :vartype TrustedCertificates: ByteString
909
    :ivar TrustedCrls:
910 1
    :vartype TrustedCrls: ByteString
911
    :ivar IssuerCertificates:
912
    :vartype IssuerCertificates: ByteString
913
    :ivar IssuerCrls:
914
    :vartype IssuerCrls: ByteString
915
    '''
916
917
    ua_types = [
918
        ('SpecifiedLists', 'UInt32'),
919
        ('TrustedCertificates', 'ListOfByteString'),
920
        ('TrustedCrls', 'ListOfByteString'),
921
        ('IssuerCertificates', 'ListOfByteString'),
922
        ('IssuerCrls', 'ListOfByteString'),
923
               ]
924
925
    def __init__(self):
926 1
        self.SpecifiedLists = 0
927
        self.TrustedCertificates = []
928
        self.TrustedCrls = []
929 View Code Duplication
        self.IssuerCertificates = []
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
930
        self.IssuerCrls = []
931
        self._freeze = True
932
933
    def to_binary(self):
934 1
        packet = []
935 1
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedLists))
936 1
        packet.append(uabin.Primitives.Int32.pack(len(self.TrustedCertificates)))
937 1
        for fieldname in self.TrustedCertificates:
938 1
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
939 1
        packet.append(uabin.Primitives.Int32.pack(len(self.TrustedCrls)))
940 1
        for fieldname in self.TrustedCrls:
941 1
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
942 1
        packet.append(uabin.Primitives.Int32.pack(len(self.IssuerCertificates)))
943 1
        for fieldname in self.IssuerCertificates:
944 1
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
945
        packet.append(uabin.Primitives.Int32.pack(len(self.IssuerCrls)))
946 1
        for fieldname in self.IssuerCrls:
947 1
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
948 1
        return b''.join(packet)
949 1
950 1
    @staticmethod
951 1
    def from_binary(data):
952 1
        obj = TrustListDataType()
953 1
        self.SpecifiedLists = uabin.Primitives.UInt32.unpack(data)
954 1
        obj.TrustedCertificates = uabin.Primitives.ByteString.unpack_array(data)
955 1
        obj.TrustedCrls = uabin.Primitives.ByteString.unpack_array(data)
956
        obj.IssuerCertificates = uabin.Primitives.ByteString.unpack_array(data)
957 1
        obj.IssuerCrls = uabin.Primitives.ByteString.unpack_array(data)
958
        return obj
959 1
960
    def __str__(self):
961 1
        return 'TrustListDataType(' + 'SpecifiedLists:' + str(self.SpecifiedLists) + ', ' + \
962 1
               'TrustedCertificates:' + str(self.TrustedCertificates) + ', ' + \
963 1
               'TrustedCrls:' + str(self.TrustedCrls) + ', ' + \
964 1
               'IssuerCertificates:' + str(self.IssuerCertificates) + ', ' + \
965 1
               'IssuerCrls:' + str(self.IssuerCrls) + ')'
966 1
967
    __repr__ = __str__
968 1
969
970
class Argument(FrozenClass):
971
    '''
972
    An argument for a method.
973
974
    :ivar Name:
975 1
    :vartype Name: String
976
    :ivar DataType:
977
    :vartype DataType: NodeId
978 1
    :ivar ValueRank:
979
    :vartype ValueRank: Int32
980
    :ivar ArrayDimensions:
981
    :vartype ArrayDimensions: UInt32
982
    :ivar Description:
983
    :vartype Description: LocalizedText
984
    '''
985
986
    ua_types = [
987
        ('Name', 'String'),
988
        ('DataType', 'NodeId'),
989
        ('ValueRank', 'Int32'),
990 1
        ('ArrayDimensions', 'ListOfUInt32'),
991
        ('Description', 'LocalizedText'),
992
               ]
993
994
    def __init__(self):
995
        self.Name = None
996 1
        self.DataType = NodeId()
997 1
        self.ValueRank = 0
998 1
        self.ArrayDimensions = []
999 1
        self.Description = LocalizedText()
1000 1
        self._freeze = True
1001 1
1002 1
    def to_binary(self):
1003 1
        packet = []
1004 1
        packet.append(uabin.Primitives.String.pack(self.Name))
1005
        packet.append(self.DataType.to_binary())
1006 1
        packet.append(uabin.Primitives.Int32.pack(self.ValueRank))
1007 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ArrayDimensions)))
1008 1
        for fieldname in self.ArrayDimensions:
1009 1
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
1010 1
        packet.append(self.Description.to_binary())
1011 1
        return b''.join(packet)
1012
1013 1
    @staticmethod
1014
    def from_binary(data):
1015 1
        obj = Argument()
1016
        self.Name = uabin.Primitives.String.unpack(data)
1017 1
        obj.DataType = NodeId.from_binary(data)
1018 1
        self.ValueRank = uabin.Primitives.Int32.unpack(data)
1019 1
        obj.ArrayDimensions = uabin.Primitives.UInt32.unpack_array(data)
1020 1
        obj.Description = LocalizedText.from_binary(data)
1021
        return obj
1022 1
1023
    def __str__(self):
1024
        return 'Argument(' + 'Name:' + str(self.Name) + ', ' + \
1025
               'DataType:' + str(self.DataType) + ', ' + \
1026
               'ValueRank:' + str(self.ValueRank) + ', ' + \
1027 1
               'ArrayDimensions:' + str(self.ArrayDimensions) + ', ' + \
1028
               'Description:' + str(self.Description) + ')'
1029
1030 1
    __repr__ = __str__
1031
1032
1033
class EnumValueType(FrozenClass):
1034
    '''
1035
    A mapping between a value of an enumerated type and a name and description.
1036
1037
    :ivar Value:
1038
    :vartype Value: Int64
1039
    :ivar DisplayName:
1040 1
    :vartype DisplayName: LocalizedText
1041
    :ivar Description:
1042
    :vartype Description: LocalizedText
1043
    '''
1044
1045 1
    ua_types = [
1046
        ('Value', 'Int64'),
1047
        ('DisplayName', 'LocalizedText'),
1048
        ('Description', 'LocalizedText'),
1049
               ]
1050
1051
    def __init__(self):
1052
        self.Value = 0
1053
        self.DisplayName = LocalizedText()
1054 1
        self.Description = LocalizedText()
1055
        self._freeze = True
1056
1057
    def to_binary(self):
1058
        packet = []
1059
        packet.append(uabin.Primitives.Int64.pack(self.Value))
1060 1
        packet.append(self.DisplayName.to_binary())
1061
        packet.append(self.Description.to_binary())
1062
        return b''.join(packet)
1063
1064 1
    @staticmethod
1065
    def from_binary(data):
1066
        obj = EnumValueType()
1067
        self.Value = uabin.Primitives.Int64.unpack(data)
1068 1
        obj.DisplayName = LocalizedText.from_binary(data)
1069
        obj.Description = LocalizedText.from_binary(data)
1070
        return obj
1071
1072 1
    def __str__(self):
1073
        return 'EnumValueType(' + 'Value:' + str(self.Value) + ', ' + \
1074
               'DisplayName:' + str(self.DisplayName) + ', ' + \
1075 1
               'Description:' + str(self.Description) + ')'
1076
1077
    __repr__ = __str__
1078
1079
1080
class OptionSet(FrozenClass):
1081 1
    '''
1082
    This abstract Structured DataType is the base DataType for all DataTypes representing a bit mask.
1083
1084 1
    :ivar Value:
1085
    :vartype Value: ByteString
1086
    :ivar ValidBits:
1087
    :vartype ValidBits: ByteString
1088
    '''
1089
1090
    ua_types = [
1091 1
        ('Value', 'ByteString'),
1092
        ('ValidBits', 'ByteString'),
1093
               ]
1094
1095 1
    def __init__(self):
1096
        self.Value = None
1097
        self.ValidBits = None
1098
        self._freeze = True
1099 1
1100
    def to_binary(self):
1101
        packet = []
1102 1
        packet.append(uabin.Primitives.ByteString.pack(self.Value))
1103
        packet.append(uabin.Primitives.ByteString.pack(self.ValidBits))
1104
        return b''.join(packet)
1105 1
1106
    @staticmethod
1107
    def from_binary(data):
1108 1
        obj = OptionSet()
1109
        self.Value = uabin.Primitives.ByteString.unpack(data)
1110
        self.ValidBits = uabin.Primitives.ByteString.unpack(data)
1111
        return obj
1112
1113
    def __str__(self):
1114
        return 'OptionSet(' + 'Value:' + str(self.Value) + ', ' + \
1115
               'ValidBits:' + str(self.ValidBits) + ')'
1116 1
1117
    __repr__ = __str__
1118
1119
1120
class Union(FrozenClass):
1121 1
    '''
1122
    This abstract DataType is the base DataType for all union DataTypes.
1123
1124
    '''
1125
1126
    ua_types = [
1127
               ]
1128
1129
    def __init__(self):
1130 1 View Code Duplication
        self._freeze = True
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1131
1132
    def to_binary(self):
1133
        packet = []
1134
        return b''.join(packet)
1135
1136 1
    @staticmethod
1137
    def from_binary(data):
1138
        obj = Union()
1139
        return obj
1140 1
1141
    def __str__(self):
1142
        return 'Union(' +  + ')'
1143
1144 1
    __repr__ = __str__
1145
1146
1147
class TimeZoneDataType(FrozenClass):
1148 1
    '''
1149
    :ivar Offset:
1150
    :vartype Offset: Int16
1151 1
    :ivar DaylightSavingInOffset:
1152
    :vartype DaylightSavingInOffset: Boolean
1153
    '''
1154
1155
    ua_types = [
1156
        ('Offset', 'Int16'),
1157
        ('DaylightSavingInOffset', 'Boolean'),
1158
               ]
1159
1160
    def __init__(self):
1161
        self.Offset = 0
1162
        self.DaylightSavingInOffset = True
1163
        self._freeze = True
1164
1165
    def to_binary(self):
1166
        packet = []
1167
        packet.append(uabin.Primitives.Int16.pack(self.Offset))
1168
        packet.append(uabin.Primitives.Boolean.pack(self.DaylightSavingInOffset))
1169
        return b''.join(packet)
1170
1171 1
    @staticmethod
1172
    def from_binary(data):
1173
        obj = TimeZoneDataType()
1174
        self.Offset = uabin.Primitives.Int16.unpack(data)
1175
        self.DaylightSavingInOffset = uabin.Primitives.Boolean.unpack(data)
1176
        return obj
1177
1178
    def __str__(self):
1179
        return 'TimeZoneDataType(' + 'Offset:' + str(self.Offset) + ', ' + \
1180
               'DaylightSavingInOffset:' + str(self.DaylightSavingInOffset) + ')'
1181 1
1182 1
    __repr__ = __str__
1183 1
1184 1
1185 1
class ApplicationDescription(FrozenClass):
1186 1
    '''
1187 1
    Describes an application and how to find it.
1188 1
1189 1
    :ivar ApplicationUri:
1190 1
    :vartype ApplicationUri: String
1191 1
    :ivar ProductUri:
1192 1
    :vartype ProductUri: String
1193 1
    :ivar ApplicationName:
1194 View Code Duplication
    :vartype ApplicationName: LocalizedText
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1195 1
    :ivar ApplicationType:
1196 1
    :vartype ApplicationType: ApplicationType
1197 1
    :ivar GatewayServerUri:
1198 1
    :vartype GatewayServerUri: String
1199 1
    :ivar DiscoveryProfileUri:
1200 1
    :vartype DiscoveryProfileUri: String
1201 1
    :ivar DiscoveryUrls:
1202 1
    :vartype DiscoveryUrls: String
1203 1
    '''
1204 1
1205 1
    ua_types = [
1206 1
        ('ApplicationUri', 'String'),
1207
        ('ProductUri', 'String'),
1208 1
        ('ApplicationName', 'LocalizedText'),
1209
        ('ApplicationType', 'ApplicationType'),
1210 1
        ('GatewayServerUri', 'String'),
1211
        ('DiscoveryProfileUri', 'String'),
1212 1
        ('DiscoveryUrls', 'ListOfString'),
1213 1
               ]
1214 1
1215 1
    def __init__(self):
1216 1
        self.ApplicationUri = None
1217 1
        self.ProductUri = None
1218 1
        self.ApplicationName = LocalizedText()
1219 1
        self.ApplicationType = ApplicationType(0)
1220
        self.GatewayServerUri = None
1221 1
        self.DiscoveryProfileUri = None
1222
        self.DiscoveryUrls = []
1223
        self._freeze = True
1224
1225
    def to_binary(self):
1226
        packet = []
1227
        packet.append(uabin.Primitives.String.pack(self.ApplicationUri))
1228
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
1229
        packet.append(self.ApplicationName.to_binary())
1230 1
        packet.append(uabin.Primitives.UInt32.pack(self.ApplicationType.value))
1231
        packet.append(uabin.Primitives.String.pack(self.GatewayServerUri))
1232
        packet.append(uabin.Primitives.String.pack(self.DiscoveryProfileUri))
1233 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiscoveryUrls)))
1234
        for fieldname in self.DiscoveryUrls:
1235
            packet.append(uabin.Primitives.String.pack(fieldname))
1236
        return b''.join(packet)
1237
1238
    @staticmethod
1239
    def from_binary(data):
1240
        obj = ApplicationDescription()
1241
        self.ApplicationUri = uabin.Primitives.String.unpack(data)
1242
        self.ProductUri = uabin.Primitives.String.unpack(data)
1243
        obj.ApplicationName = LocalizedText.from_binary(data)
1244
        self.ApplicationType = ApplicationType(uabin.Primitives.UInt32.unpack(data))
1245
        self.GatewayServerUri = uabin.Primitives.String.unpack(data)
1246
        self.DiscoveryProfileUri = uabin.Primitives.String.unpack(data)
1247
        obj.DiscoveryUrls = uabin.Primitives.String.unpack_array(data)
1248
        return obj
1249
1250
    def __str__(self):
1251
        return 'ApplicationDescription(' + 'ApplicationUri:' + str(self.ApplicationUri) + ', ' + \
1252
               'ProductUri:' + str(self.ProductUri) + ', ' + \
1253 1
               'ApplicationName:' + str(self.ApplicationName) + ', ' + \
1254
               'ApplicationType:' + str(self.ApplicationType) + ', ' + \
1255
               'GatewayServerUri:' + str(self.GatewayServerUri) + ', ' + \
1256
               'DiscoveryProfileUri:' + str(self.DiscoveryProfileUri) + ', ' + \
1257
               'DiscoveryUrls:' + str(self.DiscoveryUrls) + ')'
1258
1259
    __repr__ = __str__
1260
1261
1262
class RequestHeader(FrozenClass):
1263 1
    '''
1264 1
    The header passed with every server request.
1265 1
1266 1
    :ivar AuthenticationToken:
1267 1
    :vartype AuthenticationToken: NodeId
1268 1
    :ivar Timestamp:
1269 1
    :vartype Timestamp: DateTime
1270 1
    :ivar RequestHandle:
1271 1
    :vartype RequestHandle: UInt32
1272 1
    :ivar ReturnDiagnostics:
1273 1
    :vartype ReturnDiagnostics: UInt32
1274 1
    :ivar AuditEntryId:
1275 1
    :vartype AuditEntryId: String
1276
    :ivar TimeoutHint:
1277 1
    :vartype TimeoutHint: UInt32
1278 1
    :ivar AdditionalHeader:
1279 1
    :vartype AdditionalHeader: ExtensionObject
1280 1
    '''
1281 1
1282 1
    ua_types = [
1283 1
        ('AuthenticationToken', 'NodeId'),
1284 1
        ('Timestamp', 'DateTime'),
1285 1
        ('RequestHandle', 'UInt32'),
1286 1
        ('ReturnDiagnostics', 'UInt32'),
1287
        ('AuditEntryId', 'String'),
1288 1
        ('TimeoutHint', 'UInt32'),
1289
        ('AdditionalHeader', 'ExtensionObject'),
1290 1
               ]
1291
1292 1
    def __init__(self):
1293 1
        self.AuthenticationToken = NodeId()
1294 1
        self.Timestamp = datetime.utcnow()
1295 1
        self.RequestHandle = 0
1296 1
        self.ReturnDiagnostics = 0
1297 1
        self.AuditEntryId = None
1298 1
        self.TimeoutHint = 0
1299 1
        self.AdditionalHeader = ExtensionObject()
1300
        self._freeze = True
1301 1
1302
    def to_binary(self):
1303
        packet = []
1304
        packet.append(self.AuthenticationToken.to_binary())
1305
        packet.append(uabin.Primitives.DateTime.pack(self.Timestamp))
1306
        packet.append(uabin.Primitives.UInt32.pack(self.RequestHandle))
1307
        packet.append(uabin.Primitives.UInt32.pack(self.ReturnDiagnostics))
1308
        packet.append(uabin.Primitives.String.pack(self.AuditEntryId))
1309
        packet.append(uabin.Primitives.UInt32.pack(self.TimeoutHint))
1310 1
        packet.append(uabin.extensionobject_to_binary(self.AdditionalHeader))
1311
        return b''.join(packet)
1312
1313 1
    @staticmethod
1314
    def from_binary(data):
1315
        obj = RequestHeader()
1316
        obj.AuthenticationToken = NodeId.from_binary(data)
1317
        self.Timestamp = uabin.Primitives.DateTime.unpack(data)
1318
        self.RequestHandle = uabin.Primitives.UInt32.unpack(data)
1319
        self.ReturnDiagnostics = uabin.Primitives.UInt32.unpack(data)
1320
        self.AuditEntryId = uabin.Primitives.String.unpack(data)
1321
        self.TimeoutHint = uabin.Primitives.UInt32.unpack(data)
1322
        obj.AdditionalHeader = uabin.extensionobject_from_binary(data)
1323
        return obj
1324
1325
    def __str__(self):
1326
        return 'RequestHeader(' + 'AuthenticationToken:' + str(self.AuthenticationToken) + ', ' + \
1327
               'Timestamp:' + str(self.Timestamp) + ', ' + \
1328
               'RequestHandle:' + str(self.RequestHandle) + ', ' + \
1329
               'ReturnDiagnostics:' + str(self.ReturnDiagnostics) + ', ' + \
1330
               'AuditEntryId:' + str(self.AuditEntryId) + ', ' + \
1331 1
               'TimeoutHint:' + str(self.TimeoutHint) + ', ' + \
1332
               'AdditionalHeader:' + str(self.AdditionalHeader) + ')'
1333
1334
    __repr__ = __str__
1335
1336
1337
class ResponseHeader(FrozenClass):
1338
    '''
1339
    The header passed with every server response.
1340 1
1341 1
    :ivar Timestamp:
1342 1
    :vartype Timestamp: DateTime
1343 1
    :ivar RequestHandle:
1344 1
    :vartype RequestHandle: UInt32
1345 1
    :ivar ServiceResult:
1346 1
    :vartype ServiceResult: StatusCode
1347 1
    :ivar ServiceDiagnostics:
1348 1
    :vartype ServiceDiagnostics: DiagnosticInfo
1349 1
    :ivar StringTable:
1350 1
    :vartype StringTable: String
1351 1
    :ivar AdditionalHeader:
1352
    :vartype AdditionalHeader: ExtensionObject
1353 1
    '''
1354 1
1355 1
    ua_types = [
1356 1
        ('Timestamp', 'DateTime'),
1357 1
        ('RequestHandle', 'UInt32'),
1358 1
        ('ServiceResult', 'StatusCode'),
1359 1
        ('ServiceDiagnostics', 'DiagnosticInfo'),
1360 1
        ('StringTable', 'ListOfString'),
1361
        ('AdditionalHeader', 'ExtensionObject'),
1362 1
               ]
1363 1
1364
    def __init__(self):
1365 1
        self.Timestamp = datetime.utcnow()
1366
        self.RequestHandle = 0
1367 1
        self.ServiceResult = StatusCode()
1368
        self.ServiceDiagnostics = DiagnosticInfo()
1369 1
        self.StringTable = []
1370 1
        self.AdditionalHeader = ExtensionObject()
1371 1
        self._freeze = True
1372 1
1373 1
    def to_binary(self):
1374 1
        packet = []
1375 1
        packet.append(uabin.Primitives.DateTime.pack(self.Timestamp))
1376
        packet.append(uabin.Primitives.UInt32.pack(self.RequestHandle))
1377 1
        packet.append(self.ServiceResult.to_binary())
1378
        packet.append(self.ServiceDiagnostics.to_binary())
1379
        packet.append(uabin.Primitives.Int32.pack(len(self.StringTable)))
1380
        for fieldname in self.StringTable:
1381
            packet.append(uabin.Primitives.String.pack(fieldname))
1382
        packet.append(uabin.extensionobject_to_binary(self.AdditionalHeader))
1383
        return b''.join(packet)
1384
1385 1
    @staticmethod
1386
    def from_binary(data):
1387
        obj = ResponseHeader()
1388 1
        self.Timestamp = uabin.Primitives.DateTime.unpack(data)
1389
        self.RequestHandle = uabin.Primitives.UInt32.unpack(data)
1390
        obj.ServiceResult = StatusCode.from_binary(data)
1391
        obj.ServiceDiagnostics = DiagnosticInfo.from_binary(data)
1392
        obj.StringTable = uabin.Primitives.String.unpack_array(data)
1393
        obj.AdditionalHeader = uabin.extensionobject_from_binary(data)
1394
        return obj
1395
1396
    def __str__(self):
1397
        return 'ResponseHeader(' + 'Timestamp:' + str(self.Timestamp) + ', ' + \
1398 1
               'RequestHandle:' + str(self.RequestHandle) + ', ' + \
1399
               'ServiceResult:' + str(self.ServiceResult) + ', ' + \
1400
               'ServiceDiagnostics:' + str(self.ServiceDiagnostics) + ', ' + \
1401
               'StringTable:' + str(self.StringTable) + ', ' + \
1402
               'AdditionalHeader:' + str(self.AdditionalHeader) + ')'
1403 1
1404 1
    __repr__ = __str__
1405
1406
1407
class ServiceFault(FrozenClass):
1408 1
    '''
1409 1
    The response returned by all services when there is a service level error.
1410 1
1411
    :ivar TypeId:
1412 1
    :vartype TypeId: NodeId
1413 1
    :ivar ResponseHeader:
1414 1
    :vartype ResponseHeader: ResponseHeader
1415 1
    '''
1416 1
1417
    ua_types = [
1418 1
        ('TypeId', 'NodeId'),
1419
        ('ResponseHeader', 'ResponseHeader'),
1420
               ]
1421
1422 1
    def __init__(self):
1423
        self.TypeId = FourByteNodeId(ObjectIds.ServiceFault_Encoding_DefaultBinary)
1424
        self.ResponseHeader = ResponseHeader()
1425
        self._freeze = True
1426 1
1427
    def to_binary(self):
1428
        packet = []
1429
        packet.append(self.TypeId.to_binary())
1430 1
        packet.append(self.ResponseHeader.to_binary())
1431
        return b''.join(packet)
1432
1433 1
    @staticmethod
1434
    def from_binary(data):
1435
        obj = ServiceFault()
1436
        obj.TypeId = NodeId.from_binary(data)
1437
        obj.ResponseHeader = ResponseHeader.from_binary(data)
1438
        return obj
1439
1440
    def __str__(self):
1441
        return 'ServiceFault(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1442
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
1443 1
1444
    __repr__ = __str__
1445
1446
1447
class FindServersParameters(FrozenClass):
1448
    '''
1449 1
    :ivar EndpointUrl:
1450 1
    :vartype EndpointUrl: String
1451 1
    :ivar LocaleIds:
1452 1
    :vartype LocaleIds: String
1453 1
    :ivar ServerUris:
1454 1
    :vartype ServerUris: String
1455 1
    '''
1456 1
1457 1
    ua_types = [
1458
        ('EndpointUrl', 'String'),
1459 1
        ('LocaleIds', 'ListOfString'),
1460 1
        ('ServerUris', 'ListOfString'),
1461 1
               ]
1462 1
1463 1
    def __init__(self):
1464
        self.EndpointUrl = None
1465 1
        self.LocaleIds = []
1466 1
        self.ServerUris = []
1467 1
        self._freeze = True
1468 1
1469 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1470 1
        packet = []
1471
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
1472 1
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
1473
        for fieldname in self.LocaleIds:
1474 1
            packet.append(uabin.Primitives.String.pack(fieldname))
1475 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerUris)))
1476 1
        for fieldname in self.ServerUris:
1477 1
            packet.append(uabin.Primitives.String.pack(fieldname))
1478
        return b''.join(packet)
1479 1
1480
    @staticmethod
1481
    def from_binary(data):
1482
        obj = FindServersParameters()
1483
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
1484 1
        obj.LocaleIds = uabin.Primitives.String.unpack_array(data)
1485
        obj.ServerUris = uabin.Primitives.String.unpack_array(data)
1486
        return obj
1487 1
1488
    def __str__(self):
1489
        return 'FindServersParameters(' + 'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
1490
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
1491
               'ServerUris:' + str(self.ServerUris) + ')'
1492
1493
    __repr__ = __str__
1494
1495
1496
class FindServersRequest(FrozenClass):
1497
    '''
1498
    Finds the servers known to the discovery server.
1499 1
1500
    :ivar TypeId:
1501
    :vartype TypeId: NodeId
1502
    :ivar RequestHeader:
1503
    :vartype RequestHeader: RequestHeader
1504 View Code Duplication
    :ivar Parameters:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1505 1
    :vartype Parameters: FindServersParameters
1506 1
    '''
1507
1508
    ua_types = [
1509
        ('TypeId', 'NodeId'),
1510 1
        ('RequestHeader', 'RequestHeader'),
1511 1
        ('Parameters', 'FindServersParameters'),
1512 1
               ]
1513 1
1514
    def __init__(self):
1515 1
        self.TypeId = FourByteNodeId(ObjectIds.FindServersRequest_Encoding_DefaultBinary)
1516 1
        self.RequestHeader = RequestHeader()
1517 1
        self.Parameters = FindServersParameters()
1518 1
        self._freeze = True
1519 1
1520 1
    def to_binary(self):
1521
        packet = []
1522 1
        packet.append(self.TypeId.to_binary())
1523
        packet.append(self.RequestHeader.to_binary())
1524
        packet.append(self.Parameters.to_binary())
1525
        return b''.join(packet)
1526 1
1527
    @staticmethod
1528
    def from_binary(data):
1529
        obj = FindServersRequest()
1530
        obj.TypeId = NodeId.from_binary(data)
1531 1
        obj.RequestHeader = RequestHeader.from_binary(data)
1532
        obj.Parameters = FindServersParameters.from_binary(data)
1533
        return obj
1534
1535
    def __str__(self):
1536 1
        return 'FindServersRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1537
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
1538
               'Parameters:' + str(self.Parameters) + ')'
1539 1
1540
    __repr__ = __str__
1541
1542
1543
class FindServersResponse(FrozenClass):
1544
    '''
1545
    Finds the servers known to the discovery server.
1546
1547
    :ivar TypeId:
1548
    :vartype TypeId: NodeId
1549
    :ivar ResponseHeader:
1550
    :vartype ResponseHeader: ResponseHeader
1551 1
    :ivar Servers:
1552
    :vartype Servers: ApplicationDescription
1553
    '''
1554
1555
    ua_types = [
1556
        ('TypeId', 'NodeId'),
1557 1
        ('ResponseHeader', 'ResponseHeader'),
1558 1
        ('Servers', 'ListOfApplicationDescription'),
1559 1
               ]
1560 1
1561 1
    def __init__(self):
1562 1
        self.TypeId = FourByteNodeId(ObjectIds.FindServersResponse_Encoding_DefaultBinary)
1563 1
        self.ResponseHeader = ResponseHeader()
1564 1
        self.Servers = []
1565 1
        self._freeze = True
1566
1567 1
    def to_binary(self):
1568 1
        packet = []
1569 1
        packet.append(self.TypeId.to_binary())
1570 1
        packet.append(self.ResponseHeader.to_binary())
1571 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Servers)))
1572 1
        for fieldname in self.Servers:
1573 1
            packet.append(fieldname.to_binary())
1574 1
        return b''.join(packet)
1575
1576 1
    @staticmethod
1577
    def from_binary(data):
1578 1
        obj = FindServersResponse()
1579
        obj.TypeId = NodeId.from_binary(data)
1580 1
        obj.ResponseHeader = ResponseHeader.from_binary(data)
1581 1
        length = uabin.Primitives.Int32.unpack(data)
1582 1
        array = []
1583 1
        if length != -1:
1584 1
            for _ in range(0, length):
1585 1
                array.append(ApplicationDescription.from_binary(data))
1586 1
        obj.Servers = array
1587 1
        return obj
1588 1
1589
    def __str__(self):
1590 1
        return 'FindServersResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1591
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
1592
               'Servers:' + str(self.Servers) + ')'
1593
1594
    __repr__ = __str__
1595 1
1596
1597
class ServerOnNetwork(FrozenClass):
1598 1
    '''
1599
    :ivar RecordId:
1600
    :vartype RecordId: UInt32
1601
    :ivar ServerName:
1602
    :vartype ServerName: String
1603
    :ivar DiscoveryUrl:
1604
    :vartype DiscoveryUrl: String
1605
    :ivar ServerCapabilities:
1606
    :vartype ServerCapabilities: String
1607
    '''
1608
1609
    ua_types = [
1610 1
        ('RecordId', 'UInt32'),
1611
        ('ServerName', 'String'),
1612
        ('DiscoveryUrl', 'String'),
1613
        ('ServerCapabilities', 'ListOfString'),
1614
               ]
1615
1616 View Code Duplication
    def __init__(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1617 1
        self.RecordId = 0
1618
        self.ServerName = None
1619
        self.DiscoveryUrl = None
1620
        self.ServerCapabilities = []
1621
        self._freeze = True
1622
1623
    def to_binary(self):
1624
        packet = []
1625
        packet.append(uabin.Primitives.UInt32.pack(self.RecordId))
1626
        packet.append(uabin.Primitives.String.pack(self.ServerName))
1627
        packet.append(uabin.Primitives.String.pack(self.DiscoveryUrl))
1628 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerCapabilities)))
1629
        for fieldname in self.ServerCapabilities:
1630
            packet.append(uabin.Primitives.String.pack(fieldname))
1631
        return b''.join(packet)
1632
1633
    @staticmethod
1634
    def from_binary(data):
1635
        obj = ServerOnNetwork()
1636
        self.RecordId = uabin.Primitives.UInt32.unpack(data)
1637
        self.ServerName = uabin.Primitives.String.unpack(data)
1638 1
        self.DiscoveryUrl = uabin.Primitives.String.unpack(data)
1639
        obj.ServerCapabilities = uabin.Primitives.String.unpack_array(data)
1640
        return obj
1641
1642 1
    def __str__(self):
1643
        return 'ServerOnNetwork(' + 'RecordId:' + str(self.RecordId) + ', ' + \
1644
               'ServerName:' + str(self.ServerName) + ', ' + \
1645
               'DiscoveryUrl:' + str(self.DiscoveryUrl) + ', ' + \
1646
               'ServerCapabilities:' + str(self.ServerCapabilities) + ')'
1647
1648 1
    __repr__ = __str__
1649
1650
1651
class FindServersOnNetworkParameters(FrozenClass):
1652
    '''
1653
    :ivar StartingRecordId:
1654 1
    :vartype StartingRecordId: UInt32
1655
    :ivar MaxRecordsToReturn:
1656
    :vartype MaxRecordsToReturn: UInt32
1657 1
    :ivar ServerCapabilityFilter:
1658
    :vartype ServerCapabilityFilter: String
1659
    '''
1660
1661
    ua_types = [
1662
        ('StartingRecordId', 'UInt32'),
1663
        ('MaxRecordsToReturn', 'UInt32'),
1664
        ('ServerCapabilityFilter', 'ListOfString'),
1665
               ]
1666
1667 1
    def __init__(self):
1668
        self.StartingRecordId = 0
1669
        self.MaxRecordsToReturn = 0
1670
        self.ServerCapabilityFilter = []
1671
        self._freeze = True
1672
1673 1
    def to_binary(self):
1674
        packet = []
1675
        packet.append(uabin.Primitives.UInt32.pack(self.StartingRecordId))
1676
        packet.append(uabin.Primitives.UInt32.pack(self.MaxRecordsToReturn))
1677
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerCapabilityFilter)))
1678
        for fieldname in self.ServerCapabilityFilter:
1679
            packet.append(uabin.Primitives.String.pack(fieldname))
1680
        return b''.join(packet)
1681
1682
    @staticmethod
1683 1
    def from_binary(data):
1684
        obj = FindServersOnNetworkParameters()
1685
        self.StartingRecordId = uabin.Primitives.UInt32.unpack(data)
1686
        self.MaxRecordsToReturn = uabin.Primitives.UInt32.unpack(data)
1687
        obj.ServerCapabilityFilter = uabin.Primitives.String.unpack_array(data)
1688
        return obj
1689
1690
    def __str__(self):
1691
        return 'FindServersOnNetworkParameters(' + 'StartingRecordId:' + str(self.StartingRecordId) + ', ' + \
1692 1
               'MaxRecordsToReturn:' + str(self.MaxRecordsToReturn) + ', ' + \
1693
               'ServerCapabilityFilter:' + str(self.ServerCapabilityFilter) + ')'
1694
1695
    __repr__ = __str__
1696 1
1697
1698
class FindServersOnNetworkRequest(FrozenClass):
1699
    '''
1700
    :ivar TypeId:
1701 1
    :vartype TypeId: NodeId
1702
    :ivar RequestHeader:
1703
    :vartype RequestHeader: RequestHeader
1704
    :ivar Parameters:
1705
    :vartype Parameters: FindServersOnNetworkParameters
1706 1
    '''
1707
1708
    ua_types = [
1709 1
        ('TypeId', 'NodeId'),
1710
        ('RequestHeader', 'RequestHeader'),
1711
        ('Parameters', 'FindServersOnNetworkParameters'),
1712
               ]
1713
1714
    def __init__(self):
1715
        self.TypeId = FourByteNodeId(ObjectIds.FindServersOnNetworkRequest_Encoding_DefaultBinary)
1716
        self.RequestHeader = RequestHeader()
1717
        self.Parameters = FindServersOnNetworkParameters()
1718
        self._freeze = True
1719 1
1720
    def to_binary(self):
1721
        packet = []
1722
        packet.append(self.TypeId.to_binary())
1723
        packet.append(self.RequestHeader.to_binary())
1724
        packet.append(self.Parameters.to_binary())
1725 1
        return b''.join(packet)
1726
1727
    @staticmethod
1728
    def from_binary(data):
1729
        obj = FindServersOnNetworkRequest()
1730
        obj.TypeId = NodeId.from_binary(data)
1731
        obj.RequestHeader = RequestHeader.from_binary(data)
1732
        obj.Parameters = FindServersOnNetworkParameters.from_binary(data)
1733
        return obj
1734
1735 1
    def __str__(self):
1736
        return 'FindServersOnNetworkRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1737
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
1738
               'Parameters:' + str(self.Parameters) + ')'
1739
1740
    __repr__ = __str__
1741
1742 1
1743
class FindServersOnNetworkResult(FrozenClass):
1744
    '''
1745
    :ivar LastCounterResetTime:
1746 1
    :vartype LastCounterResetTime: DateTime
1747
    :ivar Servers:
1748
    :vartype Servers: ServerOnNetwork
1749
    '''
1750
1751 1
    ua_types = [
1752
        ('LastCounterResetTime', 'DateTime'),
1753
        ('Servers', 'ListOfServerOnNetwork'),
1754
               ]
1755
1756 1
    def __init__(self):
1757
        self.LastCounterResetTime = datetime.utcnow()
1758
        self.Servers = []
1759 1
        self._freeze = True
1760
1761
    def to_binary(self):
1762
        packet = []
1763
        packet.append(uabin.Primitives.DateTime.pack(self.LastCounterResetTime))
1764
        packet.append(uabin.Primitives.Int32.pack(len(self.Servers)))
1765
        for fieldname in self.Servers:
1766
            packet.append(fieldname.to_binary())
1767 1
        return b''.join(packet)
1768
1769
    @staticmethod
1770
    def from_binary(data):
1771
        obj = FindServersOnNetworkResult()
1772 1
        self.LastCounterResetTime = uabin.Primitives.DateTime.unpack(data)
1773
        length = uabin.Primitives.Int32.unpack(data)
1774
        array = []
1775
        if length != -1:
1776
            for _ in range(0, length):
1777
                array.append(ServerOnNetwork.from_binary(data))
1778
        obj.Servers = array
1779
        return obj
1780
1781 1
    def __str__(self):
1782
        return 'FindServersOnNetworkResult(' + 'LastCounterResetTime:' + str(self.LastCounterResetTime) + ', ' + \
1783
               'Servers:' + str(self.Servers) + ')'
1784
1785
    __repr__ = __str__
1786
1787
1788
class FindServersOnNetworkResponse(FrozenClass):
1789 1
    '''
1790
    :ivar TypeId:
1791
    :vartype TypeId: NodeId
1792
    :ivar ResponseHeader:
1793 1
    :vartype ResponseHeader: ResponseHeader
1794
    :ivar Parameters:
1795
    :vartype Parameters: FindServersOnNetworkResult
1796
    '''
1797
1798
    ua_types = [
1799
        ('TypeId', 'NodeId'),
1800
        ('ResponseHeader', 'ResponseHeader'),
1801
        ('Parameters', 'FindServersOnNetworkResult'),
1802 1
               ]
1803
1804
    def __init__(self):
1805
        self.TypeId = FourByteNodeId(ObjectIds.FindServersOnNetworkResponse_Encoding_DefaultBinary)
1806 1
        self.ResponseHeader = ResponseHeader()
1807
        self.Parameters = FindServersOnNetworkResult()
1808
        self._freeze = True
1809 1
1810
    def to_binary(self):
1811
        packet = []
1812
        packet.append(self.TypeId.to_binary())
1813
        packet.append(self.ResponseHeader.to_binary())
1814
        packet.append(self.Parameters.to_binary())
1815
        return b''.join(packet)
1816
1817
    @staticmethod
1818
    def from_binary(data):
1819 1
        obj = FindServersOnNetworkResponse()
1820
        obj.TypeId = NodeId.from_binary(data)
1821
        obj.ResponseHeader = ResponseHeader.from_binary(data)
1822
        obj.Parameters = FindServersOnNetworkResult.from_binary(data)
1823
        return obj
1824 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1825 1
    def __str__(self):
1826
        return 'FindServersOnNetworkResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1827
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
1828
               'Parameters:' + str(self.Parameters) + ')'
1829
1830
    __repr__ = __str__
1831
1832
1833
class UserTokenPolicy(FrozenClass):
1834
    '''
1835 1
    Describes a user token that can be used with a server.
1836
1837
    :ivar PolicyId:
1838
    :vartype PolicyId: String
1839
    :ivar TokenType:
1840
    :vartype TokenType: UserTokenType
1841
    :ivar IssuedTokenType:
1842 1
    :vartype IssuedTokenType: String
1843
    :ivar IssuerEndpointUrl:
1844
    :vartype IssuerEndpointUrl: String
1845
    :ivar SecurityPolicyUri:
1846 1
    :vartype SecurityPolicyUri: String
1847
    '''
1848
1849
    ua_types = [
1850
        ('PolicyId', 'String'),
1851 1
        ('TokenType', 'UserTokenType'),
1852
        ('IssuedTokenType', 'String'),
1853
        ('IssuerEndpointUrl', 'String'),
1854
        ('SecurityPolicyUri', 'String'),
1855
               ]
1856 1
1857
    def __init__(self):
1858
        self.PolicyId = None
1859 1
        self.TokenType = UserTokenType(0)
1860
        self.IssuedTokenType = None
1861
        self.IssuerEndpointUrl = None
1862
        self.SecurityPolicyUri = None
1863
        self._freeze = True
1864
1865
    def to_binary(self):
1866
        packet = []
1867
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
1868
        packet.append(uabin.Primitives.UInt32.pack(self.TokenType.value))
1869
        packet.append(uabin.Primitives.String.pack(self.IssuedTokenType))
1870
        packet.append(uabin.Primitives.String.pack(self.IssuerEndpointUrl))
1871
        packet.append(uabin.Primitives.String.pack(self.SecurityPolicyUri))
1872
        return b''.join(packet)
1873
1874
    @staticmethod
1875 1
    def from_binary(data):
1876
        obj = UserTokenPolicy()
1877
        self.PolicyId = uabin.Primitives.String.unpack(data)
1878
        self.TokenType = UserTokenType(uabin.Primitives.UInt32.unpack(data))
1879
        self.IssuedTokenType = uabin.Primitives.String.unpack(data)
1880
        self.IssuerEndpointUrl = uabin.Primitives.String.unpack(data)
1881
        self.SecurityPolicyUri = uabin.Primitives.String.unpack(data)
1882
        return obj
1883 1
1884 1
    def __str__(self):
1885 1
        return 'UserTokenPolicy(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
1886 1
               'TokenType:' + str(self.TokenType) + ', ' + \
1887 1
               'IssuedTokenType:' + str(self.IssuedTokenType) + ', ' + \
1888 1
               'IssuerEndpointUrl:' + str(self.IssuerEndpointUrl) + ', ' + \
1889 1
               'SecurityPolicyUri:' + str(self.SecurityPolicyUri) + ')'
1890 1
1891 1
    __repr__ = __str__
1892 1
1893 1
1894
class EndpointDescription(FrozenClass):
1895 1
    '''
1896 1
    The description of a endpoint that can be used to access a server.
1897 1
1898 1
    :ivar EndpointUrl:
1899 1
    :vartype EndpointUrl: String
1900 1
    :ivar Server:
1901 1
    :vartype Server: ApplicationDescription
1902 1
    :ivar ServerCertificate:
1903
    :vartype ServerCertificate: ByteString
1904 1
    :ivar SecurityMode:
1905
    :vartype SecurityMode: MessageSecurityMode
1906 1
    :ivar SecurityPolicyUri:
1907
    :vartype SecurityPolicyUri: String
1908 1
    :ivar UserIdentityTokens:
1909 1
    :vartype UserIdentityTokens: UserTokenPolicy
1910 1
    :ivar TransportProfileUri:
1911 1
    :vartype TransportProfileUri: String
1912 1
    :ivar SecurityLevel:
1913 1
    :vartype SecurityLevel: Byte
1914
    '''
1915 1
1916
    ua_types = [
1917
        ('EndpointUrl', 'String'),
1918 View Code Duplication
        ('Server', 'ApplicationDescription'),
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1919
        ('ServerCertificate', 'ByteString'),
1920
        ('SecurityMode', 'MessageSecurityMode'),
1921
        ('SecurityPolicyUri', 'String'),
1922 1
        ('UserIdentityTokens', 'ListOfUserTokenPolicy'),
1923
        ('TransportProfileUri', 'String'),
1924
        ('SecurityLevel', 'Byte'),
1925 1
               ]
1926
1927
    def __init__(self):
1928
        self.EndpointUrl = None
1929
        self.Server = ApplicationDescription()
1930
        self.ServerCertificate = None
1931
        self.SecurityMode = MessageSecurityMode(0)
1932
        self.SecurityPolicyUri = None
1933
        self.UserIdentityTokens = []
1934
        self.TransportProfileUri = None
1935
        self.SecurityLevel = 0
1936
        self._freeze = True
1937
1938
    def to_binary(self):
1939
        packet = []
1940
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
1941
        packet.append(self.Server.to_binary())
1942
        packet.append(uabin.Primitives.ByteString.pack(self.ServerCertificate))
1943
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityMode.value))
1944
        packet.append(uabin.Primitives.String.pack(self.SecurityPolicyUri))
1945
        packet.append(uabin.Primitives.Int32.pack(len(self.UserIdentityTokens)))
1946
        for fieldname in self.UserIdentityTokens:
1947 1
            packet.append(fieldname.to_binary())
1948
        packet.append(uabin.Primitives.String.pack(self.TransportProfileUri))
1949
        packet.append(uabin.Primitives.Byte.pack(self.SecurityLevel))
1950
        return b''.join(packet)
1951
1952
    @staticmethod
1953
    def from_binary(data):
1954
        obj = EndpointDescription()
1955
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
1956
        obj.Server = ApplicationDescription.from_binary(data)
1957
        self.ServerCertificate = uabin.Primitives.ByteString.unpack(data)
1958 1
        self.SecurityMode = MessageSecurityMode(uabin.Primitives.UInt32.unpack(data))
1959 1
        self.SecurityPolicyUri = uabin.Primitives.String.unpack(data)
1960 1
        length = uabin.Primitives.Int32.unpack(data)
1961 1
        array = []
1962 1
        if length != -1:
1963 1
            for _ in range(0, length):
1964 1
                array.append(UserTokenPolicy.from_binary(data))
1965 1
        obj.UserIdentityTokens = array
1966 1
        self.TransportProfileUri = uabin.Primitives.String.unpack(data)
1967 1
        self.SecurityLevel = uabin.Primitives.Byte.unpack(data)
1968 1
        return obj
1969 1
1970 1
    def __str__(self):
1971 1
        return 'EndpointDescription(' + 'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
1972
               'Server:' + str(self.Server) + ', ' + \
1973 1
               'ServerCertificate:' + str(self.ServerCertificate) + ', ' + \
1974 1
               'SecurityMode:' + str(self.SecurityMode) + ', ' + \
1975 1
               'SecurityPolicyUri:' + str(self.SecurityPolicyUri) + ', ' + \
1976 1
               'UserIdentityTokens:' + str(self.UserIdentityTokens) + ', ' + \
1977 1
               'TransportProfileUri:' + str(self.TransportProfileUri) + ', ' + \
1978 1
               'SecurityLevel:' + str(self.SecurityLevel) + ')'
1979 1
1980 1
    __repr__ = __str__
1981 1
1982 1
1983 1
class GetEndpointsParameters(FrozenClass):
1984 1
    '''
1985 1
    :ivar EndpointUrl:
1986
    :vartype EndpointUrl: String
1987 1
    :ivar LocaleIds:
1988
    :vartype LocaleIds: String
1989 1
    :ivar ProfileUris:
1990
    :vartype ProfileUris: String
1991 1
    '''
1992 1
1993 1
    ua_types = [
1994 1
        ('EndpointUrl', 'String'),
1995 1
        ('LocaleIds', 'ListOfString'),
1996 1
        ('ProfileUris', 'ListOfString'),
1997 1
               ]
1998 1
1999 1
    def __init__(self):
2000 1
        self.EndpointUrl = None
2001 1
        self.LocaleIds = []
2002 1
        self.ProfileUris = []
2003 1
        self._freeze = True
2004 1
2005 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2006 1
        packet = []
2007
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
2008
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
2009
        for fieldname in self.LocaleIds:
2010
            packet.append(uabin.Primitives.String.pack(fieldname))
2011
        packet.append(uabin.Primitives.Int32.pack(len(self.ProfileUris)))
2012
        for fieldname in self.ProfileUris:
2013
            packet.append(uabin.Primitives.String.pack(fieldname))
2014
        return b''.join(packet)
2015
2016 1
    @staticmethod
2017
    def from_binary(data):
2018
        obj = GetEndpointsParameters()
2019 1
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
2020
        obj.LocaleIds = uabin.Primitives.String.unpack_array(data)
2021
        obj.ProfileUris = uabin.Primitives.String.unpack_array(data)
2022
        return obj
2023
2024
    def __str__(self):
2025
        return 'GetEndpointsParameters(' + 'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
2026
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
2027
               'ProfileUris:' + str(self.ProfileUris) + ')'
2028
2029 1
    __repr__ = __str__
2030
2031
2032
class GetEndpointsRequest(FrozenClass):
2033
    '''
2034
    Gets the endpoints used by the server.
2035 1
2036 1
    :ivar TypeId:
2037 1
    :vartype TypeId: NodeId
2038 1
    :ivar RequestHeader:
2039 1
    :vartype RequestHeader: RequestHeader
2040 1
    :ivar Parameters:
2041 1
    :vartype Parameters: GetEndpointsParameters
2042 1
    '''
2043 1
2044
    ua_types = [
2045 1
        ('TypeId', 'NodeId'),
2046 1
        ('RequestHeader', 'RequestHeader'),
2047 1
        ('Parameters', 'GetEndpointsParameters'),
2048 1
               ]
2049 1
2050
    def __init__(self):
2051 1
        self.TypeId = FourByteNodeId(ObjectIds.GetEndpointsRequest_Encoding_DefaultBinary)
2052 1
        self.RequestHeader = RequestHeader()
2053
        self.Parameters = GetEndpointsParameters()
2054 1
        self._freeze = True
2055
2056 1
    def to_binary(self):
2057
        packet = []
2058 1
        packet.append(self.TypeId.to_binary())
2059
        packet.append(self.RequestHeader.to_binary())
2060 1
        packet.append(self.Parameters.to_binary())
2061 1
        return b''.join(packet)
2062 1
2063 1
    @staticmethod
2064
    def from_binary(data):
2065 1
        obj = GetEndpointsRequest()
2066
        obj.TypeId = NodeId.from_binary(data)
2067
        obj.RequestHeader = RequestHeader.from_binary(data)
2068
        obj.Parameters = GetEndpointsParameters.from_binary(data)
2069
        return obj
2070 1
2071
    def __str__(self):
2072
        return 'GetEndpointsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2073 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2074
               'Parameters:' + str(self.Parameters) + ')'
2075
2076
    __repr__ = __str__
2077
2078
2079
class GetEndpointsResponse(FrozenClass):
2080
    '''
2081
    Gets the endpoints used by the server.
2082
2083
    :ivar TypeId:
2084
    :vartype TypeId: NodeId
2085 1
    :ivar ResponseHeader:
2086
    :vartype ResponseHeader: ResponseHeader
2087
    :ivar Endpoints:
2088
    :vartype Endpoints: EndpointDescription
2089
    '''
2090
2091 1
    ua_types = [
2092 1
        ('TypeId', 'NodeId'),
2093
        ('ResponseHeader', 'ResponseHeader'),
2094
        ('Endpoints', 'ListOfEndpointDescription'),
2095
               ]
2096 1
2097 1
    def __init__(self):
2098 1
        self.TypeId = FourByteNodeId(ObjectIds.GetEndpointsResponse_Encoding_DefaultBinary)
2099 1
        self.ResponseHeader = ResponseHeader()
2100
        self.Endpoints = []
2101 1
        self._freeze = True
2102 1
2103 1
    def to_binary(self):
2104 1
        packet = []
2105 1
        packet.append(self.TypeId.to_binary())
2106 1
        packet.append(self.ResponseHeader.to_binary())
2107
        packet.append(uabin.Primitives.Int32.pack(len(self.Endpoints)))
2108 1
        for fieldname in self.Endpoints:
2109
            packet.append(fieldname.to_binary())
2110
        return b''.join(packet)
2111
2112 1
    @staticmethod
2113
    def from_binary(data):
2114
        obj = GetEndpointsResponse()
2115
        obj.TypeId = NodeId.from_binary(data)
2116
        obj.ResponseHeader = ResponseHeader.from_binary(data)
2117 1
        length = uabin.Primitives.Int32.unpack(data)
2118
        array = []
2119
        if length != -1:
2120
            for _ in range(0, length):
2121
                array.append(EndpointDescription.from_binary(data))
2122 1
        obj.Endpoints = array
2123
        return obj
2124
2125 1
    def __str__(self):
2126
        return 'GetEndpointsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2127
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
2128
               'Endpoints:' + str(self.Endpoints) + ')'
2129
2130
    __repr__ = __str__
2131
2132
2133
class RegisteredServer(FrozenClass):
2134
    '''
2135
    The information required to register a server with a discovery server.
2136
2137 1
    :ivar ServerUri:
2138
    :vartype ServerUri: String
2139
    :ivar ProductUri:
2140
    :vartype ProductUri: String
2141
    :ivar ServerNames:
2142
    :vartype ServerNames: LocalizedText
2143 1
    :ivar ServerType:
2144 1
    :vartype ServerType: ApplicationType
2145 1
    :ivar GatewayServerUri:
2146 1
    :vartype GatewayServerUri: String
2147 1
    :ivar DiscoveryUrls:
2148 1
    :vartype DiscoveryUrls: String
2149 1
    :ivar SemaphoreFilePath:
2150 1
    :vartype SemaphoreFilePath: String
2151 1
    :ivar IsOnline:
2152
    :vartype IsOnline: Boolean
2153 1
    '''
2154 1
2155 1
    ua_types = [
2156 1
        ('ServerUri', 'String'),
2157 1
        ('ProductUri', 'String'),
2158 1
        ('ServerNames', 'ListOfLocalizedText'),
2159 1
        ('ServerType', 'ApplicationType'),
2160 1
        ('GatewayServerUri', 'String'),
2161
        ('DiscoveryUrls', 'ListOfString'),
2162 1 View Code Duplication
        ('SemaphoreFilePath', 'String'),
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2163
        ('IsOnline', 'Boolean'),
2164 1
               ]
2165
2166 1
    def __init__(self):
2167 1
        self.ServerUri = None
2168 1
        self.ProductUri = None
2169 1
        self.ServerNames = []
2170 1
        self.ServerType = ApplicationType(0)
2171 1
        self.GatewayServerUri = None
2172 1
        self.DiscoveryUrls = []
2173 1
        self.SemaphoreFilePath = None
2174 1
        self.IsOnline = True
2175
        self._freeze = True
2176 1
2177
    def to_binary(self):
2178
        packet = []
2179
        packet.append(uabin.Primitives.String.pack(self.ServerUri))
2180
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
2181 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerNames)))
2182
        for fieldname in self.ServerNames:
2183
            packet.append(fieldname.to_binary())
2184 1
        packet.append(uabin.Primitives.UInt32.pack(self.ServerType.value))
2185
        packet.append(uabin.Primitives.String.pack(self.GatewayServerUri))
2186
        packet.append(uabin.Primitives.Int32.pack(len(self.DiscoveryUrls)))
2187
        for fieldname in self.DiscoveryUrls:
2188
            packet.append(uabin.Primitives.String.pack(fieldname))
2189
        packet.append(uabin.Primitives.String.pack(self.SemaphoreFilePath))
2190
        packet.append(uabin.Primitives.Boolean.pack(self.IsOnline))
2191
        return b''.join(packet)
2192
2193
    @staticmethod
2194
    def from_binary(data):
2195
        obj = RegisteredServer()
2196
        self.ServerUri = uabin.Primitives.String.unpack(data)
2197
        self.ProductUri = uabin.Primitives.String.unpack(data)
2198
        length = uabin.Primitives.Int32.unpack(data)
2199
        array = []
2200
        if length != -1:
2201
            for _ in range(0, length):
2202
                array.append(LocalizedText.from_binary(data))
2203
        obj.ServerNames = array
2204
        self.ServerType = ApplicationType(uabin.Primitives.UInt32.unpack(data))
2205
        self.GatewayServerUri = uabin.Primitives.String.unpack(data)
2206 1
        obj.DiscoveryUrls = uabin.Primitives.String.unpack_array(data)
2207
        self.SemaphoreFilePath = uabin.Primitives.String.unpack(data)
2208
        self.IsOnline = uabin.Primitives.Boolean.unpack(data)
2209
        return obj
2210
2211
    def __str__(self):
2212
        return 'RegisteredServer(' + 'ServerUri:' + str(self.ServerUri) + ', ' + \
2213
               'ProductUri:' + str(self.ProductUri) + ', ' + \
2214
               'ServerNames:' + str(self.ServerNames) + ', ' + \
2215
               'ServerType:' + str(self.ServerType) + ', ' + \
2216
               'GatewayServerUri:' + str(self.GatewayServerUri) + ', ' + \
2217 1
               'DiscoveryUrls:' + str(self.DiscoveryUrls) + ', ' + \
2218 1
               'SemaphoreFilePath:' + str(self.SemaphoreFilePath) + ', ' + \
2219 1
               'IsOnline:' + str(self.IsOnline) + ')'
2220 1
2221 1
    __repr__ = __str__
2222 1
2223 1
2224 1
class RegisterServerRequest(FrozenClass):
2225 1
    '''
2226 1
    Registers a server with the discovery server.
2227 1
2228 1
    :ivar TypeId:
2229 1
    :vartype TypeId: NodeId
2230 1
    :ivar RequestHeader:
2231
    :vartype RequestHeader: RequestHeader
2232 1
    :ivar Server:
2233 1
    :vartype Server: RegisteredServer
2234 1
    '''
2235 1
2236 1
    ua_types = [
2237 1
        ('TypeId', 'NodeId'),
2238 1
        ('RequestHeader', 'RequestHeader'),
2239 1
        ('Server', 'RegisteredServer'),
2240 1
               ]
2241 1
2242 1
    def __init__(self):
2243 1
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServerRequest_Encoding_DefaultBinary)
2244 1
        self.RequestHeader = RequestHeader()
2245 1
        self.Server = RegisteredServer()
2246 1
        self._freeze = True
2247
2248 1
    def to_binary(self):
2249
        packet = []
2250 1
        packet.append(self.TypeId.to_binary())
2251
        packet.append(self.RequestHeader.to_binary())
2252 1
        packet.append(self.Server.to_binary())
2253 1
        return b''.join(packet)
2254 1
2255 1
    @staticmethod
2256 1
    def from_binary(data):
2257 1
        obj = RegisterServerRequest()
2258 1
        obj.TypeId = NodeId.from_binary(data)
2259 1
        obj.RequestHeader = RequestHeader.from_binary(data)
2260 1
        obj.Server = RegisteredServer.from_binary(data)
2261 1
        return obj
2262 1
2263 1
    def __str__(self):
2264 1
        return 'RegisterServerRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2265 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2266
               'Server:' + str(self.Server) + ')'
2267 1
2268
    __repr__ = __str__
2269
2270
2271
class RegisterServerResponse(FrozenClass):
2272
    '''
2273
    Registers a server with the discovery server.
2274
2275
    :ivar TypeId:
2276
    :vartype TypeId: NodeId
2277 1
    :ivar ResponseHeader:
2278
    :vartype ResponseHeader: ResponseHeader
2279
    '''
2280 1
2281
    ua_types = [
2282
        ('TypeId', 'NodeId'),
2283
        ('ResponseHeader', 'ResponseHeader'),
2284
               ]
2285
2286
    def __init__(self):
2287
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServerResponse_Encoding_DefaultBinary)
2288
        self.ResponseHeader = ResponseHeader()
2289
        self._freeze = True
2290
2291
    def to_binary(self):
2292 1
        packet = []
2293
        packet.append(self.TypeId.to_binary())
2294
        packet.append(self.ResponseHeader.to_binary())
2295
        return b''.join(packet)
2296
2297
    @staticmethod
2298 1
    def from_binary(data):
2299 1
        obj = RegisterServerResponse()
2300
        obj.TypeId = NodeId.from_binary(data)
2301
        obj.ResponseHeader = ResponseHeader.from_binary(data)
2302
        return obj
2303 1
2304 1
    def __str__(self):
2305 1
        return 'RegisterServerResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2306 1
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
2307
2308 1
    __repr__ = __str__
2309 1
2310 1
2311 1
class DiscoveryConfiguration(FrozenClass):
2312 1
    '''
2313 1
    A base type for discovery configuration information.
2314
2315 1
    '''
2316
2317
    ua_types = [
2318
               ]
2319 1
2320
    def __init__(self):
2321
        self._freeze = True
2322
2323
    def to_binary(self):
2324 1
        packet = []
2325
        return b''.join(packet)
2326
2327
    @staticmethod
2328
    def from_binary(data):
2329 1
        obj = DiscoveryConfiguration()
2330
        return obj
2331
2332 1
    def __str__(self):
2333
        return 'DiscoveryConfiguration(' +  + ')'
2334
2335
    __repr__ = __str__
2336
2337
2338
class MdnsDiscoveryConfiguration(FrozenClass):
2339
    '''
2340
    The discovery information needed for mDNS registration.
2341
2342 1
    :ivar MdnsServerName:
2343
    :vartype MdnsServerName: String
2344
    :ivar ServerCapabilities:
2345
    :vartype ServerCapabilities: String
2346
    '''
2347 1
2348 1
    ua_types = [
2349 1
        ('MdnsServerName', 'String'),
2350 1
        ('ServerCapabilities', 'ListOfString'),
2351 1
               ]
2352 1
2353 1
    def __init__(self):
2354 1
        self.MdnsServerName = None
2355
        self.ServerCapabilities = []
2356 1
        self._freeze = True
2357 1
2358 1
    def to_binary(self):
2359 1
        packet = []
2360 1
        packet.append(uabin.Primitives.String.pack(self.MdnsServerName))
2361
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerCapabilities)))
2362 1
        for fieldname in self.ServerCapabilities:
2363
            packet.append(uabin.Primitives.String.pack(fieldname))
2364 1
        return b''.join(packet)
2365
2366 1
    @staticmethod
2367 1
    def from_binary(data):
2368 1
        obj = MdnsDiscoveryConfiguration()
2369
        self.MdnsServerName = uabin.Primitives.String.unpack(data)
2370 1
        obj.ServerCapabilities = uabin.Primitives.String.unpack_array(data)
2371
        return obj
2372
2373
    def __str__(self):
2374 1
        return 'MdnsDiscoveryConfiguration(' + 'MdnsServerName:' + str(self.MdnsServerName) + ', ' + \
2375
               'ServerCapabilities:' + str(self.ServerCapabilities) + ')'
2376
2377 1
    __repr__ = __str__
2378
2379
2380
class RegisterServer2Parameters(FrozenClass):
2381
    '''
2382
    :ivar Server:
2383 1
    :vartype Server: RegisteredServer
2384
    :ivar DiscoveryConfiguration:
2385
    :vartype DiscoveryConfiguration: ExtensionObject
2386 1
    '''
2387
2388
    ua_types = [
2389
        ('Server', 'RegisteredServer'),
2390
        ('DiscoveryConfiguration', 'ListOfExtensionObject'),
2391
               ]
2392
2393 1
    def __init__(self):
2394
        self.Server = RegisteredServer()
2395
        self.DiscoveryConfiguration = []
2396
        self._freeze = True
2397 1
2398
    def to_binary(self):
2399
        packet = []
2400
        packet.append(self.Server.to_binary())
2401 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiscoveryConfiguration)))
2402
        for fieldname in self.DiscoveryConfiguration:
2403
            packet.append(uabin.extensionobject_to_binary(fieldname))
2404 1
        return b''.join(packet)
2405
2406
    @staticmethod
2407 1
    def from_binary(data):
2408
        obj = RegisterServer2Parameters()
2409
        obj.Server = RegisteredServer.from_binary(data)
2410 1
        length = uabin.Primitives.Int32.unpack(data)
2411
        array = []
2412
        if length != -1:
2413
            for _ in range(0, length):
2414
                array.append(uabin.extensionobject_from_binary(data))
2415
        obj.DiscoveryConfiguration = array
2416
        return obj
2417
2418
    def __str__(self):
2419
        return 'RegisterServer2Parameters(' + 'Server:' + str(self.Server) + ', ' + \
2420 1
               'DiscoveryConfiguration:' + str(self.DiscoveryConfiguration) + ')'
2421
2422
    __repr__ = __str__
2423
2424
2425 1
class RegisterServer2Request(FrozenClass):
2426
    '''
2427
    :ivar TypeId:
2428
    :vartype TypeId: NodeId
2429
    :ivar RequestHeader:
2430
    :vartype RequestHeader: RequestHeader
2431
    :ivar Parameters:
2432
    :vartype Parameters: RegisterServer2Parameters
2433
    '''
2434 1
2435
    ua_types = [
2436
        ('TypeId', 'NodeId'),
2437
        ('RequestHeader', 'RequestHeader'),
2438
        ('Parameters', 'RegisterServer2Parameters'),
2439
               ]
2440
2441
    def __init__(self):
2442 1
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServer2Request_Encoding_DefaultBinary)
2443
        self.RequestHeader = RequestHeader()
2444
        self.Parameters = RegisterServer2Parameters()
2445
        self._freeze = True
2446 1
2447
    def to_binary(self):
2448
        packet = []
2449
        packet.append(self.TypeId.to_binary())
2450 1
        packet.append(self.RequestHeader.to_binary())
2451
        packet.append(self.Parameters.to_binary())
2452
        return b''.join(packet)
2453
2454 1
    @staticmethod
2455
    def from_binary(data):
2456
        obj = RegisterServer2Request()
2457 1
        obj.TypeId = NodeId.from_binary(data)
2458
        obj.RequestHeader = RequestHeader.from_binary(data)
2459
        obj.Parameters = RegisterServer2Parameters.from_binary(data)
2460
        return obj
2461
2462
    def __str__(self):
2463
        return 'RegisterServer2Request(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2464
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2465 1
               'Parameters:' + str(self.Parameters) + ')'
2466
2467
    __repr__ = __str__
2468
2469
2470 1
class RegisterServer2Response(FrozenClass):
2471
    '''
2472
    :ivar TypeId:
2473
    :vartype TypeId: NodeId
2474
    :ivar ResponseHeader:
2475
    :vartype ResponseHeader: ResponseHeader
2476
    :ivar ConfigurationResults:
2477
    :vartype ConfigurationResults: StatusCode
2478
    :ivar DiagnosticInfos:
2479 1
    :vartype DiagnosticInfos: DiagnosticInfo
2480
    '''
2481
2482
    ua_types = [
2483
        ('TypeId', 'NodeId'),
2484
        ('ResponseHeader', 'ResponseHeader'),
2485
        ('ConfigurationResults', 'ListOfStatusCode'),
2486
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
2487 1
               ]
2488
2489
    def __init__(self):
2490
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServer2Response_Encoding_DefaultBinary)
2491 1
        self.ResponseHeader = ResponseHeader()
2492
        self.ConfigurationResults = []
2493
        self.DiagnosticInfos = []
2494
        self._freeze = True
2495
2496
    def to_binary(self):
2497
        packet = []
2498
        packet.append(self.TypeId.to_binary())
2499
        packet.append(self.ResponseHeader.to_binary())
2500 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ConfigurationResults)))
2501
        for fieldname in self.ConfigurationResults:
2502
            packet.append(fieldname.to_binary())
2503
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
2504 1
        for fieldname in self.DiagnosticInfos:
2505
            packet.append(fieldname.to_binary())
2506
        return b''.join(packet)
2507 1
2508
    @staticmethod
2509
    def from_binary(data):
2510
        obj = RegisterServer2Response()
2511
        obj.TypeId = NodeId.from_binary(data)
2512
        obj.ResponseHeader = ResponseHeader.from_binary(data)
2513
        length = uabin.Primitives.Int32.unpack(data)
2514
        array = []
2515
        if length != -1:
2516
            for _ in range(0, length):
2517 1
                array.append(StatusCode.from_binary(data))
2518
        obj.ConfigurationResults = array
2519
        length = uabin.Primitives.Int32.unpack(data)
2520
        array = []
2521
        if length != -1:
2522
            for _ in range(0, length):
2523 1
                array.append(DiagnosticInfo.from_binary(data))
2524 View Code Duplication
        obj.DiagnosticInfos = array
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2525
        return obj
2526
2527
    def __str__(self):
2528
        return 'RegisterServer2Response(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2529
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
2530
               'ConfigurationResults:' + str(self.ConfigurationResults) + ', ' + \
2531
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
2532
2533 1
    __repr__ = __str__
2534
2535
2536
class ChannelSecurityToken(FrozenClass):
2537
    '''
2538
    The token that identifies a set of keys for an active secure channel.
2539
2540 1
    :ivar ChannelId:
2541
    :vartype ChannelId: UInt32
2542
    :ivar TokenId:
2543
    :vartype TokenId: UInt32
2544 1
    :ivar CreatedAt:
2545
    :vartype CreatedAt: DateTime
2546
    :ivar RevisedLifetime:
2547
    :vartype RevisedLifetime: UInt32
2548
    '''
2549 1
2550
    ua_types = [
2551
        ('ChannelId', 'UInt32'),
2552
        ('TokenId', 'UInt32'),
2553
        ('CreatedAt', 'DateTime'),
2554 1
        ('RevisedLifetime', 'UInt32'),
2555
               ]
2556
2557 1
    def __init__(self):
2558
        self.ChannelId = 0
2559
        self.TokenId = 0
2560
        self.CreatedAt = datetime.utcnow()
2561
        self.RevisedLifetime = 0
2562
        self._freeze = True
2563
2564
    def to_binary(self):
2565
        packet = []
2566
        packet.append(uabin.Primitives.UInt32.pack(self.ChannelId))
2567 View Code Duplication
        packet.append(uabin.Primitives.UInt32.pack(self.TokenId))
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2568
        packet.append(uabin.Primitives.DateTime.pack(self.CreatedAt))
2569 1
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedLifetime))
2570
        return b''.join(packet)
2571
2572
    @staticmethod
2573
    def from_binary(data):
2574
        obj = ChannelSecurityToken()
2575
        self.ChannelId = uabin.Primitives.UInt32.unpack(data)
2576 1
        self.TokenId = uabin.Primitives.UInt32.unpack(data)
2577
        self.CreatedAt = uabin.Primitives.DateTime.unpack(data)
2578
        self.RevisedLifetime = uabin.Primitives.UInt32.unpack(data)
2579
        return obj
2580
2581
    def __str__(self):
2582
        return 'ChannelSecurityToken(' + 'ChannelId:' + str(self.ChannelId) + ', ' + \
2583
               'TokenId:' + str(self.TokenId) + ', ' + \
2584
               'CreatedAt:' + str(self.CreatedAt) + ', ' + \
2585
               'RevisedLifetime:' + str(self.RevisedLifetime) + ')'
2586
2587 1
    __repr__ = __str__
2588
2589
2590
class OpenSecureChannelParameters(FrozenClass):
2591
    '''
2592
    :ivar ClientProtocolVersion:
2593
    :vartype ClientProtocolVersion: UInt32
2594
    :ivar RequestType:
2595
    :vartype RequestType: SecurityTokenRequestType
2596
    :ivar SecurityMode:
2597
    :vartype SecurityMode: MessageSecurityMode
2598
    :ivar ClientNonce:
2599 1
    :vartype ClientNonce: ByteString
2600
    :ivar RequestedLifetime:
2601
    :vartype RequestedLifetime: UInt32
2602
    '''
2603 1
2604
    ua_types = [
2605
        ('ClientProtocolVersion', 'UInt32'),
2606
        ('RequestType', 'SecurityTokenRequestType'),
2607
        ('SecurityMode', 'MessageSecurityMode'),
2608
        ('ClientNonce', 'ByteString'),
2609
        ('RequestedLifetime', 'UInt32'),
2610
               ]
2611
2612
    def __init__(self):
2613
        self.ClientProtocolVersion = 0
2614
        self.RequestType = SecurityTokenRequestType(0)
2615
        self.SecurityMode = MessageSecurityMode(0)
2616
        self.ClientNonce = None
2617
        self.RequestedLifetime = 0
2618
        self._freeze = True
2619 1
2620
    def to_binary(self):
2621
        packet = []
2622
        packet.append(uabin.Primitives.UInt32.pack(self.ClientProtocolVersion))
2623
        packet.append(uabin.Primitives.UInt32.pack(self.RequestType.value))
2624
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityMode.value))
2625 1
        packet.append(uabin.Primitives.ByteString.pack(self.ClientNonce))
2626
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedLifetime))
2627
        return b''.join(packet)
2628 1
2629
    @staticmethod
2630
    def from_binary(data):
2631
        obj = OpenSecureChannelParameters()
2632
        self.ClientProtocolVersion = uabin.Primitives.UInt32.unpack(data)
2633
        self.RequestType = SecurityTokenRequestType(uabin.Primitives.UInt32.unpack(data))
2634
        self.SecurityMode = MessageSecurityMode(uabin.Primitives.UInt32.unpack(data))
2635
        self.ClientNonce = uabin.Primitives.ByteString.unpack(data)
2636
        self.RequestedLifetime = uabin.Primitives.UInt32.unpack(data)
2637
        return obj
2638
2639
    def __str__(self):
2640
        return 'OpenSecureChannelParameters(' + 'ClientProtocolVersion:' + str(self.ClientProtocolVersion) + ', ' + \
2641
               'RequestType:' + str(self.RequestType) + ', ' + \
2642 1
               'SecurityMode:' + str(self.SecurityMode) + ', ' + \
2643
               'ClientNonce:' + str(self.ClientNonce) + ', ' + \
2644
               'RequestedLifetime:' + str(self.RequestedLifetime) + ')'
2645
2646
    __repr__ = __str__
2647
2648
2649 1
class OpenSecureChannelRequest(FrozenClass):
2650 1
    '''
2651 1
    Creates a secure channel with a server.
2652 1
2653 1
    :ivar TypeId:
2654 1
    :vartype TypeId: NodeId
2655 1
    :ivar RequestHeader:
2656 1
    :vartype RequestHeader: RequestHeader
2657 1
    :ivar Parameters:
2658 1
    :vartype Parameters: OpenSecureChannelParameters
2659
    '''
2660 1
2661 1
    ua_types = [
2662 1
        ('TypeId', 'NodeId'),
2663 1
        ('RequestHeader', 'RequestHeader'),
2664 1
        ('Parameters', 'OpenSecureChannelParameters'),
2665 1
               ]
2666 1
2667
    def __init__(self):
2668 1
        self.TypeId = FourByteNodeId(ObjectIds.OpenSecureChannelRequest_Encoding_DefaultBinary)
2669
        self.RequestHeader = RequestHeader()
2670 1
        self.Parameters = OpenSecureChannelParameters()
2671
        self._freeze = True
2672 1
2673 1
    def to_binary(self):
2674 1
        packet = []
2675 1
        packet.append(self.TypeId.to_binary())
2676 1
        packet.append(self.RequestHeader.to_binary())
2677
        packet.append(self.Parameters.to_binary())
2678 1
        return b''.join(packet)
2679
2680
    @staticmethod
2681
    def from_binary(data):
2682
        obj = OpenSecureChannelRequest()
2683
        obj.TypeId = NodeId.from_binary(data)
2684 1
        obj.RequestHeader = RequestHeader.from_binary(data)
2685
        obj.Parameters = OpenSecureChannelParameters.from_binary(data)
2686
        return obj
2687 1
2688
    def __str__(self):
2689
        return 'OpenSecureChannelRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2690
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2691
               'Parameters:' + str(self.Parameters) + ')'
2692
2693
    __repr__ = __str__
2694
2695
2696
class OpenSecureChannelResult(FrozenClass):
2697
    '''
2698
    :ivar ServerProtocolVersion:
2699
    :vartype ServerProtocolVersion: UInt32
2700
    :ivar SecurityToken:
2701 1
    :vartype SecurityToken: ChannelSecurityToken
2702
    :ivar ServerNonce:
2703
    :vartype ServerNonce: ByteString
2704
    '''
2705
2706
    ua_types = [
2707
        ('ServerProtocolVersion', 'UInt32'),
2708
        ('SecurityToken', 'ChannelSecurityToken'),
2709 1
        ('ServerNonce', 'ByteString'),
2710 1
               ]
2711 1
2712 1
    def __init__(self):
2713 1
        self.ServerProtocolVersion = 0
2714 1
        self.SecurityToken = ChannelSecurityToken()
2715 1
        self.ServerNonce = None
2716 1
        self._freeze = True
2717 1
2718 1
    def to_binary(self):
2719 1
        packet = []
2720
        packet.append(uabin.Primitives.UInt32.pack(self.ServerProtocolVersion))
2721 1
        packet.append(self.SecurityToken.to_binary())
2722 1
        packet.append(uabin.Primitives.ByteString.pack(self.ServerNonce))
2723 1
        return b''.join(packet)
2724 1
2725 1
    @staticmethod
2726 1
    def from_binary(data):
2727 1
        obj = OpenSecureChannelResult()
2728 1
        self.ServerProtocolVersion = uabin.Primitives.UInt32.unpack(data)
2729
        obj.SecurityToken = ChannelSecurityToken.from_binary(data)
2730 1
        self.ServerNonce = uabin.Primitives.ByteString.unpack(data)
2731
        return obj
2732 1
2733
    def __str__(self):
2734 1
        return 'OpenSecureChannelResult(' + 'ServerProtocolVersion:' + str(self.ServerProtocolVersion) + ', ' + \
2735 1
               'SecurityToken:' + str(self.SecurityToken) + ', ' + \
2736 1
               'ServerNonce:' + str(self.ServerNonce) + ')'
2737 1
2738 1
    __repr__ = __str__
2739 1
2740
2741 1
class OpenSecureChannelResponse(FrozenClass):
2742
    '''
2743
    Creates a secure channel with a server.
2744
2745
    :ivar TypeId:
2746
    :vartype TypeId: NodeId
2747
    :ivar ResponseHeader:
2748 1
    :vartype ResponseHeader: ResponseHeader
2749
    :ivar Parameters:
2750
    :vartype Parameters: OpenSecureChannelResult
2751 1
    '''
2752
2753
    ua_types = [
2754
        ('TypeId', 'NodeId'),
2755
        ('ResponseHeader', 'ResponseHeader'),
2756
        ('Parameters', 'OpenSecureChannelResult'),
2757
               ]
2758
2759
    def __init__(self):
2760
        self.TypeId = FourByteNodeId(ObjectIds.OpenSecureChannelResponse_Encoding_DefaultBinary)
2761
        self.ResponseHeader = ResponseHeader()
2762
        self.Parameters = OpenSecureChannelResult()
2763 1
        self._freeze = True
2764
2765
    def to_binary(self):
2766
        packet = []
2767
        packet.append(self.TypeId.to_binary())
2768
        packet.append(self.ResponseHeader.to_binary())
2769 1
        packet.append(self.Parameters.to_binary())
2770 1
        return b''.join(packet)
2771 1
2772 1
    @staticmethod
2773 1
    def from_binary(data):
2774 1
        obj = OpenSecureChannelResponse()
2775 1
        obj.TypeId = NodeId.from_binary(data)
2776 1
        obj.ResponseHeader = ResponseHeader.from_binary(data)
2777 1
        obj.Parameters = OpenSecureChannelResult.from_binary(data)
2778
        return obj
2779 1
2780 1
    def __str__(self):
2781 1
        return 'OpenSecureChannelResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2782 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
2783 1
               'Parameters:' + str(self.Parameters) + ')'
2784 1
2785
    __repr__ = __str__
2786 1
2787
2788 1
class CloseSecureChannelRequest(FrozenClass):
2789
    '''
2790 1
    Closes a secure channel.
2791 1
2792 1
    :ivar TypeId:
2793 1
    :vartype TypeId: NodeId
2794
    :ivar RequestHeader:
2795 1
    :vartype RequestHeader: RequestHeader
2796
    '''
2797
2798
    ua_types = [
2799
        ('TypeId', 'NodeId'),
2800 1
        ('RequestHeader', 'RequestHeader'),
2801
               ]
2802
2803 1
    def __init__(self):
2804
        self.TypeId = FourByteNodeId(ObjectIds.CloseSecureChannelRequest_Encoding_DefaultBinary)
2805
        self.RequestHeader = RequestHeader()
2806
        self._freeze = True
2807
2808
    def to_binary(self):
2809
        packet = []
2810
        packet.append(self.TypeId.to_binary())
2811
        packet.append(self.RequestHeader.to_binary())
2812
        return b''.join(packet)
2813 1
2814
    @staticmethod
2815
    def from_binary(data):
2816
        obj = CloseSecureChannelRequest()
2817
        obj.TypeId = NodeId.from_binary(data)
2818
        obj.RequestHeader = RequestHeader.from_binary(data)
2819 1
        return obj
2820 1
2821 1
    def __str__(self):
2822 1
        return 'CloseSecureChannelRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2823 1
               'RequestHeader:' + str(self.RequestHeader) + ')'
2824 1
2825 1
    __repr__ = __str__
2826 1
2827 1
2828
class CloseSecureChannelResponse(FrozenClass):
2829 1
    '''
2830 1
    Closes a secure channel.
2831 1
2832 1
    :ivar TypeId:
2833 1
    :vartype TypeId: NodeId
2834 1
    :ivar ResponseHeader:
2835
    :vartype ResponseHeader: ResponseHeader
2836 1
    '''
2837
2838 1
    ua_types = [
2839
        ('TypeId', 'NodeId'),
2840 1
        ('ResponseHeader', 'ResponseHeader'),
2841 1
               ]
2842 1
2843 1
    def __init__(self):
2844
        self.TypeId = FourByteNodeId(ObjectIds.CloseSecureChannelResponse_Encoding_DefaultBinary)
2845 1
        self.ResponseHeader = ResponseHeader()
2846
        self._freeze = True
2847
2848
    def to_binary(self):
2849
        packet = []
2850 1
        packet.append(self.TypeId.to_binary())
2851
        packet.append(self.ResponseHeader.to_binary())
2852
        return b''.join(packet)
2853 1
2854
    @staticmethod
2855
    def from_binary(data):
2856
        obj = CloseSecureChannelResponse()
2857
        obj.TypeId = NodeId.from_binary(data)
2858
        obj.ResponseHeader = ResponseHeader.from_binary(data)
2859
        return obj
2860
2861
    def __str__(self):
2862
        return 'CloseSecureChannelResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2863
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
2864
2865 1
    __repr__ = __str__
2866
2867
2868
class SignedSoftwareCertificate(FrozenClass):
2869
    '''
2870
    A software certificate with a digital signature.
2871 1
2872 1
    :ivar CertificateData:
2873 1
    :vartype CertificateData: ByteString
2874 1
    :ivar Signature:
2875 1
    :vartype Signature: ByteString
2876 1
    '''
2877 1
2878 1
    ua_types = [
2879 1
        ('CertificateData', 'ByteString'),
2880
        ('Signature', 'ByteString'),
2881 1
               ]
2882 1
2883 1
    def __init__(self):
2884 1
        self.CertificateData = None
2885 1
        self.Signature = None
2886 1
        self._freeze = True
2887
2888 1
    def to_binary(self):
2889 View Code Duplication
        packet = []
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2890 1
        packet.append(uabin.Primitives.ByteString.pack(self.CertificateData))
2891
        packet.append(uabin.Primitives.ByteString.pack(self.Signature))
2892 1
        return b''.join(packet)
2893 1
2894 1
    @staticmethod
2895 1
    def from_binary(data):
2896
        obj = SignedSoftwareCertificate()
2897 1
        self.CertificateData = uabin.Primitives.ByteString.unpack(data)
2898
        self.Signature = uabin.Primitives.ByteString.unpack(data)
2899
        return obj
2900
2901
    def __str__(self):
2902 1
        return 'SignedSoftwareCertificate(' + 'CertificateData:' + str(self.CertificateData) + ', ' + \
2903
               'Signature:' + str(self.Signature) + ')'
2904
2905 1
    __repr__ = __str__
2906
2907
2908
class SignatureData(FrozenClass):
2909
    '''
2910
    A digital signature.
2911
2912
    :ivar Algorithm:
2913
    :vartype Algorithm: String
2914
    :ivar Signature:
2915 1
    :vartype Signature: ByteString
2916
    '''
2917
2918
    ua_types = [
2919
        ('Algorithm', 'String'),
2920 1
        ('Signature', 'ByteString'),
2921 1
               ]
2922
2923
    def __init__(self):
2924
        self.Algorithm = None
2925 1
        self.Signature = None
2926 1
        self._freeze = True
2927 1
2928
    def to_binary(self):
2929 1
        packet = []
2930 1
        packet.append(uabin.Primitives.String.pack(self.Algorithm))
2931 1
        packet.append(uabin.Primitives.ByteString.pack(self.Signature))
2932 1
        return b''.join(packet)
2933 1
2934
    @staticmethod
2935 1
    def from_binary(data):
2936
        obj = SignatureData()
2937
        self.Algorithm = uabin.Primitives.String.unpack(data)
2938
        self.Signature = uabin.Primitives.ByteString.unpack(data)
2939 1
        return obj
2940
2941
    def __str__(self):
2942
        return 'SignatureData(' + 'Algorithm:' + str(self.Algorithm) + ', ' + \
2943 1
               'Signature:' + str(self.Signature) + ')'
2944
2945
    __repr__ = __str__
2946
2947 1
2948
class CreateSessionParameters(FrozenClass):
2949
    '''
2950 1
    :ivar ClientDescription:
2951
    :vartype ClientDescription: ApplicationDescription
2952
    :ivar ServerUri:
2953
    :vartype ServerUri: String
2954
    :ivar EndpointUrl:
2955
    :vartype EndpointUrl: String
2956
    :ivar SessionName:
2957
    :vartype SessionName: String
2958
    :ivar ClientNonce:
2959
    :vartype ClientNonce: ByteString
2960 1
    :ivar ClientCertificate:
2961
    :vartype ClientCertificate: ByteString
2962
    :ivar RequestedSessionTimeout:
2963
    :vartype RequestedSessionTimeout: Double
2964
    :ivar MaxResponseMessageSize:
2965 1
    :vartype MaxResponseMessageSize: UInt32
2966
    '''
2967
2968
    ua_types = [
2969
        ('ClientDescription', 'ApplicationDescription'),
2970
        ('ServerUri', 'String'),
2971
        ('EndpointUrl', 'String'),
2972
        ('SessionName', 'String'),
2973
        ('ClientNonce', 'ByteString'),
2974 1
        ('ClientCertificate', 'ByteString'),
2975
        ('RequestedSessionTimeout', 'Double'),
2976
        ('MaxResponseMessageSize', 'UInt32'),
2977
               ]
2978
2979
    def __init__(self):
2980 1
        self.ClientDescription = ApplicationDescription()
2981
        self.ServerUri = None
2982
        self.EndpointUrl = None
2983
        self.SessionName = None
2984 1
        self.ClientNonce = None
2985
        self.ClientCertificate = None
2986
        self.RequestedSessionTimeout = 0
2987
        self.MaxResponseMessageSize = 0
2988 1
        self._freeze = True
2989
2990
    def to_binary(self):
2991
        packet = []
2992 1
        packet.append(self.ClientDescription.to_binary())
2993
        packet.append(uabin.Primitives.String.pack(self.ServerUri))
2994
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
2995 1
        packet.append(uabin.Primitives.String.pack(self.SessionName))
2996
        packet.append(uabin.Primitives.ByteString.pack(self.ClientNonce))
2997
        packet.append(uabin.Primitives.ByteString.pack(self.ClientCertificate))
2998
        packet.append(uabin.Primitives.Double.pack(self.RequestedSessionTimeout))
2999
        packet.append(uabin.Primitives.UInt32.pack(self.MaxResponseMessageSize))
3000
        return b''.join(packet)
3001
3002
    @staticmethod
3003
    def from_binary(data):
3004
        obj = CreateSessionParameters()
3005 1
        obj.ClientDescription = ApplicationDescription.from_binary(data)
3006
        self.ServerUri = uabin.Primitives.String.unpack(data)
3007
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
3008
        self.SessionName = uabin.Primitives.String.unpack(data)
3009
        self.ClientNonce = uabin.Primitives.ByteString.unpack(data)
3010 1
        self.ClientCertificate = uabin.Primitives.ByteString.unpack(data)
3011
        self.RequestedSessionTimeout = uabin.Primitives.Double.unpack(data)
3012
        self.MaxResponseMessageSize = uabin.Primitives.UInt32.unpack(data)
3013
        return obj
3014
3015
    def __str__(self):
3016
        return 'CreateSessionParameters(' + 'ClientDescription:' + str(self.ClientDescription) + ', ' + \
3017
               'ServerUri:' + str(self.ServerUri) + ', ' + \
3018
               'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
3019 1
               'SessionName:' + str(self.SessionName) + ', ' + \
3020
               'ClientNonce:' + str(self.ClientNonce) + ', ' + \
3021
               'ClientCertificate:' + str(self.ClientCertificate) + ', ' + \
3022
               'RequestedSessionTimeout:' + str(self.RequestedSessionTimeout) + ', ' + \
3023
               'MaxResponseMessageSize:' + str(self.MaxResponseMessageSize) + ')'
3024
3025 1
    __repr__ = __str__
3026
3027
3028
class CreateSessionRequest(FrozenClass):
3029 1
    '''
3030
    Creates a new session with the server.
3031
3032
    :ivar TypeId:
3033 1
    :vartype TypeId: NodeId
3034
    :ivar RequestHeader:
3035
    :vartype RequestHeader: RequestHeader
3036
    :ivar Parameters:
3037 1
    :vartype Parameters: CreateSessionParameters
3038
    '''
3039
3040 1
    ua_types = [
3041
        ('TypeId', 'NodeId'),
3042
        ('RequestHeader', 'RequestHeader'),
3043
        ('Parameters', 'CreateSessionParameters'),
3044
               ]
3045
3046
    def __init__(self):
3047
        self.TypeId = FourByteNodeId(ObjectIds.CreateSessionRequest_Encoding_DefaultBinary)
3048
        self.RequestHeader = RequestHeader()
3049
        self.Parameters = CreateSessionParameters()
3050 1
        self._freeze = True
3051
3052
    def to_binary(self):
3053
        packet = []
3054
        packet.append(self.TypeId.to_binary())
3055 1
        packet.append(self.RequestHeader.to_binary())
3056 1
        packet.append(self.Parameters.to_binary())
3057 1
        return b''.join(packet)
3058 1
3059 1
    @staticmethod
3060 1
    def from_binary(data):
3061 1
        obj = CreateSessionRequest()
3062 1
        obj.TypeId = NodeId.from_binary(data)
3063
        obj.RequestHeader = RequestHeader.from_binary(data)
3064 1
        obj.Parameters = CreateSessionParameters.from_binary(data)
3065 1
        return obj
3066 1
3067 1
    def __str__(self):
3068 1
        return 'CreateSessionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3069
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
3070 1
               'Parameters:' + str(self.Parameters) + ')'
3071
3072 1
    __repr__ = __str__
3073
3074 1
3075 1
class CreateSessionResult(FrozenClass):
3076 1
    '''
3077
    :ivar SessionId:
3078 1
    :vartype SessionId: NodeId
3079
    :ivar AuthenticationToken:
3080
    :vartype AuthenticationToken: NodeId
3081
    :ivar RevisedSessionTimeout:
3082 1
    :vartype RevisedSessionTimeout: Double
3083
    :ivar ServerNonce:
3084
    :vartype ServerNonce: ByteString
3085 1
    :ivar ServerCertificate:
3086
    :vartype ServerCertificate: ByteString
3087
    :ivar ServerEndpoints:
3088
    :vartype ServerEndpoints: EndpointDescription
3089
    :ivar ServerSoftwareCertificates:
3090
    :vartype ServerSoftwareCertificates: SignedSoftwareCertificate
3091
    :ivar ServerSignature:
3092
    :vartype ServerSignature: SignatureData
3093
    :ivar MaxRequestMessageSize:
3094
    :vartype MaxRequestMessageSize: UInt32
3095
    '''
3096
3097
    ua_types = [
3098
        ('SessionId', 'NodeId'),
3099
        ('AuthenticationToken', 'NodeId'),
3100
        ('RevisedSessionTimeout', 'Double'),
3101
        ('ServerNonce', 'ByteString'),
3102
        ('ServerCertificate', 'ByteString'),
3103
        ('ServerEndpoints', 'ListOfEndpointDescription'),
3104
        ('ServerSoftwareCertificates', 'ListOfSignedSoftwareCertificate'),
3105 1
        ('ServerSignature', 'SignatureData'),
3106
        ('MaxRequestMessageSize', 'UInt32'),
3107
               ]
3108
3109
    def __init__(self):
3110
        self.SessionId = NodeId()
3111
        self.AuthenticationToken = NodeId()
3112
        self.RevisedSessionTimeout = 0
3113
        self.ServerNonce = None
3114
        self.ServerCertificate = None
3115
        self.ServerEndpoints = []
3116 1
        self.ServerSoftwareCertificates = []
3117 1
        self.ServerSignature = SignatureData()
3118 1
        self.MaxRequestMessageSize = 0
3119 1
        self._freeze = True
3120 1
3121 1
    def to_binary(self):
3122 1
        packet = []
3123 1
        packet.append(self.SessionId.to_binary())
3124 1
        packet.append(self.AuthenticationToken.to_binary())
3125 1
        packet.append(uabin.Primitives.Double.pack(self.RevisedSessionTimeout))
3126 1
        packet.append(uabin.Primitives.ByteString.pack(self.ServerNonce))
3127 1
        packet.append(uabin.Primitives.ByteString.pack(self.ServerCertificate))
3128 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerEndpoints)))
3129 1
        for fieldname in self.ServerEndpoints:
3130
            packet.append(fieldname.to_binary())
3131 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerSoftwareCertificates)))
3132 1
        for fieldname in self.ServerSoftwareCertificates:
3133 1
            packet.append(fieldname.to_binary())
3134 1
        packet.append(self.ServerSignature.to_binary())
3135 1
        packet.append(uabin.Primitives.UInt32.pack(self.MaxRequestMessageSize))
3136 1
        return b''.join(packet)
3137 1
3138 1
    @staticmethod
3139 1
    def from_binary(data):
3140 1
        obj = CreateSessionResult()
3141 1
        obj.SessionId = NodeId.from_binary(data)
3142
        obj.AuthenticationToken = NodeId.from_binary(data)
3143 1
        self.RevisedSessionTimeout = uabin.Primitives.Double.unpack(data)
3144
        self.ServerNonce = uabin.Primitives.ByteString.unpack(data)
3145 1
        self.ServerCertificate = uabin.Primitives.ByteString.unpack(data)
3146
        length = uabin.Primitives.Int32.unpack(data)
3147 1
        array = []
3148 1
        if length != -1:
3149 1
            for _ in range(0, length):
3150 1
                array.append(EndpointDescription.from_binary(data))
3151 1
        obj.ServerEndpoints = array
3152 1
        length = uabin.Primitives.Int32.unpack(data)
3153 1
        array = []
3154 1
        if length != -1:
3155 1
            for _ in range(0, length):
3156
                array.append(SignedSoftwareCertificate.from_binary(data))
3157 1
        obj.ServerSoftwareCertificates = array
3158
        obj.ServerSignature = SignatureData.from_binary(data)
3159
        self.MaxRequestMessageSize = uabin.Primitives.UInt32.unpack(data)
3160
        return obj
3161
3162
    def __str__(self):
3163
        return 'CreateSessionResult(' + 'SessionId:' + str(self.SessionId) + ', ' + \
3164
               'AuthenticationToken:' + str(self.AuthenticationToken) + ', ' + \
3165
               'RevisedSessionTimeout:' + str(self.RevisedSessionTimeout) + ', ' + \
3166
               'ServerNonce:' + str(self.ServerNonce) + ', ' + \
3167 1
               'ServerCertificate:' + str(self.ServerCertificate) + ', ' + \
3168
               'ServerEndpoints:' + str(self.ServerEndpoints) + ', ' + \
3169
               'ServerSoftwareCertificates:' + str(self.ServerSoftwareCertificates) + ', ' + \
3170 1
               'ServerSignature:' + str(self.ServerSignature) + ', ' + \
3171
               'MaxRequestMessageSize:' + str(self.MaxRequestMessageSize) + ')'
3172
3173
    __repr__ = __str__
3174
3175
3176
class CreateSessionResponse(FrozenClass):
3177
    '''
3178
    Creates a new session with the server.
3179
3180
    :ivar TypeId:
3181
    :vartype TypeId: NodeId
3182 1
    :ivar ResponseHeader:
3183
    :vartype ResponseHeader: ResponseHeader
3184
    :ivar Parameters:
3185
    :vartype Parameters: CreateSessionResult
3186
    '''
3187
3188 1
    ua_types = [
3189 1
        ('TypeId', 'NodeId'),
3190
        ('ResponseHeader', 'ResponseHeader'),
3191
        ('Parameters', 'CreateSessionResult'),
3192
               ]
3193 1
3194 1
    def __init__(self):
3195 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateSessionResponse_Encoding_DefaultBinary)
3196 1
        self.ResponseHeader = ResponseHeader()
3197
        self.Parameters = CreateSessionResult()
3198 1
        self._freeze = True
3199 1
3200 1
    def to_binary(self):
3201 1
        packet = []
3202 1
        packet.append(self.TypeId.to_binary())
3203 1
        packet.append(self.ResponseHeader.to_binary())
3204
        packet.append(self.Parameters.to_binary())
3205 1
        return b''.join(packet)
3206
3207
    @staticmethod
3208
    def from_binary(data):
3209 1
        obj = CreateSessionResponse()
3210
        obj.TypeId = NodeId.from_binary(data)
3211
        obj.ResponseHeader = ResponseHeader.from_binary(data)
3212
        obj.Parameters = CreateSessionResult.from_binary(data)
3213
        return obj
3214 1
3215
    def __str__(self):
3216
        return 'CreateSessionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3217
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
3218
               'Parameters:' + str(self.Parameters) + ')'
3219 1
3220
    __repr__ = __str__
3221
3222 1
3223
class UserIdentityToken(FrozenClass):
3224
    '''
3225
    A base type for a user identity token.
3226
3227
    :ivar PolicyId:
3228
    :vartype PolicyId: String
3229
    '''
3230
3231
    ua_types = [
3232
        ('PolicyId', 'String'),
3233
               ]
3234
3235
    def __init__(self):
3236
        self.PolicyId = None
3237
        self._freeze = True
3238
3239
    def to_binary(self):
3240
        packet = []
3241
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3242
        return b''.join(packet)
3243
3244 1
    @staticmethod
3245
    def from_binary(data):
3246
        obj = UserIdentityToken()
3247
        self.PolicyId = uabin.Primitives.String.unpack(data)
3248
        return obj
3249
3250
    def __str__(self):
3251
        return 'UserIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ')'
3252
3253
    __repr__ = __str__
3254
3255
3256 1
class AnonymousIdentityToken(FrozenClass):
3257 1
    '''
3258 1
    A token representing an anonymous user.
3259 1
3260 1
    :ivar PolicyId:
3261 1
    :vartype PolicyId: String
3262 1
    '''
3263 1
3264 1
    ua_types = [
3265 1
        ('PolicyId', 'String'),
3266 1
               ]
3267 1
3268 1
    def __init__(self):
3269 1
        self.PolicyId = None
3270 1
        self._freeze = True
3271
3272 1
    def to_binary(self):
3273 1
        packet = []
3274 1
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3275 1
        return b''.join(packet)
3276 1
3277 1
    @staticmethod
3278 1
    def from_binary(data):
3279 1
        obj = AnonymousIdentityToken()
3280 1
        self.PolicyId = uabin.Primitives.String.unpack(data)
3281 1
        return obj
3282 1
3283 1
    def __str__(self):
3284
        return 'AnonymousIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ')'
3285 1
3286 1
    __repr__ = __str__
3287 1
3288
3289 1
class UserNameIdentityToken(FrozenClass):
3290
    '''
3291 1
    A token representing a user identified by a user name and password.
3292
3293 1
    :ivar PolicyId:
3294 1
    :vartype PolicyId: String
3295 1
    :ivar UserName:
3296 1
    :vartype UserName: String
3297 1
    :ivar Password:
3298 1
    :vartype Password: ByteString
3299 1
    :ivar EncryptionAlgorithm:
3300 1
    :vartype EncryptionAlgorithm: String
3301 1
    '''
3302 1
3303 1
    ua_types = [
3304 1
        ('PolicyId', 'String'),
3305 1
        ('UserName', 'String'),
3306 1
        ('Password', 'ByteString'),
3307 1
        ('EncryptionAlgorithm', 'String'),
3308 1
               ]
3309
3310 1
    def __init__(self):
3311 1
        self.PolicyId = None
3312 1
        self.UserName = None
3313
        self.Password = None
3314 1
        self.EncryptionAlgorithm = None
3315
        self._freeze = True
3316
3317
    def to_binary(self):
3318
        packet = []
3319
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3320
        packet.append(uabin.Primitives.String.pack(self.UserName))
3321
        packet.append(uabin.Primitives.ByteString.pack(self.Password))
3322
        packet.append(uabin.Primitives.String.pack(self.EncryptionAlgorithm))
3323
        return b''.join(packet)
3324
3325 1
    @staticmethod
3326
    def from_binary(data):
3327
        obj = UserNameIdentityToken()
3328 1
        self.PolicyId = uabin.Primitives.String.unpack(data)
3329
        self.UserName = uabin.Primitives.String.unpack(data)
3330
        self.Password = uabin.Primitives.ByteString.unpack(data)
3331
        self.EncryptionAlgorithm = uabin.Primitives.String.unpack(data)
3332
        return obj
3333
3334
    def __str__(self):
3335
        return 'UserNameIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3336
               'UserName:' + str(self.UserName) + ', ' + \
3337
               'Password:' + str(self.Password) + ', ' + \
3338
               'EncryptionAlgorithm:' + str(self.EncryptionAlgorithm) + ')'
3339
3340 1
    __repr__ = __str__
3341
3342
3343
class X509IdentityToken(FrozenClass):
3344
    '''
3345
    A token representing a user identified by an X509 certificate.
3346 1
3347 1
    :ivar PolicyId:
3348 1
    :vartype PolicyId: String
3349 1
    :ivar CertificateData:
3350 1
    :vartype CertificateData: ByteString
3351 1
    '''
3352 1
3353 1
    ua_types = [
3354 1
        ('PolicyId', 'String'),
3355
        ('CertificateData', 'ByteString'),
3356 1
               ]
3357 1
3358 1
    def __init__(self):
3359 1
        self.PolicyId = None
3360 1
        self.CertificateData = None
3361 1
        self._freeze = True
3362
3363 1
    def to_binary(self):
3364
        packet = []
3365 1
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3366
        packet.append(uabin.Primitives.ByteString.pack(self.CertificateData))
3367 1
        return b''.join(packet)
3368 1
3369 1
    @staticmethod
3370 1
    def from_binary(data):
3371
        obj = X509IdentityToken()
3372 1
        self.PolicyId = uabin.Primitives.String.unpack(data)
3373
        self.CertificateData = uabin.Primitives.ByteString.unpack(data)
3374
        return obj
3375
3376
    def __str__(self):
3377 1
        return 'X509IdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3378
               'CertificateData:' + str(self.CertificateData) + ')'
3379
3380 1
    __repr__ = __str__
3381
3382
3383
class KerberosIdentityToken(FrozenClass):
3384
    '''
3385
    :ivar PolicyId:
3386
    :vartype PolicyId: String
3387
    :ivar TicketData:
3388 1
    :vartype TicketData: ByteString
3389
    '''
3390
3391
    ua_types = [
3392 1
        ('PolicyId', 'String'),
3393
        ('TicketData', 'ByteString'),
3394
               ]
3395
3396
    def __init__(self):
3397
        self.PolicyId = None
3398
        self.TicketData = None
3399
        self._freeze = True
3400 1
3401
    def to_binary(self):
3402
        packet = []
3403
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3404
        packet.append(uabin.Primitives.ByteString.pack(self.TicketData))
3405 1
        return b''.join(packet)
3406
3407
    @staticmethod
3408
    def from_binary(data):
3409 1
        obj = KerberosIdentityToken()
3410
        self.PolicyId = uabin.Primitives.String.unpack(data)
3411
        self.TicketData = uabin.Primitives.ByteString.unpack(data)
3412 1
        return obj
3413
3414
    def __str__(self):
3415 1
        return 'KerberosIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3416
               'TicketData:' + str(self.TicketData) + ')'
3417
3418 1
    __repr__ = __str__
3419
3420
3421
class IssuedIdentityToken(FrozenClass):
3422
    '''
3423
    A token representing a user identified by a WS-Security XML token.
3424
3425
    :ivar PolicyId:
3426 1
    :vartype PolicyId: String
3427
    :ivar TokenData:
3428
    :vartype TokenData: ByteString
3429
    :ivar EncryptionAlgorithm:
3430 1
    :vartype EncryptionAlgorithm: String
3431 1
    '''
3432 1
3433 1
    ua_types = [
3434 1
        ('PolicyId', 'String'),
3435 1
        ('TokenData', 'ByteString'),
3436 1
        ('EncryptionAlgorithm', 'String'),
3437
               ]
3438 1
3439 1
    def __init__(self):
3440 1
        self.PolicyId = None
3441 1
        self.TokenData = None
3442
        self.EncryptionAlgorithm = None
3443 1
        self._freeze = True
3444
3445 1
    def to_binary(self):
3446
        packet = []
3447 1
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3448 1
        packet.append(uabin.Primitives.ByteString.pack(self.TokenData))
3449
        packet.append(uabin.Primitives.String.pack(self.EncryptionAlgorithm))
3450 1
        return b''.join(packet)
3451
3452
    @staticmethod
3453 1
    def from_binary(data):
3454
        obj = IssuedIdentityToken()
3455
        self.PolicyId = uabin.Primitives.String.unpack(data)
3456 1
        self.TokenData = uabin.Primitives.ByteString.unpack(data)
3457
        self.EncryptionAlgorithm = uabin.Primitives.String.unpack(data)
3458
        return obj
3459
3460
    def __str__(self):
3461
        return 'IssuedIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3462
               'TokenData:' + str(self.TokenData) + ', ' + \
3463
               'EncryptionAlgorithm:' + str(self.EncryptionAlgorithm) + ')'
3464
3465
    __repr__ = __str__
3466
3467
3468
class ActivateSessionParameters(FrozenClass):
3469
    '''
3470 1
    :ivar ClientSignature:
3471
    :vartype ClientSignature: SignatureData
3472
    :ivar ClientSoftwareCertificates:
3473
    :vartype ClientSoftwareCertificates: SignedSoftwareCertificate
3474
    :ivar LocaleIds:
3475
    :vartype LocaleIds: String
3476
    :ivar UserIdentityToken:
3477 1
    :vartype UserIdentityToken: ExtensionObject
3478 1
    :ivar UserTokenSignature:
3479 1
    :vartype UserTokenSignature: SignatureData
3480 1
    '''
3481 1
3482 1
    ua_types = [
3483 1
        ('ClientSignature', 'SignatureData'),
3484 1
        ('ClientSoftwareCertificates', 'ListOfSignedSoftwareCertificate'),
3485 1
        ('LocaleIds', 'ListOfString'),
3486 1
        ('UserIdentityToken', 'ExtensionObject'),
3487
        ('UserTokenSignature', 'SignatureData'),
3488 1
               ]
3489 1
3490 1
    def __init__(self):
3491 1
        self.ClientSignature = SignatureData()
3492 1
        self.ClientSoftwareCertificates = []
3493 1
        self.LocaleIds = []
3494 1
        self.UserIdentityToken = ExtensionObject()
3495
        self.UserTokenSignature = SignatureData()
3496 1
        self._freeze = True
3497
3498 1
    def to_binary(self):
3499
        packet = []
3500 1
        packet.append(self.ClientSignature.to_binary())
3501 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ClientSoftwareCertificates)))
3502 1
        for fieldname in self.ClientSoftwareCertificates:
3503 1
            packet.append(fieldname.to_binary())
3504 1
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
3505
        for fieldname in self.LocaleIds:
3506 1
            packet.append(uabin.Primitives.String.pack(fieldname))
3507
        packet.append(uabin.extensionobject_to_binary(self.UserIdentityToken))
3508
        packet.append(self.UserTokenSignature.to_binary())
3509
        return b''.join(packet)
3510
3511
    @staticmethod
3512 1
    def from_binary(data):
3513
        obj = ActivateSessionParameters()
3514
        obj.ClientSignature = SignatureData.from_binary(data)
3515 1
        length = uabin.Primitives.Int32.unpack(data)
3516
        array = []
3517
        if length != -1:
3518
            for _ in range(0, length):
3519
                array.append(SignedSoftwareCertificate.from_binary(data))
3520
        obj.ClientSoftwareCertificates = array
3521
        obj.LocaleIds = uabin.Primitives.String.unpack_array(data)
3522
        obj.UserIdentityToken = uabin.extensionobject_from_binary(data)
3523
        obj.UserTokenSignature = SignatureData.from_binary(data)
3524
        return obj
3525 1
3526
    def __str__(self):
3527
        return 'ActivateSessionParameters(' + 'ClientSignature:' + str(self.ClientSignature) + ', ' + \
3528
               'ClientSoftwareCertificates:' + str(self.ClientSoftwareCertificates) + ', ' + \
3529
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
3530 1
               'UserIdentityToken:' + str(self.UserIdentityToken) + ', ' + \
3531
               'UserTokenSignature:' + str(self.UserTokenSignature) + ')'
3532
3533
    __repr__ = __str__
3534
3535
3536
class ActivateSessionRequest(FrozenClass):
3537
    '''
3538
    Activates a session with the server.
3539 1
3540
    :ivar TypeId:
3541
    :vartype TypeId: NodeId
3542
    :ivar RequestHeader:
3543
    :vartype RequestHeader: RequestHeader
3544
    :ivar Parameters:
3545 1
    :vartype Parameters: ActivateSessionParameters
3546
    '''
3547
3548
    ua_types = [
3549 1
        ('TypeId', 'NodeId'),
3550
        ('RequestHeader', 'RequestHeader'),
3551
        ('Parameters', 'ActivateSessionParameters'),
3552
               ]
3553 1
3554
    def __init__(self):
3555
        self.TypeId = FourByteNodeId(ObjectIds.ActivateSessionRequest_Encoding_DefaultBinary)
3556
        self.RequestHeader = RequestHeader()
3557 1
        self.Parameters = ActivateSessionParameters()
3558
        self._freeze = True
3559
3560 1
    def to_binary(self):
3561
        packet = []
3562
        packet.append(self.TypeId.to_binary())
3563
        packet.append(self.RequestHeader.to_binary())
3564
        packet.append(self.Parameters.to_binary())
3565
        return b''.join(packet)
3566
3567
    @staticmethod
3568 1
    def from_binary(data):
3569
        obj = ActivateSessionRequest()
3570
        obj.TypeId = NodeId.from_binary(data)
3571
        obj.RequestHeader = RequestHeader.from_binary(data)
3572
        obj.Parameters = ActivateSessionParameters.from_binary(data)
3573 1
        return obj
3574
3575
    def __str__(self):
3576
        return 'ActivateSessionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3577
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
3578
               'Parameters:' + str(self.Parameters) + ')'
3579
3580
    __repr__ = __str__
3581
3582 1
3583
class ActivateSessionResult(FrozenClass):
3584
    '''
3585
    :ivar ServerNonce:
3586
    :vartype ServerNonce: ByteString
3587
    :ivar Results:
3588 1
    :vartype Results: StatusCode
3589
    :ivar DiagnosticInfos:
3590
    :vartype DiagnosticInfos: DiagnosticInfo
3591
    '''
3592 1
3593
    ua_types = [
3594
        ('ServerNonce', 'ByteString'),
3595
        ('Results', 'ListOfStatusCode'),
3596 1
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
3597
               ]
3598
3599
    def __init__(self):
3600 1
        self.ServerNonce = None
3601
        self.Results = []
3602
        self.DiagnosticInfos = []
3603 1
        self._freeze = True
3604
3605
    def to_binary(self):
3606
        packet = []
3607
        packet.append(uabin.Primitives.ByteString.pack(self.ServerNonce))
3608
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
3609
        for fieldname in self.Results:
3610
            packet.append(fieldname.to_binary())
3611
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
3612
        for fieldname in self.DiagnosticInfos:
3613
            packet.append(fieldname.to_binary())
3614
        return b''.join(packet)
3615 1
3616
    @staticmethod
3617
    def from_binary(data):
3618
        obj = ActivateSessionResult()
3619
        self.ServerNonce = uabin.Primitives.ByteString.unpack(data)
3620
        length = uabin.Primitives.Int32.unpack(data)
3621 1
        array = []
3622
        if length != -1:
3623
            for _ in range(0, length):
3624
                array.append(StatusCode.from_binary(data))
3625
        obj.Results = array
3626
        length = uabin.Primitives.Int32.unpack(data)
3627
        array = []
3628
        if length != -1:
3629 View Code Duplication
            for _ in range(0, length):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3630
                array.append(DiagnosticInfo.from_binary(data))
3631 1
        obj.DiagnosticInfos = array
3632
        return obj
3633
3634
    def __str__(self):
3635
        return 'ActivateSessionResult(' + 'ServerNonce:' + str(self.ServerNonce) + ', ' + \
3636
               'Results:' + str(self.Results) + ', ' + \
3637
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
3638 1
3639
    __repr__ = __str__
3640
3641
3642 1
class ActivateSessionResponse(FrozenClass):
3643
    '''
3644
    Activates a session with the server.
3645
3646
    :ivar TypeId:
3647 1
    :vartype TypeId: NodeId
3648
    :ivar ResponseHeader:
3649
    :vartype ResponseHeader: ResponseHeader
3650
    :ivar Parameters:
3651
    :vartype Parameters: ActivateSessionResult
3652 1
    '''
3653
3654
    ua_types = [
3655 1
        ('TypeId', 'NodeId'),
3656
        ('ResponseHeader', 'ResponseHeader'),
3657
        ('Parameters', 'ActivateSessionResult'),
3658
               ]
3659
3660
    def __init__(self):
3661
        self.TypeId = FourByteNodeId(ObjectIds.ActivateSessionResponse_Encoding_DefaultBinary)
3662
        self.ResponseHeader = ResponseHeader()
3663
        self.Parameters = ActivateSessionResult()
3664
        self._freeze = True
3665
3666
    def to_binary(self):
3667
        packet = []
3668
        packet.append(self.TypeId.to_binary())
3669 1
        packet.append(self.ResponseHeader.to_binary())
3670
        packet.append(self.Parameters.to_binary())
3671
        return b''.join(packet)
3672
3673
    @staticmethod
3674
    def from_binary(data):
3675
        obj = ActivateSessionResponse()
3676
        obj.TypeId = NodeId.from_binary(data)
3677 1 View Code Duplication
        obj.ResponseHeader = ResponseHeader.from_binary(data)
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3678 1
        obj.Parameters = ActivateSessionResult.from_binary(data)
3679 1
        return obj
3680 1
3681 1
    def __str__(self):
3682 1
        return 'ActivateSessionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3683 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
3684 1
               'Parameters:' + str(self.Parameters) + ')'
3685 1
3686 1
    __repr__ = __str__
3687 1
3688
3689 1
class CloseSessionRequest(FrozenClass):
3690 1
    '''
3691 1
    Closes a session with the server.
3692 1
3693 1
    :ivar TypeId:
3694
    :vartype TypeId: NodeId
3695 1
    :ivar RequestHeader:
3696 1
    :vartype RequestHeader: RequestHeader
3697 1
    :ivar DeleteSubscriptions:
3698 1
    :vartype DeleteSubscriptions: Boolean
3699 1
    '''
3700 1
3701
    ua_types = [
3702 1
        ('TypeId', 'NodeId'),
3703
        ('RequestHeader', 'RequestHeader'),
3704 1
        ('DeleteSubscriptions', 'Boolean'),
3705
               ]
3706 1
3707 1
    def __init__(self):
3708 1
        self.TypeId = FourByteNodeId(ObjectIds.CloseSessionRequest_Encoding_DefaultBinary)
3709 1
        self.RequestHeader = RequestHeader()
3710 1
        self.DeleteSubscriptions = True
3711 1
        self._freeze = True
3712
3713 1
    def to_binary(self):
3714 1
        packet = []
3715 1
        packet.append(self.TypeId.to_binary())
3716 1
        packet.append(self.RequestHeader.to_binary())
3717
        packet.append(uabin.Primitives.Boolean.pack(self.DeleteSubscriptions))
3718 1
        return b''.join(packet)
3719
3720
    @staticmethod
3721
    def from_binary(data):
3722
        obj = CloseSessionRequest()
3723
        obj.TypeId = NodeId.from_binary(data)
3724
        obj.RequestHeader = RequestHeader.from_binary(data)
3725 1
        self.DeleteSubscriptions = uabin.Primitives.Boolean.unpack(data)
3726
        return obj
3727
3728 1
    def __str__(self):
3729
        return 'CloseSessionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3730
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
3731
               'DeleteSubscriptions:' + str(self.DeleteSubscriptions) + ')'
3732
3733
    __repr__ = __str__
3734
3735
3736
class CloseSessionResponse(FrozenClass):
3737
    '''
3738
    Closes a session with the server.
3739
3740 1
    :ivar TypeId:
3741
    :vartype TypeId: NodeId
3742
    :ivar ResponseHeader:
3743
    :vartype ResponseHeader: ResponseHeader
3744
    '''
3745
3746 1
    ua_types = [
3747 1
        ('TypeId', 'NodeId'),
3748
        ('ResponseHeader', 'ResponseHeader'),
3749
               ]
3750
3751 1
    def __init__(self):
3752 1
        self.TypeId = FourByteNodeId(ObjectIds.CloseSessionResponse_Encoding_DefaultBinary)
3753 1
        self.ResponseHeader = ResponseHeader()
3754 1
        self._freeze = True
3755
3756 1
    def to_binary(self):
3757 1
        packet = []
3758 1
        packet.append(self.TypeId.to_binary())
3759 1
        packet.append(self.ResponseHeader.to_binary())
3760 1
        return b''.join(packet)
3761 1
3762
    @staticmethod
3763 1
    def from_binary(data):
3764
        obj = CloseSessionResponse()
3765
        obj.TypeId = NodeId.from_binary(data)
3766
        obj.ResponseHeader = ResponseHeader.from_binary(data)
3767 1
        return obj
3768
3769
    def __str__(self):
3770
        return 'CloseSessionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3771
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
3772 1
3773
    __repr__ = __str__
3774
3775
3776
class CancelParameters(FrozenClass):
3777 1
    '''
3778
    :ivar RequestHandle:
3779
    :vartype RequestHandle: UInt32
3780 1
    '''
3781
3782
    ua_types = [
3783
        ('RequestHandle', 'UInt32'),
3784
               ]
3785
3786
    def __init__(self):
3787
        self.RequestHandle = 0
3788
        self._freeze = True
3789
3790 1
    def to_binary(self):
3791
        packet = []
3792
        packet.append(uabin.Primitives.UInt32.pack(self.RequestHandle))
3793
        return b''.join(packet)
3794
3795
    @staticmethod
3796 1
    def from_binary(data):
3797 1
        obj = CancelParameters()
3798 1
        self.RequestHandle = uabin.Primitives.UInt32.unpack(data)
3799 1
        return obj
3800 1
3801 1
    def __str__(self):
3802 1
        return 'CancelParameters(' + 'RequestHandle:' + str(self.RequestHandle) + ')'
3803 1
3804 1
    __repr__ = __str__
3805
3806 1
3807 1
class CancelRequest(FrozenClass):
3808 1
    '''
3809 1
    Cancels an outstanding request.
3810 1
3811
    :ivar TypeId:
3812 1
    :vartype TypeId: NodeId
3813 1
    :ivar RequestHeader:
3814
    :vartype RequestHeader: RequestHeader
3815 1
    :ivar Parameters:
3816
    :vartype Parameters: CancelParameters
3817 1
    '''
3818
3819 1
    ua_types = [
3820
        ('TypeId', 'NodeId'),
3821 1
        ('RequestHeader', 'RequestHeader'),
3822 1
        ('Parameters', 'CancelParameters'),
3823 1
               ]
3824 1
3825 1
    def __init__(self):
3826 1
        self.TypeId = FourByteNodeId(ObjectIds.CancelRequest_Encoding_DefaultBinary)
3827
        self.RequestHeader = RequestHeader()
3828 1
        self.Parameters = CancelParameters()
3829 1
        self._freeze = True
3830 1
3831 1
    def to_binary(self):
3832 1
        packet = []
3833
        packet.append(self.TypeId.to_binary())
3834 1
        packet.append(self.RequestHeader.to_binary())
3835
        packet.append(self.Parameters.to_binary())
3836 1
        return b''.join(packet)
3837
3838
    @staticmethod
3839
    def from_binary(data):
3840
        obj = CancelRequest()
3841 1
        obj.TypeId = NodeId.from_binary(data)
3842
        obj.RequestHeader = RequestHeader.from_binary(data)
3843
        obj.Parameters = CancelParameters.from_binary(data)
3844 1
        return obj
3845
3846
    def __str__(self):
3847
        return 'CancelRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3848
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
3849
               'Parameters:' + str(self.Parameters) + ')'
3850
3851
    __repr__ = __str__
3852
3853
3854
class CancelResult(FrozenClass):
3855
    '''
3856 1
    :ivar CancelCount:
3857
    :vartype CancelCount: UInt32
3858
    '''
3859
3860
    ua_types = [
3861
        ('CancelCount', 'UInt32'),
3862 1
               ]
3863 1
3864 1
    def __init__(self):
3865 1
        self.CancelCount = 0
3866 1
        self._freeze = True
3867 1
3868 1
    def to_binary(self):
3869 1
        packet = []
3870 1
        packet.append(uabin.Primitives.UInt32.pack(self.CancelCount))
3871
        return b''.join(packet)
3872 1
3873 1
    @staticmethod
3874 1
    def from_binary(data):
3875 1
        obj = CancelResult()
3876 1
        self.CancelCount = uabin.Primitives.UInt32.unpack(data)
3877 1
        return obj
3878
3879 1
    def __str__(self):
3880
        return 'CancelResult(' + 'CancelCount:' + str(self.CancelCount) + ')'
3881 1
3882
    __repr__ = __str__
3883 1
3884 1
3885 1
class CancelResponse(FrozenClass):
3886 1
    '''
3887
    Cancels an outstanding request.
3888 1
3889
    :ivar TypeId:
3890
    :vartype TypeId: NodeId
3891
    :ivar ResponseHeader:
3892
    :vartype ResponseHeader: ResponseHeader
3893 1
    :ivar Parameters:
3894
    :vartype Parameters: CancelResult
3895
    '''
3896 1
3897
    ua_types = [
3898
        ('TypeId', 'NodeId'),
3899
        ('ResponseHeader', 'ResponseHeader'),
3900
        ('Parameters', 'CancelResult'),
3901
               ]
3902 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3903
    def __init__(self):
3904
        self.TypeId = FourByteNodeId(ObjectIds.CancelResponse_Encoding_DefaultBinary)
3905
        self.ResponseHeader = ResponseHeader()
3906
        self.Parameters = CancelResult()
3907
        self._freeze = True
3908 1
3909
    def to_binary(self):
3910
        packet = []
3911
        packet.append(self.TypeId.to_binary())
3912
        packet.append(self.ResponseHeader.to_binary())
3913
        packet.append(self.Parameters.to_binary())
3914 1
        return b''.join(packet)
3915 1
3916
    @staticmethod
3917
    def from_binary(data):
3918
        obj = CancelResponse()
3919 1
        obj.TypeId = NodeId.from_binary(data)
3920 1
        obj.ResponseHeader = ResponseHeader.from_binary(data)
3921 1
        obj.Parameters = CancelResult.from_binary(data)
3922 1
        return obj
3923
3924 1
    def __str__(self):
3925 1
        return 'CancelResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3926 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
3927 1
               'Parameters:' + str(self.Parameters) + ')'
3928 1
3929 1
    __repr__ = __str__
3930
3931 1
3932
class NodeAttributes(FrozenClass):
3933
    '''
3934
    The base attributes for all nodes.
3935 1
3936
    :ivar SpecifiedAttributes:
3937
    :vartype SpecifiedAttributes: UInt32
3938
    :ivar DisplayName:
3939
    :vartype DisplayName: LocalizedText
3940 1
    :ivar Description:
3941
    :vartype Description: LocalizedText
3942
    :ivar WriteMask:
3943
    :vartype WriteMask: UInt32
3944
    :ivar UserWriteMask:
3945 1
    :vartype UserWriteMask: UInt32
3946
    '''
3947
3948 1
    ua_types = [
3949
        ('SpecifiedAttributes', 'UInt32'),
3950
        ('DisplayName', 'LocalizedText'),
3951
        ('Description', 'LocalizedText'),
3952
        ('WriteMask', 'UInt32'),
3953
        ('UserWriteMask', 'UInt32'),
3954
               ]
3955
3956
    def __init__(self):
3957
        self.SpecifiedAttributes = 0
3958 1
        self.DisplayName = LocalizedText()
3959
        self.Description = LocalizedText()
3960
        self.WriteMask = 0
3961
        self.UserWriteMask = 0
3962
        self._freeze = True
3963 1
3964 1
    def to_binary(self):
3965 1
        packet = []
3966 1
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
3967 1
        packet.append(self.DisplayName.to_binary())
3968 1
        packet.append(self.Description.to_binary())
3969 1
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
3970 1
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
3971
        return b''.join(packet)
3972 1
3973 1
    @staticmethod
3974 1
    def from_binary(data):
3975 1
        obj = NodeAttributes()
3976 1
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
3977
        obj.DisplayName = LocalizedText.from_binary(data)
3978 1
        obj.Description = LocalizedText.from_binary(data)
3979
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
3980 1
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
3981
        return obj
3982 1
3983 1
    def __str__(self):
3984 1
        return 'NodeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
3985
               'DisplayName:' + str(self.DisplayName) + ', ' + \
3986 1
               'Description:' + str(self.Description) + ', ' + \
3987
               'WriteMask:' + str(self.WriteMask) + ', ' + \
3988
               'UserWriteMask:' + str(self.UserWriteMask) + ')'
3989
3990 1
    __repr__ = __str__
3991 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3992
3993 1
class ObjectAttributes(FrozenClass):
3994
    '''
3995
    The attributes for an object node.
3996
3997
    :ivar SpecifiedAttributes:
3998
    :vartype SpecifiedAttributes: UInt32
3999 1
    :ivar DisplayName:
4000
    :vartype DisplayName: LocalizedText
4001
    :ivar Description:
4002
    :vartype Description: LocalizedText
4003 1
    :ivar WriteMask:
4004
    :vartype WriteMask: UInt32
4005
    :ivar UserWriteMask:
4006
    :vartype UserWriteMask: UInt32
4007
    :ivar EventNotifier:
4008
    :vartype EventNotifier: Byte
4009
    '''
4010
4011 1
    ua_types = [
4012
        ('SpecifiedAttributes', 'UInt32'),
4013
        ('DisplayName', 'LocalizedText'),
4014
        ('Description', 'LocalizedText'),
4015
        ('WriteMask', 'UInt32'),
4016 1
        ('UserWriteMask', 'UInt32'),
4017
        ('EventNotifier', 'Byte'),
4018
               ]
4019
4020 1
    def __init__(self):
4021
        self.SpecifiedAttributes = 0
4022
        self.DisplayName = LocalizedText()
4023 1
        self.Description = LocalizedText()
4024
        self.WriteMask = 0
4025
        self.UserWriteMask = 0
4026 1
        self.EventNotifier = 0
4027
        self._freeze = True
4028
4029 1
    def to_binary(self):
4030
        packet = []
4031
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4032
        packet.append(self.DisplayName.to_binary())
4033
        packet.append(self.Description.to_binary())
4034
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4035
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4036
        packet.append(uabin.Primitives.Byte.pack(self.EventNotifier))
4037
        return b''.join(packet)
4038
4039
    @staticmethod
4040
    def from_binary(data):
4041 1
        obj = ObjectAttributes()
4042
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4043
        obj.DisplayName = LocalizedText.from_binary(data)
4044
        obj.Description = LocalizedText.from_binary(data)
4045
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4046
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4047 1
        self.EventNotifier = uabin.Primitives.Byte.unpack(data)
4048
        return obj
4049
4050
    def __str__(self):
4051
        return 'ObjectAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4052
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4053
               'Description:' + str(self.Description) + ', ' + \
4054
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4055
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4056
               'EventNotifier:' + str(self.EventNotifier) + ')'
4057 1
4058
    __repr__ = __str__
4059
4060
4061
class VariableAttributes(FrozenClass):
4062
    '''
4063
    The attributes for a variable node.
4064 1
4065
    :ivar SpecifiedAttributes:
4066
    :vartype SpecifiedAttributes: UInt32
4067
    :ivar DisplayName:
4068 1
    :vartype DisplayName: LocalizedText
4069
    :ivar Description:
4070
    :vartype Description: LocalizedText
4071 View Code Duplication
    :ivar WriteMask:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4072
    :vartype WriteMask: UInt32
4073 1
    :ivar UserWriteMask:
4074
    :vartype UserWriteMask: UInt32
4075
    :ivar Value:
4076
    :vartype Value: Variant
4077
    :ivar DataType:
4078 1
    :vartype DataType: NodeId
4079
    :ivar ValueRank:
4080
    :vartype ValueRank: Int32
4081 1
    :ivar ArrayDimensions:
4082
    :vartype ArrayDimensions: UInt32
4083
    :ivar AccessLevel:
4084
    :vartype AccessLevel: Byte
4085
    :ivar UserAccessLevel:
4086
    :vartype UserAccessLevel: Byte
4087 1
    :ivar MinimumSamplingInterval:
4088
    :vartype MinimumSamplingInterval: Double
4089
    :ivar Historizing:
4090
    :vartype Historizing: Boolean
4091 1
    '''
4092
4093
    ua_types = [
4094
        ('SpecifiedAttributes', 'UInt32'),
4095
        ('DisplayName', 'LocalizedText'),
4096
        ('Description', 'LocalizedText'),
4097
        ('WriteMask', 'UInt32'),
4098
        ('UserWriteMask', 'UInt32'),
4099 1
        ('Value', 'Variant'),
4100
        ('DataType', 'NodeId'),
4101
        ('ValueRank', 'Int32'),
4102
        ('ArrayDimensions', 'ListOfUInt32'),
4103
        ('AccessLevel', 'Byte'),
4104 1
        ('UserAccessLevel', 'Byte'),
4105
        ('MinimumSamplingInterval', 'Double'),
4106
        ('Historizing', 'Boolean'),
4107
               ]
4108 1
4109
    def __init__(self):
4110
        self.SpecifiedAttributes = 0
4111 1
        self.DisplayName = LocalizedText()
4112
        self.Description = LocalizedText()
4113
        self.WriteMask = 0
4114 1
        self.UserWriteMask = 0
4115
        self.Value = Variant()
4116
        self.DataType = NodeId()
4117 1
        self.ValueRank = 0
4118
        self.ArrayDimensions = []
4119
        self.AccessLevel = 0
4120
        self.UserAccessLevel = 0
4121
        self.MinimumSamplingInterval = 0
4122
        self.Historizing = True
4123
        self._freeze = True
4124
4125
    def to_binary(self):
4126
        packet = []
4127
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4128
        packet.append(self.DisplayName.to_binary())
4129 1
        packet.append(self.Description.to_binary())
4130
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4131
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4132
        packet.append(self.Value.to_binary())
4133
        packet.append(self.DataType.to_binary())
4134
        packet.append(uabin.Primitives.Int32.pack(self.ValueRank))
4135 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ArrayDimensions)))
4136
        for fieldname in self.ArrayDimensions:
4137
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
4138
        packet.append(uabin.Primitives.Byte.pack(self.AccessLevel))
4139
        packet.append(uabin.Primitives.Byte.pack(self.UserAccessLevel))
4140
        packet.append(uabin.Primitives.Double.pack(self.MinimumSamplingInterval))
4141
        packet.append(uabin.Primitives.Boolean.pack(self.Historizing))
4142
        return b''.join(packet)
4143
4144
    @staticmethod
4145 1
    def from_binary(data):
4146
        obj = VariableAttributes()
4147
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4148
        obj.DisplayName = LocalizedText.from_binary(data)
4149
        obj.Description = LocalizedText.from_binary(data)
4150
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4151 View Code Duplication
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4152 1
        obj.Value = Variant.from_binary(data)
4153
        obj.DataType = NodeId.from_binary(data)
4154
        self.ValueRank = uabin.Primitives.Int32.unpack(data)
4155
        obj.ArrayDimensions = uabin.Primitives.UInt32.unpack_array(data)
4156 1
        self.AccessLevel = uabin.Primitives.Byte.unpack(data)
4157
        self.UserAccessLevel = uabin.Primitives.Byte.unpack(data)
4158
        self.MinimumSamplingInterval = uabin.Primitives.Double.unpack(data)
4159
        self.Historizing = uabin.Primitives.Boolean.unpack(data)
4160
        return obj
4161 1
4162
    def __str__(self):
4163
        return 'VariableAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4164
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4165
               'Description:' + str(self.Description) + ', ' + \
4166 1
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4167
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4168
               'Value:' + str(self.Value) + ', ' + \
4169 1
               'DataType:' + str(self.DataType) + ', ' + \
4170
               'ValueRank:' + str(self.ValueRank) + ', ' + \
4171
               'ArrayDimensions:' + str(self.ArrayDimensions) + ', ' + \
4172
               'AccessLevel:' + str(self.AccessLevel) + ', ' + \
4173
               'UserAccessLevel:' + str(self.UserAccessLevel) + ', ' + \
4174
               'MinimumSamplingInterval:' + str(self.MinimumSamplingInterval) + ', ' + \
4175
               'Historizing:' + str(self.Historizing) + ')'
4176
4177
    __repr__ = __str__
4178
4179
4180
class MethodAttributes(FrozenClass):
4181
    '''
4182
    The attributes for a method node.
4183
4184
    :ivar SpecifiedAttributes:
4185 1
    :vartype SpecifiedAttributes: UInt32
4186
    :ivar DisplayName:
4187
    :vartype DisplayName: LocalizedText
4188
    :ivar Description:
4189
    :vartype Description: LocalizedText
4190
    :ivar WriteMask:
4191
    :vartype WriteMask: UInt32
4192
    :ivar UserWriteMask:
4193 1
    :vartype UserWriteMask: UInt32
4194
    :ivar Executable:
4195
    :vartype Executable: Boolean
4196
    :ivar UserExecutable:
4197
    :vartype UserExecutable: Boolean
4198
    '''
4199
4200
    ua_types = [
4201
        ('SpecifiedAttributes', 'UInt32'),
4202
        ('DisplayName', 'LocalizedText'),
4203
        ('Description', 'LocalizedText'),
4204
        ('WriteMask', 'UInt32'),
4205 1
        ('UserWriteMask', 'UInt32'),
4206
        ('Executable', 'Boolean'),
4207
        ('UserExecutable', 'Boolean'),
4208
               ]
4209
4210
    def __init__(self):
4211
        self.SpecifiedAttributes = 0
4212
        self.DisplayName = LocalizedText()
4213 View Code Duplication
        self.Description = LocalizedText()
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4214 1
        self.WriteMask = 0
4215
        self.UserWriteMask = 0
4216
        self.Executable = True
4217
        self.UserExecutable = True
4218 1
        self._freeze = True
4219
4220
    def to_binary(self):
4221
        packet = []
4222
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4223
        packet.append(self.DisplayName.to_binary())
4224
        packet.append(self.Description.to_binary())
4225 1
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4226
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4227
        packet.append(uabin.Primitives.Boolean.pack(self.Executable))
4228
        packet.append(uabin.Primitives.Boolean.pack(self.UserExecutable))
4229
        return b''.join(packet)
4230
4231
    @staticmethod
4232 1
    def from_binary(data):
4233
        obj = MethodAttributes()
4234
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4235 1
        obj.DisplayName = LocalizedText.from_binary(data)
4236
        obj.Description = LocalizedText.from_binary(data)
4237
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4238
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4239
        self.Executable = uabin.Primitives.Boolean.unpack(data)
4240
        self.UserExecutable = uabin.Primitives.Boolean.unpack(data)
4241
        return obj
4242
4243
    def __str__(self):
4244
        return 'MethodAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4245
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4246
               'Description:' + str(self.Description) + ', ' + \
4247
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4248
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4249
               'Executable:' + str(self.Executable) + ', ' + \
4250
               'UserExecutable:' + str(self.UserExecutable) + ')'
4251
4252
    __repr__ = __str__
4253 1
4254
4255
class ObjectTypeAttributes(FrozenClass):
4256
    '''
4257
    The attributes for an object type node.
4258
4259
    :ivar SpecifiedAttributes:
4260
    :vartype SpecifiedAttributes: UInt32
4261
    :ivar DisplayName:
4262 1
    :vartype DisplayName: LocalizedText
4263 1
    :ivar Description:
4264 1
    :vartype Description: LocalizedText
4265 1
    :ivar WriteMask:
4266 1
    :vartype WriteMask: UInt32
4267 1
    :ivar UserWriteMask:
4268 1
    :vartype UserWriteMask: UInt32
4269 1
    :ivar IsAbstract:
4270 1
    :vartype IsAbstract: Boolean
4271 1
    '''
4272 1
4273 1
    ua_types = [
4274
        ('SpecifiedAttributes', 'UInt32'),
4275 1
        ('DisplayName', 'LocalizedText'),
4276 1
        ('Description', 'LocalizedText'),
4277 1
        ('WriteMask', 'UInt32'),
4278 1
        ('UserWriteMask', 'UInt32'),
4279 1
        ('IsAbstract', 'Boolean'),
4280 1
               ]
4281 1
4282 1
    def __init__(self):
4283 1
        self.SpecifiedAttributes = 0
4284
        self.DisplayName = LocalizedText()
4285 1
        self.Description = LocalizedText()
4286
        self.WriteMask = 0
4287 1
        self.UserWriteMask = 0
4288
        self.IsAbstract = True
4289 1
        self._freeze = True
4290 1
4291 1
    def to_binary(self):
4292 1
        packet = []
4293 1
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4294 1
        packet.append(self.DisplayName.to_binary())
4295 1
        packet.append(self.Description.to_binary())
4296
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4297 1
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4298
        packet.append(uabin.Primitives.Boolean.pack(self.IsAbstract))
4299
        return b''.join(packet)
4300
4301
    @staticmethod
4302
    def from_binary(data):
4303
        obj = ObjectTypeAttributes()
4304
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4305 1
        obj.DisplayName = LocalizedText.from_binary(data)
4306
        obj.Description = LocalizedText.from_binary(data)
4307
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4308 1
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4309
        self.IsAbstract = uabin.Primitives.Boolean.unpack(data)
4310
        return obj
4311
4312
    def __str__(self):
4313
        return 'ObjectTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4314
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4315
               'Description:' + str(self.Description) + ', ' + \
4316
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4317
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4318
               'IsAbstract:' + str(self.IsAbstract) + ')'
4319
4320
    __repr__ = __str__
4321
4322
4323
class VariableTypeAttributes(FrozenClass):
4324
    '''
4325
    The attributes for a variable type node.
4326
4327
    :ivar SpecifiedAttributes:
4328
    :vartype SpecifiedAttributes: UInt32
4329
    :ivar DisplayName:
4330
    :vartype DisplayName: LocalizedText
4331
    :ivar Description:
4332
    :vartype Description: LocalizedText
4333
    :ivar WriteMask:
4334
    :vartype WriteMask: UInt32
4335
    :ivar UserWriteMask:
4336
    :vartype UserWriteMask: UInt32
4337
    :ivar Value:
4338
    :vartype Value: Variant
4339
    :ivar DataType:
4340 1
    :vartype DataType: NodeId
4341
    :ivar ValueRank:
4342
    :vartype ValueRank: Int32
4343
    :ivar ArrayDimensions:
4344
    :vartype ArrayDimensions: UInt32
4345
    :ivar IsAbstract:
4346
    :vartype IsAbstract: Boolean
4347
    '''
4348
4349
    ua_types = [
4350
        ('SpecifiedAttributes', 'UInt32'),
4351
        ('DisplayName', 'LocalizedText'),
4352
        ('Description', 'LocalizedText'),
4353
        ('WriteMask', 'UInt32'),
4354
        ('UserWriteMask', 'UInt32'),
4355
        ('Value', 'Variant'),
4356 1
        ('DataType', 'NodeId'),
4357 1
        ('ValueRank', 'Int32'),
4358 1
        ('ArrayDimensions', 'ListOfUInt32'),
4359 1
        ('IsAbstract', 'Boolean'),
4360 1
               ]
4361 1
4362 1
    def __init__(self):
4363 1
        self.SpecifiedAttributes = 0
4364 1
        self.DisplayName = LocalizedText()
4365 1
        self.Description = LocalizedText()
4366 1
        self.WriteMask = 0
4367 1
        self.UserWriteMask = 0
4368 1
        self.Value = Variant()
4369 1
        self.DataType = NodeId()
4370 1
        self.ValueRank = 0
4371 1
        self.ArrayDimensions = []
4372 1
        self.IsAbstract = True
4373 1
        self._freeze = True
4374 1
4375
    def to_binary(self):
4376 1
        packet = []
4377 1
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4378 1
        packet.append(self.DisplayName.to_binary())
4379 1
        packet.append(self.Description.to_binary())
4380 1
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4381 1
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4382 1
        packet.append(self.Value.to_binary())
4383 1
        packet.append(self.DataType.to_binary())
4384 1
        packet.append(uabin.Primitives.Int32.pack(self.ValueRank))
4385 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ArrayDimensions)))
4386 1
        for fieldname in self.ArrayDimensions:
4387 1
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
4388 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsAbstract))
4389 1
        return b''.join(packet)
4390 1
4391 1
    @staticmethod
4392 1
    def from_binary(data):
4393 1
        obj = VariableTypeAttributes()
4394
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4395 1
        obj.DisplayName = LocalizedText.from_binary(data)
4396
        obj.Description = LocalizedText.from_binary(data)
4397 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4398
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4399 1
        obj.Value = Variant.from_binary(data)
4400 1
        obj.DataType = NodeId.from_binary(data)
4401 1
        self.ValueRank = uabin.Primitives.Int32.unpack(data)
4402 1 View Code Duplication
        obj.ArrayDimensions = uabin.Primitives.UInt32.unpack_array(data)
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4403 1
        self.IsAbstract = uabin.Primitives.Boolean.unpack(data)
4404 1
        return obj
4405 1
4406 1
    def __str__(self):
4407 1
        return 'VariableTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4408 1
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4409 1
               'Description:' + str(self.Description) + ', ' + \
4410 1
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4411 1
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4412 1
               'Value:' + str(self.Value) + ', ' + \
4413
               'DataType:' + str(self.DataType) + ', ' + \
4414 1
               'ValueRank:' + str(self.ValueRank) + ', ' + \
4415
               'ArrayDimensions:' + str(self.ArrayDimensions) + ', ' + \
4416
               'IsAbstract:' + str(self.IsAbstract) + ')'
4417
4418
    __repr__ = __str__
4419
4420
4421
class ReferenceTypeAttributes(FrozenClass):
4422
    '''
4423
    The attributes for a reference type node.
4424
4425
    :ivar SpecifiedAttributes:
4426
    :vartype SpecifiedAttributes: UInt32
4427
    :ivar DisplayName:
4428
    :vartype DisplayName: LocalizedText
4429 1
    :ivar Description:
4430
    :vartype Description: LocalizedText
4431
    :ivar WriteMask:
4432 1
    :vartype WriteMask: UInt32
4433
    :ivar UserWriteMask:
4434
    :vartype UserWriteMask: UInt32
4435
    :ivar IsAbstract:
4436
    :vartype IsAbstract: Boolean
4437
    :ivar Symmetric:
4438
    :vartype Symmetric: Boolean
4439
    :ivar InverseName:
4440
    :vartype InverseName: LocalizedText
4441
    '''
4442
4443
    ua_types = [
4444
        ('SpecifiedAttributes', 'UInt32'),
4445
        ('DisplayName', 'LocalizedText'),
4446
        ('Description', 'LocalizedText'),
4447
        ('WriteMask', 'UInt32'),
4448
        ('UserWriteMask', 'UInt32'),
4449
        ('IsAbstract', 'Boolean'),
4450
        ('Symmetric', 'Boolean'),
4451
        ('InverseName', 'LocalizedText'),
4452 1
               ]
4453
4454
    def __init__(self):
4455
        self.SpecifiedAttributes = 0
4456
        self.DisplayName = LocalizedText()
4457
        self.Description = LocalizedText()
4458
        self.WriteMask = 0
4459
        self.UserWriteMask = 0
4460
        self.IsAbstract = True
4461
        self.Symmetric = True
4462 1
        self.InverseName = LocalizedText()
4463 1
        self._freeze = True
4464 1
4465 1
    def to_binary(self):
4466 1
        packet = []
4467 1
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4468 1
        packet.append(self.DisplayName.to_binary())
4469 1
        packet.append(self.Description.to_binary())
4470 1
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4471 1
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4472 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsAbstract))
4473 1
        packet.append(uabin.Primitives.Boolean.pack(self.Symmetric))
4474 1
        packet.append(self.InverseName.to_binary())
4475
        return b''.join(packet)
4476 1
4477 1
    @staticmethod
4478 1 View Code Duplication
    def from_binary(data):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4479 1
        obj = ReferenceTypeAttributes()
4480 1
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4481 1
        obj.DisplayName = LocalizedText.from_binary(data)
4482 1
        obj.Description = LocalizedText.from_binary(data)
4483 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4484 1
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4485 1
        self.IsAbstract = uabin.Primitives.Boolean.unpack(data)
4486
        self.Symmetric = uabin.Primitives.Boolean.unpack(data)
4487 1
        obj.InverseName = LocalizedText.from_binary(data)
4488
        return obj
4489 1
4490
    def __str__(self):
4491 1
        return 'ReferenceTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4492 1
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4493 1
               'Description:' + str(self.Description) + ', ' + \
4494 1
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4495 1
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4496 1
               'IsAbstract:' + str(self.IsAbstract) + ', ' + \
4497 1
               'Symmetric:' + str(self.Symmetric) + ', ' + \
4498 1
               'InverseName:' + str(self.InverseName) + ')'
4499
4500 1
    __repr__ = __str__
4501
4502
4503
class DataTypeAttributes(FrozenClass):
4504
    '''
4505
    The attributes for a data type node.
4506
4507
    :ivar SpecifiedAttributes:
4508
    :vartype SpecifiedAttributes: UInt32
4509 1
    :ivar DisplayName:
4510
    :vartype DisplayName: LocalizedText
4511
    :ivar Description:
4512 1
    :vartype Description: LocalizedText
4513
    :ivar WriteMask:
4514
    :vartype WriteMask: UInt32
4515
    :ivar UserWriteMask:
4516
    :vartype UserWriteMask: UInt32
4517
    :ivar IsAbstract:
4518
    :vartype IsAbstract: Boolean
4519
    '''
4520
4521
    ua_types = [
4522
        ('SpecifiedAttributes', 'UInt32'),
4523
        ('DisplayName', 'LocalizedText'),
4524
        ('Description', 'LocalizedText'),
4525
        ('WriteMask', 'UInt32'),
4526
        ('UserWriteMask', 'UInt32'),
4527
        ('IsAbstract', 'Boolean'),
4528
               ]
4529
4530 1
    def __init__(self):
4531
        self.SpecifiedAttributes = 0
4532
        self.DisplayName = LocalizedText()
4533
        self.Description = LocalizedText()
4534
        self.WriteMask = 0
4535
        self.UserWriteMask = 0
4536
        self.IsAbstract = True
4537
        self._freeze = True
4538
4539 1
    def to_binary(self):
4540 1
        packet = []
4541 1
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4542 1
        packet.append(self.DisplayName.to_binary())
4543 1
        packet.append(self.Description.to_binary())
4544 1
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4545 1
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4546 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsAbstract))
4547 1
        return b''.join(packet)
4548 1
4549 1
    @staticmethod
4550 1
    def from_binary(data):
4551
        obj = DataTypeAttributes()
4552 1
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4553 1
        obj.DisplayName = LocalizedText.from_binary(data)
4554 1
        obj.Description = LocalizedText.from_binary(data)
4555 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4556 1
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4557 1
        self.IsAbstract = uabin.Primitives.Boolean.unpack(data)
4558 1
        return obj
4559 1
4560 1
    def __str__(self):
4561
        return 'DataTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4562 1
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4563
               'Description:' + str(self.Description) + ', ' + \
4564 1
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4565
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4566 1
               'IsAbstract:' + str(self.IsAbstract) + ')'
4567 1
4568 1
    __repr__ = __str__
4569 1
4570 1
4571 1
class ViewAttributes(FrozenClass):
4572 1
    '''
4573
    The attributes for a view node.
4574 1
4575
    :ivar SpecifiedAttributes:
4576
    :vartype SpecifiedAttributes: UInt32
4577
    :ivar DisplayName:
4578
    :vartype DisplayName: LocalizedText
4579
    :ivar Description:
4580
    :vartype Description: LocalizedText
4581
    :ivar WriteMask:
4582 1
    :vartype WriteMask: UInt32
4583
    :ivar UserWriteMask:
4584
    :vartype UserWriteMask: UInt32
4585 1
    :ivar ContainsNoLoops:
4586
    :vartype ContainsNoLoops: Boolean
4587
    :ivar EventNotifier:
4588
    :vartype EventNotifier: Byte
4589
    '''
4590
4591
    ua_types = [
4592
        ('SpecifiedAttributes', 'UInt32'),
4593
        ('DisplayName', 'LocalizedText'),
4594
        ('Description', 'LocalizedText'),
4595
        ('WriteMask', 'UInt32'),
4596
        ('UserWriteMask', 'UInt32'),
4597
        ('ContainsNoLoops', 'Boolean'),
4598
        ('EventNotifier', 'Byte'),
4599
               ]
4600
4601
    def __init__(self):
4602
        self.SpecifiedAttributes = 0
4603
        self.DisplayName = LocalizedText()
4604
        self.Description = LocalizedText()
4605
        self.WriteMask = 0
4606
        self.UserWriteMask = 0
4607
        self.ContainsNoLoops = True
4608
        self.EventNotifier = 0
4609
        self._freeze = True
4610
4611 1
    def to_binary(self):
4612
        packet = []
4613
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4614
        packet.append(self.DisplayName.to_binary())
4615
        packet.append(self.Description.to_binary())
4616
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4617
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4618
        packet.append(uabin.Primitives.Boolean.pack(self.ContainsNoLoops))
4619
        packet.append(uabin.Primitives.Byte.pack(self.EventNotifier))
4620
        return b''.join(packet)
4621
4622
    @staticmethod
4623
    def from_binary(data):
4624 1
        obj = ViewAttributes()
4625 1
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4626
        obj.DisplayName = LocalizedText.from_binary(data)
4627
        obj.Description = LocalizedText.from_binary(data)
4628
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4629 1
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4630 1
        self.ContainsNoLoops = uabin.Primitives.Boolean.unpack(data)
4631 1
        self.EventNotifier = uabin.Primitives.Byte.unpack(data)
4632 1
        return obj
4633 1
4634 1
    def __str__(self):
4635 1
        return 'ViewAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4636 1
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4637 1
               'Description:' + str(self.Description) + ', ' + \
4638 1
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4639 1
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4640
               'ContainsNoLoops:' + str(self.ContainsNoLoops) + ', ' + \
4641 1
               'EventNotifier:' + str(self.EventNotifier) + ')'
4642
4643
    __repr__ = __str__
4644
4645
4646
class AddNodesItem(FrozenClass):
4647
    '''
4648
    A request to add a node to the server address space.
4649
4650
    :ivar ParentNodeId:
4651
    :vartype ParentNodeId: ExpandedNodeId
4652
    :ivar ReferenceTypeId:
4653
    :vartype ReferenceTypeId: NodeId
4654
    :ivar RequestedNewNodeId:
4655
    :vartype RequestedNewNodeId: ExpandedNodeId
4656
    :ivar BrowseName:
4657 1
    :vartype BrowseName: QualifiedName
4658
    :ivar NodeClass:
4659
    :vartype NodeClass: NodeClass
4660
    :ivar NodeAttributes:
4661 1
    :vartype NodeAttributes: ExtensionObject
4662
    :ivar TypeDefinition:
4663
    :vartype TypeDefinition: ExpandedNodeId
4664
    '''
4665
4666
    ua_types = [
4667
        ('ParentNodeId', 'ExpandedNodeId'),
4668
        ('ReferenceTypeId', 'NodeId'),
4669
        ('RequestedNewNodeId', 'ExpandedNodeId'),
4670
        ('BrowseName', 'QualifiedName'),
4671
        ('NodeClass', 'NodeClass'),
4672
        ('NodeAttributes', 'ExtensionObject'),
4673 1
        ('TypeDefinition', 'ExpandedNodeId'),
4674
               ]
4675
4676
    def __init__(self):
4677
        self.ParentNodeId = ExpandedNodeId()
4678
        self.ReferenceTypeId = NodeId()
4679
        self.RequestedNewNodeId = ExpandedNodeId()
4680
        self.BrowseName = QualifiedName()
4681
        self.NodeClass = NodeClass(0)
4682
        self.NodeAttributes = ExtensionObject()
4683
        self.TypeDefinition = ExpandedNodeId()
4684
        self._freeze = True
4685 1
4686
    def to_binary(self):
4687
        packet = []
4688 1
        packet.append(self.ParentNodeId.to_binary())
4689
        packet.append(self.ReferenceTypeId.to_binary())
4690
        packet.append(self.RequestedNewNodeId.to_binary())
4691
        packet.append(self.BrowseName.to_binary())
4692
        packet.append(uabin.Primitives.UInt32.pack(self.NodeClass.value))
4693
        packet.append(uabin.extensionobject_to_binary(self.NodeAttributes))
4694
        packet.append(self.TypeDefinition.to_binary())
4695
        return b''.join(packet)
4696
4697 View Code Duplication
    @staticmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4698
    def from_binary(data):
4699
        obj = AddNodesItem()
4700
        obj.ParentNodeId = ExpandedNodeId.from_binary(data)
4701
        obj.ReferenceTypeId = NodeId.from_binary(data)
4702
        obj.RequestedNewNodeId = ExpandedNodeId.from_binary(data)
4703
        obj.BrowseName = QualifiedName.from_binary(data)
4704
        self.NodeClass = NodeClass(uabin.Primitives.UInt32.unpack(data))
4705
        obj.NodeAttributes = uabin.extensionobject_from_binary(data)
4706
        obj.TypeDefinition = ExpandedNodeId.from_binary(data)
4707
        return obj
4708
4709
    def __str__(self):
4710 1
        return 'AddNodesItem(' + 'ParentNodeId:' + str(self.ParentNodeId) + ', ' + \
4711
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
4712
               'RequestedNewNodeId:' + str(self.RequestedNewNodeId) + ', ' + \
4713
               'BrowseName:' + str(self.BrowseName) + ', ' + \
4714
               'NodeClass:' + str(self.NodeClass) + ', ' + \
4715
               'NodeAttributes:' + str(self.NodeAttributes) + ', ' + \
4716
               'TypeDefinition:' + str(self.TypeDefinition) + ')'
4717
4718
    __repr__ = __str__
4719
4720
4721 1
class AddNodesResult(FrozenClass):
4722 1
    '''
4723
    A result of an add node operation.
4724
4725
    :ivar StatusCode:
4726 1
    :vartype StatusCode: StatusCode
4727 1
    :ivar AddedNodeId:
4728 1
    :vartype AddedNodeId: NodeId
4729 1 View Code Duplication
    '''
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4730 1
4731 1
    ua_types = [
4732 1
        ('StatusCode', 'StatusCode'),
4733 1
        ('AddedNodeId', 'NodeId'),
4734 1
               ]
4735
4736 1
    def __init__(self):
4737
        self.StatusCode = StatusCode()
4738
        self.AddedNodeId = NodeId()
4739
        self._freeze = True
4740
4741
    def to_binary(self):
4742
        packet = []
4743
        packet.append(self.StatusCode.to_binary())
4744
        packet.append(self.AddedNodeId.to_binary())
4745
        return b''.join(packet)
4746
4747
    @staticmethod
4748 1
    def from_binary(data):
4749
        obj = AddNodesResult()
4750
        obj.StatusCode = StatusCode.from_binary(data)
4751
        obj.AddedNodeId = NodeId.from_binary(data)
4752 1
        return obj
4753
4754
    def __str__(self):
4755
        return 'AddNodesResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
4756
               'AddedNodeId:' + str(self.AddedNodeId) + ')'
4757
4758
    __repr__ = __str__
4759
4760
4761
class AddNodesParameters(FrozenClass):
4762 1
    '''
4763
    :ivar NodesToAdd:
4764
    :vartype NodesToAdd: AddNodesItem
4765
    '''
4766
4767
    ua_types = [
4768
        ('NodesToAdd', 'ListOfAddNodesItem'),
4769
               ]
4770
4771
    def __init__(self):
4772 1
        self.NodesToAdd = []
4773
        self._freeze = True
4774
4775 1
    def to_binary(self):
4776
        packet = []
4777
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToAdd)))
4778
        for fieldname in self.NodesToAdd:
4779
            packet.append(fieldname.to_binary())
4780
        return b''.join(packet)
4781
4782
    @staticmethod
4783
    def from_binary(data):
4784
        obj = AddNodesParameters()
4785
        length = uabin.Primitives.Int32.unpack(data)
4786
        array = []
4787
        if length != -1:
4788
            for _ in range(0, length):
4789
                array.append(AddNodesItem.from_binary(data))
4790
        obj.NodesToAdd = array
4791
        return obj
4792
4793 1
    def __str__(self):
4794
        return 'AddNodesParameters(' + 'NodesToAdd:' + str(self.NodesToAdd) + ')'
4795
4796
    __repr__ = __str__
4797
4798 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4799
class AddNodesRequest(FrozenClass):
4800
    '''
4801
    Adds one or more nodes to the server address space.
4802 1
4803 1
    :ivar TypeId:
4804 1
    :vartype TypeId: NodeId
4805 1
    :ivar RequestHeader:
4806 1
    :vartype RequestHeader: RequestHeader
4807 1
    :ivar Parameters:
4808 1
    :vartype Parameters: AddNodesParameters
4809 1
    '''
4810 1
4811 1
    ua_types = [
4812 1
        ('TypeId', 'NodeId'),
4813 1
        ('RequestHeader', 'RequestHeader'),
4814
        ('Parameters', 'AddNodesParameters'),
4815 1
               ]
4816 1
4817 1
    def __init__(self):
4818 1
        self.TypeId = FourByteNodeId(ObjectIds.AddNodesRequest_Encoding_DefaultBinary)
4819 1
        self.RequestHeader = RequestHeader()
4820 1
        self.Parameters = AddNodesParameters()
4821 1
        self._freeze = True
4822 1
4823 1
    def to_binary(self):
4824
        packet = []
4825 1
        packet.append(self.TypeId.to_binary())
4826
        packet.append(self.RequestHeader.to_binary())
4827 1
        packet.append(self.Parameters.to_binary())
4828
        return b''.join(packet)
4829 1
4830 1
    @staticmethod
4831 1
    def from_binary(data):
4832 1
        obj = AddNodesRequest()
4833 1
        obj.TypeId = NodeId.from_binary(data)
4834 1
        obj.RequestHeader = RequestHeader.from_binary(data)
4835 1
        obj.Parameters = AddNodesParameters.from_binary(data)
4836
        return obj
4837 1
4838
    def __str__(self):
4839
        return 'AddNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
4840
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
4841
               'Parameters:' + str(self.Parameters) + ')'
4842
4843
    __repr__ = __str__
4844
4845 1
4846
class AddNodesResponse(FrozenClass):
4847
    '''
4848 1
    Adds one or more nodes to the server address space.
4849
4850
    :ivar TypeId:
4851
    :vartype TypeId: NodeId
4852
    :ivar ResponseHeader:
4853
    :vartype ResponseHeader: ResponseHeader
4854
    :ivar Results:
4855
    :vartype Results: AddNodesResult
4856
    :ivar DiagnosticInfos:
4857
    :vartype DiagnosticInfos: DiagnosticInfo
4858
    '''
4859
4860
    ua_types = [
4861
        ('TypeId', 'NodeId'),
4862
        ('ResponseHeader', 'ResponseHeader'),
4863
        ('Results', 'ListOfAddNodesResult'),
4864
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
4865
               ]
4866
4867
    def __init__(self):
4868 1
        self.TypeId = FourByteNodeId(ObjectIds.AddNodesResponse_Encoding_DefaultBinary)
4869
        self.ResponseHeader = ResponseHeader()
4870
        self.Results = []
4871
        self.DiagnosticInfos = []
4872
        self._freeze = True
4873
4874
    def to_binary(self):
4875
        packet = []
4876
        packet.append(self.TypeId.to_binary())
4877
        packet.append(self.ResponseHeader.to_binary())
4878 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
4879
        for fieldname in self.Results:
4880
            packet.append(fieldname.to_binary())
4881
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
4882
        for fieldname in self.DiagnosticInfos:
4883
            packet.append(fieldname.to_binary())
4884
        return b''.join(packet)
4885
4886
    @staticmethod
4887
    def from_binary(data):
4888
        obj = AddNodesResponse()
4889
        obj.TypeId = NodeId.from_binary(data)
4890
        obj.ResponseHeader = ResponseHeader.from_binary(data)
4891
        length = uabin.Primitives.Int32.unpack(data)
4892 1
        array = []
4893
        if length != -1:
4894
            for _ in range(0, length):
4895
                array.append(AddNodesResult.from_binary(data))
4896
        obj.Results = array
4897
        length = uabin.Primitives.Int32.unpack(data)
4898
        array = []
4899
        if length != -1:
4900
            for _ in range(0, length):
4901
                array.append(DiagnosticInfo.from_binary(data))
4902
        obj.DiagnosticInfos = array
4903 1
        return obj
4904
4905
    def __str__(self):
4906
        return 'AddNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
4907 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
4908
               'Results:' + str(self.Results) + ', ' + \
4909
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
4910
4911
    __repr__ = __str__
4912
4913
4914
class AddReferencesItem(FrozenClass):
4915
    '''
4916 1
    A request to add a reference to the server address space.
4917
4918
    :ivar SourceNodeId:
4919
    :vartype SourceNodeId: NodeId
4920
    :ivar ReferenceTypeId:
4921
    :vartype ReferenceTypeId: NodeId
4922
    :ivar IsForward:
4923
    :vartype IsForward: Boolean
4924
    :ivar TargetServerUri:
4925 1
    :vartype TargetServerUri: String
4926
    :ivar TargetNodeId:
4927
    :vartype TargetNodeId: ExpandedNodeId
4928 1
    :ivar TargetNodeClass:
4929
    :vartype TargetNodeClass: NodeClass
4930
    '''
4931
4932
    ua_types = [
4933
        ('SourceNodeId', 'NodeId'),
4934
        ('ReferenceTypeId', 'NodeId'),
4935
        ('IsForward', 'Boolean'),
4936
        ('TargetServerUri', 'String'),
4937
        ('TargetNodeId', 'ExpandedNodeId'),
4938
        ('TargetNodeClass', 'NodeClass'),
4939
               ]
4940
4941
    def __init__(self):
4942
        self.SourceNodeId = NodeId()
4943
        self.ReferenceTypeId = NodeId()
4944
        self.IsForward = True
4945
        self.TargetServerUri = None
4946
        self.TargetNodeId = ExpandedNodeId()
4947
        self.TargetNodeClass = NodeClass(0)
4948 1
        self._freeze = True
4949
4950
    def to_binary(self):
4951
        packet = []
4952
        packet.append(self.SourceNodeId.to_binary())
4953
        packet.append(self.ReferenceTypeId.to_binary())
4954
        packet.append(uabin.Primitives.Boolean.pack(self.IsForward))
4955
        packet.append(uabin.Primitives.String.pack(self.TargetServerUri))
4956
        packet.append(self.TargetNodeId.to_binary())
4957
        packet.append(uabin.Primitives.UInt32.pack(self.TargetNodeClass.value))
4958 1
        return b''.join(packet)
4959 1
4960 1
    @staticmethod
4961 1
    def from_binary(data):
4962 1
        obj = AddReferencesItem()
4963 1
        obj.SourceNodeId = NodeId.from_binary(data)
4964 1
        obj.ReferenceTypeId = NodeId.from_binary(data)
4965 1
        self.IsForward = uabin.Primitives.Boolean.unpack(data)
4966 1
        self.TargetServerUri = uabin.Primitives.String.unpack(data)
4967 1
        obj.TargetNodeId = ExpandedNodeId.from_binary(data)
4968 1
        self.TargetNodeClass = NodeClass(uabin.Primitives.UInt32.unpack(data))
4969 1
        return obj
4970 1
4971
    def __str__(self):
4972 1
        return 'AddReferencesItem(' + 'SourceNodeId:' + str(self.SourceNodeId) + ', ' + \
4973 1
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
4974 1
               'IsForward:' + str(self.IsForward) + ', ' + \
4975 1
               'TargetServerUri:' + str(self.TargetServerUri) + ', ' + \
4976 1
               'TargetNodeId:' + str(self.TargetNodeId) + ', ' + \
4977 1
               'TargetNodeClass:' + str(self.TargetNodeClass) + ')'
4978 1
4979 1
    __repr__ = __str__
4980 1
4981 1
4982
class AddReferencesParameters(FrozenClass):
4983 1
    '''
4984
    :ivar ReferencesToAdd:
4985 1
    :vartype ReferencesToAdd: AddReferencesItem
4986
    '''
4987 1
4988 1
    ua_types = [
4989 1
        ('ReferencesToAdd', 'ListOfAddReferencesItem'),
4990 1
               ]
4991 1
4992 1
    def __init__(self):
4993 1
        self.ReferencesToAdd = []
4994 1
        self._freeze = True
4995
4996 1
    def to_binary(self):
4997
        packet = []
4998
        packet.append(uabin.Primitives.Int32.pack(len(self.ReferencesToAdd)))
4999
        for fieldname in self.ReferencesToAdd:
5000
            packet.append(fieldname.to_binary())
5001
        return b''.join(packet)
5002
5003
    @staticmethod
5004
    def from_binary(data):
5005 1
        obj = AddReferencesParameters()
5006
        length = uabin.Primitives.Int32.unpack(data)
5007
        array = []
5008 1
        if length != -1:
5009
            for _ in range(0, length):
5010
                array.append(AddReferencesItem.from_binary(data))
5011
        obj.ReferencesToAdd = array
5012
        return obj
5013
5014
    def __str__(self):
5015
        return 'AddReferencesParameters(' + 'ReferencesToAdd:' + str(self.ReferencesToAdd) + ')'
5016
5017
    __repr__ = __str__
5018 1
5019
5020
class AddReferencesRequest(FrozenClass):
5021
    '''
5022
    Adds one or more references to the server address space.
5023 1
5024 1
    :ivar TypeId:
5025 1
    :vartype TypeId: NodeId
5026 1
    :ivar RequestHeader:
5027 1
    :vartype RequestHeader: RequestHeader
5028 1
    :ivar Parameters:
5029 1
    :vartype Parameters: AddReferencesParameters
5030 1
    '''
5031
5032 1
    ua_types = [
5033 1
        ('TypeId', 'NodeId'),
5034 1
        ('RequestHeader', 'RequestHeader'),
5035 1
        ('Parameters', 'AddReferencesParameters'),
5036 1
               ]
5037
5038 1
    def __init__(self):
5039
        self.TypeId = FourByteNodeId(ObjectIds.AddReferencesRequest_Encoding_DefaultBinary)
5040 1
        self.RequestHeader = RequestHeader()
5041
        self.Parameters = AddReferencesParameters()
5042 1
        self._freeze = True
5043 1
5044 1
    def to_binary(self):
5045
        packet = []
5046 1
        packet.append(self.TypeId.to_binary())
5047
        packet.append(self.RequestHeader.to_binary())
5048
        packet.append(self.Parameters.to_binary())
5049
        return b''.join(packet)
5050 1
5051
    @staticmethod
5052
    def from_binary(data):
5053 1
        obj = AddReferencesRequest()
5054
        obj.TypeId = NodeId.from_binary(data)
5055
        obj.RequestHeader = RequestHeader.from_binary(data)
5056
        obj.Parameters = AddReferencesParameters.from_binary(data)
5057
        return obj
5058
5059 1
    def __str__(self):
5060
        return 'AddReferencesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5061
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5062
               'Parameters:' + str(self.Parameters) + ')'
5063 1
5064 1
    __repr__ = __str__
5065 1
5066 1
5067 1
class AddReferencesResponse(FrozenClass):
5068 1
    '''
5069 1
    Adds one or more references to the server address space.
5070
5071 1
    :ivar TypeId:
5072 1
    :vartype TypeId: NodeId
5073 1
    :ivar ResponseHeader:
5074 1
    :vartype ResponseHeader: ResponseHeader
5075 1
    :ivar Results:
5076 1
    :vartype Results: StatusCode
5077
    :ivar DiagnosticInfos:
5078 1
    :vartype DiagnosticInfos: DiagnosticInfo
5079
    '''
5080 1
5081
    ua_types = [
5082 1
        ('TypeId', 'NodeId'),
5083 1
        ('ResponseHeader', 'ResponseHeader'),
5084 1
        ('Results', 'ListOfStatusCode'),
5085 1
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
5086 1
               ]
5087 1
5088 1
    def __init__(self):
5089
        self.TypeId = FourByteNodeId(ObjectIds.AddReferencesResponse_Encoding_DefaultBinary)
5090 1
        self.ResponseHeader = ResponseHeader()
5091
        self.Results = []
5092
        self.DiagnosticInfos = []
5093 1
        self._freeze = True
5094
5095
    def to_binary(self):
5096 1
        packet = []
5097
        packet.append(self.TypeId.to_binary())
5098
        packet.append(self.ResponseHeader.to_binary())
5099
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
5100
        for fieldname in self.Results:
5101
            packet.append(fieldname.to_binary())
5102
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
5103
        for fieldname in self.DiagnosticInfos:
5104
            packet.append(fieldname.to_binary())
5105
        return b''.join(packet)
5106
5107
    @staticmethod
5108 1
    def from_binary(data):
5109
        obj = AddReferencesResponse()
5110
        obj.TypeId = NodeId.from_binary(data)
5111
        obj.ResponseHeader = ResponseHeader.from_binary(data)
5112
        length = uabin.Primitives.Int32.unpack(data)
5113
        array = []
5114 1
        if length != -1:
5115 1
            for _ in range(0, length):
5116
                array.append(StatusCode.from_binary(data))
5117
        obj.Results = array
5118
        length = uabin.Primitives.Int32.unpack(data)
5119 1
        array = []
5120 1
        if length != -1:
5121 1
            for _ in range(0, length):
5122 1
                array.append(DiagnosticInfo.from_binary(data))
5123
        obj.DiagnosticInfos = array
5124 1
        return obj
5125 1
5126 1
    def __str__(self):
5127 1
        return 'AddReferencesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5128 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5129 1
               'Results:' + str(self.Results) + ', ' + \
5130
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5131 1
5132
    __repr__ = __str__
5133
5134
5135 1
class DeleteNodesItem(FrozenClass):
5136
    '''
5137
    A request to delete a node to the server address space.
5138
5139
    :ivar NodeId:
5140 1
    :vartype NodeId: NodeId
5141
    :ivar DeleteTargetReferences:
5142
    :vartype DeleteTargetReferences: Boolean
5143
    '''
5144
5145 1
    ua_types = [
5146
        ('NodeId', 'NodeId'),
5147 View Code Duplication
        ('DeleteTargetReferences', 'Boolean'),
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5148 1
               ]
5149
5150
    def __init__(self):
5151
        self.NodeId = NodeId()
5152
        self.DeleteTargetReferences = True
5153
        self._freeze = True
5154
5155
    def to_binary(self):
5156
        packet = []
5157
        packet.append(self.NodeId.to_binary())
5158
        packet.append(uabin.Primitives.Boolean.pack(self.DeleteTargetReferences))
5159
        return b''.join(packet)
5160
5161
    @staticmethod
5162 1
    def from_binary(data):
5163
        obj = DeleteNodesItem()
5164
        obj.NodeId = NodeId.from_binary(data)
5165
        self.DeleteTargetReferences = uabin.Primitives.Boolean.unpack(data)
5166
        return obj
5167
5168
    def __str__(self):
5169 1
        return 'DeleteNodesItem(' + 'NodeId:' + str(self.NodeId) + ', ' + \
5170 1
               'DeleteTargetReferences:' + str(self.DeleteTargetReferences) + ')'
5171 1
5172 1
    __repr__ = __str__
5173 1
5174 1
5175 1
class DeleteNodesParameters(FrozenClass):
5176 1
    '''
5177 1
    :ivar NodesToDelete:
5178 1
    :vartype NodesToDelete: DeleteNodesItem
5179
    '''
5180 1
5181 1
    ua_types = [
5182 1
        ('NodesToDelete', 'ListOfDeleteNodesItem'),
5183 1
               ]
5184 1
5185 1
    def __init__(self):
5186 1
        self.NodesToDelete = []
5187 1
        self._freeze = True
5188 1
5189
    def to_binary(self):
5190 1
        packet = []
5191
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToDelete)))
5192 1
        for fieldname in self.NodesToDelete:
5193
            packet.append(fieldname.to_binary())
5194 1
        return b''.join(packet)
5195
5196 1
    @staticmethod
5197 1
    def from_binary(data):
5198 1
        obj = DeleteNodesParameters()
5199 1
        length = uabin.Primitives.Int32.unpack(data)
5200 1
        array = []
5201 1
        if length != -1:
5202 1
            for _ in range(0, length):
5203 1
                array.append(DeleteNodesItem.from_binary(data))
5204 1
        obj.NodesToDelete = array
5205 1
        return obj
5206 1
5207 1
    def __str__(self):
5208 1
        return 'DeleteNodesParameters(' + 'NodesToDelete:' + str(self.NodesToDelete) + ')'
5209
5210 1
    __repr__ = __str__
5211
5212 1
5213
class DeleteNodesRequest(FrozenClass):
5214
    '''
5215
    Delete one or more nodes from the server address space.
5216
5217
    :ivar TypeId:
5218 1
    :vartype TypeId: NodeId
5219
    :ivar RequestHeader:
5220
    :vartype RequestHeader: RequestHeader
5221 1
    :ivar Parameters:
5222
    :vartype Parameters: DeleteNodesParameters
5223
    '''
5224
5225
    ua_types = [
5226
        ('TypeId', 'NodeId'),
5227
        ('RequestHeader', 'RequestHeader'),
5228
        ('Parameters', 'DeleteNodesParameters'),
5229
               ]
5230
5231
    def __init__(self):
5232
        self.TypeId = FourByteNodeId(ObjectIds.DeleteNodesRequest_Encoding_DefaultBinary)
5233
        self.RequestHeader = RequestHeader()
5234
        self.Parameters = DeleteNodesParameters()
5235
        self._freeze = True
5236
5237
    def to_binary(self):
5238
        packet = []
5239 1
        packet.append(self.TypeId.to_binary())
5240
        packet.append(self.RequestHeader.to_binary())
5241
        packet.append(self.Parameters.to_binary())
5242
        return b''.join(packet)
5243
5244
    @staticmethod
5245
    def from_binary(data):
5246
        obj = DeleteNodesRequest()
5247
        obj.TypeId = NodeId.from_binary(data)
5248 1
        obj.RequestHeader = RequestHeader.from_binary(data)
5249 1
        obj.Parameters = DeleteNodesParameters.from_binary(data)
5250 1
        return obj
5251 1
5252 1
    def __str__(self):
5253 1
        return 'DeleteNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5254 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5255 1
               'Parameters:' + str(self.Parameters) + ')'
5256 1
5257 1
    __repr__ = __str__
5258 1
5259 1
5260
class DeleteNodesResponse(FrozenClass):
5261 1
    '''
5262 1
    Delete one or more nodes from the server address space.
5263 1
5264 1
    :ivar TypeId:
5265 1
    :vartype TypeId: NodeId
5266 1
    :ivar ResponseHeader:
5267 1
    :vartype ResponseHeader: ResponseHeader
5268 1
    :ivar Results:
5269 1
    :vartype Results: StatusCode
5270
    :ivar DiagnosticInfos:
5271 1
    :vartype DiagnosticInfos: DiagnosticInfo
5272
    '''
5273 1
5274
    ua_types = [
5275 1
        ('TypeId', 'NodeId'),
5276 1
        ('ResponseHeader', 'ResponseHeader'),
5277 1
        ('Results', 'ListOfStatusCode'),
5278 1
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
5279 1
               ]
5280 1
5281 1
    def __init__(self):
5282
        self.TypeId = FourByteNodeId(ObjectIds.DeleteNodesResponse_Encoding_DefaultBinary)
5283 1
        self.ResponseHeader = ResponseHeader()
5284
        self.Results = []
5285
        self.DiagnosticInfos = []
5286
        self._freeze = True
5287
5288
    def to_binary(self):
5289
        packet = []
5290
        packet.append(self.TypeId.to_binary())
5291 1
        packet.append(self.ResponseHeader.to_binary())
5292
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
5293
        for fieldname in self.Results:
5294 1
            packet.append(fieldname.to_binary())
5295
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
5296
        for fieldname in self.DiagnosticInfos:
5297
            packet.append(fieldname.to_binary())
5298
        return b''.join(packet)
5299
5300 1
    @staticmethod
5301
    def from_binary(data):
5302
        obj = DeleteNodesResponse()
5303
        obj.TypeId = NodeId.from_binary(data)
5304 1
        obj.ResponseHeader = ResponseHeader.from_binary(data)
5305 1
        length = uabin.Primitives.Int32.unpack(data)
5306 1
        array = []
5307 1
        if length != -1:
5308 1
            for _ in range(0, length):
5309 1
                array.append(StatusCode.from_binary(data))
5310 1
        obj.Results = array
5311
        length = uabin.Primitives.Int32.unpack(data)
5312 1
        array = []
5313 1
        if length != -1:
5314 1
            for _ in range(0, length):
5315 1
                array.append(DiagnosticInfo.from_binary(data))
5316 1
        obj.DiagnosticInfos = array
5317 1
        return obj
5318
5319 1
    def __str__(self):
5320
        return 'DeleteNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5321 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5322
               'Results:' + str(self.Results) + ', ' + \
5323 1
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5324 1
5325 1
    __repr__ = __str__
5326 1
5327 1
5328 1
class DeleteReferencesItem(FrozenClass):
5329 1
    '''
5330
    A request to delete a node from the server address space.
5331 1
5332
    :ivar SourceNodeId:
5333
    :vartype SourceNodeId: NodeId
5334 1
    :ivar ReferenceTypeId:
5335
    :vartype ReferenceTypeId: NodeId
5336
    :ivar IsForward:
5337 1
    :vartype IsForward: Boolean
5338
    :ivar TargetNodeId:
5339
    :vartype TargetNodeId: ExpandedNodeId
5340
    :ivar DeleteBidirectional:
5341
    :vartype DeleteBidirectional: Boolean
5342
    '''
5343
5344
    ua_types = [
5345
        ('SourceNodeId', 'NodeId'),
5346
        ('ReferenceTypeId', 'NodeId'),
5347
        ('IsForward', 'Boolean'),
5348
        ('TargetNodeId', 'ExpandedNodeId'),
5349 1
        ('DeleteBidirectional', 'Boolean'),
5350
               ]
5351
5352
    def __init__(self):
5353
        self.SourceNodeId = NodeId()
5354
        self.ReferenceTypeId = NodeId()
5355 1
        self.IsForward = True
5356 1
        self.TargetNodeId = ExpandedNodeId()
5357
        self.DeleteBidirectional = True
5358
        self._freeze = True
5359
5360 1
    def to_binary(self):
5361 1
        packet = []
5362 1
        packet.append(self.SourceNodeId.to_binary())
5363 1
        packet.append(self.ReferenceTypeId.to_binary())
5364
        packet.append(uabin.Primitives.Boolean.pack(self.IsForward))
5365 1
        packet.append(self.TargetNodeId.to_binary())
5366 1
        packet.append(uabin.Primitives.Boolean.pack(self.DeleteBidirectional))
5367 1
        return b''.join(packet)
5368 1
5369 1
    @staticmethod
5370 1
    def from_binary(data):
5371
        obj = DeleteReferencesItem()
5372 1
        obj.SourceNodeId = NodeId.from_binary(data)
5373
        obj.ReferenceTypeId = NodeId.from_binary(data)
5374
        self.IsForward = uabin.Primitives.Boolean.unpack(data)
5375
        obj.TargetNodeId = ExpandedNodeId.from_binary(data)
5376 1
        self.DeleteBidirectional = uabin.Primitives.Boolean.unpack(data)
5377
        return obj
5378
5379
    def __str__(self):
5380
        return 'DeleteReferencesItem(' + 'SourceNodeId:' + str(self.SourceNodeId) + ', ' + \
5381 1
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
5382
               'IsForward:' + str(self.IsForward) + ', ' + \
5383
               'TargetNodeId:' + str(self.TargetNodeId) + ', ' + \
5384
               'DeleteBidirectional:' + str(self.DeleteBidirectional) + ')'
5385
5386 1
    __repr__ = __str__
5387
5388
5389 1
class DeleteReferencesParameters(FrozenClass):
5390
    '''
5391
    :ivar ReferencesToDelete:
5392
    :vartype ReferencesToDelete: DeleteReferencesItem
5393
    '''
5394
5395
    ua_types = [
5396
        ('ReferencesToDelete', 'ListOfDeleteReferencesItem'),
5397
               ]
5398
5399
    def __init__(self):
5400
        self.ReferencesToDelete = []
5401
        self._freeze = True
5402
5403 1
    def to_binary(self):
5404
        packet = []
5405
        packet.append(uabin.Primitives.Int32.pack(len(self.ReferencesToDelete)))
5406
        for fieldname in self.ReferencesToDelete:
5407
            packet.append(fieldname.to_binary())
5408
        return b''.join(packet)
5409
5410 1
    @staticmethod
5411 1
    def from_binary(data):
5412 1
        obj = DeleteReferencesParameters()
5413 1
        length = uabin.Primitives.Int32.unpack(data)
5414 1
        array = []
5415 1
        if length != -1:
5416 1
            for _ in range(0, length):
5417 1
                array.append(DeleteReferencesItem.from_binary(data))
5418 1
        obj.ReferencesToDelete = array
5419 1
        return obj
5420
5421 1
    def __str__(self):
5422 1
        return 'DeleteReferencesParameters(' + 'ReferencesToDelete:' + str(self.ReferencesToDelete) + ')'
5423 1
5424 1
    __repr__ = __str__
5425 1
5426 1
5427 1
class DeleteReferencesRequest(FrozenClass):
5428 1
    '''
5429 1
    Delete one or more references from the server address space.
5430
5431 1
    :ivar TypeId:
5432
    :vartype TypeId: NodeId
5433 1
    :ivar RequestHeader:
5434
    :vartype RequestHeader: RequestHeader
5435 1
    :ivar Parameters:
5436
    :vartype Parameters: DeleteReferencesParameters
5437 1
    '''
5438 1
5439 1
    ua_types = [
5440 1
        ('TypeId', 'NodeId'),
5441 1
        ('RequestHeader', 'RequestHeader'),
5442 1
        ('Parameters', 'DeleteReferencesParameters'),
5443 1
               ]
5444 1
5445 1
    def __init__(self):
5446 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteReferencesRequest_Encoding_DefaultBinary)
5447 1
        self.RequestHeader = RequestHeader()
5448 1
        self.Parameters = DeleteReferencesParameters()
5449 1
        self._freeze = True
5450
5451 1
    def to_binary(self):
5452
        packet = []
5453 1
        packet.append(self.TypeId.to_binary())
5454
        packet.append(self.RequestHeader.to_binary())
5455
        packet.append(self.Parameters.to_binary())
5456
        return b''.join(packet)
5457
5458
    @staticmethod
5459 1
    def from_binary(data):
5460
        obj = DeleteReferencesRequest()
5461
        obj.TypeId = NodeId.from_binary(data)
5462 1
        obj.RequestHeader = RequestHeader.from_binary(data)
5463
        obj.Parameters = DeleteReferencesParameters.from_binary(data)
5464
        return obj
5465
5466
    def __str__(self):
5467
        return 'DeleteReferencesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5468
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5469
               'Parameters:' + str(self.Parameters) + ')'
5470
5471
    __repr__ = __str__
5472 1
5473
5474
class DeleteReferencesResult(FrozenClass):
5475
    '''
5476
    :ivar Results:
5477 1
    :vartype Results: StatusCode
5478 1
    :ivar DiagnosticInfos:
5479 1
    :vartype DiagnosticInfos: DiagnosticInfo
5480 1
    '''
5481 1
5482 1
    ua_types = [
5483 1
        ('Results', 'ListOfStatusCode'),
5484 1
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
5485
               ]
5486 1
5487 1
    def __init__(self):
5488 1
        self.Results = []
5489 1
        self.DiagnosticInfos = []
5490 1
        self._freeze = True
5491
5492 1
    def to_binary(self):
5493
        packet = []
5494 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
5495
        for fieldname in self.Results:
5496 1
            packet.append(fieldname.to_binary())
5497 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
5498 1
        for fieldname in self.DiagnosticInfos:
5499
            packet.append(fieldname.to_binary())
5500 1
        return b''.join(packet)
5501
5502
    @staticmethod
5503
    def from_binary(data):
5504 1
        obj = DeleteReferencesResult()
5505
        length = uabin.Primitives.Int32.unpack(data)
5506
        array = []
5507 1
        if length != -1:
5508
            for _ in range(0, length):
5509
                array.append(StatusCode.from_binary(data))
5510
        obj.Results = array
5511
        length = uabin.Primitives.Int32.unpack(data)
5512
        array = []
5513 1
        if length != -1:
5514
            for _ in range(0, length):
5515
                array.append(DiagnosticInfo.from_binary(data))
5516
        obj.DiagnosticInfos = array
5517 1
        return obj
5518 1
5519 1
    def __str__(self):
5520 1
        return 'DeleteReferencesResult(' + 'Results:' + str(self.Results) + ', ' + \
5521 1
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5522 1
5523 1
    __repr__ = __str__
5524
5525 1
5526 1
class DeleteReferencesResponse(FrozenClass):
5527 1
    '''
5528 1
    Delete one or more references from the server address space.
5529 1
5530 1
    :ivar TypeId:
5531
    :vartype TypeId: NodeId
5532 1
    :ivar ResponseHeader:
5533
    :vartype ResponseHeader: ResponseHeader
5534 1
    :ivar Parameters:
5535
    :vartype Parameters: DeleteReferencesResult
5536 1
    '''
5537 1
5538 1
    ua_types = [
5539 1
        ('TypeId', 'NodeId'),
5540 1
        ('ResponseHeader', 'ResponseHeader'),
5541 1
        ('Parameters', 'DeleteReferencesResult'),
5542 1
               ]
5543
5544 1
    def __init__(self):
5545
        self.TypeId = FourByteNodeId(ObjectIds.DeleteReferencesResponse_Encoding_DefaultBinary)
5546
        self.ResponseHeader = ResponseHeader()
5547 1
        self.Parameters = DeleteReferencesResult()
5548
        self._freeze = True
5549
5550 1
    def to_binary(self):
5551
        packet = []
5552
        packet.append(self.TypeId.to_binary())
5553
        packet.append(self.ResponseHeader.to_binary())
5554
        packet.append(self.Parameters.to_binary())
5555
        return b''.join(packet)
5556
5557
    @staticmethod
5558
    def from_binary(data):
5559
        obj = DeleteReferencesResponse()
5560
        obj.TypeId = NodeId.from_binary(data)
5561
        obj.ResponseHeader = ResponseHeader.from_binary(data)
5562 1
        obj.Parameters = DeleteReferencesResult.from_binary(data)
5563
        return obj
5564
5565
    def __str__(self):
5566
        return 'DeleteReferencesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5567
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5568 1
               'Parameters:' + str(self.Parameters) + ')'
5569 1
5570
    __repr__ = __str__
5571
5572
5573 1
class ViewDescription(FrozenClass):
5574 1
    '''
5575 1
    The view to browse.
5576 1
5577
    :ivar ViewId:
5578 1
    :vartype ViewId: NodeId
5579 1
    :ivar Timestamp:
5580 1
    :vartype Timestamp: DateTime
5581 1
    :ivar ViewVersion:
5582 1
    :vartype ViewVersion: UInt32
5583 1
    '''
5584
5585 1
    ua_types = [
5586
        ('ViewId', 'NodeId'),
5587
        ('Timestamp', 'DateTime'),
5588
        ('ViewVersion', 'UInt32'),
5589 1
               ]
5590
5591
    def __init__(self):
5592
        self.ViewId = NodeId()
5593
        self.Timestamp = datetime.utcnow()
5594 1
        self.ViewVersion = 0
5595
        self._freeze = True
5596
5597
    def to_binary(self):
5598
        packet = []
5599 1
        packet.append(self.ViewId.to_binary())
5600
        packet.append(uabin.Primitives.DateTime.pack(self.Timestamp))
5601
        packet.append(uabin.Primitives.UInt32.pack(self.ViewVersion))
5602 1
        return b''.join(packet)
5603
5604
    @staticmethod
5605
    def from_binary(data):
5606
        obj = ViewDescription()
5607
        obj.ViewId = NodeId.from_binary(data)
5608
        self.Timestamp = uabin.Primitives.DateTime.unpack(data)
5609
        self.ViewVersion = uabin.Primitives.UInt32.unpack(data)
5610
        return obj
5611
5612
    def __str__(self):
5613
        return 'ViewDescription(' + 'ViewId:' + str(self.ViewId) + ', ' + \
5614
               'Timestamp:' + str(self.Timestamp) + ', ' + \
5615
               'ViewVersion:' + str(self.ViewVersion) + ')'
5616 1
5617
    __repr__ = __str__
5618
5619
5620
class BrowseDescription(FrozenClass):
5621
    '''
5622
    A request to browse the the references from a node.
5623 1
5624 1
    :ivar NodeId:
5625 1
    :vartype NodeId: NodeId
5626 1
    :ivar BrowseDirection:
5627 1
    :vartype BrowseDirection: BrowseDirection
5628 1
    :ivar ReferenceTypeId:
5629 1
    :vartype ReferenceTypeId: NodeId
5630 1
    :ivar IncludeSubtypes:
5631 1
    :vartype IncludeSubtypes: Boolean
5632 1
    :ivar NodeClassMask:
5633
    :vartype NodeClassMask: UInt32
5634 1
    :ivar ResultMask:
5635 1
    :vartype ResultMask: UInt32
5636 1
    '''
5637 1
5638 1
    ua_types = [
5639 1
        ('NodeId', 'NodeId'),
5640 1
        ('BrowseDirection', 'BrowseDirection'),
5641 1
        ('ReferenceTypeId', 'NodeId'),
5642 1
        ('IncludeSubtypes', 'Boolean'),
5643
        ('NodeClassMask', 'UInt32'),
5644 1
        ('ResultMask', 'UInt32'),
5645
               ]
5646 1
5647
    def __init__(self):
5648 1
        self.NodeId = NodeId()
5649
        self.BrowseDirection = BrowseDirection(0)
5650 1
        self.ReferenceTypeId = NodeId()
5651 1
        self.IncludeSubtypes = True
5652 1
        self.NodeClassMask = 0
5653 1
        self.ResultMask = 0
5654 1
        self._freeze = True
5655 1
5656 1
    def to_binary(self):
5657 1
        packet = []
5658 1
        packet.append(self.NodeId.to_binary())
5659 1
        packet.append(uabin.Primitives.UInt32.pack(self.BrowseDirection.value))
5660 1
        packet.append(self.ReferenceTypeId.to_binary())
5661 1
        packet.append(uabin.Primitives.Boolean.pack(self.IncludeSubtypes))
5662 1
        packet.append(uabin.Primitives.UInt32.pack(self.NodeClassMask))
5663
        packet.append(uabin.Primitives.UInt32.pack(self.ResultMask))
5664 1
        return b''.join(packet)
5665
5666 1
    @staticmethod
5667
    def from_binary(data):
5668
        obj = BrowseDescription()
5669
        obj.NodeId = NodeId.from_binary(data)
5670
        self.BrowseDirection = BrowseDirection(uabin.Primitives.UInt32.unpack(data))
5671
        obj.ReferenceTypeId = NodeId.from_binary(data)
5672 1
        self.IncludeSubtypes = uabin.Primitives.Boolean.unpack(data)
5673
        self.NodeClassMask = uabin.Primitives.UInt32.unpack(data)
5674
        self.ResultMask = uabin.Primitives.UInt32.unpack(data)
5675 1
        return obj
5676
5677
    def __str__(self):
5678
        return 'BrowseDescription(' + 'NodeId:' + str(self.NodeId) + ', ' + \
5679
               'BrowseDirection:' + str(self.BrowseDirection) + ', ' + \
5680
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
5681
               'IncludeSubtypes:' + str(self.IncludeSubtypes) + ', ' + \
5682
               'NodeClassMask:' + str(self.NodeClassMask) + ', ' + \
5683
               'ResultMask:' + str(self.ResultMask) + ')'
5684
5685
    __repr__ = __str__
5686
5687
5688
class ReferenceDescription(FrozenClass):
5689
    '''
5690
    The description of a reference.
5691 1
5692
    :ivar ReferenceTypeId:
5693
    :vartype ReferenceTypeId: NodeId
5694
    :ivar IsForward:
5695
    :vartype IsForward: Boolean
5696
    :ivar NodeId:
5697
    :vartype NodeId: ExpandedNodeId
5698
    :ivar BrowseName:
5699 1
    :vartype BrowseName: QualifiedName
5700
    :ivar DisplayName:
5701
    :vartype DisplayName: LocalizedText
5702
    :ivar NodeClass:
5703
    :vartype NodeClass: NodeClass
5704
    :ivar TypeDefinition:
5705
    :vartype TypeDefinition: ExpandedNodeId
5706
    '''
5707
5708
    ua_types = [
5709
        ('ReferenceTypeId', 'NodeId'),
5710
        ('IsForward', 'Boolean'),
5711 1
        ('NodeId', 'ExpandedNodeId'),
5712
        ('BrowseName', 'QualifiedName'),
5713
        ('DisplayName', 'LocalizedText'),
5714
        ('NodeClass', 'NodeClass'),
5715
        ('TypeDefinition', 'ExpandedNodeId'),
5716
               ]
5717
5718
    def __init__(self):
5719
        self.ReferenceTypeId = NodeId()
5720 1
        self.IsForward = True
5721
        self.NodeId = ExpandedNodeId()
5722
        self.BrowseName = QualifiedName()
5723
        self.DisplayName = LocalizedText()
5724 1
        self.NodeClass = NodeClass(0)
5725
        self.TypeDefinition = ExpandedNodeId()
5726
        self._freeze = True
5727
5728
    def to_binary(self):
5729
        packet = []
5730
        packet.append(self.ReferenceTypeId.to_binary())
5731 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsForward))
5732
        packet.append(self.NodeId.to_binary())
5733
        packet.append(self.BrowseName.to_binary())
5734
        packet.append(self.DisplayName.to_binary())
5735
        packet.append(uabin.Primitives.UInt32.pack(self.NodeClass.value))
5736
        packet.append(self.TypeDefinition.to_binary())
5737
        return b''.join(packet)
5738 1
5739 View Code Duplication
    @staticmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5740
    def from_binary(data):
5741 1
        obj = ReferenceDescription()
5742
        obj.ReferenceTypeId = NodeId.from_binary(data)
5743
        self.IsForward = uabin.Primitives.Boolean.unpack(data)
5744
        obj.NodeId = ExpandedNodeId.from_binary(data)
5745
        obj.BrowseName = QualifiedName.from_binary(data)
5746
        obj.DisplayName = LocalizedText.from_binary(data)
5747 1
        self.NodeClass = NodeClass(uabin.Primitives.UInt32.unpack(data))
5748
        obj.TypeDefinition = ExpandedNodeId.from_binary(data)
5749
        return obj
5750
5751 1
    def __str__(self):
5752
        return 'ReferenceDescription(' + 'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
5753
               'IsForward:' + str(self.IsForward) + ', ' + \
5754
               'NodeId:' + str(self.NodeId) + ', ' + \
5755
               'BrowseName:' + str(self.BrowseName) + ', ' + \
5756
               'DisplayName:' + str(self.DisplayName) + ', ' + \
5757
               'NodeClass:' + str(self.NodeClass) + ', ' + \
5758
               'TypeDefinition:' + str(self.TypeDefinition) + ')'
5759 1
5760
    __repr__ = __str__
5761
5762
5763
class BrowseResult(FrozenClass):
5764
    '''
5765
    The result of a browse operation.
5766 1
5767
    :ivar StatusCode:
5768
    :vartype StatusCode: StatusCode
5769
    :ivar ContinuationPoint:
5770 1
    :vartype ContinuationPoint: ByteString
5771
    :ivar References:
5772
    :vartype References: ReferenceDescription
5773
    '''
5774
5775
    ua_types = [
5776
        ('StatusCode', 'StatusCode'),
5777
        ('ContinuationPoint', 'ByteString'),
5778 1
        ('References', 'ListOfReferenceDescription'),
5779
               ]
5780
5781 1
    def __init__(self):
5782
        self.StatusCode = StatusCode()
5783
        self.ContinuationPoint = None
5784 1
        self.References = []
5785
        self._freeze = True
5786
5787
    def to_binary(self):
5788
        packet = []
5789
        packet.append(self.StatusCode.to_binary())
5790
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
5791
        packet.append(uabin.Primitives.Int32.pack(len(self.References)))
5792
        for fieldname in self.References:
5793
            packet.append(fieldname.to_binary())
5794
        return b''.join(packet)
5795
5796 1
    @staticmethod
5797
    def from_binary(data):
5798
        obj = BrowseResult()
5799
        obj.StatusCode = StatusCode.from_binary(data)
5800
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
5801
        length = uabin.Primitives.Int32.unpack(data)
5802 1
        array = []
5803
        if length != -1:
5804
            for _ in range(0, length):
5805
                array.append(ReferenceDescription.from_binary(data))
5806
        obj.References = array
5807
        return obj
5808
5809
    def __str__(self):
5810
        return 'BrowseResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
5811
               'ContinuationPoint:' + str(self.ContinuationPoint) + ', ' + \
5812 1
               'References:' + str(self.References) + ')'
5813
5814
    __repr__ = __str__
5815
5816
5817
class BrowseParameters(FrozenClass):
5818
    '''
5819 1 View Code Duplication
    :ivar View:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5820
    :vartype View: ViewDescription
5821
    :ivar RequestedMaxReferencesPerNode:
5822
    :vartype RequestedMaxReferencesPerNode: UInt32
5823 1
    :ivar NodesToBrowse:
5824
    :vartype NodesToBrowse: BrowseDescription
5825
    '''
5826
5827
    ua_types = [
5828 1
        ('View', 'ViewDescription'),
5829
        ('RequestedMaxReferencesPerNode', 'UInt32'),
5830
        ('NodesToBrowse', 'ListOfBrowseDescription'),
5831
               ]
5832
5833 1
    def __init__(self):
5834
        self.View = ViewDescription()
5835
        self.RequestedMaxReferencesPerNode = 0
5836 1
        self.NodesToBrowse = []
5837
        self._freeze = True
5838
5839
    def to_binary(self):
5840
        packet = []
5841
        packet.append(self.View.to_binary())
5842
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedMaxReferencesPerNode))
5843
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToBrowse)))
5844 1
        for fieldname in self.NodesToBrowse:
5845
            packet.append(fieldname.to_binary())
5846
        return b''.join(packet)
5847
5848
    @staticmethod
5849 1
    def from_binary(data):
5850
        obj = BrowseParameters()
5851
        obj.View = ViewDescription.from_binary(data)
5852
        self.RequestedMaxReferencesPerNode = uabin.Primitives.UInt32.unpack(data)
5853
        length = uabin.Primitives.Int32.unpack(data)
5854
        array = []
5855
        if length != -1:
5856
            for _ in range(0, length):
5857
                array.append(BrowseDescription.from_binary(data))
5858 1
        obj.NodesToBrowse = array
5859
        return obj
5860
5861
    def __str__(self):
5862
        return 'BrowseParameters(' + 'View:' + str(self.View) + ', ' + \
5863
               'RequestedMaxReferencesPerNode:' + str(self.RequestedMaxReferencesPerNode) + ', ' + \
5864
               'NodesToBrowse:' + str(self.NodesToBrowse) + ')'
5865
5866
    __repr__ = __str__
5867 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5868 1
5869
class BrowseRequest(FrozenClass):
5870
    '''
5871
    Browse the references for one or more nodes from the server address space.
5872 1
5873
    :ivar TypeId:
5874
    :vartype TypeId: NodeId
5875
    :ivar RequestHeader:
5876
    :vartype RequestHeader: RequestHeader
5877
    :ivar Parameters:
5878
    :vartype Parameters: BrowseParameters
5879
    '''
5880
5881
    ua_types = [
5882
        ('TypeId', 'NodeId'),
5883
        ('RequestHeader', 'RequestHeader'),
5884
        ('Parameters', 'BrowseParameters'),
5885
               ]
5886 1
5887
    def __init__(self):
5888
        self.TypeId = FourByteNodeId(ObjectIds.BrowseRequest_Encoding_DefaultBinary)
5889
        self.RequestHeader = RequestHeader()
5890 1
        self.Parameters = BrowseParameters()
5891
        self._freeze = True
5892
5893 1
    def to_binary(self):
5894
        packet = []
5895
        packet.append(self.TypeId.to_binary())
5896
        packet.append(self.RequestHeader.to_binary())
5897
        packet.append(self.Parameters.to_binary())
5898
        return b''.join(packet)
5899
5900
    @staticmethod
5901
    def from_binary(data):
5902
        obj = BrowseRequest()
5903
        obj.TypeId = NodeId.from_binary(data)
5904
        obj.RequestHeader = RequestHeader.from_binary(data)
5905 1
        obj.Parameters = BrowseParameters.from_binary(data)
5906
        return obj
5907
5908
    def __str__(self):
5909
        return 'BrowseRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5910
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5911 1
               'Parameters:' + str(self.Parameters) + ')'
5912
5913
    __repr__ = __str__
5914
5915
5916
class BrowseResponse(FrozenClass):
5917
    '''
5918
    Browse the references for one or more nodes from the server address space.
5919
5920
    :ivar TypeId:
5921 1
    :vartype TypeId: NodeId
5922
    :ivar ResponseHeader:
5923
    :vartype ResponseHeader: ResponseHeader
5924
    :ivar Results:
5925
    :vartype Results: BrowseResult
5926
    :ivar DiagnosticInfos:
5927
    :vartype DiagnosticInfos: DiagnosticInfo
5928 1
    '''
5929
5930
    ua_types = [
5931
        ('TypeId', 'NodeId'),
5932 1
        ('ResponseHeader', 'ResponseHeader'),
5933
        ('Results', 'ListOfBrowseResult'),
5934
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
5935
               ]
5936
5937 1
    def __init__(self):
5938
        self.TypeId = FourByteNodeId(ObjectIds.BrowseResponse_Encoding_DefaultBinary)
5939
        self.ResponseHeader = ResponseHeader()
5940
        self.Results = []
5941
        self.DiagnosticInfos = []
5942 1
        self._freeze = True
5943
5944
    def to_binary(self):
5945 1
        packet = []
5946
        packet.append(self.TypeId.to_binary())
5947
        packet.append(self.ResponseHeader.to_binary())
5948
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
5949
        for fieldname in self.Results:
5950
            packet.append(fieldname.to_binary())
5951
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
5952
        for fieldname in self.DiagnosticInfos:
5953
            packet.append(fieldname.to_binary())
5954
        return b''.join(packet)
5955
5956
    @staticmethod
5957 1
    def from_binary(data):
5958
        obj = BrowseResponse()
5959
        obj.TypeId = NodeId.from_binary(data)
5960
        obj.ResponseHeader = ResponseHeader.from_binary(data)
5961
        length = uabin.Primitives.Int32.unpack(data)
5962
        array = []
5963 1
        if length != -1:
5964 1
            for _ in range(0, length):
5965 1
                array.append(BrowseResult.from_binary(data))
5966 1
        obj.Results = array
5967 1
        length = uabin.Primitives.Int32.unpack(data)
5968 1
        array = []
5969 1
        if length != -1:
5970 1
            for _ in range(0, length):
5971 1
                array.append(DiagnosticInfo.from_binary(data))
5972
        obj.DiagnosticInfos = array
5973 1
        return obj
5974 1
5975 1
    def __str__(self):
5976 1
        return 'BrowseResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5977 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5978 1
               'Results:' + str(self.Results) + ', ' + \
5979
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5980 1
5981
    __repr__ = __str__
5982 1
5983
5984 1
class BrowseNextParameters(FrozenClass):
5985 1
    '''
5986 1
    :ivar ReleaseContinuationPoints:
5987 1
    :vartype ReleaseContinuationPoints: Boolean
5988
    :ivar ContinuationPoints:
5989 1
    :vartype ContinuationPoints: ByteString
5990
    '''
5991
5992
    ua_types = [
5993
        ('ReleaseContinuationPoints', 'Boolean'),
5994 1
        ('ContinuationPoints', 'ListOfByteString'),
5995
               ]
5996
5997 1
    def __init__(self):
5998
        self.ReleaseContinuationPoints = True
5999
        self.ContinuationPoints = []
6000
        self._freeze = True
6001
6002
    def to_binary(self):
6003
        packet = []
6004
        packet.append(uabin.Primitives.Boolean.pack(self.ReleaseContinuationPoints))
6005
        packet.append(uabin.Primitives.Int32.pack(len(self.ContinuationPoints)))
6006
        for fieldname in self.ContinuationPoints:
6007
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
6008
        return b''.join(packet)
6009
6010
    @staticmethod
6011
    def from_binary(data):
6012
        obj = BrowseNextParameters()
6013
        self.ReleaseContinuationPoints = uabin.Primitives.Boolean.unpack(data)
6014
        obj.ContinuationPoints = uabin.Primitives.ByteString.unpack_array(data)
6015 1
        return obj
6016
6017
    def __str__(self):
6018
        return 'BrowseNextParameters(' + 'ReleaseContinuationPoints:' + str(self.ReleaseContinuationPoints) + ', ' + \
6019
               'ContinuationPoints:' + str(self.ContinuationPoints) + ')'
6020
6021
    __repr__ = __str__
6022
6023
6024 1
class BrowseNextRequest(FrozenClass):
6025 1
    '''
6026 1
    Continues one or more browse operations.
6027 1
6028 1
    :ivar TypeId:
6029 1
    :vartype TypeId: NodeId
6030 1
    :ivar RequestHeader:
6031 1
    :vartype RequestHeader: RequestHeader
6032 1
    :ivar Parameters:
6033 1
    :vartype Parameters: BrowseNextParameters
6034 1
    '''
6035 1
6036
    ua_types = [
6037 1
        ('TypeId', 'NodeId'),
6038 1
        ('RequestHeader', 'RequestHeader'),
6039 1
        ('Parameters', 'BrowseNextParameters'),
6040 1
               ]
6041 1
6042 1
    def __init__(self):
6043 1
        self.TypeId = FourByteNodeId(ObjectIds.BrowseNextRequest_Encoding_DefaultBinary)
6044 1
        self.RequestHeader = RequestHeader()
6045 1
        self.Parameters = BrowseNextParameters()
6046
        self._freeze = True
6047 1
6048
    def to_binary(self):
6049 1
        packet = []
6050
        packet.append(self.TypeId.to_binary())
6051 1
        packet.append(self.RequestHeader.to_binary())
6052 1
        packet.append(self.Parameters.to_binary())
6053 1
        return b''.join(packet)
6054 1
6055 1
    @staticmethod
6056 1
    def from_binary(data):
6057 1
        obj = BrowseNextRequest()
6058
        obj.TypeId = NodeId.from_binary(data)
6059 1
        obj.RequestHeader = RequestHeader.from_binary(data)
6060
        obj.Parameters = BrowseNextParameters.from_binary(data)
6061
        return obj
6062
6063
    def __str__(self):
6064
        return 'BrowseNextRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6065
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
6066
               'Parameters:' + str(self.Parameters) + ')'
6067 1
6068
    __repr__ = __str__
6069
6070 1
6071
class BrowseNextResult(FrozenClass):
6072
    '''
6073
    :ivar Results:
6074
    :vartype Results: BrowseResult
6075
    :ivar DiagnosticInfos:
6076
    :vartype DiagnosticInfos: DiagnosticInfo
6077
    '''
6078
6079
    ua_types = [
6080
        ('Results', 'ListOfBrowseResult'),
6081
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
6082
               ]
6083
6084
    def __init__(self):
6085
        self.Results = []
6086
        self.DiagnosticInfos = []
6087
        self._freeze = True
6088
6089
    def to_binary(self):
6090 1
        packet = []
6091
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
6092
        for fieldname in self.Results:
6093
            packet.append(fieldname.to_binary())
6094
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
6095
        for fieldname in self.DiagnosticInfos:
6096
            packet.append(fieldname.to_binary())
6097
        return b''.join(packet)
6098
6099
    @staticmethod
6100 1
    def from_binary(data):
6101 1
        obj = BrowseNextResult()
6102 1
        length = uabin.Primitives.Int32.unpack(data)
6103 1
        array = []
6104 1
        if length != -1:
6105 1
            for _ in range(0, length):
6106 1
                array.append(BrowseResult.from_binary(data))
6107 1
        obj.Results = array
6108 1
        length = uabin.Primitives.Int32.unpack(data)
6109 1
        array = []
6110 1
        if length != -1:
6111 1
            for _ in range(0, length):
6112 1
                array.append(DiagnosticInfo.from_binary(data))
6113
        obj.DiagnosticInfos = array
6114 1
        return obj
6115 1
6116 1
    def __str__(self):
6117 1
        return 'BrowseNextResult(' + 'Results:' + str(self.Results) + ', ' + \
6118 1
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
6119 1
6120 1
    __repr__ = __str__
6121 1
6122 1
6123 1
class BrowseNextResponse(FrozenClass):
6124
    '''
6125 1
    Continues one or more browse operations.
6126
6127 1
    :ivar TypeId:
6128
    :vartype TypeId: NodeId
6129 1
    :ivar ResponseHeader:
6130 1
    :vartype ResponseHeader: ResponseHeader
6131 1
    :ivar Parameters:
6132 1
    :vartype Parameters: BrowseNextResult
6133 1
    '''
6134 1
6135 1
    ua_types = [
6136 1
        ('TypeId', 'NodeId'),
6137
        ('ResponseHeader', 'ResponseHeader'),
6138 1
        ('Parameters', 'BrowseNextResult'),
6139
               ]
6140
6141
    def __init__(self):
6142
        self.TypeId = FourByteNodeId(ObjectIds.BrowseNextResponse_Encoding_DefaultBinary)
6143
        self.ResponseHeader = ResponseHeader()
6144
        self.Parameters = BrowseNextResult()
6145
        self._freeze = True
6146
6147 1
    def to_binary(self):
6148
        packet = []
6149
        packet.append(self.TypeId.to_binary())
6150 1
        packet.append(self.ResponseHeader.to_binary())
6151
        packet.append(self.Parameters.to_binary())
6152
        return b''.join(packet)
6153
6154
    @staticmethod
6155
    def from_binary(data):
6156
        obj = BrowseNextResponse()
6157
        obj.TypeId = NodeId.from_binary(data)
6158
        obj.ResponseHeader = ResponseHeader.from_binary(data)
6159
        obj.Parameters = BrowseNextResult.from_binary(data)
6160
        return obj
6161
6162 1
    def __str__(self):
6163
        return 'BrowseNextResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6164
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
6165
               'Parameters:' + str(self.Parameters) + ')'
6166
6167
    __repr__ = __str__
6168 1
6169 1
6170 1
class RelativePathElement(FrozenClass):
6171 1
    '''
6172 1
    An element in a relative path.
6173 1
6174 1
    :ivar ReferenceTypeId:
6175 1
    :vartype ReferenceTypeId: NodeId
6176 1
    :ivar IsInverse:
6177
    :vartype IsInverse: Boolean
6178 1
    :ivar IncludeSubtypes:
6179 1
    :vartype IncludeSubtypes: Boolean
6180 1
    :ivar TargetName:
6181 1
    :vartype TargetName: QualifiedName
6182 1
    '''
6183 1
6184 1
    ua_types = [
6185 1
        ('ReferenceTypeId', 'NodeId'),
6186
        ('IsInverse', 'Boolean'),
6187 1
        ('IncludeSubtypes', 'Boolean'),
6188
        ('TargetName', 'QualifiedName'),
6189 1
               ]
6190
6191 1
    def __init__(self):
6192 1
        self.ReferenceTypeId = NodeId()
6193 1
        self.IsInverse = True
6194 1
        self.IncludeSubtypes = True
6195 1
        self.TargetName = QualifiedName()
6196 1
        self._freeze = True
6197 1
6198 1
    def to_binary(self):
6199 1
        packet = []
6200
        packet.append(self.ReferenceTypeId.to_binary())
6201 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsInverse))
6202
        packet.append(uabin.Primitives.Boolean.pack(self.IncludeSubtypes))
6203
        packet.append(self.TargetName.to_binary())
6204
        return b''.join(packet)
6205
6206 1
    @staticmethod
6207
    def from_binary(data):
6208
        obj = RelativePathElement()
6209 1
        obj.ReferenceTypeId = NodeId.from_binary(data)
6210
        self.IsInverse = uabin.Primitives.Boolean.unpack(data)
6211
        self.IncludeSubtypes = uabin.Primitives.Boolean.unpack(data)
6212
        obj.TargetName = QualifiedName.from_binary(data)
6213
        return obj
6214
6215
    def __str__(self):
6216
        return 'RelativePathElement(' + 'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
6217
               'IsInverse:' + str(self.IsInverse) + ', ' + \
6218
               'IncludeSubtypes:' + str(self.IncludeSubtypes) + ', ' + \
6219 1
               'TargetName:' + str(self.TargetName) + ')'
6220
6221
    __repr__ = __str__
6222
6223
6224
class RelativePath(FrozenClass):
6225 1
    '''
6226 1
    A relative path constructed from reference types and browse names.
6227 1
6228 1
    :ivar Elements:
6229 1
    :vartype Elements: RelativePathElement
6230 1
    '''
6231 1
6232 1
    ua_types = [
6233 1
        ('Elements', 'ListOfRelativePathElement'),
6234
               ]
6235 1
6236 1
    def __init__(self):
6237 1
        self.Elements = []
6238 1
        self._freeze = True
6239 1
6240 1
    def to_binary(self):
6241 1
        packet = []
6242 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Elements)))
6243
        for fieldname in self.Elements:
6244 1
            packet.append(fieldname.to_binary())
6245
        return b''.join(packet)
6246 1
6247
    @staticmethod
6248 1
    def from_binary(data):
6249 1
        obj = RelativePath()
6250 1
        length = uabin.Primitives.Int32.unpack(data)
6251 1
        array = []
6252 1
        if length != -1:
6253 1
            for _ in range(0, length):
6254 1
                array.append(RelativePathElement.from_binary(data))
6255 1
        obj.Elements = array
6256 1
        return obj
6257
6258 1
    def __str__(self):
6259
        return 'RelativePath(' + 'Elements:' + str(self.Elements) + ')'
6260
6261
    __repr__ = __str__
6262
6263 1
6264
class BrowsePath(FrozenClass):
6265
    '''
6266 1
    A request to translate a path into a node id.
6267
6268
    :ivar StartingNode:
6269
    :vartype StartingNode: NodeId
6270
    :ivar RelativePath:
6271
    :vartype RelativePath: RelativePath
6272
    '''
6273
6274
    ua_types = [
6275
        ('StartingNode', 'NodeId'),
6276
        ('RelativePath', 'RelativePath'),
6277
               ]
6278 1
6279
    def __init__(self):
6280
        self.StartingNode = NodeId()
6281
        self.RelativePath = RelativePath()
6282
        self._freeze = True
6283
6284 1
    def to_binary(self):
6285 1
        packet = []
6286
        packet.append(self.StartingNode.to_binary())
6287
        packet.append(self.RelativePath.to_binary())
6288
        return b''.join(packet)
6289 1
6290 1
    @staticmethod
6291 1
    def from_binary(data):
6292 1
        obj = BrowsePath()
6293
        obj.StartingNode = NodeId.from_binary(data)
6294 1
        obj.RelativePath = RelativePath.from_binary(data)
6295 1
        return obj
6296 1
6297 1
    def __str__(self):
6298 1
        return 'BrowsePath(' + 'StartingNode:' + str(self.StartingNode) + ', ' + \
6299 1
               'RelativePath:' + str(self.RelativePath) + ')'
6300
6301 1
    __repr__ = __str__
6302
6303
6304
class BrowsePathTarget(FrozenClass):
6305 1
    '''
6306
    The target of the translated path.
6307
6308
    :ivar TargetId:
6309
    :vartype TargetId: ExpandedNodeId
6310 1
    :ivar RemainingPathIndex:
6311
    :vartype RemainingPathIndex: UInt32
6312
    '''
6313
6314
    ua_types = [
6315 1
        ('TargetId', 'ExpandedNodeId'),
6316
        ('RemainingPathIndex', 'UInt32'),
6317
               ]
6318 1
6319
    def __init__(self):
6320
        self.TargetId = ExpandedNodeId()
6321
        self.RemainingPathIndex = 0
6322
        self._freeze = True
6323
6324
    def to_binary(self):
6325
        packet = []
6326
        packet.append(self.TargetId.to_binary())
6327
        packet.append(uabin.Primitives.UInt32.pack(self.RemainingPathIndex))
6328
        return b''.join(packet)
6329
6330
    @staticmethod
6331
    def from_binary(data):
6332 1
        obj = BrowsePathTarget()
6333
        obj.TargetId = ExpandedNodeId.from_binary(data)
6334
        self.RemainingPathIndex = uabin.Primitives.UInt32.unpack(data)
6335
        return obj
6336
6337
    def __str__(self):
6338
        return 'BrowsePathTarget(' + 'TargetId:' + str(self.TargetId) + ', ' + \
6339 1
               'RemainingPathIndex:' + str(self.RemainingPathIndex) + ')'
6340 1
6341 1
    __repr__ = __str__
6342 1
6343 1
6344 1
class BrowsePathResult(FrozenClass):
6345 1
    '''
6346 1
    The result of a translate opearation.
6347 1
6348 1
    :ivar StatusCode:
6349
    :vartype StatusCode: StatusCode
6350 1
    :ivar Targets:
6351 1
    :vartype Targets: BrowsePathTarget
6352 1
    '''
6353 1
6354 1
    ua_types = [
6355 1
        ('StatusCode', 'StatusCode'),
6356 1
        ('Targets', 'ListOfBrowsePathTarget'),
6357 1
               ]
6358 1
6359
    def __init__(self):
6360 1
        self.StatusCode = StatusCode()
6361
        self.Targets = []
6362 1
        self._freeze = True
6363
6364 1
    def to_binary(self):
6365
        packet = []
6366 1
        packet.append(self.StatusCode.to_binary())
6367 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Targets)))
6368 1
        for fieldname in self.Targets:
6369 1
            packet.append(fieldname.to_binary())
6370 1
        return b''.join(packet)
6371 1
6372 1
    @staticmethod
6373 1
    def from_binary(data):
6374 1
        obj = BrowsePathResult()
6375 1
        obj.StatusCode = StatusCode.from_binary(data)
6376 1
        length = uabin.Primitives.Int32.unpack(data)
6377 1
        array = []
6378 1
        if length != -1:
6379
            for _ in range(0, length):
6380 1
                array.append(BrowsePathTarget.from_binary(data))
6381
        obj.Targets = array
6382 1
        return obj
6383
6384
    def __str__(self):
6385
        return 'BrowsePathResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
6386
               'Targets:' + str(self.Targets) + ')'
6387
6388 1
    __repr__ = __str__
6389
6390
6391 1
class TranslateBrowsePathsToNodeIdsParameters(FrozenClass):
6392
    '''
6393
    :ivar BrowsePaths:
6394
    :vartype BrowsePaths: BrowsePath
6395
    '''
6396
6397
    ua_types = [
6398
        ('BrowsePaths', 'ListOfBrowsePath'),
6399 1
               ]
6400
6401
    def __init__(self):
6402
        self.BrowsePaths = []
6403
        self._freeze = True
6404 1
6405
    def to_binary(self):
6406
        packet = []
6407
        packet.append(uabin.Primitives.Int32.pack(len(self.BrowsePaths)))
6408
        for fieldname in self.BrowsePaths:
6409
            packet.append(fieldname.to_binary())
6410
        return b''.join(packet)
6411
6412
    @staticmethod
6413 1
    def from_binary(data):
6414
        obj = TranslateBrowsePathsToNodeIdsParameters()
6415
        length = uabin.Primitives.Int32.unpack(data)
6416
        array = []
6417
        if length != -1:
6418
            for _ in range(0, length):
6419
                array.append(BrowsePath.from_binary(data))
6420
        obj.BrowsePaths = array
6421 1
        return obj
6422
6423
    def __str__(self):
6424
        return 'TranslateBrowsePathsToNodeIdsParameters(' + 'BrowsePaths:' + str(self.BrowsePaths) + ')'
6425 1
6426
    __repr__ = __str__
6427
6428
6429 1
class TranslateBrowsePathsToNodeIdsRequest(FrozenClass):
6430
    '''
6431
    Translates one or more paths in the server address space.
6432
6433 1
    :ivar TypeId:
6434
    :vartype TypeId: NodeId
6435
    :ivar RequestHeader:
6436 1
    :vartype RequestHeader: RequestHeader
6437
    :ivar Parameters:
6438
    :vartype Parameters: TranslateBrowsePathsToNodeIdsParameters
6439
    '''
6440
6441
    ua_types = [
6442
        ('TypeId', 'NodeId'),
6443
        ('RequestHeader', 'RequestHeader'),
6444
        ('Parameters', 'TranslateBrowsePathsToNodeIdsParameters'),
6445
               ]
6446
6447
    def __init__(self):
6448 1
        self.TypeId = FourByteNodeId(ObjectIds.TranslateBrowsePathsToNodeIdsRequest_Encoding_DefaultBinary)
6449
        self.RequestHeader = RequestHeader()
6450
        self.Parameters = TranslateBrowsePathsToNodeIdsParameters()
6451
        self._freeze = True
6452
6453
    def to_binary(self):
6454 1
        packet = []
6455
        packet.append(self.TypeId.to_binary())
6456
        packet.append(self.RequestHeader.to_binary())
6457
        packet.append(self.Parameters.to_binary())
6458
        return b''.join(packet)
6459
6460
    @staticmethod
6461
    def from_binary(data):
6462
        obj = TranslateBrowsePathsToNodeIdsRequest()
6463
        obj.TypeId = NodeId.from_binary(data)
6464 1
        obj.RequestHeader = RequestHeader.from_binary(data)
6465
        obj.Parameters = TranslateBrowsePathsToNodeIdsParameters.from_binary(data)
6466
        return obj
6467
6468
    def __str__(self):
6469
        return 'TranslateBrowsePathsToNodeIdsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6470
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
6471 1
               'Parameters:' + str(self.Parameters) + ')'
6472
6473
    __repr__ = __str__
6474
6475 1
6476
class TranslateBrowsePathsToNodeIdsResponse(FrozenClass):
6477
    '''
6478
    Translates one or more paths in the server address space.
6479
6480 1
    :ivar TypeId:
6481
    :vartype TypeId: NodeId
6482
    :ivar ResponseHeader:
6483
    :vartype ResponseHeader: ResponseHeader
6484
    :ivar Results:
6485 1
    :vartype Results: BrowsePathResult
6486
    :ivar DiagnosticInfos:
6487
    :vartype DiagnosticInfos: DiagnosticInfo
6488 1
    '''
6489
6490
    ua_types = [
6491
        ('TypeId', 'NodeId'),
6492
        ('ResponseHeader', 'ResponseHeader'),
6493
        ('Results', 'ListOfBrowsePathResult'),
6494
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
6495
               ]
6496 1
6497
    def __init__(self):
6498
        self.TypeId = FourByteNodeId(ObjectIds.TranslateBrowsePathsToNodeIdsResponse_Encoding_DefaultBinary)
6499
        self.ResponseHeader = ResponseHeader()
6500
        self.Results = []
6501 1
        self.DiagnosticInfos = []
6502
        self._freeze = True
6503
6504
    def to_binary(self):
6505
        packet = []
6506
        packet.append(self.TypeId.to_binary())
6507
        packet.append(self.ResponseHeader.to_binary())
6508
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
6509
        for fieldname in self.Results:
6510 1
            packet.append(fieldname.to_binary())
6511
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
6512
        for fieldname in self.DiagnosticInfos:
6513
            packet.append(fieldname.to_binary())
6514
        return b''.join(packet)
6515
6516
    @staticmethod
6517
    def from_binary(data):
6518
        obj = TranslateBrowsePathsToNodeIdsResponse()
6519
        obj.TypeId = NodeId.from_binary(data)
6520 1
        obj.ResponseHeader = ResponseHeader.from_binary(data)
6521
        length = uabin.Primitives.Int32.unpack(data)
6522
        array = []
6523
        if length != -1:
6524 1
            for _ in range(0, length):
6525
                array.append(BrowsePathResult.from_binary(data))
6526
        obj.Results = array
6527
        length = uabin.Primitives.Int32.unpack(data)
6528
        array = []
6529
        if length != -1:
6530
            for _ in range(0, length):
6531
                array.append(DiagnosticInfo.from_binary(data))
6532
        obj.DiagnosticInfos = array
6533
        return obj
6534
6535
    def __str__(self):
6536
        return 'TranslateBrowsePathsToNodeIdsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6537
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
6538 1
               'Results:' + str(self.Results) + ', ' + \
6539
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
6540
6541
    __repr__ = __str__
6542 1
6543
6544
class RegisterNodesParameters(FrozenClass):
6545 1
    '''
6546
    :ivar NodesToRegister:
6547
    :vartype NodesToRegister: NodeId
6548
    '''
6549
6550
    ua_types = [
6551
        ('NodesToRegister', 'ListOfNodeId'),
6552
               ]
6553
6554
    def __init__(self):
6555
        self.NodesToRegister = []
6556
        self._freeze = True
6557 1
6558
    def to_binary(self):
6559
        packet = []
6560
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToRegister)))
6561
        for fieldname in self.NodesToRegister:
6562
            packet.append(fieldname.to_binary())
6563 1
        return b''.join(packet)
6564
6565
    @staticmethod
6566
    def from_binary(data):
6567
        obj = RegisterNodesParameters()
6568
        length = uabin.Primitives.Int32.unpack(data)
6569
        array = []
6570
        if length != -1:
6571
            for _ in range(0, length):
6572
                array.append(NodeId.from_binary(data))
6573 1
        obj.NodesToRegister = array
6574
        return obj
6575
6576
    def __str__(self):
6577
        return 'RegisterNodesParameters(' + 'NodesToRegister:' + str(self.NodesToRegister) + ')'
6578
6579
    __repr__ = __str__
6580 1
6581
6582
class RegisterNodesRequest(FrozenClass):
6583
    '''
6584 1
    Registers one or more nodes for repeated use within a session.
6585
6586
    :ivar TypeId:
6587
    :vartype TypeId: NodeId
6588
    :ivar RequestHeader:
6589 1
    :vartype RequestHeader: RequestHeader
6590
    :ivar Parameters:
6591
    :vartype Parameters: RegisterNodesParameters
6592
    '''
6593
6594 1
    ua_types = [
6595
        ('TypeId', 'NodeId'),
6596
        ('RequestHeader', 'RequestHeader'),
6597 1
        ('Parameters', 'RegisterNodesParameters'),
6598
               ]
6599
6600
    def __init__(self):
6601
        self.TypeId = FourByteNodeId(ObjectIds.RegisterNodesRequest_Encoding_DefaultBinary)
6602
        self.RequestHeader = RequestHeader()
6603
        self.Parameters = RegisterNodesParameters()
6604
        self._freeze = True
6605 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6606
    def to_binary(self):
6607
        packet = []
6608
        packet.append(self.TypeId.to_binary())
6609
        packet.append(self.RequestHeader.to_binary())
6610
        packet.append(self.Parameters.to_binary())
6611 1
        return b''.join(packet)
6612
6613
    @staticmethod
6614
    def from_binary(data):
6615
        obj = RegisterNodesRequest()
6616
        obj.TypeId = NodeId.from_binary(data)
6617
        obj.RequestHeader = RequestHeader.from_binary(data)
6618 1
        obj.Parameters = RegisterNodesParameters.from_binary(data)
6619 1
        return obj
6620 1
6621 1
    def __str__(self):
6622 1
        return 'RegisterNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6623 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
6624 1
               'Parameters:' + str(self.Parameters) + ')'
6625 1
6626 1
    __repr__ = __str__
6627 1
6628
6629 1
class RegisterNodesResult(FrozenClass):
6630 1
    '''
6631 1
    :ivar RegisteredNodeIds:
6632 1
    :vartype RegisteredNodeIds: NodeId
6633 1
    '''
6634 1
6635 1
    ua_types = [
6636
        ('RegisteredNodeIds', 'ListOfNodeId'),
6637 1
               ]
6638
6639 1
    def __init__(self):
6640
        self.RegisteredNodeIds = []
6641 1
        self._freeze = True
6642 1
6643 1
    def to_binary(self):
6644 1
        packet = []
6645 1
        packet.append(uabin.Primitives.Int32.pack(len(self.RegisteredNodeIds)))
6646
        for fieldname in self.RegisteredNodeIds:
6647 1
            packet.append(fieldname.to_binary())
6648
        return b''.join(packet)
6649
6650
    @staticmethod
6651
    def from_binary(data):
6652
        obj = RegisterNodesResult()
6653 1
        length = uabin.Primitives.Int32.unpack(data)
6654
        array = []
6655
        if length != -1:
6656 1
            for _ in range(0, length):
6657
                array.append(NodeId.from_binary(data))
6658
        obj.RegisteredNodeIds = array
6659
        return obj
6660
6661
    def __str__(self):
6662
        return 'RegisterNodesResult(' + 'RegisteredNodeIds:' + str(self.RegisteredNodeIds) + ')'
6663
6664 1
    __repr__ = __str__
6665
6666
6667
class RegisterNodesResponse(FrozenClass):
6668 1
    '''
6669 1
    Registers one or more nodes for repeated use within a session.
6670 1
6671 1
    :ivar TypeId:
6672 1
    :vartype TypeId: NodeId
6673 1
    :ivar ResponseHeader:
6674 1
    :vartype ResponseHeader: ResponseHeader
6675
    :ivar Parameters:
6676 1
    :vartype Parameters: RegisterNodesResult
6677 1
    '''
6678 1
6679 1
    ua_types = [
6680 1
        ('TypeId', 'NodeId'),
6681 1
        ('ResponseHeader', 'ResponseHeader'),
6682
        ('Parameters', 'RegisterNodesResult'),
6683 1
               ]
6684
6685 1
    def __init__(self):
6686
        self.TypeId = FourByteNodeId(ObjectIds.RegisterNodesResponse_Encoding_DefaultBinary)
6687 1
        self.ResponseHeader = ResponseHeader()
6688 1
        self.Parameters = RegisterNodesResult()
6689 1
        self._freeze = True
6690 1
6691 1
    def to_binary(self):
6692 1
        packet = []
6693 1
        packet.append(self.TypeId.to_binary())
6694
        packet.append(self.ResponseHeader.to_binary())
6695 1
        packet.append(self.Parameters.to_binary())
6696
        return b''.join(packet)
6697
6698 1
    @staticmethod
6699
    def from_binary(data):
6700
        obj = RegisterNodesResponse()
6701 1
        obj.TypeId = NodeId.from_binary(data)
6702
        obj.ResponseHeader = ResponseHeader.from_binary(data)
6703
        obj.Parameters = RegisterNodesResult.from_binary(data)
6704
        return obj
6705
6706
    def __str__(self):
6707
        return 'RegisterNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6708
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
6709
               'Parameters:' + str(self.Parameters) + ')'
6710
6711 1
    __repr__ = __str__
6712
6713
6714
class UnregisterNodesParameters(FrozenClass):
6715
    '''
6716 1
    :ivar NodesToUnregister:
6717 1
    :vartype NodesToUnregister: NodeId
6718 1
    '''
6719 1
6720 1
    ua_types = [
6721 1
        ('NodesToUnregister', 'ListOfNodeId'),
6722 1
               ]
6723 1
6724
    def __init__(self):
6725 1
        self.NodesToUnregister = []
6726 1
        self._freeze = True
6727 1
6728 1
    def to_binary(self):
6729 1
        packet = []
6730
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToUnregister)))
6731 1
        for fieldname in self.NodesToUnregister:
6732
            packet.append(fieldname.to_binary())
6733 1
        return b''.join(packet)
6734
6735 1
    @staticmethod
6736 1
    def from_binary(data):
6737 1
        obj = UnregisterNodesParameters()
6738
        length = uabin.Primitives.Int32.unpack(data)
6739 1
        array = []
6740
        if length != -1:
6741
            for _ in range(0, length):
6742
                array.append(NodeId.from_binary(data))
6743 1
        obj.NodesToUnregister = array
6744
        return obj
6745
6746 1
    def __str__(self):
6747
        return 'UnregisterNodesParameters(' + 'NodesToUnregister:' + str(self.NodesToUnregister) + ')'
6748
6749
    __repr__ = __str__
6750
6751
6752
class UnregisterNodesRequest(FrozenClass):
6753
    '''
6754
    Unregisters one or more previously registered nodes.
6755
6756 1
    :ivar TypeId:
6757
    :vartype TypeId: NodeId
6758
    :ivar RequestHeader:
6759
    :vartype RequestHeader: RequestHeader
6760
    :ivar Parameters:
6761 1
    :vartype Parameters: UnregisterNodesParameters
6762 1
    '''
6763 1
6764 1
    ua_types = [
6765 1
        ('TypeId', 'NodeId'),
6766 1
        ('RequestHeader', 'RequestHeader'),
6767 1
        ('Parameters', 'UnregisterNodesParameters'),
6768 1
               ]
6769
6770 1
    def __init__(self):
6771 1
        self.TypeId = FourByteNodeId(ObjectIds.UnregisterNodesRequest_Encoding_DefaultBinary)
6772 1
        self.RequestHeader = RequestHeader()
6773 1
        self.Parameters = UnregisterNodesParameters()
6774 1
        self._freeze = True
6775
6776 1
    def to_binary(self):
6777
        packet = []
6778 1
        packet.append(self.TypeId.to_binary())
6779
        packet.append(self.RequestHeader.to_binary())
6780 1
        packet.append(self.Parameters.to_binary())
6781 1
        return b''.join(packet)
6782 1
6783
    @staticmethod
6784 1
    def from_binary(data):
6785
        obj = UnregisterNodesRequest()
6786
        obj.TypeId = NodeId.from_binary(data)
6787
        obj.RequestHeader = RequestHeader.from_binary(data)
6788 1
        obj.Parameters = UnregisterNodesParameters.from_binary(data)
6789
        return obj
6790
6791 1
    def __str__(self):
6792
        return 'UnregisterNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6793
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
6794
               'Parameters:' + str(self.Parameters) + ')'
6795
6796
    __repr__ = __str__
6797
6798
6799
class UnregisterNodesResponse(FrozenClass):
6800
    '''
6801 1
    Unregisters one or more previously registered nodes.
6802
6803
    :ivar TypeId:
6804
    :vartype TypeId: NodeId
6805
    :ivar ResponseHeader:
6806 1
    :vartype ResponseHeader: ResponseHeader
6807 1
    '''
6808 1
6809 1
    ua_types = [
6810 1
        ('TypeId', 'NodeId'),
6811 1
        ('ResponseHeader', 'ResponseHeader'),
6812 1
               ]
6813 1
6814
    def __init__(self):
6815 1
        self.TypeId = FourByteNodeId(ObjectIds.UnregisterNodesResponse_Encoding_DefaultBinary)
6816 1
        self.ResponseHeader = ResponseHeader()
6817 1
        self._freeze = True
6818 1
6819 1
    def to_binary(self):
6820 1
        packet = []
6821 1
        packet.append(self.TypeId.to_binary())
6822
        packet.append(self.ResponseHeader.to_binary())
6823 1
        return b''.join(packet)
6824
6825 1
    @staticmethod
6826
    def from_binary(data):
6827 1
        obj = UnregisterNodesResponse()
6828 1
        obj.TypeId = NodeId.from_binary(data)
6829 1
        obj.ResponseHeader = ResponseHeader.from_binary(data)
6830 1
        return obj
6831 1
6832 1
    def __str__(self):
6833 1
        return 'UnregisterNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6834 1
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
6835
6836 1
    __repr__ = __str__
6837
6838
6839
class EndpointConfiguration(FrozenClass):
6840 1
    '''
6841
    :ivar OperationTimeout:
6842
    :vartype OperationTimeout: Int32
6843 1
    :ivar UseBinaryEncoding:
6844
    :vartype UseBinaryEncoding: Boolean
6845
    :ivar MaxStringLength:
6846
    :vartype MaxStringLength: Int32
6847
    :ivar MaxByteStringLength:
6848
    :vartype MaxByteStringLength: Int32
6849 1
    :ivar MaxArrayLength:
6850
    :vartype MaxArrayLength: Int32
6851
    :ivar MaxMessageSize:
6852
    :vartype MaxMessageSize: Int32
6853 1
    :ivar MaxBufferSize:
6854 1
    :vartype MaxBufferSize: Int32
6855 1
    :ivar ChannelLifetime:
6856 1
    :vartype ChannelLifetime: Int32
6857 1
    :ivar SecurityTokenLifetime:
6858 1
    :vartype SecurityTokenLifetime: Int32
6859 1
    '''
6860
6861 1
    ua_types = [
6862 1
        ('OperationTimeout', 'Int32'),
6863 1
        ('UseBinaryEncoding', 'Boolean'),
6864 1
        ('MaxStringLength', 'Int32'),
6865 1
        ('MaxByteStringLength', 'Int32'),
6866 1
        ('MaxArrayLength', 'Int32'),
6867
        ('MaxMessageSize', 'Int32'),
6868 1
        ('MaxBufferSize', 'Int32'),
6869
        ('ChannelLifetime', 'Int32'),
6870 1
        ('SecurityTokenLifetime', 'Int32'),
6871
               ]
6872 1
6873 1
    def __init__(self):
6874 1
        self.OperationTimeout = 0
6875 1
        self.UseBinaryEncoding = True
6876 1
        self.MaxStringLength = 0
6877 1
        self.MaxByteStringLength = 0
6878 1
        self.MaxArrayLength = 0
6879
        self.MaxMessageSize = 0
6880 1
        self.MaxBufferSize = 0
6881
        self.ChannelLifetime = 0
6882
        self.SecurityTokenLifetime = 0
6883 1
        self._freeze = True
6884
6885
    def to_binary(self):
6886 1
        packet = []
6887
        packet.append(uabin.Primitives.Int32.pack(self.OperationTimeout))
6888
        packet.append(uabin.Primitives.Boolean.pack(self.UseBinaryEncoding))
6889
        packet.append(uabin.Primitives.Int32.pack(self.MaxStringLength))
6890
        packet.append(uabin.Primitives.Int32.pack(self.MaxByteStringLength))
6891
        packet.append(uabin.Primitives.Int32.pack(self.MaxArrayLength))
6892
        packet.append(uabin.Primitives.Int32.pack(self.MaxMessageSize))
6893
        packet.append(uabin.Primitives.Int32.pack(self.MaxBufferSize))
6894
        packet.append(uabin.Primitives.Int32.pack(self.ChannelLifetime))
6895
        packet.append(uabin.Primitives.Int32.pack(self.SecurityTokenLifetime))
6896
        return b''.join(packet)
6897
6898 1
    @staticmethod
6899
    def from_binary(data):
6900
        obj = EndpointConfiguration()
6901
        self.OperationTimeout = uabin.Primitives.Int32.unpack(data)
6902
        self.UseBinaryEncoding = uabin.Primitives.Boolean.unpack(data)
6903
        self.MaxStringLength = uabin.Primitives.Int32.unpack(data)
6904 1
        self.MaxByteStringLength = uabin.Primitives.Int32.unpack(data)
6905 1
        self.MaxArrayLength = uabin.Primitives.Int32.unpack(data)
6906
        self.MaxMessageSize = uabin.Primitives.Int32.unpack(data)
6907
        self.MaxBufferSize = uabin.Primitives.Int32.unpack(data)
6908
        self.ChannelLifetime = uabin.Primitives.Int32.unpack(data)
6909 1
        self.SecurityTokenLifetime = uabin.Primitives.Int32.unpack(data)
6910 1
        return obj
6911 1
6912 1
    def __str__(self):
6913
        return 'EndpointConfiguration(' + 'OperationTimeout:' + str(self.OperationTimeout) + ', ' + \
6914 1
               'UseBinaryEncoding:' + str(self.UseBinaryEncoding) + ', ' + \
6915 1
               'MaxStringLength:' + str(self.MaxStringLength) + ', ' + \
6916 1
               'MaxByteStringLength:' + str(self.MaxByteStringLength) + ', ' + \
6917 1
               'MaxArrayLength:' + str(self.MaxArrayLength) + ', ' + \
6918 1
               'MaxMessageSize:' + str(self.MaxMessageSize) + ', ' + \
6919 1
               'MaxBufferSize:' + str(self.MaxBufferSize) + ', ' + \
6920
               'ChannelLifetime:' + str(self.ChannelLifetime) + ', ' + \
6921 1
               'SecurityTokenLifetime:' + str(self.SecurityTokenLifetime) + ')'
6922
6923
    __repr__ = __str__
6924
6925 1
6926
class SupportedProfile(FrozenClass):
6927
    '''
6928
    :ivar OrganizationUri:
6929
    :vartype OrganizationUri: String
6930 1
    :ivar ProfileId:
6931
    :vartype ProfileId: String
6932
    :ivar ComplianceTool:
6933
    :vartype ComplianceTool: String
6934
    :ivar ComplianceDate:
6935 1
    :vartype ComplianceDate: DateTime
6936
    :ivar ComplianceLevel:
6937
    :vartype ComplianceLevel: ComplianceLevel
6938 1
    :ivar UnsupportedUnitIds:
6939
    :vartype UnsupportedUnitIds: String
6940
    '''
6941
6942
    ua_types = [
6943
        ('OrganizationUri', 'String'),
6944
        ('ProfileId', 'String'),
6945
        ('ComplianceTool', 'String'),
6946
        ('ComplianceDate', 'DateTime'),
6947
        ('ComplianceLevel', 'ComplianceLevel'),
6948
        ('UnsupportedUnitIds', 'ListOfString'),
6949
               ]
6950
6951
    def __init__(self):
6952 1
        self.OrganizationUri = None
6953
        self.ProfileId = None
6954
        self.ComplianceTool = None
6955
        self.ComplianceDate = datetime.utcnow()
6956
        self.ComplianceLevel = ComplianceLevel(0)
6957
        self.UnsupportedUnitIds = []
6958
        self._freeze = True
6959 1
6960 1
    def to_binary(self):
6961 1
        packet = []
6962 1
        packet.append(uabin.Primitives.String.pack(self.OrganizationUri))
6963 1
        packet.append(uabin.Primitives.String.pack(self.ProfileId))
6964 1
        packet.append(uabin.Primitives.String.pack(self.ComplianceTool))
6965 1
        packet.append(uabin.Primitives.DateTime.pack(self.ComplianceDate))
6966 1
        packet.append(uabin.Primitives.UInt32.pack(self.ComplianceLevel.value))
6967 1
        packet.append(uabin.Primitives.Int32.pack(len(self.UnsupportedUnitIds)))
6968 1
        for fieldname in self.UnsupportedUnitIds:
6969
            packet.append(uabin.Primitives.String.pack(fieldname))
6970 1
        return b''.join(packet)
6971 1
6972 1
    @staticmethod
6973 1
    def from_binary(data):
6974 1
        obj = SupportedProfile()
6975 1
        self.OrganizationUri = uabin.Primitives.String.unpack(data)
6976 1
        self.ProfileId = uabin.Primitives.String.unpack(data)
6977 1
        self.ComplianceTool = uabin.Primitives.String.unpack(data)
6978 1
        self.ComplianceDate = uabin.Primitives.DateTime.unpack(data)
6979
        self.ComplianceLevel = ComplianceLevel(uabin.Primitives.UInt32.unpack(data))
6980 1
        obj.UnsupportedUnitIds = uabin.Primitives.String.unpack_array(data)
6981
        return obj
6982 1
6983
    def __str__(self):
6984 1
        return 'SupportedProfile(' + 'OrganizationUri:' + str(self.OrganizationUri) + ', ' + \
6985
               'ProfileId:' + str(self.ProfileId) + ', ' + \
6986 1
               'ComplianceTool:' + str(self.ComplianceTool) + ', ' + \
6987 1
               'ComplianceDate:' + str(self.ComplianceDate) + ', ' + \
6988 1
               'ComplianceLevel:' + str(self.ComplianceLevel) + ', ' + \
6989 1
               'UnsupportedUnitIds:' + str(self.UnsupportedUnitIds) + ')'
6990 1
6991 1
    __repr__ = __str__
6992 1
6993 1
6994 1
class SoftwareCertificate(FrozenClass):
6995 1
    '''
6996 1
    :ivar ProductName:
6997 1
    :vartype ProductName: String
6998 1
    :ivar ProductUri:
6999
    :vartype ProductUri: String
7000 1
    :ivar VendorName:
7001
    :vartype VendorName: String
7002 1
    :ivar VendorProductCertificate:
7003
    :vartype VendorProductCertificate: ByteString
7004
    :ivar SoftwareVersion:
7005
    :vartype SoftwareVersion: String
7006
    :ivar BuildNumber:
7007
    :vartype BuildNumber: String
7008 1
    :ivar BuildDate:
7009
    :vartype BuildDate: DateTime
7010
    :ivar IssuedBy:
7011 1
    :vartype IssuedBy: String
7012
    :ivar IssueDate:
7013
    :vartype IssueDate: DateTime
7014
    :ivar SupportedProfiles:
7015
    :vartype SupportedProfiles: SupportedProfile
7016
    '''
7017 1
7018
    ua_types = [
7019
        ('ProductName', 'String'),
7020
        ('ProductUri', 'String'),
7021 1
        ('VendorName', 'String'),
7022
        ('VendorProductCertificate', 'ByteString'),
7023
        ('SoftwareVersion', 'String'),
7024
        ('BuildNumber', 'String'),
7025
        ('BuildDate', 'DateTime'),
7026
        ('IssuedBy', 'String'),
7027
        ('IssueDate', 'DateTime'),
7028
        ('SupportedProfiles', 'ListOfSupportedProfile'),
7029 1
               ]
7030
7031
    def __init__(self):
7032
        self.ProductName = None
7033
        self.ProductUri = None
7034
        self.VendorName = None
7035
        self.VendorProductCertificate = None
7036 1
        self.SoftwareVersion = None
7037
        self.BuildNumber = None
7038
        self.BuildDate = datetime.utcnow()
7039
        self.IssuedBy = None
7040 1
        self.IssueDate = datetime.utcnow()
7041
        self.SupportedProfiles = []
7042
        self._freeze = True
7043
7044
    def to_binary(self):
7045
        packet = []
7046
        packet.append(uabin.Primitives.String.pack(self.ProductName))
7047
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
7048 1
        packet.append(uabin.Primitives.String.pack(self.VendorName))
7049
        packet.append(uabin.Primitives.ByteString.pack(self.VendorProductCertificate))
7050
        packet.append(uabin.Primitives.String.pack(self.SoftwareVersion))
7051 1
        packet.append(uabin.Primitives.String.pack(self.BuildNumber))
7052
        packet.append(uabin.Primitives.DateTime.pack(self.BuildDate))
7053
        packet.append(uabin.Primitives.String.pack(self.IssuedBy))
7054 1
        packet.append(uabin.Primitives.DateTime.pack(self.IssueDate))
7055
        packet.append(uabin.Primitives.Int32.pack(len(self.SupportedProfiles)))
7056
        for fieldname in self.SupportedProfiles:
7057
            packet.append(fieldname.to_binary())
7058
        return b''.join(packet)
7059
7060
    @staticmethod
7061
    def from_binary(data):
7062
        obj = SoftwareCertificate()
7063
        self.ProductName = uabin.Primitives.String.unpack(data)
7064
        self.ProductUri = uabin.Primitives.String.unpack(data)
7065
        self.VendorName = uabin.Primitives.String.unpack(data)
7066 1
        self.VendorProductCertificate = uabin.Primitives.ByteString.unpack(data)
7067
        self.SoftwareVersion = uabin.Primitives.String.unpack(data)
7068
        self.BuildNumber = uabin.Primitives.String.unpack(data)
7069
        self.BuildDate = uabin.Primitives.DateTime.unpack(data)
7070
        self.IssuedBy = uabin.Primitives.String.unpack(data)
7071
        self.IssueDate = uabin.Primitives.DateTime.unpack(data)
7072 1
        length = uabin.Primitives.Int32.unpack(data)
7073
        array = []
7074
        if length != -1:
7075
            for _ in range(0, length):
7076
                array.append(SupportedProfile.from_binary(data))
7077
        obj.SupportedProfiles = array
7078
        return obj
7079
7080
    def __str__(self):
7081
        return 'SoftwareCertificate(' + 'ProductName:' + str(self.ProductName) + ', ' + \
7082 1
               'ProductUri:' + str(self.ProductUri) + ', ' + \
7083
               'VendorName:' + str(self.VendorName) + ', ' + \
7084
               'VendorProductCertificate:' + str(self.VendorProductCertificate) + ', ' + \
7085
               'SoftwareVersion:' + str(self.SoftwareVersion) + ', ' + \
7086
               'BuildNumber:' + str(self.BuildNumber) + ', ' + \
7087
               'BuildDate:' + str(self.BuildDate) + ', ' + \
7088
               'IssuedBy:' + str(self.IssuedBy) + ', ' + \
7089 1
               'IssueDate:' + str(self.IssueDate) + ', ' + \
7090
               'SupportedProfiles:' + str(self.SupportedProfiles) + ')'
7091
7092
    __repr__ = __str__
7093 1
7094
7095
class QueryDataDescription(FrozenClass):
7096
    '''
7097
    :ivar RelativePath:
7098 1
    :vartype RelativePath: RelativePath
7099
    :ivar AttributeId:
7100
    :vartype AttributeId: UInt32
7101
    :ivar IndexRange:
7102
    :vartype IndexRange: String
7103 1
    '''
7104
7105
    ua_types = [
7106 1
        ('RelativePath', 'RelativePath'),
7107
        ('AttributeId', 'UInt32'),
7108
        ('IndexRange', 'String'),
7109
               ]
7110
7111
    def __init__(self):
7112 1
        self.RelativePath = RelativePath()
7113
        self.AttributeId = 0
7114
        self.IndexRange = None
7115
        self._freeze = True
7116 1
7117
    def to_binary(self):
7118
        packet = []
7119
        packet.append(self.RelativePath.to_binary())
7120
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
7121
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
7122
        return b''.join(packet)
7123
7124 1
    @staticmethod
7125
    def from_binary(data):
7126
        obj = QueryDataDescription()
7127
        obj.RelativePath = RelativePath.from_binary(data)
7128
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
7129
        self.IndexRange = uabin.Primitives.String.unpack(data)
7130
        return obj
7131 1
7132
    def __str__(self):
7133
        return 'QueryDataDescription(' + 'RelativePath:' + str(self.RelativePath) + ', ' + \
7134
               'AttributeId:' + str(self.AttributeId) + ', ' + \
7135 1
               'IndexRange:' + str(self.IndexRange) + ')'
7136
7137
    __repr__ = __str__
7138
7139
7140
class NodeTypeDescription(FrozenClass):
7141
    '''
7142
    :ivar TypeDefinitionNode:
7143 1
    :vartype TypeDefinitionNode: ExpandedNodeId
7144
    :ivar IncludeSubTypes:
7145
    :vartype IncludeSubTypes: Boolean
7146 1
    :ivar DataToReturn:
7147
    :vartype DataToReturn: QueryDataDescription
7148
    '''
7149 1
7150
    ua_types = [
7151
        ('TypeDefinitionNode', 'ExpandedNodeId'),
7152
        ('IncludeSubTypes', 'Boolean'),
7153
        ('DataToReturn', 'ListOfQueryDataDescription'),
7154
               ]
7155
7156
    def __init__(self):
7157
        self.TypeDefinitionNode = ExpandedNodeId()
7158
        self.IncludeSubTypes = True
7159
        self.DataToReturn = []
7160
        self._freeze = True
7161 1
7162
    def to_binary(self):
7163
        packet = []
7164
        packet.append(self.TypeDefinitionNode.to_binary())
7165
        packet.append(uabin.Primitives.Boolean.pack(self.IncludeSubTypes))
7166
        packet.append(uabin.Primitives.Int32.pack(len(self.DataToReturn)))
7167 1
        for fieldname in self.DataToReturn:
7168
            packet.append(fieldname.to_binary())
7169
        return b''.join(packet)
7170
7171 View Code Duplication
    @staticmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7172
    def from_binary(data):
7173
        obj = NodeTypeDescription()
7174
        obj.TypeDefinitionNode = ExpandedNodeId.from_binary(data)
7175
        self.IncludeSubTypes = uabin.Primitives.Boolean.unpack(data)
7176
        length = uabin.Primitives.Int32.unpack(data)
7177 1
        array = []
7178
        if length != -1:
7179
            for _ in range(0, length):
7180
                array.append(QueryDataDescription.from_binary(data))
7181
        obj.DataToReturn = array
7182
        return obj
7183
7184 1
    def __str__(self):
7185
        return 'NodeTypeDescription(' + 'TypeDefinitionNode:' + str(self.TypeDefinitionNode) + ', ' + \
7186
               'IncludeSubTypes:' + str(self.IncludeSubTypes) + ', ' + \
7187
               'DataToReturn:' + str(self.DataToReturn) + ')'
7188 1
7189
    __repr__ = __str__
7190
7191
7192
class QueryDataSet(FrozenClass):
7193 1
    '''
7194
    :ivar NodeId:
7195
    :vartype NodeId: ExpandedNodeId
7196
    :ivar TypeDefinitionNode:
7197
    :vartype TypeDefinitionNode: ExpandedNodeId
7198 1
    :ivar Values:
7199
    :vartype Values: Variant
7200
    '''
7201 1
7202
    ua_types = [
7203
        ('NodeId', 'ExpandedNodeId'),
7204
        ('TypeDefinitionNode', 'ExpandedNodeId'),
7205
        ('Values', 'ListOfVariant'),
7206
               ]
7207 1
7208
    def __init__(self):
7209
        self.NodeId = ExpandedNodeId()
7210
        self.TypeDefinitionNode = ExpandedNodeId()
7211 1
        self.Values = []
7212
        self._freeze = True
7213
7214
    def to_binary(self):
7215
        packet = []
7216
        packet.append(self.NodeId.to_binary())
7217
        packet.append(self.TypeDefinitionNode.to_binary())
7218
        packet.append(uabin.Primitives.Int32.pack(len(self.Values)))
7219 1
        for fieldname in self.Values:
7220
            packet.append(fieldname.to_binary())
7221
        return b''.join(packet)
7222
7223 View Code Duplication
    @staticmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7224
    def from_binary(data):
7225
        obj = QueryDataSet()
7226 1
        obj.NodeId = ExpandedNodeId.from_binary(data)
7227
        obj.TypeDefinitionNode = ExpandedNodeId.from_binary(data)
7228
        length = uabin.Primitives.Int32.unpack(data)
7229
        array = []
7230 1
        if length != -1:
7231
            for _ in range(0, length):
7232
                array.append(Variant.from_binary(data))
7233
        obj.Values = array
7234
        return obj
7235
7236
    def __str__(self):
7237
        return 'QueryDataSet(' + 'NodeId:' + str(self.NodeId) + ', ' + \
7238 1
               'TypeDefinitionNode:' + str(self.TypeDefinitionNode) + ', ' + \
7239
               'Values:' + str(self.Values) + ')'
7240
7241 1
    __repr__ = __str__
7242
7243
7244 1
class NodeReference(FrozenClass):
7245
    '''
7246
    :ivar NodeId:
7247
    :vartype NodeId: NodeId
7248
    :ivar ReferenceTypeId:
7249
    :vartype ReferenceTypeId: NodeId
7250
    :ivar IsForward:
7251
    :vartype IsForward: Boolean
7252
    :ivar ReferencedNodeIds:
7253
    :vartype ReferencedNodeIds: NodeId
7254
    '''
7255
7256 1
    ua_types = [
7257
        ('NodeId', 'NodeId'),
7258
        ('ReferenceTypeId', 'NodeId'),
7259
        ('IsForward', 'Boolean'),
7260
        ('ReferencedNodeIds', 'ListOfNodeId'),
7261
               ]
7262 1
7263
    def __init__(self):
7264
        self.NodeId = NodeId()
7265
        self.ReferenceTypeId = NodeId()
7266
        self.IsForward = True
7267
        self.ReferencedNodeIds = []
7268
        self._freeze = True
7269
7270
    def to_binary(self):
7271
        packet = []
7272 1
        packet.append(self.NodeId.to_binary())
7273
        packet.append(self.ReferenceTypeId.to_binary())
7274
        packet.append(uabin.Primitives.Boolean.pack(self.IsForward))
7275
        packet.append(uabin.Primitives.Int32.pack(len(self.ReferencedNodeIds)))
7276
        for fieldname in self.ReferencedNodeIds:
7277
            packet.append(fieldname.to_binary())
7278
        return b''.join(packet)
7279 1
7280 View Code Duplication
    @staticmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7281
    def from_binary(data):
7282
        obj = NodeReference()
7283 1
        obj.NodeId = NodeId.from_binary(data)
7284
        obj.ReferenceTypeId = NodeId.from_binary(data)
7285
        self.IsForward = uabin.Primitives.Boolean.unpack(data)
7286
        length = uabin.Primitives.Int32.unpack(data)
7287
        array = []
7288 1
        if length != -1:
7289
            for _ in range(0, length):
7290
                array.append(NodeId.from_binary(data))
7291
        obj.ReferencedNodeIds = array
7292
        return obj
7293 1
7294
    def __str__(self):
7295
        return 'NodeReference(' + 'NodeId:' + str(self.NodeId) + ', ' + \
7296 1
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
7297
               'IsForward:' + str(self.IsForward) + ', ' + \
7298
               'ReferencedNodeIds:' + str(self.ReferencedNodeIds) + ')'
7299
7300
    __repr__ = __str__
7301
7302
7303
class ContentFilterElement(FrozenClass):
7304
    '''
7305
    :ivar FilterOperator:
7306 1
    :vartype FilterOperator: FilterOperator
7307
    :ivar FilterOperands:
7308
    :vartype FilterOperands: ExtensionObject
7309
    '''
7310
7311 1
    ua_types = [
7312
        ('FilterOperator', 'FilterOperator'),
7313
        ('FilterOperands', 'ListOfExtensionObject'),
7314
               ]
7315
7316
    def __init__(self):
7317
        self.FilterOperator = FilterOperator(0)
7318
        self.FilterOperands = []
7319
        self._freeze = True
7320 1
7321
    def to_binary(self):
7322
        packet = []
7323
        packet.append(uabin.Primitives.UInt32.pack(self.FilterOperator.value))
7324
        packet.append(uabin.Primitives.Int32.pack(len(self.FilterOperands)))
7325
        for fieldname in self.FilterOperands:
7326 1
            packet.append(uabin.extensionobject_to_binary(fieldname))
7327
        return b''.join(packet)
7328
7329
    @staticmethod
7330 1
    def from_binary(data):
7331
        obj = ContentFilterElement()
7332
        self.FilterOperator = FilterOperator(uabin.Primitives.UInt32.unpack(data))
7333
        length = uabin.Primitives.Int32.unpack(data)
7334 1
        array = []
7335
        if length != -1:
7336
            for _ in range(0, length):
7337
                array.append(uabin.extensionobject_from_binary(data))
7338 1
        obj.FilterOperands = array
7339
        return obj
7340
7341 1
    def __str__(self):
7342
        return 'ContentFilterElement(' + 'FilterOperator:' + str(self.FilterOperator) + ', ' + \
7343
               'FilterOperands:' + str(self.FilterOperands) + ')'
7344
7345
    __repr__ = __str__
7346
7347
7348
class ContentFilter(FrozenClass):
7349
    '''
7350
    :ivar Elements:
7351
    :vartype Elements: ContentFilterElement
7352
    '''
7353
7354
    ua_types = [
7355
        ('Elements', 'ListOfContentFilterElement'),
7356
               ]
7357
7358
    def __init__(self):
7359
        self.Elements = []
7360
        self._freeze = True
7361
7362
    def to_binary(self):
7363 1
        packet = []
7364
        packet.append(uabin.Primitives.Int32.pack(len(self.Elements)))
7365
        for fieldname in self.Elements:
7366
            packet.append(fieldname.to_binary())
7367
        return b''.join(packet)
7368
7369
    @staticmethod
7370 View Code Duplication
    def from_binary(data):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7371
        obj = ContentFilter()
7372
        length = uabin.Primitives.Int32.unpack(data)
7373
        array = []
7374
        if length != -1:
7375 1
            for _ in range(0, length):
7376
                array.append(ContentFilterElement.from_binary(data))
7377
        obj.Elements = array
7378
        return obj
7379
7380
    def __str__(self):
7381
        return 'ContentFilter(' + 'Elements:' + str(self.Elements) + ')'
7382
7383
    __repr__ = __str__
7384
7385
7386
class ElementOperand(FrozenClass):
7387
    '''
7388
    :ivar Index:
7389
    :vartype Index: UInt32
7390
    '''
7391 1
7392
    ua_types = [
7393
        ('Index', 'UInt32'),
7394
               ]
7395
7396
    def __init__(self):
7397
        self.Index = 0
7398
        self._freeze = True
7399
7400
    def to_binary(self):
7401
        packet = []
7402
        packet.append(uabin.Primitives.UInt32.pack(self.Index))
7403
        return b''.join(packet)
7404 1
7405
    @staticmethod
7406
    def from_binary(data):
7407
        obj = ElementOperand()
7408 1
        self.Index = uabin.Primitives.UInt32.unpack(data)
7409
        return obj
7410
7411
    def __str__(self):
7412
        return 'ElementOperand(' + 'Index:' + str(self.Index) + ')'
7413
7414
    __repr__ = __str__
7415
7416
7417
class LiteralOperand(FrozenClass):
7418
    '''
7419 1
    :ivar Value:
7420
    :vartype Value: Variant
7421
    '''
7422
7423
    ua_types = [
7424
        ('Value', 'Variant'),
7425
               ]
7426
7427
    def __init__(self):
7428
        self.Value = Variant()
7429
        self._freeze = True
7430 1
7431
    def to_binary(self):
7432
        packet = []
7433 1
        packet.append(self.Value.to_binary())
7434
        return b''.join(packet)
7435
7436
    @staticmethod
7437
    def from_binary(data):
7438
        obj = LiteralOperand()
7439
        obj.Value = Variant.from_binary(data)
7440
        return obj
7441
7442
    def __str__(self):
7443
        return 'LiteralOperand(' + 'Value:' + str(self.Value) + ')'
7444
7445
    __repr__ = __str__
7446
7447
7448
class AttributeOperand(FrozenClass):
7449 1
    '''
7450
    :ivar NodeId:
7451
    :vartype NodeId: NodeId
7452
    :ivar Alias:
7453
    :vartype Alias: String
7454
    :ivar BrowsePath:
7455
    :vartype BrowsePath: RelativePath
7456
    :ivar AttributeId:
7457
    :vartype AttributeId: UInt32
7458 1
    :ivar IndexRange:
7459
    :vartype IndexRange: String
7460
    '''
7461
7462
    ua_types = [
7463
        ('NodeId', 'NodeId'),
7464
        ('Alias', 'String'),
7465
        ('BrowsePath', 'RelativePath'),
7466
        ('AttributeId', 'UInt32'),
7467
        ('IndexRange', 'String'),
7468
               ]
7469
7470
    def __init__(self):
7471 1
        self.NodeId = NodeId()
7472
        self.Alias = None
7473
        self.BrowsePath = RelativePath()
7474
        self.AttributeId = 0
7475
        self.IndexRange = None
7476
        self._freeze = True
7477
7478
    def to_binary(self):
7479
        packet = []
7480
        packet.append(self.NodeId.to_binary())
7481
        packet.append(uabin.Primitives.String.pack(self.Alias))
7482
        packet.append(self.BrowsePath.to_binary())
7483 1
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
7484
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
7485
        return b''.join(packet)
7486
7487 1
    @staticmethod
7488
    def from_binary(data):
7489
        obj = AttributeOperand()
7490
        obj.NodeId = NodeId.from_binary(data)
7491
        self.Alias = uabin.Primitives.String.unpack(data)
7492
        obj.BrowsePath = RelativePath.from_binary(data)
7493
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
7494
        self.IndexRange = uabin.Primitives.String.unpack(data)
7495 1
        return obj
7496
7497
    def __str__(self):
7498
        return 'AttributeOperand(' + 'NodeId:' + str(self.NodeId) + ', ' + \
7499
               'Alias:' + str(self.Alias) + ', ' + \
7500
               'BrowsePath:' + str(self.BrowsePath) + ', ' + \
7501
               'AttributeId:' + str(self.AttributeId) + ', ' + \
7502
               'IndexRange:' + str(self.IndexRange) + ')'
7503 1
7504
    __repr__ = __str__
7505
7506 1
7507
class SimpleAttributeOperand(FrozenClass):
7508
    '''
7509
    :ivar TypeDefinitionId:
7510
    :vartype TypeDefinitionId: NodeId
7511
    :ivar BrowsePath:
7512
    :vartype BrowsePath: QualifiedName
7513
    :ivar AttributeId:
7514
    :vartype AttributeId: UInt32
7515
    :ivar IndexRange:
7516
    :vartype IndexRange: String
7517
    '''
7518
7519
    ua_types = [
7520
        ('TypeDefinitionId', 'NodeId'),
7521
        ('BrowsePath', 'ListOfQualifiedName'),
7522
        ('AttributeId', 'UInt32'),
7523
        ('IndexRange', 'String'),
7524
               ]
7525
7526
    def __init__(self):
7527
        self.TypeDefinitionId = NodeId()
7528
        self.BrowsePath = []
7529
        self.AttributeId = 0
7530 1
        self.IndexRange = None
7531
        self._freeze = True
7532
7533
    def to_binary(self):
7534
        packet = []
7535
        packet.append(self.TypeDefinitionId.to_binary())
7536
        packet.append(uabin.Primitives.Int32.pack(len(self.BrowsePath)))
7537
        for fieldname in self.BrowsePath:
7538
            packet.append(fieldname.to_binary())
7539
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
7540
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
7541
        return b''.join(packet)
7542
7543 1
    @staticmethod
7544
    def from_binary(data):
7545
        obj = SimpleAttributeOperand()
7546
        obj.TypeDefinitionId = NodeId.from_binary(data)
7547
        length = uabin.Primitives.Int32.unpack(data)
7548
        array = []
7549
        if length != -1:
7550
            for _ in range(0, length):
7551
                array.append(QualifiedName.from_binary(data))
7552
        obj.BrowsePath = array
7553
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
7554
        self.IndexRange = uabin.Primitives.String.unpack(data)
7555
        return obj
7556
7557
    def __str__(self):
7558
        return 'SimpleAttributeOperand(' + 'TypeDefinitionId:' + str(self.TypeDefinitionId) + ', ' + \
7559
               'BrowsePath:' + str(self.BrowsePath) + ', ' + \
7560 1
               'AttributeId:' + str(self.AttributeId) + ', ' + \
7561
               'IndexRange:' + str(self.IndexRange) + ')'
7562
7563
    __repr__ = __str__
7564
7565
7566
class ContentFilterElementResult(FrozenClass):
7567
    '''
7568
    :ivar StatusCode:
7569
    :vartype StatusCode: StatusCode
7570
    :ivar OperandStatusCodes:
7571
    :vartype OperandStatusCodes: StatusCode
7572
    :ivar OperandDiagnosticInfos:
7573
    :vartype OperandDiagnosticInfos: DiagnosticInfo
7574
    '''
7575
7576 1
    ua_types = [
7577
        ('StatusCode', 'StatusCode'),
7578
        ('OperandStatusCodes', 'ListOfStatusCode'),
7579
        ('OperandDiagnosticInfos', 'ListOfDiagnosticInfo'),
7580 1
               ]
7581
7582 View Code Duplication
    def __init__(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7583
        self.StatusCode = StatusCode()
7584
        self.OperandStatusCodes = []
7585
        self.OperandDiagnosticInfos = []
7586
        self._freeze = True
7587
7588
    def to_binary(self):
7589
        packet = []
7590
        packet.append(self.StatusCode.to_binary())
7591
        packet.append(uabin.Primitives.Int32.pack(len(self.OperandStatusCodes)))
7592
        for fieldname in self.OperandStatusCodes:
7593
            packet.append(fieldname.to_binary())
7594
        packet.append(uabin.Primitives.Int32.pack(len(self.OperandDiagnosticInfos)))
7595
        for fieldname in self.OperandDiagnosticInfos:
7596
            packet.append(fieldname.to_binary())
7597 1
        return b''.join(packet)
7598
7599
    @staticmethod
7600
    def from_binary(data):
7601
        obj = ContentFilterElementResult()
7602
        obj.StatusCode = StatusCode.from_binary(data)
7603
        length = uabin.Primitives.Int32.unpack(data)
7604
        array = []
7605
        if length != -1:
7606
            for _ in range(0, length):
7607
                array.append(StatusCode.from_binary(data))
7608
        obj.OperandStatusCodes = array
7609 1
        length = uabin.Primitives.Int32.unpack(data)
7610
        array = []
7611
        if length != -1:
7612 1
            for _ in range(0, length):
7613
                array.append(DiagnosticInfo.from_binary(data))
7614
        obj.OperandDiagnosticInfos = array
7615
        return obj
7616
7617
    def __str__(self):
7618
        return 'ContentFilterElementResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
7619
               'OperandStatusCodes:' + str(self.OperandStatusCodes) + ', ' + \
7620
               'OperandDiagnosticInfos:' + str(self.OperandDiagnosticInfos) + ')'
7621
7622 1
    __repr__ = __str__
7623
7624
7625
class ContentFilterResult(FrozenClass):
7626
    '''
7627
    :ivar ElementResults:
7628 1
    :vartype ElementResults: ContentFilterElementResult
7629
    :ivar ElementDiagnosticInfos:
7630
    :vartype ElementDiagnosticInfos: DiagnosticInfo
7631
    '''
7632
7633
    ua_types = [
7634
        ('ElementResults', 'ListOfContentFilterElementResult'),
7635
        ('ElementDiagnosticInfos', 'ListOfDiagnosticInfo'),
7636
               ]
7637
7638 1
    def __init__(self):
7639
        self.ElementResults = []
7640
        self.ElementDiagnosticInfos = []
7641
        self._freeze = True
7642
7643
    def to_binary(self):
7644
        packet = []
7645 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ElementResults)))
7646
        for fieldname in self.ElementResults:
7647
            packet.append(fieldname.to_binary())
7648
        packet.append(uabin.Primitives.Int32.pack(len(self.ElementDiagnosticInfos)))
7649 1
        for fieldname in self.ElementDiagnosticInfos:
7650
            packet.append(fieldname.to_binary())
7651
        return b''.join(packet)
7652
7653
    @staticmethod
7654 1
    def from_binary(data):
7655
        obj = ContentFilterResult()
7656
        length = uabin.Primitives.Int32.unpack(data)
7657
        array = []
7658
        if length != -1:
7659 1
            for _ in range(0, length):
7660
                array.append(ContentFilterElementResult.from_binary(data))
7661
        obj.ElementResults = array
7662 1
        length = uabin.Primitives.Int32.unpack(data)
7663
        array = []
7664
        if length != -1:
7665
            for _ in range(0, length):
7666
                array.append(DiagnosticInfo.from_binary(data))
7667 View Code Duplication
        obj.ElementDiagnosticInfos = array
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7668
        return obj
7669
7670
    def __str__(self):
7671
        return 'ContentFilterResult(' + 'ElementResults:' + str(self.ElementResults) + ', ' + \
7672 1
               'ElementDiagnosticInfos:' + str(self.ElementDiagnosticInfos) + ')'
7673
7674
    __repr__ = __str__
7675
7676
7677
class ParsingResult(FrozenClass):
7678 1
    '''
7679
    :ivar StatusCode:
7680
    :vartype StatusCode: StatusCode
7681
    :ivar DataStatusCodes:
7682
    :vartype DataStatusCodes: StatusCode
7683
    :ivar DataDiagnosticInfos:
7684
    :vartype DataDiagnosticInfos: DiagnosticInfo
7685
    '''
7686
7687
    ua_types = [
7688 1
        ('StatusCode', 'StatusCode'),
7689
        ('DataStatusCodes', 'ListOfStatusCode'),
7690
        ('DataDiagnosticInfos', 'ListOfDiagnosticInfo'),
7691
               ]
7692
7693
    def __init__(self):
7694
        self.StatusCode = StatusCode()
7695
        self.DataStatusCodes = []
7696
        self.DataDiagnosticInfos = []
7697 1
        self._freeze = True
7698
7699
    def to_binary(self):
7700
        packet = []
7701 1
        packet.append(self.StatusCode.to_binary())
7702
        packet.append(uabin.Primitives.Int32.pack(len(self.DataStatusCodes)))
7703
        for fieldname in self.DataStatusCodes:
7704
            packet.append(fieldname.to_binary())
7705
        packet.append(uabin.Primitives.Int32.pack(len(self.DataDiagnosticInfos)))
7706
        for fieldname in self.DataDiagnosticInfos:
7707
            packet.append(fieldname.to_binary())
7708
        return b''.join(packet)
7709
7710
    @staticmethod
7711 1
    def from_binary(data):
7712
        obj = ParsingResult()
7713
        obj.StatusCode = StatusCode.from_binary(data)
7714
        length = uabin.Primitives.Int32.unpack(data)
7715
        array = []
7716 1
        if length != -1:
7717
            for _ in range(0, length):
7718
                array.append(StatusCode.from_binary(data))
7719 1
        obj.DataStatusCodes = array
7720
        length = uabin.Primitives.Int32.unpack(data)
7721
        array = []
7722
        if length != -1:
7723
            for _ in range(0, length):
7724
                array.append(DiagnosticInfo.from_binary(data))
7725
        obj.DataDiagnosticInfos = array
7726
        return obj
7727
7728
    def __str__(self):
7729 1
        return 'ParsingResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
7730
               'DataStatusCodes:' + str(self.DataStatusCodes) + ', ' + \
7731 View Code Duplication
               'DataDiagnosticInfos:' + str(self.DataDiagnosticInfos) + ')'
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7732
7733
    __repr__ = __str__
7734
7735 1
7736
class QueryFirstParameters(FrozenClass):
7737
    '''
7738
    :ivar View:
7739
    :vartype View: ViewDescription
7740
    :ivar NodeTypes:
7741
    :vartype NodeTypes: NodeTypeDescription
7742
    :ivar Filter:
7743
    :vartype Filter: ContentFilter
7744
    :ivar MaxDataSetsToReturn:
7745 1
    :vartype MaxDataSetsToReturn: UInt32
7746
    :ivar MaxReferencesToReturn:
7747
    :vartype MaxReferencesToReturn: UInt32
7748
    '''
7749
7750
    ua_types = [
7751
        ('View', 'ViewDescription'),
7752
        ('NodeTypes', 'ListOfNodeTypeDescription'),
7753
        ('Filter', 'ContentFilter'),
7754 1
        ('MaxDataSetsToReturn', 'UInt32'),
7755
        ('MaxReferencesToReturn', 'UInt32'),
7756
               ]
7757
7758 1
    def __init__(self):
7759
        self.View = ViewDescription()
7760
        self.NodeTypes = []
7761
        self.Filter = ContentFilter()
7762
        self.MaxDataSetsToReturn = 0
7763
        self.MaxReferencesToReturn = 0
7764
        self._freeze = True
7765
7766
    def to_binary(self):
7767
        packet = []
7768 1
        packet.append(self.View.to_binary())
7769
        packet.append(uabin.Primitives.Int32.pack(len(self.NodeTypes)))
7770
        for fieldname in self.NodeTypes:
7771
            packet.append(fieldname.to_binary())
7772
        packet.append(self.Filter.to_binary())
7773 1
        packet.append(uabin.Primitives.UInt32.pack(self.MaxDataSetsToReturn))
7774
        packet.append(uabin.Primitives.UInt32.pack(self.MaxReferencesToReturn))
7775
        return b''.join(packet)
7776 1
7777
    @staticmethod
7778
    def from_binary(data):
7779
        obj = QueryFirstParameters()
7780
        obj.View = ViewDescription.from_binary(data)
7781
        length = uabin.Primitives.Int32.unpack(data)
7782
        array = []
7783
        if length != -1:
7784
            for _ in range(0, length):
7785
                array.append(NodeTypeDescription.from_binary(data))
7786
        obj.NodeTypes = array
7787
        obj.Filter = ContentFilter.from_binary(data)
7788 1
        self.MaxDataSetsToReturn = uabin.Primitives.UInt32.unpack(data)
7789
        self.MaxReferencesToReturn = uabin.Primitives.UInt32.unpack(data)
7790
        return obj
7791
7792
    def __str__(self):
7793
        return 'QueryFirstParameters(' + 'View:' + str(self.View) + ', ' + \
7794
               'NodeTypes:' + str(self.NodeTypes) + ', ' + \
7795 1
               'Filter:' + str(self.Filter) + ', ' + \
7796
               'MaxDataSetsToReturn:' + str(self.MaxDataSetsToReturn) + ', ' + \
7797
               'MaxReferencesToReturn:' + str(self.MaxReferencesToReturn) + ')'
7798
7799
    __repr__ = __str__
7800
7801
7802
class QueryFirstRequest(FrozenClass):
7803
    '''
7804
    :ivar TypeId:
7805
    :vartype TypeId: NodeId
7806 1
    :ivar RequestHeader:
7807
    :vartype RequestHeader: RequestHeader
7808
    :ivar Parameters:
7809
    :vartype Parameters: QueryFirstParameters
7810
    '''
7811
7812
    ua_types = [
7813
        ('TypeId', 'NodeId'),
7814
        ('RequestHeader', 'RequestHeader'),
7815
        ('Parameters', 'QueryFirstParameters'),
7816 1
               ]
7817
7818
    def __init__(self):
7819
        self.TypeId = FourByteNodeId(ObjectIds.QueryFirstRequest_Encoding_DefaultBinary)
7820 1
        self.RequestHeader = RequestHeader()
7821
        self.Parameters = QueryFirstParameters()
7822
        self._freeze = True
7823
7824
    def to_binary(self):
7825
        packet = []
7826
        packet.append(self.TypeId.to_binary())
7827
        packet.append(self.RequestHeader.to_binary())
7828
        packet.append(self.Parameters.to_binary())
7829
        return b''.join(packet)
7830
7831 1
    @staticmethod
7832
    def from_binary(data):
7833
        obj = QueryFirstRequest()
7834
        obj.TypeId = NodeId.from_binary(data)
7835
        obj.RequestHeader = RequestHeader.from_binary(data)
7836
        obj.Parameters = QueryFirstParameters.from_binary(data)
7837 1
        return obj
7838
7839
    def __str__(self):
7840 1
        return 'QueryFirstRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7841
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
7842
               'Parameters:' + str(self.Parameters) + ')'
7843
7844
    __repr__ = __str__
7845
7846
7847
class QueryFirstResult(FrozenClass):
7848 1
    '''
7849
    :ivar QueryDataSets:
7850
    :vartype QueryDataSets: QueryDataSet
7851
    :ivar ContinuationPoint:
7852
    :vartype ContinuationPoint: ByteString
7853 1
    :ivar ParsingResults:
7854 1
    :vartype ParsingResults: ParsingResult
7855 1
    :ivar DiagnosticInfos:
7856 1
    :vartype DiagnosticInfos: DiagnosticInfo
7857 1
    :ivar FilterResult:
7858 1
    :vartype FilterResult: ContentFilterResult
7859 1
    '''
7860 1
7861
    ua_types = [
7862 1
        ('QueryDataSets', 'ListOfQueryDataSet'),
7863 1
        ('ContinuationPoint', 'ByteString'),
7864 1
        ('ParsingResults', 'ListOfParsingResult'),
7865 1
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
7866 1
        ('FilterResult', 'ContentFilterResult'),
7867 1
               ]
7868 1
7869
    def __init__(self):
7870 1
        self.QueryDataSets = []
7871
        self.ContinuationPoint = None
7872 1
        self.ParsingResults = []
7873
        self.DiagnosticInfos = []
7874 1
        self.FilterResult = ContentFilterResult()
7875 1
        self._freeze = True
7876 1
7877 1
    def to_binary(self):
7878 1
        packet = []
7879 1
        packet.append(uabin.Primitives.Int32.pack(len(self.QueryDataSets)))
7880 1
        for fieldname in self.QueryDataSets:
7881 1
            packet.append(fieldname.to_binary())
7882
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
7883 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ParsingResults)))
7884
        for fieldname in self.ParsingResults:
7885
            packet.append(fieldname.to_binary())
7886
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
7887 1
        for fieldname in self.DiagnosticInfos:
7888
            packet.append(fieldname.to_binary())
7889
        packet.append(self.FilterResult.to_binary())
7890 1
        return b''.join(packet)
7891
7892
    @staticmethod
7893
    def from_binary(data):
7894
        obj = QueryFirstResult()
7895
        length = uabin.Primitives.Int32.unpack(data)
7896 1
        array = []
7897
        if length != -1:
7898
            for _ in range(0, length):
7899
                array.append(QueryDataSet.from_binary(data))
7900 1
        obj.QueryDataSets = array
7901 1
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
7902 1
        length = uabin.Primitives.Int32.unpack(data)
7903 1
        array = []
7904 1
        if length != -1:
7905 1
            for _ in range(0, length):
7906 1
                array.append(ParsingResult.from_binary(data))
7907
        obj.ParsingResults = array
7908 1
        length = uabin.Primitives.Int32.unpack(data)
7909 1
        array = []
7910 1
        if length != -1:
7911 1
            for _ in range(0, length):
7912 1
                array.append(DiagnosticInfo.from_binary(data))
7913 1
        obj.DiagnosticInfos = array
7914
        obj.FilterResult = ContentFilterResult.from_binary(data)
7915 1
        return obj
7916
7917 1
    def __str__(self):
7918
        return 'QueryFirstResult(' + 'QueryDataSets:' + str(self.QueryDataSets) + ', ' + \
7919 1
               'ContinuationPoint:' + str(self.ContinuationPoint) + ', ' + \
7920 1
               'ParsingResults:' + str(self.ParsingResults) + ', ' + \
7921 1
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ', ' + \
7922 1
               'FilterResult:' + str(self.FilterResult) + ')'
7923 1
7924 1
    __repr__ = __str__
7925 1
7926
7927 1
class QueryFirstResponse(FrozenClass):
7928
    '''
7929
    :ivar TypeId:
7930 1
    :vartype TypeId: NodeId
7931
    :ivar ResponseHeader:
7932
    :vartype ResponseHeader: ResponseHeader
7933 1
    :ivar Parameters:
7934
    :vartype Parameters: QueryFirstResult
7935
    '''
7936
7937
    ua_types = [
7938
        ('TypeId', 'NodeId'),
7939 1
        ('ResponseHeader', 'ResponseHeader'),
7940
        ('Parameters', 'QueryFirstResult'),
7941
               ]
7942
7943 1
    def __init__(self):
7944
        self.TypeId = FourByteNodeId(ObjectIds.QueryFirstResponse_Encoding_DefaultBinary)
7945
        self.ResponseHeader = ResponseHeader()
7946
        self.Parameters = QueryFirstResult()
7947
        self._freeze = True
7948
7949
    def to_binary(self):
7950
        packet = []
7951 1
        packet.append(self.TypeId.to_binary())
7952
        packet.append(self.ResponseHeader.to_binary())
7953
        packet.append(self.Parameters.to_binary())
7954
        return b''.join(packet)
7955
7956 1
    @staticmethod
7957
    def from_binary(data):
7958
        obj = QueryFirstResponse()
7959
        obj.TypeId = NodeId.from_binary(data)
7960 1
        obj.ResponseHeader = ResponseHeader.from_binary(data)
7961
        obj.Parameters = QueryFirstResult.from_binary(data)
7962
        return obj
7963 1
7964
    def __str__(self):
7965
        return 'QueryFirstResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7966 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
7967
               'Parameters:' + str(self.Parameters) + ')'
7968
7969 1
    __repr__ = __str__
7970
7971
7972
class QueryNextParameters(FrozenClass):
7973
    '''
7974
    :ivar ReleaseContinuationPoint:
7975 1
    :vartype ReleaseContinuationPoint: Boolean
7976
    :ivar ContinuationPoint:
7977
    :vartype ContinuationPoint: ByteString
7978
    '''
7979 1
7980 1
    ua_types = [
7981 1
        ('ReleaseContinuationPoint', 'Boolean'),
7982 1
        ('ContinuationPoint', 'ByteString'),
7983 1
               ]
7984 1
7985 1
    def __init__(self):
7986
        self.ReleaseContinuationPoint = True
7987 1
        self.ContinuationPoint = None
7988 1
        self._freeze = True
7989 1
7990 1
    def to_binary(self):
7991
        packet = []
7992 1
        packet.append(uabin.Primitives.Boolean.pack(self.ReleaseContinuationPoint))
7993
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
7994 1
        return b''.join(packet)
7995
7996 1
    @staticmethod
7997 1
    def from_binary(data):
7998
        obj = QueryNextParameters()
7999 1
        self.ReleaseContinuationPoint = uabin.Primitives.Boolean.unpack(data)
8000
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
8001
        return obj
8002 1
8003
    def __str__(self):
8004
        return 'QueryNextParameters(' + 'ReleaseContinuationPoint:' + str(self.ReleaseContinuationPoint) + ', ' + \
8005 1
               'ContinuationPoint:' + str(self.ContinuationPoint) + ')'
8006
8007
    __repr__ = __str__
8008
8009
8010
class QueryNextRequest(FrozenClass):
8011
    '''
8012
    :ivar TypeId:
8013
    :vartype TypeId: NodeId
8014
    :ivar RequestHeader:
8015
    :vartype RequestHeader: RequestHeader
8016
    :ivar Parameters:
8017
    :vartype Parameters: QueryNextParameters
8018
    '''
8019 1
8020
    ua_types = [
8021
        ('TypeId', 'NodeId'),
8022
        ('RequestHeader', 'RequestHeader'),
8023
        ('Parameters', 'QueryNextParameters'),
8024 View Code Duplication
               ]
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8025
8026
    def __init__(self):
8027 1
        self.TypeId = FourByteNodeId(ObjectIds.QueryNextRequest_Encoding_DefaultBinary)
8028
        self.RequestHeader = RequestHeader()
8029
        self.Parameters = QueryNextParameters()
8030
        self._freeze = True
8031
8032
    def to_binary(self):
8033
        packet = []
8034
        packet.append(self.TypeId.to_binary())
8035
        packet.append(self.RequestHeader.to_binary())
8036
        packet.append(self.Parameters.to_binary())
8037
        return b''.join(packet)
8038
8039 1
    @staticmethod
8040
    def from_binary(data):
8041
        obj = QueryNextRequest()
8042
        obj.TypeId = NodeId.from_binary(data)
8043
        obj.RequestHeader = RequestHeader.from_binary(data)
8044
        obj.Parameters = QueryNextParameters.from_binary(data)
8045
        return obj
8046
8047
    def __str__(self):
8048 1
        return 'QueryNextRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8049
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
8050
               'Parameters:' + str(self.Parameters) + ')'
8051
8052 1
    __repr__ = __str__
8053
8054
8055
class QueryNextResult(FrozenClass):
8056
    '''
8057
    :ivar QueryDataSets:
8058
    :vartype QueryDataSets: QueryDataSet
8059 1
    :ivar RevisedContinuationPoint:
8060
    :vartype RevisedContinuationPoint: ByteString
8061
    '''
8062
8063
    ua_types = [
8064
        ('QueryDataSets', 'ListOfQueryDataSet'),
8065
        ('RevisedContinuationPoint', 'ByteString'),
8066 1
               ]
8067
8068
    def __init__(self):
8069 1
        self.QueryDataSets = []
8070
        self.RevisedContinuationPoint = None
8071
        self._freeze = True
8072
8073
    def to_binary(self):
8074
        packet = []
8075
        packet.append(uabin.Primitives.Int32.pack(len(self.QueryDataSets)))
8076
        for fieldname in self.QueryDataSets:
8077
            packet.append(fieldname.to_binary())
8078
        packet.append(uabin.Primitives.ByteString.pack(self.RevisedContinuationPoint))
8079
        return b''.join(packet)
8080
8081 1
    @staticmethod
8082
    def from_binary(data):
8083
        obj = QueryNextResult()
8084
        length = uabin.Primitives.Int32.unpack(data)
8085
        array = []
8086
        if length != -1:
8087
            for _ in range(0, length):
8088 1
                array.append(QueryDataSet.from_binary(data))
8089 1
        obj.QueryDataSets = array
8090 1
        self.RevisedContinuationPoint = uabin.Primitives.ByteString.unpack(data)
8091 1
        return obj
8092 1
8093 1
    def __str__(self):
8094 1
        return 'QueryNextResult(' + 'QueryDataSets:' + str(self.QueryDataSets) + ', ' + \
8095 1
               'RevisedContinuationPoint:' + str(self.RevisedContinuationPoint) + ')'
8096 1
8097 1
    __repr__ = __str__
8098
8099 1
8100 1
class QueryNextResponse(FrozenClass):
8101 1
    '''
8102 1
    :ivar TypeId:
8103 1
    :vartype TypeId: NodeId
8104 1
    :ivar ResponseHeader:
8105 1
    :vartype ResponseHeader: ResponseHeader
8106 1
    :ivar Parameters:
8107 1
    :vartype Parameters: QueryNextResult
8108
    '''
8109 1
8110
    ua_types = [
8111 1
        ('TypeId', 'NodeId'),
8112
        ('ResponseHeader', 'ResponseHeader'),
8113 1
        ('Parameters', 'QueryNextResult'),
8114 1
               ]
8115 1
8116 1
    def __init__(self):
8117 1
        self.TypeId = FourByteNodeId(ObjectIds.QueryNextResponse_Encoding_DefaultBinary)
8118 1
        self.ResponseHeader = ResponseHeader()
8119 1
        self.Parameters = QueryNextResult()
8120 1
        self._freeze = True
8121 1
8122 1
    def to_binary(self):
8123
        packet = []
8124 1
        packet.append(self.TypeId.to_binary())
8125
        packet.append(self.ResponseHeader.to_binary())
8126
        packet.append(self.Parameters.to_binary())
8127
        return b''.join(packet)
8128
8129
    @staticmethod
8130 1
    def from_binary(data):
8131
        obj = QueryNextResponse()
8132
        obj.TypeId = NodeId.from_binary(data)
8133 1
        obj.ResponseHeader = ResponseHeader.from_binary(data)
8134
        obj.Parameters = QueryNextResult.from_binary(data)
8135
        return obj
8136
8137
    def __str__(self):
8138
        return 'QueryNextResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8139
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
8140
               'Parameters:' + str(self.Parameters) + ')'
8141
8142
    __repr__ = __str__
8143 1
8144
8145
class ReadValueId(FrozenClass):
8146
    '''
8147
    :ivar NodeId:
8148
    :vartype NodeId: NodeId
8149 1
    :ivar AttributeId:
8150
    :vartype AttributeId: UInt32
8151
    :ivar IndexRange:
8152
    :vartype IndexRange: String
8153
    :ivar DataEncoding:
8154
    :vartype DataEncoding: QualifiedName
8155
    '''
8156
8157
    ua_types = [
8158
        ('NodeId', 'NodeId'),
8159 1
        ('AttributeId', 'UInt32'),
8160
        ('IndexRange', 'String'),
8161
        ('DataEncoding', 'QualifiedName'),
8162
               ]
8163
8164
    def __init__(self):
8165
        self.NodeId = NodeId()
8166
        self.AttributeId = 0
8167
        self.IndexRange = None
8168
        self.DataEncoding = QualifiedName()
8169
        self._freeze = True
8170 1
8171
    def to_binary(self):
8172
        packet = []
8173
        packet.append(self.NodeId.to_binary())
8174 1
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
8175
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
8176
        packet.append(self.DataEncoding.to_binary())
8177
        return b''.join(packet)
8178
8179
    @staticmethod
8180
    def from_binary(data):
8181
        obj = ReadValueId()
8182
        obj.NodeId = NodeId.from_binary(data)
8183 View Code Duplication
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8184
        self.IndexRange = uabin.Primitives.String.unpack(data)
8185
        obj.DataEncoding = QualifiedName.from_binary(data)
8186
        return obj
8187
8188
    def __str__(self):
8189 1
        return 'ReadValueId(' + 'NodeId:' + str(self.NodeId) + ', ' + \
8190
               'AttributeId:' + str(self.AttributeId) + ', ' + \
8191
               'IndexRange:' + str(self.IndexRange) + ', ' + \
8192
               'DataEncoding:' + str(self.DataEncoding) + ')'
8193
8194 1
    __repr__ = __str__
8195
8196
8197 1
class ReadParameters(FrozenClass):
8198
    '''
8199
    :ivar MaxAge:
8200
    :vartype MaxAge: Double
8201
    :ivar TimestampsToReturn:
8202
    :vartype TimestampsToReturn: TimestampsToReturn
8203
    :ivar NodesToRead:
8204
    :vartype NodesToRead: ReadValueId
8205 1
    '''
8206
8207
    ua_types = [
8208
        ('MaxAge', 'Double'),
8209
        ('TimestampsToReturn', 'TimestampsToReturn'),
8210 1
        ('NodesToRead', 'ListOfReadValueId'),
8211
               ]
8212
8213
    def __init__(self):
8214
        self.MaxAge = 0
8215
        self.TimestampsToReturn = TimestampsToReturn(0)
8216
        self.NodesToRead = []
8217
        self._freeze = True
8218
8219 1
    def to_binary(self):
8220
        packet = []
8221
        packet.append(uabin.Primitives.Double.pack(self.MaxAge))
8222
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
8223
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToRead)))
8224
        for fieldname in self.NodesToRead:
8225
            packet.append(fieldname.to_binary())
8226
        return b''.join(packet)
8227
8228
    @staticmethod
8229 1
    def from_binary(data):
8230
        obj = ReadParameters()
8231
        self.MaxAge = uabin.Primitives.Double.unpack(data)
8232
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
8233 1
        length = uabin.Primitives.Int32.unpack(data)
8234
        array = []
8235
        if length != -1:
8236
            for _ in range(0, length):
8237
                array.append(ReadValueId.from_binary(data))
8238
        obj.NodesToRead = array
8239
        return obj
8240
8241
    def __str__(self):
8242
        return 'ReadParameters(' + 'MaxAge:' + str(self.MaxAge) + ', ' + \
8243
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
8244
               'NodesToRead:' + str(self.NodesToRead) + ')'
8245
8246
    __repr__ = __str__
8247 1
8248
8249
class ReadRequest(FrozenClass):
8250
    '''
8251 1
    :ivar TypeId:
8252
    :vartype TypeId: NodeId
8253
    :ivar RequestHeader:
8254 1
    :vartype RequestHeader: RequestHeader
8255
    :ivar Parameters:
8256
    :vartype Parameters: ReadParameters
8257
    '''
8258
8259
    ua_types = [
8260
        ('TypeId', 'NodeId'),
8261
        ('RequestHeader', 'RequestHeader'),
8262
        ('Parameters', 'ReadParameters'),
8263
               ]
8264 1
8265
    def __init__(self):
8266
        self.TypeId = FourByteNodeId(ObjectIds.ReadRequest_Encoding_DefaultBinary)
8267
        self.RequestHeader = RequestHeader()
8268
        self.Parameters = ReadParameters()
8269
        self._freeze = True
8270 1
8271
    def to_binary(self):
8272
        packet = []
8273
        packet.append(self.TypeId.to_binary())
8274
        packet.append(self.RequestHeader.to_binary())
8275
        packet.append(self.Parameters.to_binary())
8276
        return b''.join(packet)
8277
8278
    @staticmethod
8279
    def from_binary(data):
8280 1
        obj = ReadRequest()
8281
        obj.TypeId = NodeId.from_binary(data)
8282
        obj.RequestHeader = RequestHeader.from_binary(data)
8283
        obj.Parameters = ReadParameters.from_binary(data)
8284
        return obj
8285
8286
    def __str__(self):
8287
        return 'ReadRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8288
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
8289
               'Parameters:' + str(self.Parameters) + ')'
8290
8291 1
    __repr__ = __str__
8292
8293
8294
class ReadResponse(FrozenClass):
8295 1
    '''
8296
    :ivar TypeId:
8297
    :vartype TypeId: NodeId
8298
    :ivar ResponseHeader:
8299
    :vartype ResponseHeader: ResponseHeader
8300
    :ivar Results:
8301
    :vartype Results: DataValue
8302
    :ivar DiagnosticInfos:
8303
    :vartype DiagnosticInfos: DiagnosticInfo
8304
    '''
8305
8306
    ua_types = [
8307
        ('TypeId', 'NodeId'),
8308
        ('ResponseHeader', 'ResponseHeader'),
8309
        ('Results', 'ListOfDataValue'),
8310 1
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
8311
               ]
8312
8313
    def __init__(self):
8314
        self.TypeId = FourByteNodeId(ObjectIds.ReadResponse_Encoding_DefaultBinary)
8315 1
        self.ResponseHeader = ResponseHeader()
8316
        self.Results = []
8317
        self.DiagnosticInfos = []
8318 1
        self._freeze = True
8319
8320
    def to_binary(self):
8321
        packet = []
8322
        packet.append(self.TypeId.to_binary())
8323
        packet.append(self.ResponseHeader.to_binary())
8324
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
8325
        for fieldname in self.Results:
8326
            packet.append(fieldname.to_binary())
8327
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
8328
        for fieldname in self.DiagnosticInfos:
8329
            packet.append(fieldname.to_binary())
8330
        return b''.join(packet)
8331
8332 1
    @staticmethod
8333
    def from_binary(data):
8334
        obj = ReadResponse()
8335
        obj.TypeId = NodeId.from_binary(data)
8336
        obj.ResponseHeader = ResponseHeader.from_binary(data)
8337
        length = uabin.Primitives.Int32.unpack(data)
8338
        array = []
8339
        if length != -1:
8340 1
            for _ in range(0, length):
8341
                array.append(DataValue.from_binary(data))
8342
        obj.Results = array
8343
        length = uabin.Primitives.Int32.unpack(data)
8344
        array = []
8345
        if length != -1:
8346
            for _ in range(0, length):
8347
                array.append(DiagnosticInfo.from_binary(data))
8348
        obj.DiagnosticInfos = array
8349 View Code Duplication
        return obj
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8350
8351
    def __str__(self):
8352 1
        return 'ReadResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8353
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
8354
               'Results:' + str(self.Results) + ', ' + \
8355
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
8356
8357
    __repr__ = __str__
8358
8359
8360
class HistoryReadValueId(FrozenClass):
8361
    '''
8362
    :ivar NodeId:
8363 1
    :vartype NodeId: NodeId
8364
    :ivar IndexRange:
8365
    :vartype IndexRange: String
8366
    :ivar DataEncoding:
8367 1
    :vartype DataEncoding: QualifiedName
8368
    :ivar ContinuationPoint:
8369
    :vartype ContinuationPoint: ByteString
8370
    '''
8371
8372
    ua_types = [
8373
        ('NodeId', 'NodeId'),
8374
        ('IndexRange', 'String'),
8375
        ('DataEncoding', 'QualifiedName'),
8376
        ('ContinuationPoint', 'ByteString'),
8377
               ]
8378
8379 1
    def __init__(self):
8380
        self.NodeId = NodeId()
8381
        self.IndexRange = None
8382
        self.DataEncoding = QualifiedName()
8383
        self.ContinuationPoint = None
8384
        self._freeze = True
8385
8386 1
    def to_binary(self):
8387
        packet = []
8388
        packet.append(self.NodeId.to_binary())
8389 1
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
8390
        packet.append(self.DataEncoding.to_binary())
8391
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
8392
        return b''.join(packet)
8393
8394
    @staticmethod
8395
    def from_binary(data):
8396
        obj = HistoryReadValueId()
8397
        obj.NodeId = NodeId.from_binary(data)
8398
        self.IndexRange = uabin.Primitives.String.unpack(data)
8399 1
        obj.DataEncoding = QualifiedName.from_binary(data)
8400
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
8401
        return obj
8402
8403
    def __str__(self):
8404
        return 'HistoryReadValueId(' + 'NodeId:' + str(self.NodeId) + ', ' + \
8405 1
               'IndexRange:' + str(self.IndexRange) + ', ' + \
8406
               'DataEncoding:' + str(self.DataEncoding) + ', ' + \
8407
               'ContinuationPoint:' + str(self.ContinuationPoint) + ')'
8408
8409
    __repr__ = __str__
8410
8411
8412
class HistoryReadResult(FrozenClass):
8413
    '''
8414
    :ivar StatusCode:
8415 1
    :vartype StatusCode: StatusCode
8416
    :ivar ContinuationPoint:
8417
    :vartype ContinuationPoint: ByteString
8418
    :ivar HistoryData:
8419
    :vartype HistoryData: ExtensionObject
8420
    '''
8421
8422 1
    ua_types = [
8423
        ('StatusCode', 'StatusCode'),
8424
        ('ContinuationPoint', 'ByteString'),
8425
        ('HistoryData', 'ExtensionObject'),
8426 1
               ]
8427
8428
    def __init__(self):
8429
        self.StatusCode = StatusCode()
8430
        self.ContinuationPoint = None
8431 1
        self.HistoryData = ExtensionObject()
8432
        self._freeze = True
8433
8434
    def to_binary(self):
8435
        packet = []
8436 1
        packet.append(self.StatusCode.to_binary())
8437
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
8438
        packet.append(uabin.extensionobject_to_binary(self.HistoryData))
8439 1
        return b''.join(packet)
8440
8441
    @staticmethod
8442
    def from_binary(data):
8443
        obj = HistoryReadResult()
8444
        obj.StatusCode = StatusCode.from_binary(data)
8445
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
8446
        obj.HistoryData = uabin.extensionobject_from_binary(data)
8447
        return obj
8448
8449
    def __str__(self):
8450
        return 'HistoryReadResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
8451
               'ContinuationPoint:' + str(self.ContinuationPoint) + ', ' + \
8452
               'HistoryData:' + str(self.HistoryData) + ')'
8453 1
8454
    __repr__ = __str__
8455
8456
8457
class HistoryReadDetails(FrozenClass):
8458
    '''
8459
    '''
8460
8461 1
    ua_types = [
8462
               ]
8463
8464
    def __init__(self):
8465
        self._freeze = True
8466
8467
    def to_binary(self):
8468
        packet = []
8469
        return b''.join(packet)
8470
8471
    @staticmethod
8472
    def from_binary(data):
8473 1
        obj = HistoryReadDetails()
8474
        return obj
8475
8476
    def __str__(self):
8477
        return 'HistoryReadDetails(' +  + ')'
8478
8479
    __repr__ = __str__
8480
8481
8482
class ReadEventDetails(FrozenClass):
8483
    '''
8484
    :ivar NumValuesPerNode:
8485
    :vartype NumValuesPerNode: UInt32
8486
    :ivar StartTime:
8487
    :vartype StartTime: DateTime
8488 1
    :ivar EndTime:
8489
    :vartype EndTime: DateTime
8490
    :ivar Filter:
8491
    :vartype Filter: EventFilter
8492 1
    '''
8493
8494
    ua_types = [
8495
        ('NumValuesPerNode', 'UInt32'),
8496
        ('StartTime', 'DateTime'),
8497
        ('EndTime', 'DateTime'),
8498
        ('Filter', 'EventFilter'),
8499
               ]
8500
8501
    def __init__(self):
8502
        self.NumValuesPerNode = 0
8503
        self.StartTime = datetime.utcnow()
8504
        self.EndTime = datetime.utcnow()
8505
        self.Filter = EventFilter()
8506
        self._freeze = True
8507
8508
    def to_binary(self):
8509
        packet = []
8510
        packet.append(uabin.Primitives.UInt32.pack(self.NumValuesPerNode))
8511
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
8512
        packet.append(uabin.Primitives.DateTime.pack(self.EndTime))
8513
        packet.append(self.Filter.to_binary())
8514 1
        return b''.join(packet)
8515
8516
    @staticmethod
8517
    def from_binary(data):
8518
        obj = ReadEventDetails()
8519
        self.NumValuesPerNode = uabin.Primitives.UInt32.unpack(data)
8520
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
8521 1
        self.EndTime = uabin.Primitives.DateTime.unpack(data)
8522
        obj.Filter = EventFilter.from_binary(data)
8523
        return obj
8524 1
8525
    def __str__(self):
8526
        return 'ReadEventDetails(' + 'NumValuesPerNode:' + str(self.NumValuesPerNode) + ', ' + \
8527
               'StartTime:' + str(self.StartTime) + ', ' + \
8528
               'EndTime:' + str(self.EndTime) + ', ' + \
8529
               'Filter:' + str(self.Filter) + ')'
8530
8531
    __repr__ = __str__
8532
8533
8534 1
class ReadRawModifiedDetails(FrozenClass):
8535
    '''
8536
    :ivar IsReadModified:
8537
    :vartype IsReadModified: Boolean
8538
    :ivar StartTime:
8539
    :vartype StartTime: DateTime
8540 1
    :ivar EndTime:
8541
    :vartype EndTime: DateTime
8542
    :ivar NumValuesPerNode:
8543
    :vartype NumValuesPerNode: UInt32
8544
    :ivar ReturnBounds:
8545
    :vartype ReturnBounds: Boolean
8546
    '''
8547
8548
    ua_types = [
8549
        ('IsReadModified', 'Boolean'),
8550 1
        ('StartTime', 'DateTime'),
8551
        ('EndTime', 'DateTime'),
8552
        ('NumValuesPerNode', 'UInt32'),
8553
        ('ReturnBounds', 'Boolean'),
8554
               ]
8555
8556
    def __init__(self):
8557 1
        self.IsReadModified = True
8558
        self.StartTime = datetime.utcnow()
8559
        self.EndTime = datetime.utcnow()
8560
        self.NumValuesPerNode = 0
8561 1
        self.ReturnBounds = True
8562
        self._freeze = True
8563
8564
    def to_binary(self):
8565
        packet = []
8566 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsReadModified))
8567
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
8568
        packet.append(uabin.Primitives.DateTime.pack(self.EndTime))
8569
        packet.append(uabin.Primitives.UInt32.pack(self.NumValuesPerNode))
8570
        packet.append(uabin.Primitives.Boolean.pack(self.ReturnBounds))
8571 1
        return b''.join(packet)
8572
8573
    @staticmethod
8574 1
    def from_binary(data):
8575
        obj = ReadRawModifiedDetails()
8576
        self.IsReadModified = uabin.Primitives.Boolean.unpack(data)
8577
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
8578
        self.EndTime = uabin.Primitives.DateTime.unpack(data)
8579
        self.NumValuesPerNode = uabin.Primitives.UInt32.unpack(data)
8580
        self.ReturnBounds = uabin.Primitives.Boolean.unpack(data)
8581
        return obj
8582 1
8583
    def __str__(self):
8584
        return 'ReadRawModifiedDetails(' + 'IsReadModified:' + str(self.IsReadModified) + ', ' + \
8585
               'StartTime:' + str(self.StartTime) + ', ' + \
8586
               'EndTime:' + str(self.EndTime) + ', ' + \
8587 1
               'NumValuesPerNode:' + str(self.NumValuesPerNode) + ', ' + \
8588
               'ReturnBounds:' + str(self.ReturnBounds) + ')'
8589
8590
    __repr__ = __str__
8591
8592
8593
class ReadProcessedDetails(FrozenClass):
8594
    '''
8595
    :ivar StartTime:
8596 1
    :vartype StartTime: DateTime
8597
    :ivar EndTime:
8598
    :vartype EndTime: DateTime
8599
    :ivar ProcessingInterval:
8600
    :vartype ProcessingInterval: Double
8601
    :ivar AggregateType:
8602 1
    :vartype AggregateType: NodeId
8603
    :ivar AggregateConfiguration:
8604
    :vartype AggregateConfiguration: AggregateConfiguration
8605
    '''
8606 1
8607
    ua_types = [
8608
        ('StartTime', 'DateTime'),
8609
        ('EndTime', 'DateTime'),
8610 1
        ('ProcessingInterval', 'Double'),
8611
        ('AggregateType', 'ListOfNodeId'),
8612
        ('AggregateConfiguration', 'AggregateConfiguration'),
8613
               ]
8614 1
8615
    def __init__(self):
8616
        self.StartTime = datetime.utcnow()
8617 1
        self.EndTime = datetime.utcnow()
8618
        self.ProcessingInterval = 0
8619
        self.AggregateType = []
8620
        self.AggregateConfiguration = AggregateConfiguration()
8621
        self._freeze = True
8622
8623
    def to_binary(self):
8624
        packet = []
8625
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
8626
        packet.append(uabin.Primitives.DateTime.pack(self.EndTime))
8627 1
        packet.append(uabin.Primitives.Double.pack(self.ProcessingInterval))
8628
        packet.append(uabin.Primitives.Int32.pack(len(self.AggregateType)))
8629
        for fieldname in self.AggregateType:
8630
            packet.append(fieldname.to_binary())
8631
        packet.append(self.AggregateConfiguration.to_binary())
8632
        return b''.join(packet)
8633 1
8634
    @staticmethod
8635
    def from_binary(data):
8636
        obj = ReadProcessedDetails()
8637
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
8638
        self.EndTime = uabin.Primitives.DateTime.unpack(data)
8639
        self.ProcessingInterval = uabin.Primitives.Double.unpack(data)
8640
        length = uabin.Primitives.Int32.unpack(data)
8641
        array = []
8642
        if length != -1:
8643 1
            for _ in range(0, length):
8644
                array.append(NodeId.from_binary(data))
8645
        obj.AggregateType = array
8646
        obj.AggregateConfiguration = AggregateConfiguration.from_binary(data)
8647
        return obj
8648
8649
    def __str__(self):
8650 1
        return 'ReadProcessedDetails(' + 'StartTime:' + str(self.StartTime) + ', ' + \
8651
               'EndTime:' + str(self.EndTime) + ', ' + \
8652
               'ProcessingInterval:' + str(self.ProcessingInterval) + ', ' + \
8653
               'AggregateType:' + str(self.AggregateType) + ', ' + \
8654 1
               'AggregateConfiguration:' + str(self.AggregateConfiguration) + ')'
8655
8656
    __repr__ = __str__
8657
8658
8659 1
class ReadAtTimeDetails(FrozenClass):
8660
    '''
8661
    :ivar ReqTimes:
8662
    :vartype ReqTimes: DateTime
8663
    :ivar UseSimpleBounds:
8664 1
    :vartype UseSimpleBounds: Boolean
8665
    '''
8666
8667 1
    ua_types = [
8668
        ('ReqTimes', 'ListOfDateTime'),
8669
        ('UseSimpleBounds', 'Boolean'),
8670
               ]
8671
8672
    def __init__(self):
8673
        self.ReqTimes = []
8674
        self.UseSimpleBounds = True
8675 1
        self._freeze = True
8676
8677
    def to_binary(self):
8678
        packet = []
8679
        packet.append(uabin.Primitives.Int32.pack(len(self.ReqTimes)))
8680 1
        for fieldname in self.ReqTimes:
8681
            packet.append(uabin.Primitives.DateTime.pack(fieldname))
8682
        packet.append(uabin.Primitives.Boolean.pack(self.UseSimpleBounds))
8683
        return b''.join(packet)
8684
8685
    @staticmethod
8686
    def from_binary(data):
8687
        obj = ReadAtTimeDetails()
8688
        obj.ReqTimes = uabin.Primitives.DateTime.unpack_array(data)
8689 1
        self.UseSimpleBounds = uabin.Primitives.Boolean.unpack(data)
8690
        return obj
8691
8692
    def __str__(self):
8693
        return 'ReadAtTimeDetails(' + 'ReqTimes:' + str(self.ReqTimes) + ', ' + \
8694
               'UseSimpleBounds:' + str(self.UseSimpleBounds) + ')'
8695
8696
    __repr__ = __str__
8697 1
8698
8699
class HistoryData(FrozenClass):
8700
    '''
8701 1
    :ivar DataValues:
8702
    :vartype DataValues: DataValue
8703
    '''
8704
8705
    ua_types = [
8706
        ('DataValues', 'ListOfDataValue'),
8707
               ]
8708
8709
    def __init__(self):
8710 1
        self.DataValues = []
8711
        self._freeze = True
8712
8713 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8714 1
        packet = []
8715
        packet.append(uabin.Primitives.Int32.pack(len(self.DataValues)))
8716
        for fieldname in self.DataValues:
8717 1
            packet.append(fieldname.to_binary())
8718
        return b''.join(packet)
8719
8720
    @staticmethod
8721
    def from_binary(data):
8722
        obj = HistoryData()
8723
        length = uabin.Primitives.Int32.unpack(data)
8724
        array = []
8725
        if length != -1:
8726
            for _ in range(0, length):
8727 1
                array.append(DataValue.from_binary(data))
8728
        obj.DataValues = array
8729
        return obj
8730
8731
    def __str__(self):
8732
        return 'HistoryData(' + 'DataValues:' + str(self.DataValues) + ')'
8733 1
8734
    __repr__ = __str__
8735
8736
8737
class ModificationInfo(FrozenClass):
8738
    '''
8739
    :ivar ModificationTime:
8740
    :vartype ModificationTime: DateTime
8741
    :ivar UpdateType:
8742
    :vartype UpdateType: HistoryUpdateType
8743 1
    :ivar UserName:
8744
    :vartype UserName: String
8745
    '''
8746
8747
    ua_types = [
8748
        ('ModificationTime', 'DateTime'),
8749
        ('UpdateType', 'HistoryUpdateType'),
8750 1
        ('UserName', 'String'),
8751
               ]
8752
8753
    def __init__(self):
8754 1
        self.ModificationTime = datetime.utcnow()
8755
        self.UpdateType = HistoryUpdateType(0)
8756
        self.UserName = None
8757
        self._freeze = True
8758
8759 1
    def to_binary(self):
8760
        packet = []
8761
        packet.append(uabin.Primitives.DateTime.pack(self.ModificationTime))
8762
        packet.append(uabin.Primitives.UInt32.pack(self.UpdateType.value))
8763
        packet.append(uabin.Primitives.String.pack(self.UserName))
8764 1
        return b''.join(packet)
8765
8766
    @staticmethod
8767 1
    def from_binary(data):
8768
        obj = ModificationInfo()
8769
        self.ModificationTime = uabin.Primitives.DateTime.unpack(data)
8770
        self.UpdateType = HistoryUpdateType(uabin.Primitives.UInt32.unpack(data))
8771
        self.UserName = uabin.Primitives.String.unpack(data)
8772
        return obj
8773
8774
    def __str__(self):
8775
        return 'ModificationInfo(' + 'ModificationTime:' + str(self.ModificationTime) + ', ' + \
8776
               'UpdateType:' + str(self.UpdateType) + ', ' + \
8777
               'UserName:' + str(self.UserName) + ')'
8778
8779 1
    __repr__ = __str__
8780
8781
8782
class HistoryModifiedData(FrozenClass):
8783
    '''
8784
    :ivar DataValues:
8785
    :vartype DataValues: DataValue
8786 1
    :ivar ModificationInfos:
8787 1
    :vartype ModificationInfos: ModificationInfo
8788 1
    '''
8789 1
8790 1
    ua_types = [
8791 1
        ('DataValues', 'ListOfDataValue'),
8792 1
        ('ModificationInfos', 'ListOfModificationInfo'),
8793 1
               ]
8794 1
8795 1
    def __init__(self):
8796
        self.DataValues = []
8797 1
        self.ModificationInfos = []
8798 1
        self._freeze = True
8799 1
8800 1
    def to_binary(self):
8801 1
        packet = []
8802 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DataValues)))
8803 1
        for fieldname in self.DataValues:
8804
            packet.append(fieldname.to_binary())
8805 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ModificationInfos)))
8806
        for fieldname in self.ModificationInfos:
8807 1
            packet.append(fieldname.to_binary())
8808
        return b''.join(packet)
8809 1
8810 1
    @staticmethod
8811 1
    def from_binary(data):
8812 1
        obj = HistoryModifiedData()
8813 1
        length = uabin.Primitives.Int32.unpack(data)
8814
        array = []
8815 1
        if length != -1:
8816
            for _ in range(0, length):
8817
                array.append(DataValue.from_binary(data))
8818
        obj.DataValues = array
8819
        length = uabin.Primitives.Int32.unpack(data)
8820
        array = []
8821 1
        if length != -1:
8822
            for _ in range(0, length):
8823
                array.append(ModificationInfo.from_binary(data))
8824 1
        obj.ModificationInfos = array
8825
        return obj
8826
8827
    def __str__(self):
8828
        return 'HistoryModifiedData(' + 'DataValues:' + str(self.DataValues) + ', ' + \
8829
               'ModificationInfos:' + str(self.ModificationInfos) + ')'
8830
8831
    __repr__ = __str__
8832
8833
8834 1
class HistoryEvent(FrozenClass):
8835
    '''
8836
    :ivar Events:
8837
    :vartype Events: HistoryEventFieldList
8838
    '''
8839
8840 1
    ua_types = [
8841 1
        ('Events', 'ListOfHistoryEventFieldList'),
8842 1
               ]
8843 1
8844 1
    def __init__(self):
8845 1
        self.Events = []
8846 1
        self._freeze = True
8847 1
8848 1
    def to_binary(self):
8849
        packet = []
8850 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Events)))
8851 1
        for fieldname in self.Events:
8852 1
            packet.append(fieldname.to_binary())
8853 1
        return b''.join(packet)
8854 1
8855 1
    @staticmethod
8856 1
    def from_binary(data):
8857 1
        obj = HistoryEvent()
8858
        length = uabin.Primitives.Int32.unpack(data)
8859 1
        array = []
8860
        if length != -1:
8861 1
            for _ in range(0, length):
8862
                array.append(HistoryEventFieldList.from_binary(data))
8863 1
        obj.Events = array
8864 1
        return obj
8865 1
8866 1
    def __str__(self):
8867 1
        return 'HistoryEvent(' + 'Events:' + str(self.Events) + ')'
8868 1
8869 1
    __repr__ = __str__
8870 1
8871 1
8872
class HistoryReadParameters(FrozenClass):
8873 1
    '''
8874
    :ivar HistoryReadDetails:
8875
    :vartype HistoryReadDetails: ExtensionObject
8876
    :ivar TimestampsToReturn:
8877
    :vartype TimestampsToReturn: TimestampsToReturn
8878 1
    :ivar ReleaseContinuationPoints:
8879
    :vartype ReleaseContinuationPoints: Boolean
8880
    :ivar NodesToRead:
8881 1
    :vartype NodesToRead: HistoryReadValueId
8882
    '''
8883
8884
    ua_types = [
8885
        ('HistoryReadDetails', 'ExtensionObject'),
8886
        ('TimestampsToReturn', 'TimestampsToReturn'),
8887
        ('ReleaseContinuationPoints', 'Boolean'),
8888
        ('NodesToRead', 'ListOfHistoryReadValueId'),
8889
               ]
8890
8891 1
    def __init__(self):
8892
        self.HistoryReadDetails = ExtensionObject()
8893
        self.TimestampsToReturn = TimestampsToReturn(0)
8894
        self.ReleaseContinuationPoints = True
8895
        self.NodesToRead = []
8896
        self._freeze = True
8897 1
8898 1 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8899
        packet = []
8900
        packet.append(uabin.extensionobject_to_binary(self.HistoryReadDetails))
8901
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
8902 1
        packet.append(uabin.Primitives.Boolean.pack(self.ReleaseContinuationPoints))
8903 1
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToRead)))
8904 1
        for fieldname in self.NodesToRead:
8905 1
            packet.append(fieldname.to_binary())
8906
        return b''.join(packet)
8907 1
8908 1
    @staticmethod
8909 1
    def from_binary(data):
8910 1
        obj = HistoryReadParameters()
8911 1
        obj.HistoryReadDetails = uabin.extensionobject_from_binary(data)
8912 1
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
8913
        self.ReleaseContinuationPoints = uabin.Primitives.Boolean.unpack(data)
8914 1
        length = uabin.Primitives.Int32.unpack(data)
8915
        array = []
8916
        if length != -1:
8917
            for _ in range(0, length):
8918 1
                array.append(HistoryReadValueId.from_binary(data))
8919
        obj.NodesToRead = array
8920
        return obj
8921
8922
    def __str__(self):
8923 1
        return 'HistoryReadParameters(' + 'HistoryReadDetails:' + str(self.HistoryReadDetails) + ', ' + \
8924
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
8925
               'ReleaseContinuationPoints:' + str(self.ReleaseContinuationPoints) + ', ' + \
8926
               'NodesToRead:' + str(self.NodesToRead) + ')'
8927
8928 1
    __repr__ = __str__
8929
8930
8931 1
class HistoryReadRequest(FrozenClass):
8932
    '''
8933
    :ivar TypeId:
8934
    :vartype TypeId: NodeId
8935
    :ivar RequestHeader:
8936
    :vartype RequestHeader: RequestHeader
8937
    :ivar Parameters:
8938
    :vartype Parameters: HistoryReadParameters
8939
    '''
8940
8941
    ua_types = [
8942
        ('TypeId', 'NodeId'),
8943 1
        ('RequestHeader', 'RequestHeader'),
8944
        ('Parameters', 'HistoryReadParameters'),
8945
               ]
8946
8947
    def __init__(self):
8948
        self.TypeId = FourByteNodeId(ObjectIds.HistoryReadRequest_Encoding_DefaultBinary)
8949
        self.RequestHeader = RequestHeader()
8950 1
        self.Parameters = HistoryReadParameters()
8951 1
        self._freeze = True
8952 1
8953 1
    def to_binary(self):
8954 1
        packet = []
8955 1
        packet.append(self.TypeId.to_binary())
8956 1
        packet.append(self.RequestHeader.to_binary())
8957 1
        packet.append(self.Parameters.to_binary())
8958 1
        return b''.join(packet)
8959 1
8960
    @staticmethod
8961 1
    def from_binary(data):
8962 1
        obj = HistoryReadRequest()
8963 1
        obj.TypeId = NodeId.from_binary(data)
8964 1
        obj.RequestHeader = RequestHeader.from_binary(data)
8965 1
        obj.Parameters = HistoryReadParameters.from_binary(data)
8966 1
        return obj
8967 1
8968 1
    def __str__(self):
8969 1
        return 'HistoryReadRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8970
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
8971 1
               'Parameters:' + str(self.Parameters) + ')'
8972
8973 1
    __repr__ = __str__
8974
8975 1
8976
class HistoryReadResponse(FrozenClass):
8977 1
    '''
8978 1
    :ivar TypeId:
8979 1
    :vartype TypeId: NodeId
8980 1
    :ivar ResponseHeader:
8981 1
    :vartype ResponseHeader: ResponseHeader
8982 1
    :ivar Results:
8983 1
    :vartype Results: HistoryReadResult
8984 1
    :ivar DiagnosticInfos:
8985 1
    :vartype DiagnosticInfos: DiagnosticInfo
8986 1
    '''
8987 1
8988 1
    ua_types = [
8989 1
        ('TypeId', 'NodeId'),
8990
        ('ResponseHeader', 'ResponseHeader'),
8991 1
        ('Results', 'ListOfHistoryReadResult'),
8992
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
8993 1
               ]
8994
8995
    def __init__(self):
8996
        self.TypeId = FourByteNodeId(ObjectIds.HistoryReadResponse_Encoding_DefaultBinary)
8997
        self.ResponseHeader = ResponseHeader()
8998
        self.Results = []
8999 1
        self.DiagnosticInfos = []
9000
        self._freeze = True
9001
9002 1
    def to_binary(self):
9003
        packet = []
9004
        packet.append(self.TypeId.to_binary())
9005
        packet.append(self.ResponseHeader.to_binary())
9006
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
9007
        for fieldname in self.Results:
9008
            packet.append(fieldname.to_binary())
9009
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
9010
        for fieldname in self.DiagnosticInfos:
9011
            packet.append(fieldname.to_binary())
9012
        return b''.join(packet)
9013
9014 1
    @staticmethod
9015
    def from_binary(data):
9016
        obj = HistoryReadResponse()
9017
        obj.TypeId = NodeId.from_binary(data)
9018
        obj.ResponseHeader = ResponseHeader.from_binary(data)
9019
        length = uabin.Primitives.Int32.unpack(data)
9020
        array = []
9021 1
        if length != -1:
9022 1
            for _ in range(0, length):
9023
                array.append(HistoryReadResult.from_binary(data))
9024
        obj.Results = array
9025
        length = uabin.Primitives.Int32.unpack(data)
9026 1
        array = []
9027 1
        if length != -1:
9028 1
            for _ in range(0, length):
9029 1
                array.append(DiagnosticInfo.from_binary(data))
9030 1
        obj.DiagnosticInfos = array
9031
        return obj
9032 1
9033
    def __str__(self):
9034
        return 'HistoryReadResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9035
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
9036
               'Results:' + str(self.Results) + ', ' + \
9037
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
9038
9039
    __repr__ = __str__
9040 1
9041
9042
class WriteValue(FrozenClass):
9043
    '''
9044 1
    :ivar NodeId:
9045
    :vartype NodeId: NodeId
9046
    :ivar AttributeId:
9047
    :vartype AttributeId: UInt32
9048
    :ivar IndexRange:
9049
    :vartype IndexRange: String
9050 1
    :ivar Value:
9051
    :vartype Value: DataValue
9052
    '''
9053
9054
    ua_types = [
9055
        ('NodeId', 'NodeId'),
9056 1
        ('AttributeId', 'UInt32'),
9057
        ('IndexRange', 'String'),
9058
        ('Value', 'DataValue'),
9059 1
               ]
9060
9061
    def __init__(self):
9062
        self.NodeId = NodeId()
9063
        self.AttributeId = 0
9064
        self.IndexRange = None
9065
        self.Value = DataValue()
9066
        self._freeze = True
9067
9068
    def to_binary(self):
9069 1
        packet = []
9070
        packet.append(self.NodeId.to_binary())
9071
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
9072
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
9073
        packet.append(self.Value.to_binary())
9074
        return b''.join(packet)
9075 1
9076 1
    @staticmethod
9077
    def from_binary(data):
9078
        obj = WriteValue()
9079
        obj.NodeId = NodeId.from_binary(data)
9080 1
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
9081 1
        self.IndexRange = uabin.Primitives.String.unpack(data)
9082 1
        obj.Value = DataValue.from_binary(data)
9083 1
        return obj
9084
9085 1
    def __str__(self):
9086
        return 'WriteValue(' + 'NodeId:' + str(self.NodeId) + ', ' + \
9087
               'AttributeId:' + str(self.AttributeId) + ', ' + \
9088
               'IndexRange:' + str(self.IndexRange) + ', ' + \
9089
               'Value:' + str(self.Value) + ')'
9090
9091
    __repr__ = __str__
9092 1
9093
9094
class WriteParameters(FrozenClass):
9095
    '''
9096 1
    :ivar NodesToWrite:
9097
    :vartype NodesToWrite: WriteValue
9098
    '''
9099
9100
    ua_types = [
9101 1
        ('NodesToWrite', 'ListOfWriteValue'),
9102
               ]
9103
9104
    def __init__(self):
9105
        self.NodesToWrite = []
9106 1
        self._freeze = True
9107
9108
    def to_binary(self):
9109 1
        packet = []
9110
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToWrite)))
9111
        for fieldname in self.NodesToWrite:
9112
            packet.append(fieldname.to_binary())
9113 1
        return b''.join(packet)
9114
9115
    @staticmethod
9116 1
    def from_binary(data):
9117
        obj = WriteParameters()
9118
        length = uabin.Primitives.Int32.unpack(data)
9119
        array = []
9120
        if length != -1:
9121
            for _ in range(0, length):
9122
                array.append(WriteValue.from_binary(data))
9123 1
        obj.NodesToWrite = array
9124
        return obj
9125
9126
    def __str__(self):
9127 1
        return 'WriteParameters(' + 'NodesToWrite:' + str(self.NodesToWrite) + ')'
9128
9129
    __repr__ = __str__
9130
9131 1
9132
class WriteRequest(FrozenClass):
9133
    '''
9134 1
    :ivar TypeId:
9135
    :vartype TypeId: NodeId
9136
    :ivar RequestHeader:
9137 1
    :vartype RequestHeader: RequestHeader
9138
    :ivar Parameters:
9139
    :vartype Parameters: WriteParameters
9140 1
    '''
9141
9142
    ua_types = [
9143
        ('TypeId', 'NodeId'),
9144
        ('RequestHeader', 'RequestHeader'),
9145
        ('Parameters', 'WriteParameters'),
9146
               ]
9147
9148
    def __init__(self):
9149
        self.TypeId = FourByteNodeId(ObjectIds.WriteRequest_Encoding_DefaultBinary)
9150
        self.RequestHeader = RequestHeader()
9151
        self.Parameters = WriteParameters()
9152 1
        self._freeze = True
9153
9154
    def to_binary(self):
9155
        packet = []
9156
        packet.append(self.TypeId.to_binary())
9157
        packet.append(self.RequestHeader.to_binary())
9158
        packet.append(self.Parameters.to_binary())
9159 1
        return b''.join(packet)
9160 1
9161
    @staticmethod
9162
    def from_binary(data):
9163
        obj = WriteRequest()
9164 1
        obj.TypeId = NodeId.from_binary(data)
9165 1
        obj.RequestHeader = RequestHeader.from_binary(data)
9166 1
        obj.Parameters = WriteParameters.from_binary(data)
9167 1
        return obj
9168 1
9169
    def __str__(self):
9170 1
        return 'WriteRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9171
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
9172
               'Parameters:' + str(self.Parameters) + ')'
9173
9174
    __repr__ = __str__
9175
9176
9177
class WriteResponse(FrozenClass):
9178 1
    '''
9179
    :ivar TypeId:
9180
    :vartype TypeId: NodeId
9181
    :ivar ResponseHeader:
9182 1
    :vartype ResponseHeader: ResponseHeader
9183
    :ivar Results:
9184
    :vartype Results: StatusCode
9185
    :ivar DiagnosticInfos:
9186
    :vartype DiagnosticInfos: DiagnosticInfo
9187
    '''
9188 1
9189
    ua_types = [
9190
        ('TypeId', 'NodeId'),
9191
        ('ResponseHeader', 'ResponseHeader'),
9192
        ('Results', 'ListOfStatusCode'),
9193
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
9194 1
               ]
9195
9196
    def __init__(self):
9197 1
        self.TypeId = FourByteNodeId(ObjectIds.WriteResponse_Encoding_DefaultBinary)
9198
        self.ResponseHeader = ResponseHeader()
9199
        self.Results = []
9200
        self.DiagnosticInfos = []
9201
        self._freeze = True
9202
9203
    def to_binary(self):
9204
        packet = []
9205
        packet.append(self.TypeId.to_binary())
9206
        packet.append(self.ResponseHeader.to_binary())
9207
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
9208
        for fieldname in self.Results:
9209
            packet.append(fieldname.to_binary())
9210
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
9211 1
        for fieldname in self.DiagnosticInfos:
9212
            packet.append(fieldname.to_binary())
9213
        return b''.join(packet)
9214
9215
    @staticmethod
9216
    def from_binary(data):
9217
        obj = WriteResponse()
9218
        obj.TypeId = NodeId.from_binary(data)
9219 1
        obj.ResponseHeader = ResponseHeader.from_binary(data)
9220 1
        length = uabin.Primitives.Int32.unpack(data)
9221
        array = []
9222
        if length != -1:
9223
            for _ in range(0, length):
9224 1
                array.append(StatusCode.from_binary(data))
9225 1
        obj.Results = array
9226 1
        length = uabin.Primitives.Int32.unpack(data)
9227 1
        array = []
9228 1
        if length != -1:
9229 1
            for _ in range(0, length):
9230
                array.append(DiagnosticInfo.from_binary(data))
9231 1
        obj.DiagnosticInfos = array
9232
        return obj
9233
9234
    def __str__(self):
9235
        return 'WriteResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9236
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
9237
               'Results:' + str(self.Results) + ', ' + \
9238
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
9239
9240 1
    __repr__ = __str__
9241
9242
9243
class HistoryUpdateDetails(FrozenClass):
9244 1
    '''
9245
    :ivar NodeId:
9246
    :vartype NodeId: NodeId
9247
    '''
9248
9249
    ua_types = [
9250
        ('NodeId', 'NodeId'),
9251 1
               ]
9252
9253
    def __init__(self):
9254
        self.NodeId = NodeId()
9255
        self._freeze = True
9256
9257
    def to_binary(self):
9258 1
        packet = []
9259
        packet.append(self.NodeId.to_binary())
9260
        return b''.join(packet)
9261 1
9262
    @staticmethod
9263
    def from_binary(data):
9264
        obj = HistoryUpdateDetails()
9265
        obj.NodeId = NodeId.from_binary(data)
9266
        return obj
9267
9268
    def __str__(self):
9269
        return 'HistoryUpdateDetails(' + 'NodeId:' + str(self.NodeId) + ')'
9270
9271
    __repr__ = __str__
9272
9273
9274
class UpdateDataDetails(FrozenClass):
9275 1
    '''
9276
    :ivar NodeId:
9277
    :vartype NodeId: NodeId
9278
    :ivar PerformInsertReplace:
9279
    :vartype PerformInsertReplace: PerformUpdateType
9280
    :ivar UpdateValues:
9281
    :vartype UpdateValues: DataValue
9282
    '''
9283 1
9284
    ua_types = [
9285
        ('NodeId', 'NodeId'),
9286
        ('PerformInsertReplace', 'PerformUpdateType'),
9287
        ('UpdateValues', 'ListOfDataValue'),
9288
               ]
9289
9290
    def __init__(self):
9291
        self.NodeId = NodeId()
9292
        self.PerformInsertReplace = PerformUpdateType(0)
9293
        self.UpdateValues = []
9294
        self._freeze = True
9295 1
9296
    def to_binary(self):
9297
        packet = []
9298
        packet.append(self.NodeId.to_binary())
9299
        packet.append(uabin.Primitives.UInt32.pack(self.PerformInsertReplace.value))
9300
        packet.append(uabin.Primitives.Int32.pack(len(self.UpdateValues)))
9301
        for fieldname in self.UpdateValues:
9302
            packet.append(fieldname.to_binary())
9303
        return b''.join(packet)
9304
9305 View Code Duplication
    @staticmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9306 1
    def from_binary(data):
9307
        obj = UpdateDataDetails()
9308
        obj.NodeId = NodeId.from_binary(data)
9309
        self.PerformInsertReplace = PerformUpdateType(uabin.Primitives.UInt32.unpack(data))
9310 1
        length = uabin.Primitives.Int32.unpack(data)
9311
        array = []
9312
        if length != -1:
9313
            for _ in range(0, length):
9314
                array.append(DataValue.from_binary(data))
9315
        obj.UpdateValues = array
9316
        return obj
9317
9318
    def __str__(self):
9319
        return 'UpdateDataDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
9320
               'PerformInsertReplace:' + str(self.PerformInsertReplace) + ', ' + \
9321
               'UpdateValues:' + str(self.UpdateValues) + ')'
9322 1
9323
    __repr__ = __str__
9324
9325
9326
class UpdateStructureDataDetails(FrozenClass):
9327
    '''
9328
    :ivar NodeId:
9329 1
    :vartype NodeId: NodeId
9330
    :ivar PerformInsertReplace:
9331
    :vartype PerformInsertReplace: PerformUpdateType
9332 1
    :ivar UpdateValues:
9333
    :vartype UpdateValues: DataValue
9334
    '''
9335
9336
    ua_types = [
9337
        ('NodeId', 'NodeId'),
9338
        ('PerformInsertReplace', 'PerformUpdateType'),
9339
        ('UpdateValues', 'ListOfDataValue'),
9340 1
               ]
9341
9342
    def __init__(self):
9343
        self.NodeId = NodeId()
9344
        self.PerformInsertReplace = PerformUpdateType(0)
9345 1
        self.UpdateValues = []
9346
        self._freeze = True
9347
9348
    def to_binary(self):
9349
        packet = []
9350
        packet.append(self.NodeId.to_binary())
9351
        packet.append(uabin.Primitives.UInt32.pack(self.PerformInsertReplace.value))
9352
        packet.append(uabin.Primitives.Int32.pack(len(self.UpdateValues)))
9353
        for fieldname in self.UpdateValues:
9354 1
            packet.append(fieldname.to_binary())
9355
        return b''.join(packet)
9356
9357 View Code Duplication
    @staticmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9358
    def from_binary(data):
9359
        obj = UpdateStructureDataDetails()
9360
        obj.NodeId = NodeId.from_binary(data)
9361
        self.PerformInsertReplace = PerformUpdateType(uabin.Primitives.UInt32.unpack(data))
9362 1
        length = uabin.Primitives.Int32.unpack(data)
9363
        array = []
9364
        if length != -1:
9365
            for _ in range(0, length):
9366 1
                array.append(DataValue.from_binary(data))
9367
        obj.UpdateValues = array
9368
        return obj
9369
9370 1
    def __str__(self):
9371
        return 'UpdateStructureDataDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
9372
               'PerformInsertReplace:' + str(self.PerformInsertReplace) + ', ' + \
9373
               'UpdateValues:' + str(self.UpdateValues) + ')'
9374 1
9375
    __repr__ = __str__
9376
9377 1
9378
class UpdateEventDetails(FrozenClass):
9379
    '''
9380
    :ivar NodeId:
9381
    :vartype NodeId: NodeId
9382
    :ivar PerformInsertReplace:
9383 1
    :vartype PerformInsertReplace: PerformUpdateType
9384
    :ivar Filter:
9385
    :vartype Filter: EventFilter
9386
    :ivar EventData:
9387 1
    :vartype EventData: HistoryEventFieldList
9388 1
    '''
9389
9390
    ua_types = [
9391
        ('NodeId', 'NodeId'),
9392 1
        ('PerformInsertReplace', 'PerformUpdateType'),
9393 1
        ('Filter', 'EventFilter'),
9394
        ('EventData', 'ListOfHistoryEventFieldList'),
9395 1
               ]
9396
9397
    def __init__(self):
9398
        self.NodeId = NodeId()
9399
        self.PerformInsertReplace = PerformUpdateType(0)
9400
        self.Filter = EventFilter()
9401
        self.EventData = []
9402 1
        self._freeze = True
9403
9404
    def to_binary(self):
9405
        packet = []
9406 1
        packet.append(self.NodeId.to_binary())
9407
        packet.append(uabin.Primitives.UInt32.pack(self.PerformInsertReplace.value))
9408
        packet.append(self.Filter.to_binary())
9409
        packet.append(uabin.Primitives.Int32.pack(len(self.EventData)))
9410
        for fieldname in self.EventData:
9411
            packet.append(fieldname.to_binary())
9412
        return b''.join(packet)
9413
9414 1
    @staticmethod
9415
    def from_binary(data):
9416
        obj = UpdateEventDetails()
9417 1
        obj.NodeId = NodeId.from_binary(data)
9418
        self.PerformInsertReplace = PerformUpdateType(uabin.Primitives.UInt32.unpack(data))
9419
        obj.Filter = EventFilter.from_binary(data)
9420 1
        length = uabin.Primitives.Int32.unpack(data)
9421
        array = []
9422
        if length != -1:
9423
            for _ in range(0, length):
9424
                array.append(HistoryEventFieldList.from_binary(data))
9425
        obj.EventData = array
9426
        return obj
9427
9428
    def __str__(self):
9429
        return 'UpdateEventDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
9430 1
               'PerformInsertReplace:' + str(self.PerformInsertReplace) + ', ' + \
9431
               'Filter:' + str(self.Filter) + ', ' + \
9432
               'EventData:' + str(self.EventData) + ')'
9433
9434
    __repr__ = __str__
9435
9436 1
9437
class DeleteRawModifiedDetails(FrozenClass):
9438
    '''
9439
    :ivar NodeId:
9440
    :vartype NodeId: NodeId
9441
    :ivar IsDeleteModified:
9442
    :vartype IsDeleteModified: Boolean
9443
    :ivar StartTime:
9444
    :vartype StartTime: DateTime
9445
    :ivar EndTime:
9446 1
    :vartype EndTime: DateTime
9447
    '''
9448
9449
    ua_types = [
9450
        ('NodeId', 'NodeId'),
9451
        ('IsDeleteModified', 'Boolean'),
9452
        ('StartTime', 'DateTime'),
9453 1
        ('EndTime', 'DateTime'),
9454
               ]
9455
9456
    def __init__(self):
9457 1
        self.NodeId = NodeId()
9458
        self.IsDeleteModified = True
9459
        self.StartTime = datetime.utcnow()
9460
        self.EndTime = datetime.utcnow()
9461
        self._freeze = True
9462 1
9463
    def to_binary(self):
9464
        packet = []
9465
        packet.append(self.NodeId.to_binary())
9466
        packet.append(uabin.Primitives.Boolean.pack(self.IsDeleteModified))
9467 1
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
9468
        packet.append(uabin.Primitives.DateTime.pack(self.EndTime))
9469
        return b''.join(packet)
9470 1
9471
    @staticmethod
9472
    def from_binary(data):
9473
        obj = DeleteRawModifiedDetails()
9474
        obj.NodeId = NodeId.from_binary(data)
9475
        self.IsDeleteModified = uabin.Primitives.Boolean.unpack(data)
9476
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
9477
        self.EndTime = uabin.Primitives.DateTime.unpack(data)
9478 1
        return obj
9479
9480
    def __str__(self):
9481
        return 'DeleteRawModifiedDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
9482
               'IsDeleteModified:' + str(self.IsDeleteModified) + ', ' + \
9483 1
               'StartTime:' + str(self.StartTime) + ', ' + \
9484
               'EndTime:' + str(self.EndTime) + ')'
9485
9486
    __repr__ = __str__
9487
9488
9489
class DeleteAtTimeDetails(FrozenClass):
9490
    '''
9491
    :ivar NodeId:
9492 1
    :vartype NodeId: NodeId
9493
    :ivar ReqTimes:
9494
    :vartype ReqTimes: DateTime
9495
    '''
9496
9497
    ua_types = [
9498
        ('NodeId', 'NodeId'),
9499
        ('ReqTimes', 'ListOfDateTime'),
9500
               ]
9501
9502 1
    def __init__(self):
9503
        self.NodeId = NodeId()
9504
        self.ReqTimes = []
9505
        self._freeze = True
9506 1
9507
    def to_binary(self):
9508
        packet = []
9509
        packet.append(self.NodeId.to_binary())
9510
        packet.append(uabin.Primitives.Int32.pack(len(self.ReqTimes)))
9511
        for fieldname in self.ReqTimes:
9512
            packet.append(uabin.Primitives.DateTime.pack(fieldname))
9513
        return b''.join(packet)
9514
9515
    @staticmethod
9516
    def from_binary(data):
9517
        obj = DeleteAtTimeDetails()
9518
        obj.NodeId = NodeId.from_binary(data)
9519
        obj.ReqTimes = uabin.Primitives.DateTime.unpack_array(data)
9520 1
        return obj
9521
9522
    def __str__(self):
9523
        return 'DeleteAtTimeDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
9524 1
               'ReqTimes:' + str(self.ReqTimes) + ')'
9525
9526
    __repr__ = __str__
9527 1
9528
9529
class DeleteEventDetails(FrozenClass):
9530
    '''
9531
    :ivar NodeId:
9532
    :vartype NodeId: NodeId
9533 1
    :ivar EventIds:
9534
    :vartype EventIds: ByteString
9535
    '''
9536
9537 1
    ua_types = [
9538 1
        ('NodeId', 'NodeId'),
9539
        ('EventIds', 'ListOfByteString'),
9540
               ]
9541
9542 1
    def __init__(self):
9543 1
        self.NodeId = NodeId()
9544
        self.EventIds = []
9545 1
        self._freeze = True
9546
9547
    def to_binary(self):
9548
        packet = []
9549
        packet.append(self.NodeId.to_binary())
9550
        packet.append(uabin.Primitives.Int32.pack(len(self.EventIds)))
9551
        for fieldname in self.EventIds:
9552 1
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
9553
        return b''.join(packet)
9554
9555
    @staticmethod
9556 1
    def from_binary(data):
9557
        obj = DeleteEventDetails()
9558
        obj.NodeId = NodeId.from_binary(data)
9559
        obj.EventIds = uabin.Primitives.ByteString.unpack_array(data)
9560
        return obj
9561
9562
    def __str__(self):
9563
        return 'DeleteEventDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
9564 1
               'EventIds:' + str(self.EventIds) + ')'
9565
9566
    __repr__ = __str__
9567 1
9568
9569
class HistoryUpdateResult(FrozenClass):
9570 1
    '''
9571
    :ivar StatusCode:
9572
    :vartype StatusCode: StatusCode
9573
    :ivar OperationResults:
9574
    :vartype OperationResults: StatusCode
9575
    :ivar DiagnosticInfos:
9576
    :vartype DiagnosticInfos: DiagnosticInfo
9577
    '''
9578
9579
    ua_types = [
9580
        ('StatusCode', 'StatusCode'),
9581
        ('OperationResults', 'ListOfStatusCode'),
9582 1
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
9583
               ]
9584
9585
    def __init__(self):
9586
        self.StatusCode = StatusCode()
9587
        self.OperationResults = []
9588
        self.DiagnosticInfos = []
9589 1
        self._freeze = True
9590 1
9591
    def to_binary(self):
9592
        packet = []
9593
        packet.append(self.StatusCode.to_binary())
9594 1
        packet.append(uabin.Primitives.Int32.pack(len(self.OperationResults)))
9595 1
        for fieldname in self.OperationResults:
9596 1
            packet.append(fieldname.to_binary())
9597 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
9598 1
        for fieldname in self.DiagnosticInfos:
9599
            packet.append(fieldname.to_binary())
9600 1
        return b''.join(packet)
9601
9602
    @staticmethod
9603
    def from_binary(data):
9604
        obj = HistoryUpdateResult()
9605
        obj.StatusCode = StatusCode.from_binary(data)
9606
        length = uabin.Primitives.Int32.unpack(data)
9607
        array = []
9608
        if length != -1:
9609
            for _ in range(0, length):
9610 1
                array.append(StatusCode.from_binary(data))
9611
        obj.OperationResults = array
9612
        length = uabin.Primitives.Int32.unpack(data)
9613
        array = []
9614 1
        if length != -1:
9615
            for _ in range(0, length):
9616
                array.append(DiagnosticInfo.from_binary(data))
9617
        obj.DiagnosticInfos = array
9618
        return obj
9619
9620
    def __str__(self):
9621
        return 'HistoryUpdateResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
9622
               'OperationResults:' + str(self.OperationResults) + ', ' + \
9623
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
9624
9625 1
    __repr__ = __str__
9626
9627
9628
class HistoryUpdateParameters(FrozenClass):
9629
    '''
9630
    :ivar HistoryUpdateDetails:
9631 1
    :vartype HistoryUpdateDetails: ExtensionObject
9632
    '''
9633
9634 1
    ua_types = [
9635
        ('HistoryUpdateDetails', 'ListOfExtensionObject'),
9636
               ]
9637
9638
    def __init__(self):
9639
        self.HistoryUpdateDetails = []
9640
        self._freeze = True
9641
9642
    def to_binary(self):
9643
        packet = []
9644 1
        packet.append(uabin.Primitives.Int32.pack(len(self.HistoryUpdateDetails)))
9645
        for fieldname in self.HistoryUpdateDetails:
9646
            packet.append(uabin.extensionobject_to_binary(fieldname))
9647
        return b''.join(packet)
9648
9649
    @staticmethod
9650 1
    def from_binary(data):
9651
        obj = HistoryUpdateParameters()
9652
        length = uabin.Primitives.Int32.unpack(data)
9653
        array = []
9654
        if length != -1:
9655
            for _ in range(0, length):
9656
                array.append(uabin.extensionobject_from_binary(data))
9657
        obj.HistoryUpdateDetails = array
9658
        return obj
9659
9660 1
    def __str__(self):
9661
        return 'HistoryUpdateParameters(' + 'HistoryUpdateDetails:' + str(self.HistoryUpdateDetails) + ')'
9662
9663
    __repr__ = __str__
9664
9665
9666
class HistoryUpdateRequest(FrozenClass):
9667 1
    '''
9668
    :ivar TypeId:
9669
    :vartype TypeId: NodeId
9670
    :ivar RequestHeader:
9671 1
    :vartype RequestHeader: RequestHeader
9672
    :ivar Parameters:
9673
    :vartype Parameters: HistoryUpdateParameters
9674
    '''
9675
9676 1
    ua_types = [
9677
        ('TypeId', 'NodeId'),
9678
        ('RequestHeader', 'RequestHeader'),
9679
        ('Parameters', 'HistoryUpdateParameters'),
9680
               ]
9681 1
9682
    def __init__(self):
9683
        self.TypeId = FourByteNodeId(ObjectIds.HistoryUpdateRequest_Encoding_DefaultBinary)
9684 1
        self.RequestHeader = RequestHeader()
9685
        self.Parameters = HistoryUpdateParameters()
9686
        self._freeze = True
9687
9688
    def to_binary(self):
9689
        packet = []
9690
        packet.append(self.TypeId.to_binary())
9691
        packet.append(self.RequestHeader.to_binary())
9692
        packet.append(self.Parameters.to_binary())
9693
        return b''.join(packet)
9694
9695
    @staticmethod
9696 1
    def from_binary(data):
9697
        obj = HistoryUpdateRequest()
9698
        obj.TypeId = NodeId.from_binary(data)
9699
        obj.RequestHeader = RequestHeader.from_binary(data)
9700
        obj.Parameters = HistoryUpdateParameters.from_binary(data)
9701
        return obj
9702
9703 1
    def __str__(self):
9704
        return 'HistoryUpdateRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9705
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
9706
               'Parameters:' + str(self.Parameters) + ')'
9707
9708
    __repr__ = __str__
9709
9710
9711
class HistoryUpdateResponse(FrozenClass):
9712
    '''
9713
    :ivar TypeId:
9714 1
    :vartype TypeId: NodeId
9715
    :ivar ResponseHeader:
9716
    :vartype ResponseHeader: ResponseHeader
9717
    :ivar Results:
9718
    :vartype Results: HistoryUpdateResult
9719
    :ivar DiagnosticInfos:
9720
    :vartype DiagnosticInfos: DiagnosticInfo
9721
    '''
9722
9723
    ua_types = [
9724
        ('TypeId', 'NodeId'),
9725
        ('ResponseHeader', 'ResponseHeader'),
9726 1
        ('Results', 'ListOfHistoryUpdateResult'),
9727
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
9728
               ]
9729
9730 1
    def __init__(self):
9731
        self.TypeId = FourByteNodeId(ObjectIds.HistoryUpdateResponse_Encoding_DefaultBinary)
9732
        self.ResponseHeader = ResponseHeader()
9733
        self.Results = []
9734
        self.DiagnosticInfos = []
9735
        self._freeze = True
9736
9737
    def to_binary(self):
9738
        packet = []
9739
        packet.append(self.TypeId.to_binary())
9740
        packet.append(self.ResponseHeader.to_binary())
9741
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
9742
        for fieldname in self.Results:
9743
            packet.append(fieldname.to_binary())
9744
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
9745
        for fieldname in self.DiagnosticInfos:
9746 1
            packet.append(fieldname.to_binary())
9747
        return b''.join(packet)
9748
9749
    @staticmethod
9750
    def from_binary(data):
9751
        obj = HistoryUpdateResponse()
9752 1
        obj.TypeId = NodeId.from_binary(data)
9753
        obj.ResponseHeader = ResponseHeader.from_binary(data)
9754
        length = uabin.Primitives.Int32.unpack(data)
9755 1
        array = []
9756
        if length != -1:
9757
            for _ in range(0, length):
9758
                array.append(HistoryUpdateResult.from_binary(data))
9759
        obj.Results = array
9760
        length = uabin.Primitives.Int32.unpack(data)
9761
        array = []
9762
        if length != -1:
9763
            for _ in range(0, length):
9764
                array.append(DiagnosticInfo.from_binary(data))
9765
        obj.DiagnosticInfos = array
9766
        return obj
9767 1
9768
    def __str__(self):
9769
        return 'HistoryUpdateResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9770
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
9771
               'Results:' + str(self.Results) + ', ' + \
9772
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
9773
9774 1
    __repr__ = __str__
9775 1
9776 1
9777 1
class CallMethodRequest(FrozenClass):
9778 1
    '''
9779 1
    :ivar ObjectId:
9780 1
    :vartype ObjectId: NodeId
9781 1
    :ivar MethodId:
9782 1
    :vartype MethodId: NodeId
9783 1
    :ivar InputArguments:
9784
    :vartype InputArguments: Variant
9785 1
    '''
9786 1
9787 1
    ua_types = [
9788 1
        ('ObjectId', 'NodeId'),
9789 1
        ('MethodId', 'NodeId'),
9790 1
        ('InputArguments', 'ListOfVariant'),
9791 1
               ]
9792
9793 1
    def __init__(self):
9794
        self.ObjectId = NodeId()
9795 1
        self.MethodId = NodeId()
9796
        self.InputArguments = []
9797 1
        self._freeze = True
9798 1
9799 1
    def to_binary(self):
9800 1
        packet = []
9801 1
        packet.append(self.ObjectId.to_binary())
9802
        packet.append(self.MethodId.to_binary())
9803 1
        packet.append(uabin.Primitives.Int32.pack(len(self.InputArguments)))
9804
        for fieldname in self.InputArguments:
9805
            packet.append(fieldname.to_binary())
9806
        return b''.join(packet)
9807
9808
    @staticmethod
9809 1
    def from_binary(data):
9810
        obj = CallMethodRequest()
9811
        obj.ObjectId = NodeId.from_binary(data)
9812 1
        obj.MethodId = NodeId.from_binary(data)
9813
        length = uabin.Primitives.Int32.unpack(data)
9814
        array = []
9815
        if length != -1:
9816
            for _ in range(0, length):
9817
                array.append(Variant.from_binary(data))
9818 1
        obj.InputArguments = array
9819
        return obj
9820
9821
    def __str__(self):
9822 1
        return 'CallMethodRequest(' + 'ObjectId:' + str(self.ObjectId) + ', ' + \
9823 1
               'MethodId:' + str(self.MethodId) + ', ' + \
9824 1
               'InputArguments:' + str(self.InputArguments) + ')'
9825 1
9826 1
    __repr__ = __str__
9827 1
9828 1
9829
class CallMethodResult(FrozenClass):
9830 1
    '''
9831 1
    :ivar StatusCode:
9832 1
    :vartype StatusCode: StatusCode
9833 1
    :ivar InputArgumentResults:
9834 1
    :vartype InputArgumentResults: StatusCode
9835 1
    :ivar InputArgumentDiagnosticInfos:
9836
    :vartype InputArgumentDiagnosticInfos: DiagnosticInfo
9837 1
    :ivar OutputArguments:
9838
    :vartype OutputArguments: Variant
9839 1
    '''
9840
9841 1
    ua_types = [
9842 1
        ('StatusCode', 'StatusCode'),
9843 1
        ('InputArgumentResults', 'ListOfStatusCode'),
9844 1
        ('InputArgumentDiagnosticInfos', 'ListOfDiagnosticInfo'),
9845 1
        ('OutputArguments', 'ListOfVariant'),
9846 1
               ]
9847 1
9848
    def __init__(self):
9849 1
        self.StatusCode = StatusCode()
9850
        self.InputArgumentResults = []
9851
        self.InputArgumentDiagnosticInfos = []
9852 1
        self.OutputArguments = []
9853
        self._freeze = True
9854
9855 1
    def to_binary(self):
9856
        packet = []
9857
        packet.append(self.StatusCode.to_binary())
9858
        packet.append(uabin.Primitives.Int32.pack(len(self.InputArgumentResults)))
9859
        for fieldname in self.InputArgumentResults:
9860
            packet.append(fieldname.to_binary())
9861
        packet.append(uabin.Primitives.Int32.pack(len(self.InputArgumentDiagnosticInfos)))
9862
        for fieldname in self.InputArgumentDiagnosticInfos:
9863
            packet.append(fieldname.to_binary())
9864
        packet.append(uabin.Primitives.Int32.pack(len(self.OutputArguments)))
9865 1
        for fieldname in self.OutputArguments:
9866
            packet.append(fieldname.to_binary())
9867
        return b''.join(packet)
9868
9869
    @staticmethod
9870
    def from_binary(data):
9871 1
        obj = CallMethodResult()
9872 1
        obj.StatusCode = StatusCode.from_binary(data)
9873
        length = uabin.Primitives.Int32.unpack(data)
9874
        array = []
9875
        if length != -1:
9876 1
            for _ in range(0, length):
9877 1
                array.append(StatusCode.from_binary(data))
9878 1
        obj.InputArgumentResults = array
9879 1
        length = uabin.Primitives.Int32.unpack(data)
9880
        array = []
9881 1
        if length != -1:
9882 1
            for _ in range(0, length):
9883 1
                array.append(DiagnosticInfo.from_binary(data))
9884 1
        obj.InputArgumentDiagnosticInfos = array
9885 1
        length = uabin.Primitives.Int32.unpack(data)
9886 1
        array = []
9887
        if length != -1:
9888 1
            for _ in range(0, length):
9889
                array.append(Variant.from_binary(data))
9890
        obj.OutputArguments = array
9891
        return obj
9892 1
9893
    def __str__(self):
9894
        return 'CallMethodResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
9895
               'InputArgumentResults:' + str(self.InputArgumentResults) + ', ' + \
9896
               'InputArgumentDiagnosticInfos:' + str(self.InputArgumentDiagnosticInfos) + ', ' + \
9897 1
               'OutputArguments:' + str(self.OutputArguments) + ')'
9898
9899
    __repr__ = __str__
9900
9901
9902 1
class CallParameters(FrozenClass):
9903
    '''
9904
    :ivar MethodsToCall:
9905 1
    :vartype MethodsToCall: CallMethodRequest
9906
    '''
9907
9908
    ua_types = [
9909
        ('MethodsToCall', 'ListOfCallMethodRequest'),
9910
               ]
9911
9912
    def __init__(self):
9913
        self.MethodsToCall = []
9914
        self._freeze = True
9915
9916
    def to_binary(self):
9917 1
        packet = []
9918
        packet.append(uabin.Primitives.Int32.pack(len(self.MethodsToCall)))
9919
        for fieldname in self.MethodsToCall:
9920
            packet.append(fieldname.to_binary())
9921
        return b''.join(packet)
9922
9923
    @staticmethod
9924 1
    def from_binary(data):
9925 1
        obj = CallParameters()
9926 1
        length = uabin.Primitives.Int32.unpack(data)
9927 1
        array = []
9928 1
        if length != -1:
9929 1
            for _ in range(0, length):
9930 1
                array.append(CallMethodRequest.from_binary(data))
9931 1
        obj.MethodsToCall = array
9932 1
        return obj
9933 1
9934
    def __str__(self):
9935 1
        return 'CallParameters(' + 'MethodsToCall:' + str(self.MethodsToCall) + ')'
9936 1
9937 1
    __repr__ = __str__
9938 1
9939 1
9940 1
class CallRequest(FrozenClass):
9941 1
    '''
9942 1
    :ivar TypeId:
9943 1
    :vartype TypeId: NodeId
9944
    :ivar RequestHeader:
9945 1
    :vartype RequestHeader: RequestHeader
9946
    :ivar Parameters:
9947 1
    :vartype Parameters: CallParameters
9948
    '''
9949 1
9950
    ua_types = [
9951 1
        ('TypeId', 'NodeId'),
9952 1
        ('RequestHeader', 'RequestHeader'),
9953 1
        ('Parameters', 'CallParameters'),
9954 1
               ]
9955 1
9956 1
    def __init__(self):
9957 1
        self.TypeId = FourByteNodeId(ObjectIds.CallRequest_Encoding_DefaultBinary)
9958 1
        self.RequestHeader = RequestHeader()
9959 1
        self.Parameters = CallParameters()
9960 1
        self._freeze = True
9961 1
9962 1
    def to_binary(self):
9963 1
        packet = []
9964
        packet.append(self.TypeId.to_binary())
9965 1
        packet.append(self.RequestHeader.to_binary())
9966
        packet.append(self.Parameters.to_binary())
9967 1
        return b''.join(packet)
9968
9969
    @staticmethod
9970
    def from_binary(data):
9971
        obj = CallRequest()
9972
        obj.TypeId = NodeId.from_binary(data)
9973 1
        obj.RequestHeader = RequestHeader.from_binary(data)
9974
        obj.Parameters = CallParameters.from_binary(data)
9975
        return obj
9976 1
9977
    def __str__(self):
9978
        return 'CallRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9979
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
9980
               'Parameters:' + str(self.Parameters) + ')'
9981
9982 1
    __repr__ = __str__
9983
9984
9985
class CallResponse(FrozenClass):
9986 1
    '''
9987
    :ivar TypeId:
9988
    :vartype TypeId: NodeId
9989
    :ivar ResponseHeader:
9990
    :vartype ResponseHeader: ResponseHeader
9991
    :ivar Results:
9992
    :vartype Results: CallMethodResult
9993
    :ivar DiagnosticInfos:
9994 1
    :vartype DiagnosticInfos: DiagnosticInfo
9995
    '''
9996
9997
    ua_types = [
9998
        ('TypeId', 'NodeId'),
9999 1
        ('ResponseHeader', 'ResponseHeader'),
10000
        ('Results', 'ListOfCallMethodResult'),
10001
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
10002
               ]
10003 1
10004
    def __init__(self):
10005
        self.TypeId = FourByteNodeId(ObjectIds.CallResponse_Encoding_DefaultBinary)
10006 1
        self.ResponseHeader = ResponseHeader()
10007
        self.Results = []
10008
        self.DiagnosticInfos = []
10009 1
        self._freeze = True
10010
10011
    def to_binary(self):
10012 1
        packet = []
10013
        packet.append(self.TypeId.to_binary())
10014
        packet.append(self.ResponseHeader.to_binary())
10015
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
10016
        for fieldname in self.Results:
10017
            packet.append(fieldname.to_binary())
10018
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
10019
        for fieldname in self.DiagnosticInfos:
10020
            packet.append(fieldname.to_binary())
10021
        return b''.join(packet)
10022 1
10023
    @staticmethod
10024
    def from_binary(data):
10025
        obj = CallResponse()
10026
        obj.TypeId = NodeId.from_binary(data)
10027
        obj.ResponseHeader = ResponseHeader.from_binary(data)
10028 1
        length = uabin.Primitives.Int32.unpack(data)
10029
        array = []
10030
        if length != -1:
10031
            for _ in range(0, length):
10032
                array.append(CallMethodResult.from_binary(data))
10033
        obj.Results = array
10034
        length = uabin.Primitives.Int32.unpack(data)
10035
        array = []
10036
        if length != -1:
10037
            for _ in range(0, length):
10038 1
                array.append(DiagnosticInfo.from_binary(data))
10039
        obj.DiagnosticInfos = array
10040
        return obj
10041
10042
    def __str__(self):
10043
        return 'CallResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10044
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
10045
               'Results:' + str(self.Results) + ', ' + \
10046
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
10047 1
10048
    __repr__ = __str__
10049
10050
10051 1
class MonitoringFilter(FrozenClass):
10052
    '''
10053
    '''
10054
10055
    ua_types = [
10056
               ]
10057
10058
    def __init__(self):
10059
        self._freeze = True
10060
10061 1
    def to_binary(self):
10062
        packet = []
10063
        return b''.join(packet)
10064
10065
    @staticmethod
10066 1
    def from_binary(data):
10067
        obj = MonitoringFilter()
10068
        return obj
10069 1
10070
    def __str__(self):
10071
        return 'MonitoringFilter(' +  + ')'
10072
10073
    __repr__ = __str__
10074
10075
10076
class DataChangeFilter(FrozenClass):
10077
    '''
10078
    :ivar Trigger:
10079 1
    :vartype Trigger: DataChangeTrigger
10080
    :ivar DeadbandType:
10081
    :vartype DeadbandType: UInt32
10082
    :ivar DeadbandValue:
10083
    :vartype DeadbandValue: Double
10084
    '''
10085 1
10086
    ua_types = [
10087
        ('Trigger', 'DataChangeTrigger'),
10088
        ('DeadbandType', 'UInt32'),
10089
        ('DeadbandValue', 'Double'),
10090
               ]
10091
10092
    def __init__(self):
10093
        self.Trigger = DataChangeTrigger(0)
10094
        self.DeadbandType = 0
10095 1
        self.DeadbandValue = 0
10096
        self._freeze = True
10097
10098
    def to_binary(self):
10099
        packet = []
10100
        packet.append(uabin.Primitives.UInt32.pack(self.Trigger.value))
10101
        packet.append(uabin.Primitives.UInt32.pack(self.DeadbandType))
10102
        packet.append(uabin.Primitives.Double.pack(self.DeadbandValue))
10103
        return b''.join(packet)
10104 1
10105
    @staticmethod
10106
    def from_binary(data):
10107
        obj = DataChangeFilter()
10108 1
        self.Trigger = DataChangeTrigger(uabin.Primitives.UInt32.unpack(data))
10109
        self.DeadbandType = uabin.Primitives.UInt32.unpack(data)
10110
        self.DeadbandValue = uabin.Primitives.Double.unpack(data)
10111
        return obj
10112
10113
    def __str__(self):
10114
        return 'DataChangeFilter(' + 'Trigger:' + str(self.Trigger) + ', ' + \
10115
               'DeadbandType:' + str(self.DeadbandType) + ', ' + \
10116
               'DeadbandValue:' + str(self.DeadbandValue) + ')'
10117
10118 1
    __repr__ = __str__
10119
10120
10121
class EventFilter(FrozenClass):
10122
    '''
10123 1
    :ivar SelectClauses:
10124
    :vartype SelectClauses: SimpleAttributeOperand
10125
    :ivar WhereClause:
10126 1
    :vartype WhereClause: ContentFilter
10127
    '''
10128
10129
    ua_types = [
10130
        ('SelectClauses', 'ListOfSimpleAttributeOperand'),
10131
        ('WhereClause', 'ContentFilter'),
10132
               ]
10133
10134
    def __init__(self):
10135
        self.SelectClauses = []
10136
        self.WhereClause = ContentFilter()
10137
        self._freeze = True
10138 1
10139
    def to_binary(self):
10140
        packet = []
10141
        packet.append(uabin.Primitives.Int32.pack(len(self.SelectClauses)))
10142
        for fieldname in self.SelectClauses:
10143
            packet.append(fieldname.to_binary())
10144
        packet.append(self.WhereClause.to_binary())
10145 1
        return b''.join(packet)
10146
10147
    @staticmethod
10148
    def from_binary(data):
10149
        obj = EventFilter()
10150
        length = uabin.Primitives.Int32.unpack(data)
10151
        array = []
10152
        if length != -1:
10153
            for _ in range(0, length):
10154
                array.append(SimpleAttributeOperand.from_binary(data))
10155
        obj.SelectClauses = array
10156 1
        obj.WhereClause = ContentFilter.from_binary(data)
10157
        return obj
10158
10159
    def __str__(self):
10160
        return 'EventFilter(' + 'SelectClauses:' + str(self.SelectClauses) + ', ' + \
10161
               'WhereClause:' + str(self.WhereClause) + ')'
10162
10163
    __repr__ = __str__
10164
10165
10166 1
class AggregateConfiguration(FrozenClass):
10167
    '''
10168
    :ivar UseServerCapabilitiesDefaults:
10169
    :vartype UseServerCapabilitiesDefaults: Boolean
10170 1
    :ivar TreatUncertainAsBad:
10171
    :vartype TreatUncertainAsBad: Boolean
10172
    :ivar PercentDataBad:
10173
    :vartype PercentDataBad: Byte
10174
    :ivar PercentDataGood:
10175
    :vartype PercentDataGood: Byte
10176
    :ivar UseSlopedExtrapolation:
10177
    :vartype UseSlopedExtrapolation: Boolean
10178
    '''
10179
10180
    ua_types = [
10181 1
        ('UseServerCapabilitiesDefaults', 'Boolean'),
10182
        ('TreatUncertainAsBad', 'Boolean'),
10183
        ('PercentDataBad', 'Byte'),
10184
        ('PercentDataGood', 'Byte'),
10185
        ('UseSlopedExtrapolation', 'Boolean'),
10186 View Code Duplication
               ]
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10187 1
10188
    def __init__(self):
10189
        self.UseServerCapabilitiesDefaults = True
10190 1
        self.TreatUncertainAsBad = True
10191
        self.PercentDataBad = 0
10192
        self.PercentDataGood = 0
10193
        self.UseSlopedExtrapolation = True
10194
        self._freeze = True
10195
10196
    def to_binary(self):
10197
        packet = []
10198
        packet.append(uabin.Primitives.Boolean.pack(self.UseServerCapabilitiesDefaults))
10199
        packet.append(uabin.Primitives.Boolean.pack(self.TreatUncertainAsBad))
10200
        packet.append(uabin.Primitives.Byte.pack(self.PercentDataBad))
10201
        packet.append(uabin.Primitives.Byte.pack(self.PercentDataGood))
10202 1
        packet.append(uabin.Primitives.Boolean.pack(self.UseSlopedExtrapolation))
10203
        return b''.join(packet)
10204
10205
    @staticmethod
10206
    def from_binary(data):
10207
        obj = AggregateConfiguration()
10208
        self.UseServerCapabilitiesDefaults = uabin.Primitives.Boolean.unpack(data)
10209 1
        self.TreatUncertainAsBad = uabin.Primitives.Boolean.unpack(data)
10210
        self.PercentDataBad = uabin.Primitives.Byte.unpack(data)
10211
        self.PercentDataGood = uabin.Primitives.Byte.unpack(data)
10212
        self.UseSlopedExtrapolation = uabin.Primitives.Boolean.unpack(data)
10213
        return obj
10214
10215
    def __str__(self):
10216
        return 'AggregateConfiguration(' + 'UseServerCapabilitiesDefaults:' + str(self.UseServerCapabilitiesDefaults) + ', ' + \
10217
               'TreatUncertainAsBad:' + str(self.TreatUncertainAsBad) + ', ' + \
10218
               'PercentDataBad:' + str(self.PercentDataBad) + ', ' + \
10219
               'PercentDataGood:' + str(self.PercentDataGood) + ', ' + \
10220 1
               'UseSlopedExtrapolation:' + str(self.UseSlopedExtrapolation) + ')'
10221
10222
    __repr__ = __str__
10223
10224
10225
class AggregateFilter(FrozenClass):
10226
    '''
10227
    :ivar StartTime:
10228 1
    :vartype StartTime: DateTime
10229
    :ivar AggregateType:
10230
    :vartype AggregateType: NodeId
10231
    :ivar ProcessingInterval:
10232 1
    :vartype ProcessingInterval: Double
10233
    :ivar AggregateConfiguration:
10234
    :vartype AggregateConfiguration: AggregateConfiguration
10235
    '''
10236
10237
    ua_types = [
10238 1
        ('StartTime', 'DateTime'),
10239
        ('AggregateType', 'NodeId'),
10240
        ('ProcessingInterval', 'Double'),
10241
        ('AggregateConfiguration', 'AggregateConfiguration'),
10242
               ]
10243
10244 1
    def __init__(self):
10245
        self.StartTime = datetime.utcnow()
10246
        self.AggregateType = NodeId()
10247 1
        self.ProcessingInterval = 0
10248
        self.AggregateConfiguration = AggregateConfiguration()
10249
        self._freeze = True
10250
10251
    def to_binary(self):
10252
        packet = []
10253
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
10254
        packet.append(self.AggregateType.to_binary())
10255 1
        packet.append(uabin.Primitives.Double.pack(self.ProcessingInterval))
10256
        packet.append(self.AggregateConfiguration.to_binary())
10257
        return b''.join(packet)
10258
10259
    @staticmethod
10260 1
    def from_binary(data):
10261
        obj = AggregateFilter()
10262
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
10263
        obj.AggregateType = NodeId.from_binary(data)
10264
        self.ProcessingInterval = uabin.Primitives.Double.unpack(data)
10265
        obj.AggregateConfiguration = AggregateConfiguration.from_binary(data)
10266
        return obj
10267
10268
    def __str__(self):
10269 1
        return 'AggregateFilter(' + 'StartTime:' + str(self.StartTime) + ', ' + \
10270
               'AggregateType:' + str(self.AggregateType) + ', ' + \
10271
               'ProcessingInterval:' + str(self.ProcessingInterval) + ', ' + \
10272
               'AggregateConfiguration:' + str(self.AggregateConfiguration) + ')'
10273
10274
    __repr__ = __str__
10275
10276
10277 1
class MonitoringFilterResult(FrozenClass):
10278
    '''
10279
    '''
10280
10281 1
    ua_types = [
10282
               ]
10283
10284
    def __init__(self):
10285 1
        self._freeze = True
10286
10287
    def to_binary(self):
10288
        packet = []
10289 1
        return b''.join(packet)
10290
10291
    @staticmethod
10292 1
    def from_binary(data):
10293
        obj = MonitoringFilterResult()
10294
        return obj
10295
10296
    def __str__(self):
10297
        return 'MonitoringFilterResult(' +  + ')'
10298
10299
    __repr__ = __str__
10300 1
10301
10302
class EventFilterResult(FrozenClass):
10303
    '''
10304
    :ivar SelectClauseResults:
10305 1
    :vartype SelectClauseResults: StatusCode
10306
    :ivar SelectClauseDiagnosticInfos:
10307
    :vartype SelectClauseDiagnosticInfos: DiagnosticInfo
10308
    :ivar WhereClauseResult:
10309
    :vartype WhereClauseResult: ContentFilterResult
10310
    '''
10311
10312
    ua_types = [
10313
        ('SelectClauseResults', 'ListOfStatusCode'),
10314 1
        ('SelectClauseDiagnosticInfos', 'ListOfDiagnosticInfo'),
10315
        ('WhereClauseResult', 'ContentFilterResult'),
10316
               ]
10317
10318
    def __init__(self):
10319
        self.SelectClauseResults = []
10320
        self.SelectClauseDiagnosticInfos = []
10321
        self.WhereClauseResult = ContentFilterResult()
10322 1
        self._freeze = True
10323
10324
    def to_binary(self):
10325
        packet = []
10326 1
        packet.append(uabin.Primitives.Int32.pack(len(self.SelectClauseResults)))
10327
        for fieldname in self.SelectClauseResults:
10328
            packet.append(fieldname.to_binary())
10329
        packet.append(uabin.Primitives.Int32.pack(len(self.SelectClauseDiagnosticInfos)))
10330 1
        for fieldname in self.SelectClauseDiagnosticInfos:
10331
            packet.append(fieldname.to_binary())
10332
        packet.append(self.WhereClauseResult.to_binary())
10333
        return b''.join(packet)
10334 1
10335
    @staticmethod
10336
    def from_binary(data):
10337 1
        obj = EventFilterResult()
10338
        length = uabin.Primitives.Int32.unpack(data)
10339
        array = []
10340
        if length != -1:
10341
            for _ in range(0, length):
10342
                array.append(StatusCode.from_binary(data))
10343
        obj.SelectClauseResults = array
10344
        length = uabin.Primitives.Int32.unpack(data)
10345
        array = []
10346
        if length != -1:
10347 1
            for _ in range(0, length):
10348
                array.append(DiagnosticInfo.from_binary(data))
10349
        obj.SelectClauseDiagnosticInfos = array
10350
        obj.WhereClauseResult = ContentFilterResult.from_binary(data)
10351
        return obj
10352
10353 1
    def __str__(self):
10354
        return 'EventFilterResult(' + 'SelectClauseResults:' + str(self.SelectClauseResults) + ', ' + \
10355
               'SelectClauseDiagnosticInfos:' + str(self.SelectClauseDiagnosticInfos) + ', ' + \
10356
               'WhereClauseResult:' + str(self.WhereClauseResult) + ')'
10357
10358
    __repr__ = __str__
10359
10360
10361
class AggregateFilterResult(FrozenClass):
10362
    '''
10363 1
    :ivar RevisedStartTime:
10364
    :vartype RevisedStartTime: DateTime
10365
    :ivar RevisedProcessingInterval:
10366
    :vartype RevisedProcessingInterval: Double
10367
    :ivar RevisedAggregateConfiguration:
10368
    :vartype RevisedAggregateConfiguration: AggregateConfiguration
10369
    '''
10370
10371
    ua_types = [
10372
        ('RevisedStartTime', 'DateTime'),
10373
        ('RevisedProcessingInterval', 'Double'),
10374 1
        ('RevisedAggregateConfiguration', 'AggregateConfiguration'),
10375
               ]
10376
10377
    def __init__(self):
10378 1
        self.RevisedStartTime = datetime.utcnow()
10379
        self.RevisedProcessingInterval = 0
10380
        self.RevisedAggregateConfiguration = AggregateConfiguration()
10381
        self._freeze = True
10382
10383
    def to_binary(self):
10384
        packet = []
10385
        packet.append(uabin.Primitives.DateTime.pack(self.RevisedStartTime))
10386
        packet.append(uabin.Primitives.Double.pack(self.RevisedProcessingInterval))
10387
        packet.append(self.RevisedAggregateConfiguration.to_binary())
10388
        return b''.join(packet)
10389
10390
    @staticmethod
10391
    def from_binary(data):
10392
        obj = AggregateFilterResult()
10393 1
        self.RevisedStartTime = uabin.Primitives.DateTime.unpack(data)
10394
        self.RevisedProcessingInterval = uabin.Primitives.Double.unpack(data)
10395
        obj.RevisedAggregateConfiguration = AggregateConfiguration.from_binary(data)
10396
        return obj
10397
10398 1
    def __str__(self):
10399
        return 'AggregateFilterResult(' + 'RevisedStartTime:' + str(self.RevisedStartTime) + ', ' + \
10400
               'RevisedProcessingInterval:' + str(self.RevisedProcessingInterval) + ', ' + \
10401 1
               'RevisedAggregateConfiguration:' + str(self.RevisedAggregateConfiguration) + ')'
10402
10403
    __repr__ = __str__
10404
10405
10406
class MonitoringParameters(FrozenClass):
10407 1
    '''
10408
    :ivar ClientHandle:
10409
    :vartype ClientHandle: UInt32
10410
    :ivar SamplingInterval:
10411 1
    :vartype SamplingInterval: Double
10412
    :ivar Filter:
10413
    :vartype Filter: ExtensionObject
10414
    :ivar QueueSize:
10415
    :vartype QueueSize: UInt32
10416
    :ivar DiscardOldest:
10417
    :vartype DiscardOldest: Boolean
10418
    '''
10419 1
10420
    ua_types = [
10421
        ('ClientHandle', 'UInt32'),
10422
        ('SamplingInterval', 'Double'),
10423
        ('Filter', 'ExtensionObject'),
10424
        ('QueueSize', 'UInt32'),
10425
        ('DiscardOldest', 'Boolean'),
10426 1
               ]
10427
10428
    def __init__(self):
10429
        self.ClientHandle = 0
10430 1
        self.SamplingInterval = 0
10431
        self.Filter = ExtensionObject()
10432
        self.QueueSize = 0
10433
        self.DiscardOldest = True
10434
        self._freeze = True
10435
10436
    def to_binary(self):
10437
        packet = []
10438 1
        packet.append(uabin.Primitives.UInt32.pack(self.ClientHandle))
10439
        packet.append(uabin.Primitives.Double.pack(self.SamplingInterval))
10440
        packet.append(uabin.extensionobject_to_binary(self.Filter))
10441 1
        packet.append(uabin.Primitives.UInt32.pack(self.QueueSize))
10442
        packet.append(uabin.Primitives.Boolean.pack(self.DiscardOldest))
10443
        return b''.join(packet)
10444 1
10445
    @staticmethod
10446
    def from_binary(data):
10447
        obj = MonitoringParameters()
10448
        self.ClientHandle = uabin.Primitives.UInt32.unpack(data)
10449
        self.SamplingInterval = uabin.Primitives.Double.unpack(data)
10450
        obj.Filter = uabin.extensionobject_from_binary(data)
10451
        self.QueueSize = uabin.Primitives.UInt32.unpack(data)
10452
        self.DiscardOldest = uabin.Primitives.Boolean.unpack(data)
10453
        return obj
10454 1
10455
    def __str__(self):
10456
        return 'MonitoringParameters(' + 'ClientHandle:' + str(self.ClientHandle) + ', ' + \
10457 View Code Duplication
               'SamplingInterval:' + str(self.SamplingInterval) + ', ' + \
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10458
               'Filter:' + str(self.Filter) + ', ' + \
10459
               'QueueSize:' + str(self.QueueSize) + ', ' + \
10460 1
               'DiscardOldest:' + str(self.DiscardOldest) + ')'
10461
10462
    __repr__ = __str__
10463
10464
10465
class MonitoredItemCreateRequest(FrozenClass):
10466
    '''
10467
    :ivar ItemToMonitor:
10468
    :vartype ItemToMonitor: ReadValueId
10469
    :ivar MonitoringMode:
10470 1
    :vartype MonitoringMode: MonitoringMode
10471
    :ivar RequestedParameters:
10472
    :vartype RequestedParameters: MonitoringParameters
10473
    '''
10474
10475
    ua_types = [
10476
        ('ItemToMonitor', 'ReadValueId'),
10477 1
        ('MonitoringMode', 'MonitoringMode'),
10478
        ('RequestedParameters', 'MonitoringParameters'),
10479
               ]
10480
10481 1
    def __init__(self):
10482
        self.ItemToMonitor = ReadValueId()
10483
        self.MonitoringMode = MonitoringMode(0)
10484
        self.RequestedParameters = MonitoringParameters()
10485
        self._freeze = True
10486 1
10487
    def to_binary(self):
10488
        packet = []
10489
        packet.append(self.ItemToMonitor.to_binary())
10490
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoringMode.value))
10491 1
        packet.append(self.RequestedParameters.to_binary())
10492
        return b''.join(packet)
10493
10494 1
    @staticmethod
10495
    def from_binary(data):
10496
        obj = MonitoredItemCreateRequest()
10497
        obj.ItemToMonitor = ReadValueId.from_binary(data)
10498
        self.MonitoringMode = MonitoringMode(uabin.Primitives.UInt32.unpack(data))
10499
        obj.RequestedParameters = MonitoringParameters.from_binary(data)
10500
        return obj
10501
10502
    def __str__(self):
10503
        return 'MonitoredItemCreateRequest(' + 'ItemToMonitor:' + str(self.ItemToMonitor) + ', ' + \
10504
               'MonitoringMode:' + str(self.MonitoringMode) + ', ' + \
10505
               'RequestedParameters:' + str(self.RequestedParameters) + ')'
10506 1
10507
    __repr__ = __str__
10508
10509
10510
class MonitoredItemCreateResult(FrozenClass):
10511
    '''
10512
    :ivar StatusCode:
10513 1
    :vartype StatusCode: StatusCode
10514
    :ivar MonitoredItemId:
10515
    :vartype MonitoredItemId: UInt32
10516
    :ivar RevisedSamplingInterval:
10517
    :vartype RevisedSamplingInterval: Double
10518
    :ivar RevisedQueueSize:
10519
    :vartype RevisedQueueSize: UInt32
10520
    :ivar FilterResult:
10521
    :vartype FilterResult: ExtensionObject
10522
    '''
10523
10524 1
    ua_types = [
10525
        ('StatusCode', 'StatusCode'),
10526
        ('MonitoredItemId', 'UInt32'),
10527
        ('RevisedSamplingInterval', 'Double'),
10528
        ('RevisedQueueSize', 'UInt32'),
10529
        ('FilterResult', 'ExtensionObject'),
10530
               ]
10531
10532
    def __init__(self):
10533
        self.StatusCode = StatusCode()
10534
        self.MonitoredItemId = 0
10535
        self.RevisedSamplingInterval = 0
10536 1
        self.RevisedQueueSize = 0
10537
        self.FilterResult = ExtensionObject()
10538
        self._freeze = True
10539
10540 1
    def to_binary(self):
10541
        packet = []
10542
        packet.append(self.StatusCode.to_binary())
10543
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoredItemId))
10544
        packet.append(uabin.Primitives.Double.pack(self.RevisedSamplingInterval))
10545
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedQueueSize))
10546
        packet.append(uabin.extensionobject_to_binary(self.FilterResult))
10547
        return b''.join(packet)
10548
10549
    @staticmethod
10550
    def from_binary(data):
10551
        obj = MonitoredItemCreateResult()
10552
        obj.StatusCode = StatusCode.from_binary(data)
10553
        self.MonitoredItemId = uabin.Primitives.UInt32.unpack(data)
10554
        self.RevisedSamplingInterval = uabin.Primitives.Double.unpack(data)
10555
        self.RevisedQueueSize = uabin.Primitives.UInt32.unpack(data)
10556 1
        obj.FilterResult = uabin.extensionobject_from_binary(data)
10557
        return obj
10558
10559
    def __str__(self):
10560
        return 'MonitoredItemCreateResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
10561
               'MonitoredItemId:' + str(self.MonitoredItemId) + ', ' + \
10562 1
               'RevisedSamplingInterval:' + str(self.RevisedSamplingInterval) + ', ' + \
10563
               'RevisedQueueSize:' + str(self.RevisedQueueSize) + ', ' + \
10564
               'FilterResult:' + str(self.FilterResult) + ')'
10565 1
10566
    __repr__ = __str__
10567
10568
10569
class CreateMonitoredItemsParameters(FrozenClass):
10570
    '''
10571
    :ivar SubscriptionId:
10572
    :vartype SubscriptionId: UInt32
10573
    :ivar TimestampsToReturn:
10574
    :vartype TimestampsToReturn: TimestampsToReturn
10575 1
    :ivar ItemsToCreate:
10576
    :vartype ItemsToCreate: MonitoredItemCreateRequest
10577
    '''
10578
10579
    ua_types = [
10580
        ('SubscriptionId', 'UInt32'),
10581 1
        ('TimestampsToReturn', 'TimestampsToReturn'),
10582 1
        ('ItemsToCreate', 'ListOfMonitoredItemCreateRequest'),
10583 1
               ]
10584 1
10585 1
    def __init__(self):
10586 1
        self.SubscriptionId = 0
10587 1
        self.TimestampsToReturn = TimestampsToReturn(0)
10588 1
        self.ItemsToCreate = []
10589 1
        self._freeze = True
10590
10591 1
    def to_binary(self):
10592 1
        packet = []
10593 1
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
10594 1
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
10595 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ItemsToCreate)))
10596 1
        for fieldname in self.ItemsToCreate:
10597 1
            packet.append(fieldname.to_binary())
10598 1
        return b''.join(packet)
10599
10600 1
    @staticmethod
10601
    def from_binary(data):
10602 1
        obj = CreateMonitoredItemsParameters()
10603
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
10604 1
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
10605 1
        length = uabin.Primitives.Int32.unpack(data)
10606 1
        array = []
10607 1
        if length != -1:
10608 1
            for _ in range(0, length):
10609 1
                array.append(MonitoredItemCreateRequest.from_binary(data))
10610 1
        obj.ItemsToCreate = array
10611 1
        return obj
10612 1
10613
    def __str__(self):
10614 1
        return 'CreateMonitoredItemsParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
10615 1
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
10616
               'ItemsToCreate:' + str(self.ItemsToCreate) + ')'
10617
10618
    __repr__ = __str__
10619 1
10620
10621
class CreateMonitoredItemsRequest(FrozenClass):
10622 1
    '''
10623
    :ivar TypeId:
10624
    :vartype TypeId: NodeId
10625
    :ivar RequestHeader:
10626
    :vartype RequestHeader: RequestHeader
10627
    :ivar Parameters:
10628
    :vartype Parameters: CreateMonitoredItemsParameters
10629
    '''
10630
10631
    ua_types = [
10632
        ('TypeId', 'NodeId'),
10633
        ('RequestHeader', 'RequestHeader'),
10634 1
        ('Parameters', 'CreateMonitoredItemsParameters'),
10635
               ]
10636
10637
    def __init__(self):
10638
        self.TypeId = FourByteNodeId(ObjectIds.CreateMonitoredItemsRequest_Encoding_DefaultBinary)
10639
        self.RequestHeader = RequestHeader()
10640
        self.Parameters = CreateMonitoredItemsParameters()
10641 1
        self._freeze = True
10642 1
10643 1
    def to_binary(self):
10644 1
        packet = []
10645 1
        packet.append(self.TypeId.to_binary())
10646 1
        packet.append(self.RequestHeader.to_binary())
10647 1
        packet.append(self.Parameters.to_binary())
10648 1
        return b''.join(packet)
10649 1
10650 1
    @staticmethod
10651
    def from_binary(data):
10652 1
        obj = CreateMonitoredItemsRequest()
10653 1
        obj.TypeId = NodeId.from_binary(data)
10654 1
        obj.RequestHeader = RequestHeader.from_binary(data)
10655 1
        obj.Parameters = CreateMonitoredItemsParameters.from_binary(data)
10656 1
        return obj
10657 1
10658 1
    def __str__(self):
10659 1
        return 'CreateMonitoredItemsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10660
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
10661 1
               'Parameters:' + str(self.Parameters) + ')'
10662 1
10663 1
    __repr__ = __str__
10664 1
10665
10666 1
class CreateMonitoredItemsResponse(FrozenClass):
10667
    '''
10668 1
    :ivar TypeId:
10669
    :vartype TypeId: NodeId
10670 1
    :ivar ResponseHeader:
10671 1
    :vartype ResponseHeader: ResponseHeader
10672 1
    :ivar Results:
10673 1
    :vartype Results: MonitoredItemCreateResult
10674 1
    :ivar DiagnosticInfos:
10675 1
    :vartype DiagnosticInfos: DiagnosticInfo
10676 1
    '''
10677 1
10678 1
    ua_types = [
10679 1
        ('TypeId', 'NodeId'),
10680 1
        ('ResponseHeader', 'ResponseHeader'),
10681 1
        ('Results', 'ListOfMonitoredItemCreateResult'),
10682
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
10683 1
               ]
10684 1
10685 1
    def __init__(self):
10686 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateMonitoredItemsResponse_Encoding_DefaultBinary)
10687 1
        self.ResponseHeader = ResponseHeader()
10688 1
        self.Results = []
10689 1
        self.DiagnosticInfos = []
10690
        self._freeze = True
10691 1
10692
    def to_binary(self):
10693
        packet = []
10694
        packet.append(self.TypeId.to_binary())
10695
        packet.append(self.ResponseHeader.to_binary())
10696
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
10697 1
        for fieldname in self.Results:
10698
            packet.append(fieldname.to_binary())
10699
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
10700 1
        for fieldname in self.DiagnosticInfos:
10701
            packet.append(fieldname.to_binary())
10702 View Code Duplication
        return b''.join(packet)
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10703
10704
    @staticmethod
10705
    def from_binary(data):
10706 1
        obj = CreateMonitoredItemsResponse()
10707
        obj.TypeId = NodeId.from_binary(data)
10708
        obj.ResponseHeader = ResponseHeader.from_binary(data)
10709
        length = uabin.Primitives.Int32.unpack(data)
10710 1
        array = []
10711 1
        if length != -1:
10712 1
            for _ in range(0, length):
10713 1
                array.append(MonitoredItemCreateResult.from_binary(data))
10714 1
        obj.Results = array
10715 1
        length = uabin.Primitives.Int32.unpack(data)
10716 1
        array = []
10717
        if length != -1:
10718 1
            for _ in range(0, length):
10719 1
                array.append(DiagnosticInfo.from_binary(data))
10720 1
        obj.DiagnosticInfos = array
10721 1
        return obj
10722 1
10723 1
    def __str__(self):
10724
        return 'CreateMonitoredItemsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10725 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
10726
               'Results:' + str(self.Results) + ', ' + \
10727 1
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
10728
10729 1
    __repr__ = __str__
10730 1
10731 1
10732 1
class MonitoredItemModifyRequest(FrozenClass):
10733 1
    '''
10734 1
    :ivar MonitoredItemId:
10735 1
    :vartype MonitoredItemId: UInt32
10736
    :ivar RequestedParameters:
10737 1
    :vartype RequestedParameters: MonitoringParameters
10738
    '''
10739
10740 1
    ua_types = [
10741
        ('MonitoredItemId', 'UInt32'),
10742
        ('RequestedParameters', 'MonitoringParameters'),
10743 1
               ]
10744
10745
    def __init__(self):
10746
        self.MonitoredItemId = 0
10747
        self.RequestedParameters = MonitoringParameters()
10748
        self._freeze = True
10749
10750
    def to_binary(self):
10751
        packet = []
10752
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoredItemId))
10753 1
        packet.append(self.RequestedParameters.to_binary())
10754
        return b''.join(packet)
10755
10756
    @staticmethod
10757
    def from_binary(data):
10758
        obj = MonitoredItemModifyRequest()
10759 1
        self.MonitoredItemId = uabin.Primitives.UInt32.unpack(data)
10760 1
        obj.RequestedParameters = MonitoringParameters.from_binary(data)
10761
        return obj
10762
10763
    def __str__(self):
10764 1
        return 'MonitoredItemModifyRequest(' + 'MonitoredItemId:' + str(self.MonitoredItemId) + ', ' + \
10765 1
               'RequestedParameters:' + str(self.RequestedParameters) + ')'
10766 1
10767 1
    __repr__ = __str__
10768
10769 1
10770 1
class MonitoredItemModifyResult(FrozenClass):
10771 1
    '''
10772 1
    :ivar StatusCode:
10773 1
    :vartype StatusCode: StatusCode
10774 1
    :ivar RevisedSamplingInterval:
10775
    :vartype RevisedSamplingInterval: Double
10776 1
    :ivar RevisedQueueSize:
10777
    :vartype RevisedQueueSize: UInt32
10778
    :ivar FilterResult:
10779
    :vartype FilterResult: ExtensionObject
10780 1
    '''
10781
10782
    ua_types = [
10783
        ('StatusCode', 'StatusCode'),
10784
        ('RevisedSamplingInterval', 'Double'),
10785 1
        ('RevisedQueueSize', 'UInt32'),
10786
        ('FilterResult', 'ExtensionObject'),
10787
               ]
10788
10789
    def __init__(self):
10790 1
        self.StatusCode = StatusCode()
10791
        self.RevisedSamplingInterval = 0
10792
        self.RevisedQueueSize = 0
10793 1
        self.FilterResult = ExtensionObject()
10794
        self._freeze = True
10795
10796
    def to_binary(self):
10797
        packet = []
10798
        packet.append(self.StatusCode.to_binary())
10799
        packet.append(uabin.Primitives.Double.pack(self.RevisedSamplingInterval))
10800
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedQueueSize))
10801
        packet.append(uabin.extensionobject_to_binary(self.FilterResult))
10802
        return b''.join(packet)
10803
10804
    @staticmethod
10805 1
    def from_binary(data):
10806
        obj = MonitoredItemModifyResult()
10807
        obj.StatusCode = StatusCode.from_binary(data)
10808 View Code Duplication
        self.RevisedSamplingInterval = uabin.Primitives.Double.unpack(data)
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10809
        self.RevisedQueueSize = uabin.Primitives.UInt32.unpack(data)
10810
        obj.FilterResult = uabin.extensionobject_from_binary(data)
10811
        return obj
10812 1
10813 1
    def __str__(self):
10814 1
        return 'MonitoredItemModifyResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
10815 1
               'RevisedSamplingInterval:' + str(self.RevisedSamplingInterval) + ', ' + \
10816 1
               'RevisedQueueSize:' + str(self.RevisedQueueSize) + ', ' + \
10817 1
               'FilterResult:' + str(self.FilterResult) + ')'
10818 1
10819 1
    __repr__ = __str__
10820 1
10821 1
10822
class ModifyMonitoredItemsParameters(FrozenClass):
10823 1
    '''
10824 1
    :ivar SubscriptionId:
10825 1
    :vartype SubscriptionId: UInt32
10826 1
    :ivar TimestampsToReturn:
10827 1
    :vartype TimestampsToReturn: TimestampsToReturn
10828 1
    :ivar ItemsToModify:
10829 1
    :vartype ItemsToModify: MonitoredItemModifyRequest
10830 1
    '''
10831 1
10832
    ua_types = [
10833 1
        ('SubscriptionId', 'UInt32'),
10834
        ('TimestampsToReturn', 'TimestampsToReturn'),
10835 1
        ('ItemsToModify', 'ListOfMonitoredItemModifyRequest'),
10836
               ]
10837 1
10838
    def __init__(self):
10839 1
        self.SubscriptionId = 0
10840 1
        self.TimestampsToReturn = TimestampsToReturn(0)
10841 1
        self.ItemsToModify = []
10842 1
        self._freeze = True
10843 1
10844 1
    def to_binary(self):
10845 1
        packet = []
10846 1
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
10847 1
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
10848 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ItemsToModify)))
10849 1
        for fieldname in self.ItemsToModify:
10850 1
            packet.append(fieldname.to_binary())
10851 1
        return b''.join(packet)
10852
10853 1
    @staticmethod
10854
    def from_binary(data):
10855 1
        obj = ModifyMonitoredItemsParameters()
10856
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
10857
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
10858
        length = uabin.Primitives.Int32.unpack(data)
10859
        array = []
10860
        if length != -1:
10861 1
            for _ in range(0, length):
10862
                array.append(MonitoredItemModifyRequest.from_binary(data))
10863
        obj.ItemsToModify = array
10864 1
        return obj
10865
10866
    def __str__(self):
10867
        return 'ModifyMonitoredItemsParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
10868 1
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
10869
               'ItemsToModify:' + str(self.ItemsToModify) + ')'
10870
10871 1
    __repr__ = __str__
10872
10873
10874
class ModifyMonitoredItemsRequest(FrozenClass):
10875
    '''
10876
    :ivar TypeId:
10877
    :vartype TypeId: NodeId
10878 1
    :ivar RequestHeader:
10879
    :vartype RequestHeader: RequestHeader
10880
    :ivar Parameters:
10881
    :vartype Parameters: ModifyMonitoredItemsParameters
10882 1
    '''
10883
10884
    ua_types = [
10885
        ('TypeId', 'NodeId'),
10886 1
        ('RequestHeader', 'RequestHeader'),
10887
        ('Parameters', 'ModifyMonitoredItemsParameters'),
10888
               ]
10889 1
10890
    def __init__(self):
10891
        self.TypeId = FourByteNodeId(ObjectIds.ModifyMonitoredItemsRequest_Encoding_DefaultBinary)
10892 1
        self.RequestHeader = RequestHeader()
10893
        self.Parameters = ModifyMonitoredItemsParameters()
10894
        self._freeze = True
10895 1
10896
    def to_binary(self):
10897
        packet = []
10898
        packet.append(self.TypeId.to_binary())
10899
        packet.append(self.RequestHeader.to_binary())
10900
        packet.append(self.Parameters.to_binary())
10901
        return b''.join(packet)
10902
10903
    @staticmethod
10904
    def from_binary(data):
10905 1
        obj = ModifyMonitoredItemsRequest()
10906
        obj.TypeId = NodeId.from_binary(data)
10907
        obj.RequestHeader = RequestHeader.from_binary(data)
10908
        obj.Parameters = ModifyMonitoredItemsParameters.from_binary(data)
10909
        return obj
10910
10911 1
    def __str__(self):
10912
        return 'ModifyMonitoredItemsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10913
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
10914
               'Parameters:' + str(self.Parameters) + ')'
10915
10916
    __repr__ = __str__
10917
10918
10919
class ModifyMonitoredItemsResponse(FrozenClass):
10920
    '''
10921 1
    :ivar TypeId:
10922
    :vartype TypeId: NodeId
10923
    :ivar ResponseHeader:
10924
    :vartype ResponseHeader: ResponseHeader
10925
    :ivar Results:
10926
    :vartype Results: MonitoredItemModifyResult
10927
    :ivar DiagnosticInfos:
10928 1
    :vartype DiagnosticInfos: DiagnosticInfo
10929
    '''
10930
10931
    ua_types = [
10932 1
        ('TypeId', 'NodeId'),
10933
        ('ResponseHeader', 'ResponseHeader'),
10934
        ('Results', 'ListOfMonitoredItemModifyResult'),
10935
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
10936
               ]
10937 1
10938
    def __init__(self):
10939
        self.TypeId = FourByteNodeId(ObjectIds.ModifyMonitoredItemsResponse_Encoding_DefaultBinary)
10940
        self.ResponseHeader = ResponseHeader()
10941
        self.Results = []
10942 1
        self.DiagnosticInfos = []
10943
        self._freeze = True
10944
10945 1
    def to_binary(self):
10946
        packet = []
10947
        packet.append(self.TypeId.to_binary())
10948
        packet.append(self.ResponseHeader.to_binary())
10949
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
10950
        for fieldname in self.Results:
10951
            packet.append(fieldname.to_binary())
10952
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
10953 1
        for fieldname in self.DiagnosticInfos:
10954
            packet.append(fieldname.to_binary())
10955
        return b''.join(packet)
10956
10957
    @staticmethod
10958 1
    def from_binary(data):
10959 1
        obj = ModifyMonitoredItemsResponse()
10960 1
        obj.TypeId = NodeId.from_binary(data)
10961 1
        obj.ResponseHeader = ResponseHeader.from_binary(data)
10962 1
        length = uabin.Primitives.Int32.unpack(data)
10963 1
        array = []
10964 1
        if length != -1:
10965 1
            for _ in range(0, length):
10966
                array.append(MonitoredItemModifyResult.from_binary(data))
10967 1
        obj.Results = array
10968 1
        length = uabin.Primitives.Int32.unpack(data)
10969 1
        array = []
10970 1
        if length != -1:
10971 1
            for _ in range(0, length):
10972 1
                array.append(DiagnosticInfo.from_binary(data))
10973 1
        obj.DiagnosticInfos = array
10974
        return obj
10975 1
10976
    def __str__(self):
10977 1
        return 'ModifyMonitoredItemsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10978
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
10979 1
               'Results:' + str(self.Results) + ', ' + \
10980 1
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
10981 1
10982 1
    __repr__ = __str__
10983 1
10984 1
10985 1
class SetMonitoringModeParameters(FrozenClass):
10986 1
    '''
10987
    :ivar SubscriptionId:
10988 1
    :vartype SubscriptionId: UInt32
10989
    :ivar MonitoringMode:
10990
    :vartype MonitoringMode: MonitoringMode
10991
    :ivar MonitoredItemIds:
10992 1
    :vartype MonitoredItemIds: UInt32
10993
    '''
10994
10995 1
    ua_types = [
10996
        ('SubscriptionId', 'UInt32'),
10997
        ('MonitoringMode', 'MonitoringMode'),
10998
        ('MonitoredItemIds', 'ListOfUInt32'),
10999
               ]
11000
11001
    def __init__(self):
11002
        self.SubscriptionId = 0
11003
        self.MonitoringMode = MonitoringMode(0)
11004
        self.MonitoredItemIds = []
11005
        self._freeze = True
11006
11007
    def to_binary(self):
11008
        packet = []
11009 1
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
11010
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoringMode.value))
11011
        packet.append(uabin.Primitives.Int32.pack(len(self.MonitoredItemIds)))
11012
        for fieldname in self.MonitoredItemIds:
11013
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
11014
        return b''.join(packet)
11015
11016
    @staticmethod
11017 1
    def from_binary(data):
11018
        obj = SetMonitoringModeParameters()
11019
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
11020
        self.MonitoringMode = MonitoringMode(uabin.Primitives.UInt32.unpack(data))
11021
        obj.MonitoredItemIds = uabin.Primitives.UInt32.unpack_array(data)
11022
        return obj
11023
11024
    def __str__(self):
11025
        return 'SetMonitoringModeParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
11026
               'MonitoringMode:' + str(self.MonitoringMode) + ', ' + \
11027
               'MonitoredItemIds:' + str(self.MonitoredItemIds) + ')'
11028
11029 1
    __repr__ = __str__
11030
11031
11032
class SetMonitoringModeRequest(FrozenClass):
11033
    '''
11034
    :ivar TypeId:
11035
    :vartype TypeId: NodeId
11036
    :ivar RequestHeader:
11037
    :vartype RequestHeader: RequestHeader
11038 1
    :ivar Parameters:
11039
    :vartype Parameters: SetMonitoringModeParameters
11040
    '''
11041
11042 1
    ua_types = [
11043
        ('TypeId', 'NodeId'),
11044
        ('RequestHeader', 'RequestHeader'),
11045
        ('Parameters', 'SetMonitoringModeParameters'),
11046
               ]
11047
11048
    def __init__(self):
11049 1
        self.TypeId = FourByteNodeId(ObjectIds.SetMonitoringModeRequest_Encoding_DefaultBinary)
11050
        self.RequestHeader = RequestHeader()
11051
        self.Parameters = SetMonitoringModeParameters()
11052
        self._freeze = True
11053
11054
    def to_binary(self):
11055
        packet = []
11056 1
        packet.append(self.TypeId.to_binary())
11057
        packet.append(self.RequestHeader.to_binary())
11058
        packet.append(self.Parameters.to_binary())
11059 1
        return b''.join(packet)
11060
11061
    @staticmethod
11062
    def from_binary(data):
11063
        obj = SetMonitoringModeRequest()
11064
        obj.TypeId = NodeId.from_binary(data)
11065
        obj.RequestHeader = RequestHeader.from_binary(data)
11066
        obj.Parameters = SetMonitoringModeParameters.from_binary(data)
11067
        return obj
11068
11069
    def __str__(self):
11070
        return 'SetMonitoringModeRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11071 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
11072
               'Parameters:' + str(self.Parameters) + ')'
11073
11074
    __repr__ = __str__
11075
11076
11077
class SetMonitoringModeResult(FrozenClass):
11078 1
    '''
11079
    :ivar Results:
11080
    :vartype Results: StatusCode
11081
    :ivar DiagnosticInfos:
11082
    :vartype DiagnosticInfos: DiagnosticInfo
11083
    '''
11084
11085
    ua_types = [
11086
        ('Results', 'ListOfStatusCode'),
11087
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
11088
               ]
11089 1
11090
    def __init__(self):
11091
        self.Results = []
11092
        self.DiagnosticInfos = []
11093
        self._freeze = True
11094
11095
    def to_binary(self):
11096
        packet = []
11097 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
11098
        for fieldname in self.Results:
11099
            packet.append(fieldname.to_binary())
11100
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
11101 1
        for fieldname in self.DiagnosticInfos:
11102
            packet.append(fieldname.to_binary())
11103
        return b''.join(packet)
11104
11105
    @staticmethod
11106
    def from_binary(data):
11107 1
        obj = SetMonitoringModeResult()
11108
        length = uabin.Primitives.Int32.unpack(data)
11109
        array = []
11110
        if length != -1:
11111
            for _ in range(0, length):
11112
                array.append(StatusCode.from_binary(data))
11113 1
        obj.Results = array
11114
        length = uabin.Primitives.Int32.unpack(data)
11115
        array = []
11116 1
        if length != -1:
11117
            for _ in range(0, length):
11118
                array.append(DiagnosticInfo.from_binary(data))
11119
        obj.DiagnosticInfos = array
11120 1
        return obj
11121
11122
    def __str__(self):
11123 1
        return 'SetMonitoringModeResult(' + 'Results:' + str(self.Results) + ', ' + \
11124
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
11125
11126
    __repr__ = __str__
11127
11128
11129
class SetMonitoringModeResponse(FrozenClass):
11130 1
    '''
11131
    :ivar TypeId:
11132
    :vartype TypeId: NodeId
11133
    :ivar ResponseHeader:
11134 1
    :vartype ResponseHeader: ResponseHeader
11135
    :ivar Parameters:
11136
    :vartype Parameters: SetMonitoringModeResult
11137
    '''
11138 1
11139
    ua_types = [
11140
        ('TypeId', 'NodeId'),
11141 1
        ('ResponseHeader', 'ResponseHeader'),
11142
        ('Parameters', 'SetMonitoringModeResult'),
11143
               ]
11144 1
11145
    def __init__(self):
11146
        self.TypeId = FourByteNodeId(ObjectIds.SetMonitoringModeResponse_Encoding_DefaultBinary)
11147 1
        self.ResponseHeader = ResponseHeader()
11148
        self.Parameters = SetMonitoringModeResult()
11149
        self._freeze = True
11150
11151
    def to_binary(self):
11152
        packet = []
11153
        packet.append(self.TypeId.to_binary())
11154
        packet.append(self.ResponseHeader.to_binary())
11155
        packet.append(self.Parameters.to_binary())
11156
        return b''.join(packet)
11157 1
11158
    @staticmethod
11159
    def from_binary(data):
11160
        obj = SetMonitoringModeResponse()
11161
        obj.TypeId = NodeId.from_binary(data)
11162
        obj.ResponseHeader = ResponseHeader.from_binary(data)
11163 1
        obj.Parameters = SetMonitoringModeResult.from_binary(data)
11164
        return obj
11165
11166
    def __str__(self):
11167
        return 'SetMonitoringModeResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11168
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
11169
               'Parameters:' + str(self.Parameters) + ')'
11170
11171
    __repr__ = __str__
11172
11173 1
11174
class SetTriggeringParameters(FrozenClass):
11175
    '''
11176
    :ivar SubscriptionId:
11177
    :vartype SubscriptionId: UInt32
11178
    :ivar TriggeringItemId:
11179
    :vartype TriggeringItemId: UInt32
11180
    :ivar LinksToAdd:
11181
    :vartype LinksToAdd: UInt32
11182
    :ivar LinksToRemove:
11183
    :vartype LinksToRemove: UInt32
11184 1
    '''
11185
11186
    ua_types = [
11187
        ('SubscriptionId', 'UInt32'),
11188 1
        ('TriggeringItemId', 'UInt32'),
11189
        ('LinksToAdd', 'ListOfUInt32'),
11190
        ('LinksToRemove', 'ListOfUInt32'),
11191
               ]
11192
11193
    def __init__(self):
11194
        self.SubscriptionId = 0
11195
        self.TriggeringItemId = 0
11196
        self.LinksToAdd = []
11197
        self.LinksToRemove = []
11198
        self._freeze = True
11199
11200
    def to_binary(self):
11201
        packet = []
11202
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
11203 1
        packet.append(uabin.Primitives.UInt32.pack(self.TriggeringItemId))
11204
        packet.append(uabin.Primitives.Int32.pack(len(self.LinksToAdd)))
11205
        for fieldname in self.LinksToAdd:
11206
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
11207
        packet.append(uabin.Primitives.Int32.pack(len(self.LinksToRemove)))
11208 1
        for fieldname in self.LinksToRemove:
11209
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
11210
        return b''.join(packet)
11211 1
11212
    @staticmethod
11213
    def from_binary(data):
11214
        obj = SetTriggeringParameters()
11215
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
11216
        self.TriggeringItemId = uabin.Primitives.UInt32.unpack(data)
11217
        obj.LinksToAdd = uabin.Primitives.UInt32.unpack_array(data)
11218
        obj.LinksToRemove = uabin.Primitives.UInt32.unpack_array(data)
11219
        return obj
11220
11221 1
    def __str__(self):
11222
        return 'SetTriggeringParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
11223
               'TriggeringItemId:' + str(self.TriggeringItemId) + ', ' + \
11224
               'LinksToAdd:' + str(self.LinksToAdd) + ', ' + \
11225
               'LinksToRemove:' + str(self.LinksToRemove) + ')'
11226
11227 1
    __repr__ = __str__
11228
11229
11230
class SetTriggeringRequest(FrozenClass):
11231
    '''
11232
    :ivar TypeId:
11233
    :vartype TypeId: NodeId
11234
    :ivar RequestHeader:
11235
    :vartype RequestHeader: RequestHeader
11236
    :ivar Parameters:
11237 1
    :vartype Parameters: SetTriggeringParameters
11238
    '''
11239
11240
    ua_types = [
11241
        ('TypeId', 'NodeId'),
11242
        ('RequestHeader', 'RequestHeader'),
11243
        ('Parameters', 'SetTriggeringParameters'),
11244 1
               ]
11245
11246
    def __init__(self):
11247
        self.TypeId = FourByteNodeId(ObjectIds.SetTriggeringRequest_Encoding_DefaultBinary)
11248 1
        self.RequestHeader = RequestHeader()
11249
        self.Parameters = SetTriggeringParameters()
11250
        self._freeze = True
11251
11252
    def to_binary(self):
11253 1
        packet = []
11254
        packet.append(self.TypeId.to_binary())
11255
        packet.append(self.RequestHeader.to_binary())
11256
        packet.append(self.Parameters.to_binary())
11257
        return b''.join(packet)
11258 1
11259
    @staticmethod
11260
    def from_binary(data):
11261 1
        obj = SetTriggeringRequest()
11262
        obj.TypeId = NodeId.from_binary(data)
11263
        obj.RequestHeader = RequestHeader.from_binary(data)
11264
        obj.Parameters = SetTriggeringParameters.from_binary(data)
11265
        return obj
11266
11267
    def __str__(self):
11268
        return 'SetTriggeringRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11269
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
11270
               'Parameters:' + str(self.Parameters) + ')'
11271
11272
    __repr__ = __str__
11273
11274
11275 1
class SetTriggeringResult(FrozenClass):
11276
    '''
11277
    :ivar AddResults:
11278
    :vartype AddResults: StatusCode
11279
    :ivar AddDiagnosticInfos:
11280
    :vartype AddDiagnosticInfos: DiagnosticInfo
11281
    :ivar RemoveResults:
11282
    :vartype RemoveResults: StatusCode
11283 1
    :ivar RemoveDiagnosticInfos:
11284 1
    :vartype RemoveDiagnosticInfos: DiagnosticInfo
11285 1
    '''
11286 1
11287 1
    ua_types = [
11288 1
        ('AddResults', 'ListOfStatusCode'),
11289 1
        ('AddDiagnosticInfos', 'ListOfDiagnosticInfo'),
11290 1
        ('RemoveResults', 'ListOfStatusCode'),
11291 1
        ('RemoveDiagnosticInfos', 'ListOfDiagnosticInfo'),
11292 1
               ]
11293 1
11294
    def __init__(self):
11295 1
        self.AddResults = []
11296 1
        self.AddDiagnosticInfos = []
11297 1
        self.RemoveResults = []
11298 1
        self.RemoveDiagnosticInfos = []
11299 1
        self._freeze = True
11300 1
11301 1
    def to_binary(self):
11302 1
        packet = []
11303
        packet.append(uabin.Primitives.Int32.pack(len(self.AddResults)))
11304 1
        for fieldname in self.AddResults:
11305
            packet.append(fieldname.to_binary())
11306 1
        packet.append(uabin.Primitives.Int32.pack(len(self.AddDiagnosticInfos)))
11307
        for fieldname in self.AddDiagnosticInfos:
11308 1
            packet.append(fieldname.to_binary())
11309 1
        packet.append(uabin.Primitives.Int32.pack(len(self.RemoveResults)))
11310 1
        for fieldname in self.RemoveResults:
11311 1
            packet.append(fieldname.to_binary())
11312 1
        packet.append(uabin.Primitives.Int32.pack(len(self.RemoveDiagnosticInfos)))
11313 1
        for fieldname in self.RemoveDiagnosticInfos:
11314
            packet.append(fieldname.to_binary())
11315 1
        return b''.join(packet)
11316
11317
    @staticmethod
11318
    def from_binary(data):
11319
        obj = SetTriggeringResult()
11320
        length = uabin.Primitives.Int32.unpack(data)
11321
        array = []
11322 1
        if length != -1:
11323
            for _ in range(0, length):
11324
                array.append(StatusCode.from_binary(data))
11325 1
        obj.AddResults = array
11326
        length = uabin.Primitives.Int32.unpack(data)
11327
        array = []
11328
        if length != -1:
11329
            for _ in range(0, length):
11330
                array.append(DiagnosticInfo.from_binary(data))
11331
        obj.AddDiagnosticInfos = array
11332
        length = uabin.Primitives.Int32.unpack(data)
11333
        array = []
11334
        if length != -1:
11335 1
            for _ in range(0, length):
11336
                array.append(StatusCode.from_binary(data))
11337
        obj.RemoveResults = array
11338 View Code Duplication
        length = uabin.Primitives.Int32.unpack(data)
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11339
        array = []
11340
        if length != -1:
11341 1
            for _ in range(0, length):
11342 1
                array.append(DiagnosticInfo.from_binary(data))
11343 1
        obj.RemoveDiagnosticInfos = array
11344 1
        return obj
11345 1
11346 1
    def __str__(self):
11347 1
        return 'SetTriggeringResult(' + 'AddResults:' + str(self.AddResults) + ', ' + \
11348 1
               'AddDiagnosticInfos:' + str(self.AddDiagnosticInfos) + ', ' + \
11349 1
               'RemoveResults:' + str(self.RemoveResults) + ', ' + \
11350
               'RemoveDiagnosticInfos:' + str(self.RemoveDiagnosticInfos) + ')'
11351 1
11352 1
    __repr__ = __str__
11353 1
11354 1
11355 1
class SetTriggeringResponse(FrozenClass):
11356 1
    '''
11357
    :ivar TypeId:
11358 1
    :vartype TypeId: NodeId
11359
    :ivar ResponseHeader:
11360 1
    :vartype ResponseHeader: ResponseHeader
11361
    :ivar Parameters:
11362 1
    :vartype Parameters: SetTriggeringResult
11363 1
    '''
11364 1
11365 1
    ua_types = [
11366
        ('TypeId', 'NodeId'),
11367 1
        ('ResponseHeader', 'ResponseHeader'),
11368
        ('Parameters', 'SetTriggeringResult'),
11369
               ]
11370
11371
    def __init__(self):
11372 1
        self.TypeId = FourByteNodeId(ObjectIds.SetTriggeringResponse_Encoding_DefaultBinary)
11373
        self.ResponseHeader = ResponseHeader()
11374
        self.Parameters = SetTriggeringResult()
11375 1
        self._freeze = True
11376
11377
    def to_binary(self):
11378
        packet = []
11379
        packet.append(self.TypeId.to_binary())
11380
        packet.append(self.ResponseHeader.to_binary())
11381
        packet.append(self.Parameters.to_binary())
11382
        return b''.join(packet)
11383
11384
    @staticmethod
11385
    def from_binary(data):
11386
        obj = SetTriggeringResponse()
11387
        obj.TypeId = NodeId.from_binary(data)
11388
        obj.ResponseHeader = ResponseHeader.from_binary(data)
11389 1
        obj.Parameters = SetTriggeringResult.from_binary(data)
11390
        return obj
11391
11392
    def __str__(self):
11393
        return 'SetTriggeringResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11394
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
11395
               'Parameters:' + str(self.Parameters) + ')'
11396
11397 1
    __repr__ = __str__
11398 1
11399 1
11400 1
class DeleteMonitoredItemsParameters(FrozenClass):
11401 1
    '''
11402 1
    :ivar SubscriptionId:
11403 1
    :vartype SubscriptionId: UInt32
11404 1
    :ivar MonitoredItemIds:
11405 1
    :vartype MonitoredItemIds: UInt32
11406 1
    '''
11407 1
11408
    ua_types = [
11409 1
        ('SubscriptionId', 'UInt32'),
11410 1
        ('MonitoredItemIds', 'ListOfUInt32'),
11411 1
               ]
11412 1
11413 1
    def __init__(self):
11414 1
        self.SubscriptionId = 0
11415 1
        self.MonitoredItemIds = []
11416 1
        self._freeze = True
11417
11418 1
    def to_binary(self):
11419
        packet = []
11420 1
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
11421
        packet.append(uabin.Primitives.Int32.pack(len(self.MonitoredItemIds)))
11422 1
        for fieldname in self.MonitoredItemIds:
11423 1
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
11424 1
        return b''.join(packet)
11425 1
11426 1
    @staticmethod
11427 1
    def from_binary(data):
11428
        obj = DeleteMonitoredItemsParameters()
11429 1
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
11430
        obj.MonitoredItemIds = uabin.Primitives.UInt32.unpack_array(data)
11431
        return obj
11432
11433
    def __str__(self):
11434
        return 'DeleteMonitoredItemsParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
11435
               'MonitoredItemIds:' + str(self.MonitoredItemIds) + ')'
11436 1
11437
    __repr__ = __str__
11438
11439 1
11440
class DeleteMonitoredItemsRequest(FrozenClass):
11441
    '''
11442
    :ivar TypeId:
11443
    :vartype TypeId: NodeId
11444
    :ivar RequestHeader:
11445
    :vartype RequestHeader: RequestHeader
11446
    :ivar Parameters:
11447
    :vartype Parameters: DeleteMonitoredItemsParameters
11448
    '''
11449 1
11450
    ua_types = [
11451
        ('TypeId', 'NodeId'),
11452
        ('RequestHeader', 'RequestHeader'),
11453
        ('Parameters', 'DeleteMonitoredItemsParameters'),
11454
               ]
11455 1
11456 1
    def __init__(self):
11457 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteMonitoredItemsRequest_Encoding_DefaultBinary)
11458 1
        self.RequestHeader = RequestHeader()
11459 1
        self.Parameters = DeleteMonitoredItemsParameters()
11460 1
        self._freeze = True
11461 1
11462 1
    def to_binary(self):
11463 1
        packet = []
11464
        packet.append(self.TypeId.to_binary())
11465 1
        packet.append(self.RequestHeader.to_binary())
11466 1
        packet.append(self.Parameters.to_binary())
11467 1
        return b''.join(packet)
11468 1
11469 1
    @staticmethod
11470 1
    def from_binary(data):
11471 1
        obj = DeleteMonitoredItemsRequest()
11472 1
        obj.TypeId = NodeId.from_binary(data)
11473
        obj.RequestHeader = RequestHeader.from_binary(data)
11474 1
        obj.Parameters = DeleteMonitoredItemsParameters.from_binary(data)
11475
        return obj
11476 1
11477
    def __str__(self):
11478 1
        return 'DeleteMonitoredItemsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11479 1
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
11480 1
               'Parameters:' + str(self.Parameters) + ')'
11481 1
11482 1
    __repr__ = __str__
11483 1
11484 1
11485 1
class DeleteMonitoredItemsResponse(FrozenClass):
11486 1
    '''
11487
    :ivar TypeId:
11488 1
    :vartype TypeId: NodeId
11489
    :ivar ResponseHeader:
11490
    :vartype ResponseHeader: ResponseHeader
11491
    :ivar Results:
11492
    :vartype Results: StatusCode
11493 1
    :ivar DiagnosticInfos:
11494
    :vartype DiagnosticInfos: DiagnosticInfo
11495
    '''
11496 1
11497
    ua_types = [
11498
        ('TypeId', 'NodeId'),
11499
        ('ResponseHeader', 'ResponseHeader'),
11500
        ('Results', 'ListOfStatusCode'),
11501
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
11502
               ]
11503
11504
    def __init__(self):
11505
        self.TypeId = FourByteNodeId(ObjectIds.DeleteMonitoredItemsResponse_Encoding_DefaultBinary)
11506 1
        self.ResponseHeader = ResponseHeader()
11507
        self.Results = []
11508
        self.DiagnosticInfos = []
11509
        self._freeze = True
11510
11511
    def to_binary(self):
11512 1
        packet = []
11513 1
        packet.append(self.TypeId.to_binary())
11514
        packet.append(self.ResponseHeader.to_binary())
11515
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
11516
        for fieldname in self.Results:
11517 1
            packet.append(fieldname.to_binary())
11518 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
11519 1
        for fieldname in self.DiagnosticInfos:
11520 1
            packet.append(fieldname.to_binary())
11521
        return b''.join(packet)
11522 1
11523 1
    @staticmethod
11524 1
    def from_binary(data):
11525 1
        obj = DeleteMonitoredItemsResponse()
11526 1
        obj.TypeId = NodeId.from_binary(data)
11527 1
        obj.ResponseHeader = ResponseHeader.from_binary(data)
11528
        length = uabin.Primitives.Int32.unpack(data)
11529 1
        array = []
11530
        if length != -1:
11531
            for _ in range(0, length):
11532
                array.append(StatusCode.from_binary(data))
11533 1
        obj.Results = array
11534
        length = uabin.Primitives.Int32.unpack(data)
11535
        array = []
11536
        if length != -1:
11537
            for _ in range(0, length):
11538 1
                array.append(DiagnosticInfo.from_binary(data))
11539
        obj.DiagnosticInfos = array
11540
        return obj
11541
11542
    def __str__(self):
11543 1
        return 'DeleteMonitoredItemsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11544
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
11545
               'Results:' + str(self.Results) + ', ' + \
11546 1
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
11547
11548
    __repr__ = __str__
11549
11550
11551
class CreateSubscriptionParameters(FrozenClass):
11552
    '''
11553
    :ivar RequestedPublishingInterval:
11554
    :vartype RequestedPublishingInterval: Double
11555
    :ivar RequestedLifetimeCount:
11556
    :vartype RequestedLifetimeCount: UInt32
11557
    :ivar RequestedMaxKeepAliveCount:
11558 1
    :vartype RequestedMaxKeepAliveCount: UInt32
11559
    :ivar MaxNotificationsPerPublish:
11560
    :vartype MaxNotificationsPerPublish: UInt32
11561
    :ivar PublishingEnabled:
11562
    :vartype PublishingEnabled: Boolean
11563
    :ivar Priority:
11564
    :vartype Priority: Byte
11565 1
    '''
11566 1
11567 1
    ua_types = [
11568 1
        ('RequestedPublishingInterval', 'Double'),
11569 1
        ('RequestedLifetimeCount', 'UInt32'),
11570 1
        ('RequestedMaxKeepAliveCount', 'UInt32'),
11571 1
        ('MaxNotificationsPerPublish', 'UInt32'),
11572 1
        ('PublishingEnabled', 'Boolean'),
11573 1
        ('Priority', 'Byte'),
11574 1
               ]
11575
11576 1
    def __init__(self):
11577 1
        self.RequestedPublishingInterval = 0
11578 1
        self.RequestedLifetimeCount = 0
11579 1
        self.RequestedMaxKeepAliveCount = 0
11580 1
        self.MaxNotificationsPerPublish = 0
11581 1
        self.PublishingEnabled = True
11582 1
        self.Priority = 0
11583 1
        self._freeze = True
11584 1
11585 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11586 1
        packet = []
11587
        packet.append(uabin.Primitives.Double.pack(self.RequestedPublishingInterval))
11588 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedLifetimeCount))
11589
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedMaxKeepAliveCount))
11590 1
        packet.append(uabin.Primitives.UInt32.pack(self.MaxNotificationsPerPublish))
11591
        packet.append(uabin.Primitives.Boolean.pack(self.PublishingEnabled))
11592 1
        packet.append(uabin.Primitives.Byte.pack(self.Priority))
11593 1
        return b''.join(packet)
11594 1
11595 1 View Code Duplication
    @staticmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11596 1
    def from_binary(data):
11597 1
        obj = CreateSubscriptionParameters()
11598 1
        self.RequestedPublishingInterval = uabin.Primitives.Double.unpack(data)
11599 1
        self.RequestedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
11600 1
        self.RequestedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
11601 1
        self.MaxNotificationsPerPublish = uabin.Primitives.UInt32.unpack(data)
11602 1
        self.PublishingEnabled = uabin.Primitives.Boolean.unpack(data)
11603 1
        self.Priority = uabin.Primitives.Byte.unpack(data)
11604 1
        return obj
11605
11606 1
    def __str__(self):
11607
        return 'CreateSubscriptionParameters(' + 'RequestedPublishingInterval:' + str(self.RequestedPublishingInterval) + ', ' + \
11608 1
               'RequestedLifetimeCount:' + str(self.RequestedLifetimeCount) + ', ' + \
11609
               'RequestedMaxKeepAliveCount:' + str(self.RequestedMaxKeepAliveCount) + ', ' + \
11610
               'MaxNotificationsPerPublish:' + str(self.MaxNotificationsPerPublish) + ', ' + \
11611
               'PublishingEnabled:' + str(self.PublishingEnabled) + ', ' + \
11612
               'Priority:' + str(self.Priority) + ')'
11613
11614 1
    __repr__ = __str__
11615
11616
11617 1
class CreateSubscriptionRequest(FrozenClass):
11618
    '''
11619
    :ivar TypeId:
11620
    :vartype TypeId: NodeId
11621
    :ivar RequestHeader:
11622
    :vartype RequestHeader: RequestHeader
11623
    :ivar Parameters:
11624
    :vartype Parameters: CreateSubscriptionParameters
11625 1
    '''
11626
11627
    ua_types = [
11628
        ('TypeId', 'NodeId'),
11629
        ('RequestHeader', 'RequestHeader'),
11630 1
        ('Parameters', 'CreateSubscriptionParameters'),
11631
               ]
11632
11633
    def __init__(self):
11634
        self.TypeId = FourByteNodeId(ObjectIds.CreateSubscriptionRequest_Encoding_DefaultBinary)
11635
        self.RequestHeader = RequestHeader()
11636
        self.Parameters = CreateSubscriptionParameters()
11637
        self._freeze = True
11638
11639 1
    def to_binary(self):
11640
        packet = []
11641
        packet.append(self.TypeId.to_binary())
11642
        packet.append(self.RequestHeader.to_binary())
11643
        packet.append(self.Parameters.to_binary())
11644
        return b''.join(packet)
11645 1
11646
    @staticmethod
11647
    def from_binary(data):
11648
        obj = CreateSubscriptionRequest()
11649 1
        obj.TypeId = NodeId.from_binary(data)
11650
        obj.RequestHeader = RequestHeader.from_binary(data)
11651
        obj.Parameters = CreateSubscriptionParameters.from_binary(data)
11652
        return obj
11653 1
11654
    def __str__(self):
11655
        return 'CreateSubscriptionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11656
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
11657 1
               'Parameters:' + str(self.Parameters) + ')'
11658
11659
    __repr__ = __str__
11660 1
11661 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11662
class CreateSubscriptionResult(FrozenClass):
11663
    '''
11664
    :ivar SubscriptionId:
11665
    :vartype SubscriptionId: UInt32
11666
    :ivar RevisedPublishingInterval:
11667
    :vartype RevisedPublishingInterval: Double
11668
    :ivar RevisedLifetimeCount:
11669
    :vartype RevisedLifetimeCount: UInt32
11670
    :ivar RevisedMaxKeepAliveCount:
11671
    :vartype RevisedMaxKeepAliveCount: UInt32
11672 1
    '''
11673
11674
    ua_types = [
11675
        ('SubscriptionId', 'UInt32'),
11676
        ('RevisedPublishingInterval', 'Double'),
11677 View Code Duplication
        ('RevisedLifetimeCount', 'UInt32'),
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11678
        ('RevisedMaxKeepAliveCount', 'UInt32'),
11679 1
               ]
11680
11681
    def __init__(self):
11682
        self.SubscriptionId = 0
11683
        self.RevisedPublishingInterval = 0
11684
        self.RevisedLifetimeCount = 0
11685
        self.RevisedMaxKeepAliveCount = 0
11686
        self._freeze = True
11687
11688
    def to_binary(self):
11689
        packet = []
11690 1
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
11691
        packet.append(uabin.Primitives.Double.pack(self.RevisedPublishingInterval))
11692
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedLifetimeCount))
11693
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedMaxKeepAliveCount))
11694
        return b''.join(packet)
11695
11696
    @staticmethod
11697
    def from_binary(data):
11698 1
        obj = CreateSubscriptionResult()
11699
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
11700
        self.RevisedPublishingInterval = uabin.Primitives.Double.unpack(data)
11701
        self.RevisedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
11702 1
        self.RevisedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
11703
        return obj
11704
11705
    def __str__(self):
11706
        return 'CreateSubscriptionResult(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
11707
               'RevisedPublishingInterval:' + str(self.RevisedPublishingInterval) + ', ' + \
11708 1
               'RevisedLifetimeCount:' + str(self.RevisedLifetimeCount) + ', ' + \
11709
               'RevisedMaxKeepAliveCount:' + str(self.RevisedMaxKeepAliveCount) + ')'
11710
11711
    __repr__ = __str__
11712
11713
11714 1
class CreateSubscriptionResponse(FrozenClass):
11715
    '''
11716
    :ivar TypeId:
11717 1
    :vartype TypeId: NodeId
11718
    :ivar ResponseHeader:
11719
    :vartype ResponseHeader: ResponseHeader
11720
    :ivar Parameters:
11721
    :vartype Parameters: CreateSubscriptionResult
11722
    '''
11723
11724
    ua_types = [
11725
        ('TypeId', 'NodeId'),
11726
        ('ResponseHeader', 'ResponseHeader'),
11727 1
        ('Parameters', 'CreateSubscriptionResult'),
11728
               ]
11729
11730
    def __init__(self):
11731
        self.TypeId = FourByteNodeId(ObjectIds.CreateSubscriptionResponse_Encoding_DefaultBinary)
11732
        self.ResponseHeader = ResponseHeader()
11733 1
        self.Parameters = CreateSubscriptionResult()
11734
        self._freeze = True
11735
11736
    def to_binary(self):
11737
        packet = []
11738
        packet.append(self.TypeId.to_binary())
11739
        packet.append(self.ResponseHeader.to_binary())
11740
        packet.append(self.Parameters.to_binary())
11741
        return b''.join(packet)
11742
11743 1
    @staticmethod
11744
    def from_binary(data):
11745
        obj = CreateSubscriptionResponse()
11746
        obj.TypeId = NodeId.from_binary(data)
11747
        obj.ResponseHeader = ResponseHeader.from_binary(data)
11748
        obj.Parameters = CreateSubscriptionResult.from_binary(data)
11749
        return obj
11750
11751
    def __str__(self):
11752 1
        return 'CreateSubscriptionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11753
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
11754
               'Parameters:' + str(self.Parameters) + ')'
11755
11756 1
    __repr__ = __str__
11757
11758
11759
class ModifySubscriptionParameters(FrozenClass):
11760
    '''
11761
    :ivar SubscriptionId:
11762
    :vartype SubscriptionId: UInt32
11763
    :ivar RequestedPublishingInterval:
11764
    :vartype RequestedPublishingInterval: Double
11765
    :ivar RequestedLifetimeCount:
11766 1
    :vartype RequestedLifetimeCount: UInt32
11767
    :ivar RequestedMaxKeepAliveCount:
11768
    :vartype RequestedMaxKeepAliveCount: UInt32
11769
    :ivar MaxNotificationsPerPublish:
11770
    :vartype MaxNotificationsPerPublish: UInt32
11771 1
    :ivar Priority:
11772
    :vartype Priority: Byte
11773
    '''
11774 1
11775
    ua_types = [
11776
        ('SubscriptionId', 'UInt32'),
11777
        ('RequestedPublishingInterval', 'Double'),
11778
        ('RequestedLifetimeCount', 'UInt32'),
11779
        ('RequestedMaxKeepAliveCount', 'UInt32'),
11780
        ('MaxNotificationsPerPublish', 'UInt32'),
11781
        ('Priority', 'Byte'),
11782
               ]
11783
11784 1
    def __init__(self):
11785
        self.SubscriptionId = 0
11786
        self.RequestedPublishingInterval = 0
11787
        self.RequestedLifetimeCount = 0
11788
        self.RequestedMaxKeepAliveCount = 0
11789
        self.MaxNotificationsPerPublish = 0
11790 1
        self.Priority = 0
11791
        self._freeze = True
11792
11793 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11794
        packet = []
11795
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
11796
        packet.append(uabin.Primitives.Double.pack(self.RequestedPublishingInterval))
11797
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedLifetimeCount))
11798
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedMaxKeepAliveCount))
11799
        packet.append(uabin.Primitives.UInt32.pack(self.MaxNotificationsPerPublish))
11800 1
        packet.append(uabin.Primitives.Byte.pack(self.Priority))
11801
        return b''.join(packet)
11802
11803 View Code Duplication
    @staticmethod
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11804
    def from_binary(data):
11805
        obj = ModifySubscriptionParameters()
11806
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
11807 1
        self.RequestedPublishingInterval = uabin.Primitives.Double.unpack(data)
11808
        self.RequestedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
11809
        self.RequestedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
11810
        self.MaxNotificationsPerPublish = uabin.Primitives.UInt32.unpack(data)
11811 1
        self.Priority = uabin.Primitives.Byte.unpack(data)
11812
        return obj
11813
11814
    def __str__(self):
11815
        return 'ModifySubscriptionParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
11816 1
               'RequestedPublishingInterval:' + str(self.RequestedPublishingInterval) + ', ' + \
11817
               'RequestedLifetimeCount:' + str(self.RequestedLifetimeCount) + ', ' + \
11818
               'RequestedMaxKeepAliveCount:' + str(self.RequestedMaxKeepAliveCount) + ', ' + \
11819
               'MaxNotificationsPerPublish:' + str(self.MaxNotificationsPerPublish) + ', ' + \
11820
               'Priority:' + str(self.Priority) + ')'
11821 1
11822
    __repr__ = __str__
11823
11824 1
11825
class ModifySubscriptionRequest(FrozenClass):
11826
    '''
11827
    :ivar TypeId:
11828
    :vartype TypeId: NodeId
11829
    :ivar RequestHeader:
11830
    :vartype RequestHeader: RequestHeader
11831
    :ivar Parameters:
11832
    :vartype Parameters: ModifySubscriptionParameters
11833
    '''
11834
11835
    ua_types = [
11836 1
        ('TypeId', 'NodeId'),
11837
        ('RequestHeader', 'RequestHeader'),
11838
        ('Parameters', 'ModifySubscriptionParameters'),
11839
               ]
11840
11841
    def __init__(self):
11842
        self.TypeId = FourByteNodeId(ObjectIds.ModifySubscriptionRequest_Encoding_DefaultBinary)
11843 1
        self.RequestHeader = RequestHeader()
11844
        self.Parameters = ModifySubscriptionParameters()
11845
        self._freeze = True
11846
11847
    def to_binary(self):
11848
        packet = []
11849
        packet.append(self.TypeId.to_binary())
11850
        packet.append(self.RequestHeader.to_binary())
11851
        packet.append(self.Parameters.to_binary())
11852
        return b''.join(packet)
11853
11854 1
    @staticmethod
11855
    def from_binary(data):
11856
        obj = ModifySubscriptionRequest()
11857
        obj.TypeId = NodeId.from_binary(data)
11858
        obj.RequestHeader = RequestHeader.from_binary(data)
11859
        obj.Parameters = ModifySubscriptionParameters.from_binary(data)
11860
        return obj
11861
11862
    def __str__(self):
11863
        return 'ModifySubscriptionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11864
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
11865
               'Parameters:' + str(self.Parameters) + ')'
11866 1
11867
    __repr__ = __str__
11868
11869
11870 1
class ModifySubscriptionResult(FrozenClass):
11871
    '''
11872
    :ivar RevisedPublishingInterval:
11873
    :vartype RevisedPublishingInterval: Double
11874
    :ivar RevisedLifetimeCount:
11875
    :vartype RevisedLifetimeCount: UInt32
11876
    :ivar RevisedMaxKeepAliveCount:
11877
    :vartype RevisedMaxKeepAliveCount: UInt32
11878
    '''
11879
11880
    ua_types = [
11881
        ('RevisedPublishingInterval', 'Double'),
11882
        ('RevisedLifetimeCount', 'UInt32'),
11883
        ('RevisedMaxKeepAliveCount', 'UInt32'),
11884
               ]
11885
11886 1
    def __init__(self):
11887
        self.RevisedPublishingInterval = 0
11888
        self.RevisedLifetimeCount = 0
11889
        self.RevisedMaxKeepAliveCount = 0
11890
        self._freeze = True
11891
11892 1
    def to_binary(self):
11893
        packet = []
11894
        packet.append(uabin.Primitives.Double.pack(self.RevisedPublishingInterval))
11895 1
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedLifetimeCount))
11896
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedMaxKeepAliveCount))
11897
        return b''.join(packet)
11898
11899
    @staticmethod
11900
    def from_binary(data):
11901
        obj = ModifySubscriptionResult()
11902
        self.RevisedPublishingInterval = uabin.Primitives.Double.unpack(data)
11903
        self.RevisedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
11904
        self.RevisedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
11905 1
        return obj
11906
11907
    def __str__(self):
11908
        return 'ModifySubscriptionResult(' + 'RevisedPublishingInterval:' + str(self.RevisedPublishingInterval) + ', ' + \
11909
               'RevisedLifetimeCount:' + str(self.RevisedLifetimeCount) + ', ' + \
11910
               'RevisedMaxKeepAliveCount:' + str(self.RevisedMaxKeepAliveCount) + ')'
11911 1
11912
    __repr__ = __str__
11913
11914
11915 View Code Duplication
class ModifySubscriptionResponse(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11916
    '''
11917
    :ivar TypeId:
11918
    :vartype TypeId: NodeId
11919
    :ivar ResponseHeader:
11920
    :vartype ResponseHeader: ResponseHeader
11921 1
    :ivar Parameters:
11922
    :vartype Parameters: ModifySubscriptionResult
11923
    '''
11924
11925
    ua_types = [
11926
        ('TypeId', 'NodeId'),
11927
        ('ResponseHeader', 'ResponseHeader'),
11928
        ('Parameters', 'ModifySubscriptionResult'),
11929
               ]
11930 1
11931
    def __init__(self):
11932
        self.TypeId = FourByteNodeId(ObjectIds.ModifySubscriptionResponse_Encoding_DefaultBinary)
11933
        self.ResponseHeader = ResponseHeader()
11934 1
        self.Parameters = ModifySubscriptionResult()
11935
        self._freeze = True
11936
11937
    def to_binary(self):
11938
        packet = []
11939 1
        packet.append(self.TypeId.to_binary())
11940
        packet.append(self.ResponseHeader.to_binary())
11941
        packet.append(self.Parameters.to_binary())
11942
        return b''.join(packet)
11943
11944 1
    @staticmethod
11945
    def from_binary(data):
11946
        obj = ModifySubscriptionResponse()
11947 1
        obj.TypeId = NodeId.from_binary(data)
11948
        obj.ResponseHeader = ResponseHeader.from_binary(data)
11949
        obj.Parameters = ModifySubscriptionResult.from_binary(data)
11950
        return obj
11951
11952
    def __str__(self):
11953
        return 'ModifySubscriptionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11954
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
11955
               'Parameters:' + str(self.Parameters) + ')'
11956
11957 1
    __repr__ = __str__
11958
11959
11960
class SetPublishingModeParameters(FrozenClass):
11961
    '''
11962
    :ivar PublishingEnabled:
11963 1
    :vartype PublishingEnabled: Boolean
11964
    :ivar SubscriptionIds:
11965
    :vartype SubscriptionIds: UInt32
11966
    '''
11967
11968
    ua_types = [
11969
        ('PublishingEnabled', 'Boolean'),
11970
        ('SubscriptionIds', 'ListOfUInt32'),
11971
               ]
11972
11973 1
    def __init__(self):
11974
        self.PublishingEnabled = True
11975
        self.SubscriptionIds = []
11976
        self._freeze = True
11977
11978
    def to_binary(self):
11979
        packet = []
11980 1
        packet.append(uabin.Primitives.Boolean.pack(self.PublishingEnabled))
11981
        packet.append(uabin.Primitives.Int32.pack(len(self.SubscriptionIds)))
11982
        for fieldname in self.SubscriptionIds:
11983
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
11984 1
        return b''.join(packet)
11985
11986
    @staticmethod
11987
    def from_binary(data):
11988
        obj = SetPublishingModeParameters()
11989 1
        self.PublishingEnabled = uabin.Primitives.Boolean.unpack(data)
11990
        obj.SubscriptionIds = uabin.Primitives.UInt32.unpack_array(data)
11991
        return obj
11992
11993
    def __str__(self):
11994 1
        return 'SetPublishingModeParameters(' + 'PublishingEnabled:' + str(self.PublishingEnabled) + ', ' + \
11995
               'SubscriptionIds:' + str(self.SubscriptionIds) + ')'
11996
11997 1
    __repr__ = __str__
11998
11999
12000
class SetPublishingModeRequest(FrozenClass):
12001
    '''
12002
    :ivar TypeId:
12003
    :vartype TypeId: NodeId
12004
    :ivar RequestHeader:
12005 1
    :vartype RequestHeader: RequestHeader
12006
    :ivar Parameters:
12007
    :vartype Parameters: SetPublishingModeParameters
12008
    '''
12009
12010 1
    ua_types = [
12011
        ('TypeId', 'NodeId'),
12012
        ('RequestHeader', 'RequestHeader'),
12013
        ('Parameters', 'SetPublishingModeParameters'),
12014
               ]
12015
12016
    def __init__(self):
12017
        self.TypeId = FourByteNodeId(ObjectIds.SetPublishingModeRequest_Encoding_DefaultBinary)
12018
        self.RequestHeader = RequestHeader()
12019 1
        self.Parameters = SetPublishingModeParameters()
12020
        self._freeze = True
12021
12022
    def to_binary(self):
12023
        packet = []
12024
        packet.append(self.TypeId.to_binary())
12025
        packet.append(self.RequestHeader.to_binary())
12026
        packet.append(self.Parameters.to_binary())
12027
        return b''.join(packet)
12028 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12029 1
    @staticmethod
12030
    def from_binary(data):
12031
        obj = SetPublishingModeRequest()
12032
        obj.TypeId = NodeId.from_binary(data)
12033 1
        obj.RequestHeader = RequestHeader.from_binary(data)
12034
        obj.Parameters = SetPublishingModeParameters.from_binary(data)
12035
        return obj
12036
12037
    def __str__(self):
12038
        return 'SetPublishingModeRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12039
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12040
               'Parameters:' + str(self.Parameters) + ')'
12041
12042
    __repr__ = __str__
12043
12044
12045
class SetPublishingModeResult(FrozenClass):
12046
    '''
12047 1
    :ivar Results:
12048
    :vartype Results: StatusCode
12049
    :ivar DiagnosticInfos:
12050
    :vartype DiagnosticInfos: DiagnosticInfo
12051 1
    '''
12052
12053
    ua_types = [
12054 1
        ('Results', 'ListOfStatusCode'),
12055
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
12056
               ]
12057
12058
    def __init__(self):
12059
        self.Results = []
12060
        self.DiagnosticInfos = []
12061
        self._freeze = True
12062
12063
    def to_binary(self):
12064 1
        packet = []
12065
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
12066
        for fieldname in self.Results:
12067
            packet.append(fieldname.to_binary())
12068
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
12069
        for fieldname in self.DiagnosticInfos:
12070 1
            packet.append(fieldname.to_binary())
12071
        return b''.join(packet)
12072
12073
    @staticmethod
12074
    def from_binary(data):
12075
        obj = SetPublishingModeResult()
12076
        length = uabin.Primitives.Int32.unpack(data)
12077
        array = []
12078
        if length != -1:
12079
            for _ in range(0, length):
12080 1
                array.append(StatusCode.from_binary(data))
12081
        obj.Results = array
12082
        length = uabin.Primitives.Int32.unpack(data)
12083
        array = []
12084
        if length != -1:
12085
            for _ in range(0, length):
12086
                array.append(DiagnosticInfo.from_binary(data))
12087 1
        obj.DiagnosticInfos = array
12088
        return obj
12089
12090
    def __str__(self):
12091 1
        return 'SetPublishingModeResult(' + 'Results:' + str(self.Results) + ', ' + \
12092
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
12093
12094
    __repr__ = __str__
12095
12096 1
12097
class SetPublishingModeResponse(FrozenClass):
12098
    '''
12099
    :ivar TypeId:
12100
    :vartype TypeId: NodeId
12101 1
    :ivar ResponseHeader:
12102
    :vartype ResponseHeader: ResponseHeader
12103
    :ivar Parameters:
12104 1
    :vartype Parameters: SetPublishingModeResult
12105
    '''
12106
12107
    ua_types = [
12108
        ('TypeId', 'NodeId'),
12109
        ('ResponseHeader', 'ResponseHeader'),
12110
        ('Parameters', 'SetPublishingModeResult'),
12111
               ]
12112
12113
    def __init__(self):
12114
        self.TypeId = FourByteNodeId(ObjectIds.SetPublishingModeResponse_Encoding_DefaultBinary)
12115
        self.ResponseHeader = ResponseHeader()
12116 1
        self.Parameters = SetPublishingModeResult()
12117
        self._freeze = True
12118
12119
    def to_binary(self):
12120
        packet = []
12121
        packet.append(self.TypeId.to_binary())
12122
        packet.append(self.ResponseHeader.to_binary())
12123 1
        packet.append(self.Parameters.to_binary())
12124
        return b''.join(packet)
12125
12126
    @staticmethod
12127 View Code Duplication
    def from_binary(data):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12128
        obj = SetPublishingModeResponse()
12129
        obj.TypeId = NodeId.from_binary(data)
12130
        obj.ResponseHeader = ResponseHeader.from_binary(data)
12131
        obj.Parameters = SetPublishingModeResult.from_binary(data)
12132
        return obj
12133
12134 1
    def __str__(self):
12135
        return 'SetPublishingModeResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12136
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12137
               'Parameters:' + str(self.Parameters) + ')'
12138
12139
    __repr__ = __str__
12140
12141
12142
class NotificationMessage(FrozenClass):
12143
    '''
12144
    :ivar SequenceNumber:
12145
    :vartype SequenceNumber: UInt32
12146 1
    :ivar PublishTime:
12147
    :vartype PublishTime: DateTime
12148
    :ivar NotificationData:
12149
    :vartype NotificationData: ExtensionObject
12150 1
    '''
12151
12152
    ua_types = [
12153
        ('SequenceNumber', 'UInt32'),
12154
        ('PublishTime', 'DateTime'),
12155
        ('NotificationData', 'ListOfExtensionObject'),
12156 1
               ]
12157
12158
    def __init__(self):
12159
        self.SequenceNumber = 0
12160
        self.PublishTime = datetime.utcnow()
12161
        self.NotificationData = []
12162 1
        self._freeze = True
12163
12164
    def to_binary(self):
12165 1
        packet = []
12166
        packet.append(uabin.Primitives.UInt32.pack(self.SequenceNumber))
12167
        packet.append(uabin.Primitives.DateTime.pack(self.PublishTime))
12168
        packet.append(uabin.Primitives.Int32.pack(len(self.NotificationData)))
12169
        for fieldname in self.NotificationData:
12170
            packet.append(uabin.extensionobject_to_binary(fieldname))
12171
        return b''.join(packet)
12172
12173
    @staticmethod
12174
    def from_binary(data):
12175 1
        obj = NotificationMessage()
12176
        self.SequenceNumber = uabin.Primitives.UInt32.unpack(data)
12177
        self.PublishTime = uabin.Primitives.DateTime.unpack(data)
12178
        length = uabin.Primitives.Int32.unpack(data)
12179
        array = []
12180
        if length != -1:
12181 1
            for _ in range(0, length):
12182
                array.append(uabin.extensionobject_from_binary(data))
12183
        obj.NotificationData = array
12184
        return obj
12185
12186
    def __str__(self):
12187
        return 'NotificationMessage(' + 'SequenceNumber:' + str(self.SequenceNumber) + ', ' + \
12188
               'PublishTime:' + str(self.PublishTime) + ', ' + \
12189
               'NotificationData:' + str(self.NotificationData) + ')'
12190
12191 1
    __repr__ = __str__
12192
12193
12194
class NotificationData(FrozenClass):
12195
    '''
12196
    '''
12197
12198 1
    ua_types = [
12199
               ]
12200
12201
    def __init__(self):
12202 1
        self._freeze = True
12203
12204
    def to_binary(self):
12205
        packet = []
12206
        return b''.join(packet)
12207 1
12208
    @staticmethod
12209
    def from_binary(data):
12210
        obj = NotificationData()
12211
        return obj
12212 1
12213
    def __str__(self):
12214
        return 'NotificationData(' +  + ')'
12215 1
12216
    __repr__ = __str__
12217
12218
12219
class DataChangeNotification(FrozenClass):
12220
    '''
12221
    :ivar MonitoredItems:
12222
    :vartype MonitoredItems: MonitoredItemNotification
12223
    :ivar DiagnosticInfos:
12224
    :vartype DiagnosticInfos: DiagnosticInfo
12225
    '''
12226
12227 1
    ua_types = [
12228
        ('MonitoredItems', 'ListOfMonitoredItemNotification'),
12229
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
12230
               ]
12231
12232
    def __init__(self):
12233
        self.MonitoredItems = []
12234 1
        self.DiagnosticInfos = []
12235
        self._freeze = True
12236
12237
    def to_binary(self):
12238
        packet = []
12239
        packet.append(uabin.Primitives.Int32.pack(len(self.MonitoredItems)))
12240 View Code Duplication
        for fieldname in self.MonitoredItems:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12241
            packet.append(fieldname.to_binary())
12242
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
12243
        for fieldname in self.DiagnosticInfos:
12244
            packet.append(fieldname.to_binary())
12245 1
        return b''.join(packet)
12246
12247
    @staticmethod
12248
    def from_binary(data):
12249
        obj = DataChangeNotification()
12250
        length = uabin.Primitives.Int32.unpack(data)
12251
        array = []
12252
        if length != -1:
12253
            for _ in range(0, length):
12254
                array.append(MonitoredItemNotification.from_binary(data))
12255
        obj.MonitoredItems = array
12256
        length = uabin.Primitives.Int32.unpack(data)
12257
        array = []
12258
        if length != -1:
12259
            for _ in range(0, length):
12260
                array.append(DiagnosticInfo.from_binary(data))
12261 1
        obj.DiagnosticInfos = array
12262
        return obj
12263
12264
    def __str__(self):
12265 1
        return 'DataChangeNotification(' + 'MonitoredItems:' + str(self.MonitoredItems) + ', ' + \
12266
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
12267
12268
    __repr__ = __str__
12269
12270
12271
class MonitoredItemNotification(FrozenClass):
12272
    '''
12273
    :ivar ClientHandle:
12274
    :vartype ClientHandle: UInt32
12275
    :ivar Value:
12276
    :vartype Value: DataValue
12277
    '''
12278
12279
    ua_types = [
12280
        ('ClientHandle', 'UInt32'),
12281
        ('Value', 'DataValue'),
12282
               ]
12283
12284
    def __init__(self):
12285
        self.ClientHandle = 0
12286
        self.Value = DataValue()
12287
        self._freeze = True
12288
12289
    def to_binary(self):
12290
        packet = []
12291 1
        packet.append(uabin.Primitives.UInt32.pack(self.ClientHandle))
12292
        packet.append(self.Value.to_binary())
12293
        return b''.join(packet)
12294
12295
    @staticmethod
12296
    def from_binary(data):
12297 1
        obj = MonitoredItemNotification()
12298
        self.ClientHandle = uabin.Primitives.UInt32.unpack(data)
12299
        obj.Value = DataValue.from_binary(data)
12300 1
        return obj
12301
12302
    def __str__(self):
12303
        return 'MonitoredItemNotification(' + 'ClientHandle:' + str(self.ClientHandle) + ', ' + \
12304
               'Value:' + str(self.Value) + ')'
12305
12306
    __repr__ = __str__
12307
12308
12309
class EventNotificationList(FrozenClass):
12310 1
    '''
12311
    :ivar Events:
12312
    :vartype Events: EventFieldList
12313
    '''
12314
12315
    ua_types = [
12316 1
        ('Events', 'ListOfEventFieldList'),
12317
               ]
12318
12319
    def __init__(self):
12320
        self.Events = []
12321
        self._freeze = True
12322
12323
    def to_binary(self):
12324
        packet = []
12325
        packet.append(uabin.Primitives.Int32.pack(len(self.Events)))
12326 1
        for fieldname in self.Events:
12327
            packet.append(fieldname.to_binary())
12328
        return b''.join(packet)
12329
12330
    @staticmethod
12331
    def from_binary(data):
12332
        obj = EventNotificationList()
12333 1
        length = uabin.Primitives.Int32.unpack(data)
12334
        array = []
12335
        if length != -1:
12336
            for _ in range(0, length):
12337 1
                array.append(EventFieldList.from_binary(data))
12338
        obj.Events = array
12339
        return obj
12340
12341
    def __str__(self):
12342 1
        return 'EventNotificationList(' + 'Events:' + str(self.Events) + ')'
12343
12344
    __repr__ = __str__
12345
12346
12347 1
class EventFieldList(FrozenClass):
12348
    '''
12349
    :ivar ClientHandle:
12350 1
    :vartype ClientHandle: UInt32
12351
    :ivar EventFields:
12352
    :vartype EventFields: Variant
12353
    '''
12354
12355
    ua_types = [
12356
        ('ClientHandle', 'UInt32'),
12357
        ('EventFields', 'ListOfVariant'),
12358 1
               ]
12359
12360
    def __init__(self):
12361
        self.ClientHandle = 0
12362
        self.EventFields = []
12363 1
        self._freeze = True
12364 1
12365 1
    def to_binary(self):
12366 1
        packet = []
12367 1
        packet.append(uabin.Primitives.UInt32.pack(self.ClientHandle))
12368 1
        packet.append(uabin.Primitives.Int32.pack(len(self.EventFields)))
12369 1
        for fieldname in self.EventFields:
12370 1
            packet.append(fieldname.to_binary())
12371
        return b''.join(packet)
12372 1
12373 1
    @staticmethod
12374 1
    def from_binary(data):
12375 1
        obj = EventFieldList()
12376 1
        self.ClientHandle = uabin.Primitives.UInt32.unpack(data)
12377 1
        length = uabin.Primitives.Int32.unpack(data)
12378 1
        array = []
12379
        if length != -1:
12380 1
            for _ in range(0, length):
12381
                array.append(Variant.from_binary(data))
12382 1
        obj.EventFields = array
12383
        return obj
12384 1
12385 1
    def __str__(self):
12386 1
        return 'EventFieldList(' + 'ClientHandle:' + str(self.ClientHandle) + ', ' + \
12387
               'EventFields:' + str(self.EventFields) + ')'
12388 1
12389
    __repr__ = __str__
12390
12391
12392 1
class HistoryEventFieldList(FrozenClass):
12393
    '''
12394
    :ivar EventFields:
12395 1
    :vartype EventFields: Variant
12396
    '''
12397
12398
    ua_types = [
12399
        ('EventFields', 'ListOfVariant'),
12400
               ]
12401
12402
    def __init__(self):
12403
        self.EventFields = []
12404
        self._freeze = True
12405 1
12406
    def to_binary(self):
12407
        packet = []
12408
        packet.append(uabin.Primitives.Int32.pack(len(self.EventFields)))
12409
        for fieldname in self.EventFields:
12410
            packet.append(fieldname.to_binary())
12411 1
        return b''.join(packet)
12412 1
12413
    @staticmethod
12414
    def from_binary(data):
12415
        obj = HistoryEventFieldList()
12416 1
        length = uabin.Primitives.Int32.unpack(data)
12417 1
        array = []
12418 1
        if length != -1:
12419 1
            for _ in range(0, length):
12420
                array.append(Variant.from_binary(data))
12421 1
        obj.EventFields = array
12422 1
        return obj
12423 1
12424 1
    def __str__(self):
12425 1
        return 'HistoryEventFieldList(' + 'EventFields:' + str(self.EventFields) + ')'
12426 1
12427
    __repr__ = __str__
12428 1
12429
12430
class StatusChangeNotification(FrozenClass):
12431
    '''
12432 1
    :ivar Status:
12433
    :vartype Status: StatusCode
12434
    :ivar DiagnosticInfo:
12435
    :vartype DiagnosticInfo: DiagnosticInfo
12436
    '''
12437 1
12438
    ua_types = [
12439
        ('Status', 'StatusCode'),
12440
        ('DiagnosticInfo', 'DiagnosticInfo'),
12441
               ]
12442 1
12443
    def __init__(self):
12444
        self.Status = StatusCode()
12445 1
        self.DiagnosticInfo = DiagnosticInfo()
12446
        self._freeze = True
12447
12448
    def to_binary(self):
12449
        packet = []
12450
        packet.append(self.Status.to_binary())
12451
        packet.append(self.DiagnosticInfo.to_binary())
12452
        return b''.join(packet)
12453
12454
    @staticmethod
12455
    def from_binary(data):
12456
        obj = StatusChangeNotification()
12457 1
        obj.Status = StatusCode.from_binary(data)
12458
        obj.DiagnosticInfo = DiagnosticInfo.from_binary(data)
12459
        return obj
12460
12461
    def __str__(self):
12462
        return 'StatusChangeNotification(' + 'Status:' + str(self.Status) + ', ' + \
12463
               'DiagnosticInfo:' + str(self.DiagnosticInfo) + ')'
12464 1
12465 1
    __repr__ = __str__
12466 1
12467 1
12468 1
class SubscriptionAcknowledgement(FrozenClass):
12469 1
    '''
12470 1
    :ivar SubscriptionId:
12471 1
    :vartype SubscriptionId: UInt32
12472 1
    :ivar SequenceNumber:
12473 1
    :vartype SequenceNumber: UInt32
12474
    '''
12475 1
12476 1
    ua_types = [
12477 1
        ('SubscriptionId', 'UInt32'),
12478 1
        ('SequenceNumber', 'UInt32'),
12479 1
               ]
12480 1
12481 1
    def __init__(self):
12482 1
        self.SubscriptionId = 0
12483 1
        self.SequenceNumber = 0
12484
        self._freeze = True
12485 1
12486
    def to_binary(self):
12487 1
        packet = []
12488
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
12489 1
        packet.append(uabin.Primitives.UInt32.pack(self.SequenceNumber))
12490
        return b''.join(packet)
12491 1
12492 1
    @staticmethod
12493 1
    def from_binary(data):
12494 1
        obj = SubscriptionAcknowledgement()
12495 1
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
12496 1
        self.SequenceNumber = uabin.Primitives.UInt32.unpack(data)
12497 1
        return obj
12498 1
12499 1
    def __str__(self):
12500 1
        return 'SubscriptionAcknowledgement(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12501 1
               'SequenceNumber:' + str(self.SequenceNumber) + ')'
12502 1
12503 1
    __repr__ = __str__
12504
12505 1
12506
class PublishParameters(FrozenClass):
12507 1
    '''
12508
    :ivar SubscriptionAcknowledgements:
12509
    :vartype SubscriptionAcknowledgements: SubscriptionAcknowledgement
12510
    '''
12511
12512
    ua_types = [
12513 1
        ('SubscriptionAcknowledgements', 'ListOfSubscriptionAcknowledgement'),
12514
               ]
12515
12516 1
    def __init__(self):
12517
        self.SubscriptionAcknowledgements = []
12518
        self._freeze = True
12519
12520
    def to_binary(self):
12521
        packet = []
12522
        packet.append(uabin.Primitives.Int32.pack(len(self.SubscriptionAcknowledgements)))
12523
        for fieldname in self.SubscriptionAcknowledgements:
12524
            packet.append(fieldname.to_binary())
12525
        return b''.join(packet)
12526
12527
    @staticmethod
12528
    def from_binary(data):
12529
        obj = PublishParameters()
12530
        length = uabin.Primitives.Int32.unpack(data)
12531
        array = []
12532 1
        if length != -1:
12533
            for _ in range(0, length):
12534
                array.append(SubscriptionAcknowledgement.from_binary(data))
12535
        obj.SubscriptionAcknowledgements = array
12536
        return obj
12537
12538
    def __str__(self):
12539
        return 'PublishParameters(' + 'SubscriptionAcknowledgements:' + str(self.SubscriptionAcknowledgements) + ')'
12540
12541 1
    __repr__ = __str__
12542 1
12543 1
12544 1
class PublishRequest(FrozenClass):
12545 1
    '''
12546 1
    :ivar TypeId:
12547 1
    :vartype TypeId: NodeId
12548 1
    :ivar RequestHeader:
12549 1
    :vartype RequestHeader: RequestHeader
12550 1
    :ivar Parameters:
12551 1
    :vartype Parameters: PublishParameters
12552 1
    '''
12553
12554 1
    ua_types = [
12555 1
        ('TypeId', 'NodeId'),
12556 1
        ('RequestHeader', 'RequestHeader'),
12557 1
        ('Parameters', 'PublishParameters'),
12558 1
               ]
12559 1
12560 1
    def __init__(self):
12561 1
        self.TypeId = FourByteNodeId(ObjectIds.PublishRequest_Encoding_DefaultBinary)
12562 1
        self.RequestHeader = RequestHeader()
12563
        self.Parameters = PublishParameters()
12564 1
        self._freeze = True
12565
12566 1
    def to_binary(self):
12567
        packet = []
12568 1
        packet.append(self.TypeId.to_binary())
12569 1
        packet.append(self.RequestHeader.to_binary())
12570 1
        packet.append(self.Parameters.to_binary())
12571 1
        return b''.join(packet)
12572 1
12573 1
    @staticmethod
12574 1
    def from_binary(data):
12575
        obj = PublishRequest()
12576 1
        obj.TypeId = NodeId.from_binary(data)
12577
        obj.RequestHeader = RequestHeader.from_binary(data)
12578
        obj.Parameters = PublishParameters.from_binary(data)
12579
        return obj
12580
12581
    def __str__(self):
12582
        return 'PublishRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12583
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12584 1
               'Parameters:' + str(self.Parameters) + ')'
12585
12586
    __repr__ = __str__
12587 1
12588
12589
class PublishResult(FrozenClass):
12590
    '''
12591
    :ivar SubscriptionId:
12592
    :vartype SubscriptionId: UInt32
12593
    :ivar AvailableSequenceNumbers:
12594
    :vartype AvailableSequenceNumbers: UInt32
12595
    :ivar MoreNotifications:
12596
    :vartype MoreNotifications: Boolean
12597 1
    :ivar NotificationMessage:
12598
    :vartype NotificationMessage: NotificationMessage
12599
    :ivar Results:
12600
    :vartype Results: StatusCode
12601
    :ivar DiagnosticInfos:
12602
    :vartype DiagnosticInfos: DiagnosticInfo
12603 1
    '''
12604 1
12605
    ua_types = [
12606
        ('SubscriptionId', 'UInt32'),
12607
        ('AvailableSequenceNumbers', 'ListOfUInt32'),
12608 1
        ('MoreNotifications', 'Boolean'),
12609 1
        ('NotificationMessage', 'NotificationMessage'),
12610 1
        ('Results', 'ListOfStatusCode'),
12611 1
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
12612
               ]
12613 1
12614 1
    def __init__(self):
12615 1
        self.SubscriptionId = 0
12616 1
        self.AvailableSequenceNumbers = []
12617 1
        self.MoreNotifications = True
12618 1
        self.NotificationMessage = NotificationMessage()
12619
        self.Results = []
12620 1
        self.DiagnosticInfos = []
12621
        self._freeze = True
12622
12623
    def to_binary(self):
12624 1
        packet = []
12625
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
12626
        packet.append(uabin.Primitives.Int32.pack(len(self.AvailableSequenceNumbers)))
12627
        for fieldname in self.AvailableSequenceNumbers:
12628
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
12629 1
        packet.append(uabin.Primitives.Boolean.pack(self.MoreNotifications))
12630
        packet.append(self.NotificationMessage.to_binary())
12631
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
12632
        for fieldname in self.Results:
12633
            packet.append(fieldname.to_binary())
12634 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
12635
        for fieldname in self.DiagnosticInfos:
12636
            packet.append(fieldname.to_binary())
12637 1
        return b''.join(packet)
12638
12639
    @staticmethod
12640
    def from_binary(data):
12641
        obj = PublishResult()
12642
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
12643
        obj.AvailableSequenceNumbers = uabin.Primitives.UInt32.unpack_array(data)
12644
        self.MoreNotifications = uabin.Primitives.Boolean.unpack(data)
12645
        obj.NotificationMessage = NotificationMessage.from_binary(data)
12646
        length = uabin.Primitives.Int32.unpack(data)
12647
        array = []
12648
        if length != -1:
12649 1
            for _ in range(0, length):
12650
                array.append(StatusCode.from_binary(data))
12651
        obj.Results = array
12652
        length = uabin.Primitives.Int32.unpack(data)
12653
        array = []
12654
        if length != -1:
12655
            for _ in range(0, length):
12656 1
                array.append(DiagnosticInfo.from_binary(data))
12657 1
        obj.DiagnosticInfos = array
12658 1
        return obj
12659 1
12660 1
    def __str__(self):
12661 1
        return 'PublishResult(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12662 1
               'AvailableSequenceNumbers:' + str(self.AvailableSequenceNumbers) + ', ' + \
12663 1
               'MoreNotifications:' + str(self.MoreNotifications) + ', ' + \
12664 1
               'NotificationMessage:' + str(self.NotificationMessage) + ', ' + \
12665 1
               'Results:' + str(self.Results) + ', ' + \
12666
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
12667 1
12668 1
    __repr__ = __str__
12669 1
12670 1
12671 1
class PublishResponse(FrozenClass):
12672 1
    '''
12673 1
    :ivar TypeId:
12674
    :vartype TypeId: NodeId
12675 1
    :ivar ResponseHeader:
12676
    :vartype ResponseHeader: ResponseHeader
12677 1
    :ivar Parameters:
12678
    :vartype Parameters: PublishResult
12679 1
    '''
12680 1
12681 1
    ua_types = [
12682 1
        ('TypeId', 'NodeId'),
12683 1
        ('ResponseHeader', 'ResponseHeader'),
12684
        ('Parameters', 'PublishResult'),
12685 1
               ]
12686
12687
    def __init__(self):
12688
        self.TypeId = FourByteNodeId(ObjectIds.PublishResponse_Encoding_DefaultBinary)
12689
        self.ResponseHeader = ResponseHeader()
12690
        self.Parameters = PublishResult()
12691 1
        self._freeze = True
12692
12693
    def to_binary(self):
12694 1
        packet = []
12695
        packet.append(self.TypeId.to_binary())
12696
        packet.append(self.ResponseHeader.to_binary())
12697
        packet.append(self.Parameters.to_binary())
12698
        return b''.join(packet)
12699
12700
    @staticmethod
12701
    def from_binary(data):
12702
        obj = PublishResponse()
12703
        obj.TypeId = NodeId.from_binary(data)
12704 1
        obj.ResponseHeader = ResponseHeader.from_binary(data)
12705
        obj.Parameters = PublishResult.from_binary(data)
12706
        return obj
12707
12708
    def __str__(self):
12709
        return 'PublishResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12710 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12711 1
               'Parameters:' + str(self.Parameters) + ')'
12712 1
12713 1
    __repr__ = __str__
12714 1
12715 1
12716 1
class RepublishParameters(FrozenClass):
12717 1
    '''
12718 1
    :ivar SubscriptionId:
12719
    :vartype SubscriptionId: UInt32
12720 1
    :ivar RetransmitSequenceNumber:
12721 1
    :vartype RetransmitSequenceNumber: UInt32
12722 1
    '''
12723 1
12724 1
    ua_types = [
12725 1
        ('SubscriptionId', 'UInt32'),
12726
        ('RetransmitSequenceNumber', 'UInt32'),
12727 1
               ]
12728 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12729 1
    def __init__(self):
12730
        self.SubscriptionId = 0
12731 1
        self.RetransmitSequenceNumber = 0
12732 1
        self._freeze = True
12733 1
12734 1
    def to_binary(self):
12735
        packet = []
12736 1
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
12737
        packet.append(uabin.Primitives.UInt32.pack(self.RetransmitSequenceNumber))
12738
        return b''.join(packet)
12739
12740
    @staticmethod
12741 1
    def from_binary(data):
12742
        obj = RepublishParameters()
12743
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
12744 1
        self.RetransmitSequenceNumber = uabin.Primitives.UInt32.unpack(data)
12745
        return obj
12746
12747
    def __str__(self):
12748
        return 'RepublishParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12749
               'RetransmitSequenceNumber:' + str(self.RetransmitSequenceNumber) + ')'
12750
12751
    __repr__ = __str__
12752
12753
12754
class RepublishRequest(FrozenClass):
12755
    '''
12756
    :ivar TypeId:
12757
    :vartype TypeId: NodeId
12758
    :ivar RequestHeader:
12759
    :vartype RequestHeader: RequestHeader
12760 1
    :ivar Parameters:
12761
    :vartype Parameters: RepublishParameters
12762
    '''
12763
12764
    ua_types = [
12765
        ('TypeId', 'NodeId'),
12766
        ('RequestHeader', 'RequestHeader'),
12767
        ('Parameters', 'RepublishParameters'),
12768
               ]
12769 1
12770
    def __init__(self):
12771
        self.TypeId = FourByteNodeId(ObjectIds.RepublishRequest_Encoding_DefaultBinary)
12772
        self.RequestHeader = RequestHeader()
12773
        self.Parameters = RepublishParameters()
12774
        self._freeze = True
12775
12776
    def to_binary(self):
12777
        packet = []
12778
        packet.append(self.TypeId.to_binary())
12779
        packet.append(self.RequestHeader.to_binary())
12780
        packet.append(self.Parameters.to_binary())
12781
        return b''.join(packet)
12782 1
12783
    @staticmethod
12784
    def from_binary(data):
12785
        obj = RepublishRequest()
12786
        obj.TypeId = NodeId.from_binary(data)
12787
        obj.RequestHeader = RequestHeader.from_binary(data)
12788
        obj.Parameters = RepublishParameters.from_binary(data)
12789
        return obj
12790
12791
    def __str__(self):
12792 1
        return 'RepublishRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12793
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12794
               'Parameters:' + str(self.Parameters) + ')'
12795
12796 1
    __repr__ = __str__
12797
12798
12799
class RepublishResponse(FrozenClass):
12800
    '''
12801
    :ivar TypeId:
12802
    :vartype TypeId: NodeId
12803
    :ivar ResponseHeader:
12804 1
    :vartype ResponseHeader: ResponseHeader
12805
    :ivar NotificationMessage:
12806
    :vartype NotificationMessage: NotificationMessage
12807
    '''
12808
12809
    ua_types = [
12810
        ('TypeId', 'NodeId'),
12811
        ('ResponseHeader', 'ResponseHeader'),
12812 1
        ('NotificationMessage', 'NotificationMessage'),
12813
               ]
12814
12815 1
    def __init__(self):
12816
        self.TypeId = FourByteNodeId(ObjectIds.RepublishResponse_Encoding_DefaultBinary)
12817
        self.ResponseHeader = ResponseHeader()
12818
        self.NotificationMessage = NotificationMessage()
12819
        self._freeze = True
12820
12821
    def to_binary(self):
12822
        packet = []
12823
        packet.append(self.TypeId.to_binary())
12824
        packet.append(self.ResponseHeader.to_binary())
12825 1
        packet.append(self.NotificationMessage.to_binary())
12826
        return b''.join(packet)
12827
12828
    @staticmethod
12829
    def from_binary(data):
12830
        obj = RepublishResponse()
12831 1
        obj.TypeId = NodeId.from_binary(data)
12832
        obj.ResponseHeader = ResponseHeader.from_binary(data)
12833
        obj.NotificationMessage = NotificationMessage.from_binary(data)
12834
        return obj
12835
12836
    def __str__(self):
12837
        return 'RepublishResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12838
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12839
               'NotificationMessage:' + str(self.NotificationMessage) + ')'
12840
12841 1
    __repr__ = __str__
12842
12843
12844
class TransferResult(FrozenClass):
12845
    '''
12846
    :ivar StatusCode:
12847
    :vartype StatusCode: StatusCode
12848 1
    :ivar AvailableSequenceNumbers:
12849
    :vartype AvailableSequenceNumbers: UInt32
12850
    '''
12851
12852 1
    ua_types = [
12853
        ('StatusCode', 'StatusCode'),
12854
        ('AvailableSequenceNumbers', 'ListOfUInt32'),
12855
               ]
12856
12857 1
    def __init__(self):
12858
        self.StatusCode = StatusCode()
12859
        self.AvailableSequenceNumbers = []
12860
        self._freeze = True
12861
12862 1
    def to_binary(self):
12863
        packet = []
12864
        packet.append(self.StatusCode.to_binary())
12865 1
        packet.append(uabin.Primitives.Int32.pack(len(self.AvailableSequenceNumbers)))
12866
        for fieldname in self.AvailableSequenceNumbers:
12867
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
12868
        return b''.join(packet)
12869
12870
    @staticmethod
12871
    def from_binary(data):
12872
        obj = TransferResult()
12873
        obj.StatusCode = StatusCode.from_binary(data)
12874
        obj.AvailableSequenceNumbers = uabin.Primitives.UInt32.unpack_array(data)
12875 1
        return obj
12876
12877
    def __str__(self):
12878
        return 'TransferResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
12879
               'AvailableSequenceNumbers:' + str(self.AvailableSequenceNumbers) + ')'
12880
12881 1
    __repr__ = __str__
12882
12883
12884
class TransferSubscriptionsParameters(FrozenClass):
12885
    '''
12886
    :ivar SubscriptionIds:
12887
    :vartype SubscriptionIds: UInt32
12888
    :ivar SendInitialValues:
12889
    :vartype SendInitialValues: Boolean
12890
    '''
12891 1
12892
    ua_types = [
12893
        ('SubscriptionIds', 'ListOfUInt32'),
12894
        ('SendInitialValues', 'Boolean'),
12895
               ]
12896
12897
    def __init__(self):
12898 1
        self.SubscriptionIds = []
12899
        self.SendInitialValues = True
12900
        self._freeze = True
12901
12902 1
    def to_binary(self):
12903
        packet = []
12904
        packet.append(uabin.Primitives.Int32.pack(len(self.SubscriptionIds)))
12905
        for fieldname in self.SubscriptionIds:
12906
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
12907 1
        packet.append(uabin.Primitives.Boolean.pack(self.SendInitialValues))
12908
        return b''.join(packet)
12909
12910
    @staticmethod
12911
    def from_binary(data):
12912 1
        obj = TransferSubscriptionsParameters()
12913
        obj.SubscriptionIds = uabin.Primitives.UInt32.unpack_array(data)
12914
        self.SendInitialValues = uabin.Primitives.Boolean.unpack(data)
12915 1
        return obj
12916
12917
    def __str__(self):
12918
        return 'TransferSubscriptionsParameters(' + 'SubscriptionIds:' + str(self.SubscriptionIds) + ', ' + \
12919
               'SendInitialValues:' + str(self.SendInitialValues) + ')'
12920
12921
    __repr__ = __str__
12922
12923
12924
class TransferSubscriptionsRequest(FrozenClass):
12925 1
    '''
12926
    :ivar TypeId:
12927
    :vartype TypeId: NodeId
12928
    :ivar RequestHeader:
12929
    :vartype RequestHeader: RequestHeader
12930
    :ivar Parameters:
12931 1
    :vartype Parameters: TransferSubscriptionsParameters
12932
    '''
12933
12934
    ua_types = [
12935
        ('TypeId', 'NodeId'),
12936
        ('RequestHeader', 'RequestHeader'),
12937
        ('Parameters', 'TransferSubscriptionsParameters'),
12938
               ]
12939
12940
    def __init__(self):
12941 1
        self.TypeId = FourByteNodeId(ObjectIds.TransferSubscriptionsRequest_Encoding_DefaultBinary)
12942
        self.RequestHeader = RequestHeader()
12943
        self.Parameters = TransferSubscriptionsParameters()
12944
        self._freeze = True
12945
12946
    def to_binary(self):
12947
        packet = []
12948 1
        packet.append(self.TypeId.to_binary())
12949
        packet.append(self.RequestHeader.to_binary())
12950
        packet.append(self.Parameters.to_binary())
12951
        return b''.join(packet)
12952 1
12953
    @staticmethod
12954
    def from_binary(data):
12955
        obj = TransferSubscriptionsRequest()
12956
        obj.TypeId = NodeId.from_binary(data)
12957 1
        obj.RequestHeader = RequestHeader.from_binary(data)
12958
        obj.Parameters = TransferSubscriptionsParameters.from_binary(data)
12959
        return obj
12960
12961
    def __str__(self):
12962 1
        return 'TransferSubscriptionsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12963
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12964
               'Parameters:' + str(self.Parameters) + ')'
12965 1
12966
    __repr__ = __str__
12967
12968
12969
class TransferSubscriptionsResult(FrozenClass):
12970
    '''
12971
    :ivar Results:
12972
    :vartype Results: TransferResult
12973 1
    :ivar DiagnosticInfos:
12974
    :vartype DiagnosticInfos: DiagnosticInfo
12975
    '''
12976
12977
    ua_types = [
12978 1
        ('Results', 'ListOfTransferResult'),
12979
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
12980
               ]
12981
12982
    def __init__(self):
12983
        self.Results = []
12984
        self.DiagnosticInfos = []
12985
        self._freeze = True
12986
12987 1
    def to_binary(self):
12988
        packet = []
12989
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
12990
        for fieldname in self.Results:
12991
            packet.append(fieldname.to_binary())
12992
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
12993
        for fieldname in self.DiagnosticInfos:
12994
            packet.append(fieldname.to_binary())
12995 1
        return b''.join(packet)
12996
12997
    @staticmethod
12998
    def from_binary(data):
12999 1
        obj = TransferSubscriptionsResult()
13000
        length = uabin.Primitives.Int32.unpack(data)
13001
        array = []
13002
        if length != -1:
13003 1
            for _ in range(0, length):
13004
                array.append(TransferResult.from_binary(data))
13005
        obj.Results = array
13006
        length = uabin.Primitives.Int32.unpack(data)
13007 1
        array = []
13008
        if length != -1:
13009
            for _ in range(0, length):
13010 1
                array.append(DiagnosticInfo.from_binary(data))
13011
        obj.DiagnosticInfos = array
13012
        return obj
13013
13014
    def __str__(self):
13015
        return 'TransferSubscriptionsResult(' + 'Results:' + str(self.Results) + ', ' + \
13016
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
13017
13018
    __repr__ = __str__
13019
13020 1
13021
class TransferSubscriptionsResponse(FrozenClass):
13022
    '''
13023
    :ivar TypeId:
13024
    :vartype TypeId: NodeId
13025
    :ivar ResponseHeader:
13026 1
    :vartype ResponseHeader: ResponseHeader
13027
    :ivar Parameters:
13028
    :vartype Parameters: TransferSubscriptionsResult
13029
    '''
13030
13031
    ua_types = [
13032
        ('TypeId', 'NodeId'),
13033
        ('ResponseHeader', 'ResponseHeader'),
13034
        ('Parameters', 'TransferSubscriptionsResult'),
13035
               ]
13036 1
13037
    def __init__(self):
13038
        self.TypeId = FourByteNodeId(ObjectIds.TransferSubscriptionsResponse_Encoding_DefaultBinary)
13039
        self.ResponseHeader = ResponseHeader()
13040
        self.Parameters = TransferSubscriptionsResult()
13041
        self._freeze = True
13042
13043 1
    def to_binary(self):
13044
        packet = []
13045
        packet.append(self.TypeId.to_binary())
13046
        packet.append(self.ResponseHeader.to_binary())
13047 1
        packet.append(self.Parameters.to_binary())
13048
        return b''.join(packet)
13049
13050
    @staticmethod
13051
    def from_binary(data):
13052 1
        obj = TransferSubscriptionsResponse()
13053
        obj.TypeId = NodeId.from_binary(data)
13054
        obj.ResponseHeader = ResponseHeader.from_binary(data)
13055
        obj.Parameters = TransferSubscriptionsResult.from_binary(data)
13056
        return obj
13057 1
13058
    def __str__(self):
13059
        return 'TransferSubscriptionsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13060 1
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
13061
               'Parameters:' + str(self.Parameters) + ')'
13062
13063
    __repr__ = __str__
13064
13065
13066
class DeleteSubscriptionsParameters(FrozenClass):
13067
    '''
13068 1
    :ivar SubscriptionIds:
13069
    :vartype SubscriptionIds: UInt32
13070
    '''
13071
13072
    ua_types = [
13073 1
        ('SubscriptionIds', 'ListOfUInt32'),
13074
               ]
13075
13076
    def __init__(self):
13077
        self.SubscriptionIds = []
13078
        self._freeze = True
13079
13080
    def to_binary(self):
13081
        packet = []
13082 1
        packet.append(uabin.Primitives.Int32.pack(len(self.SubscriptionIds)))
13083
        for fieldname in self.SubscriptionIds:
13084
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
13085
        return b''.join(packet)
13086
13087
    @staticmethod
13088
    def from_binary(data):
13089
        obj = DeleteSubscriptionsParameters()
13090
        obj.SubscriptionIds = uabin.Primitives.UInt32.unpack_array(data)
13091
        return obj
13092 1
13093
    def __str__(self):
13094
        return 'DeleteSubscriptionsParameters(' + 'SubscriptionIds:' + str(self.SubscriptionIds) + ')'
13095
13096 1
    __repr__ = __str__
13097
13098
13099
class DeleteSubscriptionsRequest(FrozenClass):
13100
    '''
13101
    :ivar TypeId:
13102
    :vartype TypeId: NodeId
13103
    :ivar RequestHeader:
13104
    :vartype RequestHeader: RequestHeader
13105
    :ivar Parameters:
13106
    :vartype Parameters: DeleteSubscriptionsParameters
13107
    '''
13108
13109
    ua_types = [
13110 1
        ('TypeId', 'NodeId'),
13111
        ('RequestHeader', 'RequestHeader'),
13112
        ('Parameters', 'DeleteSubscriptionsParameters'),
13113
               ]
13114 1
13115
    def __init__(self):
13116
        self.TypeId = FourByteNodeId(ObjectIds.DeleteSubscriptionsRequest_Encoding_DefaultBinary)
13117 1
        self.RequestHeader = RequestHeader()
13118
        self.Parameters = DeleteSubscriptionsParameters()
13119
        self._freeze = True
13120
13121
    def to_binary(self):
13122
        packet = []
13123
        packet.append(self.TypeId.to_binary())
13124
        packet.append(self.RequestHeader.to_binary())
13125
        packet.append(self.Parameters.to_binary())
13126
        return b''.join(packet)
13127 1
13128
    @staticmethod
13129
    def from_binary(data):
13130
        obj = DeleteSubscriptionsRequest()
13131
        obj.TypeId = NodeId.from_binary(data)
13132
        obj.RequestHeader = RequestHeader.from_binary(data)
13133 1
        obj.Parameters = DeleteSubscriptionsParameters.from_binary(data)
13134
        return obj
13135
13136
    def __str__(self):
13137
        return 'DeleteSubscriptionsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13138
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
13139
               'Parameters:' + str(self.Parameters) + ')'
13140
13141
    __repr__ = __str__
13142
13143 1
13144
class DeleteSubscriptionsResponse(FrozenClass):
13145
    '''
13146
    :ivar TypeId:
13147
    :vartype TypeId: NodeId
13148
    :ivar ResponseHeader:
13149
    :vartype ResponseHeader: ResponseHeader
13150 1
    :ivar Results:
13151
    :vartype Results: StatusCode
13152
    :ivar DiagnosticInfos:
13153
    :vartype DiagnosticInfos: DiagnosticInfo
13154 1
    '''
13155
13156
    ua_types = [
13157
        ('TypeId', 'NodeId'),
13158
        ('ResponseHeader', 'ResponseHeader'),
13159 1
        ('Results', 'ListOfStatusCode'),
13160
        ('DiagnosticInfos', 'ListOfDiagnosticInfo'),
13161
               ]
13162
13163
    def __init__(self):
13164 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteSubscriptionsResponse_Encoding_DefaultBinary)
13165
        self.ResponseHeader = ResponseHeader()
13166
        self.Results = []
13167 1
        self.DiagnosticInfos = []
13168
        self._freeze = True
13169
13170
    def to_binary(self):
13171
        packet = []
13172
        packet.append(self.TypeId.to_binary())
13173
        packet.append(self.ResponseHeader.to_binary())
13174
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
13175
        for fieldname in self.Results:
13176
            packet.append(fieldname.to_binary())
13177 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
13178
        for fieldname in self.DiagnosticInfos:
13179
            packet.append(fieldname.to_binary())
13180
        return b''.join(packet)
13181
13182
    @staticmethod
13183 1
    def from_binary(data):
13184 1
        obj = DeleteSubscriptionsResponse()
13185 1
        obj.TypeId = NodeId.from_binary(data)
13186 1
        obj.ResponseHeader = ResponseHeader.from_binary(data)
13187 1
        length = uabin.Primitives.Int32.unpack(data)
13188 1
        array = []
13189 1
        if length != -1:
13190 1
            for _ in range(0, length):
13191 1
                array.append(StatusCode.from_binary(data))
13192
        obj.Results = array
13193 1
        length = uabin.Primitives.Int32.unpack(data)
13194 1
        array = []
13195 1
        if length != -1:
13196 1
            for _ in range(0, length):
13197 1
                array.append(DiagnosticInfo.from_binary(data))
13198 1
        obj.DiagnosticInfos = array
13199 1
        return obj
13200 1
13201
    def __str__(self):
13202 1
        return 'DeleteSubscriptionsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13203
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
13204 1
               'Results:' + str(self.Results) + ', ' + \
13205
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
13206 1
13207 1
    __repr__ = __str__
13208 1
13209 1
13210 1
class BuildInfo(FrozenClass):
13211 1
    '''
13212 1
    :ivar ProductUri:
13213 1
    :vartype ProductUri: String
13214 1
    :ivar ManufacturerName:
13215
    :vartype ManufacturerName: String
13216 1
    :ivar ProductName:
13217
    :vartype ProductName: String
13218
    :ivar SoftwareVersion:
13219
    :vartype SoftwareVersion: String
13220
    :ivar BuildNumber:
13221 1
    :vartype BuildNumber: String
13222
    :ivar BuildDate:
13223
    :vartype BuildDate: DateTime
13224 1
    '''
13225
13226
    ua_types = [
13227
        ('ProductUri', 'String'),
13228 1
        ('ManufacturerName', 'String'),
13229
        ('ProductName', 'String'),
13230
        ('SoftwareVersion', 'String'),
13231 1
        ('BuildNumber', 'String'),
13232
        ('BuildDate', 'DateTime'),
13233
               ]
13234
13235
    def __init__(self):
13236
        self.ProductUri = None
13237
        self.ManufacturerName = None
13238 1
        self.ProductName = None
13239
        self.SoftwareVersion = None
13240
        self.BuildNumber = None
13241
        self.BuildDate = datetime.utcnow()
13242 1
        self._freeze = True
13243
13244
    def to_binary(self):
13245
        packet = []
13246 1
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
13247
        packet.append(uabin.Primitives.String.pack(self.ManufacturerName))
13248
        packet.append(uabin.Primitives.String.pack(self.ProductName))
13249 1
        packet.append(uabin.Primitives.String.pack(self.SoftwareVersion))
13250
        packet.append(uabin.Primitives.String.pack(self.BuildNumber))
13251
        packet.append(uabin.Primitives.DateTime.pack(self.BuildDate))
13252 1
        return b''.join(packet)
13253
13254
    @staticmethod
13255 1
    def from_binary(data):
13256
        obj = BuildInfo()
13257
        self.ProductUri = uabin.Primitives.String.unpack(data)
13258
        self.ManufacturerName = uabin.Primitives.String.unpack(data)
13259
        self.ProductName = uabin.Primitives.String.unpack(data)
13260
        self.SoftwareVersion = uabin.Primitives.String.unpack(data)
13261
        self.BuildNumber = uabin.Primitives.String.unpack(data)
13262
        self.BuildDate = uabin.Primitives.DateTime.unpack(data)
13263 1
        return obj
13264
13265
    def __str__(self):
13266
        return 'BuildInfo(' + 'ProductUri:' + str(self.ProductUri) + ', ' + \
13267
               'ManufacturerName:' + str(self.ManufacturerName) + ', ' + \
13268 1
               'ProductName:' + str(self.ProductName) + ', ' + \
13269 1
               'SoftwareVersion:' + str(self.SoftwareVersion) + ', ' + \
13270 1
               'BuildNumber:' + str(self.BuildNumber) + ', ' + \
13271 1
               'BuildDate:' + str(self.BuildDate) + ')'
13272 1
13273 1
    __repr__ = __str__
13274 1
13275 1
13276
class RedundantServerDataType(FrozenClass):
13277 1
    '''
13278 1
    :ivar ServerId:
13279 1
    :vartype ServerId: String
13280 1
    :ivar ServiceLevel:
13281 1
    :vartype ServiceLevel: Byte
13282 1
    :ivar ServerState:
13283 1
    :vartype ServerState: ServerState
13284
    '''
13285 1
13286
    ua_types = [
13287 1
        ('ServerId', 'String'),
13288
        ('ServiceLevel', 'Byte'),
13289 1
        ('ServerState', 'ServerState'),
13290
               ]
13291 1
13292 1
    def __init__(self):
13293 1
        self.ServerId = None
13294 1
        self.ServiceLevel = 0
13295 1
        self.ServerState = ServerState(0)
13296 1
        self._freeze = True
13297 1
13298 1
    def to_binary(self):
13299 1
        packet = []
13300 1
        packet.append(uabin.Primitives.String.pack(self.ServerId))
13301 1
        packet.append(uabin.Primitives.Byte.pack(self.ServiceLevel))
13302
        packet.append(uabin.Primitives.UInt32.pack(self.ServerState.value))
13303 1
        return b''.join(packet)
13304
13305 1
    @staticmethod
13306
    def from_binary(data):
13307
        obj = RedundantServerDataType()
13308
        self.ServerId = uabin.Primitives.String.unpack(data)
13309 1
        self.ServiceLevel = uabin.Primitives.Byte.unpack(data)
13310
        self.ServerState = ServerState(uabin.Primitives.UInt32.unpack(data))
13311
        return obj
13312 1
13313
    def __str__(self):
13314
        return 'RedundantServerDataType(' + 'ServerId:' + str(self.ServerId) + ', ' + \
13315
               'ServiceLevel:' + str(self.ServiceLevel) + ', ' + \
13316
               'ServerState:' + str(self.ServerState) + ')'
13317
13318
    __repr__ = __str__
13319
13320 1
13321
class EndpointUrlListDataType(FrozenClass):
13322
    '''
13323
    :ivar EndpointUrlList:
13324
    :vartype EndpointUrlList: String
13325 1
    '''
13326 1
13327 1
    ua_types = [
13328 1
        ('EndpointUrlList', 'ListOfString'),
13329 1
               ]
13330 1
13331 1
    def __init__(self):
13332 1
        self.EndpointUrlList = []
13333
        self._freeze = True
13334 1
13335 1
    def to_binary(self):
13336 1
        packet = []
13337 1
        packet.append(uabin.Primitives.Int32.pack(len(self.EndpointUrlList)))
13338 1
        for fieldname in self.EndpointUrlList:
13339
            packet.append(uabin.Primitives.String.pack(fieldname))
13340 1
        return b''.join(packet)
13341
13342 1
    @staticmethod
13343
    def from_binary(data):
13344 1
        obj = EndpointUrlListDataType()
13345 1
        obj.EndpointUrlList = uabin.Primitives.String.unpack_array(data)
13346 1
        return obj
13347
13348 1
    def __str__(self):
13349
        return 'EndpointUrlListDataType(' + 'EndpointUrlList:' + str(self.EndpointUrlList) + ')'
13350
13351
    __repr__ = __str__
13352 1
13353
13354
class NetworkGroupDataType(FrozenClass):
13355 1
    '''
13356
    :ivar ServerUri:
13357
    :vartype ServerUri: String
13358
    :ivar NetworkPaths:
13359
    :vartype NetworkPaths: EndpointUrlListDataType
13360
    '''
13361 1
13362
    ua_types = [
13363
        ('ServerUri', 'String'),
13364
        ('NetworkPaths', 'ListOfEndpointUrlListDataType'),
13365 1
               ]
13366 1
13367 1
    def __init__(self):
13368 1
        self.ServerUri = None
13369 1
        self.NetworkPaths = []
13370 1
        self._freeze = True
13371 1
13372
    def to_binary(self):
13373 1
        packet = []
13374 1
        packet.append(uabin.Primitives.String.pack(self.ServerUri))
13375 1
        packet.append(uabin.Primitives.Int32.pack(len(self.NetworkPaths)))
13376 1
        for fieldname in self.NetworkPaths:
13377 1
            packet.append(fieldname.to_binary())
13378 1
        return b''.join(packet)
13379
13380 1
    @staticmethod
13381
    def from_binary(data):
13382 1
        obj = NetworkGroupDataType()
13383
        self.ServerUri = uabin.Primitives.String.unpack(data)
13384 1
        length = uabin.Primitives.Int32.unpack(data)
13385 1
        array = []
13386 1
        if length != -1:
13387 1
            for _ in range(0, length):
13388 1
                array.append(EndpointUrlListDataType.from_binary(data))
13389 1
        obj.NetworkPaths = array
13390 1
        return obj
13391
13392 1
    def __str__(self):
13393
        return 'NetworkGroupDataType(' + 'ServerUri:' + str(self.ServerUri) + ', ' + \
13394
               'NetworkPaths:' + str(self.NetworkPaths) + ')'
13395 1
13396
    __repr__ = __str__
13397
13398 1
13399
class SamplingIntervalDiagnosticsDataType(FrozenClass):
13400
    '''
13401
    :ivar SamplingInterval:
13402
    :vartype SamplingInterval: Double
13403
    :ivar MonitoredItemCount:
13404
    :vartype MonitoredItemCount: UInt32
13405
    :ivar MaxMonitoredItemCount:
13406 1
    :vartype MaxMonitoredItemCount: UInt32
13407
    :ivar DisabledMonitoredItemCount:
13408
    :vartype DisabledMonitoredItemCount: UInt32
13409
    '''
13410
13411 1
    ua_types = [
13412 1
        ('SamplingInterval', 'Double'),
13413 1
        ('MonitoredItemCount', 'UInt32'),
13414 1
        ('MaxMonitoredItemCount', 'UInt32'),
13415 1
        ('DisabledMonitoredItemCount', 'UInt32'),
13416 1
               ]
13417 1
13418 1
    def __init__(self):
13419
        self.SamplingInterval = 0
13420 1
        self.MonitoredItemCount = 0
13421 1
        self.MaxMonitoredItemCount = 0
13422 1
        self.DisabledMonitoredItemCount = 0
13423 1
        self._freeze = True
13424 1
13425 1
    def to_binary(self):
13426 1
        packet = []
13427
        packet.append(uabin.Primitives.Double.pack(self.SamplingInterval))
13428 1
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoredItemCount))
13429
        packet.append(uabin.Primitives.UInt32.pack(self.MaxMonitoredItemCount))
13430 1
        packet.append(uabin.Primitives.UInt32.pack(self.DisabledMonitoredItemCount))
13431
        return b''.join(packet)
13432 1
13433 1
    @staticmethod
13434 1
    def from_binary(data):
13435 1
        obj = SamplingIntervalDiagnosticsDataType()
13436 1
        self.SamplingInterval = uabin.Primitives.Double.unpack(data)
13437 1
        self.MonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
13438 1
        self.MaxMonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
13439 1
        self.DisabledMonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
13440
        return obj
13441 1
13442
    def __str__(self):
13443
        return 'SamplingIntervalDiagnosticsDataType(' + 'SamplingInterval:' + str(self.SamplingInterval) + ', ' + \
13444
               'MonitoredItemCount:' + str(self.MonitoredItemCount) + ', ' + \
13445 1
               'MaxMonitoredItemCount:' + str(self.MaxMonitoredItemCount) + ', ' + \
13446
               'DisabledMonitoredItemCount:' + str(self.DisabledMonitoredItemCount) + ')'
13447
13448 1
    __repr__ = __str__
13449
13450
13451
class ServerDiagnosticsSummaryDataType(FrozenClass):
13452
    '''
13453
    :ivar ServerViewCount:
13454 1
    :vartype ServerViewCount: UInt32
13455
    :ivar CurrentSessionCount:
13456
    :vartype CurrentSessionCount: UInt32
13457
    :ivar CumulatedSessionCount:
13458 1
    :vartype CumulatedSessionCount: UInt32
13459 1
    :ivar SecurityRejectedSessionCount:
13460
    :vartype SecurityRejectedSessionCount: UInt32
13461
    :ivar RejectedSessionCount:
13462
    :vartype RejectedSessionCount: UInt32
13463 1 View Code Duplication
    :ivar SessionTimeoutCount:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13464 1
    :vartype SessionTimeoutCount: UInt32
13465
    :ivar SessionAbortCount:
13466 1
    :vartype SessionAbortCount: UInt32
13467
    :ivar CurrentSubscriptionCount:
13468
    :vartype CurrentSubscriptionCount: UInt32
13469
    :ivar CumulatedSubscriptionCount:
13470
    :vartype CumulatedSubscriptionCount: UInt32
13471
    :ivar PublishingIntervalCount:
13472
    :vartype PublishingIntervalCount: UInt32
13473 1
    :ivar SecurityRejectedRequestsCount:
13474
    :vartype SecurityRejectedRequestsCount: UInt32
13475
    :ivar RejectedRequestsCount:
13476
    :vartype RejectedRequestsCount: UInt32
13477 1
    '''
13478
13479
    ua_types = [
13480
        ('ServerViewCount', 'UInt32'),
13481
        ('CurrentSessionCount', 'UInt32'),
13482
        ('CumulatedSessionCount', 'UInt32'),
13483
        ('SecurityRejectedSessionCount', 'UInt32'),
13484
        ('RejectedSessionCount', 'UInt32'),
13485 1
        ('SessionTimeoutCount', 'UInt32'),
13486
        ('SessionAbortCount', 'UInt32'),
13487
        ('CurrentSubscriptionCount', 'UInt32'),
13488 1
        ('CumulatedSubscriptionCount', 'UInt32'),
13489
        ('PublishingIntervalCount', 'UInt32'),
13490
        ('SecurityRejectedRequestsCount', 'UInt32'),
13491 1
        ('RejectedRequestsCount', 'UInt32'),
13492
               ]
13493
13494
    def __init__(self):
13495
        self.ServerViewCount = 0
13496
        self.CurrentSessionCount = 0
13497
        self.CumulatedSessionCount = 0
13498
        self.SecurityRejectedSessionCount = 0
13499 1
        self.RejectedSessionCount = 0
13500
        self.SessionTimeoutCount = 0
13501
        self.SessionAbortCount = 0
13502
        self.CurrentSubscriptionCount = 0
13503
        self.CumulatedSubscriptionCount = 0
13504 1
        self.PublishingIntervalCount = 0
13505
        self.SecurityRejectedRequestsCount = 0
13506
        self.RejectedRequestsCount = 0
13507
        self._freeze = True
13508
13509
    def to_binary(self):
13510
        packet = []
13511
        packet.append(uabin.Primitives.UInt32.pack(self.ServerViewCount))
13512
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentSessionCount))
13513 1
        packet.append(uabin.Primitives.UInt32.pack(self.CumulatedSessionCount))
13514
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityRejectedSessionCount))
13515
        packet.append(uabin.Primitives.UInt32.pack(self.RejectedSessionCount))
13516
        packet.append(uabin.Primitives.UInt32.pack(self.SessionTimeoutCount))
13517
        packet.append(uabin.Primitives.UInt32.pack(self.SessionAbortCount))
13518
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentSubscriptionCount))
13519 1
        packet.append(uabin.Primitives.UInt32.pack(self.CumulatedSubscriptionCount))
13520
        packet.append(uabin.Primitives.UInt32.pack(self.PublishingIntervalCount))
13521
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityRejectedRequestsCount))
13522
        packet.append(uabin.Primitives.UInt32.pack(self.RejectedRequestsCount))
13523 1
        return b''.join(packet)
13524
13525
    @staticmethod
13526
    def from_binary(data):
13527 1
        obj = ServerDiagnosticsSummaryDataType()
13528
        self.ServerViewCount = uabin.Primitives.UInt32.unpack(data)
13529
        self.CurrentSessionCount = uabin.Primitives.UInt32.unpack(data)
13530
        self.CumulatedSessionCount = uabin.Primitives.UInt32.unpack(data)
13531 1
        self.SecurityRejectedSessionCount = uabin.Primitives.UInt32.unpack(data)
13532
        self.RejectedSessionCount = uabin.Primitives.UInt32.unpack(data)
13533
        self.SessionTimeoutCount = uabin.Primitives.UInt32.unpack(data)
13534 1
        self.SessionAbortCount = uabin.Primitives.UInt32.unpack(data)
13535
        self.CurrentSubscriptionCount = uabin.Primitives.UInt32.unpack(data)
13536
        self.CumulatedSubscriptionCount = uabin.Primitives.UInt32.unpack(data)
13537
        self.PublishingIntervalCount = uabin.Primitives.UInt32.unpack(data)
13538
        self.SecurityRejectedRequestsCount = uabin.Primitives.UInt32.unpack(data)
13539
        self.RejectedRequestsCount = uabin.Primitives.UInt32.unpack(data)
13540
        return obj
13541
13542 1
    def __str__(self):
13543
        return 'ServerDiagnosticsSummaryDataType(' + 'ServerViewCount:' + str(self.ServerViewCount) + ', ' + \
13544
               'CurrentSessionCount:' + str(self.CurrentSessionCount) + ', ' + \
13545
               'CumulatedSessionCount:' + str(self.CumulatedSessionCount) + ', ' + \
13546
               'SecurityRejectedSessionCount:' + str(self.SecurityRejectedSessionCount) + ', ' + \
13547 1
               'RejectedSessionCount:' + str(self.RejectedSessionCount) + ', ' + \
13548 1
               'SessionTimeoutCount:' + str(self.SessionTimeoutCount) + ', ' + \
13549 1
               'SessionAbortCount:' + str(self.SessionAbortCount) + ', ' + \
13550 1
               'CurrentSubscriptionCount:' + str(self.CurrentSubscriptionCount) + ', ' + \
13551 1
               'CumulatedSubscriptionCount:' + str(self.CumulatedSubscriptionCount) + ', ' + \
13552 1
               'PublishingIntervalCount:' + str(self.PublishingIntervalCount) + ', ' + \
13553 1
               'SecurityRejectedRequestsCount:' + str(self.SecurityRejectedRequestsCount) + ', ' + \
13554 1
               'RejectedRequestsCount:' + str(self.RejectedRequestsCount) + ')'
13555
13556 1
    __repr__ = __str__
13557 1
13558 1
13559 1
class ServerStatusDataType(FrozenClass):
13560 1
    '''
13561
    :ivar StartTime:
13562 1
    :vartype StartTime: DateTime
13563
    :ivar CurrentTime:
13564 1
    :vartype CurrentTime: DateTime
13565
    :ivar State:
13566 1
    :vartype State: ServerState
13567 1
    :ivar BuildInfo:
13568 1
    :vartype BuildInfo: BuildInfo
13569
    :ivar SecondsTillShutdown:
13570 1
    :vartype SecondsTillShutdown: UInt32
13571
    :ivar ShutdownReason:
13572
    :vartype ShutdownReason: LocalizedText
13573
    '''
13574 1
13575
    ua_types = [
13576
        ('StartTime', 'DateTime'),
13577 1
        ('CurrentTime', 'DateTime'),
13578
        ('State', 'ServerState'),
13579
        ('BuildInfo', 'BuildInfo'),
13580
        ('SecondsTillShutdown', 'UInt32'),
13581
        ('ShutdownReason', 'LocalizedText'),
13582
               ]
13583 1
13584
    def __init__(self):
13585
        self.StartTime = datetime.utcnow()
13586
        self.CurrentTime = datetime.utcnow()
13587 1
        self.State = ServerState(0)
13588 1
        self.BuildInfo = BuildInfo()
13589 1
        self.SecondsTillShutdown = 0
13590 1
        self.ShutdownReason = LocalizedText()
13591 1
        self._freeze = True
13592 1
13593 1
    def to_binary(self):
13594
        packet = []
13595 1
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
13596 1
        packet.append(uabin.Primitives.DateTime.pack(self.CurrentTime))
13597 1
        packet.append(uabin.Primitives.UInt32.pack(self.State.value))
13598 1
        packet.append(self.BuildInfo.to_binary())
13599 1
        packet.append(uabin.Primitives.UInt32.pack(self.SecondsTillShutdown))
13600 1
        packet.append(self.ShutdownReason.to_binary())
13601
        return b''.join(packet)
13602 1
13603
    @staticmethod
13604 1
    def from_binary(data):
13605
        obj = ServerStatusDataType()
13606 1
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
13607 1
        self.CurrentTime = uabin.Primitives.DateTime.unpack(data)
13608 1
        self.State = ServerState(uabin.Primitives.UInt32.unpack(data))
13609 1
        obj.BuildInfo = BuildInfo.from_binary(data)
13610 1
        self.SecondsTillShutdown = uabin.Primitives.UInt32.unpack(data)
13611 1
        obj.ShutdownReason = LocalizedText.from_binary(data)
13612 1
        return obj
13613
13614 1
    def __str__(self):
13615
        return 'ServerStatusDataType(' + 'StartTime:' + str(self.StartTime) + ', ' + \
13616
               'CurrentTime:' + str(self.CurrentTime) + ', ' + \
13617 1
               'State:' + str(self.State) + ', ' + \
13618
               'BuildInfo:' + str(self.BuildInfo) + ', ' + \
13619
               'SecondsTillShutdown:' + str(self.SecondsTillShutdown) + ', ' + \
13620 1
               'ShutdownReason:' + str(self.ShutdownReason) + ')'
13621
13622
    __repr__ = __str__
13623
13624
13625
class SessionDiagnosticsDataType(FrozenClass):
13626
    '''
13627
    :ivar SessionId:
13628
    :vartype SessionId: NodeId
13629
    :ivar SessionName:
13630 1
    :vartype SessionName: String
13631
    :ivar ClientDescription:
13632
    :vartype ClientDescription: ApplicationDescription
13633
    :ivar ServerUri:
13634
    :vartype ServerUri: String
13635
    :ivar EndpointUrl:
13636 1
    :vartype EndpointUrl: String
13637 1
    :ivar LocaleIds:
13638
    :vartype LocaleIds: String
13639
    :ivar ActualSessionTimeout:
13640
    :vartype ActualSessionTimeout: Double
13641 1
    :ivar MaxResponseMessageSize:
13642 1
    :vartype MaxResponseMessageSize: UInt32
13643 1
    :ivar ClientConnectionTime:
13644 1
    :vartype ClientConnectionTime: DateTime
13645
    :ivar ClientLastContactTime:
13646 1
    :vartype ClientLastContactTime: DateTime
13647 1
    :ivar CurrentSubscriptionsCount:
13648 1
    :vartype CurrentSubscriptionsCount: UInt32
13649 1
    :ivar CurrentMonitoredItemsCount:
13650 1
    :vartype CurrentMonitoredItemsCount: UInt32
13651 1
    :ivar CurrentPublishRequestsInQueue:
13652
    :vartype CurrentPublishRequestsInQueue: UInt32
13653 1
    :ivar TotalRequestCount:
13654
    :vartype TotalRequestCount: ServiceCounterDataType
13655
    :ivar UnauthorizedRequestCount:
13656
    :vartype UnauthorizedRequestCount: UInt32
13657 1
    :ivar ReadCount:
13658
    :vartype ReadCount: ServiceCounterDataType
13659
    :ivar HistoryReadCount:
13660
    :vartype HistoryReadCount: ServiceCounterDataType
13661
    :ivar WriteCount:
13662 1
    :vartype WriteCount: ServiceCounterDataType
13663
    :ivar HistoryUpdateCount:
13664
    :vartype HistoryUpdateCount: ServiceCounterDataType
13665
    :ivar CallCount:
13666
    :vartype CallCount: ServiceCounterDataType
13667 1
    :ivar CreateMonitoredItemsCount:
13668
    :vartype CreateMonitoredItemsCount: ServiceCounterDataType
13669
    :ivar ModifyMonitoredItemsCount:
13670 1
    :vartype ModifyMonitoredItemsCount: ServiceCounterDataType
13671
    :ivar SetMonitoringModeCount:
13672
    :vartype SetMonitoringModeCount: ServiceCounterDataType
13673
    :ivar SetTriggeringCount:
13674
    :vartype SetTriggeringCount: ServiceCounterDataType
13675
    :ivar DeleteMonitoredItemsCount:
13676
    :vartype DeleteMonitoredItemsCount: ServiceCounterDataType
13677
    :ivar CreateSubscriptionCount:
13678
    :vartype CreateSubscriptionCount: ServiceCounterDataType
13679
    :ivar ModifySubscriptionCount:
13680
    :vartype ModifySubscriptionCount: ServiceCounterDataType
13681
    :ivar SetPublishingModeCount:
13682
    :vartype SetPublishingModeCount: ServiceCounterDataType
13683
    :ivar PublishCount:
13684
    :vartype PublishCount: ServiceCounterDataType
13685
    :ivar RepublishCount:
13686 1
    :vartype RepublishCount: ServiceCounterDataType
13687
    :ivar TransferSubscriptionsCount:
13688
    :vartype TransferSubscriptionsCount: ServiceCounterDataType
13689
    :ivar DeleteSubscriptionsCount:
13690
    :vartype DeleteSubscriptionsCount: ServiceCounterDataType
13691
    :ivar AddNodesCount:
13692
    :vartype AddNodesCount: ServiceCounterDataType
13693
    :ivar AddReferencesCount:
13694
    :vartype AddReferencesCount: ServiceCounterDataType
13695 1
    :ivar DeleteNodesCount:
13696 1
    :vartype DeleteNodesCount: ServiceCounterDataType
13697 1
    :ivar DeleteReferencesCount:
13698 1
    :vartype DeleteReferencesCount: ServiceCounterDataType
13699 1
    :ivar BrowseCount:
13700 1
    :vartype BrowseCount: ServiceCounterDataType
13701 1
    :ivar BrowseNextCount:
13702 1
    :vartype BrowseNextCount: ServiceCounterDataType
13703 1
    :ivar TranslateBrowsePathsToNodeIdsCount:
13704 1
    :vartype TranslateBrowsePathsToNodeIdsCount: ServiceCounterDataType
13705 1
    :ivar QueryFirstCount:
13706 1
    :vartype QueryFirstCount: ServiceCounterDataType
13707
    :ivar QueryNextCount:
13708 1
    :vartype QueryNextCount: ServiceCounterDataType
13709 1
    :ivar RegisterNodesCount:
13710 1
    :vartype RegisterNodesCount: ServiceCounterDataType
13711 1
    :ivar UnregisterNodesCount:
13712 1
    :vartype UnregisterNodesCount: ServiceCounterDataType
13713 1
    '''
13714 1
13715 1
    ua_types = [
13716 1
        ('SessionId', 'NodeId'),
13717 1
        ('SessionName', 'String'),
13718
        ('ClientDescription', 'ApplicationDescription'),
13719 1
        ('ServerUri', 'String'),
13720 1
        ('EndpointUrl', 'String'),
13721
        ('LocaleIds', 'ListOfString'),
13722 1
        ('ActualSessionTimeout', 'Double'),
13723 View Code Duplication
        ('MaxResponseMessageSize', 'UInt32'),
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13724 1
        ('ClientConnectionTime', 'DateTime'),
13725
        ('ClientLastContactTime', 'DateTime'),
13726 1
        ('CurrentSubscriptionsCount', 'UInt32'),
13727
        ('CurrentMonitoredItemsCount', 'UInt32'),
13728 1
        ('CurrentPublishRequestsInQueue', 'UInt32'),
13729 1
        ('TotalRequestCount', 'ServiceCounterDataType'),
13730 1
        ('UnauthorizedRequestCount', 'UInt32'),
13731 1
        ('ReadCount', 'ServiceCounterDataType'),
13732 1
        ('HistoryReadCount', 'ServiceCounterDataType'),
13733 1
        ('WriteCount', 'ServiceCounterDataType'),
13734 1
        ('HistoryUpdateCount', 'ServiceCounterDataType'),
13735 1
        ('CallCount', 'ServiceCounterDataType'),
13736 1
        ('CreateMonitoredItemsCount', 'ServiceCounterDataType'),
13737
        ('ModifyMonitoredItemsCount', 'ServiceCounterDataType'),
13738 1
        ('SetMonitoringModeCount', 'ServiceCounterDataType'),
13739 1
        ('SetTriggeringCount', 'ServiceCounterDataType'),
13740 1
        ('DeleteMonitoredItemsCount', 'ServiceCounterDataType'),
13741 1
        ('CreateSubscriptionCount', 'ServiceCounterDataType'),
13742 1
        ('ModifySubscriptionCount', 'ServiceCounterDataType'),
13743
        ('SetPublishingModeCount', 'ServiceCounterDataType'),
13744 1
        ('PublishCount', 'ServiceCounterDataType'),
13745
        ('RepublishCount', 'ServiceCounterDataType'),
13746 1
        ('TransferSubscriptionsCount', 'ServiceCounterDataType'),
13747
        ('DeleteSubscriptionsCount', 'ServiceCounterDataType'),
13748
        ('AddNodesCount', 'ServiceCounterDataType'),
13749
        ('AddReferencesCount', 'ServiceCounterDataType'),
13750
        ('DeleteNodesCount', 'ServiceCounterDataType'),
13751
        ('DeleteReferencesCount', 'ServiceCounterDataType'),
13752
        ('BrowseCount', 'ServiceCounterDataType'),
13753
        ('BrowseNextCount', 'ServiceCounterDataType'),
13754 1
        ('TranslateBrowsePathsToNodeIdsCount', 'ServiceCounterDataType'),
13755
        ('QueryFirstCount', 'ServiceCounterDataType'),
13756
        ('QueryNextCount', 'ServiceCounterDataType'),
13757 1 View Code Duplication
        ('RegisterNodesCount', 'ServiceCounterDataType'),
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13758
        ('UnregisterNodesCount', 'ServiceCounterDataType'),
13759
               ]
13760
13761
    def __init__(self):
13762
        self.SessionId = NodeId()
13763
        self.SessionName = None
13764
        self.ClientDescription = ApplicationDescription()
13765
        self.ServerUri = None
13766
        self.EndpointUrl = None
13767 1
        self.LocaleIds = []
13768
        self.ActualSessionTimeout = 0
13769
        self.MaxResponseMessageSize = 0
13770
        self.ClientConnectionTime = datetime.utcnow()
13771
        self.ClientLastContactTime = datetime.utcnow()
13772
        self.CurrentSubscriptionsCount = 0
13773 1
        self.CurrentMonitoredItemsCount = 0
13774 1
        self.CurrentPublishRequestsInQueue = 0
13775 1
        self.TotalRequestCount = ServiceCounterDataType()
13776 1
        self.UnauthorizedRequestCount = 0
13777 1
        self.ReadCount = ServiceCounterDataType()
13778 1
        self.HistoryReadCount = ServiceCounterDataType()
13779 1
        self.WriteCount = ServiceCounterDataType()
13780 1
        self.HistoryUpdateCount = ServiceCounterDataType()
13781 1
        self.CallCount = ServiceCounterDataType()
13782
        self.CreateMonitoredItemsCount = ServiceCounterDataType()
13783 1
        self.ModifyMonitoredItemsCount = ServiceCounterDataType()
13784 1
        self.SetMonitoringModeCount = ServiceCounterDataType()
13785 1
        self.SetTriggeringCount = ServiceCounterDataType()
13786 1
        self.DeleteMonitoredItemsCount = ServiceCounterDataType()
13787 1
        self.CreateSubscriptionCount = ServiceCounterDataType()
13788 1
        self.ModifySubscriptionCount = ServiceCounterDataType()
13789
        self.SetPublishingModeCount = ServiceCounterDataType()
13790 1
        self.PublishCount = ServiceCounterDataType()
13791
        self.RepublishCount = ServiceCounterDataType()
13792 1
        self.TransferSubscriptionsCount = ServiceCounterDataType()
13793
        self.DeleteSubscriptionsCount = ServiceCounterDataType()
13794 1
        self.AddNodesCount = ServiceCounterDataType()
13795 1
        self.AddReferencesCount = ServiceCounterDataType()
13796 1
        self.DeleteNodesCount = ServiceCounterDataType()
13797 1
        self.DeleteReferencesCount = ServiceCounterDataType()
13798
        self.BrowseCount = ServiceCounterDataType()
13799 1
        self.BrowseNextCount = ServiceCounterDataType()
13800
        self.TranslateBrowsePathsToNodeIdsCount = ServiceCounterDataType()
13801
        self.QueryFirstCount = ServiceCounterDataType()
13802
        self.QueryNextCount = ServiceCounterDataType()
13803 View Code Duplication
        self.RegisterNodesCount = ServiceCounterDataType()
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13804 1
        self.UnregisterNodesCount = ServiceCounterDataType()
13805
        self._freeze = True
13806
13807 1
    def to_binary(self):
13808
        packet = []
13809
        packet.append(self.SessionId.to_binary())
13810
        packet.append(uabin.Primitives.String.pack(self.SessionName))
13811
        packet.append(self.ClientDescription.to_binary())
13812
        packet.append(uabin.Primitives.String.pack(self.ServerUri))
13813
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
13814
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
13815 1
        for fieldname in self.LocaleIds:
13816
            packet.append(uabin.Primitives.String.pack(fieldname))
13817
        packet.append(uabin.Primitives.Double.pack(self.ActualSessionTimeout))
13818
        packet.append(uabin.Primitives.UInt32.pack(self.MaxResponseMessageSize))
13819
        packet.append(uabin.Primitives.DateTime.pack(self.ClientConnectionTime))
13820 1
        packet.append(uabin.Primitives.DateTime.pack(self.ClientLastContactTime))
13821
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentSubscriptionsCount))
13822
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentMonitoredItemsCount))
13823
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentPublishRequestsInQueue))
13824
        packet.append(self.TotalRequestCount.to_binary())
13825
        packet.append(uabin.Primitives.UInt32.pack(self.UnauthorizedRequestCount))
13826
        packet.append(self.ReadCount.to_binary())
13827
        packet.append(self.HistoryReadCount.to_binary())
13828
        packet.append(self.WriteCount.to_binary())
13829 1
        packet.append(self.HistoryUpdateCount.to_binary())
13830
        packet.append(self.CallCount.to_binary())
13831
        packet.append(self.CreateMonitoredItemsCount.to_binary())
13832
        packet.append(self.ModifyMonitoredItemsCount.to_binary())
13833
        packet.append(self.SetMonitoringModeCount.to_binary())
13834
        packet.append(self.SetTriggeringCount.to_binary())
13835 1
        packet.append(self.DeleteMonitoredItemsCount.to_binary())
13836
        packet.append(self.CreateSubscriptionCount.to_binary())
13837
        packet.append(self.ModifySubscriptionCount.to_binary())
13838
        packet.append(self.SetPublishingModeCount.to_binary())
13839 1
        packet.append(self.PublishCount.to_binary())
13840
        packet.append(self.RepublishCount.to_binary())
13841
        packet.append(self.TransferSubscriptionsCount.to_binary())
13842
        packet.append(self.DeleteSubscriptionsCount.to_binary())
13843 1
        packet.append(self.AddNodesCount.to_binary())
13844
        packet.append(self.AddReferencesCount.to_binary())
13845
        packet.append(self.DeleteNodesCount.to_binary())
13846
        packet.append(self.DeleteReferencesCount.to_binary())
13847 1
        packet.append(self.BrowseCount.to_binary())
13848
        packet.append(self.BrowseNextCount.to_binary())
13849
        packet.append(self.TranslateBrowsePathsToNodeIdsCount.to_binary())
13850 1
        packet.append(self.QueryFirstCount.to_binary())
13851
        packet.append(self.QueryNextCount.to_binary())
13852
        packet.append(self.RegisterNodesCount.to_binary())
13853
        packet.append(self.UnregisterNodesCount.to_binary())
13854
        return b''.join(packet)
13855
13856
    @staticmethod
13857
    def from_binary(data):
13858
        obj = SessionDiagnosticsDataType()
13859
        obj.SessionId = NodeId.from_binary(data)
13860 1
        self.SessionName = uabin.Primitives.String.unpack(data)
13861
        obj.ClientDescription = ApplicationDescription.from_binary(data)
13862
        self.ServerUri = uabin.Primitives.String.unpack(data)
13863
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
13864
        obj.LocaleIds = uabin.Primitives.String.unpack_array(data)
13865
        self.ActualSessionTimeout = uabin.Primitives.Double.unpack(data)
13866 1
        self.MaxResponseMessageSize = uabin.Primitives.UInt32.unpack(data)
13867
        self.ClientConnectionTime = uabin.Primitives.DateTime.unpack(data)
13868
        self.ClientLastContactTime = uabin.Primitives.DateTime.unpack(data)
13869
        self.CurrentSubscriptionsCount = uabin.Primitives.UInt32.unpack(data)
13870
        self.CurrentMonitoredItemsCount = uabin.Primitives.UInt32.unpack(data)
13871
        self.CurrentPublishRequestsInQueue = uabin.Primitives.UInt32.unpack(data)
13872
        obj.TotalRequestCount = ServiceCounterDataType.from_binary(data)
13873
        self.UnauthorizedRequestCount = uabin.Primitives.UInt32.unpack(data)
13874
        obj.ReadCount = ServiceCounterDataType.from_binary(data)
13875
        obj.HistoryReadCount = ServiceCounterDataType.from_binary(data)
13876 1
        obj.WriteCount = ServiceCounterDataType.from_binary(data)
13877
        obj.HistoryUpdateCount = ServiceCounterDataType.from_binary(data)
13878
        obj.CallCount = ServiceCounterDataType.from_binary(data)
13879
        obj.CreateMonitoredItemsCount = ServiceCounterDataType.from_binary(data)
13880
        obj.ModifyMonitoredItemsCount = ServiceCounterDataType.from_binary(data)
13881
        obj.SetMonitoringModeCount = ServiceCounterDataType.from_binary(data)
13882
        obj.SetTriggeringCount = ServiceCounterDataType.from_binary(data)
13883 1
        obj.DeleteMonitoredItemsCount = ServiceCounterDataType.from_binary(data)
13884
        obj.CreateSubscriptionCount = ServiceCounterDataType.from_binary(data)
13885
        obj.ModifySubscriptionCount = ServiceCounterDataType.from_binary(data)
13886
        obj.SetPublishingModeCount = ServiceCounterDataType.from_binary(data)
13887 1
        obj.PublishCount = ServiceCounterDataType.from_binary(data)
13888
        obj.RepublishCount = ServiceCounterDataType.from_binary(data)
13889
        obj.TransferSubscriptionsCount = ServiceCounterDataType.from_binary(data)
13890
        obj.DeleteSubscriptionsCount = ServiceCounterDataType.from_binary(data)
13891
        obj.AddNodesCount = ServiceCounterDataType.from_binary(data)
13892 1
        obj.AddReferencesCount = ServiceCounterDataType.from_binary(data)
13893
        obj.DeleteNodesCount = ServiceCounterDataType.from_binary(data)
13894
        obj.DeleteReferencesCount = ServiceCounterDataType.from_binary(data)
13895
        obj.BrowseCount = ServiceCounterDataType.from_binary(data)
13896
        obj.BrowseNextCount = ServiceCounterDataType.from_binary(data)
13897 1
        obj.TranslateBrowsePathsToNodeIdsCount = ServiceCounterDataType.from_binary(data)
13898
        obj.QueryFirstCount = ServiceCounterDataType.from_binary(data)
13899
        obj.QueryNextCount = ServiceCounterDataType.from_binary(data)
13900 1
        obj.RegisterNodesCount = ServiceCounterDataType.from_binary(data)
13901
        obj.UnregisterNodesCount = ServiceCounterDataType.from_binary(data)
13902
        return obj
13903
13904
    def __str__(self):
13905
        return 'SessionDiagnosticsDataType(' + 'SessionId:' + str(self.SessionId) + ', ' + \
13906
               'SessionName:' + str(self.SessionName) + ', ' + \
13907
               'ClientDescription:' + str(self.ClientDescription) + ', ' + \
13908
               'ServerUri:' + str(self.ServerUri) + ', ' + \
13909
               'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
13910 1
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
13911
               'ActualSessionTimeout:' + str(self.ActualSessionTimeout) + ', ' + \
13912
               'MaxResponseMessageSize:' + str(self.MaxResponseMessageSize) + ', ' + \
13913
               'ClientConnectionTime:' + str(self.ClientConnectionTime) + ', ' + \
13914
               'ClientLastContactTime:' + str(self.ClientLastContactTime) + ', ' + \
13915
               'CurrentSubscriptionsCount:' + str(self.CurrentSubscriptionsCount) + ', ' + \
13916 1
               'CurrentMonitoredItemsCount:' + str(self.CurrentMonitoredItemsCount) + ', ' + \
13917
               'CurrentPublishRequestsInQueue:' + str(self.CurrentPublishRequestsInQueue) + ', ' + \
13918
               'TotalRequestCount:' + str(self.TotalRequestCount) + ', ' + \
13919
               'UnauthorizedRequestCount:' + str(self.UnauthorizedRequestCount) + ', ' + \
13920
               'ReadCount:' + str(self.ReadCount) + ', ' + \
13921
               'HistoryReadCount:' + str(self.HistoryReadCount) + ', ' + \
13922
               'WriteCount:' + str(self.WriteCount) + ', ' + \
13923
               'HistoryUpdateCount:' + str(self.HistoryUpdateCount) + ', ' + \
13924
               'CallCount:' + str(self.CallCount) + ', ' + \
13925
               'CreateMonitoredItemsCount:' + str(self.CreateMonitoredItemsCount) + ', ' + \
13926 1
               'ModifyMonitoredItemsCount:' + str(self.ModifyMonitoredItemsCount) + ', ' + \
13927
               'SetMonitoringModeCount:' + str(self.SetMonitoringModeCount) + ', ' + \
13928
               'SetTriggeringCount:' + str(self.SetTriggeringCount) + ', ' + \
13929
               'DeleteMonitoredItemsCount:' + str(self.DeleteMonitoredItemsCount) + ', ' + \
13930
               'CreateSubscriptionCount:' + str(self.CreateSubscriptionCount) + ', ' + \
13931
               'ModifySubscriptionCount:' + str(self.ModifySubscriptionCount) + ', ' + \
13932
               'SetPublishingModeCount:' + str(self.SetPublishingModeCount) + ', ' + \
13933 1
               'PublishCount:' + str(self.PublishCount) + ', ' + \
13934
               'RepublishCount:' + str(self.RepublishCount) + ', ' + \
13935
               'TransferSubscriptionsCount:' + str(self.TransferSubscriptionsCount) + ', ' + \
13936
               'DeleteSubscriptionsCount:' + str(self.DeleteSubscriptionsCount) + ', ' + \
13937 1
               'AddNodesCount:' + str(self.AddNodesCount) + ', ' + \
13938
               'AddReferencesCount:' + str(self.AddReferencesCount) + ', ' + \
13939
               'DeleteNodesCount:' + str(self.DeleteNodesCount) + ', ' + \
13940
               'DeleteReferencesCount:' + str(self.DeleteReferencesCount) + ', ' + \
13941
               'BrowseCount:' + str(self.BrowseCount) + ', ' + \
13942 1
               'BrowseNextCount:' + str(self.BrowseNextCount) + ', ' + \
13943
               'TranslateBrowsePathsToNodeIdsCount:' + str(self.TranslateBrowsePathsToNodeIdsCount) + ', ' + \
13944
               'QueryFirstCount:' + str(self.QueryFirstCount) + ', ' + \
13945
               'QueryNextCount:' + str(self.QueryNextCount) + ', ' + \
13946
               'RegisterNodesCount:' + str(self.RegisterNodesCount) + ', ' + \
13947 1
               'UnregisterNodesCount:' + str(self.UnregisterNodesCount) + ')'
13948
13949
    __repr__ = __str__
13950 1
13951
13952
class SessionSecurityDiagnosticsDataType(FrozenClass):
13953
    '''
13954
    :ivar SessionId:
13955
    :vartype SessionId: NodeId
13956
    :ivar ClientUserIdOfSession:
13957
    :vartype ClientUserIdOfSession: String
13958 1
    :ivar ClientUserIdHistory:
13959
    :vartype ClientUserIdHistory: String
13960
    :ivar AuthenticationMechanism:
13961
    :vartype AuthenticationMechanism: String
13962
    :ivar Encoding:
13963 1
    :vartype Encoding: String
13964
    :ivar TransportProtocol:
13965 View Code Duplication
    :vartype TransportProtocol: String
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13966
    :ivar SecurityMode:
13967
    :vartype SecurityMode: MessageSecurityMode
13968
    :ivar SecurityPolicyUri:
13969
    :vartype SecurityPolicyUri: String
13970
    :ivar ClientCertificate:
13971
    :vartype ClientCertificate: ByteString
13972 1
    '''
13973
13974
    ua_types = [
13975
        ('SessionId', 'NodeId'),
13976
        ('ClientUserIdOfSession', 'String'),
13977
        ('ClientUserIdHistory', 'ListOfString'),
13978
        ('AuthenticationMechanism', 'String'),
13979
        ('Encoding', 'String'),
13980 1
        ('TransportProtocol', 'String'),
13981
        ('SecurityMode', 'MessageSecurityMode'),
13982
        ('SecurityPolicyUri', 'String'),
13983
        ('ClientCertificate', 'ByteString'),
13984 1
               ]
13985
13986
    def __init__(self):
13987
        self.SessionId = NodeId()
13988 1
        self.ClientUserIdOfSession = None
13989
        self.ClientUserIdHistory = []
13990
        self.AuthenticationMechanism = None
13991
        self.Encoding = None
13992 1
        self.TransportProtocol = None
13993
        self.SecurityMode = MessageSecurityMode(0)
13994
        self.SecurityPolicyUri = None
13995 1
        self.ClientCertificate = None
13996
        self._freeze = True
13997
13998
    def to_binary(self):
13999
        packet = []
14000
        packet.append(self.SessionId.to_binary())
14001
        packet.append(uabin.Primitives.String.pack(self.ClientUserIdOfSession))
14002
        packet.append(uabin.Primitives.Int32.pack(len(self.ClientUserIdHistory)))
14003 1
        for fieldname in self.ClientUserIdHistory:
14004
            packet.append(uabin.Primitives.String.pack(fieldname))
14005
        packet.append(uabin.Primitives.String.pack(self.AuthenticationMechanism))
14006
        packet.append(uabin.Primitives.String.pack(self.Encoding))
14007
        packet.append(uabin.Primitives.String.pack(self.TransportProtocol))
14008 1
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityMode.value))
14009
        packet.append(uabin.Primitives.String.pack(self.SecurityPolicyUri))
14010
        packet.append(uabin.Primitives.ByteString.pack(self.ClientCertificate))
14011
        return b''.join(packet)
14012
14013
    @staticmethod
14014
    def from_binary(data):
14015
        obj = SessionSecurityDiagnosticsDataType()
14016
        obj.SessionId = NodeId.from_binary(data)
14017 1
        self.ClientUserIdOfSession = uabin.Primitives.String.unpack(data)
14018
        obj.ClientUserIdHistory = uabin.Primitives.String.unpack_array(data)
14019
        self.AuthenticationMechanism = uabin.Primitives.String.unpack(data)
14020
        self.Encoding = uabin.Primitives.String.unpack(data)
14021
        self.TransportProtocol = uabin.Primitives.String.unpack(data)
14022
        self.SecurityMode = MessageSecurityMode(uabin.Primitives.UInt32.unpack(data))
14023
        self.SecurityPolicyUri = uabin.Primitives.String.unpack(data)
14024
        self.ClientCertificate = uabin.Primitives.ByteString.unpack(data)
14025 1
        return obj
14026
14027
    def __str__(self):
14028
        return 'SessionSecurityDiagnosticsDataType(' + 'SessionId:' + str(self.SessionId) + ', ' + \
14029 1
               'ClientUserIdOfSession:' + str(self.ClientUserIdOfSession) + ', ' + \
14030
               'ClientUserIdHistory:' + str(self.ClientUserIdHistory) + ', ' + \
14031
               'AuthenticationMechanism:' + str(self.AuthenticationMechanism) + ', ' + \
14032
               'Encoding:' + str(self.Encoding) + ', ' + \
14033 1
               'TransportProtocol:' + str(self.TransportProtocol) + ', ' + \
14034
               'SecurityMode:' + str(self.SecurityMode) + ', ' + \
14035
               'SecurityPolicyUri:' + str(self.SecurityPolicyUri) + ', ' + \
14036
               'ClientCertificate:' + str(self.ClientCertificate) + ')'
14037 1
14038
    __repr__ = __str__
14039
14040 1
14041
class ServiceCounterDataType(FrozenClass):
14042
    '''
14043
    :ivar TotalCount:
14044
    :vartype TotalCount: UInt32
14045
    :ivar ErrorCount:
14046
    :vartype ErrorCount: UInt32
14047
    '''
14048
14049
    ua_types = [
14050 1
        ('TotalCount', 'UInt32'),
14051
        ('ErrorCount', 'UInt32'),
14052
               ]
14053
14054
    def __init__(self):
14055
        self.TotalCount = 0
14056 1
        self.ErrorCount = 0
14057
        self._freeze = True
14058
14059
    def to_binary(self):
14060
        packet = []
14061
        packet.append(uabin.Primitives.UInt32.pack(self.TotalCount))
14062
        packet.append(uabin.Primitives.UInt32.pack(self.ErrorCount))
14063
        return b''.join(packet)
14064
14065
    @staticmethod
14066 1
    def from_binary(data):
14067
        obj = ServiceCounterDataType()
14068
        self.TotalCount = uabin.Primitives.UInt32.unpack(data)
14069
        self.ErrorCount = uabin.Primitives.UInt32.unpack(data)
14070
        return obj
14071
14072
    def __str__(self):
14073 1
        return 'ServiceCounterDataType(' + 'TotalCount:' + str(self.TotalCount) + ', ' + \
14074
               'ErrorCount:' + str(self.ErrorCount) + ')'
14075
14076
    __repr__ = __str__
14077 1
14078
14079
class StatusResult(FrozenClass):
14080
    '''
14081
    :ivar StatusCode:
14082 1
    :vartype StatusCode: StatusCode
14083
    :ivar DiagnosticInfo:
14084
    :vartype DiagnosticInfo: DiagnosticInfo
14085
    '''
14086
14087 1
    ua_types = [
14088
        ('StatusCode', 'StatusCode'),
14089
        ('DiagnosticInfo', 'DiagnosticInfo'),
14090 1
               ]
14091
14092
    def __init__(self):
14093
        self.StatusCode = StatusCode()
14094
        self.DiagnosticInfo = DiagnosticInfo()
14095
        self._freeze = True
14096
14097
    def to_binary(self):
14098 1
        packet = []
14099
        packet.append(self.StatusCode.to_binary())
14100
        packet.append(self.DiagnosticInfo.to_binary())
14101
        return b''.join(packet)
14102
14103 1
    @staticmethod
14104
    def from_binary(data):
14105
        obj = StatusResult()
14106
        obj.StatusCode = StatusCode.from_binary(data)
14107
        obj.DiagnosticInfo = DiagnosticInfo.from_binary(data)
14108
        return obj
14109
14110
    def __str__(self):
14111
        return 'StatusResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
14112 1
               'DiagnosticInfo:' + str(self.DiagnosticInfo) + ')'
14113
14114
    __repr__ = __str__
14115
14116
14117
class SubscriptionDiagnosticsDataType(FrozenClass):
14118
    '''
14119
    :ivar SessionId:
14120
    :vartype SessionId: NodeId
14121
    :ivar SubscriptionId:
14122 1
    :vartype SubscriptionId: UInt32
14123
    :ivar Priority:
14124
    :vartype Priority: Byte
14125
    :ivar PublishingInterval:
14126 1
    :vartype PublishingInterval: Double
14127
    :ivar MaxKeepAliveCount:
14128
    :vartype MaxKeepAliveCount: UInt32
14129
    :ivar MaxLifetimeCount:
14130
    :vartype MaxLifetimeCount: UInt32
14131
    :ivar MaxNotificationsPerPublish:
14132
    :vartype MaxNotificationsPerPublish: UInt32
14133
    :ivar PublishingEnabled:
14134
    :vartype PublishingEnabled: Boolean
14135
    :ivar ModifyCount:
14136
    :vartype ModifyCount: UInt32
14137
    :ivar EnableCount:
14138
    :vartype EnableCount: UInt32
14139
    :ivar DisableCount:
14140 1
    :vartype DisableCount: UInt32
14141
    :ivar RepublishRequestCount:
14142
    :vartype RepublishRequestCount: UInt32
14143
    :ivar RepublishMessageRequestCount:
14144 1
    :vartype RepublishMessageRequestCount: UInt32
14145
    :ivar RepublishMessageCount:
14146
    :vartype RepublishMessageCount: UInt32
14147 1
    :ivar TransferRequestCount:
14148
    :vartype TransferRequestCount: UInt32
14149
    :ivar TransferredToAltClientCount:
14150
    :vartype TransferredToAltClientCount: UInt32
14151
    :ivar TransferredToSameClientCount:
14152
    :vartype TransferredToSameClientCount: UInt32
14153
    :ivar PublishRequestCount:
14154
    :vartype PublishRequestCount: UInt32
14155
    :ivar DataChangeNotificationsCount:
14156
    :vartype DataChangeNotificationsCount: UInt32
14157 1
    :ivar EventNotificationsCount:
14158
    :vartype EventNotificationsCount: UInt32
14159
    :ivar NotificationsCount:
14160
    :vartype NotificationsCount: UInt32
14161
    :ivar LatePublishRequestCount:
14162
    :vartype LatePublishRequestCount: UInt32
14163 1
    :ivar CurrentKeepAliveCount:
14164
    :vartype CurrentKeepAliveCount: UInt32
14165
    :ivar CurrentLifetimeCount:
14166
    :vartype CurrentLifetimeCount: UInt32
14167
    :ivar UnacknowledgedMessageCount:
14168
    :vartype UnacknowledgedMessageCount: UInt32
14169
    :ivar DiscardedMessageCount:
14170
    :vartype DiscardedMessageCount: UInt32
14171
    :ivar MonitoredItemCount:
14172
    :vartype MonitoredItemCount: UInt32
14173 1
    :ivar DisabledMonitoredItemCount:
14174
    :vartype DisabledMonitoredItemCount: UInt32
14175
    :ivar MonitoringQueueOverflowCount:
14176
    :vartype MonitoringQueueOverflowCount: UInt32
14177
    :ivar NextSequenceNumber:
14178
    :vartype NextSequenceNumber: UInt32
14179
    :ivar EventQueueOverFlowCount:
14180 1
    :vartype EventQueueOverFlowCount: UInt32
14181
    '''
14182
14183
    ua_types = [
14184 1
        ('SessionId', 'NodeId'),
14185
        ('SubscriptionId', 'UInt32'),
14186
        ('Priority', 'Byte'),
14187
        ('PublishingInterval', 'Double'),
14188
        ('MaxKeepAliveCount', 'UInt32'),
14189 1
        ('MaxLifetimeCount', 'UInt32'),
14190
        ('MaxNotificationsPerPublish', 'UInt32'),
14191
        ('PublishingEnabled', 'Boolean'),
14192
        ('ModifyCount', 'UInt32'),
14193
        ('EnableCount', 'UInt32'),
14194 1
        ('DisableCount', 'UInt32'),
14195
        ('RepublishRequestCount', 'UInt32'),
14196
        ('RepublishMessageRequestCount', 'UInt32'),
14197 1
        ('RepublishMessageCount', 'UInt32'),
14198
        ('TransferRequestCount', 'UInt32'),
14199
        ('TransferredToAltClientCount', 'UInt32'),
14200
        ('TransferredToSameClientCount', 'UInt32'),
14201
        ('PublishRequestCount', 'UInt32'),
14202
        ('DataChangeNotificationsCount', 'UInt32'),
14203 1
        ('EventNotificationsCount', 'UInt32'),
14204
        ('NotificationsCount', 'UInt32'),
14205
        ('LatePublishRequestCount', 'UInt32'),
14206
        ('CurrentKeepAliveCount', 'UInt32'),
14207 1
        ('CurrentLifetimeCount', 'UInt32'),
14208 1
        ('UnacknowledgedMessageCount', 'UInt32'),
14209 1
        ('DiscardedMessageCount', 'UInt32'),
14210 1
        ('MonitoredItemCount', 'UInt32'),
14211 1
        ('DisabledMonitoredItemCount', 'UInt32'),
14212 1
        ('MonitoringQueueOverflowCount', 'UInt32'),
14213 1
        ('NextSequenceNumber', 'UInt32'),
14214
        ('EventQueueOverFlowCount', 'UInt32'),
14215 1
               ]
14216 1
14217 1
    def __init__(self):
14218 1
        self.SessionId = NodeId()
14219 1
        self.SubscriptionId = 0
14220 1
        self.Priority = 0
14221
        self.PublishingInterval = 0
14222 1
        self.MaxKeepAliveCount = 0
14223
        self.MaxLifetimeCount = 0
14224 1
        self.MaxNotificationsPerPublish = 0
14225
        self.PublishingEnabled = True
14226 1
        self.ModifyCount = 0
14227 1
        self.EnableCount = 0
14228
        self.DisableCount = 0
14229 1
        self.RepublishRequestCount = 0
14230
        self.RepublishMessageRequestCount = 0
14231
        self.RepublishMessageCount = 0
14232 1
        self.TransferRequestCount = 0
14233
        self.TransferredToAltClientCount = 0
14234
        self.TransferredToSameClientCount = 0
14235 1
        self.PublishRequestCount = 0
14236
        self.DataChangeNotificationsCount = 0
14237
        self.EventNotificationsCount = 0
14238
        self.NotificationsCount = 0
14239
        self.LatePublishRequestCount = 0
14240
        self.CurrentKeepAliveCount = 0
14241
        self.CurrentLifetimeCount = 0
14242
        self.UnacknowledgedMessageCount = 0
14243
        self.DiscardedMessageCount = 0
14244
        self.MonitoredItemCount = 0
14245 1
        self.DisabledMonitoredItemCount = 0
14246
        self.MonitoringQueueOverflowCount = 0
14247
        self.NextSequenceNumber = 0
14248
        self.EventQueueOverFlowCount = 0
14249
        self._freeze = True
14250
14251 1
    def to_binary(self):
14252 1
        packet = []
14253
        packet.append(self.SessionId.to_binary())
14254
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
14255
        packet.append(uabin.Primitives.Byte.pack(self.Priority))
14256 1
        packet.append(uabin.Primitives.Double.pack(self.PublishingInterval))
14257 1
        packet.append(uabin.Primitives.UInt32.pack(self.MaxKeepAliveCount))
14258 1
        packet.append(uabin.Primitives.UInt32.pack(self.MaxLifetimeCount))
14259 1
        packet.append(uabin.Primitives.UInt32.pack(self.MaxNotificationsPerPublish))
14260
        packet.append(uabin.Primitives.Boolean.pack(self.PublishingEnabled))
14261 1
        packet.append(uabin.Primitives.UInt32.pack(self.ModifyCount))
14262 1
        packet.append(uabin.Primitives.UInt32.pack(self.EnableCount))
14263 1
        packet.append(uabin.Primitives.UInt32.pack(self.DisableCount))
14264 1
        packet.append(uabin.Primitives.UInt32.pack(self.RepublishRequestCount))
14265 1
        packet.append(uabin.Primitives.UInt32.pack(self.RepublishMessageRequestCount))
14266 1
        packet.append(uabin.Primitives.UInt32.pack(self.RepublishMessageCount))
14267
        packet.append(uabin.Primitives.UInt32.pack(self.TransferRequestCount))
14268 1
        packet.append(uabin.Primitives.UInt32.pack(self.TransferredToAltClientCount))
14269
        packet.append(uabin.Primitives.UInt32.pack(self.TransferredToSameClientCount))
14270
        packet.append(uabin.Primitives.UInt32.pack(self.PublishRequestCount))
14271
        packet.append(uabin.Primitives.UInt32.pack(self.DataChangeNotificationsCount))
14272 1
        packet.append(uabin.Primitives.UInt32.pack(self.EventNotificationsCount))
14273
        packet.append(uabin.Primitives.UInt32.pack(self.NotificationsCount))
14274
        packet.append(uabin.Primitives.UInt32.pack(self.LatePublishRequestCount))
14275
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentKeepAliveCount))
14276
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentLifetimeCount))
14277 1
        packet.append(uabin.Primitives.UInt32.pack(self.UnacknowledgedMessageCount))
14278
        packet.append(uabin.Primitives.UInt32.pack(self.DiscardedMessageCount))
14279
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoredItemCount))
14280
        packet.append(uabin.Primitives.UInt32.pack(self.DisabledMonitoredItemCount))
14281
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoringQueueOverflowCount))
14282 1
        packet.append(uabin.Primitives.UInt32.pack(self.NextSequenceNumber))
14283
        packet.append(uabin.Primitives.UInt32.pack(self.EventQueueOverFlowCount))
14284
        return b''.join(packet)
14285 1
14286
    @staticmethod
14287
    def from_binary(data):
14288
        obj = SubscriptionDiagnosticsDataType()
14289
        obj.SessionId = NodeId.from_binary(data)
14290
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
14291
        self.Priority = uabin.Primitives.Byte.unpack(data)
14292
        self.PublishingInterval = uabin.Primitives.Double.unpack(data)
14293
        self.MaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
14294
        self.MaxLifetimeCount = uabin.Primitives.UInt32.unpack(data)
14295
        self.MaxNotificationsPerPublish = uabin.Primitives.UInt32.unpack(data)
14296
        self.PublishingEnabled = uabin.Primitives.Boolean.unpack(data)
14297 1
        self.ModifyCount = uabin.Primitives.UInt32.unpack(data)
14298
        self.EnableCount = uabin.Primitives.UInt32.unpack(data)
14299
        self.DisableCount = uabin.Primitives.UInt32.unpack(data)
14300
        self.RepublishRequestCount = uabin.Primitives.UInt32.unpack(data)
14301
        self.RepublishMessageRequestCount = uabin.Primitives.UInt32.unpack(data)
14302
        self.RepublishMessageCount = uabin.Primitives.UInt32.unpack(data)
14303
        self.TransferRequestCount = uabin.Primitives.UInt32.unpack(data)
14304 1
        self.TransferredToAltClientCount = uabin.Primitives.UInt32.unpack(data)
14305 1
        self.TransferredToSameClientCount = uabin.Primitives.UInt32.unpack(data)
14306 1
        self.PublishRequestCount = uabin.Primitives.UInt32.unpack(data)
14307 1
        self.DataChangeNotificationsCount = uabin.Primitives.UInt32.unpack(data)
14308 1
        self.EventNotificationsCount = uabin.Primitives.UInt32.unpack(data)
14309 1
        self.NotificationsCount = uabin.Primitives.UInt32.unpack(data)
14310 1
        self.LatePublishRequestCount = uabin.Primitives.UInt32.unpack(data)
14311 1
        self.CurrentKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
14312 1
        self.CurrentLifetimeCount = uabin.Primitives.UInt32.unpack(data)
14313 1
        self.UnacknowledgedMessageCount = uabin.Primitives.UInt32.unpack(data)
14314
        self.DiscardedMessageCount = uabin.Primitives.UInt32.unpack(data)
14315 1
        self.MonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
14316 1
        self.DisabledMonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
14317 1
        self.MonitoringQueueOverflowCount = uabin.Primitives.UInt32.unpack(data)
14318 1
        self.NextSequenceNumber = uabin.Primitives.UInt32.unpack(data)
14319 1
        self.EventQueueOverFlowCount = uabin.Primitives.UInt32.unpack(data)
14320 1
        return obj
14321 1
14322 1
    def __str__(self):
14323 1
        return 'SubscriptionDiagnosticsDataType(' + 'SessionId:' + str(self.SessionId) + ', ' + \
14324
               'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
14325 1
               'Priority:' + str(self.Priority) + ', ' + \
14326
               'PublishingInterval:' + str(self.PublishingInterval) + ', ' + \
14327 1
               'MaxKeepAliveCount:' + str(self.MaxKeepAliveCount) + ', ' + \
14328
               'MaxLifetimeCount:' + str(self.MaxLifetimeCount) + ', ' + \
14329 1
               'MaxNotificationsPerPublish:' + str(self.MaxNotificationsPerPublish) + ', ' + \
14330
               'PublishingEnabled:' + str(self.PublishingEnabled) + ', ' + \
14331 1
               'ModifyCount:' + str(self.ModifyCount) + ', ' + \
14332 1
               'EnableCount:' + str(self.EnableCount) + ', ' + \
14333 1
               'DisableCount:' + str(self.DisableCount) + ', ' + \
14334 1
               'RepublishRequestCount:' + str(self.RepublishRequestCount) + ', ' + \
14335 1
               'RepublishMessageRequestCount:' + str(self.RepublishMessageRequestCount) + ', ' + \
14336 1
               'RepublishMessageCount:' + str(self.RepublishMessageCount) + ', ' + \
14337 1
               'TransferRequestCount:' + str(self.TransferRequestCount) + ', ' + \
14338 1
               'TransferredToAltClientCount:' + str(self.TransferredToAltClientCount) + ', ' + \
14339 1
               'TransferredToSameClientCount:' + str(self.TransferredToSameClientCount) + ', ' + \
14340 1
               'PublishRequestCount:' + str(self.PublishRequestCount) + ', ' + \
14341 1
               'DataChangeNotificationsCount:' + str(self.DataChangeNotificationsCount) + ', ' + \
14342 1
               'EventNotificationsCount:' + str(self.EventNotificationsCount) + ', ' + \
14343 1
               'NotificationsCount:' + str(self.NotificationsCount) + ', ' + \
14344
               'LatePublishRequestCount:' + str(self.LatePublishRequestCount) + ', ' + \
14345 1
               'CurrentKeepAliveCount:' + str(self.CurrentKeepAliveCount) + ', ' + \
14346
               'CurrentLifetimeCount:' + str(self.CurrentLifetimeCount) + ', ' + \
14347 1
               'UnacknowledgedMessageCount:' + str(self.UnacknowledgedMessageCount) + ', ' + \
14348
               'DiscardedMessageCount:' + str(self.DiscardedMessageCount) + ', ' + \
14349
               'MonitoredItemCount:' + str(self.MonitoredItemCount) + ', ' + \
14350
               'DisabledMonitoredItemCount:' + str(self.DisabledMonitoredItemCount) + ', ' + \
14351
               'MonitoringQueueOverflowCount:' + str(self.MonitoringQueueOverflowCount) + ', ' + \
14352
               'NextSequenceNumber:' + str(self.NextSequenceNumber) + ', ' + \
14353 1
               'EventQueueOverFlowCount:' + str(self.EventQueueOverFlowCount) + ')'
14354
14355
    __repr__ = __str__
14356 1
14357
14358
class ModelChangeStructureDataType(FrozenClass):
14359
    '''
14360
    :ivar Affected:
14361
    :vartype Affected: NodeId
14362
    :ivar AffectedType:
14363
    :vartype AffectedType: NodeId
14364
    :ivar Verb:
14365
    :vartype Verb: Byte
14366
    '''
14367
14368
    ua_types = [
14369
        ('Affected', 'NodeId'),
14370
        ('AffectedType', 'NodeId'),
14371
        ('Verb', 'Byte'),
14372 1
               ]
14373
14374
    def __init__(self):
14375
        self.Affected = NodeId()
14376
        self.AffectedType = NodeId()
14377
        self.Verb = 0
14378
        self._freeze = True
14379
14380
    def to_binary(self):
14381 1
        packet = []
14382
        packet.append(self.Affected.to_binary())
14383
        packet.append(self.AffectedType.to_binary())
14384
        packet.append(uabin.Primitives.Byte.pack(self.Verb))
14385
        return b''.join(packet)
14386
14387
    @staticmethod
14388
    def from_binary(data):
14389
        obj = ModelChangeStructureDataType()
14390
        obj.Affected = NodeId.from_binary(data)
14391
        obj.AffectedType = NodeId.from_binary(data)
14392
        self.Verb = uabin.Primitives.Byte.unpack(data)
14393
        return obj
14394 1
14395
    def __str__(self):
14396
        return 'ModelChangeStructureDataType(' + 'Affected:' + str(self.Affected) + ', ' + \
14397
               'AffectedType:' + str(self.AffectedType) + ', ' + \
14398
               'Verb:' + str(self.Verb) + ')'
14399
14400
    __repr__ = __str__
14401
14402
14403
class SemanticChangeStructureDataType(FrozenClass):
14404 1
    '''
14405
    :ivar Affected:
14406
    :vartype Affected: NodeId
14407
    :ivar AffectedType:
14408 1
    :vartype AffectedType: NodeId
14409
    '''
14410
14411
    ua_types = [
14412
        ('Affected', 'NodeId'),
14413
        ('AffectedType', 'NodeId'),
14414
               ]
14415
14416 1
    def __init__(self):
14417
        self.Affected = NodeId()
14418
        self.AffectedType = NodeId()
14419
        self._freeze = True
14420
14421
    def to_binary(self):
14422
        packet = []
14423
        packet.append(self.Affected.to_binary())
14424 1
        packet.append(self.AffectedType.to_binary())
14425
        return b''.join(packet)
14426
14427 1
    @staticmethod
14428
    def from_binary(data):
14429
        obj = SemanticChangeStructureDataType()
14430
        obj.Affected = NodeId.from_binary(data)
14431
        obj.AffectedType = NodeId.from_binary(data)
14432
        return obj
14433
14434
    def __str__(self):
14435
        return 'SemanticChangeStructureDataType(' + 'Affected:' + str(self.Affected) + ', ' + \
14436
               'AffectedType:' + str(self.AffectedType) + ')'
14437 1
14438
    __repr__ = __str__
14439
14440
14441
class Range(FrozenClass):
14442
    '''
14443 1
    :ivar Low:
14444
    :vartype Low: Double
14445
    :ivar High:
14446
    :vartype High: Double
14447
    '''
14448
14449
    ua_types = [
14450
        ('Low', 'Double'),
14451
        ('High', 'Double'),
14452
               ]
14453 1
14454
    def __init__(self):
14455
        self.Low = 0
14456
        self.High = 0
14457
        self._freeze = True
14458
14459
    def to_binary(self):
14460 1
        packet = []
14461
        packet.append(uabin.Primitives.Double.pack(self.Low))
14462
        packet.append(uabin.Primitives.Double.pack(self.High))
14463
        return b''.join(packet)
14464 1
14465
    @staticmethod
14466
    def from_binary(data):
14467
        obj = Range()
14468
        self.Low = uabin.Primitives.Double.unpack(data)
14469 1
        self.High = uabin.Primitives.Double.unpack(data)
14470
        return obj
14471
14472
    def __str__(self):
14473
        return 'Range(' + 'Low:' + str(self.Low) + ', ' + \
14474 1
               'High:' + str(self.High) + ')'
14475
14476
    __repr__ = __str__
14477 1
14478
14479
class EUInformation(FrozenClass):
14480
    '''
14481
    :ivar NamespaceUri:
14482
    :vartype NamespaceUri: String
14483 1
    :ivar UnitId:
14484
    :vartype UnitId: Int32
14485
    :ivar DisplayName:
14486
    :vartype DisplayName: LocalizedText
14487 1
    :ivar Description:
14488
    :vartype Description: LocalizedText
14489
    '''
14490
14491
    ua_types = [
14492
        ('NamespaceUri', 'String'),
14493
        ('UnitId', 'Int32'),
14494
        ('DisplayName', 'LocalizedText'),
14495 1
        ('Description', 'LocalizedText'),
14496
               ]
14497
14498
    def __init__(self):
14499
        self.NamespaceUri = None
14500
        self.UnitId = 0
14501
        self.DisplayName = LocalizedText()
14502 1
        self.Description = LocalizedText()
14503
        self._freeze = True
14504
14505
    def to_binary(self):
14506 1
        packet = []
14507
        packet.append(uabin.Primitives.String.pack(self.NamespaceUri))
14508
        packet.append(uabin.Primitives.Int32.pack(self.UnitId))
14509 1
        packet.append(self.DisplayName.to_binary())
14510
        packet.append(self.Description.to_binary())
14511
        return b''.join(packet)
14512 1
14513
    @staticmethod
14514
    def from_binary(data):
14515 1
        obj = EUInformation()
14516
        self.NamespaceUri = uabin.Primitives.String.unpack(data)
14517
        self.UnitId = uabin.Primitives.Int32.unpack(data)
14518
        obj.DisplayName = LocalizedText.from_binary(data)
14519
        obj.Description = LocalizedText.from_binary(data)
14520
        return obj
14521
14522
    def __str__(self):
14523 1
        return 'EUInformation(' + 'NamespaceUri:' + str(self.NamespaceUri) + ', ' + \
14524
               'UnitId:' + str(self.UnitId) + ', ' + \
14525
               'DisplayName:' + str(self.DisplayName) + ', ' + \
14526
               'Description:' + str(self.Description) + ')'
14527
14528 1
    __repr__ = __str__
14529
14530
14531
class ComplexNumberType(FrozenClass):
14532
    '''
14533
    :ivar Real:
14534
    :vartype Real: Float
14535
    :ivar Imaginary:
14536
    :vartype Imaginary: Float
14537 1
    '''
14538
14539
    ua_types = [
14540
        ('Real', 'Float'),
14541
        ('Imaginary', 'Float'),
14542
               ]
14543
14544
    def __init__(self):
14545 1
        self.Real = 0
14546
        self.Imaginary = 0
14547
        self._freeze = True
14548
14549 1
    def to_binary(self):
14550
        packet = []
14551
        packet.append(uabin.Primitives.Float.pack(self.Real))
14552
        packet.append(uabin.Primitives.Float.pack(self.Imaginary))
14553
        return b''.join(packet)
14554
14555
    @staticmethod
14556
    def from_binary(data):
14557
        obj = ComplexNumberType()
14558 1
        self.Real = uabin.Primitives.Float.unpack(data)
14559
        self.Imaginary = uabin.Primitives.Float.unpack(data)
14560
        return obj
14561
14562 1
    def __str__(self):
14563
        return 'ComplexNumberType(' + 'Real:' + str(self.Real) + ', ' + \
14564
               'Imaginary:' + str(self.Imaginary) + ')'
14565 1
14566
    __repr__ = __str__
14567
14568
14569
class DoubleComplexNumberType(FrozenClass):
14570
    '''
14571
    :ivar Real:
14572
    :vartype Real: Double
14573
    :ivar Imaginary:
14574
    :vartype Imaginary: Double
14575
    '''
14576
14577 1
    ua_types = [
14578
        ('Real', 'Double'),
14579
        ('Imaginary', 'Double'),
14580
               ]
14581
14582
    def __init__(self):
14583
        self.Real = 0
14584 1
        self.Imaginary = 0
14585
        self._freeze = True
14586
14587
    def to_binary(self):
14588
        packet = []
14589
        packet.append(uabin.Primitives.Double.pack(self.Real))
14590
        packet.append(uabin.Primitives.Double.pack(self.Imaginary))
14591
        return b''.join(packet)
14592
14593
    @staticmethod
14594
    def from_binary(data):
14595 1
        obj = DoubleComplexNumberType()
14596
        self.Real = uabin.Primitives.Double.unpack(data)
14597
        self.Imaginary = uabin.Primitives.Double.unpack(data)
14598
        return obj
14599
14600
    def __str__(self):
14601
        return 'DoubleComplexNumberType(' + 'Real:' + str(self.Real) + ', ' + \
14602
               'Imaginary:' + str(self.Imaginary) + ')'
14603 1
14604
    __repr__ = __str__
14605
14606
14607 1
class AxisInformation(FrozenClass):
14608
    '''
14609
    :ivar EngineeringUnits:
14610
    :vartype EngineeringUnits: EUInformation
14611
    :ivar EURange:
14612
    :vartype EURange: Range
14613 1
    :ivar Title:
14614
    :vartype Title: LocalizedText
14615
    :ivar AxisScaleType:
14616
    :vartype AxisScaleType: AxisScaleEnumeration
14617
    :ivar AxisSteps:
14618
    :vartype AxisSteps: Double
14619 1
    '''
14620
14621
    ua_types = [
14622 1
        ('EngineeringUnits', 'EUInformation'),
14623
        ('EURange', 'Range'),
14624
        ('Title', 'LocalizedText'),
14625
        ('AxisScaleType', 'AxisScaleEnumeration'),
14626
        ('AxisSteps', 'ListOfDouble'),
14627
               ]
14628
14629
    def __init__(self):
14630
        self.EngineeringUnits = EUInformation()
14631
        self.EURange = Range()
14632
        self.Title = LocalizedText()
14633
        self.AxisScaleType = AxisScaleEnumeration(0)
14634
        self.AxisSteps = []
14635
        self._freeze = True
14636
14637
    def to_binary(self):
14638
        packet = []
14639
        packet.append(self.EngineeringUnits.to_binary())
14640
        packet.append(self.EURange.to_binary())
14641
        packet.append(self.Title.to_binary())
14642
        packet.append(uabin.Primitives.UInt32.pack(self.AxisScaleType.value))
14643
        packet.append(uabin.Primitives.Int32.pack(len(self.AxisSteps)))
14644
        for fieldname in self.AxisSteps:
14645
            packet.append(uabin.Primitives.Double.pack(fieldname))
14646
        return b''.join(packet)
14647
14648
    @staticmethod
14649
    def from_binary(data):
14650 1
        obj = AxisInformation()
14651
        obj.EngineeringUnits = EUInformation.from_binary(data)
14652
        obj.EURange = Range.from_binary(data)
14653
        obj.Title = LocalizedText.from_binary(data)
14654
        self.AxisScaleType = AxisScaleEnumeration(uabin.Primitives.UInt32.unpack(data))
14655
        obj.AxisSteps = uabin.Primitives.Double.unpack_array(data)
14656
        return obj
14657
14658
    def __str__(self):
14659
        return 'AxisInformation(' + 'EngineeringUnits:' + str(self.EngineeringUnits) + ', ' + \
14660
               'EURange:' + str(self.EURange) + ', ' + \
14661
               'Title:' + str(self.Title) + ', ' + \
14662
               'AxisScaleType:' + str(self.AxisScaleType) + ', ' + \
14663
               'AxisSteps:' + str(self.AxisSteps) + ')'
14664
14665 1
    __repr__ = __str__
14666
14667
14668
class XVType(FrozenClass):
14669
    '''
14670
    :ivar X:
14671
    :vartype X: Double
14672
    :ivar Value:
14673
    :vartype Value: Float
14674
    '''
14675
14676
    ua_types = [
14677
        ('X', 'Double'),
14678
        ('Value', 'Float'),
14679
               ]
14680
14681
    def __init__(self):
14682
        self.X = 0
14683
        self.Value = 0
14684 1
        self._freeze = True
14685
14686
    def to_binary(self):
14687
        packet = []
14688
        packet.append(uabin.Primitives.Double.pack(self.X))
14689
        packet.append(uabin.Primitives.Float.pack(self.Value))
14690
        return b''.join(packet)
14691
14692
    @staticmethod
14693
    def from_binary(data):
14694
        obj = XVType()
14695
        self.X = uabin.Primitives.Double.unpack(data)
14696
        self.Value = uabin.Primitives.Float.unpack(data)
14697
        return obj
14698
14699
    def __str__(self):
14700 1
        return 'XVType(' + 'X:' + str(self.X) + ', ' + \
14701
               'Value:' + str(self.Value) + ')'
14702
14703
    __repr__ = __str__
14704 1
14705
14706
class ProgramDiagnosticDataType(FrozenClass):
14707
    '''
14708
    :ivar CreateSessionId:
14709
    :vartype CreateSessionId: NodeId
14710
    :ivar CreateClientName:
14711
    :vartype CreateClientName: String
14712
    :ivar InvocationCreationTime:
14713
    :vartype InvocationCreationTime: DateTime
14714
    :ivar LastTransitionTime:
14715
    :vartype LastTransitionTime: DateTime
14716
    :ivar LastMethodCall:
14717
    :vartype LastMethodCall: String
14718 1
    :ivar LastMethodSessionId:
14719
    :vartype LastMethodSessionId: NodeId
14720
    :ivar LastMethodInputArguments:
14721
    :vartype LastMethodInputArguments: Argument
14722
    :ivar LastMethodOutputArguments:
14723
    :vartype LastMethodOutputArguments: Argument
14724
    :ivar LastMethodCallTime:
14725
    :vartype LastMethodCallTime: DateTime
14726
    :ivar LastMethodReturnStatus:
14727
    :vartype LastMethodReturnStatus: StatusResult
14728
    '''
14729
14730
    ua_types = [
14731
        ('CreateSessionId', 'NodeId'),
14732 1
        ('CreateClientName', 'String'),
14733
        ('InvocationCreationTime', 'DateTime'),
14734
        ('LastTransitionTime', 'DateTime'),
14735 1
        ('LastMethodCall', 'String'),
14736
        ('LastMethodSessionId', 'NodeId'),
14737
        ('LastMethodInputArguments', 'ListOfArgument'),
14738
        ('LastMethodOutputArguments', 'ListOfArgument'),
14739
        ('LastMethodCallTime', 'DateTime'),
14740
        ('LastMethodReturnStatus', 'StatusResult'),
14741
               ]
14742
14743
    def __init__(self):
14744
        self.CreateSessionId = NodeId()
14745
        self.CreateClientName = None
14746
        self.InvocationCreationTime = datetime.utcnow()
14747
        self.LastTransitionTime = datetime.utcnow()
14748
        self.LastMethodCall = None
14749
        self.LastMethodSessionId = NodeId()
14750
        self.LastMethodInputArguments = []
14751 1
        self.LastMethodOutputArguments = []
14752
        self.LastMethodCallTime = datetime.utcnow()
14753
        self.LastMethodReturnStatus = StatusResult()
14754
        self._freeze = True
14755
14756
    def to_binary(self):
14757
        packet = []
14758
        packet.append(self.CreateSessionId.to_binary())
14759
        packet.append(uabin.Primitives.String.pack(self.CreateClientName))
14760 1
        packet.append(uabin.Primitives.DateTime.pack(self.InvocationCreationTime))
14761
        packet.append(uabin.Primitives.DateTime.pack(self.LastTransitionTime))
14762
        packet.append(uabin.Primitives.String.pack(self.LastMethodCall))
14763
        packet.append(self.LastMethodSessionId.to_binary())
14764
        packet.append(uabin.Primitives.Int32.pack(len(self.LastMethodInputArguments)))
14765
        for fieldname in self.LastMethodInputArguments:
14766
            packet.append(fieldname.to_binary())
14767
        packet.append(uabin.Primitives.Int32.pack(len(self.LastMethodOutputArguments)))
14768
        for fieldname in self.LastMethodOutputArguments:
14769
            packet.append(fieldname.to_binary())
14770 View Code Duplication
        packet.append(uabin.Primitives.DateTime.pack(self.LastMethodCallTime))
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
14771
        packet.append(self.LastMethodReturnStatus.to_binary())
14772
        return b''.join(packet)
14773 1
14774
    @staticmethod
14775
    def from_binary(data):
14776
        obj = ProgramDiagnosticDataType()
14777
        obj.CreateSessionId = NodeId.from_binary(data)
14778
        self.CreateClientName = uabin.Primitives.String.unpack(data)
14779
        self.InvocationCreationTime = uabin.Primitives.DateTime.unpack(data)
14780
        self.LastTransitionTime = uabin.Primitives.DateTime.unpack(data)
14781
        self.LastMethodCall = uabin.Primitives.String.unpack(data)
14782
        obj.LastMethodSessionId = NodeId.from_binary(data)
14783 1
        length = uabin.Primitives.Int32.unpack(data)
14784
        array = []
14785
        if length != -1:
14786
            for _ in range(0, length):
14787 1
                array.append(Argument.from_binary(data))
14788
        obj.LastMethodInputArguments = array
14789
        length = uabin.Primitives.Int32.unpack(data)
14790
        array = []
14791
        if length != -1:
14792
            for _ in range(0, length):
14793
                array.append(Argument.from_binary(data))
14794
        obj.LastMethodOutputArguments = array
14795 1
        self.LastMethodCallTime = uabin.Primitives.DateTime.unpack(data)
14796
        obj.LastMethodReturnStatus = StatusResult.from_binary(data)
14797
        return obj
14798
14799
    def __str__(self):
14800
        return 'ProgramDiagnosticDataType(' + 'CreateSessionId:' + str(self.CreateSessionId) + ', ' + \
14801
               'CreateClientName:' + str(self.CreateClientName) + ', ' + \
14802
               'InvocationCreationTime:' + str(self.InvocationCreationTime) + ', ' + \
14803 1
               'LastTransitionTime:' + str(self.LastTransitionTime) + ', ' + \
14804
               'LastMethodCall:' + str(self.LastMethodCall) + ', ' + \
14805
               'LastMethodSessionId:' + str(self.LastMethodSessionId) + ', ' + \
14806 1
               'LastMethodInputArguments:' + str(self.LastMethodInputArguments) + ', ' + \
14807
               'LastMethodOutputArguments:' + str(self.LastMethodOutputArguments) + ', ' + \
14808
               'LastMethodCallTime:' + str(self.LastMethodCallTime) + ', ' + \
14809
               'LastMethodReturnStatus:' + str(self.LastMethodReturnStatus) + ')'
14810
14811
    __repr__ = __str__
14812
14813
14814
class Annotation(FrozenClass):
14815
    '''
14816
    :ivar Message:
14817
    :vartype Message: String
14818
    :ivar UserName:
14819
    :vartype UserName: String
14820
    :ivar AnnotationTime:
14821
    :vartype AnnotationTime: DateTime
14822
    '''
14823
14824
    ua_types = [
14825
        ('Message', 'String'),
14826
        ('UserName', 'String'),
14827
        ('AnnotationTime', 'DateTime'),
14828
               ]
14829
14830
    def __init__(self):
14831
        self.Message = None
14832
        self.UserName = None
14833
        self.AnnotationTime = datetime.utcnow()
14834
        self._freeze = True
14835
14836
    def to_binary(self):
14837
        packet = []
14838
        packet.append(uabin.Primitives.String.pack(self.Message))
14839
        packet.append(uabin.Primitives.String.pack(self.UserName))
14840
        packet.append(uabin.Primitives.DateTime.pack(self.AnnotationTime))
14841
        return b''.join(packet)
14842
14843
    @staticmethod
14844
    def from_binary(data):
14845
        obj = Annotation()
14846
        self.Message = uabin.Primitives.String.unpack(data)
14847
        self.UserName = uabin.Primitives.String.unpack(data)
14848
        self.AnnotationTime = uabin.Primitives.DateTime.unpack(data)
14849
        return obj
14850
14851
    def __str__(self):
14852
        return 'Annotation(' + 'Message:' + str(self.Message) + ', ' + \
14853
               'UserName:' + str(self.UserName) + ', ' + \
14854
               'AnnotationTime:' + str(self.AnnotationTime) + ')'
14855
14856
    __repr__ = __str__
14857
14858
14859
nid = FourByteNodeId(ObjectIds.TrustListDataType_Encoding_DefaultBinary)
14860
extension_object_classes[nid] = TrustListDataType
14861
extension_object_ids['TrustListDataType'] = nid
14862
nid = FourByteNodeId(ObjectIds.Argument_Encoding_DefaultBinary)
14863
extension_object_classes[nid] = Argument
14864
extension_object_ids['Argument'] = nid
14865
nid = FourByteNodeId(ObjectIds.EnumValueType_Encoding_DefaultBinary)
14866
extension_object_classes[nid] = EnumValueType
14867
extension_object_ids['EnumValueType'] = nid
14868
nid = FourByteNodeId(ObjectIds.OptionSet_Encoding_DefaultBinary)
14869
extension_object_classes[nid] = OptionSet
14870
extension_object_ids['OptionSet'] = nid
14871
nid = FourByteNodeId(ObjectIds.Union_Encoding_DefaultBinary)
14872
extension_object_classes[nid] = Union
14873
extension_object_ids['Union'] = nid
14874
nid = FourByteNodeId(ObjectIds.TimeZoneDataType_Encoding_DefaultBinary)
14875
extension_object_classes[nid] = TimeZoneDataType
14876
extension_object_ids['TimeZoneDataType'] = nid
14877
nid = FourByteNodeId(ObjectIds.ApplicationDescription_Encoding_DefaultBinary)
14878
extension_object_classes[nid] = ApplicationDescription
14879
extension_object_ids['ApplicationDescription'] = nid
14880
nid = FourByteNodeId(ObjectIds.RequestHeader_Encoding_DefaultBinary)
14881
extension_object_classes[nid] = RequestHeader
14882
extension_object_ids['RequestHeader'] = nid
14883
nid = FourByteNodeId(ObjectIds.ResponseHeader_Encoding_DefaultBinary)
14884
extension_object_classes[nid] = ResponseHeader
14885
extension_object_ids['ResponseHeader'] = nid
14886
nid = FourByteNodeId(ObjectIds.ServiceFault_Encoding_DefaultBinary)
14887
extension_object_classes[nid] = ServiceFault
14888
extension_object_ids['ServiceFault'] = nid
14889
nid = FourByteNodeId(ObjectIds.FindServersRequest_Encoding_DefaultBinary)
14890
extension_object_classes[nid] = FindServersRequest
14891
extension_object_ids['FindServersRequest'] = nid
14892
nid = FourByteNodeId(ObjectIds.FindServersResponse_Encoding_DefaultBinary)
14893
extension_object_classes[nid] = FindServersResponse
14894
extension_object_ids['FindServersResponse'] = nid
14895
nid = FourByteNodeId(ObjectIds.ServerOnNetwork_Encoding_DefaultBinary)
14896 1
extension_object_classes[nid] = ServerOnNetwork
14897
extension_object_ids['ServerOnNetwork'] = nid
14898
nid = FourByteNodeId(ObjectIds.FindServersOnNetworkRequest_Encoding_DefaultBinary)
14899
extension_object_classes[nid] = FindServersOnNetworkRequest
14900
extension_object_ids['FindServersOnNetworkRequest'] = nid
14901
nid = FourByteNodeId(ObjectIds.FindServersOnNetworkResponse_Encoding_DefaultBinary)
14902
extension_object_classes[nid] = FindServersOnNetworkResponse
14903
extension_object_ids['FindServersOnNetworkResponse'] = nid
14904
nid = FourByteNodeId(ObjectIds.UserTokenPolicy_Encoding_DefaultBinary)
14905
extension_object_classes[nid] = UserTokenPolicy
14906
extension_object_ids['UserTokenPolicy'] = nid
14907
nid = FourByteNodeId(ObjectIds.EndpointDescription_Encoding_DefaultBinary)
14908
extension_object_classes[nid] = EndpointDescription
14909
extension_object_ids['EndpointDescription'] = nid
14910
nid = FourByteNodeId(ObjectIds.GetEndpointsRequest_Encoding_DefaultBinary)
14911
extension_object_classes[nid] = GetEndpointsRequest
14912
extension_object_ids['GetEndpointsRequest'] = nid
14913
nid = FourByteNodeId(ObjectIds.GetEndpointsResponse_Encoding_DefaultBinary)
14914
extension_object_classes[nid] = GetEndpointsResponse
14915
extension_object_ids['GetEndpointsResponse'] = nid
14916
nid = FourByteNodeId(ObjectIds.RegisteredServer_Encoding_DefaultBinary)
14917
extension_object_classes[nid] = RegisteredServer
14918
extension_object_ids['RegisteredServer'] = nid
14919
nid = FourByteNodeId(ObjectIds.RegisterServerRequest_Encoding_DefaultBinary)
14920
extension_object_classes[nid] = RegisterServerRequest
14921
extension_object_ids['RegisterServerRequest'] = nid
14922
nid = FourByteNodeId(ObjectIds.RegisterServerResponse_Encoding_DefaultBinary)
14923
extension_object_classes[nid] = RegisterServerResponse
14924
extension_object_ids['RegisterServerResponse'] = nid
14925
nid = FourByteNodeId(ObjectIds.DiscoveryConfiguration_Encoding_DefaultBinary)
14926
extension_object_classes[nid] = DiscoveryConfiguration
14927
extension_object_ids['DiscoveryConfiguration'] = nid
14928
nid = FourByteNodeId(ObjectIds.MdnsDiscoveryConfiguration_Encoding_DefaultBinary)
14929
extension_object_classes[nid] = MdnsDiscoveryConfiguration
14930
extension_object_ids['MdnsDiscoveryConfiguration'] = nid
14931
nid = FourByteNodeId(ObjectIds.RegisterServer2Request_Encoding_DefaultBinary)
14932
extension_object_classes[nid] = RegisterServer2Request
14933
extension_object_ids['RegisterServer2Request'] = nid
14934
nid = FourByteNodeId(ObjectIds.RegisterServer2Response_Encoding_DefaultBinary)
14935
extension_object_classes[nid] = RegisterServer2Response
14936
extension_object_ids['RegisterServer2Response'] = nid
14937
nid = FourByteNodeId(ObjectIds.ChannelSecurityToken_Encoding_DefaultBinary)
14938
extension_object_classes[nid] = ChannelSecurityToken
14939
extension_object_ids['ChannelSecurityToken'] = nid
14940
nid = FourByteNodeId(ObjectIds.OpenSecureChannelRequest_Encoding_DefaultBinary)
14941
extension_object_classes[nid] = OpenSecureChannelRequest
14942 1
extension_object_ids['OpenSecureChannelRequest'] = nid
14943
nid = FourByteNodeId(ObjectIds.OpenSecureChannelResponse_Encoding_DefaultBinary)
14944
extension_object_classes[nid] = OpenSecureChannelResponse
14945
extension_object_ids['OpenSecureChannelResponse'] = nid
14946
nid = FourByteNodeId(ObjectIds.CloseSecureChannelRequest_Encoding_DefaultBinary)
14947
extension_object_classes[nid] = CloseSecureChannelRequest
14948
extension_object_ids['CloseSecureChannelRequest'] = nid
14949
nid = FourByteNodeId(ObjectIds.CloseSecureChannelResponse_Encoding_DefaultBinary)
14950
extension_object_classes[nid] = CloseSecureChannelResponse
14951
extension_object_ids['CloseSecureChannelResponse'] = nid
14952
nid = FourByteNodeId(ObjectIds.SignedSoftwareCertificate_Encoding_DefaultBinary)
14953
extension_object_classes[nid] = SignedSoftwareCertificate
14954
extension_object_ids['SignedSoftwareCertificate'] = nid
14955
nid = FourByteNodeId(ObjectIds.SignatureData_Encoding_DefaultBinary)
14956
extension_object_classes[nid] = SignatureData
14957
extension_object_ids['SignatureData'] = nid
14958
nid = FourByteNodeId(ObjectIds.CreateSessionRequest_Encoding_DefaultBinary)
14959
extension_object_classes[nid] = CreateSessionRequest
14960
extension_object_ids['CreateSessionRequest'] = nid
14961
nid = FourByteNodeId(ObjectIds.CreateSessionResponse_Encoding_DefaultBinary)
14962
extension_object_classes[nid] = CreateSessionResponse
14963
extension_object_ids['CreateSessionResponse'] = nid
14964
nid = FourByteNodeId(ObjectIds.UserIdentityToken_Encoding_DefaultBinary)
14965
extension_object_classes[nid] = UserIdentityToken
14966
extension_object_ids['UserIdentityToken'] = nid
14967
nid = FourByteNodeId(ObjectIds.AnonymousIdentityToken_Encoding_DefaultBinary)
14968
extension_object_classes[nid] = AnonymousIdentityToken
14969
extension_object_ids['AnonymousIdentityToken'] = nid
14970
nid = FourByteNodeId(ObjectIds.UserNameIdentityToken_Encoding_DefaultBinary)
14971
extension_object_classes[nid] = UserNameIdentityToken
14972
extension_object_ids['UserNameIdentityToken'] = nid
14973
nid = FourByteNodeId(ObjectIds.X509IdentityToken_Encoding_DefaultBinary)
14974
extension_object_classes[nid] = X509IdentityToken
14975
extension_object_ids['X509IdentityToken'] = nid
14976
nid = FourByteNodeId(ObjectIds.KerberosIdentityToken_Encoding_DefaultBinary)
14977
extension_object_classes[nid] = KerberosIdentityToken
14978
extension_object_ids['KerberosIdentityToken'] = nid
14979
nid = FourByteNodeId(ObjectIds.IssuedIdentityToken_Encoding_DefaultBinary)
14980
extension_object_classes[nid] = IssuedIdentityToken
14981
extension_object_ids['IssuedIdentityToken'] = nid
14982
nid = FourByteNodeId(ObjectIds.ActivateSessionRequest_Encoding_DefaultBinary)
14983
extension_object_classes[nid] = ActivateSessionRequest
14984
extension_object_ids['ActivateSessionRequest'] = nid
14985
nid = FourByteNodeId(ObjectIds.ActivateSessionResponse_Encoding_DefaultBinary)
14986
extension_object_classes[nid] = ActivateSessionResponse
14987
extension_object_ids['ActivateSessionResponse'] = nid
14988
nid = FourByteNodeId(ObjectIds.CloseSessionRequest_Encoding_DefaultBinary)
14989
extension_object_classes[nid] = CloseSessionRequest
14990
extension_object_ids['CloseSessionRequest'] = nid
14991
nid = FourByteNodeId(ObjectIds.CloseSessionResponse_Encoding_DefaultBinary)
14992 1
extension_object_classes[nid] = CloseSessionResponse
14993
extension_object_ids['CloseSessionResponse'] = nid
14994
nid = FourByteNodeId(ObjectIds.CancelRequest_Encoding_DefaultBinary)
14995
extension_object_classes[nid] = CancelRequest
14996
extension_object_ids['CancelRequest'] = nid
14997
nid = FourByteNodeId(ObjectIds.CancelResponse_Encoding_DefaultBinary)
14998
extension_object_classes[nid] = CancelResponse
14999
extension_object_ids['CancelResponse'] = nid
15000
nid = FourByteNodeId(ObjectIds.NodeAttributes_Encoding_DefaultBinary)
15001
extension_object_classes[nid] = NodeAttributes
15002
extension_object_ids['NodeAttributes'] = nid
15003
nid = FourByteNodeId(ObjectIds.ObjectAttributes_Encoding_DefaultBinary)
15004
extension_object_classes[nid] = ObjectAttributes
15005
extension_object_ids['ObjectAttributes'] = nid
15006
nid = FourByteNodeId(ObjectIds.VariableAttributes_Encoding_DefaultBinary)
15007
extension_object_classes[nid] = VariableAttributes
15008
extension_object_ids['VariableAttributes'] = nid
15009
nid = FourByteNodeId(ObjectIds.MethodAttributes_Encoding_DefaultBinary)
15010
extension_object_classes[nid] = MethodAttributes
15011
extension_object_ids['MethodAttributes'] = nid
15012
nid = FourByteNodeId(ObjectIds.ObjectTypeAttributes_Encoding_DefaultBinary)
15013
extension_object_classes[nid] = ObjectTypeAttributes
15014
extension_object_ids['ObjectTypeAttributes'] = nid
15015
nid = FourByteNodeId(ObjectIds.VariableTypeAttributes_Encoding_DefaultBinary)
15016
extension_object_classes[nid] = VariableTypeAttributes
15017
extension_object_ids['VariableTypeAttributes'] = nid
15018
nid = FourByteNodeId(ObjectIds.ReferenceTypeAttributes_Encoding_DefaultBinary)
15019
extension_object_classes[nid] = ReferenceTypeAttributes
15020
extension_object_ids['ReferenceTypeAttributes'] = nid
15021
nid = FourByteNodeId(ObjectIds.DataTypeAttributes_Encoding_DefaultBinary)
15022
extension_object_classes[nid] = DataTypeAttributes
15023
extension_object_ids['DataTypeAttributes'] = nid
15024
nid = FourByteNodeId(ObjectIds.ViewAttributes_Encoding_DefaultBinary)
15025 View Code Duplication
extension_object_classes[nid] = ViewAttributes
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15026
extension_object_ids['ViewAttributes'] = nid
15027
nid = FourByteNodeId(ObjectIds.AddNodesItem_Encoding_DefaultBinary)
15028
extension_object_classes[nid] = AddNodesItem
15029
extension_object_ids['AddNodesItem'] = nid
15030
nid = FourByteNodeId(ObjectIds.AddNodesResult_Encoding_DefaultBinary)
15031
extension_object_classes[nid] = AddNodesResult
15032
extension_object_ids['AddNodesResult'] = nid
15033
nid = FourByteNodeId(ObjectIds.AddNodesRequest_Encoding_DefaultBinary)
15034
extension_object_classes[nid] = AddNodesRequest
15035
extension_object_ids['AddNodesRequest'] = nid
15036
nid = FourByteNodeId(ObjectIds.AddNodesResponse_Encoding_DefaultBinary)
15037
extension_object_classes[nid] = AddNodesResponse
15038
extension_object_ids['AddNodesResponse'] = nid
15039
nid = FourByteNodeId(ObjectIds.AddReferencesItem_Encoding_DefaultBinary)
15040
extension_object_classes[nid] = AddReferencesItem
15041 1
extension_object_ids['AddReferencesItem'] = nid
15042
nid = FourByteNodeId(ObjectIds.AddReferencesRequest_Encoding_DefaultBinary)
15043
extension_object_classes[nid] = AddReferencesRequest
15044
extension_object_ids['AddReferencesRequest'] = nid
15045 1
nid = FourByteNodeId(ObjectIds.AddReferencesResponse_Encoding_DefaultBinary)
15046
extension_object_classes[nid] = AddReferencesResponse
15047
extension_object_ids['AddReferencesResponse'] = nid
15048
nid = FourByteNodeId(ObjectIds.DeleteNodesItem_Encoding_DefaultBinary)
15049
extension_object_classes[nid] = DeleteNodesItem
15050
extension_object_ids['DeleteNodesItem'] = nid
15051
nid = FourByteNodeId(ObjectIds.DeleteNodesRequest_Encoding_DefaultBinary)
15052
extension_object_classes[nid] = DeleteNodesRequest
15053
extension_object_ids['DeleteNodesRequest'] = nid
15054
nid = FourByteNodeId(ObjectIds.DeleteNodesResponse_Encoding_DefaultBinary)
15055
extension_object_classes[nid] = DeleteNodesResponse
15056
extension_object_ids['DeleteNodesResponse'] = nid
15057
nid = FourByteNodeId(ObjectIds.DeleteReferencesItem_Encoding_DefaultBinary)
15058
extension_object_classes[nid] = DeleteReferencesItem
15059
extension_object_ids['DeleteReferencesItem'] = nid
15060
nid = FourByteNodeId(ObjectIds.DeleteReferencesRequest_Encoding_DefaultBinary)
15061
extension_object_classes[nid] = DeleteReferencesRequest
15062
extension_object_ids['DeleteReferencesRequest'] = nid
15063
nid = FourByteNodeId(ObjectIds.DeleteReferencesResponse_Encoding_DefaultBinary)
15064
extension_object_classes[nid] = DeleteReferencesResponse
15065
extension_object_ids['DeleteReferencesResponse'] = nid
15066
nid = FourByteNodeId(ObjectIds.ViewDescription_Encoding_DefaultBinary)
15067
extension_object_classes[nid] = ViewDescription
15068
extension_object_ids['ViewDescription'] = nid
15069
nid = FourByteNodeId(ObjectIds.BrowseDescription_Encoding_DefaultBinary)
15070
extension_object_classes[nid] = BrowseDescription
15071
extension_object_ids['BrowseDescription'] = nid
15072
nid = FourByteNodeId(ObjectIds.ReferenceDescription_Encoding_DefaultBinary)
15073
extension_object_classes[nid] = ReferenceDescription
15074
extension_object_ids['ReferenceDescription'] = nid
15075
nid = FourByteNodeId(ObjectIds.BrowseResult_Encoding_DefaultBinary)
15076
extension_object_classes[nid] = BrowseResult
15077
extension_object_ids['BrowseResult'] = nid
15078
nid = FourByteNodeId(ObjectIds.BrowseRequest_Encoding_DefaultBinary)
15079
extension_object_classes[nid] = BrowseRequest
15080
extension_object_ids['BrowseRequest'] = nid
15081
nid = FourByteNodeId(ObjectIds.BrowseResponse_Encoding_DefaultBinary)
15082
extension_object_classes[nid] = BrowseResponse
15083
extension_object_ids['BrowseResponse'] = nid
15084
nid = FourByteNodeId(ObjectIds.BrowseNextRequest_Encoding_DefaultBinary)
15085
extension_object_classes[nid] = BrowseNextRequest
15086
extension_object_ids['BrowseNextRequest'] = nid
15087
nid = FourByteNodeId(ObjectIds.BrowseNextResponse_Encoding_DefaultBinary)
15088
extension_object_classes[nid] = BrowseNextResponse
15089
extension_object_ids['BrowseNextResponse'] = nid
15090 1
nid = FourByteNodeId(ObjectIds.RelativePathElement_Encoding_DefaultBinary)
15091
extension_object_classes[nid] = RelativePathElement
15092
extension_object_ids['RelativePathElement'] = nid
15093
nid = FourByteNodeId(ObjectIds.RelativePath_Encoding_DefaultBinary)
15094
extension_object_classes[nid] = RelativePath
15095
extension_object_ids['RelativePath'] = nid
15096
nid = FourByteNodeId(ObjectIds.BrowsePath_Encoding_DefaultBinary)
15097
extension_object_classes[nid] = BrowsePath
15098
extension_object_ids['BrowsePath'] = nid
15099
nid = FourByteNodeId(ObjectIds.BrowsePathTarget_Encoding_DefaultBinary)
15100
extension_object_classes[nid] = BrowsePathTarget
15101
extension_object_ids['BrowsePathTarget'] = nid
15102
nid = FourByteNodeId(ObjectIds.BrowsePathResult_Encoding_DefaultBinary)
15103
extension_object_classes[nid] = BrowsePathResult
15104
extension_object_ids['BrowsePathResult'] = nid
15105
nid = FourByteNodeId(ObjectIds.TranslateBrowsePathsToNodeIdsRequest_Encoding_DefaultBinary)
15106
extension_object_classes[nid] = TranslateBrowsePathsToNodeIdsRequest
15107
extension_object_ids['TranslateBrowsePathsToNodeIdsRequest'] = nid
15108
nid = FourByteNodeId(ObjectIds.TranslateBrowsePathsToNodeIdsResponse_Encoding_DefaultBinary)
15109
extension_object_classes[nid] = TranslateBrowsePathsToNodeIdsResponse
15110
extension_object_ids['TranslateBrowsePathsToNodeIdsResponse'] = nid
15111
nid = FourByteNodeId(ObjectIds.RegisterNodesRequest_Encoding_DefaultBinary)
15112
extension_object_classes[nid] = RegisterNodesRequest
15113
extension_object_ids['RegisterNodesRequest'] = nid
15114
nid = FourByteNodeId(ObjectIds.RegisterNodesResponse_Encoding_DefaultBinary)
15115
extension_object_classes[nid] = RegisterNodesResponse
15116
extension_object_ids['RegisterNodesResponse'] = nid
15117
nid = FourByteNodeId(ObjectIds.UnregisterNodesRequest_Encoding_DefaultBinary)
15118
extension_object_classes[nid] = UnregisterNodesRequest
15119
extension_object_ids['UnregisterNodesRequest'] = nid
15120
nid = FourByteNodeId(ObjectIds.UnregisterNodesResponse_Encoding_DefaultBinary)
15121
extension_object_classes[nid] = UnregisterNodesResponse
15122
extension_object_ids['UnregisterNodesResponse'] = nid
15123
nid = FourByteNodeId(ObjectIds.EndpointConfiguration_Encoding_DefaultBinary)
15124
extension_object_classes[nid] = EndpointConfiguration
15125
extension_object_ids['EndpointConfiguration'] = nid
15126
nid = FourByteNodeId(ObjectIds.SupportedProfile_Encoding_DefaultBinary)
15127
extension_object_classes[nid] = SupportedProfile
15128
extension_object_ids['SupportedProfile'] = nid
15129
nid = FourByteNodeId(ObjectIds.SoftwareCertificate_Encoding_DefaultBinary)
15130
extension_object_classes[nid] = SoftwareCertificate
15131
extension_object_ids['SoftwareCertificate'] = nid
15132
nid = FourByteNodeId(ObjectIds.QueryDataDescription_Encoding_DefaultBinary)
15133
extension_object_classes[nid] = QueryDataDescription
15134
extension_object_ids['QueryDataDescription'] = nid
15135 1
nid = FourByteNodeId(ObjectIds.NodeTypeDescription_Encoding_DefaultBinary)
15136
extension_object_classes[nid] = NodeTypeDescription
15137
extension_object_ids['NodeTypeDescription'] = nid
15138 1
nid = FourByteNodeId(ObjectIds.QueryDataSet_Encoding_DefaultBinary)
15139
extension_object_classes[nid] = QueryDataSet
15140
extension_object_ids['QueryDataSet'] = nid
15141
nid = FourByteNodeId(ObjectIds.NodeReference_Encoding_DefaultBinary)
15142
extension_object_classes[nid] = NodeReference
15143
extension_object_ids['NodeReference'] = nid
15144
nid = FourByteNodeId(ObjectIds.ContentFilterElement_Encoding_DefaultBinary)
15145
extension_object_classes[nid] = ContentFilterElement
15146
extension_object_ids['ContentFilterElement'] = nid
15147
nid = FourByteNodeId(ObjectIds.ContentFilter_Encoding_DefaultBinary)
15148
extension_object_classes[nid] = ContentFilter
15149
extension_object_ids['ContentFilter'] = nid
15150
nid = FourByteNodeId(ObjectIds.ElementOperand_Encoding_DefaultBinary)
15151
extension_object_classes[nid] = ElementOperand
15152
extension_object_ids['ElementOperand'] = nid
15153
nid = FourByteNodeId(ObjectIds.LiteralOperand_Encoding_DefaultBinary)
15154
extension_object_classes[nid] = LiteralOperand
15155
extension_object_ids['LiteralOperand'] = nid
15156
nid = FourByteNodeId(ObjectIds.AttributeOperand_Encoding_DefaultBinary)
15157
extension_object_classes[nid] = AttributeOperand
15158
extension_object_ids['AttributeOperand'] = nid
15159
nid = FourByteNodeId(ObjectIds.SimpleAttributeOperand_Encoding_DefaultBinary)
15160 1
extension_object_classes[nid] = SimpleAttributeOperand
15161
extension_object_ids['SimpleAttributeOperand'] = nid
15162
nid = FourByteNodeId(ObjectIds.ContentFilterElementResult_Encoding_DefaultBinary)
15163
extension_object_classes[nid] = ContentFilterElementResult
15164
extension_object_ids['ContentFilterElementResult'] = nid
15165
nid = FourByteNodeId(ObjectIds.ContentFilterResult_Encoding_DefaultBinary)
15166
extension_object_classes[nid] = ContentFilterResult
15167
extension_object_ids['ContentFilterResult'] = nid
15168
nid = FourByteNodeId(ObjectIds.ParsingResult_Encoding_DefaultBinary)
15169
extension_object_classes[nid] = ParsingResult
15170
extension_object_ids['ParsingResult'] = nid
15171
nid = FourByteNodeId(ObjectIds.QueryFirstRequest_Encoding_DefaultBinary)
15172 1
extension_object_classes[nid] = QueryFirstRequest
15173
extension_object_ids['QueryFirstRequest'] = nid
15174
nid = FourByteNodeId(ObjectIds.QueryFirstResponse_Encoding_DefaultBinary)
15175
extension_object_classes[nid] = QueryFirstResponse
15176
extension_object_ids['QueryFirstResponse'] = nid
15177
nid = FourByteNodeId(ObjectIds.QueryNextRequest_Encoding_DefaultBinary)
15178
extension_object_classes[nid] = QueryNextRequest
15179
extension_object_ids['QueryNextRequest'] = nid
15180
nid = FourByteNodeId(ObjectIds.QueryNextResponse_Encoding_DefaultBinary)
15181
extension_object_classes[nid] = QueryNextResponse
15182
extension_object_ids['QueryNextResponse'] = nid
15183
nid = FourByteNodeId(ObjectIds.ReadValueId_Encoding_DefaultBinary)
15184
extension_object_classes[nid] = ReadValueId
15185
extension_object_ids['ReadValueId'] = nid
15186
nid = FourByteNodeId(ObjectIds.ReadRequest_Encoding_DefaultBinary)
15187
extension_object_classes[nid] = ReadRequest
15188 1
extension_object_ids['ReadRequest'] = nid
15189
nid = FourByteNodeId(ObjectIds.ReadResponse_Encoding_DefaultBinary)
15190
extension_object_classes[nid] = ReadResponse
15191
extension_object_ids['ReadResponse'] = nid
15192
nid = FourByteNodeId(ObjectIds.HistoryReadValueId_Encoding_DefaultBinary)
15193
extension_object_classes[nid] = HistoryReadValueId
15194
extension_object_ids['HistoryReadValueId'] = nid
15195
nid = FourByteNodeId(ObjectIds.HistoryReadResult_Encoding_DefaultBinary)
15196
extension_object_classes[nid] = HistoryReadResult
15197
extension_object_ids['HistoryReadResult'] = nid
15198
nid = FourByteNodeId(ObjectIds.HistoryReadDetails_Encoding_DefaultBinary)
15199
extension_object_classes[nid] = HistoryReadDetails
15200
extension_object_ids['HistoryReadDetails'] = nid
15201
nid = FourByteNodeId(ObjectIds.ReadEventDetails_Encoding_DefaultBinary)
15202
extension_object_classes[nid] = ReadEventDetails
15203 1
extension_object_ids['ReadEventDetails'] = nid
15204
nid = FourByteNodeId(ObjectIds.ReadRawModifiedDetails_Encoding_DefaultBinary)
15205
extension_object_classes[nid] = ReadRawModifiedDetails
15206
extension_object_ids['ReadRawModifiedDetails'] = nid
15207 1
nid = FourByteNodeId(ObjectIds.ReadProcessedDetails_Encoding_DefaultBinary)
15208
extension_object_classes[nid] = ReadProcessedDetails
15209
extension_object_ids['ReadProcessedDetails'] = nid
15210
nid = FourByteNodeId(ObjectIds.ReadAtTimeDetails_Encoding_DefaultBinary)
15211
extension_object_classes[nid] = ReadAtTimeDetails
15212
extension_object_ids['ReadAtTimeDetails'] = nid
15213
nid = FourByteNodeId(ObjectIds.HistoryData_Encoding_DefaultBinary)
15214
extension_object_classes[nid] = HistoryData
15215
extension_object_ids['HistoryData'] = nid
15216
nid = FourByteNodeId(ObjectIds.ModificationInfo_Encoding_DefaultBinary)
15217
extension_object_classes[nid] = ModificationInfo
15218 1
extension_object_ids['ModificationInfo'] = nid
15219
nid = FourByteNodeId(ObjectIds.HistoryModifiedData_Encoding_DefaultBinary)
15220
extension_object_classes[nid] = HistoryModifiedData
15221
extension_object_ids['HistoryModifiedData'] = nid
15222
nid = FourByteNodeId(ObjectIds.HistoryEvent_Encoding_DefaultBinary)
15223
extension_object_classes[nid] = HistoryEvent
15224
extension_object_ids['HistoryEvent'] = nid
15225
nid = FourByteNodeId(ObjectIds.HistoryReadRequest_Encoding_DefaultBinary)
15226
extension_object_classes[nid] = HistoryReadRequest
15227
extension_object_ids['HistoryReadRequest'] = nid
15228
nid = FourByteNodeId(ObjectIds.HistoryReadResponse_Encoding_DefaultBinary)
15229 1
extension_object_classes[nid] = HistoryReadResponse
15230
extension_object_ids['HistoryReadResponse'] = nid
15231
nid = FourByteNodeId(ObjectIds.WriteValue_Encoding_DefaultBinary)
15232 1
extension_object_classes[nid] = WriteValue
15233
extension_object_ids['WriteValue'] = nid
15234
nid = FourByteNodeId(ObjectIds.WriteRequest_Encoding_DefaultBinary)
15235
extension_object_classes[nid] = WriteRequest
15236
extension_object_ids['WriteRequest'] = nid
15237
nid = FourByteNodeId(ObjectIds.WriteResponse_Encoding_DefaultBinary)
15238
extension_object_classes[nid] = WriteResponse
15239
extension_object_ids['WriteResponse'] = nid
15240 1
nid = FourByteNodeId(ObjectIds.HistoryUpdateDetails_Encoding_DefaultBinary)
15241
extension_object_classes[nid] = HistoryUpdateDetails
15242
extension_object_ids['HistoryUpdateDetails'] = nid
15243
nid = FourByteNodeId(ObjectIds.UpdateDataDetails_Encoding_DefaultBinary)
15244
extension_object_classes[nid] = UpdateDataDetails
15245 1
extension_object_ids['UpdateDataDetails'] = nid
15246
nid = FourByteNodeId(ObjectIds.UpdateStructureDataDetails_Encoding_DefaultBinary)
15247
extension_object_classes[nid] = UpdateStructureDataDetails
15248
extension_object_ids['UpdateStructureDataDetails'] = nid
15249
nid = FourByteNodeId(ObjectIds.UpdateEventDetails_Encoding_DefaultBinary)
15250
extension_object_classes[nid] = UpdateEventDetails
15251
extension_object_ids['UpdateEventDetails'] = nid
15252
nid = FourByteNodeId(ObjectIds.DeleteRawModifiedDetails_Encoding_DefaultBinary)
15253
extension_object_classes[nid] = DeleteRawModifiedDetails
15254 1
extension_object_ids['DeleteRawModifiedDetails'] = nid
15255
nid = FourByteNodeId(ObjectIds.DeleteAtTimeDetails_Encoding_DefaultBinary)
15256
extension_object_classes[nid] = DeleteAtTimeDetails
15257
extension_object_ids['DeleteAtTimeDetails'] = nid
15258
nid = FourByteNodeId(ObjectIds.DeleteEventDetails_Encoding_DefaultBinary)
15259
extension_object_classes[nid] = DeleteEventDetails
15260 1
extension_object_ids['DeleteEventDetails'] = nid
15261
nid = FourByteNodeId(ObjectIds.HistoryUpdateResult_Encoding_DefaultBinary)
15262
extension_object_classes[nid] = HistoryUpdateResult
15263
extension_object_ids['HistoryUpdateResult'] = nid
15264 1
nid = FourByteNodeId(ObjectIds.HistoryUpdateRequest_Encoding_DefaultBinary)
15265
extension_object_classes[nid] = HistoryUpdateRequest
15266
extension_object_ids['HistoryUpdateRequest'] = nid
15267
nid = FourByteNodeId(ObjectIds.HistoryUpdateResponse_Encoding_DefaultBinary)
15268 1
extension_object_classes[nid] = HistoryUpdateResponse
15269
extension_object_ids['HistoryUpdateResponse'] = nid
15270
nid = FourByteNodeId(ObjectIds.CallMethodRequest_Encoding_DefaultBinary)
15271
extension_object_classes[nid] = CallMethodRequest
15272 1
extension_object_ids['CallMethodRequest'] = nid
15273
nid = FourByteNodeId(ObjectIds.CallMethodResult_Encoding_DefaultBinary)
15274
extension_object_classes[nid] = CallMethodResult
15275 1
extension_object_ids['CallMethodResult'] = nid
15276
nid = FourByteNodeId(ObjectIds.CallRequest_Encoding_DefaultBinary)
15277
extension_object_classes[nid] = CallRequest
15278
extension_object_ids['CallRequest'] = nid
15279
nid = FourByteNodeId(ObjectIds.CallResponse_Encoding_DefaultBinary)
15280
extension_object_classes[nid] = CallResponse
15281
extension_object_ids['CallResponse'] = nid
15282
nid = FourByteNodeId(ObjectIds.MonitoringFilter_Encoding_DefaultBinary)
15283 1
extension_object_classes[nid] = MonitoringFilter
15284
extension_object_ids['MonitoringFilter'] = nid
15285
nid = FourByteNodeId(ObjectIds.DataChangeFilter_Encoding_DefaultBinary)
15286
extension_object_classes[nid] = DataChangeFilter
15287
extension_object_ids['DataChangeFilter'] = nid
15288 1
nid = FourByteNodeId(ObjectIds.EventFilter_Encoding_DefaultBinary)
15289
extension_object_classes[nid] = EventFilter
15290
extension_object_ids['EventFilter'] = nid
15291
nid = FourByteNodeId(ObjectIds.AggregateConfiguration_Encoding_DefaultBinary)
15292
extension_object_classes[nid] = AggregateConfiguration
15293
extension_object_ids['AggregateConfiguration'] = nid
15294
nid = FourByteNodeId(ObjectIds.AggregateFilter_Encoding_DefaultBinary)
15295
extension_object_classes[nid] = AggregateFilter
15296
extension_object_ids['AggregateFilter'] = nid
15297 1
nid = FourByteNodeId(ObjectIds.MonitoringFilterResult_Encoding_DefaultBinary)
15298
extension_object_classes[nid] = MonitoringFilterResult
15299
extension_object_ids['MonitoringFilterResult'] = nid
15300
nid = FourByteNodeId(ObjectIds.EventFilterResult_Encoding_DefaultBinary)
15301
extension_object_classes[nid] = EventFilterResult
15302
extension_object_ids['EventFilterResult'] = nid
15303 1
nid = FourByteNodeId(ObjectIds.AggregateFilterResult_Encoding_DefaultBinary)
15304
extension_object_classes[nid] = AggregateFilterResult
15305
extension_object_ids['AggregateFilterResult'] = nid
15306
nid = FourByteNodeId(ObjectIds.MonitoringParameters_Encoding_DefaultBinary)
15307 1
extension_object_classes[nid] = MonitoringParameters
15308
extension_object_ids['MonitoringParameters'] = nid
15309
nid = FourByteNodeId(ObjectIds.MonitoredItemCreateRequest_Encoding_DefaultBinary)
15310
extension_object_classes[nid] = MonitoredItemCreateRequest
15311 1
extension_object_ids['MonitoredItemCreateRequest'] = nid
15312
nid = FourByteNodeId(ObjectIds.MonitoredItemCreateResult_Encoding_DefaultBinary)
15313
extension_object_classes[nid] = MonitoredItemCreateResult
15314
extension_object_ids['MonitoredItemCreateResult'] = nid
15315 1
nid = FourByteNodeId(ObjectIds.CreateMonitoredItemsRequest_Encoding_DefaultBinary)
15316
extension_object_classes[nid] = CreateMonitoredItemsRequest
15317
extension_object_ids['CreateMonitoredItemsRequest'] = nid
15318 1
nid = FourByteNodeId(ObjectIds.CreateMonitoredItemsResponse_Encoding_DefaultBinary)
15319
extension_object_classes[nid] = CreateMonitoredItemsResponse
15320
extension_object_ids['CreateMonitoredItemsResponse'] = nid
15321
nid = FourByteNodeId(ObjectIds.MonitoredItemModifyRequest_Encoding_DefaultBinary)
15322
extension_object_classes[nid] = MonitoredItemModifyRequest
15323
extension_object_ids['MonitoredItemModifyRequest'] = nid
15324
nid = FourByteNodeId(ObjectIds.MonitoredItemModifyResult_Encoding_DefaultBinary)
15325
extension_object_classes[nid] = MonitoredItemModifyResult
15326
extension_object_ids['MonitoredItemModifyResult'] = nid
15327
nid = FourByteNodeId(ObjectIds.ModifyMonitoredItemsRequest_Encoding_DefaultBinary)
15328
extension_object_classes[nid] = ModifyMonitoredItemsRequest
15329
extension_object_ids['ModifyMonitoredItemsRequest'] = nid
15330
nid = FourByteNodeId(ObjectIds.ModifyMonitoredItemsResponse_Encoding_DefaultBinary)
15331
extension_object_classes[nid] = ModifyMonitoredItemsResponse
15332
extension_object_ids['ModifyMonitoredItemsResponse'] = nid
15333
nid = FourByteNodeId(ObjectIds.SetMonitoringModeRequest_Encoding_DefaultBinary)
15334
extension_object_classes[nid] = SetMonitoringModeRequest
15335
extension_object_ids['SetMonitoringModeRequest'] = nid
15336
nid = FourByteNodeId(ObjectIds.SetMonitoringModeResponse_Encoding_DefaultBinary)
15337
extension_object_classes[nid] = SetMonitoringModeResponse
15338
extension_object_ids['SetMonitoringModeResponse'] = nid
15339
nid = FourByteNodeId(ObjectIds.SetTriggeringRequest_Encoding_DefaultBinary)
15340
extension_object_classes[nid] = SetTriggeringRequest
15341
extension_object_ids['SetTriggeringRequest'] = nid
15342
nid = FourByteNodeId(ObjectIds.SetTriggeringResponse_Encoding_DefaultBinary)
15343
extension_object_classes[nid] = SetTriggeringResponse
15344
extension_object_ids['SetTriggeringResponse'] = nid
15345
nid = FourByteNodeId(ObjectIds.DeleteMonitoredItemsRequest_Encoding_DefaultBinary)
15346
extension_object_classes[nid] = DeleteMonitoredItemsRequest
15347
extension_object_ids['DeleteMonitoredItemsRequest'] = nid
15348
nid = FourByteNodeId(ObjectIds.DeleteMonitoredItemsResponse_Encoding_DefaultBinary)
15349
extension_object_classes[nid] = DeleteMonitoredItemsResponse
15350
extension_object_ids['DeleteMonitoredItemsResponse'] = nid
15351
nid = FourByteNodeId(ObjectIds.CreateSubscriptionRequest_Encoding_DefaultBinary)
15352
extension_object_classes[nid] = CreateSubscriptionRequest
15353
extension_object_ids['CreateSubscriptionRequest'] = nid
15354
nid = FourByteNodeId(ObjectIds.CreateSubscriptionResponse_Encoding_DefaultBinary)
15355
extension_object_classes[nid] = CreateSubscriptionResponse
15356
extension_object_ids['CreateSubscriptionResponse'] = nid
15357
nid = FourByteNodeId(ObjectIds.ModifySubscriptionRequest_Encoding_DefaultBinary)
15358
extension_object_classes[nid] = ModifySubscriptionRequest
15359
extension_object_ids['ModifySubscriptionRequest'] = nid
15360
nid = FourByteNodeId(ObjectIds.ModifySubscriptionResponse_Encoding_DefaultBinary)
15361
extension_object_classes[nid] = ModifySubscriptionResponse
15362
extension_object_ids['ModifySubscriptionResponse'] = nid
15363
nid = FourByteNodeId(ObjectIds.SetPublishingModeRequest_Encoding_DefaultBinary)
15364
extension_object_classes[nid] = SetPublishingModeRequest
15365
extension_object_ids['SetPublishingModeRequest'] = nid
15366
nid = FourByteNodeId(ObjectIds.SetPublishingModeResponse_Encoding_DefaultBinary)
15367
extension_object_classes[nid] = SetPublishingModeResponse
15368
extension_object_ids['SetPublishingModeResponse'] = nid
15369
nid = FourByteNodeId(ObjectIds.NotificationMessage_Encoding_DefaultBinary)
15370
extension_object_classes[nid] = NotificationMessage
15371
extension_object_ids['NotificationMessage'] = nid
15372
nid = FourByteNodeId(ObjectIds.NotificationData_Encoding_DefaultBinary)
15373
extension_object_classes[nid] = NotificationData
15374
extension_object_ids['NotificationData'] = nid
15375
nid = FourByteNodeId(ObjectIds.DataChangeNotification_Encoding_DefaultBinary)
15376
extension_object_classes[nid] = DataChangeNotification
15377
extension_object_ids['DataChangeNotification'] = nid
15378
nid = FourByteNodeId(ObjectIds.MonitoredItemNotification_Encoding_DefaultBinary)
15379
extension_object_classes[nid] = MonitoredItemNotification
15380
extension_object_ids['MonitoredItemNotification'] = nid
15381
nid = FourByteNodeId(ObjectIds.EventNotificationList_Encoding_DefaultBinary)
15382
extension_object_classes[nid] = EventNotificationList
15383
extension_object_ids['EventNotificationList'] = nid
15384 1
nid = FourByteNodeId(ObjectIds.EventFieldList_Encoding_DefaultBinary)
15385
extension_object_classes[nid] = EventFieldList
15386
extension_object_ids['EventFieldList'] = nid
15387
nid = FourByteNodeId(ObjectIds.HistoryEventFieldList_Encoding_DefaultBinary)
15388
extension_object_classes[nid] = HistoryEventFieldList
15389
extension_object_ids['HistoryEventFieldList'] = nid
15390
nid = FourByteNodeId(ObjectIds.StatusChangeNotification_Encoding_DefaultBinary)
15391
extension_object_classes[nid] = StatusChangeNotification
15392
extension_object_ids['StatusChangeNotification'] = nid
15393
nid = FourByteNodeId(ObjectIds.SubscriptionAcknowledgement_Encoding_DefaultBinary)
15394
extension_object_classes[nid] = SubscriptionAcknowledgement
15395
extension_object_ids['SubscriptionAcknowledgement'] = nid
15396
nid = FourByteNodeId(ObjectIds.PublishRequest_Encoding_DefaultBinary)
15397
extension_object_classes[nid] = PublishRequest
15398
extension_object_ids['PublishRequest'] = nid
15399
nid = FourByteNodeId(ObjectIds.PublishResponse_Encoding_DefaultBinary)
15400
extension_object_classes[nid] = PublishResponse
15401
extension_object_ids['PublishResponse'] = nid
15402
nid = FourByteNodeId(ObjectIds.RepublishRequest_Encoding_DefaultBinary)
15403
extension_object_classes[nid] = RepublishRequest
15404
extension_object_ids['RepublishRequest'] = nid
15405
nid = FourByteNodeId(ObjectIds.RepublishResponse_Encoding_DefaultBinary)
15406
extension_object_classes[nid] = RepublishResponse
15407
extension_object_ids['RepublishResponse'] = nid
15408
nid = FourByteNodeId(ObjectIds.TransferResult_Encoding_DefaultBinary)
15409
extension_object_classes[nid] = TransferResult
15410
extension_object_ids['TransferResult'] = nid
15411
nid = FourByteNodeId(ObjectIds.TransferSubscriptionsRequest_Encoding_DefaultBinary)
15412
extension_object_classes[nid] = TransferSubscriptionsRequest
15413
extension_object_ids['TransferSubscriptionsRequest'] = nid
15414
nid = FourByteNodeId(ObjectIds.TransferSubscriptionsResponse_Encoding_DefaultBinary)
15415
extension_object_classes[nid] = TransferSubscriptionsResponse
15416
extension_object_ids['TransferSubscriptionsResponse'] = nid
15417
nid = FourByteNodeId(ObjectIds.DeleteSubscriptionsRequest_Encoding_DefaultBinary)
15418 1
extension_object_classes[nid] = DeleteSubscriptionsRequest
15419
extension_object_ids['DeleteSubscriptionsRequest'] = nid
15420
nid = FourByteNodeId(ObjectIds.DeleteSubscriptionsResponse_Encoding_DefaultBinary)
15421
extension_object_classes[nid] = DeleteSubscriptionsResponse
15422
extension_object_ids['DeleteSubscriptionsResponse'] = nid
15423
nid = FourByteNodeId(ObjectIds.BuildInfo_Encoding_DefaultBinary)
15424
extension_object_classes[nid] = BuildInfo
15425
extension_object_ids['BuildInfo'] = nid
15426
nid = FourByteNodeId(ObjectIds.RedundantServerDataType_Encoding_DefaultBinary)
15427
extension_object_classes[nid] = RedundantServerDataType
15428
extension_object_ids['RedundantServerDataType'] = nid
15429
nid = FourByteNodeId(ObjectIds.EndpointUrlListDataType_Encoding_DefaultBinary)
15430
extension_object_classes[nid] = EndpointUrlListDataType
15431
extension_object_ids['EndpointUrlListDataType'] = nid
15432
nid = FourByteNodeId(ObjectIds.NetworkGroupDataType_Encoding_DefaultBinary)
15433
extension_object_classes[nid] = NetworkGroupDataType
15434
extension_object_ids['NetworkGroupDataType'] = nid
15435
nid = FourByteNodeId(ObjectIds.SamplingIntervalDiagnosticsDataType_Encoding_DefaultBinary)
15436
extension_object_classes[nid] = SamplingIntervalDiagnosticsDataType
15437
extension_object_ids['SamplingIntervalDiagnosticsDataType'] = nid
15438
nid = FourByteNodeId(ObjectIds.ServerDiagnosticsSummaryDataType_Encoding_DefaultBinary)
15439
extension_object_classes[nid] = ServerDiagnosticsSummaryDataType
15440
extension_object_ids['ServerDiagnosticsSummaryDataType'] = nid
15441
nid = FourByteNodeId(ObjectIds.ServerStatusDataType_Encoding_DefaultBinary)
15442
extension_object_classes[nid] = ServerStatusDataType
15443
extension_object_ids['ServerStatusDataType'] = nid
15444
nid = FourByteNodeId(ObjectIds.SessionDiagnosticsDataType_Encoding_DefaultBinary)
15445
extension_object_classes[nid] = SessionDiagnosticsDataType
15446
extension_object_ids['SessionDiagnosticsDataType'] = nid
15447
nid = FourByteNodeId(ObjectIds.SessionSecurityDiagnosticsDataType_Encoding_DefaultBinary)
15448
extension_object_classes[nid] = SessionSecurityDiagnosticsDataType
15449
extension_object_ids['SessionSecurityDiagnosticsDataType'] = nid
15450
nid = FourByteNodeId(ObjectIds.ServiceCounterDataType_Encoding_DefaultBinary)
15451
extension_object_classes[nid] = ServiceCounterDataType
15452
extension_object_ids['ServiceCounterDataType'] = nid
15453
nid = FourByteNodeId(ObjectIds.StatusResult_Encoding_DefaultBinary)
15454
extension_object_classes[nid] = StatusResult
15455
extension_object_ids['StatusResult'] = nid
15456 1
nid = FourByteNodeId(ObjectIds.SubscriptionDiagnosticsDataType_Encoding_DefaultBinary)
15457
extension_object_classes[nid] = SubscriptionDiagnosticsDataType
15458
extension_object_ids['SubscriptionDiagnosticsDataType'] = nid
15459
nid = FourByteNodeId(ObjectIds.ModelChangeStructureDataType_Encoding_DefaultBinary)
15460
extension_object_classes[nid] = ModelChangeStructureDataType
15461
extension_object_ids['ModelChangeStructureDataType'] = nid
15462
nid = FourByteNodeId(ObjectIds.SemanticChangeStructureDataType_Encoding_DefaultBinary)
15463
extension_object_classes[nid] = SemanticChangeStructureDataType
15464
extension_object_ids['SemanticChangeStructureDataType'] = nid
15465
nid = FourByteNodeId(ObjectIds.Range_Encoding_DefaultBinary)
15466
extension_object_classes[nid] = Range
15467
extension_object_ids['Range'] = nid
15468
nid = FourByteNodeId(ObjectIds.EUInformation_Encoding_DefaultBinary)
15469
extension_object_classes[nid] = EUInformation
15470
extension_object_ids['EUInformation'] = nid
15471
nid = FourByteNodeId(ObjectIds.ComplexNumberType_Encoding_DefaultBinary)
15472
extension_object_classes[nid] = ComplexNumberType
15473
extension_object_ids['ComplexNumberType'] = nid
15474
nid = FourByteNodeId(ObjectIds.DoubleComplexNumberType_Encoding_DefaultBinary)
15475
extension_object_classes[nid] = DoubleComplexNumberType
15476
extension_object_ids['DoubleComplexNumberType'] = nid
15477
nid = FourByteNodeId(ObjectIds.AxisInformation_Encoding_DefaultBinary)
15478
extension_object_classes[nid] = AxisInformation
15479
extension_object_ids['AxisInformation'] = nid
15480
nid = FourByteNodeId(ObjectIds.XVType_Encoding_DefaultBinary)
15481
extension_object_classes[nid] = XVType
15482
extension_object_ids['XVType'] = nid
15483
nid = FourByteNodeId(ObjectIds.ProgramDiagnosticDataType_Encoding_DefaultBinary)
15484
extension_object_classes[nid] = ProgramDiagnosticDataType
15485
extension_object_ids['ProgramDiagnosticDataType'] = nid
15486
nid = FourByteNodeId(ObjectIds.Annotation_Encoding_DefaultBinary)
15487
extension_object_classes[nid] = Annotation
15488
extension_object_ids['Annotation'] = nid
15489