Google Cloud Monitoring v3 API - Class NotificationChannelServiceClient (3.5.0)

public abstract class NotificationChannelServiceClient

Reference documentation and code samples for the Google Cloud Monitoring v3 API class NotificationChannelServiceClient.

NotificationChannelService client wrapper, for convenient use.

Inheritance

object > NotificationChannelServiceClient

Namespace

Google.Cloud.Monitoring.V3

Assembly

Google.Cloud.Monitoring.V3.dll

Remarks

The Notification Channel API provides access to configuration that controls how messages related to incidents are sent.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
TypeDescription
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default NotificationChannelService scopes.

Property Value
TypeDescription
IReadOnlyListstring
Remarks

GrpcClient

public virtual NotificationChannelService.NotificationChannelServiceClient GrpcClient { get; }

The underlying gRPC NotificationChannelService client

Property Value
TypeDescription
NotificationChannelServiceNotificationChannelServiceClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
TypeDescription
ServiceMetadata

Methods

Create()

public static NotificationChannelServiceClient Create()

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

Returns
TypeDescription
NotificationChannelServiceClient

The created NotificationChannelServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
NameDescription
cancellationTokenCancellationToken

The CancellationToken to use while creating the client.

Returns
TypeDescription
TaskNotificationChannelServiceClient

The task representing the created NotificationChannelServiceClient.

CreateNotificationChannel(IResourceName, NotificationChannel, CallSettings)

public virtual NotificationChannel CreateNotificationChannel(IResourceName name, NotificationChannel notificationChannel, CallSettings callSettings = null)

Creates a new notification channel, representing a single notification endpoint such as an email address, SMS number, or PagerDuty service.

Design your application to single-thread API calls that modify the state of notification channels in a single project. This includes calls to CreateNotificationChannel, DeleteNotificationChannel and UpdateNotificationChannel.

Parameters
NameDescription
nameIResourceName

Required. The project on which to execute the request. The format is:

projects/[PROJECT_ID_OR_NUMBER]

This names the container into which the channel will be written, this does not name the newly created channel. The resulting channel's name will have a normalized version of this field as a prefix, but will add /notificationChannels/[CHANNEL_ID] to identify the channel.

notificationChannelNotificationChannel

Required. The definition of the NotificationChannel to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
NotificationChannel

The RPC response.

Example
// Create client
NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.Create();
// Initialize request argument(s)
IResourceName name = new UnparsedResourceName("a/wildcard/resource");
NotificationChannel notificationChannel = new NotificationChannel();
// Make the request
NotificationChannel response = notificationChannelServiceClient.CreateNotificationChannel(name, notificationChannel);

CreateNotificationChannel(FolderName, NotificationChannel, CallSettings)

public virtual NotificationChannel CreateNotificationChannel(FolderName name, NotificationChannel notificationChannel, CallSettings callSettings = null)

Creates a new notification channel, representing a single notification endpoint such as an email address, SMS number, or PagerDuty service.

Design your application to single-thread API calls that modify the state of notification channels in a single project. This includes calls to CreateNotificationChannel, DeleteNotificationChannel and UpdateNotificationChannel.

Parameters
NameDescription
nameFolderName

Required. The project on which to execute the request. The format is:

projects/[PROJECT_ID_OR_NUMBER]

This names the container into which the channel will be written, this does not name the newly created channel. The resulting channel's name will have a normalized version of this field as a prefix, but will add /notificationChannels/[CHANNEL_ID] to identify the channel.

notificationChannelNotificationChannel

Required. The definition of the NotificationChannel to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
NotificationChannel

The RPC response.

Example
// Create client
NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.Create();
// Initialize request argument(s)
FolderName name = FolderName.FromFolder("[FOLDER]");
NotificationChannel notificationChannel = new NotificationChannel();
// Make the request
NotificationChannel response = notificationChannelServiceClient.CreateNotificationChannel(name, notificationChannel);

CreateNotificationChannel(OrganizationName, NotificationChannel, CallSettings)

public virtual NotificationChannel CreateNotificationChannel(OrganizationName name, NotificationChannel notificationChannel, CallSettings callSettings = null)

Creates a new notification channel, representing a single notification endpoint such as an email address, SMS number, or PagerDuty service.

Design your application to single-thread API calls that modify the state of notification channels in a single project. This includes calls to CreateNotificationChannel, DeleteNotificationChannel and UpdateNotificationChannel.

Parameters
NameDescription
nameOrganizationName

Required. The project on which to execute the request. The format is:

projects/[PROJECT_ID_OR_NUMBER]

This names the container into which the channel will be written, this does not name the newly created channel. The resulting channel's name will have a normalized version of this field as a prefix, but will add /notificationChannels/[CHANNEL_ID] to identify the channel.

notificationChannelNotificationChannel

Required. The definition of the NotificationChannel to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
NotificationChannel

The RPC response.

Example
// Create client
NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.Create();
// Initialize request argument(s)
OrganizationName name = OrganizationName.FromOrganization("[ORGANIZATION]");
NotificationChannel notificationChannel = new NotificationChannel();
// Make the request
NotificationChannel response = notificationChannelServiceClient.CreateNotificationChannel(name, notificationChannel);

CreateNotificationChannel(ProjectName, NotificationChannel, CallSettings)

public virtual NotificationChannel CreateNotificationChannel(ProjectName name, NotificationChannel notificationChannel, CallSettings callSettings = null)

Creates a new notification channel, representing a single notification endpoint such as an email address, SMS number, or PagerDuty service.

Design your application to single-thread API calls that modify the state of notification channels in a single project. This includes calls to CreateNotificationChannel, DeleteNotificationChannel and UpdateNotificationChannel.

Parameters
NameDescription
nameProjectName

Required. The project on which to execute the request. The format is:

projects/[PROJECT_ID_OR_NUMBER]

This names the container into which the channel will be written, this does not name the newly created channel. The resulting channel's name will have a normalized version of this field as a prefix, but will add /notificationChannels/[CHANNEL_ID] to identify the channel.

notificationChannelNotificationChannel

Required. The definition of the NotificationChannel to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
NotificationChannel

The RPC response.

Example
// Create client
NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.Create();
// Initialize request argument(s)
ProjectName name = ProjectName.FromProject("[PROJECT]");
NotificationChannel notificationChannel = new NotificationChannel();
// Make the request
NotificationChannel response = notificationChannelServiceClient.CreateNotificationChannel(name, notificationChannel);

CreateNotificationChannel(CreateNotificationChannelRequest, CallSettings)

public virtual NotificationChannel CreateNotificationChannel(CreateNotificationChannelRequest request, CallSettings callSettings = null)

Creates a new notification channel, representing a single notification endpoint such as an email address, SMS number, or PagerDuty service.

Design your application to single-thread API calls that modify the state of notification channels in a single project. This includes calls to CreateNotificationChannel, DeleteNotificationChannel and UpdateNotificationChannel.

Parameters
NameDescription
requestCreateNotificationChannelRequest

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

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
NotificationChannel

The RPC response.

Example
// Create client
NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.Create();
// Initialize request argument(s)
CreateNotificationChannelRequest request = new CreateNotificationChannelRequest
{
    NotificationChannel = new NotificationChannel(),
    ProjectName = ProjectName.FromProject("[PROJECT]"),
};
// Make the request
NotificationChannel response = notificationChannelServiceClient.CreateNotificationChannel(request);

CreateNotificationChannel(string, NotificationChannel, CallSettings)

public virtual NotificationChannel CreateNotificationChannel(string name, NotificationChannel notificationChannel, CallSettings callSettings = null)

Creates a new notification channel, representing a single notification endpoint such as an email address, SMS number, or PagerDuty service.

Design your application to single-thread API calls that modify the state of notification channels in a single project. This includes calls to CreateNotificationChannel, DeleteNotificationChannel and UpdateNotificationChannel.

Parameters
NameDescription
namestring

Required. The project on which to execute the request. The format is:

projects/[PROJECT_ID_OR_NUMBER]

This names the container into which the channel will be written, this does not name the newly created channel. The resulting channel's name will have a normalized version of this field as a prefix, but will add /notificationChannels/[CHANNEL_ID] to identify the channel.

notificationChannelNotificationChannel

Required. The definition of the NotificationChannel to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
NotificationChannel

The RPC response.

Example
// Create client
NotificationChannelServiceClient notificationChannelServiceClient = NotificationChannelServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]";
NotificationChannel notificationChannel = new NotificationChannel();
// Make the request
NotificationChannel response = notificationChannelServiceClient.CreateNotificationChannel(name, notificationChannel);

CreateNotificationChannelAsync(IResourceName, NotificationChannel, CallSettings)

public virtual Task<NotificationChannel> CreateNotificationChannelAsync(IResourceName name, NotificationChannel notificationChannel, CallSettings callSettings = null)

Creates a new notification channel, representing a single notification endpoint such as an email address, SMS number, or PagerDuty service.

Design your application to single-thread API calls that modify the state of notification channels in a single project. This includes calls to CreateNotificationChannel, DeleteNotificationChannel and UpdateNotificationChannel.

Parameters
NameDescription
nameIResourceName

Required. The project on which to execute the request. The format is:

projects/[PROJECT_ID_OR_NUMBER]

This names the container into which the channel will be written, this does not name the newly created channel. The resulting channel's name will have a normalized version of this field as a prefix, but will add /notificationChannels/[CHANNEL_ID] to identify the channel.

notificationChannelNotificationChannel

Required. The definition of the NotificationChannel to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskNotificationChannel

A Task containing the RPC response.

Example
// Create client
NotificationChannelServiceClient notificationChannelServiceClient = await NotificationChannelServiceClient.CreateAsync();
// Initialize request argument(s)
IResourceName name = new UnparsedResourceName("a/wildcard/resource");
NotificationChannel notificationChannel = new NotificationChannel();
// Make the request
NotificationChannel response = await notificationChannelServiceClient.CreateNotificationChannelAsync(name, notificationChannel);

CreateNotificationChannelAsync(IResourceName, NotificationChannel, CancellationToken)

public virtual Task<NotificationChannel> CreateNotificationChannelAsync(IResourceName name, NotificationChannel notificationChannel, CancellationToken cancellationToken)

Creates a new notification channel, representing a single notification endpoint such as an email address, SMS number, or PagerDuty service.

Design your application to single-thread API calls that modify the state of notification channels in a single project. This includes calls to CreateNotificationChannel, DeleteNotificationChannel and UpdateNotificationChannel.

Parameters
NameDescription
nameIResourceName

Required. The project on which to execute the request. The format is:

projects/[PROJECT_ID_OR_NUMBER]

This names the container into which the channel will be written, this does not name the newly created channel. The resulting channel's name will have a normalized version of this field as a prefix, but will add /notificationChannels/[CHANNEL_ID] to identify the channel.

notificationChannelNotificationChannel

Required. The definition of the NotificationChannel to create.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskNotificationChannel

A Task containing the RPC response.

Example
// Create client
NotificationChannelServiceClient notificationChannelServiceClient = await NotificationChannelServiceClient.CreateAsync();
// Initialize request argument(s)
IResourceName name = new UnparsedResourceName("a/wildcard/resource");
NotificationChannel notificationChannel = new NotificationChannel();
// Make the request
NotificationChannel response = await notificationChannelServiceClient.CreateNotificationChannelAsync(name, notificationChannel);

CreateNotificationChannelAsync(FolderName, NotificationChannel, CallSettings)

public virtual Task<NotificationChannel> CreateNotificationChannelAsync(FolderName name, NotificationChannel notificationChannel, CallSettings callSettings = null)

Creates a new notification channel, representing a single notification endpoint such as an email address, SMS number, or PagerDuty service.

Design your application to single-thread API calls that modify the state of notification channels in a single project. This includes calls to CreateNotificationChannel, DeleteNotificationChannel and UpdateNotificationChannel.

Parameters
NameDescription
nameFolderName

Required. The project on which to execute the request. The format is:

projects/[PROJECT_ID_OR_NUMBER]

This names the container into which the channel will be written, this does not name the newly created channel. The resulting channel's name will have a normalized version of this field as a prefix, but will add /notificationChannels/[CHANNEL_ID] to identify the channel.

notificationChannelNotificationChannel

Required. The definition of the NotificationChannel to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskNotificationChannel

A Task containing the RPC response.

Example
// Create client
NotificationChannelServiceClient notificationChannelServiceClient = await NotificationChannelServiceClient.CreateAsync();
// Initialize request argument(s)
FolderName name = FolderName.FromFolder("[FOLDER]");
NotificationChannel notificationChannel = new NotificationChannel();
// Make the request
NotificationChannel response = await notificationChannelServiceClient.CreateNotificationChannelAsync(name, notificationChannel);

CreateNotificationChannelAsync(FolderName, NotificationChannel, CancellationToken)

public virtual Task<NotificationChannel> CreateNotificationChannelAsync(FolderName name, NotificationChannel notificationChannel, CancellationToken cancellationToken)

Creates a new notification channel, representing a single notification endpoint such as an email address, SMS number, or PagerDuty service.

Design your application to single-thread API calls that modify the state of notification channels in a single project. This includes calls to CreateNotificationChannel, DeleteNotificationChannel and UpdateNotificationChannel.

Parameters
NameDescription
nameFolderName

Required. The project on which to execute the request. The format is:

projects/[PROJECT_ID_OR_NUMBER]

This names the container into which the channel will be written, this does not name the newly created channel. The resulting channel's name will have a normalized version of this field as a prefix, but will add /notificationChannels/[CHANNEL_ID] to identify the channel.

notificationChannelNotificationChannel

Required. The definition of the NotificationChannel to create.

cancellationTokenCancellationToken

A CancellationToken to use for this RPC.

Returns
TypeDescription
TaskNotificationChannel

A Task containing the RPC response.

Example
// Create client
NotificationChannelServiceClient notificationChannelServiceClient = await NotificationChannelServiceClient.CreateAsync();
// Initialize request argument(s)
FolderName name = FolderName.FromFolder("[FOLDER]");
NotificationChannel notificationChannel = new NotificationChannel();
// Make the request
NotificationChannel response = await notificationChannelServiceClient.CreateNotificationChannelAsync(name, notificationChannel);

CreateNotificationChannelAsync(OrganizationName, NotificationChannel, CallSettings)

public virtual Task<NotificationChannel> CreateNotificationChannelAsync(OrganizationName name, NotificationChannel notificationChannel, CallSettings callSettings = null)

Creates a new notification channel, representing a single notification endpoint such as an email address, SMS number, or PagerDuty service.

Design your application to single-thread API calls that modify the state of notification channels in a single project. This includes calls to CreateNotificationChannel, DeleteNotificationChannel and UpdateNotificationChannel.

Parameters
NameDescription
nameOrganizationName

Required. The project on which to execute the request. The format is:

projects/[PROJECT_ID_OR_NUMBER]

This names the container into which the channel will be written, this does not name the newly created channel. The resulting channel's name will have a normalized version of this field as a prefix, but will add /notificationChannels/[CHANNEL_ID] to identify the channel.

notificationChannelNotificationChannel

Required. The definition of the NotificationChannel to create.

callSettingsCallSettings

If not null, applies overrides to this RPC call.

Returns
TypeDescription
TaskNotificationChannel

A Task containing the RPC response.

Example
// Create client
NotificationChannelServiceClient notificationChannelServiceClient = await NotificationChannelServiceClient.CreateAsync();
// Initialize request argument(s)
OrganizationName name = OrganizationName.FromOrganization("[ORGANIZATION]");
NotificationChannel notificationChannel = new NotificationChannel();
// Make the request
NotificationChannel response