target.apidocs.com.google.api.services.pubsub.Pubsub.Projects.Topics.html Maven / Gradle / Ivy
Pubsub.Projects.Topics (Cloud Pub/Sub API v1-rev20240918-2.0.0)
com.google.api.services.pubsub
Class Pubsub.Projects.Topics
- java.lang.Object
-
- com.google.api.services.pubsub.Pubsub.Projects.Topics
-
- Enclosing class:
- Pubsub.Projects
public class Pubsub.Projects.Topics
extends Object
The "topics" collection of methods.
-
-
Nested Class Summary
Nested Classes
Modifier and Type
Class and Description
class
Pubsub.Projects.Topics.Create
class
Pubsub.Projects.Topics.Delete
class
Pubsub.Projects.Topics.Get
class
Pubsub.Projects.Topics.GetIamPolicy
class
Pubsub.Projects.Topics.List
class
Pubsub.Projects.Topics.Patch
class
Pubsub.Projects.Topics.Publish
class
Pubsub.Projects.Topics.SetIamPolicy
class
Pubsub.Projects.Topics.Snapshots
The "snapshots" collection of methods.
class
Pubsub.Projects.Topics.Subscriptions
The "subscriptions" collection of methods.
class
Pubsub.Projects.Topics.TestIamPermissions
-
Constructor Summary
Constructors
Constructor and Description
Topics()
-
Method Summary
All Methods Instance Methods Concrete Methods
Modifier and Type
Method and Description
Pubsub.Projects.Topics.Create
create(String name,
Topic content)
Creates the given topic with the given name.
Pubsub.Projects.Topics.Delete
delete(String topic)
Deletes the topic with the given name.
Pubsub.Projects.Topics.Get
get(String topic)
Gets the configuration of a topic.
Pubsub.Projects.Topics.GetIamPolicy
getIamPolicy(String resource)
Gets the access control policy for a resource.
Pubsub.Projects.Topics.List
list(String project)
Lists matching topics.
Pubsub.Projects.Topics.Patch
patch(String name,
UpdateTopicRequest content)
Updates an existing topic by updating the fields specified in the update mask.
Pubsub.Projects.Topics.Publish
publish(String topic,
PublishRequest content)
Adds one or more messages to the topic.
Pubsub.Projects.Topics.SetIamPolicy
setIamPolicy(String resource,
SetIamPolicyRequest content)
Sets the access control policy on the specified resource.
Pubsub.Projects.Topics.Snapshots
snapshots()
An accessor for creating requests from the Snapshots collection.
Pubsub.Projects.Topics.Subscriptions
subscriptions()
An accessor for creating requests from the Subscriptions collection.
Pubsub.Projects.Topics.TestIamPermissions
testIamPermissions(String resource,
TestIamPermissionsRequest content)
Returns permissions that a caller has on the specified resource.
-
-
Method Detail
-
create
public Pubsub.Projects.Topics.Create create(String name,
Topic content)
throws IOException
Creates the given topic with the given name. See the [resource name rules]
(https://cloud.google.com/pubsub/docs/pubsub-basics#resource_names).
Create a request for the method "topics.create".
This request holds the parameters needed by the pubsub server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
name
- Required. The name of the topic. It must have the format `"projects/{project}/topics/{topic}"`.
`{topic}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers
(`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or
percent signs (`%`). It must be between 3 and 255 characters in length, and it must not
start with `"goog"`.
content
- the Topic
- Returns:
- the request
- Throws:
IOException
-
delete
public Pubsub.Projects.Topics.Delete delete(String topic)
throws IOException
Deletes the topic with the given name. Returns `NOT_FOUND` if the topic does not exist. After a
topic is deleted, a new topic may be created with the same name; this is an entirely new topic
with none of the old configuration or subscriptions. Existing subscriptions to this topic are not
deleted, but their `topic` field is set to `_deleted-topic_`.
Create a request for the method "topics.delete".
This request holds the parameters needed by the pubsub server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
topic
- Required. Name of the topic to delete. Format is `projects/{project}/topics/{topic}`.
- Returns:
- the request
- Throws:
IOException
-
get
public Pubsub.Projects.Topics.Get get(String topic)
throws IOException
Gets the configuration of a topic.
Create a request for the method "topics.get".
This request holds the parameters needed by the pubsub server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
topic
- Required. The name of the topic to get. Format is `projects/{project}/topics/{topic}`.
- Returns:
- the request
- Throws:
IOException
-
getIamPolicy
public Pubsub.Projects.Topics.GetIamPolicy getIamPolicy(String resource)
throws IOException
Gets the access control policy for a resource. Returns an empty policy if the resource exists and
does not have a policy set.
Create a request for the method "topics.getIamPolicy".
This request holds the parameters needed by the pubsub server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
resource
- REQUIRED: The resource for which the policy is being requested. See [Resource
names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for
this field.
- Returns:
- the request
- Throws:
IOException
-
list
public Pubsub.Projects.Topics.List list(String project)
throws IOException
Lists matching topics.
Create a request for the method "topics.list".
This request holds the parameters needed by the pubsub server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
project
- Required. The name of the project in which to list topics. Format is `projects/{project-id}`.
- Returns:
- the request
- Throws:
IOException
-
patch
public Pubsub.Projects.Topics.Patch patch(String name,
UpdateTopicRequest content)
throws IOException
Updates an existing topic by updating the fields specified in the update mask. Note that certain
properties of a topic are not modifiable.
Create a request for the method "topics.patch".
This request holds the parameters needed by the pubsub server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
name
- Required. The name of the topic. It must have the format `"projects/{project}/topics/{topic}"`.
`{topic}` must start with a letter, and contain only letters (`[A-Za-z]`), numbers
(`[0-9]`), dashes (`-`), underscores (`_`), periods (`.`), tildes (`~`), plus (`+`) or
percent signs (`%`). It must be between 3 and 255 characters in length, and it must not
start with `"goog"`.
content
- the UpdateTopicRequest
- Returns:
- the request
- Throws:
IOException
-
publish
public Pubsub.Projects.Topics.Publish publish(String topic,
PublishRequest content)
throws IOException
Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does not exist.
Create a request for the method "topics.publish".
This request holds the parameters needed by the pubsub server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
topic
- Required. The messages in the request will be published on this topic. Format is
`projects/{project}/topics/{topic}`.
content
- the PublishRequest
- Returns:
- the request
- Throws:
IOException
-
setIamPolicy
public Pubsub.Projects.Topics.SetIamPolicy setIamPolicy(String resource,
SetIamPolicyRequest content)
throws IOException
Sets the access control policy on the specified resource. Replaces any existing policy. Can
return `NOT_FOUND`, `INVALID_ARGUMENT`, and `PERMISSION_DENIED` errors.
Create a request for the method "topics.setIamPolicy".
This request holds the parameters needed by the pubsub server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
resource
- REQUIRED: The resource for which the policy is being specified. See [Resource
names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for
this field.
content
- the SetIamPolicyRequest
- Returns:
- the request
- Throws:
IOException
-
testIamPermissions
public Pubsub.Projects.Topics.TestIamPermissions testIamPermissions(String resource,
TestIamPermissionsRequest content)
throws IOException
Returns permissions that a caller has on the specified resource. If the resource does not exist,
this will return an empty set of permissions, not a `NOT_FOUND` error. Note: This operation is
designed to be used for building permission-aware UIs and command-line tools, not for
authorization checking. This operation may "fail open" without warning.
Create a request for the method "topics.testIamPermissions".
This request holds the parameters needed by the pubsub server. After setting any optional
parameters, call the AbstractGoogleClientRequest.execute()
method to invoke the remote operation.
- Parameters:
resource
- REQUIRED: The resource for which the policy detail is being requested. See [Resource
names](https://cloud.google.com/apis/design/resource_names) for the appropriate value for
this field.
content
- the TestIamPermissionsRequest
- Returns:
- the request
- Throws:
IOException
-
snapshots
public Pubsub.Projects.Topics.Snapshots snapshots()
An accessor for creating requests from the Snapshots collection.
The typical use is:
Pubsub pubsub = new Pubsub(...);
Pubsub.Snapshots.List request = pubsub.snapshots().list(parameters ...)
- Returns:
- the resource collection
-
subscriptions
public Pubsub.Projects.Topics.Subscriptions subscriptions()
An accessor for creating requests from the Subscriptions collection.
The typical use is:
Pubsub pubsub = new Pubsub(...);
Pubsub.Subscriptions.List request = pubsub.subscriptions().list(parameters ...)
- Returns:
- the resource collection
Copyright © 2011–2024 Google. All rights reserved.