pub struct ListVehiclesRequest {
Show 15 fields pub header: Option<RequestHeader>, pub parent: String, pub page_size: i32, pub page_token: String, pub minimum_capacity: Option<i32>, pub trip_types: Vec<i32>, pub maximum_staleness: Option<Duration>, pub vehicle_type_categories: Vec<i32>, pub required_attributes: Vec<String>, pub required_one_of_attributes: Vec<String>, pub required_one_of_attribute_sets: Vec<String>, pub vehicle_state: i32, pub on_trip_only: bool, pub filter: String, pub viewport: Option<Viewport>,
}
Expand description

ListVehicles 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.

§page_size: i32

The maximum number of vehicles to return. Default value: 100.

§page_token: String

The value of the next_page_token provided by a previous call to ListVehicles so that you can paginate through groups of vehicles. The value is undefined if the filter criteria of the request is not the same as the filter criteria for the previous call to ListVehicles.

§minimum_capacity: Option<i32>

Specifies the required minimum capacity of the vehicle. All vehicles returned will have a maximum_capacity greater than or equal to this value. If set, must be greater or equal to 0.

§trip_types: Vec<i32>

Restricts the response to vehicles that support at least one of the specified trip types.

§maximum_staleness: Option<Duration>

Restricts the response to vehicles that have sent location updates to Fleet Engine within the specified duration. Stationary vehicles still transmitting their locations are not considered stale. If present, must be a valid positive duration.

§vehicle_type_categories: Vec<i32>

Required. Restricts the response to vehicles with one of the specified type categories. UNKNOWN is not allowed.

§required_attributes: Vec<String>

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 response to 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. Each repeated string should be of the format “key:value”.

§required_one_of_attributes: Vec<String>

Restricts the response to 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. Each repeated string should be of the format “key1:value1|key2:value2|key3:value3”.

§required_one_of_attribute_sets: Vec<String>

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 response to vehicles that match 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. Each repeated string should be of the format “key1:value1|key2:value2|key3:value3”.

§vehicle_state: i32

Restricts the response to vehicles that have this vehicle state.

§on_trip_only: bool

Only return the vehicles with current trip(s).

§filter: String

Optional. A filter query to apply when listing 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 vehicle_state or on_trip_only.

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").

§viewport: Option<Viewport>

Optional. A filter that limits the vehicles returned to those whose last known location was in the rectangular area defined by the viewport.

Implementations§

source§

impl ListVehiclesRequest

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 vehicle_type_categories( &self, ) -> FilterMap<Cloned<Iter<'_, i32>>, fn(_: i32) -> Option<Category>>

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

source

pub fn push_vehicle_type_categories(&mut self, value: Category)

Appends the provided enum value to vehicle_type_categories.

source

pub fn vehicle_state(&self) -> VehicleState

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

source

pub fn set_vehicle_state(&mut self, value: VehicleState)

Sets vehicle_state to the provided enum value.

Trait Implementations§

source§

impl Clone for ListVehiclesRequest

source§

fn clone(&self) -> ListVehiclesRequest

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 ListVehiclesRequest

source§

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

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

impl Default for ListVehiclesRequest

source§

fn default() -> Self

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

impl Message for ListVehiclesRequest

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(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>
where 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( &self, buf: &mut impl BufMut, ) -> Result<(), EncodeError>
where 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(buf: impl Buf) -> Result<Self, DecodeError>
where Self: Default,

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

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

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

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

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

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

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

impl PartialEq for ListVehiclesRequest

source§

fn eq(&self, other: &ListVehiclesRequest) -> 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 ListVehiclesRequest

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