{"action":"created","comment":{"url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/comments/70262743","id":70262743,"diff_hunk":"@@ -0,0 +1,419 @@\n+import json\n+import http\n+import asyncio\n+\n+import logging\n+\n+from urllib.parse import urlparse\n+\n+from itertools import repeat\n+\n+from waterbutler.core import streams\n+from waterbutler.core import provider\n+from waterbutler.core import exceptions\n+#  from waterbutler.tasks.core import backgroundify\n+from waterbutler.core.path import WaterButlerPath\n+\n+from waterbutler.providers.onedrive import settings\n+from waterbutler.providers.onedrive.metadata import OneDriveRevision\n+from waterbutler.providers.onedrive.metadata import OneDriveFileMetadata\n+from waterbutler.providers.onedrive.metadata import OneDriveFolderMetadata\n+\n+logger = logging.getLogger(__name__)\n+\n+\n+class OneDriveProvider(provider.BaseProvider):\n+    \"\"\"Provider for the OneDrive cloud storage service.\n+\n+    API docs: https://dev.onedrive.com/README.htm\n+    \"\"\"\n+    NAME = 'onedrive'\n+    BASE_URL = settings.BASE_URL\n+\n+    def __init__(self, auth, credentials, settings):\n+        super().__init__(auth, credentials, settings)\n+        self.token = self.credentials['token']\n+        self.folder = self.settings['folder']\n+        logger.debug(\"__init__ credentials:{} settings:{}\".format(repr(credentials), repr(settings)))\n+\n+    async def validate_v1_path(self, path, **kwargs):\n+        if path == '/':\n+            return WaterButlerPath(path, prepend=self.folder)\n+\n+        logger.info('validate_v1_path self::{} path::{}  url:{}'.format(repr(self), repr(path), self.build_url(path)))\n+\n+        resp = await self.make_request(\n+            'GET', self.build_url(path),\n+            expects=(200, 400),\n+            throws=exceptions.MetadataError\n+        )\n+\n+        if resp.status == 400:\n+            return WaterButlerPath(path, prepend=self.folder)","path":"waterbutler/providers/onedrive/provider.py","position":52,"original_position":52,"commit_id":"485693c019a236fa131aefc7a068403352767fb8","original_commit_id":"485693c019a236fa131aefc7a068403352767fb8","user":{"login":"felliott","id":86835,"avatar_url":"https://avatars.githubusercontent.com/u/86835?v=3","gravatar_id":"","url":"https://api.github.com/users/felliott","html_url":"https://github.com/felliott","followers_url":"https://api.github.com/users/felliott/followers","following_url":"https://api.github.com/users/felliott/following{/other_user}","gists_url":"https://api.github.com/users/felliott/gists{/gist_id}","starred_url":"https://api.github.com/users/felliott/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/felliott/subscriptions","organizations_url":"https://api.github.com/users/felliott/orgs","repos_url":"https://api.github.com/users/felliott/repos","events_url":"https://api.github.com/users/felliott/events{/privacy}","received_events_url":"https://api.github.com/users/felliott/received_events","type":"User","site_admin":false},"body":"Need to release resp before returning.","created_at":"2016-07-11T14:02:24Z","updated_at":"2016-07-11T14:02:24Z","html_url":"https://github.com/CenterForOpenScience/waterbutler/pull/151#discussion_r70262743","pull_request_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/151","_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/comments/70262743"},"html":{"href":"https://github.com/CenterForOpenScience/waterbutler/pull/151#discussion_r70262743"},"pull_request":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/151"}}},"pull_request":{"url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/151","id":70538000,"html_url":"https://github.com/CenterForOpenScience/waterbutler/pull/151","diff_url":"https://github.com/CenterForOpenScience/waterbutler/pull/151.diff","patch_url":"https://github.com/CenterForOpenScience/waterbutler/pull/151.patch","issue_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/issues/151","number":151,"state":"open","locked":false,"title":"[CR] Waterbutler OneDrive Plugin","user":{"login":"caseyrygt","id":1401995,"avatar_url":"https://avatars.githubusercontent.com/u/1401995?v=3","gravatar_id":"","url":"https://api.github.com/users/caseyrygt","html_url":"https://github.com/caseyrygt","followers_url":"https://api.github.com/users/caseyrygt/followers","following_url":"https://api.github.com/users/caseyrygt/following{/other_user}","gists_url":"https://api.github.com/users/caseyrygt/gists{/gist_id}","starred_url":"https://api.github.com/users/caseyrygt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caseyrygt/subscriptions","organizations_url":"https://api.github.com/users/caseyrygt/orgs","repos_url":"https://api.github.com/users/caseyrygt/repos","events_url":"https://api.github.com/users/caseyrygt/events{/privacy}","received_events_url":"https://api.github.com/users/caseyrygt/received_events","type":"User","site_admin":false},"body":"@felliott: This is ready for you to review.\r\n\r\nCould you please review the copy functionality?  OneDrive's \"Copy\" function is asynchronous (the other methods are not) and requires the client to check the status of the copy job in order to know when it has completed.  If there's a better way than a for loop to check the OneDrive job status, please let me know.\r\n\r\nThanks!","created_at":"2016-05-18T14:29:10Z","updated_at":"2016-07-11T14:02:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4125607cd1dc3b74326bd438804d309bd6d8a8f4","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/151/commits","review_comments_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/151/comments","review_comment_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/comments{/number}","comments_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/issues/151/comments","statuses_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/statuses/485693c019a236fa131aefc7a068403352767fb8","head":{"label":"caseyrygt:feature/onedrive-provider-35","ref":"feature/onedrive-provider-35","sha":"485693c019a236fa131aefc7a068403352767fb8","user":{"login":"caseyrygt","id":1401995,"avatar_url":"https://avatars.githubusercontent.com/u/1401995?v=3","gravatar_id":"","url":"https://api.github.com/users/caseyrygt","html_url":"https://github.com/caseyrygt","followers_url":"https://api.github.com/users/caseyrygt/followers","following_url":"https://api.github.com/users/caseyrygt/following{/other_user}","gists_url":"https://api.github.com/users/caseyrygt/gists{/gist_id}","starred_url":"https://api.github.com/users/caseyrygt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caseyrygt/subscriptions","organizations_url":"https://api.github.com/users/caseyrygt/orgs","repos_url":"https://api.github.com/users/caseyrygt/repos","events_url":"https://api.github.com/users/caseyrygt/events{/privacy}","received_events_url":"https://api.github.com/users/caseyrygt/received_events","type":"User","site_admin":false},"repo":{"id":46805978,"name":"waterbutler","full_name":"caseyrygt/waterbutler","owner":{"login":"caseyrygt","id":1401995,"avatar_url":"https://avatars.githubusercontent.com/u/1401995?v=3","gravatar_id":"","url":"https://api.github.com/users/caseyrygt","html_url":"https://github.com/caseyrygt","followers_url":"https://api.github.com/users/caseyrygt/followers","following_url":"https://api.github.com/users/caseyrygt/following{/other_user}","gists_url":"https://api.github.com/users/caseyrygt/gists{/gist_id}","starred_url":"https://api.github.com/users/caseyrygt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/caseyrygt/subscriptions","organizations_url":"https://api.github.com/users/caseyrygt/orgs","repos_url":"https://api.github.com/users/caseyrygt/repos","events_url":"https://api.github.com/users/caseyrygt/events{/privacy}","received_events_url":"https://api.github.com/users/caseyrygt/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/caseyrygt/waterbutler","description":"WaterButler is a Python web application for interacting with various file storage services via a single RESTful API, developed at The Center for Open Science.","fork":true,"url":"https://api.github.com/repos/caseyrygt/waterbutler","forks_url":"https://api.github.com/repos/caseyrygt/waterbutler/forks","keys_url":"https://api.github.com/repos/caseyrygt/waterbutler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/caseyrygt/waterbutler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/caseyrygt/waterbutler/teams","hooks_url":"https://api.github.com/repos/caseyrygt/waterbutler/hooks","issue_events_url":"https://api.github.com/repos/caseyrygt/waterbutler/issues/events{/number}","events_url":"https://api.github.com/repos/caseyrygt/waterbutler/events","assignees_url":"https://api.github.com/repos/caseyrygt/waterbutler/assignees{/user}","branches_url":"https://api.github.com/repos/caseyrygt/waterbutler/branches{/branch}","tags_url":"https://api.github.com/repos/caseyrygt/waterbutler/tags","blobs_url":"https://api.github.com/repos/caseyrygt/waterbutler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/caseyrygt/waterbutler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/caseyrygt/waterbutler/git/refs{/sha}","trees_url":"https://api.github.com/repos/caseyrygt/waterbutler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/caseyrygt/waterbutler/statuses/{sha}","languages_url":"https://api.github.com/repos/caseyrygt/waterbutler/languages","stargazers_url":"https://api.github.com/repos/caseyrygt/waterbutler/stargazers","contributors_url":"https://api.github.com/repos/caseyrygt/waterbutler/contributors","subscribers_url":"https://api.github.com/repos/caseyrygt/waterbutler/subscribers","subscription_url":"https://api.github.com/repos/caseyrygt/waterbutler/subscription","commits_url":"https://api.github.com/repos/caseyrygt/waterbutler/commits{/sha}","git_commits_url":"https://api.github.com/repos/caseyrygt/waterbutler/git/commits{/sha}","comments_url":"https://api.github.com/repos/caseyrygt/waterbutler/comments{/number}","issue_comment_url":"https://api.github.com/repos/caseyrygt/waterbutler/issues/comments{/number}","contents_url":"https://api.github.com/repos/caseyrygt/waterbutler/contents/{+path}","compare_url":"https://api.github.com/repos/caseyrygt/waterbutler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/caseyrygt/waterbutler/merges","archive_url":"https://api.github.com/repos/caseyrygt/waterbutler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/caseyrygt/waterbutler/downloads","issues_url":"https://api.github.com/repos/caseyrygt/waterbutler/issues{/number}","pulls_url":"https://api.github.com/repos/caseyrygt/waterbutler/pulls{/number}","milestones_url":"https://api.github.com/repos/caseyrygt/waterbutler/milestones{/number}","notifications_url":"https://api.github.com/repos/caseyrygt/waterbutler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/caseyrygt/waterbutler/labels{/name}","releases_url":"https://api.github.com/repos/caseyrygt/waterbutler/releases{/id}","deployments_url":"https://api.github.com/repos/caseyrygt/waterbutler/deployments","created_at":"2015-11-24T17:02:05Z","updated_at":"2015-11-24T17:02:06Z","pushed_at":"2016-05-30T19:09:47Z","git_url":"git://github.com/caseyrygt/waterbutler.git","ssh_url":"git@github.com:caseyrygt/waterbutler.git","clone_url":"https://github.com/caseyrygt/waterbutler.git","svn_url":"https://github.com/caseyrygt/waterbutler","homepage":"http://waterbutler.io","size":2298,"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":"develop"}},"base":{"label":"CenterForOpenScience:develop","ref":"develop","sha":"60a6eb7f2dfce88b7a00457034c01b20da0aef23","user":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"repo":{"id":27130042,"name":"waterbutler","full_name":"CenterForOpenScience/waterbutler","owner":{"login":"CenterForOpenScience","id":3344584,"avatar_url":"https://avatars.githubusercontent.com/u/3344584?v=3","gravatar_id":"","url":"https://api.github.com/users/CenterForOpenScience","html_url":"https://github.com/CenterForOpenScience","followers_url":"https://api.github.com/users/CenterForOpenScience/followers","following_url":"https://api.github.com/users/CenterForOpenScience/following{/other_user}","gists_url":"https://api.github.com/users/CenterForOpenScience/gists{/gist_id}","starred_url":"https://api.github.com/users/CenterForOpenScience/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CenterForOpenScience/subscriptions","organizations_url":"https://api.github.com/users/CenterForOpenScience/orgs","repos_url":"https://api.github.com/users/CenterForOpenScience/repos","events_url":"https://api.github.com/users/CenterForOpenScience/events{/privacy}","received_events_url":"https://api.github.com/users/CenterForOpenScience/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/CenterForOpenScience/waterbutler","description":"WaterButler is a Python web application for interacting with various file storage services via a single RESTful API, developed at The Center for Open Science.","fork":false,"url":"https://api.github.com/repos/CenterForOpenScience/waterbutler","forks_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/forks","keys_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/keys{/key_id}","collaborators_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/teams","hooks_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/hooks","issue_events_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/issues/events{/number}","events_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/events","assignees_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/assignees{/user}","branches_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/branches{/branch}","tags_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/tags","blobs_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/git/refs{/sha}","trees_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/git/trees{/sha}","statuses_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/statuses/{sha}","languages_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/languages","stargazers_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/stargazers","contributors_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/contributors","subscribers_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/subscribers","subscription_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/subscription","commits_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/commits{/sha}","git_commits_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/git/commits{/sha}","comments_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/comments{/number}","issue_comment_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/issues/comments{/number}","contents_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/contents/{+path}","compare_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/compare/{base}...{head}","merges_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/merges","archive_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/downloads","issues_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/issues{/number}","pulls_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls{/number}","milestones_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/milestones{/number}","notifications_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/labels{/name}","releases_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/releases{/id}","deployments_url":"https://api.github.com/repos/CenterForOpenScience/waterbutler/deployments","created_at":"2014-11-25T14:42:31Z","updated_at":"2016-06-29T13:25:12Z","pushed_at":"2016-07-11T00:21:14Z","git_url":"git://github.com/CenterForOpenScience/waterbutler.git","ssh_url":"git@github.com:CenterForOpenScience/waterbutler.git","clone_url":"https://github.com/CenterForOpenScience/waterbutler.git","svn_url":"https://github.com/CenterForOpenScience/waterbutler","homepage":"http://waterbutler.io","size":2690,"stargazers_count":19,"watchers_count":19,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":51,"mirror_url":null,"open_issues_count":17,"forks":51,"open_issues":17,"watchers":19,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/151"},"html":{"href":"https://github.com/CenterForOpenScience/waterbutler/pull/151"},"issue":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/issues/151"},"comments":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/issues/151/comments"},"review_comments":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/151/comments"},"review_comment":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/pulls/151/commits"},"statuses":{"href":"https://api.github.com/repos/CenterForOpenScience/waterbutler/statuses/485693c019a236fa131aefc7a068403352767fb8"}}}}
{"actor":{"display_login":"felliott"}}