UpdatePerson.py
[plcapi.git] / PLC / Methods / AdmAddPersonKey.py
1 from PLC.Faults import *
2 from PLC.Method import Method
3 from PLC.Parameter import Parameter, Mixed
4 from PLC.Keys import Key, Keys
5 from PLC.Persons import Person, Persons
6 from PLC.Auth import PasswordAuth
7
8 class AdmAddPersonKey(AddPersonKey):
9     """
10     Deprecated. See AddPersonKey. Keys can no longer be marked as
11     primary, i.e. the is_primary argument does nothing.
12     """
13
14     status = "deprecated"
15
16     accepts = [
17         PasswordAuth(),
18         Mixed(Person.fields['person_id'],
19               Person.fields['email']),
20         Key.fields['key_type'],
21         Key.fields['key'],
22         Parameter(int, "Make this key the primary key")
23         ]
24
25     def call(self, auth, person_id_or_email, key_type, key_value, is_primary):
26         return AddPersonKey.call(self, auth, person_id_or_email, key_type, key_value)