{"action":"created","comment":{"url":"https://api.github.com/repos/messagemedia/messagemedia-python/pulls/comments/53307280","id":53307280,"diff_hunk":"@@ -1,41 +1,158 @@\n \"\"\"\n-    Copyright 2014 MessageMedia\n-    Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n-    use this file except in compliance with the License.\n-    You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n-\n-    Unless required by applicable law or agreed to in writing, software\n-    distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n-    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n-    See the License for the specific language governing permissions and\n-    limitations under the License.\n+Copyright 2014-2016 MessageMedia\n+Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\n+use this file except in compliance with the License.\n+You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n+WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n \"\"\"\n \n import mmsoap\n import os\n import tempfile\n+from datetime import datetime, timedelta\n+\n+user = 'your-userId'\n+password = 'your-password'\n \n # Create client, specifying cache_location (e.g. /tmp/mmsoap for Linux or C:/temp/mmsoap for Windows)\n-client = mmsoap.MMSoapClient(\"your-userId\", \"your-password\", cache_location=os.path.join(tempfile.gettempdir(), 'mmsoap'))\n-\n-# Check the user\n-print \"Check User\"\n-details = client.check_user()\n-print \"Credit limit: %d / Credit remaining: %d\" % (details._creditLimit, details._creditRemaining)\n-\n-# Send messages\n-print \"Send Messages\"\n-result = client.send_messages([\"+61412345678\"], \"Hello from messagemedia-python!\")\n-print \"Sent %d messages, scheduled %d messages, %d messages failed\" % (result._sent, result._scheduled, result._failed)\n-\n-# Check for replies\n-print \"Replies\"\n-replies = client.check_replies()\n-\n-for reply in replies:\n-    print reply.content\n-    if raw_input(\"Confirm reply? (y/N): \").lower() == \"y\":\n-        if client.confirm_replies([reply._receiptId])._confirmed == 1:\n-            print \"Reply confirmed.\"\n-        else:\n-            print \"Reply could not be confirmed.\"\n+client = mmsoap.MMSoapClient(user, password,","path":"sample.py","position":56,"original_position":56,"commit_id":"c7ed460a02141ee717babe824fc95ae6aa73db7f","original_commit_id":"c7ed460a02141ee717babe824fc95ae6aa73db7f","user":{"login":"leighwaller","id":17287062,"avatar_url":"https://avatars.githubusercontent.com/u/17287062?v=3","gravatar_id":"","url":"https://api.github.com/users/leighwaller","html_url":"https://github.com/leighwaller","followers_url":"https://api.github.com/users/leighwaller/followers","following_url":"https://api.github.com/users/leighwaller/following{/other_user}","gists_url":"https://api.github.com/users/leighwaller/gists{/gist_id}","starred_url":"https://api.github.com/users/leighwaller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leighwaller/subscriptions","organizations_url":"https://api.github.com/users/leighwaller/orgs","repos_url":"https://api.github.com/users/leighwaller/repos","events_url":"https://api.github.com/users/leighwaller/events{/privacy}","received_events_url":"https://api.github.com/users/leighwaller/received_events","type":"User","site_admin":false},"body":"What are your thoughts on creating this client in each function definition so they are more standalone full examples?\r\nThe ruby client follows this approach which sort of makes sense because the example start to finish is contained in the method.","created_at":"2016-02-18T12:30:43Z","updated_at":"2016-02-18T12:30:43Z","html_url":"https://github.com/messagemedia/messagemedia-python/pull/7#discussion_r53307280","pull_request_url":"https://api.github.com/repos/messagemedia/messagemedia-python/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/messagemedia/messagemedia-python/pulls/comments/53307280"},"html":{"href":"https://github.com/messagemedia/messagemedia-python/pull/7#discussion_r53307280"},"pull_request":{"href":"https://api.github.com/repos/messagemedia/messagemedia-python/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/messagemedia/messagemedia-python/pulls/7","id":59743514,"html_url":"https://github.com/messagemedia/messagemedia-python/pull/7","diff_url":"https://github.com/messagemedia/messagemedia-python/pull/7.diff","patch_url":"https://github.com/messagemedia/messagemedia-python/pull/7.patch","issue_url":"https://api.github.com/repos/messagemedia/messagemedia-python/issues/7","number":7,"state":"open","locked":false,"title":"Implement missing endpoints and add examples","user":{"login":"leighwaller","id":17287062,"avatar_url":"https://avatars.githubusercontent.com/u/17287062?v=3","gravatar_id":"","url":"https://api.github.com/users/leighwaller","html_url":"https://github.com/leighwaller","followers_url":"https://api.github.com/users/leighwaller/followers","following_url":"https://api.github.com/users/leighwaller/following{/other_user}","gists_url":"https://api.github.com/users/leighwaller/gists{/gist_id}","starred_url":"https://api.github.com/users/leighwaller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leighwaller/subscriptions","organizations_url":"https://api.github.com/users/leighwaller/orgs","repos_url":"https://api.github.com/users/leighwaller/repos","events_url":"https://api.github.com/users/leighwaller/events{/privacy}","received_events_url":"https://api.github.com/users/leighwaller/received_events","type":"User","site_admin":false},"body":"Added more documentation","created_at":"2016-02-18T02:48:38Z","updated_at":"2016-02-18T12:30:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0af03c531c4857cff20ae31ef2cde4ab0ba75241","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/messagemedia/messagemedia-python/pulls/7/commits","review_comments_url":"https://api.github.com/repos/messagemedia/messagemedia-python/pulls/7/comments","review_comment_url":"https://api.github.com/repos/messagemedia/messagemedia-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/messagemedia/messagemedia-python/issues/7/comments","statuses_url":"https://api.github.com/repos/messagemedia/messagemedia-python/statuses/c7ed460a02141ee717babe824fc95ae6aa73db7f","head":{"label":"leighwaller:feature-ASIT-59","ref":"feature-ASIT-59","sha":"c7ed460a02141ee717babe824fc95ae6aa73db7f","user":{"login":"leighwaller","id":17287062,"avatar_url":"https://avatars.githubusercontent.com/u/17287062?v=3","gravatar_id":"","url":"https://api.github.com/users/leighwaller","html_url":"https://github.com/leighwaller","followers_url":"https://api.github.com/users/leighwaller/followers","following_url":"https://api.github.com/users/leighwaller/following{/other_user}","gists_url":"https://api.github.com/users/leighwaller/gists{/gist_id}","starred_url":"https://api.github.com/users/leighwaller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leighwaller/subscriptions","organizations_url":"https://api.github.com/users/leighwaller/orgs","repos_url":"https://api.github.com/users/leighwaller/repos","events_url":"https://api.github.com/users/leighwaller/events{/privacy}","received_events_url":"https://api.github.com/users/leighwaller/received_events","type":"User","site_admin":false},"repo":{"id":51898867,"name":"messagemedia-python","full_name":"leighwaller/messagemedia-python","owner":{"login":"leighwaller","id":17287062,"avatar_url":"https://avatars.githubusercontent.com/u/17287062?v=3","gravatar_id":"","url":"https://api.github.com/users/leighwaller","html_url":"https://github.com/leighwaller","followers_url":"https://api.github.com/users/leighwaller/followers","following_url":"https://api.github.com/users/leighwaller/following{/other_user}","gists_url":"https://api.github.com/users/leighwaller/gists{/gist_id}","starred_url":"https://api.github.com/users/leighwaller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leighwaller/subscriptions","organizations_url":"https://api.github.com/users/leighwaller/orgs","repos_url":"https://api.github.com/users/leighwaller/repos","events_url":"https://api.github.com/users/leighwaller/events{/privacy}","received_events_url":"https://api.github.com/users/leighwaller/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/leighwaller/messagemedia-python","description":"Sample Python code demonstrating how to send a SMS/Text message with the MessageMedia SOAP API","fork":true,"url":"https://api.github.com/repos/leighwaller/messagemedia-python","forks_url":"https://api.github.com/repos/leighwaller/messagemedia-python/forks","keys_url":"https://api.github.com/repos/leighwaller/messagemedia-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/leighwaller/messagemedia-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/leighwaller/messagemedia-python/teams","hooks_url":"https://api.github.com/repos/leighwaller/messagemedia-python/hooks","issue_events_url":"https://api.github.com/repos/leighwaller/messagemedia-python/issues/events{/number}","events_url":"https://api.github.com/repos/leighwaller/messagemedia-python/events","assignees_url":"https://api.github.com/repos/leighwaller/messagemedia-python/assignees{/user}","branches_url":"https://api.github.com/repos/leighwaller/messagemedia-python/branches{/branch}","tags_url":"https://api.github.com/repos/leighwaller/messagemedia-python/tags","blobs_url":"https://api.github.com/repos/leighwaller/messagemedia-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/leighwaller/messagemedia-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/leighwaller/messagemedia-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/leighwaller/messagemedia-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/leighwaller/messagemedia-python/statuses/{sha}","languages_url":"https://api.github.com/repos/leighwaller/messagemedia-python/languages","stargazers_url":"https://api.github.com/repos/leighwaller/messagemedia-python/stargazers","contributors_url":"https://api.github.com/repos/leighwaller/messagemedia-python/contributors","subscribers_url":"https://api.github.com/repos/leighwaller/messagemedia-python/subscribers","subscription_url":"https://api.github.com/repos/leighwaller/messagemedia-python/subscription","commits_url":"https://api.github.com/repos/leighwaller/messagemedia-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/leighwaller/messagemedia-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/leighwaller/messagemedia-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/leighwaller/messagemedia-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/leighwaller/messagemedia-python/contents/{+path}","compare_url":"https://api.github.com/repos/leighwaller/messagemedia-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/leighwaller/messagemedia-python/merges","archive_url":"https://api.github.com/repos/leighwaller/messagemedia-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/leighwaller/messagemedia-python/downloads","issues_url":"https://api.github.com/repos/leighwaller/messagemedia-python/issues{/number}","pulls_url":"https://api.github.com/repos/leighwaller/messagemedia-python/pulls{/number}","milestones_url":"https://api.github.com/repos/leighwaller/messagemedia-python/milestones{/number}","notifications_url":"https://api.github.com/repos/leighwaller/messagemedia-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/leighwaller/messagemedia-python/labels{/name}","releases_url":"https://api.github.com/repos/leighwaller/messagemedia-python/releases{/id}","deployments_url":"https://api.github.com/repos/leighwaller/messagemedia-python/deployments","created_at":"2016-02-17T06:01:58Z","updated_at":"2016-02-17T06:01:59Z","pushed_at":"2016-02-18T07:30:43Z","git_url":"git://github.com/leighwaller/messagemedia-python.git","ssh_url":"git@github.com:leighwaller/messagemedia-python.git","clone_url":"https://github.com/leighwaller/messagemedia-python.git","svn_url":"https://github.com/leighwaller/messagemedia-python","homepage":"www.messagemedia.com.au","size":33,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"messagemedia:master","ref":"master","sha":"1c865dcb0920ecfc266e46e74bf775302f632b92","user":{"login":"messagemedia","id":7088446,"avatar_url":"https://avatars.githubusercontent.com/u/7088446?v=3","gravatar_id":"","url":"https://api.github.com/users/messagemedia","html_url":"https://github.com/messagemedia","followers_url":"https://api.github.com/users/messagemedia/followers","following_url":"https://api.github.com/users/messagemedia/following{/other_user}","gists_url":"https://api.github.com/users/messagemedia/gists{/gist_id}","starred_url":"https://api.github.com/users/messagemedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/messagemedia/subscriptions","organizations_url":"https://api.github.com/users/messagemedia/orgs","repos_url":"https://api.github.com/users/messagemedia/repos","events_url":"https://api.github.com/users/messagemedia/events{/privacy}","received_events_url":"https://api.github.com/users/messagemedia/received_events","type":"Organization","site_admin":false},"repo":{"id":18549069,"name":"messagemedia-python","full_name":"messagemedia/messagemedia-python","owner":{"login":"messagemedia","id":7088446,"avatar_url":"https://avatars.githubusercontent.com/u/7088446?v=3","gravatar_id":"","url":"https://api.github.com/users/messagemedia","html_url":"https://github.com/messagemedia","followers_url":"https://api.github.com/users/messagemedia/followers","following_url":"https://api.github.com/users/messagemedia/following{/other_user}","gists_url":"https://api.github.com/users/messagemedia/gists{/gist_id}","starred_url":"https://api.github.com/users/messagemedia/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/messagemedia/subscriptions","organizations_url":"https://api.github.com/users/messagemedia/orgs","repos_url":"https://api.github.com/users/messagemedia/repos","events_url":"https://api.github.com/users/messagemedia/events{/privacy}","received_events_url":"https://api.github.com/users/messagemedia/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/messagemedia/messagemedia-python","description":"Sample Python code demonstrating how to send a SMS/Text message with the MessageMedia SOAP API","fork":false,"url":"https://api.github.com/repos/messagemedia/messagemedia-python","forks_url":"https://api.github.com/repos/messagemedia/messagemedia-python/forks","keys_url":"https://api.github.com/repos/messagemedia/messagemedia-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/messagemedia/messagemedia-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/messagemedia/messagemedia-python/teams","hooks_url":"https://api.github.com/repos/messagemedia/messagemedia-python/hooks","issue_events_url":"https://api.github.com/repos/messagemedia/messagemedia-python/issues/events{/number}","events_url":"https://api.github.com/repos/messagemedia/messagemedia-python/events","assignees_url":"https://api.github.com/repos/messagemedia/messagemedia-python/assignees{/user}","branches_url":"https://api.github.com/repos/messagemedia/messagemedia-python/branches{/branch}","tags_url":"https://api.github.com/repos/messagemedia/messagemedia-python/tags","blobs_url":"https://api.github.com/repos/messagemedia/messagemedia-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/messagemedia/messagemedia-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/messagemedia/messagemedia-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/messagemedia/messagemedia-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/messagemedia/messagemedia-python/statuses/{sha}","languages_url":"https://api.github.com/repos/messagemedia/messagemedia-python/languages","stargazers_url":"https://api.github.com/repos/messagemedia/messagemedia-python/stargazers","contributors_url":"https://api.github.com/repos/messagemedia/messagemedia-python/contributors","subscribers_url":"https://api.github.com/repos/messagemedia/messagemedia-python/subscribers","subscription_url":"https://api.github.com/repos/messagemedia/messagemedia-python/subscription","commits_url":"https://api.github.com/repos/messagemedia/messagemedia-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/messagemedia/messagemedia-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/messagemedia/messagemedia-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/messagemedia/messagemedia-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/messagemedia/messagemedia-python/contents/{+path}","compare_url":"https://api.github.com/repos/messagemedia/messagemedia-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/messagemedia/messagemedia-python/merges","archive_url":"https://api.github.com/repos/messagemedia/messagemedia-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/messagemedia/messagemedia-python/downloads","issues_url":"https://api.github.com/repos/messagemedia/messagemedia-python/issues{/number}","pulls_url":"https://api.github.com/repos/messagemedia/messagemedia-python/pulls{/number}","milestones_url":"https://api.github.com/repos/messagemedia/messagemedia-python/milestones{/number}","notifications_url":"https://api.github.com/repos/messagemedia/messagemedia-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/messagemedia/messagemedia-python/labels{/name}","releases_url":"https://api.github.com/repos/messagemedia/messagemedia-python/releases{/id}","deployments_url":"https://api.github.com/repos/messagemedia/messagemedia-python/deployments","created_at":"2014-04-08T07:24:27Z","updated_at":"2016-02-03T01:31:34Z","pushed_at":"2016-02-18T07:30:43Z","git_url":"git://github.com/messagemedia/messagemedia-python.git","ssh_url":"git@github.com:messagemedia/messagemedia-python.git","clone_url":"https://github.com/messagemedia/messagemedia-python.git","svn_url":"https://github.com/messagemedia/messagemedia-python","homepage":"www.messagemedia.com.au","size":262,"stargazers_count":2,"watchers_count":2,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":1,"forks":2,"open_issues":1,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/messagemedia/messagemedia-python/pulls/7"},"html":{"href":"https://github.com/messagemedia/messagemedia-python/pull/7"},"issue":{"href":"https://api.github.com/repos/messagemedia/messagemedia-python/issues/7"},"comments":{"href":"https://api.github.com/repos/messagemedia/messagemedia-python/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/messagemedia/messagemedia-python/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/messagemedia/messagemedia-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/messagemedia/messagemedia-python/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/messagemedia/messagemedia-python/statuses/c7ed460a02141ee717babe824fc95ae6aa73db7f"}}}}