Code Duplication    Length = 56-64 lines in 2 locations

asyncua/ua/uaprotocol_auto.py 2 locations

@@ 11720-11783 (lines=64) @@
11717
    __repr__ = __str__
11718
11719
11720
class ProgramDiagnostic2DataType(FrozenClass):
11721
    """
11722
    :ivar CreateSessionId:
11723
    :vartype CreateSessionId: NodeId
11724
    :ivar CreateClientName:
11725
    :vartype CreateClientName: String
11726
    :ivar InvocationCreationTime:
11727
    :vartype InvocationCreationTime: DateTime
11728
    :ivar LastTransitionTime:
11729
    :vartype LastTransitionTime: DateTime
11730
    :ivar LastMethodCall:
11731
    :vartype LastMethodCall: String
11732
    :ivar LastMethodSessionId:
11733
    :vartype LastMethodSessionId: NodeId
11734
    :ivar LastMethodInputArguments:
11735
    :vartype LastMethodInputArguments: Argument
11736
    :ivar LastMethodOutputArguments:
11737
    :vartype LastMethodOutputArguments: Argument
11738
    :ivar LastMethodInputValues:
11739
    :vartype LastMethodInputValues: Variant
11740
    :ivar LastMethodOutputValues:
11741
    :vartype LastMethodOutputValues: Variant
11742
    :ivar LastMethodCallTime:
11743
    :vartype LastMethodCallTime: DateTime
11744
    :ivar LastMethodReturnStatus:
11745
    :vartype LastMethodReturnStatus: StatusResult
11746
    """
11747
11748
    data_type = NodeId(ObjectIds.ProgramDiagnostic2DataType)
11749
11750
    ua_types = [
11751
        ('CreateSessionId', 'NodeId'),
11752
        ('CreateClientName', 'String'),
11753
        ('InvocationCreationTime', 'DateTime'),
11754
        ('LastTransitionTime', 'DateTime'),
11755
        ('LastMethodCall', 'String'),
11756
        ('LastMethodSessionId', 'NodeId'),
11757
        ('LastMethodInputArguments', 'ListOfArgument'),
11758
        ('LastMethodOutputArguments', 'ListOfArgument'),
11759
        ('LastMethodInputValues', 'ListOfVariant'),
11760
        ('LastMethodOutputValues', 'ListOfVariant'),
11761
        ('LastMethodCallTime', 'DateTime'),
11762
        ('LastMethodReturnStatus', 'StatusResult'),
11763
               ]
11764
11765
    def __init__(self):
11766
        self.CreateSessionId = NodeId()
11767
        self.CreateClientName = None
11768
        self.InvocationCreationTime = datetime.utcnow()
11769
        self.LastTransitionTime = datetime.utcnow()
11770
        self.LastMethodCall = None
11771
        self.LastMethodSessionId = NodeId()
11772
        self.LastMethodInputArguments = []
11773
        self.LastMethodOutputArguments = []
11774
        self.LastMethodInputValues = []
11775
        self.LastMethodOutputValues = []
11776
        self.LastMethodCallTime = datetime.utcnow()
11777
        self.LastMethodReturnStatus = StatusResult()
11778
        self._freeze = True
11779
11780
    def __str__(self):
11781
        return f'ProgramDiagnostic2DataType(CreateSessionId:{self.CreateSessionId}, CreateClientName:{self.CreateClientName}, InvocationCreationTime:{self.InvocationCreationTime}, LastTransitionTime:{self.LastTransitionTime}, LastMethodCall:{self.LastMethodCall}, LastMethodSessionId:{self.LastMethodSessionId}, LastMethodInputArguments:{self.LastMethodInputArguments}, LastMethodOutputArguments:{self.LastMethodOutputArguments}, LastMethodInputValues:{self.LastMethodInputValues}, LastMethodOutputValues:{self.LastMethodOutputValues}, LastMethodCallTime:{self.LastMethodCallTime}, LastMethodReturnStatus:{self.LastMethodReturnStatus})'
11782
11783
    __repr__ = __str__
11784
11785
11786
class Annotation(FrozenClass):
@@ 11662-11717 (lines=56) @@
11659
    __repr__ = __str__
11660
11661
11662
class ProgramDiagnosticDataType(FrozenClass):
11663
    """
11664
    :ivar CreateSessionId:
11665
    :vartype CreateSessionId: NodeId
11666
    :ivar CreateClientName:
11667
    :vartype CreateClientName: String
11668
    :ivar InvocationCreationTime:
11669
    :vartype InvocationCreationTime: DateTime
11670
    :ivar LastTransitionTime:
11671
    :vartype LastTransitionTime: DateTime
11672
    :ivar LastMethodCall:
11673
    :vartype LastMethodCall: String
11674
    :ivar LastMethodSessionId:
11675
    :vartype LastMethodSessionId: NodeId
11676
    :ivar LastMethodInputArguments:
11677
    :vartype LastMethodInputArguments: Argument
11678
    :ivar LastMethodOutputArguments:
11679
    :vartype LastMethodOutputArguments: Argument
11680
    :ivar LastMethodCallTime:
11681
    :vartype LastMethodCallTime: DateTime
11682
    :ivar LastMethodReturnStatus:
11683
    :vartype LastMethodReturnStatus: StatusResult
11684
    """
11685
11686
    data_type = NodeId(ObjectIds.ProgramDiagnosticDataType)
11687
11688
    ua_types = [
11689
        ('CreateSessionId', 'NodeId'),
11690
        ('CreateClientName', 'String'),
11691
        ('InvocationCreationTime', 'DateTime'),
11692
        ('LastTransitionTime', 'DateTime'),
11693
        ('LastMethodCall', 'String'),
11694
        ('LastMethodSessionId', 'NodeId'),
11695
        ('LastMethodInputArguments', 'ListOfArgument'),
11696
        ('LastMethodOutputArguments', 'ListOfArgument'),
11697
        ('LastMethodCallTime', 'DateTime'),
11698
        ('LastMethodReturnStatus', 'StatusResult'),
11699
               ]
11700
11701
    def __init__(self):
11702
        self.CreateSessionId = NodeId()
11703
        self.CreateClientName = None
11704
        self.InvocationCreationTime = datetime.utcnow()
11705
        self.LastTransitionTime = datetime.utcnow()
11706
        self.LastMethodCall = None
11707
        self.LastMethodSessionId = NodeId()
11708
        self.LastMethodInputArguments = []
11709
        self.LastMethodOutputArguments = []
11710
        self.LastMethodCallTime = datetime.utcnow()
11711
        self.LastMethodReturnStatus = StatusResult()
11712
        self._freeze = True
11713
11714
    def __str__(self):
11715
        return f'ProgramDiagnosticDataType(CreateSessionId:{self.CreateSessionId}, CreateClientName:{self.CreateClientName}, InvocationCreationTime:{self.InvocationCreationTime}, LastTransitionTime:{self.LastTransitionTime}, LastMethodCall:{self.LastMethodCall}, LastMethodSessionId:{self.LastMethodSessionId}, LastMethodInputArguments:{self.LastMethodInputArguments}, LastMethodOutputArguments:{self.LastMethodOutputArguments}, LastMethodCallTime:{self.LastMethodCallTime}, LastMethodReturnStatus:{self.LastMethodReturnStatus})'
11716
11717
    __repr__ = __str__
11718
11719
11720
class ProgramDiagnostic2DataType(FrozenClass):