Skip to content

Commit 221e254

Browse files
1 parent 1f8c6df commit 221e254

File tree

198 files changed

+32026
-19038
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

198 files changed

+32026
-19038
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
import com.google.api.gax.rpc.ClientContext;
3030
import com.google.api.gax.rpc.ClientSettings;
3131
import com.google.api.gax.rpc.PagedCallSettings;
32-
import com.google.api.gax.rpc.StubSettings;
3332
import com.google.api.gax.rpc.TransportChannelProvider;
3433
import com.google.api.gax.rpc.UnaryCallSettings;
3534
import com.google.cloud.pubsub.v1.stub.SchemaServiceStubSettings;
Lines changed: 770 additions & 2 deletions
Large diffs are not rendered by default.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import com.google.api.gax.rpc.ClientSettings;
3131
import com.google.api.gax.rpc.PagedCallSettings;
3232
import com.google.api.gax.rpc.StreamingCallSettings;
33-
import com.google.api.gax.rpc.StubSettings;
3433
import com.google.api.gax.rpc.TransportChannelProvider;
3534
import com.google.api.gax.rpc.UnaryCallSettings;
3635
import com.google.cloud.pubsub.v1.stub.SubscriberStubSettings;
Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
import com.google.pubsub.v1.ListTopicsRequest;
4646
import com.google.pubsub.v1.ListTopicsResponse;
4747
import com.google.pubsub.v1.ProjectName;
48+
import com.google.pubsub.v1.ProjectTopicName;
4849
import com.google.pubsub.v1.PublishRequest;
4950
import com.google.pubsub.v1.PublishResponse;
5051
import com.google.pubsub.v1.PubsubMessage;
@@ -462,6 +463,35 @@ public final Topic createTopic(String name) {
462463
return createTopic(request);
463464
}
464465

466+
// AUTO-GENERATED DOCUMENTATION AND METHOD
467+
/**
468+
* Creates the given topic with the given name. See the <a
469+
* href="https://cloud.google.com/pubsub/docs/admin#resource_names"> resource name
470+
* rules</a>.
471+
*
472+
* <p>Sample code:
473+
*
474+
* <pre><code>
475+
* try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
476+
* ProjectTopicName name = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
477+
* Topic response = topicAdminClient.createTopic(name);
478+
* }
479+
* </code></pre>
480+
*
481+
* @param name Required. The name of the topic. It must have the format
482+
* `"projects/{project}/topics/{topic}"`. `{topic}` must start with a letter, and contain only
483+
* letters (`[A-Za-z]`), numbers (`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`),
484+
* tildes (`~`), plus (`+`) or percent signs (`%`). It must be between 3 and 255 characters in
485+
* length, and it must not start with `"goog"`.
486+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
487+
* @deprecated Use {@link #createTopic(TopicName)} instead.
488+
*/
489+
@Deprecated
490+
public final Topic createTopic(ProjectTopicName name) {
491+
Topic request = Topic.newBuilder().setName(name == null ? null : name.toString()).build();
492+
return createTopic(request);
493+
}
494+
465495
// AUTO-GENERATED DOCUMENTATION AND METHOD.
466496
/**
467497
* Creates the given topic with the given name. See the [resource name rules]
@@ -800,6 +830,31 @@ public final Topic getTopic(String topic) {
800830
return getTopic(request);
801831
}
802832

833+
// AUTO-GENERATED DOCUMENTATION AND METHOD
834+
/**
835+
* Gets the configuration of a topic.
836+
*
837+
* <p>Sample code:
838+
*
839+
* <pre><code>
840+
* try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
841+
* ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
842+
* Topic response = topicAdminClient.getTopic(topic);
843+
* }
844+
* </code></pre>
845+
*
846+
* @param topic Required. The name of the topic to get. Format is
847+
* `projects/{project}/topics/{topic}`.
848+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
849+
* @deprecated Use {@link #getTopic(TopicName)} instead.
850+
*/
851+
@Deprecated
852+
public final Topic getTopic(ProjectTopicName topic) {
853+
GetTopicRequest request =
854+
GetTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build();
855+
return getTopic(request);
856+
}
857+
803858
// AUTO-GENERATED DOCUMENTATION AND METHOD.
804859
/**
805860
* Gets the configuration of a topic.
@@ -1079,6 +1134,35 @@ public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(String t
10791134
return listTopicSubscriptions(request);
10801135
}
10811136

1137+
// AUTO-GENERATED DOCUMENTATION AND METHOD
1138+
/**
1139+
* Lists the names of the subscriptions on this topic.
1140+
*
1141+
* <p>Sample code:
1142+
*
1143+
* <pre><code>
1144+
* try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
1145+
* ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
1146+
* for (ProjectSubscriptionName element : topicAdminClient.listTopicSubscriptions(topic).iterateAllAsProjectSubscriptionName()) {
1147+
* // doThingsWith(element);
1148+
* }
1149+
* }
1150+
* </code></pre>
1151+
*
1152+
* @param topic Required. The name of the topic that subscriptions are attached to. Format is
1153+
* `projects/{project}/topics/{topic}`.
1154+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1155+
* @deprecated Use {@link #listTopicSubscriptions(TopicName)} instead.
1156+
*/
1157+
@Deprecated
1158+
public final ListTopicSubscriptionsPagedResponse listTopicSubscriptions(ProjectTopicName topic) {
1159+
ListTopicSubscriptionsRequest request =
1160+
ListTopicSubscriptionsRequest.newBuilder()
1161+
.setTopic(topic == null ? null : topic.toString())
1162+
.build();
1163+
return listTopicSubscriptions(request);
1164+
}
1165+
10821166
// AUTO-GENERATED DOCUMENTATION AND METHOD.
10831167
/**
10841168
* Lists the names of the attached subscriptions on this topic.
@@ -1429,6 +1513,34 @@ public final void deleteTopic(String topic) {
14291513
deleteTopic(request);
14301514
}
14311515

1516+
// AUTO-GENERATED DOCUMENTATION AND METHOD
1517+
/**
1518+
* Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a
1519+
* topic is deleted, a new topic may be created with the same name; this is an entirely new topic
1520+
* with none of the old configuration or subscriptions. Existing subscriptions to this topic are
1521+
* not deleted, but their `topic` field is set to `_deleted-topic_`.
1522+
*
1523+
* <p>Sample code:
1524+
*
1525+
* <pre><code>
1526+
* try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
1527+
* ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
1528+
* topicAdminClient.deleteTopic(topic);
1529+
* }
1530+
* </code></pre>
1531+
*
1532+
* @param topic Required. Name of the topic to delete. Format is
1533+
* `projects/{project}/topics/{topic}`.
1534+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1535+
* @deprecated Use {@link #deleteTopic(TopicName)} instead.
1536+
*/
1537+
@Deprecated
1538+
public final void deleteTopic(ProjectTopicName topic) {
1539+
DeleteTopicRequest request =
1540+
DeleteTopicRequest.newBuilder().setTopic(topic == null ? null : topic.toString()).build();
1541+
deleteTopic(request);
1542+
}
1543+
14321544
// AUTO-GENERATED DOCUMENTATION AND METHOD.
14331545
/**
14341546
* Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a
@@ -1583,6 +1695,37 @@ public final Policy setIamPolicy(SetIamPolicyRequest request) {
15831695
return setIamPolicyCallable().call(request);
15841696
}
15851697

1698+
// AUTO-GENERATED DOCUMENTATION AND METHOD
1699+
/**
1700+
* Sets the access control policy on the specified resource. Replaces any existing policy.
1701+
*
1702+
* <p>Can return Public Errors: NOT_FOUND, INVALID_ARGUMENT and PERMISSION_DENIED
1703+
*
1704+
* <p>Sample code:
1705+
*
1706+
* <pre><code>
1707+
* try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
1708+
* String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
1709+
* Policy policy = Policy.newBuilder().build();
1710+
* Policy response = topicAdminClient.setIamPolicy(formattedResource, policy);
1711+
* }
1712+
* </code></pre>
1713+
*
1714+
* @param resource REQUIRED: The resource for which the policy is being specified. See the
1715+
* operation documentation for the appropriate value for this field.
1716+
* @param policy REQUIRED: The complete policy to be applied to the `resource`. The size of the
1717+
* policy is limited to a few 10s of KB. An empty policy is a valid policy but certain Cloud
1718+
* Platform services (such as Projects) might reject them.
1719+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1720+
* @deprecated Use {@link #setIamPolicy(SetIamPolicyRequest)} instead.
1721+
*/
1722+
@Deprecated
1723+
public final Policy setIamPolicy(String resource, Policy policy) {
1724+
SetIamPolicyRequest request =
1725+
SetIamPolicyRequest.newBuilder().setResource(resource).setPolicy(policy).build();
1726+
return setIamPolicy(request);
1727+
}
1728+
15861729
// AUTO-GENERATED DOCUMENTATION AND METHOD.
15871730
/**
15881731
* Sets the access control policy on the specified resource. Replacesany existing policy.
@@ -1644,6 +1787,31 @@ public final Policy getIamPolicy(GetIamPolicyRequest request) {
16441787
return getIamPolicyCallable().call(request);
16451788
}
16461789

1790+
// AUTO-GENERATED DOCUMENTATION AND METHOD
1791+
/**
1792+
* Gets the access control policy for a resource. Returns an empty policy if the resource exists
1793+
* and does not have a policy set.
1794+
*
1795+
* <p>Sample code:
1796+
*
1797+
* <pre><code>
1798+
* try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
1799+
* String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
1800+
* Policy response = topicAdminClient.getIamPolicy(formattedResource);
1801+
* }
1802+
* </code></pre>
1803+
*
1804+
* @param resource REQUIRED: The resource for which the policy is being requested. See the
1805+
* operation documentation for the appropriate value for this field.
1806+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1807+
* @deprecated Use {@link #getIamPolicy(GetIamPolicyRequest)} instead.
1808+
*/
1809+
@Deprecated
1810+
public final Policy getIamPolicy(String resource) {
1811+
GetIamPolicyRequest request = GetIamPolicyRequest.newBuilder().setResource(resource).build();
1812+
return getIamPolicy(request);
1813+
}
1814+
16471815
// AUTO-GENERATED DOCUMENTATION AND METHOD.
16481816
/**
16491817
* Gets the access control policy for a resource. Returns an empty policyif the resource exists
@@ -1707,6 +1875,44 @@ public final TestIamPermissionsResponse testIamPermissions(TestIamPermissionsReq
17071875
return testIamPermissionsCallable().call(request);
17081876
}
17091877

1878+
// AUTO-GENERATED DOCUMENTATION AND METHOD
1879+
/**
1880+
* Returns permissions that a caller has on the specified resource. If the resource does not
1881+
* exist, this will return an empty set of permissions, not a NOT_FOUND error.
1882+
*
1883+
* <p>Note: This operation is designed to be used for building permission-aware UIs and
1884+
* command-line tools, not for authorization checking. This operation may "fail open" without
1885+
* warning.
1886+
*
1887+
* <p>Sample code:
1888+
*
1889+
* <pre><code>
1890+
* try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
1891+
* String formattedResource = ProjectTopicName.format("[PROJECT]", "[TOPIC]");
1892+
* List&lt;String&gt; permissions = new ArrayList&lt;&gt;();
1893+
* TestIamPermissionsResponse response = topicAdminClient.testIamPermissions(formattedResource, permissions);
1894+
* }
1895+
* </code></pre>
1896+
*
1897+
* @param resource REQUIRED: The resource for which the policy detail is being requested. See the
1898+
* operation documentation for the appropriate value for this field.
1899+
* @param permissions The set of permissions to check for the `resource`. Permissions with
1900+
* wildcards (such as '&#42;' or 'storage.&#42;') are not allowed. For more information see
1901+
* [IAM Overview](https://cloud.google.com/iam/docs/overview#permissions).
1902+
* @throws com.google.api.gax.rpc.ApiException if the remote call fails
1903+
* @deprecated Use {@link #testIamPermissions(TestIamPermissionsRequest)} instead.
1904+
*/
1905+
@Deprecated
1906+
public final TestIamPermissionsResponse testIamPermissions(
1907+
String resource, List<String> permissions) {
1908+
TestIamPermissionsRequest request =
1909+
TestIamPermissionsRequest.newBuilder()
1910+
.setResource(resource)
1911+
.addAllPermissions(permissions)
1912+
.build();
1913+
return testIamPermissions(request);
1914+
}
1915+
17101916
// AUTO-GENERATED DOCUMENTATION AND METHOD.
17111917
/**
17121918
* Returns permissions that a caller has on the specified resource. If theresource does not exist,
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import com.google.api.gax.rpc.ClientContext;
3232
import com.google.api.gax.rpc.ClientSettings;
3333
import com.google.api.gax.rpc.PagedCallSettings;
34-
import com.google.api.gax.rpc.StubSettings;
3534
import com.google.api.gax.rpc.TransportChannelProvider;
3635
import com.google.api.gax.rpc.UnaryCallSettings;
3736
import com.google.cloud.pubsub.v1.stub.PublisherStubSettings;
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
import io.grpc.MethodDescriptor;
5252
import io.grpc.protobuf.ProtoUtils;
5353
import java.io.IOException;
54-
import java.util.Map;
5554
import java.util.concurrent.TimeUnit;
5655
import javax.annotation.Generated;
5756

0 commit comments

Comments
Β (0)