Maintenance v1beta API - Class MaintenanceClient (1.0.0-beta01)

public abstract class MaintenanceClient

Reference documentation and code samples for the Maintenance v1beta API class MaintenanceClient.

Maintenance client wrapper, for convenient use.

Inheritance

object > MaintenanceClient

Derived Types

Namespace

Google.Cloud.Maintenance.Api.V1Beta

Assembly

Google.Cloud.Maintenance.Api.V1Beta.dll

Remarks

Unified Maintenance service

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default Maintenance scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default Maintenance scopes are:

GrpcClient

public virtual Maintenance.MaintenanceClient GrpcClient { get; }

The underlying gRPC Maintenance client

Property Value
Type Description
MaintenanceMaintenanceClient

LocationsClient

public virtual LocationsClient LocationsClient { get; }

The LocationsClient associated with this client.

Property Value
Type Description
LocationsClient

ServiceMetadata

public static ServiceMetadata ServiceMetadata { get; }

The service metadata associated with this client type.

Property Value
Type Description
ServiceMetadata

Methods

Create()

public static MaintenanceClient Create()

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

Returns
Type Description
MaintenanceClient

The created MaintenanceClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskMaintenanceClient

The task representing the created MaintenanceClient.

GetResourceMaintenance(GetResourceMaintenanceRequest, CallSettings)

public virtual ResourceMaintenance GetResourceMaintenance(GetResourceMaintenanceRequest request, CallSettings callSettings = null)

Retrieve a single resource maintenance.

Parameters
Name Description
request GetResourceMaintenanceRequest

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
ResourceMaintenance

The RPC response.

Example
// Create client
MaintenanceClient maintenanceClient = MaintenanceClient.Create();
// Initialize request argument(s)
GetResourceMaintenanceRequest request = new GetResourceMaintenanceRequest
{
    ResourceMaintenanceName = ResourceMaintenanceName.FromProjectLocationResourceMaintenance("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]"),
};
// Make the request
ResourceMaintenance response = maintenanceClient.GetResourceMaintenance(request);

GetResourceMaintenance(ResourceMaintenanceName, CallSettings)

public virtual ResourceMaintenance GetResourceMaintenance(ResourceMaintenanceName name, CallSettings callSettings = null)

Retrieve a single resource maintenance.

Parameters
Name Description
name ResourceMaintenanceName

Required. The resource name of the resource within a service.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
ResourceMaintenance

The RPC response.

Example
// Create client
MaintenanceClient maintenanceClient = MaintenanceClient.Create();
// Initialize request argument(s)
ResourceMaintenanceName name = ResourceMaintenanceName.FromProjectLocationResourceMaintenance("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]");
// Make the request
ResourceMaintenance response = maintenanceClient.GetResourceMaintenance(name);

GetResourceMaintenance(string, CallSettings)

public virtual ResourceMaintenance GetResourceMaintenance(string name, CallSettings callSettings = null)

Retrieve a single resource maintenance.

Parameters
Name Description
name string

Required. The resource name of the resource within a service.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
ResourceMaintenance

The RPC response.

Example
// Create client
MaintenanceClient maintenanceClient = MaintenanceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/resourceMaintenances/[RESOURCE_MAINTENANCE]";
// Make the request
ResourceMaintenance response = maintenanceClient.GetResourceMaintenance(name);

GetResourceMaintenanceAsync(GetResourceMaintenanceRequest, CallSettings)

public virtual Task<ResourceMaintenance> GetResourceMaintenanceAsync(GetResourceMaintenanceRequest request, CallSettings callSettings = null)

Retrieve a single resource maintenance.

Parameters
Name Description
request GetResourceMaintenanceRequest

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
TaskResourceMaintenance

A Task containing the RPC response.

Example
// Create client
MaintenanceClient maintenanceClient = await MaintenanceClient.CreateAsync();
// Initialize request argument(s)
GetResourceMaintenanceRequest request = new GetResourceMaintenanceRequest
{
    ResourceMaintenanceName = ResourceMaintenanceName.FromProjectLocationResourceMaintenance("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]"),
};
// Make the request
ResourceMaintenance response = await maintenanceClient.GetResourceMaintenanceAsync(request);

GetResourceMaintenanceAsync(GetResourceMaintenanceRequest, CancellationToken)

public virtual Task<ResourceMaintenance> GetResourceMaintenanceAsync(GetResourceMaintenanceRequest request, CancellationToken cancellationToken)

Retrieve a single resource maintenance.

Parameters
Name Description
request GetResourceMaintenanceRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskResourceMaintenance

A Task containing the RPC response.

Example
// Create client
MaintenanceClient maintenanceClient = await MaintenanceClient.CreateAsync();
// Initialize request argument(s)
GetResourceMaintenanceRequest request = new GetResourceMaintenanceRequest
{
    ResourceMaintenanceName = ResourceMaintenanceName.FromProjectLocationResourceMaintenance("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]"),
};
// Make the request
ResourceMaintenance response = await maintenanceClient.GetResourceMaintenanceAsync(request);

GetResourceMaintenanceAsync(ResourceMaintenanceName, CallSettings)

public virtual Task<ResourceMaintenance> GetResourceMaintenanceAsync(ResourceMaintenanceName name, CallSettings callSettings = null)

Retrieve a single resource maintenance.

Parameters
Name Description
name ResourceMaintenanceName

Required. The resource name of the resource within a service.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskResourceMaintenance

A Task containing the RPC response.

Example
// Create client
MaintenanceClient maintenanceClient = await MaintenanceClient.CreateAsync();
// Initialize request argument(s)
ResourceMaintenanceName name = ResourceMaintenanceName.FromProjectLocationResourceMaintenance("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]");
// Make the request
ResourceMaintenance response = await maintenanceClient.GetResourceMaintenanceAsync(name);

GetResourceMaintenanceAsync(ResourceMaintenanceName, CancellationToken)

public virtual Task<ResourceMaintenance> GetResourceMaintenanceAsync(ResourceMaintenanceName name, CancellationToken cancellationToken)

Retrieve a single resource maintenance.

Parameters
Name Description
name ResourceMaintenanceName

Required. The resource name of the resource within a service.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskResourceMaintenance

A Task containing the RPC response.

Example
// Create client
MaintenanceClient maintenanceClient = await MaintenanceClient.CreateAsync();
// Initialize request argument(s)
ResourceMaintenanceName name = ResourceMaintenanceName.FromProjectLocationResourceMaintenance("[PROJECT]", "[LOCATION]", "[RESOURCE_MAINTENANCE]");
// Make the request
ResourceMaintenance response = await maintenanceClient.GetResourceMaintenanceAsync(name);

GetResourceMaintenanceAsync(string, CallSettings)

public virtual Task<ResourceMaintenance> GetResourceMaintenanceAsync(string name, CallSettings callSettings = null)

Retrieve a single resource maintenance.

Parameters
Name Description
name string

Required. The resource name of the resource within a service.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskResourceMaintenance

A Task containing the RPC response.

Example
// Create client
MaintenanceClient maintenanceClient = await MaintenanceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/resourceMaintenances/[RESOURCE_MAINTENANCE]";
// Make the request
ResourceMaintenance response = await maintenanceClient.GetResourceMaintenanceAsync(name);

GetResourceMaintenanceAsync(string, CancellationToken)

public virtual Task<ResourceMaintenance> GetResourceMaintenanceAsync(string name, CancellationToken cancellationToken)

Retrieve a single resource maintenance.

Parameters
Name Description
name string

Required. The resource name of the resource within a service.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskResourceMaintenance

A Task containing the RPC response.

Example
// Create client
MaintenanceClient maintenanceClient = await MaintenanceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/resourceMaintenances/[RESOURCE_MAINTENANCE]";
// Make the request
ResourceMaintenance response = await maintenanceClient.GetResourceMaintenanceAsync(name);

ListResourceMaintenances(LocationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListResourceMaintenancesResponse, ResourceMaintenance> ListResourceMaintenances(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieve a collection of resource maintenances.

Parameters
Name Description
parent LocationName

Required. The parent of the resource maintenance.

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListResourceMaintenancesResponseResourceMaintenance

A pageable sequence of ResourceMaintenance resources.

Example
// Create client
MaintenanceClient maintenanceClient = MaintenanceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListResourceMaintenancesResponse, ResourceMaintenance> response = maintenanceClient.ListResourceMaintenances(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (ResourceMaintenance 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 (ListResourceMaintenancesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ResourceMaintenance 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<ResourceMaintenance> 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 (ResourceMaintenance 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;

ListResourceMaintenances(ListResourceMaintenancesRequest, CallSettings)

public virtual PagedEnumerable<ListResourceMaintenancesResponse, ResourceMaintenance> ListResourceMaintenances(ListResourceMaintenancesRequest request, CallSettings callSettings = null)

Retrieve a collection of resource maintenances.

Parameters
Name Description
request ListResourceMaintenancesRequest

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
PagedEnumerableListResourceMaintenancesResponseResourceMaintenance

A pageable sequence of ResourceMaintenance resources.

Example
// Create client
MaintenanceClient maintenanceClient = MaintenanceClient.Create();
// Initialize request argument(s)
ListResourceMaintenancesRequest request = new ListResourceMaintenancesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    OrderBy = "",
};
// Make the request
PagedEnumerable<ListResourceMaintenancesResponse, ResourceMaintenance> response = maintenanceClient.ListResourceMaintenances(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (ResourceMaintenance 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 (ListResourceMaintenancesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ResourceMaintenance 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<ResourceMaintenance> 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 (ResourceMaintenance 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;

ListResourceMaintenances(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListResourceMaintenancesResponse, ResourceMaintenance> ListResourceMaintenances(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieve a collection of resource maintenances.

Parameters
Name Description
parent string

Required. The parent of the resource maintenance.

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableListResourceMaintenancesResponseResourceMaintenance

A pageable sequence of ResourceMaintenance resources.

Example
// Create client
MaintenanceClient maintenanceClient = MaintenanceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListResourceMaintenancesResponse, ResourceMaintenance> response = maintenanceClient.ListResourceMaintenances(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (ResourceMaintenance 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 (ListResourceMaintenancesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ResourceMaintenance 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<ResourceMaintenance> 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 (ResourceMaintenance 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;

ListResourceMaintenancesAsync(LocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListResourceMaintenancesResponse, ResourceMaintenance> ListResourceMaintenancesAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieve a collection of resource maintenances.

Parameters
Name Description
parent LocationName

Required. The parent of the resource maintenance.

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListResourceMaintenancesResponseResourceMaintenance

A pageable asynchronous sequence of ResourceMaintenance resources.

Example
// Create client
MaintenanceClient maintenanceClient = await MaintenanceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListResourceMaintenancesResponse, ResourceMaintenance> response = maintenanceClient.ListResourceMaintenancesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ResourceMaintenance 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((ListResourceMaintenancesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ResourceMaintenance 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<ResourceMaintenance> 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 (ResourceMaintenance 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;

ListResourceMaintenancesAsync(ListResourceMaintenancesRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListResourceMaintenancesResponse, ResourceMaintenance> ListResourceMaintenancesAsync(ListResourceMaintenancesRequest request, CallSettings callSettings = null)

Retrieve a collection of resource maintenances.

Parameters
Name Description
request ListResourceMaintenancesRequest

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
PagedAsyncEnumerableListResourceMaintenancesResponseResourceMaintenance

A pageable asynchronous sequence of ResourceMaintenance resources.

Example
// Create client
MaintenanceClient maintenanceClient = await MaintenanceClient.CreateAsync();
// Initialize request argument(s)
ListResourceMaintenancesRequest request = new ListResourceMaintenancesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    OrderBy = "",
};
// Make the request
PagedAsyncEnumerable<ListResourceMaintenancesResponse, ResourceMaintenance> response = maintenanceClient.ListResourceMaintenancesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ResourceMaintenance 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((ListResourceMaintenancesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ResourceMaintenance 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<ResourceMaintenance> 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 (ResourceMaintenance 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;

ListResourceMaintenancesAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListResourceMaintenancesResponse, ResourceMaintenance> ListResourceMaintenancesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieve a collection of resource maintenances.

Parameters
Name Description
parent string

Required. The parent of the resource maintenance.

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableListResourceMaintenancesResponseResourceMaintenance

A pageable asynchronous sequence of ResourceMaintenance resources.

Example
// Create client
MaintenanceClient maintenanceClient = await MaintenanceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListResourceMaintenancesResponse, ResourceMaintenance> response = maintenanceClient.ListResourceMaintenancesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((ResourceMaintenance 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((ListResourceMaintenancesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (ResourceMaintenance 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<ResourceMaintenance> 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 (ResourceMaintenance 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.

Remarks

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

SummarizeMaintenances(LocationName, string, int?, CallSettings)

public virtual PagedEnumerable<SummarizeMaintenancesResponse, MaintenanceSummary> SummarizeMaintenances(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieves the statistics of a specific maintenance.

Parameters
Name Description
parent LocationName

Required. The parent of the resource maintenance. eg. projects/123/locations/*

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableSummarizeMaintenancesResponseMaintenanceSummary

A pageable sequence of MaintenanceSummary resources.

Example
// Create client
MaintenanceClient maintenanceClient = MaintenanceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<SummarizeMaintenancesResponse, MaintenanceSummary> response = maintenanceClient.SummarizeMaintenances(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (MaintenanceSummary 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 (SummarizeMaintenancesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (MaintenanceSummary 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<MaintenanceSummary> 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 (MaintenanceSummary 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;

SummarizeMaintenances(SummarizeMaintenancesRequest, CallSettings)

public virtual PagedEnumerable<SummarizeMaintenancesResponse, MaintenanceSummary> SummarizeMaintenances(SummarizeMaintenancesRequest request, CallSettings callSettings = null)

Retrieves the statistics of a specific maintenance.

Parameters
Name Description
request SummarizeMaintenancesRequest

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
PagedEnumerableSummarizeMaintenancesResponseMaintenanceSummary

A pageable sequence of MaintenanceSummary resources.

Example
// Create client
MaintenanceClient maintenanceClient = MaintenanceClient.Create();
// Initialize request argument(s)
SummarizeMaintenancesRequest request = new SummarizeMaintenancesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    OrderBy = "",
};
// Make the request
PagedEnumerable<SummarizeMaintenancesResponse, MaintenanceSummary> response = maintenanceClient.SummarizeMaintenances(request);

// Iterate over all response items, lazily performing RPCs as required
foreach (MaintenanceSummary 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 (SummarizeMaintenancesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (MaintenanceSummary 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<MaintenanceSummary> 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 (MaintenanceSummary 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;

SummarizeMaintenances(string, string, int?, CallSettings)

public virtual PagedEnumerable<SummarizeMaintenancesResponse, MaintenanceSummary> SummarizeMaintenances(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieves the statistics of a specific maintenance.

Parameters
Name Description
parent string

Required. The parent of the resource maintenance. eg. projects/123/locations/*

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedEnumerableSummarizeMaintenancesResponseMaintenanceSummary

A pageable sequence of MaintenanceSummary resources.

Example
// Create client
MaintenanceClient maintenanceClient = MaintenanceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<SummarizeMaintenancesResponse, MaintenanceSummary> response = maintenanceClient.SummarizeMaintenances(parent);

// Iterate over all response items, lazily performing RPCs as required
foreach (MaintenanceSummary 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 (SummarizeMaintenancesResponse page in response.AsRawResponses())
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (MaintenanceSummary 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<MaintenanceSummary> 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 (MaintenanceSummary 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;

SummarizeMaintenancesAsync(LocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<SummarizeMaintenancesResponse, MaintenanceSummary> SummarizeMaintenancesAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieves the statistics of a specific maintenance.

Parameters
Name Description
parent LocationName

Required. The parent of the resource maintenance. eg. projects/123/locations/*

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableSummarizeMaintenancesResponseMaintenanceSummary

A pageable asynchronous sequence of MaintenanceSummary resources.

Example
// Create client
MaintenanceClient maintenanceClient = await MaintenanceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<SummarizeMaintenancesResponse, MaintenanceSummary> response = maintenanceClient.SummarizeMaintenancesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((MaintenanceSummary 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((SummarizeMaintenancesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (MaintenanceSummary 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<MaintenanceSummary> 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 (MaintenanceSummary 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;

SummarizeMaintenancesAsync(SummarizeMaintenancesRequest, CallSettings)

public virtual PagedAsyncEnumerable<SummarizeMaintenancesResponse, MaintenanceSummary> SummarizeMaintenancesAsync(SummarizeMaintenancesRequest request, CallSettings callSettings = null)

Retrieves the statistics of a specific maintenance.

Parameters
Name Description
request SummarizeMaintenancesRequest

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
PagedAsyncEnumerableSummarizeMaintenancesResponseMaintenanceSummary

A pageable asynchronous sequence of MaintenanceSummary resources.

Example
// Create client
MaintenanceClient maintenanceClient = await MaintenanceClient.CreateAsync();
// Initialize request argument(s)
SummarizeMaintenancesRequest request = new SummarizeMaintenancesRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    OrderBy = "",
};
// Make the request
PagedAsyncEnumerable<SummarizeMaintenancesResponse, MaintenanceSummary> response = maintenanceClient.SummarizeMaintenancesAsync(request);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((MaintenanceSummary 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((SummarizeMaintenancesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (MaintenanceSummary 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<MaintenanceSummary> 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 (MaintenanceSummary 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;

SummarizeMaintenancesAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<SummarizeMaintenancesResponse, MaintenanceSummary> SummarizeMaintenancesAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Retrieves the statistics of a specific maintenance.

Parameters
Name Description
parent string

Required. The parent of the resource maintenance. eg. projects/123/locations/*

pageToken string

The token returned from the previous request. A value of null or an empty string retrieves the first page.

pageSize int

The size of page to request. The response will not be larger than this, but may be smaller. A value of null or 0 uses a server-defined page size.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
PagedAsyncEnumerableSummarizeMaintenancesResponseMaintenanceSummary

A pageable asynchronous sequence of MaintenanceSummary resources.

Example
// Create client
MaintenanceClient maintenanceClient = await MaintenanceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<SummarizeMaintenancesResponse, MaintenanceSummary> response = maintenanceClient.SummarizeMaintenancesAsync(parent);

// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((MaintenanceSummary 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((SummarizeMaintenancesResponse page) =>
{
    // Do something with each page of items
    Console.WriteLine("A page of results:");
    foreach (MaintenanceSummary 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<MaintenanceSummary> 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 (MaintenanceSummary 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;