Cloud Pub/Sub v1 API - Class PublisherServiceApiClientImpl (3.17.0)

public sealed class PublisherServiceApiClientImpl : PublisherServiceApiClient

Reference documentation and code samples for the Cloud Pub/Sub v1 API class PublisherServiceApiClientImpl.

PublisherServiceApi client wrapper implementation, for convenient use.

Inheritance

object > PublisherServiceApiClient > PublisherServiceApiClientImpl

Namespace

Google.Cloud.PubSub.V1

Assembly

Google.Cloud.PubSub.V1.dll

Remarks

The service that an application uses to manipulate topics, and to send messages to a topic.

Constructors

PublisherServiceApiClientImpl(PublisherClient, PublisherServiceApiSettings, ILogger)

public PublisherServiceApiClientImpl(Publisher.PublisherClient grpcClient, PublisherServiceApiSettings settings, ILogger logger)

Constructs a client wrapper for the PublisherServiceApi service, with the specified gRPC client and settings.

Parameters
Name Description
grpcClient PublisherPublisherClient

The underlying gRPC client.

settings PublisherServiceApiSettings

The base PublisherServiceApiSettings used within this client.

logger ILogger

Optional ILogger to use within this client.

Properties

GrpcClient

public override Publisher.PublisherClient GrpcClient { get; }

The underlying gRPC PublisherServiceApi client

Property Value
Type Description
PublisherPublisherClient
Overrides

IAMPolicyClient

public override IAMPolicyClient IAMPolicyClient { get; }

The IAMPolicyClient associated with this client.

Property Value
Type Description
IAMPolicyClient
Overrides

Methods

CreateTopic(Topic, CallSettings)

public override Topic CreateTopic(Topic request, CallSettings callSettings = null)

Creates the given topic with the given name. See the resource name rules.

Parameters
Name Description
request Topic

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Topic

The RPC response.

Overrides

CreateTopicAsync(Topic, CallSettings)

public override Task<Topic> CreateTopicAsync(Topic request, CallSettings callSettings = null)

Creates the given topic with the given name. See the resource name rules.

Parameters
Name Description
request Topic

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskTopic

A Task containing the RPC response.

Overrides

DeleteTopic(DeleteTopicRequest, CallSettings)

public override void DeleteTopic(DeleteTopicRequest request, CallSettings callSettings = null)

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_.

Parameters
Name Description
request DeleteTopicRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Overrides

DeleteTopicAsync(DeleteTopicRequest, CallSettings)

public override Task DeleteTopicAsync(DeleteTopicRequest request, CallSettings callSettings = null)

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_.

Parameters
Name Description
request DeleteTopicRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Overrides

DetachSubscription(DetachSubscriptionRequest, CallSettings)

public override DetachSubscriptionResponse DetachSubscription(DetachSubscriptionRequest request, CallSettings callSettings = null)

Detaches a subscription from this topic. All messages retained in the subscription are dropped. Subsequent Pull and StreamingPull requests will return FAILED_PRECONDITION. If the subscription is a push subscription, pushes to the endpoint will stop.

Parameters
Name Description
request DetachSubscriptionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
DetachSubscriptionResponse

The RPC response.

Overrides

DetachSubscriptionAsync(DetachSubscriptionRequest, CallSettings)

public override Task<DetachSubscriptionResponse> DetachSubscriptionAsync(DetachSubscriptionRequest request, CallSettings callSettings = null)

Detaches a subscription from this topic. All messages retained in the subscription are dropped. Subsequent Pull and StreamingPull requests will return FAILED_PRECONDITION. If the subscription is a push subscription, pushes to the endpoint will stop.

Parameters
Name Description
request DetachSubscriptionRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskDetachSubscriptionResponse

A Task containing the RPC response.

Overrides

GetTopic(GetTopicRequest, CallSettings)

public override Topic GetTopic(GetTopicRequest request, CallSettings callSettings = null)

Gets the configuration of a topic.

Parameters
Name Description
request GetTopicRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Topic

The RPC response.

Overrides

GetTopicAsync(GetTopicRequest, CallSettings)

public override Task<Topic> GetTopicAsync(GetTopicRequest request, CallSettings callSettings = null)

Gets the configuration of a topic.

Parameters
Name Description
request GetTopicRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskTopic

A Task containing the RPC response.

Overrides

ListTopicSnapshots(ListTopicSnapshotsRequest, CallSettings)

public override PagedEnumerable<ListTopicSnapshotsResponse, string> ListTopicSnapshots(ListTopicSnapshotsRequest request, CallSettings callSettings = null)

Lists the names of the snapshots on this topic. Snapshots are used in Seek operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

Parameters
Name Description
request ListTopicSnapshotsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListTopicSnapshotsResponsestring

A pageable sequence of string resources.

Overrides

ListTopicSnapshotsAsync(ListTopicSnapshotsRequest, CallSettings)

public override PagedAsyncEnumerable<ListTopicSnapshotsResponse, string> ListTopicSnapshotsAsync(ListTopicSnapshotsRequest request, CallSettings callSettings = null)

Lists the names of the snapshots on this topic. Snapshots are used in Seek operations, which allow you to manage message acknowledgments in bulk. That is, you can set the acknowledgment state of messages in an existing subscription to the state captured by a snapshot.

Parameters
Name Description
request ListTopicSnapshotsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListTopicSnapshotsResponsestring

A pageable asynchronous sequence of string resources.

Overrides

ListTopicSubscriptions(ListTopicSubscriptionsRequest, CallSettings)

public override PagedEnumerable<ListTopicSubscriptionsResponse, string> ListTopicSubscriptions(ListTopicSubscriptionsRequest request, CallSettings callSettings = null)

Lists the names of the attached subscriptions on this topic.

Parameters
Name Description
request ListTopicSubscriptionsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListTopicSubscriptionsResponsestring

A pageable sequence of string resources.

Overrides

ListTopicSubscriptionsAsync(ListTopicSubscriptionsRequest, CallSettings)

public override PagedAsyncEnumerable<ListTopicSubscriptionsResponse, string> ListTopicSubscriptionsAsync(ListTopicSubscriptionsRequest request, CallSettings callSettings = null)

Lists the names of the attached subscriptions on this topic.

Parameters
Name Description
request ListTopicSubscriptionsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListTopicSubscriptionsResponsestring

A pageable asynchronous sequence of string resources.

Overrides

ListTopics(ListTopicsRequest, CallSettings)

public override PagedEnumerable<ListTopicsResponse, Topic> ListTopics(ListTopicsRequest request, CallSettings callSettings = null)

Lists matching topics.

Parameters
Name Description
request ListTopicsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListTopicsResponseTopic

A pageable sequence of Topic resources.

Overrides

ListTopicsAsync(ListTopicsRequest, CallSettings)

public override PagedAsyncEnumerable<ListTopicsResponse, Topic> ListTopicsAsync(ListTopicsRequest request, CallSettings callSettings = null)

Lists matching topics.

Parameters
Name Description
request ListTopicsRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListTopicsResponseTopic

A pageable asynchronous sequence of Topic resources.

Overrides

Publish(PublishRequest, CallSettings)

public override PublishResponse Publish(PublishRequest request, CallSettings callSettings = null)

Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist.

Parameters
Name Description
request PublishRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PublishResponse

The RPC response.

Overrides

PublishAsync(PublishRequest, CallSettings)

public override Task<PublishResponse> PublishAsync(PublishRequest request, CallSettings callSettings = null)

Adds one or more messages to the topic. Returns NOT_FOUND if the topic does not exist.

Parameters
Name Description
request PublishRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskPublishResponse

A Task containing the RPC response.

Overrides

UpdateTopic(UpdateTopicRequest, CallSettings)

public override Topic UpdateTopic(UpdateTopicRequest request, CallSettings callSettings = null)

Updates an existing topic by updating the fields specified in the update mask. Note that certain properties of a topic are not modifiable.

Parameters
Name Description
request UpdateTopicRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Topic

The RPC response.

Overrides

UpdateTopicAsync(UpdateTopicRequest, CallSettings)

public override Task<Topic> UpdateTopicAsync(UpdateTopicRequest request, CallSettings callSettings = null)

Updates an existing topic by updating the fields specified in the update mask. Note that certain properties of a topic are not modifiable.

Parameters
Name Description
request UpdateTopicRequest

The request object containing all of the parameters for the API call.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskTopic

A Task containing the RPC response.

Overrides