aboutsummaryrefslogtreecommitdiffstats
path: root/gsxws
diff options
context:
space:
mode:
authorFilipp Lepalaan <filipp@mac.com>2016-03-21 17:59:36 +0200
committerFilipp Lepalaan <filipp@mac.com>2016-03-21 17:59:36 +0200
commit5d5a8eae87bc7249ab01a63fadfd87f5e0739fe0 (patch)
tree96e3e6c7e648596a9c1bf1f2943a29d0da135540 /gsxws
parentba5574f5674138c3332f4220951d8e51d560dc1e (diff)
downloadpy-gsxws-5d5a8eae87bc7249ab01a63fadfd87f5e0739fe0.tar.gz
py-gsxws-5d5a8eae87bc7249ab01a63fadfd87f5e0739fe0.tar.bz2
py-gsxws-5d5a8eae87bc7249ab01a63fadfd87f5e0739fe0.zip
Fixed comms
Diffstat (limited to 'gsxws')
-rw-r--r--gsxws/comms.py30
1 files changed, 24 insertions, 6 deletions
diff --git a/gsxws/comms.py b/gsxws/comms.py
index 6a9bf4f..dc37e9b 100644
--- a/gsxws/comms.py
+++ b/gsxws/comms.py
@@ -12,20 +12,38 @@ class Communication(GsxObject):
The Fetch Communication Content API allows the service providers/depot/carriers
to fetch the communication content by article ID from the service news channel.
"""
+ return self._submit("lookupRequestData", "FetchCommunicationContent",
+ "communicationMessage")
def get_articles(self):
"""
The Fetch Communication Articles API allows the service partners
to fetch all the active communication message IDs.
"""
- doc = self._submit("lookupRequestData", "FetchCommunicationArticles",
- "communicationMessage")
- print(doc)
+ return self._submit("lookupRequestData", "FetchCommunicationArticles",
+ "communicationMessage")
+
+ def acknowledge(self):
+ """
+ The Acknowledge Communication API allows the service providers/depot/carriers to
+ update the status as Read/UnRead.
+ """
+ return self._submit("communicationRequest", "AcknowledgeCommunication",
+ "communicationResponse")
+
+
+def fetch(**kwargs):
+ return Communication(**kwargs).get_articles()
+
+
+def content(id):
+ return Communication(articleID=id).get_content()
-def fetch():
- """Shortcut for fetching CompTIA data from GSX"""
- return Communication(priority="HIGH", readStatus=True).get_articles()
+def ack(id, status):
+ ack = GsxObject(articleID=id)
+ ack.acknowledgeType = status
+ return Communication(acknowledgement=ack).acknowledge()
if __name__ == '__main__':