diff options
author | Filipp Lepalaan <filipp@mac.com> | 2016-03-21 18:04:13 +0200 |
---|---|---|
committer | Filipp Lepalaan <filipp@mac.com> | 2016-03-21 18:04:13 +0200 |
commit | c150e100f9a6cc3ba2168574afe74134009382a0 (patch) | |
tree | 96e3e6c7e648596a9c1bf1f2943a29d0da135540 /gsxws/comms.py | |
parent | cc38b441e308b709d6ee118d8f4d5aa50a7d05ed (diff) | |
parent | 5d5a8eae87bc7249ab01a63fadfd87f5e0739fe0 (diff) | |
download | py-gsxws-c150e100f9a6cc3ba2168574afe74134009382a0.tar.gz py-gsxws-c150e100f9a6cc3ba2168574afe74134009382a0.tar.bz2 py-gsxws-c150e100f9a6cc3ba2168574afe74134009382a0.zip |
Merge branch 'devel'
Diffstat (limited to 'gsxws/comms.py')
-rw-r--r-- | gsxws/comms.py | 42 |
1 files changed, 40 insertions, 2 deletions
diff --git a/gsxws/comms.py b/gsxws/comms.py index c2896fb..dc37e9b 100644 --- a/gsxws/comms.py +++ b/gsxws/comms.py @@ -4,14 +4,52 @@ from core import GsxObject class Communication(GsxObject): - def get_content(): + + _namespace = "glob:" + + def get_content(self): """ 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(): + def get_articles(self): """ The Fetch Communication Articles API allows the service partners to fetch all the active communication message IDs. """ + 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 ack(id, status): + ack = GsxObject(articleID=id) + ack.acknowledgeType = status + return Communication(acknowledgement=ack).acknowledge() + + +if __name__ == '__main__': + import sys + import doctest + from core import connect + logging.basicConfig(level=logging.DEBUG) + connect(*sys.argv[1:4]) + doctest.testmod() |