public abstract class SnoozeServiceClient
Reference documentation and code samples for the Google Cloud Monitoring v3 API class SnoozeServiceClient.
SnoozeService client wrapper, for convenient use.
Derived Types
Namespace
Google.Cloud.Monitoring.V3Assembly
Google.Cloud.Monitoring.V3.dll
Remarks
The SnoozeService API is used to temporarily prevent an alert policy from generating alerts. A Snooze is a description of the criteria under which one or more alert policies should not fire alerts for the specified duration.
Properties
DefaultEndpoint
public static string DefaultEndpoint { get; }
The default endpoint for the SnoozeService service, which is a host of "monitoring.googleapis.com" and a port of 443.
Property Value | |
---|---|
Type | Description |
String |
DefaultScopes
public static IReadOnlyList<string> DefaultScopes { get; }
The default SnoozeService scopes.
Property Value | |
---|---|
Type | Description |
IReadOnlyList<String> |
The default SnoozeService scopes are:
GrpcClient
public virtual SnoozeService.SnoozeServiceClient GrpcClient { get; }
The underlying gRPC SnoozeService client
Property Value | |
---|---|
Type | Description |
SnoozeService.SnoozeServiceClient |
ServiceMetadata
public static ServiceMetadata ServiceMetadata { get; }
The service metadata associated with this client type.
Property Value | |
---|---|
Type | Description |
ServiceMetadata |
Methods
Create()
public static SnoozeServiceClient Create()
Synchronously creates a SnoozeServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use SnoozeServiceClientBuilder.
Returns | |
---|---|
Type | Description |
SnoozeServiceClient | The created SnoozeServiceClient. |
CreateAsync(CancellationToken)
public static Task<SnoozeServiceClient> CreateAsync(CancellationToken cancellationToken = default(CancellationToken))
Asynchronously creates a SnoozeServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use SnoozeServiceClientBuilder.
Parameter | |
---|---|
Name | Description |
cancellationToken | CancellationToken The CancellationToken to use while creating the client. |
Returns | |
---|---|
Type | Description |
Task<SnoozeServiceClient> | The task representing the created SnoozeServiceClient. |
CreateSnooze(ProjectName, Snooze, CallSettings)
public virtual Snooze CreateSnooze(ProjectName parent, Snooze snooze, CallSettings callSettings = null)
Creates a Snooze
that will prevent alerts, which match the provided
criteria, from being opened. The Snooze
applies for a specific time
interval.
Parameters | |
---|---|
Name | Description |
parent | ProjectName Required. The
project in which
a projects/[PROJECT_ID_OR_NUMBER] |
snooze | Snooze Required. The |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Snooze | The RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
Snooze snooze = new Snooze();
// Make the request
Snooze response = snoozeServiceClient.CreateSnooze(parent, snooze);
CreateSnooze(CreateSnoozeRequest, CallSettings)
public virtual Snooze CreateSnooze(CreateSnoozeRequest request, CallSettings callSettings = null)
Creates a Snooze
that will prevent alerts, which match the provided
criteria, from being opened. The Snooze
applies for a specific time
interval.
Parameters | |
---|---|
Name | Description |
request | CreateSnoozeRequest 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 |
Snooze | The RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.Create();
// Initialize request argument(s)
CreateSnoozeRequest request = new CreateSnoozeRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
Snooze = new Snooze(),
};
// Make the request
Snooze response = snoozeServiceClient.CreateSnooze(request);
CreateSnooze(String, Snooze, CallSettings)
public virtual Snooze CreateSnooze(string parent, Snooze snooze, CallSettings callSettings = null)
Creates a Snooze
that will prevent alerts, which match the provided
criteria, from being opened. The Snooze
applies for a specific time
interval.
Parameters | |
---|---|
Name | Description |
parent | String Required. The
project in which
a projects/[PROJECT_ID_OR_NUMBER] |
snooze | Snooze Required. The |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Snooze | The RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
Snooze snooze = new Snooze();
// Make the request
Snooze response = snoozeServiceClient.CreateSnooze(parent, snooze);
CreateSnoozeAsync(ProjectName, Snooze, CallSettings)
public virtual Task<Snooze> CreateSnoozeAsync(ProjectName parent, Snooze snooze, CallSettings callSettings = null)
Creates a Snooze
that will prevent alerts, which match the provided
criteria, from being opened. The Snooze
applies for a specific time
interval.
Parameters | |
---|---|
Name | Description |
parent | ProjectName Required. The
project in which
a projects/[PROJECT_ID_OR_NUMBER] |
snooze | Snooze Required. The |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Snooze> | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
Snooze snooze = new Snooze();
// Make the request
Snooze response = await snoozeServiceClient.CreateSnoozeAsync(parent, snooze);
CreateSnoozeAsync(ProjectName, Snooze, CancellationToken)
public virtual Task<Snooze> CreateSnoozeAsync(ProjectName parent, Snooze snooze, CancellationToken cancellationToken)
Creates a Snooze
that will prevent alerts, which match the provided
criteria, from being opened. The Snooze
applies for a specific time
interval.
Parameters | |
---|---|
Name | Description |
parent | ProjectName Required. The
project in which
a projects/[PROJECT_ID_OR_NUMBER] |
snooze | Snooze Required. The |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Snooze> | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
Snooze snooze = new Snooze();
// Make the request
Snooze response = await snoozeServiceClient.CreateSnoozeAsync(parent, snooze);
CreateSnoozeAsync(CreateSnoozeRequest, CallSettings)
public virtual Task<Snooze> CreateSnoozeAsync(CreateSnoozeRequest request, CallSettings callSettings = null)
Creates a Snooze
that will prevent alerts, which match the provided
criteria, from being opened. The Snooze
applies for a specific time
interval.
Parameters | |
---|---|
Name | Description |
request | CreateSnoozeRequest 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<Snooze> | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSnoozeRequest request = new CreateSnoozeRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
Snooze = new Snooze(),
};
// Make the request
Snooze response = await snoozeServiceClient.CreateSnoozeAsync(request);
CreateSnoozeAsync(CreateSnoozeRequest, CancellationToken)
public virtual Task<Snooze> CreateSnoozeAsync(CreateSnoozeRequest request, CancellationToken cancellationToken)
Creates a Snooze
that will prevent alerts, which match the provided
criteria, from being opened. The Snooze
applies for a specific time
interval.
Parameters | |
---|---|
Name | Description |
request | CreateSnoozeRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Snooze> | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
CreateSnoozeRequest request = new CreateSnoozeRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
Snooze = new Snooze(),
};
// Make the request
Snooze response = await snoozeServiceClient.CreateSnoozeAsync(request);
CreateSnoozeAsync(String, Snooze, CallSettings)
public virtual Task<Snooze> CreateSnoozeAsync(string parent, Snooze snooze, CallSettings callSettings = null)
Creates a Snooze
that will prevent alerts, which match the provided
criteria, from being opened. The Snooze
applies for a specific time
interval.
Parameters | |
---|---|
Name | Description |
parent | String Required. The
project in which
a projects/[PROJECT_ID_OR_NUMBER] |
snooze | Snooze Required. The |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Snooze> | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
Snooze snooze = new Snooze();
// Make the request
Snooze response = await snoozeServiceClient.CreateSnoozeAsync(parent, snooze);
CreateSnoozeAsync(String, Snooze, CancellationToken)
public virtual Task<Snooze> CreateSnoozeAsync(string parent, Snooze snooze, CancellationToken cancellationToken)
Creates a Snooze
that will prevent alerts, which match the provided
criteria, from being opened. The Snooze
applies for a specific time
interval.
Parameters | |
---|---|
Name | Description |
parent | String Required. The
project in which
a projects/[PROJECT_ID_OR_NUMBER] |
snooze | Snooze Required. The |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Snooze> | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
Snooze snooze = new Snooze();
// Make the request
Snooze response = await snoozeServiceClient.CreateSnoozeAsync(parent, snooze);
GetSnooze(GetSnoozeRequest, CallSettings)
public virtual Snooze GetSnooze(GetSnoozeRequest request, CallSettings callSettings = null)
Retrieves a Snooze
by name
.
Parameters | |
---|---|
Name | Description |
request | GetSnoozeRequest 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 |
Snooze | The RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.Create();
// Initialize request argument(s)
GetSnoozeRequest request = new GetSnoozeRequest
{
SnoozeName = SnoozeName.FromProjectSnooze("[PROJECT]", "[SNOOZE]"),
};
// Make the request
Snooze response = snoozeServiceClient.GetSnooze(request);
GetSnooze(SnoozeName, CallSettings)
public virtual Snooze GetSnooze(SnoozeName name, CallSettings callSettings = null)
Retrieves a Snooze
by name
.
Parameters | |
---|---|
Name | Description |
name | SnoozeName Required. The ID of the projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Snooze | The RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.Create();
// Initialize request argument(s)
SnoozeName name = SnoozeName.FromProjectSnooze("[PROJECT]", "[SNOOZE]");
// Make the request
Snooze response = snoozeServiceClient.GetSnooze(name);
GetSnooze(String, CallSettings)
public virtual Snooze GetSnooze(string name, CallSettings callSettings = null)
Retrieves a Snooze
by name
.
Parameters | |
---|---|
Name | Description |
name | String Required. The ID of the projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Snooze | The RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/snoozes/[SNOOZE]";
// Make the request
Snooze response = snoozeServiceClient.GetSnooze(name);
GetSnoozeAsync(GetSnoozeRequest, CallSettings)
public virtual Task<Snooze> GetSnoozeAsync(GetSnoozeRequest request, CallSettings callSettings = null)
Retrieves a Snooze
by name
.
Parameters | |
---|---|
Name | Description |
request | GetSnoozeRequest 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<Snooze> | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
GetSnoozeRequest request = new GetSnoozeRequest
{
SnoozeName = SnoozeName.FromProjectSnooze("[PROJECT]", "[SNOOZE]"),
};
// Make the request
Snooze response = await snoozeServiceClient.GetSnoozeAsync(request);
GetSnoozeAsync(GetSnoozeRequest, CancellationToken)
public virtual Task<Snooze> GetSnoozeAsync(GetSnoozeRequest request, CancellationToken cancellationToken)
Retrieves a Snooze
by name
.
Parameters | |
---|---|
Name | Description |
request | GetSnoozeRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Snooze> | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
GetSnoozeRequest request = new GetSnoozeRequest
{
SnoozeName = SnoozeName.FromProjectSnooze("[PROJECT]", "[SNOOZE]"),
};
// Make the request
Snooze response = await snoozeServiceClient.GetSnoozeAsync(request);
GetSnoozeAsync(SnoozeName, CallSettings)
public virtual Task<Snooze> GetSnoozeAsync(SnoozeName name, CallSettings callSettings = null)
Retrieves a Snooze
by name
.
Parameters | |
---|---|
Name | Description |
name | SnoozeName Required. The ID of the projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Snooze> | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
SnoozeName name = SnoozeName.FromProjectSnooze("[PROJECT]", "[SNOOZE]");
// Make the request
Snooze response = await snoozeServiceClient.GetSnoozeAsync(name);
GetSnoozeAsync(SnoozeName, CancellationToken)
public virtual Task<Snooze> GetSnoozeAsync(SnoozeName name, CancellationToken cancellationToken)
Retrieves a Snooze
by name
.
Parameters | |
---|---|
Name | Description |
name | SnoozeName Required. The ID of the projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Snooze> | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
SnoozeName name = SnoozeName.FromProjectSnooze("[PROJECT]", "[SNOOZE]");
// Make the request
Snooze response = await snoozeServiceClient.GetSnoozeAsync(name);
GetSnoozeAsync(String, CallSettings)
public virtual Task<Snooze> GetSnoozeAsync(string name, CallSettings callSettings = null)
Retrieves a Snooze
by name
.
Parameters | |
---|---|
Name | Description |
name | String Required. The ID of the projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Snooze> | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/snoozes/[SNOOZE]";
// Make the request
Snooze response = await snoozeServiceClient.GetSnoozeAsync(name);
GetSnoozeAsync(String, CancellationToken)
public virtual Task<Snooze> GetSnoozeAsync(string name, CancellationToken cancellationToken)
Retrieves a Snooze
by name
.
Parameters | |
---|---|
Name | Description |
name | String Required. The ID of the projects/[PROJECT_ID_OR_NUMBER]/snoozes/[SNOOZE_ID] |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Snooze> | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/snoozes/[SNOOZE]";
// Make the request
Snooze response = await snoozeServiceClient.GetSnoozeAsync(name);
ListSnoozes(ProjectName, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListSnoozesResponse, Snooze> ListSnoozes(ProjectName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists the Snooze
s associated with a project. Can optionally pass in
filter
, which specifies predicates to match Snooze
s.
Parameters | |
---|---|
Name | Description |
parent | ProjectName Required. The
project whose
projects/[PROJECT_ID_OR_NUMBER] |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> 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 |
PagedEnumerable<ListSnoozesResponse, Snooze> | A pageable sequence of Snooze resources. |
// Create client
SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.Create();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
// Make the request
PagedEnumerable<ListSnoozesResponse, Snooze> response = snoozeServiceClient.ListSnoozes(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Snooze 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 (ListSnoozesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Snooze 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<Snooze> 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 (Snooze 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;
ListSnoozes(ListSnoozesRequest, CallSettings)
public virtual PagedEnumerable<ListSnoozesResponse, Snooze> ListSnoozes(ListSnoozesRequest request, CallSettings callSettings = null)
Lists the Snooze
s associated with a project. Can optionally pass in
filter
, which specifies predicates to match Snooze
s.
Parameters | |
---|---|
Name | Description |
request | ListSnoozesRequest 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 |
PagedEnumerable<ListSnoozesResponse, Snooze> | A pageable sequence of Snooze resources. |
// Create client
SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.Create();
// Initialize request argument(s)
ListSnoozesRequest request = new ListSnoozesRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
Filter = "",
};
// Make the request
PagedEnumerable<ListSnoozesResponse, Snooze> response = snoozeServiceClient.ListSnoozes(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Snooze 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 (ListSnoozesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Snooze 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<Snooze> 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 (Snooze 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;
ListSnoozes(String, String, Nullable<Int32>, CallSettings)
public virtual PagedEnumerable<ListSnoozesResponse, Snooze> ListSnoozes(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists the Snooze
s associated with a project. Can optionally pass in
filter
, which specifies predicates to match Snooze
s.
Parameters | |
---|---|
Name | Description |
parent | String Required. The
project whose
projects/[PROJECT_ID_OR_NUMBER] |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> 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 |
PagedEnumerable<ListSnoozesResponse, Snooze> | A pageable sequence of Snooze resources. |
// Create client
SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
// Make the request
PagedEnumerable<ListSnoozesResponse, Snooze> response = snoozeServiceClient.ListSnoozes(parent);
// Iterate over all response items, lazily performing RPCs as required
foreach (Snooze 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 (ListSnoozesResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Snooze 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<Snooze> 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 (Snooze 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;
ListSnoozesAsync(ProjectName, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListSnoozesResponse, Snooze> ListSnoozesAsync(ProjectName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists the Snooze
s associated with a project. Can optionally pass in
filter
, which specifies predicates to match Snooze
s.
Parameters | |
---|---|
Name | Description |
parent | ProjectName Required. The
project whose
projects/[PROJECT_ID_OR_NUMBER] |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> 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 |
PagedAsyncEnumerable<ListSnoozesResponse, Snooze> | A pageable asynchronous sequence of Snooze resources. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
ProjectName parent = ProjectName.FromProject("[PROJECT]");
// Make the request
PagedAsyncEnumerable<ListSnoozesResponse, Snooze> response = snoozeServiceClient.ListSnoozesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Snooze 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((ListSnoozesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Snooze 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<Snooze> 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 (Snooze 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;
ListSnoozesAsync(ListSnoozesRequest, CallSettings)
public virtual PagedAsyncEnumerable<ListSnoozesResponse, Snooze> ListSnoozesAsync(ListSnoozesRequest request, CallSettings callSettings = null)
Lists the Snooze
s associated with a project. Can optionally pass in
filter
, which specifies predicates to match Snooze
s.
Parameters | |
---|---|
Name | Description |
request | ListSnoozesRequest 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 |
PagedAsyncEnumerable<ListSnoozesResponse, Snooze> | A pageable asynchronous sequence of Snooze resources. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
ListSnoozesRequest request = new ListSnoozesRequest
{
ParentAsProjectName = ProjectName.FromProject("[PROJECT]"),
Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListSnoozesResponse, Snooze> response = snoozeServiceClient.ListSnoozesAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Snooze 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((ListSnoozesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Snooze 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<Snooze> 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 (Snooze 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;
ListSnoozesAsync(String, String, Nullable<Int32>, CallSettings)
public virtual PagedAsyncEnumerable<ListSnoozesResponse, Snooze> ListSnoozesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)
Lists the Snooze
s associated with a project. Can optionally pass in
filter
, which specifies predicates to match Snooze
s.
Parameters | |
---|---|
Name | Description |
parent | String Required. The
project whose
projects/[PROJECT_ID_OR_NUMBER] |
pageToken | String The token returned from the previous request. A value of |
pageSize | Nullable<Int32> 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 |
PagedAsyncEnumerable<ListSnoozesResponse, Snooze> | A pageable asynchronous sequence of Snooze resources. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]";
// Make the request
PagedAsyncEnumerable<ListSnoozesResponse, Snooze> response = snoozeServiceClient.ListSnoozesAsync(parent);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Snooze 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((ListSnoozesResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Snooze 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<Snooze> 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 (Snooze 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.
UpdateSnooze(Snooze, FieldMask, CallSettings)
public virtual Snooze UpdateSnooze(Snooze snooze, FieldMask updateMask, CallSettings callSettings = null)
Updates a Snooze
, identified by its name
, with the parameters in the
given Snooze
object.
Parameters | |
---|---|
Name | Description |
snooze | Snooze Required. The |
updateMask | FieldMask Required. The fields to update. For each field listed in
Fields not listed retain their existing value. The following are the field names that are accepted in
That said, the start time and end time of the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Snooze | The RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.Create();
// Initialize request argument(s)
Snooze snooze = new Snooze();
FieldMask updateMask = new FieldMask();
// Make the request
Snooze response = snoozeServiceClient.UpdateSnooze(snooze, updateMask);
UpdateSnooze(UpdateSnoozeRequest, CallSettings)
public virtual Snooze UpdateSnooze(UpdateSnoozeRequest request, CallSettings callSettings = null)
Updates a Snooze
, identified by its name
, with the parameters in the
given Snooze
object.
Parameters | |
---|---|
Name | Description |
request | UpdateSnoozeRequest 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 |
Snooze | The RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = SnoozeServiceClient.Create();
// Initialize request argument(s)
UpdateSnoozeRequest request = new UpdateSnoozeRequest
{
Snooze = new Snooze(),
UpdateMask = new FieldMask(),
};
// Make the request
Snooze response = snoozeServiceClient.UpdateSnooze(request);
UpdateSnoozeAsync(Snooze, FieldMask, CallSettings)
public virtual Task<Snooze> UpdateSnoozeAsync(Snooze snooze, FieldMask updateMask, CallSettings callSettings = null)
Updates a Snooze
, identified by its name
, with the parameters in the
given Snooze
object.
Parameters | |
---|---|
Name | Description |
snooze | Snooze Required. The |
updateMask | FieldMask Required. The fields to update. For each field listed in
Fields not listed retain their existing value. The following are the field names that are accepted in
That said, the start time and end time of the |
callSettings | CallSettings If not null, applies overrides to this RPC call. |
Returns | |
---|---|
Type | Description |
Task<Snooze> | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
Snooze snooze = new Snooze();
FieldMask updateMask = new FieldMask();
// Make the request
Snooze response = await snoozeServiceClient.UpdateSnoozeAsync(snooze, updateMask);
UpdateSnoozeAsync(Snooze, FieldMask, CancellationToken)
public virtual Task<Snooze> UpdateSnoozeAsync(Snooze snooze, FieldMask updateMask, CancellationToken cancellationToken)
Updates a Snooze
, identified by its name
, with the parameters in the
given Snooze
object.
Parameters | |
---|---|
Name | Description |
snooze | Snooze Required. The |
updateMask | FieldMask Required. The fields to update. For each field listed in
Fields not listed retain their existing value. The following are the field names that are accepted in
That said, the start time and end time of the |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Snooze> | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
Snooze snooze = new Snooze();
FieldMask updateMask = new FieldMask();
// Make the request
Snooze response = await snoozeServiceClient.UpdateSnoozeAsync(snooze, updateMask);
UpdateSnoozeAsync(UpdateSnoozeRequest, CallSettings)
public virtual Task<Snooze> UpdateSnoozeAsync(UpdateSnoozeRequest request, CallSettings callSettings = null)
Updates a Snooze
, identified by its name
, with the parameters in the
given Snooze
object.
Parameters | |
---|---|
Name | Description |
request | UpdateSnoozeRequest 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<Snooze> | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSnoozeRequest request = new UpdateSnoozeRequest
{
Snooze = new Snooze(),
UpdateMask = new FieldMask(),
};
// Make the request
Snooze response = await snoozeServiceClient.UpdateSnoozeAsync(request);
UpdateSnoozeAsync(UpdateSnoozeRequest, CancellationToken)
public virtual Task<Snooze> UpdateSnoozeAsync(UpdateSnoozeRequest request, CancellationToken cancellationToken)
Updates a Snooze
, identified by its name
, with the parameters in the
given Snooze
object.
Parameters | |
---|---|
Name | Description |
request | UpdateSnoozeRequest The request object containing all of the parameters for the API call. |
cancellationToken | CancellationToken A CancellationToken to use for this RPC. |
Returns | |
---|---|
Type | Description |
Task<Snooze> | A Task containing the RPC response. |
// Create client
SnoozeServiceClient snoozeServiceClient = await SnoozeServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateSnoozeRequest request = new UpdateSnoozeRequest
{
Snooze = new Snooze(),
UpdateMask = new FieldMask(),
};
// Make the request
Snooze response = await snoozeServiceClient.UpdateSnoozeAsync(request);