use crate::task_service::*;
impl serde::Serialize for CancelTaskRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.task_id.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("task_service.CancelTaskRequest", len)?;
if let Some(v) = self.task_id.as_ref() {
struct_ser.serialize_field("taskId", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CancelTaskRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"task_id",
"taskId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TaskId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"taskId" | "task_id" => Ok(GeneratedField::TaskId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CancelTaskRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct task_service.CancelTaskRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CancelTaskRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut task_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TaskId => {
if task_id__.is_some() {
return Err(serde::de::Error::duplicate_field("taskId"));
}
task_id__ = map_.next_value()?;
}
}
}
Ok(CancelTaskRequest {
task_id: task_id__,
})
}
}
deserializer.deserialize_struct("task_service.CancelTaskRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CancelTaskResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.status.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("task_service.CancelTaskResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CancelTaskResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"status" => Ok(GeneratedField::Status),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CancelTaskResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct task_service.CancelTaskResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CancelTaskResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Status => {
if status__.is_some() {
return Err(serde::de::Error::duplicate_field("status"));
}
status__ = map_.next_value()?;
}
}
}
Ok(CancelTaskResponse {
status: status__,
})
}
}
deserializer.deserialize_struct("task_service.CancelTaskResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateTaskRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.task_id.is_some() {
len += 1;
}
if self.plan.is_some() {
len += 1;
}
if self.epoch.is_some() {
len += 1;
}
if !self.tracing_context.is_empty() {
len += 1;
}
if self.expr_context.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("task_service.CreateTaskRequest", len)?;
if let Some(v) = self.task_id.as_ref() {
struct_ser.serialize_field("taskId", v)?;
}
if let Some(v) = self.plan.as_ref() {
struct_ser.serialize_field("plan", v)?;
}
if let Some(v) = self.epoch.as_ref() {
struct_ser.serialize_field("epoch", v)?;
}
if !self.tracing_context.is_empty() {
struct_ser.serialize_field("tracingContext", &self.tracing_context)?;
}
if let Some(v) = self.expr_context.as_ref() {
struct_ser.serialize_field("exprContext", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateTaskRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"task_id",
"taskId",
"plan",
"epoch",
"tracing_context",
"tracingContext",
"expr_context",
"exprContext",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TaskId,
Plan,
Epoch,
TracingContext,
ExprContext,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"taskId" | "task_id" => Ok(GeneratedField::TaskId),
"plan" => Ok(GeneratedField::Plan),
"epoch" => Ok(GeneratedField::Epoch),
"tracingContext" | "tracing_context" => Ok(GeneratedField::TracingContext),
"exprContext" | "expr_context" => Ok(GeneratedField::ExprContext),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CreateTaskRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct task_service.CreateTaskRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateTaskRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut task_id__ = None;
let mut plan__ = None;
let mut epoch__ = None;
let mut tracing_context__ = None;
let mut expr_context__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TaskId => {
if task_id__.is_some() {
return Err(serde::de::Error::duplicate_field("taskId"));
}
task_id__ = map_.next_value()?;
}
GeneratedField::Plan => {
if plan__.is_some() {
return Err(serde::de::Error::duplicate_field("plan"));
}
plan__ = map_.next_value()?;
}
GeneratedField::Epoch => {
if epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("epoch"));
}
epoch__ = map_.next_value()?;
}
GeneratedField::TracingContext => {
if tracing_context__.is_some() {
return Err(serde::de::Error::duplicate_field("tracingContext"));
}
tracing_context__ = Some(
map_.next_value::<std::collections::HashMap<_, _>>()?
);
}
GeneratedField::ExprContext => {
if expr_context__.is_some() {
return Err(serde::de::Error::duplicate_field("exprContext"));
}
expr_context__ = map_.next_value()?;
}
}
}
Ok(CreateTaskRequest {
task_id: task_id__,
plan: plan__,
epoch: epoch__,
tracing_context: tracing_context__.unwrap_or_default(),
expr_context: expr_context__,
})
}
}
deserializer.deserialize_struct("task_service.CreateTaskRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ExecuteRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.task_id.is_some() {
len += 1;
}
if self.plan.is_some() {
len += 1;
}
if self.epoch.is_some() {
len += 1;
}
if !self.tracing_context.is_empty() {
len += 1;
}
if self.expr_context.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("task_service.ExecuteRequest", len)?;
if let Some(v) = self.task_id.as_ref() {
struct_ser.serialize_field("taskId", v)?;
}
if let Some(v) = self.plan.as_ref() {
struct_ser.serialize_field("plan", v)?;
}
if let Some(v) = self.epoch.as_ref() {
struct_ser.serialize_field("epoch", v)?;
}
if !self.tracing_context.is_empty() {
struct_ser.serialize_field("tracingContext", &self.tracing_context)?;
}
if let Some(v) = self.expr_context.as_ref() {
struct_ser.serialize_field("exprContext", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ExecuteRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"task_id",
"taskId",
"plan",
"epoch",
"tracing_context",
"tracingContext",
"expr_context",
"exprContext",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TaskId,
Plan,
Epoch,
TracingContext,
ExprContext,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"taskId" | "task_id" => Ok(GeneratedField::TaskId),
"plan" => Ok(GeneratedField::Plan),
"epoch" => Ok(GeneratedField::Epoch),
"tracingContext" | "tracing_context" => Ok(GeneratedField::TracingContext),
"exprContext" | "expr_context" => Ok(GeneratedField::ExprContext),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ExecuteRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct task_service.ExecuteRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ExecuteRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut task_id__ = None;
let mut plan__ = None;
let mut epoch__ = None;
let mut tracing_context__ = None;
let mut expr_context__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TaskId => {
if task_id__.is_some() {
return Err(serde::de::Error::duplicate_field("taskId"));
}
task_id__ = map_.next_value()?;
}
GeneratedField::Plan => {
if plan__.is_some() {
return Err(serde::de::Error::duplicate_field("plan"));
}
plan__ = map_.next_value()?;
}
GeneratedField::Epoch => {
if epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("epoch"));
}
epoch__ = map_.next_value()?;
}
GeneratedField::TracingContext => {
if tracing_context__.is_some() {
return Err(serde::de::Error::duplicate_field("tracingContext"));
}
tracing_context__ = Some(
map_.next_value::<std::collections::HashMap<_, _>>()?
);
}
GeneratedField::ExprContext => {
if expr_context__.is_some() {
return Err(serde::de::Error::duplicate_field("exprContext"));
}
expr_context__ = map_.next_value()?;
}
}
}
Ok(ExecuteRequest {
task_id: task_id__,
plan: plan__,
epoch: epoch__,
tracing_context: tracing_context__.unwrap_or_default(),
expr_context: expr_context__,
})
}
}
deserializer.deserialize_struct("task_service.ExecuteRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetDataRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.task_output_id.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("task_service.GetDataRequest", len)?;
if let Some(v) = self.task_output_id.as_ref() {
struct_ser.serialize_field("taskOutputId", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetDataRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"task_output_id",
"taskOutputId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TaskOutputId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"taskOutputId" | "task_output_id" => Ok(GeneratedField::TaskOutputId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetDataRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct task_service.GetDataRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetDataRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut task_output_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TaskOutputId => {
if task_output_id__.is_some() {
return Err(serde::de::Error::duplicate_field("taskOutputId"));
}
task_output_id__ = map_.next_value()?;
}
}
}
Ok(GetDataRequest {
task_output_id: task_output_id__,
})
}
}
deserializer.deserialize_struct("task_service.GetDataRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetDataResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.record_batch.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("task_service.GetDataResponse", len)?;
if let Some(v) = self.record_batch.as_ref() {
struct_ser.serialize_field("recordBatch", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetDataResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"record_batch",
"recordBatch",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
RecordBatch,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"recordBatch" | "record_batch" => Ok(GeneratedField::RecordBatch),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetDataResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct task_service.GetDataResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetDataResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut record_batch__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::RecordBatch => {
if record_batch__.is_some() {
return Err(serde::de::Error::duplicate_field("recordBatch"));
}
record_batch__ = map_.next_value()?;
}
}
}
Ok(GetDataResponse {
record_batch: record_batch__,
})
}
}
deserializer.deserialize_struct("task_service.GetDataResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetStreamRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.value.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("task_service.GetStreamRequest", len)?;
if let Some(v) = self.value.as_ref() {
match v {
get_stream_request::Value::Get(v) => {
struct_ser.serialize_field("get", v)?;
}
get_stream_request::Value::AddPermits(v) => {
struct_ser.serialize_field("addPermits", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetStreamRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"get",
"add_permits",
"addPermits",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Get,
AddPermits,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"get" => Ok(GeneratedField::Get),
"addPermits" | "add_permits" => Ok(GeneratedField::AddPermits),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetStreamRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct task_service.GetStreamRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetStreamRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut value__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Get => {
if value__.is_some() {
return Err(serde::de::Error::duplicate_field("get"));
}
value__ = map_.next_value::<::std::option::Option<_>>()?.map(get_stream_request::Value::Get)
;
}
GeneratedField::AddPermits => {
if value__.is_some() {
return Err(serde::de::Error::duplicate_field("addPermits"));
}
value__ = map_.next_value::<::std::option::Option<_>>()?.map(get_stream_request::Value::AddPermits)
;
}
}
}
Ok(GetStreamRequest {
value: value__,
})
}
}
deserializer.deserialize_struct("task_service.GetStreamRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for get_stream_request::Get {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.up_actor_id != 0 {
len += 1;
}
if self.down_actor_id != 0 {
len += 1;
}
if self.up_fragment_id != 0 {
len += 1;
}
if self.down_fragment_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("task_service.GetStreamRequest.Get", len)?;
if self.up_actor_id != 0 {
struct_ser.serialize_field("upActorId", &self.up_actor_id)?;
}
if self.down_actor_id != 0 {
struct_ser.serialize_field("downActorId", &self.down_actor_id)?;
}
if self.up_fragment_id != 0 {
struct_ser.serialize_field("upFragmentId", &self.up_fragment_id)?;
}
if self.down_fragment_id != 0 {
struct_ser.serialize_field("downFragmentId", &self.down_fragment_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for get_stream_request::Get {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"up_actor_id",
"upActorId",
"down_actor_id",
"downActorId",
"up_fragment_id",
"upFragmentId",
"down_fragment_id",
"downFragmentId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
UpActorId,
DownActorId,
UpFragmentId,
DownFragmentId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"upActorId" | "up_actor_id" => Ok(GeneratedField::UpActorId),
"downActorId" | "down_actor_id" => Ok(GeneratedField::DownActorId),
"upFragmentId" | "up_fragment_id" => Ok(GeneratedField::UpFragmentId),
"downFragmentId" | "down_fragment_id" => Ok(GeneratedField::DownFragmentId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = get_stream_request::Get;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct task_service.GetStreamRequest.Get")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<get_stream_request::Get, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut up_actor_id__ = None;
let mut down_actor_id__ = None;
let mut up_fragment_id__ = None;
let mut down_fragment_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::UpActorId => {
if up_actor_id__.is_some() {
return Err(serde::de::Error::duplicate_field("upActorId"));
}
up_actor_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::DownActorId => {
if down_actor_id__.is_some() {
return Err(serde::de::Error::duplicate_field("downActorId"));
}
down_actor_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::UpFragmentId => {
if up_fragment_id__.is_some() {
return Err(serde::de::Error::duplicate_field("upFragmentId"));
}
up_fragment_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::DownFragmentId => {
if down_fragment_id__.is_some() {
return Err(serde::de::Error::duplicate_field("downFragmentId"));
}
down_fragment_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(get_stream_request::Get {
up_actor_id: up_actor_id__.unwrap_or_default(),
down_actor_id: down_actor_id__.unwrap_or_default(),
up_fragment_id: up_fragment_id__.unwrap_or_default(),
down_fragment_id: down_fragment_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("task_service.GetStreamRequest.Get", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetStreamResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.message.is_some() {
len += 1;
}
if self.permits.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("task_service.GetStreamResponse", len)?;
if let Some(v) = self.message.as_ref() {
struct_ser.serialize_field("message", v)?;
}
if let Some(v) = self.permits.as_ref() {
struct_ser.serialize_field("permits", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetStreamResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"message",
"permits",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Message,
Permits,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"message" => Ok(GeneratedField::Message),
"permits" => Ok(GeneratedField::Permits),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetStreamResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct task_service.GetStreamResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetStreamResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut message__ = None;
let mut permits__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Message => {
if message__.is_some() {
return Err(serde::de::Error::duplicate_field("message"));
}
message__ = map_.next_value()?;
}
GeneratedField::Permits => {
if permits__.is_some() {
return Err(serde::de::Error::duplicate_field("permits"));
}
permits__ = map_.next_value()?;
}
}
}
Ok(GetStreamResponse {
message: message__,
permits: permits__,
})
}
}
deserializer.deserialize_struct("task_service.GetStreamResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetTaskInfoRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.task_id.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("task_service.GetTaskInfoRequest", len)?;
if let Some(v) = self.task_id.as_ref() {
struct_ser.serialize_field("taskId", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetTaskInfoRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"task_id",
"taskId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TaskId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"taskId" | "task_id" => Ok(GeneratedField::TaskId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetTaskInfoRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct task_service.GetTaskInfoRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetTaskInfoRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut task_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TaskId => {
if task_id__.is_some() {
return Err(serde::de::Error::duplicate_field("taskId"));
}
task_id__ = map_.next_value()?;
}
}
}
Ok(GetTaskInfoRequest {
task_id: task_id__,
})
}
}
deserializer.deserialize_struct("task_service.GetTaskInfoRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for Permits {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.value.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("task_service.Permits", len)?;
if let Some(v) = self.value.as_ref() {
match v {
permits::Value::Record(v) => {
struct_ser.serialize_field("record", v)?;
}
permits::Value::Barrier(v) => {
struct_ser.serialize_field("barrier", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for Permits {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"record",
"barrier",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Record,
Barrier,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"record" => Ok(GeneratedField::Record),
"barrier" => Ok(GeneratedField::Barrier),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = Permits;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct task_service.Permits")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<Permits, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut value__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Record => {
if value__.is_some() {
return Err(serde::de::Error::duplicate_field("record"));
}
value__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| permits::Value::Record(x.0));
}
GeneratedField::Barrier => {
if value__.is_some() {
return Err(serde::de::Error::duplicate_field("barrier"));
}
value__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| permits::Value::Barrier(x.0));
}
}
}
Ok(Permits {
value: value__,
})
}
}
deserializer.deserialize_struct("task_service.Permits", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for TaskId {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if !self.query_id.is_empty() {
len += 1;
}
if self.stage_id != 0 {
len += 1;
}
if self.task_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("task_service.TaskId", len)?;
if !self.query_id.is_empty() {
struct_ser.serialize_field("queryId", &self.query_id)?;
}
if self.stage_id != 0 {
struct_ser.serialize_field("stageId", &self.stage_id)?;
}
if self.task_id != 0 {
struct_ser.serialize_field("taskId", &self.task_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TaskId {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"query_id",
"queryId",
"stage_id",
"stageId",
"task_id",
"taskId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
QueryId,
StageId,
TaskId,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"queryId" | "query_id" => Ok(GeneratedField::QueryId),
"stageId" | "stage_id" => Ok(GeneratedField::StageId),
"taskId" | "task_id" => Ok(GeneratedField::TaskId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TaskId;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct task_service.TaskId")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TaskId, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut query_id__ = None;
let mut stage_id__ = None;
let mut task_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::QueryId => {
if query_id__.is_some() {
return Err(serde::de::Error::duplicate_field("queryId"));
}
query_id__ = Some(map_.next_value()?);
}
GeneratedField::StageId => {
if stage_id__.is_some() {
return Err(serde::de::Error::duplicate_field("stageId"));
}
stage_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TaskId => {
if task_id__.is_some() {
return Err(serde::de::Error::duplicate_field("taskId"));
}
task_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(TaskId {
query_id: query_id__.unwrap_or_default(),
stage_id: stage_id__.unwrap_or_default(),
task_id: task_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("task_service.TaskId", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for TaskInfoResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let mut len = 0;
if self.task_id.is_some() {
len += 1;
}
if self.task_status != 0 {
len += 1;
}
if !self.error_message.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("task_service.TaskInfoResponse", len)?;
if let Some(v) = self.task_id.as_ref() {
struct_ser.serialize_field("taskId", v)?;
}
if self.task_status != 0 {
let v = task_info_response::TaskStatus::try_from(self.task_status)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.task_status)))?;
struct_ser.serialize_field("taskStatus", &v)?;
}
if !self.error_message.is_empty() {
struct_ser.serialize_field("errorMessage", &self.error_message)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TaskInfoResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"task_id",
"taskId",
"task_status",
"taskStatus",
"error_message",
"errorMessage",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TaskId,
TaskStatus,
ErrorMessage,
}
impl<'de> serde::Deserialize<'de> for GeneratedField {
fn deserialize<D>(deserializer: D) -> std::result::Result<GeneratedField, D::Error>
where
D: serde::Deserializer<'de>,
{
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GeneratedField;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
#[allow(unused_variables)]
fn visit_str<E>(self, value: &str) -> std::result::Result<GeneratedField, E>
where
E: serde::de::Error,
{
match value {
"taskId" | "task_id" => Ok(GeneratedField::TaskId),
"taskStatus" | "task_status" => Ok(GeneratedField::TaskStatus),
"errorMessage" | "error_message" => Ok(GeneratedField::ErrorMessage),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TaskInfoResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct task_service.TaskInfoResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TaskInfoResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut task_id__ = None;
let mut task_status__ = None;
let mut error_message__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TaskId => {
if task_id__.is_some() {
return Err(serde::de::Error::duplicate_field("taskId"));
}
task_id__ = map_.next_value()?;
}
GeneratedField::TaskStatus => {
if task_status__.is_some() {
return Err(serde::de::Error::duplicate_field("taskStatus"));
}
task_status__ = Some(map_.next_value::<task_info_response::TaskStatus>()? as i32);
}
GeneratedField::ErrorMessage => {
if error_message__.is_some() {
return Err(serde::de::Error::duplicate_field("errorMessage"));
}
error_message__ = Some(map_.next_value()?);
}
}
}
Ok(TaskInfoResponse {
task_id: task_id__,
task_status: task_status__.unwrap_or_default(),
error_message: error_message__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("task_service.TaskInfoResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for task_info_response::TaskStatus {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
let variant = match self {
Self::Unspecified => "UNSPECIFIED",
Self::Pending => "PENDING",
Self::Running => "RUNNING",
Self::Finished => "FINISHED",
Self::Failed => "FAILED",
Self::Aborted => "ABORTED",
Self::Cancelled => "CANCELLED",
Self::Ping => "PING",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for task_info_response::TaskStatus {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"UNSPECIFIED",
"PENDING",
"RUNNING",
"FINISHED",
"FAILED",
"ABORTED",
"CANCELLED",
"PING",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = task_info_response::TaskStatus;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(formatter, "expected one of: {:?}", &FIELDS)
}
fn visit_i64<E>(self, v: i64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self)
})
}
fn visit_u64<E>(self, v: u64) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
i32::try_from(v)
.ok()
.and_then(|x| x.try_into().ok())
.ok_or_else(|| {
serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self)
})
}
fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
where
E: serde::de::Error,
{
match value {
"UNSPECIFIED" => Ok(task_info_response::TaskStatus::Unspecified),
"PENDING" => Ok(task_info_response::TaskStatus::Pending),
"RUNNING" => Ok(task_info_response::TaskStatus::Running),
"FINISHED" => Ok(task_info_response::TaskStatus::Finished),
"FAILED" => Ok(task_info_response::TaskStatus::Failed),
"ABORTED" => Ok(task_info_response::TaskStatus::Aborted),
"CANCELLED" => Ok(task_info_response::TaskStatus::Cancelled),
"PING" => Ok(task_info_response::TaskStatus::Ping),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}