public abstract class AdvisoryNotificationsServiceClient
Reference documentation and code samples for the Advisory Notifications v1 API class AdvisoryNotificationsServiceClient.
AdvisoryNotificationsService client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.AdvisoryNotifications.V1Assembly
Google.Cloud.AdvisoryNotifications.V1.dll
Remarks
Service to manage Security and Privacy Notifications.
Properties
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the AdvisoryNotificationsService service, which is a host of "advisorynotifications.googleapis.com" and a port of 443.
Property Value | |
---|---|
Type | Description |
string |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default AdvisoryNotificationsService scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyListstring |
The default AdvisoryNotificationsService scopes are:
GrpcClient
public virtual AdvisoryNotificationsService.AdvisoryNotificationsServiceClient GrpcClient { get; }
The underlying gRPC AdvisoryNotificationsService client
Property Value | |
---|---|
Type | Description |
AdvisoryNotificationsServiceAdvisoryNotificationsServiceClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Property Value | |
---|---|
Type | Description |
ServiceMetadata |
Methods
Create()
public static AdvisoryNotificationsServiceClient Create()
Synchronously creates a AdvisoryNotificationsServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AdvisoryNotificationsServiceClientBuilder.
Returns | |
---|---|
Type | Description |
AdvisoryNotificationsServiceClient |
The created AdvisoryNotificationsServiceClient. |
CreateAsync(CancellationToken)
public static Task<AdvisoryNotificationsServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Asynchronously creates a AdvisoryNotificationsServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use AdvisoryNotificationsServiceClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken |
CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
TaskAdvisoryNotificationsServiceClient |
The task representing the created AdvisoryNotificationsServiceClient. |
GetNotification(GetNotificationRequest, CallSettings)
public virtual Notification GetNotification(GetNotificationRequest request, CallSettings callSettings = null)
Gets a notification.
Parameters | |
---|---|
Name | Description |
request |
GetNotificationRequest 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 |
Notification |
The RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = AdvisoryNotificationsServiceClient.Create();
// Initialize request argument(s)
GetNotificationRequest request = new GetNotificationRequest
{
NotificationName = NotificationName.FromOrganizationLocationNotification("[ORGANIZATION]", "[LOCATION]", "[NOTIFICATION]"),
LanguageCode = "",
};
// Make the request
Notification response = advisoryNotificationsServiceClient.GetNotification(request);
GetNotification(NotificationName, CallSettings)
public virtual Notification GetNotification(NotificationName name, CallSettings callSettings = null)
Gets a notification.
Parameters | |
---|---|
Name | Description |
name |
NotificationName Required. A name of the notification to retrieve. Format: organizations/{organization}/locations/{location}/notifications/{notification} or projects/{projects}/locations/{location}/notifications/{notification}. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Notification |
The RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = AdvisoryNotificationsServiceClient.Create();
// Initialize request argument(s)
NotificationName name = NotificationName.FromOrganizationLocationNotification("[ORGANIZATION]", "[LOCATION]", "[NOTIFICATION]");
// Make the request
Notification response = advisoryNotificationsServiceClient.GetNotification(name);
GetNotification(string, CallSettings)
public virtual Notification GetNotification(string name, CallSettings callSettings = null)
Gets a notification.
Parameters | |
---|---|
Name | Description |
name |
string Required. A name of the notification to retrieve. Format: organizations/{organization}/locations/{location}/notifications/{notification} or projects/{projects}/locations/{location}/notifications/{notification}. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Notification |
The RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = AdvisoryNotificationsServiceClient.Create();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/notifications/[NOTIFICATION]";
// Make the request
Notification response = advisoryNotificationsServiceClient.GetNotification(name);
GetNotificationAsync(GetNotificationRequest, CallSettings)
public virtual Task<Notification> GetNotificationAsync(GetNotificationRequest request, CallSettings callSettings = null)
Gets a notification.
Parameters | |
---|---|
Name | Description |
request |
GetNotificationRequest 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 |
TaskNotification |
A Task containing the RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = await AdvisoryNotificationsServiceClient.CreateAsync();
// Initialize request argument(s)
GetNotificationRequest request = new GetNotificationRequest
{
NotificationName = NotificationName.FromOrganizationLocationNotification("[ORGANIZATION]", "[LOCATION]", "[NOTIFICATION]"),
LanguageCode = "",
};
// Make the request
Notification response = await advisoryNotificationsServiceClient.GetNotificationAsync(request);
GetNotificationAsync(GetNotificationRequest, CancellationToken)
public virtual Task<Notification> GetNotificationAsync(GetNotificationRequest request, CancellationToken cancellationToken)
Gets a notification.
Parameters | |
---|---|
Name | Description |
request |
GetNotificationRequest The request object containing all of the parameters for the API call. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskNotification |
A Task containing the RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = await AdvisoryNotificationsServiceClient.CreateAsync();
// Initialize request argument(s)
GetNotificationRequest request = new GetNotificationRequest
{
NotificationName = NotificationName.FromOrganizationLocationNotification("[ORGANIZATION]", "[LOCATION]", "[NOTIFICATION]"),
LanguageCode = "",
};
// Make the request
Notification response = await advisoryNotificationsServiceClient.GetNotificationAsync(request);
GetNotificationAsync(NotificationName, CallSettings)
public virtual Task<Notification> GetNotificationAsync(NotificationName name, CallSettings callSettings = null)
Gets a notification.
Parameters | |
---|---|
Name | Description |
name |
NotificationName Required. A name of the notification to retrieve. Format: organizations/{organization}/locations/{location}/notifications/{notification} or projects/{projects}/locations/{location}/notifications/{notification}. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskNotification |
A Task containing the RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = await AdvisoryNotificationsServiceClient.CreateAsync();
// Initialize request argument(s)
NotificationName name = NotificationName.FromOrganizationLocationNotification("[ORGANIZATION]", "[LOCATION]", "[NOTIFICATION]");
// Make the request
Notification response = await advisoryNotificationsServiceClient.GetNotificationAsync(name);
GetNotificationAsync(NotificationName, CancellationToken)
public virtual Task<Notification> GetNotificationAsync(NotificationName name, CancellationToken cancellationToken)
Gets a notification.
Parameters | |
---|---|
Name | Description |
name |
NotificationName Required. A name of the notification to retrieve. Format: organizations/{organization}/locations/{location}/notifications/{notification} or projects/{projects}/locations/{location}/notifications/{notification}. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskNotification |
A Task containing the RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = await AdvisoryNotificationsServiceClient.CreateAsync();
// Initialize request argument(s)
NotificationName name = NotificationName.FromOrganizationLocationNotification("[ORGANIZATION]", "[LOCATION]", "[NOTIFICATION]");
// Make the request
Notification response = await advisoryNotificationsServiceClient.GetNotificationAsync(name);
GetNotificationAsync(string, CallSettings)
public virtual Task<Notification> GetNotificationAsync(string name, CallSettings callSettings = null)
Gets a notification.
Parameters | |
---|---|
Name | Description |
name |
string Required. A name of the notification to retrieve. Format: organizations/{organization}/locations/{location}/notifications/{notification} or projects/{projects}/locations/{location}/notifications/{notification}. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskNotification |
A Task containing the RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = await AdvisoryNotificationsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/notifications/[NOTIFICATION]";
// Make the request
Notification response = await advisoryNotificationsServiceClient.GetNotificationAsync(name);
GetNotificationAsync(string, CancellationToken)
public virtual Task<Notification> GetNotificationAsync(string name, CancellationToken cancellationToken)
Gets a notification.
Parameters | |
---|---|
Name | Description |
name |
string Required. A name of the notification to retrieve. Format: organizations/{organization}/locations/{location}/notifications/{notification} or projects/{projects}/locations/{location}/notifications/{notification}. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskNotification |
A Task containing the RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = await AdvisoryNotificationsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/notifications/[NOTIFICATION]";
// Make the request
Notification response = await advisoryNotificationsServiceClient.GetNotificationAsync(name);
GetSettings(GetSettingsRequest, CallSettings)
public virtual Settings GetSettings(GetSettingsRequest request, CallSettings callSettings = null)
Get notification settings.
Parameters | |
---|---|
Name | Description |
request |
GetSettingsRequest 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 |
Settings |
The RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = AdvisoryNotificationsServiceClient.Create();
// Initialize request argument(s)
GetSettingsRequest request = new GetSettingsRequest
{
SettingsName = SettingsName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]"),
};
// Make the request
Settings response = advisoryNotificationsServiceClient.GetSettings(request);
GetSettings(SettingsName, CallSettings)
public virtual Settings GetSettings(SettingsName name, CallSettings callSettings = null)
Get notification settings.
Parameters | |
---|---|
Name | Description |
name |
SettingsName Required. The resource name of the settings to retrieve. Format: organizations/{organization}/locations/{location}/settings or projects/{projects}/locations/{location}/settings. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Settings |
The RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = AdvisoryNotificationsServiceClient.Create();
// Initialize request argument(s)
SettingsName name = SettingsName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]");
// Make the request
Settings response = advisoryNotificationsServiceClient.GetSettings(name);
GetSettings(string, CallSettings)
public virtual Settings GetSettings(string name, CallSettings callSettings = null)
Get notification settings.
Parameters | |
---|---|
Name | Description |
name |
string Required. The resource name of the settings to retrieve. Format: organizations/{organization}/locations/{location}/settings or projects/{projects}/locations/{location}/settings. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Settings |
The RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = AdvisoryNotificationsServiceClient.Create();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/settings";
// Make the request
Settings response = advisoryNotificationsServiceClient.GetSettings(name);
GetSettingsAsync(GetSettingsRequest, CallSettings)
public virtual Task<Settings> GetSettingsAsync(GetSettingsRequest request, CallSettings callSettings = null)
Get notification settings.
Parameters | |
---|---|
Name | Description |
request |
GetSettingsRequest 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 |
TaskSettings |
A Task containing the RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = await AdvisoryNotificationsServiceClient.CreateAsync();
// Initialize request argument(s)
GetSettingsRequest request = new GetSettingsRequest
{
SettingsName = SettingsName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]"),
};
// Make the request
Settings response = await advisoryNotificationsServiceClient.GetSettingsAsync(request);
GetSettingsAsync(GetSettingsRequest, CancellationToken)
public virtual Task<Settings> GetSettingsAsync(GetSettingsRequest request, CancellationToken cancellationToken)
Get notification settings.
Parameters | |
---|---|
Name | Description |
request |
GetSettingsRequest The request object containing all of the parameters for the API call. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSettings |
A Task containing the RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = await AdvisoryNotificationsServiceClient.CreateAsync();
// Initialize request argument(s)
GetSettingsRequest request = new GetSettingsRequest
{
SettingsName = SettingsName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]"),
};
// Make the request
Settings response = await advisoryNotificationsServiceClient.GetSettingsAsync(request);
GetSettingsAsync(SettingsName, CallSettings)
public virtual Task<Settings> GetSettingsAsync(SettingsName name, CallSettings callSettings = null)
Get notification settings.
Parameters | |
---|---|
Name | Description |
name |
SettingsName Required. The resource name of the settings to retrieve. Format: organizations/{organization}/locations/{location}/settings or projects/{projects}/locations/{location}/settings. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskSettings |
A Task containing the RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = await AdvisoryNotificationsServiceClient.CreateAsync();
// Initialize request argument(s)
SettingsName name = SettingsName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]");
// Make the request
Settings response = await advisoryNotificationsServiceClient.GetSettingsAsync(name);
GetSettingsAsync(SettingsName, CancellationToken)
public virtual Task<Settings> GetSettingsAsync(SettingsName name, CancellationToken cancellationToken)
Get notification settings.
Parameters | |
---|---|
Name | Description |
name |
SettingsName Required. The resource name of the settings to retrieve. Format: organizations/{organization}/locations/{location}/settings or projects/{projects}/locations/{location}/settings. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSettings |
A Task containing the RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = await AdvisoryNotificationsServiceClient.CreateAsync();
// Initialize request argument(s)
SettingsName name = SettingsName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]");
// Make the request
Settings response = await advisoryNotificationsServiceClient.GetSettingsAsync(name);
GetSettingsAsync(string, CallSettings)
public virtual Task<Settings> GetSettingsAsync(string name, CallSettings callSettings = null)
Get notification settings.
Parameters | |
---|---|
Name | Description |
name |
string Required. The resource name of the settings to retrieve. Format: organizations/{organization}/locations/{location}/settings or projects/{projects}/locations/{location}/settings. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskSettings |
A Task containing the RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = await AdvisoryNotificationsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/settings";
// Make the request
Settings response = await advisoryNotificationsServiceClient.GetSettingsAsync(name);
GetSettingsAsync(string, CancellationToken)
public virtual Task<Settings> GetSettingsAsync(string name, CancellationToken cancellationToken)
Get notification settings.
Parameters | |
---|---|
Name | Description |
name |
string Required. The resource name of the settings to retrieve. Format: organizations/{organization}/locations/{location}/settings or projects/{projects}/locations/{location}/settings. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSettings |
A Task containing the RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = await AdvisoryNotificationsServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "organizations/[ORGANIZATION]/locations/[LOCATION]/settings";
// Make the request
Settings response = await advisoryNotificationsServiceClient.GetSettingsAsync(name);
ListNotifications(ListNotificationsRequest, CallSettings)
public virtual PagedEnumerable<ListNotificationsResponse, Notification> ListNotifications(ListNotificationsRequest request, CallSettings callSettings = null)
Lists notifications under a given parent.
Parameters | |
---|---|
Name | Description |
request |
ListNotificationsRequest 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 |
PagedEnumerableListNotificationsResponseNotification |
A pageable sequence of Notification resources. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = AdvisoryNotificationsServiceClient.Create();
// Initialize request argument(s)
ListNotificationsRequest request = new ListNotificationsRequest
{
ParentAsLocationName = LocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]"),
View = NotificationView.Unspecified,
LanguageCode = "",
};
// Make the request
PagedEnumerable<ListNotificationsResponse, Notification> response = advisoryNotificationsServiceClient.ListNotifications(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Notification item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListNotificationsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Notification item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Notification> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Notification item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListNotifications(LocationName, string, int?, CallSettings)
public virtual PagedEnumerable<ListNotificationsResponse, Notification> ListNotifications(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists notifications under a given parent.
Parameters | |
---|---|
Name | Description |
parent |
LocationName Required. The parent, which owns this collection of notifications. Must be of the form "organizations/{organization}/locations/{location}" or "projects/{project}/locations/{location}". |
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListNotificationsResponseNotification |
A pageable sequence of Notification resources. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = AdvisoryNotificationsServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]");
// Make the request
PagedEnumerable<ListNotificationsResponse, Notification> response = advisoryNotificationsServiceClient.ListNotifications(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Notification item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListNotificationsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Notification item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Notification> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Notification item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListNotifications(string, string, int?, CallSettings)
public virtual PagedEnumerable<ListNotificationsResponse, Notification> ListNotifications(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists notifications under a given parent.
Parameters | |
---|---|
Name | Description |
parent |
string Required. The parent, which owns this collection of notifications. Must be of the form "organizations/{organization}/locations/{location}" or "projects/{project}/locations/{location}". |
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedEnumerableListNotificationsResponseNotification |
A pageable sequence of Notification resources. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = AdvisoryNotificationsServiceClient.Create();
// Initialize request argument(s)
string parent = "organizations/[ORGANIZATION]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListNotificationsResponse, Notification> response = advisoryNotificationsServiceClient.ListNotifications(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Notification item in response)
{
// Do something with each item
Console.WriteLine(item);
}
// Or iterate over pages (of server-defined size), performing one RPC per page
foreach (ListNotificationsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Notification item in page)
{
// Do something with each item
Console.WriteLine(item);
}
}
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Notification> singlePage = response.ReadPage(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Notification item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListNotificationsAsync(ListNotificationsRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListNotificationsResponse, Notification> ListNotificationsAsync(ListNotificationsRequest request, CallSettings callSettings = null)
Lists notifications under a given parent.
Parameters | |
---|---|
Name | Description |
request |
ListNotificationsRequest 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 |
PagedAsyncEnumerableListNotificationsResponseNotification |
A pageable asynchronous sequence of Notification resources. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = await AdvisoryNotificationsServiceClient.CreateAsync();
// Initialize request argument(s)
ListNotificationsRequest request = new ListNotificationsRequest
{
ParentAsLocationName = LocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]"),
View = NotificationView.Unspecified,
LanguageCode = "",
};
// Make the request
PagedAsyncEnumerable<ListNotificationsResponse, Notification> response = advisoryNotificationsServiceClient.ListNotificationsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Notification item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListNotificationsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Notification item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Notification> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Notification item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListNotificationsAsync(LocationName, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListNotificationsResponse, Notification> ListNotificationsAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists notifications under a given parent.
Parameters | |
---|---|
Name | Description |
parent |
LocationName Required. The parent, which owns this collection of notifications. Must be of the form "organizations/{organization}/locations/{location}" or "projects/{project}/locations/{location}". |
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableListNotificationsResponseNotification |
A pageable asynchronous sequence of Notification resources. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = await AdvisoryNotificationsServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromOrganizationLocation("[ORGANIZATION]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListNotificationsResponse, Notification> response = advisoryNotificationsServiceClient.ListNotificationsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Notification item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListNotificationsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Notification item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Notification> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Notification item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
ListNotificationsAsync(string, string, int?, CallSettings)
public virtual PagedAsyncEnumerable<ListNotificationsResponse, Notification> ListNotificationsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists notifications under a given parent.
Parameters | |
---|---|
Name | Description |
parent |
string Required. The parent, which owns this collection of notifications. Must be of the form "organizations/{organization}/locations/{location}" or "projects/{project}/locations/{location}". |
pageToken |
string The token returned from the previous request. A value of |
pageSize |
int The size of page to request. The response will not be larger than this, but may be smaller. A value of
|
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
PagedAsyncEnumerableListNotificationsResponseNotification |
A pageable asynchronous sequence of Notification resources. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = await AdvisoryNotificationsServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "organizations/[ORGANIZATION]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListNotificationsResponse, Notification> response = advisoryNotificationsServiceClient.ListNotificationsAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Notification item) =>
{
// Do something with each item
Console.WriteLine(item);
});
// Or iterate over pages (of server-defined size), performing one RPC per page
await response.AsRawResponses().ForEachAsync((ListNotificationsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Notification item in page)
{
// Do something with each item
Console.WriteLine(item);
}
});
// Or retrieve a single page of known size (unless it's the final page), performing as many RPCs as required
int pageSize = 10;
Page<Notification> singlePage = await response.ReadPageAsync(pageSize);
// Do something with the page of items
Console.WriteLine($"A page of {pageSize} results (unless it's the final page):");
foreach (Notification item in singlePage)
{
// Do something with each item
Console.WriteLine(item);
}
// Store the pageToken, for when the next page is required.
string nextPageToken = singlePage.NextPageToken;
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 | |
---|---|
Type | Description |
Task |
A task representing the asynchronous shutdown operation. |
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.
UpdateSettings(Settings, CallSettings)
public virtual Settings UpdateSettings(Settings settings, CallSettings callSettings = null)
Update notification settings.
Parameters | |
---|---|
Name | Description |
settings |
Settings Required. New settings. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Settings |
The RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = AdvisoryNotificationsServiceClient.Create();
// Initialize request argument(s)
Settings settings = new Settings();
// Make the request
Settings response = advisoryNotificationsServiceClient.UpdateSettings(settings);
UpdateSettings(UpdateSettingsRequest, CallSettings)
public virtual Settings UpdateSettings(UpdateSettingsRequest request, CallSettings callSettings = null)
Update notification settings.
Parameters | |
---|---|
Name | Description |
request |
UpdateSettingsRequest 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 |
Settings |
The RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = AdvisoryNotificationsServiceClient.Create();
// Initialize request argument(s)
UpdateSettingsRequest request = new UpdateSettingsRequest
{
Settings = new Settings(),
};
// Make the request
Settings response = advisoryNotificationsServiceClient.UpdateSettings(request);
UpdateSettingsAsync(Settings, CallSettings)
public virtual Task<Settings> UpdateSettingsAsync(Settings settings, CallSettings callSettings = null)
Update notification settings.
Parameters | |
---|---|
Name | Description |
settings |
Settings Required. New settings. |
callSettings |
CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
TaskSettings |
A Task containing the RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = await AdvisoryNotificationsServiceClient.CreateAsync();
// Initialize request argument(s)
Settings settings = new Settings();
// Make the request
Settings response = await advisoryNotificationsServiceClient.UpdateSettingsAsync(settings);
UpdateSettingsAsync(Settings, CancellationToken)
public virtual Task<Settings> UpdateSettingsAsync(Settings settings, CancellationToken cancellationToken)
Update notification settings.
Parameters | |
---|---|
Name | Description |
settings |
Settings Required. New settings. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSettings |
A Task containing the RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = await AdvisoryNotificationsServiceClient.CreateAsync();
// Initialize request argument(s)
Settings settings = new Settings();
// Make the request
Settings response = await advisoryNotificationsServiceClient.UpdateSettingsAsync(settings);
UpdateSettingsAsync(UpdateSettingsRequest, CallSettings)
public virtual Task<Settings> UpdateSettingsAsync(UpdateSettingsRequest request, CallSettings callSettings = null)
Update notification settings.
Parameters | |
---|---|
Name | Description |
request |
UpdateSettingsRequest 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 |
TaskSettings |
A Task containing the RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = await AdvisoryNotificationsServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSettingsRequest request = new UpdateSettingsRequest
{
Settings = new Settings(),
};
// Make the request
Settings response = await advisoryNotificationsServiceClient.UpdateSettingsAsync(request);
UpdateSettingsAsync(UpdateSettingsRequest, CancellationToken)
public virtual Task<Settings> UpdateSettingsAsync(UpdateSettingsRequest request, CancellationToken cancellationToken)
Update notification settings.
Parameters | |
---|---|
Name | Description |
request |
UpdateSettingsRequest The request object containing all of the parameters for the API call. |
cancellationToken |
CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
TaskSettings |
A Task containing the RPC response. |
// Create client
AdvisoryNotificationsServiceClient advisoryNotificationsServiceClient = await AdvisoryNotificationsServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSettingsRequest request = new UpdateSettingsRequest
{
Settings = new Settings(),
};
// Make the request
Settings response = await advisoryNotificationsServiceClient.UpdateSettingsAsync(request);