# Google.Cloud.Location - Class Locations.LocationsClient (2.4.0)

<button class="button button-with-icon cloud-select-dropdown__button " aria-haspopup="true">Version latest</button>

- [2.4.0 (latest)](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.Locations.LocationsClient)
- [2.3.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/2.3.0/Google.Cloud.Location.Locations.LocationsClient)
- [2.2.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/2.2.0/Google.Cloud.Location.Locations.LocationsClient)
- [2.1.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/2.1.0/Google.Cloud.Location.Locations.LocationsClient)
- [2.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/2.0.0/Google.Cloud.Location.Locations.LocationsClient)
- [1.0.0](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/1.0.0/Google.Cloud.Location.Locations.LocationsClient)

    public class Locations.LocationsClient : ClientBase<Locations.LocationsClient>

Reference documentation and code samples for the Google.Cloud.Location class Locations.LocationsClient.

Client for Locations

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> [ClientBase](https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.html) \> [ClientBase](https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase-1.html)[Locations](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.Locations)[LocationsClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.Locations.LocationsClient) \> Locations.LocationsClient

## Inherited Members

[ClientBase\<Locations.LocationsClient\>.WithHost(string)](https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase-1.html#Grpc_Core_ClientBase_1_WithHost_System_String_) [ClientBase.CallInvoker](https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.html#Grpc_Core_ClientBase_CallInvoker) [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)

## Namespace

[Google.Cloud.Location](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location)

## Assembly

Google.Cloud.Location.dll

## Constructors

### LocationsClient()

    protected LocationsClient()

Protected parameterless constructor to allow creation of test doubles.

### LocationsClient(CallInvoker)

    public LocationsClient(CallInvoker callInvoker)

Creates a new client for Locations that uses a custom `CallInvoker`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `callInvoker` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallInvoker.html` The callInvoker to use to make remote calls. |

### LocationsClient(ChannelBase)

    public LocationsClient(ChannelBase channel)

Creates a new client for Locations

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `channel` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ChannelBase.html` The channel to use to make remote calls. |

### LocationsClient(ClientBaseConfiguration)

    protected LocationsClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `configuration` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.htmlhttps://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.ClientBaseConfiguration.html` The client configuration. |

## Methods

### GetLocation(GetLocationRequest, CallOptions)

    public virtual Location GetLocation(GetLocationRequest request, CallOptions options)

Gets information about a location.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.GetLocationRequest` The request to send to the server. |
| `options` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallOptions.html` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.Location` | The response received from the server. |

### GetLocation(GetLocationRequest, Metadata, DateTime?, CancellationToken)

    public virtual Location GetLocation(GetLocationRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Gets information about a location.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.GetLocationRequest` The request to send to the server. |
| `headers` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata.html` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.Location` | The response received from the server. |

### GetLocationAsync(GetLocationRequest, CallOptions)

    public virtual AsyncUnaryCall<Location> GetLocationAsync(GetLocationRequest request, CallOptions options)

Gets information about a location.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.GetLocationRequest` The request to send to the server. |
| `options` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallOptions.html` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncUnaryCall-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.Location` | The call object. |

### GetLocationAsync(GetLocationRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<Location> GetLocationAsync(GetLocationRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Gets information about a location.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.GetLocationRequest` The request to send to the server. |
| `headers` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata.html` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncUnaryCall-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.Location` | The call object. |

### ListLocations(ListLocationsRequest, CallOptions)

    public virtual ListLocationsResponse ListLocations(ListLocationsRequest request, CallOptions options)

Lists information about the supported locations for this service.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.ListLocationsRequest` The request to send to the server. |
| `options` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallOptions.html` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.ListLocationsResponse` | The response received from the server. |

### ListLocations(ListLocationsRequest, Metadata, DateTime?, CancellationToken)

    public virtual ListLocationsResponse ListLocations(ListLocationsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Lists information about the supported locations for this service.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.ListLocationsRequest` The request to send to the server. |
| `headers` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata.html` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.ListLocationsResponse` | The response received from the server. |

### ListLocationsAsync(ListLocationsRequest, CallOptions)

    public virtual AsyncUnaryCall<ListLocationsResponse> ListLocationsAsync(ListLocationsRequest request, CallOptions options)

Lists information about the supported locations for this service.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.ListLocationsRequest` The request to send to the server. |
| `options` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.CallOptions.html` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncUnaryCall-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.ListLocationsResponse` | The call object. |

### ListLocationsAsync(ListLocationsRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<ListLocationsResponse> ListLocationsAsync(ListLocationsRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Lists information about the supported locations for this service.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.ListLocationsRequest` The request to send to the server. |
| `headers` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Metadata.html` The initial metadata to send with the call. This parameter is optional. |
| `deadline` | `System.DateTime` An optional deadline for the call. The call will be cancelled if deadline is hit. |
| `cancellationToken` | `https://learn.microsoft.com/dotnet/api/system.threading.cancellationtoken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.AsyncUnaryCall-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.ListLocationsResponse` | The call object. |

### NewInstance(ClientBaseConfiguration)

    protected override Locations.LocationsClient NewInstance(ClientBase.ClientBaseConfiguration configuration)

Creates a new instance of client from given `ClientBaseConfiguration`.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `configuration` | `https://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.htmlhttps://cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.ClientBaseConfiguration.html` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.Locationshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Location/latest/Google.Cloud.Location.Locations.LocationsClient` |   |

**Overrides** Grpc.Core.ClientBase\<Google.Cloud.Location.Locations.LocationsClient\>.NewInstance(Grpc.Core.ClientBase.ClientBaseConfiguration)