{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/comments/57008144","id":57008144,"diff_hunk":"@@ -0,0 +1,119 @@\n+/*\n+ * Copyright 2016 Google Inc. All Rights Reserved.\n+ *\n+ * Licensed under the Apache License, Version 2.0 (the \"License\");\n+ * you may not use this file except in compliance with the License.\n+ * You may obtain a copy of the License at\n+ *\n+ *       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,\n+ * WITHOUT 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+package com.google.gcloud.pubsub;\n+\n+import com.google.gcloud.Page;\n+import com.google.gcloud.Service;\n+\n+import java.util.List;\n+import java.util.concurrent.Future;\n+\n+/**\n+ * An interface for Google Cloud Pub/Sub.\n+ *\n+ * @see <a href=\"https://cloud.google.com/pubsub/\">Google Cloud Pub/Sub</a>\n+ */\n+public interface PubSub extends Service<PubSubOptions> {\n+\n+  class ListOption {\n+    // page size\n+    // page token\n+  }\n+\n+  class PullOption {\n+    // bool return_immediately = 2;\n+    // int32 max_messages = 3;\n+  }\n+\n+  // topics\n+  //////////////////////\n+  Topic createTopic(TopicInfo topic);\n+\n+  Future<Topic> createTopicAsync(String topic);\n+\n+  // null if not found\n+  Topic getTopic(String topic);\n+\n+  Future<Topic> getTopicAsync(String topic);\n+\n+  // false if not found\n+  boolean deleteTopic(String topic);\n+\n+  Future<Boolean> deleteTopicAsync(String topic);\n+\n+  Page<Topic> listTopics(ListOption... options);\n+\n+  // todo: consider AsyncPage that has nextPageAsync\n+  Future<Page<Topic>> listTopicsAsync(ListOption... options);","path":"gcloud-java-pubsub/src/main/java/com/google/gcloud/pubsub/PubSub.java","position":61,"original_position":61,"commit_id":"1ffb2a988f840f004c9088141fc46ea3cc20218d","original_commit_id":"1ffb2a988f840f004c9088141fc46ea3cc20218d","user":{"login":"aozarov","id":8921691,"avatar_url":"https://avatars.githubusercontent.com/u/8921691?v=3","gravatar_id":"","url":"https://api.github.com/users/aozarov","html_url":"https://github.com/aozarov","followers_url":"https://api.github.com/users/aozarov/followers","following_url":"https://api.github.com/users/aozarov/following{/other_user}","gists_url":"https://api.github.com/users/aozarov/gists{/gist_id}","starred_url":"https://api.github.com/users/aozarov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aozarov/subscriptions","organizations_url":"https://api.github.com/users/aozarov/orgs","repos_url":"https://api.github.com/users/aozarov/repos","events_url":"https://api.github.com/users/aozarov/events{/privacy}","received_events_url":"https://api.github.com/users/aozarov/received_events","type":"User","site_admin":false},"body":"do you mean \"Is `nextPage()` going to be **asynchronous**\"?\r\n\r\nI suppose so. Was not 100% sure about it but I do incline to think we should do it (wanted to get your opinions).\r\n\r\nI actually was thinking to let AsyncPage extend Page (so one could still use the synchronous options).\r\n\r\ne.g.\r\n```java\r\npublic interface AsyncPage<T> extends Page<T> {\r\n  Future<Page<T>> nextPageAsync();\r\n  // and optionally\r\n  Future<Iterable<T>> valuesAsync();\r\n}\r\n```","created_at":"2016-03-22T15:34:00Z","updated_at":"2016-03-22T15:34:00Z","html_url":"https://github.com/GoogleCloudPlatform/gcloud-java/pull/768#discussion_r57008144","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/768","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/comments/57008144"},"html":{"href":"https://github.com/GoogleCloudPlatform/gcloud-java/pull/768#discussion_r57008144"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/768"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/768","id":63523885,"html_url":"https://github.com/GoogleCloudPlatform/gcloud-java/pull/768","diff_url":"https://github.com/GoogleCloudPlatform/gcloud-java/pull/768.diff","patch_url":"https://github.com/GoogleCloudPlatform/gcloud-java/pull/768.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/issues/768","number":768,"state":"open","locked":false,"title":"API prototype","user":{"login":"aozarov","id":8921691,"avatar_url":"https://avatars.githubusercontent.com/u/8921691?v=3","gravatar_id":"","url":"https://api.github.com/users/aozarov","html_url":"https://github.com/aozarov","followers_url":"https://api.github.com/users/aozarov/followers","following_url":"https://api.github.com/users/aozarov/following{/other_user}","gists_url":"https://api.github.com/users/aozarov/gists{/gist_id}","starred_url":"https://api.github.com/users/aozarov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aozarov/subscriptions","organizations_url":"https://api.github.com/users/aozarov/orgs","repos_url":"https://api.github.com/users/aozarov/repos","events_url":"https://api.github.com/users/aozarov/events{/privacy}","received_events_url":"https://api.github.com/users/aozarov/received_events","type":"User","site_admin":false},"body":"Creating this PR for API discussion only. *DO NOT merge*","created_at":"2016-03-21T05:46:42Z","updated_at":"2016-03-22T15:34:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a3bc72e43809a4b0668ac764d45a10b21f82c494","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/768/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/768/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/768/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/statuses/1ffb2a988f840f004c9088141fc46ea3cc20218d","head":{"label":"aozarov:pubsub-alpha","ref":"pubsub-alpha","sha":"1ffb2a988f840f004c9088141fc46ea3cc20218d","user":{"login":"aozarov","id":8921691,"avatar_url":"https://avatars.githubusercontent.com/u/8921691?v=3","gravatar_id":"","url":"https://api.github.com/users/aozarov","html_url":"https://github.com/aozarov","followers_url":"https://api.github.com/users/aozarov/followers","following_url":"https://api.github.com/users/aozarov/following{/other_user}","gists_url":"https://api.github.com/users/aozarov/gists{/gist_id}","starred_url":"https://api.github.com/users/aozarov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aozarov/subscriptions","organizations_url":"https://api.github.com/users/aozarov/orgs","repos_url":"https://api.github.com/users/aozarov/repos","events_url":"https://api.github.com/users/aozarov/events{/privacy}","received_events_url":"https://api.github.com/users/aozarov/received_events","type":"User","site_admin":false},"repo":{"id":44983350,"name":"gcloud-java","full_name":"aozarov/gcloud-java","owner":{"login":"aozarov","id":8921691,"avatar_url":"https://avatars.githubusercontent.com/u/8921691?v=3","gravatar_id":"","url":"https://api.github.com/users/aozarov","html_url":"https://github.com/aozarov","followers_url":"https://api.github.com/users/aozarov/followers","following_url":"https://api.github.com/users/aozarov/following{/other_user}","gists_url":"https://api.github.com/users/aozarov/gists{/gist_id}","starred_url":"https://api.github.com/users/aozarov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aozarov/subscriptions","organizations_url":"https://api.github.com/users/aozarov/orgs","repos_url":"https://api.github.com/users/aozarov/repos","events_url":"https://api.github.com/users/aozarov/events{/privacy}","received_events_url":"https://api.github.com/users/aozarov/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/aozarov/gcloud-java","description":"Google Cloud Client Library for Java","fork":true,"url":"https://api.github.com/repos/aozarov/gcloud-java","forks_url":"https://api.github.com/repos/aozarov/gcloud-java/forks","keys_url":"https://api.github.com/repos/aozarov/gcloud-java/keys{/key_id}","collaborators_url":"https://api.github.com/repos/aozarov/gcloud-java/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/aozarov/gcloud-java/teams","hooks_url":"https://api.github.com/repos/aozarov/gcloud-java/hooks","issue_events_url":"https://api.github.com/repos/aozarov/gcloud-java/issues/events{/number}","events_url":"https://api.github.com/repos/aozarov/gcloud-java/events","assignees_url":"https://api.github.com/repos/aozarov/gcloud-java/assignees{/user}","branches_url":"https://api.github.com/repos/aozarov/gcloud-java/branches{/branch}","tags_url":"https://api.github.com/repos/aozarov/gcloud-java/tags","blobs_url":"https://api.github.com/repos/aozarov/gcloud-java/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/aozarov/gcloud-java/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/aozarov/gcloud-java/git/refs{/sha}","trees_url":"https://api.github.com/repos/aozarov/gcloud-java/git/trees{/sha}","statuses_url":"https://api.github.com/repos/aozarov/gcloud-java/statuses/{sha}","languages_url":"https://api.github.com/repos/aozarov/gcloud-java/languages","stargazers_url":"https://api.github.com/repos/aozarov/gcloud-java/stargazers","contributors_url":"https://api.github.com/repos/aozarov/gcloud-java/contributors","subscribers_url":"https://api.github.com/repos/aozarov/gcloud-java/subscribers","subscription_url":"https://api.github.com/repos/aozarov/gcloud-java/subscription","commits_url":"https://api.github.com/repos/aozarov/gcloud-java/commits{/sha}","git_commits_url":"https://api.github.com/repos/aozarov/gcloud-java/git/commits{/sha}","comments_url":"https://api.github.com/repos/aozarov/gcloud-java/comments{/number}","issue_comment_url":"https://api.github.com/repos/aozarov/gcloud-java/issues/comments{/number}","contents_url":"https://api.github.com/repos/aozarov/gcloud-java/contents/{+path}","compare_url":"https://api.github.com/repos/aozarov/gcloud-java/compare/{base}...{head}","merges_url":"https://api.github.com/repos/aozarov/gcloud-java/merges","archive_url":"https://api.github.com/repos/aozarov/gcloud-java/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/aozarov/gcloud-java/downloads","issues_url":"https://api.github.com/repos/aozarov/gcloud-java/issues{/number}","pulls_url":"https://api.github.com/repos/aozarov/gcloud-java/pulls{/number}","milestones_url":"https://api.github.com/repos/aozarov/gcloud-java/milestones{/number}","notifications_url":"https://api.github.com/repos/aozarov/gcloud-java/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/aozarov/gcloud-java/labels{/name}","releases_url":"https://api.github.com/repos/aozarov/gcloud-java/releases{/id}","deployments_url":"https://api.github.com/repos/aozarov/gcloud-java/deployments","created_at":"2015-10-26T16:53:21Z","updated_at":"2016-01-15T16:28:53Z","pushed_at":"2016-03-21T05:43:51Z","git_url":"git://github.com/aozarov/gcloud-java.git","ssh_url":"git@github.com:aozarov/gcloud-java.git","clone_url":"https://github.com/aozarov/gcloud-java.git","svn_url":"https://github.com/aozarov/gcloud-java","homepage":"http://googlecloudplatform.github.io/gcloud-java/","size":20055,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"GoogleCloudPlatform:pubsub-alpha","ref":"pubsub-alpha","sha":"e32afa64efce44a03e14c27f1fc7d57de0e4c041","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-03-22T08:11:57Z","pushed_at":"2016-03-22T15:33:42Z","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":217806,"stargazers_count":74,"watchers_count":74,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":40,"mirror_url":null,"open_issues_count":127,"forks":40,"open_issues":127,"watchers":74,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/768"},"html":{"href":"https://github.com/GoogleCloudPlatform/gcloud-java/pull/768"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/issues/768"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/issues/768/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/pulls/768/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/768/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-java/statuses/1ffb2a988f840f004c9088141fc46ea3cc20218d"}}}}