Cloud Location Finder v1 API - Class CloudLocationFinderClient (1.0.0-beta01)

public abstract class CloudLocationFinderClient

Reference documentation and code samples for the Cloud Location Finder v1 API class CloudLocationFinderClient.

CloudLocationFinder client wrapper, for convenient use.

Inheritance

object > CloudLocationFinderClient

Namespace

Google.Cloud.LocationFinder.V1

Assembly

Google.Cloud.LocationFinder.V1.dll

Remarks

Service describing handlers for resources

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default CloudLocationFinder scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default CloudLocationFinder scopes are:

GrpcClient

public virtual CloudLocationFinder.CloudLocationFinderClient GrpcClient { get; }

The underlying gRPC CloudLocationFinder client

Property Value
Type Description
CloudLocationFinderCloudLocationFinderClient

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 CloudLocationFinderClient Create()

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

Returns
Type Description
CloudLocationFinderClient

The created CloudLocationFinderClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskCloudLocationFinderClient

The task representing the created CloudLocationFinderClient.

GetCloudLocation(CloudLocationName, CallSettings)

public virtual CloudLocation GetCloudLocation(CloudLocationName name, CallSettings callSettings = null)

Retrieves a resource containing information about a cloud location.

Parameters
Name Description
name CloudLocationName

Required. Name of the resource.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CloudLocation

The RPC response.

Example
// Create client
CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.Create();
// Initialize request argument(s)
CloudLocationName name = CloudLocationName.FromProjectLocationCloudLocation("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]");
// Make the request
CloudLocation response = cloudLocationFinderClient.GetCloudLocation(name);

GetCloudLocation(GetCloudLocationRequest, CallSettings)

public virtual CloudLocation GetCloudLocation(GetCloudLocationRequest request, CallSettings callSettings = null)

Retrieves a resource containing information about a cloud location.

Parameters
Name Description
request GetCloudLocationRequest

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
CloudLocation

The RPC response.

Example
// Create client
CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.Create();
// Initialize request argument(s)
GetCloudLocationRequest request = new GetCloudLocationRequest
{
    CloudLocationName = CloudLocationName.FromProjectLocationCloudLocation("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]"),
};
// Make the request
CloudLocation response = cloudLocationFinderClient.GetCloudLocation(request);

GetCloudLocation(string, CallSettings)

public virtual CloudLocation GetCloudLocation(string name, CallSettings callSettings = null)

Retrieves a resource containing information about a cloud location.

Parameters
Name Description
name string

Required. Name of the resource.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
CloudLocation

The RPC response.

Example
// Create client
CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/cloudLocations/[CLOUD_LOCATION]";
// Make the request
CloudLocation response = cloudLocationFinderClient.GetCloudLocation(name);

GetCloudLocationAsync(CloudLocationName, CallSettings)

public virtual Task<CloudLocation> GetCloudLocationAsync(CloudLocationName name, CallSettings callSettings = null)

Retrieves a resource containing information about a cloud location.

Parameters
Name Description
name CloudLocationName

Required. Name of the resource.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskCloudLocation

A Task containing the RPC response.

Example
// Create client
CloudLocationFinderClient cloudLocationFinderClient = await CloudLocationFinderClient.CreateAsync();
// Initialize request argument(s)
CloudLocationName name = CloudLocationName.FromProjectLocationCloudLocation("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]");
// Make the request
CloudLocation response = await cloudLocationFinderClient.GetCloudLocationAsync(name);

GetCloudLocationAsync(CloudLocationName, CancellationToken)

public virtual Task<CloudLocation> GetCloudLocationAsync(CloudLocationName name, CancellationToken cancellationToken)

Retrieves a resource containing information about a cloud location.

Parameters
Name Description
name CloudLocationName

Required. Name of the resource.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskCloudLocation

A Task containing the RPC response.

Example
// Create client
CloudLocationFinderClient cloudLocationFinderClient = await CloudLocationFinderClient.CreateAsync();
// Initialize request argument(s)
CloudLocationName name = CloudLocationName.FromProjectLocationCloudLocation("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]");
// Make the request
CloudLocation response = await cloudLocationFinderClient.GetCloudLocationAsync(name);

GetCloudLocationAsync(GetCloudLocationRequest, CallSettings)

public virtual Task<CloudLocation> GetCloudLocationAsync(GetCloudLocationRequest request, CallSettings callSettings = null)

Retrieves a resource containing information about a cloud location.

Parameters
Name Description
request GetCloudLocationRequest

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
TaskCloudLocation

A Task containing the RPC response.

Example
// Create client
CloudLocationFinderClient cloudLocationFinderClient = await CloudLocationFinderClient.CreateAsync();
// Initialize request argument(s)
GetCloudLocationRequest request = new GetCloudLocationRequest
{
    CloudLocationName = CloudLocationName.FromProjectLocationCloudLocation("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]"),
};
// Make the request
CloudLocation response = await cloudLocationFinderClient.GetCloudLocationAsync(request);

GetCloudLocationAsync(GetCloudLocationRequest, CancellationToken)

public virtual Task<CloudLocation> GetCloudLocationAsync(GetCloudLocationRequest request, CancellationToken cancellationToken)

Retrieves a resource containing information about a cloud location.

Parameters
Name Description
request GetCloudLocationRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskCloudLocation

A Task containing the RPC response.

Example
// Create client
CloudLocationFinderClient cloudLocationFinderClient = await CloudLocationFinderClient.CreateAsync();
// Initialize request argument(s)
GetCloudLocationRequest request = new GetCloudLocationRequest
{
    CloudLocationName = CloudLocationName.FromProjectLocationCloudLocation("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]"),
};
// Make the request
CloudLocation response = await cloudLocationFinderClient.GetCloudLocationAsync(request);

GetCloudLocationAsync(string, CallSettings)

public virtual Task<CloudLocation> GetCloudLocationAsync(string name, CallSettings callSettings = null)

Retrieves a resource containing information about a cloud location.

Parameters
Name Description
name string

Required. Name of the resource.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskCloudLocation

A Task containing the RPC response.

Example
// Create client
CloudLocationFinderClient cloudLocationFinderClient = await CloudLocationFinderClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/cloudLocations/[CLOUD_LOCATION]";
// Make the request
CloudLocation response = await cloudLocationFinderClient.GetCloudLocationAsync(name);

GetCloudLocationAsync(string, CancellationToken)

public virtual Task<CloudLocation> GetCloudLocationAsync(string name, CancellationToken cancellationToken)

Retrieves a resource containing information about a cloud location.

Parameters
Name Description
name string

Required. Name of the resource.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskCloudLocation

A Task containing the RPC response.

Example
// Create client
CloudLocationFinderClient cloudLocationFinderClient = await CloudLocationFinderClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/cloudLocations/[CLOUD_LOCATION]";
// Make the request
CloudLocation response = await cloudLocationFinderClient.GetCloudLocationAsync(name);

ListCloudLocations(LocationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListCloudLocationsResponse, CloudLocation> ListCloudLocations(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists cloud locations under a given project and location.

Parameters
Name Description
parent LocationName

Required. The parent, which owns this collection of cloud locations. Format: projects/{project}/locations/{location}

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
PagedEnumerableListCloudLocationsResponseCloudLocation

A pageable sequence of CloudLocation resources.

Example
// Create client
CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListCloudLocationsResponse, CloudLocation> response = cloudLocationFinderClient.ListCloudLocations(parent);

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

ListCloudLocations(ListCloudLocationsRequest, CallSettings)

public virtual PagedEnumerable<ListCloudLocationsResponse, CloudLocation> ListCloudLocations(ListCloudLocationsRequest request, CallSettings callSettings = null)

Lists cloud locations under a given project and location.

Parameters
Name Description
request ListCloudLocationsRequest

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
PagedEnumerableListCloudLocationsResponseCloudLocation

A pageable sequence of CloudLocation resources.

Example
// Create client
CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.Create();
// Initialize request argument(s)
ListCloudLocationsRequest request = new ListCloudLocationsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
};
// Make the request
PagedEnumerable<ListCloudLocationsResponse, CloudLocation> response = cloudLocationFinderClient.ListCloudLocations(request);

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

ListCloudLocations(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListCloudLocationsResponse, CloudLocation> ListCloudLocations(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists cloud locations under a given project and location.

Parameters
Name Description
parent string

Required. The parent, which owns this collection of cloud locations. Format: projects/{project}/locations/{location}

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
PagedEnumerableListCloudLocationsResponseCloudLocation

A pageable sequence of CloudLocation resources.

Example
// Create client
CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListCloudLocationsResponse, CloudLocation> response = cloudLocationFinderClient.ListCloudLocations(parent);

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

ListCloudLocationsAsync(LocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListCloudLocationsResponse, CloudLocation> ListCloudLocationsAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists cloud locations under a given project and location.

Parameters
Name Description
parent LocationName

Required. The parent, which owns this collection of cloud locations. Format: projects/{project}/locations/{location}

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
PagedAsyncEnumerableListCloudLocationsResponseCloudLocation

A pageable asynchronous sequence of CloudLocation resources.

Example
// Create client
CloudLocationFinderClient cloudLocationFinderClient = await CloudLocationFinderClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListCloudLocationsResponse, CloudLocation> response = cloudLocationFinderClient.ListCloudLocationsAsync(parent);

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

ListCloudLocationsAsync(ListCloudLocationsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListCloudLocationsResponse, CloudLocation> ListCloudLocationsAsync(ListCloudLocationsRequest request, CallSettings callSettings = null)

Lists cloud locations under a given project and location.

Parameters
Name Description
request ListCloudLocationsRequest

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
PagedAsyncEnumerableListCloudLocationsResponseCloudLocation

A pageable asynchronous sequence of CloudLocation resources.

Example
// Create client
CloudLocationFinderClient cloudLocationFinderClient = await CloudLocationFinderClient.CreateAsync();
// Initialize request argument(s)
ListCloudLocationsRequest request = new ListCloudLocationsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
};
// Make the request
PagedAsyncEnumerable<ListCloudLocationsResponse, CloudLocation> response = cloudLocationFinderClient.ListCloudLocationsAsync(request);

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

ListCloudLocationsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListCloudLocationsResponse, CloudLocation> ListCloudLocationsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists cloud locations under a given project and location.

Parameters
Name Description
parent string

Required. The parent, which owns this collection of cloud locations. Format: projects/{project}/locations/{location}

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
PagedAsyncEnumerableListCloudLocationsResponseCloudLocation

A pageable asynchronous sequence of CloudLocation resources.

Example
// Create client
CloudLocationFinderClient cloudLocationFinderClient = await CloudLocationFinderClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListCloudLocationsResponse, CloudLocation> response = cloudLocationFinderClient.ListCloudLocationsAsync(parent);

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

SearchCloudLocations(LocationName, CloudLocationName, string, string, int?, CallSettings)

public virtual PagedEnumerable<SearchCloudLocationsResponse, CloudLocation> SearchCloudLocations(LocationName parent, CloudLocationName sourceCloudLocation, string query, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Searches for cloud locations from a given source location.

Parameters
Name Description
parent LocationName

Required. The parent, which owns this collection of cloud locations. Format: projects/{project}/locations/{location}

sourceCloudLocation CloudLocationName

Required. The source cloud location to search from. Example search can be searching nearby cloud locations from the source cloud location by latency.

query string

Optional. The query string in search query syntax. While filter is used to filter the search results by attributes, query is used to specify the search requirements.

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
PagedEnumerableSearchCloudLocationsResponseCloudLocation

A pageable sequence of CloudLocation resources.

Example
// Create client
CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
CloudLocationName sourceCloudLocation = CloudLocationName.FromProjectLocationCloudLocation("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]");
string query = "";
// Make the request
PagedEnumerable<SearchCloudLocationsResponse, CloudLocation> response = cloudLocationFinderClient.SearchCloudLocations(parent, sourceCloudLocation, query);

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

SearchCloudLocations(SearchCloudLocationsRequest, CallSettings)

public virtual PagedEnumerable<SearchCloudLocationsResponse, CloudLocation> SearchCloudLocations(SearchCloudLocationsRequest request, CallSettings callSettings = null)

Searches for cloud locations from a given source location.

Parameters
Name Description
request SearchCloudLocationsRequest

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
PagedEnumerableSearchCloudLocationsResponseCloudLocation

A pageable sequence of CloudLocation resources.

Example
// Create client
CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.Create();
// Initialize request argument(s)
SearchCloudLocationsRequest request = new SearchCloudLocationsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    SourceCloudLocationAsCloudLocationName = CloudLocationName.FromProjectLocationCloudLocation("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]"),
    Query = "",
};
// Make the request
PagedEnumerable<SearchCloudLocationsResponse, CloudLocation> response = cloudLocationFinderClient.SearchCloudLocations(request);

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

SearchCloudLocations(string, string, string, string, int?, CallSettings)

public virtual PagedEnumerable<SearchCloudLocationsResponse, CloudLocation> SearchCloudLocations(string parent, string sourceCloudLocation, string query, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Searches for cloud locations from a given source location.

Parameters
Name Description
parent string

Required. The parent, which owns this collection of cloud locations. Format: projects/{project}/locations/{location}

sourceCloudLocation string

Required. The source cloud location to search from. Example search can be searching nearby cloud locations from the source cloud location by latency.

query string

Optional. The query string in search query syntax. While filter is used to filter the search results by attributes, query is used to specify the search requirements.

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
PagedEnumerableSearchCloudLocationsResponseCloudLocation

A pageable sequence of CloudLocation resources.

Example
// Create client
CloudLocationFinderClient cloudLocationFinderClient = CloudLocationFinderClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string sourceCloudLocation = "projects/[PROJECT]/locations/[LOCATION]/cloudLocations/[CLOUD_LOCATION]";
string query = "";
// Make the request
PagedEnumerable<SearchCloudLocationsResponse, CloudLocation> response = cloudLocationFinderClient.SearchCloudLocations(parent, sourceCloudLocation, query);

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

SearchCloudLocationsAsync(LocationName, CloudLocationName, string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<SearchCloudLocationsResponse, CloudLocation> SearchCloudLocationsAsync(LocationName parent, CloudLocationName sourceCloudLocation, string query, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Searches for cloud locations from a given source location.

Parameters
Name Description
parent LocationName

Required. The parent, which owns this collection of cloud locations. Format: projects/{project}/locations/{location}

sourceCloudLocation CloudLocationName

Required. The source cloud location to search from. Example search can be searching nearby cloud locations from the source cloud location by latency.

query string

Optional. The query string in search query syntax. While filter is used to filter the search results by attributes, query is used to specify the search requirements.

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
PagedAsyncEnumerableSearchCloudLocationsResponseCloudLocation

A pageable asynchronous sequence of CloudLocation resources.

Example
// Create client
CloudLocationFinderClient cloudLocationFinderClient = await CloudLocationFinderClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
CloudLocationName sourceCloudLocation = CloudLocationName.FromProjectLocationCloudLocation("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]");
string query = "";
// Make the request
PagedAsyncEnumerable<SearchCloudLocationsResponse, CloudLocation> response = cloudLocationFinderClient.SearchCloudLocationsAsync(parent, sourceCloudLocation, query);

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

SearchCloudLocationsAsync(SearchCloudLocationsRequest, CallSettings)

public virtual PagedAsyncEnumerable<SearchCloudLocationsResponse, CloudLocation> SearchCloudLocationsAsync(SearchCloudLocationsRequest request, CallSettings callSettings = null)

Searches for cloud locations from a given source location.

Parameters
Name Description
request SearchCloudLocationsRequest

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
PagedAsyncEnumerableSearchCloudLocationsResponseCloudLocation

A pageable asynchronous sequence of CloudLocation resources.

Example
// Create client
CloudLocationFinderClient cloudLocationFinderClient = await CloudLocationFinderClient.CreateAsync();
// Initialize request argument(s)
SearchCloudLocationsRequest request = new SearchCloudLocationsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    SourceCloudLocationAsCloudLocationName = CloudLocationName.FromProjectLocationCloudLocation("[PROJECT]", "[LOCATION]", "[CLOUD_LOCATION]"),
    Query = "",
};
// Make the request
PagedAsyncEnumerable<SearchCloudLocationsResponse, CloudLocation> response = cloudLocationFinderClient.SearchCloudLocationsAsync(request);

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

SearchCloudLocationsAsync(string, string, string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<SearchCloudLocationsResponse, CloudLocation> SearchCloudLocationsAsync(string parent, string sourceCloudLocation, string query, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Searches for cloud locations from a given source location.

Parameters
Name Description
parent string

Required. The parent, which owns this collection of cloud locations. Format: projects/{project}/locations/{location}

sourceCloudLocation string

Required. The source cloud location to search from. Example search can be searching nearby cloud locations from the source cloud location by latency.

query string

Optional. The query string in search query syntax. While filter is used to filter the search results by attributes, query is used to specify the search requirements.

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
PagedAsyncEnumerableSearchCloudLocationsResponseCloudLocation

A pageable asynchronous sequence of CloudLocation resources.

Example
// Create client
CloudLocationFinderClient cloudLocationFinderClient = await CloudLocationFinderClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
string sourceCloudLocation = "projects/[PROJECT]/locations/[LOCATION]/cloudLocations/[CLOUD_LOCATION]";
string query = "";
// Make the request
PagedAsyncEnumerable<SearchCloudLocationsResponse, CloudLocation> response = cloudLocationFinderClient.SearchCloudLocationsAsync(parent, sourceCloudLocation, query);

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