API hub v1 API - Class HostProjectRegistrationServiceClient (1.0.0)

public abstract class HostProjectRegistrationServiceClient

Reference documentation and code samples for the API hub v1 API class HostProjectRegistrationServiceClient.

HostProjectRegistrationService client wrapper, for convenient use.

Inheritance

object > HostProjectRegistrationServiceClient

Namespace

Google.Cloud.ApiHub.V1

Assembly

Google.Cloud.ApiHub.V1.dll

Remarks

This service is used for managing the host project registrations.

Properties

DefaultEndpoint

public static string DefaultEndpoint { get; }

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

Property Value
Type Description
string

DefaultScopes

public static IReadOnlyList<string> DefaultScopes { get; }

The default HostProjectRegistrationService scopes.

Property Value
Type Description
IReadOnlyListstring
Remarks

The default HostProjectRegistrationService scopes are:

GrpcClient

public virtual HostProjectRegistrationService.HostProjectRegistrationServiceClient GrpcClient { get; }

The underlying gRPC HostProjectRegistrationService client

Property Value
Type Description
HostProjectRegistrationServiceHostProjectRegistrationServiceClient

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

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

Returns
Type Description
HostProjectRegistrationServiceClient

The created HostProjectRegistrationServiceClient.

CreateAsync(CancellationToken)

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

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

Parameter
Name Description
cancellationToken CancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
TaskHostProjectRegistrationServiceClient

The task representing the created HostProjectRegistrationServiceClient.

CreateHostProjectRegistration(LocationName, HostProjectRegistration, string, CallSettings)

public virtual HostProjectRegistration CreateHostProjectRegistration(LocationName parent, HostProjectRegistration hostProjectRegistration, string hostProjectRegistrationId, CallSettings callSettings = null)

Create a host project registration. A Google cloud project can be registered as a host project if it is not attached as a runtime project to another host project. A project can be registered as a host project only once. Subsequent register calls for the same project will fail.

Parameters
Name Description
parent LocationName

Required. The parent resource for the host project. Format: projects/{project}/locations/{location}

hostProjectRegistration HostProjectRegistration

Required. The host project registration to register.

hostProjectRegistrationId string

Required. The ID to use for the Host Project Registration, which will become the final component of the host project registration's resource name. The ID must be the same as the Google cloud project specified in the host_project_registration.gcp_project field.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
HostProjectRegistration

The RPC response.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = HostProjectRegistrationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
HostProjectRegistration hostProjectRegistration = new HostProjectRegistration();
string hostProjectRegistrationId = "";
// Make the request
HostProjectRegistration response = hostProjectRegistrationServiceClient.CreateHostProjectRegistration(parent, hostProjectRegistration, hostProjectRegistrationId);

CreateHostProjectRegistration(CreateHostProjectRegistrationRequest, CallSettings)

public virtual HostProjectRegistration CreateHostProjectRegistration(CreateHostProjectRegistrationRequest request, CallSettings callSettings = null)

Create a host project registration. A Google cloud project can be registered as a host project if it is not attached as a runtime project to another host project. A project can be registered as a host project only once. Subsequent register calls for the same project will fail.

Parameters
Name Description
request CreateHostProjectRegistrationRequest

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
HostProjectRegistration

The RPC response.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = HostProjectRegistrationServiceClient.Create();
// Initialize request argument(s)
CreateHostProjectRegistrationRequest request = new CreateHostProjectRegistrationRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    HostProjectRegistrationId = "",
    HostProjectRegistration = new HostProjectRegistration(),
};
// Make the request
HostProjectRegistration response = hostProjectRegistrationServiceClient.CreateHostProjectRegistration(request);

CreateHostProjectRegistration(string, HostProjectRegistration, string, CallSettings)

public virtual HostProjectRegistration CreateHostProjectRegistration(string parent, HostProjectRegistration hostProjectRegistration, string hostProjectRegistrationId, CallSettings callSettings = null)

Create a host project registration. A Google cloud project can be registered as a host project if it is not attached as a runtime project to another host project. A project can be registered as a host project only once. Subsequent register calls for the same project will fail.

Parameters
Name Description
parent string

Required. The parent resource for the host project. Format: projects/{project}/locations/{location}

hostProjectRegistration HostProjectRegistration

Required. The host project registration to register.

hostProjectRegistrationId string

Required. The ID to use for the Host Project Registration, which will become the final component of the host project registration's resource name. The ID must be the same as the Google cloud project specified in the host_project_registration.gcp_project field.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
HostProjectRegistration

The RPC response.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = HostProjectRegistrationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
HostProjectRegistration hostProjectRegistration = new HostProjectRegistration();
string hostProjectRegistrationId = "";
// Make the request
HostProjectRegistration response = hostProjectRegistrationServiceClient.CreateHostProjectRegistration(parent, hostProjectRegistration, hostProjectRegistrationId);

CreateHostProjectRegistrationAsync(LocationName, HostProjectRegistration, string, CallSettings)

public virtual Task<HostProjectRegistration> CreateHostProjectRegistrationAsync(LocationName parent, HostProjectRegistration hostProjectRegistration, string hostProjectRegistrationId, CallSettings callSettings = null)

Create a host project registration. A Google cloud project can be registered as a host project if it is not attached as a runtime project to another host project. A project can be registered as a host project only once. Subsequent register calls for the same project will fail.

Parameters
Name Description
parent LocationName

Required. The parent resource for the host project. Format: projects/{project}/locations/{location}

hostProjectRegistration HostProjectRegistration

Required. The host project registration to register.

hostProjectRegistrationId string

Required. The ID to use for the Host Project Registration, which will become the final component of the host project registration's resource name. The ID must be the same as the Google cloud project specified in the host_project_registration.gcp_project field.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskHostProjectRegistration

A Task containing the RPC response.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = await HostProjectRegistrationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
HostProjectRegistration hostProjectRegistration = new HostProjectRegistration();
string hostProjectRegistrationId = "";
// Make the request
HostProjectRegistration response = await hostProjectRegistrationServiceClient.CreateHostProjectRegistrationAsync(parent, hostProjectRegistration, hostProjectRegistrationId);

CreateHostProjectRegistrationAsync(LocationName, HostProjectRegistration, string, CancellationToken)

public virtual Task<HostProjectRegistration> CreateHostProjectRegistrationAsync(LocationName parent, HostProjectRegistration hostProjectRegistration, string hostProjectRegistrationId, CancellationToken cancellationToken)

Create a host project registration. A Google cloud project can be registered as a host project if it is not attached as a runtime project to another host project. A project can be registered as a host project only once. Subsequent register calls for the same project will fail.

Parameters
Name Description
parent LocationName

Required. The parent resource for the host project. Format: projects/{project}/locations/{location}

hostProjectRegistration HostProjectRegistration

Required. The host project registration to register.

hostProjectRegistrationId string

Required. The ID to use for the Host Project Registration, which will become the final component of the host project registration's resource name. The ID must be the same as the Google cloud project specified in the host_project_registration.gcp_project field.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskHostProjectRegistration

A Task containing the RPC response.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = await HostProjectRegistrationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
HostProjectRegistration hostProjectRegistration = new HostProjectRegistration();
string hostProjectRegistrationId = "";
// Make the request
HostProjectRegistration response = await hostProjectRegistrationServiceClient.CreateHostProjectRegistrationAsync(parent, hostProjectRegistration, hostProjectRegistrationId);

CreateHostProjectRegistrationAsync(CreateHostProjectRegistrationRequest, CallSettings)

public virtual Task<HostProjectRegistration> CreateHostProjectRegistrationAsync(CreateHostProjectRegistrationRequest request, CallSettings callSettings = null)

Create a host project registration. A Google cloud project can be registered as a host project if it is not attached as a runtime project to another host project. A project can be registered as a host project only once. Subsequent register calls for the same project will fail.

Parameters
Name Description
request CreateHostProjectRegistrationRequest

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
TaskHostProjectRegistration

A Task containing the RPC response.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = await HostProjectRegistrationServiceClient.CreateAsync();
// Initialize request argument(s)
CreateHostProjectRegistrationRequest request = new CreateHostProjectRegistrationRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    HostProjectRegistrationId = "",
    HostProjectRegistration = new HostProjectRegistration(),
};
// Make the request
HostProjectRegistration response = await hostProjectRegistrationServiceClient.CreateHostProjectRegistrationAsync(request);

CreateHostProjectRegistrationAsync(CreateHostProjectRegistrationRequest, CancellationToken)

public virtual Task<HostProjectRegistration> CreateHostProjectRegistrationAsync(CreateHostProjectRegistrationRequest request, CancellationToken cancellationToken)

Create a host project registration. A Google cloud project can be registered as a host project if it is not attached as a runtime project to another host project. A project can be registered as a host project only once. Subsequent register calls for the same project will fail.

Parameters
Name Description
request CreateHostProjectRegistrationRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskHostProjectRegistration

A Task containing the RPC response.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = await HostProjectRegistrationServiceClient.CreateAsync();
// Initialize request argument(s)
CreateHostProjectRegistrationRequest request = new CreateHostProjectRegistrationRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    HostProjectRegistrationId = "",
    HostProjectRegistration = new HostProjectRegistration(),
};
// Make the request
HostProjectRegistration response = await hostProjectRegistrationServiceClient.CreateHostProjectRegistrationAsync(request);

CreateHostProjectRegistrationAsync(string, HostProjectRegistration, string, CallSettings)

public virtual Task<HostProjectRegistration> CreateHostProjectRegistrationAsync(string parent, HostProjectRegistration hostProjectRegistration, string hostProjectRegistrationId, CallSettings callSettings = null)

Create a host project registration. A Google cloud project can be registered as a host project if it is not attached as a runtime project to another host project. A project can be registered as a host project only once. Subsequent register calls for the same project will fail.

Parameters
Name Description
parent string

Required. The parent resource for the host project. Format: projects/{project}/locations/{location}

hostProjectRegistration HostProjectRegistration

Required. The host project registration to register.

hostProjectRegistrationId string

Required. The ID to use for the Host Project Registration, which will become the final component of the host project registration's resource name. The ID must be the same as the Google cloud project specified in the host_project_registration.gcp_project field.

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskHostProjectRegistration

A Task containing the RPC response.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = await HostProjectRegistrationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
HostProjectRegistration hostProjectRegistration = new HostProjectRegistration();
string hostProjectRegistrationId = "";
// Make the request
HostProjectRegistration response = await hostProjectRegistrationServiceClient.CreateHostProjectRegistrationAsync(parent, hostProjectRegistration, hostProjectRegistrationId);

CreateHostProjectRegistrationAsync(string, HostProjectRegistration, string, CancellationToken)

public virtual Task<HostProjectRegistration> CreateHostProjectRegistrationAsync(string parent, HostProjectRegistration hostProjectRegistration, string hostProjectRegistrationId, CancellationToken cancellationToken)

Create a host project registration. A Google cloud project can be registered as a host project if it is not attached as a runtime project to another host project. A project can be registered as a host project only once. Subsequent register calls for the same project will fail.

Parameters
Name Description
parent string

Required. The parent resource for the host project. Format: projects/{project}/locations/{location}

hostProjectRegistration HostProjectRegistration

Required. The host project registration to register.

hostProjectRegistrationId string

Required. The ID to use for the Host Project Registration, which will become the final component of the host project registration's resource name. The ID must be the same as the Google cloud project specified in the host_project_registration.gcp_project field.

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskHostProjectRegistration

A Task containing the RPC response.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = await HostProjectRegistrationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
HostProjectRegistration hostProjectRegistration = new HostProjectRegistration();
string hostProjectRegistrationId = "";
// Make the request
HostProjectRegistration response = await hostProjectRegistrationServiceClient.CreateHostProjectRegistrationAsync(parent, hostProjectRegistration, hostProjectRegistrationId);

GetHostProjectRegistration(GetHostProjectRegistrationRequest, CallSettings)

public virtual HostProjectRegistration GetHostProjectRegistration(GetHostProjectRegistrationRequest request, CallSettings callSettings = null)

Get a host project registration.

Parameters
Name Description
request GetHostProjectRegistrationRequest

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
HostProjectRegistration

The RPC response.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = HostProjectRegistrationServiceClient.Create();
// Initialize request argument(s)
GetHostProjectRegistrationRequest request = new GetHostProjectRegistrationRequest
{
    HostProjectRegistrationName = HostProjectRegistrationName.FromProjectLocationHostProjectRegistration("[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]"),
};
// Make the request
HostProjectRegistration response = hostProjectRegistrationServiceClient.GetHostProjectRegistration(request);

GetHostProjectRegistration(HostProjectRegistrationName, CallSettings)

public virtual HostProjectRegistration GetHostProjectRegistration(HostProjectRegistrationName name, CallSettings callSettings = null)

Get a host project registration.

Parameters
Name Description
name HostProjectRegistrationName

Required. Host project registration resource name. projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
HostProjectRegistration

The RPC response.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = HostProjectRegistrationServiceClient.Create();
// Initialize request argument(s)
HostProjectRegistrationName name = HostProjectRegistrationName.FromProjectLocationHostProjectRegistration("[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]");
// Make the request
HostProjectRegistration response = hostProjectRegistrationServiceClient.GetHostProjectRegistration(name);

GetHostProjectRegistration(string, CallSettings)

public virtual HostProjectRegistration GetHostProjectRegistration(string name, CallSettings callSettings = null)

Get a host project registration.

Parameters
Name Description
name string

Required. Host project registration resource name. projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
HostProjectRegistration

The RPC response.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = HostProjectRegistrationServiceClient.Create();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/hostProjectRegistrations/[HOST_PROJECT_REGISTRATION]";
// Make the request
HostProjectRegistration response = hostProjectRegistrationServiceClient.GetHostProjectRegistration(name);

GetHostProjectRegistrationAsync(GetHostProjectRegistrationRequest, CallSettings)

public virtual Task<HostProjectRegistration> GetHostProjectRegistrationAsync(GetHostProjectRegistrationRequest request, CallSettings callSettings = null)

Get a host project registration.

Parameters
Name Description
request GetHostProjectRegistrationRequest

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
TaskHostProjectRegistration

A Task containing the RPC response.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = await HostProjectRegistrationServiceClient.CreateAsync();
// Initialize request argument(s)
GetHostProjectRegistrationRequest request = new GetHostProjectRegistrationRequest
{
    HostProjectRegistrationName = HostProjectRegistrationName.FromProjectLocationHostProjectRegistration("[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]"),
};
// Make the request
HostProjectRegistration response = await hostProjectRegistrationServiceClient.GetHostProjectRegistrationAsync(request);

GetHostProjectRegistrationAsync(GetHostProjectRegistrationRequest, CancellationToken)

public virtual Task<HostProjectRegistration> GetHostProjectRegistrationAsync(GetHostProjectRegistrationRequest request, CancellationToken cancellationToken)

Get a host project registration.

Parameters
Name Description
request GetHostProjectRegistrationRequest

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

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskHostProjectRegistration

A Task containing the RPC response.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = await HostProjectRegistrationServiceClient.CreateAsync();
// Initialize request argument(s)
GetHostProjectRegistrationRequest request = new GetHostProjectRegistrationRequest
{
    HostProjectRegistrationName = HostProjectRegistrationName.FromProjectLocationHostProjectRegistration("[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]"),
};
// Make the request
HostProjectRegistration response = await hostProjectRegistrationServiceClient.GetHostProjectRegistrationAsync(request);

GetHostProjectRegistrationAsync(HostProjectRegistrationName, CallSettings)

public virtual Task<HostProjectRegistration> GetHostProjectRegistrationAsync(HostProjectRegistrationName name, CallSettings callSettings = null)

Get a host project registration.

Parameters
Name Description
name HostProjectRegistrationName

Required. Host project registration resource name. projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskHostProjectRegistration

A Task containing the RPC response.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = await HostProjectRegistrationServiceClient.CreateAsync();
// Initialize request argument(s)
HostProjectRegistrationName name = HostProjectRegistrationName.FromProjectLocationHostProjectRegistration("[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]");
// Make the request
HostProjectRegistration response = await hostProjectRegistrationServiceClient.GetHostProjectRegistrationAsync(name);

GetHostProjectRegistrationAsync(HostProjectRegistrationName, CancellationToken)

public virtual Task<HostProjectRegistration> GetHostProjectRegistrationAsync(HostProjectRegistrationName name, CancellationToken cancellationToken)

Get a host project registration.

Parameters
Name Description
name HostProjectRegistrationName

Required. Host project registration resource name. projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskHostProjectRegistration

A Task containing the RPC response.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = await HostProjectRegistrationServiceClient.CreateAsync();
// Initialize request argument(s)
HostProjectRegistrationName name = HostProjectRegistrationName.FromProjectLocationHostProjectRegistration("[PROJECT]", "[LOCATION]", "[HOST_PROJECT_REGISTRATION]");
// Make the request
HostProjectRegistration response = await hostProjectRegistrationServiceClient.GetHostProjectRegistrationAsync(name);

GetHostProjectRegistrationAsync(string, CallSettings)

public virtual Task<HostProjectRegistration> GetHostProjectRegistrationAsync(string name, CallSettings callSettings = null)

Get a host project registration.

Parameters
Name Description
name string

Required. Host project registration resource name. projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id}

callSettings CallSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
TaskHostProjectRegistration

A Task containing the RPC response.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = await HostProjectRegistrationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/hostProjectRegistrations/[HOST_PROJECT_REGISTRATION]";
// Make the request
HostProjectRegistration response = await hostProjectRegistrationServiceClient.GetHostProjectRegistrationAsync(name);

GetHostProjectRegistrationAsync(string, CancellationToken)

public virtual Task<HostProjectRegistration> GetHostProjectRegistrationAsync(string name, CancellationToken cancellationToken)

Get a host project registration.

Parameters
Name Description
name string

Required. Host project registration resource name. projects/{project}/locations/{location}/hostProjectRegistrations/{host_project_registration_id}

cancellationToken CancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
TaskHostProjectRegistration

A Task containing the RPC response.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = await HostProjectRegistrationServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "projects/[PROJECT]/locations/[LOCATION]/hostProjectRegistrations/[HOST_PROJECT_REGISTRATION]";
// Make the request
HostProjectRegistration response = await hostProjectRegistrationServiceClient.GetHostProjectRegistrationAsync(name);

ListHostProjectRegistrations(LocationName, string, int?, CallSettings)

public virtual PagedEnumerable<ListHostProjectRegistrationsResponse, HostProjectRegistration> ListHostProjectRegistrations(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists host project registrations.

Parameters
Name Description
parent LocationName

Required. The parent, which owns this collection of host projects. Format: projects/*/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
PagedEnumerableListHostProjectRegistrationsResponseHostProjectRegistration

A pageable sequence of HostProjectRegistration resources.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = HostProjectRegistrationServiceClient.Create();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedEnumerable<ListHostProjectRegistrationsResponse, HostProjectRegistration> response = hostProjectRegistrationServiceClient.ListHostProjectRegistrations(parent);

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

ListHostProjectRegistrations(ListHostProjectRegistrationsRequest, CallSettings)

public virtual PagedEnumerable<ListHostProjectRegistrationsResponse, HostProjectRegistration> ListHostProjectRegistrations(ListHostProjectRegistrationsRequest request, CallSettings callSettings = null)

Lists host project registrations.

Parameters
Name Description
request ListHostProjectRegistrationsRequest

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
PagedEnumerableListHostProjectRegistrationsResponseHostProjectRegistration

A pageable sequence of HostProjectRegistration resources.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = HostProjectRegistrationServiceClient.Create();
// Initialize request argument(s)
ListHostProjectRegistrationsRequest request = new ListHostProjectRegistrationsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    OrderBy = "",
};
// Make the request
PagedEnumerable<ListHostProjectRegistrationsResponse, HostProjectRegistration> response = hostProjectRegistrationServiceClient.ListHostProjectRegistrations(request);

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

ListHostProjectRegistrations(string, string, int?, CallSettings)

public virtual PagedEnumerable<ListHostProjectRegistrationsResponse, HostProjectRegistration> ListHostProjectRegistrations(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists host project registrations.

Parameters
Name Description
parent string

Required. The parent, which owns this collection of host projects. Format: projects/*/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
PagedEnumerableListHostProjectRegistrationsResponseHostProjectRegistration

A pageable sequence of HostProjectRegistration resources.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = HostProjectRegistrationServiceClient.Create();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedEnumerable<ListHostProjectRegistrationsResponse, HostProjectRegistration> response = hostProjectRegistrationServiceClient.ListHostProjectRegistrations(parent);

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

ListHostProjectRegistrationsAsync(LocationName, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListHostProjectRegistrationsResponse, HostProjectRegistration> ListHostProjectRegistrationsAsync(LocationName parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists host project registrations.

Parameters
Name Description
parent LocationName

Required. The parent, which owns this collection of host projects. Format: projects/*/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
PagedAsyncEnumerableListHostProjectRegistrationsResponseHostProjectRegistration

A pageable asynchronous sequence of HostProjectRegistration resources.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = await HostProjectRegistrationServiceClient.CreateAsync();
// Initialize request argument(s)
LocationName parent = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]");
// Make the request
PagedAsyncEnumerable<ListHostProjectRegistrationsResponse, HostProjectRegistration> response = hostProjectRegistrationServiceClient.ListHostProjectRegistrationsAsync(parent);

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

ListHostProjectRegistrationsAsync(ListHostProjectRegistrationsRequest, CallSettings)

public virtual PagedAsyncEnumerable<ListHostProjectRegistrationsResponse, HostProjectRegistration> ListHostProjectRegistrationsAsync(ListHostProjectRegistrationsRequest request, CallSettings callSettings = null)

Lists host project registrations.

Parameters
Name Description
request ListHostProjectRegistrationsRequest

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
PagedAsyncEnumerableListHostProjectRegistrationsResponseHostProjectRegistration

A pageable asynchronous sequence of HostProjectRegistration resources.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = await HostProjectRegistrationServiceClient.CreateAsync();
// Initialize request argument(s)
ListHostProjectRegistrationsRequest request = new ListHostProjectRegistrationsRequest
{
    ParentAsLocationName = LocationName.FromProjectLocation("[PROJECT]", "[LOCATION]"),
    Filter = "",
    OrderBy = "",
};
// Make the request
PagedAsyncEnumerable<ListHostProjectRegistrationsResponse, HostProjectRegistration> response = hostProjectRegistrationServiceClient.ListHostProjectRegistrationsAsync(request);

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

ListHostProjectRegistrationsAsync(string, string, int?, CallSettings)

public virtual PagedAsyncEnumerable<ListHostProjectRegistrationsResponse, HostProjectRegistration> ListHostProjectRegistrationsAsync(string parent, string pageToken = null, int? pageSize = null, CallSettings callSettings = null)

Lists host project registrations.

Parameters
Name Description
parent string

Required. The parent, which owns this collection of host projects. Format: projects/*/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
PagedAsyncEnumerableListHostProjectRegistrationsResponseHostProjectRegistration

A pageable asynchronous sequence of HostProjectRegistration resources.

Example
// Create client
HostProjectRegistrationServiceClient hostProjectRegistrationServiceClient = await HostProjectRegistrationServiceClient.CreateAsync();
// Initialize request argument(s)
string parent = "projects/[PROJECT]/locations/[LOCATION]";
// Make the request
PagedAsyncEnumerable<ListHostProjectRegistrationsResponse, HostProjectRegistration> response = hostProjectRegistrationServiceClient.ListHostProjectRegistrationsAsync(parent);

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