{"action":"created","comment":{"url":"https://api.github.com/repos/box/box-python-sdk/pulls/comments/33973911","id":33973911,"diff_hunk":"@@ -0,0 +1,127 @@\n+# coding: utf-8\n+\n+from __future__ import unicode_literals\n+from mock import call, patch\n+import pytest\n+from boxsdk.config import API\n+from boxsdk.object.group_membership import GroupMembership\n+from boxsdk.object.user import User\n+\n+\n+@pytest.fixture\n+def box_api_headers(mock_user_id, access_token):","path":"test/integration/test_as_user.py","position":12,"original_position":12,"commit_id":"5cbc924836e3724c4d6973ac59b62d7741b0fa49","original_commit_id":"5cbc924836e3724c4d6973ac59b62d7741b0fa49","user":{"login":"aptxkid","id":941406,"avatar_url":"https://avatars.githubusercontent.com/u/941406?v=3","gravatar_id":"","url":"https://api.github.com/users/aptxkid","html_url":"https://github.com/aptxkid","followers_url":"https://api.github.com/users/aptxkid/followers","following_url":"https://api.github.com/users/aptxkid/following{/other_user}","gists_url":"https://api.github.com/users/aptxkid/gists{/gist_id}","starred_url":"https://api.github.com/users/aptxkid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aptxkid/subscriptions","organizations_url":"https://api.github.com/users/aptxkid/orgs","repos_url":"https://api.github.com/users/aptxkid/repos","events_url":"https://api.github.com/users/aptxkid/events{/privacy}","received_events_url":"https://api.github.com/users/aptxkid/received_events","type":"User","site_admin":false},"body":"How about renaming this fixture to indicate that it has the as-user header?","created_at":"2015-07-06T19:43:23Z","updated_at":"2015-07-06T19:43:23Z","html_url":"https://github.com/box/box-python-sdk/pull/54#discussion_r33973911","pull_request_url":"https://api.github.com/repos/box/box-python-sdk/pulls/54","_links":{"self":{"href":"https://api.github.com/repos/box/box-python-sdk/pulls/comments/33973911"},"html":{"href":"https://github.com/box/box-python-sdk/pull/54#discussion_r33973911"},"pull_request":{"href":"https://api.github.com/repos/box/box-python-sdk/pulls/54"}}},"pull_request":{"url":"https://api.github.com/repos/box/box-python-sdk/pulls/54","id":39130595,"html_url":"https://github.com/box/box-python-sdk/pull/54","diff_url":"https://github.com/box/box-python-sdk/pull/54.diff","patch_url":"https://github.com/box/box-python-sdk/pull/54.patch","issue_url":"https://api.github.com/repos/box/box-python-sdk/issues/54","number":54,"state":"open","locked":false,"title":"Add support for As-User and shared items headers.","user":{"login":"Jeff-Meadows","id":3839339,"avatar_url":"https://avatars.githubusercontent.com/u/3839339?v=3","gravatar_id":"","url":"https://api.github.com/users/Jeff-Meadows","html_url":"https://github.com/Jeff-Meadows","followers_url":"https://api.github.com/users/Jeff-Meadows/followers","following_url":"https://api.github.com/users/Jeff-Meadows/following{/other_user}","gists_url":"https://api.github.com/users/Jeff-Meadows/gists{/gist_id}","starred_url":"https://api.github.com/users/Jeff-Meadows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jeff-Meadows/subscriptions","organizations_url":"https://api.github.com/users/Jeff-Meadows/orgs","repos_url":"https://api.github.com/users/Jeff-Meadows/repos","events_url":"https://api.github.com/users/Jeff-Meadows/events{/privacy}","received_events_url":"https://api.github.com/users/Jeff-Meadows/received_events","type":"User","site_admin":false},"body":"The Box API supports enterprise admins making requests as users via the As-User header.\r\nIt also supports gaining access to items via a shared link via the BoxApi: shared_link= header.\r\n\r\nThis commit adds an `as_user` and `with_shared_link` method to the SDK client, session, and endpoint objects\r\nto support a fluent interface for adding the appropriate headers to requests.\r\n\r\nFor example, to get user with id 1234's root folder info:\r\n    client.as_user(User('1234')).folder('0').get()","created_at":"2015-07-02T22:07:10Z","updated_at":"2015-07-06T19:43:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3082fae7b20e93e277b430ee17827af3ce24371a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/box/box-python-sdk/pulls/54/commits","review_comments_url":"https://api.github.com/repos/box/box-python-sdk/pulls/54/comments","review_comment_url":"https://api.github.com/repos/box/box-python-sdk/pulls/comments{/number}","comments_url":"https://api.github.com/repos/box/box-python-sdk/issues/54/comments","statuses_url":"https://api.github.com/repos/box/box-python-sdk/statuses/5cbc924836e3724c4d6973ac59b62d7741b0fa49","head":{"label":"box:headers","ref":"headers","sha":"5cbc924836e3724c4d6973ac59b62d7741b0fa49","user":{"login":"box","id":23900,"avatar_url":"https://avatars.githubusercontent.com/u/23900?v=3","gravatar_id":"","url":"https://api.github.com/users/box","html_url":"https://github.com/box","followers_url":"https://api.github.com/users/box/followers","following_url":"https://api.github.com/users/box/following{/other_user}","gists_url":"https://api.github.com/users/box/gists{/gist_id}","starred_url":"https://api.github.com/users/box/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/box/subscriptions","organizations_url":"https://api.github.com/users/box/orgs","repos_url":"https://api.github.com/users/box/repos","events_url":"https://api.github.com/users/box/events{/privacy}","received_events_url":"https://api.github.com/users/box/received_events","type":"Organization","site_admin":false},"repo":{"id":30386388,"name":"box-python-sdk","full_name":"box/box-python-sdk","owner":{"login":"box","id":23900,"avatar_url":"https://avatars.githubusercontent.com/u/23900?v=3","gravatar_id":"","url":"https://api.github.com/users/box","html_url":"https://github.com/box","followers_url":"https://api.github.com/users/box/followers","following_url":"https://api.github.com/users/box/following{/other_user}","gists_url":"https://api.github.com/users/box/gists{/gist_id}","starred_url":"https://api.github.com/users/box/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/box/subscriptions","organizations_url":"https://api.github.com/users/box/orgs","repos_url":"https://api.github.com/users/box/repos","events_url":"https://api.github.com/users/box/events{/privacy}","received_events_url":"https://api.github.com/users/box/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/box/box-python-sdk","description":"Box SDK for Python","fork":false,"url":"https://api.github.com/repos/box/box-python-sdk","forks_url":"https://api.github.com/repos/box/box-python-sdk/forks","keys_url":"https://api.github.com/repos/box/box-python-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/box/box-python-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/box/box-python-sdk/teams","hooks_url":"https://api.github.com/repos/box/box-python-sdk/hooks","issue_events_url":"https://api.github.com/repos/box/box-python-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/box/box-python-sdk/events","assignees_url":"https://api.github.com/repos/box/box-python-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/box/box-python-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/box/box-python-sdk/tags","blobs_url":"https://api.github.com/repos/box/box-python-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/box/box-python-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/box/box-python-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/box/box-python-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/box/box-python-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/box/box-python-sdk/languages","stargazers_url":"https://api.github.com/repos/box/box-python-sdk/stargazers","contributors_url":"https://api.github.com/repos/box/box-python-sdk/contributors","subscribers_url":"https://api.github.com/repos/box/box-python-sdk/subscribers","subscription_url":"https://api.github.com/repos/box/box-python-sdk/subscription","commits_url":"https://api.github.com/repos/box/box-python-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/box/box-python-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/box/box-python-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/box/box-python-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/box/box-python-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/box/box-python-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/box/box-python-sdk/merges","archive_url":"https://api.github.com/repos/box/box-python-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/box/box-python-sdk/downloads","issues_url":"https://api.github.com/repos/box/box-python-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/box/box-python-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/box/box-python-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/box/box-python-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/box/box-python-sdk/labels{/name}","releases_url":"https://api.github.com/repos/box/box-python-sdk/releases{/id}","created_at":"2015-02-06T00:30:55Z","updated_at":"2015-06-29T17:32:05Z","pushed_at":"2015-07-02T22:31:29Z","git_url":"git://github.com/box/box-python-sdk.git","ssh_url":"git@github.com:box/box-python-sdk.git","clone_url":"https://github.com/box/box-python-sdk.git","svn_url":"https://github.com/box/box-python-sdk","homepage":"http://opensource.box.com/box-python-sdk/","size":2836,"stargazers_count":39,"watchers_count":39,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":17,"mirror_url":null,"open_issues_count":15,"forks":17,"open_issues":15,"watchers":39,"default_branch":"master"}},"base":{"label":"box:master","ref":"master","sha":"90e9af5e7d3ef2e5a48e51f55055f7bf7ecce835","user":{"login":"box","id":23900,"avatar_url":"https://avatars.githubusercontent.com/u/23900?v=3","gravatar_id":"","url":"https://api.github.com/users/box","html_url":"https://github.com/box","followers_url":"https://api.github.com/users/box/followers","following_url":"https://api.github.com/users/box/following{/other_user}","gists_url":"https://api.github.com/users/box/gists{/gist_id}","starred_url":"https://api.github.com/users/box/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/box/subscriptions","organizations_url":"https://api.github.com/users/box/orgs","repos_url":"https://api.github.com/users/box/repos","events_url":"https://api.github.com/users/box/events{/privacy}","received_events_url":"https://api.github.com/users/box/received_events","type":"Organization","site_admin":false},"repo":{"id":30386388,"name":"box-python-sdk","full_name":"box/box-python-sdk","owner":{"login":"box","id":23900,"avatar_url":"https://avatars.githubusercontent.com/u/23900?v=3","gravatar_id":"","url":"https://api.github.com/users/box","html_url":"https://github.com/box","followers_url":"https://api.github.com/users/box/followers","following_url":"https://api.github.com/users/box/following{/other_user}","gists_url":"https://api.github.com/users/box/gists{/gist_id}","starred_url":"https://api.github.com/users/box/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/box/subscriptions","organizations_url":"https://api.github.com/users/box/orgs","repos_url":"https://api.github.com/users/box/repos","events_url":"https://api.github.com/users/box/events{/privacy}","received_events_url":"https://api.github.com/users/box/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/box/box-python-sdk","description":"Box SDK for Python","fork":false,"url":"https://api.github.com/repos/box/box-python-sdk","forks_url":"https://api.github.com/repos/box/box-python-sdk/forks","keys_url":"https://api.github.com/repos/box/box-python-sdk/keys{/key_id}","collaborators_url":"https://api.github.com/repos/box/box-python-sdk/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/box/box-python-sdk/teams","hooks_url":"https://api.github.com/repos/box/box-python-sdk/hooks","issue_events_url":"https://api.github.com/repos/box/box-python-sdk/issues/events{/number}","events_url":"https://api.github.com/repos/box/box-python-sdk/events","assignees_url":"https://api.github.com/repos/box/box-python-sdk/assignees{/user}","branches_url":"https://api.github.com/repos/box/box-python-sdk/branches{/branch}","tags_url":"https://api.github.com/repos/box/box-python-sdk/tags","blobs_url":"https://api.github.com/repos/box/box-python-sdk/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/box/box-python-sdk/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/box/box-python-sdk/git/refs{/sha}","trees_url":"https://api.github.com/repos/box/box-python-sdk/git/trees{/sha}","statuses_url":"https://api.github.com/repos/box/box-python-sdk/statuses/{sha}","languages_url":"https://api.github.com/repos/box/box-python-sdk/languages","stargazers_url":"https://api.github.com/repos/box/box-python-sdk/stargazers","contributors_url":"https://api.github.com/repos/box/box-python-sdk/contributors","subscribers_url":"https://api.github.com/repos/box/box-python-sdk/subscribers","subscription_url":"https://api.github.com/repos/box/box-python-sdk/subscription","commits_url":"https://api.github.com/repos/box/box-python-sdk/commits{/sha}","git_commits_url":"https://api.github.com/repos/box/box-python-sdk/git/commits{/sha}","comments_url":"https://api.github.com/repos/box/box-python-sdk/comments{/number}","issue_comment_url":"https://api.github.com/repos/box/box-python-sdk/issues/comments{/number}","contents_url":"https://api.github.com/repos/box/box-python-sdk/contents/{+path}","compare_url":"https://api.github.com/repos/box/box-python-sdk/compare/{base}...{head}","merges_url":"https://api.github.com/repos/box/box-python-sdk/merges","archive_url":"https://api.github.com/repos/box/box-python-sdk/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/box/box-python-sdk/downloads","issues_url":"https://api.github.com/repos/box/box-python-sdk/issues{/number}","pulls_url":"https://api.github.com/repos/box/box-python-sdk/pulls{/number}","milestones_url":"https://api.github.com/repos/box/box-python-sdk/milestones{/number}","notifications_url":"https://api.github.com/repos/box/box-python-sdk/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/box/box-python-sdk/labels{/name}","releases_url":"https://api.github.com/repos/box/box-python-sdk/releases{/id}","created_at":"2015-02-06T00:30:55Z","updated_at":"2015-06-29T17:32:05Z","pushed_at":"2015-07-02T22:31:29Z","git_url":"git://github.com/box/box-python-sdk.git","ssh_url":"git@github.com:box/box-python-sdk.git","clone_url":"https://github.com/box/box-python-sdk.git","svn_url":"https://github.com/box/box-python-sdk","homepage":"http://opensource.box.com/box-python-sdk/","size":2836,"stargazers_count":39,"watchers_count":39,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":17,"mirror_url":null,"open_issues_count":15,"forks":17,"open_issues":15,"watchers":39,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/box/box-python-sdk/pulls/54"},"html":{"href":"https://github.com/box/box-python-sdk/pull/54"},"issue":{"href":"https://api.github.com/repos/box/box-python-sdk/issues/54"},"comments":{"href":"https://api.github.com/repos/box/box-python-sdk/issues/54/comments"},"review_comments":{"href":"https://api.github.com/repos/box/box-python-sdk/pulls/54/comments"},"review_comment":{"href":"https://api.github.com/repos/box/box-python-sdk/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/box/box-python-sdk/pulls/54/commits"},"statuses":{"href":"https://api.github.com/repos/box/box-python-sdk/statuses/5cbc924836e3724c4d6973ac59b62d7741b0fa49"}}}}