Code Duplication    Length = 55-62 lines in 14 locations

opcua/ua/uaprotocol_auto.py 14 locations

@@ 6150-6206 (lines=57) @@
6147
               'TypeDefinition:' + str(self.TypeDefinition) + ')'
6148
6149
    __repr__ = __str__
6150
6151
6152
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
    ua_types = {
6165
        'StatusCode': 'StatusCode',
6166
        'ContinuationPoint': 'ByteString',
6167
        'References': 'ReferenceDescription',
6168
               }
6169
6170
    def __init__(self, binary=None):
6171
        if binary is not None:
6172
            self._binary_init(binary)
6173
            self._freeze = True
6174
            return
6175
        self.StatusCode = StatusCode()
6176
        self.ContinuationPoint = None
6177
        self.References = []
6178
        self._freeze = True
6179
6180
    def to_binary(self):
6181
        packet = []
6182
        packet.append(self.StatusCode.to_binary())
6183
        packet.append(uabin.Primitives.ByteString.pack(self.ContinuationPoint))
6184
        packet.append(uabin.Primitives.Int32.pack(len(self.References)))
6185
        for fieldname in self.References:
6186
            packet.append(fieldname.to_binary())
6187
        return b''.join(packet)
6188
6189
    @staticmethod
6190
    def from_binary(data):
6191
        return BrowseResult(data)
6192
6193
    def _binary_init(self, data):
6194
        self.StatusCode = StatusCode.from_binary(data)
6195
        self.ContinuationPoint = uabin.Primitives.ByteString.unpack(data)
6196
        length = uabin.Primitives.Int32.unpack(data)
6197
        array = []
6198
        if length != -1:
6199
            for _ in range(0, length):
6200
                array.append(ReferenceDescription.from_binary(data))
6201
        self.References = array
6202
6203
    def __str__(self):
6204
        return 'BrowseResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \
6205
               'ContinuationPoint:' + str(self.ContinuationPoint) + ', ' + \
6206
               'References:' + str(self.References) + ')'
6207
6208
    __repr__ = __str__
6209
@@ 13167-13221 (lines=55) @@
13164
               'Parameters:' + str(self.Parameters) + ')'
13165
13166
    __repr__ = __str__
13167
13168
13169
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
    ua_types = {
13180
        'SequenceNumber': 'UInt32',
13181
        'PublishTime': 'DateTime',
13182
        'NotificationData': 'ExtensionObject',
13183
               }
13184
13185
    def __init__(self, binary=None):
13186
        if binary is not None:
13187
            self._binary_init(binary)
13188
            self._freeze = True
13189
            return
13190
        self.SequenceNumber = 0
13191
        self.PublishTime = datetime.utcnow()
13192
        self.NotificationData = []
13193
        self._freeze = True
13194
13195
    def to_binary(self):
13196
        packet = []
13197
        packet.append(uabin.Primitives.UInt32.pack(self.SequenceNumber))
13198
        packet.append(uabin.Primitives.DateTime.pack(self.PublishTime))
13199
        packet.append(uabin.Primitives.Int32.pack(len(self.NotificationData)))
13200
        for fieldname in self.NotificationData:
13201
            packet.append(extensionobject_to_binary(fieldname))
13202
        return b''.join(packet)
13203
13204
    @staticmethod
13205
    def from_binary(data):
13206
        return NotificationMessage(data)
13207
13208
    def _binary_init(self, data):
13209
        self.SequenceNumber = uabin.Primitives.UInt32.unpack(data)
13210
        self.PublishTime = uabin.Primitives.DateTime.unpack(data)
13211
        length = uabin.Primitives.Int32.unpack(data)
13212
        array = []
13213
        if length != -1:
13214
            for _ in range(0, length):
13215
                array.append(extensionobject_from_binary(data))
13216
        self.NotificationData = array
13217
13218
    def __str__(self):
13219
        return 'NotificationMessage(' + 'SequenceNumber:' + str(self.SequenceNumber) + ', ' + \
13220
               'PublishTime:' + str(self.PublishTime) + ', ' + \
13221
               'NotificationData:' + str(self.NotificationData) + ')'
13222
13223
    __repr__ = __str__
13224
@@ 11717-11771 (lines=55) @@
11714
               'FilterResult:' + str(self.FilterResult) + ')'
11715
11716
    __repr__ = __str__
11717
11718
11719
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
    ua_types = {
11730
        'SubscriptionId': 'UInt32',
11731
        'TimestampsToReturn': 'TimestampsToReturn',
11732
        'ItemsToModify': 'MonitoredItemModifyRequest',
11733
               }
11734
11735
    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
    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
    @staticmethod
11755
    def from_binary(data):
11756
        return ModifyMonitoredItemsParameters(data)
11757
11758
    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
    def __str__(self):
11769
        return 'ModifyMonitoredItemsParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
11770
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
11771
               'ItemsToModify:' + str(self.ItemsToModify) + ')'
11772
11773
    __repr__ = __str__
11774
@@ 11439-11493 (lines=55) @@
11436
               'FilterResult:' + str(self.FilterResult) + ')'
11437
11438
    __repr__ = __str__
11439
11440
11441
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
    ua_types = {
11452
        'SubscriptionId': 'UInt32',
11453
        'TimestampsToReturn': 'TimestampsToReturn',
11454
        'ItemsToCreate': 'MonitoredItemCreateRequest',
11455
               }
11456
11457
    def __init__(self, binary=None):
11458
        if binary is not None:
11459
            self._binary_init(binary)
11460
            self._freeze = True
11461
            return
11462
        self.SubscriptionId = 0
11463
        self.TimestampsToReturn = TimestampsToReturn(0)
11464
        self.ItemsToCreate = []
11465
        self._freeze = True
11466
11467
    def to_binary(self):
11468
        packet = []
11469
        packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId))
11470
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
11471
        packet.append(uabin.Primitives.Int32.pack(len(self.ItemsToCreate)))
11472
        for fieldname in self.ItemsToCreate:
11473
            packet.append(fieldname.to_binary())
11474
        return b''.join(packet)
11475
11476
    @staticmethod
11477
    def from_binary(data):
11478
        return CreateMonitoredItemsParameters(data)
11479
11480
    def _binary_init(self, data):
11481
        self.SubscriptionId = uabin.Primitives.UInt32.unpack(data)
11482
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
11483
        length = uabin.Primitives.Int32.unpack(data)
11484
        array = []
11485
        if length != -1:
11486
            for _ in range(0, length):
11487
                array.append(MonitoredItemCreateRequest.from_binary(data))
11488
        self.ItemsToCreate = array
11489
11490
    def __str__(self):
11491
        return 'CreateMonitoredItemsParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \
11492
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
11493
               'ItemsToCreate:' + str(self.ItemsToCreate) + ')'
11494
11495
    __repr__ = __str__
11496
@@ 10069-10123 (lines=55) @@
10066
               'UpdateValues:' + str(self.UpdateValues) + ')'
10067
10068
    __repr__ = __str__
10069
10070
10071
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
    ua_types = {
10082
        'NodeId': 'NodeId',
10083
        'PerformInsertReplace': 'PerformUpdateType',
10084
        'UpdateValues': 'DataValue',
10085
               }
10086
10087
    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
    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
    @staticmethod
10107
    def from_binary(data):
10108
        return UpdateStructureDataDetails(data)
10109
10110
    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
    def __str__(self):
10121
        return 'UpdateStructureDataDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10122
               'PerformInsertReplace:' + str(self.PerformInsertReplace) + ', ' + \
10123
               'UpdateValues:' + str(self.UpdateValues) + ')'
10124
10125
    __repr__ = __str__
10126
@@ 10012-10066 (lines=55) @@
10009
        return 'HistoryUpdateDetails(' + 'NodeId:' + str(self.NodeId) + ')'
10010
10011
    __repr__ = __str__
10012
10013
10014
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
    ua_types = {
10025
        'NodeId': 'NodeId',
10026
        'PerformInsertReplace': 'PerformUpdateType',
10027
        'UpdateValues': 'DataValue',
10028
               }
10029
10030
    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
    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
    @staticmethod
10050
    def from_binary(data):
10051
        return UpdateDataDetails(data)
10052
10053
    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
    def __str__(self):
10064
        return 'UpdateDataDetails(' + 'NodeId:' + str(self.NodeId) + ', ' + \
10065
               'PerformInsertReplace:' + str(self.PerformInsertReplace) + ', ' + \
10066
               'UpdateValues:' + str(self.UpdateValues) + ')'
10067
10068
    __repr__ = __str__
10069
@@ 8824-8878 (lines=55) @@
8821
               'DataEncoding:' + str(self.DataEncoding) + ')'
8822
8823
    __repr__ = __str__
8824
8825
8826
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
    ua_types = {
8837
        'MaxAge': 'Double',
8838
        'TimestampsToReturn': 'TimestampsToReturn',
8839
        'NodesToRead': 'ReadValueId',
8840
               }
8841
8842
    def __init__(self, binary=None):
8843
        if binary is not None:
8844
            self._binary_init(binary)
8845
            self._freeze = True
8846
            return
8847
        self.MaxAge = 0
8848
        self.TimestampsToReturn = TimestampsToReturn(0)
8849
        self.NodesToRead = []
8850
        self._freeze = True
8851
8852
    def to_binary(self):
8853
        packet = []
8854
        packet.append(uabin.Primitives.Double.pack(self.MaxAge))
8855
        packet.append(uabin.Primitives.UInt32.pack(self.TimestampsToReturn.value))
8856
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToRead)))
8857
        for fieldname in self.NodesToRead:
8858
            packet.append(fieldname.to_binary())
8859
        return b''.join(packet)
8860
8861
    @staticmethod
8862
    def from_binary(data):
8863
        return ReadParameters(data)
8864
8865
    def _binary_init(self, data):
8866
        self.MaxAge = uabin.Primitives.Double.unpack(data)
8867
        self.TimestampsToReturn = TimestampsToReturn(uabin.Primitives.UInt32.unpack(data))
8868
        length = uabin.Primitives.Int32.unpack(data)
8869
        array = []
8870
        if length != -1:
8871
            for _ in range(0, length):
8872
                array.append(ReadValueId.from_binary(data))
8873
        self.NodesToRead = array
8874
8875
    def __str__(self):
8876
        return 'ReadParameters(' + 'MaxAge:' + str(self.MaxAge) + ', ' + \
8877
               'TimestampsToReturn:' + str(self.TimestampsToReturn) + ', ' + \
8878
               'NodesToRead:' + str(self.NodesToRead) + ')'
8879
8880
    __repr__ = __str__
8881
@@ 7662-7716 (lines=55) @@
7659
               'IndexRange:' + str(self.IndexRange) + ')'
7660
7661
    __repr__ = __str__
7662
7663
7664
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
    ua_types = {
7675
        'TypeDefinitionNode': 'ExpandedNodeId',
7676
        'IncludeSubTypes': 'Boolean',
7677
        'DataToReturn': 'QueryDataDescription',
7678
               }
7679
7680
    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
    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
    @staticmethod
7700
    def from_binary(data):
7701
        return NodeTypeDescription(data)
7702
7703
    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
    def __str__(self):
7714
        return 'NodeTypeDescription(' + 'TypeDefinitionNode:' + str(self.TypeDefinitionNode) + ', ' + \
7715
               'IncludeSubTypes:' + str(self.IncludeSubTypes) + ', ' + \
7716
               'DataToReturn:' + str(self.DataToReturn) + ')'
7717
7718
    __repr__ = __str__
7719
@@ 6209-6263 (lines=55) @@
6206
               'References:' + str(self.References) + ')'
6207
6208
    __repr__ = __str__
6209
6210
6211
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
    ua_types = {
6222
        'View': 'ViewDescription',
6223
        'RequestedMaxReferencesPerNode': 'UInt32',
6224
        'NodesToBrowse': 'BrowseDescription',
6225
               }
6226
6227
    def __init__(self, binary=None):
6228
        if binary is not None:
6229
            self._binary_init(binary)
6230
            self._freeze = True
6231
            return
6232
        self.View = ViewDescription()
6233
        self.RequestedMaxReferencesPerNode = 0
6234
        self.NodesToBrowse = []
6235
        self._freeze = True
6236
6237
    def to_binary(self):
6238
        packet = []
6239
        packet.append(self.View.to_binary())
6240
        packet.append(uabin.Primitives.UInt32.pack(self.RequestedMaxReferencesPerNode))
6241
        packet.append(uabin.Primitives.Int32.pack(len(self.NodesToBrowse)))
6242
        for fieldname in self.NodesToBrowse:
6243
            packet.append(fieldname.to_binary())
6244
        return b''.join(packet)
6245
6246
    @staticmethod
6247
    def from_binary(data):
6248
        return BrowseParameters(data)
6249
6250
    def _binary_init(self, data):
6251
        self.View = ViewDescription.from_binary(data)
6252
        self.RequestedMaxReferencesPerNode = uabin.Primitives.UInt32.unpack(data)
6253
        length = uabin.Primitives.Int32.unpack(data)
6254
        array = []
6255
        if length != -1:
6256
            for _ in range(0, length):
6257
                array.append(BrowseDescription.from_binary(data))
6258
        self.NodesToBrowse = array
6259
6260
    def __str__(self):
6261
        return 'BrowseParameters(' + 'View:' + str(self.View) + ', ' + \
6262
               'RequestedMaxReferencesPerNode:' + str(self.RequestedMaxReferencesPerNode) + ', ' + \
6263
               'NodesToBrowse:' + str(self.NodesToBrowse) + ')'
6264
6265
    __repr__ = __str__
6266
@@ 7776-7837 (lines=62) @@
7773
               'Values:' + str(self.Values) + ')'
7774
7775
    __repr__ = __str__
7776
7777
7778
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
    ua_types = {
7791
        'NodeId': 'NodeId',
7792
        'ReferenceTypeId': 'NodeId',
7793
        'IsForward': 'Boolean',
7794
        'ReferencedNodeIds': 'NodeId',
7795
               }
7796
7797
    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
    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
    @staticmethod
7819
    def from_binary(data):
7820
        return NodeReference(data)
7821
7822
    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
    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
    __repr__ = __str__
7840
@@ 2125-2181 (lines=57) @@
2122
               'Parameters:' + str(self.Parameters) + ')'
2123
2124
    __repr__ = __str__
2125
2126
2127
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
    ua_types = {
2140
        'TypeId': 'NodeId',
2141
        'ResponseHeader': 'ResponseHeader',
2142
        'Endpoints': 'EndpointDescription',
2143
               }
2144
2145
    def __init__(self, binary=None):
2146
        if binary is not None:
2147
            self._binary_init(binary)
2148
            self._freeze = True
2149
            return
2150
        self.TypeId = FourByteNodeId(ObjectIds.GetEndpointsResponse_Encoding_DefaultBinary)
2151
        self.ResponseHeader = ResponseHeader()
2152
        self.Endpoints = []
2153
        self._freeze = True
2154
2155
    def to_binary(self):
2156
        packet = []
2157
        packet.append(self.TypeId.to_binary())
2158
        packet.append(self.ResponseHeader.to_binary())
2159
        packet.append(uabin.Primitives.Int32.pack(len(self.Endpoints)))
2160
        for fieldname in self.Endpoints:
2161
            packet.append(fieldname.to_binary())
2162
        return b''.join(packet)
2163
2164
    @staticmethod
2165
    def from_binary(data):
2166
        return GetEndpointsResponse(data)
2167
2168
    def _binary_init(self, data):
2169
        self.TypeId = NodeId.from_binary(data)
2170
        self.ResponseHeader = ResponseHeader.from_binary(data)
2171
        length = uabin.Primitives.Int32.unpack(data)
2172
        array = []
2173
        if length != -1:
2174
            for _ in range(0, length):
2175
                array.append(EndpointDescription.from_binary(data))
2176
        self.Endpoints = array
2177
2178
    def __str__(self):
2179
        return 'GetEndpointsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
2180
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
2181
               'Endpoints:' + str(self.Endpoints) + ')'
2182
2183
    __repr__ = __str__
2184
@@ 1539-1595 (lines=57) @@
1536
               'Parameters:' + str(self.Parameters) + ')'
1537
1538
    __repr__ = __str__
1539
1540
1541
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
    ua_types = {
1554
        'TypeId': 'NodeId',
1555
        'ResponseHeader': 'ResponseHeader',
1556
        'Servers': 'ApplicationDescription',
1557
               }
1558
1559
    def __init__(self, binary=None):
1560
        if binary is not None:
1561
            self._binary_init(binary)
1562
            self._freeze = True
1563
            return
1564
        self.TypeId = FourByteNodeId(ObjectIds.FindServersResponse_Encoding_DefaultBinary)
1565
        self.ResponseHeader = ResponseHeader()
1566
        self.Servers = []
1567
        self._freeze = True
1568
1569
    def to_binary(self):
1570
        packet = []
1571
        packet.append(self.TypeId.to_binary())
1572
        packet.append(self.ResponseHeader.to_binary())
1573
        packet.append(uabin.Primitives.Int32.pack(len(self.Servers)))
1574
        for fieldname in self.Servers:
1575
            packet.append(fieldname.to_binary())
1576
        return b''.join(packet)
1577
1578
    @staticmethod
1579
    def from_binary(data):
1580
        return FindServersResponse(data)
1581
1582
    def _binary_init(self, data):
1583
        self.TypeId = NodeId.from_binary(data)
1584
        self.ResponseHeader = ResponseHeader.from_binary(data)
1585
        length = uabin.Primitives.Int32.unpack(data)
1586
        array = []
1587
        if length != -1:
1588
            for _ in range(0, length):
1589
                array.append(ApplicationDescription.from_binary(data))
1590
        self.Servers = array
1591
1592
    def __str__(self):
1593
        return 'FindServersResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
1594
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
1595
               'Servers:' + str(self.Servers) + ')'
1596
1597
    __repr__ = __str__
1598
@@ 10565-10619 (lines=55) @@
10562
               'DiagnosticInfos:' + str(self.DiagnosticInfos) + ')'
10563
10564
    __repr__ = __str__
10565
10566
10567
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
    ua_types = {
10578
        'ObjectId': 'NodeId',
10579
        'MethodId': 'NodeId',
10580
        'InputArguments': 'Variant',
10581
               }
10582
10583
    def __init__(self, binary=None):
10584
        if binary is not None:
10585
            self._binary_init(binary)
10586
            self._freeze = True
10587
            return
10588
        self.ObjectId = NodeId()
10589
        self.MethodId = NodeId()
10590
        self.InputArguments = []
10591
        self._freeze = True
10592
10593
    def to_binary(self):
10594
        packet = []
10595
        packet.append(self.ObjectId.to_binary())
10596
        packet.append(self.MethodId.to_binary())
10597
        packet.append(uabin.Primitives.Int32.pack(len(self.InputArguments)))
10598
        for fieldname in self.InputArguments:
10599
            packet.append(fieldname.to_binary())
10600
        return b''.join(packet)
10601
10602
    @staticmethod
10603
    def from_binary(data):
10604
        return CallMethodRequest(data)
10605
10606
    def _binary_init(self, data):
10607
        self.ObjectId = NodeId.from_binary(data)
10608
        self.MethodId = NodeId.from_binary(data)
10609
        length = uabin.Primitives.Int32.unpack(data)
10610
        array = []
10611
        if length != -1:
10612
            for _ in range(0, length):
10613
                array.append(Variant.from_binary(data))
10614
        self.InputArguments = array
10615
10616
    def __str__(self):
10617
        return 'CallMethodRequest(' + 'ObjectId:' + str(self.ObjectId) + ', ' + \
10618
               'MethodId:' + str(self.MethodId) + ', ' + \
10619
               'InputArguments:' + str(self.InputArguments) + ')'
10620
10621
    __repr__ = __str__
10622
@@ 7719-7773 (lines=55) @@
7716
               'DataToReturn:' + str(self.DataToReturn) + ')'
7717
7718
    __repr__ = __str__
7719
7720
7721
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
    ua_types = {
7732
        'NodeId': 'ExpandedNodeId',
7733
        'TypeDefinitionNode': 'ExpandedNodeId',
7734
        'Values': 'Variant',
7735
               }
7736
7737
    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
    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
    @staticmethod
7757
    def from_binary(data):
7758
        return QueryDataSet(data)
7759
7760
    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
    def __str__(self):
7771
        return 'QueryDataSet(' + 'NodeId:' + str(self.NodeId) + ', ' + \
7772
               'TypeDefinitionNode:' + str(self.TypeDefinitionNode) + ', ' + \
7773
               'Values:' + str(self.Values) + ')'
7774
7775
    __repr__ = __str__
7776