Completed
Pull Request — master (#394)
by
unknown
06:10
created

SoftwareCertificate   A

Complexity

Total Complexity 9

Size/Duplication

Total Lines 104
Duplicated Lines 32.69 %

Test Coverage

Coverage 14.81%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 34
loc 104
ccs 8
cts 54
cp 0.1481
rs 10
wmc 9

How to fix   Duplicated Code   

Duplicated Code

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

Common duplication problems, and corresponding solutions are:

1
'''
2
Autogenerate code from xml spec
3
'''
4
5 1
from datetime import datetime
6 1
from enum import Enum, IntEnum
7
8 1
from opcua.common.utils import Buffer
9 1
from opcua.ua.uaerrors import UaError
10 1
from opcua.ua.uatypes import *
11 1
from opcua.ua import ua_binary as uabin
12 1
from opcua.ua.object_ids import ObjectIds
13
14
15 1
class NamingRuleType(IntEnum):
16
    '''
17
    :ivar Mandatory:
18
    :vartype Mandatory: 1
19
    :ivar Optional:
20
    :vartype Optional: 2
21
    :ivar Constraint:
22
    :vartype Constraint: 3
23
    '''
24 1
    Mandatory = 1
25 1
    Optional = 2
26 1
    Constraint = 3
27
28
29 1
class OpenFileMode(IntEnum):
30
    '''
31
    :ivar Read:
32
    :vartype Read: 1
33
    :ivar Write:
34
    :vartype Write: 2
35
    :ivar EraseExisting:
36
    :vartype EraseExisting: 4
37
    :ivar Append:
38
    :vartype Append: 8
39
    '''
40 1
    Read = 1
41 1
    Write = 2
42 1
    EraseExisting = 4
43 1
    Append = 8
44
45
46 1
class TrustListMasks(IntEnum):
47
    '''
48
    :ivar None_:
49
    :vartype None_: 0
50
    :ivar TrustedCertificates:
51
    :vartype TrustedCertificates: 1
52
    :ivar TrustedCrls:
53
    :vartype TrustedCrls: 2
54
    :ivar IssuerCertificates:
55
    :vartype IssuerCertificates: 4
56
    :ivar IssuerCrls:
57
    :vartype IssuerCrls: 8
58
    :ivar All:
59
    :vartype All: 15
60
    '''
61 1
    None_ = 0
62 1
    TrustedCertificates = 1
63 1
    TrustedCrls = 2
64 1
    IssuerCertificates = 4
65 1
    IssuerCrls = 8
66 1
    All = 15
67
68
69 1
class IdType(IntEnum):
70
    '''
71
    The type of identifier used in a node id.
72
73
    :ivar Numeric:
74
    :vartype Numeric: 0
75
    :ivar String:
76
    :vartype String: 1
77
    :ivar Guid:
78
    :vartype Guid: 2
79
    :ivar Opaque:
80
    :vartype Opaque: 3
81
    '''
82 1
    Numeric = 0
83 1
    String = 1
84 1
    Guid = 2
85 1
    Opaque = 3
86
87
88 1
class NodeClass(IntEnum):
89
    '''
90
    A mask specifying the class of the node.
91
92
    :ivar Unspecified:
93
    :vartype Unspecified: 0
94
    :ivar Object:
95
    :vartype Object: 1
96
    :ivar Variable:
97
    :vartype Variable: 2
98
    :ivar Method:
99
    :vartype Method: 4
100
    :ivar ObjectType:
101
    :vartype ObjectType: 8
102
    :ivar VariableType:
103
    :vartype VariableType: 16
104
    :ivar ReferenceType:
105
    :vartype ReferenceType: 32
106
    :ivar DataType:
107
    :vartype DataType: 64
108
    :ivar View:
109
    :vartype View: 128
110
    '''
111 1
    Unspecified = 0
112 1
    Object = 1
113 1
    Variable = 2
114 1
    Method = 4
115 1
    ObjectType = 8
116 1
    VariableType = 16
117 1
    ReferenceType = 32
118 1
    DataType = 64
119 1
    View = 128
120
121
122 1
class ApplicationType(IntEnum):
123
    '''
124
    The types of applications.
125
126
    :ivar Server:
127
    :vartype Server: 0
128
    :ivar Client:
129
    :vartype Client: 1
130
    :ivar ClientAndServer:
131
    :vartype ClientAndServer: 2
132
    :ivar DiscoveryServer:
133
    :vartype DiscoveryServer: 3
134
    '''
135 1
    Server = 0
136 1
    Client = 1
137 1
    ClientAndServer = 2
138 1
    DiscoveryServer = 3
139
140
141 1
class MessageSecurityMode(IntEnum):
142
    '''
143
    The type of security to use on a message.
144
145
    :ivar Invalid:
146
    :vartype Invalid: 0
147
    :ivar None_:
148
    :vartype None_: 1
149
    :ivar Sign:
150
    :vartype Sign: 2
151
    :ivar SignAndEncrypt:
152
    :vartype SignAndEncrypt: 3
153
    '''
154 1
    Invalid = 0
155 1
    None_ = 1
156 1
    Sign = 2
157 1
    SignAndEncrypt = 3
158
159
160 1
class UserTokenType(IntEnum):
161
    '''
162
    The possible user token types.
163
164
    :ivar Anonymous:
165
    :vartype Anonymous: 0
166
    :ivar UserName:
167
    :vartype UserName: 1
168
    :ivar Certificate:
169
    :vartype Certificate: 2
170
    :ivar IssuedToken:
171
    :vartype IssuedToken: 3
172
    :ivar Kerberos:
173
    :vartype Kerberos: 4
174
    '''
175 1
    Anonymous = 0
176 1
    UserName = 1
177 1
    Certificate = 2
178 1
    IssuedToken = 3
179 1
    Kerberos = 4
180
181
182 1
class SecurityTokenRequestType(IntEnum):
183
    '''
184
    Indicates whether a token if being created or renewed.
185
186
    :ivar Issue:
187
    :vartype Issue: 0
188
    :ivar Renew:
189
    :vartype Renew: 1
190
    '''
191 1
    Issue = 0
192 1
    Renew = 1
193
194
195 1
class NodeAttributesMask(IntEnum):
196
    '''
197
    The bits used to specify default attributes for a new node.
198
199
    :ivar None_:
200
    :vartype None_: 0
201
    :ivar AccessLevel:
202
    :vartype AccessLevel: 1
203
    :ivar ArrayDimensions:
204
    :vartype ArrayDimensions: 2
205
    :ivar BrowseName:
206
    :vartype BrowseName: 4
207
    :ivar ContainsNoLoops:
208
    :vartype ContainsNoLoops: 8
209
    :ivar DataType:
210
    :vartype DataType: 16
211
    :ivar Description:
212
    :vartype Description: 32
213
    :ivar DisplayName:
214
    :vartype DisplayName: 64
215
    :ivar EventNotifier:
216
    :vartype EventNotifier: 128
217
    :ivar Executable:
218
    :vartype Executable: 256
219
    :ivar Historizing:
220
    :vartype Historizing: 512
221
    :ivar InverseName:
222
    :vartype InverseName: 1024
223
    :ivar IsAbstract:
224
    :vartype IsAbstract: 2048
225
    :ivar MinimumSamplingInterval:
226
    :vartype MinimumSamplingInterval: 4096
227
    :ivar NodeClass:
228
    :vartype NodeClass: 8192
229
    :ivar NodeId:
230
    :vartype NodeId: 16384
231
    :ivar Symmetric:
232
    :vartype Symmetric: 32768
233
    :ivar UserAccessLevel:
234
    :vartype UserAccessLevel: 65536
235
    :ivar UserExecutable:
236
    :vartype UserExecutable: 131072
237
    :ivar UserWriteMask:
238
    :vartype UserWriteMask: 262144
239
    :ivar ValueRank:
240
    :vartype ValueRank: 524288
241
    :ivar WriteMask:
242
    :vartype WriteMask: 1048576
243
    :ivar Value:
244
    :vartype Value: 2097152
245
    :ivar All:
246
    :vartype All: 4194303
247
    :ivar BaseNode:
248
    :vartype BaseNode: 1335396
249
    :ivar Object:
250
    :vartype Object: 1335524
251
    :ivar ObjectTypeOrDataType:
252
    :vartype ObjectTypeOrDataType: 1337444
253
    :ivar Variable:
254
    :vartype Variable: 4026999
255
    :ivar VariableType:
256
    :vartype VariableType: 3958902
257
    :ivar Method:
258
    :vartype Method: 1466724
259
    :ivar ReferenceType:
260
    :vartype ReferenceType: 1371236
261
    :ivar View:
262
    :vartype View: 1335532
263
    '''
264 1
    None_ = 0
265 1
    AccessLevel = 1
266 1
    ArrayDimensions = 2
267 1
    BrowseName = 4
268 1
    ContainsNoLoops = 8
269 1
    DataType = 16
270 1
    Description = 32
271 1
    DisplayName = 64
272 1
    EventNotifier = 128
273 1
    Executable = 256
274 1
    Historizing = 512
275 1
    InverseName = 1024
276 1
    IsAbstract = 2048
277 1
    MinimumSamplingInterval = 4096
278 1
    NodeClass = 8192
279 1
    NodeId = 16384
280 1
    Symmetric = 32768
281 1
    UserAccessLevel = 65536
282 1
    UserExecutable = 131072
283 1
    UserWriteMask = 262144
284 1
    ValueRank = 524288
285 1
    WriteMask = 1048576
286 1
    Value = 2097152
287 1
    All = 4194303
288 1
    BaseNode = 1335396
289 1
    Object = 1335524
290 1
    ObjectTypeOrDataType = 1337444
291 1
    Variable = 4026999
292 1
    VariableType = 3958902
293 1
    Method = 1466724
294 1
    ReferenceType = 1371236
295 1
    View = 1335532
296
297 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
298 1
class AttributeWriteMask(IntEnum):
299
    '''
300
    Define bits used to indicate which attributes are writable.
301
302
    :ivar None_:
303
    :vartype None_: 0
304
    :ivar AccessLevel:
305
    :vartype AccessLevel: 1
306
    :ivar ArrayDimensions:
307
    :vartype ArrayDimensions: 2
308
    :ivar BrowseName:
309
    :vartype BrowseName: 4
310
    :ivar ContainsNoLoops:
311
    :vartype ContainsNoLoops: 8
312
    :ivar DataType:
313
    :vartype DataType: 16
314
    :ivar Description:
315
    :vartype Description: 32
316
    :ivar DisplayName:
317
    :vartype DisplayName: 64
318
    :ivar EventNotifier:
319
    :vartype EventNotifier: 128
320
    :ivar Executable:
321
    :vartype Executable: 256
322
    :ivar Historizing:
323
    :vartype Historizing: 512
324
    :ivar InverseName:
325
    :vartype InverseName: 1024
326
    :ivar IsAbstract:
327
    :vartype IsAbstract: 2048
328
    :ivar MinimumSamplingInterval:
329
    :vartype MinimumSamplingInterval: 4096
330
    :ivar NodeClass:
331
    :vartype NodeClass: 8192
332
    :ivar NodeId:
333
    :vartype NodeId: 16384
334
    :ivar Symmetric:
335
    :vartype Symmetric: 32768
336
    :ivar UserAccessLevel:
337
    :vartype UserAccessLevel: 65536
338
    :ivar UserExecutable:
339
    :vartype UserExecutable: 131072
340
    :ivar UserWriteMask:
341
    :vartype UserWriteMask: 262144
342
    :ivar ValueRank:
343
    :vartype ValueRank: 524288
344
    :ivar WriteMask:
345
    :vartype WriteMask: 1048576
346
    :ivar ValueForVariableType:
347
    :vartype ValueForVariableType: 2097152
348
    '''
349 1
    None_ = 0
350 1
    AccessLevel = 1
351 1
    ArrayDimensions = 2
352 1
    BrowseName = 4
353 1
    ContainsNoLoops = 8
354 1
    DataType = 16
355 1
    Description = 32
356 1
    DisplayName = 64
357 1
    EventNotifier = 128
358 1
    Executable = 256
359 1
    Historizing = 512
360 1
    InverseName = 1024
361 1
    IsAbstract = 2048
362 1
    MinimumSamplingInterval = 4096
363 1
    NodeClass = 8192
364 1
    NodeId = 16384
365 1
    Symmetric = 32768
366 1
    UserAccessLevel = 65536
367 1
    UserExecutable = 131072
368 1
    UserWriteMask = 262144
369 1
    ValueRank = 524288
370 1
    WriteMask = 1048576
371 1
    ValueForVariableType = 2097152
372
373
374 1
class BrowseDirection(IntEnum):
375
    '''
376
    The directions of the references to return.
377
378
    :ivar Forward:
379
    :vartype Forward: 0
380
    :ivar Inverse:
381
    :vartype Inverse: 1
382
    :ivar Both:
383
    :vartype Both: 2
384
    '''
385 1
    Forward = 0
386 1
    Inverse = 1
387 1
    Both = 2
388
389
390 1
class BrowseResultMask(IntEnum):
391
    '''
392
    A bit mask which specifies what should be returned in a browse response.
393
394
    :ivar None_:
395
    :vartype None_: 0
396
    :ivar ReferenceTypeId:
397
    :vartype ReferenceTypeId: 1
398
    :ivar IsForward:
399
    :vartype IsForward: 2
400
    :ivar NodeClass:
401
    :vartype NodeClass: 4
402
    :ivar BrowseName:
403
    :vartype BrowseName: 8
404
    :ivar DisplayName:
405
    :vartype DisplayName: 16
406
    :ivar TypeDefinition:
407
    :vartype TypeDefinition: 32
408
    :ivar All:
409
    :vartype All: 63
410
    :ivar ReferenceTypeInfo:
411
    :vartype ReferenceTypeInfo: 3
412
    :ivar TargetInfo:
413
    :vartype TargetInfo: 60
414
    '''
415 1
    None_ = 0
416 1
    ReferenceTypeId = 1
417 1
    IsForward = 2
418 1
    NodeClass = 4
419 1
    BrowseName = 8
420 1
    DisplayName = 16
421 1
    TypeDefinition = 32
422 1
    All = 63
423 1
    ReferenceTypeInfo = 3
424 1
    TargetInfo = 60
425
426
427 1
class ComplianceLevel(IntEnum):
428
    '''
429
    :ivar Untested:
430
    :vartype Untested: 0
431
    :ivar Partial:
432
    :vartype Partial: 1
433
    :ivar SelfTested:
434
    :vartype SelfTested: 2
435
    :ivar Certified:
436
    :vartype Certified: 3
437
    '''
438 1
    Untested = 0
439 1
    Partial = 1
440 1
    SelfTested = 2
441 1
    Certified = 3
442
443
444 1
class FilterOperator(IntEnum):
445
    '''
446
    :ivar Equals:
447
    :vartype Equals: 0
448
    :ivar IsNull:
449
    :vartype IsNull: 1
450
    :ivar GreaterThan:
451
    :vartype GreaterThan: 2
452
    :ivar LessThan:
453
    :vartype LessThan: 3
454
    :ivar GreaterThanOrEqual:
455
    :vartype GreaterThanOrEqual: 4
456
    :ivar LessThanOrEqual:
457
    :vartype LessThanOrEqual: 5
458
    :ivar Like:
459
    :vartype Like: 6
460
    :ivar Not:
461
    :vartype Not: 7
462
    :ivar Between:
463
    :vartype Between: 8
464
    :ivar InList:
465
    :vartype InList: 9
466
    :ivar And:
467
    :vartype And: 10
468
    :ivar Or:
469
    :vartype Or: 11
470
    :ivar Cast:
471
    :vartype Cast: 12
472
    :ivar InView:
473
    :vartype InView: 13
474
    :ivar OfType:
475
    :vartype OfType: 14
476
    :ivar RelatedTo:
477
    :vartype RelatedTo: 15
478
    :ivar BitwiseAnd:
479
    :vartype BitwiseAnd: 16
480
    :ivar BitwiseOr:
481
    :vartype BitwiseOr: 17
482
    '''
483 1
    Equals = 0
484 1
    IsNull = 1
485 1
    GreaterThan = 2
486 1
    LessThan = 3
487 1
    GreaterThanOrEqual = 4
488 1
    LessThanOrEqual = 5
489 1
    Like = 6
490 1
    Not = 7
491 1
    Between = 8
492 1
    InList = 9
493 1
    And = 10
494 1
    Or = 11
495 1
    Cast = 12
496 1
    InView = 13
497 1
    OfType = 14
498 1
    RelatedTo = 15
499 1
    BitwiseAnd = 16
500 1
    BitwiseOr = 17
501
502
503 1
class TimestampsToReturn(IntEnum):
504
    '''
505
    :ivar Source:
506
    :vartype Source: 0
507
    :ivar Server:
508
    :vartype Server: 1
509
    :ivar Both:
510
    :vartype Both: 2
511
    :ivar Neither:
512
    :vartype Neither: 3
513
    '''
514 1
    Source = 0
515 1
    Server = 1
516 1
    Both = 2
517 1
    Neither = 3
518
519
520 1
class HistoryUpdateType(IntEnum):
521
    '''
522
    :ivar Insert:
523
    :vartype Insert: 1
524
    :ivar Replace:
525
    :vartype Replace: 2
526
    :ivar Update:
527
    :vartype Update: 3
528
    :ivar Delete:
529
    :vartype Delete: 4
530
    '''
531 1
    Insert = 1
532 1
    Replace = 2
533 1
    Update = 3
534 1
    Delete = 4
535
536
537 1
class PerformUpdateType(IntEnum):
538
    '''
539
    :ivar Insert:
540
    :vartype Insert: 1
541
    :ivar Replace:
542
    :vartype Replace: 2
543
    :ivar Update:
544
    :vartype Update: 3
545
    :ivar Remove:
546
    :vartype Remove: 4
547
    '''
548 1
    Insert = 1
549 1
    Replace = 2
550 1
    Update = 3
551 1
    Remove = 4
552
553
554 1
class MonitoringMode(IntEnum):
555
    '''
556
    :ivar Disabled:
557
    :vartype Disabled: 0
558
    :ivar Sampling:
559
    :vartype Sampling: 1
560
    :ivar Reporting:
561
    :vartype Reporting: 2
562
    '''
563 1
    Disabled = 0
564 1
    Sampling = 1
565 1
    Reporting = 2
566
567
568 1
class DataChangeTrigger(IntEnum):
569
    '''
570
    :ivar Status:
571
    :vartype Status: 0
572
    :ivar StatusValue:
573
    :vartype StatusValue: 1
574
    :ivar StatusValueTimestamp:
575
    :vartype StatusValueTimestamp: 2
576
    '''
577 1
    Status = 0
578 1
    StatusValue = 1
579 1
    StatusValueTimestamp = 2
580
581
582 1
class DeadbandType(IntEnum):
583
    '''
584
    :ivar None_:
585
    :vartype None_: 0
586
    :ivar Absolute:
587
    :vartype Absolute: 1
588
    :ivar Percent:
589
    :vartype Percent: 2
590
    '''
591 1
    None_ = 0
592 1
    Absolute = 1
593 1
    Percent = 2
594
595
596 1
class EnumeratedTestType(IntEnum):
597
    '''
598
    A simple enumerated type used for testing.
599
600
    :ivar Red:
601
    :vartype Red: 1
602
    :ivar Yellow:
603
    :vartype Yellow: 4
604
    :ivar Green:
605
    :vartype Green: 5
606
    '''
607 1
    Red = 1
608 1
    Yellow = 4
609 1
    Green = 5
610
611
612 1
class RedundancySupport(IntEnum):
613
    '''
614
    :ivar None_:
615
    :vartype None_: 0
616
    :ivar Cold:
617
    :vartype Cold: 1
618
    :ivar Warm:
619
    :vartype Warm: 2
620
    :ivar Hot:
621
    :vartype Hot: 3
622
    :ivar Transparent:
623
    :vartype Transparent: 4
624
    :ivar HotAndMirrored:
625
    :vartype HotAndMirrored: 5
626
    '''
627 1
    None_ = 0
628 1
    Cold = 1
629 1
    Warm = 2
630 1
    Hot = 3
631 1
    Transparent = 4
632 1
    HotAndMirrored = 5
633
634
635 1
class ServerState(IntEnum):
636
    '''
637
    :ivar Running:
638
    :vartype Running: 0
639
    :ivar Failed:
640
    :vartype Failed: 1
641
    :ivar NoConfiguration:
642
    :vartype NoConfiguration: 2
643
    :ivar Suspended:
644
    :vartype Suspended: 3
645
    :ivar Shutdown:
646
    :vartype Shutdown: 4
647
    :ivar Test:
648
    :vartype Test: 5
649
    :ivar CommunicationFault:
650
    :vartype CommunicationFault: 6
651
    :ivar Unknown:
652
    :vartype Unknown: 7
653
    '''
654 1
    Running = 0
655 1
    Failed = 1
656 1
    NoConfiguration = 2
657 1
    Suspended = 3
658 1
    Shutdown = 4
659 1
    Test = 5
660 1
    CommunicationFault = 6
661 1
    Unknown = 7
662
663
664 1
class ModelChangeStructureVerbMask(IntEnum):
665
    '''
666
    :ivar NodeAdded:
667
    :vartype NodeAdded: 1
668
    :ivar NodeDeleted:
669
    :vartype NodeDeleted: 2
670
    :ivar ReferenceAdded:
671
    :vartype ReferenceAdded: 4
672
    :ivar ReferenceDeleted:
673
    :vartype ReferenceDeleted: 8
674
    :ivar DataTypeChanged:
675
    :vartype DataTypeChanged: 16
676
    '''
677 1
    NodeAdded = 1
678 1
    NodeDeleted = 2
679 1
    ReferenceAdded = 4
680 1
    ReferenceDeleted = 8
681 1
    DataTypeChanged = 16
682
683
684 1
class AxisScaleEnumeration(IntEnum):
685
    '''
686
    :ivar Linear:
687
    :vartype Linear: 0
688
    :ivar Log:
689
    :vartype Log: 1
690
    :ivar Ln:
691
    :vartype Ln: 2
692
    '''
693 1
    Linear = 0
694 1
    Log = 1
695 1
    Ln = 2
696
697
698 1
class ExceptionDeviationFormat(IntEnum):
699
    '''
700
    :ivar AbsoluteValue:
701
    :vartype AbsoluteValue: 0
702
    :ivar PercentOfValue:
703
    :vartype PercentOfValue: 1
704
    :ivar PercentOfRange:
705
    :vartype PercentOfRange: 2
706
    :ivar PercentOfEURange:
707
    :vartype PercentOfEURange: 3
708
    :ivar Unknown:
709
    :vartype Unknown: 4
710
    '''
711 1
    AbsoluteValue = 0
712 1
    PercentOfValue = 1
713 1
    PercentOfRange = 2
714 1
    PercentOfEURange = 3
715 1
    Unknown = 4
716
717
718 1
class DiagnosticInfo(FrozenClass):
719
    '''
720
    A recursive structure containing diagnostic information associated with a status code.
721
722
    :ivar Encoding:
723
    :vartype Encoding: UInt8
724
    :ivar SymbolicId:
725
    :vartype SymbolicId: Int32
726
    :ivar NamespaceURI:
727
    :vartype NamespaceURI: Int32
728
    :ivar Locale:
729
    :vartype Locale: Int32
730
    :ivar LocalizedText:
731
    :vartype LocalizedText: Int32
732
    :ivar AdditionalInfo:
733
    :vartype AdditionalInfo: CharArray
734
    :ivar InnerStatusCode:
735
    :vartype InnerStatusCode: StatusCode
736
    :ivar InnerDiagnosticInfo:
737
    :vartype InnerDiagnosticInfo: DiagnosticInfo
738
    '''
739
740 1
    ua_types = {
741
        'Encoding': 'UInt8',
742
        'SymbolicId': 'Int32',
743
        'NamespaceURI': 'Int32',
744
        'Locale': 'Int32',
745
        'LocalizedText': 'Int32',
746
        'AdditionalInfo': 'CharArray',
747
        'InnerStatusCode': 'StatusCode',
748
        'InnerDiagnosticInfo': 'DiagnosticInfo',
749
               }
750
751 1
    def __init__(self, binary=None):
752 1
        if binary is not None:
753 1
            self._binary_init(binary)
754 1
            self._freeze = True
755 1
            return
756 1
        self.Encoding = 0
757 1
        self.SymbolicId = 0
758 1
        self.NamespaceURI = 0
759 1
        self.Locale = 0
760 1
        self.LocalizedText = 0
761 1
        self.AdditionalInfo = None
762 1
        self.InnerStatusCode = StatusCode()
763 1
        self.InnerDiagnosticInfo = None
764 1
        self._freeze = True
765
766 1
    def to_binary(self):
767 1
        packet = []
768 1
        if self.SymbolicId: self.Encoding |= (1 << 0)
769 1
        if self.NamespaceURI: self.Encoding |= (1 << 1)
770 1
        if self.Locale: self.Encoding |= (1 << 2)
771 1
        if self.LocalizedText: self.Encoding |= (1 << 3)
772 1
        if self.AdditionalInfo: self.Encoding |= (1 << 4)
773 1
        if self.InnerStatusCode: self.Encoding |= (1 << 5)
774 1
        if self.InnerDiagnosticInfo: self.Encoding |= (1 << 6)
775 1
        packet.append(uabin.Primitives.UInt8.pack(self.Encoding))
776 1
        if self.SymbolicId: 
777
            packet.append(uabin.Primitives.Int32.pack(self.SymbolicId))
778 1
        if self.NamespaceURI: 
779
            packet.append(uabin.Primitives.Int32.pack(self.NamespaceURI))
780 1
        if self.Locale: 
781
            packet.append(uabin.Primitives.Int32.pack(self.Locale))
782 1
        if self.LocalizedText: 
783
            packet.append(uabin.Primitives.Int32.pack(self.LocalizedText))
784 1
        if self.AdditionalInfo: 
785
            packet.append(uabin.Primitives.CharArray.pack(self.AdditionalInfo))
786 1
        if self.InnerStatusCode: 
787 1
            packet.append(self.InnerStatusCode.to_binary())
788 1
        if self.InnerDiagnosticInfo: 
789
            packet.append(self.InnerDiagnosticInfo.to_binary())
790 1
        return b''.join(packet)
791
792 1
    @staticmethod
793
    def from_binary(data):
794 1
        return DiagnosticInfo(data)
795
796 1
    def _binary_init(self, data):
797 1
        self.Encoding = uabin.Primitives.UInt8.unpack(data)
798 1
        if self.Encoding & (1 << 0):
799
            self.SymbolicId = uabin.Primitives.Int32.unpack(data)
800
        else:
801 1
            self.SymbolicId = 0
802 1
        if self.Encoding & (1 << 1):
803
            self.NamespaceURI = uabin.Primitives.Int32.unpack(data)
804
        else:
805 1
            self.NamespaceURI = 0
806 1
        if self.Encoding & (1 << 2):
807
            self.Locale = uabin.Primitives.Int32.unpack(data)
808
        else:
809 1
            self.Locale = 0
810 1
        if self.Encoding & (1 << 3):
811
            self.LocalizedText = uabin.Primitives.Int32.unpack(data)
812
        else:
813 1
            self.LocalizedText = 0
814 1
        if self.Encoding & (1 << 4):
815
            self.AdditionalInfo = uabin.Primitives.CharArray.unpack(data)
816
        else:
817 1
            self.AdditionalInfo = None
818 1
        if self.Encoding & (1 << 5):
819 1
            self.InnerStatusCode = StatusCode.from_binary(data)
820
        else:
821
            self.InnerStatusCode = StatusCode()
822 1
        if self.Encoding & (1 << 6):
823
            self.InnerDiagnosticInfo = DiagnosticInfo.from_binary(data)
824
        else:
825 1
            self.InnerDiagnosticInfo = None
826
827 1
    def __str__(self):
828
        return 'DiagnosticInfo(' + 'Encoding:' + str(self.Encoding) + ', ' + \
829
               'SymbolicId:' + str(self.SymbolicId) + ', ' + \
830
               'NamespaceURI:' + str(self.NamespaceURI) + ', ' + \
831
               'Locale:' + str(self.Locale) + ', ' + \
832
               'LocalizedText:' + str(self.LocalizedText) + ', ' + \
833
               'AdditionalInfo:' + str(self.AdditionalInfo) + ', ' + \
834
               'InnerStatusCode:' + str(self.InnerStatusCode) + ', ' + \
835
               'InnerDiagnosticInfo:' + str(self.InnerDiagnosticInfo) + ')'
836
837 1
    __repr__ = __str__
838
839
840 1
class TrustListDataType(FrozenClass):
841
    '''
842
    :ivar SpecifiedLists:
843
    :vartype SpecifiedLists: UInt32
844
    :ivar TrustedCertificates:
845
    :vartype TrustedCertificates: ByteString
846
    :ivar TrustedCrls:
847
    :vartype TrustedCrls: ByteString
848
    :ivar IssuerCertificates:
849
    :vartype IssuerCertificates: ByteString
850
    :ivar IssuerCrls:
851
    :vartype IssuerCrls: ByteString
852
    '''
853
854 1
    ua_types = {
855
        'SpecifiedLists': 'UInt32',
856
        'TrustedCertificates': 'ByteString',
857
        'TrustedCrls': 'ByteString',
858
        'IssuerCertificates': 'ByteString',
859
        'IssuerCrls': 'ByteString',
860
               }
861
862 1
    def __init__(self, binary=None):
863
        if binary is not None:
864
            self._binary_init(binary)
865
            self._freeze = True
866
            return
867
        self.SpecifiedLists = 0
868
        self.TrustedCertificates = []
869
        self.TrustedCrls = []
870
        self.IssuerCertificates = []
871
        self.IssuerCrls = []
872
        self._freeze = True
873
874 1
    def to_binary(self):
875
        packet = []
876
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedLists))
877
        packet.append(uabin.Primitives.Int32.pack(len(self.TrustedCertificates)))
878
        for fieldname in self.TrustedCertificates:
879
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
880
        packet.append(uabin.Primitives.Int32.pack(len(self.TrustedCrls)))
881
        for fieldname in self.TrustedCrls:
882
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
883
        packet.append(uabin.Primitives.Int32.pack(len(self.IssuerCertificates)))
884
        for fieldname in self.IssuerCertificates:
885
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
886
        packet.append(uabin.Primitives.Int32.pack(len(self.IssuerCrls)))
887
        for fieldname in self.IssuerCrls:
888
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
889
        return b''.join(packet)
890
891 1
    @staticmethod
892
    def from_binary(data):
893
        return TrustListDataType(data)
894
895 1
    def _binary_init(self, data):
896
        self.SpecifiedLists = uabin.Primitives.UInt32.unpack(data)
897
        self.TrustedCertificates = uabin.Primitives.ByteString.unpack_array(data)
898
        self.TrustedCrls = uabin.Primitives.ByteString.unpack_array(data)
899
        self.IssuerCertificates = uabin.Primitives.ByteString.unpack_array(data)
900
        self.IssuerCrls = uabin.Primitives.ByteString.unpack_array(data)
901
902 1
    def __str__(self):
903
        return 'TrustListDataType(' + 'SpecifiedLists:' + str(self.SpecifiedLists) + ', ' + \
904
               'TrustedCertificates:' + str(self.TrustedCertificates) + ', ' + \
905
               'TrustedCrls:' + str(self.TrustedCrls) + ', ' + \
906
               'IssuerCertificates:' + str(self.IssuerCertificates) + ', ' + \
907
               'IssuerCrls:' + str(self.IssuerCrls) + ')'
908
909 1
    __repr__ = __str__
910
911
912 1
class Argument(FrozenClass):
913
    '''
914
    An argument for a method.
915
916
    :ivar Name:
917
    :vartype Name: String
918
    :ivar DataType:
919
    :vartype DataType: NodeId
920
    :ivar ValueRank:
921
    :vartype ValueRank: Int32
922
    :ivar ArrayDimensions:
923
    :vartype ArrayDimensions: UInt32
924
    :ivar Description:
925
    :vartype Description: LocalizedText
926
    '''
927
928 1
    ua_types = {
929
        'Name': 'String',
930
        'DataType': 'NodeId',
931
        'ValueRank': 'Int32',
932
        'ArrayDimensions': 'UInt32',
933
        'Description': 'LocalizedText',
934
               }
935
936 1
    def __init__(self, binary=None):
937 1
        if binary is not None:
938 1
            self._binary_init(binary)
939 1
            self._freeze = True
940 1
            return
941 1
        self.Name = None
942 1
        self.DataType = NodeId()
943 1
        self.ValueRank = 0
944 1
        self.ArrayDimensions = []
945 1
        self.Description = LocalizedText()
946 1
        self._freeze = True
947
948 1
    def to_binary(self):
949 1
        packet = []
950 1
        packet.append(uabin.Primitives.String.pack(self.Name))
951 1
        packet.append(self.DataType.to_binary())
952 1
        packet.append(uabin.Primitives.Int32.pack(self.ValueRank))
953 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ArrayDimensions)))
954 1
        for fieldname in self.ArrayDimensions:
955 1
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
956 1
        packet.append(self.Description.to_binary())
957 1
        return b''.join(packet)
958
959 1
    @staticmethod
960
    def from_binary(data):
961 1
        return Argument(data)
962
963 1
    def _binary_init(self, data):
964 1
        self.Name = uabin.Primitives.String.unpack(data)
965 1
        self.DataType = NodeId.from_binary(data)
966 1
        self.ValueRank = uabin.Primitives.Int32.unpack(data)
967 1
        self.ArrayDimensions = uabin.Primitives.UInt32.unpack_array(data)
968 1
        self.Description = LocalizedText.from_binary(data)
969
970 1
    def __str__(self):
971
        return 'Argument(' + 'Name:' + str(self.Name) + ', ' + \
972
               'DataType:' + str(self.DataType) + ', ' + \
973
               'ValueRank:' + str(self.ValueRank) + ', ' + \
974
               'ArrayDimensions:' + str(self.ArrayDimensions) + ', ' + \
975
               'Description:' + str(self.Description) + ')'
976
977 1
    __repr__ = __str__
978
979
980 1
class EnumValueType(FrozenClass):
981
    '''
982
    A mapping between a value of an enumerated type and a name and description.
983
984
    :ivar Value:
985
    :vartype Value: Int64
986
    :ivar DisplayName:
987
    :vartype DisplayName: LocalizedText
988
    :ivar Description:
989
    :vartype Description: LocalizedText
990
    '''
991
992 1
    ua_types = {
993
        'Value': 'Int64',
994
        'DisplayName': 'LocalizedText',
995
        'Description': 'LocalizedText',
996
               }
997
998 1
    def __init__(self, binary=None):
999 1
        if binary is not None:
1000 1
            self._binary_init(binary)
1001 1
            self._freeze = True
1002 1
            return
1003 1
        self.Value = 0
1004 1
        self.DisplayName = LocalizedText()
1005 1
        self.Description = LocalizedText()
1006 1
        self._freeze = True
1007
1008 1
    def to_binary(self):
1009 1
        packet = []
1010 1
        packet.append(uabin.Primitives.Int64.pack(self.Value))
1011 1
        packet.append(self.DisplayName.to_binary())
1012 1
        packet.append(self.Description.to_binary())
1013 1
        return b''.join(packet)
1014
1015 1
    @staticmethod
1016
    def from_binary(data):
1017 1
        return EnumValueType(data)
1018
1019 1
    def _binary_init(self, data):
1020 1
        self.Value = uabin.Primitives.Int64.unpack(data)
1021 1
        self.DisplayName = LocalizedText.from_binary(data)
1022 1
        self.Description = LocalizedText.from_binary(data)
1023
1024 1
    def __str__(self):
1025
        return 'EnumValueType(' + 'Value:' + str(self.Value) + ', ' + \
1026
               'DisplayName:' + str(self.DisplayName) + ', ' + \
1027
               'Description:' + str(self.Description) + ')'
1028
1029 1
    __repr__ = __str__
1030
1031
1032 1
class OptionSet(FrozenClass):
1033
    '''
1034
    This abstract Structured DataType is the base DataType for all DataTypes representing a bit mask.
1035
1036
    :ivar Value:
1037
    :vartype Value: ByteString
1038
    :ivar ValidBits:
1039
    :vartype ValidBits: ByteString
1040
    '''
1041
1042 1
    ua_types = {
1043
        'Value': 'ByteString',
1044
        'ValidBits': 'ByteString',
1045
               }
1046
1047 1
    def __init__(self, binary=None):
1048
        if binary is not None:
1049
            self._binary_init(binary)
1050
            self._freeze = True
1051
            return
1052
        self.Value = None
1053
        self.ValidBits = None
1054
        self._freeze = True
1055
1056 1
    def to_binary(self):
1057
        packet = []
1058
        packet.append(uabin.Primitives.ByteString.pack(self.Value))
1059
        packet.append(uabin.Primitives.ByteString.pack(self.ValidBits))
1060
        return b''.join(packet)
1061
1062 1
    @staticmethod
1063
    def from_binary(data):
1064
        return OptionSet(data)
1065
1066 1
    def _binary_init(self, data):
1067
        self.Value = uabin.Primitives.ByteString.unpack(data)
1068
        self.ValidBits = uabin.Primitives.ByteString.unpack(data)
1069
1070 1
    def __str__(self):
1071
        return 'OptionSet(' + 'Value:' + str(self.Value) + ', ' + \
1072
               'ValidBits:' + str(self.ValidBits) + ')'
1073
1074 1
    __repr__ = __str__
1075
1076
1077 1
class Union(FrozenClass):
1078
    '''
1079
    This abstract DataType is the base DataType for all union DataTypes.
1080
1081
    '''
1082
1083 1
    ua_types = {
1084
               }
1085
1086 1
    def __init__(self, binary=None):
1087
        if binary is not None:
1088
            self._binary_init(binary)
1089
            self._freeze = True
1090
            return
1091
        self._freeze = True
1092
1093 1
    def to_binary(self):
1094
        packet = []
1095
        return b''.join(packet)
1096
1097 1
    @staticmethod
1098
    def from_binary(data):
1099
        return Union(data)
1100
1101 1
    def _binary_init(self, data):
1102
        pass
1103
1104 1
    def __str__(self):
1105
        return 'Union(' +  + ')'
1106
1107 1
    __repr__ = __str__
1108
1109
1110 1
class TimeZoneDataType(FrozenClass):
1111
    '''
1112
    :ivar Offset:
1113
    :vartype Offset: Int16
1114
    :ivar DaylightSavingInOffset:
1115
    :vartype DaylightSavingInOffset: Boolean
1116
    '''
1117
1118 1
    ua_types = {
1119
        'Offset': 'Int16',
1120
        'DaylightSavingInOffset': 'Boolean',
1121
               }
1122
1123 1
    def __init__(self, binary=None):
1124
        if binary is not None:
1125
            self._binary_init(binary)
1126
            self._freeze = True
1127
            return
1128
        self.Offset = 0
1129
        self.DaylightSavingInOffset = True
1130
        self._freeze = True
1131
1132 1
    def to_binary(self):
1133
        packet = []
1134
        packet.append(uabin.Primitives.Int16.pack(self.Offset))
1135
        packet.append(uabin.Primitives.Boolean.pack(self.DaylightSavingInOffset))
1136
        return b''.join(packet)
1137
1138 1
    @staticmethod
1139
    def from_binary(data):
1140
        return TimeZoneDataType(data)
1141
1142 1
    def _binary_init(self, data):
1143
        self.Offset = uabin.Primitives.Int16.unpack(data)
1144
        self.DaylightSavingInOffset = uabin.Primitives.Boolean.unpack(data)
1145
1146 1
    def __str__(self):
1147
        return 'TimeZoneDataType(' + 'Offset:' + str(self.Offset) + ', ' + \
1148
               'DaylightSavingInOffset:' + str(self.DaylightSavingInOffset) + ')'
1149
1150 1
    __repr__ = __str__
1151
1152
1153 1
class ApplicationDescription(FrozenClass):
1154
    '''
1155
    Describes an application and how to find it.
1156
1157
    :ivar ApplicationUri:
1158
    :vartype ApplicationUri: String
1159
    :ivar ProductUri:
1160
    :vartype ProductUri: String
1161
    :ivar ApplicationName:
1162
    :vartype ApplicationName: LocalizedText
1163
    :ivar ApplicationType:
1164
    :vartype ApplicationType: ApplicationType
1165
    :ivar GatewayServerUri:
1166
    :vartype GatewayServerUri: String
1167
    :ivar DiscoveryProfileUri:
1168
    :vartype DiscoveryProfileUri: String
1169
    :ivar DiscoveryUrls:
1170
    :vartype DiscoveryUrls: String
1171
    '''
1172
1173 1
    ua_types = {
1174
        'ApplicationUri': 'String',
1175
        'ProductUri': 'String',
1176
        'ApplicationName': 'LocalizedText',
1177
        'ApplicationType': 'ApplicationType',
1178
        'GatewayServerUri': 'String',
1179
        'DiscoveryProfileUri': 'String',
1180
        'DiscoveryUrls': 'String',
1181
               }
1182
1183 1
    def __init__(self, binary=None):
1184 1
        if binary is not None:
1185 1
            self._binary_init(binary)
1186 1
            self._freeze = True
1187 1
            return
1188 1
        self.ApplicationUri = None
1189 1
        self.ProductUri = None
1190 1
        self.ApplicationName = LocalizedText()
1191 1
        self.ApplicationType = ApplicationType(0)
1192 1
        self.GatewayServerUri = None
1193 1
        self.DiscoveryProfileUri = None
1194 1
        self.DiscoveryUrls = []
1195 1
        self._freeze = True
1196
1197 1 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1198 1
        packet = []
1199 1
        packet.append(uabin.Primitives.String.pack(self.ApplicationUri))
1200 1
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
1201 1
        packet.append(self.ApplicationName.to_binary())
1202 1
        packet.append(uabin.Primitives.UInt32.pack(self.ApplicationType.value))
1203 1
        packet.append(uabin.Primitives.String.pack(self.GatewayServerUri))
1204 1
        packet.append(uabin.Primitives.String.pack(self.DiscoveryProfileUri))
1205 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiscoveryUrls)))
1206 1
        for fieldname in self.DiscoveryUrls:
1207 1
            packet.append(uabin.Primitives.String.pack(fieldname))
1208 1
        return b''.join(packet)
1209
1210 1
    @staticmethod
1211
    def from_binary(data):
1212 1
        return ApplicationDescription(data)
1213
1214 1
    def _binary_init(self, data):
1215 1
        self.ApplicationUri = uabin.Primitives.String.unpack(data)
1216 1
        self.ProductUri = uabin.Primitives.String.unpack(data)
1217 1
        self.ApplicationName = LocalizedText.from_binary(data)
1218 1
        self.ApplicationType = ApplicationType(uabin.Primitives.UInt32.unpack(data))
1219 1
        self.GatewayServerUri = uabin.Primitives.String.unpack(data)
1220 1
        self.DiscoveryProfileUri = uabin.Primitives.String.unpack(data)
1221 1
        self.DiscoveryUrls = uabin.Primitives.String.unpack_array(data)
1222
1223 1
    def __str__(self):
1224
        return 'ApplicationDescription(' + 'ApplicationUri:' + str(self.ApplicationUri) + ', ' + \
1225
               'ProductUri:' + str(self.ProductUri) + ', ' + \
1226
               'ApplicationName:' + str(self.ApplicationName) + ', ' + \
1227
               'ApplicationType:' + str(self.ApplicationType) + ', ' + \
1228
               'GatewayServerUri:' + str(self.GatewayServerUri) + ', ' + \
1229
               'DiscoveryProfileUri:' + str(self.DiscoveryProfileUri) + ', ' + \
1230
               'DiscoveryUrls:' + str(self.DiscoveryUrls) + ')'
1231
1232 1
    __repr__ = __str__
1233
1234
1235 1
class RequestHeader(FrozenClass):
1236
    '''
1237
    The header passed with every server request.
1238
1239
    :ivar AuthenticationToken:
1240
    :vartype AuthenticationToken: NodeId
1241
    :ivar Timestamp:
1242
    :vartype Timestamp: DateTime
1243
    :ivar RequestHandle:
1244
    :vartype RequestHandle: UInt32
1245
    :ivar ReturnDiagnostics:
1246
    :vartype ReturnDiagnostics: UInt32
1247
    :ivar AuditEntryId:
1248
    :vartype AuditEntryId: String
1249
    :ivar TimeoutHint:
1250
    :vartype TimeoutHint: UInt32
1251
    :ivar AdditionalHeader:
1252
    :vartype AdditionalHeader: ExtensionObject
1253
    '''
1254
1255 1
    ua_types = {
1256
        'AuthenticationToken': 'NodeId',
1257
        'Timestamp': 'DateTime',
1258
        'RequestHandle': 'UInt32',
1259
        'ReturnDiagnostics': 'UInt32',
1260
        'AuditEntryId': 'String',
1261
        'TimeoutHint': 'UInt32',
1262
        'AdditionalHeader': 'ExtensionObject',
1263
               }
1264
1265 1
    def __init__(self, binary=None):
1266 1
        if binary is not None:
1267 1
            self._binary_init(binary)
1268 1
            self._freeze = True
1269 1
            return
1270 1
        self.AuthenticationToken = NodeId()
1271 1
        self.Timestamp = datetime.utcnow()
1272 1
        self.RequestHandle = 0
1273 1
        self.ReturnDiagnostics = 0
1274 1
        self.AuditEntryId = None
1275 1
        self.TimeoutHint = 0
1276 1
        self.AdditionalHeader = None
1277 1
        self._freeze = True
1278
1279 1
    def to_binary(self):
1280 1
        packet = []
1281 1
        packet.append(self.AuthenticationToken.to_binary())
1282 1
        packet.append(uabin.Primitives.DateTime.pack(self.Timestamp))
1283 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestHandle))
1284 1
        packet.append(uabin.Primitives.UInt32.pack(self.ReturnDiagnostics))
1285 1
        packet.append(uabin.Primitives.String.pack(self.AuditEntryId))
1286 1
        packet.append(uabin.Primitives.UInt32.pack(self.TimeoutHint))
1287 1
        packet.append(extensionobject_to_binary(self.AdditionalHeader))
1288 1
        return b''.join(packet)
1289
1290 1
    @staticmethod
1291
    def from_binary(data):
1292 1
        return RequestHeader(data)
1293
1294 1
    def _binary_init(self, data):
1295 1
        self.AuthenticationToken = NodeId.from_binary(data)
1296 1
        self.Timestamp = uabin.Primitives.DateTime.unpack(data)
1297 1
        self.RequestHandle = uabin.Primitives.UInt32.unpack(data)
1298 1
        self.ReturnDiagnostics = uabin.Primitives.UInt32.unpack(data)
1299 1
        self.AuditEntryId = uabin.Primitives.String.unpack(data)
1300 1
        self.TimeoutHint = uabin.Primitives.UInt32.unpack(data)
1301 1
        self.AdditionalHeader = extensionobject_from_binary(data)
1302
1303 1
    def __str__(self):
1304
        return 'RequestHeader(' + 'AuthenticationToken:' + str(self.AuthenticationToken) + ', ' + \
1305
               'Timestamp:' + str(self.Timestamp) + ', ' + \
1306
               'RequestHandle:' + str(self.RequestHandle) + ', ' + \
1307
               'ReturnDiagnostics:' + str(self.ReturnDiagnostics) + ', ' + \
1308
               'AuditEntryId:' + str(self.AuditEntryId) + ', ' + \
1309
               'TimeoutHint:' + str(self.TimeoutHint) + ', ' + \
1310
               'AdditionalHeader:' + str(self.AdditionalHeader) + ')'
1311
1312 1
    __repr__ = __str__
1313
1314
1315 1
class ResponseHeader(FrozenClass):
1316
    '''
1317
    The header passed with every server response.
1318
1319
    :ivar Timestamp:
1320
    :vartype Timestamp: DateTime
1321
    :ivar RequestHandle:
1322
    :vartype RequestHandle: UInt32
1323
    :ivar ServiceResult:
1324
    :vartype ServiceResult: StatusCode
1325
    :ivar ServiceDiagnostics:
1326
    :vartype ServiceDiagnostics: DiagnosticInfo
1327
    :ivar StringTable:
1328
    :vartype StringTable: String
1329
    :ivar AdditionalHeader:
1330
    :vartype AdditionalHeader: ExtensionObject
1331
    '''
1332
1333 1
    ua_types = {
1334
        'Timestamp': 'DateTime',
1335
        'RequestHandle': 'UInt32',
1336
        'ServiceResult': 'StatusCode',
1337
        'ServiceDiagnostics': 'DiagnosticInfo',
1338
        'StringTable': 'String',
1339
        'AdditionalHeader': 'ExtensionObject',
1340
               }
1341
1342 1
    def __init__(self, binary=None):
1343 1
        if binary is not None:
1344 1
            self._binary_init(binary)
1345 1
            self._freeze = True
1346 1
            return
1347 1
        self.Timestamp = datetime.utcnow()
1348 1
        self.RequestHandle = 0
1349 1
        self.ServiceResult = StatusCode()
1350 1
        self.ServiceDiagnostics = DiagnosticInfo()
1351 1
        self.StringTable = []
1352 1
        self.AdditionalHeader = None
1353 1
        self._freeze = True
1354
1355 1
    def to_binary(self):
1356 1
        packet = []
1357 1
        packet.append(uabin.Primitives.DateTime.pack(self.Timestamp))
1358 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestHandle))
1359 1
        packet.append(self.ServiceResult.to_binary())
1360 1
        packet.append(self.ServiceDiagnostics.to_binary())
1361 1
        packet.append(uabin.Primitives.Int32.pack(len(self.StringTable)))
1362 1
        for fieldname in self.StringTable:
1363
            packet.append(uabin.Primitives.String.pack(fieldname))
1364 1
        packet.append(extensionobject_to_binary(self.AdditionalHeader))
1365 1
        return b''.join(packet)
1366
1367 1
    @staticmethod
1368
    def from_binary(data):
1369 1
        return ResponseHeader(data)
1370
1371 1
    def _binary_init(self, data):
1372 1
        self.Timestamp = uabin.Primitives.DateTime.unpack(data)
1373 1
        self.RequestHandle = uabin.Primitives.UInt32.unpack(data)
1374 1
        self.ServiceResult = StatusCode.from_binary(data)
1375 1
        self.ServiceDiagnostics = DiagnosticInfo.from_binary(data)
1376 1
        self.StringTable = uabin.Primitives.String.unpack_array(data)
1377 1
        self.AdditionalHeader = extensionobject_from_binary(data)
1378
1379 1
    def __str__(self):
1380
        return 'ResponseHeader(' + 'Timestamp:' + str(self.Timestamp) + ', ' + \
1381
               'RequestHandle:' + str(self.RequestHandle) + ', ' + \
1382
               'ServiceResult:' + str(self.ServiceResult) + ', ' + \
1383
               'ServiceDiagnostics:' + str(self.ServiceDiagnostics) + ', ' + \
1384
               'StringTable:' + str(self.StringTable) + ', ' + \
1385
               'AdditionalHeader:' + str(self.AdditionalHeader) + ')'
1386
1387 1
    __repr__ = __str__
1388
1389
1390 1
class ServiceFault(FrozenClass):
1391
    '''
1392
    The response returned by all services when there is a service level error.
1393
1394
    :ivar TypeId:
1395
    :vartype TypeId: NodeId
1396
    :ivar ResponseHeader:
1397
    :vartype ResponseHeader: ResponseHeader
1398
    '''
1399
1400 1
    ua_types = {
1401
        'TypeId': 'NodeId',
1402
        'ResponseHeader': 'ResponseHeader',
1403
               }
1404
1405 1
    def __init__(self, binary=None):
1406 1
        if binary is not None:
1407
            self._binary_init(binary)
1408
            self._freeze = True
1409
            return
1410 1
        self.TypeId = FourByteNodeId(ObjectIds.ServiceFault_Encoding_DefaultBinary)
1411 1
        self.ResponseHeader = ResponseHeader()
1412 1
        self._freeze = True
1413
1414 1
    def to_binary(self):
1415 1
        packet = []
1416 1
        packet.append(self.TypeId.to_binary())
1417 1
        packet.append(self.ResponseHeader.to_binary())
1418 1
        return b''.join(packet)
1419
1420 1
    @staticmethod
1421
    def from_binary(data):
1422
        return ServiceFault(data)
1423
1424 1
    def _binary_init(self, data):
1425
        self.TypeId = NodeId.from_binary(data)
1426
        self.ResponseHeader = ResponseHeader.from_binary(data)
1427
1428 1
    def __str__(self):
1429
        return 'ServiceFault(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1430
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
1431
1432 1
    __repr__ = __str__
1433
1434
1435 1
class FindServersParameters(FrozenClass):
1436
    '''
1437
    :ivar EndpointUrl:
1438
    :vartype EndpointUrl: String
1439
    :ivar LocaleIds:
1440
    :vartype LocaleIds: String
1441
    :ivar ServerUris:
1442
    :vartype ServerUris: String
1443
    '''
1444
1445 1
    ua_types = {
1446
        'EndpointUrl': 'String',
1447
        'LocaleIds': 'String',
1448
        'ServerUris': 'String',
1449
               }
1450
1451 1
    def __init__(self, binary=None):
1452 1
        if binary is not None:
1453 1
            self._binary_init(binary)
1454 1
            self._freeze = True
1455 1
            return
1456 1
        self.EndpointUrl = None
1457 1
        self.LocaleIds = []
1458 1
        self.ServerUris = []
1459 1
        self._freeze = True
1460
1461 1
    def to_binary(self):
1462 1
        packet = []
1463 1
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
1464 1
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
1465 1
        for fieldname in self.LocaleIds:
1466
            packet.append(uabin.Primitives.String.pack(fieldname))
1467 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerUris)))
1468 1
        for fieldname in self.ServerUris:
1469 1
            packet.append(uabin.Primitives.String.pack(fieldname))
1470 1
        return b''.join(packet)
1471
1472 1
    @staticmethod
1473
    def from_binary(data):
1474 1
        return FindServersParameters(data)
1475
1476 1
    def _binary_init(self, data):
1477 1
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
1478 1
        self.LocaleIds = uabin.Primitives.String.unpack_array(data)
1479 1
        self.ServerUris = uabin.Primitives.String.unpack_array(data)
1480
1481 1
    def __str__(self):
1482
        return 'FindServersParameters(' + 'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
1483
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
1484
               'ServerUris:' + str(self.ServerUris) + ')'
1485
1486 1
    __repr__ = __str__
1487
1488
1489 1
class FindServersRequest(FrozenClass):
1490
    '''
1491
    Finds the servers known to the discovery server.
1492
1493
    :ivar TypeId:
1494
    :vartype TypeId: NodeId
1495
    :ivar RequestHeader:
1496
    :vartype RequestHeader: RequestHeader
1497
    :ivar Parameters:
1498
    :vartype Parameters: FindServersParameters
1499
    '''
1500
1501 1
    ua_types = {
1502
        'TypeId': 'NodeId',
1503
        'RequestHeader': 'RequestHeader',
1504
        'Parameters': 'FindServersParameters',
1505
               }
1506
1507 1
    def __init__(self, binary=None):
1508 1
        if binary is not None:
1509
            self._binary_init(binary)
1510
            self._freeze = True
1511
            return
1512 1
        self.TypeId = FourByteNodeId(ObjectIds.FindServersRequest_Encoding_DefaultBinary)
1513 1
        self.RequestHeader = RequestHeader()
1514 1
        self.Parameters = FindServersParameters()
1515 1
        self._freeze = True
1516
1517 1
    def to_binary(self):
1518 1
        packet = []
1519 1
        packet.append(self.TypeId.to_binary())
1520 1
        packet.append(self.RequestHeader.to_binary())
1521 1
        packet.append(self.Parameters.to_binary())
1522 1
        return b''.join(packet)
1523
1524 1
    @staticmethod
1525
    def from_binary(data):
1526
        return FindServersRequest(data)
1527
1528 1
    def _binary_init(self, data):
1529
        self.TypeId = NodeId.from_binary(data)
1530
        self.RequestHeader = RequestHeader.from_binary(data)
1531
        self.Parameters = FindServersParameters.from_binary(data)
1532
1533 1
    def __str__(self):
1534
        return 'FindServersRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1535
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
1536
               'Parameters:' + str(self.Parameters) + ')'
1537
1538 1
    __repr__ = __str__
1539 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1540
1541 1
class FindServersResponse(FrozenClass):
1542
    '''
1543
    Finds the servers known to the discovery server.
1544
1545
    :ivar TypeId:
1546
    :vartype TypeId: NodeId
1547
    :ivar ResponseHeader:
1548
    :vartype ResponseHeader: ResponseHeader
1549
    :ivar Servers:
1550
    :vartype Servers: ApplicationDescription
1551
    '''
1552
1553 1
    ua_types = {
1554
        'TypeId': 'NodeId',
1555
        'ResponseHeader': 'ResponseHeader',
1556
        'Servers': 'ApplicationDescription',
1557
               }
1558
1559 1
    def __init__(self, binary=None):
1560 1
        if binary is not None:
1561 1
            self._binary_init(binary)
1562 1
            self._freeze = True
1563 1
            return
1564 1
        self.TypeId = FourByteNodeId(ObjectIds.FindServersResponse_Encoding_DefaultBinary)
1565 1
        self.ResponseHeader = ResponseHeader()
1566 1
        self.Servers = []
1567 1
        self._freeze = True
1568
1569 1
    def to_binary(self):
1570 1
        packet = []
1571 1
        packet.append(self.TypeId.to_binary())
1572 1
        packet.append(self.ResponseHeader.to_binary())
1573 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Servers)))
1574 1
        for fieldname in self.Servers:
1575 1
            packet.append(fieldname.to_binary())
1576 1
        return b''.join(packet)
1577
1578 1
    @staticmethod
1579
    def from_binary(data):
1580 1
        return FindServersResponse(data)
1581
1582 1
    def _binary_init(self, data):
1583 1
        self.TypeId = NodeId.from_binary(data)
1584 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
1585 1
        length = uabin.Primitives.Int32.unpack(data)
1586 1
        array = []
1587 1
        if length != -1:
1588 1
            for _ in range(0, length):
1589 1
                array.append(ApplicationDescription.from_binary(data))
1590 1
        self.Servers = array
1591
1592 1
    def __str__(self):
1593
        return 'FindServersResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1594
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
1595
               'Servers:' + str(self.Servers) + ')'
1596
1597 1
    __repr__ = __str__
1598
1599
1600 1 View Code Duplication
class ServerOnNetwork(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1601
    '''
1602
    :ivar RecordId:
1603
    :vartype RecordId: UInt32
1604
    :ivar ServerName:
1605
    :vartype ServerName: String
1606
    :ivar DiscoveryUrl:
1607
    :vartype DiscoveryUrl: String
1608
    :ivar ServerCapabilities:
1609
    :vartype ServerCapabilities: String
1610
    '''
1611
1612 1
    ua_types = {
1613
        'RecordId': 'UInt32',
1614
        'ServerName': 'String',
1615
        'DiscoveryUrl': 'String',
1616
        'ServerCapabilities': 'String',
1617
               }
1618
1619 1
    def __init__(self, binary=None):
1620
        if binary is not None:
1621
            self._binary_init(binary)
1622
            self._freeze = True
1623
            return
1624
        self.RecordId = 0
1625
        self.ServerName = None
1626
        self.DiscoveryUrl = None
1627
        self.ServerCapabilities = []
1628
        self._freeze = True
1629
1630 1
    def to_binary(self):
1631
        packet = []
1632
        packet.append(uabin.Primitives.UInt32.pack(self.RecordId))
1633
        packet.append(uabin.Primitives.String.pack(self.ServerName))
1634
        packet.append(uabin.Primitives.String.pack(self.DiscoveryUrl))
1635
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerCapabilities)))
1636
        for fieldname in self.ServerCapabilities:
1637
            packet.append(uabin.Primitives.String.pack(fieldname))
1638
        return b''.join(packet)
1639
1640 1
    @staticmethod
1641
    def from_binary(data):
1642
        return ServerOnNetwork(data)
1643
1644 1
    def _binary_init(self, data):
1645
        self.RecordId = uabin.Primitives.UInt32.unpack(data)
1646
        self.ServerName = uabin.Primitives.String.unpack(data)
1647
        self.DiscoveryUrl = uabin.Primitives.String.unpack(data)
1648
        self.ServerCapabilities = uabin.Primitives.String.unpack_array(data)
1649
1650 1
    def __str__(self):
1651
        return 'ServerOnNetwork(' + 'RecordId:' + str(self.RecordId) + ', ' + \
1652
               'ServerName:' + str(self.ServerName) + ', ' + \
1653
               'DiscoveryUrl:' + str(self.DiscoveryUrl) + ', ' + \
1654
               'ServerCapabilities:' + str(self.ServerCapabilities) + ')'
1655
1656 1
    __repr__ = __str__
1657
1658
1659 1
class FindServersOnNetworkParameters(FrozenClass):
1660
    '''
1661
    :ivar StartingRecordId:
1662
    :vartype StartingRecordId: UInt32
1663
    :ivar MaxRecordsToReturn:
1664
    :vartype MaxRecordsToReturn: UInt32
1665
    :ivar ServerCapabilityFilter:
1666
    :vartype ServerCapabilityFilter: String
1667
    '''
1668
1669 1
    ua_types = {
1670
        'StartingRecordId': 'UInt32',
1671
        'MaxRecordsToReturn': 'UInt32',
1672
        'ServerCapabilityFilter': 'String',
1673
               }
1674
1675 1
    def __init__(self, binary=None):
1676
        if binary is not None:
1677
            self._binary_init(binary)
1678
            self._freeze = True
1679
            return
1680
        self.StartingRecordId = 0
1681
        self.MaxRecordsToReturn = 0
1682
        self.ServerCapabilityFilter = []
1683
        self._freeze = True
1684
1685 1
    def to_binary(self):
1686
        packet = []
1687
        packet.append(uabin.Primitives.UInt32.pack(self.StartingRecordId))
1688
        packet.append(uabin.Primitives.UInt32.pack(self.MaxRecordsToReturn))
1689
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerCapabilityFilter)))
1690
        for fieldname in self.ServerCapabilityFilter:
1691
            packet.append(uabin.Primitives.String.pack(fieldname))
1692
        return b''.join(packet)
1693
1694 1
    @staticmethod
1695
    def from_binary(data):
1696
        return FindServersOnNetworkParameters(data)
1697
1698 1
    def _binary_init(self, data):
1699
        self.StartingRecordId = uabin.Primitives.UInt32.unpack(data)
1700
        self.MaxRecordsToReturn = uabin.Primitives.UInt32.unpack(data)
1701
        self.ServerCapabilityFilter = uabin.Primitives.String.unpack_array(data)
1702
1703 1
    def __str__(self):
1704
        return 'FindServersOnNetworkParameters(' + 'StartingRecordId:' + str(self.StartingRecordId) + ', ' + \
1705
               'MaxRecordsToReturn:' + str(self.MaxRecordsToReturn) + ', ' + \
1706
               'ServerCapabilityFilter:' + str(self.ServerCapabilityFilter) + ')'
1707
1708 1
    __repr__ = __str__
1709
1710
1711 1
class FindServersOnNetworkRequest(FrozenClass):
1712
    '''
1713
    :ivar TypeId:
1714
    :vartype TypeId: NodeId
1715
    :ivar RequestHeader:
1716
    :vartype RequestHeader: RequestHeader
1717
    :ivar Parameters:
1718
    :vartype Parameters: FindServersOnNetworkParameters
1719
    '''
1720
1721 1
    ua_types = {
1722
        'TypeId': 'NodeId',
1723
        'RequestHeader': 'RequestHeader',
1724
        'Parameters': 'FindServersOnNetworkParameters',
1725
               }
1726
1727 1
    def __init__(self, binary=None):
1728
        if binary is not None:
1729
            self._binary_init(binary)
1730
            self._freeze = True
1731
            return
1732
        self.TypeId = FourByteNodeId(ObjectIds.FindServersOnNetworkRequest_Encoding_DefaultBinary)
1733
        self.RequestHeader = RequestHeader()
1734
        self.Parameters = FindServersOnNetworkParameters()
1735
        self._freeze = True
1736
1737 1
    def to_binary(self):
1738
        packet = []
1739
        packet.append(self.TypeId.to_binary())
1740
        packet.append(self.RequestHeader.to_binary())
1741
        packet.append(self.Parameters.to_binary())
1742
        return b''.join(packet)
1743
1744 1
    @staticmethod
1745
    def from_binary(data):
1746
        return FindServersOnNetworkRequest(data)
1747
1748 1
    def _binary_init(self, data):
1749
        self.TypeId = NodeId.from_binary(data)
1750
        self.RequestHeader = RequestHeader.from_binary(data)
1751
        self.Parameters = FindServersOnNetworkParameters.from_binary(data)
1752
1753 1
    def __str__(self):
1754
        return 'FindServersOnNetworkRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1755
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
1756
               'Parameters:' + str(self.Parameters) + ')'
1757
1758 1
    __repr__ = __str__
1759
1760
1761 1
class FindServersOnNetworkResult(FrozenClass):
1762
    '''
1763
    :ivar LastCounterResetTime:
1764
    :vartype LastCounterResetTime: DateTime
1765
    :ivar Servers:
1766
    :vartype Servers: ServerOnNetwork
1767
    '''
1768
1769 1
    ua_types = {
1770
        'LastCounterResetTime': 'DateTime',
1771
        'Servers': 'ServerOnNetwork',
1772
               }
1773
1774 1
    def __init__(self, binary=None):
1775
        if binary is not None:
1776
            self._binary_init(binary)
1777
            self._freeze = True
1778
            return
1779
        self.LastCounterResetTime = datetime.utcnow()
1780
        self.Servers = []
1781
        self._freeze = True
1782
1783 1
    def to_binary(self):
1784
        packet = []
1785
        packet.append(uabin.Primitives.DateTime.pack(self.LastCounterResetTime))
1786
        packet.append(uabin.Primitives.Int32.pack(len(self.Servers)))
1787
        for fieldname in self.Servers:
1788
            packet.append(fieldname.to_binary())
1789
        return b''.join(packet)
1790
1791 1
    @staticmethod
1792
    def from_binary(data):
1793
        return FindServersOnNetworkResult(data)
1794
1795 1
    def _binary_init(self, data):
1796
        self.LastCounterResetTime = uabin.Primitives.DateTime.unpack(data)
1797
        length = uabin.Primitives.Int32.unpack(data)
1798
        array = []
1799
        if length != -1:
1800
            for _ in range(0, length):
1801
                array.append(ServerOnNetwork.from_binary(data))
1802
        self.Servers = array
1803
1804 1
    def __str__(self):
1805
        return 'FindServersOnNetworkResult(' + 'LastCounterResetTime:' + str(self.LastCounterResetTime) + ', ' + \
1806
               'Servers:' + str(self.Servers) + ')'
1807
1808 1
    __repr__ = __str__
1809
1810
1811 1
class FindServersOnNetworkResponse(FrozenClass):
1812
    '''
1813
    :ivar TypeId:
1814
    :vartype TypeId: NodeId
1815
    :ivar ResponseHeader:
1816
    :vartype ResponseHeader: ResponseHeader
1817
    :ivar Parameters:
1818
    :vartype Parameters: FindServersOnNetworkResult
1819
    '''
1820
1821 1
    ua_types = {
1822
        'TypeId': 'NodeId',
1823
        'ResponseHeader': 'ResponseHeader',
1824
        'Parameters': 'FindServersOnNetworkResult',
1825
               }
1826
1827 1
    def __init__(self, binary=None):
1828
        if binary is not None:
1829
            self._binary_init(binary)
1830
            self._freeze = True
1831
            return
1832
        self.TypeId = FourByteNodeId(ObjectIds.FindServersOnNetworkResponse_Encoding_DefaultBinary)
1833
        self.ResponseHeader = ResponseHeader()
1834
        self.Parameters = FindServersOnNetworkResult()
1835
        self._freeze = True
1836
1837 1
    def to_binary(self):
1838
        packet = []
1839
        packet.append(self.TypeId.to_binary())
1840
        packet.append(self.ResponseHeader.to_binary())
1841
        packet.append(self.Parameters.to_binary())
1842
        return b''.join(packet)
1843
1844 1
    @staticmethod
1845
    def from_binary(data):
1846
        return FindServersOnNetworkResponse(data)
1847
1848 1
    def _binary_init(self, data):
1849
        self.TypeId = NodeId.from_binary(data)
1850
        self.ResponseHeader = ResponseHeader.from_binary(data)
1851
        self.Parameters = FindServersOnNetworkResult.from_binary(data)
1852
1853 1
    def __str__(self):
1854
        return 'FindServersOnNetworkResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1855
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
1856
               'Parameters:' + str(self.Parameters) + ')'
1857
1858 1
    __repr__ = __str__
1859
1860
1861 1 View Code Duplication
class UserTokenPolicy(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1862
    '''
1863
    Describes a user token that can be used with a server.
1864
1865
    :ivar PolicyId:
1866
    :vartype PolicyId: String
1867
    :ivar TokenType:
1868
    :vartype TokenType: UserTokenType
1869
    :ivar IssuedTokenType:
1870
    :vartype IssuedTokenType: String
1871
    :ivar IssuerEndpointUrl:
1872
    :vartype IssuerEndpointUrl: String
1873
    :ivar SecurityPolicyUri:
1874
    :vartype SecurityPolicyUri: String
1875
    '''
1876
1877 1
    ua_types = {
1878
        'PolicyId': 'String',
1879
        'TokenType': 'UserTokenType',
1880
        'IssuedTokenType': 'String',
1881
        'IssuerEndpointUrl': 'String',
1882
        'SecurityPolicyUri': 'String',
1883
               }
1884
1885 1
    def __init__(self, binary=None):
1886 1
        if binary is not None:
1887 1
            self._binary_init(binary)
1888 1
            self._freeze = True
1889 1
            return
1890 1
        self.PolicyId = None
1891 1
        self.TokenType = UserTokenType(0)
1892 1
        self.IssuedTokenType = None
1893 1
        self.IssuerEndpointUrl = None
1894 1
        self.SecurityPolicyUri = None
1895 1
        self._freeze = True
1896
1897 1
    def to_binary(self):
1898 1
        packet = []
1899 1
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
1900 1
        packet.append(uabin.Primitives.UInt32.pack(self.TokenType.value))
1901 1
        packet.append(uabin.Primitives.String.pack(self.IssuedTokenType))
1902 1
        packet.append(uabin.Primitives.String.pack(self.IssuerEndpointUrl))
1903 1
        packet.append(uabin.Primitives.String.pack(self.SecurityPolicyUri))
1904 1
        return b''.join(packet)
1905
1906 1
    @staticmethod
1907
    def from_binary(data):
1908 1
        return UserTokenPolicy(data)
1909
1910 1
    def _binary_init(self, data):
1911 1
        self.PolicyId = uabin.Primitives.String.unpack(data)
1912 1
        self.TokenType = UserTokenType(uabin.Primitives.UInt32.unpack(data))
1913 1
        self.IssuedTokenType = uabin.Primitives.String.unpack(data)
1914 1
        self.IssuerEndpointUrl = uabin.Primitives.String.unpack(data)
1915 1
        self.SecurityPolicyUri = uabin.Primitives.String.unpack(data)
1916
1917 1
    def __str__(self):
1918
        return 'UserTokenPolicy(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
1919
               'TokenType:' + str(self.TokenType) + ', ' + \
1920
               'IssuedTokenType:' + str(self.IssuedTokenType) + ', ' + \
1921
               'IssuerEndpointUrl:' + str(self.IssuerEndpointUrl) + ', ' + \
1922
               'SecurityPolicyUri:' + str(self.SecurityPolicyUri) + ')'
1923
1924 1
    __repr__ = __str__
1925
1926
1927 1
class EndpointDescription(FrozenClass):
1928
    '''
1929
    The description of a endpoint that can be used to access a server.
1930
1931
    :ivar EndpointUrl:
1932
    :vartype EndpointUrl: String
1933
    :ivar Server:
1934
    :vartype Server: ApplicationDescription
1935
    :ivar ServerCertificate:
1936
    :vartype ServerCertificate: ByteString
1937
    :ivar SecurityMode:
1938
    :vartype SecurityMode: MessageSecurityMode
1939
    :ivar SecurityPolicyUri:
1940
    :vartype SecurityPolicyUri: String
1941
    :ivar UserIdentityTokens:
1942
    :vartype UserIdentityTokens: UserTokenPolicy
1943
    :ivar TransportProfileUri:
1944
    :vartype TransportProfileUri: String
1945
    :ivar SecurityLevel:
1946
    :vartype SecurityLevel: Byte
1947
    '''
1948
1949 1
    ua_types = {
1950
        'EndpointUrl': 'String',
1951
        'Server': 'ApplicationDescription',
1952
        'ServerCertificate': 'ByteString',
1953
        'SecurityMode': 'MessageSecurityMode',
1954
        'SecurityPolicyUri': 'String',
1955
        'UserIdentityTokens': 'UserTokenPolicy',
1956
        'TransportProfileUri': 'String',
1957
        'SecurityLevel': 'Byte',
1958
               }
1959
1960 1
    def __init__(self, binary=None):
1961 1
        if binary is not None:
1962 1
            self._binary_init(binary)
1963 1
            self._freeze = True
1964 1
            return
1965 1
        self.EndpointUrl = None
1966 1
        self.Server = ApplicationDescription()
1967 1
        self.ServerCertificate = None
1968 1
        self.SecurityMode = MessageSecurityMode(0)
1969 1
        self.SecurityPolicyUri = None
1970 1
        self.UserIdentityTokens = []
1971 1
        self.TransportProfileUri = None
1972 1
        self.SecurityLevel = 0
1973 1
        self._freeze = True
1974
1975 1 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1976 1
        packet = []
1977 1
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
1978 1
        packet.append(self.Server.to_binary())
1979 1
        packet.append(uabin.Primitives.ByteString.pack(self.ServerCertificate))
1980 1
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityMode.value))
1981 1
        packet.append(uabin.Primitives.String.pack(self.SecurityPolicyUri))
1982 1
        packet.append(uabin.Primitives.Int32.pack(len(self.UserIdentityTokens)))
1983 1
        for fieldname in self.UserIdentityTokens:
1984 1
            packet.append(fieldname.to_binary())
1985 1
        packet.append(uabin.Primitives.String.pack(self.TransportProfileUri))
1986 1
        packet.append(uabin.Primitives.Byte.pack(self.SecurityLevel))
1987 1
        return b''.join(packet)
1988
1989 1
    @staticmethod
1990
    def from_binary(data):
1991 1
        return EndpointDescription(data)
1992
1993 1 View Code Duplication
    def _binary_init(self, data):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
1994 1
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
1995 1
        self.Server = ApplicationDescription.from_binary(data)
1996 1
        self.ServerCertificate = uabin.Primitives.ByteString.unpack(data)
1997 1
        self.SecurityMode = MessageSecurityMode(uabin.Primitives.UInt32.unpack(data))
1998 1
        self.SecurityPolicyUri = uabin.Primitives.String.unpack(data)
1999 1
        length = uabin.Primitives.Int32.unpack(data)
2000 1
        array = []
2001 1
        if length != -1:
2002 1
            for _ in range(0, length):
2003 1
                array.append(UserTokenPolicy.from_binary(data))
2004 1
        self.UserIdentityTokens = array
2005 1
        self.TransportProfileUri = uabin.Primitives.String.unpack(data)
2006 1
        self.SecurityLevel = uabin.Primitives.Byte.unpack(data)
2007
2008 1
    def __str__(self):
2009
        return 'EndpointDescription(' + 'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
2010
               'Server:' + str(self.Server) + ', ' + \
2011
               'ServerCertificate:' + str(self.ServerCertificate) + ', ' + \
2012
               'SecurityMode:' + str(self.SecurityMode) + ', ' + \
2013
               'SecurityPolicyUri:' + str(self.SecurityPolicyUri) + ', ' + \
2014
               'UserIdentityTokens:' + str(self.UserIdentityTokens) + ', ' + \
2015
               'TransportProfileUri:' + str(self.TransportProfileUri) + ', ' + \
2016
               'SecurityLevel:' + str(self.SecurityLevel) + ')'
2017
2018 1
    __repr__ = __str__
2019
2020
2021 1
class GetEndpointsParameters(FrozenClass):
2022
    '''
2023
    :ivar EndpointUrl:
2024
    :vartype EndpointUrl: String
2025
    :ivar LocaleIds:
2026
    :vartype LocaleIds: String
2027
    :ivar ProfileUris:
2028
    :vartype ProfileUris: String
2029
    '''
2030
2031 1
    ua_types = {
2032
        'EndpointUrl': 'String',
2033
        'LocaleIds': 'String',
2034
        'ProfileUris': 'String',
2035
               }
2036
2037 1
    def __init__(self, binary=None):
2038 1
        if binary is not None:
2039 1
            self._binary_init(binary)
2040 1
            self._freeze = True
2041 1
            return
2042 1
        self.EndpointUrl = None
2043 1
        self.LocaleIds = []
2044 1
        self.ProfileUris = []
2045 1
        self._freeze = True
2046
2047 1
    def to_binary(self):
2048 1
        packet = []
2049 1
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
2050 1
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
2051 1
        for fieldname in self.LocaleIds:
2052
            packet.append(uabin.Primitives.String.pack(fieldname))
2053 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ProfileUris)))
2054 1
        for fieldname in self.ProfileUris:
2055
            packet.append(uabin.Primitives.String.pack(fieldname))
2056 1
        return b''.join(packet)
2057
2058 1
    @staticmethod
2059
    def from_binary(data):
2060 1
        return GetEndpointsParameters(data)
2061
2062 1
    def _binary_init(self, data):
2063 1
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
2064 1
        self.LocaleIds = uabin.Primitives.String.unpack_array(data)
2065 1
        self.ProfileUris = uabin.Primitives.String.unpack_array(data)
2066
2067 1
    def __str__(self):
2068
        return 'GetEndpointsParameters(' + 'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
2069
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
2070
               'ProfileUris:' + str(self.ProfileUris) + ')'
2071
2072 1
    __repr__ = __str__
2073
2074
2075 1
class GetEndpointsRequest(FrozenClass):
2076
    '''
2077
    Gets the endpoints used by the server.
2078
2079
    :ivar TypeId:
2080
    :vartype TypeId: NodeId
2081
    :ivar RequestHeader:
2082
    :vartype RequestHeader: RequestHeader
2083
    :ivar Parameters:
2084
    :vartype Parameters: GetEndpointsParameters
2085
    '''
2086
2087 1
    ua_types = {
2088
        'TypeId': 'NodeId',
2089
        'RequestHeader': 'RequestHeader',
2090
        'Parameters': 'GetEndpointsParameters',
2091
               }
2092
2093 1
    def __init__(self, binary=None):
2094 1
        if binary is not None:
2095
            self._binary_init(binary)
2096
            self._freeze = True
2097
            return
2098 1
        self.TypeId = FourByteNodeId(ObjectIds.GetEndpointsRequest_Encoding_DefaultBinary)
2099 1
        self.RequestHeader = RequestHeader()
2100 1
        self.Parameters = GetEndpointsParameters()
2101 1
        self._freeze = True
2102
2103 1
    def to_binary(self):
2104 1
        packet = []
2105 1
        packet.append(self.TypeId.to_binary())
2106 1
        packet.append(self.RequestHeader.to_binary())
2107 1
        packet.append(self.Parameters.to_binary())
2108 1
        return b''.join(packet)
2109
2110 1
    @staticmethod
2111
    def from_binary(data):
2112
        return GetEndpointsRequest(data)
2113
2114 1
    def _binary_init(self, data):
2115
        self.TypeId = NodeId.from_binary(data)
2116
        self.RequestHeader = RequestHeader.from_binary(data)
2117
        self.Parameters = GetEndpointsParameters.from_binary(data)
2118
2119 1
    def __str__(self):
2120
        return 'GetEndpointsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2121
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2122
               'Parameters:' + str(self.Parameters) + ')'
2123
2124 1
    __repr__ = __str__
2125 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2126
2127 1
class GetEndpointsResponse(FrozenClass):
2128
    '''
2129
    Gets the endpoints used by the server.
2130
2131
    :ivar TypeId:
2132
    :vartype TypeId: NodeId
2133
    :ivar ResponseHeader:
2134
    :vartype ResponseHeader: ResponseHeader
2135
    :ivar Endpoints:
2136
    :vartype Endpoints: EndpointDescription
2137
    '''
2138
2139 1
    ua_types = {
2140
        'TypeId': 'NodeId',
2141
        'ResponseHeader': 'ResponseHeader',
2142
        'Endpoints': 'EndpointDescription',
2143
               }
2144
2145 1
    def __init__(self, binary=None):
2146 1
        if binary is not None:
2147 1
            self._binary_init(binary)
2148 1
            self._freeze = True
2149 1
            return
2150 1
        self.TypeId = FourByteNodeId(ObjectIds.GetEndpointsResponse_Encoding_DefaultBinary)
2151 1
        self.ResponseHeader = ResponseHeader()
2152 1
        self.Endpoints = []
2153 1
        self._freeze = True
2154
2155 1
    def to_binary(self):
2156 1
        packet = []
2157 1
        packet.append(self.TypeId.to_binary())
2158 1
        packet.append(self.ResponseHeader.to_binary())
2159 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Endpoints)))
2160 1
        for fieldname in self.Endpoints:
2161 1
            packet.append(fieldname.to_binary())
2162 1
        return b''.join(packet)
2163
2164 1
    @staticmethod
2165
    def from_binary(data):
2166 1
        return GetEndpointsResponse(data)
2167
2168 1
    def _binary_init(self, data):
2169 1
        self.TypeId = NodeId.from_binary(data)
2170 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
2171 1
        length = uabin.Primitives.Int32.unpack(data)
2172 1
        array = []
2173 1
        if length != -1:
2174 1
            for _ in range(0, length):
2175 1
                array.append(EndpointDescription.from_binary(data))
2176 1
        self.Endpoints = array
2177
2178 1
    def __str__(self):
2179
        return 'GetEndpointsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2180
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
2181
               'Endpoints:' + str(self.Endpoints) + ')'
2182
2183 1
    __repr__ = __str__
2184
2185
2186 1
class RegisteredServer(FrozenClass):
2187
    '''
2188
    The information required to register a server with a discovery server.
2189
2190
    :ivar ServerUri:
2191
    :vartype ServerUri: String
2192
    :ivar ProductUri:
2193
    :vartype ProductUri: String
2194
    :ivar ServerNames:
2195
    :vartype ServerNames: LocalizedText
2196
    :ivar ServerType:
2197
    :vartype ServerType: ApplicationType
2198
    :ivar GatewayServerUri:
2199
    :vartype GatewayServerUri: String
2200
    :ivar DiscoveryUrls:
2201
    :vartype DiscoveryUrls: String
2202
    :ivar SemaphoreFilePath:
2203
    :vartype SemaphoreFilePath: String
2204
    :ivar IsOnline:
2205
    :vartype IsOnline: Boolean
2206
    '''
2207
2208 1
    ua_types = {
2209
        'ServerUri': 'String',
2210
        'ProductUri': 'String',
2211
        'ServerNames': 'LocalizedText',
2212
        'ServerType': 'ApplicationType',
2213
        'GatewayServerUri': 'String',
2214
        'DiscoveryUrls': 'String',
2215
        'SemaphoreFilePath': 'String',
2216
        'IsOnline': 'Boolean',
2217
               }
2218
2219 1
    def __init__(self, binary=None):
2220 1
        if binary is not None:
2221 1
            self._binary_init(binary)
2222 1
            self._freeze = True
2223 1
            return
2224 1
        self.ServerUri = None
2225 1
        self.ProductUri = None
2226 1
        self.ServerNames = []
2227 1
        self.ServerType = ApplicationType(0)
2228 1
        self.GatewayServerUri = None
2229 1
        self.DiscoveryUrls = []
2230 1
        self.SemaphoreFilePath = None
2231 1
        self.IsOnline = True
2232 1
        self._freeze = True
2233
2234 1
    def to_binary(self):
2235 1
        packet = []
2236 1
        packet.append(uabin.Primitives.String.pack(self.ServerUri))
2237 1
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
2238 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerNames)))
2239 1
        for fieldname in self.ServerNames:
2240 1
            packet.append(fieldname.to_binary())
2241 1
        packet.append(uabin.Primitives.UInt32.pack(self.ServerType.value))
2242 1
        packet.append(uabin.Primitives.String.pack(self.GatewayServerUri))
2243 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiscoveryUrls)))
2244 1
        for fieldname in self.DiscoveryUrls:
2245 1
            packet.append(uabin.Primitives.String.pack(fieldname))
2246 1
        packet.append(uabin.Primitives.String.pack(self.SemaphoreFilePath))
2247 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsOnline))
2248 1
        return b''.join(packet)
2249
2250 1
    @staticmethod
2251
    def from_binary(data):
2252 1
        return RegisteredServer(data)
2253
2254 1 View Code Duplication
    def _binary_init(self, data):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2255 1
        self.ServerUri = uabin.Primitives.String.unpack(data)
2256 1
        self.ProductUri = uabin.Primitives.String.unpack(data)
2257 1
        length = uabin.Primitives.Int32.unpack(data)
2258 1
        array = []
2259 1
        if length != -1:
2260 1
            for _ in range(0, length):
2261 1
                array.append(LocalizedText.from_binary(data))
2262 1
        self.ServerNames = array
2263 1
        self.ServerType = ApplicationType(uabin.Primitives.UInt32.unpack(data))
2264 1
        self.GatewayServerUri = uabin.Primitives.String.unpack(data)
2265 1
        self.DiscoveryUrls = uabin.Primitives.String.unpack_array(data)
2266 1
        self.SemaphoreFilePath = uabin.Primitives.String.unpack(data)
2267 1
        self.IsOnline = uabin.Primitives.Boolean.unpack(data)
2268
2269 1
    def __str__(self):
2270
        return 'RegisteredServer(' + 'ServerUri:' + str(self.ServerUri) + ', ' + \
2271
               'ProductUri:' + str(self.ProductUri) + ', ' + \
2272
               'ServerNames:' + str(self.ServerNames) + ', ' + \
2273
               'ServerType:' + str(self.ServerType) + ', ' + \
2274
               'GatewayServerUri:' + str(self.GatewayServerUri) + ', ' + \
2275
               'DiscoveryUrls:' + str(self.DiscoveryUrls) + ', ' + \
2276
               'SemaphoreFilePath:' + str(self.SemaphoreFilePath) + ', ' + \
2277
               'IsOnline:' + str(self.IsOnline) + ')'
2278
2279 1
    __repr__ = __str__
2280
2281
2282 1
class RegisterServerRequest(FrozenClass):
2283
    '''
2284
    Registers a server with the discovery server.
2285
2286
    :ivar TypeId:
2287
    :vartype TypeId: NodeId
2288
    :ivar RequestHeader:
2289
    :vartype RequestHeader: RequestHeader
2290
    :ivar Server:
2291
    :vartype Server: RegisteredServer
2292
    '''
2293
2294 1
    ua_types = {
2295
        'TypeId': 'NodeId',
2296
        'RequestHeader': 'RequestHeader',
2297
        'Server': 'RegisteredServer',
2298
               }
2299
2300 1
    def __init__(self, binary=None):
2301 1
        if binary is not None:
2302
            self._binary_init(binary)
2303
            self._freeze = True
2304
            return
2305 1
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServerRequest_Encoding_DefaultBinary)
2306 1
        self.RequestHeader = RequestHeader()
2307 1
        self.Server = RegisteredServer()
2308 1
        self._freeze = True
2309
2310 1
    def to_binary(self):
2311 1
        packet = []
2312 1
        packet.append(self.TypeId.to_binary())
2313 1
        packet.append(self.RequestHeader.to_binary())
2314 1
        packet.append(self.Server.to_binary())
2315 1
        return b''.join(packet)
2316
2317 1
    @staticmethod
2318
    def from_binary(data):
2319
        return RegisterServerRequest(data)
2320
2321 1
    def _binary_init(self, data):
2322
        self.TypeId = NodeId.from_binary(data)
2323
        self.RequestHeader = RequestHeader.from_binary(data)
2324
        self.Server = RegisteredServer.from_binary(data)
2325
2326 1
    def __str__(self):
2327
        return 'RegisterServerRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2328
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2329
               'Server:' + str(self.Server) + ')'
2330
2331 1
    __repr__ = __str__
2332
2333
2334 1
class RegisterServerResponse(FrozenClass):
2335
    '''
2336
    Registers a server with the discovery server.
2337
2338
    :ivar TypeId:
2339
    :vartype TypeId: NodeId
2340
    :ivar ResponseHeader:
2341
    :vartype ResponseHeader: ResponseHeader
2342
    '''
2343
2344 1
    ua_types = {
2345
        'TypeId': 'NodeId',
2346
        'ResponseHeader': 'ResponseHeader',
2347
               }
2348
2349 1
    def __init__(self, binary=None):
2350 1
        if binary is not None:
2351 1
            self._binary_init(binary)
2352 1
            self._freeze = True
2353 1
            return
2354 1
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServerResponse_Encoding_DefaultBinary)
2355 1
        self.ResponseHeader = ResponseHeader()
2356 1
        self._freeze = True
2357
2358 1
    def to_binary(self):
2359 1
        packet = []
2360 1
        packet.append(self.TypeId.to_binary())
2361 1
        packet.append(self.ResponseHeader.to_binary())
2362 1
        return b''.join(packet)
2363
2364 1
    @staticmethod
2365
    def from_binary(data):
2366 1
        return RegisterServerResponse(data)
2367
2368 1
    def _binary_init(self, data):
2369 1
        self.TypeId = NodeId.from_binary(data)
2370 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
2371
2372 1
    def __str__(self):
2373
        return 'RegisterServerResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2374
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
2375
2376 1
    __repr__ = __str__
2377
2378
2379 1
class DiscoveryConfiguration(FrozenClass):
2380
    '''
2381
    A base type for discovery configuration information.
2382
2383
    '''
2384
2385 1
    ua_types = {
2386
               }
2387
2388 1
    def __init__(self, binary=None):
2389
        if binary is not None:
2390
            self._binary_init(binary)
2391
            self._freeze = True
2392
            return
2393
        self._freeze = True
2394
2395 1
    def to_binary(self):
2396
        packet = []
2397
        return b''.join(packet)
2398
2399 1
    @staticmethod
2400
    def from_binary(data):
2401
        return DiscoveryConfiguration(data)
2402
2403 1
    def _binary_init(self, data):
2404
        pass
2405
2406 1
    def __str__(self):
2407
        return 'DiscoveryConfiguration(' +  + ')'
2408
2409 1
    __repr__ = __str__
2410
2411
2412 1
class MdnsDiscoveryConfiguration(FrozenClass):
2413
    '''
2414
    The discovery information needed for mDNS registration.
2415
2416
    :ivar MdnsServerName:
2417
    :vartype MdnsServerName: String
2418
    :ivar ServerCapabilities:
2419
    :vartype ServerCapabilities: String
2420
    '''
2421
2422 1
    ua_types = {
2423
        'MdnsServerName': 'String',
2424
        'ServerCapabilities': 'String',
2425
               }
2426
2427 1
    def __init__(self, binary=None):
2428
        if binary is not None:
2429
            self._binary_init(binary)
2430
            self._freeze = True
2431
            return
2432
        self.MdnsServerName = None
2433
        self.ServerCapabilities = []
2434
        self._freeze = True
2435
2436 1
    def to_binary(self):
2437
        packet = []
2438
        packet.append(uabin.Primitives.String.pack(self.MdnsServerName))
2439
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerCapabilities)))
2440
        for fieldname in self.ServerCapabilities:
2441
            packet.append(uabin.Primitives.String.pack(fieldname))
2442
        return b''.join(packet)
2443
2444 1
    @staticmethod
2445
    def from_binary(data):
2446
        return MdnsDiscoveryConfiguration(data)
2447
2448 1
    def _binary_init(self, data):
2449
        self.MdnsServerName = uabin.Primitives.String.unpack(data)
2450
        self.ServerCapabilities = uabin.Primitives.String.unpack_array(data)
2451
2452 1
    def __str__(self):
2453
        return 'MdnsDiscoveryConfiguration(' + 'MdnsServerName:' + str(self.MdnsServerName) + ', ' + \
2454
               'ServerCapabilities:' + str(self.ServerCapabilities) + ')'
2455
2456 1
    __repr__ = __str__
2457
2458
2459 1
class RegisterServer2Parameters(FrozenClass):
2460
    '''
2461
    :ivar Server:
2462
    :vartype Server: RegisteredServer
2463
    :ivar DiscoveryConfiguration:
2464
    :vartype DiscoveryConfiguration: ExtensionObject
2465
    '''
2466
2467 1
    ua_types = {
2468
        'Server': 'RegisteredServer',
2469
        'DiscoveryConfiguration': 'ExtensionObject',
2470
               }
2471
2472 1
    def __init__(self, binary=None):
2473
        if binary is not None:
2474
            self._binary_init(binary)
2475
            self._freeze = True
2476
            return
2477
        self.Server = RegisteredServer()
2478
        self.DiscoveryConfiguration = []
2479
        self._freeze = True
2480
2481 1
    def to_binary(self):
2482
        packet = []
2483
        packet.append(self.Server.to_binary())
2484
        packet.append(uabin.Primitives.Int32.pack(len(self.DiscoveryConfiguration)))
2485
        for fieldname in self.DiscoveryConfiguration:
2486
            packet.append(extensionobject_to_binary(fieldname))
2487
        return b''.join(packet)
2488
2489 1
    @staticmethod
2490
    def from_binary(data):
2491
        return RegisterServer2Parameters(data)
2492
2493 1
    def _binary_init(self, data):
2494
        self.Server = RegisteredServer.from_binary(data)
2495
        length = uabin.Primitives.Int32.unpack(data)
2496
        array = []
2497
        if length != -1:
2498
            for _ in range(0, length):
2499
                array.append(extensionobject_from_binary(data))
2500
        self.DiscoveryConfiguration = array
2501
2502 1
    def __str__(self):
2503
        return 'RegisterServer2Parameters(' + 'Server:' + str(self.Server) + ', ' + \
2504
               'DiscoveryConfiguration:' + str(self.DiscoveryConfiguration) + ')'
2505
2506 1
    __repr__ = __str__
2507
2508
2509 1
class RegisterServer2Request(FrozenClass):
2510
    '''
2511
    :ivar TypeId:
2512
    :vartype TypeId: NodeId
2513
    :ivar RequestHeader:
2514
    :vartype RequestHeader: RequestHeader
2515
    :ivar Parameters:
2516
    :vartype Parameters: RegisterServer2Parameters
2517
    '''
2518
2519 1
    ua_types = {
2520
        'TypeId': 'NodeId',
2521
        'RequestHeader': 'RequestHeader',
2522
        'Parameters': 'RegisterServer2Parameters',
2523
               }
2524
2525 1
    def __init__(self, binary=None):
2526
        if binary is not None:
2527
            self._binary_init(binary)
2528
            self._freeze = True
2529
            return
2530
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServer2Request_Encoding_DefaultBinary)
2531
        self.RequestHeader = RequestHeader()
2532
        self.Parameters = RegisterServer2Parameters()
2533
        self._freeze = True
2534
2535 1
    def to_binary(self):
2536
        packet = []
2537
        packet.append(self.TypeId.to_binary())
2538
        packet.append(self.RequestHeader.to_binary())
2539
        packet.append(self.Parameters.to_binary())
2540
        return b''.join(packet)
2541
2542 1
    @staticmethod
2543
    def from_binary(data):
2544
        return RegisterServer2Request(data)
2545
2546 1
    def _binary_init(self, data):
2547
        self.TypeId = NodeId.from_binary(data)
2548
        self.RequestHeader = RequestHeader.from_binary(data)
2549
        self.Parameters = RegisterServer2Parameters.from_binary(data)
2550
2551 1
    def __str__(self):
2552
        return 'RegisterServer2Request(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2553
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2554
               'Parameters:' + str(self.Parameters) + ')'
2555
2556 1
    __repr__ = __str__
2557
2558
2559 1
class RegisterServer2Response(FrozenClass):
2560
    '''
2561
    :ivar TypeId:
2562
    :vartype TypeId: NodeId
2563
    :ivar ResponseHeader:
2564
    :vartype ResponseHeader: ResponseHeader
2565
    :ivar ConfigurationResults:
2566
    :vartype ConfigurationResults: StatusCode
2567
    :ivar DiagnosticInfos:
2568
    :vartype DiagnosticInfos: DiagnosticInfo
2569
    '''
2570
2571 1
    ua_types = {
2572
        'TypeId': 'NodeId',
2573
        'ResponseHeader': 'ResponseHeader',
2574
        'ConfigurationResults': 'StatusCode',
2575
        'DiagnosticInfos': 'DiagnosticInfo',
2576
               }
2577
2578 1
    def __init__(self, binary=None):
2579
        if binary is not None:
2580
            self._binary_init(binary)
2581
            self._freeze = True
2582
            return
2583
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServer2Response_Encoding_DefaultBinary)
2584
        self.ResponseHeader = ResponseHeader()
2585
        self.ConfigurationResults = []
2586
        self.DiagnosticInfos = []
2587
        self._freeze = True
2588
2589 1
    def to_binary(self):
2590
        packet = []
2591
        packet.append(self.TypeId.to_binary())
2592
        packet.append(self.ResponseHeader.to_binary())
2593
        packet.append(uabin.Primitives.Int32.pack(len(self.ConfigurationResults)))
2594
        for fieldname in self.ConfigurationResults:
2595
            packet.append(fieldname.to_binary())
2596
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
2597
        for fieldname in self.DiagnosticInfos:
2598
            packet.append(fieldname.to_binary())
2599
        return b''.join(packet)
2600
2601 1
    @staticmethod
2602
    def from_binary(data):
2603
        return RegisterServer2Response(data)
2604
2605 1
    def _binary_init(self, data):
2606
        self.TypeId = NodeId.from_binary(data)
2607
        self.ResponseHeader = ResponseHeader.from_binary(data)
2608
        length = uabin.Primitives.Int32.unpack(data)
2609
        array = []
2610
        if length != -1:
2611
            for _ in range(0, length):
2612
                array.append(StatusCode.from_binary(data))
2613
        self.ConfigurationResults = array
2614
        length = uabin.Primitives.Int32.unpack(data)
2615
        array = []
2616
        if length != -1:
2617
            for _ in range(0, length):
2618
                array.append(DiagnosticInfo.from_binary(data))
2619
        self.DiagnosticInfos = array
2620
2621 1
    def __str__(self):
2622
        return 'RegisterServer2Response(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2623
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
2624
               'ConfigurationResults:' + str(self.ConfigurationResults) + ', ' + \
2625
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
2626
2627 1
    __repr__ = __str__
2628
2629
2630 1 View Code Duplication
class ChannelSecurityToken(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2631
    '''
2632
    The token that identifies a set of keys for an active secure channel.
2633
2634
    :ivar ChannelId:
2635
    :vartype ChannelId: UInt32
2636
    :ivar TokenId:
2637
    :vartype TokenId: UInt32
2638
    :ivar CreatedAt:
2639
    :vartype CreatedAt: DateTime
2640
    :ivar RevisedLifetime:
2641
    :vartype RevisedLifetime: UInt32
2642
    '''
2643
2644 1
    ua_types = {
2645
        'ChannelId': 'UInt32',
2646
        'TokenId': 'UInt32',
2647
        'CreatedAt': 'DateTime',
2648
        'RevisedLifetime': 'UInt32',
2649
               }
2650
2651 1
    def __init__(self, binary=None):
2652 1
        if binary is not None:
2653 1
            self._binary_init(binary)
2654 1
            self._freeze = True
2655 1
            return
2656 1
        self.ChannelId = 0
2657 1
        self.TokenId = 0
2658 1
        self.CreatedAt = datetime.utcnow()
2659 1
        self.RevisedLifetime = 0
2660 1
        self._freeze = True
2661
2662 1
    def to_binary(self):
2663 1
        packet = []
2664 1
        packet.append(uabin.Primitives.UInt32.pack(self.ChannelId))
2665 1
        packet.append(uabin.Primitives.UInt32.pack(self.TokenId))
2666 1
        packet.append(uabin.Primitives.DateTime.pack(self.CreatedAt))
2667 1
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedLifetime))
2668 1
        return b''.join(packet)
2669
2670 1
    @staticmethod
2671
    def from_binary(data):
2672 1
        return ChannelSecurityToken(data)
2673
2674 1
    def _binary_init(self, data):
2675 1
        self.ChannelId = uabin.Primitives.UInt32.unpack(data)
2676 1
        self.TokenId = uabin.Primitives.UInt32.unpack(data)
2677 1
        self.CreatedAt = uabin.Primitives.DateTime.unpack(data)
2678 1
        self.RevisedLifetime = uabin.Primitives.UInt32.unpack(data)
2679
2680 1
    def __str__(self):
2681
        return 'ChannelSecurityToken(' + 'ChannelId:' + str(self.ChannelId) + ', ' + \
2682
               'TokenId:' + str(self.TokenId) + ', ' + \
2683
               'CreatedAt:' + str(self.CreatedAt) + ', ' + \
2684
               'RevisedLifetime:' + str(self.RevisedLifetime) + ')'
2685
2686 1
    __repr__ = __str__
2687
2688
2689 1 View Code Duplication
class OpenSecureChannelParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
2690
    '''
2691
    :ivar ClientProtocolVersion:
2692
    :vartype ClientProtocolVersion: UInt32
2693
    :ivar RequestType:
2694
    :vartype RequestType: SecurityTokenRequestType
2695
    :ivar SecurityMode:
2696
    :vartype SecurityMode: MessageSecurityMode
2697
    :ivar ClientNonce:
2698
    :vartype ClientNonce: ByteString
2699
    :ivar RequestedLifetime:
2700
    :vartype RequestedLifetime: UInt32
2701
    '''
2702
2703 1
    ua_types = {
2704
        'ClientProtocolVersion': 'UInt32',
2705
        'RequestType': 'SecurityTokenRequestType',
2706
        'SecurityMode': 'MessageSecurityMode',
2707
        'ClientNonce': 'ByteString',
2708
        'RequestedLifetime': 'UInt32',
2709
               }
2710
2711 1
    def __init__(self, binary=None):
2712 1
        if binary is not None:
2713 1
            self._binary_init(binary)
2714 1
            self._freeze = True
2715 1
            return
2716 1
        self.ClientProtocolVersion = 0
2717 1
        self.RequestType = SecurityTokenRequestType(0)
2718 1
        self.SecurityMode = MessageSecurityMode(0)
2719 1
        self.ClientNonce = None
2720 1
        self.RequestedLifetime = 0
2721 1
        self._freeze = True
2722
2723 1
    def to_binary(self):
2724 1
        packet = []
2725 1
        packet.append(uabin.Primitives.UInt32.pack(self.ClientProtocolVersion))
2726 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestType.value))
2727 1
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityMode.value))
2728 1
        packet.append(uabin.Primitives.ByteString.pack(self.ClientNonce))
2729 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedLifetime))
2730 1
        return b''.join(packet)
2731
2732 1
    @staticmethod
2733
    def from_binary(data):
2734 1
        return OpenSecureChannelParameters(data)
2735
2736 1
    def _binary_init(self, data):
2737 1
        self.ClientProtocolVersion = uabin.Primitives.UInt32.unpack(data)
2738 1
        self.RequestType = SecurityTokenRequestType(uabin.Primitives.UInt32.unpack(data))
2739 1
        self.SecurityMode = MessageSecurityMode(uabin.Primitives.UInt32.unpack(data))
2740 1
        self.ClientNonce = uabin.Primitives.ByteString.unpack(data)
2741 1
        self.RequestedLifetime = uabin.Primitives.UInt32.unpack(data)
2742
2743 1
    def __str__(self):
2744
        return 'OpenSecureChannelParameters(' + 'ClientProtocolVersion:' + str(self.ClientProtocolVersion) + ', ' + \
2745
               'RequestType:' + str(self.RequestType) + ', ' + \
2746
               'SecurityMode:' + str(self.SecurityMode) + ', ' + \
2747
               'ClientNonce:' + str(self.ClientNonce) + ', ' + \
2748
               'RequestedLifetime:' + str(self.RequestedLifetime) + ')'
2749
2750 1
    __repr__ = __str__
2751
2752
2753 1
class OpenSecureChannelRequest(FrozenClass):
2754
    '''
2755
    Creates a secure channel with a server.
2756
2757
    :ivar TypeId:
2758
    :vartype TypeId: NodeId
2759
    :ivar RequestHeader:
2760
    :vartype RequestHeader: RequestHeader
2761
    :ivar Parameters:
2762
    :vartype Parameters: OpenSecureChannelParameters
2763
    '''
2764
2765 1
    ua_types = {
2766
        'TypeId': 'NodeId',
2767
        'RequestHeader': 'RequestHeader',
2768
        'Parameters': 'OpenSecureChannelParameters',
2769
               }
2770
2771 1
    def __init__(self, binary=None):
2772 1
        if binary is not None:
2773 1
            self._binary_init(binary)
2774 1
            self._freeze = True
2775 1
            return
2776 1
        self.TypeId = FourByteNodeId(ObjectIds.OpenSecureChannelRequest_Encoding_DefaultBinary)
2777 1
        self.RequestHeader = RequestHeader()
2778 1
        self.Parameters = OpenSecureChannelParameters()
2779 1
        self._freeze = True
2780
2781 1
    def to_binary(self):
2782 1
        packet = []
2783 1
        packet.append(self.TypeId.to_binary())
2784 1
        packet.append(self.RequestHeader.to_binary())
2785 1
        packet.append(self.Parameters.to_binary())
2786 1
        return b''.join(packet)
2787
2788 1
    @staticmethod
2789
    def from_binary(data):
2790 1
        return OpenSecureChannelRequest(data)
2791
2792 1
    def _binary_init(self, data):
2793 1
        self.TypeId = NodeId.from_binary(data)
2794 1
        self.RequestHeader = RequestHeader.from_binary(data)
2795 1
        self.Parameters = OpenSecureChannelParameters.from_binary(data)
2796
2797 1
    def __str__(self):
2798
        return 'OpenSecureChannelRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2799
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
2800
               'Parameters:' + str(self.Parameters) + ')'
2801
2802 1
    __repr__ = __str__
2803
2804
2805 1
class OpenSecureChannelResult(FrozenClass):
2806
    '''
2807
    :ivar ServerProtocolVersion:
2808
    :vartype ServerProtocolVersion: UInt32
2809
    :ivar SecurityToken:
2810
    :vartype SecurityToken: ChannelSecurityToken
2811
    :ivar ServerNonce:
2812
    :vartype ServerNonce: ByteString
2813
    '''
2814
2815 1
    ua_types = {
2816
        'ServerProtocolVersion': 'UInt32',
2817
        'SecurityToken': 'ChannelSecurityToken',
2818
        'ServerNonce': 'ByteString',
2819
               }
2820
2821 1
    def __init__(self, binary=None):
2822 1
        if binary is not None:
2823 1
            self._binary_init(binary)
2824 1
            self._freeze = True
2825 1
            return
2826 1
        self.ServerProtocolVersion = 0
2827 1
        self.SecurityToken = ChannelSecurityToken()
2828 1
        self.ServerNonce = None
2829 1
        self._freeze = True
2830
2831 1
    def to_binary(self):
2832 1
        packet = []
2833 1
        packet.append(uabin.Primitives.UInt32.pack(self.ServerProtocolVersion))
2834 1
        packet.append(self.SecurityToken.to_binary())
2835 1
        packet.append(uabin.Primitives.ByteString.pack(self.ServerNonce))
2836 1
        return b''.join(packet)
2837
2838 1
    @staticmethod
2839
    def from_binary(data):
2840 1
        return OpenSecureChannelResult(data)
2841
2842 1
    def _binary_init(self, data):
2843 1
        self.ServerProtocolVersion = uabin.Primitives.UInt32.unpack(data)
2844 1
        self.SecurityToken = ChannelSecurityToken.from_binary(data)
2845 1
        self.ServerNonce = uabin.Primitives.ByteString.unpack(data)
2846
2847 1
    def __str__(self):
2848
        return 'OpenSecureChannelResult(' + 'ServerProtocolVersion:' + str(self.ServerProtocolVersion) + ', ' + \
2849
               'SecurityToken:' + str(self.SecurityToken) + ', ' + \
2850
               'ServerNonce:' + str(self.ServerNonce) + ')'
2851
2852 1
    __repr__ = __str__
2853
2854
2855 1
class OpenSecureChannelResponse(FrozenClass):
2856
    '''
2857
    Creates a secure channel with a server.
2858
2859
    :ivar TypeId:
2860
    :vartype TypeId: NodeId
2861
    :ivar ResponseHeader:
2862
    :vartype ResponseHeader: ResponseHeader
2863
    :ivar Parameters:
2864
    :vartype Parameters: OpenSecureChannelResult
2865
    '''
2866
2867 1
    ua_types = {
2868
        'TypeId': 'NodeId',
2869
        'ResponseHeader': 'ResponseHeader',
2870
        'Parameters': 'OpenSecureChannelResult',
2871
               }
2872
2873 1
    def __init__(self, binary=None):
2874 1
        if binary is not None:
2875 1
            self._binary_init(binary)
2876 1
            self._freeze = True
2877 1
            return
2878 1
        self.TypeId = FourByteNodeId(ObjectIds.OpenSecureChannelResponse_Encoding_DefaultBinary)
2879 1
        self.ResponseHeader = ResponseHeader()
2880 1
        self.Parameters = OpenSecureChannelResult()
2881 1
        self._freeze = True
2882
2883 1
    def to_binary(self):
2884 1
        packet = []
2885 1
        packet.append(self.TypeId.to_binary())
2886 1
        packet.append(self.ResponseHeader.to_binary())
2887 1
        packet.append(self.Parameters.to_binary())
2888 1
        return b''.join(packet)
2889
2890 1
    @staticmethod
2891
    def from_binary(data):
2892 1
        return OpenSecureChannelResponse(data)
2893
2894 1
    def _binary_init(self, data):
2895 1
        self.TypeId = NodeId.from_binary(data)
2896 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
2897 1
        self.Parameters = OpenSecureChannelResult.from_binary(data)
2898
2899 1
    def __str__(self):
2900
        return 'OpenSecureChannelResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2901
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
2902
               'Parameters:' + str(self.Parameters) + ')'
2903
2904 1
    __repr__ = __str__
2905
2906
2907 1
class CloseSecureChannelRequest(FrozenClass):
2908
    '''
2909
    Closes a secure channel.
2910
2911
    :ivar TypeId:
2912
    :vartype TypeId: NodeId
2913
    :ivar RequestHeader:
2914
    :vartype RequestHeader: RequestHeader
2915
    '''
2916
2917 1
    ua_types = {
2918
        'TypeId': 'NodeId',
2919
        'RequestHeader': 'RequestHeader',
2920
               }
2921
2922 1
    def __init__(self, binary=None):
2923 1
        if binary is not None:
2924
            self._binary_init(binary)
2925
            self._freeze = True
2926
            return
2927 1
        self.TypeId = FourByteNodeId(ObjectIds.CloseSecureChannelRequest_Encoding_DefaultBinary)
2928 1
        self.RequestHeader = RequestHeader()
2929 1
        self._freeze = True
2930
2931 1
    def to_binary(self):
2932 1
        packet = []
2933 1
        packet.append(self.TypeId.to_binary())
2934 1
        packet.append(self.RequestHeader.to_binary())
2935 1
        return b''.join(packet)
2936
2937 1
    @staticmethod
2938
    def from_binary(data):
2939
        return CloseSecureChannelRequest(data)
2940
2941 1
    def _binary_init(self, data):
2942
        self.TypeId = NodeId.from_binary(data)
2943
        self.RequestHeader = RequestHeader.from_binary(data)
2944
2945 1
    def __str__(self):
2946
        return 'CloseSecureChannelRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2947
               'RequestHeader:' + str(self.RequestHeader) + ')'
2948
2949 1
    __repr__ = __str__
2950
2951
2952 1
class CloseSecureChannelResponse(FrozenClass):
2953
    '''
2954
    Closes a secure channel.
2955
2956
    :ivar TypeId:
2957
    :vartype TypeId: NodeId
2958
    :ivar ResponseHeader:
2959
    :vartype ResponseHeader: ResponseHeader
2960
    '''
2961
2962 1
    ua_types = {
2963
        'TypeId': 'NodeId',
2964
        'ResponseHeader': 'ResponseHeader',
2965
               }
2966
2967 1
    def __init__(self, binary=None):
2968
        if binary is not None:
2969
            self._binary_init(binary)
2970
            self._freeze = True
2971
            return
2972
        self.TypeId = FourByteNodeId(ObjectIds.CloseSecureChannelResponse_Encoding_DefaultBinary)
2973
        self.ResponseHeader = ResponseHeader()
2974
        self._freeze = True
2975
2976 1
    def to_binary(self):
2977
        packet = []
2978
        packet.append(self.TypeId.to_binary())
2979
        packet.append(self.ResponseHeader.to_binary())
2980
        return b''.join(packet)
2981
2982 1
    @staticmethod
2983
    def from_binary(data):
2984
        return CloseSecureChannelResponse(data)
2985
2986 1
    def _binary_init(self, data):
2987
        self.TypeId = NodeId.from_binary(data)
2988
        self.ResponseHeader = ResponseHeader.from_binary(data)
2989
2990 1
    def __str__(self):
2991
        return 'CloseSecureChannelResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2992
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
2993
2994 1
    __repr__ = __str__
2995
2996
2997 1
class SignedSoftwareCertificate(FrozenClass):
2998
    '''
2999
    A software certificate with a digital signature.
3000
3001
    :ivar CertificateData:
3002
    :vartype CertificateData: ByteString
3003
    :ivar Signature:
3004
    :vartype Signature: ByteString
3005
    '''
3006
3007 1
    ua_types = {
3008
        'CertificateData': 'ByteString',
3009
        'Signature': 'ByteString',
3010
               }
3011
3012 1
    def __init__(self, binary=None):
3013
        if binary is not None:
3014
            self._binary_init(binary)
3015
            self._freeze = True
3016
            return
3017
        self.CertificateData = None
3018
        self.Signature = None
3019
        self._freeze = True
3020
3021 1
    def to_binary(self):
3022
        packet = []
3023
        packet.append(uabin.Primitives.ByteString.pack(self.CertificateData))
3024
        packet.append(uabin.Primitives.ByteString.pack(self.Signature))
3025
        return b''.join(packet)
3026
3027 1
    @staticmethod
3028
    def from_binary(data):
3029
        return SignedSoftwareCertificate(data)
3030
3031 1
    def _binary_init(self, data):
3032
        self.CertificateData = uabin.Primitives.ByteString.unpack(data)
3033
        self.Signature = uabin.Primitives.ByteString.unpack(data)
3034
3035 1
    def __str__(self):
3036
        return 'SignedSoftwareCertificate(' + 'CertificateData:' + str(self.CertificateData) + ', ' + \
3037
               'Signature:' + str(self.Signature) + ')'
3038
3039 1
    __repr__ = __str__
3040
3041
3042 1
class SignatureData(FrozenClass):
3043
    '''
3044
    A digital signature.
3045
3046
    :ivar Algorithm:
3047
    :vartype Algorithm: String
3048
    :ivar Signature:
3049
    :vartype Signature: ByteString
3050
    '''
3051
3052 1
    ua_types = {
3053
        'Algorithm': 'String',
3054
        'Signature': 'ByteString',
3055
               }
3056
3057 1
    def __init__(self, binary=None):
3058 1
        if binary is not None:
3059 1
            self._binary_init(binary)
3060 1
            self._freeze = True
3061 1
            return
3062 1
        self.Algorithm = None
3063 1
        self.Signature = None
3064 1
        self._freeze = True
3065
3066 1
    def to_binary(self):
3067 1
        packet = []
3068 1
        packet.append(uabin.Primitives.String.pack(self.Algorithm))
3069 1
        packet.append(uabin.Primitives.ByteString.pack(self.Signature))
3070 1
        return b''.join(packet)
3071
3072 1
    @staticmethod
3073
    def from_binary(data):
3074 1
        return SignatureData(data)
3075
3076 1
    def _binary_init(self, data):
3077 1
        self.Algorithm = uabin.Primitives.String.unpack(data)
3078 1
        self.Signature = uabin.Primitives.ByteString.unpack(data)
3079
3080 1
    def __str__(self):
3081
        return 'SignatureData(' + 'Algorithm:' + str(self.Algorithm) + ', ' + \
3082
               'Signature:' + str(self.Signature) + ')'
3083
3084 1
    __repr__ = __str__
3085
3086
3087 1
class CreateSessionParameters(FrozenClass):
3088
    '''
3089
    :ivar ClientDescription:
3090
    :vartype ClientDescription: ApplicationDescription
3091
    :ivar ServerUri:
3092
    :vartype ServerUri: String
3093
    :ivar EndpointUrl:
3094
    :vartype EndpointUrl: String
3095
    :ivar SessionName:
3096
    :vartype SessionName: String
3097
    :ivar ClientNonce:
3098
    :vartype ClientNonce: ByteString
3099
    :ivar ClientCertificate:
3100
    :vartype ClientCertificate: ByteString
3101
    :ivar RequestedSessionTimeout:
3102
    :vartype RequestedSessionTimeout: Double
3103
    :ivar MaxResponseMessageSize:
3104
    :vartype MaxResponseMessageSize: UInt32
3105
    '''
3106
3107 1
    ua_types = {
3108
        'ClientDescription': 'ApplicationDescription',
3109
        'ServerUri': 'String',
3110
        'EndpointUrl': 'String',
3111
        'SessionName': 'String',
3112
        'ClientNonce': 'ByteString',
3113
        'ClientCertificate': 'ByteString',
3114
        'RequestedSessionTimeout': 'Double',
3115
        'MaxResponseMessageSize': 'UInt32',
3116
               }
3117
3118 1
    def __init__(self, binary=None):
3119 1
        if binary is not None:
3120 1
            self._binary_init(binary)
3121 1
            self._freeze = True
3122 1
            return
3123 1
        self.ClientDescription = ApplicationDescription()
3124 1
        self.ServerUri = None
3125 1
        self.EndpointUrl = None
3126 1
        self.SessionName = None
3127 1
        self.ClientNonce = None
3128 1
        self.ClientCertificate = None
3129 1
        self.RequestedSessionTimeout = 0
3130 1
        self.MaxResponseMessageSize = 0
3131 1
        self._freeze = True
3132
3133 1 View Code Duplication
    def to_binary(self):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3134 1
        packet = []
3135 1
        packet.append(self.ClientDescription.to_binary())
3136 1
        packet.append(uabin.Primitives.String.pack(self.ServerUri))
3137 1
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
3138 1
        packet.append(uabin.Primitives.String.pack(self.SessionName))
3139 1
        packet.append(uabin.Primitives.ByteString.pack(self.ClientNonce))
3140 1
        packet.append(uabin.Primitives.ByteString.pack(self.ClientCertificate))
3141 1
        packet.append(uabin.Primitives.Double.pack(self.RequestedSessionTimeout))
3142 1
        packet.append(uabin.Primitives.UInt32.pack(self.MaxResponseMessageSize))
3143 1
        return b''.join(packet)
3144
3145 1
    @staticmethod
3146
    def from_binary(data):
3147 1
        return CreateSessionParameters(data)
3148
3149 1
    def _binary_init(self, data):
3150 1
        self.ClientDescription = ApplicationDescription.from_binary(data)
3151 1
        self.ServerUri = uabin.Primitives.String.unpack(data)
3152 1
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
3153 1
        self.SessionName = uabin.Primitives.String.unpack(data)
3154 1
        self.ClientNonce = uabin.Primitives.ByteString.unpack(data)
3155 1
        self.ClientCertificate = uabin.Primitives.ByteString.unpack(data)
3156 1
        self.RequestedSessionTimeout = uabin.Primitives.Double.unpack(data)
3157 1
        self.MaxResponseMessageSize = uabin.Primitives.UInt32.unpack(data)
3158
3159 1
    def __str__(self):
3160
        return 'CreateSessionParameters(' + 'ClientDescription:' + str(self.ClientDescription) + ', ' + \
3161
               'ServerUri:' + str(self.ServerUri) + ', ' + \
3162
               'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
3163
               'SessionName:' + str(self.SessionName) + ', ' + \
3164
               'ClientNonce:' + str(self.ClientNonce) + ', ' + \
3165
               'ClientCertificate:' + str(self.ClientCertificate) + ', ' + \
3166
               'RequestedSessionTimeout:' + str(self.RequestedSessionTimeout) + ', ' + \
3167
               'MaxResponseMessageSize:' + str(self.MaxResponseMessageSize) + ')'
3168
3169 1
    __repr__ = __str__
3170
3171
3172 1
class CreateSessionRequest(FrozenClass):
3173
    '''
3174
    Creates a new session with the server.
3175
3176
    :ivar TypeId:
3177
    :vartype TypeId: NodeId
3178
    :ivar RequestHeader:
3179
    :vartype RequestHeader: RequestHeader
3180
    :ivar Parameters:
3181
    :vartype Parameters: CreateSessionParameters
3182
    '''
3183
3184 1
    ua_types = {
3185
        'TypeId': 'NodeId',
3186
        'RequestHeader': 'RequestHeader',
3187
        'Parameters': 'CreateSessionParameters',
3188
               }
3189
3190 1
    def __init__(self, binary=None):
3191 1
        if binary is not None:
3192
            self._binary_init(binary)
3193
            self._freeze = True
3194
            return
3195 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateSessionRequest_Encoding_DefaultBinary)
3196 1
        self.RequestHeader = RequestHeader()
3197 1
        self.Parameters = CreateSessionParameters()
3198 1
        self._freeze = True
3199
3200 1
    def to_binary(self):
3201 1
        packet = []
3202 1
        packet.append(self.TypeId.to_binary())
3203 1
        packet.append(self.RequestHeader.to_binary())
3204 1
        packet.append(self.Parameters.to_binary())
3205 1
        return b''.join(packet)
3206
3207 1
    @staticmethod
3208
    def from_binary(data):
3209
        return CreateSessionRequest(data)
3210
3211 1
    def _binary_init(self, data):
3212
        self.TypeId = NodeId.from_binary(data)
3213
        self.RequestHeader = RequestHeader.from_binary(data)
3214
        self.Parameters = CreateSessionParameters.from_binary(data)
3215
3216 1
    def __str__(self):
3217
        return 'CreateSessionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3218
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
3219
               'Parameters:' + str(self.Parameters) + ')'
3220
3221 1
    __repr__ = __str__
3222
3223
3224 1
class CreateSessionResult(FrozenClass):
3225
    '''
3226
    :ivar SessionId:
3227
    :vartype SessionId: NodeId
3228
    :ivar AuthenticationToken:
3229
    :vartype AuthenticationToken: NodeId
3230
    :ivar RevisedSessionTimeout:
3231
    :vartype RevisedSessionTimeout: Double
3232
    :ivar ServerNonce:
3233
    :vartype ServerNonce: ByteString
3234
    :ivar ServerCertificate:
3235
    :vartype ServerCertificate: ByteString
3236
    :ivar ServerEndpoints:
3237
    :vartype ServerEndpoints: EndpointDescription
3238
    :ivar ServerSoftwareCertificates:
3239
    :vartype ServerSoftwareCertificates: SignedSoftwareCertificate
3240
    :ivar ServerSignature:
3241
    :vartype ServerSignature: SignatureData
3242
    :ivar MaxRequestMessageSize:
3243
    :vartype MaxRequestMessageSize: UInt32
3244
    '''
3245
3246 1
    ua_types = {
3247
        'SessionId': 'NodeId',
3248
        'AuthenticationToken': 'NodeId',
3249
        'RevisedSessionTimeout': 'Double',
3250
        'ServerNonce': 'ByteString',
3251
        'ServerCertificate': 'ByteString',
3252
        'ServerEndpoints': 'EndpointDescription',
3253
        'ServerSoftwareCertificates': 'SignedSoftwareCertificate',
3254
        'ServerSignature': 'SignatureData',
3255
        'MaxRequestMessageSize': 'UInt32',
3256
               }
3257
3258 1
    def __init__(self, binary=None):
3259 1
        if binary is not None:
3260 1
            self._binary_init(binary)
3261 1
            self._freeze = True
3262 1
            return
3263 1
        self.SessionId = NodeId()
3264 1
        self.AuthenticationToken = NodeId()
3265 1
        self.RevisedSessionTimeout = 0
3266 1
        self.ServerNonce = None
3267 1
        self.ServerCertificate = None
3268 1
        self.ServerEndpoints = []
3269 1
        self.ServerSoftwareCertificates = []
3270 1
        self.ServerSignature = SignatureData()
3271 1
        self.MaxRequestMessageSize = 0
3272 1
        self._freeze = True
3273
3274 1
    def to_binary(self):
3275 1
        packet = []
3276 1
        packet.append(self.SessionId.to_binary())
3277 1
        packet.append(self.AuthenticationToken.to_binary())
3278 1
        packet.append(uabin.Primitives.Double.pack(self.RevisedSessionTimeout))
3279 1
        packet.append(uabin.Primitives.ByteString.pack(self.ServerNonce))
3280 1
        packet.append(uabin.Primitives.ByteString.pack(self.ServerCertificate))
3281 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerEndpoints)))
3282 1
        for fieldname in self.ServerEndpoints:
3283 1
            packet.append(fieldname.to_binary())
3284 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ServerSoftwareCertificates)))
3285 1
        for fieldname in self.ServerSoftwareCertificates:
3286
            packet.append(fieldname.to_binary())
3287 1
        packet.append(self.ServerSignature.to_binary())
3288 1
        packet.append(uabin.Primitives.UInt32.pack(self.MaxRequestMessageSize))
3289 1
        return b''.join(packet)
3290
3291 1
    @staticmethod
3292
    def from_binary(data):
3293 1
        return CreateSessionResult(data)
3294
3295 1
    def _binary_init(self, data):
3296 1
        self.SessionId = NodeId.from_binary(data)
3297 1
        self.AuthenticationToken = NodeId.from_binary(data)
3298 1
        self.RevisedSessionTimeout = uabin.Primitives.Double.unpack(data)
3299 1
        self.ServerNonce = uabin.Primitives.ByteString.unpack(data)
3300 1
        self.ServerCertificate = uabin.Primitives.ByteString.unpack(data)
3301 1
        length = uabin.Primitives.Int32.unpack(data)
3302 1
        array = []
3303 1
        if length != -1:
3304 1
            for _ in range(0, length):
3305 1
                array.append(EndpointDescription.from_binary(data))
3306 1
        self.ServerEndpoints = array
3307 1
        length = uabin.Primitives.Int32.unpack(data)
3308 1
        array = []
3309 1
        if length != -1:
3310 1
            for _ in range(0, length):
3311
                array.append(SignedSoftwareCertificate.from_binary(data))
3312 1
        self.ServerSoftwareCertificates = array
3313 1
        self.ServerSignature = SignatureData.from_binary(data)
3314 1
        self.MaxRequestMessageSize = uabin.Primitives.UInt32.unpack(data)
3315
3316 1
    def __str__(self):
3317
        return 'CreateSessionResult(' + 'SessionId:' + str(self.SessionId) + ', ' + \
3318
               'AuthenticationToken:' + str(self.AuthenticationToken) + ', ' + \
3319
               'RevisedSessionTimeout:' + str(self.RevisedSessionTimeout) + ', ' + \
3320
               'ServerNonce:' + str(self.ServerNonce) + ', ' + \
3321
               'ServerCertificate:' + str(self.ServerCertificate) + ', ' + \
3322
               'ServerEndpoints:' + str(self.ServerEndpoints) + ', ' + \
3323
               'ServerSoftwareCertificates:' + str(self.ServerSoftwareCertificates) + ', ' + \
3324
               'ServerSignature:' + str(self.ServerSignature) + ', ' + \
3325
               'MaxRequestMessageSize:' + str(self.MaxRequestMessageSize) + ')'
3326
3327 1
    __repr__ = __str__
3328
3329
3330 1
class CreateSessionResponse(FrozenClass):
3331
    '''
3332
    Creates a new session with the server.
3333
3334
    :ivar TypeId:
3335
    :vartype TypeId: NodeId
3336
    :ivar ResponseHeader:
3337
    :vartype ResponseHeader: ResponseHeader
3338
    :ivar Parameters:
3339
    :vartype Parameters: CreateSessionResult
3340
    '''
3341
3342 1
    ua_types = {
3343
        'TypeId': 'NodeId',
3344
        'ResponseHeader': 'ResponseHeader',
3345
        'Parameters': 'CreateSessionResult',
3346
               }
3347
3348 1
    def __init__(self, binary=None):
3349 1
        if binary is not None:
3350 1
            self._binary_init(binary)
3351 1
            self._freeze = True
3352 1
            return
3353 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateSessionResponse_Encoding_DefaultBinary)
3354 1
        self.ResponseHeader = ResponseHeader()
3355 1
        self.Parameters = CreateSessionResult()
3356 1
        self._freeze = True
3357
3358 1
    def to_binary(self):
3359 1
        packet = []
3360 1
        packet.append(self.TypeId.to_binary())
3361 1
        packet.append(self.ResponseHeader.to_binary())
3362 1
        packet.append(self.Parameters.to_binary())
3363 1
        return b''.join(packet)
3364
3365 1
    @staticmethod
3366
    def from_binary(data):
3367 1
        return CreateSessionResponse(data)
3368
3369 1
    def _binary_init(self, data):
3370 1
        self.TypeId = NodeId.from_binary(data)
3371 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
3372 1
        self.Parameters = CreateSessionResult.from_binary(data)
3373
3374 1
    def __str__(self):
3375
        return 'CreateSessionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3376
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
3377
               'Parameters:' + str(self.Parameters) + ')'
3378
3379 1
    __repr__ = __str__
3380
3381
3382 1
class UserIdentityToken(FrozenClass):
3383
    '''
3384
    A base type for a user identity token.
3385
3386
    :ivar PolicyId:
3387
    :vartype PolicyId: String
3388
    '''
3389
3390 1
    ua_types = {
3391
        'PolicyId': 'String',
3392
               }
3393
3394 1
    def __init__(self, binary=None):
3395
        if binary is not None:
3396
            self._binary_init(binary)
3397
            self._freeze = True
3398
            return
3399
        self.PolicyId = None
3400
        self._freeze = True
3401
3402 1
    def to_binary(self):
3403
        packet = []
3404
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3405
        return b''.join(packet)
3406
3407 1
    @staticmethod
3408
    def from_binary(data):
3409
        return UserIdentityToken(data)
3410
3411 1
    def _binary_init(self, data):
3412
        self.PolicyId = uabin.Primitives.String.unpack(data)
3413
3414 1
    def __str__(self):
3415
        return 'UserIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ')'
3416
3417 1
    __repr__ = __str__
3418
3419
3420 1
class AnonymousIdentityToken(FrozenClass):
3421
    '''
3422
    A token representing an anonymous user.
3423
3424
    :ivar PolicyId:
3425
    :vartype PolicyId: String
3426
    '''
3427
3428 1
    ua_types = {
3429
        'PolicyId': 'String',
3430
               }
3431
3432 1
    def __init__(self, binary=None):
3433 1
        if binary is not None:
3434 1
            self._binary_init(binary)
3435 1
            self._freeze = True
3436 1
            return
3437 1
        self.PolicyId = None
3438 1
        self._freeze = True
3439
3440 1
    def to_binary(self):
3441 1
        packet = []
3442 1
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3443 1
        return b''.join(packet)
3444
3445 1
    @staticmethod
3446
    def from_binary(data):
3447 1
        return AnonymousIdentityToken(data)
3448
3449 1
    def _binary_init(self, data):
3450 1
        self.PolicyId = uabin.Primitives.String.unpack(data)
3451
3452 1
    def __str__(self):
3453
        return 'AnonymousIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ')'
3454
3455 1
    __repr__ = __str__
3456
3457
3458 1 View Code Duplication
class UserNameIdentityToken(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3459
    '''
3460
    A token representing a user identified by a user name and password.
3461
3462
    :ivar PolicyId:
3463
    :vartype PolicyId: String
3464
    :ivar UserName:
3465
    :vartype UserName: String
3466
    :ivar Password:
3467
    :vartype Password: ByteString
3468
    :ivar EncryptionAlgorithm:
3469
    :vartype EncryptionAlgorithm: String
3470
    '''
3471
3472 1
    ua_types = {
3473
        'PolicyId': 'String',
3474
        'UserName': 'String',
3475
        'Password': 'ByteString',
3476
        'EncryptionAlgorithm': 'String',
3477
               }
3478
3479 1
    def __init__(self, binary=None):
3480 1
        if binary is not None:
3481 1
            self._binary_init(binary)
3482 1
            self._freeze = True
3483 1
            return
3484 1
        self.PolicyId = None
3485 1
        self.UserName = None
3486 1
        self.Password = None
3487 1
        self.EncryptionAlgorithm = None
3488 1
        self._freeze = True
3489
3490 1
    def to_binary(self):
3491 1
        packet = []
3492 1
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3493 1
        packet.append(uabin.Primitives.String.pack(self.UserName))
3494 1
        packet.append(uabin.Primitives.ByteString.pack(self.Password))
3495 1
        packet.append(uabin.Primitives.String.pack(self.EncryptionAlgorithm))
3496 1
        return b''.join(packet)
3497
3498 1
    @staticmethod
3499
    def from_binary(data):
3500 1
        return UserNameIdentityToken(data)
3501
3502 1
    def _binary_init(self, data):
3503 1
        self.PolicyId = uabin.Primitives.String.unpack(data)
3504 1
        self.UserName = uabin.Primitives.String.unpack(data)
3505 1
        self.Password = uabin.Primitives.ByteString.unpack(data)
3506 1
        self.EncryptionAlgorithm = uabin.Primitives.String.unpack(data)
3507
3508 1
    def __str__(self):
3509
        return 'UserNameIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3510
               'UserName:' + str(self.UserName) + ', ' + \
3511
               'Password:' + str(self.Password) + ', ' + \
3512
               'EncryptionAlgorithm:' + str(self.EncryptionAlgorithm) + ')'
3513
3514 1
    __repr__ = __str__
3515
3516
3517 1
class X509IdentityToken(FrozenClass):
3518
    '''
3519
    A token representing a user identified by an X509 certificate.
3520
3521
    :ivar PolicyId:
3522
    :vartype PolicyId: String
3523
    :ivar CertificateData:
3524
    :vartype CertificateData: ByteString
3525
    '''
3526
3527 1
    ua_types = {
3528
        'PolicyId': 'String',
3529
        'CertificateData': 'ByteString',
3530
               }
3531
3532 1
    def __init__(self, binary=None):
3533
        if binary is not None:
3534
            self._binary_init(binary)
3535
            self._freeze = True
3536
            return
3537
        self.PolicyId = None
3538
        self.CertificateData = None
3539
        self._freeze = True
3540
3541 1
    def to_binary(self):
3542
        packet = []
3543
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3544
        packet.append(uabin.Primitives.ByteString.pack(self.CertificateData))
3545
        return b''.join(packet)
3546
3547 1
    @staticmethod
3548
    def from_binary(data):
3549
        return X509IdentityToken(data)
3550
3551 1
    def _binary_init(self, data):
3552
        self.PolicyId = uabin.Primitives.String.unpack(data)
3553
        self.CertificateData = uabin.Primitives.ByteString.unpack(data)
3554
3555 1
    def __str__(self):
3556
        return 'X509IdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3557
               'CertificateData:' + str(self.CertificateData) + ')'
3558
3559 1
    __repr__ = __str__
3560
3561
3562 1
class KerberosIdentityToken(FrozenClass):
3563
    '''
3564
    :ivar PolicyId:
3565
    :vartype PolicyId: String
3566
    :ivar TicketData:
3567
    :vartype TicketData: ByteString
3568
    '''
3569
3570 1
    ua_types = {
3571
        'PolicyId': 'String',
3572
        'TicketData': 'ByteString',
3573
               }
3574
3575 1
    def __init__(self, binary=None):
3576
        if binary is not None:
3577
            self._binary_init(binary)
3578
            self._freeze = True
3579
            return
3580
        self.PolicyId = None
3581
        self.TicketData = None
3582
        self._freeze = True
3583
3584 1
    def to_binary(self):
3585
        packet = []
3586
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3587
        packet.append(uabin.Primitives.ByteString.pack(self.TicketData))
3588
        return b''.join(packet)
3589
3590 1
    @staticmethod
3591
    def from_binary(data):
3592
        return KerberosIdentityToken(data)
3593
3594 1
    def _binary_init(self, data):
3595
        self.PolicyId = uabin.Primitives.String.unpack(data)
3596
        self.TicketData = uabin.Primitives.ByteString.unpack(data)
3597
3598 1
    def __str__(self):
3599
        return 'KerberosIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3600
               'TicketData:' + str(self.TicketData) + ')'
3601
3602 1
    __repr__ = __str__
3603
3604
3605 1
class IssuedIdentityToken(FrozenClass):
3606
    '''
3607
    A token representing a user identified by a WS-Security XML token.
3608
3609
    :ivar PolicyId:
3610
    :vartype PolicyId: String
3611
    :ivar TokenData:
3612
    :vartype TokenData: ByteString
3613
    :ivar EncryptionAlgorithm:
3614
    :vartype EncryptionAlgorithm: String
3615
    '''
3616
3617 1
    ua_types = {
3618
        'PolicyId': 'String',
3619
        'TokenData': 'ByteString',
3620
        'EncryptionAlgorithm': 'String',
3621
               }
3622
3623 1
    def __init__(self, binary=None):
3624
        if binary is not None:
3625
            self._binary_init(binary)
3626
            self._freeze = True
3627
            return
3628
        self.PolicyId = None
3629
        self.TokenData = None
3630
        self.EncryptionAlgorithm = None
3631
        self._freeze = True
3632
3633 1
    def to_binary(self):
3634
        packet = []
3635
        packet.append(uabin.Primitives.String.pack(self.PolicyId))
3636
        packet.append(uabin.Primitives.ByteString.pack(self.TokenData))
3637
        packet.append(uabin.Primitives.String.pack(self.EncryptionAlgorithm))
3638
        return b''.join(packet)
3639
3640 1
    @staticmethod
3641
    def from_binary(data):
3642
        return IssuedIdentityToken(data)
3643
3644 1
    def _binary_init(self, data):
3645
        self.PolicyId = uabin.Primitives.String.unpack(data)
3646
        self.TokenData = uabin.Primitives.ByteString.unpack(data)
3647
        self.EncryptionAlgorithm = uabin.Primitives.String.unpack(data)
3648
3649 1
    def __str__(self):
3650
        return 'IssuedIdentityToken(' + 'PolicyId:' + str(self.PolicyId) + ', ' + \
3651
               'TokenData:' + str(self.TokenData) + ', ' + \
3652
               'EncryptionAlgorithm:' + str(self.EncryptionAlgorithm) + ')'
3653
3654 1
    __repr__ = __str__
3655
3656
3657 1 View Code Duplication
class ActivateSessionParameters(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
3658
    '''
3659
    :ivar ClientSignature:
3660
    :vartype ClientSignature: SignatureData
3661
    :ivar ClientSoftwareCertificates:
3662
    :vartype ClientSoftwareCertificates: SignedSoftwareCertificate
3663
    :ivar LocaleIds:
3664
    :vartype LocaleIds: String
3665
    :ivar UserIdentityToken:
3666
    :vartype UserIdentityToken: ExtensionObject
3667
    :ivar UserTokenSignature:
3668
    :vartype UserTokenSignature: SignatureData
3669
    '''
3670
3671 1
    ua_types = {
3672
        'ClientSignature': 'SignatureData',
3673
        'ClientSoftwareCertificates': 'SignedSoftwareCertificate',
3674
        'LocaleIds': 'String',
3675
        'UserIdentityToken': 'ExtensionObject',
3676
        'UserTokenSignature': 'SignatureData',
3677
               }
3678
3679 1
    def __init__(self, binary=None):
3680 1
        if binary is not None:
3681 1
            self._binary_init(binary)
3682 1
            self._freeze = True
3683 1
            return
3684 1
        self.ClientSignature = SignatureData()
3685 1
        self.ClientSoftwareCertificates = []
3686 1
        self.LocaleIds = []
3687 1
        self.UserIdentityToken = None
3688 1
        self.UserTokenSignature = SignatureData()
3689 1
        self._freeze = True
3690
3691 1
    def to_binary(self):
3692 1
        packet = []
3693 1
        packet.append(self.ClientSignature.to_binary())
3694 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ClientSoftwareCertificates)))
3695 1
        for fieldname in self.ClientSoftwareCertificates:
3696
            packet.append(fieldname.to_binary())
3697 1
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
3698 1
        for fieldname in self.LocaleIds:
3699 1
            packet.append(uabin.Primitives.String.pack(fieldname))
3700 1
        packet.append(extensionobject_to_binary(self.UserIdentityToken))
3701 1
        packet.append(self.UserTokenSignature.to_binary())
3702 1
        return b''.join(packet)
3703
3704 1
    @staticmethod
3705
    def from_binary(data):
3706 1
        return ActivateSessionParameters(data)
3707
3708 1
    def _binary_init(self, data):
3709 1
        self.ClientSignature = SignatureData.from_binary(data)
3710 1
        length = uabin.Primitives.Int32.unpack(data)
3711 1
        array = []
3712 1
        if length != -1:
3713 1
            for _ in range(0, length):
3714
                array.append(SignedSoftwareCertificate.from_binary(data))
3715 1
        self.ClientSoftwareCertificates = array
3716 1
        self.LocaleIds = uabin.Primitives.String.unpack_array(data)
3717 1
        self.UserIdentityToken = extensionobject_from_binary(data)
3718 1
        self.UserTokenSignature = SignatureData.from_binary(data)
3719
3720 1
    def __str__(self):
3721
        return 'ActivateSessionParameters(' + 'ClientSignature:' + str(self.ClientSignature) + ', ' + \
3722
               'ClientSoftwareCertificates:' + str(self.ClientSoftwareCertificates) + ', ' + \
3723
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
3724
               'UserIdentityToken:' + str(self.UserIdentityToken) + ', ' + \
3725
               'UserTokenSignature:' + str(self.UserTokenSignature) + ')'
3726
3727 1
    __repr__ = __str__
3728
3729
3730 1
class ActivateSessionRequest(FrozenClass):
3731
    '''
3732
    Activates a session with the server.
3733
3734
    :ivar TypeId:
3735
    :vartype TypeId: NodeId
3736
    :ivar RequestHeader:
3737
    :vartype RequestHeader: RequestHeader
3738
    :ivar Parameters:
3739
    :vartype Parameters: ActivateSessionParameters
3740
    '''
3741
3742 1
    ua_types = {
3743
        'TypeId': 'NodeId',
3744
        'RequestHeader': 'RequestHeader',
3745
        'Parameters': 'ActivateSessionParameters',
3746
               }
3747
3748 1
    def __init__(self, binary=None):
3749 1
        if binary is not None:
3750
            self._binary_init(binary)
3751
            self._freeze = True
3752
            return
3753 1
        self.TypeId = FourByteNodeId(ObjectIds.ActivateSessionRequest_Encoding_DefaultBinary)
3754 1
        self.RequestHeader = RequestHeader()
3755 1
        self.Parameters = ActivateSessionParameters()
3756 1
        self._freeze = True
3757
3758 1
    def to_binary(self):
3759 1
        packet = []
3760 1
        packet.append(self.TypeId.to_binary())
3761 1
        packet.append(self.RequestHeader.to_binary())
3762 1
        packet.append(self.Parameters.to_binary())
3763 1
        return b''.join(packet)
3764
3765 1
    @staticmethod
3766
    def from_binary(data):
3767
        return ActivateSessionRequest(data)
3768
3769 1
    def _binary_init(self, data):
3770
        self.TypeId = NodeId.from_binary(data)
3771
        self.RequestHeader = RequestHeader.from_binary(data)
3772
        self.Parameters = ActivateSessionParameters.from_binary(data)
3773
3774 1
    def __str__(self):
3775
        return 'ActivateSessionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3776
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
3777
               'Parameters:' + str(self.Parameters) + ')'
3778
3779 1
    __repr__ = __str__
3780
3781
3782 1
class ActivateSessionResult(FrozenClass):
3783
    '''
3784
    :ivar ServerNonce:
3785
    :vartype ServerNonce: ByteString
3786
    :ivar Results:
3787
    :vartype Results: StatusCode
3788
    :ivar DiagnosticInfos:
3789
    :vartype DiagnosticInfos: DiagnosticInfo
3790
    '''
3791
3792 1
    ua_types = {
3793
        'ServerNonce': 'ByteString',
3794
        'Results': 'StatusCode',
3795
        'DiagnosticInfos': 'DiagnosticInfo',
3796
               }
3797
3798 1
    def __init__(self, binary=None):
3799 1
        if binary is not None:
3800 1
            self._binary_init(binary)
3801 1
            self._freeze = True
3802 1
            return
3803 1
        self.ServerNonce = None
3804 1
        self.Results = []
3805 1
        self.DiagnosticInfos = []
3806 1
        self._freeze = True
3807
3808 1
    def to_binary(self):
3809 1
        packet = []
3810 1
        packet.append(uabin.Primitives.ByteString.pack(self.ServerNonce))
3811 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
3812 1
        for fieldname in self.Results:
3813
            packet.append(fieldname.to_binary())
3814 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
3815 1
        for fieldname in self.DiagnosticInfos:
3816
            packet.append(fieldname.to_binary())
3817 1
        return b''.join(packet)
3818
3819 1
    @staticmethod
3820
    def from_binary(data):
3821 1
        return ActivateSessionResult(data)
3822
3823 1
    def _binary_init(self, data):
3824 1
        self.ServerNonce = uabin.Primitives.ByteString.unpack(data)
3825 1
        length = uabin.Primitives.Int32.unpack(data)
3826 1
        array = []
3827 1
        if length != -1:
3828 1
            for _ in range(0, length):
3829
                array.append(StatusCode.from_binary(data))
3830 1
        self.Results = array
3831 1
        length = uabin.Primitives.Int32.unpack(data)
3832 1
        array = []
3833 1
        if length != -1:
3834 1
            for _ in range(0, length):
3835
                array.append(DiagnosticInfo.from_binary(data))
3836 1
        self.DiagnosticInfos = array
3837
3838 1
    def __str__(self):
3839
        return 'ActivateSessionResult(' + 'ServerNonce:' + str(self.ServerNonce) + ', ' + \
3840
               'Results:' + str(self.Results) + ', ' + \
3841
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
3842
3843 1
    __repr__ = __str__
3844
3845
3846 1
class ActivateSessionResponse(FrozenClass):
3847
    '''
3848
    Activates a session with the server.
3849
3850
    :ivar TypeId:
3851
    :vartype TypeId: NodeId
3852
    :ivar ResponseHeader:
3853
    :vartype ResponseHeader: ResponseHeader
3854
    :ivar Parameters:
3855
    :vartype Parameters: ActivateSessionResult
3856
    '''
3857
3858 1
    ua_types = {
3859
        'TypeId': 'NodeId',
3860
        'ResponseHeader': 'ResponseHeader',
3861
        'Parameters': 'ActivateSessionResult',
3862
               }
3863
3864 1
    def __init__(self, binary=None):
3865 1
        if binary is not None:
3866 1
            self._binary_init(binary)
3867 1
            self._freeze = True
3868 1
            return
3869 1
        self.TypeId = FourByteNodeId(ObjectIds.ActivateSessionResponse_Encoding_DefaultBinary)
3870 1
        self.ResponseHeader = ResponseHeader()
3871 1
        self.Parameters = ActivateSessionResult()
3872 1
        self._freeze = True
3873
3874 1
    def to_binary(self):
3875 1
        packet = []
3876 1
        packet.append(self.TypeId.to_binary())
3877 1
        packet.append(self.ResponseHeader.to_binary())
3878 1
        packet.append(self.Parameters.to_binary())
3879 1
        return b''.join(packet)
3880
3881 1
    @staticmethod
3882
    def from_binary(data):
3883 1
        return ActivateSessionResponse(data)
3884
3885 1
    def _binary_init(self, data):
3886 1
        self.TypeId = NodeId.from_binary(data)
3887 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
3888 1
        self.Parameters = ActivateSessionResult.from_binary(data)
3889
3890 1
    def __str__(self):
3891
        return 'ActivateSessionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3892
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
3893
               'Parameters:' + str(self.Parameters) + ')'
3894
3895 1
    __repr__ = __str__
3896
3897
3898 1
class CloseSessionRequest(FrozenClass):
3899
    '''
3900
    Closes a session with the server.
3901
3902
    :ivar TypeId:
3903
    :vartype TypeId: NodeId
3904
    :ivar RequestHeader:
3905
    :vartype RequestHeader: RequestHeader
3906
    :ivar DeleteSubscriptions:
3907
    :vartype DeleteSubscriptions: Boolean
3908
    '''
3909
3910 1
    ua_types = {
3911
        'TypeId': 'NodeId',
3912
        'RequestHeader': 'RequestHeader',
3913
        'DeleteSubscriptions': 'Boolean',
3914
               }
3915
3916 1
    def __init__(self, binary=None):
3917 1
        if binary is not None:
3918
            self._binary_init(binary)
3919
            self._freeze = True
3920
            return
3921 1
        self.TypeId = FourByteNodeId(ObjectIds.CloseSessionRequest_Encoding_DefaultBinary)
3922 1
        self.RequestHeader = RequestHeader()
3923 1
        self.DeleteSubscriptions = True
3924 1
        self._freeze = True
3925
3926 1
    def to_binary(self):
3927 1
        packet = []
3928 1
        packet.append(self.TypeId.to_binary())
3929 1
        packet.append(self.RequestHeader.to_binary())
3930 1
        packet.append(uabin.Primitives.Boolean.pack(self.DeleteSubscriptions))
3931 1
        return b''.join(packet)
3932
3933 1
    @staticmethod
3934
    def from_binary(data):
3935
        return CloseSessionRequest(data)
3936
3937 1
    def _binary_init(self, data):
3938
        self.TypeId = NodeId.from_binary(data)
3939
        self.RequestHeader = RequestHeader.from_binary(data)
3940
        self.DeleteSubscriptions = uabin.Primitives.Boolean.unpack(data)
3941
3942 1
    def __str__(self):
3943
        return 'CloseSessionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3944
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
3945
               'DeleteSubscriptions:' + str(self.DeleteSubscriptions) + ')'
3946
3947 1
    __repr__ = __str__
3948
3949
3950 1
class CloseSessionResponse(FrozenClass):
3951
    '''
3952
    Closes a session with the server.
3953
3954
    :ivar TypeId:
3955
    :vartype TypeId: NodeId
3956
    :ivar ResponseHeader:
3957
    :vartype ResponseHeader: ResponseHeader
3958
    '''
3959
3960 1
    ua_types = {
3961
        'TypeId': 'NodeId',
3962
        'ResponseHeader': 'ResponseHeader',
3963
               }
3964
3965 1
    def __init__(self, binary=None):
3966 1
        if binary is not None:
3967 1
            self._binary_init(binary)
3968 1
            self._freeze = True
3969 1
            return
3970 1
        self.TypeId = FourByteNodeId(ObjectIds.CloseSessionResponse_Encoding_DefaultBinary)
3971 1
        self.ResponseHeader = ResponseHeader()
3972 1
        self._freeze = True
3973
3974 1
    def to_binary(self):
3975 1
        packet = []
3976 1
        packet.append(self.TypeId.to_binary())
3977 1
        packet.append(self.ResponseHeader.to_binary())
3978 1
        return b''.join(packet)
3979
3980 1
    @staticmethod
3981
    def from_binary(data):
3982 1
        return CloseSessionResponse(data)
3983
3984 1
    def _binary_init(self, data):
3985 1
        self.TypeId = NodeId.from_binary(data)
3986 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
3987
3988 1
    def __str__(self):
3989
        return 'CloseSessionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3990
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
3991
3992 1
    __repr__ = __str__
3993
3994
3995 1
class CancelParameters(FrozenClass):
3996
    '''
3997
    :ivar RequestHandle:
3998
    :vartype RequestHandle: UInt32
3999
    '''
4000
4001 1
    ua_types = {
4002
        'RequestHandle': 'UInt32',
4003
               }
4004
4005 1
    def __init__(self, binary=None):
4006
        if binary is not None:
4007
            self._binary_init(binary)
4008
            self._freeze = True
4009
            return
4010
        self.RequestHandle = 0
4011
        self._freeze = True
4012
4013 1
    def to_binary(self):
4014
        packet = []
4015
        packet.append(uabin.Primitives.UInt32.pack(self.RequestHandle))
4016
        return b''.join(packet)
4017
4018 1
    @staticmethod
4019
    def from_binary(data):
4020
        return CancelParameters(data)
4021
4022 1
    def _binary_init(self, data):
4023
        self.RequestHandle = uabin.Primitives.UInt32.unpack(data)
4024
4025 1
    def __str__(self):
4026
        return 'CancelParameters(' + 'RequestHandle:' + str(self.RequestHandle) + ')'
4027
4028 1
    __repr__ = __str__
4029
4030
4031 1
class CancelRequest(FrozenClass):
4032
    '''
4033
    Cancels an outstanding request.
4034
4035
    :ivar TypeId:
4036
    :vartype TypeId: NodeId
4037
    :ivar RequestHeader:
4038
    :vartype RequestHeader: RequestHeader
4039
    :ivar Parameters:
4040
    :vartype Parameters: CancelParameters
4041
    '''
4042
4043 1
    ua_types = {
4044
        'TypeId': 'NodeId',
4045
        'RequestHeader': 'RequestHeader',
4046
        'Parameters': 'CancelParameters',
4047
               }
4048
4049 1
    def __init__(self, binary=None):
4050
        if binary is not None:
4051
            self._binary_init(binary)
4052
            self._freeze = True
4053
            return
4054
        self.TypeId = FourByteNodeId(ObjectIds.CancelRequest_Encoding_DefaultBinary)
4055
        self.RequestHeader = RequestHeader()
4056
        self.Parameters = CancelParameters()
4057
        self._freeze = True
4058
4059 1
    def to_binary(self):
4060
        packet = []
4061
        packet.append(self.TypeId.to_binary())
4062
        packet.append(self.RequestHeader.to_binary())
4063
        packet.append(self.Parameters.to_binary())
4064
        return b''.join(packet)
4065
4066 1
    @staticmethod
4067
    def from_binary(data):
4068
        return CancelRequest(data)
4069
4070 1
    def _binary_init(self, data):
4071
        self.TypeId = NodeId.from_binary(data)
4072
        self.RequestHeader = RequestHeader.from_binary(data)
4073
        self.Parameters = CancelParameters.from_binary(data)
4074
4075 1
    def __str__(self):
4076
        return 'CancelRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
4077
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
4078
               'Parameters:' + str(self.Parameters) + ')'
4079
4080 1
    __repr__ = __str__
4081
4082
4083 1
class CancelResult(FrozenClass):
4084
    '''
4085
    :ivar CancelCount:
4086
    :vartype CancelCount: UInt32
4087
    '''
4088
4089 1
    ua_types = {
4090
        'CancelCount': 'UInt32',
4091
               }
4092
4093 1
    def __init__(self, binary=None):
4094
        if binary is not None:
4095
            self._binary_init(binary)
4096
            self._freeze = True
4097
            return
4098
        self.CancelCount = 0
4099
        self._freeze = True
4100
4101 1
    def to_binary(self):
4102
        packet = []
4103
        packet.append(uabin.Primitives.UInt32.pack(self.CancelCount))
4104 View Code Duplication
        return b''.join(packet)
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4105
4106 1
    @staticmethod
4107
    def from_binary(data):
4108
        return CancelResult(data)
4109
4110 1
    def _binary_init(self, data):
4111
        self.CancelCount = uabin.Primitives.UInt32.unpack(data)
4112
4113 1
    def __str__(self):
4114
        return 'CancelResult(' + 'CancelCount:' + str(self.CancelCount) + ')'
4115
4116 1
    __repr__ = __str__
4117
4118
4119 1
class CancelResponse(FrozenClass):
4120
    '''
4121
    Cancels an outstanding request.
4122
4123
    :ivar TypeId:
4124
    :vartype TypeId: NodeId
4125
    :ivar ResponseHeader:
4126
    :vartype ResponseHeader: ResponseHeader
4127
    :ivar Parameters:
4128
    :vartype Parameters: CancelResult
4129
    '''
4130
4131 1
    ua_types = {
4132
        'TypeId': 'NodeId',
4133
        'ResponseHeader': 'ResponseHeader',
4134
        'Parameters': 'CancelResult',
4135
               }
4136
4137 1
    def __init__(self, binary=None):
4138
        if binary is not None:
4139
            self._binary_init(binary)
4140
            self._freeze = True
4141
            return
4142
        self.TypeId = FourByteNodeId(ObjectIds.CancelResponse_Encoding_DefaultBinary)
4143
        self.ResponseHeader = ResponseHeader()
4144
        self.Parameters = CancelResult()
4145
        self._freeze = True
4146
4147 1
    def to_binary(self):
4148
        packet = []
4149
        packet.append(self.TypeId.to_binary())
4150
        packet.append(self.ResponseHeader.to_binary())
4151
        packet.append(self.Parameters.to_binary())
4152
        return b''.join(packet)
4153
4154 1
    @staticmethod
4155
    def from_binary(data):
4156
        return CancelResponse(data)
4157
4158 1
    def _binary_init(self, data):
4159
        self.TypeId = NodeId.from_binary(data)
4160
        self.ResponseHeader = ResponseHeader.from_binary(data)
4161
        self.Parameters = CancelResult.from_binary(data)
4162
4163 1
    def __str__(self):
4164
        return 'CancelResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
4165
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
4166
               'Parameters:' + str(self.Parameters) + ')'
4167
4168 1
    __repr__ = __str__
4169
4170
4171 1
class NodeAttributes(FrozenClass):
4172
    '''
4173
    The base attributes for all nodes.
4174
4175
    :ivar SpecifiedAttributes:
4176
    :vartype SpecifiedAttributes: UInt32
4177
    :ivar DisplayName:
4178
    :vartype DisplayName: LocalizedText
4179
    :ivar Description:
4180
    :vartype Description: LocalizedText
4181
    :ivar WriteMask:
4182
    :vartype WriteMask: UInt32
4183
    :ivar UserWriteMask:
4184
    :vartype UserWriteMask: UInt32
4185
    '''
4186
4187 1
    ua_types = {
4188
        'SpecifiedAttributes': 'UInt32',
4189 View Code Duplication
        'DisplayName': 'LocalizedText',
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4190
        'Description': 'LocalizedText',
4191
        'WriteMask': 'UInt32',
4192
        'UserWriteMask': 'UInt32',
4193
               }
4194
4195 1
    def __init__(self, binary=None):
4196
        if binary is not None:
4197
            self._binary_init(binary)
4198
            self._freeze = True
4199
            return
4200
        self.SpecifiedAttributes = 0
4201
        self.DisplayName = LocalizedText()
4202
        self.Description = LocalizedText()
4203
        self.WriteMask = 0
4204
        self.UserWriteMask = 0
4205
        self._freeze = True
4206
4207 1
    def to_binary(self):
4208
        packet = []
4209
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4210
        packet.append(self.DisplayName.to_binary())
4211
        packet.append(self.Description.to_binary())
4212
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4213
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4214
        return b''.join(packet)
4215
4216 1
    @staticmethod
4217
    def from_binary(data):
4218
        return NodeAttributes(data)
4219
4220 1
    def _binary_init(self, data):
4221
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4222
        self.DisplayName = LocalizedText.from_binary(data)
4223
        self.Description = LocalizedText.from_binary(data)
4224
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4225
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4226
4227 1
    def __str__(self):
4228
        return 'NodeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4229
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4230
               'Description:' + str(self.Description) + ', ' + \
4231
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4232
               'UserWriteMask:' + str(self.UserWriteMask) + ')'
4233
4234 1
    __repr__ = __str__
4235
4236
4237 1 View Code Duplication
class ObjectAttributes(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4238
    '''
4239
    The attributes for an object node.
4240
4241
    :ivar SpecifiedAttributes:
4242
    :vartype SpecifiedAttributes: UInt32
4243
    :ivar DisplayName:
4244
    :vartype DisplayName: LocalizedText
4245
    :ivar Description:
4246
    :vartype Description: LocalizedText
4247
    :ivar WriteMask:
4248
    :vartype WriteMask: UInt32
4249
    :ivar UserWriteMask:
4250
    :vartype UserWriteMask: UInt32
4251
    :ivar EventNotifier:
4252
    :vartype EventNotifier: Byte
4253
    '''
4254
4255 1
    ua_types = {
4256
        'SpecifiedAttributes': 'UInt32',
4257
        'DisplayName': 'LocalizedText',
4258
        'Description': 'LocalizedText',
4259
        'WriteMask': 'UInt32',
4260
        'UserWriteMask': 'UInt32',
4261
        'EventNotifier': 'Byte',
4262
               }
4263
4264 1
    def __init__(self, binary=None):
4265 1
        if binary is not None:
4266 1
            self._binary_init(binary)
4267 1
            self._freeze = True
4268 1
            return
4269 1
        self.SpecifiedAttributes = 0
4270 1
        self.DisplayName = LocalizedText()
4271 1
        self.Description = LocalizedText()
4272 1
        self.WriteMask = 0
4273 1
        self.UserWriteMask = 0
4274 1
        self.EventNotifier = 0
4275 1
        self._freeze = True
4276
4277 1
    def to_binary(self):
4278 1
        packet = []
4279 1
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4280 1
        packet.append(self.DisplayName.to_binary())
4281 1
        packet.append(self.Description.to_binary())
4282 1
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4283 1
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4284 1
        packet.append(uabin.Primitives.Byte.pack(self.EventNotifier))
4285 1
        return b''.join(packet)
4286
4287 1
    @staticmethod
4288
    def from_binary(data):
4289 1
        return ObjectAttributes(data)
4290
4291 1
    def _binary_init(self, data):
4292 1
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4293 1
        self.DisplayName = LocalizedText.from_binary(data)
4294 1
        self.Description = LocalizedText.from_binary(data)
4295 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4296 1
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4297 1
        self.EventNotifier = uabin.Primitives.Byte.unpack(data)
4298
4299 1
    def __str__(self):
4300
        return 'ObjectAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4301
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4302
               'Description:' + str(self.Description) + ', ' + \
4303
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4304
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4305
               'EventNotifier:' + str(self.EventNotifier) + ')'
4306
4307 1
    __repr__ = __str__
4308
4309
4310 1
class VariableAttributes(FrozenClass):
4311
    '''
4312
    The attributes for a variable node.
4313
4314
    :ivar SpecifiedAttributes:
4315
    :vartype SpecifiedAttributes: UInt32
4316
    :ivar DisplayName:
4317
    :vartype DisplayName: LocalizedText
4318
    :ivar Description:
4319
    :vartype Description: LocalizedText
4320
    :ivar WriteMask:
4321
    :vartype WriteMask: UInt32
4322
    :ivar UserWriteMask:
4323
    :vartype UserWriteMask: UInt32
4324
    :ivar Value:
4325
    :vartype Value: Variant
4326
    :ivar DataType:
4327
    :vartype DataType: NodeId
4328
    :ivar ValueRank:
4329
    :vartype ValueRank: Int32
4330
    :ivar ArrayDimensions:
4331
    :vartype ArrayDimensions: UInt32
4332
    :ivar AccessLevel:
4333
    :vartype AccessLevel: Byte
4334
    :ivar UserAccessLevel:
4335
    :vartype UserAccessLevel: Byte
4336
    :ivar MinimumSamplingInterval:
4337
    :vartype MinimumSamplingInterval: Double
4338
    :ivar Historizing:
4339
    :vartype Historizing: Boolean
4340
    '''
4341
4342 1
    ua_types = {
4343
        'SpecifiedAttributes': 'UInt32',
4344
        'DisplayName': 'LocalizedText',
4345
        'Description': 'LocalizedText',
4346
        'WriteMask': 'UInt32',
4347
        'UserWriteMask': 'UInt32',
4348
        'Value': 'Variant',
4349
        'DataType': 'NodeId',
4350
        'ValueRank': 'Int32',
4351
        'ArrayDimensions': 'UInt32',
4352
        'AccessLevel': 'Byte',
4353
        'UserAccessLevel': 'Byte',
4354
        'MinimumSamplingInterval': 'Double',
4355
        'Historizing': 'Boolean',
4356
               }
4357
4358 1
    def __init__(self, binary=None):
4359 1
        if binary is not None:
4360 1
            self._binary_init(binary)
4361 1
            self._freeze = True
4362 1
            return
4363 1
        self.SpecifiedAttributes = 0
4364 1
        self.DisplayName = LocalizedText()
4365 1
        self.Description = LocalizedText()
4366 1
        self.WriteMask = 0
4367 1
        self.UserWriteMask = 0
4368 1
        self.Value = Variant()
4369 1
        self.DataType = NodeId()
4370 1
        self.ValueRank = 0
4371 1
        self.ArrayDimensions = []
4372 1
        self.AccessLevel = 0
4373 1
        self.UserAccessLevel = 0
4374 1
        self.MinimumSamplingInterval = 0
4375 1
        self.Historizing = True
4376 1
        self._freeze = True
4377
4378 1
    def to_binary(self):
4379 1
        packet = []
4380 1
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4381 1
        packet.append(self.DisplayName.to_binary())
4382 1
        packet.append(self.Description.to_binary())
4383 1
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4384 1
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4385 1
        packet.append(self.Value.to_binary())
4386 1
        packet.append(self.DataType.to_binary())
4387 1
        packet.append(uabin.Primitives.Int32.pack(self.ValueRank))
4388 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ArrayDimensions)))
4389 1
        for fieldname in self.ArrayDimensions:
4390 1
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
4391 1
        packet.append(uabin.Primitives.Byte.pack(self.AccessLevel))
4392 1
        packet.append(uabin.Primitives.Byte.pack(self.UserAccessLevel))
4393 1
        packet.append(uabin.Primitives.Double.pack(self.MinimumSamplingInterval))
4394 1
        packet.append(uabin.Primitives.Boolean.pack(self.Historizing))
4395 1
        return b''.join(packet)
4396
4397 1
    @staticmethod
4398
    def from_binary(data):
4399 1
        return VariableAttributes(data)
4400
4401 1
    def _binary_init(self, data):
4402 1
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4403 1
        self.DisplayName = LocalizedText.from_binary(data)
4404 1
        self.Description = LocalizedText.from_binary(data)
4405 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4406 1
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4407 1
        self.Value = Variant.from_binary(data)
4408 1
        self.DataType = NodeId.from_binary(data)
4409 1
        self.ValueRank = uabin.Primitives.Int32.unpack(data)
4410 1
        self.ArrayDimensions = uabin.Primitives.UInt32.unpack_array(data)
4411 1
        self.AccessLevel = uabin.Primitives.Byte.unpack(data)
4412 1
        self.UserAccessLevel = uabin.Primitives.Byte.unpack(data)
4413 1
        self.MinimumSamplingInterval = uabin.Primitives.Double.unpack(data)
4414 1
        self.Historizing = uabin.Primitives.Boolean.unpack(data)
4415
4416 1
    def __str__(self):
4417
        return 'VariableAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4418
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4419
               'Description:' + str(self.Description) + ', ' + \
4420
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4421
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4422
               'Value:' + str(self.Value) + ', ' + \
4423
               'DataType:' + str(self.DataType) + ', ' + \
4424
               'ValueRank:' + str(self.ValueRank) + ', ' + \
4425
               'ArrayDimensions:' + str(self.ArrayDimensions) + ', ' + \
4426
               'AccessLevel:' + str(self.AccessLevel) + ', ' + \
4427
               'UserAccessLevel:' + str(self.UserAccessLevel) + ', ' + \
4428
               'MinimumSamplingInterval:' + str(self.MinimumSamplingInterval) + ', ' + \
4429
               'Historizing:' + str(self.Historizing) + ')'
4430
4431 1
    __repr__ = __str__
4432
4433
4434 1 View Code Duplication
class MethodAttributes(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4435
    '''
4436
    The attributes for a method node.
4437
4438
    :ivar SpecifiedAttributes:
4439
    :vartype SpecifiedAttributes: UInt32
4440
    :ivar DisplayName:
4441
    :vartype DisplayName: LocalizedText
4442
    :ivar Description:
4443
    :vartype Description: LocalizedText
4444
    :ivar WriteMask:
4445
    :vartype WriteMask: UInt32
4446
    :ivar UserWriteMask:
4447
    :vartype UserWriteMask: UInt32
4448
    :ivar Executable:
4449
    :vartype Executable: Boolean
4450
    :ivar UserExecutable:
4451
    :vartype UserExecutable: Boolean
4452
    '''
4453
4454 1
    ua_types = {
4455
        'SpecifiedAttributes': 'UInt32',
4456
        'DisplayName': 'LocalizedText',
4457
        'Description': 'LocalizedText',
4458
        'WriteMask': 'UInt32',
4459
        'UserWriteMask': 'UInt32',
4460
        'Executable': 'Boolean',
4461
        'UserExecutable': 'Boolean',
4462
               }
4463
4464 1
    def __init__(self, binary=None):
4465 1
        if binary is not None:
4466 1
            self._binary_init(binary)
4467 1
            self._freeze = True
4468 1
            return
4469 1
        self.SpecifiedAttributes = 0
4470 1
        self.DisplayName = LocalizedText()
4471 1
        self.Description = LocalizedText()
4472 1
        self.WriteMask = 0
4473 1
        self.UserWriteMask = 0
4474 1
        self.Executable = True
4475 1
        self.UserExecutable = True
4476 1
        self._freeze = True
4477
4478 1
    def to_binary(self):
4479 1
        packet = []
4480 1
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4481 1
        packet.append(self.DisplayName.to_binary())
4482 1
        packet.append(self.Description.to_binary())
4483 1
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4484 1
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4485 1
        packet.append(uabin.Primitives.Boolean.pack(self.Executable))
4486 1
        packet.append(uabin.Primitives.Boolean.pack(self.UserExecutable))
4487 1
        return b''.join(packet)
4488
4489 1
    @staticmethod
4490
    def from_binary(data):
4491 1
        return MethodAttributes(data)
4492
4493 1
    def _binary_init(self, data):
4494 1
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4495 1
        self.DisplayName = LocalizedText.from_binary(data)
4496 1
        self.Description = LocalizedText.from_binary(data)
4497 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4498 1
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4499 1
        self.Executable = uabin.Primitives.Boolean.unpack(data)
4500 1
        self.UserExecutable = uabin.Primitives.Boolean.unpack(data)
4501
4502 1
    def __str__(self):
4503
        return 'MethodAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4504
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4505
               'Description:' + str(self.Description) + ', ' + \
4506
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4507
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4508
               'Executable:' + str(self.Executable) + ', ' + \
4509
               'UserExecutable:' + str(self.UserExecutable) + ')'
4510
4511 1
    __repr__ = __str__
4512
4513
4514 1 View Code Duplication
class ObjectTypeAttributes(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4515
    '''
4516
    The attributes for an object type node.
4517
4518
    :ivar SpecifiedAttributes:
4519
    :vartype SpecifiedAttributes: UInt32
4520
    :ivar DisplayName:
4521
    :vartype DisplayName: LocalizedText
4522
    :ivar Description:
4523
    :vartype Description: LocalizedText
4524
    :ivar WriteMask:
4525
    :vartype WriteMask: UInt32
4526
    :ivar UserWriteMask:
4527
    :vartype UserWriteMask: UInt32
4528
    :ivar IsAbstract:
4529
    :vartype IsAbstract: Boolean
4530
    '''
4531
4532 1
    ua_types = {
4533
        'SpecifiedAttributes': 'UInt32',
4534
        'DisplayName': 'LocalizedText',
4535
        'Description': 'LocalizedText',
4536
        'WriteMask': 'UInt32',
4537
        'UserWriteMask': 'UInt32',
4538
        'IsAbstract': 'Boolean',
4539
               }
4540
4541 1
    def __init__(self, binary=None):
4542 1
        if binary is not None:
4543 1
            self._binary_init(binary)
4544 1
            self._freeze = True
4545 1
            return
4546 1
        self.SpecifiedAttributes = 0
4547 1
        self.DisplayName = LocalizedText()
4548 1
        self.Description = LocalizedText()
4549 1
        self.WriteMask = 0
4550 1
        self.UserWriteMask = 0
4551 1
        self.IsAbstract = True
4552 1
        self._freeze = True
4553
4554 1
    def to_binary(self):
4555 1
        packet = []
4556 1
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4557 1
        packet.append(self.DisplayName.to_binary())
4558 1
        packet.append(self.Description.to_binary())
4559 1
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4560 1
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4561 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsAbstract))
4562 1
        return b''.join(packet)
4563
4564 1
    @staticmethod
4565
    def from_binary(data):
4566 1
        return ObjectTypeAttributes(data)
4567
4568 1
    def _binary_init(self, data):
4569 1
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4570 1
        self.DisplayName = LocalizedText.from_binary(data)
4571 1
        self.Description = LocalizedText.from_binary(data)
4572 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4573 1
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4574 1
        self.IsAbstract = uabin.Primitives.Boolean.unpack(data)
4575
4576 1
    def __str__(self):
4577
        return 'ObjectTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4578
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4579
               'Description:' + str(self.Description) + ', ' + \
4580
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4581
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4582
               'IsAbstract:' + str(self.IsAbstract) + ')'
4583
4584 1
    __repr__ = __str__
4585
4586
4587 1
class VariableTypeAttributes(FrozenClass):
4588
    '''
4589
    The attributes for a variable type node.
4590
4591
    :ivar SpecifiedAttributes:
4592
    :vartype SpecifiedAttributes: UInt32
4593
    :ivar DisplayName:
4594
    :vartype DisplayName: LocalizedText
4595
    :ivar Description:
4596
    :vartype Description: LocalizedText
4597
    :ivar WriteMask:
4598
    :vartype WriteMask: UInt32
4599
    :ivar UserWriteMask:
4600
    :vartype UserWriteMask: UInt32
4601
    :ivar Value:
4602
    :vartype Value: Variant
4603
    :ivar DataType:
4604
    :vartype DataType: NodeId
4605
    :ivar ValueRank:
4606
    :vartype ValueRank: Int32
4607
    :ivar ArrayDimensions:
4608
    :vartype ArrayDimensions: UInt32
4609
    :ivar IsAbstract:
4610
    :vartype IsAbstract: Boolean
4611
    '''
4612
4613 1
    ua_types = {
4614
        'SpecifiedAttributes': 'UInt32',
4615
        'DisplayName': 'LocalizedText',
4616
        'Description': 'LocalizedText',
4617
        'WriteMask': 'UInt32',
4618
        'UserWriteMask': 'UInt32',
4619
        'Value': 'Variant',
4620
        'DataType': 'NodeId',
4621
        'ValueRank': 'Int32',
4622
        'ArrayDimensions': 'UInt32',
4623
        'IsAbstract': 'Boolean',
4624
               }
4625
4626 1
    def __init__(self, binary=None):
4627 1
        if binary is not None:
4628
            self._binary_init(binary)
4629
            self._freeze = True
4630
            return
4631 1
        self.SpecifiedAttributes = 0
4632 1
        self.DisplayName = LocalizedText()
4633 1
        self.Description = LocalizedText()
4634 1
        self.WriteMask = 0
4635 1
        self.UserWriteMask = 0
4636 1
        self.Value = Variant()
4637 1
        self.DataType = NodeId()
4638 1
        self.ValueRank = 0
4639 1
        self.ArrayDimensions = []
4640 1
        self.IsAbstract = True
4641 1
        self._freeze = True
4642
4643 1
    def to_binary(self):
4644
        packet = []
4645
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4646
        packet.append(self.DisplayName.to_binary())
4647
        packet.append(self.Description.to_binary())
4648
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4649
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4650
        packet.append(self.Value.to_binary())
4651
        packet.append(self.DataType.to_binary())
4652
        packet.append(uabin.Primitives.Int32.pack(self.ValueRank))
4653
        packet.append(uabin.Primitives.Int32.pack(len(self.ArrayDimensions)))
4654
        for fieldname in self.ArrayDimensions:
4655
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
4656
        packet.append(uabin.Primitives.Boolean.pack(self.IsAbstract))
4657
        return b''.join(packet)
4658
4659 1
    @staticmethod
4660
    def from_binary(data):
4661
        return VariableTypeAttributes(data)
4662
4663 1 View Code Duplication
    def _binary_init(self, data):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4664
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4665
        self.DisplayName = LocalizedText.from_binary(data)
4666
        self.Description = LocalizedText.from_binary(data)
4667
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4668
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4669
        self.Value = Variant.from_binary(data)
4670
        self.DataType = NodeId.from_binary(data)
4671
        self.ValueRank = uabin.Primitives.Int32.unpack(data)
4672
        self.ArrayDimensions = uabin.Primitives.UInt32.unpack_array(data)
4673
        self.IsAbstract = uabin.Primitives.Boolean.unpack(data)
4674
4675 1
    def __str__(self):
4676
        return 'VariableTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4677
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4678
               'Description:' + str(self.Description) + ', ' + \
4679
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4680
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4681
               'Value:' + str(self.Value) + ', ' + \
4682
               'DataType:' + str(self.DataType) + ', ' + \
4683
               'ValueRank:' + str(self.ValueRank) + ', ' + \
4684
               'ArrayDimensions:' + str(self.ArrayDimensions) + ', ' + \
4685
               'IsAbstract:' + str(self.IsAbstract) + ')'
4686
4687 1
    __repr__ = __str__
4688
4689
4690 1
class ReferenceTypeAttributes(FrozenClass):
4691
    '''
4692
    The attributes for a reference type node.
4693
4694
    :ivar SpecifiedAttributes:
4695
    :vartype SpecifiedAttributes: UInt32
4696
    :ivar DisplayName:
4697
    :vartype DisplayName: LocalizedText
4698
    :ivar Description:
4699
    :vartype Description: LocalizedText
4700
    :ivar WriteMask:
4701
    :vartype WriteMask: UInt32
4702
    :ivar UserWriteMask:
4703
    :vartype UserWriteMask: UInt32
4704
    :ivar IsAbstract:
4705
    :vartype IsAbstract: Boolean
4706
    :ivar Symmetric:
4707
    :vartype Symmetric: Boolean
4708
    :ivar InverseName:
4709
    :vartype InverseName: LocalizedText
4710
    '''
4711
4712 1
    ua_types = {
4713
        'SpecifiedAttributes': 'UInt32',
4714
        'DisplayName': 'LocalizedText',
4715
        'Description': 'LocalizedText',
4716
        'WriteMask': 'UInt32',
4717
        'UserWriteMask': 'UInt32',
4718
        'IsAbstract': 'Boolean',
4719
        'Symmetric': 'Boolean',
4720
        'InverseName': 'LocalizedText',
4721
               }
4722
4723 1
    def __init__(self, binary=None):
4724 1
        if binary is not None:
4725
            self._binary_init(binary)
4726
            self._freeze = True
4727
            return
4728 1
        self.SpecifiedAttributes = 0
4729 1
        self.DisplayName = LocalizedText()
4730 1
        self.Description = LocalizedText()
4731 1
        self.WriteMask = 0
4732 1
        self.UserWriteMask = 0
4733 1
        self.IsAbstract = True
4734 1
        self.Symmetric = True
4735 1
        self.InverseName = LocalizedText()
4736 1
        self._freeze = True
4737
4738 1
    def to_binary(self):
4739
        packet = []
4740
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4741
        packet.append(self.DisplayName.to_binary())
4742
        packet.append(self.Description.to_binary())
4743
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4744
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4745
        packet.append(uabin.Primitives.Boolean.pack(self.IsAbstract))
4746
        packet.append(uabin.Primitives.Boolean.pack(self.Symmetric))
4747
        packet.append(self.InverseName.to_binary())
4748
        return b''.join(packet)
4749
4750 1
    @staticmethod
4751
    def from_binary(data):
4752
        return ReferenceTypeAttributes(data)
4753
4754 1
    def _binary_init(self, data):
4755
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4756
        self.DisplayName = LocalizedText.from_binary(data)
4757
        self.Description = LocalizedText.from_binary(data)
4758
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4759
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4760
        self.IsAbstract = uabin.Primitives.Boolean.unpack(data)
4761
        self.Symmetric = uabin.Primitives.Boolean.unpack(data)
4762
        self.InverseName = LocalizedText.from_binary(data)
4763
4764 1
    def __str__(self):
4765
        return 'ReferenceTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4766
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4767
               'Description:' + str(self.Description) + ', ' + \
4768
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4769
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4770
               'IsAbstract:' + str(self.IsAbstract) + ', ' + \
4771
               'Symmetric:' + str(self.Symmetric) + ', ' + \
4772
               'InverseName:' + str(self.InverseName) + ')'
4773
4774 1
    __repr__ = __str__
4775
4776
4777 1 View Code Duplication
class DataTypeAttributes(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4778
    '''
4779
    The attributes for a data type node.
4780
4781
    :ivar SpecifiedAttributes:
4782
    :vartype SpecifiedAttributes: UInt32
4783
    :ivar DisplayName:
4784
    :vartype DisplayName: LocalizedText
4785
    :ivar Description:
4786
    :vartype Description: LocalizedText
4787
    :ivar WriteMask:
4788
    :vartype WriteMask: UInt32
4789
    :ivar UserWriteMask:
4790
    :vartype UserWriteMask: UInt32
4791
    :ivar IsAbstract:
4792
    :vartype IsAbstract: Boolean
4793
    '''
4794
4795 1
    ua_types = {
4796
        'SpecifiedAttributes': 'UInt32',
4797
        'DisplayName': 'LocalizedText',
4798
        'Description': 'LocalizedText',
4799
        'WriteMask': 'UInt32',
4800
        'UserWriteMask': 'UInt32',
4801
        'IsAbstract': 'Boolean',
4802
               }
4803
4804 1
    def __init__(self, binary=None):
4805 1
        if binary is not None:
4806 1
            self._binary_init(binary)
4807 1
            self._freeze = True
4808 1
            return
4809 1
        self.SpecifiedAttributes = 0
4810 1
        self.DisplayName = LocalizedText()
4811 1
        self.Description = LocalizedText()
4812 1
        self.WriteMask = 0
4813 1
        self.UserWriteMask = 0
4814 1
        self.IsAbstract = True
4815 1
        self._freeze = True
4816
4817 1
    def to_binary(self):
4818 1
        packet = []
4819 1
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4820 1
        packet.append(self.DisplayName.to_binary())
4821 1
        packet.append(self.Description.to_binary())
4822 1
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4823 1
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4824 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsAbstract))
4825 1
        return b''.join(packet)
4826
4827 1
    @staticmethod
4828
    def from_binary(data):
4829 1
        return DataTypeAttributes(data)
4830
4831 1
    def _binary_init(self, data):
4832 1
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4833 1
        self.DisplayName = LocalizedText.from_binary(data)
4834 1
        self.Description = LocalizedText.from_binary(data)
4835 1
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4836 1
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4837 1
        self.IsAbstract = uabin.Primitives.Boolean.unpack(data)
4838
4839 1
    def __str__(self):
4840
        return 'DataTypeAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4841
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4842
               'Description:' + str(self.Description) + ', ' + \
4843
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4844
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4845
               'IsAbstract:' + str(self.IsAbstract) + ')'
4846
4847 1
    __repr__ = __str__
4848
4849
4850 1 View Code Duplication
class ViewAttributes(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4851
    '''
4852
    The attributes for a view node.
4853
4854
    :ivar SpecifiedAttributes:
4855
    :vartype SpecifiedAttributes: UInt32
4856
    :ivar DisplayName:
4857
    :vartype DisplayName: LocalizedText
4858
    :ivar Description:
4859
    :vartype Description: LocalizedText
4860
    :ivar WriteMask:
4861
    :vartype WriteMask: UInt32
4862
    :ivar UserWriteMask:
4863
    :vartype UserWriteMask: UInt32
4864
    :ivar ContainsNoLoops:
4865
    :vartype ContainsNoLoops: Boolean
4866
    :ivar EventNotifier:
4867
    :vartype EventNotifier: Byte
4868
    '''
4869
4870 1
    ua_types = {
4871
        'SpecifiedAttributes': 'UInt32',
4872
        'DisplayName': 'LocalizedText',
4873
        'Description': 'LocalizedText',
4874
        'WriteMask': 'UInt32',
4875
        'UserWriteMask': 'UInt32',
4876
        'ContainsNoLoops': 'Boolean',
4877
        'EventNotifier': 'Byte',
4878
               }
4879
4880 1
    def __init__(self, binary=None):
4881
        if binary is not None:
4882
            self._binary_init(binary)
4883
            self._freeze = True
4884
            return
4885
        self.SpecifiedAttributes = 0
4886
        self.DisplayName = LocalizedText()
4887
        self.Description = LocalizedText()
4888
        self.WriteMask = 0
4889
        self.UserWriteMask = 0
4890
        self.ContainsNoLoops = True
4891
        self.EventNotifier = 0
4892
        self._freeze = True
4893
4894 1
    def to_binary(self):
4895
        packet = []
4896
        packet.append(uabin.Primitives.UInt32.pack(self.SpecifiedAttributes))
4897
        packet.append(self.DisplayName.to_binary())
4898
        packet.append(self.Description.to_binary())
4899
        packet.append(uabin.Primitives.UInt32.pack(self.WriteMask))
4900
        packet.append(uabin.Primitives.UInt32.pack(self.UserWriteMask))
4901
        packet.append(uabin.Primitives.Boolean.pack(self.ContainsNoLoops))
4902
        packet.append(uabin.Primitives.Byte.pack(self.EventNotifier))
4903
        return b''.join(packet)
4904
4905 1
    @staticmethod
4906
    def from_binary(data):
4907
        return ViewAttributes(data)
4908
4909 1
    def _binary_init(self, data):
4910
        self.SpecifiedAttributes = uabin.Primitives.UInt32.unpack(data)
4911
        self.DisplayName = LocalizedText.from_binary(data)
4912
        self.Description = LocalizedText.from_binary(data)
4913
        self.WriteMask = uabin.Primitives.UInt32.unpack(data)
4914
        self.UserWriteMask = uabin.Primitives.UInt32.unpack(data)
4915
        self.ContainsNoLoops = uabin.Primitives.Boolean.unpack(data)
4916
        self.EventNotifier = uabin.Primitives.Byte.unpack(data)
4917
4918 1
    def __str__(self):
4919
        return 'ViewAttributes(' + 'SpecifiedAttributes:' + str(self.SpecifiedAttributes) + ', ' + \
4920
               'DisplayName:' + str(self.DisplayName) + ', ' + \
4921
               'Description:' + str(self.Description) + ', ' + \
4922
               'WriteMask:' + str(self.WriteMask) + ', ' + \
4923
               'UserWriteMask:' + str(self.UserWriteMask) + ', ' + \
4924
               'ContainsNoLoops:' + str(self.ContainsNoLoops) + ', ' + \
4925
               'EventNotifier:' + str(self.EventNotifier) + ')'
4926
4927 1
    __repr__ = __str__
4928
4929
4930 1 View Code Duplication
class AddNodesItem(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
4931
    '''
4932
    A request to add a node to the server address space.
4933
4934
    :ivar ParentNodeId:
4935
    :vartype ParentNodeId: ExpandedNodeId
4936
    :ivar ReferenceTypeId:
4937
    :vartype ReferenceTypeId: NodeId
4938
    :ivar RequestedNewNodeId:
4939
    :vartype RequestedNewNodeId: ExpandedNodeId
4940
    :ivar BrowseName:
4941
    :vartype BrowseName: QualifiedName
4942
    :ivar NodeClass:
4943
    :vartype NodeClass: NodeClass
4944
    :ivar NodeAttributes:
4945
    :vartype NodeAttributes: ExtensionObject
4946
    :ivar TypeDefinition:
4947
    :vartype TypeDefinition: ExpandedNodeId
4948
    '''
4949
4950 1
    ua_types = {
4951
        'ParentNodeId': 'ExpandedNodeId',
4952
        'ReferenceTypeId': 'NodeId',
4953
        'RequestedNewNodeId': 'ExpandedNodeId',
4954
        'BrowseName': 'QualifiedName',
4955
        'NodeClass': 'NodeClass',
4956
        'NodeAttributes': 'ExtensionObject',
4957
        'TypeDefinition': 'ExpandedNodeId',
4958
               }
4959
4960 1
    def __init__(self, binary=None):
4961 1
        if binary is not None:
4962 1
            self._binary_init(binary)
4963 1
            self._freeze = True
4964 1
            return
4965 1
        self.ParentNodeId = ExpandedNodeId()
4966 1
        self.ReferenceTypeId = NodeId()
4967 1
        self.RequestedNewNodeId = ExpandedNodeId()
4968 1
        self.BrowseName = QualifiedName()
4969 1
        self.NodeClass = NodeClass(0)
4970 1
        self.NodeAttributes = None
4971 1
        self.TypeDefinition = ExpandedNodeId()
4972 1
        self._freeze = True
4973
4974 1
    def to_binary(self):
4975 1
        packet = []
4976 1
        packet.append(self.ParentNodeId.to_binary())
4977 1
        packet.append(self.ReferenceTypeId.to_binary())
4978 1
        packet.append(self.RequestedNewNodeId.to_binary())
4979 1
        packet.append(self.BrowseName.to_binary())
4980 1
        packet.append(uabin.Primitives.UInt32.pack(self.NodeClass.value))
4981 1
        packet.append(extensionobject_to_binary(self.NodeAttributes))
4982 1
        packet.append(self.TypeDefinition.to_binary())
4983 1
        return b''.join(packet)
4984
4985 1
    @staticmethod
4986
    def from_binary(data):
4987 1
        return AddNodesItem(data)
4988
4989 1
    def _binary_init(self, data):
4990 1
        self.ParentNodeId = ExpandedNodeId.from_binary(data)
4991 1
        self.ReferenceTypeId = NodeId.from_binary(data)
4992 1
        self.RequestedNewNodeId = ExpandedNodeId.from_binary(data)
4993 1
        self.BrowseName = QualifiedName.from_binary(data)
4994 1
        self.NodeClass = NodeClass(uabin.Primitives.UInt32.unpack(data))
4995 1
        self.NodeAttributes = extensionobject_from_binary(data)
4996 1
        self.TypeDefinition = ExpandedNodeId.from_binary(data)
4997
4998 1
    def __str__(self):
4999
        return 'AddNodesItem(' + 'ParentNodeId:' + str(self.ParentNodeId) + ', ' + \
5000
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
5001
               'RequestedNewNodeId:' + str(self.RequestedNewNodeId) + ', ' + \
5002
               'BrowseName:' + str(self.BrowseName) + ', ' + \
5003
               'NodeClass:' + str(self.NodeClass) + ', ' + \
5004
               'NodeAttributes:' + str(self.NodeAttributes) + ', ' + \
5005
               'TypeDefinition:' + str(self.TypeDefinition) + ')'
5006
5007 1
    __repr__ = __str__
5008
5009
5010 1
class AddNodesResult(FrozenClass):
5011
    '''
5012
    A result of an add node operation.
5013
5014
    :ivar StatusCode:
5015
    :vartype StatusCode: StatusCode
5016
    :ivar AddedNodeId:
5017
    :vartype AddedNodeId: NodeId
5018
    '''
5019
5020 1
    ua_types = {
5021
        'StatusCode': 'StatusCode',
5022
        'AddedNodeId': 'NodeId',
5023
               }
5024
5025 1
    def __init__(self, binary=None):
5026 1
        if binary is not None:
5027 1
            self._binary_init(binary)
5028 1
            self._freeze = True
5029 1
            return
5030 1
        self.StatusCode = StatusCode()
5031 1
        self.AddedNodeId = NodeId()
5032 1
        self._freeze = True
5033
5034 1
    def to_binary(self):
5035 1
        packet = []
5036 1
        packet.append(self.StatusCode.to_binary())
5037 1
        packet.append(self.AddedNodeId.to_binary())
5038 1
        return b''.join(packet)
5039
5040 1
    @staticmethod
5041
    def from_binary(data):
5042 1
        return AddNodesResult(data)
5043
5044 1
    def _binary_init(self, data):
5045 1
        self.StatusCode = StatusCode.from_binary(data)
5046 1
        self.AddedNodeId = NodeId.from_binary(data)
5047
5048 1
    def __str__(self):
5049
        return 'AddNodesResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
5050
               'AddedNodeId:' + str(self.AddedNodeId) + ')'
5051
5052 1
    __repr__ = __str__
5053
5054
5055 1
class AddNodesParameters(FrozenClass):
5056
    '''
5057
    :ivar NodesToAdd:
5058
    :vartype NodesToAdd: AddNodesItem
5059
    '''
5060
5061 1
    ua_types = {
5062
        'NodesToAdd': 'AddNodesItem',
5063
               }
5064
5065 1
    def __init__(self, binary=None):
5066 1
        if binary is not None:
5067 1
            self._binary_init(binary)
5068 1
            self._freeze = True
5069 1
            return
5070 1
        self.NodesToAdd = []
5071 1
        self._freeze = True
5072
5073 1
    def to_binary(self):
5074 1
        packet = []
5075 1
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToAdd)))
5076 1
        for fieldname in self.NodesToAdd:
5077 1
            packet.append(fieldname.to_binary())
5078 1
        return b''.join(packet)
5079
5080 1
    @staticmethod
5081
    def from_binary(data):
5082 1
        return AddNodesParameters(data)
5083
5084 1
    def _binary_init(self, data):
5085 1
        length = uabin.Primitives.Int32.unpack(data)
5086 1
        array = []
5087 1
        if length != -1:
5088 1
            for _ in range(0, length):
5089 1
                array.append(AddNodesItem.from_binary(data))
5090 1
        self.NodesToAdd = array
5091
5092 1
    def __str__(self):
5093
        return 'AddNodesParameters(' + 'NodesToAdd:' + str(self.NodesToAdd) + ')'
5094
5095 1
    __repr__ = __str__
5096
5097
5098 1
class AddNodesRequest(FrozenClass):
5099
    '''
5100
    Adds one or more nodes to the server address space.
5101
5102
    :ivar TypeId:
5103
    :vartype TypeId: NodeId
5104
    :ivar RequestHeader:
5105
    :vartype RequestHeader: RequestHeader
5106
    :ivar Parameters:
5107
    :vartype Parameters: AddNodesParameters
5108
    '''
5109
5110 1
    ua_types = {
5111
        'TypeId': 'NodeId',
5112
        'RequestHeader': 'RequestHeader',
5113
        'Parameters': 'AddNodesParameters',
5114
               }
5115
5116 1
    def __init__(self, binary=None):
5117 1
        if binary is not None:
5118
            self._binary_init(binary)
5119
            self._freeze = True
5120
            return
5121 1
        self.TypeId = FourByteNodeId(ObjectIds.AddNodesRequest_Encoding_DefaultBinary)
5122 1
        self.RequestHeader = RequestHeader()
5123 1
        self.Parameters = AddNodesParameters()
5124 1
        self._freeze = True
5125
5126 1
    def to_binary(self):
5127 1
        packet = []
5128 1
        packet.append(self.TypeId.to_binary())
5129 1
        packet.append(self.RequestHeader.to_binary())
5130 1
        packet.append(self.Parameters.to_binary())
5131 1
        return b''.join(packet)
5132
5133 1
    @staticmethod
5134
    def from_binary(data):
5135
        return AddNodesRequest(data)
5136
5137 1
    def _binary_init(self, data):
5138
        self.TypeId = NodeId.from_binary(data)
5139
        self.RequestHeader = RequestHeader.from_binary(data)
5140
        self.Parameters = AddNodesParameters.from_binary(data)
5141
5142 1
    def __str__(self):
5143
        return 'AddNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5144
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5145
               'Parameters:' + str(self.Parameters) + ')'
5146
5147 1
    __repr__ = __str__
5148
5149
5150 1
class AddNodesResponse(FrozenClass):
5151
    '''
5152
    Adds one or more nodes to the server address space.
5153
5154
    :ivar TypeId:
5155
    :vartype TypeId: NodeId
5156
    :ivar ResponseHeader:
5157
    :vartype ResponseHeader: ResponseHeader
5158
    :ivar Results:
5159
    :vartype Results: AddNodesResult
5160
    :ivar DiagnosticInfos:
5161
    :vartype DiagnosticInfos: DiagnosticInfo
5162
    '''
5163
5164 1
    ua_types = {
5165
        'TypeId': 'NodeId',
5166
        'ResponseHeader': 'ResponseHeader',
5167
        'Results': 'AddNodesResult',
5168
        'DiagnosticInfos': 'DiagnosticInfo',
5169
               }
5170
5171 1
    def __init__(self, binary=None):
5172 1
        if binary is not None:
5173 1
            self._binary_init(binary)
5174 1
            self._freeze = True
5175 1
            return
5176 1
        self.TypeId = FourByteNodeId(ObjectIds.AddNodesResponse_Encoding_DefaultBinary)
5177 1
        self.ResponseHeader = ResponseHeader()
5178 1
        self.Results = []
5179 1
        self.DiagnosticInfos = []
5180 1
        self._freeze = True
5181
5182 1
    def to_binary(self):
5183 1
        packet = []
5184 1
        packet.append(self.TypeId.to_binary())
5185 1
        packet.append(self.ResponseHeader.to_binary())
5186 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
5187 1
        for fieldname in self.Results:
5188 1
            packet.append(fieldname.to_binary())
5189 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
5190 1
        for fieldname in self.DiagnosticInfos:
5191
            packet.append(fieldname.to_binary())
5192 1
        return b''.join(packet)
5193
5194 1
    @staticmethod
5195
    def from_binary(data):
5196 1
        return AddNodesResponse(data)
5197
5198 1
    def _binary_init(self, data):
5199 1
        self.TypeId = NodeId.from_binary(data)
5200 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
5201 1
        length = uabin.Primitives.Int32.unpack(data)
5202 1
        array = []
5203 1
        if length != -1:
5204 1
            for _ in range(0, length):
5205 1
                array.append(AddNodesResult.from_binary(data))
5206 1
        self.Results = array
5207 1
        length = uabin.Primitives.Int32.unpack(data)
5208 1
        array = []
5209 1
        if length != -1:
5210 1
            for _ in range(0, length):
5211
                array.append(DiagnosticInfo.from_binary(data))
5212 1
        self.DiagnosticInfos = array
5213
5214 1
    def __str__(self):
5215
        return 'AddNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5216
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5217
               'Results:' + str(self.Results) + ', ' + \
5218
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5219
5220 1
    __repr__ = __str__
5221
5222
5223 1 View Code Duplication
class AddReferencesItem(FrozenClass):
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5224
    '''
5225
    A request to add a reference to the server address space.
5226
5227
    :ivar SourceNodeId:
5228
    :vartype SourceNodeId: NodeId
5229
    :ivar ReferenceTypeId:
5230
    :vartype ReferenceTypeId: NodeId
5231
    :ivar IsForward:
5232
    :vartype IsForward: Boolean
5233
    :ivar TargetServerUri:
5234
    :vartype TargetServerUri: String
5235
    :ivar TargetNodeId:
5236
    :vartype TargetNodeId: ExpandedNodeId
5237
    :ivar TargetNodeClass:
5238
    :vartype TargetNodeClass: NodeClass
5239
    '''
5240
5241 1
    ua_types = {
5242
        'SourceNodeId': 'NodeId',
5243
        'ReferenceTypeId': 'NodeId',
5244
        'IsForward': 'Boolean',
5245
        'TargetServerUri': 'String',
5246
        'TargetNodeId': 'ExpandedNodeId',
5247
        'TargetNodeClass': 'NodeClass',
5248
               }
5249
5250 1
    def __init__(self, binary=None):
5251 1
        if binary is not None:
5252 1
            self._binary_init(binary)
5253 1
            self._freeze = True
5254 1
            return
5255 1
        self.SourceNodeId = NodeId()
5256 1
        self.ReferenceTypeId = NodeId()
5257 1
        self.IsForward = True
5258 1
        self.TargetServerUri = None
5259 1
        self.TargetNodeId = ExpandedNodeId()
5260 1
        self.TargetNodeClass = NodeClass(0)
5261 1
        self._freeze = True
5262
5263 1
    def to_binary(self):
5264 1
        packet = []
5265 1
        packet.append(self.SourceNodeId.to_binary())
5266 1
        packet.append(self.ReferenceTypeId.to_binary())
5267 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsForward))
5268 1
        packet.append(uabin.Primitives.String.pack(self.TargetServerUri))
5269 1
        packet.append(self.TargetNodeId.to_binary())
5270 1
        packet.append(uabin.Primitives.UInt32.pack(self.TargetNodeClass.value))
5271 1
        return b''.join(packet)
5272
5273 1
    @staticmethod
5274
    def from_binary(data):
5275 1
        return AddReferencesItem(data)
5276
5277 1
    def _binary_init(self, data):
5278 1
        self.SourceNodeId = NodeId.from_binary(data)
5279 1
        self.ReferenceTypeId = NodeId.from_binary(data)
5280 1
        self.IsForward = uabin.Primitives.Boolean.unpack(data)
5281 1
        self.TargetServerUri = uabin.Primitives.String.unpack(data)
5282 1
        self.TargetNodeId = ExpandedNodeId.from_binary(data)
5283 1
        self.TargetNodeClass = NodeClass(uabin.Primitives.UInt32.unpack(data))
5284
5285 1
    def __str__(self):
5286
        return 'AddReferencesItem(' + 'SourceNodeId:' + str(self.SourceNodeId) + ', ' + \
5287
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
5288
               'IsForward:' + str(self.IsForward) + ', ' + \
5289
               'TargetServerUri:' + str(self.TargetServerUri) + ', ' + \
5290
               'TargetNodeId:' + str(self.TargetNodeId) + ', ' + \
5291
               'TargetNodeClass:' + str(self.TargetNodeClass) + ')'
5292
5293 1
    __repr__ = __str__
5294
5295
5296 1
class AddReferencesParameters(FrozenClass):
5297
    '''
5298
    :ivar ReferencesToAdd:
5299
    :vartype ReferencesToAdd: AddReferencesItem
5300
    '''
5301
5302 1
    ua_types = {
5303
        'ReferencesToAdd': 'AddReferencesItem',
5304
               }
5305
5306 1
    def __init__(self, binary=None):
5307 1
        if binary is not None:
5308 1
            self._binary_init(binary)
5309 1
            self._freeze = True
5310 1
            return
5311 1
        self.ReferencesToAdd = []
5312 1
        self._freeze = True
5313
5314 1
    def to_binary(self):
5315 1
        packet = []
5316 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ReferencesToAdd)))
5317 1
        for fieldname in self.ReferencesToAdd:
5318 1
            packet.append(fieldname.to_binary())
5319 1
        return b''.join(packet)
5320
5321 1
    @staticmethod
5322
    def from_binary(data):
5323 1
        return AddReferencesParameters(data)
5324
5325 1
    def _binary_init(self, data):
5326 1
        length = uabin.Primitives.Int32.unpack(data)
5327 1
        array = []
5328 1
        if length != -1:
5329 1
            for _ in range(0, length):
5330 1
                array.append(AddReferencesItem.from_binary(data))
5331 1
        self.ReferencesToAdd = array
5332
5333 1
    def __str__(self):
5334
        return 'AddReferencesParameters(' + 'ReferencesToAdd:' + str(self.ReferencesToAdd) + ')'
5335
5336 1
    __repr__ = __str__
5337
5338
5339 1
class AddReferencesRequest(FrozenClass):
5340
    '''
5341
    Adds one or more references to the server address space.
5342
5343
    :ivar TypeId:
5344
    :vartype TypeId: NodeId
5345
    :ivar RequestHeader:
5346
    :vartype RequestHeader: RequestHeader
5347
    :ivar Parameters:
5348
    :vartype Parameters: AddReferencesParameters
5349
    '''
5350
5351 1
    ua_types = {
5352
        'TypeId': 'NodeId',
5353
        'RequestHeader': 'RequestHeader',
5354
        'Parameters': 'AddReferencesParameters',
5355
               }
5356
5357 1
    def __init__(self, binary=None):
5358 1
        if binary is not None:
5359
            self._binary_init(binary)
5360
            self._freeze = True
5361
            return
5362 1
        self.TypeId = FourByteNodeId(ObjectIds.AddReferencesRequest_Encoding_DefaultBinary)
5363 1
        self.RequestHeader = RequestHeader()
5364 1
        self.Parameters = AddReferencesParameters()
5365 1
        self._freeze = True
5366
5367 1
    def to_binary(self):
5368 1
        packet = []
5369 1
        packet.append(self.TypeId.to_binary())
5370 1
        packet.append(self.RequestHeader.to_binary())
5371 1
        packet.append(self.Parameters.to_binary())
5372 1
        return b''.join(packet)
5373
5374 1
    @staticmethod
5375
    def from_binary(data):
5376
        return AddReferencesRequest(data)
5377
5378 1
    def _binary_init(self, data):
5379
        self.TypeId = NodeId.from_binary(data)
5380
        self.RequestHeader = RequestHeader.from_binary(data)
5381
        self.Parameters = AddReferencesParameters.from_binary(data)
5382
5383 1
    def __str__(self):
5384
        return 'AddReferencesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5385
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5386
               'Parameters:' + str(self.Parameters) + ')'
5387
5388 1
    __repr__ = __str__
5389
5390
5391 1
class AddReferencesResponse(FrozenClass):
5392
    '''
5393
    Adds one or more references to the server address space.
5394
5395
    :ivar TypeId:
5396
    :vartype TypeId: NodeId
5397
    :ivar ResponseHeader:
5398
    :vartype ResponseHeader: ResponseHeader
5399
    :ivar Results:
5400
    :vartype Results: StatusCode
5401
    :ivar DiagnosticInfos:
5402
    :vartype DiagnosticInfos: DiagnosticInfo
5403
    '''
5404
5405 1
    ua_types = {
5406
        'TypeId': 'NodeId',
5407
        'ResponseHeader': 'ResponseHeader',
5408
        'Results': 'StatusCode',
5409
        'DiagnosticInfos': 'DiagnosticInfo',
5410
               }
5411
5412 1
    def __init__(self, binary=None):
5413 1
        if binary is not None:
5414 1
            self._binary_init(binary)
5415 1
            self._freeze = True
5416 1
            return
5417 1
        self.TypeId = FourByteNodeId(ObjectIds.AddReferencesResponse_Encoding_DefaultBinary)
5418 1
        self.ResponseHeader = ResponseHeader()
5419 1
        self.Results = []
5420 1
        self.DiagnosticInfos = []
5421 1
        self._freeze = True
5422
5423 1
    def to_binary(self):
5424 1
        packet = []
5425 1
        packet.append(self.TypeId.to_binary())
5426 1
        packet.append(self.ResponseHeader.to_binary())
5427 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
5428 1
        for fieldname in self.Results:
5429 1
            packet.append(fieldname.to_binary())
5430 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
5431 1
        for fieldname in self.DiagnosticInfos:
5432
            packet.append(fieldname.to_binary())
5433 1
        return b''.join(packet)
5434
5435 1
    @staticmethod
5436
    def from_binary(data):
5437 1
        return AddReferencesResponse(data)
5438
5439 1
    def _binary_init(self, data):
5440 1
        self.TypeId = NodeId.from_binary(data)
5441 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
5442 1
        length = uabin.Primitives.Int32.unpack(data)
5443 1
        array = []
5444 1
        if length != -1:
5445 1
            for _ in range(0, length):
5446 1
                array.append(StatusCode.from_binary(data))
5447 1
        self.Results = array
5448 1
        length = uabin.Primitives.Int32.unpack(data)
5449 1
        array = []
5450 1
        if length != -1:
5451 1
            for _ in range(0, length):
5452
                array.append(DiagnosticInfo.from_binary(data))
5453 1
        self.DiagnosticInfos = array
5454
5455 1
    def __str__(self):
5456
        return 'AddReferencesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5457
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5458
               'Results:' + str(self.Results) + ', ' + \
5459
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5460
5461 1
    __repr__ = __str__
5462
5463
5464 1
class DeleteNodesItem(FrozenClass):
5465
    '''
5466
    A request to delete a node to the server address space.
5467
5468
    :ivar NodeId:
5469
    :vartype NodeId: NodeId
5470
    :ivar DeleteTargetReferences:
5471
    :vartype DeleteTargetReferences: Boolean
5472
    '''
5473
5474 1
    ua_types = {
5475
        'NodeId': 'NodeId',
5476
        'DeleteTargetReferences': 'Boolean',
5477
               }
5478
5479 1
    def __init__(self, binary=None):
5480 1
        if binary is not None:
5481 1
            self._binary_init(binary)
5482 1
            self._freeze = True
5483 1
            return
5484 1
        self.NodeId = NodeId()
5485 1
        self.DeleteTargetReferences = True
5486 1
        self._freeze = True
5487
5488 1
    def to_binary(self):
5489 1
        packet = []
5490 1
        packet.append(self.NodeId.to_binary())
5491 1
        packet.append(uabin.Primitives.Boolean.pack(self.DeleteTargetReferences))
5492 1
        return b''.join(packet)
5493
5494 1
    @staticmethod
5495
    def from_binary(data):
5496 1
        return DeleteNodesItem(data)
5497
5498 1
    def _binary_init(self, data):
5499 1
        self.NodeId = NodeId.from_binary(data)
5500 1
        self.DeleteTargetReferences = uabin.Primitives.Boolean.unpack(data)
5501
5502 1
    def __str__(self):
5503
        return 'DeleteNodesItem(' + 'NodeId:' + str(self.NodeId) + ', ' + \
5504
               'DeleteTargetReferences:' + str(self.DeleteTargetReferences) + ')'
5505
5506 1
    __repr__ = __str__
5507
5508
5509 1
class DeleteNodesParameters(FrozenClass):
5510
    '''
5511
    :ivar NodesToDelete:
5512
    :vartype NodesToDelete: DeleteNodesItem
5513
    '''
5514
5515 1
    ua_types = {
5516
        'NodesToDelete': 'DeleteNodesItem',
5517
               }
5518
5519 1
    def __init__(self, binary=None):
5520 1
        if binary is not None:
5521 1
            self._binary_init(binary)
5522 1
            self._freeze = True
5523 1
            return
5524 1
        self.NodesToDelete = []
5525 1
        self._freeze = True
5526
5527 1
    def to_binary(self):
5528 1
        packet = []
5529 1
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToDelete)))
5530 1
        for fieldname in self.NodesToDelete:
5531 1
            packet.append(fieldname.to_binary())
5532 1
        return b''.join(packet)
5533
5534 1
    @staticmethod
5535
    def from_binary(data):
5536 1
        return DeleteNodesParameters(data)
5537
5538 1
    def _binary_init(self, data):
5539 1
        length = uabin.Primitives.Int32.unpack(data)
5540 1
        array = []
5541 1
        if length != -1:
5542 1
            for _ in range(0, length):
5543 1
                array.append(DeleteNodesItem.from_binary(data))
5544 1
        self.NodesToDelete = array
5545
5546 1
    def __str__(self):
5547
        return 'DeleteNodesParameters(' + 'NodesToDelete:' + str(self.NodesToDelete) + ')'
5548
5549 1
    __repr__ = __str__
5550
5551
5552 1
class DeleteNodesRequest(FrozenClass):
5553
    '''
5554
    Delete one or more nodes from the server address space.
5555
5556
    :ivar TypeId:
5557
    :vartype TypeId: NodeId
5558
    :ivar RequestHeader:
5559
    :vartype RequestHeader: RequestHeader
5560
    :ivar Parameters:
5561
    :vartype Parameters: DeleteNodesParameters
5562
    '''
5563
5564 1
    ua_types = {
5565
        'TypeId': 'NodeId',
5566
        'RequestHeader': 'RequestHeader',
5567
        'Parameters': 'DeleteNodesParameters',
5568
               }
5569
5570 1
    def __init__(self, binary=None):
5571 1
        if binary is not None:
5572
            self._binary_init(binary)
5573
            self._freeze = True
5574
            return
5575 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteNodesRequest_Encoding_DefaultBinary)
5576 1
        self.RequestHeader = RequestHeader()
5577 1
        self.Parameters = DeleteNodesParameters()
5578 1
        self._freeze = True
5579
5580 1
    def to_binary(self):
5581 1
        packet = []
5582 1
        packet.append(self.TypeId.to_binary())
5583 1
        packet.append(self.RequestHeader.to_binary())
5584 1
        packet.append(self.Parameters.to_binary())
5585 1
        return b''.join(packet)
5586
5587 1
    @staticmethod
5588
    def from_binary(data):
5589
        return DeleteNodesRequest(data)
5590
5591 1
    def _binary_init(self, data):
5592
        self.TypeId = NodeId.from_binary(data)
5593
        self.RequestHeader = RequestHeader.from_binary(data)
5594
        self.Parameters = DeleteNodesParameters.from_binary(data)
5595
5596 1
    def __str__(self):
5597
        return 'DeleteNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5598
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5599
               'Parameters:' + str(self.Parameters) + ')'
5600
5601 1
    __repr__ = __str__
5602
5603
5604 1
class DeleteNodesResponse(FrozenClass):
5605
    '''
5606
    Delete one or more nodes from the server address space.
5607
5608
    :ivar TypeId:
5609
    :vartype TypeId: NodeId
5610
    :ivar ResponseHeader:
5611
    :vartype ResponseHeader: ResponseHeader
5612
    :ivar Results:
5613
    :vartype Results: StatusCode
5614
    :ivar DiagnosticInfos:
5615
    :vartype DiagnosticInfos: DiagnosticInfo
5616
    '''
5617
5618 1
    ua_types = {
5619
        'TypeId': 'NodeId',
5620
        'ResponseHeader': 'ResponseHeader',
5621
        'Results': 'StatusCode',
5622
        'DiagnosticInfos': 'DiagnosticInfo',
5623
               }
5624
5625 1
    def __init__(self, binary=None):
5626 1
        if binary is not None:
5627 1
            self._binary_init(binary)
5628 1
            self._freeze = True
5629 1
            return
5630 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteNodesResponse_Encoding_DefaultBinary)
5631 1
        self.ResponseHeader = ResponseHeader()
5632 1
        self.Results = []
5633 1
        self.DiagnosticInfos = []
5634 1
        self._freeze = True
5635
5636 1
    def to_binary(self):
5637 1
        packet = []
5638 1
        packet.append(self.TypeId.to_binary())
5639 1
        packet.append(self.ResponseHeader.to_binary())
5640 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
5641 1 View Code Duplication
        for fieldname in self.Results:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5642 1
            packet.append(fieldname.to_binary())
5643 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
5644 1
        for fieldname in self.DiagnosticInfos:
5645
            packet.append(fieldname.to_binary())
5646 1
        return b''.join(packet)
5647
5648 1
    @staticmethod
5649
    def from_binary(data):
5650 1
        return DeleteNodesResponse(data)
5651
5652 1
    def _binary_init(self, data):
5653 1
        self.TypeId = NodeId.from_binary(data)
5654 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
5655 1
        length = uabin.Primitives.Int32.unpack(data)
5656 1
        array = []
5657 1
        if length != -1:
5658 1
            for _ in range(0, length):
5659 1
                array.append(StatusCode.from_binary(data))
5660 1
        self.Results = array
5661 1
        length = uabin.Primitives.Int32.unpack(data)
5662 1
        array = []
5663 1
        if length != -1:
5664 1
            for _ in range(0, length):
5665
                array.append(DiagnosticInfo.from_binary(data))
5666 1
        self.DiagnosticInfos = array
5667
5668 1
    def __str__(self):
5669
        return 'DeleteNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5670
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5671
               'Results:' + str(self.Results) + ', ' + \
5672
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5673
5674 1
    __repr__ = __str__
5675
5676
5677 1
class DeleteReferencesItem(FrozenClass):
5678
    '''
5679
    A request to delete a node from the server address space.
5680
5681
    :ivar SourceNodeId:
5682
    :vartype SourceNodeId: NodeId
5683
    :ivar ReferenceTypeId:
5684
    :vartype ReferenceTypeId: NodeId
5685
    :ivar IsForward:
5686
    :vartype IsForward: Boolean
5687
    :ivar TargetNodeId:
5688
    :vartype TargetNodeId: ExpandedNodeId
5689
    :ivar DeleteBidirectional:
5690
    :vartype DeleteBidirectional: Boolean
5691
    '''
5692
5693 1
    ua_types = {
5694
        'SourceNodeId': 'NodeId',
5695
        'ReferenceTypeId': 'NodeId',
5696
        'IsForward': 'Boolean',
5697
        'TargetNodeId': 'ExpandedNodeId',
5698
        'DeleteBidirectional': 'Boolean',
5699
               }
5700
5701 1
    def __init__(self, binary=None):
5702
        if binary is not None:
5703
            self._binary_init(binary)
5704
            self._freeze = True
5705
            return
5706
        self.SourceNodeId = NodeId()
5707
        self.ReferenceTypeId = NodeId()
5708
        self.IsForward = True
5709
        self.TargetNodeId = ExpandedNodeId()
5710
        self.DeleteBidirectional = True
5711
        self._freeze = True
5712
5713 1
    def to_binary(self):
5714
        packet = []
5715
        packet.append(self.SourceNodeId.to_binary())
5716
        packet.append(self.ReferenceTypeId.to_binary())
5717
        packet.append(uabin.Primitives.Boolean.pack(self.IsForward))
5718
        packet.append(self.TargetNodeId.to_binary())
5719
        packet.append(uabin.Primitives.Boolean.pack(self.DeleteBidirectional))
5720
        return b''.join(packet)
5721
5722 1
    @staticmethod
5723
    def from_binary(data):
5724
        return DeleteReferencesItem(data)
5725
5726 1
    def _binary_init(self, data):
5727
        self.SourceNodeId = NodeId.from_binary(data)
5728
        self.ReferenceTypeId = NodeId.from_binary(data)
5729
        self.IsForward = uabin.Primitives.Boolean.unpack(data)
5730
        self.TargetNodeId = ExpandedNodeId.from_binary(data)
5731
        self.DeleteBidirectional = uabin.Primitives.Boolean.unpack(data)
5732
5733 1
    def __str__(self):
5734
        return 'DeleteReferencesItem(' + 'SourceNodeId:' + str(self.SourceNodeId) + ', ' + \
5735
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
5736
               'IsForward:' + str(self.IsForward) + ', ' + \
5737
               'TargetNodeId:' + str(self.TargetNodeId) + ', ' + \
5738
               'DeleteBidirectional:' + str(self.DeleteBidirectional) + ')'
5739
5740 1
    __repr__ = __str__
5741
5742
5743 1
class DeleteReferencesParameters(FrozenClass):
5744
    '''
5745
    :ivar ReferencesToDelete:
5746
    :vartype ReferencesToDelete: DeleteReferencesItem
5747
    '''
5748
5749 1
    ua_types = {
5750
        'ReferencesToDelete': 'DeleteReferencesItem',
5751
               }
5752
5753 1
    def __init__(self, binary=None):
5754
        if binary is not None:
5755
            self._binary_init(binary)
5756
            self._freeze = True
5757
            return
5758
        self.ReferencesToDelete = []
5759
        self._freeze = True
5760
5761 1
    def to_binary(self):
5762
        packet = []
5763
        packet.append(uabin.Primitives.Int32.pack(len(self.ReferencesToDelete)))
5764
        for fieldname in self.ReferencesToDelete:
5765
            packet.append(fieldname.to_binary())
5766
        return b''.join(packet)
5767
5768 1
    @staticmethod
5769
    def from_binary(data):
5770
        return DeleteReferencesParameters(data)
5771
5772 1
    def _binary_init(self, data):
5773
        length = uabin.Primitives.Int32.unpack(data)
5774
        array = []
5775
        if length != -1:
5776
            for _ in range(0, length):
5777
                array.append(DeleteReferencesItem.from_binary(data))
5778
        self.ReferencesToDelete = array
5779
5780 1
    def __str__(self):
5781
        return 'DeleteReferencesParameters(' + 'ReferencesToDelete:' + str(self.ReferencesToDelete) + ')'
5782
5783 1
    __repr__ = __str__
5784
5785
5786 1
class DeleteReferencesRequest(FrozenClass):
5787
    '''
5788
    Delete one or more references from the server address space.
5789
5790
    :ivar TypeId:
5791
    :vartype TypeId: NodeId
5792
    :ivar RequestHeader:
5793
    :vartype RequestHeader: RequestHeader
5794
    :ivar Parameters:
5795
    :vartype Parameters: DeleteReferencesParameters
5796
    '''
5797
5798 1
    ua_types = {
5799
        'TypeId': 'NodeId',
5800
        'RequestHeader': 'RequestHeader',
5801
        'Parameters': 'DeleteReferencesParameters',
5802
               }
5803
5804 1
    def __init__(self, binary=None):
5805
        if binary is not None:
5806
            self._binary_init(binary)
5807
            self._freeze = True
5808
            return
5809
        self.TypeId = FourByteNodeId(ObjectIds.DeleteReferencesRequest_Encoding_DefaultBinary)
5810
        self.RequestHeader = RequestHeader()
5811
        self.Parameters = DeleteReferencesParameters()
5812
        self._freeze = True
5813
5814 1
    def to_binary(self):
5815
        packet = []
5816
        packet.append(self.TypeId.to_binary())
5817
        packet.append(self.RequestHeader.to_binary())
5818
        packet.append(self.Parameters.to_binary())
5819
        return b''.join(packet)
5820
5821 1
    @staticmethod
5822
    def from_binary(data):
5823
        return DeleteReferencesRequest(data)
5824
5825 1
    def _binary_init(self, data):
5826
        self.TypeId = NodeId.from_binary(data)
5827
        self.RequestHeader = RequestHeader.from_binary(data)
5828
        self.Parameters = DeleteReferencesParameters.from_binary(data)
5829
5830 1
    def __str__(self):
5831
        return 'DeleteReferencesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5832
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
5833
               'Parameters:' + str(self.Parameters) + ')'
5834
5835 1
    __repr__ = __str__
5836 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5837
5838 1
class DeleteReferencesResult(FrozenClass):
5839
    '''
5840
    :ivar Results:
5841
    :vartype Results: StatusCode
5842
    :ivar DiagnosticInfos:
5843
    :vartype DiagnosticInfos: DiagnosticInfo
5844
    '''
5845
5846 1
    ua_types = {
5847
        'Results': 'StatusCode',
5848
        'DiagnosticInfos': 'DiagnosticInfo',
5849
               }
5850
5851 1
    def __init__(self, binary=None):
5852
        if binary is not None:
5853
            self._binary_init(binary)
5854
            self._freeze = True
5855
            return
5856
        self.Results = []
5857
        self.DiagnosticInfos = []
5858
        self._freeze = True
5859
5860 1
    def to_binary(self):
5861
        packet = []
5862
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
5863
        for fieldname in self.Results:
5864
            packet.append(fieldname.to_binary())
5865
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
5866
        for fieldname in self.DiagnosticInfos:
5867
            packet.append(fieldname.to_binary())
5868
        return b''.join(packet)
5869
5870 1
    @staticmethod
5871
    def from_binary(data):
5872
        return DeleteReferencesResult(data)
5873
5874 1
    def _binary_init(self, data):
5875
        length = uabin.Primitives.Int32.unpack(data)
5876
        array = []
5877
        if length != -1:
5878
            for _ in range(0, length):
5879
                array.append(StatusCode.from_binary(data))
5880
        self.Results = array
5881
        length = uabin.Primitives.Int32.unpack(data)
5882
        array = []
5883
        if length != -1:
5884
            for _ in range(0, length):
5885
                array.append(DiagnosticInfo.from_binary(data))
5886
        self.DiagnosticInfos = array
5887
5888 1
    def __str__(self):
5889
        return 'DeleteReferencesResult(' + 'Results:' + str(self.Results) + ', ' + \
5890
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5891
5892 1
    __repr__ = __str__
5893
5894
5895 1
class DeleteReferencesResponse(FrozenClass):
5896
    '''
5897
    Delete one or more references from the server address space.
5898
5899
    :ivar TypeId:
5900
    :vartype TypeId: NodeId
5901
    :ivar ResponseHeader:
5902
    :vartype ResponseHeader: ResponseHeader
5903
    :ivar Parameters:
5904
    :vartype Parameters: DeleteReferencesResult
5905
    '''
5906
5907 1
    ua_types = {
5908
        'TypeId': 'NodeId',
5909
        'ResponseHeader': 'ResponseHeader',
5910
        'Parameters': 'DeleteReferencesResult',
5911
               }
5912
5913 1
    def __init__(self, binary=None):
5914
        if binary is not None:
5915
            self._binary_init(binary)
5916
            self._freeze = True
5917
            return
5918
        self.TypeId = FourByteNodeId(ObjectIds.DeleteReferencesResponse_Encoding_DefaultBinary)
5919
        self.ResponseHeader = ResponseHeader()
5920
        self.Parameters = DeleteReferencesResult()
5921
        self._freeze = True
5922
5923 1
    def to_binary(self):
5924
        packet = []
5925
        packet.append(self.TypeId.to_binary())
5926
        packet.append(self.ResponseHeader.to_binary())
5927
        packet.append(self.Parameters.to_binary())
5928
        return b''.join(packet)
5929
5930 1
    @staticmethod
5931
    def from_binary(data):
5932
        return DeleteReferencesResponse(data)
5933
5934 1
    def _binary_init(self, data):
5935
        self.TypeId = NodeId.from_binary(data)
5936
        self.ResponseHeader = ResponseHeader.from_binary(data)
5937
        self.Parameters = DeleteReferencesResult.from_binary(data)
5938
5939 1
    def __str__(self):
5940
        return 'DeleteReferencesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
5941
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
5942
               'Parameters:' + str(self.Parameters) + ')'
5943
5944 1
    __repr__ = __str__
5945
5946
5947 1
class ViewDescription(FrozenClass):
5948
    '''
5949
    The view to browse.
5950
5951
    :ivar ViewId:
5952
    :vartype ViewId: NodeId
5953
    :ivar Timestamp:
5954
    :vartype Timestamp: DateTime
5955
    :ivar ViewVersion:
5956
    :vartype ViewVersion: UInt32
5957
    '''
5958
5959 1
    ua_types = {
5960
        'ViewId': 'NodeId',
5961
        'Timestamp': 'DateTime',
5962
        'ViewVersion': 'UInt32',
5963 View Code Duplication
               }
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
5964
5965 1
    def __init__(self, binary=None):
5966 1
        if binary is not None:
5967 1
            self._binary_init(binary)
5968 1
            self._freeze = True
5969 1
            return
5970 1
        self.ViewId = NodeId()
5971 1
        self.Timestamp = datetime.utcnow()
5972 1
        self.ViewVersion = 0
5973 1
        self._freeze = True
5974
5975 1
    def to_binary(self):
5976 1
        packet = []
5977 1
        packet.append(self.ViewId.to_binary())
5978 1
        packet.append(uabin.Primitives.DateTime.pack(self.Timestamp))
5979 1
        packet.append(uabin.Primitives.UInt32.pack(self.ViewVersion))
5980 1
        return b''.join(packet)
5981
5982 1
    @staticmethod
5983
    def from_binary(data):
5984 1
        return ViewDescription(data)
5985
5986 1
    def _binary_init(self, data):
5987 1
        self.ViewId = NodeId.from_binary(data)
5988 1
        self.Timestamp = uabin.Primitives.DateTime.unpack(data)
5989 1
        self.ViewVersion = uabin.Primitives.UInt32.unpack(data)
5990
5991 1
    def __str__(self):
5992
        return 'ViewDescription(' + 'ViewId:' + str(self.ViewId) + ', ' + \
5993
               'Timestamp:' + str(self.Timestamp) + ', ' + \
5994
               'ViewVersion:' + str(self.ViewVersion) + ')'
5995
5996 1
    __repr__ = __str__
5997
5998
5999 1
class BrowseDescription(FrozenClass):
6000
    '''
6001
    A request to browse the the references from a node.
6002
6003
    :ivar NodeId:
6004
    :vartype NodeId: NodeId
6005
    :ivar BrowseDirection:
6006
    :vartype BrowseDirection: BrowseDirection
6007
    :ivar ReferenceTypeId:
6008
    :vartype ReferenceTypeId: NodeId
6009
    :ivar IncludeSubtypes:
6010
    :vartype IncludeSubtypes: Boolean
6011
    :ivar NodeClassMask:
6012
    :vartype NodeClassMask: UInt32
6013
    :ivar ResultMask:
6014
    :vartype ResultMask: UInt32
6015
    '''
6016
6017 1
    ua_types = {
6018
        'NodeId': 'NodeId',
6019
        'BrowseDirection': 'BrowseDirection',
6020
        'ReferenceTypeId': 'NodeId',
6021
        'IncludeSubtypes': 'Boolean',
6022
        'NodeClassMask': 'UInt32',
6023
        'ResultMask': 'UInt32',
6024
               }
6025
6026 1
    def __init__(self, binary=None):
6027 1
        if binary is not None:
6028 1
            self._binary_init(binary)
6029 1
            self._freeze = True
6030 1
            return
6031 1
        self.NodeId = NodeId()
6032 1
        self.BrowseDirection = BrowseDirection(0)
6033 1
        self.ReferenceTypeId = NodeId()
6034 1
        self.IncludeSubtypes = True
6035 1
        self.NodeClassMask = 0
6036 1 View Code Duplication
        self.ResultMask = 0
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6037 1
        self._freeze = True
6038
6039 1
    def to_binary(self):
6040 1
        packet = []
6041 1
        packet.append(self.NodeId.to_binary())
6042 1
        packet.append(uabin.Primitives.UInt32.pack(self.BrowseDirection.value))
6043 1
        packet.append(self.ReferenceTypeId.to_binary())
6044 1
        packet.append(uabin.Primitives.Boolean.pack(self.IncludeSubtypes))
6045 1
        packet.append(uabin.Primitives.UInt32.pack(self.NodeClassMask))
6046 1
        packet.append(uabin.Primitives.UInt32.pack(self.ResultMask))
6047 1
        return b''.join(packet)
6048
6049 1
    @staticmethod
6050
    def from_binary(data):
6051 1
        return BrowseDescription(data)
6052
6053 1
    def _binary_init(self, data):
6054 1
        self.NodeId = NodeId.from_binary(data)
6055 1
        self.BrowseDirection = BrowseDirection(uabin.Primitives.UInt32.unpack(data))
6056 1
        self.ReferenceTypeId = NodeId.from_binary(data)
6057 1
        self.IncludeSubtypes = uabin.Primitives.Boolean.unpack(data)
6058 1
        self.NodeClassMask = uabin.Primitives.UInt32.unpack(data)
6059 1
        self.ResultMask = uabin.Primitives.UInt32.unpack(data)
6060
6061 1
    def __str__(self):
6062
        return 'BrowseDescription(' + 'NodeId:' + str(self.NodeId) + ', ' + \
6063
               'BrowseDirection:' + str(self.BrowseDirection) + ', ' + \
6064
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
6065
               'IncludeSubtypes:' + str(self.IncludeSubtypes) + ', ' + \
6066
               'NodeClassMask:' + str(self.NodeClassMask) + ', ' + \
6067
               'ResultMask:' + str(self.ResultMask) + ')'
6068
6069 1
    __repr__ = __str__
6070
6071
6072 1
class ReferenceDescription(FrozenClass):
6073
    '''
6074
    The description of a reference.
6075
6076
    :ivar ReferenceTypeId:
6077
    :vartype ReferenceTypeId: NodeId
6078
    :ivar IsForward:
6079
    :vartype IsForward: Boolean
6080
    :ivar NodeId:
6081
    :vartype NodeId: ExpandedNodeId
6082
    :ivar BrowseName:
6083
    :vartype BrowseName: QualifiedName
6084
    :ivar DisplayName:
6085
    :vartype DisplayName: LocalizedText
6086
    :ivar NodeClass:
6087
    :vartype NodeClass: NodeClass
6088
    :ivar TypeDefinition:
6089
    :vartype TypeDefinition: ExpandedNodeId
6090
    '''
6091
6092 1
    ua_types = {
6093
        'ReferenceTypeId': 'NodeId',
6094
        'IsForward': 'Boolean',
6095
        'NodeId': 'ExpandedNodeId',
6096
        'BrowseName': 'QualifiedName',
6097
        'DisplayName': 'LocalizedText',
6098
        'NodeClass': 'NodeClass',
6099
        'TypeDefinition': 'ExpandedNodeId',
6100
               }
6101
6102 1
    def __init__(self, binary=None):
6103 1
        if binary is not None:
6104 1
            self._binary_init(binary)
6105 1
            self._freeze = True
6106 1
            return
6107 1
        self.ReferenceTypeId = NodeId()
6108 1
        self.IsForward = True
6109 1
        self.NodeId = ExpandedNodeId()
6110 1
        self.BrowseName = QualifiedName()
6111 1
        self.DisplayName = LocalizedText()
6112 1
        self.NodeClass = NodeClass(0)
6113 1
        self.TypeDefinition = ExpandedNodeId()
6114 1
        self._freeze = True
6115
6116 1
    def to_binary(self):
6117 1
        packet = []
6118 1
        packet.append(self.ReferenceTypeId.to_binary())
6119 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsForward))
6120 1
        packet.append(self.NodeId.to_binary())
6121 1
        packet.append(self.BrowseName.to_binary())
6122 1
        packet.append(self.DisplayName.to_binary())
6123 1
        packet.append(uabin.Primitives.UInt32.pack(self.NodeClass.value))
6124 1
        packet.append(self.TypeDefinition.to_binary())
6125 1
        return b''.join(packet)
6126
6127 1
    @staticmethod
6128
    def from_binary(data):
6129 1
        return ReferenceDescription(data)
6130
6131 1
    def _binary_init(self, data):
6132 1
        self.ReferenceTypeId = NodeId.from_binary(data)
6133 1
        self.IsForward = uabin.Primitives.Boolean.unpack(data)
6134 1
        self.NodeId = ExpandedNodeId.from_binary(data)
6135 1
        self.BrowseName = QualifiedName.from_binary(data)
6136 1
        self.DisplayName = LocalizedText.from_binary(data)
6137 1
        self.NodeClass = NodeClass(uabin.Primitives.UInt32.unpack(data))
6138 1
        self.TypeDefinition = ExpandedNodeId.from_binary(data)
6139
6140 1
    def __str__(self):
6141
        return 'ReferenceDescription(' + 'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
6142
               'IsForward:' + str(self.IsForward) + ', ' + \
6143
               'NodeId:' + str(self.NodeId) + ', ' + \
6144
               'BrowseName:' + str(self.BrowseName) + ', ' + \
6145
               'DisplayName:' + str(self.DisplayName) + ', ' + \
6146
               'NodeClass:' + str(self.NodeClass) + ', ' + \
6147
               'TypeDefinition:' + str(self.TypeDefinition) + ')'
6148
6149 1
    __repr__ = __str__
6150 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6151
6152 1
class BrowseResult(FrozenClass):
6153
    '''
6154
    The result of a browse operation.
6155
6156
    :ivar StatusCode:
6157
    :vartype StatusCode: StatusCode
6158
    :ivar ContinuationPoint:
6159
    :vartype ContinuationPoint: ByteString
6160
    :ivar References:
6161
    :vartype References: ReferenceDescription
6162
    '''
6163
6164 1
    ua_types = {
6165
        'StatusCode': 'StatusCode',
6166
        'ContinuationPoint': 'ByteString',
6167
        'References': 'ReferenceDescription',
6168
               }
6169
6170 1
    def __init__(self, binary=None):
6171 1
        if binary is not None:
6172 1
            self._binary_init(binary)
6173 1
            self._freeze = True
6174 1
            return
6175 1
        self.StatusCode = StatusCode()
6176 1
        self.ContinuationPoint = None
6177 1
        self.References = []
6178 1
        self._freeze = True
6179
6180 1
    def to_binary(self):
6181 1
        packet = []
6182 1
        packet.append(self.StatusCode.to_binary())
6183 1
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
6184 1
        packet.append(uabin.Primitives.Int32.pack(len(self.References)))
6185 1
        for fieldname in self.References:
6186 1
            packet.append(fieldname.to_binary())
6187 1
        return b''.join(packet)
6188
6189 1
    @staticmethod
6190
    def from_binary(data):
6191 1
        return BrowseResult(data)
6192
6193 1
    def _binary_init(self, data):
6194 1
        self.StatusCode = StatusCode.from_binary(data)
6195 1
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
6196 1
        length = uabin.Primitives.Int32.unpack(data)
6197 1
        array = []
6198 1
        if length != -1:
6199 1
            for _ in range(0, length):
6200 1
                array.append(ReferenceDescription.from_binary(data))
6201 1
        self.References = array
6202
6203 1
    def __str__(self):
6204
        return 'BrowseResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
6205
               'ContinuationPoint:' + str(self.ContinuationPoint) + ', ' + \
6206
               'References:' + str(self.References) + ')'
6207
6208 1
    __repr__ = __str__
6209 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6210
6211 1
class BrowseParameters(FrozenClass):
6212
    '''
6213
    :ivar View:
6214
    :vartype View: ViewDescription
6215
    :ivar RequestedMaxReferencesPerNode:
6216
    :vartype RequestedMaxReferencesPerNode: UInt32
6217
    :ivar NodesToBrowse:
6218
    :vartype NodesToBrowse: BrowseDescription
6219
    '''
6220
6221 1
    ua_types = {
6222
        'View': 'ViewDescription',
6223
        'RequestedMaxReferencesPerNode': 'UInt32',
6224
        'NodesToBrowse': 'BrowseDescription',
6225
               }
6226
6227 1
    def __init__(self, binary=None):
6228 1
        if binary is not None:
6229 1
            self._binary_init(binary)
6230 1
            self._freeze = True
6231 1
            return
6232 1
        self.View = ViewDescription()
6233 1
        self.RequestedMaxReferencesPerNode = 0
6234 1
        self.NodesToBrowse = []
6235 1
        self._freeze = True
6236
6237 1
    def to_binary(self):
6238 1
        packet = []
6239 1
        packet.append(self.View.to_binary())
6240 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedMaxReferencesPerNode))
6241 1
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToBrowse)))
6242 1
        for fieldname in self.NodesToBrowse:
6243 1
            packet.append(fieldname.to_binary())
6244 1
        return b''.join(packet)
6245
6246 1
    @staticmethod
6247
    def from_binary(data):
6248 1
        return BrowseParameters(data)
6249
6250 1
    def _binary_init(self, data):
6251 1
        self.View = ViewDescription.from_binary(data)
6252 1
        self.RequestedMaxReferencesPerNode = uabin.Primitives.UInt32.unpack(data)
6253 1
        length = uabin.Primitives.Int32.unpack(data)
6254 1
        array = []
6255 1
        if length != -1:
6256 1
            for _ in range(0, length):
6257 1
                array.append(BrowseDescription.from_binary(data))
6258 1
        self.NodesToBrowse = array
6259
6260 1
    def __str__(self):
6261
        return 'BrowseParameters(' + 'View:' + str(self.View) + ', ' + \
6262
               'RequestedMaxReferencesPerNode:' + str(self.RequestedMaxReferencesPerNode) + ', ' + \
6263
               'NodesToBrowse:' + str(self.NodesToBrowse) + ')'
6264
6265 1
    __repr__ = __str__
6266
6267
6268 1
class BrowseRequest(FrozenClass):
6269
    '''
6270
    Browse the references for one or more nodes from the server address space.
6271
6272
    :ivar TypeId:
6273
    :vartype TypeId: NodeId
6274
    :ivar RequestHeader:
6275
    :vartype RequestHeader: RequestHeader
6276
    :ivar Parameters:
6277
    :vartype Parameters: BrowseParameters
6278
    '''
6279
6280 1
    ua_types = {
6281
        'TypeId': 'NodeId',
6282
        'RequestHeader': 'RequestHeader',
6283
        'Parameters': 'BrowseParameters',
6284
               }
6285
6286 1
    def __init__(self, binary=None):
6287 1
        if binary is not None:
6288
            self._binary_init(binary)
6289
            self._freeze = True
6290
            return
6291 1
        self.TypeId = FourByteNodeId(ObjectIds.BrowseRequest_Encoding_DefaultBinary)
6292 1
        self.RequestHeader = RequestHeader()
6293 1
        self.Parameters = BrowseParameters()
6294 1
        self._freeze = True
6295
6296 1
    def to_binary(self):
6297 1
        packet = []
6298 1
        packet.append(self.TypeId.to_binary())
6299 1
        packet.append(self.RequestHeader.to_binary())
6300 1
        packet.append(self.Parameters.to_binary())
6301 1
        return b''.join(packet)
6302
6303 1
    @staticmethod
6304
    def from_binary(data):
6305
        return BrowseRequest(data)
6306
6307 1
    def _binary_init(self, data):
6308
        self.TypeId = NodeId.from_binary(data)
6309
        self.RequestHeader = RequestHeader.from_binary(data)
6310
        self.Parameters = BrowseParameters.from_binary(data)
6311
6312 1
    def __str__(self):
6313
        return 'BrowseRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6314
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
6315
               'Parameters:' + str(self.Parameters) + ')'
6316
6317 1
    __repr__ = __str__
6318
6319
6320 1
class BrowseResponse(FrozenClass):
6321
    '''
6322
    Browse the references for one or more nodes from the server address space.
6323
6324
    :ivar TypeId:
6325
    :vartype TypeId: NodeId
6326
    :ivar ResponseHeader:
6327
    :vartype ResponseHeader: ResponseHeader
6328
    :ivar Results:
6329
    :vartype Results: BrowseResult
6330
    :ivar DiagnosticInfos:
6331
    :vartype DiagnosticInfos: DiagnosticInfo
6332
    '''
6333
6334 1
    ua_types = {
6335
        'TypeId': 'NodeId',
6336
        'ResponseHeader': 'ResponseHeader',
6337
        'Results': 'BrowseResult',
6338
        'DiagnosticInfos': 'DiagnosticInfo',
6339
               }
6340
6341 1
    def __init__(self, binary=None):
6342 1
        if binary is not None:
6343 1
            self._binary_init(binary)
6344 1
            self._freeze = True
6345 1
            return
6346 1
        self.TypeId = FourByteNodeId(ObjectIds.BrowseResponse_Encoding_DefaultBinary)
6347 1
        self.ResponseHeader = ResponseHeader()
6348 1
        self.Results = []
6349 1
        self.DiagnosticInfos = []
6350 1
        self._freeze = True
6351
6352 1
    def to_binary(self):
6353 1
        packet = []
6354 1
        packet.append(self.TypeId.to_binary())
6355 1
        packet.append(self.ResponseHeader.to_binary())
6356 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
6357 1
        for fieldname in self.Results:
6358 1
            packet.append(fieldname.to_binary())
6359 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
6360 1
        for fieldname in self.DiagnosticInfos:
6361
            packet.append(fieldname.to_binary())
6362 1
        return b''.join(packet)
6363
6364 1
    @staticmethod
6365
    def from_binary(data):
6366 1
        return BrowseResponse(data)
6367
6368 1
    def _binary_init(self, data):
6369 1
        self.TypeId = NodeId.from_binary(data)
6370 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
6371 1
        length = uabin.Primitives.Int32.unpack(data)
6372 1
        array = []
6373 1
        if length != -1:
6374 1
            for _ in range(0, length):
6375 1
                array.append(BrowseResult.from_binary(data))
6376 1
        self.Results = array
6377 1
        length = uabin.Primitives.Int32.unpack(data)
6378 1
        array = []
6379 1
        if length != -1:
6380 1
            for _ in range(0, length):
6381
                array.append(DiagnosticInfo.from_binary(data))
6382 1
        self.DiagnosticInfos = array
6383
6384 1
    def __str__(self):
6385
        return 'BrowseResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6386
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
6387
               'Results:' + str(self.Results) + ', ' + \
6388
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
6389
6390 1
    __repr__ = __str__
6391
6392
6393 1
class BrowseNextParameters(FrozenClass):
6394
    '''
6395
    :ivar ReleaseContinuationPoints:
6396
    :vartype ReleaseContinuationPoints: Boolean
6397
    :ivar ContinuationPoints:
6398
    :vartype ContinuationPoints: ByteString
6399
    '''
6400
6401 1
    ua_types = {
6402
        'ReleaseContinuationPoints': 'Boolean',
6403
        'ContinuationPoints': 'ByteString',
6404
               }
6405
6406 1
    def __init__(self, binary=None):
6407
        if binary is not None:
6408
            self._binary_init(binary)
6409
            self._freeze = True
6410
            return
6411
        self.ReleaseContinuationPoints = True
6412
        self.ContinuationPoints = []
6413
        self._freeze = True
6414
6415 1
    def to_binary(self):
6416
        packet = []
6417
        packet.append(uabin.Primitives.Boolean.pack(self.ReleaseContinuationPoints))
6418
        packet.append(uabin.Primitives.Int32.pack(len(self.ContinuationPoints)))
6419
        for fieldname in self.ContinuationPoints:
6420
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
6421
        return b''.join(packet)
6422
6423 1
    @staticmethod
6424
    def from_binary(data):
6425
        return BrowseNextParameters(data)
6426
6427 1
    def _binary_init(self, data):
6428
        self.ReleaseContinuationPoints = uabin.Primitives.Boolean.unpack(data)
6429
        self.ContinuationPoints = uabin.Primitives.ByteString.unpack_array(data)
6430
6431 1
    def __str__(self):
6432
        return 'BrowseNextParameters(' + 'ReleaseContinuationPoints:' + str(self.ReleaseContinuationPoints) + ', ' + \
6433
               'ContinuationPoints:' + str(self.ContinuationPoints) + ')'
6434
6435 1
    __repr__ = __str__
6436
6437
6438 1
class BrowseNextRequest(FrozenClass):
6439
    '''
6440
    Continues one or more browse operations.
6441
6442
    :ivar TypeId:
6443
    :vartype TypeId: NodeId
6444
    :ivar RequestHeader:
6445
    :vartype RequestHeader: RequestHeader
6446
    :ivar Parameters:
6447
    :vartype Parameters: BrowseNextParameters
6448
    '''
6449
6450 1
    ua_types = {
6451
        'TypeId': 'NodeId',
6452
        'RequestHeader': 'RequestHeader',
6453
        'Parameters': 'BrowseNextParameters',
6454
               }
6455
6456 1
    def __init__(self, binary=None):
6457
        if binary is not None:
6458
            self._binary_init(binary)
6459
            self._freeze = True
6460
            return
6461
        self.TypeId = FourByteNodeId(ObjectIds.BrowseNextRequest_Encoding_DefaultBinary)
6462
        self.RequestHeader = RequestHeader()
6463
        self.Parameters = BrowseNextParameters()
6464
        self._freeze = True
6465
6466 1
    def to_binary(self):
6467
        packet = []
6468
        packet.append(self.TypeId.to_binary())
6469
        packet.append(self.RequestHeader.to_binary())
6470
        packet.append(self.Parameters.to_binary())
6471
        return b''.join(packet)
6472
6473 1
    @staticmethod
6474
    def from_binary(data):
6475
        return BrowseNextRequest(data)
6476
6477 1
    def _binary_init(self, data):
6478
        self.TypeId = NodeId.from_binary(data)
6479
        self.RequestHeader = RequestHeader.from_binary(data)
6480
        self.Parameters = BrowseNextParameters.from_binary(data)
6481
6482 1
    def __str__(self):
6483
        return 'BrowseNextRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6484
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
6485
               'Parameters:' + str(self.Parameters) + ')'
6486
6487 1
    __repr__ = __str__
6488 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6489
6490 1
class BrowseNextResult(FrozenClass):
6491
    '''
6492
    :ivar Results:
6493
    :vartype Results: BrowseResult
6494
    :ivar DiagnosticInfos:
6495
    :vartype DiagnosticInfos: DiagnosticInfo
6496
    '''
6497
6498 1
    ua_types = {
6499
        'Results': 'BrowseResult',
6500
        'DiagnosticInfos': 'DiagnosticInfo',
6501
               }
6502
6503 1
    def __init__(self, binary=None):
6504
        if binary is not None:
6505
            self._binary_init(binary)
6506
            self._freeze = True
6507
            return
6508
        self.Results = []
6509
        self.DiagnosticInfos = []
6510
        self._freeze = True
6511
6512 1
    def to_binary(self):
6513
        packet = []
6514
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
6515
        for fieldname in self.Results:
6516
            packet.append(fieldname.to_binary())
6517
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
6518
        for fieldname in self.DiagnosticInfos:
6519
            packet.append(fieldname.to_binary())
6520
        return b''.join(packet)
6521
6522 1
    @staticmethod
6523
    def from_binary(data):
6524
        return BrowseNextResult(data)
6525
6526 1
    def _binary_init(self, data):
6527
        length = uabin.Primitives.Int32.unpack(data)
6528
        array = []
6529
        if length != -1:
6530
            for _ in range(0, length):
6531
                array.append(BrowseResult.from_binary(data))
6532
        self.Results = array
6533
        length = uabin.Primitives.Int32.unpack(data)
6534
        array = []
6535
        if length != -1:
6536
            for _ in range(0, length):
6537
                array.append(DiagnosticInfo.from_binary(data))
6538
        self.DiagnosticInfos = array
6539
6540 1
    def __str__(self):
6541
        return 'BrowseNextResult(' + 'Results:' + str(self.Results) + ', ' + \
6542
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
6543
6544 1
    __repr__ = __str__
6545
6546
6547 1
class BrowseNextResponse(FrozenClass):
6548
    '''
6549
    Continues one or more browse operations.
6550
6551
    :ivar TypeId:
6552
    :vartype TypeId: NodeId
6553
    :ivar ResponseHeader:
6554
    :vartype ResponseHeader: ResponseHeader
6555
    :ivar Parameters:
6556
    :vartype Parameters: BrowseNextResult
6557
    '''
6558
6559 1
    ua_types = {
6560
        'TypeId': 'NodeId',
6561
        'ResponseHeader': 'ResponseHeader',
6562
        'Parameters': 'BrowseNextResult',
6563 View Code Duplication
               }
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
6564
6565 1
    def __init__(self, binary=None):
6566
        if binary is not None:
6567
            self._binary_init(binary)
6568
            self._freeze = True
6569
            return
6570
        self.TypeId = FourByteNodeId(ObjectIds.BrowseNextResponse_Encoding_DefaultBinary)
6571
        self.ResponseHeader = ResponseHeader()
6572
        self.Parameters = BrowseNextResult()
6573
        self._freeze = True
6574
6575 1
    def to_binary(self):
6576
        packet = []
6577
        packet.append(self.TypeId.to_binary())
6578
        packet.append(self.ResponseHeader.to_binary())
6579
        packet.append(self.Parameters.to_binary())
6580
        return b''.join(packet)
6581
6582 1
    @staticmethod
6583
    def from_binary(data):
6584
        return BrowseNextResponse(data)
6585
6586 1
    def _binary_init(self, data):
6587
        self.TypeId = NodeId.from_binary(data)
6588
        self.ResponseHeader = ResponseHeader.from_binary(data)
6589
        self.Parameters = BrowseNextResult.from_binary(data)
6590
6591 1
    def __str__(self):
6592
        return 'BrowseNextResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6593
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
6594
               'Parameters:' + str(self.Parameters) + ')'
6595
6596 1
    __repr__ = __str__
6597
6598
6599 1
class RelativePathElement(FrozenClass):
6600
    '''
6601
    An element in a relative path.
6602
6603
    :ivar ReferenceTypeId:
6604
    :vartype ReferenceTypeId: NodeId
6605
    :ivar IsInverse:
6606
    :vartype IsInverse: Boolean
6607
    :ivar IncludeSubtypes:
6608
    :vartype IncludeSubtypes: Boolean
6609
    :ivar TargetName:
6610
    :vartype TargetName: QualifiedName
6611
    '''
6612
6613 1
    ua_types = {
6614
        'ReferenceTypeId': 'NodeId',
6615
        'IsInverse': 'Boolean',
6616
        'IncludeSubtypes': 'Boolean',
6617
        'TargetName': 'QualifiedName',
6618
               }
6619
6620 1
    def __init__(self, binary=None):
6621 1
        if binary is not None:
6622 1
            self._binary_init(binary)
6623 1
            self._freeze = True
6624 1
            return
6625 1
        self.ReferenceTypeId = NodeId()
6626 1
        self.IsInverse = True
6627 1
        self.IncludeSubtypes = True
6628 1
        self.TargetName = QualifiedName()
6629 1
        self._freeze = True
6630
6631 1
    def to_binary(self):
6632 1
        packet = []
6633 1
        packet.append(self.ReferenceTypeId.to_binary())
6634 1
        packet.append(uabin.Primitives.Boolean.pack(self.IsInverse))
6635 1
        packet.append(uabin.Primitives.Boolean.pack(self.IncludeSubtypes))
6636 1
        packet.append(self.TargetName.to_binary())
6637 1
        return b''.join(packet)
6638
6639 1
    @staticmethod
6640
    def from_binary(data):
6641 1
        return RelativePathElement(data)
6642
6643 1
    def _binary_init(self, data):
6644 1
        self.ReferenceTypeId = NodeId.from_binary(data)
6645 1
        self.IsInverse = uabin.Primitives.Boolean.unpack(data)
6646 1
        self.IncludeSubtypes = uabin.Primitives.Boolean.unpack(data)
6647 1
        self.TargetName = QualifiedName.from_binary(data)
6648
6649 1
    def __str__(self):
6650
        return 'RelativePathElement(' + 'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
6651
               'IsInverse:' + str(self.IsInverse) + ', ' + \
6652
               'IncludeSubtypes:' + str(self.IncludeSubtypes) + ', ' + \
6653
               'TargetName:' + str(self.TargetName) + ')'
6654
6655 1
    __repr__ = __str__
6656
6657
6658 1
class RelativePath(FrozenClass):
6659
    '''
6660
    A relative path constructed from reference types and browse names.
6661
6662
    :ivar Elements:
6663
    :vartype Elements: RelativePathElement
6664
    '''
6665
6666 1
    ua_types = {
6667
        'Elements': 'RelativePathElement',
6668
               }
6669
6670 1
    def __init__(self, binary=None):
6671 1
        if binary is not None:
6672 1
            self._binary_init(binary)
6673 1
            self._freeze = True
6674 1
            return
6675 1
        self.Elements = []
6676 1
        self._freeze = True
6677
6678 1
    def to_binary(self):
6679 1
        packet = []
6680 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Elements)))
6681 1
        for fieldname in self.Elements:
6682 1
            packet.append(fieldname.to_binary())
6683 1
        return b''.join(packet)
6684
6685 1
    @staticmethod
6686
    def from_binary(data):
6687 1
        return RelativePath(data)
6688
6689 1
    def _binary_init(self, data):
6690 1
        length = uabin.Primitives.Int32.unpack(data)
6691 1
        array = []
6692 1
        if length != -1:
6693 1
            for _ in range(0, length):
6694 1
                array.append(RelativePathElement.from_binary(data))
6695 1
        self.Elements = array
6696
6697 1
    def __str__(self):
6698
        return 'RelativePath(' + 'Elements:' + str(self.Elements) + ')'
6699
6700 1
    __repr__ = __str__
6701
6702
6703 1
class BrowsePath(FrozenClass):
6704
    '''
6705
    A request to translate a path into a node id.
6706
6707
    :ivar StartingNode:
6708
    :vartype StartingNode: NodeId
6709
    :ivar RelativePath:
6710
    :vartype RelativePath: RelativePath
6711
    '''
6712
6713 1
    ua_types = {
6714
        'StartingNode': 'NodeId',
6715
        'RelativePath': 'RelativePath',
6716
               }
6717
6718 1
    def __init__(self, binary=None):
6719 1
        if binary is not None:
6720 1
            self._binary_init(binary)
6721 1
            self._freeze = True
6722 1
            return
6723 1
        self.StartingNode = NodeId()
6724 1
        self.RelativePath = RelativePath()
6725 1
        self._freeze = True
6726
6727 1
    def to_binary(self):
6728 1
        packet = []
6729 1
        packet.append(self.StartingNode.to_binary())
6730 1
        packet.append(self.RelativePath.to_binary())
6731 1
        return b''.join(packet)
6732
6733 1
    @staticmethod
6734
    def from_binary(data):
6735 1
        return BrowsePath(data)
6736
6737 1
    def _binary_init(self, data):
6738 1
        self.StartingNode = NodeId.from_binary(data)
6739 1
        self.RelativePath = RelativePath.from_binary(data)
6740
6741 1
    def __str__(self):
6742
        return 'BrowsePath(' + 'StartingNode:' + str(self.StartingNode) + ', ' + \
6743
               'RelativePath:' + str(self.RelativePath) + ')'
6744
6745 1
    __repr__ = __str__
6746
6747
6748 1
class BrowsePathTarget(FrozenClass):
6749
    '''
6750
    The target of the translated path.
6751
6752
    :ivar TargetId:
6753
    :vartype TargetId: ExpandedNodeId
6754
    :ivar RemainingPathIndex:
6755
    :vartype RemainingPathIndex: UInt32
6756
    '''
6757
6758 1
    ua_types = {
6759
        'TargetId': 'ExpandedNodeId',
6760
        'RemainingPathIndex': 'UInt32',
6761
               }
6762
6763 1
    def __init__(self, binary=None):
6764 1
        if binary is not None:
6765 1
            self._binary_init(binary)
6766 1
            self._freeze = True
6767 1
            return
6768 1
        self.TargetId = ExpandedNodeId()
6769 1
        self.RemainingPathIndex = 0
6770 1
        self._freeze = True
6771
6772 1
    def to_binary(self):
6773 1
        packet = []
6774 1
        packet.append(self.TargetId.to_binary())
6775 1
        packet.append(uabin.Primitives.UInt32.pack(self.RemainingPathIndex))
6776 1
        return b''.join(packet)
6777
6778 1
    @staticmethod
6779
    def from_binary(data):
6780 1
        return BrowsePathTarget(data)
6781
6782 1
    def _binary_init(self, data):
6783 1
        self.TargetId = ExpandedNodeId.from_binary(data)
6784 1
        self.RemainingPathIndex = uabin.Primitives.UInt32.unpack(data)
6785
6786 1
    def __str__(self):
6787
        return 'BrowsePathTarget(' + 'TargetId:' + str(self.TargetId) + ', ' + \
6788
               'RemainingPathIndex:' + str(self.RemainingPathIndex) + ')'
6789
6790 1
    __repr__ = __str__
6791
6792
6793 1
class BrowsePathResult(FrozenClass):
6794
    '''
6795
    The result of a translate opearation.
6796
6797
    :ivar StatusCode:
6798
    :vartype StatusCode: StatusCode
6799
    :ivar Targets:
6800
    :vartype Targets: BrowsePathTarget
6801
    '''
6802
6803 1
    ua_types = {
6804
        'StatusCode': 'StatusCode',
6805
        'Targets': 'BrowsePathTarget',
6806
               }
6807
6808 1
    def __init__(self, binary=None):
6809 1
        if binary is not None:
6810 1
            self._binary_init(binary)
6811 1
            self._freeze = True
6812 1
            return
6813 1
        self.StatusCode = StatusCode()
6814 1
        self.Targets = []
6815 1
        self._freeze = True
6816
6817 1
    def to_binary(self):
6818 1
        packet = []
6819 1
        packet.append(self.StatusCode.to_binary())
6820 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Targets)))
6821 1
        for fieldname in self.Targets:
6822 1
            packet.append(fieldname.to_binary())
6823 1
        return b''.join(packet)
6824
6825 1
    @staticmethod
6826
    def from_binary(data):
6827 1
        return BrowsePathResult(data)
6828
6829 1
    def _binary_init(self, data):
6830 1
        self.StatusCode = StatusCode.from_binary(data)
6831 1
        length = uabin.Primitives.Int32.unpack(data)
6832 1
        array = []
6833 1
        if length != -1:
6834 1
            for _ in range(0, length):
6835 1
                array.append(BrowsePathTarget.from_binary(data))
6836 1
        self.Targets = array
6837
6838 1
    def __str__(self):
6839
        return 'BrowsePathResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
6840
               'Targets:' + str(self.Targets) + ')'
6841
6842 1
    __repr__ = __str__
6843
6844
6845 1
class TranslateBrowsePathsToNodeIdsParameters(FrozenClass):
6846
    '''
6847
    :ivar BrowsePaths:
6848
    :vartype BrowsePaths: BrowsePath
6849
    '''
6850
6851 1
    ua_types = {
6852
        'BrowsePaths': 'BrowsePath',
6853
               }
6854
6855 1
    def __init__(self, binary=None):
6856 1
        if binary is not None:
6857 1
            self._binary_init(binary)
6858 1
            self._freeze = True
6859 1
            return
6860 1
        self.BrowsePaths = []
6861 1
        self._freeze = True
6862
6863 1
    def to_binary(self):
6864 1
        packet = []
6865 1
        packet.append(uabin.Primitives.Int32.pack(len(self.BrowsePaths)))
6866 1
        for fieldname in self.BrowsePaths:
6867 1
            packet.append(fieldname.to_binary())
6868 1
        return b''.join(packet)
6869
6870 1
    @staticmethod
6871
    def from_binary(data):
6872 1
        return TranslateBrowsePathsToNodeIdsParameters(data)
6873
6874 1
    def _binary_init(self, data):
6875 1
        length = uabin.Primitives.Int32.unpack(data)
6876 1
        array = []
6877 1
        if length != -1:
6878 1
            for _ in range(0, length):
6879 1
                array.append(BrowsePath.from_binary(data))
6880 1
        self.BrowsePaths = array
6881
6882 1
    def __str__(self):
6883
        return 'TranslateBrowsePathsToNodeIdsParameters(' + 'BrowsePaths:' + str(self.BrowsePaths) + ')'
6884
6885 1
    __repr__ = __str__
6886
6887
6888 1
class TranslateBrowsePathsToNodeIdsRequest(FrozenClass):
6889
    '''
6890
    Translates one or more paths in the server address space.
6891
6892
    :ivar TypeId:
6893
    :vartype TypeId: NodeId
6894
    :ivar RequestHeader:
6895
    :vartype RequestHeader: RequestHeader
6896
    :ivar Parameters:
6897
    :vartype Parameters: TranslateBrowsePathsToNodeIdsParameters
6898
    '''
6899
6900 1
    ua_types = {
6901
        'TypeId': 'NodeId',
6902
        'RequestHeader': 'RequestHeader',
6903
        'Parameters': 'TranslateBrowsePathsToNodeIdsParameters',
6904
               }
6905
6906 1
    def __init__(self, binary=None):
6907 1
        if binary is not None:
6908
            self._binary_init(binary)
6909
            self._freeze = True
6910
            return
6911 1
        self.TypeId = FourByteNodeId(ObjectIds.TranslateBrowsePathsToNodeIdsRequest_Encoding_DefaultBinary)
6912 1
        self.RequestHeader = RequestHeader()
6913 1
        self.Parameters = TranslateBrowsePathsToNodeIdsParameters()
6914 1
        self._freeze = True
6915
6916 1
    def to_binary(self):
6917 1
        packet = []
6918 1
        packet.append(self.TypeId.to_binary())
6919 1
        packet.append(self.RequestHeader.to_binary())
6920 1
        packet.append(self.Parameters.to_binary())
6921 1
        return b''.join(packet)
6922
6923 1
    @staticmethod
6924
    def from_binary(data):
6925
        return TranslateBrowsePathsToNodeIdsRequest(data)
6926
6927 1
    def _binary_init(self, data):
6928
        self.TypeId = NodeId.from_binary(data)
6929
        self.RequestHeader = RequestHeader.from_binary(data)
6930
        self.Parameters = TranslateBrowsePathsToNodeIdsParameters.from_binary(data)
6931
6932 1
    def __str__(self):
6933
        return 'TranslateBrowsePathsToNodeIdsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6934
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
6935
               'Parameters:' + str(self.Parameters) + ')'
6936
6937 1
    __repr__ = __str__
6938
6939
6940 1
class TranslateBrowsePathsToNodeIdsResponse(FrozenClass):
6941
    '''
6942
    Translates one or more paths in the server address space.
6943
6944
    :ivar TypeId:
6945
    :vartype TypeId: NodeId
6946
    :ivar ResponseHeader:
6947
    :vartype ResponseHeader: ResponseHeader
6948
    :ivar Results:
6949
    :vartype Results: BrowsePathResult
6950
    :ivar DiagnosticInfos:
6951
    :vartype DiagnosticInfos: DiagnosticInfo
6952
    '''
6953
6954 1
    ua_types = {
6955
        'TypeId': 'NodeId',
6956
        'ResponseHeader': 'ResponseHeader',
6957
        'Results': 'BrowsePathResult',
6958
        'DiagnosticInfos': 'DiagnosticInfo',
6959
               }
6960
6961 1
    def __init__(self, binary=None):
6962 1
        if binary is not None:
6963 1
            self._binary_init(binary)
6964 1
            self._freeze = True
6965 1
            return
6966 1
        self.TypeId = FourByteNodeId(ObjectIds.TranslateBrowsePathsToNodeIdsResponse_Encoding_DefaultBinary)
6967 1
        self.ResponseHeader = ResponseHeader()
6968 1
        self.Results = []
6969 1
        self.DiagnosticInfos = []
6970 1
        self._freeze = True
6971
6972 1
    def to_binary(self):
6973 1
        packet = []
6974 1
        packet.append(self.TypeId.to_binary())
6975 1
        packet.append(self.ResponseHeader.to_binary())
6976 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
6977 1
        for fieldname in self.Results:
6978 1
            packet.append(fieldname.to_binary())
6979 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
6980 1
        for fieldname in self.DiagnosticInfos:
6981
            packet.append(fieldname.to_binary())
6982 1
        return b''.join(packet)
6983
6984 1
    @staticmethod
6985
    def from_binary(data):
6986 1
        return TranslateBrowsePathsToNodeIdsResponse(data)
6987
6988 1
    def _binary_init(self, data):
6989 1
        self.TypeId = NodeId.from_binary(data)
6990 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
6991 1
        length = uabin.Primitives.Int32.unpack(data)
6992 1
        array = []
6993 1
        if length != -1:
6994 1
            for _ in range(0, length):
6995 1
                array.append(BrowsePathResult.from_binary(data))
6996 1
        self.Results = array
6997 1
        length = uabin.Primitives.Int32.unpack(data)
6998 1
        array = []
6999 1
        if length != -1:
7000 1
            for _ in range(0, length):
7001
                array.append(DiagnosticInfo.from_binary(data))
7002 1
        self.DiagnosticInfos = array
7003
7004 1
    def __str__(self):
7005
        return 'TranslateBrowsePathsToNodeIdsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7006
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
7007
               'Results:' + str(self.Results) + ', ' + \
7008
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
7009
7010 1
    __repr__ = __str__
7011
7012
7013 1
class RegisterNodesParameters(FrozenClass):
7014
    '''
7015
    :ivar NodesToRegister:
7016
    :vartype NodesToRegister: NodeId
7017
    '''
7018
7019 1
    ua_types = {
7020
        'NodesToRegister': 'NodeId',
7021
               }
7022
7023 1
    def __init__(self, binary=None):
7024
        if binary is not None:
7025
            self._binary_init(binary)
7026
            self._freeze = True
7027
            return
7028
        self.NodesToRegister = []
7029
        self._freeze = True
7030
7031 1
    def to_binary(self):
7032
        packet = []
7033
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToRegister)))
7034
        for fieldname in self.NodesToRegister:
7035
            packet.append(fieldname.to_binary())
7036
        return b''.join(packet)
7037
7038 1
    @staticmethod
7039
    def from_binary(data):
7040
        return RegisterNodesParameters(data)
7041
7042 1
    def _binary_init(self, data):
7043
        length = uabin.Primitives.Int32.unpack(data)
7044
        array = []
7045
        if length != -1:
7046
            for _ in range(0, length):
7047
                array.append(NodeId.from_binary(data))
7048
        self.NodesToRegister = array
7049
7050 1
    def __str__(self):
7051
        return 'RegisterNodesParameters(' + 'NodesToRegister:' + str(self.NodesToRegister) + ')'
7052
7053 1
    __repr__ = __str__
7054
7055
7056 1
class RegisterNodesRequest(FrozenClass):
7057
    '''
7058
    Registers one or more nodes for repeated use within a session.
7059
7060
    :ivar TypeId:
7061
    :vartype TypeId: NodeId
7062
    :ivar RequestHeader:
7063
    :vartype RequestHeader: RequestHeader
7064
    :ivar Parameters:
7065
    :vartype Parameters: RegisterNodesParameters
7066
    '''
7067
7068 1
    ua_types = {
7069
        'TypeId': 'NodeId',
7070
        'RequestHeader': 'RequestHeader',
7071
        'Parameters': 'RegisterNodesParameters',
7072
               }
7073
7074 1
    def __init__(self, binary=None):
7075
        if binary is not None:
7076
            self._binary_init(binary)
7077
            self._freeze = True
7078
            return
7079
        self.TypeId = FourByteNodeId(ObjectIds.RegisterNodesRequest_Encoding_DefaultBinary)
7080
        self.RequestHeader = RequestHeader()
7081
        self.Parameters = RegisterNodesParameters()
7082
        self._freeze = True
7083
7084 1
    def to_binary(self):
7085
        packet = []
7086
        packet.append(self.TypeId.to_binary())
7087
        packet.append(self.RequestHeader.to_binary())
7088
        packet.append(self.Parameters.to_binary())
7089
        return b''.join(packet)
7090
7091 1
    @staticmethod
7092
    def from_binary(data):
7093
        return RegisterNodesRequest(data)
7094
7095 1
    def _binary_init(self, data):
7096
        self.TypeId = NodeId.from_binary(data)
7097
        self.RequestHeader = RequestHeader.from_binary(data)
7098
        self.Parameters = RegisterNodesParameters.from_binary(data)
7099
7100 1
    def __str__(self):
7101
        return 'RegisterNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7102
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
7103
               'Parameters:' + str(self.Parameters) + ')'
7104
7105 1
    __repr__ = __str__
7106
7107
7108 1
class RegisterNodesResult(FrozenClass):
7109
    '''
7110
    :ivar RegisteredNodeIds:
7111
    :vartype RegisteredNodeIds: NodeId
7112
    '''
7113
7114 1
    ua_types = {
7115
        'RegisteredNodeIds': 'NodeId',
7116
               }
7117
7118 1
    def __init__(self, binary=None):
7119
        if binary is not None:
7120
            self._binary_init(binary)
7121
            self._freeze = True
7122
            return
7123
        self.RegisteredNodeIds = []
7124
        self._freeze = True
7125
7126 1
    def to_binary(self):
7127
        packet = []
7128
        packet.append(uabin.Primitives.Int32.pack(len(self.RegisteredNodeIds)))
7129
        for fieldname in self.RegisteredNodeIds:
7130
            packet.append(fieldname.to_binary())
7131
        return b''.join(packet)
7132
7133 1
    @staticmethod
7134
    def from_binary(data):
7135
        return RegisterNodesResult(data)
7136
7137 1
    def _binary_init(self, data):
7138
        length = uabin.Primitives.Int32.unpack(data)
7139
        array = []
7140
        if length != -1:
7141
            for _ in range(0, length):
7142
                array.append(NodeId.from_binary(data))
7143
        self.RegisteredNodeIds = array
7144
7145 1
    def __str__(self):
7146
        return 'RegisterNodesResult(' + 'RegisteredNodeIds:' + str(self.RegisteredNodeIds) + ')'
7147
7148 1
    __repr__ = __str__
7149
7150
7151 1
class RegisterNodesResponse(FrozenClass):
7152
    '''
7153
    Registers one or more nodes for repeated use within a session.
7154
7155
    :ivar TypeId:
7156
    :vartype TypeId: NodeId
7157
    :ivar ResponseHeader:
7158
    :vartype ResponseHeader: ResponseHeader
7159
    :ivar Parameters:
7160
    :vartype Parameters: RegisterNodesResult
7161
    '''
7162
7163 1
    ua_types = {
7164
        'TypeId': 'NodeId',
7165
        'ResponseHeader': 'ResponseHeader',
7166
        'Parameters': 'RegisterNodesResult',
7167
               }
7168
7169 1
    def __init__(self, binary=None):
7170
        if binary is not None:
7171
            self._binary_init(binary)
7172
            self._freeze = True
7173
            return
7174
        self.TypeId = FourByteNodeId(ObjectIds.RegisterNodesResponse_Encoding_DefaultBinary)
7175
        self.ResponseHeader = ResponseHeader()
7176
        self.Parameters = RegisterNodesResult()
7177
        self._freeze = True
7178
7179 1
    def to_binary(self):
7180
        packet = []
7181
        packet.append(self.TypeId.to_binary())
7182
        packet.append(self.ResponseHeader.to_binary())
7183
        packet.append(self.Parameters.to_binary())
7184
        return b''.join(packet)
7185
7186 1
    @staticmethod
7187
    def from_binary(data):
7188
        return RegisterNodesResponse(data)
7189
7190 1
    def _binary_init(self, data):
7191
        self.TypeId = NodeId.from_binary(data)
7192
        self.ResponseHeader = ResponseHeader.from_binary(data)
7193
        self.Parameters = RegisterNodesResult.from_binary(data)
7194
7195 1
    def __str__(self):
7196
        return 'RegisterNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7197
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
7198
               'Parameters:' + str(self.Parameters) + ')'
7199
7200 1
    __repr__ = __str__
7201
7202
7203 1
class UnregisterNodesParameters(FrozenClass):
7204
    '''
7205
    :ivar NodesToUnregister:
7206
    :vartype NodesToUnregister: NodeId
7207
    '''
7208
7209 1
    ua_types = {
7210
        'NodesToUnregister': 'NodeId',
7211
               }
7212
7213 1
    def __init__(self, binary=None):
7214
        if binary is not None:
7215
            self._binary_init(binary)
7216
            self._freeze = True
7217
            return
7218
        self.NodesToUnregister = []
7219
        self._freeze = True
7220
7221 1
    def to_binary(self):
7222
        packet = []
7223
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToUnregister)))
7224
        for fieldname in self.NodesToUnregister:
7225
            packet.append(fieldname.to_binary())
7226
        return b''.join(packet)
7227
7228 1
    @staticmethod
7229
    def from_binary(data):
7230
        return UnregisterNodesParameters(data)
7231
7232 1
    def _binary_init(self, data):
7233
        length = uabin.Primitives.Int32.unpack(data)
7234
        array = []
7235
        if length != -1:
7236
            for _ in range(0, length):
7237
                array.append(NodeId.from_binary(data))
7238
        self.NodesToUnregister = array
7239
7240 1
    def __str__(self):
7241
        return 'UnregisterNodesParameters(' + 'NodesToUnregister:' + str(self.NodesToUnregister) + ')'
7242
7243 1
    __repr__ = __str__
7244
7245
7246 1
class UnregisterNodesRequest(FrozenClass):
7247
    '''
7248
    Unregisters one or more previously registered nodes.
7249
7250
    :ivar TypeId:
7251
    :vartype TypeId: NodeId
7252
    :ivar RequestHeader:
7253
    :vartype RequestHeader: RequestHeader
7254
    :ivar Parameters:
7255
    :vartype Parameters: UnregisterNodesParameters
7256
    '''
7257
7258 1
    ua_types = {
7259
        'TypeId': 'NodeId',
7260
        'RequestHeader': 'RequestHeader',
7261
        'Parameters': 'UnregisterNodesParameters',
7262
               }
7263
7264 1
    def __init__(self, binary=None):
7265
        if binary is not None:
7266
            self._binary_init(binary)
7267
            self._freeze = True
7268
            return
7269
        self.TypeId = FourByteNodeId(ObjectIds.UnregisterNodesRequest_Encoding_DefaultBinary)
7270
        self.RequestHeader = RequestHeader()
7271
        self.Parameters = UnregisterNodesParameters()
7272
        self._freeze = True
7273
7274 1
    def to_binary(self):
7275
        packet = []
7276
        packet.append(self.TypeId.to_binary())
7277
        packet.append(self.RequestHeader.to_binary())
7278
        packet.append(self.Parameters.to_binary())
7279
        return b''.join(packet)
7280
7281 1
    @staticmethod
7282
    def from_binary(data):
7283
        return UnregisterNodesRequest(data)
7284
7285 1
    def _binary_init(self, data):
7286
        self.TypeId = NodeId.from_binary(data)
7287
        self.RequestHeader = RequestHeader.from_binary(data)
7288
        self.Parameters = UnregisterNodesParameters.from_binary(data)
7289
7290 1
    def __str__(self):
7291
        return 'UnregisterNodesRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7292
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
7293
               'Parameters:' + str(self.Parameters) + ')'
7294
7295 1
    __repr__ = __str__
7296
7297
7298 1
class UnregisterNodesResponse(FrozenClass):
7299
    '''
7300
    Unregisters one or more previously registered nodes.
7301
7302
    :ivar TypeId:
7303
    :vartype TypeId: NodeId
7304
    :ivar ResponseHeader:
7305
    :vartype ResponseHeader: ResponseHeader
7306
    '''
7307
7308 1
    ua_types = {
7309
        'TypeId': 'NodeId',
7310
        'ResponseHeader': 'ResponseHeader',
7311
               }
7312
7313 1
    def __init__(self, binary=None):
7314
        if binary is not None:
7315
            self._binary_init(binary)
7316
            self._freeze = True
7317
            return
7318
        self.TypeId = FourByteNodeId(ObjectIds.UnregisterNodesResponse_Encoding_DefaultBinary)
7319
        self.ResponseHeader = ResponseHeader()
7320
        self._freeze = True
7321
7322 1
    def to_binary(self):
7323
        packet = []
7324
        packet.append(self.TypeId.to_binary())
7325
        packet.append(self.ResponseHeader.to_binary())
7326
        return b''.join(packet)
7327
7328 1
    @staticmethod
7329
    def from_binary(data):
7330
        return UnregisterNodesResponse(data)
7331
7332 1
    def _binary_init(self, data):
7333
        self.TypeId = NodeId.from_binary(data)
7334
        self.ResponseHeader = ResponseHeader.from_binary(data)
7335
7336 1
    def __str__(self):
7337
        return 'UnregisterNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
7338
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
7339
7340 1
    __repr__ = __str__
7341
7342
7343 1
class EndpointConfiguration(FrozenClass):
7344
    '''
7345
    :ivar OperationTimeout:
7346
    :vartype OperationTimeout: Int32
7347
    :ivar UseBinaryEncoding:
7348
    :vartype UseBinaryEncoding: Boolean
7349
    :ivar MaxStringLength:
7350
    :vartype MaxStringLength: Int32
7351
    :ivar MaxByteStringLength:
7352
    :vartype MaxByteStringLength: Int32
7353
    :ivar MaxArrayLength:
7354
    :vartype MaxArrayLength: Int32
7355
    :ivar MaxMessageSize:
7356
    :vartype MaxMessageSize: Int32
7357
    :ivar MaxBufferSize:
7358
    :vartype MaxBufferSize: Int32
7359
    :ivar ChannelLifetime:
7360
    :vartype ChannelLifetime: Int32
7361
    :ivar SecurityTokenLifetime:
7362
    :vartype SecurityTokenLifetime: Int32
7363
    '''
7364
7365 1
    ua_types = {
7366
        'OperationTimeout': 'Int32',
7367
        'UseBinaryEncoding': 'Boolean',
7368
        'MaxStringLength': 'Int32',
7369
        'MaxByteStringLength': 'Int32',
7370
        'MaxArrayLength': 'Int32',
7371
        'MaxMessageSize': 'Int32',
7372
        'MaxBufferSize': 'Int32',
7373
        'ChannelLifetime': 'Int32',
7374
        'SecurityTokenLifetime': 'Int32',
7375
               }
7376
7377 1
    def __init__(self, binary=None):
7378
        if binary is not None:
7379
            self._binary_init(binary)
7380
            self._freeze = True
7381
            return
7382
        self.OperationTimeout = 0
7383
        self.UseBinaryEncoding = True
7384
        self.MaxStringLength = 0
7385
        self.MaxByteStringLength = 0
7386
        self.MaxArrayLength = 0
7387
        self.MaxMessageSize = 0
7388
        self.MaxBufferSize = 0
7389
        self.ChannelLifetime = 0
7390
        self.SecurityTokenLifetime = 0
7391
        self._freeze = True
7392
7393 1
    def to_binary(self):
7394
        packet = []
7395
        packet.append(uabin.Primitives.Int32.pack(self.OperationTimeout))
7396
        packet.append(uabin.Primitives.Boolean.pack(self.UseBinaryEncoding))
7397
        packet.append(uabin.Primitives.Int32.pack(self.MaxStringLength))
7398
        packet.append(uabin.Primitives.Int32.pack(self.MaxByteStringLength))
7399
        packet.append(uabin.Primitives.Int32.pack(self.MaxArrayLength))
7400
        packet.append(uabin.Primitives.Int32.pack(self.MaxMessageSize))
7401
        packet.append(uabin.Primitives.Int32.pack(self.MaxBufferSize))
7402
        packet.append(uabin.Primitives.Int32.pack(self.ChannelLifetime))
7403
        packet.append(uabin.Primitives.Int32.pack(self.SecurityTokenLifetime))
7404
        return b''.join(packet)
7405
7406 1
    @staticmethod
7407
    def from_binary(data):
7408
        return EndpointConfiguration(data)
7409
7410 1
    def _binary_init(self, data):
7411
        self.OperationTimeout = uabin.Primitives.Int32.unpack(data)
7412
        self.UseBinaryEncoding = uabin.Primitives.Boolean.unpack(data)
7413
        self.MaxStringLength = uabin.Primitives.Int32.unpack(data)
7414
        self.MaxByteStringLength = uabin.Primitives.Int32.unpack(data)
7415
        self.MaxArrayLength = uabin.Primitives.Int32.unpack(data)
7416
        self.MaxMessageSize = uabin.Primitives.Int32.unpack(data)
7417
        self.MaxBufferSize = uabin.Primitives.Int32.unpack(data)
7418
        self.ChannelLifetime = uabin.Primitives.Int32.unpack(data)
7419
        self.SecurityTokenLifetime = uabin.Primitives.Int32.unpack(data)
7420
7421 1
    def __str__(self):
7422
        return 'EndpointConfiguration(' + 'OperationTimeout:' + str(self.OperationTimeout) + ', ' + \
7423
               'UseBinaryEncoding:' + str(self.UseBinaryEncoding) + ', ' + \
7424
               'MaxStringLength:' + str(self.MaxStringLength) + ', ' + \
7425
               'MaxByteStringLength:' + str(self.MaxByteStringLength) + ', ' + \
7426
               'MaxArrayLength:' + str(self.MaxArrayLength) + ', ' + \
7427
               'MaxMessageSize:' + str(self.MaxMessageSize) + ', ' + \
7428
               'MaxBufferSize:' + str(self.MaxBufferSize) + ', ' + \
7429
               'ChannelLifetime:' + str(self.ChannelLifetime) + ', ' + \
7430
               'SecurityTokenLifetime:' + str(self.SecurityTokenLifetime) + ')'
7431
7432 1
    __repr__ = __str__
7433
7434
7435 1
class SupportedProfile(FrozenClass):
7436
    '''
7437 View Code Duplication
    :ivar OrganizationUri:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7438
    :vartype OrganizationUri: String
7439
    :ivar ProfileId:
7440
    :vartype ProfileId: String
7441
    :ivar ComplianceTool:
7442
    :vartype ComplianceTool: String
7443
    :ivar ComplianceDate:
7444
    :vartype ComplianceDate: DateTime
7445
    :ivar ComplianceLevel:
7446
    :vartype ComplianceLevel: ComplianceLevel
7447
    :ivar UnsupportedUnitIds:
7448
    :vartype UnsupportedUnitIds: String
7449
    '''
7450
7451 1
    ua_types = {
7452
        'OrganizationUri': 'String',
7453
        'ProfileId': 'String',
7454
        'ComplianceTool': 'String',
7455
        'ComplianceDate': 'DateTime',
7456
        'ComplianceLevel': 'ComplianceLevel',
7457
        'UnsupportedUnitIds': 'String',
7458
               }
7459
7460 1
    def __init__(self, binary=None):
7461
        if binary is not None:
7462
            self._binary_init(binary)
7463
            self._freeze = True
7464
            return
7465
        self.OrganizationUri = None
7466
        self.ProfileId = None
7467
        self.ComplianceTool = None
7468
        self.ComplianceDate = datetime.utcnow()
7469
        self.ComplianceLevel = ComplianceLevel(0)
7470
        self.UnsupportedUnitIds = []
7471
        self._freeze = True
7472
7473 1
    def to_binary(self):
7474
        packet = []
7475
        packet.append(uabin.Primitives.String.pack(self.OrganizationUri))
7476
        packet.append(uabin.Primitives.String.pack(self.ProfileId))
7477
        packet.append(uabin.Primitives.String.pack(self.ComplianceTool))
7478
        packet.append(uabin.Primitives.DateTime.pack(self.ComplianceDate))
7479
        packet.append(uabin.Primitives.UInt32.pack(self.ComplianceLevel.value))
7480
        packet.append(uabin.Primitives.Int32.pack(len(self.UnsupportedUnitIds)))
7481
        for fieldname in self.UnsupportedUnitIds:
7482
            packet.append(uabin.Primitives.String.pack(fieldname))
7483
        return b''.join(packet)
7484
7485 1
    @staticmethod
7486
    def from_binary(data):
7487
        return SupportedProfile(data)
7488
7489 1
    def _binary_init(self, data):
7490
        self.OrganizationUri = uabin.Primitives.String.unpack(data)
7491
        self.ProfileId = uabin.Primitives.String.unpack(data)
7492
        self.ComplianceTool = uabin.Primitives.String.unpack(data)
7493
        self.ComplianceDate = uabin.Primitives.DateTime.unpack(data)
7494
        self.ComplianceLevel = ComplianceLevel(uabin.Primitives.UInt32.unpack(data))
7495
        self.UnsupportedUnitIds = uabin.Primitives.String.unpack_array(data)
7496
7497 1
    def __str__(self):
7498
        return 'SupportedProfile(' + 'OrganizationUri:' + str(self.OrganizationUri) + ', ' + \
7499
               'ProfileId:' + str(self.ProfileId) + ', ' + \
7500
               'ComplianceTool:' + str(self.ComplianceTool) + ', ' + \
7501
               'ComplianceDate:' + str(self.ComplianceDate) + ', ' + \
7502
               'ComplianceLevel:' + str(self.ComplianceLevel) + ', ' + \
7503
               'UnsupportedUnitIds:' + str(self.UnsupportedUnitIds) + ')'
7504
7505 1
    __repr__ = __str__
7506
7507
7508 1
class SoftwareCertificate(FrozenClass):
7509
    '''
7510
    :ivar ProductName:
7511
    :vartype ProductName: String
7512
    :ivar ProductUri:
7513
    :vartype ProductUri: String
7514
    :ivar VendorName:
7515
    :vartype VendorName: String
7516
    :ivar VendorProductCertificate:
7517
    :vartype VendorProductCertificate: ByteString
7518
    :ivar SoftwareVersion:
7519
    :vartype SoftwareVersion: String
7520
    :ivar BuildNumber:
7521
    :vartype BuildNumber: String
7522
    :ivar BuildDate:
7523
    :vartype BuildDate: DateTime
7524
    :ivar IssuedBy:
7525
    :vartype IssuedBy: String
7526
    :ivar IssueDate:
7527
    :vartype IssueDate: DateTime
7528
    :ivar SupportedProfiles:
7529
    :vartype SupportedProfiles: SupportedProfile
7530
    '''
7531
7532 1
    ua_types = {
7533
        'ProductName': 'String',
7534
        'ProductUri': 'String',
7535
        'VendorName': 'String',
7536
        'VendorProductCertificate': 'ByteString',
7537
        'SoftwareVersion': 'String',
7538
        'BuildNumber': 'String',
7539
        'BuildDate': 'DateTime',
7540
        'IssuedBy': 'String',
7541
        'IssueDate': 'DateTime',
7542
        'SupportedProfiles': 'SupportedProfile',
7543
               }
7544
7545 1
    def __init__(self, binary=None):
7546
        if binary is not None:
7547
            self._binary_init(binary)
7548
            self._freeze = True
7549
            return
7550
        self.ProductName = None
7551
        self.ProductUri = None
7552
        self.VendorName = None
7553
        self.VendorProductCertificate = None
7554
        self.SoftwareVersion = None
7555
        self.BuildNumber = None
7556
        self.BuildDate = datetime.utcnow()
7557
        self.IssuedBy = None
7558
        self.IssueDate = datetime.utcnow()
7559
        self.SupportedProfiles = []
7560
        self._freeze = True
7561
7562 1
    def to_binary(self):
7563
        packet = []
7564
        packet.append(uabin.Primitives.String.pack(self.ProductName))
7565
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
7566
        packet.append(uabin.Primitives.String.pack(self.VendorName))
7567
        packet.append(uabin.Primitives.ByteString.pack(self.VendorProductCertificate))
7568
        packet.append(uabin.Primitives.String.pack(self.SoftwareVersion))
7569
        packet.append(uabin.Primitives.String.pack(self.BuildNumber))
7570
        packet.append(uabin.Primitives.DateTime.pack(self.BuildDate))
7571
        packet.append(uabin.Primitives.String.pack(self.IssuedBy))
7572
        packet.append(uabin.Primitives.DateTime.pack(self.IssueDate))
7573
        packet.append(uabin.Primitives.Int32.pack(len(self.SupportedProfiles)))
7574
        for fieldname in self.SupportedProfiles:
7575
            packet.append(fieldname.to_binary())
7576
        return b''.join(packet)
7577
7578 1
    @staticmethod
7579
    def from_binary(data):
7580
        return SoftwareCertificate(data)
7581
7582 1
    def _binary_init(self, data):
7583
        self.ProductName = uabin.Primitives.String.unpack(data)
7584
        self.ProductUri = uabin.Primitives.String.unpack(data)
7585
        self.VendorName = uabin.Primitives.String.unpack(data)
7586
        self.VendorProductCertificate = uabin.Primitives.ByteString.unpack(data)
7587
        self.SoftwareVersion = uabin.Primitives.String.unpack(data)
7588
        self.BuildNumber = uabin.Primitives.String.unpack(data)
7589
        self.BuildDate = uabin.Primitives.DateTime.unpack(data)
7590
        self.IssuedBy = uabin.Primitives.String.unpack(data)
7591
        self.IssueDate = uabin.Primitives.DateTime.unpack(data)
7592
        length = uabin.Primitives.Int32.unpack(data)
7593
        array = []
7594
        if length != -1:
7595
            for _ in range(0, length):
7596
                array.append(SupportedProfile.from_binary(data))
7597
        self.SupportedProfiles = array
7598
7599 1
    def __str__(self):
7600
        return 'SoftwareCertificate(' + 'ProductName:' + str(self.ProductName) + ', ' + \
7601
               'ProductUri:' + str(self.ProductUri) + ', ' + \
7602
               'VendorName:' + str(self.VendorName) + ', ' + \
7603
               'VendorProductCertificate:' + str(self.VendorProductCertificate) + ', ' + \
7604
               'SoftwareVersion:' + str(self.SoftwareVersion) + ', ' + \
7605
               'BuildNumber:' + str(self.BuildNumber) + ', ' + \
7606
               'BuildDate:' + str(self.BuildDate) + ', ' + \
7607
               'IssuedBy:' + str(self.IssuedBy) + ', ' + \
7608
               'IssueDate:' + str(self.IssueDate) + ', ' + \
7609
               'SupportedProfiles:' + str(self.SupportedProfiles) + ')'
7610
7611 1
    __repr__ = __str__
7612
7613
7614 1
class QueryDataDescription(FrozenClass):
7615
    '''
7616
    :ivar RelativePath:
7617
    :vartype RelativePath: RelativePath
7618
    :ivar AttributeId:
7619
    :vartype AttributeId: UInt32
7620
    :ivar IndexRange:
7621
    :vartype IndexRange: String
7622
    '''
7623
7624 1
    ua_types = {
7625
        'RelativePath': 'RelativePath',
7626
        'AttributeId': 'UInt32',
7627
        'IndexRange': 'String',
7628
               }
7629
7630 1
    def __init__(self, binary=None):
7631
        if binary is not None:
7632
            self._binary_init(binary)
7633
            self._freeze = True
7634
            return
7635
        self.RelativePath = RelativePath()
7636
        self.AttributeId = 0
7637
        self.IndexRange = None
7638
        self._freeze = True
7639
7640 1
    def to_binary(self):
7641
        packet = []
7642
        packet.append(self.RelativePath.to_binary())
7643
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
7644
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
7645
        return b''.join(packet)
7646
7647 1
    @staticmethod
7648
    def from_binary(data):
7649
        return QueryDataDescription(data)
7650
7651 1
    def _binary_init(self, data):
7652
        self.RelativePath = RelativePath.from_binary(data)
7653
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
7654
        self.IndexRange = uabin.Primitives.String.unpack(data)
7655
7656 1
    def __str__(self):
7657
        return 'QueryDataDescription(' + 'RelativePath:' + str(self.RelativePath) + ', ' + \
7658
               'AttributeId:' + str(self.AttributeId) + ', ' + \
7659
               'IndexRange:' + str(self.IndexRange) + ')'
7660
7661 1
    __repr__ = __str__
7662 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7663
7664 1
class NodeTypeDescription(FrozenClass):
7665
    '''
7666
    :ivar TypeDefinitionNode:
7667
    :vartype TypeDefinitionNode: ExpandedNodeId
7668
    :ivar IncludeSubTypes:
7669
    :vartype IncludeSubTypes: Boolean
7670
    :ivar DataToReturn:
7671
    :vartype DataToReturn: QueryDataDescription
7672
    '''
7673
7674 1
    ua_types = {
7675
        'TypeDefinitionNode': 'ExpandedNodeId',
7676
        'IncludeSubTypes': 'Boolean',
7677
        'DataToReturn': 'QueryDataDescription',
7678
               }
7679
7680 1
    def __init__(self, binary=None):
7681
        if binary is not None:
7682
            self._binary_init(binary)
7683
            self._freeze = True
7684
            return
7685
        self.TypeDefinitionNode = ExpandedNodeId()
7686
        self.IncludeSubTypes = True
7687
        self.DataToReturn = []
7688
        self._freeze = True
7689
7690 1
    def to_binary(self):
7691
        packet = []
7692
        packet.append(self.TypeDefinitionNode.to_binary())
7693
        packet.append(uabin.Primitives.Boolean.pack(self.IncludeSubTypes))
7694
        packet.append(uabin.Primitives.Int32.pack(len(self.DataToReturn)))
7695
        for fieldname in self.DataToReturn:
7696
            packet.append(fieldname.to_binary())
7697
        return b''.join(packet)
7698
7699 1
    @staticmethod
7700
    def from_binary(data):
7701
        return NodeTypeDescription(data)
7702
7703 1
    def _binary_init(self, data):
7704
        self.TypeDefinitionNode = ExpandedNodeId.from_binary(data)
7705
        self.IncludeSubTypes = uabin.Primitives.Boolean.unpack(data)
7706
        length = uabin.Primitives.Int32.unpack(data)
7707
        array = []
7708
        if length != -1:
7709
            for _ in range(0, length):
7710
                array.append(QueryDataDescription.from_binary(data))
7711
        self.DataToReturn = array
7712
7713 1
    def __str__(self):
7714
        return 'NodeTypeDescription(' + 'TypeDefinitionNode:' + str(self.TypeDefinitionNode) + ', ' + \
7715
               'IncludeSubTypes:' + str(self.IncludeSubTypes) + ', ' + \
7716
               'DataToReturn:' + str(self.DataToReturn) + ')'
7717
7718 1
    __repr__ = __str__
7719 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7720
7721 1
class QueryDataSet(FrozenClass):
7722
    '''
7723
    :ivar NodeId:
7724
    :vartype NodeId: ExpandedNodeId
7725
    :ivar TypeDefinitionNode:
7726
    :vartype TypeDefinitionNode: ExpandedNodeId
7727
    :ivar Values:
7728
    :vartype Values: Variant
7729
    '''
7730
7731 1
    ua_types = {
7732
        'NodeId': 'ExpandedNodeId',
7733
        'TypeDefinitionNode': 'ExpandedNodeId',
7734
        'Values': 'Variant',
7735
               }
7736
7737 1
    def __init__(self, binary=None):
7738
        if binary is not None:
7739
            self._binary_init(binary)
7740
            self._freeze = True
7741
            return
7742
        self.NodeId = ExpandedNodeId()
7743
        self.TypeDefinitionNode = ExpandedNodeId()
7744
        self.Values = []
7745
        self._freeze = True
7746
7747 1
    def to_binary(self):
7748
        packet = []
7749
        packet.append(self.NodeId.to_binary())
7750
        packet.append(self.TypeDefinitionNode.to_binary())
7751
        packet.append(uabin.Primitives.Int32.pack(len(self.Values)))
7752
        for fieldname in self.Values:
7753
            packet.append(fieldname.to_binary())
7754
        return b''.join(packet)
7755
7756 1
    @staticmethod
7757
    def from_binary(data):
7758
        return QueryDataSet(data)
7759
7760 1
    def _binary_init(self, data):
7761
        self.NodeId = ExpandedNodeId.from_binary(data)
7762
        self.TypeDefinitionNode = ExpandedNodeId.from_binary(data)
7763
        length = uabin.Primitives.Int32.unpack(data)
7764
        array = []
7765
        if length != -1:
7766
            for _ in range(0, length):
7767
                array.append(Variant.from_binary(data))
7768
        self.Values = array
7769
7770 1
    def __str__(self):
7771
        return 'QueryDataSet(' + 'NodeId:' + str(self.NodeId) + ', ' + \
7772
               'TypeDefinitionNode:' + str(self.TypeDefinitionNode) + ', ' + \
7773
               'Values:' + str(self.Values) + ')'
7774
7775 1
    __repr__ = __str__
7776 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7777
7778 1
class NodeReference(FrozenClass):
7779
    '''
7780
    :ivar NodeId:
7781
    :vartype NodeId: NodeId
7782
    :ivar ReferenceTypeId:
7783
    :vartype ReferenceTypeId: NodeId
7784
    :ivar IsForward:
7785
    :vartype IsForward: Boolean
7786
    :ivar ReferencedNodeIds:
7787
    :vartype ReferencedNodeIds: NodeId
7788
    '''
7789
7790 1
    ua_types = {
7791
        'NodeId': 'NodeId',
7792
        'ReferenceTypeId': 'NodeId',
7793
        'IsForward': 'Boolean',
7794
        'ReferencedNodeIds': 'NodeId',
7795
               }
7796
7797 1
    def __init__(self, binary=None):
7798
        if binary is not None:
7799
            self._binary_init(binary)
7800
            self._freeze = True
7801
            return
7802
        self.NodeId = NodeId()
7803
        self.ReferenceTypeId = NodeId()
7804
        self.IsForward = True
7805
        self.ReferencedNodeIds = []
7806
        self._freeze = True
7807
7808 1
    def to_binary(self):
7809
        packet = []
7810
        packet.append(self.NodeId.to_binary())
7811
        packet.append(self.ReferenceTypeId.to_binary())
7812
        packet.append(uabin.Primitives.Boolean.pack(self.IsForward))
7813
        packet.append(uabin.Primitives.Int32.pack(len(self.ReferencedNodeIds)))
7814
        for fieldname in self.ReferencedNodeIds:
7815
            packet.append(fieldname.to_binary())
7816
        return b''.join(packet)
7817
7818 1
    @staticmethod
7819
    def from_binary(data):
7820
        return NodeReference(data)
7821
7822 1
    def _binary_init(self, data):
7823
        self.NodeId = NodeId.from_binary(data)
7824
        self.ReferenceTypeId = NodeId.from_binary(data)
7825
        self.IsForward = uabin.Primitives.Boolean.unpack(data)
7826
        length = uabin.Primitives.Int32.unpack(data)
7827
        array = []
7828
        if length != -1:
7829
            for _ in range(0, length):
7830
                array.append(NodeId.from_binary(data))
7831
        self.ReferencedNodeIds = array
7832
7833 1
    def __str__(self):
7834
        return 'NodeReference(' + 'NodeId:' + str(self.NodeId) + ', ' + \
7835
               'ReferenceTypeId:' + str(self.ReferenceTypeId) + ', ' + \
7836
               'IsForward:' + str(self.IsForward) + ', ' + \
7837
               'ReferencedNodeIds:' + str(self.ReferencedNodeIds) + ')'
7838
7839 1
    __repr__ = __str__
7840
7841
7842 1
class ContentFilterElement(FrozenClass):
7843
    '''
7844
    :ivar FilterOperator:
7845
    :vartype FilterOperator: FilterOperator
7846
    :ivar FilterOperands:
7847
    :vartype FilterOperands: ExtensionObject
7848
    '''
7849
7850 1
    ua_types = {
7851
        'FilterOperator': 'FilterOperator',
7852
        'FilterOperands': 'ExtensionObject',
7853
               }
7854
7855 1
    def __init__(self, binary=None):
7856 1
        if binary is not None:
7857 1
            self._binary_init(binary)
7858 1
            self._freeze = True
7859 1
            return
7860 1
        self.FilterOperator = FilterOperator(0)
7861 1
        self.FilterOperands = []
7862 1
        self._freeze = True
7863
7864 1
    def to_binary(self):
7865 1
        packet = []
7866 1
        packet.append(uabin.Primitives.UInt32.pack(self.FilterOperator.value))
7867 1
        packet.append(uabin.Primitives.Int32.pack(len(self.FilterOperands)))
7868 1
        for fieldname in self.FilterOperands:
7869 1
            packet.append(extensionobject_to_binary(fieldname))
7870 1
        return b''.join(packet)
7871
7872 1
    @staticmethod
7873
    def from_binary(data):
7874 1
        return ContentFilterElement(data)
7875
7876 1
    def _binary_init(self, data):
7877 1
        self.FilterOperator = FilterOperator(uabin.Primitives.UInt32.unpack(data))
7878 1
        length = uabin.Primitives.Int32.unpack(data)
7879 1
        array = []
7880 1
        if length != -1:
7881 1
            for _ in range(0, length):
7882 1
                array.append(extensionobject_from_binary(data))
7883 1
        self.FilterOperands = array
7884
7885 1
    def __str__(self):
7886
        return 'ContentFilterElement(' + 'FilterOperator:' + str(self.FilterOperator) + ', ' + \
7887
               'FilterOperands:' + str(self.FilterOperands) + ')'
7888
7889 1
    __repr__ = __str__
7890
7891
7892 1
class ContentFilter(FrozenClass):
7893
    '''
7894
    :ivar Elements:
7895
    :vartype Elements: ContentFilterElement
7896
    '''
7897
7898 1
    ua_types = {
7899
        'Elements': 'ContentFilterElement',
7900
               }
7901
7902 1
    def __init__(self, binary=None):
7903 1
        if binary is not None:
7904 1
            self._binary_init(binary)
7905 1
            self._freeze = True
7906 1
            return
7907 1
        self.Elements = []
7908 1
        self._freeze = True
7909
7910 1
    def to_binary(self):
7911 1
        packet = []
7912 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Elements)))
7913 1
        for fieldname in self.Elements:
7914 1
            packet.append(fieldname.to_binary())
7915 1
        return b''.join(packet)
7916
7917 1
    @staticmethod
7918
    def from_binary(data):
7919 1
        return ContentFilter(data)
7920
7921 1
    def _binary_init(self, data):
7922 1
        length = uabin.Primitives.Int32.unpack(data)
7923 1
        array = []
7924 1
        if length != -1:
7925 1
            for _ in range(0, length):
7926 1
                array.append(ContentFilterElement.from_binary(data))
7927 1
        self.Elements = array
7928
7929 1
    def __str__(self):
7930
        return 'ContentFilter(' + 'Elements:' + str(self.Elements) + ')'
7931
7932 1
    __repr__ = __str__
7933
7934
7935 1
class ElementOperand(FrozenClass):
7936
    '''
7937
    :ivar Index:
7938
    :vartype Index: UInt32
7939
    '''
7940
7941 1
    ua_types = {
7942
        'Index': 'UInt32',
7943
               }
7944
7945 1
    def __init__(self, binary=None):
7946
        if binary is not None:
7947
            self._binary_init(binary)
7948
            self._freeze = True
7949
            return
7950
        self.Index = 0
7951
        self._freeze = True
7952
7953 1
    def to_binary(self):
7954
        packet = []
7955
        packet.append(uabin.Primitives.UInt32.pack(self.Index))
7956
        return b''.join(packet)
7957
7958 1
    @staticmethod
7959
    def from_binary(data):
7960
        return ElementOperand(data)
7961
7962 1
    def _binary_init(self, data):
7963
        self.Index = uabin.Primitives.UInt32.unpack(data)
7964
7965 1
    def __str__(self):
7966
        return 'ElementOperand(' + 'Index:' + str(self.Index) + ')'
7967
7968 1
    __repr__ = __str__
7969 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
7970
7971 1
class LiteralOperand(FrozenClass):
7972
    '''
7973
    :ivar Value:
7974
    :vartype Value: Variant
7975
    '''
7976
7977 1
    ua_types = {
7978
        'Value': 'Variant',
7979
               }
7980
7981 1
    def __init__(self, binary=None):
7982 1
        if binary is not None:
7983 1
            self._binary_init(binary)
7984 1
            self._freeze = True
7985 1
            return
7986 1
        self.Value = Variant()
7987 1
        self._freeze = True
7988
7989 1
    def to_binary(self):
7990 1
        packet = []
7991 1
        packet.append(self.Value.to_binary())
7992 1
        return b''.join(packet)
7993
7994 1
    @staticmethod
7995
    def from_binary(data):
7996 1
        return LiteralOperand(data)
7997
7998 1
    def _binary_init(self, data):
7999 1
        self.Value = Variant.from_binary(data)
8000
8001 1
    def __str__(self):
8002
        return 'LiteralOperand(' + 'Value:' + str(self.Value) + ')'
8003
8004 1
    __repr__ = __str__
8005
8006
8007 1
class AttributeOperand(FrozenClass):
8008
    '''
8009
    :ivar NodeId:
8010
    :vartype NodeId: NodeId
8011
    :ivar Alias:
8012
    :vartype Alias: String
8013
    :ivar BrowsePath:
8014
    :vartype BrowsePath: RelativePath
8015
    :ivar AttributeId:
8016
    :vartype AttributeId: UInt32
8017
    :ivar IndexRange:
8018
    :vartype IndexRange: String
8019
    '''
8020
8021 1
    ua_types = {
8022
        'NodeId': 'NodeId',
8023
        'Alias': 'String',
8024
        'BrowsePath': 'RelativePath',
8025
        'AttributeId': 'UInt32',
8026
        'IndexRange': 'String',
8027
               }
8028
8029 1
    def __init__(self, binary=None):
8030
        if binary is not None:
8031
            self._binary_init(binary)
8032
            self._freeze = True
8033
            return
8034
        self.NodeId = NodeId()
8035
        self.Alias = None
8036
        self.BrowsePath = RelativePath()
8037
        self.AttributeId = 0
8038
        self.IndexRange = None
8039
        self._freeze = True
8040
8041 1
    def to_binary(self):
8042
        packet = []
8043
        packet.append(self.NodeId.to_binary())
8044
        packet.append(uabin.Primitives.String.pack(self.Alias))
8045
        packet.append(self.BrowsePath.to_binary())
8046
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
8047
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
8048
        return b''.join(packet)
8049
8050 1
    @staticmethod
8051
    def from_binary(data):
8052
        return AttributeOperand(data)
8053
8054 1
    def _binary_init(self, data):
8055
        self.NodeId = NodeId.from_binary(data)
8056
        self.Alias = uabin.Primitives.String.unpack(data)
8057
        self.BrowsePath = RelativePath.from_binary(data)
8058
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
8059
        self.IndexRange = uabin.Primitives.String.unpack(data)
8060
8061 1
    def __str__(self):
8062
        return 'AttributeOperand(' + 'NodeId:' + str(self.NodeId) + ', ' + \
8063
               'Alias:' + str(self.Alias) + ', ' + \
8064
               'BrowsePath:' + str(self.BrowsePath) + ', ' + \
8065
               'AttributeId:' + str(self.AttributeId) + ', ' + \
8066
               'IndexRange:' + str(self.IndexRange) + ')'
8067
8068 1
    __repr__ = __str__
8069
8070
8071 1
class SimpleAttributeOperand(FrozenClass):
8072
    '''
8073
    :ivar TypeDefinitionId:
8074
    :vartype TypeDefinitionId: NodeId
8075
    :ivar BrowsePath:
8076
    :vartype BrowsePath: QualifiedName
8077
    :ivar AttributeId:
8078
    :vartype AttributeId: UInt32
8079
    :ivar IndexRange:
8080
    :vartype IndexRange: String
8081
    '''
8082
8083 1
    ua_types = {
8084
        'TypeDefinitionId': 'NodeId',
8085
        'BrowsePath': 'QualifiedName',
8086
        'AttributeId': 'UInt32',
8087
        'IndexRange': 'String',
8088
               }
8089
8090 1
    def __init__(self, binary=None):
8091 1
        if binary is not None:
8092 1
            self._binary_init(binary)
8093 1
            self._freeze = True
8094 1
            return
8095 1
        self.TypeDefinitionId = NodeId()
8096 1
        self.BrowsePath = []
8097 1
        self.AttributeId = 0
8098 1
        self.IndexRange = None
8099 1
        self._freeze = True
8100
8101 1
    def to_binary(self):
8102 1
        packet = []
8103 1
        packet.append(self.TypeDefinitionId.to_binary())
8104 1
        packet.append(uabin.Primitives.Int32.pack(len(self.BrowsePath)))
8105 1
        for fieldname in self.BrowsePath:
8106 1
            packet.append(fieldname.to_binary())
8107 1
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
8108 1
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
8109 1
        return b''.join(packet)
8110
8111 1
    @staticmethod
8112
    def from_binary(data):
8113 1
        return SimpleAttributeOperand(data)
8114
8115 1
    def _binary_init(self, data):
8116 1
        self.TypeDefinitionId = NodeId.from_binary(data)
8117 1
        length = uabin.Primitives.Int32.unpack(data)
8118 1
        array = []
8119 1
        if length != -1:
8120 1
            for _ in range(0, length):
8121 1
                array.append(QualifiedName.from_binary(data))
8122 1
        self.BrowsePath = array
8123 1
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
8124 1
        self.IndexRange = uabin.Primitives.String.unpack(data)
8125
8126 1
    def __str__(self):
8127
        return 'SimpleAttributeOperand(' + 'TypeDefinitionId:' + str(self.TypeDefinitionId) + ', ' + \
8128
               'BrowsePath:' + str(self.BrowsePath) + ', ' + \
8129
               'AttributeId:' + str(self.AttributeId) + ', ' + \
8130
               'IndexRange:' + str(self.IndexRange) + ')'
8131
8132 1
    __repr__ = __str__
8133
8134
8135 1
class ContentFilterElementResult(FrozenClass):
8136
    '''
8137
    :ivar StatusCode:
8138
    :vartype StatusCode: StatusCode
8139
    :ivar OperandStatusCodes:
8140
    :vartype OperandStatusCodes: StatusCode
8141
    :ivar OperandDiagnosticInfos:
8142
    :vartype OperandDiagnosticInfos: DiagnosticInfo
8143
    '''
8144
8145 1
    ua_types = {
8146
        'StatusCode': 'StatusCode',
8147
        'OperandStatusCodes': 'StatusCode',
8148
        'OperandDiagnosticInfos': 'DiagnosticInfo',
8149
               }
8150
8151 1
    def __init__(self, binary=None):
8152
        if binary is not None:
8153
            self._binary_init(binary)
8154
            self._freeze = True
8155
            return
8156
        self.StatusCode = StatusCode()
8157
        self.OperandStatusCodes = []
8158
        self.OperandDiagnosticInfos = []
8159
        self._freeze = True
8160
8161 1
    def to_binary(self):
8162
        packet = []
8163
        packet.append(self.StatusCode.to_binary())
8164
        packet.append(uabin.Primitives.Int32.pack(len(self.OperandStatusCodes)))
8165
        for fieldname in self.OperandStatusCodes:
8166
            packet.append(fieldname.to_binary())
8167
        packet.append(uabin.Primitives.Int32.pack(len(self.OperandDiagnosticInfos)))
8168
        for fieldname in self.OperandDiagnosticInfos:
8169
            packet.append(fieldname.to_binary())
8170
        return b''.join(packet)
8171
8172 1
    @staticmethod
8173
    def from_binary(data):
8174
        return ContentFilterElementResult(data)
8175
8176 1
    def _binary_init(self, data):
8177
        self.StatusCode = StatusCode.from_binary(data)
8178
        length = uabin.Primitives.Int32.unpack(data)
8179
        array = []
8180
        if length != -1:
8181
            for _ in range(0, length):
8182
                array.append(StatusCode.from_binary(data))
8183
        self.OperandStatusCodes = array
8184
        length = uabin.Primitives.Int32.unpack(data)
8185
        array = []
8186
        if length != -1:
8187
            for _ in range(0, length):
8188
                array.append(DiagnosticInfo.from_binary(data))
8189
        self.OperandDiagnosticInfos = array
8190
8191 1
    def __str__(self):
8192
        return 'ContentFilterElementResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
8193
               'OperandStatusCodes:' + str(self.OperandStatusCodes) + ', ' + \
8194
               'OperandDiagnosticInfos:' + str(self.OperandDiagnosticInfos) + ')'
8195
8196 1
    __repr__ = __str__
8197 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8198
8199 1
class ContentFilterResult(FrozenClass):
8200
    '''
8201
    :ivar ElementResults:
8202
    :vartype ElementResults: ContentFilterElementResult
8203
    :ivar ElementDiagnosticInfos:
8204
    :vartype ElementDiagnosticInfos: DiagnosticInfo
8205
    '''
8206
8207 1
    ua_types = {
8208
        'ElementResults': 'ContentFilterElementResult',
8209
        'ElementDiagnosticInfos': 'DiagnosticInfo',
8210
               }
8211
8212 1
    def __init__(self, binary=None):
8213
        if binary is not None:
8214
            self._binary_init(binary)
8215
            self._freeze = True
8216
            return
8217
        self.ElementResults = []
8218
        self.ElementDiagnosticInfos = []
8219
        self._freeze = True
8220
8221 1
    def to_binary(self):
8222
        packet = []
8223
        packet.append(uabin.Primitives.Int32.pack(len(self.ElementResults)))
8224
        for fieldname in self.ElementResults:
8225
            packet.append(fieldname.to_binary())
8226
        packet.append(uabin.Primitives.Int32.pack(len(self.ElementDiagnosticInfos)))
8227
        for fieldname in self.ElementDiagnosticInfos:
8228
            packet.append(fieldname.to_binary())
8229
        return b''.join(packet)
8230
8231 1
    @staticmethod
8232
    def from_binary(data):
8233
        return ContentFilterResult(data)
8234
8235 1
    def _binary_init(self, data):
8236
        length = uabin.Primitives.Int32.unpack(data)
8237
        array = []
8238
        if length != -1:
8239
            for _ in range(0, length):
8240
                array.append(ContentFilterElementResult.from_binary(data))
8241
        self.ElementResults = array
8242
        length = uabin.Primitives.Int32.unpack(data)
8243
        array = []
8244
        if length != -1:
8245
            for _ in range(0, length):
8246
                array.append(DiagnosticInfo.from_binary(data))
8247
        self.ElementDiagnosticInfos = array
8248
8249 1
    def __str__(self):
8250
        return 'ContentFilterResult(' + 'ElementResults:' + str(self.ElementResults) + ', ' + \
8251
               'ElementDiagnosticInfos:' + str(self.ElementDiagnosticInfos) + ')'
8252
8253 1
    __repr__ = __str__
8254
8255
8256 1
class ParsingResult(FrozenClass):
8257
    '''
8258
    :ivar StatusCode:
8259
    :vartype StatusCode: StatusCode
8260
    :ivar DataStatusCodes:
8261
    :vartype DataStatusCodes: StatusCode
8262
    :ivar DataDiagnosticInfos:
8263
    :vartype DataDiagnosticInfos: DiagnosticInfo
8264
    '''
8265
8266 1
    ua_types = {
8267
        'StatusCode': 'StatusCode',
8268
        'DataStatusCodes': 'StatusCode',
8269
        'DataDiagnosticInfos': 'DiagnosticInfo',
8270
               }
8271
8272 1
    def __init__(self, binary=None):
8273
        if binary is not None:
8274
            self._binary_init(binary)
8275
            self._freeze = True
8276
            return
8277
        self.StatusCode = StatusCode()
8278
        self.DataStatusCodes = []
8279
        self.DataDiagnosticInfos = []
8280
        self._freeze = True
8281
8282 1
    def to_binary(self):
8283
        packet = []
8284 View Code Duplication
        packet.append(self.StatusCode.to_binary())
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8285
        packet.append(uabin.Primitives.Int32.pack(len(self.DataStatusCodes)))
8286
        for fieldname in self.DataStatusCodes:
8287
            packet.append(fieldname.to_binary())
8288
        packet.append(uabin.Primitives.Int32.pack(len(self.DataDiagnosticInfos)))
8289
        for fieldname in self.DataDiagnosticInfos:
8290
            packet.append(fieldname.to_binary())
8291
        return b''.join(packet)
8292
8293 1
    @staticmethod
8294
    def from_binary(data):
8295
        return ParsingResult(data)
8296
8297 1
    def _binary_init(self, data):
8298
        self.StatusCode = StatusCode.from_binary(data)
8299
        length = uabin.Primitives.Int32.unpack(data)
8300
        array = []
8301
        if length != -1:
8302
            for _ in range(0, length):
8303
                array.append(StatusCode.from_binary(data))
8304
        self.DataStatusCodes = array
8305
        length = uabin.Primitives.Int32.unpack(data)
8306
        array = []
8307
        if length != -1:
8308
            for _ in range(0, length):
8309
                array.append(DiagnosticInfo.from_binary(data))
8310
        self.DataDiagnosticInfos = array
8311
8312 1
    def __str__(self):
8313
        return 'ParsingResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
8314
               'DataStatusCodes:' + str(self.DataStatusCodes) + ', ' + \
8315
               'DataDiagnosticInfos:' + str(self.DataDiagnosticInfos) + ')'
8316
8317 1
    __repr__ = __str__
8318
8319
8320 1
class QueryFirstParameters(FrozenClass):
8321
    '''
8322
    :ivar View:
8323
    :vartype View: ViewDescription
8324
    :ivar NodeTypes:
8325
    :vartype NodeTypes: NodeTypeDescription
8326
    :ivar Filter:
8327
    :vartype Filter: ContentFilter
8328
    :ivar MaxDataSetsToReturn:
8329
    :vartype MaxDataSetsToReturn: UInt32
8330
    :ivar MaxReferencesToReturn:
8331
    :vartype MaxReferencesToReturn: UInt32
8332
    '''
8333
8334 1
    ua_types = {
8335
        'View': 'ViewDescription',
8336
        'NodeTypes': 'NodeTypeDescription',
8337
        'Filter': 'ContentFilter',
8338
        'MaxDataSetsToReturn': 'UInt32',
8339
        'MaxReferencesToReturn': 'UInt32',
8340
               }
8341
8342 1
    def __init__(self, binary=None):
8343
        if binary is not None:
8344
            self._binary_init(binary)
8345
            self._freeze = True
8346
            return
8347
        self.View = ViewDescription()
8348
        self.NodeTypes = []
8349
        self.Filter = ContentFilter()
8350
        self.MaxDataSetsToReturn = 0
8351
        self.MaxReferencesToReturn = 0
8352
        self._freeze = True
8353
8354 1
    def to_binary(self):
8355
        packet = []
8356
        packet.append(self.View.to_binary())
8357
        packet.append(uabin.Primitives.Int32.pack(len(self.NodeTypes)))
8358
        for fieldname in self.NodeTypes:
8359
            packet.append(fieldname.to_binary())
8360
        packet.append(self.Filter.to_binary())
8361
        packet.append(uabin.Primitives.UInt32.pack(self.MaxDataSetsToReturn))
8362
        packet.append(uabin.Primitives.UInt32.pack(self.MaxReferencesToReturn))
8363
        return b''.join(packet)
8364
8365 1
    @staticmethod
8366
    def from_binary(data):
8367
        return QueryFirstParameters(data)
8368
8369 1
    def _binary_init(self, data):
8370
        self.View = ViewDescription.from_binary(data)
8371
        length = uabin.Primitives.Int32.unpack(data)
8372
        array = []
8373
        if length != -1:
8374
            for _ in range(0, length):
8375
                array.append(NodeTypeDescription.from_binary(data))
8376
        self.NodeTypes = array
8377
        self.Filter = ContentFilter.from_binary(data)
8378
        self.MaxDataSetsToReturn = uabin.Primitives.UInt32.unpack(data)
8379
        self.MaxReferencesToReturn = uabin.Primitives.UInt32.unpack(data)
8380
8381 1
    def __str__(self):
8382
        return 'QueryFirstParameters(' + 'View:' + str(self.View) + ', ' + \
8383
               'NodeTypes:' + str(self.NodeTypes) + ', ' + \
8384
               'Filter:' + str(self.Filter) + ', ' + \
8385
               'MaxDataSetsToReturn:' + str(self.MaxDataSetsToReturn) + ', ' + \
8386
               'MaxReferencesToReturn:' + str(self.MaxReferencesToReturn) + ')'
8387
8388 1
    __repr__ = __str__
8389
8390
8391 1
class QueryFirstRequest(FrozenClass):
8392
    '''
8393
    :ivar TypeId:
8394
    :vartype TypeId: NodeId
8395
    :ivar RequestHeader:
8396
    :vartype RequestHeader: RequestHeader
8397
    :ivar Parameters:
8398
    :vartype Parameters: QueryFirstParameters
8399
    '''
8400
8401 1
    ua_types = {
8402
        'TypeId': 'NodeId',
8403
        'RequestHeader': 'RequestHeader',
8404
        'Parameters': 'QueryFirstParameters',
8405
               }
8406
8407 1
    def __init__(self, binary=None):
8408
        if binary is not None:
8409
            self._binary_init(binary)
8410
            self._freeze = True
8411
            return
8412
        self.TypeId = FourByteNodeId(ObjectIds.QueryFirstRequest_Encoding_DefaultBinary)
8413
        self.RequestHeader = RequestHeader()
8414
        self.Parameters = QueryFirstParameters()
8415
        self._freeze = True
8416
8417 1
    def to_binary(self):
8418
        packet = []
8419
        packet.append(self.TypeId.to_binary())
8420
        packet.append(self.RequestHeader.to_binary())
8421
        packet.append(self.Parameters.to_binary())
8422
        return b''.join(packet)
8423
8424 1
    @staticmethod
8425
    def from_binary(data):
8426
        return QueryFirstRequest(data)
8427
8428 1
    def _binary_init(self, data):
8429
        self.TypeId = NodeId.from_binary(data)
8430
        self.RequestHeader = RequestHeader.from_binary(data)
8431
        self.Parameters = QueryFirstParameters.from_binary(data)
8432
8433 1
    def __str__(self):
8434
        return 'QueryFirstRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8435
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
8436
               'Parameters:' + str(self.Parameters) + ')'
8437
8438 1
    __repr__ = __str__
8439 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8440
8441 1
class QueryFirstResult(FrozenClass):
8442
    '''
8443
    :ivar QueryDataSets:
8444
    :vartype QueryDataSets: QueryDataSet
8445
    :ivar ContinuationPoint:
8446
    :vartype ContinuationPoint: ByteString
8447
    :ivar ParsingResults:
8448
    :vartype ParsingResults: ParsingResult
8449
    :ivar DiagnosticInfos:
8450
    :vartype DiagnosticInfos: DiagnosticInfo
8451
    :ivar FilterResult:
8452
    :vartype FilterResult: ContentFilterResult
8453
    '''
8454
8455 1
    ua_types = {
8456
        'QueryDataSets': 'QueryDataSet',
8457
        'ContinuationPoint': 'ByteString',
8458
        'ParsingResults': 'ParsingResult',
8459
        'DiagnosticInfos': 'DiagnosticInfo',
8460
        'FilterResult': 'ContentFilterResult',
8461
               }
8462
8463 1
    def __init__(self, binary=None):
8464
        if binary is not None:
8465
            self._binary_init(binary)
8466
            self._freeze = True
8467
            return
8468
        self.QueryDataSets = []
8469
        self.ContinuationPoint = None
8470
        self.ParsingResults = []
8471
        self.DiagnosticInfos = []
8472
        self.FilterResult = ContentFilterResult()
8473
        self._freeze = True
8474
8475 1
    def to_binary(self):
8476
        packet = []
8477
        packet.append(uabin.Primitives.Int32.pack(len(self.QueryDataSets)))
8478
        for fieldname in self.QueryDataSets:
8479
            packet.append(fieldname.to_binary())
8480
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
8481
        packet.append(uabin.Primitives.Int32.pack(len(self.ParsingResults)))
8482
        for fieldname in self.ParsingResults:
8483
            packet.append(fieldname.to_binary())
8484
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
8485
        for fieldname in self.DiagnosticInfos:
8486
            packet.append(fieldname.to_binary())
8487
        packet.append(self.FilterResult.to_binary())
8488
        return b''.join(packet)
8489
8490 1
    @staticmethod
8491
    def from_binary(data):
8492
        return QueryFirstResult(data)
8493
8494 1
    def _binary_init(self, data):
8495
        length = uabin.Primitives.Int32.unpack(data)
8496
        array = []
8497
        if length != -1:
8498
            for _ in range(0, length):
8499
                array.append(QueryDataSet.from_binary(data))
8500
        self.QueryDataSets = array
8501
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
8502
        length = uabin.Primitives.Int32.unpack(data)
8503
        array = []
8504
        if length != -1:
8505
            for _ in range(0, length):
8506
                array.append(ParsingResult.from_binary(data))
8507
        self.ParsingResults = array
8508
        length = uabin.Primitives.Int32.unpack(data)
8509
        array = []
8510
        if length != -1:
8511
            for _ in range(0, length):
8512
                array.append(DiagnosticInfo.from_binary(data))
8513
        self.DiagnosticInfos = array
8514
        self.FilterResult = ContentFilterResult.from_binary(data)
8515
8516 1
    def __str__(self):
8517
        return 'QueryFirstResult(' + 'QueryDataSets:' + str(self.QueryDataSets) + ', ' + \
8518
               'ContinuationPoint:' + str(self.ContinuationPoint) + ', ' + \
8519
               'ParsingResults:' + str(self.ParsingResults) + ', ' + \
8520
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ', ' + \
8521
               'FilterResult:' + str(self.FilterResult) + ')'
8522
8523 1
    __repr__ = __str__
8524
8525
8526 1
class QueryFirstResponse(FrozenClass):
8527
    '''
8528
    :ivar TypeId:
8529
    :vartype TypeId: NodeId
8530
    :ivar ResponseHeader:
8531
    :vartype ResponseHeader: ResponseHeader
8532
    :ivar Parameters:
8533
    :vartype Parameters: QueryFirstResult
8534
    '''
8535
8536 1
    ua_types = {
8537
        'TypeId': 'NodeId',
8538
        'ResponseHeader': 'ResponseHeader',
8539
        'Parameters': 'QueryFirstResult',
8540
               }
8541
8542 1
    def __init__(self, binary=None):
8543
        if binary is not None:
8544
            self._binary_init(binary)
8545
            self._freeze = True
8546
            return
8547
        self.TypeId = FourByteNodeId(ObjectIds.QueryFirstResponse_Encoding_DefaultBinary)
8548
        self.ResponseHeader = ResponseHeader()
8549
        self.Parameters = QueryFirstResult()
8550
        self._freeze = True
8551
8552 1
    def to_binary(self):
8553
        packet = []
8554
        packet.append(self.TypeId.to_binary())
8555
        packet.append(self.ResponseHeader.to_binary())
8556
        packet.append(self.Parameters.to_binary())
8557
        return b''.join(packet)
8558
8559 1
    @staticmethod
8560
    def from_binary(data):
8561
        return QueryFirstResponse(data)
8562
8563 1
    def _binary_init(self, data):
8564
        self.TypeId = NodeId.from_binary(data)
8565
        self.ResponseHeader = ResponseHeader.from_binary(data)
8566
        self.Parameters = QueryFirstResult.from_binary(data)
8567
8568 1
    def __str__(self):
8569
        return 'QueryFirstResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8570
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
8571
               'Parameters:' + str(self.Parameters) + ')'
8572
8573 1
    __repr__ = __str__
8574
8575
8576 1
class QueryNextParameters(FrozenClass):
8577
    '''
8578
    :ivar ReleaseContinuationPoint:
8579
    :vartype ReleaseContinuationPoint: Boolean
8580
    :ivar ContinuationPoint:
8581
    :vartype ContinuationPoint: ByteString
8582
    '''
8583
8584 1
    ua_types = {
8585
        'ReleaseContinuationPoint': 'Boolean',
8586
        'ContinuationPoint': 'ByteString',
8587
               }
8588
8589 1
    def __init__(self, binary=None):
8590
        if binary is not None:
8591
            self._binary_init(binary)
8592
            self._freeze = True
8593
            return
8594
        self.ReleaseContinuationPoint = True
8595
        self.ContinuationPoint = None
8596
        self._freeze = True
8597
8598 1
    def to_binary(self):
8599
        packet = []
8600
        packet.append(uabin.Primitives.Boolean.pack(self.ReleaseContinuationPoint))
8601
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
8602
        return b''.join(packet)
8603
8604 1
    @staticmethod
8605
    def from_binary(data):
8606
        return QueryNextParameters(data)
8607
8608 1
    def _binary_init(self, data):
8609
        self.ReleaseContinuationPoint = uabin.Primitives.Boolean.unpack(data)
8610
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
8611
8612 1
    def __str__(self):
8613
        return 'QueryNextParameters(' + 'ReleaseContinuationPoint:' + str(self.ReleaseContinuationPoint) + ', ' + \
8614
               'ContinuationPoint:' + str(self.ContinuationPoint) + ')'
8615
8616 1
    __repr__ = __str__
8617
8618
8619 1
class QueryNextRequest(FrozenClass):
8620
    '''
8621
    :ivar TypeId:
8622
    :vartype TypeId: NodeId
8623
    :ivar RequestHeader:
8624
    :vartype RequestHeader: RequestHeader
8625
    :ivar Parameters:
8626
    :vartype Parameters: QueryNextParameters
8627
    '''
8628
8629 1
    ua_types = {
8630
        'TypeId': 'NodeId',
8631
        'RequestHeader': 'RequestHeader',
8632
        'Parameters': 'QueryNextParameters',
8633
               }
8634
8635 1
    def __init__(self, binary=None):
8636
        if binary is not None:
8637
            self._binary_init(binary)
8638
            self._freeze = True
8639
            return
8640
        self.TypeId = FourByteNodeId(ObjectIds.QueryNextRequest_Encoding_DefaultBinary)
8641
        self.RequestHeader = RequestHeader()
8642
        self.Parameters = QueryNextParameters()
8643
        self._freeze = True
8644
8645 1
    def to_binary(self):
8646
        packet = []
8647
        packet.append(self.TypeId.to_binary())
8648
        packet.append(self.RequestHeader.to_binary())
8649
        packet.append(self.Parameters.to_binary())
8650
        return b''.join(packet)
8651
8652 1
    @staticmethod
8653
    def from_binary(data):
8654
        return QueryNextRequest(data)
8655
8656 1
    def _binary_init(self, data):
8657
        self.TypeId = NodeId.from_binary(data)
8658
        self.RequestHeader = RequestHeader.from_binary(data)
8659
        self.Parameters = QueryNextParameters.from_binary(data)
8660
8661 1
    def __str__(self):
8662
        return 'QueryNextRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8663
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
8664
               'Parameters:' + str(self.Parameters) + ')'
8665
8666 1
    __repr__ = __str__
8667
8668
8669 1
class QueryNextResult(FrozenClass):
8670
    '''
8671
    :ivar QueryDataSets:
8672
    :vartype QueryDataSets: QueryDataSet
8673
    :ivar RevisedContinuationPoint:
8674
    :vartype RevisedContinuationPoint: ByteString
8675
    '''
8676
8677 1
    ua_types = {
8678
        'QueryDataSets': 'QueryDataSet',
8679
        'RevisedContinuationPoint': 'ByteString',
8680
               }
8681
8682 1
    def __init__(self, binary=None):
8683
        if binary is not None:
8684
            self._binary_init(binary)
8685
            self._freeze = True
8686
            return
8687
        self.QueryDataSets = []
8688
        self.RevisedContinuationPoint = None
8689
        self._freeze = True
8690
8691 1
    def to_binary(self):
8692
        packet = []
8693
        packet.append(uabin.Primitives.Int32.pack(len(self.QueryDataSets)))
8694
        for fieldname in self.QueryDataSets:
8695
            packet.append(fieldname.to_binary())
8696
        packet.append(uabin.Primitives.ByteString.pack(self.RevisedContinuationPoint))
8697
        return b''.join(packet)
8698
8699 1
    @staticmethod
8700
    def from_binary(data):
8701
        return QueryNextResult(data)
8702
8703 1
    def _binary_init(self, data):
8704
        length = uabin.Primitives.Int32.unpack(data)
8705
        array = []
8706
        if length != -1:
8707
            for _ in range(0, length):
8708
                array.append(QueryDataSet.from_binary(data))
8709
        self.QueryDataSets = array
8710
        self.RevisedContinuationPoint = uabin.Primitives.ByteString.unpack(data)
8711
8712 1
    def __str__(self):
8713
        return 'QueryNextResult(' + 'QueryDataSets:' + str(self.QueryDataSets) + ', ' + \
8714
               'RevisedContinuationPoint:' + str(self.RevisedContinuationPoint) + ')'
8715
8716 1
    __repr__ = __str__
8717
8718
8719 1
class QueryNextResponse(FrozenClass):
8720
    '''
8721
    :ivar TypeId:
8722
    :vartype TypeId: NodeId
8723
    :ivar ResponseHeader:
8724
    :vartype ResponseHeader: ResponseHeader
8725
    :ivar Parameters:
8726
    :vartype Parameters: QueryNextResult
8727
    '''
8728
8729 1
    ua_types = {
8730
        'TypeId': 'NodeId',
8731
        'ResponseHeader': 'ResponseHeader',
8732
        'Parameters': 'QueryNextResult',
8733 View Code Duplication
               }
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8734
8735 1
    def __init__(self, binary=None):
8736
        if binary is not None:
8737
            self._binary_init(binary)
8738
            self._freeze = True
8739
            return
8740
        self.TypeId = FourByteNodeId(ObjectIds.QueryNextResponse_Encoding_DefaultBinary)
8741
        self.ResponseHeader = ResponseHeader()
8742
        self.Parameters = QueryNextResult()
8743
        self._freeze = True
8744
8745 1
    def to_binary(self):
8746
        packet = []
8747
        packet.append(self.TypeId.to_binary())
8748
        packet.append(self.ResponseHeader.to_binary())
8749
        packet.append(self.Parameters.to_binary())
8750
        return b''.join(packet)
8751
8752 1
    @staticmethod
8753
    def from_binary(data):
8754
        return QueryNextResponse(data)
8755
8756 1
    def _binary_init(self, data):
8757
        self.TypeId = NodeId.from_binary(data)
8758
        self.ResponseHeader = ResponseHeader.from_binary(data)
8759
        self.Parameters = QueryNextResult.from_binary(data)
8760
8761 1
    def __str__(self):
8762
        return 'QueryNextResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8763
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
8764
               'Parameters:' + str(self.Parameters) + ')'
8765
8766 1
    __repr__ = __str__
8767
8768
8769 1
class ReadValueId(FrozenClass):
8770
    '''
8771
    :ivar NodeId:
8772
    :vartype NodeId: NodeId
8773
    :ivar AttributeId:
8774
    :vartype AttributeId: UInt32
8775
    :ivar IndexRange:
8776
    :vartype IndexRange: String
8777
    :ivar DataEncoding:
8778
    :vartype DataEncoding: QualifiedName
8779
    '''
8780
8781 1
    ua_types = {
8782
        'NodeId': 'NodeId',
8783
        'AttributeId': 'UInt32',
8784
        'IndexRange': 'String',
8785
        'DataEncoding': 'QualifiedName',
8786
               }
8787
8788 1
    def __init__(self, binary=None):
8789 1
        if binary is not None:
8790 1
            self._binary_init(binary)
8791 1
            self._freeze = True
8792 1
            return
8793 1
        self.NodeId = NodeId()
8794 1
        self.AttributeId = 0
8795 1
        self.IndexRange = None
8796 1
        self.DataEncoding = QualifiedName()
8797 1
        self._freeze = True
8798
8799 1
    def to_binary(self):
8800 1
        packet = []
8801 1
        packet.append(self.NodeId.to_binary())
8802 1
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
8803 1
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
8804 1
        packet.append(self.DataEncoding.to_binary())
8805 1
        return b''.join(packet)
8806
8807 1
    @staticmethod
8808
    def from_binary(data):
8809 1
        return ReadValueId(data)
8810
8811 1
    def _binary_init(self, data):
8812 1
        self.NodeId = NodeId.from_binary(data)
8813 1
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
8814 1
        self.IndexRange = uabin.Primitives.String.unpack(data)
8815 1
        self.DataEncoding = QualifiedName.from_binary(data)
8816
8817 1
    def __str__(self):
8818
        return 'ReadValueId(' + 'NodeId:' + str(self.NodeId) + ', ' + \
8819
               'AttributeId:' + str(self.AttributeId) + ', ' + \
8820
               'IndexRange:' + str(self.IndexRange) + ', ' + \
8821
               'DataEncoding:' + str(self.DataEncoding) + ')'
8822
8823 1
    __repr__ = __str__
8824 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8825
8826 1
class ReadParameters(FrozenClass):
8827
    '''
8828
    :ivar MaxAge:
8829
    :vartype MaxAge: Double
8830
    :ivar TimestampsToReturn:
8831
    :vartype TimestampsToReturn: TimestampsToReturn
8832
    :ivar NodesToRead:
8833
    :vartype NodesToRead: ReadValueId
8834
    '''
8835
8836 1
    ua_types = {
8837
        'MaxAge': 'Double',
8838
        'TimestampsToReturn': 'TimestampsToReturn',
8839
        'NodesToRead': 'ReadValueId',
8840
               }
8841
8842 1
    def __init__(self, binary=None):
8843 1
        if binary is not None:
8844 1
            self._binary_init(binary)
8845 1
            self._freeze = True
8846 1
            return
8847 1
        self.MaxAge = 0
8848 1
        self.TimestampsToReturn = TimestampsToReturn(0)
8849 1
        self.NodesToRead = []
8850 1
        self._freeze = True
8851
8852 1
    def to_binary(self):
8853 1
        packet = []
8854 1
        packet.append(uabin.Primitives.Double.pack(self.MaxAge))
8855 1
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
8856 1
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToRead)))
8857 1
        for fieldname in self.NodesToRead:
8858 1
            packet.append(fieldname.to_binary())
8859 1
        return b''.join(packet)
8860
8861 1
    @staticmethod
8862
    def from_binary(data):
8863 1
        return ReadParameters(data)
8864
8865 1
    def _binary_init(self, data):
8866 1
        self.MaxAge = uabin.Primitives.Double.unpack(data)
8867 1
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
8868 1
        length = uabin.Primitives.Int32.unpack(data)
8869 1
        array = []
8870 1
        if length != -1:
8871 1
            for _ in range(0, length):
8872 1
                array.append(ReadValueId.from_binary(data))
8873 1
        self.NodesToRead = array
8874
8875 1
    def __str__(self):
8876
        return 'ReadParameters(' + 'MaxAge:' + str(self.MaxAge) + ', ' + \
8877
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
8878
               'NodesToRead:' + str(self.NodesToRead) + ')'
8879
8880 1
    __repr__ = __str__
8881
8882
8883 1
class ReadRequest(FrozenClass):
8884
    '''
8885
    :ivar TypeId:
8886
    :vartype TypeId: NodeId
8887
    :ivar RequestHeader:
8888
    :vartype RequestHeader: RequestHeader
8889
    :ivar Parameters:
8890
    :vartype Parameters: ReadParameters
8891
    '''
8892
8893 1
    ua_types = {
8894
        'TypeId': 'NodeId',
8895
        'RequestHeader': 'RequestHeader',
8896
        'Parameters': 'ReadParameters',
8897
               }
8898
8899 1
    def __init__(self, binary=None):
8900 1
        if binary is not None:
8901
            self._binary_init(binary)
8902
            self._freeze = True
8903
            return
8904 1
        self.TypeId = FourByteNodeId(ObjectIds.ReadRequest_Encoding_DefaultBinary)
8905 1
        self.RequestHeader = RequestHeader()
8906 1
        self.Parameters = ReadParameters()
8907 1
        self._freeze = True
8908
8909 1
    def to_binary(self):
8910 1
        packet = []
8911 1
        packet.append(self.TypeId.to_binary())
8912 1
        packet.append(self.RequestHeader.to_binary())
8913 1
        packet.append(self.Parameters.to_binary())
8914 1
        return b''.join(packet)
8915
8916 1
    @staticmethod
8917
    def from_binary(data):
8918
        return ReadRequest(data)
8919
8920 1
    def _binary_init(self, data):
8921
        self.TypeId = NodeId.from_binary(data)
8922
        self.RequestHeader = RequestHeader.from_binary(data)
8923
        self.Parameters = ReadParameters.from_binary(data)
8924
8925 1
    def __str__(self):
8926
        return 'ReadRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8927
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
8928
               'Parameters:' + str(self.Parameters) + ')'
8929
8930 1
    __repr__ = __str__
8931
8932
8933 1
class ReadResponse(FrozenClass):
8934
    '''
8935
    :ivar TypeId:
8936
    :vartype TypeId: NodeId
8937
    :ivar ResponseHeader:
8938
    :vartype ResponseHeader: ResponseHeader
8939
    :ivar Results:
8940
    :vartype Results: DataValue
8941
    :ivar DiagnosticInfos:
8942
    :vartype DiagnosticInfos: DiagnosticInfo
8943
    '''
8944
8945 1
    ua_types = {
8946
        'TypeId': 'NodeId',
8947
        'ResponseHeader': 'ResponseHeader',
8948
        'Results': 'DataValue',
8949
        'DiagnosticInfos': 'DiagnosticInfo',
8950
               }
8951
8952 1
    def __init__(self, binary=None):
8953 1
        if binary is not None:
8954 1
            self._binary_init(binary)
8955 1
            self._freeze = True
8956 1
            return
8957 1
        self.TypeId = FourByteNodeId(ObjectIds.ReadResponse_Encoding_DefaultBinary)
8958 1
        self.ResponseHeader = ResponseHeader()
8959 1
        self.Results = []
8960 1
        self.DiagnosticInfos = []
8961 1
        self._freeze = True
8962
8963 1
    def to_binary(self):
8964 1
        packet = []
8965 1
        packet.append(self.TypeId.to_binary())
8966 1
        packet.append(self.ResponseHeader.to_binary())
8967 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
8968 1 View Code Duplication
        for fieldname in self.Results:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
8969 1
            packet.append(fieldname.to_binary())
8970 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
8971 1
        for fieldname in self.DiagnosticInfos:
8972
            packet.append(fieldname.to_binary())
8973 1
        return b''.join(packet)
8974
8975 1
    @staticmethod
8976
    def from_binary(data):
8977 1
        return ReadResponse(data)
8978
8979 1
    def _binary_init(self, data):
8980 1
        self.TypeId = NodeId.from_binary(data)
8981 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
8982 1
        length = uabin.Primitives.Int32.unpack(data)
8983 1
        array = []
8984 1
        if length != -1:
8985 1
            for _ in range(0, length):
8986 1
                array.append(DataValue.from_binary(data))
8987 1
        self.Results = array
8988 1
        length = uabin.Primitives.Int32.unpack(data)
8989 1
        array = []
8990 1
        if length != -1:
8991 1
            for _ in range(0, length):
8992
                array.append(DiagnosticInfo.from_binary(data))
8993 1
        self.DiagnosticInfos = array
8994
8995 1
    def __str__(self):
8996
        return 'ReadResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
8997
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
8998
               'Results:' + str(self.Results) + ', ' + \
8999
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
9000
9001 1
    __repr__ = __str__
9002
9003
9004 1
class HistoryReadValueId(FrozenClass):
9005
    '''
9006
    :ivar NodeId:
9007
    :vartype NodeId: NodeId
9008
    :ivar IndexRange:
9009
    :vartype IndexRange: String
9010
    :ivar DataEncoding:
9011
    :vartype DataEncoding: QualifiedName
9012
    :ivar ContinuationPoint:
9013
    :vartype ContinuationPoint: ByteString
9014
    '''
9015
9016 1
    ua_types = {
9017
        'NodeId': 'NodeId',
9018
        'IndexRange': 'String',
9019
        'DataEncoding': 'QualifiedName',
9020
        'ContinuationPoint': 'ByteString',
9021
               }
9022
9023 1
    def __init__(self, binary=None):
9024 1
        if binary is not None:
9025
            self._binary_init(binary)
9026
            self._freeze = True
9027
            return
9028 1
        self.NodeId = NodeId()
9029 1
        self.IndexRange = None
9030 1
        self.DataEncoding = QualifiedName()
9031 1
        self.ContinuationPoint = None
9032 1
        self._freeze = True
9033
9034 1
    def to_binary(self):
9035
        packet = []
9036
        packet.append(self.NodeId.to_binary())
9037
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
9038
        packet.append(self.DataEncoding.to_binary())
9039
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
9040
        return b''.join(packet)
9041
9042 1
    @staticmethod
9043
    def from_binary(data):
9044
        return HistoryReadValueId(data)
9045
9046 1
    def _binary_init(self, data):
9047
        self.NodeId = NodeId.from_binary(data)
9048
        self.IndexRange = uabin.Primitives.String.unpack(data)
9049
        self.DataEncoding = QualifiedName.from_binary(data)
9050
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
9051
9052 1
    def __str__(self):
9053
        return 'HistoryReadValueId(' + 'NodeId:' + str(self.NodeId) + ', ' + \
9054
               'IndexRange:' + str(self.IndexRange) + ', ' + \
9055
               'DataEncoding:' + str(self.DataEncoding) + ', ' + \
9056
               'ContinuationPoint:' + str(self.ContinuationPoint) + ')'
9057
9058 1
    __repr__ = __str__
9059
9060
9061 1
class HistoryReadResult(FrozenClass):
9062
    '''
9063
    :ivar StatusCode:
9064
    :vartype StatusCode: StatusCode
9065
    :ivar ContinuationPoint:
9066
    :vartype ContinuationPoint: ByteString
9067
    :ivar HistoryData:
9068
    :vartype HistoryData: ExtensionObject
9069
    '''
9070
9071 1
    ua_types = {
9072
        'StatusCode': 'StatusCode',
9073
        'ContinuationPoint': 'ByteString',
9074
        'HistoryData': 'ExtensionObject',
9075
               }
9076
9077 1
    def __init__(self, binary=None):
9078 1
        if binary is not None:
9079
            self._binary_init(binary)
9080
            self._freeze = True
9081
            return
9082 1
        self.StatusCode = StatusCode()
9083 1
        self.ContinuationPoint = None
9084 1
        self.HistoryData = None
9085 1
        self._freeze = True
9086
9087 1
    def to_binary(self):
9088
        packet = []
9089
        packet.append(self.StatusCode.to_binary())
9090
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
9091
        packet.append(extensionobject_to_binary(self.HistoryData))
9092
        return b''.join(packet)
9093
9094 1
    @staticmethod
9095
    def from_binary(data):
9096
        return HistoryReadResult(data)
9097
9098 1
    def _binary_init(self, data):
9099
        self.StatusCode = StatusCode.from_binary(data)
9100
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
9101
        self.HistoryData = extensionobject_from_binary(data)
9102
9103 1
    def __str__(self):
9104
        return 'HistoryReadResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
9105
               'ContinuationPoint:' + str(self.ContinuationPoint) + ', ' + \
9106 View Code Duplication
               'HistoryData:' + str(self.HistoryData) + ')'
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9107
9108 1
    __repr__ = __str__
9109
9110
9111 1
class HistoryReadDetails(FrozenClass):
9112
    '''
9113
    '''
9114
9115 1
    ua_types = {
9116
               }
9117
9118 1
    def __init__(self, binary=None):
9119
        if binary is not None:
9120
            self._binary_init(binary)
9121
            self._freeze = True
9122
            return
9123
        self._freeze = True
9124
9125 1
    def to_binary(self):
9126
        packet = []
9127
        return b''.join(packet)
9128
9129 1
    @staticmethod
9130
    def from_binary(data):
9131
        return HistoryReadDetails(data)
9132
9133 1
    def _binary_init(self, data):
9134
        pass
9135
9136 1
    def __str__(self):
9137
        return 'HistoryReadDetails(' +  + ')'
9138
9139 1
    __repr__ = __str__
9140
9141
9142 1
class ReadEventDetails(FrozenClass):
9143
    '''
9144
    :ivar NumValuesPerNode:
9145
    :vartype NumValuesPerNode: UInt32
9146
    :ivar StartTime:
9147
    :vartype StartTime: DateTime
9148
    :ivar EndTime:
9149
    :vartype EndTime: DateTime
9150
    :ivar Filter:
9151
    :vartype Filter: EventFilter
9152
    '''
9153
9154 1
    ua_types = {
9155
        'NumValuesPerNode': 'UInt32',
9156
        'StartTime': 'DateTime',
9157
        'EndTime': 'DateTime',
9158
        'Filter': 'EventFilter',
9159
               }
9160
9161 1
    def __init__(self, binary=None):
9162 1
        if binary is not None:
9163 View Code Duplication
            self._binary_init(binary)
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9164
            self._freeze = True
9165
            return
9166 1
        self.NumValuesPerNode = 0
9167 1
        self.StartTime = datetime.utcnow()
9168 1
        self.EndTime = datetime.utcnow()
9169 1
        self.Filter = EventFilter()
9170 1
        self._freeze = True
9171
9172 1
    def to_binary(self):
9173
        packet = []
9174
        packet.append(uabin.Primitives.UInt32.pack(self.NumValuesPerNode))
9175
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
9176
        packet.append(uabin.Primitives.DateTime.pack(self.EndTime))
9177
        packet.append(self.Filter.to_binary())
9178
        return b''.join(packet)
9179
9180 1
    @staticmethod
9181
    def from_binary(data):
9182
        return ReadEventDetails(data)
9183
9184 1
    def _binary_init(self, data):
9185
        self.NumValuesPerNode = uabin.Primitives.UInt32.unpack(data)
9186
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
9187
        self.EndTime = uabin.Primitives.DateTime.unpack(data)
9188
        self.Filter = EventFilter.from_binary(data)
9189
9190 1
    def __str__(self):
9191
        return 'ReadEventDetails(' + 'NumValuesPerNode:' + str(self.NumValuesPerNode) + ', ' + \
9192
               'StartTime:' + str(self.StartTime) + ', ' + \
9193
               'EndTime:' + str(self.EndTime) + ', ' + \
9194
               'Filter:' + str(self.Filter) + ')'
9195
9196 1
    __repr__ = __str__
9197
9198
9199 1
class ReadRawModifiedDetails(FrozenClass):
9200
    '''
9201
    :ivar IsReadModified:
9202
    :vartype IsReadModified: Boolean
9203
    :ivar StartTime:
9204
    :vartype StartTime: DateTime
9205
    :ivar EndTime:
9206
    :vartype EndTime: DateTime
9207
    :ivar NumValuesPerNode:
9208
    :vartype NumValuesPerNode: UInt32
9209
    :ivar ReturnBounds:
9210
    :vartype ReturnBounds: Boolean
9211
    '''
9212
9213 1
    ua_types = {
9214
        'IsReadModified': 'Boolean',
9215
        'StartTime': 'DateTime',
9216
        'EndTime': 'DateTime',
9217
        'NumValuesPerNode': 'UInt32',
9218
        'ReturnBounds': 'Boolean',
9219
               }
9220
9221 1
    def __init__(self, binary=None):
9222 1
        if binary is not None:
9223
            self._binary_init(binary)
9224
            self._freeze = True
9225
            return
9226 1
        self.IsReadModified = True
9227 1 View Code Duplication
        self.StartTime = datetime.utcnow()
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9228 1
        self.EndTime = datetime.utcnow()
9229 1
        self.NumValuesPerNode = 0
9230 1
        self.ReturnBounds = True
9231 1
        self._freeze = True
9232
9233 1
    def to_binary(self):
9234
        packet = []
9235
        packet.append(uabin.Primitives.Boolean.pack(self.IsReadModified))
9236
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
9237
        packet.append(uabin.Primitives.DateTime.pack(self.EndTime))
9238
        packet.append(uabin.Primitives.UInt32.pack(self.NumValuesPerNode))
9239
        packet.append(uabin.Primitives.Boolean.pack(self.ReturnBounds))
9240
        return b''.join(packet)
9241
9242 1
    @staticmethod
9243
    def from_binary(data):
9244
        return ReadRawModifiedDetails(data)
9245
9246 1
    def _binary_init(self, data):
9247
        self.IsReadModified = uabin.Primitives.Boolean.unpack(data)
9248
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
9249
        self.EndTime = uabin.Primitives.DateTime.unpack(data)
9250
        self.NumValuesPerNode = uabin.Primitives.UInt32.unpack(data)
9251
        self.ReturnBounds = uabin.Primitives.Boolean.unpack(data)
9252
9253 1
    def __str__(self):
9254
        return 'ReadRawModifiedDetails(' + 'IsReadModified:' + str(self.IsReadModified) + ', ' + \
9255
               'StartTime:' + str(self.StartTime) + ', ' + \
9256
               'EndTime:' + str(self.EndTime) + ', ' + \
9257
               'NumValuesPerNode:' + str(self.NumValuesPerNode) + ', ' + \
9258
               'ReturnBounds:' + str(self.ReturnBounds) + ')'
9259
9260 1
    __repr__ = __str__
9261
9262
9263 1
class ReadProcessedDetails(FrozenClass):
9264
    '''
9265
    :ivar StartTime:
9266
    :vartype StartTime: DateTime
9267
    :ivar EndTime:
9268
    :vartype EndTime: DateTime
9269
    :ivar ProcessingInterval:
9270
    :vartype ProcessingInterval: Double
9271
    :ivar AggregateType:
9272
    :vartype AggregateType: NodeId
9273
    :ivar AggregateConfiguration:
9274
    :vartype AggregateConfiguration: AggregateConfiguration
9275
    '''
9276
9277 1
    ua_types = {
9278
        'StartTime': 'DateTime',
9279
        'EndTime': 'DateTime',
9280
        'ProcessingInterval': 'Double',
9281
        'AggregateType': 'NodeId',
9282
        'AggregateConfiguration': 'AggregateConfiguration',
9283
               }
9284
9285 1
    def __init__(self, binary=None):
9286
        if binary is not None:
9287
            self._binary_init(binary)
9288
            self._freeze = True
9289
            return
9290
        self.StartTime = datetime.utcnow()
9291
        self.EndTime = datetime.utcnow()
9292
        self.ProcessingInterval = 0
9293
        self.AggregateType = []
9294
        self.AggregateConfiguration = AggregateConfiguration()
9295
        self._freeze = True
9296
9297 1
    def to_binary(self):
9298
        packet = []
9299
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
9300
        packet.append(uabin.Primitives.DateTime.pack(self.EndTime))
9301
        packet.append(uabin.Primitives.Double.pack(self.ProcessingInterval))
9302
        packet.append(uabin.Primitives.Int32.pack(len(self.AggregateType)))
9303
        for fieldname in self.AggregateType:
9304
            packet.append(fieldname.to_binary())
9305
        packet.append(self.AggregateConfiguration.to_binary())
9306
        return b''.join(packet)
9307
9308 1
    @staticmethod
9309
    def from_binary(data):
9310
        return ReadProcessedDetails(data)
9311
9312 1
    def _binary_init(self, data):
9313
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
9314
        self.EndTime = uabin.Primitives.DateTime.unpack(data)
9315
        self.ProcessingInterval = uabin.Primitives.Double.unpack(data)
9316
        length = uabin.Primitives.Int32.unpack(data)
9317
        array = []
9318
        if length != -1:
9319
            for _ in range(0, length):
9320
                array.append(NodeId.from_binary(data))
9321
        self.AggregateType = array
9322
        self.AggregateConfiguration = AggregateConfiguration.from_binary(data)
9323
9324 1
    def __str__(self):
9325
        return 'ReadProcessedDetails(' + 'StartTime:' + str(self.StartTime) + ', ' + \
9326
               'EndTime:' + str(self.EndTime) + ', ' + \
9327
               'ProcessingInterval:' + str(self.ProcessingInterval) + ', ' + \
9328
               'AggregateType:' + str(self.AggregateType) + ', ' + \
9329
               'AggregateConfiguration:' + str(self.AggregateConfiguration) + ')'
9330
9331 1
    __repr__ = __str__
9332
9333
9334 1
class ReadAtTimeDetails(FrozenClass):
9335
    '''
9336
    :ivar ReqTimes:
9337
    :vartype ReqTimes: DateTime
9338
    :ivar UseSimpleBounds:
9339
    :vartype UseSimpleBounds: Boolean
9340
    '''
9341
9342 1
    ua_types = {
9343
        'ReqTimes': 'DateTime',
9344
        'UseSimpleBounds': 'Boolean',
9345
               }
9346
9347 1
    def __init__(self, binary=None):
9348
        if binary is not None:
9349
            self._binary_init(binary)
9350
            self._freeze = True
9351
            return
9352
        self.ReqTimes = []
9353
        self.UseSimpleBounds = True
9354
        self._freeze = True
9355
9356 1
    def to_binary(self):
9357
        packet = []
9358
        packet.append(uabin.Primitives.Int32.pack(len(self.ReqTimes)))
9359
        for fieldname in self.ReqTimes:
9360
            packet.append(uabin.Primitives.DateTime.pack(fieldname))
9361
        packet.append(uabin.Primitives.Boolean.pack(self.UseSimpleBounds))
9362
        return b''.join(packet)
9363
9364 1
    @staticmethod
9365
    def from_binary(data):
9366
        return ReadAtTimeDetails(data)
9367
9368 1
    def _binary_init(self, data):
9369
        self.ReqTimes = uabin.Primitives.DateTime.unpack_array(data)
9370
        self.UseSimpleBounds = uabin.Primitives.Boolean.unpack(data)
9371
9372 1
    def __str__(self):
9373
        return 'ReadAtTimeDetails(' + 'ReqTimes:' + str(self.ReqTimes) + ', ' + \
9374
               'UseSimpleBounds:' + str(self.UseSimpleBounds) + ')'
9375
9376 1
    __repr__ = __str__
9377
9378
9379 1
class HistoryData(FrozenClass):
9380
    '''
9381
    :ivar DataValues:
9382
    :vartype DataValues: DataValue
9383
    '''
9384
9385 1
    ua_types = {
9386 View Code Duplication
        'DataValues': 'DataValue',
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9387
               }
9388
9389 1
    def __init__(self, binary=None):
9390 1
        if binary is not None:
9391
            self._binary_init(binary)
9392
            self._freeze = True
9393
            return
9394 1
        self.DataValues = []
9395 1
        self._freeze = True
9396
9397 1
    def to_binary(self):
9398
        packet = []
9399
        packet.append(uabin.Primitives.Int32.pack(len(self.DataValues)))
9400
        for fieldname in self.DataValues:
9401
            packet.append(fieldname.to_binary())
9402
        return b''.join(packet)
9403
9404 1
    @staticmethod
9405
    def from_binary(data):
9406
        return HistoryData(data)
9407
9408 1
    def _binary_init(self, data):
9409
        length = uabin.Primitives.Int32.unpack(data)
9410
        array = []
9411
        if length != -1:
9412
            for _ in range(0, length):
9413
                array.append(DataValue.from_binary(data))
9414
        self.DataValues = array
9415
9416 1
    def __str__(self):
9417
        return 'HistoryData(' + 'DataValues:' + str(self.DataValues) + ')'
9418
9419 1
    __repr__ = __str__
9420
9421
9422 1
class ModificationInfo(FrozenClass):
9423
    '''
9424
    :ivar ModificationTime:
9425
    :vartype ModificationTime: DateTime
9426
    :ivar UpdateType:
9427
    :vartype UpdateType: HistoryUpdateType
9428
    :ivar UserName:
9429
    :vartype UserName: String
9430
    '''
9431
9432 1
    ua_types = {
9433
        'ModificationTime': 'DateTime',
9434
        'UpdateType': 'HistoryUpdateType',
9435
        'UserName': 'String',
9436
               }
9437
9438 1
    def __init__(self, binary=None):
9439
        if binary is not None:
9440
            self._binary_init(binary)
9441
            self._freeze = True
9442
            return
9443
        self.ModificationTime = datetime.utcnow()
9444
        self.UpdateType = HistoryUpdateType(0)
9445
        self.UserName = None
9446
        self._freeze = True
9447
9448 1
    def to_binary(self):
9449
        packet = []
9450
        packet.append(uabin.Primitives.DateTime.pack(self.ModificationTime))
9451
        packet.append(uabin.Primitives.UInt32.pack(self.UpdateType.value))
9452
        packet.append(uabin.Primitives.String.pack(self.UserName))
9453
        return b''.join(packet)
9454
9455 1
    @staticmethod
9456
    def from_binary(data):
9457
        return ModificationInfo(data)
9458
9459 1
    def _binary_init(self, data):
9460
        self.ModificationTime = uabin.Primitives.DateTime.unpack(data)
9461
        self.UpdateType = HistoryUpdateType(uabin.Primitives.UInt32.unpack(data))
9462
        self.UserName = uabin.Primitives.String.unpack(data)
9463
9464 1
    def __str__(self):
9465
        return 'ModificationInfo(' + 'ModificationTime:' + str(self.ModificationTime) + ', ' + \
9466
               'UpdateType:' + str(self.UpdateType) + ', ' + \
9467
               'UserName:' + str(self.UserName) + ')'
9468
9469 1
    __repr__ = __str__
9470 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9471
9472 1
class HistoryModifiedData(FrozenClass):
9473
    '''
9474
    :ivar DataValues:
9475
    :vartype DataValues: DataValue
9476
    :ivar ModificationInfos:
9477
    :vartype ModificationInfos: ModificationInfo
9478
    '''
9479
9480 1
    ua_types = {
9481
        'DataValues': 'DataValue',
9482
        'ModificationInfos': 'ModificationInfo',
9483
               }
9484
9485 1
    def __init__(self, binary=None):
9486
        if binary is not None:
9487
            self._binary_init(binary)
9488
            self._freeze = True
9489
            return
9490
        self.DataValues = []
9491
        self.ModificationInfos = []
9492
        self._freeze = True
9493
9494 1
    def to_binary(self):
9495
        packet = []
9496
        packet.append(uabin.Primitives.Int32.pack(len(self.DataValues)))
9497
        for fieldname in self.DataValues:
9498
            packet.append(fieldname.to_binary())
9499
        packet.append(uabin.Primitives.Int32.pack(len(self.ModificationInfos)))
9500
        for fieldname in self.ModificationInfos:
9501
            packet.append(fieldname.to_binary())
9502
        return b''.join(packet)
9503
9504 1
    @staticmethod
9505
    def from_binary(data):
9506
        return HistoryModifiedData(data)
9507
9508 1
    def _binary_init(self, data):
9509
        length = uabin.Primitives.Int32.unpack(data)
9510
        array = []
9511
        if length != -1:
9512
            for _ in range(0, length):
9513
                array.append(DataValue.from_binary(data))
9514
        self.DataValues = array
9515
        length = uabin.Primitives.Int32.unpack(data)
9516
        array = []
9517
        if length != -1:
9518
            for _ in range(0, length):
9519
                array.append(ModificationInfo.from_binary(data))
9520
        self.ModificationInfos = array
9521
9522 1
    def __str__(self):
9523
        return 'HistoryModifiedData(' + 'DataValues:' + str(self.DataValues) + ', ' + \
9524
               'ModificationInfos:' + str(self.ModificationInfos) + ')'
9525
9526 1
    __repr__ = __str__
9527
9528
9529 1
class HistoryEvent(FrozenClass):
9530
    '''
9531
    :ivar Events:
9532
    :vartype Events: HistoryEventFieldList
9533
    '''
9534
9535 1
    ua_types = {
9536
        'Events': 'HistoryEventFieldList',
9537
               }
9538
9539 1
    def __init__(self, binary=None):
9540 1
        if binary is not None:
9541
            self._binary_init(binary)
9542
            self._freeze = True
9543
            return
9544 1
        self.Events = []
9545 1
        self._freeze = True
9546
9547 1
    def to_binary(self):
9548
        packet = []
9549
        packet.append(uabin.Primitives.Int32.pack(len(self.Events)))
9550
        for fieldname in self.Events:
9551
            packet.append(fieldname.to_binary())
9552
        return b''.join(packet)
9553
9554 1
    @staticmethod
9555
    def from_binary(data):
9556
        return HistoryEvent(data)
9557
9558 1
    def _binary_init(self, data):
9559
        length = uabin.Primitives.Int32.unpack(data)
9560
        array = []
9561
        if length != -1:
9562
            for _ in range(0, length):
9563
                array.append(HistoryEventFieldList.from_binary(data))
9564
        self.Events = array
9565
9566 1
    def __str__(self):
9567
        return 'HistoryEvent(' + 'Events:' + str(self.Events) + ')'
9568
9569 1
    __repr__ = __str__
9570
9571
9572 1
class HistoryReadParameters(FrozenClass):
9573
    '''
9574
    :ivar HistoryReadDetails:
9575
    :vartype HistoryReadDetails: ExtensionObject
9576
    :ivar TimestampsToReturn:
9577
    :vartype TimestampsToReturn: TimestampsToReturn
9578
    :ivar ReleaseContinuationPoints:
9579
    :vartype ReleaseContinuationPoints: Boolean
9580
    :ivar NodesToRead:
9581
    :vartype NodesToRead: HistoryReadValueId
9582
    '''
9583
9584 1
    ua_types = {
9585
        'HistoryReadDetails': 'ExtensionObject',
9586
        'TimestampsToReturn': 'TimestampsToReturn',
9587
        'ReleaseContinuationPoints': 'Boolean',
9588
        'NodesToRead': 'HistoryReadValueId',
9589
               }
9590
9591 1
    def __init__(self, binary=None):
9592 1
        if binary is not None:
9593
            self._binary_init(binary)
9594
            self._freeze = True
9595
            return
9596 1
        self.HistoryReadDetails = None
9597 1
        self.TimestampsToReturn = TimestampsToReturn(0)
9598 1
        self.ReleaseContinuationPoints = True
9599 1
        self.NodesToRead = []
9600 1
        self._freeze = True
9601
9602 1
    def to_binary(self):
9603
        packet = []
9604
        packet.append(extensionobject_to_binary(self.HistoryReadDetails))
9605
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
9606
        packet.append(uabin.Primitives.Boolean.pack(self.ReleaseContinuationPoints))
9607
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToRead)))
9608
        for fieldname in self.NodesToRead:
9609
            packet.append(fieldname.to_binary())
9610
        return b''.join(packet)
9611
9612 1
    @staticmethod
9613
    def from_binary(data):
9614
        return HistoryReadParameters(data)
9615
9616 1
    def _binary_init(self, data):
9617
        self.HistoryReadDetails = extensionobject_from_binary(data)
9618
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
9619
        self.ReleaseContinuationPoints = uabin.Primitives.Boolean.unpack(data)
9620
        length = uabin.Primitives.Int32.unpack(data)
9621
        array = []
9622
        if length != -1:
9623
            for _ in range(0, length):
9624
                array.append(HistoryReadValueId.from_binary(data))
9625
        self.NodesToRead = array
9626
9627 1
    def __str__(self):
9628
        return 'HistoryReadParameters(' + 'HistoryReadDetails:' + str(self.HistoryReadDetails) + ', ' + \
9629
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
9630
               'ReleaseContinuationPoints:' + str(self.ReleaseContinuationPoints) + ', ' + \
9631
               'NodesToRead:' + str(self.NodesToRead) + ')'
9632
9633 1
    __repr__ = __str__
9634
9635
9636 1
class HistoryReadRequest(FrozenClass):
9637
    '''
9638
    :ivar TypeId:
9639
    :vartype TypeId: NodeId
9640
    :ivar RequestHeader:
9641
    :vartype RequestHeader: RequestHeader
9642
    :ivar Parameters:
9643
    :vartype Parameters: HistoryReadParameters
9644
    '''
9645
9646 1
    ua_types = {
9647
        'TypeId': 'NodeId',
9648
        'RequestHeader': 'RequestHeader',
9649
        'Parameters': 'HistoryReadParameters',
9650
               }
9651
9652 1
    def __init__(self, binary=None):
9653
        if binary is not None:
9654
            self._binary_init(binary)
9655
            self._freeze = True
9656
            return
9657
        self.TypeId = FourByteNodeId(ObjectIds.HistoryReadRequest_Encoding_DefaultBinary)
9658
        self.RequestHeader = RequestHeader()
9659
        self.Parameters = HistoryReadParameters()
9660
        self._freeze = True
9661
9662 1
    def to_binary(self):
9663
        packet = []
9664
        packet.append(self.TypeId.to_binary())
9665
        packet.append(self.RequestHeader.to_binary())
9666
        packet.append(self.Parameters.to_binary())
9667
        return b''.join(packet)
9668
9669 1
    @staticmethod
9670
    def from_binary(data):
9671
        return HistoryReadRequest(data)
9672
9673 1
    def _binary_init(self, data):
9674
        self.TypeId = NodeId.from_binary(data)
9675
        self.RequestHeader = RequestHeader.from_binary(data)
9676
        self.Parameters = HistoryReadParameters.from_binary(data)
9677
9678 1
    def __str__(self):
9679
        return 'HistoryReadRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9680
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
9681
               'Parameters:' + str(self.Parameters) + ')'
9682
9683 1
    __repr__ = __str__
9684
9685
9686 1
class HistoryReadResponse(FrozenClass):
9687
    '''
9688
    :ivar TypeId:
9689
    :vartype TypeId: NodeId
9690
    :ivar ResponseHeader:
9691
    :vartype ResponseHeader: ResponseHeader
9692
    :ivar Results:
9693
    :vartype Results: HistoryReadResult
9694
    :ivar DiagnosticInfos:
9695
    :vartype DiagnosticInfos: DiagnosticInfo
9696
    '''
9697
9698 1
    ua_types = {
9699
        'TypeId': 'NodeId',
9700
        'ResponseHeader': 'ResponseHeader',
9701
        'Results': 'HistoryReadResult',
9702
        'DiagnosticInfos': 'DiagnosticInfo',
9703
               }
9704
9705 1
    def __init__(self, binary=None):
9706
        if binary is not None:
9707
            self._binary_init(binary)
9708
            self._freeze = True
9709
            return
9710
        self.TypeId = FourByteNodeId(ObjectIds.HistoryReadResponse_Encoding_DefaultBinary)
9711
        self.ResponseHeader = ResponseHeader()
9712
        self.Results = []
9713
        self.DiagnosticInfos = []
9714
        self._freeze = True
9715
9716 1
    def to_binary(self):
9717
        packet = []
9718
        packet.append(self.TypeId.to_binary())
9719
        packet.append(self.ResponseHeader.to_binary())
9720
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
9721 View Code Duplication
        for fieldname in self.Results:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9722
            packet.append(fieldname.to_binary())
9723
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
9724
        for fieldname in self.DiagnosticInfos:
9725
            packet.append(fieldname.to_binary())
9726
        return b''.join(packet)
9727
9728 1
    @staticmethod
9729
    def from_binary(data):
9730
        return HistoryReadResponse(data)
9731
9732 1
    def _binary_init(self, data):
9733
        self.TypeId = NodeId.from_binary(data)
9734
        self.ResponseHeader = ResponseHeader.from_binary(data)
9735
        length = uabin.Primitives.Int32.unpack(data)
9736
        array = []
9737
        if length != -1:
9738
            for _ in range(0, length):
9739
                array.append(HistoryReadResult.from_binary(data))
9740
        self.Results = array
9741
        length = uabin.Primitives.Int32.unpack(data)
9742
        array = []
9743
        if length != -1:
9744
            for _ in range(0, length):
9745
                array.append(DiagnosticInfo.from_binary(data))
9746
        self.DiagnosticInfos = array
9747
9748 1
    def __str__(self):
9749
        return 'HistoryReadResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9750
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
9751
               'Results:' + str(self.Results) + ', ' + \
9752
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
9753
9754 1
    __repr__ = __str__
9755
9756
9757 1
class WriteValue(FrozenClass):
9758
    '''
9759
    :ivar NodeId:
9760
    :vartype NodeId: NodeId
9761
    :ivar AttributeId:
9762
    :vartype AttributeId: UInt32
9763
    :ivar IndexRange:
9764
    :vartype IndexRange: String
9765
    :ivar Value:
9766
    :vartype Value: DataValue
9767
    '''
9768
9769 1
    ua_types = {
9770
        'NodeId': 'NodeId',
9771
        'AttributeId': 'UInt32',
9772
        'IndexRange': 'String',
9773
        'Value': 'DataValue',
9774
               }
9775
9776 1
    def __init__(self, binary=None):
9777 1
        if binary is not None:
9778 1
            self._binary_init(binary)
9779 1
            self._freeze = True
9780 1
            return
9781 1
        self.NodeId = NodeId()
9782 1
        self.AttributeId = 0
9783 1
        self.IndexRange = None
9784 1
        self.Value = DataValue()
9785 1
        self._freeze = True
9786
9787 1
    def to_binary(self):
9788 1
        packet = []
9789 1
        packet.append(self.NodeId.to_binary())
9790 1
        packet.append(uabin.Primitives.UInt32.pack(self.AttributeId))
9791 1
        packet.append(uabin.Primitives.String.pack(self.IndexRange))
9792 1
        packet.append(self.Value.to_binary())
9793 1
        return b''.join(packet)
9794
9795 1
    @staticmethod
9796
    def from_binary(data):
9797 1
        return WriteValue(data)
9798
9799 1
    def _binary_init(self, data):
9800 1
        self.NodeId = NodeId.from_binary(data)
9801 1
        self.AttributeId = uabin.Primitives.UInt32.unpack(data)
9802 1
        self.IndexRange = uabin.Primitives.String.unpack(data)
9803 1
        self.Value = DataValue.from_binary(data)
9804
9805 1
    def __str__(self):
9806
        return 'WriteValue(' + 'NodeId:' + str(self.NodeId) + ', ' + \
9807
               'AttributeId:' + str(self.AttributeId) + ', ' + \
9808
               'IndexRange:' + str(self.IndexRange) + ', ' + \
9809
               'Value:' + str(self.Value) + ')'
9810
9811 1
    __repr__ = __str__
9812
9813
9814 1
class WriteParameters(FrozenClass):
9815
    '''
9816
    :ivar NodesToWrite:
9817
    :vartype NodesToWrite: WriteValue
9818
    '''
9819
9820 1
    ua_types = {
9821
        'NodesToWrite': 'WriteValue',
9822
               }
9823
9824 1
    def __init__(self, binary=None):
9825 1
        if binary is not None:
9826 1
            self._binary_init(binary)
9827 1
            self._freeze = True
9828 1
            return
9829 1
        self.NodesToWrite = []
9830 1
        self._freeze = True
9831
9832 1
    def to_binary(self):
9833 1
        packet = []
9834 1
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToWrite)))
9835 1
        for fieldname in self.NodesToWrite:
9836 1
            packet.append(fieldname.to_binary())
9837 1
        return b''.join(packet)
9838
9839 1
    @staticmethod
9840
    def from_binary(data):
9841 1
        return WriteParameters(data)
9842
9843 1
    def _binary_init(self, data):
9844 1
        length = uabin.Primitives.Int32.unpack(data)
9845 1
        array = []
9846 1
        if length != -1:
9847 1
            for _ in range(0, length):
9848 1
                array.append(WriteValue.from_binary(data))
9849 1
        self.NodesToWrite = array
9850
9851 1
    def __str__(self):
9852
        return 'WriteParameters(' + 'NodesToWrite:' + str(self.NodesToWrite) + ')'
9853
9854 1
    __repr__ = __str__
9855
9856
9857 1
class WriteRequest(FrozenClass):
9858
    '''
9859
    :ivar TypeId:
9860
    :vartype TypeId: NodeId
9861
    :ivar RequestHeader:
9862
    :vartype RequestHeader: RequestHeader
9863
    :ivar Parameters:
9864
    :vartype Parameters: WriteParameters
9865
    '''
9866
9867 1
    ua_types = {
9868
        'TypeId': 'NodeId',
9869
        'RequestHeader': 'RequestHeader',
9870
        'Parameters': 'WriteParameters',
9871
               }
9872
9873 1
    def __init__(self, binary=None):
9874 1
        if binary is not None:
9875
            self._binary_init(binary)
9876
            self._freeze = True
9877
            return
9878 1
        self.TypeId = FourByteNodeId(ObjectIds.WriteRequest_Encoding_DefaultBinary)
9879 1
        self.RequestHeader = RequestHeader()
9880 1
        self.Parameters = WriteParameters()
9881 1
        self._freeze = True
9882
9883 1
    def to_binary(self):
9884 1
        packet = []
9885 1
        packet.append(self.TypeId.to_binary())
9886 1
        packet.append(self.RequestHeader.to_binary())
9887 1
        packet.append(self.Parameters.to_binary())
9888 1
        return b''.join(packet)
9889
9890 1
    @staticmethod
9891
    def from_binary(data):
9892
        return WriteRequest(data)
9893
9894 1
    def _binary_init(self, data):
9895
        self.TypeId = NodeId.from_binary(data)
9896
        self.RequestHeader = RequestHeader.from_binary(data)
9897
        self.Parameters = WriteParameters.from_binary(data)
9898
9899 1
    def __str__(self):
9900
        return 'WriteRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9901
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
9902
               'Parameters:' + str(self.Parameters) + ')'
9903
9904 1
    __repr__ = __str__
9905
9906
9907 1
class WriteResponse(FrozenClass):
9908
    '''
9909
    :ivar TypeId:
9910
    :vartype TypeId: NodeId
9911
    :ivar ResponseHeader:
9912
    :vartype ResponseHeader: ResponseHeader
9913
    :ivar Results:
9914
    :vartype Results: StatusCode
9915
    :ivar DiagnosticInfos:
9916
    :vartype DiagnosticInfos: DiagnosticInfo
9917
    '''
9918
9919 1
    ua_types = {
9920
        'TypeId': 'NodeId',
9921
        'ResponseHeader': 'ResponseHeader',
9922
        'Results': 'StatusCode',
9923
        'DiagnosticInfos': 'DiagnosticInfo',
9924
               }
9925
9926 1
    def __init__(self, binary=None):
9927 1
        if binary is not None:
9928 1
            self._binary_init(binary)
9929 1
            self._freeze = True
9930 1
            return
9931 1
        self.TypeId = FourByteNodeId(ObjectIds.WriteResponse_Encoding_DefaultBinary)
9932 1
        self.ResponseHeader = ResponseHeader()
9933 1
        self.Results = []
9934 1
        self.DiagnosticInfos = []
9935 1
        self._freeze = True
9936
9937 1
    def to_binary(self):
9938 1
        packet = []
9939 1
        packet.append(self.TypeId.to_binary())
9940 1
        packet.append(self.ResponseHeader.to_binary())
9941 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
9942 1
        for fieldname in self.Results:
9943 1
            packet.append(fieldname.to_binary())
9944 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
9945 1
        for fieldname in self.DiagnosticInfos:
9946
            packet.append(fieldname.to_binary())
9947 1
        return b''.join(packet)
9948
9949 1
    @staticmethod
9950
    def from_binary(data):
9951 1
        return WriteResponse(data)
9952
9953 1
    def _binary_init(self, data):
9954 1
        self.TypeId = NodeId.from_binary(data)
9955 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
9956 1
        length = uabin.Primitives.Int32.unpack(data)
9957 1
        array = []
9958 1
        if length != -1:
9959 1
            for _ in range(0, length):
9960 1
                array.append(StatusCode.from_binary(data))
9961 1
        self.Results = array
9962 1
        length = uabin.Primitives.Int32.unpack(data)
9963 1
        array = []
9964 1
        if length != -1:
9965 1
            for _ in range(0, length):
9966
                array.append(DiagnosticInfo.from_binary(data))
9967 1
        self.DiagnosticInfos = array
9968
9969 1
    def __str__(self):
9970
        return 'WriteResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
9971
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
9972
               'Results:' + str(self.Results) + ', ' + \
9973
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
9974
9975 1
    __repr__ = __str__
9976 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
9977
9978 1
class HistoryUpdateDetails(FrozenClass):
9979
    '''
9980
    :ivar NodeId:
9981
    :vartype NodeId: NodeId
9982
    '''
9983
9984 1
    ua_types = {
9985
        'NodeId': 'NodeId',
9986
               }
9987
9988 1
    def __init__(self, binary=None):
9989
        if binary is not None:
9990
            self._binary_init(binary)
9991
            self._freeze = True
9992
            return
9993
        self.NodeId = NodeId()
9994
        self._freeze = True
9995
9996 1
    def to_binary(self):
9997
        packet = []
9998
        packet.append(self.NodeId.to_binary())
9999
        return b''.join(packet)
10000
10001 1
    @staticmethod
10002
    def from_binary(data):
10003
        return HistoryUpdateDetails(data)
10004
10005 1
    def _binary_init(self, data):
10006
        self.NodeId = NodeId.from_binary(data)
10007
10008 1
    def __str__(self):
10009
        return 'HistoryUpdateDetails(' + 'NodeId:' + str(self.NodeId) + ')'
10010
10011 1
    __repr__ = __str__
10012 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10013
10014 1
class UpdateDataDetails(FrozenClass):
10015
    '''
10016
    :ivar NodeId:
10017
    :vartype NodeId: NodeId
10018
    :ivar PerformInsertReplace:
10019
    :vartype PerformInsertReplace: PerformUpdateType
10020
    :ivar UpdateValues:
10021
    :vartype UpdateValues: DataValue
10022
    '''
10023
10024 1
    ua_types = {
10025
        'NodeId': 'NodeId',
10026
        'PerformInsertReplace': 'PerformUpdateType',
10027
        'UpdateValues': 'DataValue',
10028
               }
10029
10030 1
    def __init__(self, binary=None):
10031
        if binary is not None:
10032
            self._binary_init(binary)
10033
            self._freeze = True
10034
            return
10035
        self.NodeId = NodeId()
10036
        self.PerformInsertReplace = PerformUpdateType(0)
10037
        self.UpdateValues = []
10038
        self._freeze = True
10039
10040 1
    def to_binary(self):
10041
        packet = []
10042
        packet.append(self.NodeId.to_binary())
10043
        packet.append(uabin.Primitives.UInt32.pack(self.PerformInsertReplace.value))
10044
        packet.append(uabin.Primitives.Int32.pack(len(self.UpdateValues)))
10045
        for fieldname in self.UpdateValues:
10046
            packet.append(fieldname.to_binary())
10047
        return b''.join(packet)
10048
10049 1
    @staticmethod
10050
    def from_binary(data):
10051
        return UpdateDataDetails(data)
10052
10053 1
    def _binary_init(self, data):
10054
        self.NodeId = NodeId.from_binary(data)
10055
        self.PerformInsertReplace = PerformUpdateType(uabin.Primitives.UInt32.unpack(data))
10056
        length = uabin.Primitives.Int32.unpack(data)
10057
        array = []
10058
        if length != -1:
10059
            for _ in range(0, length):
10060
                array.append(DataValue.from_binary(data))
10061
        self.UpdateValues = array
10062
10063 1
    def __str__(self):
10064
        return 'UpdateDataDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10065
               'PerformInsertReplace:' + str(self.PerformInsertReplace) + ', ' + \
10066
               'UpdateValues:' + str(self.UpdateValues) + ')'
10067
10068 1
    __repr__ = __str__
10069 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10070
10071 1
class UpdateStructureDataDetails(FrozenClass):
10072
    '''
10073
    :ivar NodeId:
10074
    :vartype NodeId: NodeId
10075
    :ivar PerformInsertReplace:
10076
    :vartype PerformInsertReplace: PerformUpdateType
10077
    :ivar UpdateValues:
10078
    :vartype UpdateValues: DataValue
10079
    '''
10080
10081 1
    ua_types = {
10082
        'NodeId': 'NodeId',
10083
        'PerformInsertReplace': 'PerformUpdateType',
10084
        'UpdateValues': 'DataValue',
10085
               }
10086
10087 1
    def __init__(self, binary=None):
10088
        if binary is not None:
10089
            self._binary_init(binary)
10090
            self._freeze = True
10091
            return
10092
        self.NodeId = NodeId()
10093
        self.PerformInsertReplace = PerformUpdateType(0)
10094
        self.UpdateValues = []
10095
        self._freeze = True
10096
10097 1
    def to_binary(self):
10098
        packet = []
10099
        packet.append(self.NodeId.to_binary())
10100
        packet.append(uabin.Primitives.UInt32.pack(self.PerformInsertReplace.value))
10101
        packet.append(uabin.Primitives.Int32.pack(len(self.UpdateValues)))
10102
        for fieldname in self.UpdateValues:
10103
            packet.append(fieldname.to_binary())
10104
        return b''.join(packet)
10105
10106 1
    @staticmethod
10107
    def from_binary(data):
10108
        return UpdateStructureDataDetails(data)
10109
10110 1
    def _binary_init(self, data):
10111
        self.NodeId = NodeId.from_binary(data)
10112
        self.PerformInsertReplace = PerformUpdateType(uabin.Primitives.UInt32.unpack(data))
10113
        length = uabin.Primitives.Int32.unpack(data)
10114
        array = []
10115
        if length != -1:
10116
            for _ in range(0, length):
10117
                array.append(DataValue.from_binary(data))
10118
        self.UpdateValues = array
10119
10120 1
    def __str__(self):
10121
        return 'UpdateStructureDataDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10122
               'PerformInsertReplace:' + str(self.PerformInsertReplace) + ', ' + \
10123
               'UpdateValues:' + str(self.UpdateValues) + ')'
10124
10125 1
    __repr__ = __str__
10126
10127
10128 1
class UpdateEventDetails(FrozenClass):
10129
    '''
10130
    :ivar NodeId:
10131
    :vartype NodeId: NodeId
10132
    :ivar PerformInsertReplace:
10133
    :vartype PerformInsertReplace: PerformUpdateType
10134
    :ivar Filter:
10135
    :vartype Filter: EventFilter
10136
    :ivar EventData:
10137
    :vartype EventData: HistoryEventFieldList
10138
    '''
10139
10140 1
    ua_types = {
10141
        'NodeId': 'NodeId',
10142
        'PerformInsertReplace': 'PerformUpdateType',
10143
        'Filter': 'EventFilter',
10144
        'EventData': 'HistoryEventFieldList',
10145
               }
10146
10147 1
    def __init__(self, binary=None):
10148
        if binary is not None:
10149
            self._binary_init(binary)
10150
            self._freeze = True
10151
            return
10152
        self.NodeId = NodeId()
10153
        self.PerformInsertReplace = PerformUpdateType(0)
10154
        self.Filter = EventFilter()
10155
        self.EventData = []
10156 View Code Duplication
        self._freeze = True
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10157
10158 1
    def to_binary(self):
10159
        packet = []
10160
        packet.append(self.NodeId.to_binary())
10161
        packet.append(uabin.Primitives.UInt32.pack(self.PerformInsertReplace.value))
10162
        packet.append(self.Filter.to_binary())
10163
        packet.append(uabin.Primitives.Int32.pack(len(self.EventData)))
10164
        for fieldname in self.EventData:
10165
            packet.append(fieldname.to_binary())
10166
        return b''.join(packet)
10167
10168 1
    @staticmethod
10169
    def from_binary(data):
10170
        return UpdateEventDetails(data)
10171
10172 1
    def _binary_init(self, data):
10173
        self.NodeId = NodeId.from_binary(data)
10174
        self.PerformInsertReplace = PerformUpdateType(uabin.Primitives.UInt32.unpack(data))
10175
        self.Filter = EventFilter.from_binary(data)
10176
        length = uabin.Primitives.Int32.unpack(data)
10177
        array = []
10178
        if length != -1:
10179
            for _ in range(0, length):
10180
                array.append(HistoryEventFieldList.from_binary(data))
10181
        self.EventData = array
10182
10183 1
    def __str__(self):
10184
        return 'UpdateEventDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10185
               'PerformInsertReplace:' + str(self.PerformInsertReplace) + ', ' + \
10186
               'Filter:' + str(self.Filter) + ', ' + \
10187
               'EventData:' + str(self.EventData) + ')'
10188
10189 1
    __repr__ = __str__
10190
10191
10192 1
class DeleteRawModifiedDetails(FrozenClass):
10193
    '''
10194
    :ivar NodeId:
10195
    :vartype NodeId: NodeId
10196
    :ivar IsDeleteModified:
10197
    :vartype IsDeleteModified: Boolean
10198
    :ivar StartTime:
10199
    :vartype StartTime: DateTime
10200
    :ivar EndTime:
10201
    :vartype EndTime: DateTime
10202
    '''
10203
10204 1
    ua_types = {
10205
        'NodeId': 'NodeId',
10206
        'IsDeleteModified': 'Boolean',
10207
        'StartTime': 'DateTime',
10208
        'EndTime': 'DateTime',
10209
               }
10210
10211 1
    def __init__(self, binary=None):
10212
        if binary is not None:
10213
            self._binary_init(binary)
10214
            self._freeze = True
10215
            return
10216
        self.NodeId = NodeId()
10217
        self.IsDeleteModified = True
10218
        self.StartTime = datetime.utcnow()
10219
        self.EndTime = datetime.utcnow()
10220
        self._freeze = True
10221
10222 1
    def to_binary(self):
10223
        packet = []
10224
        packet.append(self.NodeId.to_binary())
10225
        packet.append(uabin.Primitives.Boolean.pack(self.IsDeleteModified))
10226
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
10227
        packet.append(uabin.Primitives.DateTime.pack(self.EndTime))
10228
        return b''.join(packet)
10229
10230 1
    @staticmethod
10231
    def from_binary(data):
10232
        return DeleteRawModifiedDetails(data)
10233
10234 1
    def _binary_init(self, data):
10235
        self.NodeId = NodeId.from_binary(data)
10236
        self.IsDeleteModified = uabin.Primitives.Boolean.unpack(data)
10237
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
10238
        self.EndTime = uabin.Primitives.DateTime.unpack(data)
10239
10240 1
    def __str__(self):
10241
        return 'DeleteRawModifiedDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10242
               'IsDeleteModified:' + str(self.IsDeleteModified) + ', ' + \
10243
               'StartTime:' + str(self.StartTime) + ', ' + \
10244
               'EndTime:' + str(self.EndTime) + ')'
10245
10246 1
    __repr__ = __str__
10247
10248
10249 1
class DeleteAtTimeDetails(FrozenClass):
10250
    '''
10251
    :ivar NodeId:
10252
    :vartype NodeId: NodeId
10253
    :ivar ReqTimes:
10254
    :vartype ReqTimes: DateTime
10255
    '''
10256
10257 1
    ua_types = {
10258
        'NodeId': 'NodeId',
10259
        'ReqTimes': 'DateTime',
10260
               }
10261
10262 1
    def __init__(self, binary=None):
10263
        if binary is not None:
10264
            self._binary_init(binary)
10265
            self._freeze = True
10266
            return
10267
        self.NodeId = NodeId()
10268
        self.ReqTimes = []
10269
        self._freeze = True
10270
10271 1
    def to_binary(self):
10272
        packet = []
10273
        packet.append(self.NodeId.to_binary())
10274
        packet.append(uabin.Primitives.Int32.pack(len(self.ReqTimes)))
10275
        for fieldname in self.ReqTimes:
10276
            packet.append(uabin.Primitives.DateTime.pack(fieldname))
10277
        return b''.join(packet)
10278
10279 1
    @staticmethod
10280
    def from_binary(data):
10281
        return DeleteAtTimeDetails(data)
10282
10283 1
    def _binary_init(self, data):
10284
        self.NodeId = NodeId.from_binary(data)
10285
        self.ReqTimes = uabin.Primitives.DateTime.unpack_array(data)
10286
10287 1
    def __str__(self):
10288
        return 'DeleteAtTimeDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10289
               'ReqTimes:' + str(self.ReqTimes) + ')'
10290
10291 1
    __repr__ = __str__
10292
10293
10294 1
class DeleteEventDetails(FrozenClass):
10295
    '''
10296
    :ivar NodeId:
10297
    :vartype NodeId: NodeId
10298
    :ivar EventIds:
10299
    :vartype EventIds: ByteString
10300
    '''
10301
10302 1
    ua_types = {
10303
        'NodeId': 'NodeId',
10304
        'EventIds': 'ByteString',
10305
               }
10306
10307 1
    def __init__(self, binary=None):
10308
        if binary is not None:
10309
            self._binary_init(binary)
10310
            self._freeze = True
10311
            return
10312
        self.NodeId = NodeId()
10313
        self.EventIds = []
10314
        self._freeze = True
10315
10316 1
    def to_binary(self):
10317
        packet = []
10318
        packet.append(self.NodeId.to_binary())
10319
        packet.append(uabin.Primitives.Int32.pack(len(self.EventIds)))
10320
        for fieldname in self.EventIds:
10321
            packet.append(uabin.Primitives.ByteString.pack(fieldname))
10322
        return b''.join(packet)
10323
10324 1
    @staticmethod
10325
    def from_binary(data):
10326
        return DeleteEventDetails(data)
10327
10328 1
    def _binary_init(self, data):
10329
        self.NodeId = NodeId.from_binary(data)
10330
        self.EventIds = uabin.Primitives.ByteString.unpack_array(data)
10331
10332 1
    def __str__(self):
10333
        return 'DeleteEventDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10334
               'EventIds:' + str(self.EventIds) + ')'
10335
10336 1
    __repr__ = __str__
10337
10338
10339 1
class HistoryUpdateResult(FrozenClass):
10340
    '''
10341
    :ivar StatusCode:
10342
    :vartype StatusCode: StatusCode
10343
    :ivar OperationResults:
10344
    :vartype OperationResults: StatusCode
10345
    :ivar DiagnosticInfos:
10346
    :vartype DiagnosticInfos: DiagnosticInfo
10347
    '''
10348
10349 1
    ua_types = {
10350
        'StatusCode': 'StatusCode',
10351
        'OperationResults': 'StatusCode',
10352
        'DiagnosticInfos': 'DiagnosticInfo',
10353
               }
10354
10355 1
    def __init__(self, binary=None):
10356
        if binary is not None:
10357
            self._binary_init(binary)
10358
            self._freeze = True
10359
            return
10360
        self.StatusCode = StatusCode()
10361
        self.OperationResults = []
10362
        self.DiagnosticInfos = []
10363
        self._freeze = True
10364
10365 1
    def to_binary(self):
10366
        packet = []
10367
        packet.append(self.StatusCode.to_binary())
10368
        packet.append(uabin.Primitives.Int32.pack(len(self.OperationResults)))
10369
        for fieldname in self.OperationResults:
10370
            packet.append(fieldname.to_binary())
10371
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
10372
        for fieldname in self.DiagnosticInfos:
10373
            packet.append(fieldname.to_binary())
10374
        return b''.join(packet)
10375
10376 1
    @staticmethod
10377
    def from_binary(data):
10378
        return HistoryUpdateResult(data)
10379
10380 1
    def _binary_init(self, data):
10381
        self.StatusCode = StatusCode.from_binary(data)
10382
        length = uabin.Primitives.Int32.unpack(data)
10383
        array = []
10384
        if length != -1:
10385
            for _ in range(0, length):
10386
                array.append(StatusCode.from_binary(data))
10387
        self.OperationResults = array
10388
        length = uabin.Primitives.Int32.unpack(data)
10389
        array = []
10390
        if length != -1:
10391
            for _ in range(0, length):
10392
                array.append(DiagnosticInfo.from_binary(data))
10393
        self.DiagnosticInfos = array
10394
10395 1
    def __str__(self):
10396
        return 'HistoryUpdateResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
10397
               'OperationResults:' + str(self.OperationResults) + ', ' + \
10398
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
10399
10400 1
    __repr__ = __str__
10401
10402
10403 1
class HistoryUpdateParameters(FrozenClass):
10404
    '''
10405
    :ivar HistoryUpdateDetails:
10406
    :vartype HistoryUpdateDetails: ExtensionObject
10407
    '''
10408
10409 1
    ua_types = {
10410
        'HistoryUpdateDetails': 'ExtensionObject',
10411
               }
10412
10413 1
    def __init__(self, binary=None):
10414
        if binary is not None:
10415
            self._binary_init(binary)
10416
            self._freeze = True
10417
            return
10418
        self.HistoryUpdateDetails = []
10419
        self._freeze = True
10420
10421 1
    def to_binary(self):
10422
        packet = []
10423
        packet.append(uabin.Primitives.Int32.pack(len(self.HistoryUpdateDetails)))
10424
        for fieldname in self.HistoryUpdateDetails:
10425
            packet.append(extensionobject_to_binary(fieldname))
10426
        return b''.join(packet)
10427
10428 1
    @staticmethod
10429
    def from_binary(data):
10430
        return HistoryUpdateParameters(data)
10431
10432 1
    def _binary_init(self, data):
10433
        length = uabin.Primitives.Int32.unpack(data)
10434
        array = []
10435
        if length != -1:
10436
            for _ in range(0, length):
10437
                array.append(extensionobject_from_binary(data))
10438
        self.HistoryUpdateDetails = array
10439
10440 1
    def __str__(self):
10441
        return 'HistoryUpdateParameters(' + 'HistoryUpdateDetails:' + str(self.HistoryUpdateDetails) + ')'
10442
10443 1
    __repr__ = __str__
10444
10445
10446 1
class HistoryUpdateRequest(FrozenClass):
10447
    '''
10448
    :ivar TypeId:
10449
    :vartype TypeId: NodeId
10450
    :ivar RequestHeader:
10451
    :vartype RequestHeader: RequestHeader
10452
    :ivar Parameters:
10453
    :vartype Parameters: HistoryUpdateParameters
10454
    '''
10455
10456 1
    ua_types = {
10457
        'TypeId': 'NodeId',
10458
        'RequestHeader': 'RequestHeader',
10459
        'Parameters': 'HistoryUpdateParameters',
10460
               }
10461
10462 1
    def __init__(self, binary=None):
10463
        if binary is not None:
10464
            self._binary_init(binary)
10465
            self._freeze = True
10466
            return
10467
        self.TypeId = FourByteNodeId(ObjectIds.HistoryUpdateRequest_Encoding_DefaultBinary)
10468
        self.RequestHeader = RequestHeader()
10469
        self.Parameters = HistoryUpdateParameters()
10470
        self._freeze = True
10471
10472 1
    def to_binary(self):
10473
        packet = []
10474
        packet.append(self.TypeId.to_binary())
10475
        packet.append(self.RequestHeader.to_binary())
10476
        packet.append(self.Parameters.to_binary())
10477
        return b''.join(packet)
10478
10479 1
    @staticmethod
10480
    def from_binary(data):
10481
        return HistoryUpdateRequest(data)
10482
10483 1
    def _binary_init(self, data):
10484
        self.TypeId = NodeId.from_binary(data)
10485
        self.RequestHeader = RequestHeader.from_binary(data)
10486
        self.Parameters = HistoryUpdateParameters.from_binary(data)
10487
10488 1
    def __str__(self):
10489
        return 'HistoryUpdateRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10490
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
10491
               'Parameters:' + str(self.Parameters) + ')'
10492
10493 1
    __repr__ = __str__
10494
10495
10496 1
class HistoryUpdateResponse(FrozenClass):
10497
    '''
10498
    :ivar TypeId:
10499
    :vartype TypeId: NodeId
10500
    :ivar ResponseHeader:
10501
    :vartype ResponseHeader: ResponseHeader
10502
    :ivar Results:
10503
    :vartype Results: HistoryUpdateResult
10504
    :ivar DiagnosticInfos:
10505
    :vartype DiagnosticInfos: DiagnosticInfo
10506
    '''
10507
10508 1
    ua_types = {
10509
        'TypeId': 'NodeId',
10510
        'ResponseHeader': 'ResponseHeader',
10511
        'Results': 'HistoryUpdateResult',
10512
        'DiagnosticInfos': 'DiagnosticInfo',
10513
               }
10514
10515 1
    def __init__(self, binary=None):
10516
        if binary is not None:
10517
            self._binary_init(binary)
10518
            self._freeze = True
10519
            return
10520
        self.TypeId = FourByteNodeId(ObjectIds.HistoryUpdateResponse_Encoding_DefaultBinary)
10521
        self.ResponseHeader = ResponseHeader()
10522
        self.Results = []
10523
        self.DiagnosticInfos = []
10524
        self._freeze = True
10525
10526 1
    def to_binary(self):
10527
        packet = []
10528
        packet.append(self.TypeId.to_binary())
10529
        packet.append(self.ResponseHeader.to_binary())
10530
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
10531
        for fieldname in self.Results:
10532
            packet.append(fieldname.to_binary())
10533
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
10534
        for fieldname in self.DiagnosticInfos:
10535
            packet.append(fieldname.to_binary())
10536
        return b''.join(packet)
10537
10538 1
    @staticmethod
10539
    def from_binary(data):
10540
        return HistoryUpdateResponse(data)
10541
10542 1
    def _binary_init(self, data):
10543
        self.TypeId = NodeId.from_binary(data)
10544
        self.ResponseHeader = ResponseHeader.from_binary(data)
10545
        length = uabin.Primitives.Int32.unpack(data)
10546
        array = []
10547
        if length != -1:
10548
            for _ in range(0, length):
10549
                array.append(HistoryUpdateResult.from_binary(data))
10550
        self.Results = array
10551
        length = uabin.Primitives.Int32.unpack(data)
10552
        array = []
10553
        if length != -1:
10554
            for _ in range(0, length):
10555
                array.append(DiagnosticInfo.from_binary(data))
10556
        self.DiagnosticInfos = array
10557
10558 1
    def __str__(self):
10559
        return 'HistoryUpdateResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10560
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
10561
               'Results:' + str(self.Results) + ', ' + \
10562
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
10563
10564 1
    __repr__ = __str__
10565 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10566
10567 1
class CallMethodRequest(FrozenClass):
10568
    '''
10569
    :ivar ObjectId:
10570
    :vartype ObjectId: NodeId
10571
    :ivar MethodId:
10572
    :vartype MethodId: NodeId
10573
    :ivar InputArguments:
10574
    :vartype InputArguments: Variant
10575
    '''
10576
10577 1
    ua_types = {
10578
        'ObjectId': 'NodeId',
10579
        'MethodId': 'NodeId',
10580
        'InputArguments': 'Variant',
10581
               }
10582
10583 1
    def __init__(self, binary=None):
10584 1
        if binary is not None:
10585 1
            self._binary_init(binary)
10586 1
            self._freeze = True
10587 1
            return
10588 1
        self.ObjectId = NodeId()
10589 1
        self.MethodId = NodeId()
10590 1
        self.InputArguments = []
10591 1
        self._freeze = True
10592
10593 1
    def to_binary(self):
10594 1
        packet = []
10595 1
        packet.append(self.ObjectId.to_binary())
10596 1
        packet.append(self.MethodId.to_binary())
10597 1
        packet.append(uabin.Primitives.Int32.pack(len(self.InputArguments)))
10598 1
        for fieldname in self.InputArguments:
10599 1
            packet.append(fieldname.to_binary())
10600 1
        return b''.join(packet)
10601
10602 1
    @staticmethod
10603
    def from_binary(data):
10604 1
        return CallMethodRequest(data)
10605
10606 1
    def _binary_init(self, data):
10607 1
        self.ObjectId = NodeId.from_binary(data)
10608 1
        self.MethodId = NodeId.from_binary(data)
10609 1
        length = uabin.Primitives.Int32.unpack(data)
10610 1
        array = []
10611 1
        if length != -1:
10612 1
            for _ in range(0, length):
10613 1
                array.append(Variant.from_binary(data))
10614 1
        self.InputArguments = array
10615
10616 1
    def __str__(self):
10617 1
        return 'CallMethodRequest(' + 'ObjectId:' + str(self.ObjectId) + ', ' + \
10618
               'MethodId:' + str(self.MethodId) + ', ' + \
10619
               'InputArguments:' + str(self.InputArguments) + ')'
10620
10621 1
    __repr__ = __str__
10622
10623
10624 1
class CallMethodResult(FrozenClass):
10625
    '''
10626
    :ivar StatusCode:
10627
    :vartype StatusCode: StatusCode
10628
    :ivar InputArgumentResults:
10629
    :vartype InputArgumentResults: StatusCode
10630
    :ivar InputArgumentDiagnosticInfos:
10631
    :vartype InputArgumentDiagnosticInfos: DiagnosticInfo
10632
    :ivar OutputArguments:
10633
    :vartype OutputArguments: Variant
10634
    '''
10635
10636 1
    ua_types = {
10637
        'StatusCode': 'StatusCode',
10638
        'InputArgumentResults': 'StatusCode',
10639
        'InputArgumentDiagnosticInfos': 'DiagnosticInfo',
10640
        'OutputArguments': 'Variant',
10641
               }
10642
10643 1
    def __init__(self, binary=None):
10644 1
        if binary is not None:
10645 1
            self._binary_init(binary)
10646 1
            self._freeze = True
10647 1
            return
10648 1
        self.StatusCode = StatusCode()
10649 1
        self.InputArgumentResults = []
10650 1
        self.InputArgumentDiagnosticInfos = []
10651 1
        self.OutputArguments = []
10652 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...
10653
10654 1
    def to_binary(self):
10655 1
        packet = []
10656 1
        packet.append(self.StatusCode.to_binary())
10657 1
        packet.append(uabin.Primitives.Int32.pack(len(self.InputArgumentResults)))
10658 1
        for fieldname in self.InputArgumentResults:
10659 1
            packet.append(fieldname.to_binary())
10660 1
        packet.append(uabin.Primitives.Int32.pack(len(self.InputArgumentDiagnosticInfos)))
10661 1
        for fieldname in self.InputArgumentDiagnosticInfos:
10662
            packet.append(fieldname.to_binary())
10663 1
        packet.append(uabin.Primitives.Int32.pack(len(self.OutputArguments)))
10664 1
        for fieldname in self.OutputArguments:
10665 1
            packet.append(fieldname.to_binary())
10666 1
        return b''.join(packet)
10667
10668 1
    @staticmethod
10669
    def from_binary(data):
10670 1
        return CallMethodResult(data)
10671
10672 1
    def _binary_init(self, data):
10673 1
        self.StatusCode = StatusCode.from_binary(data)
10674 1
        length = uabin.Primitives.Int32.unpack(data)
10675 1
        array = []
10676 1
        if length != -1:
10677 1
            for _ in range(0, length):
10678 1
                array.append(StatusCode.from_binary(data))
10679 1
        self.InputArgumentResults = array
10680 1
        length = uabin.Primitives.Int32.unpack(data)
10681 1
        array = []
10682 1
        if length != -1:
10683 1
            for _ in range(0, length):
10684
                array.append(DiagnosticInfo.from_binary(data))
10685 1
        self.InputArgumentDiagnosticInfos = array
10686 1
        length = uabin.Primitives.Int32.unpack(data)
10687 1
        array = []
10688 1
        if length != -1:
10689 1
            for _ in range(0, length):
10690 1
                array.append(Variant.from_binary(data))
10691 1
        self.OutputArguments = array
10692
10693 1
    def __str__(self):
10694
        return 'CallMethodResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
10695
               'InputArgumentResults:' + str(self.InputArgumentResults) + ', ' + \
10696
               'InputArgumentDiagnosticInfos:' + str(self.InputArgumentDiagnosticInfos) + ', ' + \
10697
               'OutputArguments:' + str(self.OutputArguments) + ')'
10698
10699 1
    __repr__ = __str__
10700
10701
10702 1
class CallParameters(FrozenClass):
10703
    '''
10704
    :ivar MethodsToCall:
10705
    :vartype MethodsToCall: CallMethodRequest
10706
    '''
10707
10708 1
    ua_types = {
10709
        'MethodsToCall': 'CallMethodRequest',
10710
               }
10711
10712 1
    def __init__(self, binary=None):
10713 1
        if binary is not None:
10714 1
            self._binary_init(binary)
10715 1
            self._freeze = True
10716 1
            return
10717 1
        self.MethodsToCall = []
10718 1
        self._freeze = True
10719
10720 1
    def to_binary(self):
10721 1
        packet = []
10722 1
        packet.append(uabin.Primitives.Int32.pack(len(self.MethodsToCall)))
10723 1
        for fieldname in self.MethodsToCall:
10724 1
            packet.append(fieldname.to_binary())
10725 1
        return b''.join(packet)
10726
10727 1
    @staticmethod
10728
    def from_binary(data):
10729 1
        return CallParameters(data)
10730
10731 1
    def _binary_init(self, data):
10732 1
        length = uabin.Primitives.Int32.unpack(data)
10733 1
        array = []
10734 1
        if length != -1:
10735 1
            for _ in range(0, length):
10736 1
                array.append(CallMethodRequest.from_binary(data))
10737 1
        self.MethodsToCall = array
10738
10739 1
    def __str__(self):
10740
        return 'CallParameters(' + 'MethodsToCall:' + str(self.MethodsToCall) + ')'
10741
10742 1
    __repr__ = __str__
10743
10744
10745 1
class CallRequest(FrozenClass):
10746
    '''
10747
    :ivar TypeId:
10748
    :vartype TypeId: NodeId
10749
    :ivar RequestHeader:
10750
    :vartype RequestHeader: RequestHeader
10751
    :ivar Parameters:
10752
    :vartype Parameters: CallParameters
10753
    '''
10754
10755 1
    ua_types = {
10756
        'TypeId': 'NodeId',
10757
        'RequestHeader': 'RequestHeader',
10758
        'Parameters': 'CallParameters',
10759
               }
10760
10761 1
    def __init__(self, binary=None):
10762 1
        if binary is not None:
10763
            self._binary_init(binary)
10764
            self._freeze = True
10765
            return
10766 1
        self.TypeId = FourByteNodeId(ObjectIds.CallRequest_Encoding_DefaultBinary)
10767 1
        self.RequestHeader = RequestHeader()
10768 1
        self.Parameters = CallParameters()
10769 1
        self._freeze = True
10770
10771 1
    def to_binary(self):
10772 1
        packet = []
10773 1
        packet.append(self.TypeId.to_binary())
10774 1
        packet.append(self.RequestHeader.to_binary())
10775 1
        packet.append(self.Parameters.to_binary())
10776 1
        return b''.join(packet)
10777
10778 1
    @staticmethod
10779
    def from_binary(data):
10780
        return CallRequest(data)
10781
10782 1
    def _binary_init(self, data):
10783
        self.TypeId = NodeId.from_binary(data)
10784
        self.RequestHeader = RequestHeader.from_binary(data)
10785
        self.Parameters = CallParameters.from_binary(data)
10786
10787 1
    def __str__(self):
10788
        return 'CallRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10789
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
10790
               'Parameters:' + str(self.Parameters) + ')'
10791
10792 1
    __repr__ = __str__
10793
10794
10795 1
class CallResponse(FrozenClass):
10796
    '''
10797
    :ivar TypeId:
10798
    :vartype TypeId: NodeId
10799
    :ivar ResponseHeader:
10800
    :vartype ResponseHeader: ResponseHeader
10801
    :ivar Results:
10802
    :vartype Results: CallMethodResult
10803
    :ivar DiagnosticInfos:
10804
    :vartype DiagnosticInfos: DiagnosticInfo
10805
    '''
10806
10807 1
    ua_types = {
10808
        'TypeId': 'NodeId',
10809
        'ResponseHeader': 'ResponseHeader',
10810
        'Results': 'CallMethodResult',
10811
        'DiagnosticInfos': 'DiagnosticInfo',
10812
               }
10813
10814 1
    def __init__(self, binary=None):
10815 1
        if binary is not None:
10816 1
            self._binary_init(binary)
10817 1
            self._freeze = True
10818 1
            return
10819 1
        self.TypeId = FourByteNodeId(ObjectIds.CallResponse_Encoding_DefaultBinary)
10820 1
        self.ResponseHeader = ResponseHeader()
10821 1
        self.Results = []
10822 1
        self.DiagnosticInfos = []
10823 1
        self._freeze = True
10824
10825 1
    def to_binary(self):
10826 1
        packet = []
10827 1
        packet.append(self.TypeId.to_binary())
10828 1
        packet.append(self.ResponseHeader.to_binary())
10829 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
10830 1
        for fieldname in self.Results:
10831 1
            packet.append(fieldname.to_binary())
10832 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
10833 1
        for fieldname in self.DiagnosticInfos:
10834
            packet.append(fieldname.to_binary())
10835 1
        return b''.join(packet)
10836
10837 1
    @staticmethod
10838
    def from_binary(data):
10839 1
        return CallResponse(data)
10840
10841 1
    def _binary_init(self, data):
10842 1
        self.TypeId = NodeId.from_binary(data)
10843 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
10844 1
        length = uabin.Primitives.Int32.unpack(data)
10845 1
        array = []
10846 1
        if length != -1:
10847 1
            for _ in range(0, length):
10848 1
                array.append(CallMethodResult.from_binary(data))
10849 1
        self.Results = array
10850 1
        length = uabin.Primitives.Int32.unpack(data)
10851 1
        array = []
10852 1
        if length != -1:
10853 1
            for _ in range(0, length):
10854
                array.append(DiagnosticInfo.from_binary(data))
10855 1
        self.DiagnosticInfos = array
10856
10857 1
    def __str__(self):
10858
        return 'CallResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
10859
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
10860
               'Results:' + str(self.Results) + ', ' + \
10861
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
10862
10863 1
    __repr__ = __str__
10864
10865
10866 1
class MonitoringFilter(FrozenClass):
10867
    '''
10868
    '''
10869
10870 1
    ua_types = {
10871
               }
10872
10873 1
    def __init__(self, binary=None):
10874
        if binary is not None:
10875
            self._binary_init(binary)
10876
            self._freeze = True
10877
            return
10878
        self._freeze = True
10879
10880 1
    def to_binary(self):
10881
        packet = []
10882
        return b''.join(packet)
10883
10884 1
    @staticmethod
10885
    def from_binary(data):
10886
        return MonitoringFilter(data)
10887
10888 1
    def _binary_init(self, data):
10889
        pass
10890
10891 1
    def __str__(self):
10892
        return 'MonitoringFilter(' +  + ')'
10893
10894 1
    __repr__ = __str__
10895
10896
10897 1
class DataChangeFilter(FrozenClass):
10898
    '''
10899
    :ivar Trigger:
10900
    :vartype Trigger: DataChangeTrigger
10901
    :ivar DeadbandType:
10902
    :vartype DeadbandType: UInt32
10903
    :ivar DeadbandValue:
10904
    :vartype DeadbandValue: Double
10905
    '''
10906
10907 1
    ua_types = {
10908
        'Trigger': 'DataChangeTrigger',
10909
        'DeadbandType': 'UInt32',
10910
        'DeadbandValue': 'Double',
10911
               }
10912
10913 1
    def __init__(self, binary=None):
10914
        if binary is not None:
10915
            self._binary_init(binary)
10916
            self._freeze = True
10917
            return
10918
        self.Trigger = DataChangeTrigger(0)
10919
        self.DeadbandType = 0
10920
        self.DeadbandValue = 0
10921
        self._freeze = True
10922
10923 1
    def to_binary(self):
10924
        packet = []
10925
        packet.append(uabin.Primitives.UInt32.pack(self.Trigger.value))
10926
        packet.append(uabin.Primitives.UInt32.pack(self.DeadbandType))
10927
        packet.append(uabin.Primitives.Double.pack(self.DeadbandValue))
10928
        return b''.join(packet)
10929
10930 1
    @staticmethod
10931
    def from_binary(data):
10932
        return DataChangeFilter(data)
10933
10934 1
    def _binary_init(self, data):
10935
        self.Trigger = DataChangeTrigger(uabin.Primitives.UInt32.unpack(data))
10936
        self.DeadbandType = uabin.Primitives.UInt32.unpack(data)
10937
        self.DeadbandValue = uabin.Primitives.Double.unpack(data)
10938
10939 1
    def __str__(self):
10940
        return 'DataChangeFilter(' + 'Trigger:' + str(self.Trigger) + ', ' + \
10941
               'DeadbandType:' + str(self.DeadbandType) + ', ' + \
10942
               'DeadbandValue:' + str(self.DeadbandValue) + ')'
10943
10944 1
    __repr__ = __str__
10945
10946
10947 1
class EventFilter(FrozenClass):
10948
    '''
10949
    :ivar SelectClauses:
10950
    :vartype SelectClauses: SimpleAttributeOperand
10951
    :ivar WhereClause:
10952
    :vartype WhereClause: ContentFilter
10953
    '''
10954
10955 1
    ua_types = {
10956
        'SelectClauses': 'SimpleAttributeOperand',
10957
        'WhereClause': 'ContentFilter',
10958
               }
10959
10960 1
    def __init__(self, binary=None):
10961 1 View Code Duplication
        if binary is not None:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
10962 1
            self._binary_init(binary)
10963 1
            self._freeze = True
10964 1
            return
10965 1
        self.SelectClauses = []
10966 1
        self.WhereClause = ContentFilter()
10967 1
        self._freeze = True
10968
10969 1
    def to_binary(self):
10970 1
        packet = []
10971 1
        packet.append(uabin.Primitives.Int32.pack(len(self.SelectClauses)))
10972 1
        for fieldname in self.SelectClauses:
10973 1
            packet.append(fieldname.to_binary())
10974 1
        packet.append(self.WhereClause.to_binary())
10975 1
        return b''.join(packet)
10976
10977 1
    @staticmethod
10978
    def from_binary(data):
10979 1
        return EventFilter(data)
10980
10981 1
    def _binary_init(self, data):
10982 1
        length = uabin.Primitives.Int32.unpack(data)
10983 1
        array = []
10984 1
        if length != -1:
10985 1
            for _ in range(0, length):
10986 1
                array.append(SimpleAttributeOperand.from_binary(data))
10987 1
        self.SelectClauses = array
10988 1
        self.WhereClause = ContentFilter.from_binary(data)
10989
10990 1
    def __str__(self):
10991
        return 'EventFilter(' + 'SelectClauses:' + str(self.SelectClauses) + ', ' + \
10992
               'WhereClause:' + str(self.WhereClause) + ')'
10993
10994 1
    __repr__ = __str__
10995
10996
10997 1
class AggregateConfiguration(FrozenClass):
10998
    '''
10999
    :ivar UseServerCapabilitiesDefaults:
11000
    :vartype UseServerCapabilitiesDefaults: Boolean
11001
    :ivar TreatUncertainAsBad:
11002
    :vartype TreatUncertainAsBad: Boolean
11003
    :ivar PercentDataBad:
11004
    :vartype PercentDataBad: Byte
11005
    :ivar PercentDataGood:
11006
    :vartype PercentDataGood: Byte
11007
    :ivar UseSlopedExtrapolation:
11008
    :vartype UseSlopedExtrapolation: Boolean
11009
    '''
11010
11011 1
    ua_types = {
11012
        'UseServerCapabilitiesDefaults': 'Boolean',
11013
        'TreatUncertainAsBad': 'Boolean',
11014
        'PercentDataBad': 'Byte',
11015
        'PercentDataGood': 'Byte',
11016
        'UseSlopedExtrapolation': 'Boolean',
11017
               }
11018
11019 1
    def __init__(self, binary=None):
11020
        if binary is not None:
11021
            self._binary_init(binary)
11022
            self._freeze = True
11023
            return
11024
        self.UseServerCapabilitiesDefaults = True
11025 View Code Duplication
        self.TreatUncertainAsBad = True
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11026
        self.PercentDataBad = 0
11027
        self.PercentDataGood = 0
11028
        self.UseSlopedExtrapolation = True
11029
        self._freeze = True
11030
11031 1
    def to_binary(self):
11032
        packet = []
11033
        packet.append(uabin.Primitives.Boolean.pack(self.UseServerCapabilitiesDefaults))
11034
        packet.append(uabin.Primitives.Boolean.pack(self.TreatUncertainAsBad))
11035
        packet.append(uabin.Primitives.Byte.pack(self.PercentDataBad))
11036
        packet.append(uabin.Primitives.Byte.pack(self.PercentDataGood))
11037
        packet.append(uabin.Primitives.Boolean.pack(self.UseSlopedExtrapolation))
11038
        return b''.join(packet)
11039
11040 1
    @staticmethod
11041
    def from_binary(data):
11042
        return AggregateConfiguration(data)
11043
11044 1
    def _binary_init(self, data):
11045
        self.UseServerCapabilitiesDefaults = uabin.Primitives.Boolean.unpack(data)
11046
        self.TreatUncertainAsBad = uabin.Primitives.Boolean.unpack(data)
11047
        self.PercentDataBad = uabin.Primitives.Byte.unpack(data)
11048
        self.PercentDataGood = uabin.Primitives.Byte.unpack(data)
11049
        self.UseSlopedExtrapolation = uabin.Primitives.Boolean.unpack(data)
11050
11051 1
    def __str__(self):
11052
        return 'AggregateConfiguration(' + 'UseServerCapabilitiesDefaults:' + str(self.UseServerCapabilitiesDefaults) + ', ' + \
11053
               'TreatUncertainAsBad:' + str(self.TreatUncertainAsBad) + ', ' + \
11054
               'PercentDataBad:' + str(self.PercentDataBad) + ', ' + \
11055
               'PercentDataGood:' + str(self.PercentDataGood) + ', ' + \
11056
               'UseSlopedExtrapolation:' + str(self.UseSlopedExtrapolation) + ')'
11057
11058 1
    __repr__ = __str__
11059
11060
11061 1
class AggregateFilter(FrozenClass):
11062
    '''
11063
    :ivar StartTime:
11064
    :vartype StartTime: DateTime
11065
    :ivar AggregateType:
11066
    :vartype AggregateType: NodeId
11067
    :ivar ProcessingInterval:
11068
    :vartype ProcessingInterval: Double
11069
    :ivar AggregateConfiguration:
11070
    :vartype AggregateConfiguration: AggregateConfiguration
11071
    '''
11072
11073 1
    ua_types = {
11074
        'StartTime': 'DateTime',
11075
        'AggregateType': 'NodeId',
11076
        'ProcessingInterval': 'Double',
11077
        'AggregateConfiguration': 'AggregateConfiguration',
11078
               }
11079
11080 1
    def __init__(self, binary=None):
11081
        if binary is not None:
11082
            self._binary_init(binary)
11083
            self._freeze = True
11084
            return
11085
        self.StartTime = datetime.utcnow()
11086
        self.AggregateType = NodeId()
11087
        self.ProcessingInterval = 0
11088
        self.AggregateConfiguration = AggregateConfiguration()
11089
        self._freeze = True
11090
11091 1
    def to_binary(self):
11092
        packet = []
11093
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
11094
        packet.append(self.AggregateType.to_binary())
11095
        packet.append(uabin.Primitives.Double.pack(self.ProcessingInterval))
11096
        packet.append(self.AggregateConfiguration.to_binary())
11097
        return b''.join(packet)
11098
11099 1
    @staticmethod
11100
    def from_binary(data):
11101
        return AggregateFilter(data)
11102
11103 1
    def _binary_init(self, data):
11104
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
11105
        self.AggregateType = NodeId.from_binary(data)
11106
        self.ProcessingInterval = uabin.Primitives.Double.unpack(data)
11107
        self.AggregateConfiguration = AggregateConfiguration.from_binary(data)
11108
11109 1
    def __str__(self):
11110
        return 'AggregateFilter(' + 'StartTime:' + str(self.StartTime) + ', ' + \
11111
               'AggregateType:' + str(self.AggregateType) + ', ' + \
11112
               'ProcessingInterval:' + str(self.ProcessingInterval) + ', ' + \
11113
               'AggregateConfiguration:' + str(self.AggregateConfiguration) + ')'
11114
11115 1
    __repr__ = __str__
11116
11117
11118 1
class MonitoringFilterResult(FrozenClass):
11119
    '''
11120
    '''
11121
11122 1
    ua_types = {
11123
               }
11124
11125 1
    def __init__(self, binary=None):
11126
        if binary is not None:
11127
            self._binary_init(binary)
11128
            self._freeze = True
11129
            return
11130
        self._freeze = True
11131
11132 1
    def to_binary(self):
11133
        packet = []
11134
        return b''.join(packet)
11135
11136 1
    @staticmethod
11137
    def from_binary(data):
11138
        return MonitoringFilterResult(data)
11139
11140 1
    def _binary_init(self, data):
11141
        pass
11142
11143 1
    def __str__(self):
11144
        return 'MonitoringFilterResult(' +  + ')'
11145
11146 1
    __repr__ = __str__
11147
11148
11149 1
class EventFilterResult(FrozenClass):
11150
    '''
11151
    :ivar SelectClauseResults:
11152
    :vartype SelectClauseResults: StatusCode
11153
    :ivar SelectClauseDiagnosticInfos:
11154
    :vartype SelectClauseDiagnosticInfos: DiagnosticInfo
11155
    :ivar WhereClauseResult:
11156
    :vartype WhereClauseResult: ContentFilterResult
11157
    '''
11158
11159 1
    ua_types = {
11160
        'SelectClauseResults': 'StatusCode',
11161
        'SelectClauseDiagnosticInfos': 'DiagnosticInfo',
11162
        'WhereClauseResult': 'ContentFilterResult',
11163
               }
11164
11165 1
    def __init__(self, binary=None):
11166
        if binary is not None:
11167
            self._binary_init(binary)
11168
            self._freeze = True
11169
            return
11170
        self.SelectClauseResults = []
11171
        self.SelectClauseDiagnosticInfos = []
11172
        self.WhereClauseResult = ContentFilterResult()
11173
        self._freeze = True
11174
11175 1
    def to_binary(self):
11176
        packet = []
11177
        packet.append(uabin.Primitives.Int32.pack(len(self.SelectClauseResults)))
11178
        for fieldname in self.SelectClauseResults:
11179
            packet.append(fieldname.to_binary())
11180
        packet.append(uabin.Primitives.Int32.pack(len(self.SelectClauseDiagnosticInfos)))
11181
        for fieldname in self.SelectClauseDiagnosticInfos:
11182
            packet.append(fieldname.to_binary())
11183
        packet.append(self.WhereClauseResult.to_binary())
11184
        return b''.join(packet)
11185
11186 1
    @staticmethod
11187
    def from_binary(data):
11188
        return EventFilterResult(data)
11189
11190 1
    def _binary_init(self, data):
11191
        length = uabin.Primitives.Int32.unpack(data)
11192
        array = []
11193
        if length != -1:
11194
            for _ in range(0, length):
11195
                array.append(StatusCode.from_binary(data))
11196
        self.SelectClauseResults = array
11197
        length = uabin.Primitives.Int32.unpack(data)
11198
        array = []
11199
        if length != -1:
11200
            for _ in range(0, length):
11201
                array.append(DiagnosticInfo.from_binary(data))
11202
        self.SelectClauseDiagnosticInfos = array
11203
        self.WhereClauseResult = ContentFilterResult.from_binary(data)
11204
11205 1
    def __str__(self):
11206
        return 'EventFilterResult(' + 'SelectClauseResults:' + str(self.SelectClauseResults) + ', ' + \
11207
               'SelectClauseDiagnosticInfos:' + str(self.SelectClauseDiagnosticInfos) + ', ' + \
11208
               'WhereClauseResult:' + str(self.WhereClauseResult) + ')'
11209
11210 1
    __repr__ = __str__
11211
11212
11213 1
class AggregateFilterResult(FrozenClass):
11214
    '''
11215
    :ivar RevisedStartTime:
11216
    :vartype RevisedStartTime: DateTime
11217
    :ivar RevisedProcessingInterval:
11218
    :vartype RevisedProcessingInterval: Double
11219
    :ivar RevisedAggregateConfiguration:
11220
    :vartype RevisedAggregateConfiguration: AggregateConfiguration
11221
    '''
11222
11223 1
    ua_types = {
11224
        'RevisedStartTime': 'DateTime',
11225
        'RevisedProcessingInterval': 'Double',
11226
        'RevisedAggregateConfiguration': 'AggregateConfiguration',
11227
               }
11228
11229 1
    def __init__(self, binary=None):
11230
        if binary is not None:
11231
            self._binary_init(binary)
11232
            self._freeze = True
11233
            return
11234
        self.RevisedStartTime = datetime.utcnow()
11235
        self.RevisedProcessingInterval = 0
11236
        self.RevisedAggregateConfiguration = AggregateConfiguration()
11237
        self._freeze = True
11238
11239 1
    def to_binary(self):
11240
        packet = []
11241
        packet.append(uabin.Primitives.DateTime.pack(self.RevisedStartTime))
11242
        packet.append(uabin.Primitives.Double.pack(self.RevisedProcessingInterval))
11243
        packet.append(self.RevisedAggregateConfiguration.to_binary())
11244
        return b''.join(packet)
11245
11246 1
    @staticmethod
11247
    def from_binary(data):
11248
        return AggregateFilterResult(data)
11249
11250 1
    def _binary_init(self, data):
11251
        self.RevisedStartTime = uabin.Primitives.DateTime.unpack(data)
11252
        self.RevisedProcessingInterval = uabin.Primitives.Double.unpack(data)
11253
        self.RevisedAggregateConfiguration = AggregateConfiguration.from_binary(data)
11254
11255 1
    def __str__(self):
11256
        return 'AggregateFilterResult(' + 'RevisedStartTime:' + str(self.RevisedStartTime) + ', ' + \
11257
               'RevisedProcessingInterval:' + str(self.RevisedProcessingInterval) + ', ' + \
11258
               'RevisedAggregateConfiguration:' + str(self.RevisedAggregateConfiguration) + ')'
11259
11260 1
    __repr__ = __str__
11261
11262
11263 1
class MonitoringParameters(FrozenClass):
11264
    '''
11265
    :ivar ClientHandle:
11266
    :vartype ClientHandle: UInt32
11267
    :ivar SamplingInterval:
11268
    :vartype SamplingInterval: Double
11269
    :ivar Filter:
11270
    :vartype Filter: ExtensionObject
11271
    :ivar QueueSize:
11272
    :vartype QueueSize: UInt32
11273
    :ivar DiscardOldest:
11274
    :vartype DiscardOldest: Boolean
11275
    '''
11276
11277 1
    ua_types = {
11278
        'ClientHandle': 'UInt32',
11279
        'SamplingInterval': 'Double',
11280
        'Filter': 'ExtensionObject',
11281
        'QueueSize': 'UInt32',
11282
        'DiscardOldest': 'Boolean',
11283
               }
11284
11285 1
    def __init__(self, binary=None):
11286 1
        if binary is not None:
11287 1
            self._binary_init(binary)
11288 1
            self._freeze = True
11289 1
            return
11290 1
        self.ClientHandle = 0
11291 1
        self.SamplingInterval = 0
11292 1
        self.Filter = None
11293 1
        self.QueueSize = 0
11294 1
        self.DiscardOldest = True
11295 1
        self._freeze = True
11296
11297 1
    def to_binary(self):
11298 1
        packet = []
11299 1
        packet.append(uabin.Primitives.UInt32.pack(self.ClientHandle))
11300 1
        packet.append(uabin.Primitives.Double.pack(self.SamplingInterval))
11301 1
        packet.append(extensionobject_to_binary(self.Filter))
11302 1
        packet.append(uabin.Primitives.UInt32.pack(self.QueueSize))
11303 1
        packet.append(uabin.Primitives.Boolean.pack(self.DiscardOldest))
11304 1
        return b''.join(packet)
11305
11306 1
    @staticmethod
11307
    def from_binary(data):
11308 1
        return MonitoringParameters(data)
11309
11310 1
    def _binary_init(self, data):
11311 1
        self.ClientHandle = uabin.Primitives.UInt32.unpack(data)
11312 1
        self.SamplingInterval = uabin.Primitives.Double.unpack(data)
11313 1
        self.Filter = extensionobject_from_binary(data)
11314 1
        self.QueueSize = uabin.Primitives.UInt32.unpack(data)
11315 1
        self.DiscardOldest = uabin.Primitives.Boolean.unpack(data)
11316
11317 1
    def __str__(self):
11318
        return 'MonitoringParameters(' + 'ClientHandle:' + str(self.ClientHandle) + ', ' + \
11319
               'SamplingInterval:' + str(self.SamplingInterval) + ', ' + \
11320
               'Filter:' + str(self.Filter) + ', ' + \
11321
               'QueueSize:' + str(self.QueueSize) + ', ' + \
11322
               'DiscardOldest:' + str(self.DiscardOldest) + ')'
11323
11324 1
    __repr__ = __str__
11325
11326
11327 1
class MonitoredItemCreateRequest(FrozenClass):
11328
    '''
11329
    :ivar ItemToMonitor:
11330
    :vartype ItemToMonitor: ReadValueId
11331
    :ivar MonitoringMode:
11332
    :vartype MonitoringMode: MonitoringMode
11333
    :ivar RequestedParameters:
11334
    :vartype RequestedParameters: MonitoringParameters
11335
    '''
11336
11337 1
    ua_types = {
11338
        'ItemToMonitor': 'ReadValueId',
11339
        'MonitoringMode': 'MonitoringMode',
11340
        'RequestedParameters': 'MonitoringParameters',
11341
               }
11342
11343 1
    def __init__(self, binary=None):
11344 1
        if binary is not None:
11345 1
            self._binary_init(binary)
11346 1
            self._freeze = True
11347 1
            return
11348 1
        self.ItemToMonitor = ReadValueId()
11349 1
        self.MonitoringMode = MonitoringMode(0)
11350 1
        self.RequestedParameters = MonitoringParameters()
11351 1
        self._freeze = True
11352
11353 1
    def to_binary(self):
11354 1
        packet = []
11355 1
        packet.append(self.ItemToMonitor.to_binary())
11356 1
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoringMode.value))
11357 1
        packet.append(self.RequestedParameters.to_binary())
11358 1
        return b''.join(packet)
11359
11360 1
    @staticmethod
11361
    def from_binary(data):
11362 1
        return MonitoredItemCreateRequest(data)
11363
11364 1
    def _binary_init(self, data):
11365 1
        self.ItemToMonitor = ReadValueId.from_binary(data)
11366 1
        self.MonitoringMode = MonitoringMode(uabin.Primitives.UInt32.unpack(data))
11367 1
        self.RequestedParameters = MonitoringParameters.from_binary(data)
11368
11369 1
    def __str__(self):
11370
        return 'MonitoredItemCreateRequest(' + 'ItemToMonitor:' + str(self.ItemToMonitor) + ', ' + \
11371
               'MonitoringMode:' + str(self.MonitoringMode) + ', ' + \
11372
               'RequestedParameters:' + str(self.RequestedParameters) + ')'
11373
11374 1
    __repr__ = __str__
11375
11376
11377 1
class MonitoredItemCreateResult(FrozenClass):
11378
    '''
11379
    :ivar StatusCode:
11380
    :vartype StatusCode: StatusCode
11381
    :ivar MonitoredItemId:
11382
    :vartype MonitoredItemId: UInt32
11383
    :ivar RevisedSamplingInterval:
11384
    :vartype RevisedSamplingInterval: Double
11385
    :ivar RevisedQueueSize:
11386
    :vartype RevisedQueueSize: UInt32
11387
    :ivar FilterResult:
11388
    :vartype FilterResult: ExtensionObject
11389
    '''
11390
11391 1
    ua_types = {
11392
        'StatusCode': 'StatusCode',
11393
        'MonitoredItemId': 'UInt32',
11394
        'RevisedSamplingInterval': 'Double',
11395
        'RevisedQueueSize': 'UInt32',
11396
        'FilterResult': 'ExtensionObject',
11397
               }
11398
11399 1
    def __init__(self, binary=None):
11400 1
        if binary is not None:
11401 1
            self._binary_init(binary)
11402 1
            self._freeze = True
11403 1
            return
11404 1
        self.StatusCode = StatusCode()
11405 1
        self.MonitoredItemId = 0
11406 1
        self.RevisedSamplingInterval = 0
11407 1
        self.RevisedQueueSize = 0
11408 1
        self.FilterResult = None
11409 1
        self._freeze = True
11410
11411 1
    def to_binary(self):
11412 1
        packet = []
11413 1
        packet.append(self.StatusCode.to_binary())
11414 1
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoredItemId))
11415 1
        packet.append(uabin.Primitives.Double.pack(self.RevisedSamplingInterval))
11416 1
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedQueueSize))
11417 1
        packet.append(extensionobject_to_binary(self.FilterResult))
11418 1
        return b''.join(packet)
11419
11420 1
    @staticmethod
11421
    def from_binary(data):
11422 1
        return MonitoredItemCreateResult(data)
11423
11424 1
    def _binary_init(self, data):
11425 1
        self.StatusCode = StatusCode.from_binary(data)
11426 1
        self.MonitoredItemId = uabin.Primitives.UInt32.unpack(data)
11427 1
        self.RevisedSamplingInterval = uabin.Primitives.Double.unpack(data)
11428 1
        self.RevisedQueueSize = uabin.Primitives.UInt32.unpack(data)
11429 1
        self.FilterResult = extensionobject_from_binary(data)
11430
11431 1
    def __str__(self):
11432
        return 'MonitoredItemCreateResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
11433
               'MonitoredItemId:' + str(self.MonitoredItemId) + ', ' + \
11434
               'RevisedSamplingInterval:' + str(self.RevisedSamplingInterval) + ', ' + \
11435
               'RevisedQueueSize:' + str(self.RevisedQueueSize) + ', ' + \
11436
               'FilterResult:' + str(self.FilterResult) + ')'
11437
11438 1
    __repr__ = __str__
11439 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11440
11441 1
class CreateMonitoredItemsParameters(FrozenClass):
11442
    '''
11443
    :ivar SubscriptionId:
11444
    :vartype SubscriptionId: UInt32
11445
    :ivar TimestampsToReturn:
11446
    :vartype TimestampsToReturn: TimestampsToReturn
11447
    :ivar ItemsToCreate:
11448
    :vartype ItemsToCreate: MonitoredItemCreateRequest
11449
    '''
11450
11451 1
    ua_types = {
11452
        'SubscriptionId': 'UInt32',
11453
        'TimestampsToReturn': 'TimestampsToReturn',
11454
        'ItemsToCreate': 'MonitoredItemCreateRequest',
11455
               }
11456
11457 1
    def __init__(self, binary=None):
11458 1
        if binary is not None:
11459 1
            self._binary_init(binary)
11460 1
            self._freeze = True
11461 1
            return
11462 1
        self.SubscriptionId = 0
11463 1
        self.TimestampsToReturn = TimestampsToReturn(0)
11464 1
        self.ItemsToCreate = []
11465 1
        self._freeze = True
11466
11467 1
    def to_binary(self):
11468 1
        packet = []
11469 1
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
11470 1
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
11471 1
        packet.append(uabin.Primitives.Int32.pack(len(self.ItemsToCreate)))
11472 1
        for fieldname in self.ItemsToCreate:
11473 1
            packet.append(fieldname.to_binary())
11474 1
        return b''.join(packet)
11475
11476 1
    @staticmethod
11477
    def from_binary(data):
11478 1
        return CreateMonitoredItemsParameters(data)
11479
11480 1
    def _binary_init(self, data):
11481 1
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
11482 1
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
11483 1
        length = uabin.Primitives.Int32.unpack(data)
11484 1
        array = []
11485 1
        if length != -1:
11486 1
            for _ in range(0, length):
11487 1
                array.append(MonitoredItemCreateRequest.from_binary(data))
11488 1
        self.ItemsToCreate = array
11489
11490 1
    def __str__(self):
11491
        return 'CreateMonitoredItemsParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
11492
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
11493
               'ItemsToCreate:' + str(self.ItemsToCreate) + ')'
11494
11495 1
    __repr__ = __str__
11496
11497
11498 1
class CreateMonitoredItemsRequest(FrozenClass):
11499
    '''
11500
    :ivar TypeId:
11501
    :vartype TypeId: NodeId
11502
    :ivar RequestHeader:
11503
    :vartype RequestHeader: RequestHeader
11504
    :ivar Parameters:
11505
    :vartype Parameters: CreateMonitoredItemsParameters
11506
    '''
11507
11508 1
    ua_types = {
11509
        'TypeId': 'NodeId',
11510
        'RequestHeader': 'RequestHeader',
11511
        'Parameters': 'CreateMonitoredItemsParameters',
11512
               }
11513
11514 1
    def __init__(self, binary=None):
11515 1
        if binary is not None:
11516
            self._binary_init(binary)
11517
            self._freeze = True
11518
            return
11519 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateMonitoredItemsRequest_Encoding_DefaultBinary)
11520 1
        self.RequestHeader = RequestHeader()
11521 1
        self.Parameters = CreateMonitoredItemsParameters()
11522 1
        self._freeze = True
11523
11524 1
    def to_binary(self):
11525 1
        packet = []
11526 1
        packet.append(self.TypeId.to_binary())
11527 1
        packet.append(self.RequestHeader.to_binary())
11528 1
        packet.append(self.Parameters.to_binary())
11529 1
        return b''.join(packet)
11530
11531 1
    @staticmethod
11532
    def from_binary(data):
11533
        return CreateMonitoredItemsRequest(data)
11534
11535 1
    def _binary_init(self, data):
11536
        self.TypeId = NodeId.from_binary(data)
11537
        self.RequestHeader = RequestHeader.from_binary(data)
11538
        self.Parameters = CreateMonitoredItemsParameters.from_binary(data)
11539
11540 1
    def __str__(self):
11541
        return 'CreateMonitoredItemsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11542
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
11543
               'Parameters:' + str(self.Parameters) + ')'
11544
11545 1
    __repr__ = __str__
11546
11547
11548 1
class CreateMonitoredItemsResponse(FrozenClass):
11549
    '''
11550
    :ivar TypeId:
11551
    :vartype TypeId: NodeId
11552
    :ivar ResponseHeader:
11553
    :vartype ResponseHeader: ResponseHeader
11554
    :ivar Results:
11555
    :vartype Results: MonitoredItemCreateResult
11556
    :ivar DiagnosticInfos:
11557
    :vartype DiagnosticInfos: DiagnosticInfo
11558
    '''
11559
11560 1
    ua_types = {
11561
        'TypeId': 'NodeId',
11562
        'ResponseHeader': 'ResponseHeader',
11563
        'Results': 'MonitoredItemCreateResult',
11564
        'DiagnosticInfos': 'DiagnosticInfo',
11565
               }
11566
11567 1
    def __init__(self, binary=None):
11568 1
        if binary is not None:
11569 1
            self._binary_init(binary)
11570 1
            self._freeze = True
11571 1
            return
11572 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateMonitoredItemsResponse_Encoding_DefaultBinary)
11573 1
        self.ResponseHeader = ResponseHeader()
11574 1
        self.Results = []
11575 1
        self.DiagnosticInfos = []
11576 1
        self._freeze = True
11577
11578 1
    def to_binary(self):
11579 1
        packet = []
11580 1
        packet.append(self.TypeId.to_binary())
11581 1
        packet.append(self.ResponseHeader.to_binary())
11582 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
11583 1
        for fieldname in self.Results:
11584 1
            packet.append(fieldname.to_binary())
11585 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
11586 1
        for fieldname in self.DiagnosticInfos:
11587
            packet.append(fieldname.to_binary())
11588 1
        return b''.join(packet)
11589
11590 1
    @staticmethod
11591
    def from_binary(data):
11592 1
        return CreateMonitoredItemsResponse(data)
11593
11594 1
    def _binary_init(self, data):
11595 1
        self.TypeId = NodeId.from_binary(data)
11596 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
11597 1
        length = uabin.Primitives.Int32.unpack(data)
11598 1
        array = []
11599 1
        if length != -1:
11600 1
            for _ in range(0, length):
11601 1
                array.append(MonitoredItemCreateResult.from_binary(data))
11602 1
        self.Results = array
11603 1
        length = uabin.Primitives.Int32.unpack(data)
11604 1
        array = []
11605 1
        if length != -1:
11606 1
            for _ in range(0, length):
11607
                array.append(DiagnosticInfo.from_binary(data))
11608 1
        self.DiagnosticInfos = array
11609
11610 1
    def __str__(self):
11611
        return 'CreateMonitoredItemsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11612
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
11613
               'Results:' + str(self.Results) + ', ' + \
11614
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
11615
11616 1
    __repr__ = __str__
11617
11618
11619 1
class MonitoredItemModifyRequest(FrozenClass):
11620
    '''
11621
    :ivar MonitoredItemId:
11622
    :vartype MonitoredItemId: UInt32
11623
    :ivar RequestedParameters:
11624
    :vartype RequestedParameters: MonitoringParameters
11625
    '''
11626 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11627 1
    ua_types = {
11628
        'MonitoredItemId': 'UInt32',
11629
        'RequestedParameters': 'MonitoringParameters',
11630
               }
11631
11632 1
    def __init__(self, binary=None):
11633
        if binary is not None:
11634
            self._binary_init(binary)
11635
            self._freeze = True
11636
            return
11637
        self.MonitoredItemId = 0
11638
        self.RequestedParameters = MonitoringParameters()
11639
        self._freeze = True
11640
11641 1
    def to_binary(self):
11642
        packet = []
11643
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoredItemId))
11644
        packet.append(self.RequestedParameters.to_binary())
11645
        return b''.join(packet)
11646
11647 1
    @staticmethod
11648
    def from_binary(data):
11649
        return MonitoredItemModifyRequest(data)
11650
11651 1
    def _binary_init(self, data):
11652
        self.MonitoredItemId = uabin.Primitives.UInt32.unpack(data)
11653
        self.RequestedParameters = MonitoringParameters.from_binary(data)
11654
11655 1
    def __str__(self):
11656
        return 'MonitoredItemModifyRequest(' + 'MonitoredItemId:' + str(self.MonitoredItemId) + ', ' + \
11657
               'RequestedParameters:' + str(self.RequestedParameters) + ')'
11658
11659 1
    __repr__ = __str__
11660
11661
11662 1
class MonitoredItemModifyResult(FrozenClass):
11663
    '''
11664
    :ivar StatusCode:
11665
    :vartype StatusCode: StatusCode
11666
    :ivar RevisedSamplingInterval:
11667
    :vartype RevisedSamplingInterval: Double
11668
    :ivar RevisedQueueSize:
11669
    :vartype RevisedQueueSize: UInt32
11670
    :ivar FilterResult:
11671
    :vartype FilterResult: ExtensionObject
11672
    '''
11673
11674 1
    ua_types = {
11675
        'StatusCode': 'StatusCode',
11676
        'RevisedSamplingInterval': 'Double',
11677
        'RevisedQueueSize': 'UInt32',
11678
        'FilterResult': 'ExtensionObject',
11679
               }
11680
11681 1
    def __init__(self, binary=None):
11682
        if binary is not None:
11683
            self._binary_init(binary)
11684
            self._freeze = True
11685
            return
11686
        self.StatusCode = StatusCode()
11687
        self.RevisedSamplingInterval = 0
11688
        self.RevisedQueueSize = 0
11689
        self.FilterResult = None
11690
        self._freeze = True
11691
11692 1
    def to_binary(self):
11693
        packet = []
11694
        packet.append(self.StatusCode.to_binary())
11695
        packet.append(uabin.Primitives.Double.pack(self.RevisedSamplingInterval))
11696
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedQueueSize))
11697
        packet.append(extensionobject_to_binary(self.FilterResult))
11698
        return b''.join(packet)
11699
11700 1
    @staticmethod
11701
    def from_binary(data):
11702
        return MonitoredItemModifyResult(data)
11703
11704 1
    def _binary_init(self, data):
11705
        self.StatusCode = StatusCode.from_binary(data)
11706
        self.RevisedSamplingInterval = uabin.Primitives.Double.unpack(data)
11707
        self.RevisedQueueSize = uabin.Primitives.UInt32.unpack(data)
11708
        self.FilterResult = extensionobject_from_binary(data)
11709
11710 1
    def __str__(self):
11711
        return 'MonitoredItemModifyResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
11712
               'RevisedSamplingInterval:' + str(self.RevisedSamplingInterval) + ', ' + \
11713
               'RevisedQueueSize:' + str(self.RevisedQueueSize) + ', ' + \
11714
               'FilterResult:' + str(self.FilterResult) + ')'
11715
11716 1
    __repr__ = __str__
11717 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11718
11719 1
class ModifyMonitoredItemsParameters(FrozenClass):
11720
    '''
11721
    :ivar SubscriptionId:
11722
    :vartype SubscriptionId: UInt32
11723
    :ivar TimestampsToReturn:
11724
    :vartype TimestampsToReturn: TimestampsToReturn
11725
    :ivar ItemsToModify:
11726
    :vartype ItemsToModify: MonitoredItemModifyRequest
11727
    '''
11728
11729 1
    ua_types = {
11730
        'SubscriptionId': 'UInt32',
11731
        'TimestampsToReturn': 'TimestampsToReturn',
11732
        'ItemsToModify': 'MonitoredItemModifyRequest',
11733
               }
11734
11735 1
    def __init__(self, binary=None):
11736
        if binary is not None:
11737
            self._binary_init(binary)
11738
            self._freeze = True
11739
            return
11740
        self.SubscriptionId = 0
11741
        self.TimestampsToReturn = TimestampsToReturn(0)
11742
        self.ItemsToModify = []
11743
        self._freeze = True
11744
11745 1
    def to_binary(self):
11746
        packet = []
11747
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
11748
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
11749
        packet.append(uabin.Primitives.Int32.pack(len(self.ItemsToModify)))
11750
        for fieldname in self.ItemsToModify:
11751
            packet.append(fieldname.to_binary())
11752
        return b''.join(packet)
11753
11754 1
    @staticmethod
11755
    def from_binary(data):
11756
        return ModifyMonitoredItemsParameters(data)
11757
11758 1
    def _binary_init(self, data):
11759
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
11760
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
11761
        length = uabin.Primitives.Int32.unpack(data)
11762
        array = []
11763
        if length != -1:
11764
            for _ in range(0, length):
11765
                array.append(MonitoredItemModifyRequest.from_binary(data))
11766
        self.ItemsToModify = array
11767
11768 1
    def __str__(self):
11769
        return 'ModifyMonitoredItemsParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
11770
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
11771
               'ItemsToModify:' + str(self.ItemsToModify) + ')'
11772
11773 1
    __repr__ = __str__
11774
11775
11776 1
class ModifyMonitoredItemsRequest(FrozenClass):
11777
    '''
11778
    :ivar TypeId:
11779
    :vartype TypeId: NodeId
11780
    :ivar RequestHeader:
11781
    :vartype RequestHeader: RequestHeader
11782
    :ivar Parameters:
11783
    :vartype Parameters: ModifyMonitoredItemsParameters
11784
    '''
11785
11786 1
    ua_types = {
11787
        'TypeId': 'NodeId',
11788
        'RequestHeader': 'RequestHeader',
11789
        'Parameters': 'ModifyMonitoredItemsParameters',
11790
               }
11791
11792 1
    def __init__(self, binary=None):
11793
        if binary is not None:
11794
            self._binary_init(binary)
11795
            self._freeze = True
11796
            return
11797
        self.TypeId = FourByteNodeId(ObjectIds.ModifyMonitoredItemsRequest_Encoding_DefaultBinary)
11798
        self.RequestHeader = RequestHeader()
11799
        self.Parameters = ModifyMonitoredItemsParameters()
11800
        self._freeze = True
11801
11802 1
    def to_binary(self):
11803
        packet = []
11804
        packet.append(self.TypeId.to_binary())
11805
        packet.append(self.RequestHeader.to_binary())
11806
        packet.append(self.Parameters.to_binary())
11807
        return b''.join(packet)
11808
11809 1
    @staticmethod
11810
    def from_binary(data):
11811
        return ModifyMonitoredItemsRequest(data)
11812
11813 1
    def _binary_init(self, data):
11814
        self.TypeId = NodeId.from_binary(data)
11815
        self.RequestHeader = RequestHeader.from_binary(data)
11816
        self.Parameters = ModifyMonitoredItemsParameters.from_binary(data)
11817
11818 1
    def __str__(self):
11819
        return 'ModifyMonitoredItemsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11820
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
11821
               'Parameters:' + str(self.Parameters) + ')'
11822
11823 1
    __repr__ = __str__
11824
11825
11826 1
class ModifyMonitoredItemsResponse(FrozenClass):
11827
    '''
11828
    :ivar TypeId:
11829
    :vartype TypeId: NodeId
11830
    :ivar ResponseHeader:
11831
    :vartype ResponseHeader: ResponseHeader
11832
    :ivar Results:
11833
    :vartype Results: MonitoredItemModifyResult
11834
    :ivar DiagnosticInfos:
11835
    :vartype DiagnosticInfos: DiagnosticInfo
11836
    '''
11837
11838 1
    ua_types = {
11839
        'TypeId': 'NodeId',
11840
        'ResponseHeader': 'ResponseHeader',
11841
        'Results': 'MonitoredItemModifyResult',
11842
        'DiagnosticInfos': 'DiagnosticInfo',
11843
               }
11844
11845 1
    def __init__(self, binary=None):
11846
        if binary is not None:
11847
            self._binary_init(binary)
11848
            self._freeze = True
11849
            return
11850
        self.TypeId = FourByteNodeId(ObjectIds.ModifyMonitoredItemsResponse_Encoding_DefaultBinary)
11851
        self.ResponseHeader = ResponseHeader()
11852
        self.Results = []
11853
        self.DiagnosticInfos = []
11854
        self._freeze = True
11855
11856 1
    def to_binary(self):
11857
        packet = []
11858
        packet.append(self.TypeId.to_binary())
11859
        packet.append(self.ResponseHeader.to_binary())
11860
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
11861
        for fieldname in self.Results:
11862
            packet.append(fieldname.to_binary())
11863
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
11864
        for fieldname in self.DiagnosticInfos:
11865
            packet.append(fieldname.to_binary())
11866
        return b''.join(packet)
11867
11868 1
    @staticmethod
11869
    def from_binary(data):
11870
        return ModifyMonitoredItemsResponse(data)
11871
11872 1
    def _binary_init(self, data):
11873
        self.TypeId = NodeId.from_binary(data)
11874
        self.ResponseHeader = ResponseHeader.from_binary(data)
11875
        length = uabin.Primitives.Int32.unpack(data)
11876
        array = []
11877
        if length != -1:
11878
            for _ in range(0, length):
11879
                array.append(MonitoredItemModifyResult.from_binary(data))
11880
        self.Results = array
11881
        length = uabin.Primitives.Int32.unpack(data)
11882
        array = []
11883
        if length != -1:
11884
            for _ in range(0, length):
11885
                array.append(DiagnosticInfo.from_binary(data))
11886
        self.DiagnosticInfos = array
11887
11888 1
    def __str__(self):
11889
        return 'ModifyMonitoredItemsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11890
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
11891
               'Results:' + str(self.Results) + ', ' + \
11892
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
11893
11894 1
    __repr__ = __str__
11895
11896
11897 1
class SetMonitoringModeParameters(FrozenClass):
11898
    '''
11899
    :ivar SubscriptionId:
11900
    :vartype SubscriptionId: UInt32
11901
    :ivar MonitoringMode:
11902
    :vartype MonitoringMode: MonitoringMode
11903
    :ivar MonitoredItemIds:
11904
    :vartype MonitoredItemIds: UInt32
11905
    '''
11906
11907 1
    ua_types = {
11908
        'SubscriptionId': 'UInt32',
11909
        'MonitoringMode': 'MonitoringMode',
11910
        'MonitoredItemIds': 'UInt32',
11911
               }
11912
11913 1
    def __init__(self, binary=None):
11914
        if binary is not None:
11915
            self._binary_init(binary)
11916
            self._freeze = True
11917
            return
11918
        self.SubscriptionId = 0
11919
        self.MonitoringMode = MonitoringMode(0)
11920
        self.MonitoredItemIds = []
11921
        self._freeze = True
11922
11923 1
    def to_binary(self):
11924
        packet = []
11925
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
11926
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoringMode.value))
11927
        packet.append(uabin.Primitives.Int32.pack(len(self.MonitoredItemIds)))
11928
        for fieldname in self.MonitoredItemIds:
11929
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
11930
        return b''.join(packet)
11931
11932 1
    @staticmethod
11933
    def from_binary(data):
11934
        return SetMonitoringModeParameters(data)
11935
11936 1
    def _binary_init(self, data):
11937
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
11938
        self.MonitoringMode = MonitoringMode(uabin.Primitives.UInt32.unpack(data))
11939
        self.MonitoredItemIds = uabin.Primitives.UInt32.unpack_array(data)
11940
11941 1
    def __str__(self):
11942
        return 'SetMonitoringModeParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
11943
               'MonitoringMode:' + str(self.MonitoringMode) + ', ' + \
11944
               'MonitoredItemIds:' + str(self.MonitoredItemIds) + ')'
11945
11946 1
    __repr__ = __str__
11947
11948
11949 1
class SetMonitoringModeRequest(FrozenClass):
11950
    '''
11951
    :ivar TypeId:
11952
    :vartype TypeId: NodeId
11953
    :ivar RequestHeader:
11954
    :vartype RequestHeader: RequestHeader
11955
    :ivar Parameters:
11956
    :vartype Parameters: SetMonitoringModeParameters
11957
    '''
11958
11959 1
    ua_types = {
11960
        'TypeId': 'NodeId',
11961
        'RequestHeader': 'RequestHeader',
11962
        'Parameters': 'SetMonitoringModeParameters',
11963
               }
11964
11965 1
    def __init__(self, binary=None):
11966
        if binary is not None:
11967
            self._binary_init(binary)
11968
            self._freeze = True
11969
            return
11970
        self.TypeId = FourByteNodeId(ObjectIds.SetMonitoringModeRequest_Encoding_DefaultBinary)
11971
        self.RequestHeader = RequestHeader()
11972
        self.Parameters = SetMonitoringModeParameters()
11973
        self._freeze = True
11974
11975 1
    def to_binary(self):
11976
        packet = []
11977
        packet.append(self.TypeId.to_binary())
11978
        packet.append(self.RequestHeader.to_binary())
11979
        packet.append(self.Parameters.to_binary())
11980
        return b''.join(packet)
11981
11982 1
    @staticmethod
11983
    def from_binary(data):
11984
        return SetMonitoringModeRequest(data)
11985
11986 1
    def _binary_init(self, data):
11987
        self.TypeId = NodeId.from_binary(data)
11988
        self.RequestHeader = RequestHeader.from_binary(data)
11989
        self.Parameters = SetMonitoringModeParameters.from_binary(data)
11990
11991 1
    def __str__(self):
11992
        return 'SetMonitoringModeRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
11993
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
11994
               'Parameters:' + str(self.Parameters) + ')'
11995
11996 1
    __repr__ = __str__
11997 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
11998
11999 1
class SetMonitoringModeResult(FrozenClass):
12000
    '''
12001
    :ivar Results:
12002
    :vartype Results: StatusCode
12003
    :ivar DiagnosticInfos:
12004
    :vartype DiagnosticInfos: DiagnosticInfo
12005
    '''
12006
12007 1
    ua_types = {
12008
        'Results': 'StatusCode',
12009
        'DiagnosticInfos': 'DiagnosticInfo',
12010
               }
12011
12012 1
    def __init__(self, binary=None):
12013
        if binary is not None:
12014
            self._binary_init(binary)
12015
            self._freeze = True
12016
            return
12017
        self.Results = []
12018
        self.DiagnosticInfos = []
12019
        self._freeze = True
12020
12021 1
    def to_binary(self):
12022
        packet = []
12023
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
12024
        for fieldname in self.Results:
12025
            packet.append(fieldname.to_binary())
12026
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
12027
        for fieldname in self.DiagnosticInfos:
12028
            packet.append(fieldname.to_binary())
12029
        return b''.join(packet)
12030
12031 1
    @staticmethod
12032
    def from_binary(data):
12033
        return SetMonitoringModeResult(data)
12034
12035 1
    def _binary_init(self, data):
12036
        length = uabin.Primitives.Int32.unpack(data)
12037
        array = []
12038
        if length != -1:
12039
            for _ in range(0, length):
12040
                array.append(StatusCode.from_binary(data))
12041
        self.Results = array
12042
        length = uabin.Primitives.Int32.unpack(data)
12043
        array = []
12044
        if length != -1:
12045
            for _ in range(0, length):
12046
                array.append(DiagnosticInfo.from_binary(data))
12047
        self.DiagnosticInfos = array
12048
12049 1
    def __str__(self):
12050
        return 'SetMonitoringModeResult(' + 'Results:' + str(self.Results) + ', ' + \
12051
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
12052
12053 1
    __repr__ = __str__
12054
12055
12056 1
class SetMonitoringModeResponse(FrozenClass):
12057
    '''
12058
    :ivar TypeId:
12059
    :vartype TypeId: NodeId
12060
    :ivar ResponseHeader:
12061
    :vartype ResponseHeader: ResponseHeader
12062
    :ivar Parameters:
12063
    :vartype Parameters: SetMonitoringModeResult
12064
    '''
12065
12066 1
    ua_types = {
12067
        'TypeId': 'NodeId',
12068
        'ResponseHeader': 'ResponseHeader',
12069
        'Parameters': 'SetMonitoringModeResult',
12070 View Code Duplication
               }
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12071
12072 1
    def __init__(self, binary=None):
12073
        if binary is not None:
12074
            self._binary_init(binary)
12075
            self._freeze = True
12076
            return
12077
        self.TypeId = FourByteNodeId(ObjectIds.SetMonitoringModeResponse_Encoding_DefaultBinary)
12078
        self.ResponseHeader = ResponseHeader()
12079
        self.Parameters = SetMonitoringModeResult()
12080
        self._freeze = True
12081
12082 1
    def to_binary(self):
12083
        packet = []
12084
        packet.append(self.TypeId.to_binary())
12085
        packet.append(self.ResponseHeader.to_binary())
12086
        packet.append(self.Parameters.to_binary())
12087
        return b''.join(packet)
12088
12089 1
    @staticmethod
12090
    def from_binary(data):
12091
        return SetMonitoringModeResponse(data)
12092
12093 1
    def _binary_init(self, data):
12094
        self.TypeId = NodeId.from_binary(data)
12095
        self.ResponseHeader = ResponseHeader.from_binary(data)
12096
        self.Parameters = SetMonitoringModeResult.from_binary(data)
12097
12098 1
    def __str__(self):
12099
        return 'SetMonitoringModeResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12100
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12101
               'Parameters:' + str(self.Parameters) + ')'
12102
12103 1
    __repr__ = __str__
12104
12105
12106 1
class SetTriggeringParameters(FrozenClass):
12107
    '''
12108
    :ivar SubscriptionId:
12109
    :vartype SubscriptionId: UInt32
12110
    :ivar TriggeringItemId:
12111
    :vartype TriggeringItemId: UInt32
12112
    :ivar LinksToAdd:
12113
    :vartype LinksToAdd: UInt32
12114
    :ivar LinksToRemove:
12115
    :vartype LinksToRemove: UInt32
12116
    '''
12117
12118 1
    ua_types = {
12119
        'SubscriptionId': 'UInt32',
12120
        'TriggeringItemId': 'UInt32',
12121
        'LinksToAdd': 'UInt32',
12122
        'LinksToRemove': 'UInt32',
12123
               }
12124
12125 1
    def __init__(self, binary=None):
12126
        if binary is not None:
12127
            self._binary_init(binary)
12128
            self._freeze = True
12129
            return
12130
        self.SubscriptionId = 0
12131
        self.TriggeringItemId = 0
12132
        self.LinksToAdd = []
12133
        self.LinksToRemove = []
12134
        self._freeze = True
12135
12136 1
    def to_binary(self):
12137
        packet = []
12138
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
12139
        packet.append(uabin.Primitives.UInt32.pack(self.TriggeringItemId))
12140
        packet.append(uabin.Primitives.Int32.pack(len(self.LinksToAdd)))
12141
        for fieldname in self.LinksToAdd:
12142
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
12143
        packet.append(uabin.Primitives.Int32.pack(len(self.LinksToRemove)))
12144
        for fieldname in self.LinksToRemove:
12145
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
12146
        return b''.join(packet)
12147
12148 1
    @staticmethod
12149
    def from_binary(data):
12150
        return SetTriggeringParameters(data)
12151
12152 1
    def _binary_init(self, data):
12153
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
12154
        self.TriggeringItemId = uabin.Primitives.UInt32.unpack(data)
12155
        self.LinksToAdd = uabin.Primitives.UInt32.unpack_array(data)
12156
        self.LinksToRemove = uabin.Primitives.UInt32.unpack_array(data)
12157
12158 1
    def __str__(self):
12159
        return 'SetTriggeringParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12160
               'TriggeringItemId:' + str(self.TriggeringItemId) + ', ' + \
12161
               'LinksToAdd:' + str(self.LinksToAdd) + ', ' + \
12162
               'LinksToRemove:' + str(self.LinksToRemove) + ')'
12163
12164 1
    __repr__ = __str__
12165
12166
12167 1
class SetTriggeringRequest(FrozenClass):
12168
    '''
12169
    :ivar TypeId:
12170
    :vartype TypeId: NodeId
12171
    :ivar RequestHeader:
12172
    :vartype RequestHeader: RequestHeader
12173
    :ivar Parameters:
12174
    :vartype Parameters: SetTriggeringParameters
12175
    '''
12176
12177 1
    ua_types = {
12178
        'TypeId': 'NodeId',
12179
        'RequestHeader': 'RequestHeader',
12180
        'Parameters': 'SetTriggeringParameters',
12181
               }
12182
12183 1
    def __init__(self, binary=None):
12184
        if binary is not None:
12185
            self._binary_init(binary)
12186
            self._freeze = True
12187
            return
12188
        self.TypeId = FourByteNodeId(ObjectIds.SetTriggeringRequest_Encoding_DefaultBinary)
12189
        self.RequestHeader = RequestHeader()
12190
        self.Parameters = SetTriggeringParameters()
12191
        self._freeze = True
12192
12193 1
    def to_binary(self):
12194
        packet = []
12195
        packet.append(self.TypeId.to_binary())
12196
        packet.append(self.RequestHeader.to_binary())
12197
        packet.append(self.Parameters.to_binary())
12198
        return b''.join(packet)
12199
12200 1
    @staticmethod
12201
    def from_binary(data):
12202
        return SetTriggeringRequest(data)
12203
12204 1
    def _binary_init(self, data):
12205
        self.TypeId = NodeId.from_binary(data)
12206
        self.RequestHeader = RequestHeader.from_binary(data)
12207
        self.Parameters = SetTriggeringParameters.from_binary(data)
12208
12209 1
    def __str__(self):
12210
        return 'SetTriggeringRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12211
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12212
               'Parameters:' + str(self.Parameters) + ')'
12213
12214 1
    __repr__ = __str__
12215
12216
12217 1
class SetTriggeringResult(FrozenClass):
12218
    '''
12219
    :ivar AddResults:
12220
    :vartype AddResults: StatusCode
12221
    :ivar AddDiagnosticInfos:
12222
    :vartype AddDiagnosticInfos: DiagnosticInfo
12223
    :ivar RemoveResults:
12224
    :vartype RemoveResults: StatusCode
12225
    :ivar RemoveDiagnosticInfos:
12226
    :vartype RemoveDiagnosticInfos: DiagnosticInfo
12227
    '''
12228
12229 1
    ua_types = {
12230
        'AddResults': 'StatusCode',
12231
        'AddDiagnosticInfos': 'DiagnosticInfo',
12232
        'RemoveResults': 'StatusCode',
12233
        'RemoveDiagnosticInfos': 'DiagnosticInfo',
12234
               }
12235
12236 1
    def __init__(self, binary=None):
12237
        if binary is not None:
12238
            self._binary_init(binary)
12239
            self._freeze = True
12240
            return
12241
        self.AddResults = []
12242
        self.AddDiagnosticInfos = []
12243
        self.RemoveResults = []
12244
        self.RemoveDiagnosticInfos = []
12245 View Code Duplication
        self._freeze = True
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12246
12247 1
    def to_binary(self):
12248
        packet = []
12249
        packet.append(uabin.Primitives.Int32.pack(len(self.AddResults)))
12250
        for fieldname in self.AddResults:
12251
            packet.append(fieldname.to_binary())
12252
        packet.append(uabin.Primitives.Int32.pack(len(self.AddDiagnosticInfos)))
12253
        for fieldname in self.AddDiagnosticInfos:
12254
            packet.append(fieldname.to_binary())
12255
        packet.append(uabin.Primitives.Int32.pack(len(self.RemoveResults)))
12256
        for fieldname in self.RemoveResults:
12257
            packet.append(fieldname.to_binary())
12258
        packet.append(uabin.Primitives.Int32.pack(len(self.RemoveDiagnosticInfos)))
12259
        for fieldname in self.RemoveDiagnosticInfos:
12260
            packet.append(fieldname.to_binary())
12261
        return b''.join(packet)
12262
12263 1
    @staticmethod
12264
    def from_binary(data):
12265
        return SetTriggeringResult(data)
12266
12267 1
    def _binary_init(self, data):
12268
        length = uabin.Primitives.Int32.unpack(data)
12269
        array = []
12270
        if length != -1:
12271
            for _ in range(0, length):
12272
                array.append(StatusCode.from_binary(data))
12273
        self.AddResults = array
12274
        length = uabin.Primitives.Int32.unpack(data)
12275
        array = []
12276
        if length != -1:
12277
            for _ in range(0, length):
12278
                array.append(DiagnosticInfo.from_binary(data))
12279
        self.AddDiagnosticInfos = array
12280
        length = uabin.Primitives.Int32.unpack(data)
12281
        array = []
12282
        if length != -1:
12283
            for _ in range(0, length):
12284
                array.append(StatusCode.from_binary(data))
12285
        self.RemoveResults = array
12286
        length = uabin.Primitives.Int32.unpack(data)
12287
        array = []
12288
        if length != -1:
12289
            for _ in range(0, length):
12290
                array.append(DiagnosticInfo.from_binary(data))
12291
        self.RemoveDiagnosticInfos = array
12292
12293 1
    def __str__(self):
12294
        return 'SetTriggeringResult(' + 'AddResults:' + str(self.AddResults) + ', ' + \
12295
               'AddDiagnosticInfos:' + str(self.AddDiagnosticInfos) + ', ' + \
12296
               'RemoveResults:' + str(self.RemoveResults) + ', ' + \
12297
               'RemoveDiagnosticInfos:' + str(self.RemoveDiagnosticInfos) + ')'
12298
12299 1
    __repr__ = __str__
12300
12301
12302 1
class SetTriggeringResponse(FrozenClass):
12303
    '''
12304
    :ivar TypeId:
12305
    :vartype TypeId: NodeId
12306
    :ivar ResponseHeader:
12307
    :vartype ResponseHeader: ResponseHeader
12308
    :ivar Parameters:
12309
    :vartype Parameters: SetTriggeringResult
12310
    '''
12311
12312 1
    ua_types = {
12313
        'TypeId': 'NodeId',
12314
        'ResponseHeader': 'ResponseHeader',
12315
        'Parameters': 'SetTriggeringResult',
12316
               }
12317
12318 1
    def __init__(self, binary=None):
12319
        if binary is not None:
12320
            self._binary_init(binary)
12321
            self._freeze = True
12322
            return
12323
        self.TypeId = FourByteNodeId(ObjectIds.SetTriggeringResponse_Encoding_DefaultBinary)
12324
        self.ResponseHeader = ResponseHeader()
12325
        self.Parameters = SetTriggeringResult()
12326
        self._freeze = True
12327
12328 1
    def to_binary(self):
12329
        packet = []
12330
        packet.append(self.TypeId.to_binary())
12331
        packet.append(self.ResponseHeader.to_binary())
12332
        packet.append(self.Parameters.to_binary())
12333
        return b''.join(packet)
12334
12335 1
    @staticmethod
12336
    def from_binary(data):
12337
        return SetTriggeringResponse(data)
12338
12339 1
    def _binary_init(self, data):
12340
        self.TypeId = NodeId.from_binary(data)
12341
        self.ResponseHeader = ResponseHeader.from_binary(data)
12342
        self.Parameters = SetTriggeringResult.from_binary(data)
12343
12344 1
    def __str__(self):
12345
        return 'SetTriggeringResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12346
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12347
               'Parameters:' + str(self.Parameters) + ')'
12348
12349 1
    __repr__ = __str__
12350
12351
12352 1
class DeleteMonitoredItemsParameters(FrozenClass):
12353
    '''
12354
    :ivar SubscriptionId:
12355
    :vartype SubscriptionId: UInt32
12356
    :ivar MonitoredItemIds:
12357
    :vartype MonitoredItemIds: UInt32
12358
    '''
12359
12360 1
    ua_types = {
12361
        'SubscriptionId': 'UInt32',
12362
        'MonitoredItemIds': 'UInt32',
12363
               }
12364
12365 1
    def __init__(self, binary=None):
12366 1
        if binary is not None:
12367 1
            self._binary_init(binary)
12368 1
            self._freeze = True
12369 1
            return
12370 1
        self.SubscriptionId = 0
12371 1
        self.MonitoredItemIds = []
12372 1
        self._freeze = True
12373
12374 1
    def to_binary(self):
12375 1
        packet = []
12376 1
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
12377 1
        packet.append(uabin.Primitives.Int32.pack(len(self.MonitoredItemIds)))
12378 1
        for fieldname in self.MonitoredItemIds:
12379 1
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
12380 1
        return b''.join(packet)
12381
12382 1
    @staticmethod
12383
    def from_binary(data):
12384 1
        return DeleteMonitoredItemsParameters(data)
12385
12386 1
    def _binary_init(self, data):
12387 1
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
12388 1
        self.MonitoredItemIds = uabin.Primitives.UInt32.unpack_array(data)
12389
12390 1
    def __str__(self):
12391
        return 'DeleteMonitoredItemsParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12392
               'MonitoredItemIds:' + str(self.MonitoredItemIds) + ')'
12393
12394 1
    __repr__ = __str__
12395
12396
12397 1
class DeleteMonitoredItemsRequest(FrozenClass):
12398
    '''
12399
    :ivar TypeId:
12400
    :vartype TypeId: NodeId
12401
    :ivar RequestHeader:
12402
    :vartype RequestHeader: RequestHeader
12403
    :ivar Parameters:
12404
    :vartype Parameters: DeleteMonitoredItemsParameters
12405
    '''
12406
12407 1
    ua_types = {
12408
        'TypeId': 'NodeId',
12409
        'RequestHeader': 'RequestHeader',
12410
        'Parameters': 'DeleteMonitoredItemsParameters',
12411
               }
12412
12413 1
    def __init__(self, binary=None):
12414 1
        if binary is not None:
12415
            self._binary_init(binary)
12416
            self._freeze = True
12417
            return
12418 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteMonitoredItemsRequest_Encoding_DefaultBinary)
12419 1
        self.RequestHeader = RequestHeader()
12420 1
        self.Parameters = DeleteMonitoredItemsParameters()
12421 1
        self._freeze = True
12422
12423 1
    def to_binary(self):
12424 1
        packet = []
12425 1
        packet.append(self.TypeId.to_binary())
12426 1
        packet.append(self.RequestHeader.to_binary())
12427 1
        packet.append(self.Parameters.to_binary())
12428 1
        return b''.join(packet)
12429
12430 1
    @staticmethod
12431
    def from_binary(data):
12432
        return DeleteMonitoredItemsRequest(data)
12433
12434 1
    def _binary_init(self, data):
12435
        self.TypeId = NodeId.from_binary(data)
12436
        self.RequestHeader = RequestHeader.from_binary(data)
12437
        self.Parameters = DeleteMonitoredItemsParameters.from_binary(data)
12438
12439 1
    def __str__(self):
12440
        return 'DeleteMonitoredItemsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12441
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12442
               'Parameters:' + str(self.Parameters) + ')'
12443
12444 1
    __repr__ = __str__
12445
12446
12447 1
class DeleteMonitoredItemsResponse(FrozenClass):
12448
    '''
12449
    :ivar TypeId:
12450
    :vartype TypeId: NodeId
12451
    :ivar ResponseHeader:
12452
    :vartype ResponseHeader: ResponseHeader
12453
    :ivar Results:
12454
    :vartype Results: StatusCode
12455
    :ivar DiagnosticInfos:
12456
    :vartype DiagnosticInfos: DiagnosticInfo
12457
    '''
12458
12459 1
    ua_types = {
12460
        'TypeId': 'NodeId',
12461
        'ResponseHeader': 'ResponseHeader',
12462
        'Results': 'StatusCode',
12463
        'DiagnosticInfos': 'DiagnosticInfo',
12464
               }
12465
12466 1
    def __init__(self, binary=None):
12467 1
        if binary is not None:
12468 1
            self._binary_init(binary)
12469 1
            self._freeze = True
12470 1
            return
12471 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteMonitoredItemsResponse_Encoding_DefaultBinary)
12472 1
        self.ResponseHeader = ResponseHeader()
12473 1
        self.Results = []
12474 1
        self.DiagnosticInfos = []
12475 1
        self._freeze = True
12476
12477 1
    def to_binary(self):
12478 1
        packet = []
12479 1
        packet.append(self.TypeId.to_binary())
12480 1
        packet.append(self.ResponseHeader.to_binary())
12481 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
12482 1
        for fieldname in self.Results:
12483 1
            packet.append(fieldname.to_binary())
12484 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
12485 1
        for fieldname in self.DiagnosticInfos:
12486
            packet.append(fieldname.to_binary())
12487 1
        return b''.join(packet)
12488
12489 1
    @staticmethod
12490
    def from_binary(data):
12491 1
        return DeleteMonitoredItemsResponse(data)
12492
12493 1
    def _binary_init(self, data):
12494 1
        self.TypeId = NodeId.from_binary(data)
12495 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
12496 1
        length = uabin.Primitives.Int32.unpack(data)
12497 1
        array = []
12498 1
        if length != -1:
12499 1
            for _ in range(0, length):
12500 1
                array.append(StatusCode.from_binary(data))
12501 1
        self.Results = array
12502 1
        length = uabin.Primitives.Int32.unpack(data)
12503 1
        array = []
12504 1
        if length != -1:
12505 1
            for _ in range(0, length):
12506
                array.append(DiagnosticInfo.from_binary(data))
12507 1
        self.DiagnosticInfos = array
12508
12509 1
    def __str__(self):
12510
        return 'DeleteMonitoredItemsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12511
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12512
               'Results:' + str(self.Results) + ', ' + \
12513
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
12514
12515 1
    __repr__ = __str__
12516 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12517
12518 1
class CreateSubscriptionParameters(FrozenClass):
12519
    '''
12520
    :ivar RequestedPublishingInterval:
12521
    :vartype RequestedPublishingInterval: Double
12522
    :ivar RequestedLifetimeCount:
12523
    :vartype RequestedLifetimeCount: UInt32
12524
    :ivar RequestedMaxKeepAliveCount:
12525
    :vartype RequestedMaxKeepAliveCount: UInt32
12526
    :ivar MaxNotificationsPerPublish:
12527
    :vartype MaxNotificationsPerPublish: UInt32
12528
    :ivar PublishingEnabled:
12529
    :vartype PublishingEnabled: Boolean
12530
    :ivar Priority:
12531
    :vartype Priority: Byte
12532
    '''
12533
12534 1
    ua_types = {
12535
        'RequestedPublishingInterval': 'Double',
12536
        'RequestedLifetimeCount': 'UInt32',
12537
        'RequestedMaxKeepAliveCount': 'UInt32',
12538
        'MaxNotificationsPerPublish': 'UInt32',
12539
        'PublishingEnabled': 'Boolean',
12540
        'Priority': 'Byte',
12541
               }
12542
12543 1
    def __init__(self, binary=None):
12544 1
        if binary is not None:
12545 1
            self._binary_init(binary)
12546 1
            self._freeze = True
12547 1
            return
12548 1
        self.RequestedPublishingInterval = 0
12549 1
        self.RequestedLifetimeCount = 0
12550 1
        self.RequestedMaxKeepAliveCount = 0
12551 1
        self.MaxNotificationsPerPublish = 0
12552 1
        self.PublishingEnabled = True
12553 1
        self.Priority = 0
12554 1
        self._freeze = True
12555
12556 1
    def to_binary(self):
12557 1
        packet = []
12558 1
        packet.append(uabin.Primitives.Double.pack(self.RequestedPublishingInterval))
12559 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedLifetimeCount))
12560 1
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedMaxKeepAliveCount))
12561 1
        packet.append(uabin.Primitives.UInt32.pack(self.MaxNotificationsPerPublish))
12562 1
        packet.append(uabin.Primitives.Boolean.pack(self.PublishingEnabled))
12563 1
        packet.append(uabin.Primitives.Byte.pack(self.Priority))
12564 1
        return b''.join(packet)
12565
12566 1
    @staticmethod
12567
    def from_binary(data):
12568 1
        return CreateSubscriptionParameters(data)
12569
12570 1
    def _binary_init(self, data):
12571 1
        self.RequestedPublishingInterval = uabin.Primitives.Double.unpack(data)
12572 1
        self.RequestedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
12573 1
        self.RequestedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
12574 1
        self.MaxNotificationsPerPublish = uabin.Primitives.UInt32.unpack(data)
12575 1
        self.PublishingEnabled = uabin.Primitives.Boolean.unpack(data)
12576 1
        self.Priority = uabin.Primitives.Byte.unpack(data)
12577
12578 1
    def __str__(self):
12579
        return 'CreateSubscriptionParameters(' + 'RequestedPublishingInterval:' + str(self.RequestedPublishingInterval) + ', ' + \
12580
               'RequestedLifetimeCount:' + str(self.RequestedLifetimeCount) + ', ' + \
12581
               'RequestedMaxKeepAliveCount:' + str(self.RequestedMaxKeepAliveCount) + ', ' + \
12582
               'MaxNotificationsPerPublish:' + str(self.MaxNotificationsPerPublish) + ', ' + \
12583
               'PublishingEnabled:' + str(self.PublishingEnabled) + ', ' + \
12584
               'Priority:' + str(self.Priority) + ')'
12585
12586 1
    __repr__ = __str__
12587
12588
12589 1
class CreateSubscriptionRequest(FrozenClass):
12590
    '''
12591
    :ivar TypeId:
12592
    :vartype TypeId: NodeId
12593
    :ivar RequestHeader:
12594
    :vartype RequestHeader: RequestHeader
12595
    :ivar Parameters:
12596
    :vartype Parameters: CreateSubscriptionParameters
12597
    '''
12598
12599 1
    ua_types = {
12600
        'TypeId': 'NodeId',
12601
        'RequestHeader': 'RequestHeader',
12602
        'Parameters': 'CreateSubscriptionParameters',
12603 View Code Duplication
               }
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12604
12605 1
    def __init__(self, binary=None):
12606 1
        if binary is not None:
12607
            self._binary_init(binary)
12608
            self._freeze = True
12609
            return
12610 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateSubscriptionRequest_Encoding_DefaultBinary)
12611 1
        self.RequestHeader = RequestHeader()
12612 1
        self.Parameters = CreateSubscriptionParameters()
12613 1
        self._freeze = True
12614
12615 1
    def to_binary(self):
12616 1
        packet = []
12617 1
        packet.append(self.TypeId.to_binary())
12618 1
        packet.append(self.RequestHeader.to_binary())
12619 1
        packet.append(self.Parameters.to_binary())
12620 1
        return b''.join(packet)
12621
12622 1
    @staticmethod
12623
    def from_binary(data):
12624
        return CreateSubscriptionRequest(data)
12625
12626 1
    def _binary_init(self, data):
12627
        self.TypeId = NodeId.from_binary(data)
12628
        self.RequestHeader = RequestHeader.from_binary(data)
12629
        self.Parameters = CreateSubscriptionParameters.from_binary(data)
12630
12631 1
    def __str__(self):
12632
        return 'CreateSubscriptionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12633
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12634
               'Parameters:' + str(self.Parameters) + ')'
12635
12636 1
    __repr__ = __str__
12637
12638
12639 1
class CreateSubscriptionResult(FrozenClass):
12640
    '''
12641
    :ivar SubscriptionId:
12642
    :vartype SubscriptionId: UInt32
12643
    :ivar RevisedPublishingInterval:
12644
    :vartype RevisedPublishingInterval: Double
12645
    :ivar RevisedLifetimeCount:
12646
    :vartype RevisedLifetimeCount: UInt32
12647
    :ivar RevisedMaxKeepAliveCount:
12648
    :vartype RevisedMaxKeepAliveCount: UInt32
12649
    '''
12650
12651 1
    ua_types = {
12652
        'SubscriptionId': 'UInt32',
12653
        'RevisedPublishingInterval': 'Double',
12654
        'RevisedLifetimeCount': 'UInt32',
12655
        'RevisedMaxKeepAliveCount': 'UInt32',
12656
               }
12657
12658 1
    def __init__(self, binary=None):
12659 1
        if binary is not None:
12660 1
            self._binary_init(binary)
12661 1
            self._freeze = True
12662 1
            return
12663 1
        self.SubscriptionId = 0
12664 1
        self.RevisedPublishingInterval = 0
12665 1
        self.RevisedLifetimeCount = 0
12666 1
        self.RevisedMaxKeepAliveCount = 0
12667 1
        self._freeze = True
12668
12669 1
    def to_binary(self):
12670 1
        packet = []
12671 1
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
12672 1
        packet.append(uabin.Primitives.Double.pack(self.RevisedPublishingInterval))
12673 1
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedLifetimeCount))
12674 1
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedMaxKeepAliveCount))
12675 1
        return b''.join(packet)
12676
12677 1
    @staticmethod
12678
    def from_binary(data):
12679 1
        return CreateSubscriptionResult(data)
12680
12681 1
    def _binary_init(self, data):
12682 1
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
12683 1
        self.RevisedPublishingInterval = uabin.Primitives.Double.unpack(data)
12684 1
        self.RevisedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
12685 1
        self.RevisedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
12686
12687 1
    def __str__(self):
12688
        return 'CreateSubscriptionResult(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12689
               'RevisedPublishingInterval:' + str(self.RevisedPublishingInterval) + ', ' + \
12690
               'RevisedLifetimeCount:' + str(self.RevisedLifetimeCount) + ', ' + \
12691
               'RevisedMaxKeepAliveCount:' + str(self.RevisedMaxKeepAliveCount) + ')'
12692
12693 1
    __repr__ = __str__
12694
12695
12696 1
class CreateSubscriptionResponse(FrozenClass):
12697
    '''
12698
    :ivar TypeId:
12699
    :vartype TypeId: NodeId
12700
    :ivar ResponseHeader:
12701
    :vartype ResponseHeader: ResponseHeader
12702
    :ivar Parameters:
12703
    :vartype Parameters: CreateSubscriptionResult
12704
    '''
12705
12706 1
    ua_types = {
12707
        'TypeId': 'NodeId',
12708
        'ResponseHeader': 'ResponseHeader',
12709
        'Parameters': 'CreateSubscriptionResult',
12710
               }
12711
12712 1
    def __init__(self, binary=None):
12713 1
        if binary is not None:
12714 1
            self._binary_init(binary)
12715 1
            self._freeze = True
12716 1
            return
12717 1
        self.TypeId = FourByteNodeId(ObjectIds.CreateSubscriptionResponse_Encoding_DefaultBinary)
12718 1
        self.ResponseHeader = ResponseHeader()
12719 1
        self.Parameters = CreateSubscriptionResult()
12720 1
        self._freeze = True
12721
12722 1
    def to_binary(self):
12723 1
        packet = []
12724 1
        packet.append(self.TypeId.to_binary())
12725 1
        packet.append(self.ResponseHeader.to_binary())
12726 1
        packet.append(self.Parameters.to_binary())
12727 1
        return b''.join(packet)
12728
12729 1
    @staticmethod
12730
    def from_binary(data):
12731 1
        return CreateSubscriptionResponse(data)
12732
12733 1
    def _binary_init(self, data):
12734 1
        self.TypeId = NodeId.from_binary(data)
12735 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
12736 1
        self.Parameters = CreateSubscriptionResult.from_binary(data)
12737
12738 1
    def __str__(self):
12739
        return 'CreateSubscriptionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12740
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12741
               'Parameters:' + str(self.Parameters) + ')'
12742
12743 1
    __repr__ = __str__
12744 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
12745
12746 1
class ModifySubscriptionParameters(FrozenClass):
12747
    '''
12748
    :ivar SubscriptionId:
12749
    :vartype SubscriptionId: UInt32
12750
    :ivar RequestedPublishingInterval:
12751
    :vartype RequestedPublishingInterval: Double
12752
    :ivar RequestedLifetimeCount:
12753
    :vartype RequestedLifetimeCount: UInt32
12754
    :ivar RequestedMaxKeepAliveCount:
12755
    :vartype RequestedMaxKeepAliveCount: UInt32
12756
    :ivar MaxNotificationsPerPublish:
12757
    :vartype MaxNotificationsPerPublish: UInt32
12758
    :ivar Priority:
12759
    :vartype Priority: Byte
12760
    '''
12761
12762 1
    ua_types = {
12763
        'SubscriptionId': 'UInt32',
12764
        'RequestedPublishingInterval': 'Double',
12765
        'RequestedLifetimeCount': 'UInt32',
12766
        'RequestedMaxKeepAliveCount': 'UInt32',
12767
        'MaxNotificationsPerPublish': 'UInt32',
12768
        'Priority': 'Byte',
12769
               }
12770
12771 1
    def __init__(self, binary=None):
12772
        if binary is not None:
12773
            self._binary_init(binary)
12774
            self._freeze = True
12775
            return
12776
        self.SubscriptionId = 0
12777
        self.RequestedPublishingInterval = 0
12778
        self.RequestedLifetimeCount = 0
12779
        self.RequestedMaxKeepAliveCount = 0
12780
        self.MaxNotificationsPerPublish = 0
12781
        self.Priority = 0
12782
        self._freeze = True
12783
12784 1
    def to_binary(self):
12785
        packet = []
12786
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
12787
        packet.append(uabin.Primitives.Double.pack(self.RequestedPublishingInterval))
12788
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedLifetimeCount))
12789
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedMaxKeepAliveCount))
12790
        packet.append(uabin.Primitives.UInt32.pack(self.MaxNotificationsPerPublish))
12791
        packet.append(uabin.Primitives.Byte.pack(self.Priority))
12792
        return b''.join(packet)
12793
12794 1
    @staticmethod
12795
    def from_binary(data):
12796
        return ModifySubscriptionParameters(data)
12797
12798 1
    def _binary_init(self, data):
12799
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
12800
        self.RequestedPublishingInterval = uabin.Primitives.Double.unpack(data)
12801
        self.RequestedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
12802
        self.RequestedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
12803
        self.MaxNotificationsPerPublish = uabin.Primitives.UInt32.unpack(data)
12804
        self.Priority = uabin.Primitives.Byte.unpack(data)
12805
12806 1
    def __str__(self):
12807
        return 'ModifySubscriptionParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
12808
               'RequestedPublishingInterval:' + str(self.RequestedPublishingInterval) + ', ' + \
12809
               'RequestedLifetimeCount:' + str(self.RequestedLifetimeCount) + ', ' + \
12810
               'RequestedMaxKeepAliveCount:' + str(self.RequestedMaxKeepAliveCount) + ', ' + \
12811
               'MaxNotificationsPerPublish:' + str(self.MaxNotificationsPerPublish) + ', ' + \
12812
               'Priority:' + str(self.Priority) + ')'
12813
12814 1
    __repr__ = __str__
12815
12816
12817 1
class ModifySubscriptionRequest(FrozenClass):
12818
    '''
12819
    :ivar TypeId:
12820
    :vartype TypeId: NodeId
12821
    :ivar RequestHeader:
12822
    :vartype RequestHeader: RequestHeader
12823
    :ivar Parameters:
12824
    :vartype Parameters: ModifySubscriptionParameters
12825
    '''
12826
12827 1
    ua_types = {
12828
        'TypeId': 'NodeId',
12829
        'RequestHeader': 'RequestHeader',
12830
        'Parameters': 'ModifySubscriptionParameters',
12831
               }
12832
12833 1
    def __init__(self, binary=None):
12834
        if binary is not None:
12835
            self._binary_init(binary)
12836
            self._freeze = True
12837
            return
12838
        self.TypeId = FourByteNodeId(ObjectIds.ModifySubscriptionRequest_Encoding_DefaultBinary)
12839
        self.RequestHeader = RequestHeader()
12840
        self.Parameters = ModifySubscriptionParameters()
12841
        self._freeze = True
12842
12843 1
    def to_binary(self):
12844
        packet = []
12845
        packet.append(self.TypeId.to_binary())
12846
        packet.append(self.RequestHeader.to_binary())
12847
        packet.append(self.Parameters.to_binary())
12848
        return b''.join(packet)
12849
12850 1
    @staticmethod
12851
    def from_binary(data):
12852
        return ModifySubscriptionRequest(data)
12853
12854 1
    def _binary_init(self, data):
12855
        self.TypeId = NodeId.from_binary(data)
12856
        self.RequestHeader = RequestHeader.from_binary(data)
12857
        self.Parameters = ModifySubscriptionParameters.from_binary(data)
12858
12859 1
    def __str__(self):
12860
        return 'ModifySubscriptionRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12861
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
12862
               'Parameters:' + str(self.Parameters) + ')'
12863
12864 1
    __repr__ = __str__
12865
12866
12867 1
class ModifySubscriptionResult(FrozenClass):
12868
    '''
12869
    :ivar RevisedPublishingInterval:
12870
    :vartype RevisedPublishingInterval: Double
12871
    :ivar RevisedLifetimeCount:
12872
    :vartype RevisedLifetimeCount: UInt32
12873
    :ivar RevisedMaxKeepAliveCount:
12874
    :vartype RevisedMaxKeepAliveCount: UInt32
12875
    '''
12876
12877 1
    ua_types = {
12878
        'RevisedPublishingInterval': 'Double',
12879
        'RevisedLifetimeCount': 'UInt32',
12880
        'RevisedMaxKeepAliveCount': 'UInt32',
12881
               }
12882
12883 1
    def __init__(self, binary=None):
12884
        if binary is not None:
12885
            self._binary_init(binary)
12886
            self._freeze = True
12887
            return
12888
        self.RevisedPublishingInterval = 0
12889
        self.RevisedLifetimeCount = 0
12890
        self.RevisedMaxKeepAliveCount = 0
12891
        self._freeze = True
12892
12893 1
    def to_binary(self):
12894
        packet = []
12895
        packet.append(uabin.Primitives.Double.pack(self.RevisedPublishingInterval))
12896
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedLifetimeCount))
12897
        packet.append(uabin.Primitives.UInt32.pack(self.RevisedMaxKeepAliveCount))
12898
        return b''.join(packet)
12899
12900 1
    @staticmethod
12901
    def from_binary(data):
12902
        return ModifySubscriptionResult(data)
12903
12904 1
    def _binary_init(self, data):
12905
        self.RevisedPublishingInterval = uabin.Primitives.Double.unpack(data)
12906
        self.RevisedLifetimeCount = uabin.Primitives.UInt32.unpack(data)
12907
        self.RevisedMaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
12908
12909 1
    def __str__(self):
12910
        return 'ModifySubscriptionResult(' + 'RevisedPublishingInterval:' + str(self.RevisedPublishingInterval) + ', ' + \
12911
               'RevisedLifetimeCount:' + str(self.RevisedLifetimeCount) + ', ' + \
12912
               'RevisedMaxKeepAliveCount:' + str(self.RevisedMaxKeepAliveCount) + ')'
12913
12914 1
    __repr__ = __str__
12915
12916
12917 1
class ModifySubscriptionResponse(FrozenClass):
12918
    '''
12919
    :ivar TypeId:
12920
    :vartype TypeId: NodeId
12921
    :ivar ResponseHeader:
12922
    :vartype ResponseHeader: ResponseHeader
12923
    :ivar Parameters:
12924
    :vartype Parameters: ModifySubscriptionResult
12925
    '''
12926
12927 1
    ua_types = {
12928
        'TypeId': 'NodeId',
12929
        'ResponseHeader': 'ResponseHeader',
12930
        'Parameters': 'ModifySubscriptionResult',
12931
               }
12932
12933 1
    def __init__(self, binary=None):
12934
        if binary is not None:
12935
            self._binary_init(binary)
12936
            self._freeze = True
12937
            return
12938
        self.TypeId = FourByteNodeId(ObjectIds.ModifySubscriptionResponse_Encoding_DefaultBinary)
12939
        self.ResponseHeader = ResponseHeader()
12940
        self.Parameters = ModifySubscriptionResult()
12941
        self._freeze = True
12942
12943 1
    def to_binary(self):
12944
        packet = []
12945
        packet.append(self.TypeId.to_binary())
12946
        packet.append(self.ResponseHeader.to_binary())
12947
        packet.append(self.Parameters.to_binary())
12948
        return b''.join(packet)
12949
12950 1
    @staticmethod
12951
    def from_binary(data):
12952
        return ModifySubscriptionResponse(data)
12953
12954 1
    def _binary_init(self, data):
12955
        self.TypeId = NodeId.from_binary(data)
12956
        self.ResponseHeader = ResponseHeader.from_binary(data)
12957
        self.Parameters = ModifySubscriptionResult.from_binary(data)
12958
12959 1
    def __str__(self):
12960
        return 'ModifySubscriptionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
12961
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
12962
               'Parameters:' + str(self.Parameters) + ')'
12963
12964 1
    __repr__ = __str__
12965
12966
12967 1
class SetPublishingModeParameters(FrozenClass):
12968
    '''
12969
    :ivar PublishingEnabled:
12970
    :vartype PublishingEnabled: Boolean
12971
    :ivar SubscriptionIds:
12972
    :vartype SubscriptionIds: UInt32
12973
    '''
12974
12975 1
    ua_types = {
12976
        'PublishingEnabled': 'Boolean',
12977
        'SubscriptionIds': 'UInt32',
12978
               }
12979
12980 1
    def __init__(self, binary=None):
12981
        if binary is not None:
12982
            self._binary_init(binary)
12983
            self._freeze = True
12984
            return
12985
        self.PublishingEnabled = True
12986
        self.SubscriptionIds = []
12987
        self._freeze = True
12988
12989 1
    def to_binary(self):
12990
        packet = []
12991
        packet.append(uabin.Primitives.Boolean.pack(self.PublishingEnabled))
12992
        packet.append(uabin.Primitives.Int32.pack(len(self.SubscriptionIds)))
12993
        for fieldname in self.SubscriptionIds:
12994
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
12995
        return b''.join(packet)
12996
12997 1
    @staticmethod
12998
    def from_binary(data):
12999
        return SetPublishingModeParameters(data)
13000
13001 1
    def _binary_init(self, data):
13002
        self.PublishingEnabled = uabin.Primitives.Boolean.unpack(data)
13003
        self.SubscriptionIds = uabin.Primitives.UInt32.unpack_array(data)
13004
13005 1
    def __str__(self):
13006
        return 'SetPublishingModeParameters(' + 'PublishingEnabled:' + str(self.PublishingEnabled) + ', ' + \
13007
               'SubscriptionIds:' + str(self.SubscriptionIds) + ')'
13008
13009 1
    __repr__ = __str__
13010
13011
13012 1
class SetPublishingModeRequest(FrozenClass):
13013
    '''
13014
    :ivar TypeId:
13015
    :vartype TypeId: NodeId
13016
    :ivar RequestHeader:
13017
    :vartype RequestHeader: RequestHeader
13018
    :ivar Parameters:
13019
    :vartype Parameters: SetPublishingModeParameters
13020
    '''
13021
13022 1
    ua_types = {
13023
        'TypeId': 'NodeId',
13024
        'RequestHeader': 'RequestHeader',
13025
        'Parameters': 'SetPublishingModeParameters',
13026
               }
13027
13028 1
    def __init__(self, binary=None):
13029
        if binary is not None:
13030
            self._binary_init(binary)
13031
            self._freeze = True
13032
            return
13033
        self.TypeId = FourByteNodeId(ObjectIds.SetPublishingModeRequest_Encoding_DefaultBinary)
13034
        self.RequestHeader = RequestHeader()
13035
        self.Parameters = SetPublishingModeParameters()
13036
        self._freeze = True
13037
13038 1
    def to_binary(self):
13039
        packet = []
13040
        packet.append(self.TypeId.to_binary())
13041
        packet.append(self.RequestHeader.to_binary())
13042
        packet.append(self.Parameters.to_binary())
13043
        return b''.join(packet)
13044
13045 1
    @staticmethod
13046
    def from_binary(data):
13047
        return SetPublishingModeRequest(data)
13048
13049 1
    def _binary_init(self, data):
13050
        self.TypeId = NodeId.from_binary(data)
13051
        self.RequestHeader = RequestHeader.from_binary(data)
13052
        self.Parameters = SetPublishingModeParameters.from_binary(data)
13053
13054 1
    def __str__(self):
13055
        return 'SetPublishingModeRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13056
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
13057
               'Parameters:' + str(self.Parameters) + ')'
13058
13059 1
    __repr__ = __str__
13060 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13061
13062 1
class SetPublishingModeResult(FrozenClass):
13063
    '''
13064
    :ivar Results:
13065
    :vartype Results: StatusCode
13066
    :ivar DiagnosticInfos:
13067
    :vartype DiagnosticInfos: DiagnosticInfo
13068
    '''
13069
13070 1
    ua_types = {
13071
        'Results': 'StatusCode',
13072
        'DiagnosticInfos': 'DiagnosticInfo',
13073
               }
13074
13075 1
    def __init__(self, binary=None):
13076
        if binary is not None:
13077
            self._binary_init(binary)
13078
            self._freeze = True
13079
            return
13080
        self.Results = []
13081
        self.DiagnosticInfos = []
13082
        self._freeze = True
13083
13084 1
    def to_binary(self):
13085
        packet = []
13086
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
13087
        for fieldname in self.Results:
13088
            packet.append(fieldname.to_binary())
13089
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
13090
        for fieldname in self.DiagnosticInfos:
13091
            packet.append(fieldname.to_binary())
13092
        return b''.join(packet)
13093
13094 1
    @staticmethod
13095
    def from_binary(data):
13096
        return SetPublishingModeResult(data)
13097
13098 1
    def _binary_init(self, data):
13099
        length = uabin.Primitives.Int32.unpack(data)
13100
        array = []
13101
        if length != -1:
13102
            for _ in range(0, length):
13103
                array.append(StatusCode.from_binary(data))
13104
        self.Results = array
13105
        length = uabin.Primitives.Int32.unpack(data)
13106
        array = []
13107
        if length != -1:
13108
            for _ in range(0, length):
13109
                array.append(DiagnosticInfo.from_binary(data))
13110
        self.DiagnosticInfos = array
13111
13112 1
    def __str__(self):
13113
        return 'SetPublishingModeResult(' + 'Results:' + str(self.Results) + ', ' + \
13114
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
13115
13116 1
    __repr__ = __str__
13117
13118
13119 1
class SetPublishingModeResponse(FrozenClass):
13120
    '''
13121
    :ivar TypeId:
13122
    :vartype TypeId: NodeId
13123
    :ivar ResponseHeader:
13124
    :vartype ResponseHeader: ResponseHeader
13125
    :ivar Parameters:
13126
    :vartype Parameters: SetPublishingModeResult
13127
    '''
13128
13129 1
    ua_types = {
13130
        'TypeId': 'NodeId',
13131
        'ResponseHeader': 'ResponseHeader',
13132
        'Parameters': 'SetPublishingModeResult',
13133
               }
13134
13135 1
    def __init__(self, binary=None):
13136
        if binary is not None:
13137
            self._binary_init(binary)
13138
            self._freeze = True
13139
            return
13140
        self.TypeId = FourByteNodeId(ObjectIds.SetPublishingModeResponse_Encoding_DefaultBinary)
13141
        self.ResponseHeader = ResponseHeader()
13142
        self.Parameters = SetPublishingModeResult()
13143
        self._freeze = True
13144
13145 1
    def to_binary(self):
13146
        packet = []
13147
        packet.append(self.TypeId.to_binary())
13148
        packet.append(self.ResponseHeader.to_binary())
13149
        packet.append(self.Parameters.to_binary())
13150
        return b''.join(packet)
13151
13152 1
    @staticmethod
13153
    def from_binary(data):
13154
        return SetPublishingModeResponse(data)
13155
13156 1
    def _binary_init(self, data):
13157
        self.TypeId = NodeId.from_binary(data)
13158
        self.ResponseHeader = ResponseHeader.from_binary(data)
13159
        self.Parameters = SetPublishingModeResult.from_binary(data)
13160
13161 1
    def __str__(self):
13162
        return 'SetPublishingModeResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13163
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
13164
               'Parameters:' + str(self.Parameters) + ')'
13165
13166 1
    __repr__ = __str__
13167 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13168
13169 1
class NotificationMessage(FrozenClass):
13170
    '''
13171
    :ivar SequenceNumber:
13172
    :vartype SequenceNumber: UInt32
13173
    :ivar PublishTime:
13174
    :vartype PublishTime: DateTime
13175
    :ivar NotificationData:
13176
    :vartype NotificationData: ExtensionObject
13177
    '''
13178
13179 1
    ua_types = {
13180
        'SequenceNumber': 'UInt32',
13181
        'PublishTime': 'DateTime',
13182
        'NotificationData': 'ExtensionObject',
13183
               }
13184
13185 1
    def __init__(self, binary=None):
13186 1
        if binary is not None:
13187 1
            self._binary_init(binary)
13188 1
            self._freeze = True
13189 1
            return
13190 1
        self.SequenceNumber = 0
13191 1
        self.PublishTime = datetime.utcnow()
13192 1
        self.NotificationData = []
13193 1
        self._freeze = True
13194
13195 1
    def to_binary(self):
13196 1
        packet = []
13197 1
        packet.append(uabin.Primitives.UInt32.pack(self.SequenceNumber))
13198 1
        packet.append(uabin.Primitives.DateTime.pack(self.PublishTime))
13199 1
        packet.append(uabin.Primitives.Int32.pack(len(self.NotificationData)))
13200 1
        for fieldname in self.NotificationData:
13201 1
            packet.append(extensionobject_to_binary(fieldname))
13202 1
        return b''.join(packet)
13203
13204 1
    @staticmethod
13205
    def from_binary(data):
13206 1
        return NotificationMessage(data)
13207
13208 1
    def _binary_init(self, data):
13209 1
        self.SequenceNumber = uabin.Primitives.UInt32.unpack(data)
13210 1
        self.PublishTime = uabin.Primitives.DateTime.unpack(data)
13211 1
        length = uabin.Primitives.Int32.unpack(data)
13212 1
        array = []
13213 1
        if length != -1:
13214 1
            for _ in range(0, length):
13215 1
                array.append(extensionobject_from_binary(data))
13216 1
        self.NotificationData = array
13217
13218 1
    def __str__(self):
13219
        return 'NotificationMessage(' + 'SequenceNumber:' + str(self.SequenceNumber) + ', ' + \
13220
               'PublishTime:' + str(self.PublishTime) + ', ' + \
13221
               'NotificationData:' + str(self.NotificationData) + ')'
13222
13223 1
    __repr__ = __str__
13224
13225
13226 1
class NotificationData(FrozenClass):
13227
    '''
13228
    '''
13229
13230 1
    ua_types = {
13231
               }
13232
13233 1
    def __init__(self, binary=None):
13234
        if binary is not None:
13235
            self._binary_init(binary)
13236
            self._freeze = True
13237
            return
13238
        self._freeze = True
13239
13240 1
    def to_binary(self):
13241
        packet = []
13242
        return b''.join(packet)
13243
13244 1
    @staticmethod
13245
    def from_binary(data):
13246
        return NotificationData(data)
13247
13248 1
    def _binary_init(self, data):
13249
        pass
13250
13251 1
    def __str__(self):
13252
        return 'NotificationData(' +  + ')'
13253
13254 1
    __repr__ = __str__
13255 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13256
13257 1
class DataChangeNotification(FrozenClass):
13258
    '''
13259
    :ivar MonitoredItems:
13260
    :vartype MonitoredItems: MonitoredItemNotification
13261
    :ivar DiagnosticInfos:
13262
    :vartype DiagnosticInfos: DiagnosticInfo
13263
    '''
13264
13265 1
    ua_types = {
13266
        'MonitoredItems': 'MonitoredItemNotification',
13267
        'DiagnosticInfos': 'DiagnosticInfo',
13268
               }
13269
13270 1
    def __init__(self, binary=None):
13271 1
        if binary is not None:
13272 1
            self._binary_init(binary)
13273 1
            self._freeze = True
13274 1
            return
13275 1
        self.MonitoredItems = []
13276 1
        self.DiagnosticInfos = []
13277 1
        self._freeze = True
13278
13279 1
    def to_binary(self):
13280 1
        packet = []
13281 1
        packet.append(uabin.Primitives.Int32.pack(len(self.MonitoredItems)))
13282 1
        for fieldname in self.MonitoredItems:
13283 1
            packet.append(fieldname.to_binary())
13284 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
13285 1
        for fieldname in self.DiagnosticInfos:
13286
            packet.append(fieldname.to_binary())
13287 1
        return b''.join(packet)
13288
13289 1
    @staticmethod
13290
    def from_binary(data):
13291 1
        return DataChangeNotification(data)
13292
13293 1
    def _binary_init(self, data):
13294 1
        length = uabin.Primitives.Int32.unpack(data)
13295 1
        array = []
13296 1
        if length != -1:
13297 1
            for _ in range(0, length):
13298 1
                array.append(MonitoredItemNotification.from_binary(data))
13299 1
        self.MonitoredItems = array
13300 1
        length = uabin.Primitives.Int32.unpack(data)
13301 1
        array = []
13302 1
        if length != -1:
13303 1
            for _ in range(0, length):
13304
                array.append(DiagnosticInfo.from_binary(data))
13305 1
        self.DiagnosticInfos = array
13306
13307 1
    def __str__(self):
13308
        return 'DataChangeNotification(' + 'MonitoredItems:' + str(self.MonitoredItems) + ', ' + \
13309
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
13310
13311 1
    __repr__ = __str__
13312
13313
13314 1
class MonitoredItemNotification(FrozenClass):
13315
    '''
13316
    :ivar ClientHandle:
13317
    :vartype ClientHandle: UInt32
13318
    :ivar Value:
13319
    :vartype Value: DataValue
13320
    '''
13321
13322 1
    ua_types = {
13323
        'ClientHandle': 'UInt32',
13324
        'Value': 'DataValue',
13325
               }
13326
13327 1
    def __init__(self, binary=None):
13328 1
        if binary is not None:
13329 1
            self._binary_init(binary)
13330 1
            self._freeze = True
13331 1
            return
13332 1
        self.ClientHandle = 0
13333 1
        self.Value = DataValue()
13334 1
        self._freeze = True
13335
13336 1
    def to_binary(self):
13337 1
        packet = []
13338 1
        packet.append(uabin.Primitives.UInt32.pack(self.ClientHandle))
13339 1
        packet.append(self.Value.to_binary())
13340 1
        return b''.join(packet)
13341
13342 1
    @staticmethod
13343
    def from_binary(data):
13344 1
        return MonitoredItemNotification(data)
13345
13346 1
    def _binary_init(self, data):
13347 1
        self.ClientHandle = uabin.Primitives.UInt32.unpack(data)
13348 1
        self.Value = DataValue.from_binary(data)
13349
13350 1
    def __str__(self):
13351
        return 'MonitoredItemNotification(' + 'ClientHandle:' + str(self.ClientHandle) + ', ' + \
13352
               'Value:' + str(self.Value) + ')'
13353
13354 1
    __repr__ = __str__
13355
13356
13357 1
class EventNotificationList(FrozenClass):
13358
    '''
13359
    :ivar Events:
13360
    :vartype Events: EventFieldList
13361
    '''
13362
13363 1
    ua_types = {
13364
        'Events': 'EventFieldList',
13365
               }
13366
13367 1
    def __init__(self, binary=None):
13368 1
        if binary is not None:
13369 1
            self._binary_init(binary)
13370 1
            self._freeze = True
13371 1
            return
13372 1
        self.Events = []
13373 1
        self._freeze = True
13374
13375 1
    def to_binary(self):
13376 1
        packet = []
13377 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Events)))
13378 1
        for fieldname in self.Events:
13379 1
            packet.append(fieldname.to_binary())
13380 1
        return b''.join(packet)
13381
13382 1
    @staticmethod
13383
    def from_binary(data):
13384 1
        return EventNotificationList(data)
13385
13386 1
    def _binary_init(self, data):
13387 1
        length = uabin.Primitives.Int32.unpack(data)
13388 1
        array = []
13389 1
        if length != -1:
13390 1
            for _ in range(0, length):
13391 1
                array.append(EventFieldList.from_binary(data))
13392 1
        self.Events = array
13393
13394 1
    def __str__(self):
13395
        return 'EventNotificationList(' + 'Events:' + str(self.Events) + ')'
13396
13397 1
    __repr__ = __str__
13398
13399
13400 1
class EventFieldList(FrozenClass):
13401
    '''
13402
    :ivar ClientHandle:
13403
    :vartype ClientHandle: UInt32
13404
    :ivar EventFields:
13405
    :vartype EventFields: Variant
13406
    '''
13407
13408 1
    ua_types = {
13409
        'ClientHandle': 'UInt32',
13410
        'EventFields': 'Variant',
13411
               }
13412
13413 1
    def __init__(self, binary=None):
13414 1
        if binary is not None:
13415 1
            self._binary_init(binary)
13416 1
            self._freeze = True
13417 1
            return
13418 1
        self.ClientHandle = 0
13419 1
        self.EventFields = []
13420 1
        self._freeze = True
13421
13422 1
    def to_binary(self):
13423 1
        packet = []
13424 1
        packet.append(uabin.Primitives.UInt32.pack(self.ClientHandle))
13425 1
        packet.append(uabin.Primitives.Int32.pack(len(self.EventFields)))
13426 1
        for fieldname in self.EventFields:
13427 1
            packet.append(fieldname.to_binary())
13428 1
        return b''.join(packet)
13429
13430 1
    @staticmethod
13431
    def from_binary(data):
13432 1
        return EventFieldList(data)
13433
13434 1
    def _binary_init(self, data):
13435 1
        self.ClientHandle = uabin.Primitives.UInt32.unpack(data)
13436 1
        length = uabin.Primitives.Int32.unpack(data)
13437 1
        array = []
13438 1
        if length != -1:
13439 1
            for _ in range(0, length):
13440 1
                array.append(Variant.from_binary(data))
13441 1
        self.EventFields = array
13442
13443 1
    def __str__(self):
13444
        return 'EventFieldList(' + 'ClientHandle:' + str(self.ClientHandle) + ', ' + \
13445
               'EventFields:' + str(self.EventFields) + ')'
13446
13447 1
    __repr__ = __str__
13448
13449
13450 1
class HistoryEventFieldList(FrozenClass):
13451
    '''
13452
    :ivar EventFields:
13453
    :vartype EventFields: Variant
13454
    '''
13455
13456 1
    ua_types = {
13457
        'EventFields': 'Variant',
13458
               }
13459
13460 1
    def __init__(self, binary=None):
13461 1
        if binary is not None:
13462
            self._binary_init(binary)
13463
            self._freeze = True
13464
            return
13465 1
        self.EventFields = []
13466 1
        self._freeze = True
13467
13468 1
    def to_binary(self):
13469
        packet = []
13470
        packet.append(uabin.Primitives.Int32.pack(len(self.EventFields)))
13471
        for fieldname in self.EventFields:
13472
            packet.append(fieldname.to_binary())
13473
        return b''.join(packet)
13474
13475 1
    @staticmethod
13476
    def from_binary(data):
13477
        return HistoryEventFieldList(data)
13478
13479 1
    def _binary_init(self, data):
13480
        length = uabin.Primitives.Int32.unpack(data)
13481
        array = []
13482
        if length != -1:
13483
            for _ in range(0, length):
13484
                array.append(Variant.from_binary(data))
13485
        self.EventFields = array
13486
13487 1
    def __str__(self):
13488
        return 'HistoryEventFieldList(' + 'EventFields:' + str(self.EventFields) + ')'
13489
13490 1
    __repr__ = __str__
13491
13492
13493 1
class StatusChangeNotification(FrozenClass):
13494
    '''
13495
    :ivar Status:
13496
    :vartype Status: StatusCode
13497
    :ivar DiagnosticInfo:
13498
    :vartype DiagnosticInfo: DiagnosticInfo
13499
    '''
13500
13501 1
    ua_types = {
13502
        'Status': 'StatusCode',
13503
        'DiagnosticInfo': 'DiagnosticInfo',
13504
               }
13505
13506 1
    def __init__(self, binary=None):
13507
        if binary is not None:
13508
            self._binary_init(binary)
13509
            self._freeze = True
13510
            return
13511
        self.Status = StatusCode()
13512
        self.DiagnosticInfo = DiagnosticInfo()
13513
        self._freeze = True
13514
13515 1
    def to_binary(self):
13516
        packet = []
13517
        packet.append(self.Status.to_binary())
13518
        packet.append(self.DiagnosticInfo.to_binary())
13519
        return b''.join(packet)
13520
13521 1
    @staticmethod
13522
    def from_binary(data):
13523
        return StatusChangeNotification(data)
13524
13525 1
    def _binary_init(self, data):
13526
        self.Status = StatusCode.from_binary(data)
13527
        self.DiagnosticInfo = DiagnosticInfo.from_binary(data)
13528
13529 1
    def __str__(self):
13530
        return 'StatusChangeNotification(' + 'Status:' + str(self.Status) + ', ' + \
13531
               'DiagnosticInfo:' + str(self.DiagnosticInfo) + ')'
13532
13533 1
    __repr__ = __str__
13534
13535
13536 1
class SubscriptionAcknowledgement(FrozenClass):
13537
    '''
13538
    :ivar SubscriptionId:
13539
    :vartype SubscriptionId: UInt32
13540
    :ivar SequenceNumber:
13541
    :vartype SequenceNumber: UInt32
13542
    '''
13543
13544 1
    ua_types = {
13545
        'SubscriptionId': 'UInt32',
13546
        'SequenceNumber': 'UInt32',
13547
               }
13548
13549 1
    def __init__(self, binary=None):
13550 1
        if binary is not None:
13551 1
            self._binary_init(binary)
13552 1
            self._freeze = True
13553 1
            return
13554 1
        self.SubscriptionId = 0
13555 1
        self.SequenceNumber = 0
13556 1
        self._freeze = True
13557
13558 1
    def to_binary(self):
13559 1
        packet = []
13560 1
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
13561 1
        packet.append(uabin.Primitives.UInt32.pack(self.SequenceNumber))
13562 1
        return b''.join(packet)
13563
13564 1
    @staticmethod
13565
    def from_binary(data):
13566 1
        return SubscriptionAcknowledgement(data)
13567
13568 1
    def _binary_init(self, data):
13569 1
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
13570 1
        self.SequenceNumber = uabin.Primitives.UInt32.unpack(data)
13571
13572 1
    def __str__(self):
13573
        return 'SubscriptionAcknowledgement(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
13574
               'SequenceNumber:' + str(self.SequenceNumber) + ')'
13575
13576 1
    __repr__ = __str__
13577
13578
13579 1
class PublishParameters(FrozenClass):
13580
    '''
13581
    :ivar SubscriptionAcknowledgements:
13582
    :vartype SubscriptionAcknowledgements: SubscriptionAcknowledgement
13583
    '''
13584
13585 1
    ua_types = {
13586
        'SubscriptionAcknowledgements': 'SubscriptionAcknowledgement',
13587
               }
13588
13589 1
    def __init__(self, binary=None):
13590 1
        if binary is not None:
13591 1
            self._binary_init(binary)
13592 1
            self._freeze = True
13593 1
            return
13594 1
        self.SubscriptionAcknowledgements = []
13595 1
        self._freeze = True
13596
13597 1
    def to_binary(self):
13598 1
        packet = []
13599 1
        packet.append(uabin.Primitives.Int32.pack(len(self.SubscriptionAcknowledgements)))
13600 1
        for fieldname in self.SubscriptionAcknowledgements:
13601 1
            packet.append(fieldname.to_binary())
13602 1
        return b''.join(packet)
13603
13604 1
    @staticmethod
13605
    def from_binary(data):
13606 1
        return PublishParameters(data)
13607
13608 1
    def _binary_init(self, data):
13609 1
        length = uabin.Primitives.Int32.unpack(data)
13610 1
        array = []
13611 1
        if length != -1:
13612 1
            for _ in range(0, length):
13613 1
                array.append(SubscriptionAcknowledgement.from_binary(data))
13614 1
        self.SubscriptionAcknowledgements = array
13615
13616 1
    def __str__(self):
13617
        return 'PublishParameters(' + 'SubscriptionAcknowledgements:' + str(self.SubscriptionAcknowledgements) + ')'
13618
13619 1
    __repr__ = __str__
13620
13621
13622 1
class PublishRequest(FrozenClass):
13623
    '''
13624
    :ivar TypeId:
13625
    :vartype TypeId: NodeId
13626
    :ivar RequestHeader:
13627
    :vartype RequestHeader: RequestHeader
13628
    :ivar Parameters:
13629
    :vartype Parameters: PublishParameters
13630
    '''
13631
13632 1
    ua_types = {
13633
        'TypeId': 'NodeId',
13634
        'RequestHeader': 'RequestHeader',
13635
        'Parameters': 'PublishParameters',
13636
               }
13637
13638 1
    def __init__(self, binary=None):
13639 1
        if binary is not None:
13640
            self._binary_init(binary)
13641
            self._freeze = True
13642
            return
13643 1
        self.TypeId = FourByteNodeId(ObjectIds.PublishRequest_Encoding_DefaultBinary)
13644 1
        self.RequestHeader = RequestHeader()
13645 1
        self.Parameters = PublishParameters()
13646 1
        self._freeze = True
13647
13648 1
    def to_binary(self):
13649 1
        packet = []
13650 1
        packet.append(self.TypeId.to_binary())
13651 1
        packet.append(self.RequestHeader.to_binary())
13652 1
        packet.append(self.Parameters.to_binary())
13653 1
        return b''.join(packet)
13654
13655 1
    @staticmethod
13656
    def from_binary(data):
13657
        return PublishRequest(data)
13658
13659 1
    def _binary_init(self, data):
13660
        self.TypeId = NodeId.from_binary(data)
13661
        self.RequestHeader = RequestHeader.from_binary(data)
13662
        self.Parameters = PublishParameters.from_binary(data)
13663
13664 1
    def __str__(self):
13665
        return 'PublishRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13666
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
13667
               'Parameters:' + str(self.Parameters) + ')'
13668
13669 1
    __repr__ = __str__
13670
13671
13672 1
class PublishResult(FrozenClass):
13673
    '''
13674 View Code Duplication
    :ivar SubscriptionId:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
13675
    :vartype SubscriptionId: UInt32
13676
    :ivar AvailableSequenceNumbers:
13677
    :vartype AvailableSequenceNumbers: UInt32
13678
    :ivar MoreNotifications:
13679
    :vartype MoreNotifications: Boolean
13680
    :ivar NotificationMessage:
13681
    :vartype NotificationMessage: NotificationMessage
13682
    :ivar Results:
13683
    :vartype Results: StatusCode
13684
    :ivar DiagnosticInfos:
13685
    :vartype DiagnosticInfos: DiagnosticInfo
13686
    '''
13687
13688 1
    ua_types = {
13689
        'SubscriptionId': 'UInt32',
13690
        'AvailableSequenceNumbers': 'UInt32',
13691
        'MoreNotifications': 'Boolean',
13692
        'NotificationMessage': 'NotificationMessage',
13693
        'Results': 'StatusCode',
13694
        'DiagnosticInfos': 'DiagnosticInfo',
13695
               }
13696
13697 1
    def __init__(self, binary=None):
13698 1
        if binary is not None:
13699 1
            self._binary_init(binary)
13700 1
            self._freeze = True
13701 1
            return
13702 1
        self.SubscriptionId = 0
13703 1
        self.AvailableSequenceNumbers = []
13704 1
        self.MoreNotifications = True
13705 1
        self.NotificationMessage = NotificationMessage()
13706 1
        self.Results = []
13707 1
        self.DiagnosticInfos = []
13708 1
        self._freeze = True
13709
13710 1
    def to_binary(self):
13711 1
        packet = []
13712 1
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
13713 1
        packet.append(uabin.Primitives.Int32.pack(len(self.AvailableSequenceNumbers)))
13714 1
        for fieldname in self.AvailableSequenceNumbers:
13715 1
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
13716 1
        packet.append(uabin.Primitives.Boolean.pack(self.MoreNotifications))
13717 1
        packet.append(self.NotificationMessage.to_binary())
13718 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
13719 1
        for fieldname in self.Results:
13720
            packet.append(fieldname.to_binary())
13721 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
13722 1
        for fieldname in self.DiagnosticInfos:
13723
            packet.append(fieldname.to_binary())
13724 1
        return b''.join(packet)
13725
13726 1
    @staticmethod
13727
    def from_binary(data):
13728 1
        return PublishResult(data)
13729
13730 1
    def _binary_init(self, data):
13731 1
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
13732 1
        self.AvailableSequenceNumbers = uabin.Primitives.UInt32.unpack_array(data)
13733 1
        self.MoreNotifications = uabin.Primitives.Boolean.unpack(data)
13734 1
        self.NotificationMessage = NotificationMessage.from_binary(data)
13735 1
        length = uabin.Primitives.Int32.unpack(data)
13736 1
        array = []
13737 1
        if length != -1:
13738 1
            for _ in range(0, length):
13739
                array.append(StatusCode.from_binary(data))
13740 1
        self.Results = array
13741 1
        length = uabin.Primitives.Int32.unpack(data)
13742 1
        array = []
13743 1
        if length != -1:
13744 1
            for _ in range(0, length):
13745
                array.append(DiagnosticInfo.from_binary(data))
13746 1
        self.DiagnosticInfos = array
13747
13748 1
    def __str__(self):
13749
        return 'PublishResult(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
13750
               'AvailableSequenceNumbers:' + str(self.AvailableSequenceNumbers) + ', ' + \
13751
               'MoreNotifications:' + str(self.MoreNotifications) + ', ' + \
13752
               'NotificationMessage:' + str(self.NotificationMessage) + ', ' + \
13753
               'Results:' + str(self.Results) + ', ' + \
13754
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
13755
13756 1
    __repr__ = __str__
13757
13758
13759 1
class PublishResponse(FrozenClass):
13760
    '''
13761
    :ivar TypeId:
13762
    :vartype TypeId: NodeId
13763
    :ivar ResponseHeader:
13764
    :vartype ResponseHeader: ResponseHeader
13765
    :ivar Parameters:
13766
    :vartype Parameters: PublishResult
13767
    '''
13768
13769 1
    ua_types = {
13770
        'TypeId': 'NodeId',
13771
        'ResponseHeader': 'ResponseHeader',
13772
        'Parameters': 'PublishResult',
13773
               }
13774
13775 1
    def __init__(self, binary=None):
13776 1
        if binary is not None:
13777 1
            self._binary_init(binary)
13778 1
            self._freeze = True
13779 1
            return
13780 1
        self.TypeId = FourByteNodeId(ObjectIds.PublishResponse_Encoding_DefaultBinary)
13781 1
        self.ResponseHeader = ResponseHeader()
13782 1
        self.Parameters = PublishResult()
13783 1
        self._freeze = True
13784
13785 1
    def to_binary(self):
13786 1
        packet = []
13787 1
        packet.append(self.TypeId.to_binary())
13788 1
        packet.append(self.ResponseHeader.to_binary())
13789 1
        packet.append(self.Parameters.to_binary())
13790 1
        return b''.join(packet)
13791
13792 1
    @staticmethod
13793
    def from_binary(data):
13794 1
        return PublishResponse(data)
13795
13796 1
    def _binary_init(self, data):
13797 1
        self.TypeId = NodeId.from_binary(data)
13798 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
13799 1
        self.Parameters = PublishResult.from_binary(data)
13800
13801 1
    def __str__(self):
13802
        return 'PublishResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13803
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
13804
               'Parameters:' + str(self.Parameters) + ')'
13805
13806 1
    __repr__ = __str__
13807
13808
13809 1
class RepublishParameters(FrozenClass):
13810
    '''
13811
    :ivar SubscriptionId:
13812
    :vartype SubscriptionId: UInt32
13813
    :ivar RetransmitSequenceNumber:
13814
    :vartype RetransmitSequenceNumber: UInt32
13815
    '''
13816
13817 1
    ua_types = {
13818
        'SubscriptionId': 'UInt32',
13819
        'RetransmitSequenceNumber': 'UInt32',
13820
               }
13821
13822 1
    def __init__(self, binary=None):
13823
        if binary is not None:
13824
            self._binary_init(binary)
13825
            self._freeze = True
13826
            return
13827
        self.SubscriptionId = 0
13828
        self.RetransmitSequenceNumber = 0
13829
        self._freeze = True
13830
13831 1
    def to_binary(self):
13832
        packet = []
13833
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
13834
        packet.append(uabin.Primitives.UInt32.pack(self.RetransmitSequenceNumber))
13835
        return b''.join(packet)
13836
13837 1
    @staticmethod
13838
    def from_binary(data):
13839
        return RepublishParameters(data)
13840
13841 1
    def _binary_init(self, data):
13842
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
13843
        self.RetransmitSequenceNumber = uabin.Primitives.UInt32.unpack(data)
13844
13845 1
    def __str__(self):
13846
        return 'RepublishParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
13847
               'RetransmitSequenceNumber:' + str(self.RetransmitSequenceNumber) + ')'
13848
13849 1
    __repr__ = __str__
13850
13851
13852 1
class RepublishRequest(FrozenClass):
13853
    '''
13854
    :ivar TypeId:
13855
    :vartype TypeId: NodeId
13856
    :ivar RequestHeader:
13857
    :vartype RequestHeader: RequestHeader
13858
    :ivar Parameters:
13859
    :vartype Parameters: RepublishParameters
13860
    '''
13861
13862 1
    ua_types = {
13863
        'TypeId': 'NodeId',
13864
        'RequestHeader': 'RequestHeader',
13865
        'Parameters': 'RepublishParameters',
13866
               }
13867
13868 1
    def __init__(self, binary=None):
13869
        if binary is not None:
13870
            self._binary_init(binary)
13871
            self._freeze = True
13872
            return
13873
        self.TypeId = FourByteNodeId(ObjectIds.RepublishRequest_Encoding_DefaultBinary)
13874
        self.RequestHeader = RequestHeader()
13875
        self.Parameters = RepublishParameters()
13876
        self._freeze = True
13877
13878 1
    def to_binary(self):
13879
        packet = []
13880
        packet.append(self.TypeId.to_binary())
13881
        packet.append(self.RequestHeader.to_binary())
13882
        packet.append(self.Parameters.to_binary())
13883
        return b''.join(packet)
13884
13885 1
    @staticmethod
13886
    def from_binary(data):
13887
        return RepublishRequest(data)
13888
13889 1
    def _binary_init(self, data):
13890
        self.TypeId = NodeId.from_binary(data)
13891
        self.RequestHeader = RequestHeader.from_binary(data)
13892
        self.Parameters = RepublishParameters.from_binary(data)
13893
13894 1
    def __str__(self):
13895
        return 'RepublishRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13896
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
13897
               'Parameters:' + str(self.Parameters) + ')'
13898
13899 1
    __repr__ = __str__
13900
13901
13902 1
class RepublishResponse(FrozenClass):
13903
    '''
13904
    :ivar TypeId:
13905
    :vartype TypeId: NodeId
13906
    :ivar ResponseHeader:
13907
    :vartype ResponseHeader: ResponseHeader
13908
    :ivar NotificationMessage:
13909
    :vartype NotificationMessage: NotificationMessage
13910
    '''
13911
13912 1
    ua_types = {
13913
        'TypeId': 'NodeId',
13914
        'ResponseHeader': 'ResponseHeader',
13915
        'NotificationMessage': 'NotificationMessage',
13916
               }
13917
13918 1
    def __init__(self, binary=None):
13919
        if binary is not None:
13920
            self._binary_init(binary)
13921
            self._freeze = True
13922
            return
13923
        self.TypeId = FourByteNodeId(ObjectIds.RepublishResponse_Encoding_DefaultBinary)
13924
        self.ResponseHeader = ResponseHeader()
13925
        self.NotificationMessage = NotificationMessage()
13926
        self._freeze = True
13927
13928 1
    def to_binary(self):
13929
        packet = []
13930
        packet.append(self.TypeId.to_binary())
13931
        packet.append(self.ResponseHeader.to_binary())
13932
        packet.append(self.NotificationMessage.to_binary())
13933
        return b''.join(packet)
13934
13935 1
    @staticmethod
13936
    def from_binary(data):
13937
        return RepublishResponse(data)
13938
13939 1
    def _binary_init(self, data):
13940
        self.TypeId = NodeId.from_binary(data)
13941
        self.ResponseHeader = ResponseHeader.from_binary(data)
13942
        self.NotificationMessage = NotificationMessage.from_binary(data)
13943
13944 1
    def __str__(self):
13945
        return 'RepublishResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
13946
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
13947
               'NotificationMessage:' + str(self.NotificationMessage) + ')'
13948
13949 1
    __repr__ = __str__
13950
13951
13952 1
class TransferResult(FrozenClass):
13953
    '''
13954
    :ivar StatusCode:
13955
    :vartype StatusCode: StatusCode
13956
    :ivar AvailableSequenceNumbers:
13957
    :vartype AvailableSequenceNumbers: UInt32
13958
    '''
13959
13960 1
    ua_types = {
13961
        'StatusCode': 'StatusCode',
13962
        'AvailableSequenceNumbers': 'UInt32',
13963
               }
13964
13965 1
    def __init__(self, binary=None):
13966
        if binary is not None:
13967
            self._binary_init(binary)
13968
            self._freeze = True
13969
            return
13970
        self.StatusCode = StatusCode()
13971
        self.AvailableSequenceNumbers = []
13972
        self._freeze = True
13973
13974 1
    def to_binary(self):
13975
        packet = []
13976
        packet.append(self.StatusCode.to_binary())
13977
        packet.append(uabin.Primitives.Int32.pack(len(self.AvailableSequenceNumbers)))
13978
        for fieldname in self.AvailableSequenceNumbers:
13979
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
13980
        return b''.join(packet)
13981
13982 1
    @staticmethod
13983
    def from_binary(data):
13984
        return TransferResult(data)
13985
13986 1
    def _binary_init(self, data):
13987
        self.StatusCode = StatusCode.from_binary(data)
13988
        self.AvailableSequenceNumbers = uabin.Primitives.UInt32.unpack_array(data)
13989
13990 1
    def __str__(self):
13991
        return 'TransferResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
13992
               'AvailableSequenceNumbers:' + str(self.AvailableSequenceNumbers) + ')'
13993
13994 1
    __repr__ = __str__
13995
13996
13997 1
class TransferSubscriptionsParameters(FrozenClass):
13998
    '''
13999
    :ivar SubscriptionIds:
14000
    :vartype SubscriptionIds: UInt32
14001
    :ivar SendInitialValues:
14002
    :vartype SendInitialValues: Boolean
14003
    '''
14004
14005 1
    ua_types = {
14006
        'SubscriptionIds': 'UInt32',
14007
        'SendInitialValues': 'Boolean',
14008
               }
14009
14010 1
    def __init__(self, binary=None):
14011
        if binary is not None:
14012
            self._binary_init(binary)
14013
            self._freeze = True
14014
            return
14015
        self.SubscriptionIds = []
14016
        self.SendInitialValues = True
14017
        self._freeze = True
14018
14019 1
    def to_binary(self):
14020
        packet = []
14021
        packet.append(uabin.Primitives.Int32.pack(len(self.SubscriptionIds)))
14022
        for fieldname in self.SubscriptionIds:
14023
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
14024
        packet.append(uabin.Primitives.Boolean.pack(self.SendInitialValues))
14025
        return b''.join(packet)
14026
14027 1
    @staticmethod
14028
    def from_binary(data):
14029
        return TransferSubscriptionsParameters(data)
14030
14031 1
    def _binary_init(self, data):
14032
        self.SubscriptionIds = uabin.Primitives.UInt32.unpack_array(data)
14033
        self.SendInitialValues = uabin.Primitives.Boolean.unpack(data)
14034
14035 1
    def __str__(self):
14036
        return 'TransferSubscriptionsParameters(' + 'SubscriptionIds:' + str(self.SubscriptionIds) + ', ' + \
14037
               'SendInitialValues:' + str(self.SendInitialValues) + ')'
14038
14039 1
    __repr__ = __str__
14040
14041
14042 1
class TransferSubscriptionsRequest(FrozenClass):
14043
    '''
14044
    :ivar TypeId:
14045
    :vartype TypeId: NodeId
14046
    :ivar RequestHeader:
14047
    :vartype RequestHeader: RequestHeader
14048
    :ivar Parameters:
14049
    :vartype Parameters: TransferSubscriptionsParameters
14050
    '''
14051
14052 1
    ua_types = {
14053
        'TypeId': 'NodeId',
14054
        'RequestHeader': 'RequestHeader',
14055
        'Parameters': 'TransferSubscriptionsParameters',
14056
               }
14057
14058 1
    def __init__(self, binary=None):
14059
        if binary is not None:
14060
            self._binary_init(binary)
14061
            self._freeze = True
14062
            return
14063
        self.TypeId = FourByteNodeId(ObjectIds.TransferSubscriptionsRequest_Encoding_DefaultBinary)
14064
        self.RequestHeader = RequestHeader()
14065
        self.Parameters = TransferSubscriptionsParameters()
14066
        self._freeze = True
14067
14068 1
    def to_binary(self):
14069
        packet = []
14070
        packet.append(self.TypeId.to_binary())
14071
        packet.append(self.RequestHeader.to_binary())
14072
        packet.append(self.Parameters.to_binary())
14073
        return b''.join(packet)
14074
14075 1
    @staticmethod
14076
    def from_binary(data):
14077
        return TransferSubscriptionsRequest(data)
14078
14079 1
    def _binary_init(self, data):
14080
        self.TypeId = NodeId.from_binary(data)
14081
        self.RequestHeader = RequestHeader.from_binary(data)
14082
        self.Parameters = TransferSubscriptionsParameters.from_binary(data)
14083
14084 1
    def __str__(self):
14085
        return 'TransferSubscriptionsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
14086
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
14087
               'Parameters:' + str(self.Parameters) + ')'
14088
14089 1
    __repr__ = __str__
14090 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
14091
14092 1
class TransferSubscriptionsResult(FrozenClass):
14093
    '''
14094
    :ivar Results:
14095
    :vartype Results: TransferResult
14096
    :ivar DiagnosticInfos:
14097
    :vartype DiagnosticInfos: DiagnosticInfo
14098
    '''
14099
14100 1
    ua_types = {
14101
        'Results': 'TransferResult',
14102
        'DiagnosticInfos': 'DiagnosticInfo',
14103
               }
14104
14105 1
    def __init__(self, binary=None):
14106
        if binary is not None:
14107
            self._binary_init(binary)
14108
            self._freeze = True
14109
            return
14110
        self.Results = []
14111
        self.DiagnosticInfos = []
14112
        self._freeze = True
14113
14114 1
    def to_binary(self):
14115
        packet = []
14116
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
14117
        for fieldname in self.Results:
14118
            packet.append(fieldname.to_binary())
14119
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
14120
        for fieldname in self.DiagnosticInfos:
14121
            packet.append(fieldname.to_binary())
14122
        return b''.join(packet)
14123
14124 1
    @staticmethod
14125
    def from_binary(data):
14126
        return TransferSubscriptionsResult(data)
14127
14128 1
    def _binary_init(self, data):
14129
        length = uabin.Primitives.Int32.unpack(data)
14130
        array = []
14131
        if length != -1:
14132
            for _ in range(0, length):
14133
                array.append(TransferResult.from_binary(data))
14134
        self.Results = array
14135
        length = uabin.Primitives.Int32.unpack(data)
14136
        array = []
14137
        if length != -1:
14138
            for _ in range(0, length):
14139
                array.append(DiagnosticInfo.from_binary(data))
14140
        self.DiagnosticInfos = array
14141
14142 1
    def __str__(self):
14143
        return 'TransferSubscriptionsResult(' + 'Results:' + str(self.Results) + ', ' + \
14144
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
14145
14146 1
    __repr__ = __str__
14147
14148
14149 1
class TransferSubscriptionsResponse(FrozenClass):
14150
    '''
14151
    :ivar TypeId:
14152
    :vartype TypeId: NodeId
14153
    :ivar ResponseHeader:
14154
    :vartype ResponseHeader: ResponseHeader
14155
    :ivar Parameters:
14156
    :vartype Parameters: TransferSubscriptionsResult
14157
    '''
14158
14159 1
    ua_types = {
14160
        'TypeId': 'NodeId',
14161
        'ResponseHeader': 'ResponseHeader',
14162
        'Parameters': 'TransferSubscriptionsResult',
14163
               }
14164
14165 1
    def __init__(self, binary=None):
14166
        if binary is not None:
14167
            self._binary_init(binary)
14168
            self._freeze = True
14169
            return
14170
        self.TypeId = FourByteNodeId(ObjectIds.TransferSubscriptionsResponse_Encoding_DefaultBinary)
14171
        self.ResponseHeader = ResponseHeader()
14172
        self.Parameters = TransferSubscriptionsResult()
14173
        self._freeze = True
14174
14175 1
    def to_binary(self):
14176
        packet = []
14177
        packet.append(self.TypeId.to_binary())
14178
        packet.append(self.ResponseHeader.to_binary())
14179
        packet.append(self.Parameters.to_binary())
14180
        return b''.join(packet)
14181
14182 1
    @staticmethod
14183
    def from_binary(data):
14184
        return TransferSubscriptionsResponse(data)
14185
14186 1
    def _binary_init(self, data):
14187
        self.TypeId = NodeId.from_binary(data)
14188
        self.ResponseHeader = ResponseHeader.from_binary(data)
14189
        self.Parameters = TransferSubscriptionsResult.from_binary(data)
14190
14191 1
    def __str__(self):
14192
        return 'TransferSubscriptionsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
14193
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
14194
               'Parameters:' + str(self.Parameters) + ')'
14195
14196 1
    __repr__ = __str__
14197
14198
14199 1
class DeleteSubscriptionsParameters(FrozenClass):
14200
    '''
14201
    :ivar SubscriptionIds:
14202
    :vartype SubscriptionIds: UInt32
14203
    '''
14204
14205 1
    ua_types = {
14206
        'SubscriptionIds': 'UInt32',
14207
               }
14208
14209 1
    def __init__(self, binary=None):
14210 1
        if binary is not None:
14211 1
            self._binary_init(binary)
14212 1
            self._freeze = True
14213 1
            return
14214 1
        self.SubscriptionIds = []
14215 1
        self._freeze = True
14216
14217 1
    def to_binary(self):
14218 1
        packet = []
14219 1
        packet.append(uabin.Primitives.Int32.pack(len(self.SubscriptionIds)))
14220 1
        for fieldname in self.SubscriptionIds:
14221 1
            packet.append(uabin.Primitives.UInt32.pack(fieldname))
14222 1
        return b''.join(packet)
14223
14224 1
    @staticmethod
14225
    def from_binary(data):
14226 1
        return DeleteSubscriptionsParameters(data)
14227
14228 1
    def _binary_init(self, data):
14229 1
        self.SubscriptionIds = uabin.Primitives.UInt32.unpack_array(data)
14230
14231 1
    def __str__(self):
14232
        return 'DeleteSubscriptionsParameters(' + 'SubscriptionIds:' + str(self.SubscriptionIds) + ')'
14233
14234 1
    __repr__ = __str__
14235
14236
14237 1
class DeleteSubscriptionsRequest(FrozenClass):
14238
    '''
14239
    :ivar TypeId:
14240
    :vartype TypeId: NodeId
14241
    :ivar RequestHeader:
14242
    :vartype RequestHeader: RequestHeader
14243
    :ivar Parameters:
14244
    :vartype Parameters: DeleteSubscriptionsParameters
14245
    '''
14246
14247 1
    ua_types = {
14248
        'TypeId': 'NodeId',
14249
        'RequestHeader': 'RequestHeader',
14250
        'Parameters': 'DeleteSubscriptionsParameters',
14251
               }
14252
14253 1
    def __init__(self, binary=None):
14254 1
        if binary is not None:
14255
            self._binary_init(binary)
14256
            self._freeze = True
14257
            return
14258 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteSubscriptionsRequest_Encoding_DefaultBinary)
14259 1
        self.RequestHeader = RequestHeader()
14260 1
        self.Parameters = DeleteSubscriptionsParameters()
14261 1
        self._freeze = True
14262
14263 1
    def to_binary(self):
14264 1
        packet = []
14265 1
        packet.append(self.TypeId.to_binary())
14266 1
        packet.append(self.RequestHeader.to_binary())
14267 1
        packet.append(self.Parameters.to_binary())
14268 1
        return b''.join(packet)
14269
14270 1
    @staticmethod
14271
    def from_binary(data):
14272
        return DeleteSubscriptionsRequest(data)
14273
14274 1
    def _binary_init(self, data):
14275
        self.TypeId = NodeId.from_binary(data)
14276
        self.RequestHeader = RequestHeader.from_binary(data)
14277
        self.Parameters = DeleteSubscriptionsParameters.from_binary(data)
14278
14279 1
    def __str__(self):
14280
        return 'DeleteSubscriptionsRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
14281
               'RequestHeader:' + str(self.RequestHeader) + ', ' + \
14282
               'Parameters:' + str(self.Parameters) + ')'
14283
14284 1
    __repr__ = __str__
14285
14286
14287 1
class DeleteSubscriptionsResponse(FrozenClass):
14288
    '''
14289
    :ivar TypeId:
14290
    :vartype TypeId: NodeId
14291
    :ivar ResponseHeader:
14292
    :vartype ResponseHeader: ResponseHeader
14293
    :ivar Results:
14294
    :vartype Results: StatusCode
14295
    :ivar DiagnosticInfos:
14296
    :vartype DiagnosticInfos: DiagnosticInfo
14297
    '''
14298
14299 1
    ua_types = {
14300
        'TypeId': 'NodeId',
14301
        'ResponseHeader': 'ResponseHeader',
14302
        'Results': 'StatusCode',
14303
        'DiagnosticInfos': 'DiagnosticInfo',
14304
               }
14305
14306 1
    def __init__(self, binary=None):
14307 1
        if binary is not None:
14308 1
            self._binary_init(binary)
14309 1
            self._freeze = True
14310 1
            return
14311 1
        self.TypeId = FourByteNodeId(ObjectIds.DeleteSubscriptionsResponse_Encoding_DefaultBinary)
14312 1
        self.ResponseHeader = ResponseHeader()
14313 1
        self.Results = []
14314 1
        self.DiagnosticInfos = []
14315 1
        self._freeze = True
14316
14317 1
    def to_binary(self):
14318 1
        packet = []
14319 1
        packet.append(self.TypeId.to_binary())
14320 1
        packet.append(self.ResponseHeader.to_binary())
14321 1
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
14322 1
        for fieldname in self.Results:
14323 1
            packet.append(fieldname.to_binary())
14324 1
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
14325 1
        for fieldname in self.DiagnosticInfos:
14326
            packet.append(fieldname.to_binary())
14327 1
        return b''.join(packet)
14328
14329 1
    @staticmethod
14330
    def from_binary(data):
14331 1
        return DeleteSubscriptionsResponse(data)
14332
14333 1
    def _binary_init(self, data):
14334 1
        self.TypeId = NodeId.from_binary(data)
14335 1
        self.ResponseHeader = ResponseHeader.from_binary(data)
14336 1
        length = uabin.Primitives.Int32.unpack(data)
14337 1
        array = []
14338 1
        if length != -1:
14339 1
            for _ in range(0, length):
14340 1
                array.append(StatusCode.from_binary(data))
14341 1
        self.Results = array
14342 1
        length = uabin.Primitives.Int32.unpack(data)
14343 1
        array = []
14344 1
        if length != -1:
14345 1
            for _ in range(0, length):
14346
                array.append(DiagnosticInfo.from_binary(data))
14347 1
        self.DiagnosticInfos = array
14348
14349 1
    def __str__(self):
14350
        return 'DeleteSubscriptionsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
14351
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
14352
               'Results:' + str(self.Results) + ', ' + \
14353
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
14354
14355 1
    __repr__ = __str__
14356
14357
14358 1
class BuildInfo(FrozenClass):
14359
    '''
14360
    :ivar ProductUri:
14361
    :vartype ProductUri: String
14362
    :ivar ManufacturerName:
14363
    :vartype ManufacturerName: String
14364
    :ivar ProductName:
14365
    :vartype ProductName: String
14366
    :ivar SoftwareVersion:
14367
    :vartype SoftwareVersion: String
14368
    :ivar BuildNumber:
14369
    :vartype BuildNumber: String
14370
    :ivar BuildDate:
14371
    :vartype BuildDate: DateTime
14372
    '''
14373
14374 1
    ua_types = {
14375
        'ProductUri': 'String',
14376
        'ManufacturerName': 'String',
14377
        'ProductName': 'String',
14378
        'SoftwareVersion': 'String',
14379
        'BuildNumber': 'String',
14380
        'BuildDate': 'DateTime',
14381
               }
14382
14383 1
    def __init__(self, binary=None):
14384
        if binary is not None:
14385
            self._binary_init(binary)
14386
            self._freeze = True
14387
            return
14388
        self.ProductUri = None
14389
        self.ManufacturerName = None
14390
        self.ProductName = None
14391
        self.SoftwareVersion = None
14392
        self.BuildNumber = None
14393 View Code Duplication
        self.BuildDate = datetime.utcnow()
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
14394
        self._freeze = True
14395
14396 1
    def to_binary(self):
14397
        packet = []
14398
        packet.append(uabin.Primitives.String.pack(self.ProductUri))
14399
        packet.append(uabin.Primitives.String.pack(self.ManufacturerName))
14400
        packet.append(uabin.Primitives.String.pack(self.ProductName))
14401
        packet.append(uabin.Primitives.String.pack(self.SoftwareVersion))
14402
        packet.append(uabin.Primitives.String.pack(self.BuildNumber))
14403
        packet.append(uabin.Primitives.DateTime.pack(self.BuildDate))
14404
        return b''.join(packet)
14405
14406 1
    @staticmethod
14407
    def from_binary(data):
14408
        return BuildInfo(data)
14409
14410 1
    def _binary_init(self, data):
14411
        self.ProductUri = uabin.Primitives.String.unpack(data)
14412
        self.ManufacturerName = uabin.Primitives.String.unpack(data)
14413
        self.ProductName = uabin.Primitives.String.unpack(data)
14414
        self.SoftwareVersion = uabin.Primitives.String.unpack(data)
14415
        self.BuildNumber = uabin.Primitives.String.unpack(data)
14416
        self.BuildDate = uabin.Primitives.DateTime.unpack(data)
14417
14418 1
    def __str__(self):
14419
        return 'BuildInfo(' + 'ProductUri:' + str(self.ProductUri) + ', ' + \
14420
               'ManufacturerName:' + str(self.ManufacturerName) + ', ' + \
14421
               'ProductName:' + str(self.ProductName) + ', ' + \
14422
               'SoftwareVersion:' + str(self.SoftwareVersion) + ', ' + \
14423
               'BuildNumber:' + str(self.BuildNumber) + ', ' + \
14424
               'BuildDate:' + str(self.BuildDate) + ')'
14425
14426 1
    __repr__ = __str__
14427
14428
14429 1
class RedundantServerDataType(FrozenClass):
14430
    '''
14431
    :ivar ServerId:
14432
    :vartype ServerId: String
14433
    :ivar ServiceLevel:
14434
    :vartype ServiceLevel: Byte
14435
    :ivar ServerState:
14436
    :vartype ServerState: ServerState
14437
    '''
14438
14439 1
    ua_types = {
14440
        'ServerId': 'String',
14441
        'ServiceLevel': 'Byte',
14442
        'ServerState': 'ServerState',
14443
               }
14444
14445 1
    def __init__(self, binary=None):
14446
        if binary is not None:
14447
            self._binary_init(binary)
14448
            self._freeze = True
14449
            return
14450
        self.ServerId = None
14451
        self.ServiceLevel = 0
14452
        self.ServerState = ServerState(0)
14453
        self._freeze = True
14454
14455 1
    def to_binary(self):
14456
        packet = []
14457
        packet.append(uabin.Primitives.String.pack(self.ServerId))
14458
        packet.append(uabin.Primitives.Byte.pack(self.ServiceLevel))
14459
        packet.append(uabin.Primitives.UInt32.pack(self.ServerState.value))
14460
        return b''.join(packet)
14461
14462 1
    @staticmethod
14463
    def from_binary(data):
14464
        return RedundantServerDataType(data)
14465
14466 1
    def _binary_init(self, data):
14467
        self.ServerId = uabin.Primitives.String.unpack(data)
14468
        self.ServiceLevel = uabin.Primitives.Byte.unpack(data)
14469
        self.ServerState = ServerState(uabin.Primitives.UInt32.unpack(data))
14470
14471 1
    def __str__(self):
14472
        return 'RedundantServerDataType(' + 'ServerId:' + str(self.ServerId) + ', ' + \
14473
               'ServiceLevel:' + str(self.ServiceLevel) + ', ' + \
14474
               'ServerState:' + str(self.ServerState) + ')'
14475
14476 1
    __repr__ = __str__
14477
14478
14479 1
class EndpointUrlListDataType(FrozenClass):
14480
    '''
14481
    :ivar EndpointUrlList:
14482
    :vartype EndpointUrlList: String
14483
    '''
14484
14485 1
    ua_types = {
14486
        'EndpointUrlList': 'String',
14487
               }
14488
14489 1
    def __init__(self, binary=None):
14490
        if binary is not None:
14491
            self._binary_init(binary)
14492
            self._freeze = True
14493
            return
14494
        self.EndpointUrlList = []
14495
        self._freeze = True
14496
14497 1
    def to_binary(self):
14498
        packet = []
14499
        packet.append(uabin.Primitives.Int32.pack(len(self.EndpointUrlList)))
14500
        for fieldname in self.EndpointUrlList:
14501
            packet.append(uabin.Primitives.String.pack(fieldname))
14502
        return b''.join(packet)
14503
14504 1
    @staticmethod
14505
    def from_binary(data):
14506
        return EndpointUrlListDataType(data)
14507
14508 1
    def _binary_init(self, data):
14509
        self.EndpointUrlList = uabin.Primitives.String.unpack_array(data)
14510
14511 1
    def __str__(self):
14512
        return 'EndpointUrlListDataType(' + 'EndpointUrlList:' + str(self.EndpointUrlList) + ')'
14513
14514 1
    __repr__ = __str__
14515
14516
14517 1
class NetworkGroupDataType(FrozenClass):
14518
    '''
14519
    :ivar ServerUri:
14520
    :vartype ServerUri: String
14521
    :ivar NetworkPaths:
14522
    :vartype NetworkPaths: EndpointUrlListDataType
14523
    '''
14524
14525 1
    ua_types = {
14526
        'ServerUri': 'String',
14527
        'NetworkPaths': 'EndpointUrlListDataType',
14528
               }
14529
14530 1
    def __init__(self, binary=None):
14531 View Code Duplication
        if binary is not None:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
14532
            self._binary_init(binary)
14533
            self._freeze = True
14534
            return
14535
        self.ServerUri = None
14536
        self.NetworkPaths = []
14537
        self._freeze = True
14538
14539 1
    def to_binary(self):
14540
        packet = []
14541
        packet.append(uabin.Primitives.String.pack(self.ServerUri))
14542
        packet.append(uabin.Primitives.Int32.pack(len(self.NetworkPaths)))
14543
        for fieldname in self.NetworkPaths:
14544
            packet.append(fieldname.to_binary())
14545
        return b''.join(packet)
14546
14547 1
    @staticmethod
14548
    def from_binary(data):
14549
        return NetworkGroupDataType(data)
14550
14551 1
    def _binary_init(self, data):
14552
        self.ServerUri = uabin.Primitives.String.unpack(data)
14553
        length = uabin.Primitives.Int32.unpack(data)
14554
        array = []
14555
        if length != -1:
14556
            for _ in range(0, length):
14557
                array.append(EndpointUrlListDataType.from_binary(data))
14558
        self.NetworkPaths = array
14559
14560 1
    def __str__(self):
14561
        return 'NetworkGroupDataType(' + 'ServerUri:' + str(self.ServerUri) + ', ' + \
14562
               'NetworkPaths:' + str(self.NetworkPaths) + ')'
14563
14564 1
    __repr__ = __str__
14565
14566
14567 1
class SamplingIntervalDiagnosticsDataType(FrozenClass):
14568
    '''
14569
    :ivar SamplingInterval:
14570
    :vartype SamplingInterval: Double
14571
    :ivar MonitoredItemCount:
14572
    :vartype MonitoredItemCount: UInt32
14573
    :ivar MaxMonitoredItemCount:
14574
    :vartype MaxMonitoredItemCount: UInt32
14575
    :ivar DisabledMonitoredItemCount:
14576
    :vartype DisabledMonitoredItemCount: UInt32
14577
    '''
14578
14579 1
    ua_types = {
14580
        'SamplingInterval': 'Double',
14581
        'MonitoredItemCount': 'UInt32',
14582
        'MaxMonitoredItemCount': 'UInt32',
14583
        'DisabledMonitoredItemCount': 'UInt32',
14584
               }
14585
14586 1
    def __init__(self, binary=None):
14587
        if binary is not None:
14588
            self._binary_init(binary)
14589
            self._freeze = True
14590
            return
14591
        self.SamplingInterval = 0
14592
        self.MonitoredItemCount = 0
14593
        self.MaxMonitoredItemCount = 0
14594
        self.DisabledMonitoredItemCount = 0
14595
        self._freeze = True
14596
14597 1
    def to_binary(self):
14598
        packet = []
14599
        packet.append(uabin.Primitives.Double.pack(self.SamplingInterval))
14600
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoredItemCount))
14601
        packet.append(uabin.Primitives.UInt32.pack(self.MaxMonitoredItemCount))
14602
        packet.append(uabin.Primitives.UInt32.pack(self.DisabledMonitoredItemCount))
14603
        return b''.join(packet)
14604
14605 1
    @staticmethod
14606
    def from_binary(data):
14607
        return SamplingIntervalDiagnosticsDataType(data)
14608
14609 1
    def _binary_init(self, data):
14610
        self.SamplingInterval = uabin.Primitives.Double.unpack(data)
14611
        self.MonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
14612
        self.MaxMonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
14613
        self.DisabledMonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
14614
14615 1
    def __str__(self):
14616
        return 'SamplingIntervalDiagnosticsDataType(' + 'SamplingInterval:' + str(self.SamplingInterval) + ', ' + \
14617
               'MonitoredItemCount:' + str(self.MonitoredItemCount) + ', ' + \
14618
               'MaxMonitoredItemCount:' + str(self.MaxMonitoredItemCount) + ', ' + \
14619
               'DisabledMonitoredItemCount:' + str(self.DisabledMonitoredItemCount) + ')'
14620
14621 1
    __repr__ = __str__
14622
14623
14624 1
class ServerDiagnosticsSummaryDataType(FrozenClass):
14625
    '''
14626
    :ivar ServerViewCount:
14627
    :vartype ServerViewCount: UInt32
14628
    :ivar CurrentSessionCount:
14629
    :vartype CurrentSessionCount: UInt32
14630
    :ivar CumulatedSessionCount:
14631
    :vartype CumulatedSessionCount: UInt32
14632
    :ivar SecurityRejectedSessionCount:
14633
    :vartype SecurityRejectedSessionCount: UInt32
14634
    :ivar RejectedSessionCount:
14635
    :vartype RejectedSessionCount: UInt32
14636
    :ivar SessionTimeoutCount:
14637
    :vartype SessionTimeoutCount: UInt32
14638
    :ivar SessionAbortCount:
14639
    :vartype SessionAbortCount: UInt32
14640
    :ivar CurrentSubscriptionCount:
14641
    :vartype CurrentSubscriptionCount: UInt32
14642
    :ivar CumulatedSubscriptionCount:
14643
    :vartype CumulatedSubscriptionCount: UInt32
14644
    :ivar PublishingIntervalCount:
14645
    :vartype PublishingIntervalCount: UInt32
14646
    :ivar SecurityRejectedRequestsCount:
14647
    :vartype SecurityRejectedRequestsCount: UInt32
14648
    :ivar RejectedRequestsCount:
14649
    :vartype RejectedRequestsCount: UInt32
14650
    '''
14651
14652 1
    ua_types = {
14653
        'ServerViewCount': 'UInt32',
14654
        'CurrentSessionCount': 'UInt32',
14655
        'CumulatedSessionCount': 'UInt32',
14656
        'SecurityRejectedSessionCount': 'UInt32',
14657
        'RejectedSessionCount': 'UInt32',
14658
        'SessionTimeoutCount': 'UInt32',
14659
        'SessionAbortCount': 'UInt32',
14660
        'CurrentSubscriptionCount': 'UInt32',
14661
        'CumulatedSubscriptionCount': 'UInt32',
14662
        'PublishingIntervalCount': 'UInt32',
14663
        'SecurityRejectedRequestsCount': 'UInt32',
14664
        'RejectedRequestsCount': 'UInt32',
14665
               }
14666
14667 1
    def __init__(self, binary=None):
14668
        if binary is not None:
14669
            self._binary_init(binary)
14670
            self._freeze = True
14671
            return
14672
        self.ServerViewCount = 0
14673
        self.CurrentSessionCount = 0
14674
        self.CumulatedSessionCount = 0
14675
        self.SecurityRejectedSessionCount = 0
14676
        self.RejectedSessionCount = 0
14677
        self.SessionTimeoutCount = 0
14678
        self.SessionAbortCount = 0
14679
        self.CurrentSubscriptionCount = 0
14680
        self.CumulatedSubscriptionCount = 0
14681
        self.PublishingIntervalCount = 0
14682
        self.SecurityRejectedRequestsCount = 0
14683
        self.RejectedRequestsCount = 0
14684
        self._freeze = True
14685
14686 1
    def to_binary(self):
14687
        packet = []
14688
        packet.append(uabin.Primitives.UInt32.pack(self.ServerViewCount))
14689
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentSessionCount))
14690
        packet.append(uabin.Primitives.UInt32.pack(self.CumulatedSessionCount))
14691
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityRejectedSessionCount))
14692
        packet.append(uabin.Primitives.UInt32.pack(self.RejectedSessionCount))
14693
        packet.append(uabin.Primitives.UInt32.pack(self.SessionTimeoutCount))
14694
        packet.append(uabin.Primitives.UInt32.pack(self.SessionAbortCount))
14695
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentSubscriptionCount))
14696
        packet.append(uabin.Primitives.UInt32.pack(self.CumulatedSubscriptionCount))
14697
        packet.append(uabin.Primitives.UInt32.pack(self.PublishingIntervalCount))
14698
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityRejectedRequestsCount))
14699
        packet.append(uabin.Primitives.UInt32.pack(self.RejectedRequestsCount))
14700
        return b''.join(packet)
14701 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
14702 1
    @staticmethod
14703
    def from_binary(data):
14704
        return ServerDiagnosticsSummaryDataType(data)
14705
14706 1
    def _binary_init(self, data):
14707
        self.ServerViewCount = uabin.Primitives.UInt32.unpack(data)
14708
        self.CurrentSessionCount = uabin.Primitives.UInt32.unpack(data)
14709
        self.CumulatedSessionCount = uabin.Primitives.UInt32.unpack(data)
14710
        self.SecurityRejectedSessionCount = uabin.Primitives.UInt32.unpack(data)
14711
        self.RejectedSessionCount = uabin.Primitives.UInt32.unpack(data)
14712
        self.SessionTimeoutCount = uabin.Primitives.UInt32.unpack(data)
14713
        self.SessionAbortCount = uabin.Primitives.UInt32.unpack(data)
14714
        self.CurrentSubscriptionCount = uabin.Primitives.UInt32.unpack(data)
14715
        self.CumulatedSubscriptionCount = uabin.Primitives.UInt32.unpack(data)
14716
        self.PublishingIntervalCount = uabin.Primitives.UInt32.unpack(data)
14717
        self.SecurityRejectedRequestsCount = uabin.Primitives.UInt32.unpack(data)
14718
        self.RejectedRequestsCount = uabin.Primitives.UInt32.unpack(data)
14719
14720 1
    def __str__(self):
14721
        return 'ServerDiagnosticsSummaryDataType(' + 'ServerViewCount:' + str(self.ServerViewCount) + ', ' + \
14722
               'CurrentSessionCount:' + str(self.CurrentSessionCount) + ', ' + \
14723
               'CumulatedSessionCount:' + str(self.CumulatedSessionCount) + ', ' + \
14724
               'SecurityRejectedSessionCount:' + str(self.SecurityRejectedSessionCount) + ', ' + \
14725
               'RejectedSessionCount:' + str(self.RejectedSessionCount) + ', ' + \
14726
               'SessionTimeoutCount:' + str(self.SessionTimeoutCount) + ', ' + \
14727
               'SessionAbortCount:' + str(self.SessionAbortCount) + ', ' + \
14728
               'CurrentSubscriptionCount:' + str(self.CurrentSubscriptionCount) + ', ' + \
14729
               'CumulatedSubscriptionCount:' + str(self.CumulatedSubscriptionCount) + ', ' + \
14730
               'PublishingIntervalCount:' + str(self.PublishingIntervalCount) + ', ' + \
14731
               'SecurityRejectedRequestsCount:' + str(self.SecurityRejectedRequestsCount) + ', ' + \
14732
               'RejectedRequestsCount:' + str(self.RejectedRequestsCount) + ')'
14733
14734 1
    __repr__ = __str__
14735
14736
14737 1
class ServerStatusDataType(FrozenClass):
14738
    '''
14739
    :ivar StartTime:
14740
    :vartype StartTime: DateTime
14741
    :ivar CurrentTime:
14742
    :vartype CurrentTime: DateTime
14743
    :ivar State:
14744
    :vartype State: ServerState
14745
    :ivar BuildInfo:
14746
    :vartype BuildInfo: BuildInfo
14747
    :ivar SecondsTillShutdown:
14748
    :vartype SecondsTillShutdown: UInt32
14749
    :ivar ShutdownReason:
14750
    :vartype ShutdownReason: LocalizedText
14751
    '''
14752
14753 1
    ua_types = {
14754
        'StartTime': 'DateTime',
14755
        'CurrentTime': 'DateTime',
14756
        'State': 'ServerState',
14757
        'BuildInfo': 'BuildInfo',
14758
        'SecondsTillShutdown': 'UInt32',
14759
        'ShutdownReason': 'LocalizedText',
14760
               }
14761
14762 1
    def __init__(self, binary=None):
14763
        if binary is not None:
14764
            self._binary_init(binary)
14765
            self._freeze = True
14766
            return
14767
        self.StartTime = datetime.utcnow()
14768
        self.CurrentTime = datetime.utcnow()
14769
        self.State = ServerState(0)
14770
        self.BuildInfo = BuildInfo()
14771
        self.SecondsTillShutdown = 0
14772
        self.ShutdownReason = LocalizedText()
14773
        self._freeze = True
14774
14775 1
    def to_binary(self):
14776
        packet = []
14777
        packet.append(uabin.Primitives.DateTime.pack(self.StartTime))
14778
        packet.append(uabin.Primitives.DateTime.pack(self.CurrentTime))
14779
        packet.append(uabin.Primitives.UInt32.pack(self.State.value))
14780
        packet.append(self.BuildInfo.to_binary())
14781
        packet.append(uabin.Primitives.UInt32.pack(self.SecondsTillShutdown))
14782
        packet.append(self.ShutdownReason.to_binary())
14783
        return b''.join(packet)
14784
14785 1
    @staticmethod
14786
    def from_binary(data):
14787
        return ServerStatusDataType(data)
14788
14789 1
    def _binary_init(self, data):
14790
        self.StartTime = uabin.Primitives.DateTime.unpack(data)
14791
        self.CurrentTime = uabin.Primitives.DateTime.unpack(data)
14792
        self.State = ServerState(uabin.Primitives.UInt32.unpack(data))
14793
        self.BuildInfo = BuildInfo.from_binary(data)
14794
        self.SecondsTillShutdown = uabin.Primitives.UInt32.unpack(data)
14795
        self.ShutdownReason = LocalizedText.from_binary(data)
14796
14797 1
    def __str__(self):
14798
        return 'ServerStatusDataType(' + 'StartTime:' + str(self.StartTime) + ', ' + \
14799
               'CurrentTime:' + str(self.CurrentTime) + ', ' + \
14800
               'State:' + str(self.State) + ', ' + \
14801
               'BuildInfo:' + str(self.BuildInfo) + ', ' + \
14802
               'SecondsTillShutdown:' + str(self.SecondsTillShutdown) + ', ' + \
14803
               'ShutdownReason:' + str(self.ShutdownReason) + ')'
14804
14805 1
    __repr__ = __str__
14806
14807
14808 1
class SessionDiagnosticsDataType(FrozenClass):
14809
    '''
14810
    :ivar SessionId:
14811
    :vartype SessionId: NodeId
14812
    :ivar SessionName:
14813
    :vartype SessionName: String
14814
    :ivar ClientDescription:
14815
    :vartype ClientDescription: ApplicationDescription
14816
    :ivar ServerUri:
14817
    :vartype ServerUri: String
14818
    :ivar EndpointUrl:
14819
    :vartype EndpointUrl: String
14820
    :ivar LocaleIds:
14821
    :vartype LocaleIds: String
14822
    :ivar ActualSessionTimeout:
14823
    :vartype ActualSessionTimeout: Double
14824
    :ivar MaxResponseMessageSize:
14825
    :vartype MaxResponseMessageSize: UInt32
14826
    :ivar ClientConnectionTime:
14827
    :vartype ClientConnectionTime: DateTime
14828
    :ivar ClientLastContactTime:
14829
    :vartype ClientLastContactTime: DateTime
14830
    :ivar CurrentSubscriptionsCount:
14831
    :vartype CurrentSubscriptionsCount: UInt32
14832
    :ivar CurrentMonitoredItemsCount:
14833
    :vartype CurrentMonitoredItemsCount: UInt32
14834
    :ivar CurrentPublishRequestsInQueue:
14835
    :vartype CurrentPublishRequestsInQueue: UInt32
14836
    :ivar TotalRequestCount:
14837
    :vartype TotalRequestCount: ServiceCounterDataType
14838
    :ivar UnauthorizedRequestCount:
14839
    :vartype UnauthorizedRequestCount: UInt32
14840
    :ivar ReadCount:
14841
    :vartype ReadCount: ServiceCounterDataType
14842
    :ivar HistoryReadCount:
14843
    :vartype HistoryReadCount: ServiceCounterDataType
14844
    :ivar WriteCount:
14845
    :vartype WriteCount: ServiceCounterDataType
14846
    :ivar HistoryUpdateCount:
14847
    :vartype HistoryUpdateCount: ServiceCounterDataType
14848
    :ivar CallCount:
14849
    :vartype CallCount: ServiceCounterDataType
14850
    :ivar CreateMonitoredItemsCount:
14851
    :vartype CreateMonitoredItemsCount: ServiceCounterDataType
14852
    :ivar ModifyMonitoredItemsCount:
14853
    :vartype ModifyMonitoredItemsCount: ServiceCounterDataType
14854
    :ivar SetMonitoringModeCount:
14855
    :vartype SetMonitoringModeCount: ServiceCounterDataType
14856
    :ivar SetTriggeringCount:
14857
    :vartype SetTriggeringCount: ServiceCounterDataType
14858
    :ivar DeleteMonitoredItemsCount:
14859
    :vartype DeleteMonitoredItemsCount: ServiceCounterDataType
14860
    :ivar CreateSubscriptionCount:
14861
    :vartype CreateSubscriptionCount: ServiceCounterDataType
14862
    :ivar ModifySubscriptionCount:
14863
    :vartype ModifySubscriptionCount: ServiceCounterDataType
14864
    :ivar SetPublishingModeCount:
14865
    :vartype SetPublishingModeCount: ServiceCounterDataType
14866
    :ivar PublishCount:
14867
    :vartype PublishCount: ServiceCounterDataType
14868
    :ivar RepublishCount:
14869
    :vartype RepublishCount: ServiceCounterDataType
14870
    :ivar TransferSubscriptionsCount:
14871
    :vartype TransferSubscriptionsCount: ServiceCounterDataType
14872
    :ivar DeleteSubscriptionsCount:
14873
    :vartype DeleteSubscriptionsCount: ServiceCounterDataType
14874
    :ivar AddNodesCount:
14875
    :vartype AddNodesCount: ServiceCounterDataType
14876
    :ivar AddReferencesCount:
14877
    :vartype AddReferencesCount: ServiceCounterDataType
14878
    :ivar DeleteNodesCount:
14879
    :vartype DeleteNodesCount: ServiceCounterDataType
14880
    :ivar DeleteReferencesCount:
14881
    :vartype DeleteReferencesCount: ServiceCounterDataType
14882
    :ivar BrowseCount:
14883
    :vartype BrowseCount: ServiceCounterDataType
14884
    :ivar BrowseNextCount:
14885
    :vartype BrowseNextCount: ServiceCounterDataType
14886
    :ivar TranslateBrowsePathsToNodeIdsCount:
14887
    :vartype TranslateBrowsePathsToNodeIdsCount: ServiceCounterDataType
14888
    :ivar QueryFirstCount:
14889
    :vartype QueryFirstCount: ServiceCounterDataType
14890
    :ivar QueryNextCount:
14891
    :vartype QueryNextCount: ServiceCounterDataType
14892
    :ivar RegisterNodesCount:
14893
    :vartype RegisterNodesCount: ServiceCounterDataType
14894
    :ivar UnregisterNodesCount:
14895
    :vartype UnregisterNodesCount: ServiceCounterDataType
14896
    '''
14897
14898 1
    ua_types = {
14899
        'SessionId': 'NodeId',
14900
        'SessionName': 'String',
14901
        'ClientDescription': 'ApplicationDescription',
14902
        'ServerUri': 'String',
14903
        'EndpointUrl': 'String',
14904
        'LocaleIds': 'String',
14905
        'ActualSessionTimeout': 'Double',
14906
        'MaxResponseMessageSize': 'UInt32',
14907
        'ClientConnectionTime': 'DateTime',
14908
        'ClientLastContactTime': 'DateTime',
14909
        'CurrentSubscriptionsCount': 'UInt32',
14910
        'CurrentMonitoredItemsCount': 'UInt32',
14911
        'CurrentPublishRequestsInQueue': 'UInt32',
14912
        'TotalRequestCount': 'ServiceCounterDataType',
14913
        'UnauthorizedRequestCount': 'UInt32',
14914
        'ReadCount': 'ServiceCounterDataType',
14915
        'HistoryReadCount': 'ServiceCounterDataType',
14916
        'WriteCount': 'ServiceCounterDataType',
14917
        'HistoryUpdateCount': 'ServiceCounterDataType',
14918
        'CallCount': 'ServiceCounterDataType',
14919
        'CreateMonitoredItemsCount': 'ServiceCounterDataType',
14920
        'ModifyMonitoredItemsCount': 'ServiceCounterDataType',
14921
        'SetMonitoringModeCount': 'ServiceCounterDataType',
14922
        'SetTriggeringCount': 'ServiceCounterDataType',
14923
        'DeleteMonitoredItemsCount': 'ServiceCounterDataType',
14924
        'CreateSubscriptionCount': 'ServiceCounterDataType',
14925
        'ModifySubscriptionCount': 'ServiceCounterDataType',
14926
        'SetPublishingModeCount': 'ServiceCounterDataType',
14927
        'PublishCount': 'ServiceCounterDataType',
14928
        'RepublishCount': 'ServiceCounterDataType',
14929
        'TransferSubscriptionsCount': 'ServiceCounterDataType',
14930
        'DeleteSubscriptionsCount': 'ServiceCounterDataType',
14931
        'AddNodesCount': 'ServiceCounterDataType',
14932
        'AddReferencesCount': 'ServiceCounterDataType',
14933
        'DeleteNodesCount': 'ServiceCounterDataType',
14934
        'DeleteReferencesCount': 'ServiceCounterDataType',
14935
        'BrowseCount': 'ServiceCounterDataType',
14936
        'BrowseNextCount': 'ServiceCounterDataType',
14937
        'TranslateBrowsePathsToNodeIdsCount': 'ServiceCounterDataType',
14938
        'QueryFirstCount': 'ServiceCounterDataType',
14939
        'QueryNextCount': 'ServiceCounterDataType',
14940
        'RegisterNodesCount': 'ServiceCounterDataType',
14941
        'UnregisterNodesCount': 'ServiceCounterDataType',
14942
               }
14943
14944 1
    def __init__(self, binary=None):
14945
        if binary is not None:
14946
            self._binary_init(binary)
14947
            self._freeze = True
14948
            return
14949
        self.SessionId = NodeId()
14950
        self.SessionName = None
14951
        self.ClientDescription = ApplicationDescription()
14952
        self.ServerUri = None
14953
        self.EndpointUrl = None
14954
        self.LocaleIds = []
14955
        self.ActualSessionTimeout = 0
14956
        self.MaxResponseMessageSize = 0
14957
        self.ClientConnectionTime = datetime.utcnow()
14958
        self.ClientLastContactTime = datetime.utcnow()
14959
        self.CurrentSubscriptionsCount = 0
14960
        self.CurrentMonitoredItemsCount = 0
14961
        self.CurrentPublishRequestsInQueue = 0
14962
        self.TotalRequestCount = ServiceCounterDataType()
14963
        self.UnauthorizedRequestCount = 0
14964
        self.ReadCount = ServiceCounterDataType()
14965
        self.HistoryReadCount = ServiceCounterDataType()
14966
        self.WriteCount = ServiceCounterDataType()
14967
        self.HistoryUpdateCount = ServiceCounterDataType()
14968
        self.CallCount = ServiceCounterDataType()
14969
        self.CreateMonitoredItemsCount = ServiceCounterDataType()
14970
        self.ModifyMonitoredItemsCount = ServiceCounterDataType()
14971
        self.SetMonitoringModeCount = ServiceCounterDataType()
14972
        self.SetTriggeringCount = ServiceCounterDataType()
14973
        self.DeleteMonitoredItemsCount = ServiceCounterDataType()
14974
        self.CreateSubscriptionCount = ServiceCounterDataType()
14975
        self.ModifySubscriptionCount = ServiceCounterDataType()
14976
        self.SetPublishingModeCount = ServiceCounterDataType()
14977
        self.PublishCount = ServiceCounterDataType()
14978
        self.RepublishCount = ServiceCounterDataType()
14979
        self.TransferSubscriptionsCount = ServiceCounterDataType()
14980
        self.DeleteSubscriptionsCount = ServiceCounterDataType()
14981
        self.AddNodesCount = ServiceCounterDataType()
14982
        self.AddReferencesCount = ServiceCounterDataType()
14983
        self.DeleteNodesCount = ServiceCounterDataType()
14984
        self.DeleteReferencesCount = ServiceCounterDataType()
14985
        self.BrowseCount = ServiceCounterDataType()
14986
        self.BrowseNextCount = ServiceCounterDataType()
14987
        self.TranslateBrowsePathsToNodeIdsCount = ServiceCounterDataType()
14988
        self.QueryFirstCount = ServiceCounterDataType()
14989
        self.QueryNextCount = ServiceCounterDataType()
14990
        self.RegisterNodesCount = ServiceCounterDataType()
14991
        self.UnregisterNodesCount = ServiceCounterDataType()
14992
        self._freeze = True
14993
14994 1
    def to_binary(self):
14995
        packet = []
14996
        packet.append(self.SessionId.to_binary())
14997
        packet.append(uabin.Primitives.String.pack(self.SessionName))
14998
        packet.append(self.ClientDescription.to_binary())
14999
        packet.append(uabin.Primitives.String.pack(self.ServerUri))
15000
        packet.append(uabin.Primitives.String.pack(self.EndpointUrl))
15001
        packet.append(uabin.Primitives.Int32.pack(len(self.LocaleIds)))
15002
        for fieldname in self.LocaleIds:
15003
            packet.append(uabin.Primitives.String.pack(fieldname))
15004
        packet.append(uabin.Primitives.Double.pack(self.ActualSessionTimeout))
15005
        packet.append(uabin.Primitives.UInt32.pack(self.MaxResponseMessageSize))
15006
        packet.append(uabin.Primitives.DateTime.pack(self.ClientConnectionTime))
15007
        packet.append(uabin.Primitives.DateTime.pack(self.ClientLastContactTime))
15008
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentSubscriptionsCount))
15009
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentMonitoredItemsCount))
15010
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentPublishRequestsInQueue))
15011
        packet.append(self.TotalRequestCount.to_binary())
15012
        packet.append(uabin.Primitives.UInt32.pack(self.UnauthorizedRequestCount))
15013
        packet.append(self.ReadCount.to_binary())
15014
        packet.append(self.HistoryReadCount.to_binary())
15015
        packet.append(self.WriteCount.to_binary())
15016
        packet.append(self.HistoryUpdateCount.to_binary())
15017
        packet.append(self.CallCount.to_binary())
15018
        packet.append(self.CreateMonitoredItemsCount.to_binary())
15019
        packet.append(self.ModifyMonitoredItemsCount.to_binary())
15020
        packet.append(self.SetMonitoringModeCount.to_binary())
15021
        packet.append(self.SetTriggeringCount.to_binary())
15022
        packet.append(self.DeleteMonitoredItemsCount.to_binary())
15023
        packet.append(self.CreateSubscriptionCount.to_binary())
15024
        packet.append(self.ModifySubscriptionCount.to_binary())
15025
        packet.append(self.SetPublishingModeCount.to_binary())
15026
        packet.append(self.PublishCount.to_binary())
15027
        packet.append(self.RepublishCount.to_binary())
15028
        packet.append(self.TransferSubscriptionsCount.to_binary())
15029
        packet.append(self.DeleteSubscriptionsCount.to_binary())
15030
        packet.append(self.AddNodesCount.to_binary())
15031
        packet.append(self.AddReferencesCount.to_binary())
15032
        packet.append(self.DeleteNodesCount.to_binary())
15033
        packet.append(self.DeleteReferencesCount.to_binary())
15034
        packet.append(self.BrowseCount.to_binary())
15035
        packet.append(self.BrowseNextCount.to_binary())
15036
        packet.append(self.TranslateBrowsePathsToNodeIdsCount.to_binary())
15037
        packet.append(self.QueryFirstCount.to_binary())
15038
        packet.append(self.QueryNextCount.to_binary())
15039
        packet.append(self.RegisterNodesCount.to_binary())
15040
        packet.append(self.UnregisterNodesCount.to_binary())
15041
        return b''.join(packet)
15042
15043 1
    @staticmethod
15044
    def from_binary(data):
15045
        return SessionDiagnosticsDataType(data)
15046
15047 1
    def _binary_init(self, data):
15048
        self.SessionId = NodeId.from_binary(data)
15049
        self.SessionName = uabin.Primitives.String.unpack(data)
15050
        self.ClientDescription = ApplicationDescription.from_binary(data)
15051
        self.ServerUri = uabin.Primitives.String.unpack(data)
15052
        self.EndpointUrl = uabin.Primitives.String.unpack(data)
15053
        self.LocaleIds = uabin.Primitives.String.unpack_array(data)
15054
        self.ActualSessionTimeout = uabin.Primitives.Double.unpack(data)
15055
        self.MaxResponseMessageSize = uabin.Primitives.UInt32.unpack(data)
15056
        self.ClientConnectionTime = uabin.Primitives.DateTime.unpack(data)
15057
        self.ClientLastContactTime = uabin.Primitives.DateTime.unpack(data)
15058
        self.CurrentSubscriptionsCount = uabin.Primitives.UInt32.unpack(data)
15059
        self.CurrentMonitoredItemsCount = uabin.Primitives.UInt32.unpack(data)
15060
        self.CurrentPublishRequestsInQueue = uabin.Primitives.UInt32.unpack(data)
15061
        self.TotalRequestCount = ServiceCounterDataType.from_binary(data)
15062
        self.UnauthorizedRequestCount = uabin.Primitives.UInt32.unpack(data)
15063
        self.ReadCount = ServiceCounterDataType.from_binary(data)
15064
        self.HistoryReadCount = ServiceCounterDataType.from_binary(data)
15065
        self.WriteCount = ServiceCounterDataType.from_binary(data)
15066
        self.HistoryUpdateCount = ServiceCounterDataType.from_binary(data)
15067
        self.CallCount = ServiceCounterDataType.from_binary(data)
15068
        self.CreateMonitoredItemsCount = ServiceCounterDataType.from_binary(data)
15069
        self.ModifyMonitoredItemsCount = ServiceCounterDataType.from_binary(data)
15070
        self.SetMonitoringModeCount = ServiceCounterDataType.from_binary(data)
15071
        self.SetTriggeringCount = ServiceCounterDataType.from_binary(data)
15072
        self.DeleteMonitoredItemsCount = ServiceCounterDataType.from_binary(data)
15073
        self.CreateSubscriptionCount = ServiceCounterDataType.from_binary(data)
15074
        self.ModifySubscriptionCount = ServiceCounterDataType.from_binary(data)
15075
        self.SetPublishingModeCount = ServiceCounterDataType.from_binary(data)
15076
        self.PublishCount = ServiceCounterDataType.from_binary(data)
15077
        self.RepublishCount = ServiceCounterDataType.from_binary(data)
15078
        self.TransferSubscriptionsCount = ServiceCounterDataType.from_binary(data)
15079
        self.DeleteSubscriptionsCount = ServiceCounterDataType.from_binary(data)
15080
        self.AddNodesCount = ServiceCounterDataType.from_binary(data)
15081
        self.AddReferencesCount = ServiceCounterDataType.from_binary(data)
15082
        self.DeleteNodesCount = ServiceCounterDataType.from_binary(data)
15083
        self.DeleteReferencesCount = ServiceCounterDataType.from_binary(data)
15084
        self.BrowseCount = ServiceCounterDataType.from_binary(data)
15085
        self.BrowseNextCount = ServiceCounterDataType.from_binary(data)
15086
        self.TranslateBrowsePathsToNodeIdsCount = ServiceCounterDataType.from_binary(data)
15087
        self.QueryFirstCount = ServiceCounterDataType.from_binary(data)
15088
        self.QueryNextCount = ServiceCounterDataType.from_binary(data)
15089
        self.RegisterNodesCount = ServiceCounterDataType.from_binary(data)
15090
        self.UnregisterNodesCount = ServiceCounterDataType.from_binary(data)
15091
15092 1
    def __str__(self):
15093
        return 'SessionDiagnosticsDataType(' + 'SessionId:' + str(self.SessionId) + ', ' + \
15094
               'SessionName:' + str(self.SessionName) + ', ' + \
15095
               'ClientDescription:' + str(self.ClientDescription) + ', ' + \
15096
               'ServerUri:' + str(self.ServerUri) + ', ' + \
15097
               'EndpointUrl:' + str(self.EndpointUrl) + ', ' + \
15098
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
15099
               'ActualSessionTimeout:' + str(self.ActualSessionTimeout) + ', ' + \
15100
               'MaxResponseMessageSize:' + str(self.MaxResponseMessageSize) + ', ' + \
15101
               'ClientConnectionTime:' + str(self.ClientConnectionTime) + ', ' + \
15102
               'ClientLastContactTime:' + str(self.ClientLastContactTime) + ', ' + \
15103
               'CurrentSubscriptionsCount:' + str(self.CurrentSubscriptionsCount) + ', ' + \
15104
               'CurrentMonitoredItemsCount:' + str(self.CurrentMonitoredItemsCount) + ', ' + \
15105
               'CurrentPublishRequestsInQueue:' + str(self.CurrentPublishRequestsInQueue) + ', ' + \
15106
               'TotalRequestCount:' + str(self.TotalRequestCount) + ', ' + \
15107
               'UnauthorizedRequestCount:' + str(self.UnauthorizedRequestCount) + ', ' + \
15108
               'ReadCount:' + str(self.ReadCount) + ', ' + \
15109
               'HistoryReadCount:' + str(self.HistoryReadCount) + ', ' + \
15110
               'WriteCount:' + str(self.WriteCount) + ', ' + \
15111
               'HistoryUpdateCount:' + str(self.HistoryUpdateCount) + ', ' + \
15112
               'CallCount:' + str(self.CallCount) + ', ' + \
15113
               'CreateMonitoredItemsCount:' + str(self.CreateMonitoredItemsCount) + ', ' + \
15114
               'ModifyMonitoredItemsCount:' + str(self.ModifyMonitoredItemsCount) + ', ' + \
15115
               'SetMonitoringModeCount:' + str(self.SetMonitoringModeCount) + ', ' + \
15116
               'SetTriggeringCount:' + str(self.SetTriggeringCount) + ', ' + \
15117
               'DeleteMonitoredItemsCount:' + str(self.DeleteMonitoredItemsCount) + ', ' + \
15118
               'CreateSubscriptionCount:' + str(self.CreateSubscriptionCount) + ', ' + \
15119
               'ModifySubscriptionCount:' + str(self.ModifySubscriptionCount) + ', ' + \
15120
               'SetPublishingModeCount:' + str(self.SetPublishingModeCount) + ', ' + \
15121
               'PublishCount:' + str(self.PublishCount) + ', ' + \
15122
               'RepublishCount:' + str(self.RepublishCount) + ', ' + \
15123
               'TransferSubscriptionsCount:' + str(self.TransferSubscriptionsCount) + ', ' + \
15124
               'DeleteSubscriptionsCount:' + str(self.DeleteSubscriptionsCount) + ', ' + \
15125
               'AddNodesCount:' + str(self.AddNodesCount) + ', ' + \
15126
               'AddReferencesCount:' + str(self.AddReferencesCount) + ', ' + \
15127
               'DeleteNodesCount:' + str(self.DeleteNodesCount) + ', ' + \
15128
               'DeleteReferencesCount:' + str(self.DeleteReferencesCount) + ', ' + \
15129
               'BrowseCount:' + str(self.BrowseCount) + ', ' + \
15130
               'BrowseNextCount:' + str(self.BrowseNextCount) + ', ' + \
15131
               'TranslateBrowsePathsToNodeIdsCount:' + str(self.TranslateBrowsePathsToNodeIdsCount) + ', ' + \
15132
               'QueryFirstCount:' + str(self.QueryFirstCount) + ', ' + \
15133
               'QueryNextCount:' + str(self.QueryNextCount) + ', ' + \
15134
               'RegisterNodesCount:' + str(self.RegisterNodesCount) + ', ' + \
15135
               'UnregisterNodesCount:' + str(self.UnregisterNodesCount) + ')'
15136
15137 1
    __repr__ = __str__
15138
15139
15140 1
class SessionSecurityDiagnosticsDataType(FrozenClass):
15141
    '''
15142
    :ivar SessionId:
15143
    :vartype SessionId: NodeId
15144
    :ivar ClientUserIdOfSession:
15145
    :vartype ClientUserIdOfSession: String
15146
    :ivar ClientUserIdHistory:
15147
    :vartype ClientUserIdHistory: String
15148
    :ivar AuthenticationMechanism:
15149
    :vartype AuthenticationMechanism: String
15150
    :ivar Encoding:
15151
    :vartype Encoding: String
15152
    :ivar TransportProtocol:
15153
    :vartype TransportProtocol: String
15154 View Code Duplication
    :ivar SecurityMode:
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15155
    :vartype SecurityMode: MessageSecurityMode
15156
    :ivar SecurityPolicyUri:
15157
    :vartype SecurityPolicyUri: String
15158
    :ivar ClientCertificate:
15159
    :vartype ClientCertificate: ByteString
15160
    '''
15161
15162 1
    ua_types = {
15163
        'SessionId': 'NodeId',
15164
        'ClientUserIdOfSession': 'String',
15165
        'ClientUserIdHistory': 'String',
15166
        'AuthenticationMechanism': 'String',
15167
        'Encoding': 'String',
15168
        'TransportProtocol': 'String',
15169
        'SecurityMode': 'MessageSecurityMode',
15170
        'SecurityPolicyUri': 'String',
15171
        'ClientCertificate': 'ByteString',
15172
               }
15173
15174 1
    def __init__(self, binary=None):
15175
        if binary is not None:
15176
            self._binary_init(binary)
15177
            self._freeze = True
15178
            return
15179
        self.SessionId = NodeId()
15180
        self.ClientUserIdOfSession = None
15181
        self.ClientUserIdHistory = []
15182
        self.AuthenticationMechanism = None
15183
        self.Encoding = None
15184
        self.TransportProtocol = None
15185
        self.SecurityMode = MessageSecurityMode(0)
15186
        self.SecurityPolicyUri = None
15187
        self.ClientCertificate = None
15188
        self._freeze = True
15189
15190 1
    def to_binary(self):
15191
        packet = []
15192
        packet.append(self.SessionId.to_binary())
15193
        packet.append(uabin.Primitives.String.pack(self.ClientUserIdOfSession))
15194
        packet.append(uabin.Primitives.Int32.pack(len(self.ClientUserIdHistory)))
15195
        for fieldname in self.ClientUserIdHistory:
15196
            packet.append(uabin.Primitives.String.pack(fieldname))
15197
        packet.append(uabin.Primitives.String.pack(self.AuthenticationMechanism))
15198
        packet.append(uabin.Primitives.String.pack(self.Encoding))
15199
        packet.append(uabin.Primitives.String.pack(self.TransportProtocol))
15200
        packet.append(uabin.Primitives.UInt32.pack(self.SecurityMode.value))
15201
        packet.append(uabin.Primitives.String.pack(self.SecurityPolicyUri))
15202
        packet.append(uabin.Primitives.ByteString.pack(self.ClientCertificate))
15203
        return b''.join(packet)
15204
15205 1
    @staticmethod
15206
    def from_binary(data):
15207
        return SessionSecurityDiagnosticsDataType(data)
15208
15209 1
    def _binary_init(self, data):
15210
        self.SessionId = NodeId.from_binary(data)
15211
        self.ClientUserIdOfSession = uabin.Primitives.String.unpack(data)
15212
        self.ClientUserIdHistory = uabin.Primitives.String.unpack_array(data)
15213
        self.AuthenticationMechanism = uabin.Primitives.String.unpack(data)
15214
        self.Encoding = uabin.Primitives.String.unpack(data)
15215
        self.TransportProtocol = uabin.Primitives.String.unpack(data)
15216
        self.SecurityMode = MessageSecurityMode(uabin.Primitives.UInt32.unpack(data))
15217
        self.SecurityPolicyUri = uabin.Primitives.String.unpack(data)
15218
        self.ClientCertificate = uabin.Primitives.ByteString.unpack(data)
15219
15220 1
    def __str__(self):
15221
        return 'SessionSecurityDiagnosticsDataType(' + 'SessionId:' + str(self.SessionId) + ', ' + \
15222
               'ClientUserIdOfSession:' + str(self.ClientUserIdOfSession) + ', ' + \
15223
               'ClientUserIdHistory:' + str(self.ClientUserIdHistory) + ', ' + \
15224
               'AuthenticationMechanism:' + str(self.AuthenticationMechanism) + ', ' + \
15225
               'Encoding:' + str(self.Encoding) + ', ' + \
15226
               'TransportProtocol:' + str(self.TransportProtocol) + ', ' + \
15227
               'SecurityMode:' + str(self.SecurityMode) + ', ' + \
15228
               'SecurityPolicyUri:' + str(self.SecurityPolicyUri) + ', ' + \
15229
               'ClientCertificate:' + str(self.ClientCertificate) + ')'
15230
15231 1
    __repr__ = __str__
15232
15233
15234 1
class ServiceCounterDataType(FrozenClass):
15235
    '''
15236
    :ivar TotalCount:
15237
    :vartype TotalCount: UInt32
15238
    :ivar ErrorCount:
15239
    :vartype ErrorCount: UInt32
15240
    '''
15241
15242 1
    ua_types = {
15243
        'TotalCount': 'UInt32',
15244
        'ErrorCount': 'UInt32',
15245
               }
15246
15247 1
    def __init__(self, binary=None):
15248
        if binary is not None:
15249
            self._binary_init(binary)
15250
            self._freeze = True
15251
            return
15252
        self.TotalCount = 0
15253
        self.ErrorCount = 0
15254
        self._freeze = True
15255
15256 1
    def to_binary(self):
15257
        packet = []
15258
        packet.append(uabin.Primitives.UInt32.pack(self.TotalCount))
15259
        packet.append(uabin.Primitives.UInt32.pack(self.ErrorCount))
15260
        return b''.join(packet)
15261
15262 1
    @staticmethod
15263
    def from_binary(data):
15264
        return ServiceCounterDataType(data)
15265
15266 1
    def _binary_init(self, data):
15267
        self.TotalCount = uabin.Primitives.UInt32.unpack(data)
15268
        self.ErrorCount = uabin.Primitives.UInt32.unpack(data)
15269
15270 1
    def __str__(self):
15271
        return 'ServiceCounterDataType(' + 'TotalCount:' + str(self.TotalCount) + ', ' + \
15272
               'ErrorCount:' + str(self.ErrorCount) + ')'
15273
15274 1
    __repr__ = __str__
15275
15276
15277 1
class StatusResult(FrozenClass):
15278
    '''
15279
    :ivar StatusCode:
15280
    :vartype StatusCode: StatusCode
15281
    :ivar DiagnosticInfo:
15282
    :vartype DiagnosticInfo: DiagnosticInfo
15283
    '''
15284
15285 1
    ua_types = {
15286
        'StatusCode': 'StatusCode',
15287
        'DiagnosticInfo': 'DiagnosticInfo',
15288
               }
15289
15290 1
    def __init__(self, binary=None):
15291
        if binary is not None:
15292
            self._binary_init(binary)
15293
            self._freeze = True
15294
            return
15295
        self.StatusCode = StatusCode()
15296
        self.DiagnosticInfo = DiagnosticInfo()
15297
        self._freeze = True
15298
15299 1
    def to_binary(self):
15300
        packet = []
15301
        packet.append(self.StatusCode.to_binary())
15302
        packet.append(self.DiagnosticInfo.to_binary())
15303
        return b''.join(packet)
15304
15305 1
    @staticmethod
15306
    def from_binary(data):
15307
        return StatusResult(data)
15308
15309 1
    def _binary_init(self, data):
15310
        self.StatusCode = StatusCode.from_binary(data)
15311
        self.DiagnosticInfo = DiagnosticInfo.from_binary(data)
15312
15313 1
    def __str__(self):
15314
        return 'StatusResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
15315
               'DiagnosticInfo:' + str(self.DiagnosticInfo) + ')'
15316
15317 1
    __repr__ = __str__
15318
15319
15320 1
class SubscriptionDiagnosticsDataType(FrozenClass):
15321
    '''
15322
    :ivar SessionId:
15323
    :vartype SessionId: NodeId
15324
    :ivar SubscriptionId:
15325
    :vartype SubscriptionId: UInt32
15326
    :ivar Priority:
15327
    :vartype Priority: Byte
15328
    :ivar PublishingInterval:
15329
    :vartype PublishingInterval: Double
15330
    :ivar MaxKeepAliveCount:
15331
    :vartype MaxKeepAliveCount: UInt32
15332
    :ivar MaxLifetimeCount:
15333
    :vartype MaxLifetimeCount: UInt32
15334
    :ivar MaxNotificationsPerPublish:
15335
    :vartype MaxNotificationsPerPublish: UInt32
15336
    :ivar PublishingEnabled:
15337
    :vartype PublishingEnabled: Boolean
15338
    :ivar ModifyCount:
15339
    :vartype ModifyCount: UInt32
15340
    :ivar EnableCount:
15341
    :vartype EnableCount: UInt32
15342
    :ivar DisableCount:
15343
    :vartype DisableCount: UInt32
15344
    :ivar RepublishRequestCount:
15345
    :vartype RepublishRequestCount: UInt32
15346
    :ivar RepublishMessageRequestCount:
15347
    :vartype RepublishMessageRequestCount: UInt32
15348
    :ivar RepublishMessageCount:
15349
    :vartype RepublishMessageCount: UInt32
15350
    :ivar TransferRequestCount:
15351
    :vartype TransferRequestCount: UInt32
15352
    :ivar TransferredToAltClientCount:
15353
    :vartype TransferredToAltClientCount: UInt32
15354
    :ivar TransferredToSameClientCount:
15355
    :vartype TransferredToSameClientCount: UInt32
15356
    :ivar PublishRequestCount:
15357
    :vartype PublishRequestCount: UInt32
15358
    :ivar DataChangeNotificationsCount:
15359
    :vartype DataChangeNotificationsCount: UInt32
15360
    :ivar EventNotificationsCount:
15361
    :vartype EventNotificationsCount: UInt32
15362
    :ivar NotificationsCount:
15363
    :vartype NotificationsCount: UInt32
15364
    :ivar LatePublishRequestCount:
15365
    :vartype LatePublishRequestCount: UInt32
15366
    :ivar CurrentKeepAliveCount:
15367
    :vartype CurrentKeepAliveCount: UInt32
15368
    :ivar CurrentLifetimeCount:
15369
    :vartype CurrentLifetimeCount: UInt32
15370
    :ivar UnacknowledgedMessageCount:
15371
    :vartype UnacknowledgedMessageCount: UInt32
15372
    :ivar DiscardedMessageCount:
15373
    :vartype DiscardedMessageCount: UInt32
15374
    :ivar MonitoredItemCount:
15375
    :vartype MonitoredItemCount: UInt32
15376
    :ivar DisabledMonitoredItemCount:
15377
    :vartype DisabledMonitoredItemCount: UInt32
15378
    :ivar MonitoringQueueOverflowCount:
15379
    :vartype MonitoringQueueOverflowCount: UInt32
15380
    :ivar NextSequenceNumber:
15381
    :vartype NextSequenceNumber: UInt32
15382
    :ivar EventQueueOverFlowCount:
15383
    :vartype EventQueueOverFlowCount: UInt32
15384
    '''
15385
15386 1
    ua_types = {
15387
        'SessionId': 'NodeId',
15388
        'SubscriptionId': 'UInt32',
15389
        'Priority': 'Byte',
15390
        'PublishingInterval': 'Double',
15391
        'MaxKeepAliveCount': 'UInt32',
15392
        'MaxLifetimeCount': 'UInt32',
15393
        'MaxNotificationsPerPublish': 'UInt32',
15394
        'PublishingEnabled': 'Boolean',
15395
        'ModifyCount': 'UInt32',
15396
        'EnableCount': 'UInt32',
15397
        'DisableCount': 'UInt32',
15398
        'RepublishRequestCount': 'UInt32',
15399
        'RepublishMessageRequestCount': 'UInt32',
15400
        'RepublishMessageCount': 'UInt32',
15401
        'TransferRequestCount': 'UInt32',
15402
        'TransferredToAltClientCount': 'UInt32',
15403
        'TransferredToSameClientCount': 'UInt32',
15404
        'PublishRequestCount': 'UInt32',
15405
        'DataChangeNotificationsCount': 'UInt32',
15406
        'EventNotificationsCount': 'UInt32',
15407
        'NotificationsCount': 'UInt32',
15408
        'LatePublishRequestCount': 'UInt32',
15409
        'CurrentKeepAliveCount': 'UInt32',
15410
        'CurrentLifetimeCount': 'UInt32',
15411
        'UnacknowledgedMessageCount': 'UInt32',
15412
        'DiscardedMessageCount': 'UInt32',
15413
        'MonitoredItemCount': 'UInt32',
15414
        'DisabledMonitoredItemCount': 'UInt32',
15415
        'MonitoringQueueOverflowCount': 'UInt32',
15416
        'NextSequenceNumber': 'UInt32',
15417
        'EventQueueOverFlowCount': 'UInt32',
15418
               }
15419
15420 1
    def __init__(self, binary=None):
15421
        if binary is not None:
15422
            self._binary_init(binary)
15423
            self._freeze = True
15424
            return
15425
        self.SessionId = NodeId()
15426
        self.SubscriptionId = 0
15427
        self.Priority = 0
15428
        self.PublishingInterval = 0
15429
        self.MaxKeepAliveCount = 0
15430
        self.MaxLifetimeCount = 0
15431
        self.MaxNotificationsPerPublish = 0
15432
        self.PublishingEnabled = True
15433
        self.ModifyCount = 0
15434
        self.EnableCount = 0
15435
        self.DisableCount = 0
15436
        self.RepublishRequestCount = 0
15437
        self.RepublishMessageRequestCount = 0
15438
        self.RepublishMessageCount = 0
15439
        self.TransferRequestCount = 0
15440
        self.TransferredToAltClientCount = 0
15441
        self.TransferredToSameClientCount = 0
15442
        self.PublishRequestCount = 0
15443
        self.DataChangeNotificationsCount = 0
15444
        self.EventNotificationsCount = 0
15445
        self.NotificationsCount = 0
15446
        self.LatePublishRequestCount = 0
15447
        self.CurrentKeepAliveCount = 0
15448
        self.CurrentLifetimeCount = 0
15449
        self.UnacknowledgedMessageCount = 0
15450
        self.DiscardedMessageCount = 0
15451
        self.MonitoredItemCount = 0
15452
        self.DisabledMonitoredItemCount = 0
15453
        self.MonitoringQueueOverflowCount = 0
15454
        self.NextSequenceNumber = 0
15455
        self.EventQueueOverFlowCount = 0
15456
        self._freeze = True
15457
15458 1
    def to_binary(self):
15459
        packet = []
15460
        packet.append(self.SessionId.to_binary())
15461
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
15462
        packet.append(uabin.Primitives.Byte.pack(self.Priority))
15463
        packet.append(uabin.Primitives.Double.pack(self.PublishingInterval))
15464
        packet.append(uabin.Primitives.UInt32.pack(self.MaxKeepAliveCount))
15465
        packet.append(uabin.Primitives.UInt32.pack(self.MaxLifetimeCount))
15466
        packet.append(uabin.Primitives.UInt32.pack(self.MaxNotificationsPerPublish))
15467
        packet.append(uabin.Primitives.Boolean.pack(self.PublishingEnabled))
15468
        packet.append(uabin.Primitives.UInt32.pack(self.ModifyCount))
15469
        packet.append(uabin.Primitives.UInt32.pack(self.EnableCount))
15470
        packet.append(uabin.Primitives.UInt32.pack(self.DisableCount))
15471
        packet.append(uabin.Primitives.UInt32.pack(self.RepublishRequestCount))
15472
        packet.append(uabin.Primitives.UInt32.pack(self.RepublishMessageRequestCount))
15473
        packet.append(uabin.Primitives.UInt32.pack(self.RepublishMessageCount))
15474
        packet.append(uabin.Primitives.UInt32.pack(self.TransferRequestCount))
15475
        packet.append(uabin.Primitives.UInt32.pack(self.TransferredToAltClientCount))
15476
        packet.append(uabin.Primitives.UInt32.pack(self.TransferredToSameClientCount))
15477
        packet.append(uabin.Primitives.UInt32.pack(self.PublishRequestCount))
15478
        packet.append(uabin.Primitives.UInt32.pack(self.DataChangeNotificationsCount))
15479
        packet.append(uabin.Primitives.UInt32.pack(self.EventNotificationsCount))
15480
        packet.append(uabin.Primitives.UInt32.pack(self.NotificationsCount))
15481
        packet.append(uabin.Primitives.UInt32.pack(self.LatePublishRequestCount))
15482
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentKeepAliveCount))
15483
        packet.append(uabin.Primitives.UInt32.pack(self.CurrentLifetimeCount))
15484
        packet.append(uabin.Primitives.UInt32.pack(self.UnacknowledgedMessageCount))
15485
        packet.append(uabin.Primitives.UInt32.pack(self.DiscardedMessageCount))
15486
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoredItemCount))
15487
        packet.append(uabin.Primitives.UInt32.pack(self.DisabledMonitoredItemCount))
15488
        packet.append(uabin.Primitives.UInt32.pack(self.MonitoringQueueOverflowCount))
15489
        packet.append(uabin.Primitives.UInt32.pack(self.NextSequenceNumber))
15490
        packet.append(uabin.Primitives.UInt32.pack(self.EventQueueOverFlowCount))
15491
        return b''.join(packet)
15492
15493 1
    @staticmethod
15494
    def from_binary(data):
15495
        return SubscriptionDiagnosticsDataType(data)
15496
15497 1
    def _binary_init(self, data):
15498
        self.SessionId = NodeId.from_binary(data)
15499
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
15500
        self.Priority = uabin.Primitives.Byte.unpack(data)
15501
        self.PublishingInterval = uabin.Primitives.Double.unpack(data)
15502
        self.MaxKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
15503
        self.MaxLifetimeCount = uabin.Primitives.UInt32.unpack(data)
15504
        self.MaxNotificationsPerPublish = uabin.Primitives.UInt32.unpack(data)
15505
        self.PublishingEnabled = uabin.Primitives.Boolean.unpack(data)
15506
        self.ModifyCount = uabin.Primitives.UInt32.unpack(data)
15507
        self.EnableCount = uabin.Primitives.UInt32.unpack(data)
15508
        self.DisableCount = uabin.Primitives.UInt32.unpack(data)
15509
        self.RepublishRequestCount = uabin.Primitives.UInt32.unpack(data)
15510
        self.RepublishMessageRequestCount = uabin.Primitives.UInt32.unpack(data)
15511
        self.RepublishMessageCount = uabin.Primitives.UInt32.unpack(data)
15512
        self.TransferRequestCount = uabin.Primitives.UInt32.unpack(data)
15513
        self.TransferredToAltClientCount = uabin.Primitives.UInt32.unpack(data)
15514
        self.TransferredToSameClientCount = uabin.Primitives.UInt32.unpack(data)
15515
        self.PublishRequestCount = uabin.Primitives.UInt32.unpack(data)
15516
        self.DataChangeNotificationsCount = uabin.Primitives.UInt32.unpack(data)
15517
        self.EventNotificationsCount = uabin.Primitives.UInt32.unpack(data)
15518
        self.NotificationsCount = uabin.Primitives.UInt32.unpack(data)
15519
        self.LatePublishRequestCount = uabin.Primitives.UInt32.unpack(data)
15520
        self.CurrentKeepAliveCount = uabin.Primitives.UInt32.unpack(data)
15521
        self.CurrentLifetimeCount = uabin.Primitives.UInt32.unpack(data)
15522
        self.UnacknowledgedMessageCount = uabin.Primitives.UInt32.unpack(data)
15523
        self.DiscardedMessageCount = uabin.Primitives.UInt32.unpack(data)
15524
        self.MonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
15525
        self.DisabledMonitoredItemCount = uabin.Primitives.UInt32.unpack(data)
15526
        self.MonitoringQueueOverflowCount = uabin.Primitives.UInt32.unpack(data)
15527
        self.NextSequenceNumber = uabin.Primitives.UInt32.unpack(data)
15528
        self.EventQueueOverFlowCount = uabin.Primitives.UInt32.unpack(data)
15529
15530 1
    def __str__(self):
15531
        return 'SubscriptionDiagnosticsDataType(' + 'SessionId:' + str(self.SessionId) + ', ' + \
15532
               'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
15533
               'Priority:' + str(self.Priority) + ', ' + \
15534
               'PublishingInterval:' + str(self.PublishingInterval) + ', ' + \
15535
               'MaxKeepAliveCount:' + str(self.MaxKeepAliveCount) + ', ' + \
15536
               'MaxLifetimeCount:' + str(self.MaxLifetimeCount) + ', ' + \
15537
               'MaxNotificationsPerPublish:' + str(self.MaxNotificationsPerPublish) + ', ' + \
15538
               'PublishingEnabled:' + str(self.PublishingEnabled) + ', ' + \
15539
               'ModifyCount:' + str(self.ModifyCount) + ', ' + \
15540
               'EnableCount:' + str(self.EnableCount) + ', ' + \
15541
               'DisableCount:' + str(self.DisableCount) + ', ' + \
15542
               'RepublishRequestCount:' + str(self.RepublishRequestCount) + ', ' + \
15543
               'RepublishMessageRequestCount:' + str(self.RepublishMessageRequestCount) + ', ' + \
15544
               'RepublishMessageCount:' + str(self.RepublishMessageCount) + ', ' + \
15545
               'TransferRequestCount:' + str(self.TransferRequestCount) + ', ' + \
15546
               'TransferredToAltClientCount:' + str(self.TransferredToAltClientCount) + ', ' + \
15547
               'TransferredToSameClientCount:' + str(self.TransferredToSameClientCount) + ', ' + \
15548
               'PublishRequestCount:' + str(self.PublishRequestCount) + ', ' + \
15549
               'DataChangeNotificationsCount:' + str(self.DataChangeNotificationsCount) + ', ' + \
15550
               'EventNotificationsCount:' + str(self.EventNotificationsCount) + ', ' + \
15551
               'NotificationsCount:' + str(self.NotificationsCount) + ', ' + \
15552
               'LatePublishRequestCount:' + str(self.LatePublishRequestCount) + ', ' + \
15553
               'CurrentKeepAliveCount:' + str(self.CurrentKeepAliveCount) + ', ' + \
15554
               'CurrentLifetimeCount:' + str(self.CurrentLifetimeCount) + ', ' + \
15555
               'UnacknowledgedMessageCount:' + str(self.UnacknowledgedMessageCount) + ', ' + \
15556
               'DiscardedMessageCount:' + str(self.DiscardedMessageCount) + ', ' + \
15557
               'MonitoredItemCount:' + str(self.MonitoredItemCount) + ', ' + \
15558
               'DisabledMonitoredItemCount:' + str(self.DisabledMonitoredItemCount) + ', ' + \
15559
               'MonitoringQueueOverflowCount:' + str(self.MonitoringQueueOverflowCount) + ', ' + \
15560
               'NextSequenceNumber:' + str(self.NextSequenceNumber) + ', ' + \
15561
               'EventQueueOverFlowCount:' + str(self.EventQueueOverFlowCount) + ')'
15562
15563 1
    __repr__ = __str__
15564
15565
15566 1
class ModelChangeStructureDataType(FrozenClass):
15567
    '''
15568
    :ivar Affected:
15569
    :vartype Affected: NodeId
15570
    :ivar AffectedType:
15571
    :vartype AffectedType: NodeId
15572
    :ivar Verb:
15573
    :vartype Verb: Byte
15574
    '''
15575
15576 1
    ua_types = {
15577
        'Affected': 'NodeId',
15578
        'AffectedType': 'NodeId',
15579
        'Verb': 'Byte',
15580
               }
15581
15582 1
    def __init__(self, binary=None):
15583
        if binary is not None:
15584
            self._binary_init(binary)
15585
            self._freeze = True
15586
            return
15587
        self.Affected = NodeId()
15588
        self.AffectedType = NodeId()
15589
        self.Verb = 0
15590
        self._freeze = True
15591
15592 1
    def to_binary(self):
15593
        packet = []
15594
        packet.append(self.Affected.to_binary())
15595
        packet.append(self.AffectedType.to_binary())
15596
        packet.append(uabin.Primitives.Byte.pack(self.Verb))
15597
        return b''.join(packet)
15598
15599 1
    @staticmethod
15600
    def from_binary(data):
15601
        return ModelChangeStructureDataType(data)
15602
15603 1
    def _binary_init(self, data):
15604
        self.Affected = NodeId.from_binary(data)
15605
        self.AffectedType = NodeId.from_binary(data)
15606
        self.Verb = uabin.Primitives.Byte.unpack(data)
15607
15608 1
    def __str__(self):
15609
        return 'ModelChangeStructureDataType(' + 'Affected:' + str(self.Affected) + ', ' + \
15610
               'AffectedType:' + str(self.AffectedType) + ', ' + \
15611
               'Verb:' + str(self.Verb) + ')'
15612
15613 1
    __repr__ = __str__
15614
15615
15616 1
class SemanticChangeStructureDataType(FrozenClass):
15617
    '''
15618
    :ivar Affected:
15619
    :vartype Affected: NodeId
15620
    :ivar AffectedType:
15621
    :vartype AffectedType: NodeId
15622
    '''
15623
15624 1
    ua_types = {
15625
        'Affected': 'NodeId',
15626
        'AffectedType': 'NodeId',
15627
               }
15628
15629 1
    def __init__(self, binary=None):
15630
        if binary is not None:
15631
            self._binary_init(binary)
15632
            self._freeze = True
15633
            return
15634
        self.Affected = NodeId()
15635
        self.AffectedType = NodeId()
15636
        self._freeze = True
15637
15638 1
    def to_binary(self):
15639
        packet = []
15640
        packet.append(self.Affected.to_binary())
15641
        packet.append(self.AffectedType.to_binary())
15642
        return b''.join(packet)
15643
15644 1
    @staticmethod
15645
    def from_binary(data):
15646
        return SemanticChangeStructureDataType(data)
15647
15648 1
    def _binary_init(self, data):
15649
        self.Affected = NodeId.from_binary(data)
15650
        self.AffectedType = NodeId.from_binary(data)
15651
15652 1
    def __str__(self):
15653
        return 'SemanticChangeStructureDataType(' + 'Affected:' + str(self.Affected) + ', ' + \
15654
               'AffectedType:' + str(self.AffectedType) + ')'
15655
15656 1
    __repr__ = __str__
15657
15658
15659 1
class Range(FrozenClass):
15660
    '''
15661
    :ivar Low:
15662
    :vartype Low: Double
15663
    :ivar High:
15664
    :vartype High: Double
15665
    '''
15666 View Code Duplication
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
15667 1
    ua_types = {
15668
        'Low': 'Double',
15669
        'High': 'Double',
15670
               }
15671
15672 1
    def __init__(self, binary=None):
15673
        if binary is not None:
15674
            self._binary_init(binary)
15675
            self._freeze = True
15676
            return
15677
        self.Low = 0
15678
        self.High = 0
15679
        self._freeze = True
15680
15681 1
    def to_binary(self):
15682
        packet = []
15683
        packet.append(uabin.Primitives.Double.pack(self.Low))
15684
        packet.append(uabin.Primitives.Double.pack(self.High))
15685
        return b''.join(packet)
15686
15687 1
    @staticmethod
15688
    def from_binary(data):
15689
        return Range(data)
15690
15691 1
    def _binary_init(self, data):
15692
        self.Low = uabin.Primitives.Double.unpack(data)
15693
        self.High = uabin.Primitives.Double.unpack(data)
15694
15695 1
    def __str__(self):
15696
        return 'Range(' + 'Low:' + str(self.Low) + ', ' + \
15697
               'High:' + str(self.High) + ')'
15698
15699 1
    __repr__ = __str__
15700
15701
15702 1
class EUInformation(FrozenClass):
15703
    '''
15704
    :ivar NamespaceUri:
15705
    :vartype NamespaceUri: String
15706
    :ivar UnitId:
15707
    :vartype UnitId: Int32
15708
    :ivar DisplayName:
15709
    :vartype DisplayName: LocalizedText
15710
    :ivar Description:
15711
    :vartype Description: LocalizedText
15712
    '''
15713
15714 1
    ua_types = {
15715
        'NamespaceUri': 'String',
15716
        'UnitId': 'Int32',
15717
        'DisplayName': 'LocalizedText',
15718
        'Description': 'LocalizedText',
15719
               }
15720
15721 1
    def __init__(self, binary=None):
15722
        if binary is not None:
15723
            self._binary_init(binary)
15724
            self._freeze = True
15725
            return
15726
        self.NamespaceUri = None
15727
        self.UnitId = 0
15728
        self.DisplayName = LocalizedText()
15729
        self.Description = LocalizedText()
15730
        self._freeze = True
15731
15732 1
    def to_binary(self):
15733
        packet = []
15734
        packet.append(uabin.Primitives.String.pack(self.NamespaceUri))
15735
        packet.append(uabin.Primitives.Int32.pack(self.UnitId))
15736
        packet.append(self.DisplayName.to_binary())
15737
        packet.append(self.Description.to_binary())
15738
        return b''.join(packet)
15739
15740 1
    @staticmethod
15741
    def from_binary(data):
15742
        return EUInformation(data)
15743
15744 1
    def _binary_init(self, data):
15745
        self.NamespaceUri = uabin.Primitives.String.unpack(data)
15746
        self.UnitId = uabin.Primitives.Int32.unpack(data)
15747
        self.DisplayName = LocalizedText.from_binary(data)
15748
        self.Description = LocalizedText.from_binary(data)
15749
15750 1
    def __str__(self):
15751
        return 'EUInformation(' + 'NamespaceUri:' + str(self.NamespaceUri) + ', ' + \
15752
               'UnitId:' + str(self.UnitId) + ', ' + \
15753
               'DisplayName:' + str(self.DisplayName) + ', ' + \
15754
               'Description:' + str(self.Description) + ')'
15755
15756 1
    __repr__ = __str__
15757
15758
15759 1
class ComplexNumberType(FrozenClass):
15760
    '''
15761
    :ivar Real:
15762
    :vartype Real: Float
15763
    :ivar Imaginary:
15764
    :vartype Imaginary: Float
15765
    '''
15766
15767 1
    ua_types = {
15768
        'Real': 'Float',
15769
        'Imaginary': 'Float',
15770
               }
15771
15772 1
    def __init__(self, binary=None):
15773
        if binary is not None:
15774
            self._binary_init(binary)
15775
            self._freeze = True
15776
            return
15777
        self.Real = 0
15778
        self.Imaginary = 0
15779
        self._freeze = True
15780
15781 1
    def to_binary(self):
15782
        packet = []
15783
        packet.append(uabin.Primitives.Float.pack(self.Real))
15784
        packet.append(uabin.Primitives.Float.pack(self.Imaginary))
15785
        return b''.join(packet)
15786
15787 1
    @staticmethod
15788
    def from_binary(data):
15789
        return ComplexNumberType(data)
15790
15791 1
    def _binary_init(self, data):
15792
        self.Real = uabin.Primitives.Float.unpack(data)
15793
        self.Imaginary = uabin.Primitives.Float.unpack(data)
15794
15795 1
    def __str__(self):
15796
        return 'ComplexNumberType(' + 'Real:' + str(self.Real) + ', ' + \
15797
               'Imaginary:' + str(self.Imaginary) + ')'
15798
15799 1
    __repr__ = __str__
15800
15801
15802 1
class DoubleComplexNumberType(FrozenClass):
15803
    '''
15804
    :ivar Real:
15805
    :vartype Real: Double
15806
    :ivar Imaginary:
15807
    :vartype Imaginary: Double
15808
    '''
15809
15810 1
    ua_types = {
15811
        'Real': 'Double',
15812
        'Imaginary': 'Double',
15813
               }
15814
15815 1
    def __init__(self, binary=None):
15816
        if binary is not None:
15817
            self._binary_init(binary)
15818
            self._freeze = True
15819
            return
15820
        self.Real = 0
15821
        self.Imaginary = 0
15822
        self._freeze = True
15823
15824 1
    def to_binary(self):
15825
        packet = []
15826
        packet.append(uabin.Primitives.Double.pack(self.Real))
15827
        packet.append(uabin.Primitives.Double.pack(self.Imaginary))
15828
        return b''.join(packet)
15829
15830 1
    @staticmethod
15831
    def from_binary(data):
15832
        return DoubleComplexNumberType(data)
15833
15834 1
    def _binary_init(self, data):
15835
        self.Real = uabin.Primitives.Double.unpack(data)
15836
        self.Imaginary = uabin.Primitives.Double.unpack(data)
15837
15838 1
    def __str__(self):
15839
        return 'DoubleComplexNumberType(' + 'Real:' + str(self.Real) + ', ' + \
15840
               'Imaginary:' + str(self.Imaginary) + ')'
15841
15842 1
    __repr__ = __str__
15843
15844
15845 1
class AxisInformation(FrozenClass):
15846
    '''
15847
    :ivar EngineeringUnits:
15848
    :vartype EngineeringUnits: EUInformation
15849
    :ivar EURange:
15850
    :vartype EURange: Range
15851
    :ivar Title:
15852
    :vartype Title: LocalizedText
15853
    :ivar AxisScaleType:
15854
    :vartype AxisScaleType: AxisScaleEnumeration
15855
    :ivar AxisSteps:
15856
    :vartype AxisSteps: Double
15857
    '''
15858
15859 1
    ua_types = {
15860
        'EngineeringUnits': 'EUInformation',
15861
        'EURange': 'Range',
15862
        'Title': 'LocalizedText',
15863
        'AxisScaleType': 'AxisScaleEnumeration',
15864
        'AxisSteps': 'Double',
15865
               }
15866
15867 1
    def __init__(self, binary=None):
15868
        if binary is not None:
15869
            self._binary_init(binary)
15870
            self._freeze = True
15871
            return
15872
        self.EngineeringUnits = EUInformation()
15873
        self.EURange = Range()
15874
        self.Title = LocalizedText()
15875
        self.AxisScaleType = AxisScaleEnumeration(0)
15876
        self.AxisSteps = []
15877
        self._freeze = True
15878
15879 1
    def to_binary(self):
15880
        packet = []
15881
        packet.append(self.EngineeringUnits.to_binary())
15882
        packet.append(self.EURange.to_binary())
15883
        packet.append(self.Title.to_binary())
15884
        packet.append(uabin.Primitives.UInt32.pack(self.AxisScaleType.value))
15885
        packet.append(uabin.Primitives.Int32.pack(len(self.AxisSteps)))
15886
        for fieldname in self.AxisSteps:
15887
            packet.append(uabin.Primitives.Double.pack(fieldname))
15888
        return b''.join(packet)
15889
15890 1
    @staticmethod
15891
    def from_binary(data):
15892
        return AxisInformation(data)
15893
15894 1
    def _binary_init(self, data):
15895
        self.EngineeringUnits = EUInformation.from_binary(data)
15896
        self.EURange = Range.from_binary(data)
15897
        self.Title = LocalizedText.from_binary(data)
15898
        self.AxisScaleType = AxisScaleEnumeration(uabin.Primitives.UInt32.unpack(data))
15899
        self.AxisSteps = uabin.Primitives.Double.unpack_array(data)
15900
15901 1
    def __str__(self):
15902
        return 'AxisInformation(' + 'EngineeringUnits:' + str(self.EngineeringUnits) + ', ' + \
15903
               'EURange:' + str(self.EURange) + ', ' + \
15904
               'Title:' + str(self.Title) + ', ' + \
15905
               'AxisScaleType:' + str(self.AxisScaleType) + ', ' + \
15906
               'AxisSteps:' + str(self.AxisSteps) + ')'
15907
15908 1
    __repr__ = __str__
15909
15910
15911 1
class XVType(FrozenClass):
15912
    '''
15913
    :ivar X:
15914
    :vartype X: Double
15915
    :ivar Value:
15916
    :vartype Value: Float
15917
    '''
15918
15919 1
    ua_types = {
15920
        'X': 'Double',
15921
        'Value': 'Float',
15922
               }
15923
15924 1
    def __init__(self, binary=None):
15925
        if binary is not None:
15926
            self._binary_init(binary)
15927
            self._freeze = True
15928
            return
15929
        self.X = 0
15930
        self.Value = 0
15931
        self._freeze = True
15932
15933 1
    def to_binary(self):
15934
        packet = []
15935
        packet.append(uabin.Primitives.Double.pack(self.X))
15936
        packet.append(uabin.Primitives.Float.pack(self.Value))
15937
        return b''.join(packet)
15938
15939 1
    @staticmethod
15940
    def from_binary(data):
15941
        return XVType(data)
15942
15943 1
    def _binary_init(self, data):
15944
        self.X = uabin.Primitives.Double.unpack(data)
15945
        self.Value = uabin.Primitives.Float.unpack(data)
15946
15947 1
    def __str__(self):
15948
        return 'XVType(' + 'X:' + str(self.X) + ', ' + \
15949
               'Value:' + str(self.Value) + ')'
15950
15951 1
    __repr__ = __str__
15952
15953
15954 1
class ProgramDiagnosticDataType(FrozenClass):
15955
    '''
15956
    :ivar CreateSessionId:
15957
    :vartype CreateSessionId: NodeId
15958
    :ivar CreateClientName:
15959
    :vartype CreateClientName: String
15960
    :ivar InvocationCreationTime:
15961
    :vartype InvocationCreationTime: DateTime
15962
    :ivar LastTransitionTime:
15963
    :vartype LastTransitionTime: DateTime
15964
    :ivar LastMethodCall:
15965
    :vartype LastMethodCall: String
15966
    :ivar LastMethodSessionId:
15967
    :vartype LastMethodSessionId: NodeId
15968
    :ivar LastMethodInputArguments:
15969
    :vartype LastMethodInputArguments: Argument
15970
    :ivar LastMethodOutputArguments:
15971
    :vartype LastMethodOutputArguments: Argument
15972
    :ivar LastMethodCallTime:
15973
    :vartype LastMethodCallTime: DateTime
15974
    :ivar LastMethodReturnStatus:
15975
    :vartype LastMethodReturnStatus: StatusResult
15976
    '''
15977
15978 1
    ua_types = {
15979
        'CreateSessionId': 'NodeId',
15980
        'CreateClientName': 'String',
15981
        'InvocationCreationTime': 'DateTime',
15982
        'LastTransitionTime': 'DateTime',
15983
        'LastMethodCall': 'String',
15984
        'LastMethodSessionId': 'NodeId',
15985
        'LastMethodInputArguments': 'Argument',
15986
        'LastMethodOutputArguments': 'Argument',
15987
        'LastMethodCallTime': 'DateTime',
15988
        'LastMethodReturnStatus': 'StatusResult',
15989
               }
15990
15991 1
    def __init__(self, binary=None):
15992
        if binary is not None:
15993
            self._binary_init(binary)
15994
            self._freeze = True
15995
            return
15996
        self.CreateSessionId = NodeId()
15997
        self.CreateClientName = None
15998
        self.InvocationCreationTime = datetime.utcnow()
15999
        self.LastTransitionTime = datetime.utcnow()
16000
        self.LastMethodCall = None
16001
        self.LastMethodSessionId = NodeId()
16002
        self.LastMethodInputArguments = []
16003
        self.LastMethodOutputArguments = []
16004
        self.LastMethodCallTime = datetime.utcnow()
16005
        self.LastMethodReturnStatus = StatusResult()
16006
        self._freeze = True
16007
16008 1
    def to_binary(self):
16009
        packet = []
16010
        packet.append(self.CreateSessionId.to_binary())
16011
        packet.append(uabin.Primitives.String.pack(self.CreateClientName))
16012
        packet.append(uabin.Primitives.DateTime.pack(self.InvocationCreationTime))
16013
        packet.append(uabin.Primitives.DateTime.pack(self.LastTransitionTime))
16014
        packet.append(uabin.Primitives.String.pack(self.LastMethodCall))
16015
        packet.append(self.LastMethodSessionId.to_binary())
16016
        packet.append(uabin.Primitives.Int32.pack(len(self.LastMethodInputArguments)))
16017
        for fieldname in self.LastMethodInputArguments:
16018
            packet.append(fieldname.to_binary())
16019
        packet.append(uabin.Primitives.Int32.pack(len(self.LastMethodOutputArguments)))
16020
        for fieldname in self.LastMethodOutputArguments:
16021
            packet.append(fieldname.to_binary())
16022
        packet.append(uabin.Primitives.DateTime.pack(self.LastMethodCallTime))
16023
        packet.append(self.LastMethodReturnStatus.to_binary())
16024
        return b''.join(packet)
16025
16026 1
    @staticmethod
16027
    def from_binary(data):
16028
        return ProgramDiagnosticDataType(data)
16029
16030 1
    def _binary_init(self, data):
16031 View Code Duplication
        self.CreateSessionId = NodeId.from_binary(data)
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
16032
        self.CreateClientName = uabin.Primitives.String.unpack(data)
16033
        self.InvocationCreationTime = uabin.Primitives.DateTime.unpack(data)
16034
        self.LastTransitionTime = uabin.Primitives.DateTime.unpack(data)
16035
        self.LastMethodCall = uabin.Primitives.String.unpack(data)
16036
        self.LastMethodSessionId = NodeId.from_binary(data)
16037
        length = uabin.Primitives.Int32.unpack(data)
16038
        array = []
16039
        if length != -1:
16040
            for _ in range(0, length):
16041
                array.append(Argument.from_binary(data))
16042
        self.LastMethodInputArguments = array
16043
        length = uabin.Primitives.Int32.unpack(data)
16044
        array = []
16045
        if length != -1:
16046
            for _ in range(0, length):
16047
                array.append(Argument.from_binary(data))
16048
        self.LastMethodOutputArguments = array
16049
        self.LastMethodCallTime = uabin.Primitives.DateTime.unpack(data)
16050
        self.LastMethodReturnStatus = StatusResult.from_binary(data)
16051
16052 1
    def __str__(self):
16053
        return 'ProgramDiagnosticDataType(' + 'CreateSessionId:' + str(self.CreateSessionId) + ', ' + \
16054
               'CreateClientName:' + str(self.CreateClientName) + ', ' + \
16055
               'InvocationCreationTime:' + str(self.InvocationCreationTime) + ', ' + \
16056
               'LastTransitionTime:' + str(self.LastTransitionTime) + ', ' + \
16057
               'LastMethodCall:' + str(self.LastMethodCall) + ', ' + \
16058
               'LastMethodSessionId:' + str(self.LastMethodSessionId) + ', ' + \
16059
               'LastMethodInputArguments:' + str(self.LastMethodInputArguments) + ', ' + \
16060
               'LastMethodOutputArguments:' + str(self.LastMethodOutputArguments) + ', ' + \
16061
               'LastMethodCallTime:' + str(self.LastMethodCallTime) + ', ' + \
16062
               'LastMethodReturnStatus:' + str(self.LastMethodReturnStatus) + ')'
16063
16064 1
    __repr__ = __str__
16065
16066
16067 1
class Annotation(FrozenClass):
16068
    '''
16069
    :ivar Message:
16070
    :vartype Message: String
16071
    :ivar UserName:
16072
    :vartype UserName: String
16073
    :ivar AnnotationTime:
16074
    :vartype AnnotationTime: DateTime
16075
    '''
16076
16077 1
    ua_types = {
16078
        'Message': 'String',
16079
        'UserName': 'String',
16080
        'AnnotationTime': 'DateTime',
16081
               }
16082
16083 1
    def __init__(self, binary=None):
16084
        if binary is not None:
16085
            self._binary_init(binary)
16086
            self._freeze = True
16087
            return
16088
        self.Message = None
16089
        self.UserName = None
16090
        self.AnnotationTime = datetime.utcnow()
16091
        self._freeze = True
16092
16093 1
    def to_binary(self):
16094
        packet = []
16095
        packet.append(uabin.Primitives.String.pack(self.Message))
16096
        packet.append(uabin.Primitives.String.pack(self.UserName))
16097
        packet.append(uabin.Primitives.DateTime.pack(self.AnnotationTime))
16098
        return b''.join(packet)
16099
16100 1
    @staticmethod
16101
    def from_binary(data):
16102
        return Annotation(data)
16103
16104 1
    def _binary_init(self, data):
16105
        self.Message = uabin.Primitives.String.unpack(data)
16106
        self.UserName = uabin.Primitives.String.unpack(data)
16107
        self.AnnotationTime = uabin.Primitives.DateTime.unpack(data)
16108
16109 1
    def __str__(self):
16110
        return 'Annotation(' + 'Message:' + str(self.Message) + ', ' + \
16111
               'UserName:' + str(self.UserName) + ', ' + \
16112
               'AnnotationTime:' + str(self.AnnotationTime) + ')'
16113
16114 1
    __repr__ = __str__
16115
16116
16117 1
ExtensionClasses = {
16118
    ObjectIds.TrustListDataType_Encoding_DefaultBinary: TrustListDataType,
16119
    ObjectIds.Argument_Encoding_DefaultBinary: Argument,
16120
    ObjectIds.EnumValueType_Encoding_DefaultBinary: EnumValueType,
16121
    ObjectIds.OptionSet_Encoding_DefaultBinary: OptionSet,
16122
    ObjectIds.Union_Encoding_DefaultBinary: Union,
16123
    ObjectIds.TimeZoneDataType_Encoding_DefaultBinary: TimeZoneDataType,
16124
    ObjectIds.ApplicationDescription_Encoding_DefaultBinary: ApplicationDescription,
16125
    ObjectIds.RequestHeader_Encoding_DefaultBinary: RequestHeader,
16126
    ObjectIds.ResponseHeader_Encoding_DefaultBinary: ResponseHeader,
16127
    ObjectIds.ServiceFault_Encoding_DefaultBinary: ServiceFault,
16128
    ObjectIds.FindServersRequest_Encoding_DefaultBinary: FindServersRequest,
16129
    ObjectIds.FindServersResponse_Encoding_DefaultBinary: FindServersResponse,
16130
    ObjectIds.ServerOnNetwork_Encoding_DefaultBinary: ServerOnNetwork,
16131
    ObjectIds.FindServersOnNetworkRequest_Encoding_DefaultBinary: FindServersOnNetworkRequest,
16132
    ObjectIds.FindServersOnNetworkResponse_Encoding_DefaultBinary: FindServersOnNetworkResponse,
16133
    ObjectIds.UserTokenPolicy_Encoding_DefaultBinary: UserTokenPolicy,
16134
    ObjectIds.EndpointDescription_Encoding_DefaultBinary: EndpointDescription,
16135
    ObjectIds.GetEndpointsRequest_Encoding_DefaultBinary: GetEndpointsRequest,
16136
    ObjectIds.GetEndpointsResponse_Encoding_DefaultBinary: GetEndpointsResponse,
16137
    ObjectIds.RegisteredServer_Encoding_DefaultBinary: RegisteredServer,
16138
    ObjectIds.RegisterServerRequest_Encoding_DefaultBinary: RegisterServerRequest,
16139
    ObjectIds.RegisterServerResponse_Encoding_DefaultBinary: RegisterServerResponse,
16140
    ObjectIds.DiscoveryConfiguration_Encoding_DefaultBinary: DiscoveryConfiguration,
16141
    ObjectIds.MdnsDiscoveryConfiguration_Encoding_DefaultBinary: MdnsDiscoveryConfiguration,
16142
    ObjectIds.RegisterServer2Request_Encoding_DefaultBinary: RegisterServer2Request,
16143
    ObjectIds.RegisterServer2Response_Encoding_DefaultBinary: RegisterServer2Response,
16144
    ObjectIds.ChannelSecurityToken_Encoding_DefaultBinary: ChannelSecurityToken,
16145
    ObjectIds.OpenSecureChannelRequest_Encoding_DefaultBinary: OpenSecureChannelRequest,
16146
    ObjectIds.OpenSecureChannelResponse_Encoding_DefaultBinary: OpenSecureChannelResponse,
16147
    ObjectIds.CloseSecureChannelRequest_Encoding_DefaultBinary: CloseSecureChannelRequest,
16148
    ObjectIds.CloseSecureChannelResponse_Encoding_DefaultBinary: CloseSecureChannelResponse,
16149
    ObjectIds.SignedSoftwareCertificate_Encoding_DefaultBinary: SignedSoftwareCertificate,
16150
    ObjectIds.SignatureData_Encoding_DefaultBinary: SignatureData,
16151
    ObjectIds.CreateSessionRequest_Encoding_DefaultBinary: CreateSessionRequest,
16152
    ObjectIds.CreateSessionResponse_Encoding_DefaultBinary: CreateSessionResponse,
16153
    ObjectIds.UserIdentityToken_Encoding_DefaultBinary: UserIdentityToken,
16154
    ObjectIds.AnonymousIdentityToken_Encoding_DefaultBinary: AnonymousIdentityToken,
16155
    ObjectIds.UserNameIdentityToken_Encoding_DefaultBinary: UserNameIdentityToken,
16156
    ObjectIds.X509IdentityToken_Encoding_DefaultBinary: X509IdentityToken,
16157
    ObjectIds.KerberosIdentityToken_Encoding_DefaultBinary: KerberosIdentityToken,
16158
    ObjectIds.IssuedIdentityToken_Encoding_DefaultBinary: IssuedIdentityToken,
16159
    ObjectIds.ActivateSessionRequest_Encoding_DefaultBinary: ActivateSessionRequest,
16160
    ObjectIds.ActivateSessionResponse_Encoding_DefaultBinary: ActivateSessionResponse,
16161
    ObjectIds.CloseSessionRequest_Encoding_DefaultBinary: CloseSessionRequest,
16162
    ObjectIds.CloseSessionResponse_Encoding_DefaultBinary: CloseSessionResponse,
16163
    ObjectIds.CancelRequest_Encoding_DefaultBinary: CancelRequest,
16164
    ObjectIds.CancelResponse_Encoding_DefaultBinary: CancelResponse,
16165
    ObjectIds.NodeAttributes_Encoding_DefaultBinary: NodeAttributes,
16166
    ObjectIds.ObjectAttributes_Encoding_DefaultBinary: ObjectAttributes,
16167
    ObjectIds.VariableAttributes_Encoding_DefaultBinary: VariableAttributes,
16168
    ObjectIds.MethodAttributes_Encoding_DefaultBinary: MethodAttributes,
16169
    ObjectIds.ObjectTypeAttributes_Encoding_DefaultBinary: ObjectTypeAttributes,
16170
    ObjectIds.VariableTypeAttributes_Encoding_DefaultBinary: VariableTypeAttributes,
16171
    ObjectIds.ReferenceTypeAttributes_Encoding_DefaultBinary: ReferenceTypeAttributes,
16172
    ObjectIds.DataTypeAttributes_Encoding_DefaultBinary: DataTypeAttributes,
16173
    ObjectIds.ViewAttributes_Encoding_DefaultBinary: ViewAttributes,
16174
    ObjectIds.AddNodesItem_Encoding_DefaultBinary: AddNodesItem,
16175
    ObjectIds.AddNodesResult_Encoding_DefaultBinary: AddNodesResult,
16176
    ObjectIds.AddNodesRequest_Encoding_DefaultBinary: AddNodesRequest,
16177
    ObjectIds.AddNodesResponse_Encoding_DefaultBinary: AddNodesResponse,
16178
    ObjectIds.AddReferencesItem_Encoding_DefaultBinary: AddReferencesItem,
16179
    ObjectIds.AddReferencesRequest_Encoding_DefaultBinary: AddReferencesRequest,
16180
    ObjectIds.AddReferencesResponse_Encoding_DefaultBinary: AddReferencesResponse,
16181
    ObjectIds.DeleteNodesItem_Encoding_DefaultBinary: DeleteNodesItem,
16182
    ObjectIds.DeleteNodesRequest_Encoding_DefaultBinary: DeleteNodesRequest,
16183
    ObjectIds.DeleteNodesResponse_Encoding_DefaultBinary: DeleteNodesResponse,
16184
    ObjectIds.DeleteReferencesItem_Encoding_DefaultBinary: DeleteReferencesItem,
16185
    ObjectIds.DeleteReferencesRequest_Encoding_DefaultBinary: DeleteReferencesRequest,
16186
    ObjectIds.DeleteReferencesResponse_Encoding_DefaultBinary: DeleteReferencesResponse,
16187
    ObjectIds.ViewDescription_Encoding_DefaultBinary: ViewDescription,
16188
    ObjectIds.BrowseDescription_Encoding_DefaultBinary: BrowseDescription,
16189
    ObjectIds.ReferenceDescription_Encoding_DefaultBinary: ReferenceDescription,
16190
    ObjectIds.BrowseResult_Encoding_DefaultBinary: BrowseResult,
16191
    ObjectIds.BrowseRequest_Encoding_DefaultBinary: BrowseRequest,
16192
    ObjectIds.BrowseResponse_Encoding_DefaultBinary: BrowseResponse,
16193
    ObjectIds.BrowseNextRequest_Encoding_DefaultBinary: BrowseNextRequest,
16194
    ObjectIds.BrowseNextResponse_Encoding_DefaultBinary: BrowseNextResponse,
16195
    ObjectIds.RelativePathElement_Encoding_DefaultBinary: RelativePathElement,
16196
    ObjectIds.RelativePath_Encoding_DefaultBinary: RelativePath,
16197
    ObjectIds.BrowsePath_Encoding_DefaultBinary: BrowsePath,
16198
    ObjectIds.BrowsePathTarget_Encoding_DefaultBinary: BrowsePathTarget,
16199
    ObjectIds.BrowsePathResult_Encoding_DefaultBinary: BrowsePathResult,
16200
    ObjectIds.TranslateBrowsePathsToNodeIdsRequest_Encoding_DefaultBinary: TranslateBrowsePathsToNodeIdsRequest,
16201
    ObjectIds.TranslateBrowsePathsToNodeIdsResponse_Encoding_DefaultBinary: TranslateBrowsePathsToNodeIdsResponse,
16202
    ObjectIds.RegisterNodesRequest_Encoding_DefaultBinary: RegisterNodesRequest,
16203
    ObjectIds.RegisterNodesResponse_Encoding_DefaultBinary: RegisterNodesResponse,
16204
    ObjectIds.UnregisterNodesRequest_Encoding_DefaultBinary: UnregisterNodesRequest,
16205
    ObjectIds.UnregisterNodesResponse_Encoding_DefaultBinary: UnregisterNodesResponse,
16206
    ObjectIds.EndpointConfiguration_Encoding_DefaultBinary: EndpointConfiguration,
16207
    ObjectIds.SupportedProfile_Encoding_DefaultBinary: SupportedProfile,
16208
    ObjectIds.SoftwareCertificate_Encoding_DefaultBinary: SoftwareCertificate,
16209
    ObjectIds.QueryDataDescription_Encoding_DefaultBinary: QueryDataDescription,
16210
    ObjectIds.NodeTypeDescription_Encoding_DefaultBinary: NodeTypeDescription,
16211
    ObjectIds.QueryDataSet_Encoding_DefaultBinary: QueryDataSet,
16212
    ObjectIds.NodeReference_Encoding_DefaultBinary: NodeReference,
16213
    ObjectIds.ContentFilterElement_Encoding_DefaultBinary: ContentFilterElement,
16214
    ObjectIds.ContentFilter_Encoding_DefaultBinary: ContentFilter,
16215
    ObjectIds.ElementOperand_Encoding_DefaultBinary: ElementOperand,
16216
    ObjectIds.LiteralOperand_Encoding_DefaultBinary: LiteralOperand,
16217
    ObjectIds.AttributeOperand_Encoding_DefaultBinary: AttributeOperand,
16218
    ObjectIds.SimpleAttributeOperand_Encoding_DefaultBinary: SimpleAttributeOperand,
16219
    ObjectIds.ContentFilterElementResult_Encoding_DefaultBinary: ContentFilterElementResult,
16220
    ObjectIds.ContentFilterResult_Encoding_DefaultBinary: ContentFilterResult,
16221
    ObjectIds.ParsingResult_Encoding_DefaultBinary: ParsingResult,
16222
    ObjectIds.QueryFirstRequest_Encoding_DefaultBinary: QueryFirstRequest,
16223
    ObjectIds.QueryFirstResponse_Encoding_DefaultBinary: QueryFirstResponse,
16224
    ObjectIds.QueryNextRequest_Encoding_DefaultBinary: QueryNextRequest,
16225
    ObjectIds.QueryNextResponse_Encoding_DefaultBinary: QueryNextResponse,
16226
    ObjectIds.ReadValueId_Encoding_DefaultBinary: ReadValueId,
16227
    ObjectIds.ReadRequest_Encoding_DefaultBinary: ReadRequest,
16228
    ObjectIds.ReadResponse_Encoding_DefaultBinary: ReadResponse,
16229
    ObjectIds.HistoryReadValueId_Encoding_DefaultBinary: HistoryReadValueId,
16230
    ObjectIds.HistoryReadResult_Encoding_DefaultBinary: HistoryReadResult,
16231
    ObjectIds.HistoryReadDetails_Encoding_DefaultBinary: HistoryReadDetails,
16232
    ObjectIds.ReadEventDetails_Encoding_DefaultBinary: ReadEventDetails,
16233
    ObjectIds.ReadRawModifiedDetails_Encoding_DefaultBinary: ReadRawModifiedDetails,
16234
    ObjectIds.ReadProcessedDetails_Encoding_DefaultBinary: ReadProcessedDetails,
16235
    ObjectIds.ReadAtTimeDetails_Encoding_DefaultBinary: ReadAtTimeDetails,
16236
    ObjectIds.HistoryData_Encoding_DefaultBinary: HistoryData,
16237
    ObjectIds.ModificationInfo_Encoding_DefaultBinary: ModificationInfo,
16238
    ObjectIds.HistoryModifiedData_Encoding_DefaultBinary: HistoryModifiedData,
16239
    ObjectIds.HistoryEvent_Encoding_DefaultBinary: HistoryEvent,
16240
    ObjectIds.HistoryReadRequest_Encoding_DefaultBinary: HistoryReadRequest,
16241
    ObjectIds.HistoryReadResponse_Encoding_DefaultBinary: HistoryReadResponse,
16242
    ObjectIds.WriteValue_Encoding_DefaultBinary: WriteValue,
16243
    ObjectIds.WriteRequest_Encoding_DefaultBinary: WriteRequest,
16244
    ObjectIds.WriteResponse_Encoding_DefaultBinary: WriteResponse,
16245
    ObjectIds.HistoryUpdateDetails_Encoding_DefaultBinary: HistoryUpdateDetails,
16246
    ObjectIds.UpdateDataDetails_Encoding_DefaultBinary: UpdateDataDetails,
16247
    ObjectIds.UpdateStructureDataDetails_Encoding_DefaultBinary: UpdateStructureDataDetails,
16248
    ObjectIds.UpdateEventDetails_Encoding_DefaultBinary: UpdateEventDetails,
16249
    ObjectIds.DeleteRawModifiedDetails_Encoding_DefaultBinary: DeleteRawModifiedDetails,
16250
    ObjectIds.DeleteAtTimeDetails_Encoding_DefaultBinary: DeleteAtTimeDetails,
16251
    ObjectIds.DeleteEventDetails_Encoding_DefaultBinary: DeleteEventDetails,
16252
    ObjectIds.HistoryUpdateResult_Encoding_DefaultBinary: HistoryUpdateResult,
16253
    ObjectIds.HistoryUpdateRequest_Encoding_DefaultBinary: HistoryUpdateRequest,
16254
    ObjectIds.HistoryUpdateResponse_Encoding_DefaultBinary: HistoryUpdateResponse,
16255
    ObjectIds.CallMethodRequest_Encoding_DefaultBinary: CallMethodRequest,
16256
    ObjectIds.CallMethodResult_Encoding_DefaultBinary: CallMethodResult,
16257
    ObjectIds.CallRequest_Encoding_DefaultBinary: CallRequest,
16258
    ObjectIds.CallResponse_Encoding_DefaultBinary: CallResponse,
16259
    ObjectIds.MonitoringFilter_Encoding_DefaultBinary: MonitoringFilter,
16260
    ObjectIds.DataChangeFilter_Encoding_DefaultBinary: DataChangeFilter,
16261
    ObjectIds.EventFilter_Encoding_DefaultBinary: EventFilter,
16262
    ObjectIds.AggregateConfiguration_Encoding_DefaultBinary: AggregateConfiguration,
16263
    ObjectIds.AggregateFilter_Encoding_DefaultBinary: AggregateFilter,
16264
    ObjectIds.MonitoringFilterResult_Encoding_DefaultBinary: MonitoringFilterResult,
16265
    ObjectIds.EventFilterResult_Encoding_DefaultBinary: EventFilterResult,
16266
    ObjectIds.AggregateFilterResult_Encoding_DefaultBinary: AggregateFilterResult,
16267
    ObjectIds.MonitoringParameters_Encoding_DefaultBinary: MonitoringParameters,
16268
    ObjectIds.MonitoredItemCreateRequest_Encoding_DefaultBinary: MonitoredItemCreateRequest,
16269
    ObjectIds.MonitoredItemCreateResult_Encoding_DefaultBinary: MonitoredItemCreateResult,
16270
    ObjectIds.CreateMonitoredItemsRequest_Encoding_DefaultBinary: CreateMonitoredItemsRequest,
16271
    ObjectIds.CreateMonitoredItemsResponse_Encoding_DefaultBinary: CreateMonitoredItemsResponse,
16272
    ObjectIds.MonitoredItemModifyRequest_Encoding_DefaultBinary: MonitoredItemModifyRequest,
16273
    ObjectIds.MonitoredItemModifyResult_Encoding_DefaultBinary: MonitoredItemModifyResult,
16274
    ObjectIds.ModifyMonitoredItemsRequest_Encoding_DefaultBinary: ModifyMonitoredItemsRequest,
16275
    ObjectIds.ModifyMonitoredItemsResponse_Encoding_DefaultBinary: ModifyMonitoredItemsResponse,
16276
    ObjectIds.SetMonitoringModeRequest_Encoding_DefaultBinary: SetMonitoringModeRequest,
16277
    ObjectIds.SetMonitoringModeResponse_Encoding_DefaultBinary: SetMonitoringModeResponse,
16278
    ObjectIds.SetTriggeringRequest_Encoding_DefaultBinary: SetTriggeringRequest,
16279
    ObjectIds.SetTriggeringResponse_Encoding_DefaultBinary: SetTriggeringResponse,
16280
    ObjectIds.DeleteMonitoredItemsRequest_Encoding_DefaultBinary: DeleteMonitoredItemsRequest,
16281
    ObjectIds.DeleteMonitoredItemsResponse_Encoding_DefaultBinary: DeleteMonitoredItemsResponse,
16282
    ObjectIds.CreateSubscriptionRequest_Encoding_DefaultBinary: CreateSubscriptionRequest,
16283
    ObjectIds.CreateSubscriptionResponse_Encoding_DefaultBinary: CreateSubscriptionResponse,
16284
    ObjectIds.ModifySubscriptionRequest_Encoding_DefaultBinary: ModifySubscriptionRequest,
16285
    ObjectIds.ModifySubscriptionResponse_Encoding_DefaultBinary: ModifySubscriptionResponse,
16286
    ObjectIds.SetPublishingModeRequest_Encoding_DefaultBinary: SetPublishingModeRequest,
16287
    ObjectIds.SetPublishingModeResponse_Encoding_DefaultBinary: SetPublishingModeResponse,
16288
    ObjectIds.NotificationMessage_Encoding_DefaultBinary: NotificationMessage,
16289
    ObjectIds.NotificationData_Encoding_DefaultBinary: NotificationData,
16290
    ObjectIds.DataChangeNotification_Encoding_DefaultBinary: DataChangeNotification,
16291
    ObjectIds.MonitoredItemNotification_Encoding_DefaultBinary: MonitoredItemNotification,
16292
    ObjectIds.EventNotificationList_Encoding_DefaultBinary: EventNotificationList,
16293
    ObjectIds.EventFieldList_Encoding_DefaultBinary: EventFieldList,
16294
    ObjectIds.HistoryEventFieldList_Encoding_DefaultBinary: HistoryEventFieldList,
16295
    ObjectIds.StatusChangeNotification_Encoding_DefaultBinary: StatusChangeNotification,
16296
    ObjectIds.SubscriptionAcknowledgement_Encoding_DefaultBinary: SubscriptionAcknowledgement,
16297
    ObjectIds.PublishRequest_Encoding_DefaultBinary: PublishRequest,
16298
    ObjectIds.PublishResponse_Encoding_DefaultBinary: PublishResponse,
16299
    ObjectIds.RepublishRequest_Encoding_DefaultBinary: RepublishRequest,
16300
    ObjectIds.RepublishResponse_Encoding_DefaultBinary: RepublishResponse,
16301
    ObjectIds.TransferResult_Encoding_DefaultBinary: TransferResult,
16302
    ObjectIds.TransferSubscriptionsRequest_Encoding_DefaultBinary: TransferSubscriptionsRequest,
16303
    ObjectIds.TransferSubscriptionsResponse_Encoding_DefaultBinary: TransferSubscriptionsResponse,
16304
    ObjectIds.DeleteSubscriptionsRequest_Encoding_DefaultBinary: DeleteSubscriptionsRequest,
16305
    ObjectIds.DeleteSubscriptionsResponse_Encoding_DefaultBinary: DeleteSubscriptionsResponse,
16306
    ObjectIds.BuildInfo_Encoding_DefaultBinary: BuildInfo,
16307
    ObjectIds.RedundantServerDataType_Encoding_DefaultBinary: RedundantServerDataType,
16308
    ObjectIds.EndpointUrlListDataType_Encoding_DefaultBinary: EndpointUrlListDataType,
16309
    ObjectIds.NetworkGroupDataType_Encoding_DefaultBinary: NetworkGroupDataType,
16310
    ObjectIds.SamplingIntervalDiagnosticsDataType_Encoding_DefaultBinary: SamplingIntervalDiagnosticsDataType,
16311
    ObjectIds.ServerDiagnosticsSummaryDataType_Encoding_DefaultBinary: ServerDiagnosticsSummaryDataType,
16312
    ObjectIds.ServerStatusDataType_Encoding_DefaultBinary: ServerStatusDataType,
16313
    ObjectIds.SessionDiagnosticsDataType_Encoding_DefaultBinary: SessionDiagnosticsDataType,
16314
    ObjectIds.SessionSecurityDiagnosticsDataType_Encoding_DefaultBinary: SessionSecurityDiagnosticsDataType,
16315
    ObjectIds.ServiceCounterDataType_Encoding_DefaultBinary: ServiceCounterDataType,
16316
    ObjectIds.StatusResult_Encoding_DefaultBinary: StatusResult,
16317
    ObjectIds.SubscriptionDiagnosticsDataType_Encoding_DefaultBinary: SubscriptionDiagnosticsDataType,
16318
    ObjectIds.ModelChangeStructureDataType_Encoding_DefaultBinary: ModelChangeStructureDataType,
16319
    ObjectIds.SemanticChangeStructureDataType_Encoding_DefaultBinary: SemanticChangeStructureDataType,
16320
    ObjectIds.Range_Encoding_DefaultBinary: Range,
16321
    ObjectIds.EUInformation_Encoding_DefaultBinary: EUInformation,
16322
    ObjectIds.ComplexNumberType_Encoding_DefaultBinary: ComplexNumberType,
16323
    ObjectIds.DoubleComplexNumberType_Encoding_DefaultBinary: DoubleComplexNumberType,
16324
    ObjectIds.AxisInformation_Encoding_DefaultBinary: AxisInformation,
16325
    ObjectIds.XVType_Encoding_DefaultBinary: XVType,
16326
    ObjectIds.ProgramDiagnosticDataType_Encoding_DefaultBinary: ProgramDiagnosticDataType,
16327
    ObjectIds.Annotation_Encoding_DefaultBinary: Annotation,
16328
}
16329
16330
16331 1
def extensionobject_from_binary(data):
16332
    """
16333
    Convert binary-coded ExtensionObject to a Python object.
16334
    Returns an object, or None if TypeId is zero
16335
    """
16336 1
    TypeId = NodeId.from_binary(data)
16337 1
    Encoding = ord(data.read(1))
16338 1
    body = None
16339 1
    if Encoding & (1 << 0):
16340 1
        length = uabin.Primitives.Int32.unpack(data)
16341 1
        if length < 1:
16342
            body = Buffer(b"")
16343
        else:
16344 1
            body = data.copy(length)
16345 1
            data.skip(length)
16346 1
    if TypeId.Identifier == 0:
16347 1
        return None
16348 1
    elif TypeId.Identifier not in ExtensionClasses:
16349 1
        e = ExtensionObject()
16350 1
        e.TypeId = TypeId
16351 1
        e.Encoding = Encoding
16352 1
        if body is not None:
16353 1
            e.Body = body.read(len(body))
16354 1
        return e
16355 1
    klass = ExtensionClasses[TypeId.Identifier]
16356 1
    if body is None:
16357
        raise UaError("parsing ExtensionObject {0} without data".format(klass.__name__))
16358 1
    return klass.from_binary(body)
16359
16360
16361 1
def extensionobject_to_binary(obj):
16362
    """
16363
    Convert Python object to binary-coded ExtensionObject.
16364
    If obj is None, convert to empty ExtensionObject (TypeId = 0, no Body).
16365
    Returns a binary string
16366
    """
16367 1
    if isinstance(obj, ExtensionObject):
16368 1
        return obj.to_binary()
16369 1
    TypeId = NodeId()
16370 1
    Encoding = 0
16371 1
    Body = None
16372 1
    if obj is not None:
16373 1
        TypeId = FourByteNodeId(getattr(ObjectIds, "{0}_Encoding_DefaultBinary".format(obj.__class__.__name__)))
16374 1
        Encoding |= (1 << 0)
16375 1
        Body = obj.to_binary()
16376 1
    packet = []
16377 1
    packet.append(TypeId.to_binary())
16378 1
    packet.append(uabin.Primitives.UInt8.pack(Encoding))
16379 1
    if Body:
16380 1
        packet.append(uabin.Primitives.Bytes.pack(Body))
16381
    return b''.join(packet)
16382