{"action":"created","comment":{"url":"https://api.github.com/repos/google/google-api-python-client/pulls/comments/37602218","id":37602218,"diff_hunk":"@@ -185,22 +190,60 @@ def build(serviceName,\n \n   requested_url = uritemplate.expand(discoveryServiceUrl, params)\n \n+  content = _retrieve_discovery_doc(requested_url, http, cache_discovery, cache)\n+\n+  return build_from_document(content, base=discoveryServiceUrl, http=http,\n+      developerKey=developerKey, model=model, requestBuilder=requestBuilder,\n+      credentials=credentials)\n+\n+\n+def _retrieve_discovery_doc(url, http, cache_discovery, cache=None):\n+  \"\"\"Retrieves the discovery_doc from cache or the internet.\n+\n+  Args:\n+    url: string, the URL of the discovery document.\n+    http: httplib2.Http, An instance of httplib2.Http or something that acts\n+      like it that HTTP requests will be made through.","path":"googleapiclient/discovery.py","position":38,"original_position":38,"commit_id":"c9905bf756a316ac00a1f4fa3ea344341cf0c649","original_commit_id":"c9905bf756a316ac00a1f4fa3ea344341cf0c649","user":{"login":"nathanielmanistaatgoogle","id":10131044,"avatar_url":"https://avatars.githubusercontent.com/u/10131044?v=3","gravatar_id":"","url":"https://api.github.com/users/nathanielmanistaatgoogle","html_url":"https://github.com/nathanielmanistaatgoogle","followers_url":"https://api.github.com/users/nathanielmanistaatgoogle/followers","following_url":"https://api.github.com/users/nathanielmanistaatgoogle/following{/other_user}","gists_url":"https://api.github.com/users/nathanielmanistaatgoogle/gists{/gist_id}","starred_url":"https://api.github.com/users/nathanielmanistaatgoogle/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathanielmanistaatgoogle/subscriptions","organizations_url":"https://api.github.com/users/nathanielmanistaatgoogle/orgs","repos_url":"https://api.github.com/users/nathanielmanistaatgoogle/repos","events_url":"https://api.github.com/users/nathanielmanistaatgoogle/events{/privacy}","received_events_url":"https://api.github.com/users/nathanielmanistaatgoogle/received_events","type":"User","site_admin":false},"body":"\"like it through which HTTP requests will be made.\"","created_at":"2015-08-21T02:44:49Z","updated_at":"2015-08-21T02:44:49Z","html_url":"https://github.com/google/google-api-python-client/pull/127#discussion_r37602218","pull_request_url":"https://api.github.com/repos/google/google-api-python-client/pulls/127","_links":{"self":{"href":"https://api.github.com/repos/google/google-api-python-client/pulls/comments/37602218"},"html":{"href":"https://github.com/google/google-api-python-client/pull/127#discussion_r37602218"},"pull_request":{"href":"https://api.github.com/repos/google/google-api-python-client/pulls/127"}}},"pull_request":{"url":"https://api.github.com/repos/google/google-api-python-client/pulls/127","id":42850377,"html_url":"https://github.com/google/google-api-python-client/pull/127","diff_url":"https://github.com/google/google-api-python-client/pull/127.diff","patch_url":"https://github.com/google/google-api-python-client/pull/127.patch","issue_url":"https://api.github.com/repos/google/google-api-python-client/issues/127","number":127,"state":"open","locked":false,"title":"Implemented automatic caching for the discovery documents.","user":{"login":"tmatsuo","id":41815,"avatar_url":"https://avatars.githubusercontent.com/u/41815?v=3","gravatar_id":"","url":"https://api.github.com/users/tmatsuo","html_url":"https://github.com/tmatsuo","followers_url":"https://api.github.com/users/tmatsuo/followers","following_url":"https://api.github.com/users/tmatsuo/following{/other_user}","gists_url":"https://api.github.com/users/tmatsuo/gists{/gist_id}","starred_url":"https://api.github.com/users/tmatsuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmatsuo/subscriptions","organizations_url":"https://api.github.com/users/tmatsuo/orgs","repos_url":"https://api.github.com/users/tmatsuo/repos","events_url":"https://api.github.com/users/tmatsuo/events{/privacy}","received_events_url":"https://api.github.com/users/tmatsuo/received_events","type":"User","site_admin":false},"body":"Added 2 keyword arguments; cache_discovery and cache. You can suppress caching by setting cache_discovery=False. You can inject your own caching module via the cache kwarg.\r\n\r\nIt automatically uses app engine memcache if it's detected. It's not a hard dependency. Then fall back to file based caching.\r\n\r\nfixes #110 ","created_at":"2015-08-19T18:53:16Z","updated_at":"2015-08-21T02:44:49Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3e553940aea28cbdc1bfc8dd00e1bd4ec7e35dd4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/google/google-api-python-client/pulls/127/commits","review_comments_url":"https://api.github.com/repos/google/google-api-python-client/pulls/127/comments","review_comment_url":"https://api.github.com/repos/google/google-api-python-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/google/google-api-python-client/issues/127/comments","statuses_url":"https://api.github.com/repos/google/google-api-python-client/statuses/c9905bf756a316ac00a1f4fa3ea344341cf0c649","head":{"label":"tmatsuo:master","ref":"master","sha":"c9905bf756a316ac00a1f4fa3ea344341cf0c649","user":{"login":"tmatsuo","id":41815,"avatar_url":"https://avatars.githubusercontent.com/u/41815?v=3","gravatar_id":"","url":"https://api.github.com/users/tmatsuo","html_url":"https://github.com/tmatsuo","followers_url":"https://api.github.com/users/tmatsuo/followers","following_url":"https://api.github.com/users/tmatsuo/following{/other_user}","gists_url":"https://api.github.com/users/tmatsuo/gists{/gist_id}","starred_url":"https://api.github.com/users/tmatsuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmatsuo/subscriptions","organizations_url":"https://api.github.com/users/tmatsuo/orgs","repos_url":"https://api.github.com/users/tmatsuo/repos","events_url":"https://api.github.com/users/tmatsuo/events{/privacy}","received_events_url":"https://api.github.com/users/tmatsuo/received_events","type":"User","site_admin":false},"repo":{"id":40990287,"name":"google-api-python-client","full_name":"tmatsuo/google-api-python-client","owner":{"login":"tmatsuo","id":41815,"avatar_url":"https://avatars.githubusercontent.com/u/41815?v=3","gravatar_id":"","url":"https://api.github.com/users/tmatsuo","html_url":"https://github.com/tmatsuo","followers_url":"https://api.github.com/users/tmatsuo/followers","following_url":"https://api.github.com/users/tmatsuo/following{/other_user}","gists_url":"https://api.github.com/users/tmatsuo/gists{/gist_id}","starred_url":"https://api.github.com/users/tmatsuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tmatsuo/subscriptions","organizations_url":"https://api.github.com/users/tmatsuo/orgs","repos_url":"https://api.github.com/users/tmatsuo/repos","events_url":"https://api.github.com/users/tmatsuo/events{/privacy}","received_events_url":"https://api.github.com/users/tmatsuo/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/tmatsuo/google-api-python-client","description":null,"fork":true,"url":"https://api.github.com/repos/tmatsuo/google-api-python-client","forks_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/forks","keys_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/teams","hooks_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/hooks","issue_events_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/issues/events{/number}","events_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/events","assignees_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/assignees{/user}","branches_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/branches{/branch}","tags_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/tags","blobs_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/statuses/{sha}","languages_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/languages","stargazers_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/stargazers","contributors_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/contributors","subscribers_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/subscribers","subscription_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/subscription","commits_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/contents/{+path}","compare_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/merges","archive_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/downloads","issues_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/issues{/number}","pulls_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/pulls{/number}","milestones_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/milestones{/number}","notifications_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/labels{/name}","releases_url":"https://api.github.com/repos/tmatsuo/google-api-python-client/releases{/id}","created_at":"2015-08-18T18:30:01Z","updated_at":"2015-08-18T18:30:02Z","pushed_at":"2015-08-21T01:52:25Z","git_url":"git://github.com/tmatsuo/google-api-python-client.git","ssh_url":"git@github.com:tmatsuo/google-api-python-client.git","clone_url":"https://github.com/tmatsuo/google-api-python-client.git","svn_url":"https://github.com/tmatsuo/google-api-python-client","homepage":null,"size":21562,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"google:master","ref":"master","sha":"a98add2392ef9e3d77aa36b4d0b0ec8c9b6e3504","user":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"repo":{"id":15749269,"name":"google-api-python-client","full_name":"google/google-api-python-client","owner":{"login":"google","id":1342004,"avatar_url":"https://avatars.githubusercontent.com/u/1342004?v=3","gravatar_id":"","url":"https://api.github.com/users/google","html_url":"https://github.com/google","followers_url":"https://api.github.com/users/google/followers","following_url":"https://api.github.com/users/google/following{/other_user}","gists_url":"https://api.github.com/users/google/gists{/gist_id}","starred_url":"https://api.github.com/users/google/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/google/subscriptions","organizations_url":"https://api.github.com/users/google/orgs","repos_url":"https://api.github.com/users/google/repos","events_url":"https://api.github.com/users/google/events{/privacy}","received_events_url":"https://api.github.com/users/google/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/google/google-api-python-client","description":null,"fork":false,"url":"https://api.github.com/repos/google/google-api-python-client","forks_url":"https://api.github.com/repos/google/google-api-python-client/forks","keys_url":"https://api.github.com/repos/google/google-api-python-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/google/google-api-python-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/google/google-api-python-client/teams","hooks_url":"https://api.github.com/repos/google/google-api-python-client/hooks","issue_events_url":"https://api.github.com/repos/google/google-api-python-client/issues/events{/number}","events_url":"https://api.github.com/repos/google/google-api-python-client/events","assignees_url":"https://api.github.com/repos/google/google-api-python-client/assignees{/user}","branches_url":"https://api.github.com/repos/google/google-api-python-client/branches{/branch}","tags_url":"https://api.github.com/repos/google/google-api-python-client/tags","blobs_url":"https://api.github.com/repos/google/google-api-python-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/google/google-api-python-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/google/google-api-python-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/google/google-api-python-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/google/google-api-python-client/statuses/{sha}","languages_url":"https://api.github.com/repos/google/google-api-python-client/languages","stargazers_url":"https://api.github.com/repos/google/google-api-python-client/stargazers","contributors_url":"https://api.github.com/repos/google/google-api-python-client/contributors","subscribers_url":"https://api.github.com/repos/google/google-api-python-client/subscribers","subscription_url":"https://api.github.com/repos/google/google-api-python-client/subscription","commits_url":"https://api.github.com/repos/google/google-api-python-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/google/google-api-python-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/google/google-api-python-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/google/google-api-python-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/google/google-api-python-client/contents/{+path}","compare_url":"https://api.github.com/repos/google/google-api-python-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/google/google-api-python-client/merges","archive_url":"https://api.github.com/repos/google/google-api-python-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/google/google-api-python-client/downloads","issues_url":"https://api.github.com/repos/google/google-api-python-client/issues{/number}","pulls_url":"https://api.github.com/repos/google/google-api-python-client/pulls{/number}","milestones_url":"https://api.github.com/repos/google/google-api-python-client/milestones{/number}","notifications_url":"https://api.github.com/repos/google/google-api-python-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/google/google-api-python-client/labels{/name}","releases_url":"https://api.github.com/repos/google/google-api-python-client/releases{/id}","created_at":"2014-01-08T21:55:56Z","updated_at":"2015-08-20T02:01:01Z","pushed_at":"2015-08-21T01:52:26Z","git_url":"git://github.com/google/google-api-python-client.git","ssh_url":"git@github.com:google/google-api-python-client.git","clone_url":"https://github.com/google/google-api-python-client.git","svn_url":"https://github.com/google/google-api-python-client","homepage":null,"size":21562,"stargazers_count":561,"watchers_count":561,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":211,"mirror_url":null,"open_issues_count":41,"forks":211,"open_issues":41,"watchers":561,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/google/google-api-python-client/pulls/127"},"html":{"href":"https://github.com/google/google-api-python-client/pull/127"},"issue":{"href":"https://api.github.com/repos/google/google-api-python-client/issues/127"},"comments":{"href":"https://api.github.com/repos/google/google-api-python-client/issues/127/comments"},"review_comments":{"href":"https://api.github.com/repos/google/google-api-python-client/pulls/127/comments"},"review_comment":{"href":"https://api.github.com/repos/google/google-api-python-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/google/google-api-python-client/pulls/127/commits"},"statuses":{"href":"https://api.github.com/repos/google/google-api-python-client/statuses/c9905bf756a316ac00a1f4fa3ea344341cf0c649"}}}}