1.3.0 (latest) 1.2.0 1.1.0 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](https://learn.microsoft.com/dotnet/api/system.object) \> HostProjectRegistrationServiceClient

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Derived Types

[HostProjectRegistrationServiceClientImpl](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.HostProjectRegistrationServiceClientImpl.md.txt)

## Namespace

[Google.Cloud.ApiHub.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.md.txt)

## 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:

- <https://www.googleapis.com/auth/apihub.readonly>
- <https://www.googleapis.com/auth/apihub.readwrite>
- <https://www.googleapis.com/auth/cloud-platform>

### 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](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.LocationsClient.md.txt) 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](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.HostProjectRegistrationServiceClient.md.txt) using the default credentials,
endpoint and settings. To specify custom credentials or other settings, use
[HostProjectRegistrationServiceClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.HostProjectRegistrationServiceClientBuilder.md.txt).

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `HostProjectRegistrationServiceClient` | The created [HostProjectRegistrationServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.HostProjectRegistrationServiceClient.md.txt). |

### CreateAsync(CancellationToken)

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

Asynchronously creates a [HostProjectRegistrationServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.HostProjectRegistrationServiceClient.md.txt) using the default credentials,
endpoint and settings. To specify custom credentials or other settings, use
[HostProjectRegistrationServiceClientBuilder](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.HostProjectRegistrationServiceClientBuilder.md.txt).

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `cancellationToken` | `CancellationToken` The [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use while creating the client. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `TaskHostProjectRegistrationServiceClient` | The task representing the created [HostProjectRegistrationServiceClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.HostProjectRegistrationServiceClient.md.txt). |

### 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 have only one host project registration at a time.
Subsequent register calls for the same project will fail until the
existing registration is deleted.

| **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**

```cs
// 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 have only one host project registration at a time.
Subsequent register calls for the same project will fail until the
existing registration is deleted.

| **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**

```cs
// 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 have only one host project registration at a time.
Subsequent register calls for the same project will fail until the
existing registration is deleted.

| **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**

```cs
// 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 have only one host project registration at a time.
Subsequent register calls for the same project will fail until the
existing registration is deleted.

| **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**

```cs
// 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 have only one host project registration at a time.
Subsequent register calls for the same project will fail until the
existing registration is deleted.

| **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](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `TaskHostProjectRegistration` | A Task containing the RPC response. |

**Example**

```cs
// 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 have only one host project registration at a time.
Subsequent register calls for the same project will fail until the
existing registration is deleted.

| **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**

```cs
// 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 have only one host project registration at a time.
Subsequent register calls for the same project will fail until the
existing registration is deleted.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `CreateHostProjectRegistrationRequest` The request object containing all of the parameters for the API call. |
| `cancellationToken` | `CancellationToken` A [CancellationToken](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `TaskHostProjectRegistration` | A Task containing the RPC response. |

**Example**

```cs
// 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 have only one host project registration at a time.
Subsequent register calls for the same project will fail until the
existing registration is deleted.

| **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**

```cs
// 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 have only one host project registration at a time.
Subsequent register calls for the same project will fail until the
existing registration is deleted.

| **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](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `TaskHostProjectRegistration` | A Task containing the RPC response. |

**Example**

```cs
// 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**

```cs
// 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**

```cs
// 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**

```cs
// 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**

```cs
// 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](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `TaskHostProjectRegistration` | A Task containing the RPC response. |

**Example**

```cs
// 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**

```cs
// 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](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `TaskHostProjectRegistration` | A Task containing the RPC response. |

**Example**

```cs
// 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**

```cs
// 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](https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken) to use for this RPC. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `TaskHostProjectRegistration` | A Task containing the RPC response. |

**Example**

```cs
// 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](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.HostProjectRegistration.md.txt) resources. |

**Example**

```cs
// 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](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.HostProjectRegistration.md.txt) resources. |

**Example**

```cs
// 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](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.HostProjectRegistration.md.txt) resources. |

**Example**

```cs
// 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](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.HostProjectRegistration.md.txt) resources. |

**Example**

```cs
// 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 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
await 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 = 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](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.HostProjectRegistration.md.txt) resources. |

**Example**

```cs
// 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 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
await 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 = 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](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.HostProjectRegistration.md.txt) resources. |

**Example**

```cs
// 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 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
await 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 = 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()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.HostProjectRegistrationServiceClient.md.txt#Google_Cloud_ApiHub_V1_HostProjectRegistrationServiceClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.HostProjectRegistrationServiceClient.md.txt#Google_Cloud_ApiHub_V1_HostProjectRegistrationServiceClient_CreateAsync_System_Threading_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()](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.HostProjectRegistrationServiceClient.md.txt#Google_Cloud_ApiHub_V1_HostProjectRegistrationServiceClient_Create) and
[CreateAsync(CancellationToken)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.ApiHub.V1/latest/Google.Cloud.ApiHub.V1.HostProjectRegistrationServiceClient.md.txt#Google_Cloud_ApiHub_V1_HostProjectRegistrationServiceClient_CreateAsync_System_Threading_CancellationToken_) will create new channels, which could in turn be shut down
by another call to this method.