2 from PLC.Faults import *
3 from PLC.Method import Method
4 from PLC.Parameter import Parameter, Mixed
5 from PLC.PCUProtocolTypes import PCUProtocolType, PCUProtocolTypes
6 from PLC.Auth import Auth
8 class DeletePCUProtocolType(Method):
10 Deletes a PCU protocol type.
12 Returns 1 if successful, faults otherwise.
19 PCUProtocolType.fields['pcu_protocol_type_id']
22 returns = Parameter(int, '1 if successful')
25 def call(self, auth, protocol_type_id):
26 protocol_types = PCUProtocolTypes(self.api, [protocol_type_id])
27 if not protocol_types:
28 raise PLCInvalidArgument, "No such pcu protocol type"
30 protocol_type = protocol_types[0]
31 protocol_type.delete()
32 self.event_objects = {'PCUProtocolType': [protocol_type['pcu_protocol_type_id']]}