Code Duplication    Length = 55-55 lines in 8 locations

opcua/ua/uaprotocol_auto.py 8 locations

@@ 14090-14144 (lines=55) @@
14087
    __repr__ = __str__
14088
14089
14090
class TransferSubscriptionsResult(FrozenClass):
14091
    '''
14092
    :ivar Results:
14093
    :vartype Results: TransferResult
14094
    :ivar DiagnosticInfos:
14095
    :vartype DiagnosticInfos: DiagnosticInfo
14096
    '''
14097
14098
    ua_types = {
14099
        'Results': 'TransferResult',
14100
        'DiagnosticInfos': 'DiagnosticInfo',
14101
               }
14102
14103
    def __init__(self, binary=None):
14104
        if binary is not None:
14105
            self._binary_init(binary)
14106
            self._freeze = True
14107
            return
14108
        self.Results = []
14109
        self.DiagnosticInfos = []
14110
        self._freeze = True
14111
14112
    def to_binary(self):
14113
        packet = []
14114
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
14115
        for fieldname in self.Results:
14116
            packet.append(fieldname.to_binary())
14117
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
14118
        for fieldname in self.DiagnosticInfos:
14119
            packet.append(fieldname.to_binary())
14120
        return b''.join(packet)
14121
14122
    @staticmethod
14123
    def from_binary(data):
14124
        return TransferSubscriptionsResult(data)
14125
14126
    def _binary_init(self, data):
14127
        length = uabin.Primitives.Int32.unpack(data)
14128
        array = []
14129
        if length != -1:
14130
            for _ in range(0, length):
14131
                array.append(TransferResult.from_binary(data))
14132
        self.Results = array
14133
        length = uabin.Primitives.Int32.unpack(data)
14134
        array = []
14135
        if length != -1:
14136
            for _ in range(0, length):
14137
                array.append(DiagnosticInfo.from_binary(data))
14138
        self.DiagnosticInfos = array
14139
14140
    def __str__(self):
14141
        return 'TransferSubscriptionsResult(' + 'Results:' + str(self.Results) + ', ' + \
14142
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
14143
14144
    __repr__ = __str__
14145
14146
14147
class TransferSubscriptionsResponse(FrozenClass):
@@ 13255-13309 (lines=55) @@
13252
    __repr__ = __str__
13253
13254
13255
class DataChangeNotification(FrozenClass):
13256
    '''
13257
    :ivar MonitoredItems:
13258
    :vartype MonitoredItems: MonitoredItemNotification
13259
    :ivar DiagnosticInfos:
13260
    :vartype DiagnosticInfos: DiagnosticInfo
13261
    '''
13262
13263
    ua_types = {
13264
        'MonitoredItems': 'MonitoredItemNotification',
13265
        'DiagnosticInfos': 'DiagnosticInfo',
13266
               }
13267
13268
    def __init__(self, binary=None):
13269
        if binary is not None:
13270
            self._binary_init(binary)
13271
            self._freeze = True
13272
            return
13273
        self.MonitoredItems = []
13274
        self.DiagnosticInfos = []
13275
        self._freeze = True
13276
13277
    def to_binary(self):
13278
        packet = []
13279
        packet.append(uabin.Primitives.Int32.pack(len(self.MonitoredItems)))
13280
        for fieldname in self.MonitoredItems:
13281
            packet.append(fieldname.to_binary())
13282
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
13283
        for fieldname in self.DiagnosticInfos:
13284
            packet.append(fieldname.to_binary())
13285
        return b''.join(packet)
13286
13287
    @staticmethod
13288
    def from_binary(data):
13289
        return DataChangeNotification(data)
13290
13291
    def _binary_init(self, data):
13292
        length = uabin.Primitives.Int32.unpack(data)
13293
        array = []
13294
        if length != -1:
13295
            for _ in range(0, length):
13296
                array.append(MonitoredItemNotification.from_binary(data))
13297
        self.MonitoredItems = array
13298
        length = uabin.Primitives.Int32.unpack(data)
13299
        array = []
13300
        if length != -1:
13301
            for _ in range(0, length):
13302
                array.append(DiagnosticInfo.from_binary(data))
13303
        self.DiagnosticInfos = array
13304
13305
    def __str__(self):
13306
        return 'DataChangeNotification(' + 'MonitoredItems:' + str(self.MonitoredItems) + ', ' + \
13307
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
13308
13309
    __repr__ = __str__
13310
13311
13312
class MonitoredItemNotification(FrozenClass):
@@ 13060-13114 (lines=55) @@
13057
    __repr__ = __str__
13058
13059
13060
class SetPublishingModeResult(FrozenClass):
13061
    '''
13062
    :ivar Results:
13063
    :vartype Results: StatusCode
13064
    :ivar DiagnosticInfos:
13065
    :vartype DiagnosticInfos: DiagnosticInfo
13066
    '''
13067
13068
    ua_types = {
13069
        'Results': 'StatusCode',
13070
        'DiagnosticInfos': 'DiagnosticInfo',
13071
               }
13072
13073
    def __init__(self, binary=None):
13074
        if binary is not None:
13075
            self._binary_init(binary)
13076
            self._freeze = True
13077
            return
13078
        self.Results = []
13079
        self.DiagnosticInfos = []
13080
        self._freeze = True
13081
13082
    def to_binary(self):
13083
        packet = []
13084
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
13085
        for fieldname in self.Results:
13086
            packet.append(fieldname.to_binary())
13087
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
13088
        for fieldname in self.DiagnosticInfos:
13089
            packet.append(fieldname.to_binary())
13090
        return b''.join(packet)
13091
13092
    @staticmethod
13093
    def from_binary(data):
13094
        return SetPublishingModeResult(data)
13095
13096
    def _binary_init(self, data):
13097
        length = uabin.Primitives.Int32.unpack(data)
13098
        array = []
13099
        if length != -1:
13100
            for _ in range(0, length):
13101
                array.append(StatusCode.from_binary(data))
13102
        self.Results = array
13103
        length = uabin.Primitives.Int32.unpack(data)
13104
        array = []
13105
        if length != -1:
13106
            for _ in range(0, length):
13107
                array.append(DiagnosticInfo.from_binary(data))
13108
        self.DiagnosticInfos = array
13109
13110
    def __str__(self):
13111
        return 'SetPublishingModeResult(' + 'Results:' + str(self.Results) + ', ' + \
13112
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
13113
13114
    __repr__ = __str__
13115
13116
13117
class SetPublishingModeResponse(FrozenClass):
@@ 11997-12051 (lines=55) @@
11994
    __repr__ = __str__
11995
11996
11997
class SetMonitoringModeResult(FrozenClass):
11998
    '''
11999
    :ivar Results:
12000
    :vartype Results: StatusCode
12001
    :ivar DiagnosticInfos:
12002
    :vartype DiagnosticInfos: DiagnosticInfo
12003
    '''
12004
12005
    ua_types = {
12006
        'Results': 'StatusCode',
12007
        'DiagnosticInfos': 'DiagnosticInfo',
12008
               }
12009
12010
    def __init__(self, binary=None):
12011
        if binary is not None:
12012
            self._binary_init(binary)
12013
            self._freeze = True
12014
            return
12015
        self.Results = []
12016
        self.DiagnosticInfos = []
12017
        self._freeze = True
12018
12019
    def to_binary(self):
12020
        packet = []
12021
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
12022
        for fieldname in self.Results:
12023
            packet.append(fieldname.to_binary())
12024
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
12025
        for fieldname in self.DiagnosticInfos:
12026
            packet.append(fieldname.to_binary())
12027
        return b''.join(packet)
12028
12029
    @staticmethod
12030
    def from_binary(data):
12031
        return SetMonitoringModeResult(data)
12032
12033
    def _binary_init(self, data):
12034
        length = uabin.Primitives.Int32.unpack(data)
12035
        array = []
12036
        if length != -1:
12037
            for _ in range(0, length):
12038
                array.append(StatusCode.from_binary(data))
12039
        self.Results = array
12040
        length = uabin.Primitives.Int32.unpack(data)
12041
        array = []
12042
        if length != -1:
12043
            for _ in range(0, length):
12044
                array.append(DiagnosticInfo.from_binary(data))
12045
        self.DiagnosticInfos = array
12046
12047
    def __str__(self):
12048
        return 'SetMonitoringModeResult(' + 'Results:' + str(self.Results) + ', ' + \
12049
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
12050
12051
    __repr__ = __str__
12052
12053
12054
class SetMonitoringModeResponse(FrozenClass):
@@ 9470-9524 (lines=55) @@
9467
    __repr__ = __str__
9468
9469
9470
class HistoryModifiedData(FrozenClass):
9471
    '''
9472
    :ivar DataValues:
9473
    :vartype DataValues: DataValue
9474
    :ivar ModificationInfos:
9475
    :vartype ModificationInfos: ModificationInfo
9476
    '''
9477
9478
    ua_types = {
9479
        'DataValues': 'DataValue',
9480
        'ModificationInfos': 'ModificationInfo',
9481
               }
9482
9483
    def __init__(self, binary=None):
9484
        if binary is not None:
9485
            self._binary_init(binary)
9486
            self._freeze = True
9487
            return
9488
        self.DataValues = []
9489
        self.ModificationInfos = []
9490
        self._freeze = True
9491
9492
    def to_binary(self):
9493
        packet = []
9494
        packet.append(uabin.Primitives.Int32.pack(len(self.DataValues)))
9495
        for fieldname in self.DataValues:
9496
            packet.append(fieldname.to_binary())
9497
        packet.append(uabin.Primitives.Int32.pack(len(self.ModificationInfos)))
9498
        for fieldname in self.ModificationInfos:
9499
            packet.append(fieldname.to_binary())
9500
        return b''.join(packet)
9501
9502
    @staticmethod
9503
    def from_binary(data):
9504
        return HistoryModifiedData(data)
9505
9506
    def _binary_init(self, data):
9507
        length = uabin.Primitives.Int32.unpack(data)
9508
        array = []
9509
        if length != -1:
9510
            for _ in range(0, length):
9511
                array.append(DataValue.from_binary(data))
9512
        self.DataValues = array
9513
        length = uabin.Primitives.Int32.unpack(data)
9514
        array = []
9515
        if length != -1:
9516
            for _ in range(0, length):
9517
                array.append(ModificationInfo.from_binary(data))
9518
        self.ModificationInfos = array
9519
9520
    def __str__(self):
9521
        return 'HistoryModifiedData(' + 'DataValues:' + str(self.DataValues) + ', ' + \
9522
               'ModificationInfos:' + str(self.ModificationInfos) + ')'
9523
9524
    __repr__ = __str__
9525
9526
9527
class HistoryEvent(FrozenClass):
@@ 8197-8251 (lines=55) @@
8194
    __repr__ = __str__
8195
8196
8197
class ContentFilterResult(FrozenClass):
8198
    '''
8199
    :ivar ElementResults:
8200
    :vartype ElementResults: ContentFilterElementResult
8201
    :ivar ElementDiagnosticInfos:
8202
    :vartype ElementDiagnosticInfos: DiagnosticInfo
8203
    '''
8204
8205
    ua_types = {
8206
        'ElementResults': 'ContentFilterElementResult',
8207
        'ElementDiagnosticInfos': 'DiagnosticInfo',
8208
               }
8209
8210
    def __init__(self, binary=None):
8211
        if binary is not None:
8212
            self._binary_init(binary)
8213
            self._freeze = True
8214
            return
8215
        self.ElementResults = []
8216
        self.ElementDiagnosticInfos = []
8217
        self._freeze = True
8218
8219
    def to_binary(self):
8220
        packet = []
8221
        packet.append(uabin.Primitives.Int32.pack(len(self.ElementResults)))
8222
        for fieldname in self.ElementResults:
8223
            packet.append(fieldname.to_binary())
8224
        packet.append(uabin.Primitives.Int32.pack(len(self.ElementDiagnosticInfos)))
8225
        for fieldname in self.ElementDiagnosticInfos:
8226
            packet.append(fieldname.to_binary())
8227
        return b''.join(packet)
8228
8229
    @staticmethod
8230
    def from_binary(data):
8231
        return ContentFilterResult(data)
8232
8233
    def _binary_init(self, data):
8234
        length = uabin.Primitives.Int32.unpack(data)
8235
        array = []
8236
        if length != -1:
8237
            for _ in range(0, length):
8238
                array.append(ContentFilterElementResult.from_binary(data))
8239
        self.ElementResults = array
8240
        length = uabin.Primitives.Int32.unpack(data)
8241
        array = []
8242
        if length != -1:
8243
            for _ in range(0, length):
8244
                array.append(DiagnosticInfo.from_binary(data))
8245
        self.ElementDiagnosticInfos = array
8246
8247
    def __str__(self):
8248
        return 'ContentFilterResult(' + 'ElementResults:' + str(self.ElementResults) + ', ' + \
8249
               'ElementDiagnosticInfos:' + str(self.ElementDiagnosticInfos) + ')'
8250
8251
    __repr__ = __str__
8252
8253
8254
class ParsingResult(FrozenClass):
@@ 6488-6542 (lines=55) @@
6485
    __repr__ = __str__
6486
6487
6488
class BrowseNextResult(FrozenClass):
6489
    '''
6490
    :ivar Results:
6491
    :vartype Results: BrowseResult
6492
    :ivar DiagnosticInfos:
6493
    :vartype DiagnosticInfos: DiagnosticInfo
6494
    '''
6495
6496
    ua_types = {
6497
        'Results': 'BrowseResult',
6498
        'DiagnosticInfos': 'DiagnosticInfo',
6499
               }
6500
6501
    def __init__(self, binary=None):
6502
        if binary is not None:
6503
            self._binary_init(binary)
6504
            self._freeze = True
6505
            return
6506
        self.Results = []
6507
        self.DiagnosticInfos = []
6508
        self._freeze = True
6509
6510
    def to_binary(self):
6511
        packet = []
6512
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
6513
        for fieldname in self.Results:
6514
            packet.append(fieldname.to_binary())
6515
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
6516
        for fieldname in self.DiagnosticInfos:
6517
            packet.append(fieldname.to_binary())
6518
        return b''.join(packet)
6519
6520
    @staticmethod
6521
    def from_binary(data):
6522
        return BrowseNextResult(data)
6523
6524
    def _binary_init(self, data):
6525
        length = uabin.Primitives.Int32.unpack(data)
6526
        array = []
6527
        if length != -1:
6528
            for _ in range(0, length):
6529
                array.append(BrowseResult.from_binary(data))
6530
        self.Results = array
6531
        length = uabin.Primitives.Int32.unpack(data)
6532
        array = []
6533
        if length != -1:
6534
            for _ in range(0, length):
6535
                array.append(DiagnosticInfo.from_binary(data))
6536
        self.DiagnosticInfos = array
6537
6538
    def __str__(self):
6539
        return 'BrowseNextResult(' + 'Results:' + str(self.Results) + ', ' + \
6540
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
6541
6542
    __repr__ = __str__
6543
6544
6545
class BrowseNextResponse(FrozenClass):
@@ 5836-5890 (lines=55) @@
5833
    __repr__ = __str__
5834
5835
5836
class DeleteReferencesResult(FrozenClass):
5837
    '''
5838
    :ivar Results:
5839
    :vartype Results: StatusCode
5840
    :ivar DiagnosticInfos:
5841
    :vartype DiagnosticInfos: DiagnosticInfo
5842
    '''
5843
5844
    ua_types = {
5845
        'Results': 'StatusCode',
5846
        'DiagnosticInfos': 'DiagnosticInfo',
5847
               }
5848
5849
    def __init__(self, binary=None):
5850
        if binary is not None:
5851
            self._binary_init(binary)
5852
            self._freeze = True
5853
            return
5854
        self.Results = []
5855
        self.DiagnosticInfos = []
5856
        self._freeze = True
5857
5858
    def to_binary(self):
5859
        packet = []
5860
        packet.append(uabin.Primitives.Int32.pack(len(self.Results)))
5861
        for fieldname in self.Results:
5862
            packet.append(fieldname.to_binary())
5863
        packet.append(uabin.Primitives.Int32.pack(len(self.DiagnosticInfos)))
5864
        for fieldname in self.DiagnosticInfos:
5865
            packet.append(fieldname.to_binary())
5866
        return b''.join(packet)
5867
5868
    @staticmethod
5869
    def from_binary(data):
5870
        return DeleteReferencesResult(data)
5871
5872
    def _binary_init(self, data):
5873
        length = uabin.Primitives.Int32.unpack(data)
5874
        array = []
5875
        if length != -1:
5876
            for _ in range(0, length):
5877
                array.append(StatusCode.from_binary(data))
5878
        self.Results = array
5879
        length = uabin.Primitives.Int32.unpack(data)
5880
        array = []
5881
        if length != -1:
5882
            for _ in range(0, length):
5883
                array.append(DiagnosticInfo.from_binary(data))
5884
        self.DiagnosticInfos = array
5885
5886
    def __str__(self):
5887
        return 'DeleteReferencesResult(' + 'Results:' + str(self.Results) + ', ' + \
5888
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
5889
5890
    __repr__ = __str__
5891
5892
5893
class DeleteReferencesResponse(FrozenClass):