8d45af629ceb8fc0e96d7877f7c3bd7f1f78aae4
[plcapi.git] / PLC / Methods / GetMessages.py
1 from PLC.Faults import *
2 from PLC.Method import Method
3 from PLC.Parameter import Parameter
4 from PLC.Messages import Message, Messages
5 from PLC.Auth import Auth
6
7 class GetMessages(Method):
8     """
9     Return an array of structs containing details about message
10     templates. If message_ids is specified, only the specified
11     messages will be queried.
12     """
13
14     roles = ['admin']
15
16     accepts = [
17         Auth(),
18         [Message.fields['message_id']],
19         ]
20
21     returns = [Message.fields]
22
23
24     def call(self, auth, message_ids = None):
25         return Messages(self.api, message_ids)