Class TripServiceClient
TripService client wrapper, for convenient use.
Namespace: Google.Maps.FleetEngine.V1
Assembly: Google.Maps.FleetEngine.V1.dll
Syntax
public abstract class TripServiceClient
Remarks
Trip management service.
Properties
DefaultEndpoint
The default endpoint for the TripService 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 TripService scopes.
Declaration
public static IReadOnlyList<string> DefaultScopes { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<string> |
Remarks
The default TripService scopes are:
- https://www.googleapis.com/auth/cloud-platform
GrpcClient
The underlying gRPC TripService client
Declaration
public virtual TripService.TripServiceClient GrpcClient { get; }
Property Value
Type | Description |
---|---|
TripService.TripServiceClient |
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 TripServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use TripServiceClientBuilder.
Declaration
public static TripServiceClient Create()
Returns
Type | Description |
---|---|
TripServiceClient | The created TripServiceClient. |
CreateAsync(CancellationToken)
Asynchronously creates a TripServiceClient using the default credentials, endpoint and settings. To specify custom credentials or other settings, use TripServiceClientBuilder.
Declaration
public static Task<TripServiceClient> CreateAsync(CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
CancellationToken | cancellationToken | The CancellationToken to use while creating the client. |
Returns
Type | Description |
---|---|
Task<TripServiceClient> | The task representing the created TripServiceClient. |
CreateTrip(CreateTripRequest, CallSettings)
Creates a trip in the Fleet Engine and returns the new trip.
Declaration
public virtual Trip CreateTrip(CreateTripRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
CreateTripRequest | 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 |
---|---|
Trip | The RPC response. |
Sample code
// Create client
TripServiceClient tripServiceClient = TripServiceClient.Create();
// Initialize request argument(s)
CreateTripRequest request = new CreateTripRequest
{
Header = new RequestHeader(),
ParentAsTripName = TripName.FromProviderTrip("[PROVIDER]", "[TRIP]"),
Trip = new Trip(),
TripId = "",
};
// Make the request
Trip response = tripServiceClient.CreateTrip(request);
CreateTripAsync(CreateTripRequest, CallSettings)
Creates a trip in the Fleet Engine and returns the new trip.
Declaration
public virtual Task<Trip> CreateTripAsync(CreateTripRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
CreateTripRequest | 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<Trip> | A Task containing the RPC response. |
Sample code
// Create client
TripServiceClient tripServiceClient = await TripServiceClient.CreateAsync();
// Initialize request argument(s)
CreateTripRequest request = new CreateTripRequest
{
Header = new RequestHeader(),
ParentAsTripName = TripName.FromProviderTrip("[PROVIDER]", "[TRIP]"),
Trip = new Trip(),
TripId = "",
};
// Make the request
Trip response = await tripServiceClient.CreateTripAsync(request);
CreateTripAsync(CreateTripRequest, CancellationToken)
Creates a trip in the Fleet Engine and returns the new trip.
Declaration
public virtual Task<Trip> CreateTripAsync(CreateTripRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CreateTripRequest | 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<Trip> | A Task containing the RPC response. |
Sample code
// Create client
TripServiceClient tripServiceClient = await TripServiceClient.CreateAsync();
// Initialize request argument(s)
CreateTripRequest request = new CreateTripRequest
{
Header = new RequestHeader(),
ParentAsTripName = TripName.FromProviderTrip("[PROVIDER]", "[TRIP]"),
Trip = new Trip(),
TripId = "",
};
// Make the request
Trip response = await tripServiceClient.CreateTripAsync(request);
GetTrip(GetTripRequest, CallSettings)
Get information about a single trip.
Declaration
public virtual Trip GetTrip(GetTripRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
GetTripRequest | 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 |
---|---|
Trip | The RPC response. |
Sample code
// Create client
TripServiceClient tripServiceClient = TripServiceClient.Create();
// Initialize request argument(s)
GetTripRequest request = new GetTripRequest
{
Header = new RequestHeader(),
TripName = TripName.FromProviderTrip("[PROVIDER]", "[TRIP]"),
CurrentRouteSegmentVersion = new Timestamp(),
RemainingWaypointsVersion = new Timestamp(),
RouteFormatType = PolylineFormatType.UnknownFormatType,
CurrentRouteSegmentTrafficVersion = new Timestamp(),
RemainingWaypointsRouteVersion = new Timestamp(),
View = TripView.Unspecified,
};
// Make the request
Trip response = tripServiceClient.GetTrip(request);
GetTripAsync(GetTripRequest, CallSettings)
Get information about a single trip.
Declaration
public virtual Task<Trip> GetTripAsync(GetTripRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
GetTripRequest | 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<Trip> | A Task containing the RPC response. |
Sample code
// Create client
TripServiceClient tripServiceClient = await TripServiceClient.CreateAsync();
// Initialize request argument(s)
GetTripRequest request = new GetTripRequest
{
Header = new RequestHeader(),
TripName = TripName.FromProviderTrip("[PROVIDER]", "[TRIP]"),
CurrentRouteSegmentVersion = new Timestamp(),
RemainingWaypointsVersion = new Timestamp(),
RouteFormatType = PolylineFormatType.UnknownFormatType,
CurrentRouteSegmentTrafficVersion = new Timestamp(),
RemainingWaypointsRouteVersion = new Timestamp(),
View = TripView.Unspecified,
};
// Make the request
Trip response = await tripServiceClient.GetTripAsync(request);
GetTripAsync(GetTripRequest, CancellationToken)
Get information about a single trip.
Declaration
public virtual Task<Trip> GetTripAsync(GetTripRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
GetTripRequest | 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<Trip> | A Task containing the RPC response. |
Sample code
// Create client
TripServiceClient tripServiceClient = await TripServiceClient.CreateAsync();
// Initialize request argument(s)
GetTripRequest request = new GetTripRequest
{
Header = new RequestHeader(),
TripName = TripName.FromProviderTrip("[PROVIDER]", "[TRIP]"),
CurrentRouteSegmentVersion = new Timestamp(),
RemainingWaypointsVersion = new Timestamp(),
RouteFormatType = PolylineFormatType.UnknownFormatType,
CurrentRouteSegmentTrafficVersion = new Timestamp(),
RemainingWaypointsRouteVersion = new Timestamp(),
View = TripView.Unspecified,
};
// Make the request
Trip response = await tripServiceClient.GetTripAsync(request);
ReportBillableTrip(ReportBillableTripRequest, CallSettings)
Report billable trip usage.
Declaration
public virtual void ReportBillableTrip(ReportBillableTripRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
ReportBillableTripRequest | 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
TripServiceClient tripServiceClient = TripServiceClient.Create();
// Initialize request argument(s)
ReportBillableTripRequest request = new ReportBillableTripRequest
{
Name = "",
CountryCode = "",
Platform = BillingPlatformIdentifier.Unspecified,
RelatedIds = { "", },
SolutionType = ReportBillableTripRequest.Types.SolutionType.Unspecified,
};
// Make the request
tripServiceClient.ReportBillableTrip(request);
ReportBillableTripAsync(ReportBillableTripRequest, CallSettings)
Report billable trip usage.
Declaration
public virtual Task ReportBillableTripAsync(ReportBillableTripRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
ReportBillableTripRequest | 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
TripServiceClient tripServiceClient = await TripServiceClient.CreateAsync();
// Initialize request argument(s)
ReportBillableTripRequest request = new ReportBillableTripRequest
{
Name = "",
CountryCode = "",
Platform = BillingPlatformIdentifier.Unspecified,
RelatedIds = { "", },
SolutionType = ReportBillableTripRequest.Types.SolutionType.Unspecified,
};
// Make the request
await tripServiceClient.ReportBillableTripAsync(request);
ReportBillableTripAsync(ReportBillableTripRequest, CancellationToken)
Report billable trip usage.
Declaration
public virtual Task ReportBillableTripAsync(ReportBillableTripRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
ReportBillableTripRequest | 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
TripServiceClient tripServiceClient = await TripServiceClient.CreateAsync();
// Initialize request argument(s)
ReportBillableTripRequest request = new ReportBillableTripRequest
{
Name = "",
CountryCode = "",
Platform = BillingPlatformIdentifier.Unspecified,
RelatedIds = { "", },
SolutionType = ReportBillableTripRequest.Types.SolutionType.Unspecified,
};
// Make the request
await tripServiceClient.ReportBillableTripAsync(request);
SearchTrips(SearchTripsRequest, CallSettings)
Get all the trips for a specific vehicle.
Declaration
public virtual PagedEnumerable<SearchTripsResponse, Trip> SearchTrips(SearchTripsRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
SearchTripsRequest | 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<SearchTripsResponse, Trip> | A pageable sequence of Trip resources. |
Sample code
// Create client
TripServiceClient tripServiceClient = TripServiceClient.Create();
// Initialize request argument(s)
SearchTripsRequest request = new SearchTripsRequest
{
Header = new RequestHeader(),
Parent = "",
VehicleId = "",
ActiveTripsOnly = false,
MinimumStaleness = new Duration(),
};
// Make the request
PagedEnumerable<SearchTripsResponse, Trip> response = tripServiceClient.SearchTrips(request);
// Iterate over all response items, lazily performing RPCs as required
foreach (Trip 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 (SearchTripsResponse page in response.AsRawResponses())
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Trip 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<Trip> 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 (Trip 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;
SearchTripsAsync(SearchTripsRequest, CallSettings)
Get all the trips for a specific vehicle.
Declaration
public virtual PagedAsyncEnumerable<SearchTripsResponse, Trip> SearchTripsAsync(SearchTripsRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
SearchTripsRequest | 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<SearchTripsResponse, Trip> | A pageable asynchronous sequence of Trip resources. |
Sample code
// Create client
TripServiceClient tripServiceClient = await TripServiceClient.CreateAsync();
// Initialize request argument(s)
SearchTripsRequest request = new SearchTripsRequest
{
Header = new RequestHeader(),
Parent = "",
VehicleId = "",
ActiveTripsOnly = false,
MinimumStaleness = new Duration(),
};
// Make the request
PagedAsyncEnumerable<SearchTripsResponse, Trip> response = tripServiceClient.SearchTripsAsync(request);
// Iterate over all response items, lazily performing RPCs as required
await response.ForEachAsync((Trip 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((SearchTripsResponse page) =>
{
// Do something with each page of items
Console.WriteLine("A page of results:");
foreach (Trip 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<Trip> 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 (Trip 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()
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.
UpdateTrip(UpdateTripRequest, CallSettings)
Updates trip data.
Declaration
public virtual Trip UpdateTrip(UpdateTripRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
UpdateTripRequest | 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 |
---|---|
Trip | The RPC response. |
Sample code
// Create client
TripServiceClient tripServiceClient = TripServiceClient.Create();
// Initialize request argument(s)
UpdateTripRequest request = new UpdateTripRequest
{
Header = new RequestHeader(),
Name = "",
Trip = new Trip(),
UpdateMask = new FieldMask(),
};
// Make the request
Trip response = tripServiceClient.UpdateTrip(request);
UpdateTripAsync(UpdateTripRequest, CallSettings)
Updates trip data.
Declaration
public virtual Task<Trip> UpdateTripAsync(UpdateTripRequest request, CallSettings callSettings = null)
Parameters
Type | Name | Description |
---|---|---|
UpdateTripRequest | 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<Trip> | A Task containing the RPC response. |
Sample code
// Create client
TripServiceClient tripServiceClient = await TripServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateTripRequest request = new UpdateTripRequest
{
Header = new RequestHeader(),
Name = "",
Trip = new Trip(),
UpdateMask = new FieldMask(),
};
// Make the request
Trip response = await tripServiceClient.UpdateTripAsync(request);
UpdateTripAsync(UpdateTripRequest, CancellationToken)
Updates trip data.
Declaration
public virtual Task<Trip> UpdateTripAsync(UpdateTripRequest request, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
UpdateTripRequest | 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<Trip> | A Task containing the RPC response. |
Sample code
// Create client
TripServiceClient tripServiceClient = await TripServiceClient.CreateAsync();
// Initialize request argument(s)
UpdateTripRequest request = new UpdateTripRequest
{
Header = new RequestHeader(),
Name = "",
Trip = new Trip(),
UpdateMask = new FieldMask(),
};
// Make the request
Trip response = await tripServiceClient.UpdateTripAsync(request);