Code Duplication    Length = 45-50 lines in 3 locations

opcua/ua/uaprotocol_auto.py 3 locations

@@ 3895-3944 (lines=50) @@
3892
               'Parameters:' + str(self.Parameters) + ')'
3893
3894
    __repr__ = __str__
3895
3896
3897
class GetEndpointsResponse(FrozenClass):
3898
    '''
3899
    Gets the endpoints used by the server.
3900
3901
    :ivar TypeId:
3902
    :vartype TypeId: NodeId
3903
    :ivar ResponseHeader:
3904
    :vartype ResponseHeader: ResponseHeader
3905
    :ivar Endpoints:
3906
    :vartype Endpoints: EndpointDescription
3907
    '''
3908
3909
    ua_types = [
3910
        ('TypeId', 'NodeId'),
3911
        ('ResponseHeader', 'ResponseHeader'),
3912
        ('Endpoints', 'ListOfEndpointDescription'),
3913
               ]
3914
3915
    def __init__(self):
3916
        self.TypeId = FourByteNodeId(ObjectIds.GetEndpointsResponse_Encoding_DefaultBinary)
3917
        self.ResponseHeader = ResponseHeader()
3918
        self.Endpoints = []
3919
        self._freeze = True
3920
3921
    def __str__(self):
3922
        return 'GetEndpointsResponse(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3923
               'ResponseHeader:' + str(self.ResponseHeader) + ', ' + \
3924
               'Endpoints:' + str(self.Endpoints) + ')'
3925
3926
    __repr__ = __str__
3927
3928
3929
class RegisteredServer(FrozenClass):
3930
    '''
3931
    The information required to register a server with a discovery server.
3932
3933
    :ivar ServerUri:
3934
    :vartype ServerUri: String
3935
    :ivar ProductUri:
3936
    :vartype ProductUri: String
3937
    :ivar ServerNames:
3938
    :vartype ServerNames: LocalizedText
3939
    :ivar ServerType:
3940
    :vartype ServerType: ApplicationType
3941
    :ivar GatewayServerUri:
3942
    :vartype GatewayServerUri: String
3943
    :ivar DiscoveryUrls:
3944
    :vartype DiscoveryUrls: String
3945
    :ivar SemaphoreFilePath:
3946
    :vartype SemaphoreFilePath: String
3947
    :ivar IsOnline:
@@ 3245-3294 (lines=50) @@
3242
3243
3244
class ApplicationDescription(FrozenClass):
3245
    '''
3246
    Describes an application and how to find it.
3247
3248
    :ivar ApplicationUri:
3249
    :vartype ApplicationUri: String
3250
    :ivar ProductUri:
3251
    :vartype ProductUri: String
3252
    :ivar ApplicationName:
3253
    :vartype ApplicationName: LocalizedText
3254
    :ivar ApplicationType:
3255
    :vartype ApplicationType: ApplicationType
3256
    :ivar GatewayServerUri:
3257
    :vartype GatewayServerUri: String
3258
    :ivar DiscoveryProfileUri:
3259
    :vartype DiscoveryProfileUri: String
3260
    :ivar DiscoveryUrls:
3261
    :vartype DiscoveryUrls: String
3262
    '''
3263
3264
    ua_types = [
3265
        ('ApplicationUri', 'String'),
3266
        ('ProductUri', 'String'),
3267
        ('ApplicationName', 'LocalizedText'),
3268
        ('ApplicationType', 'ApplicationType'),
3269
        ('GatewayServerUri', 'String'),
3270
        ('DiscoveryProfileUri', 'String'),
3271
        ('DiscoveryUrls', 'ListOfString'),
3272
               ]
3273
3274
    def __init__(self):
3275
        self.ApplicationUri = None
3276
        self.ProductUri = None
3277
        self.ApplicationName = LocalizedText()
3278
        self.ApplicationType = ApplicationType(0)
3279
        self.GatewayServerUri = None
3280
        self.DiscoveryProfileUri = None
3281
        self.DiscoveryUrls = []
3282
        self._freeze = True
3283
3284
    def __str__(self):
3285
        return 'ApplicationDescription(' + 'ApplicationUri:' + str(self.ApplicationUri) + ', ' + \
3286
               'ProductUri:' + str(self.ProductUri) + ', ' + \
3287
               'ApplicationName:' + str(self.ApplicationName) + ', ' + \
3288
               'ApplicationType:' + str(self.ApplicationType) + ', ' + \
3289
               'GatewayServerUri:' + str(self.GatewayServerUri) + ', ' + \
3290
               'DiscoveryProfileUri:' + str(self.DiscoveryProfileUri) + ', ' + \
3291
               'DiscoveryUrls:' + str(self.DiscoveryUrls) + ')'
3292
3293
    __repr__ = __str__
3294
3295
3296
class RequestHeader(FrozenClass):
3297
    '''
@@ 3413-3457 (lines=45) @@
3410
    def __init__(self):
3411
        self.TypeId = FourByteNodeId(ObjectIds.ServiceFault_Encoding_DefaultBinary)
3412
        self.ResponseHeader = ResponseHeader()
3413
        self._freeze = True
3414
3415
    def __str__(self):
3416
        return 'ServiceFault(' + 'TypeId:' + str(self.TypeId) + ', ' + \
3417
               'ResponseHeader:' + str(self.ResponseHeader) + ')'
3418
3419
    __repr__ = __str__
3420
3421
3422
class SessionlessInvokeRequestType(FrozenClass):
3423
    '''
3424
    :ivar UrisVersion:
3425
    :vartype UrisVersion: UInt32
3426
    :ivar NamespaceUris:
3427
    :vartype NamespaceUris: String
3428
    :ivar ServerUris:
3429
    :vartype ServerUris: String
3430
    :ivar LocaleIds:
3431
    :vartype LocaleIds: String
3432
    :ivar ServiceId:
3433
    :vartype ServiceId: UInt32
3434
    '''
3435
3436
    ua_types = [
3437
        ('UrisVersion', 'ListOfUInt32'),
3438
        ('NamespaceUris', 'ListOfString'),
3439
        ('ServerUris', 'ListOfString'),
3440
        ('LocaleIds', 'ListOfString'),
3441
        ('ServiceId', 'UInt32'),
3442
               ]
3443
3444
    def __init__(self):
3445
        self.UrisVersion = []
3446
        self.NamespaceUris = []
3447
        self.ServerUris = []
3448
        self.LocaleIds = []
3449
        self.ServiceId = 0
3450
        self._freeze = True
3451
3452
    def __str__(self):
3453
        return 'SessionlessInvokeRequestType(' + 'UrisVersion:' + str(self.UrisVersion) + ', ' + \
3454
               'NamespaceUris:' + str(self.NamespaceUris) + ', ' + \
3455
               'ServerUris:' + str(self.ServerUris) + ', ' + \
3456
               'LocaleIds:' + str(self.LocaleIds) + ', ' + \
3457
               'ServiceId:' + str(self.ServiceId) + ')'
3458
3459
    __repr__ = __str__
3460