@@ 7952-7992 (lines=41) @@ | ||
7949 | __repr__ = __str__ |
|
7950 | ||
7951 | ||
7952 | class HistoryReadResult(FrozenClass): |
|
7953 | ''' |
|
7954 | :ivar StatusCode: |
|
7955 | :vartype StatusCode: StatusCode |
|
7956 | :ivar ContinuationPoint: |
|
7957 | :vartype ContinuationPoint: ByteString |
|
7958 | :ivar HistoryData: |
|
7959 | :vartype HistoryData: ExtensionObject |
|
7960 | ''' |
|
7961 | def __init__(self, binary=None): |
|
7962 | if binary is not None: |
|
7963 | self._binary_init(binary) |
|
7964 | self._freeze = True |
|
7965 | return |
|
7966 | self.StatusCode = StatusCode() |
|
7967 | self.ContinuationPoint = b'' |
|
7968 | self.HistoryData = None |
|
7969 | self._freeze = True |
|
7970 | ||
7971 | def to_binary(self): |
|
7972 | packet = [] |
|
7973 | packet.append(self.StatusCode.to_binary()) |
|
7974 | packet.append(pack_bytes(self.ContinuationPoint)) |
|
7975 | packet.append(extensionobject_to_binary(self.HistoryData)) |
|
7976 | return b''.join(packet) |
|
7977 | ||
7978 | @staticmethod |
|
7979 | def from_binary(data): |
|
7980 | return HistoryReadResult(data) |
|
7981 | ||
7982 | def _binary_init(self, data): |
|
7983 | self.StatusCode = StatusCode.from_binary(data) |
|
7984 | self.ContinuationPoint = unpack_bytes(data) |
|
7985 | self.HistoryData = extensionobject_from_binary(data) |
|
7986 | ||
7987 | def __str__(self): |
|
7988 | return 'HistoryReadResult(' + 'StatusCode:' + str(self.StatusCode) + ', ' + \ |
|
7989 | 'ContinuationPoint:' + str(self.ContinuationPoint) + ', ' + \ |
|
7990 | 'HistoryData:' + str(self.HistoryData) + ')' |
|
7991 | ||
7992 | __repr__ = __str__ |
|
7993 | ||
7994 | ||
7995 | class HistoryReadDetails(FrozenClass): |
|
@@ 2535-2575 (lines=41) @@ | ||
2532 | __repr__ = __str__ |
|
2533 | ||
2534 | ||
2535 | class OpenSecureChannelResult(FrozenClass): |
|
2536 | ''' |
|
2537 | :ivar ServerProtocolVersion: |
|
2538 | :vartype ServerProtocolVersion: UInt32 |
|
2539 | :ivar SecurityToken: |
|
2540 | :vartype SecurityToken: ChannelSecurityToken |
|
2541 | :ivar ServerNonce: |
|
2542 | :vartype ServerNonce: ByteString |
|
2543 | ''' |
|
2544 | def __init__(self, binary=None): |
|
2545 | if binary is not None: |
|
2546 | self._binary_init(binary) |
|
2547 | self._freeze = True |
|
2548 | return |
|
2549 | self.ServerProtocolVersion = 0 |
|
2550 | self.SecurityToken = ChannelSecurityToken() |
|
2551 | self.ServerNonce = b'' |
|
2552 | self._freeze = True |
|
2553 | ||
2554 | def to_binary(self): |
|
2555 | packet = [] |
|
2556 | packet.append(uatype_UInt32.pack(self.ServerProtocolVersion)) |
|
2557 | packet.append(self.SecurityToken.to_binary()) |
|
2558 | packet.append(pack_bytes(self.ServerNonce)) |
|
2559 | return b''.join(packet) |
|
2560 | ||
2561 | @staticmethod |
|
2562 | def from_binary(data): |
|
2563 | return OpenSecureChannelResult(data) |
|
2564 | ||
2565 | def _binary_init(self, data): |
|
2566 | self.ServerProtocolVersion = uatype_UInt32.unpack(data.read(4))[0] |
|
2567 | self.SecurityToken = ChannelSecurityToken.from_binary(data) |
|
2568 | self.ServerNonce = unpack_bytes(data) |
|
2569 | ||
2570 | def __str__(self): |
|
2571 | return 'OpenSecureChannelResult(' + 'ServerProtocolVersion:' + str(self.ServerProtocolVersion) + ', ' + \ |
|
2572 | 'SecurityToken:' + str(self.SecurityToken) + ', ' + \ |
|
2573 | 'ServerNonce:' + str(self.ServerNonce) + ')' |
|
2574 | ||
2575 | __repr__ = __str__ |
|
2576 | ||
2577 | ||
2578 | class OpenSecureChannelResponse(FrozenClass): |