#[derive(Eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FlightPlan {
#[prost(string, tag="1")]
pub id: ::prost::alloc::string::String,
#[prost(message, optional, tag="2")]
pub data: ::core::option::Option<FlightPlanData>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct UpdateFlightPlan {
#[prost(string, tag="1")]
pub id: ::prost::alloc::string::String,
#[prost(message, optional, tag="2")]
pub data: ::core::option::Option<FlightPlanData>,
#[prost(message, optional, tag="3")]
pub mask: ::core::option::Option<::prost_types::FieldMask>,
}
#[derive(Eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FlightPlanData {
#[prost(string, tag="1")]
pub pilot_id: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub vehicle_id: ::prost::alloc::string::String,
#[prost(int64, repeated, tag="3")]
pub cargo_weight_g: ::prost::alloc::vec::Vec<i64>,
#[prost(int64, tag="4")]
pub flight_distance: i64,
#[prost(string, tag="5")]
pub weather_conditions: ::prost::alloc::string::String,
#[prost(string, optional, tag="6")]
pub departure_vertiport_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, tag="7")]
pub departure_vertipad_id: ::prost::alloc::string::String,
#[prost(string, optional, tag="8")]
pub destination_vertiport_id: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, tag="9")]
pub destination_vertipad_id: ::prost::alloc::string::String,
#[prost(message, optional, tag="10")]
pub scheduled_departure: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag="11")]
pub scheduled_arrival: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag="12")]
pub actual_departure: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag="13")]
pub actual_arrival: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag="14")]
pub flight_release_approval: ::core::option::Option<::prost_types::Timestamp>,
#[prost(message, optional, tag="15")]
pub flight_plan_submitted: ::core::option::Option<::prost_types::Timestamp>,
#[prost(string, optional, tag="16")]
pub approved_by: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration="FlightStatus", tag="17")]
pub flight_status: i32,
#[prost(enumeration="FlightPriority", tag="18")]
pub flight_priority: i32,
}
#[derive(Eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FlightPlans {
#[prost(message, repeated, tag="1")]
pub flight_plans: ::prost::alloc::vec::Vec<FlightPlan>,
}
#[derive(num_derive::FromPrimitive)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum FlightStatus {
Ready = 0,
Boarding = 1,
InFlight = 3,
Finished = 4,
Cancelled = 5,
Draft = 6,
}
impl FlightStatus {
pub fn as_str_name(&self) -> &'static str {
match self {
FlightStatus::Ready => "READY",
FlightStatus::Boarding => "BOARDING",
FlightStatus::InFlight => "IN_FLIGHT",
FlightStatus::Finished => "FINISHED",
FlightStatus::Cancelled => "CANCELLED",
FlightStatus::Draft => "DRAFT",
}
}
}
#[derive(num_derive::FromPrimitive)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
#[repr(i32)]
pub enum FlightPriority {
Low = 0,
High = 1,
Emergency = 2,
}
impl FlightPriority {
pub fn as_str_name(&self) -> &'static str {
match self {
FlightPriority::Low => "LOW",
FlightPriority::High => "HIGH",
FlightPriority::Emergency => "EMERGENCY",
}
}
}
pub mod flight_plan_rpc_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct FlightPlanRpcClient<T> {
inner: tonic::client::Grpc<T>,
}
impl FlightPlanRpcClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> FlightPlanRpcClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> FlightPlanRpcClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
FlightPlanRpcClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
pub async fn flight_plans(
&mut self,
request: impl tonic::IntoRequest<super::super::SearchFilter>,
) -> Result<tonic::Response<super::FlightPlans>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/grpc.flight_plan.FlightPlanRpc/flight_plans",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn flight_plan_by_id(
&mut self,
request: impl tonic::IntoRequest<super::super::Id>,
) -> Result<tonic::Response<super::FlightPlan>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/grpc.flight_plan.FlightPlanRpc/flight_plan_by_id",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn insert_flight_plan(
&mut self,
request: impl tonic::IntoRequest<super::FlightPlanData>,
) -> Result<tonic::Response<super::FlightPlan>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/grpc.flight_plan.FlightPlanRpc/insert_flight_plan",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn update_flight_plan(
&mut self,
request: impl tonic::IntoRequest<super::UpdateFlightPlan>,
) -> Result<tonic::Response<super::FlightPlan>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/grpc.flight_plan.FlightPlanRpc/update_flight_plan",
);
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn delete_flight_plan(
&mut self,
request: impl tonic::IntoRequest<super::super::Id>,
) -> Result<tonic::Response<()>, tonic::Status> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/grpc.flight_plan.FlightPlanRpc/delete_flight_plan",
);
self.inner.unary(request.into_request(), path, codec).await
}
}
}