Code Duplication    Length = 35-41 lines in 19 locations

opcua/ua/uaprotocol_auto.py 19 locations

@@ 12215-12251 (lines=37) @@
12212
12213
    __repr__ = __str__
12214
12215
12216
class TransferResult(FrozenClass):
12217
    '''
12218
    :ivar StatusCode:
12219
    :vartype StatusCode: StatusCode
12220
    :ivar AvailableSequenceNumbers:
12221
    :vartype AvailableSequenceNumbers: UInt32
12222
    '''
12223
    def __init__(self, binary=None):
12224
        if binary is not None:
12225
            self._binary_init(binary)
12226
            self._freeze = True
12227
            return
12228
        self.StatusCode = StatusCode()
12229
        self.AvailableSequenceNumbers = []
12230
        self._freeze = True
12231
12232
    def to_binary(self):
12233
        packet = []
12234
        packet.append(self.StatusCode.to_binary())
12235
        packet.append(uatype_Int32.pack(len(self.AvailableSequenceNumbers)))
12236
        for fieldname in self.AvailableSequenceNumbers:
12237
            packet.append(uatype_UInt32.pack(fieldname))
12238
        return b''.join(packet)
12239
12240
    @staticmethod
12241
    def from_binary(data):
12242
        return TransferResult(data)
12243
12244
    def _binary_init(self, data):
12245
        self.StatusCode = StatusCode.from_binary(data)
12246
        self.AvailableSequenceNumbers = unpack_uatype_array('UInt32', data)
12247
12248
    def __str__(self):
12249
        return 'TransferResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
12250
               'AvailableSequenceNumbers:' + str(self.AvailableSequenceNumbers) + ')'
12251
12252
    __repr__ = __str__
12253
12254
@@ 9027-9063 (lines=37) @@
9024
9025
    __repr__ = __str__
9026
9027
9028
class DeleteEventDetails(FrozenClass):
9029
    '''
9030
    :ivar NodeId:
9031
    :vartype NodeId: NodeId
9032
    :ivar EventIds:
9033
    :vartype EventIds: ByteString
9034
    '''
9035
    def __init__(self, binary=None):
9036
        if binary is not None:
9037
            self._binary_init(binary)
9038
            self._freeze = True
9039
            return
9040
        self.NodeId = NodeId()
9041
        self.EventIds = []
9042
        self._freeze = True
9043
9044
    def to_binary(self):
9045
        packet = []
9046
        packet.append(self.NodeId.to_binary())
9047
        packet.append(uatype_Int32.pack(len(self.EventIds)))
9048
        for fieldname in self.EventIds:
9049
            packet.append(pack_bytes(fieldname))
9050
        return b''.join(packet)
9051
9052
    @staticmethod
9053
    def from_binary(data):
9054
        return DeleteEventDetails(data)
9055
9056
    def _binary_init(self, data):
9057
        self.NodeId = NodeId.from_binary(data)
9058
        self.EventIds = unpack_uatype_array('ByteString', data)
9059
9060
    def __str__(self):
9061
        return 'DeleteEventDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
9062
               'EventIds:' + str(self.EventIds) + ')'
9063
9064
    __repr__ = __str__
9065
9066
@@ 8988-9024 (lines=37) @@
8985
8986
    __repr__ = __str__
8987
8988
8989
class DeleteAtTimeDetails(FrozenClass):
8990
    '''
8991
    :ivar NodeId:
8992
    :vartype NodeId: NodeId
8993
    :ivar ReqTimes:
8994
    :vartype ReqTimes: DateTime
8995
    '''
8996
    def __init__(self, binary=None):
8997
        if binary is not None:
8998
            self._binary_init(binary)
8999
            self._freeze = True
9000
            return
9001
        self.NodeId = NodeId()
9002
        self.ReqTimes = []
9003
        self._freeze = True
9004
9005
    def to_binary(self):
9006
        packet = []
9007
        packet.append(self.NodeId.to_binary())
9008
        packet.append(uatype_Int32.pack(len(self.ReqTimes)))
9009
        for fieldname in self.ReqTimes:
9010
            packet.append(pack_datetime(fieldname))
9011
        return b''.join(packet)
9012
9013
    @staticmethod
9014
    def from_binary(data):
9015
        return DeleteAtTimeDetails(data)
9016
9017
    def _binary_init(self, data):
9018
        self.NodeId = NodeId.from_binary(data)
9019
        self.ReqTimes = unpack_uatype_array('DateTime', data)
9020
9021
    def __str__(self):
9022
        return 'DeleteAtTimeDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
9023
               'ReqTimes:' + str(self.ReqTimes) + ')'
9024
9025
    __repr__ = __str__
9026
9027
@@ 6415-6451 (lines=37) @@
6412
6413
    __repr__ = __str__
6414
6415
6416
class UnregisterNodesResponse(FrozenClass):
6417
    '''
6418
    Unregisters one or more previously registered nodes.
6419
6420
    :ivar TypeId:
6421
    :vartype TypeId: NodeId
6422
    :ivar ResponseHeader:
6423
    :vartype ResponseHeader: ResponseHeader
6424
    '''
6425
    def __init__(self, binary=None):
6426
        if binary is not None:
6427
            self._binary_init(binary)
6428
            self._freeze = True
6429
            return
6430
        self.TypeId = FourByteNodeId(ObjectIds.UnregisterNodesResponse_Encoding_DefaultBinary)
6431
        self.ResponseHeader = ResponseHeader()
6432
        self._freeze = True
6433
6434
    def to_binary(self):
6435
        packet = []
6436
        packet.append(self.TypeId.to_binary())
6437
        packet.append(self.ResponseHeader.to_binary())
6438
        return b''.join(packet)
6439
6440
    @staticmethod
6441
    def from_binary(data):
6442
        return UnregisterNodesResponse(data)
6443
6444
    def _binary_init(self, data):
6445
        self.TypeId = NodeId.from_binary(data)
6446
        self.ResponseHeader = ResponseHeader.from_binary(data)
6447
6448
    def __str__(self):
6449
        return 'UnregisterNodesResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
6450
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
6451
6452
    __repr__ = __str__
6453
6454
@@ 5933-5969 (lines=37) @@
5930
5931
    __repr__ = __str__
5932
5933
5934
class BrowsePathTarget(FrozenClass):
5935
    '''
5936
    The target of the translated path.
5937
5938
    :ivar TargetId:
5939
    :vartype TargetId: ExpandedNodeId
5940
    :ivar RemainingPathIndex:
5941
    :vartype RemainingPathIndex: UInt32
5942
    '''
5943
    def __init__(self, binary=None):
5944
        if binary is not None:
5945
            self._binary_init(binary)
5946
            self._freeze = True
5947
            return
5948
        self.TargetId = ExpandedNodeId()
5949
        self.RemainingPathIndex = 0
5950
        self._freeze = True
5951
5952
    def to_binary(self):
5953
        packet = []
5954
        packet.append(self.TargetId.to_binary())
5955
        packet.append(uatype_UInt32.pack(self.RemainingPathIndex))
5956
        return b''.join(packet)
5957
5958
    @staticmethod
5959
    def from_binary(data):
5960
        return BrowsePathTarget(data)
5961
5962
    def _binary_init(self, data):
5963
        self.TargetId = ExpandedNodeId.from_binary(data)
5964
        self.RemainingPathIndex = uatype_UInt32.unpack(data.read(4))[0]
5965
5966
    def __str__(self):
5967
        return 'BrowsePathTarget(' + 'TargetId:' + str(self.TargetId) + ', ' + \
5968
               'RemainingPathIndex:' + str(self.RemainingPathIndex) + ')'
5969
5970
    __repr__ = __str__
5971
5972
@@ 5894-5930 (lines=37) @@
5891
5892
    __repr__ = __str__
5893
5894
5895
class BrowsePath(FrozenClass):
5896
    '''
5897
    A request to translate a path into a node id.
5898
5899
    :ivar StartingNode:
5900
    :vartype StartingNode: NodeId
5901
    :ivar RelativePath:
5902
    :vartype RelativePath: RelativePath
5903
    '''
5904
    def __init__(self, binary=None):
5905
        if binary is not None:
5906
            self._binary_init(binary)
5907
            self._freeze = True
5908
            return
5909
        self.StartingNode = NodeId()
5910
        self.RelativePath = RelativePath()
5911
        self._freeze = True
5912
5913
    def to_binary(self):
5914
        packet = []
5915
        packet.append(self.StartingNode.to_binary())
5916
        packet.append(self.RelativePath.to_binary())
5917
        return b''.join(packet)
5918
5919
    @staticmethod
5920
    def from_binary(data):
5921
        return BrowsePath(data)
5922
5923
    def _binary_init(self, data):
5924
        self.StartingNode = NodeId.from_binary(data)
5925
        self.RelativePath = RelativePath.from_binary(data)
5926
5927
    def __str__(self):
5928
        return 'BrowsePath(' + 'StartingNode:' + str(self.StartingNode) + ', ' + \
5929
               'RelativePath:' + str(self.RelativePath) + ')'
5930
5931
    __repr__ = __str__
5932
5933
@@ 4811-4847 (lines=37) @@
4808
4809
    __repr__ = __str__
4810
4811
4812
class DeleteNodesItem(FrozenClass):
4813
    '''
4814
    A request to delete a node to the server address space.
4815
4816
    :ivar NodeId:
4817
    :vartype NodeId: NodeId
4818
    :ivar DeleteTargetReferences:
4819
    :vartype DeleteTargetReferences: Boolean
4820
    '''
4821
    def __init__(self, binary=None):
4822
        if binary is not None:
4823
            self._binary_init(binary)
4824
            self._freeze = True
4825
            return
4826
        self.NodeId = NodeId()
4827
        self.DeleteTargetReferences = True
4828
        self._freeze = True
4829
4830
    def to_binary(self):
4831
        packet = []
4832
        packet.append(self.NodeId.to_binary())
4833
        packet.append(uatype_Boolean.pack(self.DeleteTargetReferences))
4834
        return b''.join(packet)
4835
4836
    @staticmethod
4837
    def from_binary(data):
4838
        return DeleteNodesItem(data)
4839
4840
    def _binary_init(self, data):
4841
        self.NodeId = NodeId.from_binary(data)
4842
        self.DeleteTargetReferences = uatype_Boolean.unpack(data.read(1))[0]
4843
4844
    def __str__(self):
4845
        return 'DeleteNodesItem(' + 'NodeId:' + str(self.NodeId) + ', ' + \
4846
               'DeleteTargetReferences:' + str(self.DeleteTargetReferences) + ')'
4847
4848
    __repr__ = __str__
4849
4850
@@ 4444-4480 (lines=37) @@
4441
4442
    __repr__ = __str__
4443
4444
4445
class AddNodesResult(FrozenClass):
4446
    '''
4447
    A result of an add node operation.
4448
4449
    :ivar StatusCode:
4450
    :vartype StatusCode: StatusCode
4451
    :ivar AddedNodeId:
4452
    :vartype AddedNodeId: NodeId
4453
    '''
4454
    def __init__(self, binary=None):
4455
        if binary is not None:
4456
            self._binary_init(binary)
4457
            self._freeze = True
4458
            return
4459
        self.StatusCode = StatusCode()
4460
        self.AddedNodeId = NodeId()
4461
        self._freeze = True
4462
4463
    def to_binary(self):
4464
        packet = []
4465
        packet.append(self.StatusCode.to_binary())
4466
        packet.append(self.AddedNodeId.to_binary())
4467
        return b''.join(packet)
4468
4469
    @staticmethod
4470
    def from_binary(data):
4471
        return AddNodesResult(data)
4472
4473
    def _binary_init(self, data):
4474
        self.StatusCode = StatusCode.from_binary(data)
4475
        self.AddedNodeId = NodeId.from_binary(data)
4476
4477
    def __str__(self):
4478
        return 'AddNodesResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
4479
               'AddedNodeId:' + str(self.AddedNodeId) + ')'
4480
4481
    __repr__ = __str__
4482
4483
@@ 3529-3565 (lines=37) @@
3526
3527
    __repr__ = __str__
3528
3529
3530
class CloseSessionResponse(FrozenClass):
3531
    '''
3532
    Closes a session with the server.
3533
3534
    :ivar TypeId:
3535
    :vartype TypeId: NodeId
3536
    :ivar ResponseHeader:
3537
    :vartype ResponseHeader: ResponseHeader
3538
    '''
3539
    def __init__(self, binary=None):
3540
        if binary is not None:
3541
            self._binary_init(binary)
3542
            self._freeze = True
3543
            return
3544
        self.TypeId = FourByteNodeId(ObjectIds.CloseSessionResponse_Encoding_DefaultBinary)
3545
        self.ResponseHeader = ResponseHeader()
3546
        self._freeze = True
3547
3548
    def to_binary(self):
3549
        packet = []
3550
        packet.append(self.TypeId.to_binary())
3551
        packet.append(self.ResponseHeader.to_binary())
3552
        return b''.join(packet)
3553
3554
    @staticmethod
3555
    def from_binary(data):
3556
        return CloseSessionResponse(data)
3557
3558
    def _binary_init(self, data):
3559
        self.TypeId = NodeId.from_binary(data)
3560
        self.ResponseHeader = ResponseHeader.from_binary(data)
3561
3562
    def __str__(self):
3563
        return 'CloseSessionResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3564
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
3565
3566
    __repr__ = __str__
3567
3568
@@ 2662-2698 (lines=37) @@
2659
2660
    __repr__ = __str__
2661
2662
2663
class CloseSecureChannelResponse(FrozenClass):
2664
    '''
2665
    Closes a secure channel.
2666
2667
    :ivar TypeId:
2668
    :vartype TypeId: NodeId
2669
    :ivar ResponseHeader:
2670
    :vartype ResponseHeader: ResponseHeader
2671
    '''
2672
    def __init__(self, binary=None):
2673
        if binary is not None:
2674
            self._binary_init(binary)
2675
            self._freeze = True
2676
            return
2677
        self.TypeId = FourByteNodeId(ObjectIds.CloseSecureChannelResponse_Encoding_DefaultBinary)
2678
        self.ResponseHeader = ResponseHeader()
2679
        self._freeze = True
2680
2681
    def to_binary(self):
2682
        packet = []
2683
        packet.append(self.TypeId.to_binary())
2684
        packet.append(self.ResponseHeader.to_binary())
2685
        return b''.join(packet)
2686
2687
    @staticmethod
2688
    def from_binary(data):
2689
        return CloseSecureChannelResponse(data)
2690
2691
    def _binary_init(self, data):
2692
        self.TypeId = NodeId.from_binary(data)
2693
        self.ResponseHeader = ResponseHeader.from_binary(data)
2694
2695
    def __str__(self):
2696
        return 'CloseSecureChannelResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2697
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
2698
2699
    __repr__ = __str__
2700
2701
@@ 2623-2659 (lines=37) @@
2620
2621
    __repr__ = __str__
2622
2623
2624
class CloseSecureChannelRequest(FrozenClass):
2625
    '''
2626
    Closes a secure channel.
2627
2628
    :ivar TypeId:
2629
    :vartype TypeId: NodeId
2630
    :ivar RequestHeader:
2631
    :vartype RequestHeader: RequestHeader
2632
    '''
2633
    def __init__(self, binary=None):
2634
        if binary is not None:
2635
            self._binary_init(binary)
2636
            self._freeze = True
2637
            return
2638
        self.TypeId = FourByteNodeId(ObjectIds.CloseSecureChannelRequest_Encoding_DefaultBinary)
2639
        self.RequestHeader = RequestHeader()
2640
        self._freeze = True
2641
2642
    def to_binary(self):
2643
        packet = []
2644
        packet.append(self.TypeId.to_binary())
2645
        packet.append(self.RequestHeader.to_binary())
2646
        return b''.join(packet)
2647
2648
    @staticmethod
2649
    def from_binary(data):
2650
        return CloseSecureChannelRequest(data)
2651
2652
    def _binary_init(self, data):
2653
        self.TypeId = NodeId.from_binary(data)
2654
        self.RequestHeader = RequestHeader.from_binary(data)
2655
2656
    def __str__(self):
2657
        return 'CloseSecureChannelRequest(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2658
               'RequestHeader:' + str(self.RequestHeader) + ')'
2659
2660
    __repr__ = __str__
2661
2662
@@ 2125-2161 (lines=37) @@
2122
2123
    __repr__ = __str__
2124
2125
2126
class RegisterServerResponse(FrozenClass):
2127
    '''
2128
    Registers a server with the discovery server.
2129
2130
    :ivar TypeId:
2131
    :vartype TypeId: NodeId
2132
    :ivar ResponseHeader:
2133
    :vartype ResponseHeader: ResponseHeader
2134
    '''
2135
    def __init__(self, binary=None):
2136
        if binary is not None:
2137
            self._binary_init(binary)
2138
            self._freeze = True
2139
            return
2140
        self.TypeId = FourByteNodeId(ObjectIds.RegisterServerResponse_Encoding_DefaultBinary)
2141
        self.ResponseHeader = ResponseHeader()
2142
        self._freeze = True
2143
2144
    def to_binary(self):
2145
        packet = []
2146
        packet.append(self.TypeId.to_binary())
2147
        packet.append(self.ResponseHeader.to_binary())
2148
        return b''.join(packet)
2149
2150
    @staticmethod
2151
    def from_binary(data):
2152
        return RegisterServerResponse(data)
2153
2154
    def _binary_init(self, data):
2155
        self.TypeId = NodeId.from_binary(data)
2156
        self.ResponseHeader = ResponseHeader.from_binary(data)
2157
2158
    def __str__(self):
2159
        return 'RegisterServerResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2160
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
2161
2162
    __repr__ = __str__
2163
2164
@@ 1304-1340 (lines=37) @@
1301
1302
    __repr__ = __str__
1303
1304
1305
class ServiceFault(FrozenClass):
1306
    '''
1307
    The response returned by all services when there is a service level error.
1308
1309
    :ivar TypeId:
1310
    :vartype TypeId: NodeId
1311
    :ivar ResponseHeader:
1312
    :vartype ResponseHeader: ResponseHeader
1313
    '''
1314
    def __init__(self, binary=None):
1315
        if binary is not None:
1316
            self._binary_init(binary)
1317
            self._freeze = True
1318
            return
1319
        self.TypeId = FourByteNodeId(ObjectIds.ServiceFault_Encoding_DefaultBinary)
1320
        self.ResponseHeader = ResponseHeader()
1321
        self._freeze = True
1322
1323
    def to_binary(self):
1324
        packet = []
1325
        packet.append(self.TypeId.to_binary())
1326
        packet.append(self.ResponseHeader.to_binary())
1327
        return b''.join(packet)
1328
1329
    @staticmethod
1330
    def from_binary(data):
1331
        return ServiceFault(data)
1332
1333
    def _binary_init(self, data):
1334
        self.TypeId = NodeId.from_binary(data)
1335
        self.ResponseHeader = ResponseHeader.from_binary(data)
1336
1337
    def __str__(self):
1338
        return 'ServiceFault(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1339
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
1340
1341
    __repr__ = __str__
1342
1343
@@ 13651-13685 (lines=35) @@
13648
13649
    __repr__ = __str__
13650
13651
13652
class SemanticChangeStructureDataType(FrozenClass):
13653
    '''
13654
    :ivar Affected:
13655
    :vartype Affected: NodeId
13656
    :ivar AffectedType:
13657
    :vartype AffectedType: NodeId
13658
    '''
13659
    def __init__(self, binary=None):
13660
        if binary is not None:
13661
            self._binary_init(binary)
13662
            self._freeze = True
13663
            return
13664
        self.Affected = NodeId()
13665
        self.AffectedType = NodeId()
13666
        self._freeze = True
13667
13668
    def to_binary(self):
13669
        packet = []
13670
        packet.append(self.Affected.to_binary())
13671
        packet.append(self.AffectedType.to_binary())
13672
        return b''.join(packet)
13673
13674
    @staticmethod
13675
    def from_binary(data):
13676
        return SemanticChangeStructureDataType(data)
13677
13678
    def _binary_init(self, data):
13679
        self.Affected = NodeId.from_binary(data)
13680
        self.AffectedType = NodeId.from_binary(data)
13681
13682
    def __str__(self):
13683
        return 'SemanticChangeStructureDataType(' + 'Affected:' + str(self.Affected) + ', ' + \
13684
               'AffectedType:' + str(self.AffectedType) + ')'
13685
13686
    __repr__ = __str__
13687
13688
@@ 13360-13394 (lines=35) @@
13357
13358
    __repr__ = __str__
13359
13360
13361
class StatusResult(FrozenClass):
13362
    '''
13363
    :ivar StatusCode:
13364
    :vartype StatusCode: StatusCode
13365
    :ivar DiagnosticInfo:
13366
    :vartype DiagnosticInfo: DiagnosticInfo
13367
    '''
13368
    def __init__(self, binary=None):
13369
        if binary is not None:
13370
            self._binary_init(binary)
13371
            self._freeze = True
13372
            return
13373
        self.StatusCode = StatusCode()
13374
        self.DiagnosticInfo = DiagnosticInfo()
13375
        self._freeze = True
13376
13377
    def to_binary(self):
13378
        packet = []
13379
        packet.append(self.StatusCode.to_binary())
13380
        packet.append(self.DiagnosticInfo.to_binary())
13381
        return b''.join(packet)
13382
13383
    @staticmethod
13384
    def from_binary(data):
13385
        return StatusResult(data)
13386
13387
    def _binary_init(self, data):
13388
        self.StatusCode = StatusCode.from_binary(data)
13389
        self.DiagnosticInfo = DiagnosticInfo.from_binary(data)
13390
13391
    def __str__(self):
13392
        return 'StatusResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
13393
               'DiagnosticInfo:' + str(self.DiagnosticInfo) + ')'
13394
13395
    __repr__ = __str__
13396
13397
@@ 11817-11851 (lines=35) @@
11814
11815
    __repr__ = __str__
11816
11817
11818
class StatusChangeNotification(FrozenClass):
11819
    '''
11820
    :ivar Status:
11821
    :vartype Status: StatusCode
11822
    :ivar DiagnosticInfo:
11823
    :vartype DiagnosticInfo: DiagnosticInfo
11824
    '''
11825
    def __init__(self, binary=None):
11826
        if binary is not None:
11827
            self._binary_init(binary)
11828
            self._freeze = True
11829
            return
11830
        self.Status = StatusCode()
11831
        self.DiagnosticInfo = DiagnosticInfo()
11832
        self._freeze = True
11833
11834
    def to_binary(self):
11835
        packet = []
11836
        packet.append(self.Status.to_binary())
11837
        packet.append(self.DiagnosticInfo.to_binary())
11838
        return b''.join(packet)
11839
11840
    @staticmethod
11841
    def from_binary(data):
11842
        return StatusChangeNotification(data)
11843
11844
    def _binary_init(self, data):
11845
        self.Status = StatusCode.from_binary(data)
11846
        self.DiagnosticInfo = DiagnosticInfo.from_binary(data)
11847
11848
    def __str__(self):
11849
        return 'StatusChangeNotification(' + 'Status:' + str(self.Status) + ', ' + \
11850
               'DiagnosticInfo:' + str(self.DiagnosticInfo) + ')'
11851
11852
    __repr__ = __str__
11853
11854
@@ 11660-11694 (lines=35) @@
11657
11658
    __repr__ = __str__
11659
11660
11661
class MonitoredItemNotification(FrozenClass):
11662
    '''
11663
    :ivar ClientHandle:
11664
    :vartype ClientHandle: UInt32
11665
    :ivar Value:
11666
    :vartype Value: DataValue
11667
    '''
11668
    def __init__(self, binary=None):
11669
        if binary is not None:
11670
            self._binary_init(binary)
11671
            self._freeze = True
11672
            return
11673
        self.ClientHandle = 0
11674
        self.Value = DataValue()
11675
        self._freeze = True
11676
11677
    def to_binary(self):
11678
        packet = []
11679
        packet.append(uatype_UInt32.pack(self.ClientHandle))
11680
        packet.append(self.Value.to_binary())
11681
        return b''.join(packet)
11682
11683
    @staticmethod
11684
    def from_binary(data):
11685
        return MonitoredItemNotification(data)
11686
11687
    def _binary_init(self, data):
11688
        self.ClientHandle = uatype_UInt32.unpack(data.read(4))[0]
11689
        self.Value = DataValue.from_binary(data)
11690
11691
    def __str__(self):
11692
        return 'MonitoredItemNotification(' + 'ClientHandle:' + str(self.ClientHandle) + ', ' + \
11693
               'Value:' + str(self.Value) + ')'
11694
11695
    __repr__ = __str__
11696
11697
@@ 10185-10219 (lines=35) @@
10182
10183
    __repr__ = __str__
10184
10185
10186
class MonitoredItemModifyRequest(FrozenClass):
10187
    '''
10188
    :ivar MonitoredItemId:
10189
    :vartype MonitoredItemId: UInt32
10190
    :ivar RequestedParameters:
10191
    :vartype RequestedParameters: MonitoringParameters
10192
    '''
10193
    def __init__(self, binary=None):
10194
        if binary is not None:
10195
            self._binary_init(binary)
10196
            self._freeze = True
10197
            return
10198
        self.MonitoredItemId = 0
10199
        self.RequestedParameters = MonitoringParameters()
10200
        self._freeze = True
10201
10202
    def to_binary(self):
10203
        packet = []
10204
        packet.append(uatype_UInt32.pack(self.MonitoredItemId))
10205
        packet.append(self.RequestedParameters.to_binary())
10206
        return b''.join(packet)
10207
10208
    @staticmethod
10209
    def from_binary(data):
10210
        return MonitoredItemModifyRequest(data)
10211
10212
    def _binary_init(self, data):
10213
        self.MonitoredItemId = uatype_UInt32.unpack(data.read(4))[0]
10214
        self.RequestedParameters = MonitoringParameters.from_binary(data)
10215
10216
    def __str__(self):
10217
        return 'MonitoredItemModifyRequest(' + 'MonitoredItemId:' + str(self.MonitoredItemId) + ', ' + \
10218
               'RequestedParameters:' + str(self.RequestedParameters) + ')'
10219
10220
    __repr__ = __str__
10221
10222
@@ 7952-7992 (lines=41) @@
7949
7950
    __repr__ = __str__
7951
7952
7953
class HistoryReadResult(FrozenClass):
7954
    '''
7955
    :ivar StatusCode:
7956
    :vartype StatusCode: StatusCode
7957
    :ivar ContinuationPoint:
7958
    :vartype ContinuationPoint: ByteString
7959
    :ivar HistoryData:
7960
    :vartype HistoryData: ExtensionObject
7961
    '''
7962
    def __init__(self, binary=None):
7963
        if binary is not None:
7964
            self._binary_init(binary)
7965
            self._freeze = True
7966
            return
7967
        self.StatusCode = StatusCode()
7968
        self.ContinuationPoint = None
7969
        self.HistoryData = None
7970
        self._freeze = True
7971
7972
    def to_binary(self):
7973
        packet = []
7974
        packet.append(self.StatusCode.to_binary())
7975
        packet.append(pack_bytes(self.ContinuationPoint))
7976
        packet.append(extensionobject_to_binary(self.HistoryData))
7977
        return b''.join(packet)
7978
7979
    @staticmethod
7980
    def from_binary(data):
7981
        return HistoryReadResult(data)
7982
7983
    def _binary_init(self, data):
7984
        self.StatusCode = StatusCode.from_binary(data)
7985
        self.ContinuationPoint = unpack_bytes(data)
7986
        self.HistoryData = extensionobject_from_binary(data)
7987
7988
    def __str__(self):
7989
        return 'HistoryReadResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
7990
               'ContinuationPoint:' + str(self.ContinuationPoint) + ', ' + \
7991
               'HistoryData:' + str(self.HistoryData) + ')'
7992
7993
    __repr__ = __str__
7994
7995