Class PublisherClient (1.0.0-beta02)

public abstract class PublisherClient

Publisher client wrapper, for convenient use.

Inheritance

Object > PublisherClient

Derived Types

Namespace

Google.Cloud.Eventarc.Publishing.V1

Assembly

Google.Cloud.Eventarc.Publishing.V1.dll

Remarks

Eventarc processes events generated by an event provider and delivers them to a subscriber.

An event provider is a software-as-a-service (SaaS) system or product that can generate and deliver events through Eventarc.

A third-party event provider is an event provider from outside of Google.

A partner is a third-party event provider that is integrated with Eventarc.

A subscriber is a GCP customer interested in receiving events.

Channel is a first-class Eventarc resource that is created and managed by the subscriber in their GCP project. A Channel represents a subscriber's intent to receive events from an event provider. A Channel is associated with exactly one event provider.

ChannelConnection is a first-class Eventarc resource that is created and managed by the partner in their GCP project. A ChannelConnection represents a connection between a partner and a subscriber's Channel. A ChannelConnection has a one-to-one mapping with a Channel.

Publisher allows an event provider to publish events to Eventarc.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

The default endpoint for the Publisher service, which is a host of "eventarcpublishing.googleapis.com" and a port of 443.

Property Value
TypeDescription
String

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default Publisher scopes.

Property Value
TypeDescription
IReadOnlyList<String>
Remarks

The default Publisher scopes are:

GrpcClient

public virtual Publisher.PublisherClient GrpcClient { get; }

The underlying gRPC Publisher client

Property Value
TypeDescription
Publisher.PublisherClient

Methods

Create()

public static PublisherClient Create()

Synchronously creates a PublisherClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use PublisherClientBuilder.

Returns
TypeDescription
PublisherClient

The created PublisherClient.

CreateAsync(CancellationToken)

public static Task<PublisherClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))

Asynchronously creates a PublisherClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use PublisherClientBuilder.

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
Task<PublisherClient>

The task representing the created PublisherClient.

PublishChannelConnectionEvents(PublishChannelConnectionEventsRequest, CallSettings)

public virtual PublishChannelConnectionEventsResponse PublishChannelConnectionEvents(PublishChannelConnectionEventsRequest request, CallSettings callSettings = null)

Publish events to a ChannelConnection in a partner's project.

Parameters
NameDescription
requestPublishChannelConnectionEventsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PublishChannelConnectionEventsResponse

The RPC response.

Example
// Create client
PublisherClient publisherClient = PublisherClient.Create();
// Initialize request argument(s)
PublishChannelConnectionEventsRequest request = new PublishChannelConnectionEventsRequest
{
    ChannelConnection = "",
    Events = { new Any(), },
};
// Make the request
PublishChannelConnectionEventsResponse response = publisherClient.PublishChannelConnectionEvents(request);

PublishChannelConnectionEventsAsync(PublishChannelConnectionEventsRequest, CallSettings)

public virtual Task<PublishChannelConnectionEventsResponse> PublishChannelConnectionEventsAsync(PublishChannelConnectionEventsRequest request, CallSettings callSettings = null)

Publish events to a ChannelConnection in a partner's project.

Parameters
NameDescription
requestPublishChannelConnectionEventsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<PublishChannelConnectionEventsResponse>

A Task containing the RPC response.

Example
// Create client
PublisherClient publisherClient = await PublisherClient.CreateAsync();
// Initialize request argument(s)
PublishChannelConnectionEventsRequest request = new PublishChannelConnectionEventsRequest
{
    ChannelConnection = "",
    Events = { new Any(), },
};
// Make the request
PublishChannelConnectionEventsResponse response = await publisherClient.PublishChannelConnectionEventsAsync(request);

PublishChannelConnectionEventsAsync(PublishChannelConnectionEventsRequest, CancellationToken)

public virtual Task<PublishChannelConnectionEventsResponse> PublishChannelConnectionEventsAsync(PublishChannelConnectionEventsRequest request, CancellationToken cancellationToken)

Publish events to a ChannelConnection in a partner's project.

Parameters
NameDescription
requestPublishChannelConnectionEventsRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<PublishChannelConnectionEventsResponse>

A Task containing the RPC response.

Example
// Create client
PublisherClient publisherClient = await PublisherClient.CreateAsync();
// Initialize request argument(s)
PublishChannelConnectionEventsRequest request = new PublishChannelConnectionEventsRequest
{
    ChannelConnection = "",
    Events = { new Any(), },
};
// Make the request
PublishChannelConnectionEventsResponse response = await publisherClient.PublishChannelConnectionEventsAsync(request);

PublishEvents(PublishEventsRequest, CallSettings)

public virtual PublishEventsResponse PublishEvents(PublishEventsRequest request, CallSettings callSettings = null)

Publish events to a subscriber's channel.

Parameters
NameDescription
requestPublishEventsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
PublishEventsResponse

The RPC response.

Example
// Create client
PublisherClient publisherClient = PublisherClient.Create();
// Initialize request argument(s)
PublishEventsRequest request = new PublishEventsRequest
{
    Channel = "",
    Events = { new Any(), },
};
// Make the request
PublishEventsResponse response = publisherClient.PublishEvents(request);

PublishEventsAsync(PublishEventsRequest, CallSettings)

public virtual Task<PublishEventsResponse> PublishEventsAsync(PublishEventsRequest request, CallSettings callSettings = null)

Publish events to a subscriber's channel.

Parameters
NameDescription
requestPublishEventsRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
Task<PublishEventsResponse>

A Task containing the RPC response.

Example
// Create client
PublisherClient publisherClient = await PublisherClient.CreateAsync();
// Initialize request argument(s)
PublishEventsRequest request = new PublishEventsRequest
{
    Channel = "",
    Events = { new Any(), },
};
// Make the request
PublishEventsResponse response = await publisherClient.PublishEventsAsync(request);

PublishEventsAsync(PublishEventsRequest, CancellationToken)

public virtual Task<PublishEventsResponse> PublishEventsAsync(PublishEventsRequest request, CancellationToken cancellationToken)

Publish events to a subscriber's channel.

Parameters
NameDescription
requestPublishEventsRequest

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

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
Task<PublishEventsResponse>

A Task containing the RPC response.

Example
// Create client
PublisherClient publisherClient = await PublisherClient.CreateAsync();
// Initialize request argument(s)
PublishEventsRequest request = new PublishEventsRequest
{
    Channel = "",
    Events = { new Any(), },
};
// Make the request
PublishEventsResponse response = await publisherClient.PublishEventsAsync(request);

ShutdownDefaultChannelsAsync()

public static Task ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Returns
TypeDescription
Task

A task representing the asynchronous shutdown operation.

Remarks

After calling this method, further calls to Create() and CreateAsync(CancellationToken) will create new channels, which could in turn be shut down by another call to this method.