2 from PLC.Faults import *
3 from PLC.Method import Method
4 from PLC.Parameter import Parameter, Mixed
5 from PLC.AddressTypes import AddressType, AddressTypes
6 from PLC.Auth import Auth
8 class DeleteAddressType(Method):
10 Deletes an address type.
12 Returns 1 if successful, faults otherwise.
19 Mixed(AddressType.fields['address_type_id'],
20 AddressType.fields['name'])
23 returns = Parameter(int, '1 if successful')
26 def call(self, auth, address_type_id_or_name):
27 address_types = AddressTypes(self.api, [address_type_id_or_name])
29 raise PLCInvalidArgument, "No such address type"
30 address_type = address_types[0]
32 self.event_objects = {'AddressType': [address_type['address_type_id']]}