2.7.0 (latest) 2.6.0 2.5.0 2.4.0 2.3.0 2.2.0 2.1.0 2.0.0 1.0.0-beta01

    public class FleetRouting.FleetRoutingClient : ClientBase<FleetRouting.FleetRoutingClient>

Reference documentation and code samples for the Cloud Optimization v1 API class FleetRouting.FleetRoutingClient.

Client for FleetRouting

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> [ClientBase](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.md.txt) \> [ClientBase](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase-1.md.txt)[FleetRouting](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.FleetRouting.md.txt)[FleetRoutingClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.FleetRouting.FleetRoutingClient.md.txt) \> FleetRouting.FleetRoutingClient

## Inherited Members

[ClientBase\<FleetRouting.FleetRoutingClient\>.WithHost(string)](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase-1.md.txt#Grpc_Core_ClientBase_1_WithHost_System_String_) [ClientBase.CallInvoker](https://docs.cloud.google.com/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.ClientBase.md.txt#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.Optimization.V1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.Optimization.V1/latest/Google.Cloud.Optimization.V1.md.txt)

## Assembly

Google.Cloud.Optimization.V1.dll

## Constructors

### FleetRoutingClient()

    protected FleetRoutingClient()

Protected parameterless constructor to allow creation of test doubles.

### FleetRoutingClient(CallInvoker)

    public FleetRoutingClient(CallInvoker callInvoker)

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `callInvoker` | `CallInvoker` The callInvoker to use to make remote calls. |

### FleetRoutingClient(ChannelBase)

    public FleetRoutingClient(ChannelBase channel)

Creates a new client for FleetRouting

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `channel` | `ChannelBase` The channel to use to make remote calls. |

### FleetRoutingClient(ClientBaseConfiguration)

    protected FleetRoutingClient(ClientBase.ClientBaseConfiguration configuration)

Protected constructor to allow creation of configured clients.

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `configuration` | `ClientBaseClientBaseConfiguration` The client configuration. |

## Methods

### BatchOptimizeTours(BatchOptimizeToursRequest, CallOptions)

    public virtual Operation BatchOptimizeTours(BatchOptimizeToursRequest request, CallOptions options)

Optimizes vehicle tours for one or more `OptimizeToursRequest`
messages as a batch.

This method is a Long Running Operation (LRO). The inputs for optimization
(`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse`
messages) are read/written from/to Cloud Storage in user-specified
format. Like the `OptimizeTours` method, each `OptimizeToursRequest`
contains a `ShipmentModel` and returns an `OptimizeToursResponse`
containing `ShipmentRoute`s, which are a set of routes to be performed by
vehicles minimizing the overall cost.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `BatchOptimizeToursRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Operation` | The response received from the server. |

### BatchOptimizeTours(BatchOptimizeToursRequest, Metadata, DateTime?, CancellationToken)

    public virtual Operation BatchOptimizeTours(BatchOptimizeToursRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Optimizes vehicle tours for one or more `OptimizeToursRequest`
messages as a batch.

This method is a Long Running Operation (LRO). The inputs for optimization
(`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse`
messages) are read/written from/to Cloud Storage in user-specified
format. Like the `OptimizeTours` method, each `OptimizeToursRequest`
contains a `ShipmentModel` and returns an `OptimizeToursResponse`
containing `ShipmentRoute`s, which are a set of routes to be performed by
vehicles minimizing the overall cost.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `BatchOptimizeToursRequest` The request to send to the server. |
| `headers` | `Metadata` 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` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `Operation` | The response received from the server. |

### BatchOptimizeToursAsync(BatchOptimizeToursRequest, CallOptions)

    public virtual AsyncUnaryCall<Operation> BatchOptimizeToursAsync(BatchOptimizeToursRequest request, CallOptions options)

Optimizes vehicle tours for one or more `OptimizeToursRequest`
messages as a batch.

This method is a Long Running Operation (LRO). The inputs for optimization
(`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse`
messages) are read/written from/to Cloud Storage in user-specified
format. Like the `OptimizeTours` method, each `OptimizeToursRequest`
contains a `ShipmentModel` and returns an `OptimizeToursResponse`
containing `ShipmentRoute`s, which are a set of routes to be performed by
vehicles minimizing the overall cost.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `BatchOptimizeToursRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallOperation` | The call object. |

### BatchOptimizeToursAsync(BatchOptimizeToursRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<Operation> BatchOptimizeToursAsync(BatchOptimizeToursRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Optimizes vehicle tours for one or more `OptimizeToursRequest`
messages as a batch.

This method is a Long Running Operation (LRO). The inputs for optimization
(`OptimizeToursRequest` messages) and outputs (`OptimizeToursResponse`
messages) are read/written from/to Cloud Storage in user-specified
format. Like the `OptimizeTours` method, each `OptimizeToursRequest`
contains a `ShipmentModel` and returns an `OptimizeToursResponse`
containing `ShipmentRoute`s, which are a set of routes to be performed by
vehicles minimizing the overall cost.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `BatchOptimizeToursRequest` The request to send to the server. |
| `headers` | `Metadata` 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` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallOperation` | The call object. |

### CreateOperationsClient()

    public virtual Operations.OperationsClient CreateOperationsClient()

Creates a new instance of [Operations.OperationsClient](https://docs.cloud.google.com/dotnet/docs/reference/Google.LongRunning/latest/Google.LongRunning.Operations.OperationsClient.md.txt) using the same call invoker as
this client.

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `OperationsOperationsClient` | A new Operations client for the same target as this client. |

### NewInstance(ClientBaseConfiguration)

    protected override FleetRouting.FleetRoutingClient NewInstance(ClientBase.ClientBaseConfiguration configuration)

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

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `configuration` | `ClientBaseClientBaseConfiguration` |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `FleetRoutingFleetRoutingClient` |   |

**Overrides** Grpc.Core.ClientBase\<Google.Cloud.Optimization.V1.FleetRouting.FleetRoutingClient\>.NewInstance(Grpc.Core.ClientBase.ClientBaseConfiguration)

### OptimizeTours(OptimizeToursRequest, CallOptions)

    public virtual OptimizeToursResponse OptimizeTours(OptimizeToursRequest request, CallOptions options)

Sends an `OptimizeToursRequest` containing a `ShipmentModel` and returns an
`OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of
routes to be performed by vehicles minimizing the overall cost.

A `ShipmentModel` model consists mainly of `Shipment`s that need to be
carried out and `Vehicle`s that can be used to transport the `Shipment`s.
The `ShipmentRoute`s assign `Shipment`s to `Vehicle`s. More specifically,
they assign a series of `Visit`s to each vehicle, where a `Visit`
corresponds to a `VisitRequest`, which is a pickup or delivery for a
`Shipment`.

The goal is to provide an assignment of `ShipmentRoute`s to `Vehicle`s that
minimizes the total cost where cost has many components defined in the
`ShipmentModel`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `OptimizeToursRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `OptimizeToursResponse` | The response received from the server. |

### OptimizeTours(OptimizeToursRequest, Metadata, DateTime?, CancellationToken)

    public virtual OptimizeToursResponse OptimizeTours(OptimizeToursRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Sends an `OptimizeToursRequest` containing a `ShipmentModel` and returns an
`OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of
routes to be performed by vehicles minimizing the overall cost.

A `ShipmentModel` model consists mainly of `Shipment`s that need to be
carried out and `Vehicle`s that can be used to transport the `Shipment`s.
The `ShipmentRoute`s assign `Shipment`s to `Vehicle`s. More specifically,
they assign a series of `Visit`s to each vehicle, where a `Visit`
corresponds to a `VisitRequest`, which is a pickup or delivery for a
`Shipment`.

The goal is to provide an assignment of `ShipmentRoute`s to `Vehicle`s that
minimizes the total cost where cost has many components defined in the
`ShipmentModel`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `OptimizeToursRequest` The request to send to the server. |
| `headers` | `Metadata` 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` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `OptimizeToursResponse` | The response received from the server. |

### OptimizeToursAsync(OptimizeToursRequest, CallOptions)

    public virtual AsyncUnaryCall<OptimizeToursResponse> OptimizeToursAsync(OptimizeToursRequest request, CallOptions options)

Sends an `OptimizeToursRequest` containing a `ShipmentModel` and returns an
`OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of
routes to be performed by vehicles minimizing the overall cost.

A `ShipmentModel` model consists mainly of `Shipment`s that need to be
carried out and `Vehicle`s that can be used to transport the `Shipment`s.
The `ShipmentRoute`s assign `Shipment`s to `Vehicle`s. More specifically,
they assign a series of `Visit`s to each vehicle, where a `Visit`
corresponds to a `VisitRequest`, which is a pickup or delivery for a
`Shipment`.

The goal is to provide an assignment of `ShipmentRoute`s to `Vehicle`s that
minimizes the total cost where cost has many components defined in the
`ShipmentModel`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `OptimizeToursRequest` The request to send to the server. |
| `options` | `CallOptions` The options for the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallOptimizeToursResponse` | The call object. |

### OptimizeToursAsync(OptimizeToursRequest, Metadata, DateTime?, CancellationToken)

    public virtual AsyncUnaryCall<OptimizeToursResponse> OptimizeToursAsync(OptimizeToursRequest request, Metadata headers = null, DateTime? deadline = null, CancellationToken cancellationToken = default)

Sends an `OptimizeToursRequest` containing a `ShipmentModel` and returns an
`OptimizeToursResponse` containing `ShipmentRoute`s, which are a set of
routes to be performed by vehicles minimizing the overall cost.

A `ShipmentModel` model consists mainly of `Shipment`s that need to be
carried out and `Vehicle`s that can be used to transport the `Shipment`s.
The `ShipmentRoute`s assign `Shipment`s to `Vehicle`s. More specifically,
they assign a series of `Visit`s to each vehicle, where a `Visit`
corresponds to a `VisitRequest`, which is a pickup or delivery for a
`Shipment`.

The goal is to provide an assignment of `ShipmentRoute`s to `Vehicle`s that
minimizes the total cost where cost has many components defined in the
`ShipmentModel`.

| **Parameters** ||
|---|---|
| **Name** | **Description** |
| `request` | `OptimizeToursRequest` The request to send to the server. |
| `headers` | `Metadata` 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` | `CancellationToken` An optional token for canceling the call. |

| **Returns** ||
|---|---|
| **Type** | **Description** |
| `AsyncUnaryCallOptimizeToursResponse` | The call object. |