1 from PLC.Faults import *
2 from PLC.Method import Method
3 from PLC.Parameter import Parameter, Mixed
4 from PLC.Filter import Filter
5 from PLC.AddressTypes import AddressType, AddressTypes
6 from PLC.Auth import Auth
8 class GetAddressTypes(Method):
10 Returns an array of structs containing details about address
11 types. If address_type_filter is specified and is an array of
12 address type identifiers, or a struct of address type attributes,
13 only address types matching the filter will be returned.
16 roles = ['admin', 'pi', 'user', 'tech']
20 Mixed([Mixed(AddressType.fields['address_type_id'],
21 AddressType.fields['name'])],
22 Filter(AddressType.fields))
25 returns = [AddressType.fields]
27 def call(self, auth, address_type_filter = None):
28 return AddressTypes(self.api, address_type_filter).values()