{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/comments/59142562","id":59142562,"diff_hunk":"@@ -1161,6 +1201,141 @@ public Operation deprecate(ImageId image,\n     }\n   }\n \n+  @Override\n+  public Disk get(final DiskId diskId, DiskOption... options) {\n+    final Map<ComputeRpc.Option, ?> optionsMap = optionMap(options);\n+    try {\n+      com.google.api.services.compute.model.Disk answer =\n+          runWithRetries(new Callable<com.google.api.services.compute.model.Disk>() {\n+            @Override\n+            public com.google.api.services.compute.model.Disk call() {\n+              return computeRpc.getDisk(diskId.zone(), diskId.disk(), optionsMap);\n+            }\n+          }, options().retryParams(), EXCEPTION_HANDLER);\n+      return answer == null ? null : Disk.fromPb(this, answer);\n+    } catch (RetryHelper.RetryHelperException e) {\n+      throw ComputeException.translateAndThrow(e);\n+    }\n+  }\n+\n+  @Override\n+  public Operation create(final DiskInfo disk, OperationOption... options) {\n+    final com.google.api.services.compute.model.Disk diskPb =\n+        disk.setProjectId(options().projectId()).toPb();\n+    final Map<ComputeRpc.Option, ?> optionsMap = optionMap(options);\n+    try {\n+      return Operation.fromPb(this,\n+          runWithRetries(new Callable<com.google.api.services.compute.model.Operation>() {\n+            @Override\n+            public com.google.api.services.compute.model.Operation call() {\n+              return computeRpc.createDisk(disk.diskId().zone(), diskPb, optionsMap);\n+            }\n+          }, options().retryParams(), EXCEPTION_HANDLER));\n+    } catch (RetryHelper.RetryHelperException e) {\n+      throw ComputeException.translateAndThrow(e);\n+    }\n+  }\n+\n+  private static Function<com.google.api.services.compute.model.Disk, Disk> diskFromPb(\n+      final ComputeOptions serviceOptions) {\n+    return new Function<com.google.api.services.compute.model.Disk, Disk>() {\n+      @Override\n+      public Disk apply(com.google.api.services.compute.model.Disk disk) {\n+        return Disk.fromPb(serviceOptions.service(), disk);\n+      }\n+    };\n+  }\n+\n+  @Override\n+  public Page<Disk> listDisks(String zone, DiskListOption... options) {\n+    return listDisks(zone, options(), optionMap(options));\n+  }\n+\n+  private static Page<Disk> listDisks(final String zone, final ComputeOptions serviceOptions,\n+      final Map<ComputeRpc.Option, ?> optionsMap) {\n+    try {\n+      ComputeRpc.Tuple<String, Iterable<com.google.api.services.compute.model.Disk>> result =\n+          runWithRetries(new Callable<ComputeRpc.Tuple<String,\n+              Iterable<com.google.api.services.compute.model.Disk>>>() {\n+            @Override\n+            public ComputeRpc.Tuple<String,\n+                Iterable<com.google.api.services.compute.model.Disk>> call() {\n+              return serviceOptions.rpc().listDisks(zone, optionsMap);\n+            }\n+          }, serviceOptions.retryParams(), EXCEPTION_HANDLER);\n+      String cursor = result.x();\n+      Iterable<Disk> disks = Iterables.transform(\n+          result.y() == null ? ImmutableList.<com.google.api.services.compute.model.Disk>of()\n+              : result.y(), diskFromPb(serviceOptions));\n+      return new PageImpl<>(new DiskPageFetcher(zone, serviceOptions, cursor, optionsMap),\n+          cursor, disks);\n+    } catch (RetryHelper.RetryHelperException e) {\n+      throw ComputeException.translateAndThrow(e);\n+    }\n+  }\n+\n+  @Override\n+  public Page<Disk> listDisks(DiskAggregatedListOption... options) {\n+    return listDisks(options(), optionMap(options));\n+  }\n+\n+  private static Page<Disk> listDisks(final ComputeOptions serviceOptions,","path":"gcloud-java-compute/src/main/java/com/google/gcloud/compute/ComputeImpl.java","position":129,"original_position":129,"commit_id":"f6cbc1bef8e1e4e1446c88b4ca42f8ad4f9af21c","original_commit_id":"f6cbc1bef8e1e4e1446c88b4ca42f8ad4f9af21c","user":{"login":"mziccard","id":450933,"avatar_url":"https://avatars.githubusercontent.com/u/450933?v=3","gravatar_id":"","url":"https://api.github.com/users/mziccard","html_url":"https://github.com/mziccard","followers_url":"https://api.github.com/users/mziccard/followers","following_url":"https://api.github.com/users/mziccard/following{/other_user}","gists_url":"https://api.github.com/users/mziccard/gists{/gist_id}","starred_url":"https://api.github.com/users/mziccard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mziccard/subscriptions","organizations_url":"https://api.github.com/users/mziccard/orgs","repos_url":"https://api.github.com/users/mziccard/repos","events_url":"https://api.github.com/users/mziccard/events{/privacy}","received_events_url":"https://api.github.com/users/mziccard/received_events","type":"User","site_admin":false},"body":"![Codacy](https://www.codacy.com/assets/images/favicon.png) Issue found: [Avoid unused private methods such as 'listDisks(ComputeOptions,Map)'.](https://www.codacy.com/app/mziccard/gcloud-java/file/2383968024/issues/source?bid=3140968&fileBranchId=3223208#l1282)","created_at":"2016-04-10T22:10:19Z","updated_at":"2016-04-10T22:10:19Z","html_url":"https://github.com/GoogleCloudPlatform/gcloud-java/pull/870#discussion_r59142562","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/870","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/comments/59142562"},"html":{"href":"https://github.com/GoogleCloudPlatform/gcloud-java/pull/870#discussion_r59142562"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/870"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/870","id":65605958,"html_url":"https://github.com/GoogleCloudPlatform/gcloud-java/pull/870","diff_url":"https://github.com/GoogleCloudPlatform/gcloud-java/pull/870.diff","patch_url":"https://github.com/GoogleCloudPlatform/gcloud-java/pull/870.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/issues/870","number":870,"state":"open","locked":false,"title":"Add functional methods for disks and Disk class","user":{"login":"mziccard","id":450933,"avatar_url":"https://avatars.githubusercontent.com/u/450933?v=3","gravatar_id":"","url":"https://api.github.com/users/mziccard","html_url":"https://github.com/mziccard","followers_url":"https://api.github.com/users/mziccard/followers","following_url":"https://api.github.com/users/mziccard/following{/other_user}","gists_url":"https://api.github.com/users/mziccard/gists{/gist_id}","starred_url":"https://api.github.com/users/mziccard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mziccard/subscriptions","organizations_url":"https://api.github.com/users/mziccard/orgs","repos_url":"https://api.github.com/users/mziccard/repos","events_url":"https://api.github.com/users/mziccard/events{/privacy}","received_events_url":"https://api.github.com/users/mziccard/received_events","type":"User","site_admin":false},"body":"This PR also includes integration tests for disks images and snapshots.","created_at":"2016-04-07T10:18:53Z","updated_at":"2016-04-10T22:10:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4fca984013ae02e2b8c83d7282e0d7612f2199a8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/870/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/870/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/issues/870/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/statuses/f6cbc1bef8e1e4e1446c88b4ca42f8ad4f9af21c","head":{"label":"mziccard:compute-disk","ref":"compute-disk","sha":"f6cbc1bef8e1e4e1446c88b4ca42f8ad4f9af21c","user":{"login":"mziccard","id":450933,"avatar_url":"https://avatars.githubusercontent.com/u/450933?v=3","gravatar_id":"","url":"https://api.github.com/users/mziccard","html_url":"https://github.com/mziccard","followers_url":"https://api.github.com/users/mziccard/followers","following_url":"https://api.github.com/users/mziccard/following{/other_user}","gists_url":"https://api.github.com/users/mziccard/gists{/gist_id}","starred_url":"https://api.github.com/users/mziccard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mziccard/subscriptions","organizations_url":"https://api.github.com/users/mziccard/orgs","repos_url":"https://api.github.com/users/mziccard/repos","events_url":"https://api.github.com/users/mziccard/events{/privacy}","received_events_url":"https://api.github.com/users/mziccard/received_events","type":"User","site_admin":false},"repo":{"id":40965279,"name":"gcloud-java","full_name":"mziccard/gcloud-java","owner":{"login":"mziccard","id":450933,"avatar_url":"https://avatars.githubusercontent.com/u/450933?v=3","gravatar_id":"","url":"https://api.github.com/users/mziccard","html_url":"https://github.com/mziccard","followers_url":"https://api.github.com/users/mziccard/followers","following_url":"https://api.github.com/users/mziccard/following{/other_user}","gists_url":"https://api.github.com/users/mziccard/gists{/gist_id}","starred_url":"https://api.github.com/users/mziccard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mziccard/subscriptions","organizations_url":"https://api.github.com/users/mziccard/orgs","repos_url":"https://api.github.com/users/mziccard/repos","events_url":"https://api.github.com/users/mziccard/events{/privacy}","received_events_url":"https://api.github.com/users/mziccard/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/mziccard/gcloud-java","description":"Google Cloud Client Library for Java","fork":true,"url":"https://api.github.com/repos/mziccard/gcloud-java","forks_url":"https://api.github.com/repos/mziccard/gcloud-java/forks","keys_url":"https://api.github.com/repos/mziccard/gcloud-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mziccard/gcloud-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mziccard/gcloud-java/teams","hooks_url":"https://api.github.com/repos/mziccard/gcloud-java/hooks","issue_events_url":"https://api.github.com/repos/mziccard/gcloud-java/issues/events{/number}","events_url":"https://api.github.com/repos/mziccard/gcloud-java/events","assignees_url":"https://api.github.com/repos/mziccard/gcloud-java/assignees{/user}","branches_url":"https://api.github.com/repos/mziccard/gcloud-java/branches{/branch}","tags_url":"https://api.github.com/repos/mziccard/gcloud-java/tags","blobs_url":"https://api.github.com/repos/mziccard/gcloud-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mziccard/gcloud-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mziccard/gcloud-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/mziccard/gcloud-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mziccard/gcloud-java/statuses/{sha}","languages_url":"https://api.github.com/repos/mziccard/gcloud-java/languages","stargazers_url":"https://api.github.com/repos/mziccard/gcloud-java/stargazers","contributors_url":"https://api.github.com/repos/mziccard/gcloud-java/contributors","subscribers_url":"https://api.github.com/repos/mziccard/gcloud-java/subscribers","subscription_url":"https://api.github.com/repos/mziccard/gcloud-java/subscription","commits_url":"https://api.github.com/repos/mziccard/gcloud-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/mziccard/gcloud-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/mziccard/gcloud-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/mziccard/gcloud-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/mziccard/gcloud-java/contents/{+path}","compare_url":"https://api.github.com/repos/mziccard/gcloud-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mziccard/gcloud-java/merges","archive_url":"https://api.github.com/repos/mziccard/gcloud-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mziccard/gcloud-java/downloads","issues_url":"https://api.github.com/repos/mziccard/gcloud-java/issues{/number}","pulls_url":"https://api.github.com/repos/mziccard/gcloud-java/pulls{/number}","milestones_url":"https://api.github.com/repos/mziccard/gcloud-java/milestones{/number}","notifications_url":"https://api.github.com/repos/mziccard/gcloud-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mziccard/gcloud-java/labels{/name}","releases_url":"https://api.github.com/repos/mziccard/gcloud-java/releases{/id}","deployments_url":"https://api.github.com/repos/mziccard/gcloud-java/deployments","created_at":"2015-08-18T10:16:17Z","updated_at":"2016-01-12T12:42:25Z","pushed_at":"2016-04-10T22:06:57Z","git_url":"git://github.com/mziccard/gcloud-java.git","ssh_url":"git@github.com:mziccard/gcloud-java.git","clone_url":"https://github.com/mziccard/gcloud-java.git","svn_url":"https://github.com/mziccard/gcloud-java","homepage":"http://googlecloudplatform.github.io/gcloud-java/site/0.0.6/","size":34315,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"GoogleCloudPlatform:compute-alpha","ref":"compute-alpha","sha":"6780c0d2b9e167135aba6d8aca733574a299a3f1","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":26181278,"name":"gcloud-java","full_name":"GoogleCloudPlatform/gcloud-java","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/gcloud-java","description":"Google Cloud Client Library for Java","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/releases{/id}","deployments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/deployments","created_at":"2014-11-04T17:57:16Z","updated_at":"2016-04-08T02:50:48Z","pushed_at":"2016-04-10T22:06:58Z","git_url":"git://github.com/GoogleCloudPlatform/gcloud-java.git","ssh_url":"git@github.com:GoogleCloudPlatform/gcloud-java.git","clone_url":"https://github.com/GoogleCloudPlatform/gcloud-java.git","svn_url":"https://github.com/GoogleCloudPlatform/gcloud-java","homepage":"http://googlecloudplatform.github.io/gcloud-java/","size":222050,"stargazers_count":83,"watchers_count":83,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":45,"mirror_url":null,"open_issues_count":148,"forks":45,"open_issues":148,"watchers":83,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/870"},"html":{"href":"https://github.com/GoogleCloudPlatform/gcloud-java/pull/870"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/issues/870"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/issues/870/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/870/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/870/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/statuses/f6cbc1bef8e1e4e1446c88b4ca42f8ad4f9af21c"}}}}