Show / Hide Table of Contents

Class VehicleServiceClient

VehicleService client wrapper, for convenient use.

Inheritance
object
VehicleServiceClient
VehicleServiceClientImpl
Inherited Members
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ToString()
Namespace: Google.Maps.FleetEngine.V1
Assembly: Google.Maps.FleetEngine.V1.dll
Syntax
public abstract class VehicleServiceClient
Remarks

Vehicle management service.

Properties

DefaultEndpoint

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

Declaration
public static string DefaultEndpoint { get; }
Property Value
Type Description
string

DefaultScopes

The default VehicleService scopes.

Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
Type Description
IReadOnlyList<string>
Remarks

The default VehicleService scopes are:

  • https://www.googleapis.com/auth/cloud-platform

GrpcClient

The underlying gRPC VehicleService client

Declaration
public virtual VehicleService.VehicleServiceClient GrpcClient { get; }
Property Value
Type Description
VehicleService.VehicleServiceClient

ServiceMetadata

The service metadata associated with this client type.

Declaration
public static ServiceMetadata ServiceMetadata { get; }
Property Value
Type Description
ServiceMetadata

Methods

Create()

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

Declaration
public static VehicleServiceClient Create()
Returns
Type Description
VehicleServiceClient

The created VehicleServiceClient.

CreateAsync(CancellationToken)

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

Declaration
public static Task<VehicleServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
Type Name Description
CancellationToken cancellationToken

The CancellationToken to use while creating the client.

Returns
Type Description
Task<VehicleServiceClient>

The task representing the created VehicleServiceClient.

CreateVehicle(CreateVehicleRequest, CallSettings)

Instantiates a new vehicle associated with an on-demand rideshare or deliveries provider. Each Vehicle must have a unique vehicle ID.

The following Vehicle fields are required when creating a Vehicle:

  • vehicleState
  • supportedTripTypes
  • maximumCapacity
  • vehicleType

The following Vehicle fields are ignored when creating a Vehicle:

  • name
  • currentTrips
  • availableCapacity
  • current_route_segment
  • current_route_segment_end_point
  • current_route_segment_version
  • current_route_segment_traffic
  • route
  • waypoints
  • waypoints_version
  • remaining_distance_meters
  • remaining_time_seconds
  • eta_to_next_waypoint
  • navigation_status

All other fields are optional and used if provided.

Declaration
public virtual Vehicle CreateVehicle(CreateVehicleRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CreateVehicleRequest request

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
Vehicle

The RPC response.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = VehicleServiceClient.Create();
// Initialize request argument(s)
CreateVehicleRequest request = new CreateVehicleRequest
{
    Header = new RequestHeader(),
    Parent = "",
    VehicleId = "",
    Vehicle = new Vehicle(),
};
// Make the request
Vehicle response = vehicleServiceClient.CreateVehicle(request);

CreateVehicleAsync(CreateVehicleRequest, CallSettings)

Instantiates a new vehicle associated with an on-demand rideshare or deliveries provider. Each Vehicle must have a unique vehicle ID.

The following Vehicle fields are required when creating a Vehicle:

  • vehicleState
  • supportedTripTypes
  • maximumCapacity
  • vehicleType

The following Vehicle fields are ignored when creating a Vehicle:

  • name
  • currentTrips
  • availableCapacity
  • current_route_segment
  • current_route_segment_end_point
  • current_route_segment_version
  • current_route_segment_traffic
  • route
  • waypoints
  • waypoints_version
  • remaining_distance_meters
  • remaining_time_seconds
  • eta_to_next_waypoint
  • navigation_status

All other fields are optional and used if provided.

Declaration
public virtual Task<Vehicle> CreateVehicleAsync(CreateVehicleRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
CreateVehicleRequest request

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
Task<Vehicle>

A Task containing the RPC response.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = await VehicleServiceClient.CreateAsync();
// Initialize request argument(s)
CreateVehicleRequest request = new CreateVehicleRequest
{
    Header = new RequestHeader(),
    Parent = "",
    VehicleId = "",
    Vehicle = new Vehicle(),
};
// Make the request
Vehicle response = await vehicleServiceClient.CreateVehicleAsync(request);

CreateVehicleAsync(CreateVehicleRequest, CancellationToken)

Instantiates a new vehicle associated with an on-demand rideshare or deliveries provider. Each Vehicle must have a unique vehicle ID.

The following Vehicle fields are required when creating a Vehicle:

  • vehicleState
  • supportedTripTypes
  • maximumCapacity
  • vehicleType

The following Vehicle fields are ignored when creating a Vehicle:

  • name
  • currentTrips
  • availableCapacity
  • current_route_segment
  • current_route_segment_end_point
  • current_route_segment_version
  • current_route_segment_traffic
  • route
  • waypoints
  • waypoints_version
  • remaining_distance_meters
  • remaining_time_seconds
  • eta_to_next_waypoint
  • navigation_status

All other fields are optional and used if provided.

Declaration
public virtual Task<Vehicle> CreateVehicleAsync(CreateVehicleRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
CreateVehicleRequest request

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

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Vehicle>

A Task containing the RPC response.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = await VehicleServiceClient.CreateAsync();
// Initialize request argument(s)
CreateVehicleRequest request = new CreateVehicleRequest
{
    Header = new RequestHeader(),
    Parent = "",
    VehicleId = "",
    Vehicle = new Vehicle(),
};
// Make the request
Vehicle response = await vehicleServiceClient.CreateVehicleAsync(request);

DeleteVehicle(DeleteVehicleRequest, CallSettings)

Deletes a Vehicle from the Fleet Engine.

Returns FAILED_PRECONDITION if the Vehicle has active Trips. assigned to it.

Declaration
public virtual void DeleteVehicle(DeleteVehicleRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
DeleteVehicleRequest request

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

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = VehicleServiceClient.Create();
// Initialize request argument(s)
DeleteVehicleRequest request = new DeleteVehicleRequest
{
    Header = new RequestHeader(),
    VehicleName = VehicleName.FromProviderVehicle("[PROVIDER]", "[VEHICLE]"),
};
// Make the request
vehicleServiceClient.DeleteVehicle(request);

DeleteVehicle(VehicleName, CallSettings)

Deletes a Vehicle from the Fleet Engine.

Returns FAILED_PRECONDITION if the Vehicle has active Trips. assigned to it.

Declaration
public virtual void DeleteVehicle(VehicleName name, CallSettings callSettings = null)
Parameters
Type Name Description
VehicleName name

Required. Must be in the format providers/{provider}/vehicles/{vehicle}. The {provider} must be the Project ID (for example, sample-cloud-project) of the Google Cloud Project of which the service account making this call is a member.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = VehicleServiceClient.Create();
// Initialize request argument(s)
VehicleName name = VehicleName.FromProviderVehicle("[PROVIDER]", "[VEHICLE]");
// Make the request
vehicleServiceClient.DeleteVehicle(name);

DeleteVehicle(string, CallSettings)

Deletes a Vehicle from the Fleet Engine.

Returns FAILED_PRECONDITION if the Vehicle has active Trips. assigned to it.

Declaration
public virtual void DeleteVehicle(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. Must be in the format providers/{provider}/vehicles/{vehicle}. The {provider} must be the Project ID (for example, sample-cloud-project) of the Google Cloud Project of which the service account making this call is a member.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = VehicleServiceClient.Create();
// Initialize request argument(s)
string name = "providers/[PROVIDER]/vehicles/[VEHICLE]";
// Make the request
vehicleServiceClient.DeleteVehicle(name);

DeleteVehicleAsync(DeleteVehicleRequest, CallSettings)

Deletes a Vehicle from the Fleet Engine.

Returns FAILED_PRECONDITION if the Vehicle has active Trips. assigned to it.

Declaration
public virtual Task DeleteVehicleAsync(DeleteVehicleRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
DeleteVehicleRequest request

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
Task

A Task containing the RPC response.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = await VehicleServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteVehicleRequest request = new DeleteVehicleRequest
{
    Header = new RequestHeader(),
    VehicleName = VehicleName.FromProviderVehicle("[PROVIDER]", "[VEHICLE]"),
};
// Make the request
await vehicleServiceClient.DeleteVehicleAsync(request);

DeleteVehicleAsync(DeleteVehicleRequest, CancellationToken)

Deletes a Vehicle from the Fleet Engine.

Returns FAILED_PRECONDITION if the Vehicle has active Trips. assigned to it.

Declaration
public virtual Task DeleteVehicleAsync(DeleteVehicleRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
DeleteVehicleRequest request

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

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = await VehicleServiceClient.CreateAsync();
// Initialize request argument(s)
DeleteVehicleRequest request = new DeleteVehicleRequest
{
    Header = new RequestHeader(),
    VehicleName = VehicleName.FromProviderVehicle("[PROVIDER]", "[VEHICLE]"),
};
// Make the request
await vehicleServiceClient.DeleteVehicleAsync(request);

DeleteVehicleAsync(VehicleName, CallSettings)

Deletes a Vehicle from the Fleet Engine.

Returns FAILED_PRECONDITION if the Vehicle has active Trips. assigned to it.

Declaration
public virtual Task DeleteVehicleAsync(VehicleName name, CallSettings callSettings = null)
Parameters
Type Name Description
VehicleName name

Required. Must be in the format providers/{provider}/vehicles/{vehicle}. The {provider} must be the Project ID (for example, sample-cloud-project) of the Google Cloud Project of which the service account making this call is a member.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = await VehicleServiceClient.CreateAsync();
// Initialize request argument(s)
VehicleName name = VehicleName.FromProviderVehicle("[PROVIDER]", "[VEHICLE]");
// Make the request
await vehicleServiceClient.DeleteVehicleAsync(name);

DeleteVehicleAsync(VehicleName, CancellationToken)

Deletes a Vehicle from the Fleet Engine.

Returns FAILED_PRECONDITION if the Vehicle has active Trips. assigned to it.

Declaration
public virtual Task DeleteVehicleAsync(VehicleName name, CancellationToken cancellationToken)
Parameters
Type Name Description
VehicleName name

Required. Must be in the format providers/{provider}/vehicles/{vehicle}. The {provider} must be the Project ID (for example, sample-cloud-project) of the Google Cloud Project of which the service account making this call is a member.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = await VehicleServiceClient.CreateAsync();
// Initialize request argument(s)
VehicleName name = VehicleName.FromProviderVehicle("[PROVIDER]", "[VEHICLE]");
// Make the request
await vehicleServiceClient.DeleteVehicleAsync(name);

DeleteVehicleAsync(string, CallSettings)

Deletes a Vehicle from the Fleet Engine.

Returns FAILED_PRECONDITION if the Vehicle has active Trips. assigned to it.

Declaration
public virtual Task DeleteVehicleAsync(string name, CallSettings callSettings = null)
Parameters
Type Name Description
string name

Required. Must be in the format providers/{provider}/vehicles/{vehicle}. The {provider} must be the Project ID (for example, sample-cloud-project) of the Google Cloud Project of which the service account making this call is a member.

CallSettings callSettings

If not null, applies overrides to this RPC call.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = await VehicleServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "providers/[PROVIDER]/vehicles/[VEHICLE]";
// Make the request
await vehicleServiceClient.DeleteVehicleAsync(name);

DeleteVehicleAsync(string, CancellationToken)

Deletes a Vehicle from the Fleet Engine.

Returns FAILED_PRECONDITION if the Vehicle has active Trips. assigned to it.

Declaration
public virtual Task DeleteVehicleAsync(string name, CancellationToken cancellationToken)
Parameters
Type Name Description
string name

Required. Must be in the format providers/{provider}/vehicles/{vehicle}. The {provider} must be the Project ID (for example, sample-cloud-project) of the Google Cloud Project of which the service account making this call is a member.

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task

A Task containing the RPC response.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = await VehicleServiceClient.CreateAsync();
// Initialize request argument(s)
string name = "providers/[PROVIDER]/vehicles/[VEHICLE]";
// Make the request
await vehicleServiceClient.DeleteVehicleAsync(name);

GetVehicle(GetVehicleRequest, CallSettings)

Returns a vehicle from the Fleet Engine.

Declaration
public virtual Vehicle GetVehicle(GetVehicleRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetVehicleRequest request

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
Vehicle

The RPC response.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = VehicleServiceClient.Create();
// Initialize request argument(s)
GetVehicleRequest request = new GetVehicleRequest
{
    Header = new RequestHeader(),
    VehicleName = VehicleName.FromProviderVehicle("[PROVIDER]", "[VEHICLE]"),
    CurrentRouteSegmentVersion = new Timestamp(),
    WaypointsVersion = new Timestamp(),
};
// Make the request
Vehicle response = vehicleServiceClient.GetVehicle(request);

GetVehicleAsync(GetVehicleRequest, CallSettings)

Returns a vehicle from the Fleet Engine.

Declaration
public virtual Task<Vehicle> GetVehicleAsync(GetVehicleRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
GetVehicleRequest request

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
Task<Vehicle>

A Task containing the RPC response.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = await VehicleServiceClient.CreateAsync();
// Initialize request argument(s)
GetVehicleRequest request = new GetVehicleRequest
{
    Header = new RequestHeader(),
    VehicleName = VehicleName.FromProviderVehicle("[PROVIDER]", "[VEHICLE]"),
    CurrentRouteSegmentVersion = new Timestamp(),
    WaypointsVersion = new Timestamp(),
};
// Make the request
Vehicle response = await vehicleServiceClient.GetVehicleAsync(request);

GetVehicleAsync(GetVehicleRequest, CancellationToken)

Returns a vehicle from the Fleet Engine.

Declaration
public virtual Task<Vehicle> GetVehicleAsync(GetVehicleRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
GetVehicleRequest request

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

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Vehicle>

A Task containing the RPC response.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = await VehicleServiceClient.CreateAsync();
// Initialize request argument(s)
GetVehicleRequest request = new GetVehicleRequest
{
    Header = new RequestHeader(),
    VehicleName = VehicleName.FromProviderVehicle("[PROVIDER]", "[VEHICLE]"),
    CurrentRouteSegmentVersion = new Timestamp(),
    WaypointsVersion = new Timestamp(),
};
// Make the request
Vehicle response = await vehicleServiceClient.GetVehicleAsync(request);

ListVehicles(ListVehiclesRequest, CallSettings)

Returns a paginated list of vehicles associated with a provider that match the request options.

Declaration
public virtual PagedEnumerable<ListVehiclesResponse, Vehicle> ListVehicles(ListVehiclesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListVehiclesRequest request

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
PagedEnumerable<ListVehiclesResponse, Vehicle>

A pageable sequence of Vehicle resources.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = VehicleServiceClient.Create();
// Initialize request argument(s)
ListVehiclesRequest request = new ListVehiclesRequest
{
    Parent = "",
    MinimumCapacity = 0,
    TripTypes =
    {
        TripType.UnknownTripType,
    },
    MaximumStaleness = new Duration(),
    VehicleTypeCategories =
    {
        Vehicle.Types.VehicleType.Types.Category.Unknown,
    },
    RequiredAttributes = { "", },
    VehicleState = VehicleState.UnknownVehicleState,
    Header = new RequestHeader(),
    RequiredOneOfAttributes = { "", },
    OnTripOnly = false,
    RequiredOneOfAttributeSets = { "", },
    Filter = "",
    Viewport = new Viewport(),
};
// Make the request
PagedEnumerable<ListVehiclesResponse, Vehicle> response = vehicleServiceClient.ListVehicles(request);

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

ListVehiclesAsync(ListVehiclesRequest, CallSettings)

Returns a paginated list of vehicles associated with a provider that match the request options.

Declaration
public virtual PagedAsyncEnumerable<ListVehiclesResponse, Vehicle> ListVehiclesAsync(ListVehiclesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
ListVehiclesRequest request

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
PagedAsyncEnumerable<ListVehiclesResponse, Vehicle>

A pageable asynchronous sequence of Vehicle resources.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = await VehicleServiceClient.CreateAsync();
// Initialize request argument(s)
ListVehiclesRequest request = new ListVehiclesRequest
{
    Parent = "",
    MinimumCapacity = 0,
    TripTypes =
    {
        TripType.UnknownTripType,
    },
    MaximumStaleness = new Duration(),
    VehicleTypeCategories =
    {
        Vehicle.Types.VehicleType.Types.Category.Unknown,
    },
    RequiredAttributes = { "", },
    VehicleState = VehicleState.UnknownVehicleState,
    Header = new RequestHeader(),
    RequiredOneOfAttributes = { "", },
    OnTripOnly = false,
    RequiredOneOfAttributeSets = { "", },
    Filter = "",
    Viewport = new Viewport(),
};
// Make the request
PagedAsyncEnumerable<ListVehiclesResponse, Vehicle> response = vehicleServiceClient.ListVehiclesAsync(request);

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

SearchVehicles(SearchVehiclesRequest, CallSettings)

Returns a list of vehicles that match the request options.

Declaration
public virtual SearchVehiclesResponse SearchVehicles(SearchVehiclesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
SearchVehiclesRequest request

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
SearchVehiclesResponse

The RPC response.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = VehicleServiceClient.Create();
// Initialize request argument(s)
SearchVehiclesRequest request = new SearchVehiclesRequest
{
    Header = new RequestHeader(),
    Parent = "",
    PickupPoint = new TerminalLocation(),
    DropoffPoint = new TerminalLocation(),
    PickupRadiusMeters = 0,
    Count = 0,
    MinimumCapacity = 0,
    TripTypes =
    {
        TripType.UnknownTripType,
    },
    MaximumStaleness = new Duration(),
    RequiredAttributes =
    {
        new VehicleAttribute(),
    },
    OrderBy = SearchVehiclesRequest.Types.VehicleMatchOrder.UnknownVehicleMatchOrder,
    VehicleTypes =
    {
        new Vehicle.Types.VehicleType(),
    },
    RequiredOneOfAttributes =
    {
        new VehicleAttributeList(),
    },
    IncludeBackToBack = false,
    TripId = "",
    RequiredOneOfAttributeSets =
    {
        new VehicleAttributeList(),
    },
    CurrentTripsPresent = SearchVehiclesRequest.Types.CurrentTripsPresent.Unspecified,
    Filter = "",
};
// Make the request
SearchVehiclesResponse response = vehicleServiceClient.SearchVehicles(request);

SearchVehiclesAsync(SearchVehiclesRequest, CallSettings)

Returns a list of vehicles that match the request options.

Declaration
public virtual Task<SearchVehiclesResponse> SearchVehiclesAsync(SearchVehiclesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
SearchVehiclesRequest request

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
Task<SearchVehiclesResponse>

A Task containing the RPC response.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = await VehicleServiceClient.CreateAsync();
// Initialize request argument(s)
SearchVehiclesRequest request = new SearchVehiclesRequest
{
    Header = new RequestHeader(),
    Parent = "",
    PickupPoint = new TerminalLocation(),
    DropoffPoint = new TerminalLocation(),
    PickupRadiusMeters = 0,
    Count = 0,
    MinimumCapacity = 0,
    TripTypes =
    {
        TripType.UnknownTripType,
    },
    MaximumStaleness = new Duration(),
    RequiredAttributes =
    {
        new VehicleAttribute(),
    },
    OrderBy = SearchVehiclesRequest.Types.VehicleMatchOrder.UnknownVehicleMatchOrder,
    VehicleTypes =
    {
        new Vehicle.Types.VehicleType(),
    },
    RequiredOneOfAttributes =
    {
        new VehicleAttributeList(),
    },
    IncludeBackToBack = false,
    TripId = "",
    RequiredOneOfAttributeSets =
    {
        new VehicleAttributeList(),
    },
    CurrentTripsPresent = SearchVehiclesRequest.Types.CurrentTripsPresent.Unspecified,
    Filter = "",
};
// Make the request
SearchVehiclesResponse response = await vehicleServiceClient.SearchVehiclesAsync(request);

SearchVehiclesAsync(SearchVehiclesRequest, CancellationToken)

Returns a list of vehicles that match the request options.

Declaration
public virtual Task<SearchVehiclesResponse> SearchVehiclesAsync(SearchVehiclesRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
SearchVehiclesRequest request

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

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<SearchVehiclesResponse>

A Task containing the RPC response.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = await VehicleServiceClient.CreateAsync();
// Initialize request argument(s)
SearchVehiclesRequest request = new SearchVehiclesRequest
{
    Header = new RequestHeader(),
    Parent = "",
    PickupPoint = new TerminalLocation(),
    DropoffPoint = new TerminalLocation(),
    PickupRadiusMeters = 0,
    Count = 0,
    MinimumCapacity = 0,
    TripTypes =
    {
        TripType.UnknownTripType,
    },
    MaximumStaleness = new Duration(),
    RequiredAttributes =
    {
        new VehicleAttribute(),
    },
    OrderBy = SearchVehiclesRequest.Types.VehicleMatchOrder.UnknownVehicleMatchOrder,
    VehicleTypes =
    {
        new Vehicle.Types.VehicleType(),
    },
    RequiredOneOfAttributes =
    {
        new VehicleAttributeList(),
    },
    IncludeBackToBack = false,
    TripId = "",
    RequiredOneOfAttributeSets =
    {
        new VehicleAttributeList(),
    },
    CurrentTripsPresent = SearchVehiclesRequest.Types.CurrentTripsPresent.Unspecified,
    Filter = "",
};
// Make the request
SearchVehiclesResponse response = await vehicleServiceClient.SearchVehiclesAsync(request);

ShutdownDefaultChannelsAsync()

Shuts down any channels automatically created by Create() and CreateAsync(CancellationToken). Channels which weren't automatically created are not affected.

Declaration
public static Task ShutdownDefaultChannelsAsync()
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.

UpdateVehicle(UpdateVehicleRequest, CallSettings)

Writes updated vehicle data to the Fleet Engine.

When updating a Vehicle, the following fields cannot be updated since they are managed by the server:

  • currentTrips
  • availableCapacity
  • current_route_segment_version
  • waypoints_version

The vehicle name also cannot be updated.

If the attributes field is updated, all the vehicle's attributes are replaced with the attributes provided in the request. If you want to update only some attributes, see the UpdateVehicleAttributes method. Likewise, the waypoints field can be updated, but must contain all the waypoints currently on the vehicle, and no other waypoints.

Declaration
public virtual Vehicle UpdateVehicle(UpdateVehicleRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateVehicleRequest request

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
Vehicle

The RPC response.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = VehicleServiceClient.Create();
// Initialize request argument(s)
UpdateVehicleRequest request = new UpdateVehicleRequest
{
    Header = new RequestHeader(),
    Name = "",
    Vehicle = new Vehicle(),
    UpdateMask = new FieldMask(),
};
// Make the request
Vehicle response = vehicleServiceClient.UpdateVehicle(request);

UpdateVehicleAsync(UpdateVehicleRequest, CallSettings)

Writes updated vehicle data to the Fleet Engine.

When updating a Vehicle, the following fields cannot be updated since they are managed by the server:

  • currentTrips
  • availableCapacity
  • current_route_segment_version
  • waypoints_version

The vehicle name also cannot be updated.

If the attributes field is updated, all the vehicle's attributes are replaced with the attributes provided in the request. If you want to update only some attributes, see the UpdateVehicleAttributes method. Likewise, the waypoints field can be updated, but must contain all the waypoints currently on the vehicle, and no other waypoints.

Declaration
public virtual Task<Vehicle> UpdateVehicleAsync(UpdateVehicleRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateVehicleRequest request

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
Task<Vehicle>

A Task containing the RPC response.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = await VehicleServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateVehicleRequest request = new UpdateVehicleRequest
{
    Header = new RequestHeader(),
    Name = "",
    Vehicle = new Vehicle(),
    UpdateMask = new FieldMask(),
};
// Make the request
Vehicle response = await vehicleServiceClient.UpdateVehicleAsync(request);

UpdateVehicleAsync(UpdateVehicleRequest, CancellationToken)

Writes updated vehicle data to the Fleet Engine.

When updating a Vehicle, the following fields cannot be updated since they are managed by the server:

  • currentTrips
  • availableCapacity
  • current_route_segment_version
  • waypoints_version

The vehicle name also cannot be updated.

If the attributes field is updated, all the vehicle's attributes are replaced with the attributes provided in the request. If you want to update only some attributes, see the UpdateVehicleAttributes method. Likewise, the waypoints field can be updated, but must contain all the waypoints currently on the vehicle, and no other waypoints.

Declaration
public virtual Task<Vehicle> UpdateVehicleAsync(UpdateVehicleRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
UpdateVehicleRequest request

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

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<Vehicle>

A Task containing the RPC response.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = await VehicleServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateVehicleRequest request = new UpdateVehicleRequest
{
    Header = new RequestHeader(),
    Name = "",
    Vehicle = new Vehicle(),
    UpdateMask = new FieldMask(),
};
// Make the request
Vehicle response = await vehicleServiceClient.UpdateVehicleAsync(request);

UpdateVehicleAttributes(UpdateVehicleAttributesRequest, CallSettings)

Partially updates a vehicle's attributes. Only the attributes mentioned in the request will be updated, other attributes will NOT be altered. Note: this is different in UpdateVehicle, where the whole attributes field will be replaced by the one in UpdateVehicleRequest, attributes not in the request would be removed.

Declaration
public virtual UpdateVehicleAttributesResponse UpdateVehicleAttributes(UpdateVehicleAttributesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateVehicleAttributesRequest request

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
UpdateVehicleAttributesResponse

The RPC response.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = VehicleServiceClient.Create();
// Initialize request argument(s)
UpdateVehicleAttributesRequest request = new UpdateVehicleAttributesRequest
{
    Header = new RequestHeader(),
    Name = "",
    Attributes =
    {
        new VehicleAttribute(),
    },
};
// Make the request
UpdateVehicleAttributesResponse response = vehicleServiceClient.UpdateVehicleAttributes(request);

UpdateVehicleAttributesAsync(UpdateVehicleAttributesRequest, CallSettings)

Partially updates a vehicle's attributes. Only the attributes mentioned in the request will be updated, other attributes will NOT be altered. Note: this is different in UpdateVehicle, where the whole attributes field will be replaced by the one in UpdateVehicleRequest, attributes not in the request would be removed.

Declaration
public virtual Task<UpdateVehicleAttributesResponse> UpdateVehicleAttributesAsync(UpdateVehicleAttributesRequest request, CallSettings callSettings = null)
Parameters
Type Name Description
UpdateVehicleAttributesRequest request

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
Task<UpdateVehicleAttributesResponse>

A Task containing the RPC response.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = await VehicleServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateVehicleAttributesRequest request = new UpdateVehicleAttributesRequest
{
    Header = new RequestHeader(),
    Name = "",
    Attributes =
    {
        new VehicleAttribute(),
    },
};
// Make the request
UpdateVehicleAttributesResponse response = await vehicleServiceClient.UpdateVehicleAttributesAsync(request);

UpdateVehicleAttributesAsync(UpdateVehicleAttributesRequest, CancellationToken)

Partially updates a vehicle's attributes. Only the attributes mentioned in the request will be updated, other attributes will NOT be altered. Note: this is different in UpdateVehicle, where the whole attributes field will be replaced by the one in UpdateVehicleRequest, attributes not in the request would be removed.

Declaration
public virtual Task<UpdateVehicleAttributesResponse> UpdateVehicleAttributesAsync(UpdateVehicleAttributesRequest request, CancellationToken cancellationToken)
Parameters
Type Name Description
UpdateVehicleAttributesRequest request

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

CancellationToken cancellationToken

A CancellationToken to use for this RPC.

Returns
Type Description
Task<UpdateVehicleAttributesResponse>

A Task containing the RPC response.

Sample code
// Create client
VehicleServiceClient vehicleServiceClient = await VehicleServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateVehicleAttributesRequest request = new UpdateVehicleAttributesRequest
{
    Header = new RequestHeader(),
    Name = "",
    Attributes =
    {
        new VehicleAttribute(),
    },
};
// Make the request
UpdateVehicleAttributesResponse response = await vehicleServiceClient.UpdateVehicleAttributesAsync(request);
In this article
Back to top Generated by DocFX