pub struct SearchVehiclesRequest {
Show 18 fields pub header: Option<RequestHeader>, pub parent: String, pub pickup_point: Option<TerminalLocation>, pub dropoff_point: Option<TerminalLocation>, pub pickup_radius_meters: i32, pub count: i32, pub minimum_capacity: i32, pub trip_types: Vec<i32>, pub maximum_staleness: Option<Duration>, pub vehicle_types: Vec<VehicleType>, pub required_attributes: Vec<VehicleAttribute>, pub required_one_of_attributes: Vec<VehicleAttributeList>, pub required_one_of_attribute_sets: Vec<VehicleAttributeList>, pub order_by: i32, pub include_back_to_back: bool, pub trip_id: String, pub current_trips_present: i32, pub filter: String,
}
Expand description

SearchVehicles request message.

Fields§

§header: Option<RequestHeader>

The standard Fleet Engine request header.

§parent: String

Required. Must be in the format providers/{provider}. 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.

§pickup_point: Option<TerminalLocation>

Required. The pickup point to search near.

§dropoff_point: Option<TerminalLocation>

The customer’s intended dropoff location. The field is required if trip_types contains TripType.SHARED.

§pickup_radius_meters: i32

Required. Defines the vehicle search radius around the pickup point. Only vehicles within the search radius will be returned. Value must be between 400 and 10000 meters (inclusive).

§count: i32

Required. Specifies the maximum number of vehicles to return. The value must be between 1 and 50 (inclusive).

§minimum_capacity: i32

Required. Specifies the number of passengers being considered for a trip. The value must be greater than or equal to one. The driver is not considered in the capacity value.

§trip_types: Vec<i32>

Required. Represents the type of proposed trip. Must include exactly one type. UNKNOWN_TRIP_TYPE is not allowed. Restricts the search to only those vehicles that can support that trip type.

§maximum_staleness: Option<Duration>

Restricts the search to only those vehicles that have sent location updates to Fleet Engine within the specified duration. Stationary vehicles still transmitting their locations are not considered stale. If this field is not set, the server uses five minutes as the default value.

§vehicle_types: Vec<VehicleType>

Required. Restricts the search to vehicles with one of the specified types. At least one vehicle type must be specified. VehicleTypes with a category of UNKNOWN are not allowed.

§required_attributes: Vec<VehicleAttribute>

Callers can form complex logical operations using any combination of the required_attributes, required_one_of_attributes, and required_one_of_attribute_sets fields.

required_attributes is a list; required_one_of_attributes uses a message which allows a list of lists. In combination, the two fields allow the composition of this expression:

(required_attributes\[0\] AND required_attributes\[1\] AND ...)
AND
(required_one_of_attributes[0][0] OR required_one_of_attributes[0][1] OR
...)
AND
(required_one_of_attributes[1][0] OR required_one_of_attributes[1][1] OR
...)

Restricts the search to only those vehicles with the specified attributes. This field is a conjunction/AND operation. A max of 50 required_attributes is allowed. This matches the maximum number of attributes allowed on a vehicle.

§required_one_of_attributes: Vec<VehicleAttributeList>

Restricts the search to only those vehicles with at least one of the specified attributes in each VehicleAttributeList. Within each list, a vehicle must match at least one of the attributes. This field is an inclusive disjunction/OR operation in each VehicleAttributeList and a conjunction/AND operation across the collection of VehicleAttributeList.

§required_one_of_attribute_sets: Vec<VehicleAttributeList>

required_one_of_attribute_sets provides additional functionality.

Similar to required_one_of_attributes, required_one_of_attribute_sets uses a message which allows a list of lists, allowing expressions such as this one:

(required_attributes\[0\] AND required_attributes\[1\] AND ...)
AND
(
   (required_one_of_attribute_sets[0][0] AND
   required_one_of_attribute_sets[0][1] AND
   ...)
   OR
   (required_one_of_attribute_sets[1][0] AND
   required_one_of_attribute_sets[1][1] AND
   ...)
)

Restricts the search to only those vehicles with all the attributes in a VehicleAttributeList. Within each list, a vehicle must match all of the attributes. This field is a conjunction/AND operation in each VehicleAttributeList and inclusive disjunction/OR operation across the collection of VehicleAttributeList.

§order_by: i32

Required. Specifies the desired ordering criterion for results.

§include_back_to_back: bool

This indicates if vehicles with a single active trip are eligible for this search. This field is only used when current_trips_present is unspecified. When current_trips_present is unspecified and this field is false, vehicles with assigned trips are excluded from the search results. When current_trips_present is unspecified and this field is true, search results can include vehicles with one active trip that has a status of ENROUTE_TO_DROPOFF. When current_trips_present is specified, this field cannot be set to true.

The default value is false.

§trip_id: String

Indicates the trip associated with this SearchVehicleRequest.

§current_trips_present: i32

This indicates if vehicles with active trips are eligible for this search. This must be set to something other than CURRENT_TRIPS_PRESENT_UNSPECIFIED if trip_type includes SHARED.

§filter: String

Optional. A filter query to apply when searching vehicles. See http://aip.dev/160 for examples of the filter syntax.

This field is designed to replace the required_attributes, required_one_of_attributes, and required_one_of_attributes_sets fields. If a non-empty value is specified here, the following fields must be empty: required_attributes, required_one_of_attributes, and required_one_of_attributes_sets.

This filter functions as an AND clause with other constraints, such as minimum_capacity or vehicle_types.

Note that the only queries supported are on vehicle attributes (for example, attributes.<key> = <value> or attributes.<key1> = <value1> AND attributes.<key2> = <value2>). The maximum number of restrictions allowed in a filter query is 50.

Also, all attributes are stored as strings, so the only supported comparisons against attributes are string comparisons. In order to compare against number or boolean values, the values must be explicitly quoted to be treated as strings (for example, attributes.<key> = "10" or attributes.<key> = "true").

Implementations§

source§

impl SearchVehiclesRequest

source

pub fn trip_types( &self ) -> FilterMap<Cloned<Iter<'_, i32>>, fn(_: i32) -> Option<TripType>>

Returns an iterator which yields the valid enum values contained in trip_types.

source

pub fn push_trip_types(&mut self, value: TripType)

Appends the provided enum value to trip_types.

source

pub fn order_by(&self) -> VehicleMatchOrder

Returns the enum value of order_by, or the default if the field is set to an invalid enum value.

source

pub fn set_order_by(&mut self, value: VehicleMatchOrder)

Sets order_by to the provided enum value.

source

pub fn current_trips_present(&self) -> CurrentTripsPresent

Returns the enum value of current_trips_present, or the default if the field is set to an invalid enum value.

source

pub fn set_current_trips_present(&mut self, value: CurrentTripsPresent)

Sets current_trips_present to the provided enum value.

Trait Implementations§

source§

impl Clone for SearchVehiclesRequest

source§

fn clone(&self) -> SearchVehiclesRequest

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for SearchVehiclesRequest

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for SearchVehiclesRequest

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl Message for SearchVehiclesRequest

source§

fn encoded_len(&self) -> usize

Returns the encoded length of the message without a length delimiter.
source§

fn clear(&mut self)

Clears the message, resetting all fields to their default.
source§

fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message to a buffer. Read more
source§

fn encode_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message to a newly allocated buffer.
source§

fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
where B: BufMut, Self: Sized,

Encodes the message with a length-delimiter to a buffer. Read more
source§

fn encode_length_delimited_to_vec(&self) -> Vec<u8>
where Self: Sized,

Encodes the message with a length-delimiter to a newly allocated buffer.
source§

fn decode<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes an instance of the message from a buffer. Read more
source§

fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
where B: Buf, Self: Default,

Decodes a length-delimited instance of the message from the buffer.
source§

fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes an instance of the message from a buffer, and merges it into self. Read more
source§

fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
where B: Buf, Self: Sized,

Decodes a length-delimited instance of the message from buffer, and merges it into self.
source§

impl PartialEq for SearchVehiclesRequest

source§

fn eq(&self, other: &SearchVehiclesRequest) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl StructuralPartialEq for SearchVehiclesRequest

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromRef<T> for T
where T: Clone,

§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoRequest<T> for T

source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more