@@ 12104-12162 (lines=59) @@ | ||
12101 | __repr__ = __str__ |
|
12102 | ||
12103 | ||
12104 | class SetTriggeringParameters(FrozenClass): |
|
12105 | ''' |
|
12106 | :ivar SubscriptionId: |
|
12107 | :vartype SubscriptionId: UInt32 |
|
12108 | :ivar TriggeringItemId: |
|
12109 | :vartype TriggeringItemId: UInt32 |
|
12110 | :ivar LinksToAdd: |
|
12111 | :vartype LinksToAdd: UInt32 |
|
12112 | :ivar LinksToRemove: |
|
12113 | :vartype LinksToRemove: UInt32 |
|
12114 | ''' |
|
12115 | ||
12116 | ua_types = { |
|
12117 | 'SubscriptionId': 'UInt32', |
|
12118 | 'TriggeringItemId': 'UInt32', |
|
12119 | 'LinksToAdd': 'UInt32', |
|
12120 | 'LinksToRemove': 'UInt32', |
|
12121 | } |
|
12122 | ||
12123 | def __init__(self, binary=None): |
|
12124 | if binary is not None: |
|
12125 | self._binary_init(binary) |
|
12126 | self._freeze = True |
|
12127 | return |
|
12128 | self.SubscriptionId = 0 |
|
12129 | self.TriggeringItemId = 0 |
|
12130 | self.LinksToAdd = [] |
|
12131 | self.LinksToRemove = [] |
|
12132 | self._freeze = True |
|
12133 | ||
12134 | def to_binary(self): |
|
12135 | packet = [] |
|
12136 | packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId)) |
|
12137 | packet.append(uabin.Primitives.UInt32.pack(self.TriggeringItemId)) |
|
12138 | packet.append(uabin.Primitives.Int32.pack(len(self.LinksToAdd))) |
|
12139 | for fieldname in self.LinksToAdd: |
|
12140 | packet.append(uabin.Primitives.UInt32.pack(fieldname)) |
|
12141 | packet.append(uabin.Primitives.Int32.pack(len(self.LinksToRemove))) |
|
12142 | for fieldname in self.LinksToRemove: |
|
12143 | packet.append(uabin.Primitives.UInt32.pack(fieldname)) |
|
12144 | return b''.join(packet) |
|
12145 | ||
12146 | @staticmethod |
|
12147 | def from_binary(data): |
|
12148 | return SetTriggeringParameters(data) |
|
12149 | ||
12150 | def _binary_init(self, data): |
|
12151 | self.SubscriptionId = uabin.Primitives.UInt32.unpack(data) |
|
12152 | self.TriggeringItemId = uabin.Primitives.UInt32.unpack(data) |
|
12153 | self.LinksToAdd = uabin.Primitives.UInt32.unpack_array(data) |
|
12154 | self.LinksToRemove = uabin.Primitives.UInt32.unpack_array(data) |
|
12155 | ||
12156 | def __str__(self): |
|
12157 | return 'SetTriggeringParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \ |
|
12158 | 'TriggeringItemId:' + str(self.TriggeringItemId) + ', ' + \ |
|
12159 | 'LinksToAdd:' + str(self.LinksToAdd) + ', ' + \ |
|
12160 | 'LinksToRemove:' + str(self.LinksToRemove) + ')' |
|
12161 | ||
12162 | __repr__ = __str__ |
|
12163 | ||
12164 | ||
12165 | class SetTriggeringRequest(FrozenClass): |
|
@@ 1598-1654 (lines=57) @@ | ||
1595 | __repr__ = __str__ |
|
1596 | ||
1597 | ||
1598 | class ServerOnNetwork(FrozenClass): |
|
1599 | ''' |
|
1600 | :ivar RecordId: |
|
1601 | :vartype RecordId: UInt32 |
|
1602 | :ivar ServerName: |
|
1603 | :vartype ServerName: String |
|
1604 | :ivar DiscoveryUrl: |
|
1605 | :vartype DiscoveryUrl: String |
|
1606 | :ivar ServerCapabilities: |
|
1607 | :vartype ServerCapabilities: String |
|
1608 | ''' |
|
1609 | ||
1610 | ua_types = { |
|
1611 | 'RecordId': 'UInt32', |
|
1612 | 'ServerName': 'String', |
|
1613 | 'DiscoveryUrl': 'String', |
|
1614 | 'ServerCapabilities': 'String', |
|
1615 | } |
|
1616 | ||
1617 | def __init__(self, binary=None): |
|
1618 | if binary is not None: |
|
1619 | self._binary_init(binary) |
|
1620 | self._freeze = True |
|
1621 | return |
|
1622 | self.RecordId = 0 |
|
1623 | self.ServerName = None |
|
1624 | self.DiscoveryUrl = None |
|
1625 | self.ServerCapabilities = [] |
|
1626 | self._freeze = True |
|
1627 | ||
1628 | def to_binary(self): |
|
1629 | packet = [] |
|
1630 | packet.append(uabin.Primitives.UInt32.pack(self.RecordId)) |
|
1631 | packet.append(uabin.Primitives.String.pack(self.ServerName)) |
|
1632 | packet.append(uabin.Primitives.String.pack(self.DiscoveryUrl)) |
|
1633 | packet.append(uabin.Primitives.Int32.pack(len(self.ServerCapabilities))) |
|
1634 | for fieldname in self.ServerCapabilities: |
|
1635 | packet.append(uabin.Primitives.String.pack(fieldname)) |
|
1636 | return b''.join(packet) |
|
1637 | ||
1638 | @staticmethod |
|
1639 | def from_binary(data): |
|
1640 | return ServerOnNetwork(data) |
|
1641 | ||
1642 | def _binary_init(self, data): |
|
1643 | self.RecordId = uabin.Primitives.UInt32.unpack(data) |
|
1644 | self.ServerName = uabin.Primitives.String.unpack(data) |
|
1645 | self.DiscoveryUrl = uabin.Primitives.String.unpack(data) |
|
1646 | self.ServerCapabilities = uabin.Primitives.String.unpack_array(data) |
|
1647 | ||
1648 | def __str__(self): |
|
1649 | return 'ServerOnNetwork(' + 'RecordId:' + str(self.RecordId) + ', ' + \ |
|
1650 | 'ServerName:' + str(self.ServerName) + ', ' + \ |
|
1651 | 'DiscoveryUrl:' + str(self.DiscoveryUrl) + ', ' + \ |
|
1652 | 'ServerCapabilities:' + str(self.ServerCapabilities) + ')' |
|
1653 | ||
1654 | __repr__ = __str__ |
|
1655 | ||
1656 | ||
1657 | class FindServersOnNetworkParameters(FrozenClass): |