@@ 12070-12128 (lines=59) @@ | ||
12067 | __repr__ = __str__ |
|
12068 | ||
12069 | ||
12070 | class SetTriggeringParameters(FrozenClass): |
|
12071 | ''' |
|
12072 | :ivar SubscriptionId: |
|
12073 | :vartype SubscriptionId: UInt32 |
|
12074 | :ivar TriggeringItemId: |
|
12075 | :vartype TriggeringItemId: UInt32 |
|
12076 | :ivar LinksToAdd: |
|
12077 | :vartype LinksToAdd: UInt32 |
|
12078 | :ivar LinksToRemove: |
|
12079 | :vartype LinksToRemove: UInt32 |
|
12080 | ''' |
|
12081 | ||
12082 | ua_types = { |
|
12083 | 'SubscriptionId': 'UInt32', |
|
12084 | 'TriggeringItemId': 'UInt32', |
|
12085 | 'LinksToAdd': 'UInt32', |
|
12086 | 'LinksToRemove': 'UInt32', |
|
12087 | } |
|
12088 | ||
12089 | def __init__(self, binary=None): |
|
12090 | if binary is not None: |
|
12091 | self._binary_init(binary) |
|
12092 | self._freeze = True |
|
12093 | return |
|
12094 | self.SubscriptionId = 0 |
|
12095 | self.TriggeringItemId = 0 |
|
12096 | self.LinksToAdd = [] |
|
12097 | self.LinksToRemove = [] |
|
12098 | self._freeze = True |
|
12099 | ||
12100 | def to_binary(self): |
|
12101 | packet = [] |
|
12102 | packet.append(uabin.Primitives.UInt32.pack(self.SubscriptionId)) |
|
12103 | packet.append(uabin.Primitives.UInt32.pack(self.TriggeringItemId)) |
|
12104 | packet.append(uabin.Primitives.Int32.pack(len(self.LinksToAdd))) |
|
12105 | for fieldname in self.LinksToAdd: |
|
12106 | packet.append(uabin.Primitives.UInt32.pack(fieldname)) |
|
12107 | packet.append(uabin.Primitives.Int32.pack(len(self.LinksToRemove))) |
|
12108 | for fieldname in self.LinksToRemove: |
|
12109 | packet.append(uabin.Primitives.UInt32.pack(fieldname)) |
|
12110 | return b''.join(packet) |
|
12111 | ||
12112 | @staticmethod |
|
12113 | def from_binary(data): |
|
12114 | return SetTriggeringParameters(data) |
|
12115 | ||
12116 | def _binary_init(self, data): |
|
12117 | self.SubscriptionId = uabin.Primitives.UInt32.unpack(data) |
|
12118 | self.TriggeringItemId = uabin.Primitives.UInt32.unpack(data) |
|
12119 | self.LinksToAdd = uabin.Primitives.UInt32.unpack_array(data) |
|
12120 | self.LinksToRemove = uabin.Primitives.UInt32.unpack_array(data) |
|
12121 | ||
12122 | def __str__(self): |
|
12123 | return 'SetTriggeringParameters(' + 'SubscriptionId:' + str(self.SubscriptionId) + ', ' + \ |
|
12124 | 'TriggeringItemId:' + str(self.TriggeringItemId) + ', ' + \ |
|
12125 | 'LinksToAdd:' + str(self.LinksToAdd) + ', ' + \ |
|
12126 | 'LinksToRemove:' + str(self.LinksToRemove) + ')' |
|
12127 | ||
12128 | __repr__ = __str__ |
|
12129 | ||
12130 | ||
12131 | class SetTriggeringRequest(FrozenClass): |
|
@@ 1600-1656 (lines=57) @@ | ||
1597 | __repr__ = __str__ |
|
1598 | ||
1599 | ||
1600 | class ServerOnNetwork(FrozenClass): |
|
1601 | ''' |
|
1602 | :ivar RecordId: |
|
1603 | :vartype RecordId: UInt32 |
|
1604 | :ivar ServerName: |
|
1605 | :vartype ServerName: String |
|
1606 | :ivar DiscoveryUrl: |
|
1607 | :vartype DiscoveryUrl: String |
|
1608 | :ivar ServerCapabilities: |
|
1609 | :vartype ServerCapabilities: String |
|
1610 | ''' |
|
1611 | ||
1612 | ua_types = { |
|
1613 | 'RecordId': 'UInt32', |
|
1614 | 'ServerName': 'String', |
|
1615 | 'DiscoveryUrl': 'String', |
|
1616 | 'ServerCapabilities': 'String', |
|
1617 | } |
|
1618 | ||
1619 | def __init__(self, binary=None): |
|
1620 | if binary is not None: |
|
1621 | self._binary_init(binary) |
|
1622 | self._freeze = True |
|
1623 | return |
|
1624 | self.RecordId = 0 |
|
1625 | self.ServerName = None |
|
1626 | self.DiscoveryUrl = None |
|
1627 | self.ServerCapabilities = [] |
|
1628 | self._freeze = True |
|
1629 | ||
1630 | def to_binary(self): |
|
1631 | packet = [] |
|
1632 | packet.append(uabin.Primitives.UInt32.pack(self.RecordId)) |
|
1633 | packet.append(uabin.Primitives.String.pack(self.ServerName)) |
|
1634 | packet.append(uabin.Primitives.String.pack(self.DiscoveryUrl)) |
|
1635 | packet.append(uabin.Primitives.Int32.pack(len(self.ServerCapabilities))) |
|
1636 | for fieldname in self.ServerCapabilities: |
|
1637 | packet.append(uabin.Primitives.String.pack(fieldname)) |
|
1638 | return b''.join(packet) |
|
1639 | ||
1640 | @staticmethod |
|
1641 | def from_binary(data): |
|
1642 | return ServerOnNetwork(data) |
|
1643 | ||
1644 | def _binary_init(self, data): |
|
1645 | self.RecordId = uabin.Primitives.UInt32.unpack(data) |
|
1646 | self.ServerName = uabin.Primitives.String.unpack(data) |
|
1647 | self.DiscoveryUrl = uabin.Primitives.String.unpack(data) |
|
1648 | self.ServerCapabilities = uabin.Primitives.String.unpack_array(data) |
|
1649 | ||
1650 | def __str__(self): |
|
1651 | return 'ServerOnNetwork(' + 'RecordId:' + str(self.RecordId) + ', ' + \ |
|
1652 | 'ServerName:' + str(self.ServerName) + ', ' + \ |
|
1653 | 'DiscoveryUrl:' + str(self.DiscoveryUrl) + ', ' + \ |
|
1654 | 'ServerCapabilities:' + str(self.ServerCapabilities) + ')' |
|
1655 | ||
1656 | __repr__ = __str__ |
|
1657 | ||
1658 | ||
1659 | class FindServersOnNetworkParameters(FrozenClass): |