# Copyright 2015 cybojenix <anthonydking@slimroms.net>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#    http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

from __future__ import absolute_import

from ..base import XdaBase


class Pms(XdaBase):
    pass

@@ -665,35 +665,910 @@
 ase%0A
-%0A%0Aclass Pms(XdaBase):%0A    pass%0A
+from ..model.pm import Pm as PmModel%0A%0A%0Aclass Pms(XdaBase):%0A    def __init__(self, xda):%0A        super(Pms, self).__init__(xda)%0A        self.api = self.xda.api.pms%0A%0A    def inbox(self, page=1, unread_only=False):%0A        data = self.api.inbox(page=page, unread_only=unread_only)%0A        data = data.get('results', %5B%5D)%0A        return (PmModel(d) for d in data)%0A%0A    def sent(self, page=1):%0A        data = self.api.sent(page=page)%0A        data = data.get('results', %5B%5D)%0A        return (PmModel(d) for d in data)%0A%0A    # TODO: see forums TODO message regarding handling this data%0A%0A    def send(self, username, subject, message):%0A        return self.api.send(username, subject, message)%0A%0A    def mark_read(self, pm_id):%0A        return self.api.mark_read(pm_id)%0A%0A    def mark_unread(self, pm_id):%0A        return self.api.mark_unread(pm_id)%0A%0A    def delete_pm(self, pm_id):%0A        return self.api.delete_pm(pm_id)

add pms entries