1 from PLC.Faults import *
2 from PLC.Method import Method
3 from PLC.Parameter import Parameter, Mixed
4 from PLC.AddressTypes import AddressType, AddressTypes
5 from PLC.Auth import Auth
7 class DeleteAddressType(Method):
9 Deletes an address type.
11 Returns 1 if successful, faults otherwise.
18 Mixed(AddressType.fields['address_type_id'],
19 AddressType.fields['name'])
22 returns = Parameter(int, '1 if successful')
25 def call(self, auth, address_type_id_or_name):
26 address_types = AddressTypes(self.api, [address_type_id_or_name])
28 raise PLCInvalidArgument, "No such address type"
29 address_type = address_types[0]
31 self.object_ids = [address_type['address_type_id']]