use crate::meta::*;
impl serde::Serialize for ActivateWorkerNodeRequest {
#[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.host.is_some() {
len += 1;
}
if self.node_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ActivateWorkerNodeRequest", len)?;
if let Some(v) = self.host.as_ref() {
struct_ser.serialize_field("host", v)?;
}
if self.node_id != 0 {
struct_ser.serialize_field("nodeId", &self.node_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ActivateWorkerNodeRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"host",
"node_id",
"nodeId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Host,
NodeId,
}
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 {
"host" => Ok(GeneratedField::Host),
"nodeId" | "node_id" => Ok(GeneratedField::NodeId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ActivateWorkerNodeRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ActivateWorkerNodeRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ActivateWorkerNodeRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut host__ = None;
let mut node_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Host => {
if host__.is_some() {
return Err(serde::de::Error::duplicate_field("host"));
}
host__ = map_.next_value()?;
}
GeneratedField::NodeId => {
if node_id__.is_some() {
return Err(serde::de::Error::duplicate_field("nodeId"));
}
node_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(ActivateWorkerNodeRequest {
host: host__,
node_id: node_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ActivateWorkerNodeRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ActivateWorkerNodeResponse {
#[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("meta.ActivateWorkerNodeResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ActivateWorkerNodeResponse {
#[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 = ActivateWorkerNodeResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ActivateWorkerNodeResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ActivateWorkerNodeResponse, 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(ActivateWorkerNodeResponse {
status: status__,
})
}
}
deserializer.deserialize_struct("meta.ActivateWorkerNodeResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ActorCountPerParallelism {
#[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.worker_id_to_actor_count.is_empty() {
len += 1;
}
if self.hard_limit != 0 {
len += 1;
}
if self.soft_limit != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ActorCountPerParallelism", len)?;
if !self.worker_id_to_actor_count.is_empty() {
struct_ser.serialize_field("workerIdToActorCount", &self.worker_id_to_actor_count)?;
}
if self.hard_limit != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("hardLimit", ToString::to_string(&self.hard_limit).as_str())?;
}
if self.soft_limit != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("softLimit", ToString::to_string(&self.soft_limit).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ActorCountPerParallelism {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"worker_id_to_actor_count",
"workerIdToActorCount",
"hard_limit",
"hardLimit",
"soft_limit",
"softLimit",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
WorkerIdToActorCount,
HardLimit,
SoftLimit,
}
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 {
"workerIdToActorCount" | "worker_id_to_actor_count" => Ok(GeneratedField::WorkerIdToActorCount),
"hardLimit" | "hard_limit" => Ok(GeneratedField::HardLimit),
"softLimit" | "soft_limit" => Ok(GeneratedField::SoftLimit),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ActorCountPerParallelism;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ActorCountPerParallelism")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ActorCountPerParallelism, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut worker_id_to_actor_count__ = None;
let mut hard_limit__ = None;
let mut soft_limit__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::WorkerIdToActorCount => {
if worker_id_to_actor_count__.is_some() {
return Err(serde::de::Error::duplicate_field("workerIdToActorCount"));
}
worker_id_to_actor_count__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::HardLimit => {
if hard_limit__.is_some() {
return Err(serde::de::Error::duplicate_field("hardLimit"));
}
hard_limit__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::SoftLimit => {
if soft_limit__.is_some() {
return Err(serde::de::Error::duplicate_field("softLimit"));
}
soft_limit__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(ActorCountPerParallelism {
worker_id_to_actor_count: worker_id_to_actor_count__.unwrap_or_default(),
hard_limit: hard_limit__.unwrap_or_default(),
soft_limit: soft_limit__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ActorCountPerParallelism", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for actor_count_per_parallelism::WorkerActorCount {
#[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.actor_count != 0 {
len += 1;
}
if self.parallelism != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ActorCountPerParallelism.WorkerActorCount", len)?;
if self.actor_count != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("actorCount", ToString::to_string(&self.actor_count).as_str())?;
}
if self.parallelism != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("parallelism", ToString::to_string(&self.parallelism).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for actor_count_per_parallelism::WorkerActorCount {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"actor_count",
"actorCount",
"parallelism",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ActorCount,
Parallelism,
}
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 {
"actorCount" | "actor_count" => Ok(GeneratedField::ActorCount),
"parallelism" => Ok(GeneratedField::Parallelism),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = actor_count_per_parallelism::WorkerActorCount;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ActorCountPerParallelism.WorkerActorCount")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<actor_count_per_parallelism::WorkerActorCount, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut actor_count__ = None;
let mut parallelism__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ActorCount => {
if actor_count__.is_some() {
return Err(serde::de::Error::duplicate_field("actorCount"));
}
actor_count__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Parallelism => {
if parallelism__.is_some() {
return Err(serde::de::Error::duplicate_field("parallelism"));
}
parallelism__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(actor_count_per_parallelism::WorkerActorCount {
actor_count: actor_count__.unwrap_or_default(),
parallelism: parallelism__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ActorCountPerParallelism.WorkerActorCount", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ActorIds {
#[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.ids.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ActorIds", len)?;
if !self.ids.is_empty() {
struct_ser.serialize_field("ids", &self.ids)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ActorIds {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"ids",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Ids,
}
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 {
"ids" => Ok(GeneratedField::Ids),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ActorIds;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ActorIds")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ActorIds, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut ids__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Ids => {
if ids__.is_some() {
return Err(serde::de::Error::duplicate_field("ids"));
}
ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(ActorIds {
ids: ids__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ActorIds", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ActorLocation {
#[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.node.is_some() {
len += 1;
}
if !self.actors.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ActorLocation", len)?;
if let Some(v) = self.node.as_ref() {
struct_ser.serialize_field("node", v)?;
}
if !self.actors.is_empty() {
struct_ser.serialize_field("actors", &self.actors)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ActorLocation {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"node",
"actors",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Node,
Actors,
}
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 {
"node" => Ok(GeneratedField::Node),
"actors" => Ok(GeneratedField::Actors),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ActorLocation;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ActorLocation")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ActorLocation, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut node__ = None;
let mut actors__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Node => {
if node__.is_some() {
return Err(serde::de::Error::duplicate_field("node"));
}
node__ = map_.next_value()?;
}
GeneratedField::Actors => {
if actors__.is_some() {
return Err(serde::de::Error::duplicate_field("actors"));
}
actors__ = Some(map_.next_value()?);
}
}
}
Ok(ActorLocation {
node: node__,
actors: actors__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ActorLocation", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for AddEventLogRequest {
#[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.event.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.AddEventLogRequest", len)?;
if let Some(v) = self.event.as_ref() {
match v {
add_event_log_request::Event::WorkerNodePanic(v) => {
struct_ser.serialize_field("workerNodePanic", v)?;
}
add_event_log_request::Event::SinkFail(v) => {
struct_ser.serialize_field("sinkFail", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for AddEventLogRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"worker_node_panic",
"workerNodePanic",
"sink_fail",
"sinkFail",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
WorkerNodePanic,
SinkFail,
}
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 {
"workerNodePanic" | "worker_node_panic" => Ok(GeneratedField::WorkerNodePanic),
"sinkFail" | "sink_fail" => Ok(GeneratedField::SinkFail),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = AddEventLogRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.AddEventLogRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<AddEventLogRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut event__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::WorkerNodePanic => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("workerNodePanic"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(add_event_log_request::Event::WorkerNodePanic)
;
}
GeneratedField::SinkFail => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("sinkFail"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(add_event_log_request::Event::SinkFail)
;
}
}
}
Ok(AddEventLogRequest {
event: event__,
})
}
}
deserializer.deserialize_struct("meta.AddEventLogRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for AddEventLogResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.AddEventLogResponse", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for AddEventLogResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = AddEventLogResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.AddEventLogResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<AddEventLogResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(AddEventLogResponse {
})
}
}
deserializer.deserialize_struct("meta.AddEventLogResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for AddWorkerNodeRequest {
#[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.worker_type != 0 {
len += 1;
}
if self.host.is_some() {
len += 1;
}
if self.property.is_some() {
len += 1;
}
if self.resource.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.AddWorkerNodeRequest", len)?;
if self.worker_type != 0 {
let v = super::common::WorkerType::try_from(self.worker_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.worker_type)))?;
struct_ser.serialize_field("workerType", &v)?;
}
if let Some(v) = self.host.as_ref() {
struct_ser.serialize_field("host", v)?;
}
if let Some(v) = self.property.as_ref() {
struct_ser.serialize_field("property", v)?;
}
if let Some(v) = self.resource.as_ref() {
struct_ser.serialize_field("resource", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for AddWorkerNodeRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"worker_type",
"workerType",
"host",
"property",
"resource",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
WorkerType,
Host,
Property,
Resource,
}
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 {
"workerType" | "worker_type" => Ok(GeneratedField::WorkerType),
"host" => Ok(GeneratedField::Host),
"property" => Ok(GeneratedField::Property),
"resource" => Ok(GeneratedField::Resource),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = AddWorkerNodeRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.AddWorkerNodeRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<AddWorkerNodeRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut worker_type__ = None;
let mut host__ = None;
let mut property__ = None;
let mut resource__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::WorkerType => {
if worker_type__.is_some() {
return Err(serde::de::Error::duplicate_field("workerType"));
}
worker_type__ = Some(map_.next_value::<super::common::WorkerType>()? as i32);
}
GeneratedField::Host => {
if host__.is_some() {
return Err(serde::de::Error::duplicate_field("host"));
}
host__ = map_.next_value()?;
}
GeneratedField::Property => {
if property__.is_some() {
return Err(serde::de::Error::duplicate_field("property"));
}
property__ = map_.next_value()?;
}
GeneratedField::Resource => {
if resource__.is_some() {
return Err(serde::de::Error::duplicate_field("resource"));
}
resource__ = map_.next_value()?;
}
}
}
Ok(AddWorkerNodeRequest {
worker_type: worker_type__.unwrap_or_default(),
host: host__,
property: property__,
resource: resource__,
})
}
}
deserializer.deserialize_struct("meta.AddWorkerNodeRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for add_worker_node_request::Property {
#[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.worker_node_parallelism != 0 {
len += 1;
}
if self.is_streaming {
len += 1;
}
if self.is_serving {
len += 1;
}
if self.is_unschedulable {
len += 1;
}
if !self.internal_rpc_host_addr.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.AddWorkerNodeRequest.Property", len)?;
if self.worker_node_parallelism != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("workerNodeParallelism", ToString::to_string(&self.worker_node_parallelism).as_str())?;
}
if self.is_streaming {
struct_ser.serialize_field("isStreaming", &self.is_streaming)?;
}
if self.is_serving {
struct_ser.serialize_field("isServing", &self.is_serving)?;
}
if self.is_unschedulable {
struct_ser.serialize_field("isUnschedulable", &self.is_unschedulable)?;
}
if !self.internal_rpc_host_addr.is_empty() {
struct_ser.serialize_field("internalRpcHostAddr", &self.internal_rpc_host_addr)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for add_worker_node_request::Property {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"worker_node_parallelism",
"workerNodeParallelism",
"is_streaming",
"isStreaming",
"is_serving",
"isServing",
"is_unschedulable",
"isUnschedulable",
"internal_rpc_host_addr",
"internalRpcHostAddr",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
WorkerNodeParallelism,
IsStreaming,
IsServing,
IsUnschedulable,
InternalRpcHostAddr,
}
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 {
"workerNodeParallelism" | "worker_node_parallelism" => Ok(GeneratedField::WorkerNodeParallelism),
"isStreaming" | "is_streaming" => Ok(GeneratedField::IsStreaming),
"isServing" | "is_serving" => Ok(GeneratedField::IsServing),
"isUnschedulable" | "is_unschedulable" => Ok(GeneratedField::IsUnschedulable),
"internalRpcHostAddr" | "internal_rpc_host_addr" => Ok(GeneratedField::InternalRpcHostAddr),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = add_worker_node_request::Property;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.AddWorkerNodeRequest.Property")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<add_worker_node_request::Property, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut worker_node_parallelism__ = None;
let mut is_streaming__ = None;
let mut is_serving__ = None;
let mut is_unschedulable__ = None;
let mut internal_rpc_host_addr__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::WorkerNodeParallelism => {
if worker_node_parallelism__.is_some() {
return Err(serde::de::Error::duplicate_field("workerNodeParallelism"));
}
worker_node_parallelism__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::IsStreaming => {
if is_streaming__.is_some() {
return Err(serde::de::Error::duplicate_field("isStreaming"));
}
is_streaming__ = Some(map_.next_value()?);
}
GeneratedField::IsServing => {
if is_serving__.is_some() {
return Err(serde::de::Error::duplicate_field("isServing"));
}
is_serving__ = Some(map_.next_value()?);
}
GeneratedField::IsUnschedulable => {
if is_unschedulable__.is_some() {
return Err(serde::de::Error::duplicate_field("isUnschedulable"));
}
is_unschedulable__ = Some(map_.next_value()?);
}
GeneratedField::InternalRpcHostAddr => {
if internal_rpc_host_addr__.is_some() {
return Err(serde::de::Error::duplicate_field("internalRpcHostAddr"));
}
internal_rpc_host_addr__ = Some(map_.next_value()?);
}
}
}
Ok(add_worker_node_request::Property {
worker_node_parallelism: worker_node_parallelism__.unwrap_or_default(),
is_streaming: is_streaming__.unwrap_or_default(),
is_serving: is_serving__.unwrap_or_default(),
is_unschedulable: is_unschedulable__.unwrap_or_default(),
internal_rpc_host_addr: internal_rpc_host_addr__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.AddWorkerNodeRequest.Property", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for AddWorkerNodeResponse {
#[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.node_id.is_some() {
len += 1;
}
if !self.cluster_id.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.AddWorkerNodeResponse", len)?;
if let Some(v) = self.node_id.as_ref() {
struct_ser.serialize_field("nodeId", v)?;
}
if !self.cluster_id.is_empty() {
struct_ser.serialize_field("clusterId", &self.cluster_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for AddWorkerNodeResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"node_id",
"nodeId",
"cluster_id",
"clusterId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
NodeId,
ClusterId,
}
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 {
"nodeId" | "node_id" => Ok(GeneratedField::NodeId),
"clusterId" | "cluster_id" => Ok(GeneratedField::ClusterId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = AddWorkerNodeResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.AddWorkerNodeResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<AddWorkerNodeResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut node_id__ = None;
let mut cluster_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::NodeId => {
if node_id__.is_some() {
return Err(serde::de::Error::duplicate_field("nodeId"));
}
node_id__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::ClusterId => {
if cluster_id__.is_some() {
return Err(serde::de::Error::duplicate_field("clusterId"));
}
cluster_id__ = Some(map_.next_value()?);
}
}
}
Ok(AddWorkerNodeResponse {
node_id: node_id__,
cluster_id: cluster_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.AddWorkerNodeResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ApplyThrottleRequest {
#[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.kind != 0 {
len += 1;
}
if self.id != 0 {
len += 1;
}
if self.rate.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ApplyThrottleRequest", len)?;
if self.kind != 0 {
let v = ThrottleTarget::try_from(self.kind)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.kind)))?;
struct_ser.serialize_field("kind", &v)?;
}
if self.id != 0 {
struct_ser.serialize_field("id", &self.id)?;
}
if let Some(v) = self.rate.as_ref() {
struct_ser.serialize_field("rate", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ApplyThrottleRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"kind",
"id",
"rate",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Kind,
Id,
Rate,
}
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 {
"kind" => Ok(GeneratedField::Kind),
"id" => Ok(GeneratedField::Id),
"rate" => Ok(GeneratedField::Rate),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ApplyThrottleRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ApplyThrottleRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ApplyThrottleRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut kind__ = None;
let mut id__ = None;
let mut rate__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Kind => {
if kind__.is_some() {
return Err(serde::de::Error::duplicate_field("kind"));
}
kind__ = Some(map_.next_value::<ThrottleTarget>()? as i32);
}
GeneratedField::Id => {
if id__.is_some() {
return Err(serde::de::Error::duplicate_field("id"));
}
id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Rate => {
if rate__.is_some() {
return Err(serde::de::Error::duplicate_field("rate"));
}
rate__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
}
}
Ok(ApplyThrottleRequest {
kind: kind__.unwrap_or_default(),
id: id__.unwrap_or_default(),
rate: rate__,
})
}
}
deserializer.deserialize_struct("meta.ApplyThrottleRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ApplyThrottleResponse {
#[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("meta.ApplyThrottleResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ApplyThrottleResponse {
#[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 = ApplyThrottleResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ApplyThrottleResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ApplyThrottleResponse, 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(ApplyThrottleResponse {
status: status__,
})
}
}
deserializer.deserialize_struct("meta.ApplyThrottleResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CancelCreatingJobsRequest {
#[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.jobs.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.CancelCreatingJobsRequest", len)?;
if let Some(v) = self.jobs.as_ref() {
match v {
cancel_creating_jobs_request::Jobs::Infos(v) => {
struct_ser.serialize_field("infos", v)?;
}
cancel_creating_jobs_request::Jobs::Ids(v) => {
struct_ser.serialize_field("ids", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CancelCreatingJobsRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"infos",
"ids",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Infos,
Ids,
}
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 {
"infos" => Ok(GeneratedField::Infos),
"ids" => Ok(GeneratedField::Ids),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CancelCreatingJobsRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.CancelCreatingJobsRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CancelCreatingJobsRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut jobs__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Infos => {
if jobs__.is_some() {
return Err(serde::de::Error::duplicate_field("infos"));
}
jobs__ = map_.next_value::<::std::option::Option<_>>()?.map(cancel_creating_jobs_request::Jobs::Infos)
;
}
GeneratedField::Ids => {
if jobs__.is_some() {
return Err(serde::de::Error::duplicate_field("ids"));
}
jobs__ = map_.next_value::<::std::option::Option<_>>()?.map(cancel_creating_jobs_request::Jobs::Ids)
;
}
}
}
Ok(CancelCreatingJobsRequest {
jobs: jobs__,
})
}
}
deserializer.deserialize_struct("meta.CancelCreatingJobsRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for cancel_creating_jobs_request::CreatingJobIds {
#[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.job_ids.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.CancelCreatingJobsRequest.CreatingJobIds", len)?;
if !self.job_ids.is_empty() {
struct_ser.serialize_field("jobIds", &self.job_ids)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for cancel_creating_jobs_request::CreatingJobIds {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"job_ids",
"jobIds",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
JobIds,
}
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 {
"jobIds" | "job_ids" => Ok(GeneratedField::JobIds),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = cancel_creating_jobs_request::CreatingJobIds;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.CancelCreatingJobsRequest.CreatingJobIds")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<cancel_creating_jobs_request::CreatingJobIds, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut job_ids__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::JobIds => {
if job_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("jobIds"));
}
job_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(cancel_creating_jobs_request::CreatingJobIds {
job_ids: job_ids__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.CancelCreatingJobsRequest.CreatingJobIds", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for cancel_creating_jobs_request::CreatingJobInfo {
#[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.database_id != 0 {
len += 1;
}
if self.schema_id != 0 {
len += 1;
}
if !self.name.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.CancelCreatingJobsRequest.CreatingJobInfo", len)?;
if self.database_id != 0 {
struct_ser.serialize_field("databaseId", &self.database_id)?;
}
if self.schema_id != 0 {
struct_ser.serialize_field("schemaId", &self.schema_id)?;
}
if !self.name.is_empty() {
struct_ser.serialize_field("name", &self.name)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for cancel_creating_jobs_request::CreatingJobInfo {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"database_id",
"databaseId",
"schema_id",
"schemaId",
"name",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
DatabaseId,
SchemaId,
Name,
}
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 {
"databaseId" | "database_id" => Ok(GeneratedField::DatabaseId),
"schemaId" | "schema_id" => Ok(GeneratedField::SchemaId),
"name" => Ok(GeneratedField::Name),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = cancel_creating_jobs_request::CreatingJobInfo;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.CancelCreatingJobsRequest.CreatingJobInfo")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<cancel_creating_jobs_request::CreatingJobInfo, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut database_id__ = None;
let mut schema_id__ = None;
let mut name__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::DatabaseId => {
if database_id__.is_some() {
return Err(serde::de::Error::duplicate_field("databaseId"));
}
database_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::SchemaId => {
if schema_id__.is_some() {
return Err(serde::de::Error::duplicate_field("schemaId"));
}
schema_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Name => {
if name__.is_some() {
return Err(serde::de::Error::duplicate_field("name"));
}
name__ = Some(map_.next_value()?);
}
}
}
Ok(cancel_creating_jobs_request::CreatingJobInfo {
database_id: database_id__.unwrap_or_default(),
schema_id: schema_id__.unwrap_or_default(),
name: name__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.CancelCreatingJobsRequest.CreatingJobInfo", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for cancel_creating_jobs_request::CreatingJobInfos {
#[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.infos.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.CancelCreatingJobsRequest.CreatingJobInfos", len)?;
if !self.infos.is_empty() {
struct_ser.serialize_field("infos", &self.infos)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for cancel_creating_jobs_request::CreatingJobInfos {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"infos",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Infos,
}
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 {
"infos" => Ok(GeneratedField::Infos),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = cancel_creating_jobs_request::CreatingJobInfos;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.CancelCreatingJobsRequest.CreatingJobInfos")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<cancel_creating_jobs_request::CreatingJobInfos, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut infos__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Infos => {
if infos__.is_some() {
return Err(serde::de::Error::duplicate_field("infos"));
}
infos__ = Some(map_.next_value()?);
}
}
}
Ok(cancel_creating_jobs_request::CreatingJobInfos {
infos: infos__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.CancelCreatingJobsRequest.CreatingJobInfos", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CancelCreatingJobsResponse {
#[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;
}
if !self.canceled_jobs.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.CancelCreatingJobsResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if !self.canceled_jobs.is_empty() {
struct_ser.serialize_field("canceledJobs", &self.canceled_jobs)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CancelCreatingJobsResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"canceled_jobs",
"canceledJobs",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
CanceledJobs,
}
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),
"canceledJobs" | "canceled_jobs" => Ok(GeneratedField::CanceledJobs),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CancelCreatingJobsResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.CancelCreatingJobsResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CancelCreatingJobsResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut canceled_jobs__ = 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()?;
}
GeneratedField::CanceledJobs => {
if canceled_jobs__.is_some() {
return Err(serde::de::Error::duplicate_field("canceledJobs"));
}
canceled_jobs__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(CancelCreatingJobsResponse {
status: status__,
canceled_jobs: canceled_jobs__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.CancelCreatingJobsResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ClusterLimit {
#[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.limit.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ClusterLimit", len)?;
if let Some(v) = self.limit.as_ref() {
match v {
cluster_limit::Limit::ActorCount(v) => {
struct_ser.serialize_field("actorCount", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ClusterLimit {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"actor_count",
"actorCount",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ActorCount,
}
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 {
"actorCount" | "actor_count" => Ok(GeneratedField::ActorCount),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ClusterLimit;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ClusterLimit")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ClusterLimit, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut limit__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ActorCount => {
if limit__.is_some() {
return Err(serde::de::Error::duplicate_field("actorCount"));
}
limit__ = map_.next_value::<::std::option::Option<_>>()?.map(cluster_limit::Limit::ActorCount)
;
}
}
}
Ok(ClusterLimit {
limit: limit__,
})
}
}
deserializer.deserialize_struct("meta.ClusterLimit", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DeleteWorkerNodeRequest {
#[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.host.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.DeleteWorkerNodeRequest", len)?;
if let Some(v) = self.host.as_ref() {
struct_ser.serialize_field("host", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DeleteWorkerNodeRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"host",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Host,
}
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 {
"host" => Ok(GeneratedField::Host),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DeleteWorkerNodeRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.DeleteWorkerNodeRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DeleteWorkerNodeRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut host__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Host => {
if host__.is_some() {
return Err(serde::de::Error::duplicate_field("host"));
}
host__ = map_.next_value()?;
}
}
}
Ok(DeleteWorkerNodeRequest {
host: host__,
})
}
}
deserializer.deserialize_struct("meta.DeleteWorkerNodeRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DeleteWorkerNodeResponse {
#[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("meta.DeleteWorkerNodeResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DeleteWorkerNodeResponse {
#[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 = DeleteWorkerNodeResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.DeleteWorkerNodeResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DeleteWorkerNodeResponse, 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(DeleteWorkerNodeResponse {
status: status__,
})
}
}
deserializer.deserialize_struct("meta.DeleteWorkerNodeResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for EventLog {
#[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.unique_id.is_some() {
len += 1;
}
if self.timestamp.is_some() {
len += 1;
}
if self.event.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.EventLog", len)?;
if let Some(v) = self.unique_id.as_ref() {
struct_ser.serialize_field("uniqueId", v)?;
}
if let Some(v) = self.timestamp.as_ref() {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("timestamp", ToString::to_string(&v).as_str())?;
}
if let Some(v) = self.event.as_ref() {
match v {
event_log::Event::CreateStreamJobFail(v) => {
struct_ser.serialize_field("createStreamJobFail", v)?;
}
event_log::Event::DirtyStreamJobClear(v) => {
struct_ser.serialize_field("dirtyStreamJobClear", v)?;
}
event_log::Event::MetaNodeStart(v) => {
struct_ser.serialize_field("metaNodeStart", v)?;
}
event_log::Event::BarrierComplete(v) => {
struct_ser.serialize_field("barrierComplete", v)?;
}
event_log::Event::InjectBarrierFail(v) => {
struct_ser.serialize_field("injectBarrierFail", v)?;
}
event_log::Event::CollectBarrierFail(v) => {
struct_ser.serialize_field("collectBarrierFail", v)?;
}
event_log::Event::WorkerNodePanic(v) => {
struct_ser.serialize_field("workerNodePanic", v)?;
}
event_log::Event::AutoSchemaChangeFail(v) => {
struct_ser.serialize_field("autoSchemaChangeFail", v)?;
}
event_log::Event::SinkFail(v) => {
struct_ser.serialize_field("sinkFail", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for EventLog {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"unique_id",
"uniqueId",
"timestamp",
"create_stream_job_fail",
"createStreamJobFail",
"dirty_stream_job_clear",
"dirtyStreamJobClear",
"meta_node_start",
"metaNodeStart",
"barrier_complete",
"barrierComplete",
"inject_barrier_fail",
"injectBarrierFail",
"collect_barrier_fail",
"collectBarrierFail",
"worker_node_panic",
"workerNodePanic",
"auto_schema_change_fail",
"autoSchemaChangeFail",
"sink_fail",
"sinkFail",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
UniqueId,
Timestamp,
CreateStreamJobFail,
DirtyStreamJobClear,
MetaNodeStart,
BarrierComplete,
InjectBarrierFail,
CollectBarrierFail,
WorkerNodePanic,
AutoSchemaChangeFail,
SinkFail,
}
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 {
"uniqueId" | "unique_id" => Ok(GeneratedField::UniqueId),
"timestamp" => Ok(GeneratedField::Timestamp),
"createStreamJobFail" | "create_stream_job_fail" => Ok(GeneratedField::CreateStreamJobFail),
"dirtyStreamJobClear" | "dirty_stream_job_clear" => Ok(GeneratedField::DirtyStreamJobClear),
"metaNodeStart" | "meta_node_start" => Ok(GeneratedField::MetaNodeStart),
"barrierComplete" | "barrier_complete" => Ok(GeneratedField::BarrierComplete),
"injectBarrierFail" | "inject_barrier_fail" => Ok(GeneratedField::InjectBarrierFail),
"collectBarrierFail" | "collect_barrier_fail" => Ok(GeneratedField::CollectBarrierFail),
"workerNodePanic" | "worker_node_panic" => Ok(GeneratedField::WorkerNodePanic),
"autoSchemaChangeFail" | "auto_schema_change_fail" => Ok(GeneratedField::AutoSchemaChangeFail),
"sinkFail" | "sink_fail" => Ok(GeneratedField::SinkFail),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = EventLog;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.EventLog")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<EventLog, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut unique_id__ = None;
let mut timestamp__ = None;
let mut event__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::UniqueId => {
if unique_id__.is_some() {
return Err(serde::de::Error::duplicate_field("uniqueId"));
}
unique_id__ = map_.next_value()?;
}
GeneratedField::Timestamp => {
if timestamp__.is_some() {
return Err(serde::de::Error::duplicate_field("timestamp"));
}
timestamp__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::CreateStreamJobFail => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("createStreamJobFail"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(event_log::Event::CreateStreamJobFail)
;
}
GeneratedField::DirtyStreamJobClear => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("dirtyStreamJobClear"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(event_log::Event::DirtyStreamJobClear)
;
}
GeneratedField::MetaNodeStart => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("metaNodeStart"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(event_log::Event::MetaNodeStart)
;
}
GeneratedField::BarrierComplete => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("barrierComplete"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(event_log::Event::BarrierComplete)
;
}
GeneratedField::InjectBarrierFail => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("injectBarrierFail"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(event_log::Event::InjectBarrierFail)
;
}
GeneratedField::CollectBarrierFail => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("collectBarrierFail"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(event_log::Event::CollectBarrierFail)
;
}
GeneratedField::WorkerNodePanic => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("workerNodePanic"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(event_log::Event::WorkerNodePanic)
;
}
GeneratedField::AutoSchemaChangeFail => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("autoSchemaChangeFail"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(event_log::Event::AutoSchemaChangeFail)
;
}
GeneratedField::SinkFail => {
if event__.is_some() {
return Err(serde::de::Error::duplicate_field("sinkFail"));
}
event__ = map_.next_value::<::std::option::Option<_>>()?.map(event_log::Event::SinkFail)
;
}
}
}
Ok(EventLog {
unique_id: unique_id__,
timestamp: timestamp__,
event: event__,
})
}
}
deserializer.deserialize_struct("meta.EventLog", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for event_log::EventAutoSchemaChangeFail {
#[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.table_id != 0 {
len += 1;
}
if !self.table_name.is_empty() {
len += 1;
}
if !self.cdc_table_id.is_empty() {
len += 1;
}
if !self.upstream_ddl.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.EventLog.EventAutoSchemaChangeFail", len)?;
if self.table_id != 0 {
struct_ser.serialize_field("tableId", &self.table_id)?;
}
if !self.table_name.is_empty() {
struct_ser.serialize_field("tableName", &self.table_name)?;
}
if !self.cdc_table_id.is_empty() {
struct_ser.serialize_field("cdcTableId", &self.cdc_table_id)?;
}
if !self.upstream_ddl.is_empty() {
struct_ser.serialize_field("upstreamDdl", &self.upstream_ddl)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for event_log::EventAutoSchemaChangeFail {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table_id",
"tableId",
"table_name",
"tableName",
"cdc_table_id",
"cdcTableId",
"upstream_ddl",
"upstreamDdl",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableId,
TableName,
CdcTableId,
UpstreamDdl,
}
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 {
"tableId" | "table_id" => Ok(GeneratedField::TableId),
"tableName" | "table_name" => Ok(GeneratedField::TableName),
"cdcTableId" | "cdc_table_id" => Ok(GeneratedField::CdcTableId),
"upstreamDdl" | "upstream_ddl" => Ok(GeneratedField::UpstreamDdl),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = event_log::EventAutoSchemaChangeFail;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.EventLog.EventAutoSchemaChangeFail")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<event_log::EventAutoSchemaChangeFail, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_id__ = None;
let mut table_name__ = None;
let mut cdc_table_id__ = None;
let mut upstream_ddl__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TableId => {
if table_id__.is_some() {
return Err(serde::de::Error::duplicate_field("tableId"));
}
table_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TableName => {
if table_name__.is_some() {
return Err(serde::de::Error::duplicate_field("tableName"));
}
table_name__ = Some(map_.next_value()?);
}
GeneratedField::CdcTableId => {
if cdc_table_id__.is_some() {
return Err(serde::de::Error::duplicate_field("cdcTableId"));
}
cdc_table_id__ = Some(map_.next_value()?);
}
GeneratedField::UpstreamDdl => {
if upstream_ddl__.is_some() {
return Err(serde::de::Error::duplicate_field("upstreamDdl"));
}
upstream_ddl__ = Some(map_.next_value()?);
}
}
}
Ok(event_log::EventAutoSchemaChangeFail {
table_id: table_id__.unwrap_or_default(),
table_name: table_name__.unwrap_or_default(),
cdc_table_id: cdc_table_id__.unwrap_or_default(),
upstream_ddl: upstream_ddl__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.EventLog.EventAutoSchemaChangeFail", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for event_log::EventBarrierComplete {
#[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.prev_epoch != 0 {
len += 1;
}
if self.cur_epoch != 0 {
len += 1;
}
if self.duration_sec != 0. {
len += 1;
}
if !self.command.is_empty() {
len += 1;
}
if !self.barrier_kind.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.EventLog.EventBarrierComplete", len)?;
if self.prev_epoch != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("prevEpoch", ToString::to_string(&self.prev_epoch).as_str())?;
}
if self.cur_epoch != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("curEpoch", ToString::to_string(&self.cur_epoch).as_str())?;
}
if self.duration_sec != 0. {
struct_ser.serialize_field("durationSec", &self.duration_sec)?;
}
if !self.command.is_empty() {
struct_ser.serialize_field("command", &self.command)?;
}
if !self.barrier_kind.is_empty() {
struct_ser.serialize_field("barrierKind", &self.barrier_kind)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for event_log::EventBarrierComplete {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"prev_epoch",
"prevEpoch",
"cur_epoch",
"curEpoch",
"duration_sec",
"durationSec",
"command",
"barrier_kind",
"barrierKind",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
PrevEpoch,
CurEpoch,
DurationSec,
Command,
BarrierKind,
}
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 {
"prevEpoch" | "prev_epoch" => Ok(GeneratedField::PrevEpoch),
"curEpoch" | "cur_epoch" => Ok(GeneratedField::CurEpoch),
"durationSec" | "duration_sec" => Ok(GeneratedField::DurationSec),
"command" => Ok(GeneratedField::Command),
"barrierKind" | "barrier_kind" => Ok(GeneratedField::BarrierKind),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = event_log::EventBarrierComplete;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.EventLog.EventBarrierComplete")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<event_log::EventBarrierComplete, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut prev_epoch__ = None;
let mut cur_epoch__ = None;
let mut duration_sec__ = None;
let mut command__ = None;
let mut barrier_kind__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::PrevEpoch => {
if prev_epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("prevEpoch"));
}
prev_epoch__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::CurEpoch => {
if cur_epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("curEpoch"));
}
cur_epoch__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::DurationSec => {
if duration_sec__.is_some() {
return Err(serde::de::Error::duplicate_field("durationSec"));
}
duration_sec__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Command => {
if command__.is_some() {
return Err(serde::de::Error::duplicate_field("command"));
}
command__ = Some(map_.next_value()?);
}
GeneratedField::BarrierKind => {
if barrier_kind__.is_some() {
return Err(serde::de::Error::duplicate_field("barrierKind"));
}
barrier_kind__ = Some(map_.next_value()?);
}
}
}
Ok(event_log::EventBarrierComplete {
prev_epoch: prev_epoch__.unwrap_or_default(),
cur_epoch: cur_epoch__.unwrap_or_default(),
duration_sec: duration_sec__.unwrap_or_default(),
command: command__.unwrap_or_default(),
barrier_kind: barrier_kind__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.EventLog.EventBarrierComplete", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for event_log::EventCollectBarrierFail {
#[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.error.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.EventLog.EventCollectBarrierFail", len)?;
if !self.error.is_empty() {
struct_ser.serialize_field("error", &self.error)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for event_log::EventCollectBarrierFail {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"error",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Error,
}
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 {
"error" => Ok(GeneratedField::Error),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = event_log::EventCollectBarrierFail;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.EventLog.EventCollectBarrierFail")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<event_log::EventCollectBarrierFail, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut error__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Error => {
if error__.is_some() {
return Err(serde::de::Error::duplicate_field("error"));
}
error__ = Some(map_.next_value()?);
}
}
}
Ok(event_log::EventCollectBarrierFail {
error: error__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.EventLog.EventCollectBarrierFail", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for event_log::EventCreateStreamJobFail {
#[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.id != 0 {
len += 1;
}
if !self.name.is_empty() {
len += 1;
}
if !self.definition.is_empty() {
len += 1;
}
if !self.error.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.EventLog.EventCreateStreamJobFail", len)?;
if self.id != 0 {
struct_ser.serialize_field("id", &self.id)?;
}
if !self.name.is_empty() {
struct_ser.serialize_field("name", &self.name)?;
}
if !self.definition.is_empty() {
struct_ser.serialize_field("definition", &self.definition)?;
}
if !self.error.is_empty() {
struct_ser.serialize_field("error", &self.error)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for event_log::EventCreateStreamJobFail {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"id",
"name",
"definition",
"error",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Id,
Name,
Definition,
Error,
}
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 {
"id" => Ok(GeneratedField::Id),
"name" => Ok(GeneratedField::Name),
"definition" => Ok(GeneratedField::Definition),
"error" => Ok(GeneratedField::Error),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = event_log::EventCreateStreamJobFail;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.EventLog.EventCreateStreamJobFail")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<event_log::EventCreateStreamJobFail, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut id__ = None;
let mut name__ = None;
let mut definition__ = None;
let mut error__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Id => {
if id__.is_some() {
return Err(serde::de::Error::duplicate_field("id"));
}
id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Name => {
if name__.is_some() {
return Err(serde::de::Error::duplicate_field("name"));
}
name__ = Some(map_.next_value()?);
}
GeneratedField::Definition => {
if definition__.is_some() {
return Err(serde::de::Error::duplicate_field("definition"));
}
definition__ = Some(map_.next_value()?);
}
GeneratedField::Error => {
if error__.is_some() {
return Err(serde::de::Error::duplicate_field("error"));
}
error__ = Some(map_.next_value()?);
}
}
}
Ok(event_log::EventCreateStreamJobFail {
id: id__.unwrap_or_default(),
name: name__.unwrap_or_default(),
definition: definition__.unwrap_or_default(),
error: error__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.EventLog.EventCreateStreamJobFail", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for event_log::EventDirtyStreamJobClear {
#[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.id != 0 {
len += 1;
}
if !self.name.is_empty() {
len += 1;
}
if !self.definition.is_empty() {
len += 1;
}
if !self.error.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.EventLog.EventDirtyStreamJobClear", len)?;
if self.id != 0 {
struct_ser.serialize_field("id", &self.id)?;
}
if !self.name.is_empty() {
struct_ser.serialize_field("name", &self.name)?;
}
if !self.definition.is_empty() {
struct_ser.serialize_field("definition", &self.definition)?;
}
if !self.error.is_empty() {
struct_ser.serialize_field("error", &self.error)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for event_log::EventDirtyStreamJobClear {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"id",
"name",
"definition",
"error",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Id,
Name,
Definition,
Error,
}
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 {
"id" => Ok(GeneratedField::Id),
"name" => Ok(GeneratedField::Name),
"definition" => Ok(GeneratedField::Definition),
"error" => Ok(GeneratedField::Error),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = event_log::EventDirtyStreamJobClear;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.EventLog.EventDirtyStreamJobClear")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<event_log::EventDirtyStreamJobClear, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut id__ = None;
let mut name__ = None;
let mut definition__ = None;
let mut error__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Id => {
if id__.is_some() {
return Err(serde::de::Error::duplicate_field("id"));
}
id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Name => {
if name__.is_some() {
return Err(serde::de::Error::duplicate_field("name"));
}
name__ = Some(map_.next_value()?);
}
GeneratedField::Definition => {
if definition__.is_some() {
return Err(serde::de::Error::duplicate_field("definition"));
}
definition__ = Some(map_.next_value()?);
}
GeneratedField::Error => {
if error__.is_some() {
return Err(serde::de::Error::duplicate_field("error"));
}
error__ = Some(map_.next_value()?);
}
}
}
Ok(event_log::EventDirtyStreamJobClear {
id: id__.unwrap_or_default(),
name: name__.unwrap_or_default(),
definition: definition__.unwrap_or_default(),
error: error__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.EventLog.EventDirtyStreamJobClear", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for event_log::EventInjectBarrierFail {
#[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.prev_epoch != 0 {
len += 1;
}
if self.cur_epoch != 0 {
len += 1;
}
if !self.error.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.EventLog.EventInjectBarrierFail", len)?;
if self.prev_epoch != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("prevEpoch", ToString::to_string(&self.prev_epoch).as_str())?;
}
if self.cur_epoch != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("curEpoch", ToString::to_string(&self.cur_epoch).as_str())?;
}
if !self.error.is_empty() {
struct_ser.serialize_field("error", &self.error)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for event_log::EventInjectBarrierFail {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"prev_epoch",
"prevEpoch",
"cur_epoch",
"curEpoch",
"error",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
PrevEpoch,
CurEpoch,
Error,
}
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 {
"prevEpoch" | "prev_epoch" => Ok(GeneratedField::PrevEpoch),
"curEpoch" | "cur_epoch" => Ok(GeneratedField::CurEpoch),
"error" => Ok(GeneratedField::Error),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = event_log::EventInjectBarrierFail;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.EventLog.EventInjectBarrierFail")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<event_log::EventInjectBarrierFail, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut prev_epoch__ = None;
let mut cur_epoch__ = None;
let mut error__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::PrevEpoch => {
if prev_epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("prevEpoch"));
}
prev_epoch__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::CurEpoch => {
if cur_epoch__.is_some() {
return Err(serde::de::Error::duplicate_field("curEpoch"));
}
cur_epoch__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Error => {
if error__.is_some() {
return Err(serde::de::Error::duplicate_field("error"));
}
error__ = Some(map_.next_value()?);
}
}
}
Ok(event_log::EventInjectBarrierFail {
prev_epoch: prev_epoch__.unwrap_or_default(),
cur_epoch: cur_epoch__.unwrap_or_default(),
error: error__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.EventLog.EventInjectBarrierFail", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for event_log::EventMetaNodeStart {
#[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.advertise_addr.is_empty() {
len += 1;
}
if !self.listen_addr.is_empty() {
len += 1;
}
if !self.opts.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.EventLog.EventMetaNodeStart", len)?;
if !self.advertise_addr.is_empty() {
struct_ser.serialize_field("advertiseAddr", &self.advertise_addr)?;
}
if !self.listen_addr.is_empty() {
struct_ser.serialize_field("listenAddr", &self.listen_addr)?;
}
if !self.opts.is_empty() {
struct_ser.serialize_field("opts", &self.opts)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for event_log::EventMetaNodeStart {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"advertise_addr",
"advertiseAddr",
"listen_addr",
"listenAddr",
"opts",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
AdvertiseAddr,
ListenAddr,
Opts,
}
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 {
"advertiseAddr" | "advertise_addr" => Ok(GeneratedField::AdvertiseAddr),
"listenAddr" | "listen_addr" => Ok(GeneratedField::ListenAddr),
"opts" => Ok(GeneratedField::Opts),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = event_log::EventMetaNodeStart;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.EventLog.EventMetaNodeStart")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<event_log::EventMetaNodeStart, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut advertise_addr__ = None;
let mut listen_addr__ = None;
let mut opts__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::AdvertiseAddr => {
if advertise_addr__.is_some() {
return Err(serde::de::Error::duplicate_field("advertiseAddr"));
}
advertise_addr__ = Some(map_.next_value()?);
}
GeneratedField::ListenAddr => {
if listen_addr__.is_some() {
return Err(serde::de::Error::duplicate_field("listenAddr"));
}
listen_addr__ = Some(map_.next_value()?);
}
GeneratedField::Opts => {
if opts__.is_some() {
return Err(serde::de::Error::duplicate_field("opts"));
}
opts__ = Some(map_.next_value()?);
}
}
}
Ok(event_log::EventMetaNodeStart {
advertise_addr: advertise_addr__.unwrap_or_default(),
listen_addr: listen_addr__.unwrap_or_default(),
opts: opts__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.EventLog.EventMetaNodeStart", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for event_log::EventSinkFail {
#[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.sink_id != 0 {
len += 1;
}
if !self.sink_name.is_empty() {
len += 1;
}
if !self.connector.is_empty() {
len += 1;
}
if !self.error.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.EventLog.EventSinkFail", len)?;
if self.sink_id != 0 {
struct_ser.serialize_field("sinkId", &self.sink_id)?;
}
if !self.sink_name.is_empty() {
struct_ser.serialize_field("sinkName", &self.sink_name)?;
}
if !self.connector.is_empty() {
struct_ser.serialize_field("connector", &self.connector)?;
}
if !self.error.is_empty() {
struct_ser.serialize_field("error", &self.error)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for event_log::EventSinkFail {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"sink_id",
"sinkId",
"sink_name",
"sinkName",
"connector",
"error",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SinkId,
SinkName,
Connector,
Error,
}
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 {
"sinkId" | "sink_id" => Ok(GeneratedField::SinkId),
"sinkName" | "sink_name" => Ok(GeneratedField::SinkName),
"connector" => Ok(GeneratedField::Connector),
"error" => Ok(GeneratedField::Error),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = event_log::EventSinkFail;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.EventLog.EventSinkFail")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<event_log::EventSinkFail, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut sink_id__ = None;
let mut sink_name__ = None;
let mut connector__ = None;
let mut error__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::SinkId => {
if sink_id__.is_some() {
return Err(serde::de::Error::duplicate_field("sinkId"));
}
sink_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::SinkName => {
if sink_name__.is_some() {
return Err(serde::de::Error::duplicate_field("sinkName"));
}
sink_name__ = Some(map_.next_value()?);
}
GeneratedField::Connector => {
if connector__.is_some() {
return Err(serde::de::Error::duplicate_field("connector"));
}
connector__ = Some(map_.next_value()?);
}
GeneratedField::Error => {
if error__.is_some() {
return Err(serde::de::Error::duplicate_field("error"));
}
error__ = Some(map_.next_value()?);
}
}
}
Ok(event_log::EventSinkFail {
sink_id: sink_id__.unwrap_or_default(),
sink_name: sink_name__.unwrap_or_default(),
connector: connector__.unwrap_or_default(),
error: error__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.EventLog.EventSinkFail", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for event_log::EventWorkerNodePanic {
#[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.worker_id != 0 {
len += 1;
}
if self.worker_type != 0 {
len += 1;
}
if self.host_addr.is_some() {
len += 1;
}
if !self.panic_info.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.EventLog.EventWorkerNodePanic", len)?;
if self.worker_id != 0 {
struct_ser.serialize_field("workerId", &self.worker_id)?;
}
if self.worker_type != 0 {
let v = super::common::WorkerType::try_from(self.worker_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.worker_type)))?;
struct_ser.serialize_field("workerType", &v)?;
}
if let Some(v) = self.host_addr.as_ref() {
struct_ser.serialize_field("hostAddr", v)?;
}
if !self.panic_info.is_empty() {
struct_ser.serialize_field("panicInfo", &self.panic_info)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for event_log::EventWorkerNodePanic {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"worker_id",
"workerId",
"worker_type",
"workerType",
"host_addr",
"hostAddr",
"panic_info",
"panicInfo",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
WorkerId,
WorkerType,
HostAddr,
PanicInfo,
}
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 {
"workerId" | "worker_id" => Ok(GeneratedField::WorkerId),
"workerType" | "worker_type" => Ok(GeneratedField::WorkerType),
"hostAddr" | "host_addr" => Ok(GeneratedField::HostAddr),
"panicInfo" | "panic_info" => Ok(GeneratedField::PanicInfo),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = event_log::EventWorkerNodePanic;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.EventLog.EventWorkerNodePanic")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<event_log::EventWorkerNodePanic, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut worker_id__ = None;
let mut worker_type__ = None;
let mut host_addr__ = None;
let mut panic_info__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::WorkerId => {
if worker_id__.is_some() {
return Err(serde::de::Error::duplicate_field("workerId"));
}
worker_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::WorkerType => {
if worker_type__.is_some() {
return Err(serde::de::Error::duplicate_field("workerType"));
}
worker_type__ = Some(map_.next_value::<super::common::WorkerType>()? as i32);
}
GeneratedField::HostAddr => {
if host_addr__.is_some() {
return Err(serde::de::Error::duplicate_field("hostAddr"));
}
host_addr__ = map_.next_value()?;
}
GeneratedField::PanicInfo => {
if panic_info__.is_some() {
return Err(serde::de::Error::duplicate_field("panicInfo"));
}
panic_info__ = Some(map_.next_value()?);
}
}
}
Ok(event_log::EventWorkerNodePanic {
worker_id: worker_id__.unwrap_or_default(),
worker_type: worker_type__.unwrap_or_default(),
host_addr: host_addr__,
panic_info: panic_info__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.EventLog.EventWorkerNodePanic", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for FlushRequest {
#[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.database_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.FlushRequest", len)?;
if self.database_id != 0 {
struct_ser.serialize_field("databaseId", &self.database_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for FlushRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"database_id",
"databaseId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
DatabaseId,
}
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 {
"databaseId" | "database_id" => Ok(GeneratedField::DatabaseId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = FlushRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.FlushRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<FlushRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut database_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::DatabaseId => {
if database_id__.is_some() {
return Err(serde::de::Error::duplicate_field("databaseId"));
}
database_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(FlushRequest {
database_id: database_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.FlushRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for FlushResponse {
#[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;
}
if self.hummock_version_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.FlushResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if self.hummock_version_id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("hummockVersionId", ToString::to_string(&self.hummock_version_id).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for FlushResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"hummock_version_id",
"hummockVersionId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
HummockVersionId,
}
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),
"hummockVersionId" | "hummock_version_id" => Ok(GeneratedField::HummockVersionId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = FlushResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.FlushResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<FlushResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut hummock_version_id__ = 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()?;
}
GeneratedField::HummockVersionId => {
if hummock_version_id__.is_some() {
return Err(serde::de::Error::duplicate_field("hummockVersionId"));
}
hummock_version_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(FlushResponse {
status: status__,
hummock_version_id: hummock_version_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.FlushResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for FragmentIdToActorIdMap {
#[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.map.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.FragmentIdToActorIdMap", len)?;
if !self.map.is_empty() {
struct_ser.serialize_field("map", &self.map)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for FragmentIdToActorIdMap {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"map",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Map,
}
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 {
"map" => Ok(GeneratedField::Map),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = FragmentIdToActorIdMap;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.FragmentIdToActorIdMap")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<FragmentIdToActorIdMap, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut map__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Map => {
if map__.is_some() {
return Err(serde::de::Error::duplicate_field("map"));
}
map__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
}
}
Ok(FragmentIdToActorIdMap {
map: map__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.FragmentIdToActorIdMap", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for FragmentVertexToRelationMap {
#[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.in_map.is_empty() {
len += 1;
}
if !self.out_map.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.FragmentVertexToRelationMap", len)?;
if !self.in_map.is_empty() {
struct_ser.serialize_field("inMap", &self.in_map)?;
}
if !self.out_map.is_empty() {
struct_ser.serialize_field("outMap", &self.out_map)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for FragmentVertexToRelationMap {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"in_map",
"inMap",
"out_map",
"outMap",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
InMap,
OutMap,
}
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 {
"inMap" | "in_map" => Ok(GeneratedField::InMap),
"outMap" | "out_map" => Ok(GeneratedField::OutMap),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = FragmentVertexToRelationMap;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.FragmentVertexToRelationMap")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<FragmentVertexToRelationMap, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut in_map__ = None;
let mut out_map__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::InMap => {
if in_map__.is_some() {
return Err(serde::de::Error::duplicate_field("inMap"));
}
in_map__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, ::pbjson::private::NumberDeserialize<u32>>>()?
.into_iter().map(|(k,v)| (k.0, v.0)).collect()
);
}
GeneratedField::OutMap => {
if out_map__.is_some() {
return Err(serde::de::Error::duplicate_field("outMap"));
}
out_map__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, ::pbjson::private::NumberDeserialize<u32>>>()?
.into_iter().map(|(k,v)| (k.0, v.0)).collect()
);
}
}
}
Ok(FragmentVertexToRelationMap {
in_map: in_map__.unwrap_or_default(),
out_map: out_map__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.FragmentVertexToRelationMap", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for FragmentWorkerSlotMapping {
#[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.fragment_id != 0 {
len += 1;
}
if self.mapping.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.FragmentWorkerSlotMapping", len)?;
if self.fragment_id != 0 {
struct_ser.serialize_field("fragmentId", &self.fragment_id)?;
}
if let Some(v) = self.mapping.as_ref() {
struct_ser.serialize_field("mapping", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for FragmentWorkerSlotMapping {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"fragment_id",
"fragmentId",
"mapping",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
FragmentId,
Mapping,
}
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 {
"fragmentId" | "fragment_id" => Ok(GeneratedField::FragmentId),
"mapping" => Ok(GeneratedField::Mapping),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = FragmentWorkerSlotMapping;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.FragmentWorkerSlotMapping")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<FragmentWorkerSlotMapping, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut fragment_id__ = None;
let mut mapping__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::FragmentId => {
if fragment_id__.is_some() {
return Err(serde::de::Error::duplicate_field("fragmentId"));
}
fragment_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Mapping => {
if mapping__.is_some() {
return Err(serde::de::Error::duplicate_field("mapping"));
}
mapping__ = map_.next_value()?;
}
}
}
Ok(FragmentWorkerSlotMapping {
fragment_id: fragment_id__.unwrap_or_default(),
mapping: mapping__,
})
}
}
deserializer.deserialize_struct("meta.FragmentWorkerSlotMapping", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for FragmentWorkerSlotMappings {
#[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.mappings.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.FragmentWorkerSlotMappings", len)?;
if !self.mappings.is_empty() {
struct_ser.serialize_field("mappings", &self.mappings)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for FragmentWorkerSlotMappings {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"mappings",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Mappings,
}
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 {
"mappings" => Ok(GeneratedField::Mappings),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = FragmentWorkerSlotMappings;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.FragmentWorkerSlotMappings")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<FragmentWorkerSlotMappings, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut mappings__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Mappings => {
if mappings__.is_some() {
return Err(serde::de::Error::duplicate_field("mappings"));
}
mappings__ = Some(map_.next_value()?);
}
}
}
Ok(FragmentWorkerSlotMappings {
mappings: mappings__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.FragmentWorkerSlotMappings", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetClusterInfoRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.GetClusterInfoRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetClusterInfoRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetClusterInfoRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.GetClusterInfoRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetClusterInfoRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(GetClusterInfoRequest {
})
}
}
deserializer.deserialize_struct("meta.GetClusterInfoRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetClusterInfoResponse {
#[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.worker_nodes.is_empty() {
len += 1;
}
if !self.table_fragments.is_empty() {
len += 1;
}
if !self.actor_splits.is_empty() {
len += 1;
}
if !self.source_infos.is_empty() {
len += 1;
}
if self.revision != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.GetClusterInfoResponse", len)?;
if !self.worker_nodes.is_empty() {
struct_ser.serialize_field("workerNodes", &self.worker_nodes)?;
}
if !self.table_fragments.is_empty() {
struct_ser.serialize_field("tableFragments", &self.table_fragments)?;
}
if !self.actor_splits.is_empty() {
struct_ser.serialize_field("actorSplits", &self.actor_splits)?;
}
if !self.source_infos.is_empty() {
struct_ser.serialize_field("sourceInfos", &self.source_infos)?;
}
if self.revision != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("revision", ToString::to_string(&self.revision).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetClusterInfoResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"worker_nodes",
"workerNodes",
"table_fragments",
"tableFragments",
"actor_splits",
"actorSplits",
"source_infos",
"sourceInfos",
"revision",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
WorkerNodes,
TableFragments,
ActorSplits,
SourceInfos,
Revision,
}
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 {
"workerNodes" | "worker_nodes" => Ok(GeneratedField::WorkerNodes),
"tableFragments" | "table_fragments" => Ok(GeneratedField::TableFragments),
"actorSplits" | "actor_splits" => Ok(GeneratedField::ActorSplits),
"sourceInfos" | "source_infos" => Ok(GeneratedField::SourceInfos),
"revision" => Ok(GeneratedField::Revision),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetClusterInfoResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.GetClusterInfoResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetClusterInfoResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut worker_nodes__ = None;
let mut table_fragments__ = None;
let mut actor_splits__ = None;
let mut source_infos__ = None;
let mut revision__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::WorkerNodes => {
if worker_nodes__.is_some() {
return Err(serde::de::Error::duplicate_field("workerNodes"));
}
worker_nodes__ = Some(map_.next_value()?);
}
GeneratedField::TableFragments => {
if table_fragments__.is_some() {
return Err(serde::de::Error::duplicate_field("tableFragments"));
}
table_fragments__ = Some(map_.next_value()?);
}
GeneratedField::ActorSplits => {
if actor_splits__.is_some() {
return Err(serde::de::Error::duplicate_field("actorSplits"));
}
actor_splits__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::SourceInfos => {
if source_infos__.is_some() {
return Err(serde::de::Error::duplicate_field("sourceInfos"));
}
source_infos__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::Revision => {
if revision__.is_some() {
return Err(serde::de::Error::duplicate_field("revision"));
}
revision__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(GetClusterInfoResponse {
worker_nodes: worker_nodes__.unwrap_or_default(),
table_fragments: table_fragments__.unwrap_or_default(),
actor_splits: actor_splits__.unwrap_or_default(),
source_infos: source_infos__.unwrap_or_default(),
revision: revision__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.GetClusterInfoResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetClusterLimitsRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.GetClusterLimitsRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetClusterLimitsRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetClusterLimitsRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.GetClusterLimitsRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetClusterLimitsRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(GetClusterLimitsRequest {
})
}
}
deserializer.deserialize_struct("meta.GetClusterLimitsRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetClusterLimitsResponse {
#[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.active_limits.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.GetClusterLimitsResponse", len)?;
if !self.active_limits.is_empty() {
struct_ser.serialize_field("activeLimits", &self.active_limits)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetClusterLimitsResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"active_limits",
"activeLimits",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ActiveLimits,
}
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 {
"activeLimits" | "active_limits" => Ok(GeneratedField::ActiveLimits),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetClusterLimitsResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.GetClusterLimitsResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetClusterLimitsResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut active_limits__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ActiveLimits => {
if active_limits__.is_some() {
return Err(serde::de::Error::duplicate_field("activeLimits"));
}
active_limits__ = Some(map_.next_value()?);
}
}
}
Ok(GetClusterLimitsResponse {
active_limits: active_limits__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.GetClusterLimitsResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetClusterRecoveryStatusRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.GetClusterRecoveryStatusRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetClusterRecoveryStatusRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetClusterRecoveryStatusRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.GetClusterRecoveryStatusRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetClusterRecoveryStatusRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(GetClusterRecoveryStatusRequest {
})
}
}
deserializer.deserialize_struct("meta.GetClusterRecoveryStatusRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetClusterRecoveryStatusResponse {
#[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 != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.GetClusterRecoveryStatusResponse", len)?;
if self.status != 0 {
let v = RecoveryStatus::try_from(self.status)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.status)))?;
struct_ser.serialize_field("status", &v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetClusterRecoveryStatusResponse {
#[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 = GetClusterRecoveryStatusResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.GetClusterRecoveryStatusResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetClusterRecoveryStatusResponse, 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__ = Some(map_.next_value::<RecoveryStatus>()? as i32);
}
}
}
Ok(GetClusterRecoveryStatusResponse {
status: status__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.GetClusterRecoveryStatusResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetServerlessStreamingJobsStatusRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.GetServerlessStreamingJobsStatusRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetServerlessStreamingJobsStatusRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetServerlessStreamingJobsStatusRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.GetServerlessStreamingJobsStatusRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetServerlessStreamingJobsStatusRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(GetServerlessStreamingJobsStatusRequest {
})
}
}
deserializer.deserialize_struct("meta.GetServerlessStreamingJobsStatusRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetServerlessStreamingJobsStatusResponse {
#[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.streaming_job_statuses.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.GetServerlessStreamingJobsStatusResponse", len)?;
if !self.streaming_job_statuses.is_empty() {
struct_ser.serialize_field("streamingJobStatuses", &self.streaming_job_statuses)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetServerlessStreamingJobsStatusResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"streaming_job_statuses",
"streamingJobStatuses",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
StreamingJobStatuses,
}
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 {
"streamingJobStatuses" | "streaming_job_statuses" => Ok(GeneratedField::StreamingJobStatuses),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetServerlessStreamingJobsStatusResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.GetServerlessStreamingJobsStatusResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetServerlessStreamingJobsStatusResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut streaming_job_statuses__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::StreamingJobStatuses => {
if streaming_job_statuses__.is_some() {
return Err(serde::de::Error::duplicate_field("streamingJobStatuses"));
}
streaming_job_statuses__ = Some(map_.next_value()?);
}
}
}
Ok(GetServerlessStreamingJobsStatusResponse {
streaming_job_statuses: streaming_job_statuses__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.GetServerlessStreamingJobsStatusResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for get_serverless_streaming_jobs_status_response::Status {
#[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.table_id != 0 {
len += 1;
}
if !self.node_label.is_empty() {
len += 1;
}
if self.backfill_done {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.GetServerlessStreamingJobsStatusResponse.Status", len)?;
if self.table_id != 0 {
struct_ser.serialize_field("tableId", &self.table_id)?;
}
if !self.node_label.is_empty() {
struct_ser.serialize_field("nodeLabel", &self.node_label)?;
}
if self.backfill_done {
struct_ser.serialize_field("backfillDone", &self.backfill_done)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for get_serverless_streaming_jobs_status_response::Status {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table_id",
"tableId",
"node_label",
"nodeLabel",
"backfill_done",
"backfillDone",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableId,
NodeLabel,
BackfillDone,
}
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 {
"tableId" | "table_id" => Ok(GeneratedField::TableId),
"nodeLabel" | "node_label" => Ok(GeneratedField::NodeLabel),
"backfillDone" | "backfill_done" => Ok(GeneratedField::BackfillDone),
_ => 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_serverless_streaming_jobs_status_response::Status;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.GetServerlessStreamingJobsStatusResponse.Status")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<get_serverless_streaming_jobs_status_response::Status, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_id__ = None;
let mut node_label__ = None;
let mut backfill_done__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TableId => {
if table_id__.is_some() {
return Err(serde::de::Error::duplicate_field("tableId"));
}
table_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::NodeLabel => {
if node_label__.is_some() {
return Err(serde::de::Error::duplicate_field("nodeLabel"));
}
node_label__ = Some(map_.next_value()?);
}
GeneratedField::BackfillDone => {
if backfill_done__.is_some() {
return Err(serde::de::Error::duplicate_field("backfillDone"));
}
backfill_done__ = Some(map_.next_value()?);
}
}
}
Ok(get_serverless_streaming_jobs_status_response::Status {
table_id: table_id__.unwrap_or_default(),
node_label: node_label__.unwrap_or_default(),
backfill_done: backfill_done__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.GetServerlessStreamingJobsStatusResponse.Status", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetServingVnodeMappingsRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.GetServingVnodeMappingsRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetServingVnodeMappingsRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetServingVnodeMappingsRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.GetServingVnodeMappingsRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetServingVnodeMappingsRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(GetServingVnodeMappingsRequest {
})
}
}
deserializer.deserialize_struct("meta.GetServingVnodeMappingsRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetServingVnodeMappingsResponse {
#[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.fragment_to_table.is_empty() {
len += 1;
}
if !self.worker_slot_mappings.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.GetServingVnodeMappingsResponse", len)?;
if !self.fragment_to_table.is_empty() {
struct_ser.serialize_field("fragmentToTable", &self.fragment_to_table)?;
}
if !self.worker_slot_mappings.is_empty() {
struct_ser.serialize_field("workerSlotMappings", &self.worker_slot_mappings)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetServingVnodeMappingsResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"fragment_to_table",
"fragmentToTable",
"worker_slot_mappings",
"workerSlotMappings",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
FragmentToTable,
WorkerSlotMappings,
}
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 {
"fragmentToTable" | "fragment_to_table" => Ok(GeneratedField::FragmentToTable),
"workerSlotMappings" | "worker_slot_mappings" => Ok(GeneratedField::WorkerSlotMappings),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetServingVnodeMappingsResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.GetServingVnodeMappingsResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetServingVnodeMappingsResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut fragment_to_table__ = None;
let mut worker_slot_mappings__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::FragmentToTable => {
if fragment_to_table__.is_some() {
return Err(serde::de::Error::duplicate_field("fragmentToTable"));
}
fragment_to_table__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, ::pbjson::private::NumberDeserialize<u32>>>()?
.into_iter().map(|(k,v)| (k.0, v.0)).collect()
);
}
GeneratedField::WorkerSlotMappings => {
if worker_slot_mappings__.is_some() {
return Err(serde::de::Error::duplicate_field("workerSlotMappings"));
}
worker_slot_mappings__ = Some(map_.next_value()?);
}
}
}
Ok(GetServingVnodeMappingsResponse {
fragment_to_table: fragment_to_table__.unwrap_or_default(),
worker_slot_mappings: worker_slot_mappings__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.GetServingVnodeMappingsResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetSessionParamsRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.GetSessionParamsRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetSessionParamsRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetSessionParamsRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.GetSessionParamsRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetSessionParamsRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(GetSessionParamsRequest {
})
}
}
deserializer.deserialize_struct("meta.GetSessionParamsRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetSessionParamsResponse {
#[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.params.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.GetSessionParamsResponse", len)?;
if !self.params.is_empty() {
struct_ser.serialize_field("params", &self.params)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetSessionParamsResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"params",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Params,
}
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 {
"params" => Ok(GeneratedField::Params),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetSessionParamsResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.GetSessionParamsResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetSessionParamsResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut params__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Params => {
if params__.is_some() {
return Err(serde::de::Error::duplicate_field("params"));
}
params__ = Some(map_.next_value()?);
}
}
}
Ok(GetSessionParamsResponse {
params: params__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.GetSessionParamsResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetSystemParamsRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.GetSystemParamsRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetSystemParamsRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetSystemParamsRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.GetSystemParamsRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetSystemParamsRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(GetSystemParamsRequest {
})
}
}
deserializer.deserialize_struct("meta.GetSystemParamsRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetSystemParamsResponse {
#[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.params.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.GetSystemParamsResponse", len)?;
if let Some(v) = self.params.as_ref() {
struct_ser.serialize_field("params", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetSystemParamsResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"params",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Params,
}
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 {
"params" => Ok(GeneratedField::Params),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetSystemParamsResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.GetSystemParamsResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetSystemParamsResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut params__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Params => {
if params__.is_some() {
return Err(serde::de::Error::duplicate_field("params"));
}
params__ = map_.next_value()?;
}
}
}
Ok(GetSystemParamsResponse {
params: params__,
})
}
}
deserializer.deserialize_struct("meta.GetSystemParamsResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetTelemetryInfoRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.GetTelemetryInfoRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetTelemetryInfoRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetTelemetryInfoRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.GetTelemetryInfoRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetTelemetryInfoRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(GetTelemetryInfoRequest {
})
}
}
deserializer.deserialize_struct("meta.GetTelemetryInfoRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for HeartbeatRequest {
#[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.node_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.HeartbeatRequest", len)?;
if self.node_id != 0 {
struct_ser.serialize_field("nodeId", &self.node_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for HeartbeatRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"node_id",
"nodeId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
NodeId,
}
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 {
"nodeId" | "node_id" => Ok(GeneratedField::NodeId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = HeartbeatRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.HeartbeatRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<HeartbeatRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut node_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::NodeId => {
if node_id__.is_some() {
return Err(serde::de::Error::duplicate_field("nodeId"));
}
node_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(HeartbeatRequest {
node_id: node_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.HeartbeatRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for HeartbeatResponse {
#[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("meta.HeartbeatResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for HeartbeatResponse {
#[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 = HeartbeatResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.HeartbeatResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<HeartbeatResponse, 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(HeartbeatResponse {
status: status__,
})
}
}
deserializer.deserialize_struct("meta.HeartbeatResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListActorSplitsRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.ListActorSplitsRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListActorSplitsRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListActorSplitsRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListActorSplitsRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListActorSplitsRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(ListActorSplitsRequest {
})
}
}
deserializer.deserialize_struct("meta.ListActorSplitsRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListActorSplitsResponse {
#[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.actor_splits.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ListActorSplitsResponse", len)?;
if !self.actor_splits.is_empty() {
struct_ser.serialize_field("actorSplits", &self.actor_splits)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListActorSplitsResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"actor_splits",
"actorSplits",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ActorSplits,
}
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 {
"actorSplits" | "actor_splits" => Ok(GeneratedField::ActorSplits),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListActorSplitsResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListActorSplitsResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListActorSplitsResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut actor_splits__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ActorSplits => {
if actor_splits__.is_some() {
return Err(serde::de::Error::duplicate_field("actorSplits"));
}
actor_splits__ = Some(map_.next_value()?);
}
}
}
Ok(ListActorSplitsResponse {
actor_splits: actor_splits__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ListActorSplitsResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for list_actor_splits_response::ActorSplit {
#[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.actor_id != 0 {
len += 1;
}
if self.fragment_id != 0 {
len += 1;
}
if self.source_id != 0 {
len += 1;
}
if !self.split_id.is_empty() {
len += 1;
}
if self.fragment_type != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ListActorSplitsResponse.ActorSplit", len)?;
if self.actor_id != 0 {
struct_ser.serialize_field("actorId", &self.actor_id)?;
}
if self.fragment_id != 0 {
struct_ser.serialize_field("fragmentId", &self.fragment_id)?;
}
if self.source_id != 0 {
struct_ser.serialize_field("sourceId", &self.source_id)?;
}
if !self.split_id.is_empty() {
struct_ser.serialize_field("splitId", &self.split_id)?;
}
if self.fragment_type != 0 {
let v = list_actor_splits_response::FragmentType::try_from(self.fragment_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.fragment_type)))?;
struct_ser.serialize_field("fragmentType", &v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for list_actor_splits_response::ActorSplit {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"actor_id",
"actorId",
"fragment_id",
"fragmentId",
"source_id",
"sourceId",
"split_id",
"splitId",
"fragment_type",
"fragmentType",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ActorId,
FragmentId,
SourceId,
SplitId,
FragmentType,
}
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 {
"actorId" | "actor_id" => Ok(GeneratedField::ActorId),
"fragmentId" | "fragment_id" => Ok(GeneratedField::FragmentId),
"sourceId" | "source_id" => Ok(GeneratedField::SourceId),
"splitId" | "split_id" => Ok(GeneratedField::SplitId),
"fragmentType" | "fragment_type" => Ok(GeneratedField::FragmentType),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = list_actor_splits_response::ActorSplit;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListActorSplitsResponse.ActorSplit")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<list_actor_splits_response::ActorSplit, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut actor_id__ = None;
let mut fragment_id__ = None;
let mut source_id__ = None;
let mut split_id__ = None;
let mut fragment_type__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ActorId => {
if actor_id__.is_some() {
return Err(serde::de::Error::duplicate_field("actorId"));
}
actor_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::FragmentId => {
if fragment_id__.is_some() {
return Err(serde::de::Error::duplicate_field("fragmentId"));
}
fragment_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::SourceId => {
if source_id__.is_some() {
return Err(serde::de::Error::duplicate_field("sourceId"));
}
source_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::SplitId => {
if split_id__.is_some() {
return Err(serde::de::Error::duplicate_field("splitId"));
}
split_id__ = Some(map_.next_value()?);
}
GeneratedField::FragmentType => {
if fragment_type__.is_some() {
return Err(serde::de::Error::duplicate_field("fragmentType"));
}
fragment_type__ = Some(map_.next_value::<list_actor_splits_response::FragmentType>()? as i32);
}
}
}
Ok(list_actor_splits_response::ActorSplit {
actor_id: actor_id__.unwrap_or_default(),
fragment_id: fragment_id__.unwrap_or_default(),
source_id: source_id__.unwrap_or_default(),
split_id: split_id__.unwrap_or_default(),
fragment_type: fragment_type__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ListActorSplitsResponse.ActorSplit", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for list_actor_splits_response::FragmentType {
#[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::NonSharedSource => "NON_SHARED_SOURCE",
Self::SharedSource => "SHARED_SOURCE",
Self::SharedSourceBackfill => "SHARED_SOURCE_BACKFILL",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for list_actor_splits_response::FragmentType {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"UNSPECIFIED",
"NON_SHARED_SOURCE",
"SHARED_SOURCE",
"SHARED_SOURCE_BACKFILL",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = list_actor_splits_response::FragmentType;
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(list_actor_splits_response::FragmentType::Unspecified),
"NON_SHARED_SOURCE" => Ok(list_actor_splits_response::FragmentType::NonSharedSource),
"SHARED_SOURCE" => Ok(list_actor_splits_response::FragmentType::SharedSource),
"SHARED_SOURCE_BACKFILL" => Ok(list_actor_splits_response::FragmentType::SharedSourceBackfill),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for ListActorStatesRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.ListActorStatesRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListActorStatesRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListActorStatesRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListActorStatesRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListActorStatesRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(ListActorStatesRequest {
})
}
}
deserializer.deserialize_struct("meta.ListActorStatesRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListActorStatesResponse {
#[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.states.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ListActorStatesResponse", len)?;
if !self.states.is_empty() {
struct_ser.serialize_field("states", &self.states)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListActorStatesResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"states",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
States,
}
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 {
"states" => Ok(GeneratedField::States),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListActorStatesResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListActorStatesResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListActorStatesResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut states__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::States => {
if states__.is_some() {
return Err(serde::de::Error::duplicate_field("states"));
}
states__ = Some(map_.next_value()?);
}
}
}
Ok(ListActorStatesResponse {
states: states__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ListActorStatesResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for list_actor_states_response::ActorState {
#[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.actor_id != 0 {
len += 1;
}
if self.fragment_id != 0 {
len += 1;
}
if self.state != 0 {
len += 1;
}
if self.worker_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ListActorStatesResponse.ActorState", len)?;
if self.actor_id != 0 {
struct_ser.serialize_field("actorId", &self.actor_id)?;
}
if self.fragment_id != 0 {
struct_ser.serialize_field("fragmentId", &self.fragment_id)?;
}
if self.state != 0 {
let v = table_fragments::actor_status::ActorState::try_from(self.state)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.state)))?;
struct_ser.serialize_field("state", &v)?;
}
if self.worker_id != 0 {
struct_ser.serialize_field("workerId", &self.worker_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for list_actor_states_response::ActorState {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"actor_id",
"actorId",
"fragment_id",
"fragmentId",
"state",
"worker_id",
"workerId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ActorId,
FragmentId,
State,
WorkerId,
}
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 {
"actorId" | "actor_id" => Ok(GeneratedField::ActorId),
"fragmentId" | "fragment_id" => Ok(GeneratedField::FragmentId),
"state" => Ok(GeneratedField::State),
"workerId" | "worker_id" => Ok(GeneratedField::WorkerId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = list_actor_states_response::ActorState;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListActorStatesResponse.ActorState")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<list_actor_states_response::ActorState, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut actor_id__ = None;
let mut fragment_id__ = None;
let mut state__ = None;
let mut worker_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ActorId => {
if actor_id__.is_some() {
return Err(serde::de::Error::duplicate_field("actorId"));
}
actor_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::FragmentId => {
if fragment_id__.is_some() {
return Err(serde::de::Error::duplicate_field("fragmentId"));
}
fragment_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::State => {
if state__.is_some() {
return Err(serde::de::Error::duplicate_field("state"));
}
state__ = Some(map_.next_value::<table_fragments::actor_status::ActorState>()? as i32);
}
GeneratedField::WorkerId => {
if worker_id__.is_some() {
return Err(serde::de::Error::duplicate_field("workerId"));
}
worker_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(list_actor_states_response::ActorState {
actor_id: actor_id__.unwrap_or_default(),
fragment_id: fragment_id__.unwrap_or_default(),
state: state__.unwrap_or_default(),
worker_id: worker_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ListActorStatesResponse.ActorState", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListAllNodesRequest {
#[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.worker_type.is_some() {
len += 1;
}
if self.include_starting_nodes {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ListAllNodesRequest", len)?;
if let Some(v) = self.worker_type.as_ref() {
let v = super::common::WorkerType::try_from(*v)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", *v)))?;
struct_ser.serialize_field("workerType", &v)?;
}
if self.include_starting_nodes {
struct_ser.serialize_field("includeStartingNodes", &self.include_starting_nodes)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListAllNodesRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"worker_type",
"workerType",
"include_starting_nodes",
"includeStartingNodes",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
WorkerType,
IncludeStartingNodes,
}
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 {
"workerType" | "worker_type" => Ok(GeneratedField::WorkerType),
"includeStartingNodes" | "include_starting_nodes" => Ok(GeneratedField::IncludeStartingNodes),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListAllNodesRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListAllNodesRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListAllNodesRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut worker_type__ = None;
let mut include_starting_nodes__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::WorkerType => {
if worker_type__.is_some() {
return Err(serde::de::Error::duplicate_field("workerType"));
}
worker_type__ = map_.next_value::<::std::option::Option<super::common::WorkerType>>()?.map(|x| x as i32);
}
GeneratedField::IncludeStartingNodes => {
if include_starting_nodes__.is_some() {
return Err(serde::de::Error::duplicate_field("includeStartingNodes"));
}
include_starting_nodes__ = Some(map_.next_value()?);
}
}
}
Ok(ListAllNodesRequest {
worker_type: worker_type__,
include_starting_nodes: include_starting_nodes__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ListAllNodesRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListAllNodesResponse {
#[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;
}
if !self.nodes.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ListAllNodesResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if !self.nodes.is_empty() {
struct_ser.serialize_field("nodes", &self.nodes)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListAllNodesResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"nodes",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
Nodes,
}
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),
"nodes" => Ok(GeneratedField::Nodes),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListAllNodesResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListAllNodesResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListAllNodesResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut nodes__ = 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()?;
}
GeneratedField::Nodes => {
if nodes__.is_some() {
return Err(serde::de::Error::duplicate_field("nodes"));
}
nodes__ = Some(map_.next_value()?);
}
}
}
Ok(ListAllNodesResponse {
status: status__,
nodes: nodes__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ListAllNodesResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListEventLogRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.ListEventLogRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListEventLogRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListEventLogRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListEventLogRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListEventLogRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(ListEventLogRequest {
})
}
}
deserializer.deserialize_struct("meta.ListEventLogRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListEventLogResponse {
#[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.event_logs.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ListEventLogResponse", len)?;
if !self.event_logs.is_empty() {
struct_ser.serialize_field("eventLogs", &self.event_logs)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListEventLogResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"event_logs",
"eventLogs",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
EventLogs,
}
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 {
"eventLogs" | "event_logs" => Ok(GeneratedField::EventLogs),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListEventLogResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListEventLogResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListEventLogResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut event_logs__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::EventLogs => {
if event_logs__.is_some() {
return Err(serde::de::Error::duplicate_field("eventLogs"));
}
event_logs__ = Some(map_.next_value()?);
}
}
}
Ok(ListEventLogResponse {
event_logs: event_logs__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ListEventLogResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListFragmentDistributionRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.ListFragmentDistributionRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListFragmentDistributionRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListFragmentDistributionRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListFragmentDistributionRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListFragmentDistributionRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(ListFragmentDistributionRequest {
})
}
}
deserializer.deserialize_struct("meta.ListFragmentDistributionRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListFragmentDistributionResponse {
#[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.distributions.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ListFragmentDistributionResponse", len)?;
if !self.distributions.is_empty() {
struct_ser.serialize_field("distributions", &self.distributions)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListFragmentDistributionResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"distributions",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Distributions,
}
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 {
"distributions" => Ok(GeneratedField::Distributions),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListFragmentDistributionResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListFragmentDistributionResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListFragmentDistributionResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut distributions__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Distributions => {
if distributions__.is_some() {
return Err(serde::de::Error::duplicate_field("distributions"));
}
distributions__ = Some(map_.next_value()?);
}
}
}
Ok(ListFragmentDistributionResponse {
distributions: distributions__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ListFragmentDistributionResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for list_fragment_distribution_response::FragmentDistribution {
#[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.fragment_id != 0 {
len += 1;
}
if self.table_id != 0 {
len += 1;
}
if self.distribution_type != 0 {
len += 1;
}
if !self.state_table_ids.is_empty() {
len += 1;
}
if !self.upstream_fragment_ids.is_empty() {
len += 1;
}
if self.fragment_type_mask != 0 {
len += 1;
}
if self.parallelism != 0 {
len += 1;
}
if self.vnode_count != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ListFragmentDistributionResponse.FragmentDistribution", len)?;
if self.fragment_id != 0 {
struct_ser.serialize_field("fragmentId", &self.fragment_id)?;
}
if self.table_id != 0 {
struct_ser.serialize_field("tableId", &self.table_id)?;
}
if self.distribution_type != 0 {
let v = table_fragments::fragment::FragmentDistributionType::try_from(self.distribution_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.distribution_type)))?;
struct_ser.serialize_field("distributionType", &v)?;
}
if !self.state_table_ids.is_empty() {
struct_ser.serialize_field("stateTableIds", &self.state_table_ids)?;
}
if !self.upstream_fragment_ids.is_empty() {
struct_ser.serialize_field("upstreamFragmentIds", &self.upstream_fragment_ids)?;
}
if self.fragment_type_mask != 0 {
struct_ser.serialize_field("fragmentTypeMask", &self.fragment_type_mask)?;
}
if self.parallelism != 0 {
struct_ser.serialize_field("parallelism", &self.parallelism)?;
}
if self.vnode_count != 0 {
struct_ser.serialize_field("vnodeCount", &self.vnode_count)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for list_fragment_distribution_response::FragmentDistribution {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"fragment_id",
"fragmentId",
"table_id",
"tableId",
"distribution_type",
"distributionType",
"state_table_ids",
"stateTableIds",
"upstream_fragment_ids",
"upstreamFragmentIds",
"fragment_type_mask",
"fragmentTypeMask",
"parallelism",
"vnode_count",
"vnodeCount",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
FragmentId,
TableId,
DistributionType,
StateTableIds,
UpstreamFragmentIds,
FragmentTypeMask,
Parallelism,
VnodeCount,
}
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 {
"fragmentId" | "fragment_id" => Ok(GeneratedField::FragmentId),
"tableId" | "table_id" => Ok(GeneratedField::TableId),
"distributionType" | "distribution_type" => Ok(GeneratedField::DistributionType),
"stateTableIds" | "state_table_ids" => Ok(GeneratedField::StateTableIds),
"upstreamFragmentIds" | "upstream_fragment_ids" => Ok(GeneratedField::UpstreamFragmentIds),
"fragmentTypeMask" | "fragment_type_mask" => Ok(GeneratedField::FragmentTypeMask),
"parallelism" => Ok(GeneratedField::Parallelism),
"vnodeCount" | "vnode_count" => Ok(GeneratedField::VnodeCount),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = list_fragment_distribution_response::FragmentDistribution;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListFragmentDistributionResponse.FragmentDistribution")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<list_fragment_distribution_response::FragmentDistribution, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut fragment_id__ = None;
let mut table_id__ = None;
let mut distribution_type__ = None;
let mut state_table_ids__ = None;
let mut upstream_fragment_ids__ = None;
let mut fragment_type_mask__ = None;
let mut parallelism__ = None;
let mut vnode_count__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::FragmentId => {
if fragment_id__.is_some() {
return Err(serde::de::Error::duplicate_field("fragmentId"));
}
fragment_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TableId => {
if table_id__.is_some() {
return Err(serde::de::Error::duplicate_field("tableId"));
}
table_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::DistributionType => {
if distribution_type__.is_some() {
return Err(serde::de::Error::duplicate_field("distributionType"));
}
distribution_type__ = Some(map_.next_value::<table_fragments::fragment::FragmentDistributionType>()? as i32);
}
GeneratedField::StateTableIds => {
if state_table_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("stateTableIds"));
}
state_table_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::UpstreamFragmentIds => {
if upstream_fragment_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("upstreamFragmentIds"));
}
upstream_fragment_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::FragmentTypeMask => {
if fragment_type_mask__.is_some() {
return Err(serde::de::Error::duplicate_field("fragmentTypeMask"));
}
fragment_type_mask__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Parallelism => {
if parallelism__.is_some() {
return Err(serde::de::Error::duplicate_field("parallelism"));
}
parallelism__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::VnodeCount => {
if vnode_count__.is_some() {
return Err(serde::de::Error::duplicate_field("vnodeCount"));
}
vnode_count__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(list_fragment_distribution_response::FragmentDistribution {
fragment_id: fragment_id__.unwrap_or_default(),
table_id: table_id__.unwrap_or_default(),
distribution_type: distribution_type__.unwrap_or_default(),
state_table_ids: state_table_ids__.unwrap_or_default(),
upstream_fragment_ids: upstream_fragment_ids__.unwrap_or_default(),
fragment_type_mask: fragment_type_mask__.unwrap_or_default(),
parallelism: parallelism__.unwrap_or_default(),
vnode_count: vnode_count__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ListFragmentDistributionResponse.FragmentDistribution", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListObjectDependenciesRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.ListObjectDependenciesRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListObjectDependenciesRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListObjectDependenciesRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListObjectDependenciesRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListObjectDependenciesRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(ListObjectDependenciesRequest {
})
}
}
deserializer.deserialize_struct("meta.ListObjectDependenciesRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListObjectDependenciesResponse {
#[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.dependencies.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ListObjectDependenciesResponse", len)?;
if !self.dependencies.is_empty() {
struct_ser.serialize_field("dependencies", &self.dependencies)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListObjectDependenciesResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"dependencies",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Dependencies,
}
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 {
"dependencies" => Ok(GeneratedField::Dependencies),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListObjectDependenciesResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListObjectDependenciesResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListObjectDependenciesResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut dependencies__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Dependencies => {
if dependencies__.is_some() {
return Err(serde::de::Error::duplicate_field("dependencies"));
}
dependencies__ = Some(map_.next_value()?);
}
}
}
Ok(ListObjectDependenciesResponse {
dependencies: dependencies__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ListObjectDependenciesResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for list_object_dependencies_response::ObjectDependencies {
#[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.object_id != 0 {
len += 1;
}
if self.referenced_object_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ListObjectDependenciesResponse.ObjectDependencies", len)?;
if self.object_id != 0 {
struct_ser.serialize_field("objectId", &self.object_id)?;
}
if self.referenced_object_id != 0 {
struct_ser.serialize_field("referencedObjectId", &self.referenced_object_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for list_object_dependencies_response::ObjectDependencies {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"object_id",
"objectId",
"referenced_object_id",
"referencedObjectId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ObjectId,
ReferencedObjectId,
}
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 {
"objectId" | "object_id" => Ok(GeneratedField::ObjectId),
"referencedObjectId" | "referenced_object_id" => Ok(GeneratedField::ReferencedObjectId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = list_object_dependencies_response::ObjectDependencies;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListObjectDependenciesResponse.ObjectDependencies")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<list_object_dependencies_response::ObjectDependencies, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut object_id__ = None;
let mut referenced_object_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ObjectId => {
if object_id__.is_some() {
return Err(serde::de::Error::duplicate_field("objectId"));
}
object_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::ReferencedObjectId => {
if referenced_object_id__.is_some() {
return Err(serde::de::Error::duplicate_field("referencedObjectId"));
}
referenced_object_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(list_object_dependencies_response::ObjectDependencies {
object_id: object_id__.unwrap_or_default(),
referenced_object_id: referenced_object_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ListObjectDependenciesResponse.ObjectDependencies", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListRateLimitsRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.ListRateLimitsRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListRateLimitsRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListRateLimitsRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListRateLimitsRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListRateLimitsRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(ListRateLimitsRequest {
})
}
}
deserializer.deserialize_struct("meta.ListRateLimitsRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListRateLimitsResponse {
#[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.rate_limits.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ListRateLimitsResponse", len)?;
if !self.rate_limits.is_empty() {
struct_ser.serialize_field("rateLimits", &self.rate_limits)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListRateLimitsResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"rate_limits",
"rateLimits",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
RateLimits,
}
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 {
"rateLimits" | "rate_limits" => Ok(GeneratedField::RateLimits),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListRateLimitsResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListRateLimitsResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListRateLimitsResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut rate_limits__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::RateLimits => {
if rate_limits__.is_some() {
return Err(serde::de::Error::duplicate_field("rateLimits"));
}
rate_limits__ = Some(map_.next_value()?);
}
}
}
Ok(ListRateLimitsResponse {
rate_limits: rate_limits__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ListRateLimitsResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for list_rate_limits_response::RateLimitInfo {
#[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.fragment_id != 0 {
len += 1;
}
if self.job_id != 0 {
len += 1;
}
if self.fragment_type_mask != 0 {
len += 1;
}
if self.rate_limit != 0 {
len += 1;
}
if !self.node_name.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ListRateLimitsResponse.RateLimitInfo", len)?;
if self.fragment_id != 0 {
struct_ser.serialize_field("fragmentId", &self.fragment_id)?;
}
if self.job_id != 0 {
struct_ser.serialize_field("jobId", &self.job_id)?;
}
if self.fragment_type_mask != 0 {
struct_ser.serialize_field("fragmentTypeMask", &self.fragment_type_mask)?;
}
if self.rate_limit != 0 {
struct_ser.serialize_field("rateLimit", &self.rate_limit)?;
}
if !self.node_name.is_empty() {
struct_ser.serialize_field("nodeName", &self.node_name)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for list_rate_limits_response::RateLimitInfo {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"fragment_id",
"fragmentId",
"job_id",
"jobId",
"fragment_type_mask",
"fragmentTypeMask",
"rate_limit",
"rateLimit",
"node_name",
"nodeName",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
FragmentId,
JobId,
FragmentTypeMask,
RateLimit,
NodeName,
}
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 {
"fragmentId" | "fragment_id" => Ok(GeneratedField::FragmentId),
"jobId" | "job_id" => Ok(GeneratedField::JobId),
"fragmentTypeMask" | "fragment_type_mask" => Ok(GeneratedField::FragmentTypeMask),
"rateLimit" | "rate_limit" => Ok(GeneratedField::RateLimit),
"nodeName" | "node_name" => Ok(GeneratedField::NodeName),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = list_rate_limits_response::RateLimitInfo;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListRateLimitsResponse.RateLimitInfo")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<list_rate_limits_response::RateLimitInfo, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut fragment_id__ = None;
let mut job_id__ = None;
let mut fragment_type_mask__ = None;
let mut rate_limit__ = None;
let mut node_name__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::FragmentId => {
if fragment_id__.is_some() {
return Err(serde::de::Error::duplicate_field("fragmentId"));
}
fragment_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::JobId => {
if job_id__.is_some() {
return Err(serde::de::Error::duplicate_field("jobId"));
}
job_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::FragmentTypeMask => {
if fragment_type_mask__.is_some() {
return Err(serde::de::Error::duplicate_field("fragmentTypeMask"));
}
fragment_type_mask__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::RateLimit => {
if rate_limit__.is_some() {
return Err(serde::de::Error::duplicate_field("rateLimit"));
}
rate_limit__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::NodeName => {
if node_name__.is_some() {
return Err(serde::de::Error::duplicate_field("nodeName"));
}
node_name__ = Some(map_.next_value()?);
}
}
}
Ok(list_rate_limits_response::RateLimitInfo {
fragment_id: fragment_id__.unwrap_or_default(),
job_id: job_id__.unwrap_or_default(),
fragment_type_mask: fragment_type_mask__.unwrap_or_default(),
rate_limit: rate_limit__.unwrap_or_default(),
node_name: node_name__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ListRateLimitsResponse.RateLimitInfo", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListTableFragmentStatesRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.ListTableFragmentStatesRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListTableFragmentStatesRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListTableFragmentStatesRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListTableFragmentStatesRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListTableFragmentStatesRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(ListTableFragmentStatesRequest {
})
}
}
deserializer.deserialize_struct("meta.ListTableFragmentStatesRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListTableFragmentStatesResponse {
#[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.states.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ListTableFragmentStatesResponse", len)?;
if !self.states.is_empty() {
struct_ser.serialize_field("states", &self.states)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListTableFragmentStatesResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"states",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
States,
}
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 {
"states" => Ok(GeneratedField::States),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListTableFragmentStatesResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListTableFragmentStatesResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListTableFragmentStatesResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut states__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::States => {
if states__.is_some() {
return Err(serde::de::Error::duplicate_field("states"));
}
states__ = Some(map_.next_value()?);
}
}
}
Ok(ListTableFragmentStatesResponse {
states: states__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ListTableFragmentStatesResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for list_table_fragment_states_response::TableFragmentState {
#[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.table_id != 0 {
len += 1;
}
if self.state != 0 {
len += 1;
}
if self.parallelism.is_some() {
len += 1;
}
if self.max_parallelism != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ListTableFragmentStatesResponse.TableFragmentState", len)?;
if self.table_id != 0 {
struct_ser.serialize_field("tableId", &self.table_id)?;
}
if self.state != 0 {
let v = table_fragments::State::try_from(self.state)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.state)))?;
struct_ser.serialize_field("state", &v)?;
}
if let Some(v) = self.parallelism.as_ref() {
struct_ser.serialize_field("parallelism", v)?;
}
if self.max_parallelism != 0 {
struct_ser.serialize_field("maxParallelism", &self.max_parallelism)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for list_table_fragment_states_response::TableFragmentState {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table_id",
"tableId",
"state",
"parallelism",
"max_parallelism",
"maxParallelism",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableId,
State,
Parallelism,
MaxParallelism,
}
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 {
"tableId" | "table_id" => Ok(GeneratedField::TableId),
"state" => Ok(GeneratedField::State),
"parallelism" => Ok(GeneratedField::Parallelism),
"maxParallelism" | "max_parallelism" => Ok(GeneratedField::MaxParallelism),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = list_table_fragment_states_response::TableFragmentState;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListTableFragmentStatesResponse.TableFragmentState")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<list_table_fragment_states_response::TableFragmentState, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_id__ = None;
let mut state__ = None;
let mut parallelism__ = None;
let mut max_parallelism__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TableId => {
if table_id__.is_some() {
return Err(serde::de::Error::duplicate_field("tableId"));
}
table_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::State => {
if state__.is_some() {
return Err(serde::de::Error::duplicate_field("state"));
}
state__ = Some(map_.next_value::<table_fragments::State>()? as i32);
}
GeneratedField::Parallelism => {
if parallelism__.is_some() {
return Err(serde::de::Error::duplicate_field("parallelism"));
}
parallelism__ = map_.next_value()?;
}
GeneratedField::MaxParallelism => {
if max_parallelism__.is_some() {
return Err(serde::de::Error::duplicate_field("maxParallelism"));
}
max_parallelism__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(list_table_fragment_states_response::TableFragmentState {
table_id: table_id__.unwrap_or_default(),
state: state__.unwrap_or_default(),
parallelism: parallelism__,
max_parallelism: max_parallelism__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ListTableFragmentStatesResponse.TableFragmentState", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListTableFragmentsRequest {
#[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.table_ids.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ListTableFragmentsRequest", len)?;
if !self.table_ids.is_empty() {
struct_ser.serialize_field("tableIds", &self.table_ids)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListTableFragmentsRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table_ids",
"tableIds",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableIds,
}
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 {
"tableIds" | "table_ids" => Ok(GeneratedField::TableIds),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListTableFragmentsRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListTableFragmentsRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListTableFragmentsRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_ids__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TableIds => {
if table_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("tableIds"));
}
table_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(ListTableFragmentsRequest {
table_ids: table_ids__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ListTableFragmentsRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListTableFragmentsResponse {
#[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.table_fragments.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ListTableFragmentsResponse", len)?;
if !self.table_fragments.is_empty() {
struct_ser.serialize_field("tableFragments", &self.table_fragments)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListTableFragmentsResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table_fragments",
"tableFragments",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableFragments,
}
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 {
"tableFragments" | "table_fragments" => Ok(GeneratedField::TableFragments),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListTableFragmentsResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListTableFragmentsResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListTableFragmentsResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_fragments__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TableFragments => {
if table_fragments__.is_some() {
return Err(serde::de::Error::duplicate_field("tableFragments"));
}
table_fragments__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
}
}
Ok(ListTableFragmentsResponse {
table_fragments: table_fragments__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ListTableFragmentsResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for list_table_fragments_response::ActorInfo {
#[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.id != 0 {
len += 1;
}
if self.node.is_some() {
len += 1;
}
if !self.dispatcher.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ListTableFragmentsResponse.ActorInfo", len)?;
if self.id != 0 {
struct_ser.serialize_field("id", &self.id)?;
}
if let Some(v) = self.node.as_ref() {
struct_ser.serialize_field("node", v)?;
}
if !self.dispatcher.is_empty() {
struct_ser.serialize_field("dispatcher", &self.dispatcher)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for list_table_fragments_response::ActorInfo {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"id",
"node",
"dispatcher",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Id,
Node,
Dispatcher,
}
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 {
"id" => Ok(GeneratedField::Id),
"node" => Ok(GeneratedField::Node),
"dispatcher" => Ok(GeneratedField::Dispatcher),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = list_table_fragments_response::ActorInfo;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListTableFragmentsResponse.ActorInfo")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<list_table_fragments_response::ActorInfo, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut id__ = None;
let mut node__ = None;
let mut dispatcher__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Id => {
if id__.is_some() {
return Err(serde::de::Error::duplicate_field("id"));
}
id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Node => {
if node__.is_some() {
return Err(serde::de::Error::duplicate_field("node"));
}
node__ = map_.next_value()?;
}
GeneratedField::Dispatcher => {
if dispatcher__.is_some() {
return Err(serde::de::Error::duplicate_field("dispatcher"));
}
dispatcher__ = Some(map_.next_value()?);
}
}
}
Ok(list_table_fragments_response::ActorInfo {
id: id__.unwrap_or_default(),
node: node__,
dispatcher: dispatcher__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ListTableFragmentsResponse.ActorInfo", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for list_table_fragments_response::FragmentInfo {
#[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.id != 0 {
len += 1;
}
if !self.actors.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ListTableFragmentsResponse.FragmentInfo", len)?;
if self.id != 0 {
struct_ser.serialize_field("id", &self.id)?;
}
if !self.actors.is_empty() {
struct_ser.serialize_field("actors", &self.actors)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for list_table_fragments_response::FragmentInfo {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"id",
"actors",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Id,
Actors,
}
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 {
"id" => Ok(GeneratedField::Id),
"actors" => Ok(GeneratedField::Actors),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = list_table_fragments_response::FragmentInfo;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListTableFragmentsResponse.FragmentInfo")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<list_table_fragments_response::FragmentInfo, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut id__ = None;
let mut actors__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Id => {
if id__.is_some() {
return Err(serde::de::Error::duplicate_field("id"));
}
id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Actors => {
if actors__.is_some() {
return Err(serde::de::Error::duplicate_field("actors"));
}
actors__ = Some(map_.next_value()?);
}
}
}
Ok(list_table_fragments_response::FragmentInfo {
id: id__.unwrap_or_default(),
actors: actors__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.ListTableFragmentsResponse.FragmentInfo", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for list_table_fragments_response::TableFragmentInfo {
#[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.fragments.is_empty() {
len += 1;
}
if self.ctx.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.ListTableFragmentsResponse.TableFragmentInfo", len)?;
if !self.fragments.is_empty() {
struct_ser.serialize_field("fragments", &self.fragments)?;
}
if let Some(v) = self.ctx.as_ref() {
struct_ser.serialize_field("ctx", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for list_table_fragments_response::TableFragmentInfo {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"fragments",
"ctx",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Fragments,
Ctx,
}
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 {
"fragments" => Ok(GeneratedField::Fragments),
"ctx" => Ok(GeneratedField::Ctx),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = list_table_fragments_response::TableFragmentInfo;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ListTableFragmentsResponse.TableFragmentInfo")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<list_table_fragments_response::TableFragmentInfo, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut fragments__ = None;
let mut ctx__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Fragments => {
if fragments__.is_some() {
return Err(serde::de::Error::duplicate_field("fragments"));
}
fragments__ = Some(map_.next_value()?);
}
GeneratedField::Ctx => {
if ctx__.is_some() {
return Err(serde::de::Error::duplicate_field("ctx"));
}
ctx__ = map_.next_value()?;
}
}
}
Ok(list_table_fragments_response::TableFragmentInfo {
fragments: fragments__.unwrap_or_default(),
ctx: ctx__,
})
}
}
deserializer.deserialize_struct("meta.ListTableFragmentsResponse.TableFragmentInfo", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for MembersRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.MembersRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for MembersRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = MembersRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.MembersRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<MembersRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(MembersRequest {
})
}
}
deserializer.deserialize_struct("meta.MembersRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for MembersResponse {
#[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.members.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.MembersResponse", len)?;
if !self.members.is_empty() {
struct_ser.serialize_field("members", &self.members)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for MembersResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"members",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Members,
}
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 {
"members" => Ok(GeneratedField::Members),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = MembersResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.MembersResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<MembersResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut members__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Members => {
if members__.is_some() {
return Err(serde::de::Error::duplicate_field("members"));
}
members__ = Some(map_.next_value()?);
}
}
}
Ok(MembersResponse {
members: members__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.MembersResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for MetaMember {
#[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.address.is_some() {
len += 1;
}
if self.is_leader {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.MetaMember", len)?;
if let Some(v) = self.address.as_ref() {
struct_ser.serialize_field("address", v)?;
}
if self.is_leader {
struct_ser.serialize_field("isLeader", &self.is_leader)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for MetaMember {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"address",
"is_leader",
"isLeader",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Address,
IsLeader,
}
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 {
"address" => Ok(GeneratedField::Address),
"isLeader" | "is_leader" => Ok(GeneratedField::IsLeader),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = MetaMember;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.MetaMember")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<MetaMember, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut address__ = None;
let mut is_leader__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Address => {
if address__.is_some() {
return Err(serde::de::Error::duplicate_field("address"));
}
address__ = map_.next_value()?;
}
GeneratedField::IsLeader => {
if is_leader__.is_some() {
return Err(serde::de::Error::duplicate_field("isLeader"));
}
is_leader__ = Some(map_.next_value()?);
}
}
}
Ok(MetaMember {
address: address__,
is_leader: is_leader__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.MetaMember", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for MetaSnapshot {
#[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.databases.is_empty() {
len += 1;
}
if !self.schemas.is_empty() {
len += 1;
}
if !self.sources.is_empty() {
len += 1;
}
if !self.sinks.is_empty() {
len += 1;
}
if !self.tables.is_empty() {
len += 1;
}
if !self.indexes.is_empty() {
len += 1;
}
if !self.views.is_empty() {
len += 1;
}
if !self.functions.is_empty() {
len += 1;
}
if !self.connections.is_empty() {
len += 1;
}
if !self.subscriptions.is_empty() {
len += 1;
}
if !self.users.is_empty() {
len += 1;
}
if self.session_params.is_some() {
len += 1;
}
if !self.secrets.is_empty() {
len += 1;
}
if !self.nodes.is_empty() {
len += 1;
}
if self.hummock_version.is_some() {
len += 1;
}
if self.meta_backup_manifest_id.is_some() {
len += 1;
}
if self.hummock_write_limits.is_some() {
len += 1;
}
if !self.streaming_worker_slot_mappings.is_empty() {
len += 1;
}
if !self.serving_worker_slot_mappings.is_empty() {
len += 1;
}
if self.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.MetaSnapshot", len)?;
if !self.databases.is_empty() {
struct_ser.serialize_field("databases", &self.databases)?;
}
if !self.schemas.is_empty() {
struct_ser.serialize_field("schemas", &self.schemas)?;
}
if !self.sources.is_empty() {
struct_ser.serialize_field("sources", &self.sources)?;
}
if !self.sinks.is_empty() {
struct_ser.serialize_field("sinks", &self.sinks)?;
}
if !self.tables.is_empty() {
struct_ser.serialize_field("tables", &self.tables)?;
}
if !self.indexes.is_empty() {
struct_ser.serialize_field("indexes", &self.indexes)?;
}
if !self.views.is_empty() {
struct_ser.serialize_field("views", &self.views)?;
}
if !self.functions.is_empty() {
struct_ser.serialize_field("functions", &self.functions)?;
}
if !self.connections.is_empty() {
struct_ser.serialize_field("connections", &self.connections)?;
}
if !self.subscriptions.is_empty() {
struct_ser.serialize_field("subscriptions", &self.subscriptions)?;
}
if !self.users.is_empty() {
struct_ser.serialize_field("users", &self.users)?;
}
if let Some(v) = self.session_params.as_ref() {
struct_ser.serialize_field("sessionParams", v)?;
}
if !self.secrets.is_empty() {
struct_ser.serialize_field("secrets", &self.secrets)?;
}
if !self.nodes.is_empty() {
struct_ser.serialize_field("nodes", &self.nodes)?;
}
if let Some(v) = self.hummock_version.as_ref() {
struct_ser.serialize_field("hummockVersion", v)?;
}
if let Some(v) = self.meta_backup_manifest_id.as_ref() {
struct_ser.serialize_field("metaBackupManifestId", v)?;
}
if let Some(v) = self.hummock_write_limits.as_ref() {
struct_ser.serialize_field("hummockWriteLimits", v)?;
}
if !self.streaming_worker_slot_mappings.is_empty() {
struct_ser.serialize_field("streamingWorkerSlotMappings", &self.streaming_worker_slot_mappings)?;
}
if !self.serving_worker_slot_mappings.is_empty() {
struct_ser.serialize_field("servingWorkerSlotMappings", &self.serving_worker_slot_mappings)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for MetaSnapshot {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"databases",
"schemas",
"sources",
"sinks",
"tables",
"indexes",
"views",
"functions",
"connections",
"subscriptions",
"users",
"session_params",
"sessionParams",
"secrets",
"nodes",
"hummock_version",
"hummockVersion",
"meta_backup_manifest_id",
"metaBackupManifestId",
"hummock_write_limits",
"hummockWriteLimits",
"streaming_worker_slot_mappings",
"streamingWorkerSlotMappings",
"serving_worker_slot_mappings",
"servingWorkerSlotMappings",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Databases,
Schemas,
Sources,
Sinks,
Tables,
Indexes,
Views,
Functions,
Connections,
Subscriptions,
Users,
SessionParams,
Secrets,
Nodes,
HummockVersion,
MetaBackupManifestId,
HummockWriteLimits,
StreamingWorkerSlotMappings,
ServingWorkerSlotMappings,
Version,
}
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 {
"databases" => Ok(GeneratedField::Databases),
"schemas" => Ok(GeneratedField::Schemas),
"sources" => Ok(GeneratedField::Sources),
"sinks" => Ok(GeneratedField::Sinks),
"tables" => Ok(GeneratedField::Tables),
"indexes" => Ok(GeneratedField::Indexes),
"views" => Ok(GeneratedField::Views),
"functions" => Ok(GeneratedField::Functions),
"connections" => Ok(GeneratedField::Connections),
"subscriptions" => Ok(GeneratedField::Subscriptions),
"users" => Ok(GeneratedField::Users),
"sessionParams" | "session_params" => Ok(GeneratedField::SessionParams),
"secrets" => Ok(GeneratedField::Secrets),
"nodes" => Ok(GeneratedField::Nodes),
"hummockVersion" | "hummock_version" => Ok(GeneratedField::HummockVersion),
"metaBackupManifestId" | "meta_backup_manifest_id" => Ok(GeneratedField::MetaBackupManifestId),
"hummockWriteLimits" | "hummock_write_limits" => Ok(GeneratedField::HummockWriteLimits),
"streamingWorkerSlotMappings" | "streaming_worker_slot_mappings" => Ok(GeneratedField::StreamingWorkerSlotMappings),
"servingWorkerSlotMappings" | "serving_worker_slot_mappings" => Ok(GeneratedField::ServingWorkerSlotMappings),
"version" => Ok(GeneratedField::Version),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = MetaSnapshot;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.MetaSnapshot")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<MetaSnapshot, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut databases__ = None;
let mut schemas__ = None;
let mut sources__ = None;
let mut sinks__ = None;
let mut tables__ = None;
let mut indexes__ = None;
let mut views__ = None;
let mut functions__ = None;
let mut connections__ = None;
let mut subscriptions__ = None;
let mut users__ = None;
let mut session_params__ = None;
let mut secrets__ = None;
let mut nodes__ = None;
let mut hummock_version__ = None;
let mut meta_backup_manifest_id__ = None;
let mut hummock_write_limits__ = None;
let mut streaming_worker_slot_mappings__ = None;
let mut serving_worker_slot_mappings__ = None;
let mut version__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Databases => {
if databases__.is_some() {
return Err(serde::de::Error::duplicate_field("databases"));
}
databases__ = Some(map_.next_value()?);
}
GeneratedField::Schemas => {
if schemas__.is_some() {
return Err(serde::de::Error::duplicate_field("schemas"));
}
schemas__ = Some(map_.next_value()?);
}
GeneratedField::Sources => {
if sources__.is_some() {
return Err(serde::de::Error::duplicate_field("sources"));
}
sources__ = Some(map_.next_value()?);
}
GeneratedField::Sinks => {
if sinks__.is_some() {
return Err(serde::de::Error::duplicate_field("sinks"));
}
sinks__ = Some(map_.next_value()?);
}
GeneratedField::Tables => {
if tables__.is_some() {
return Err(serde::de::Error::duplicate_field("tables"));
}
tables__ = Some(map_.next_value()?);
}
GeneratedField::Indexes => {
if indexes__.is_some() {
return Err(serde::de::Error::duplicate_field("indexes"));
}
indexes__ = Some(map_.next_value()?);
}
GeneratedField::Views => {
if views__.is_some() {
return Err(serde::de::Error::duplicate_field("views"));
}
views__ = Some(map_.next_value()?);
}
GeneratedField::Functions => {
if functions__.is_some() {
return Err(serde::de::Error::duplicate_field("functions"));
}
functions__ = Some(map_.next_value()?);
}
GeneratedField::Connections => {
if connections__.is_some() {
return Err(serde::de::Error::duplicate_field("connections"));
}
connections__ = Some(map_.next_value()?);
}
GeneratedField::Subscriptions => {
if subscriptions__.is_some() {
return Err(serde::de::Error::duplicate_field("subscriptions"));
}
subscriptions__ = Some(map_.next_value()?);
}
GeneratedField::Users => {
if users__.is_some() {
return Err(serde::de::Error::duplicate_field("users"));
}
users__ = Some(map_.next_value()?);
}
GeneratedField::SessionParams => {
if session_params__.is_some() {
return Err(serde::de::Error::duplicate_field("sessionParams"));
}
session_params__ = map_.next_value()?;
}
GeneratedField::Secrets => {
if secrets__.is_some() {
return Err(serde::de::Error::duplicate_field("secrets"));
}
secrets__ = Some(map_.next_value()?);
}
GeneratedField::Nodes => {
if nodes__.is_some() {
return Err(serde::de::Error::duplicate_field("nodes"));
}
nodes__ = Some(map_.next_value()?);
}
GeneratedField::HummockVersion => {
if hummock_version__.is_some() {
return Err(serde::de::Error::duplicate_field("hummockVersion"));
}
hummock_version__ = map_.next_value()?;
}
GeneratedField::MetaBackupManifestId => {
if meta_backup_manifest_id__.is_some() {
return Err(serde::de::Error::duplicate_field("metaBackupManifestId"));
}
meta_backup_manifest_id__ = map_.next_value()?;
}
GeneratedField::HummockWriteLimits => {
if hummock_write_limits__.is_some() {
return Err(serde::de::Error::duplicate_field("hummockWriteLimits"));
}
hummock_write_limits__ = map_.next_value()?;
}
GeneratedField::StreamingWorkerSlotMappings => {
if streaming_worker_slot_mappings__.is_some() {
return Err(serde::de::Error::duplicate_field("streamingWorkerSlotMappings"));
}
streaming_worker_slot_mappings__ = Some(map_.next_value()?);
}
GeneratedField::ServingWorkerSlotMappings => {
if serving_worker_slot_mappings__.is_some() {
return Err(serde::de::Error::duplicate_field("servingWorkerSlotMappings"));
}
serving_worker_slot_mappings__ = Some(map_.next_value()?);
}
GeneratedField::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(MetaSnapshot {
databases: databases__.unwrap_or_default(),
schemas: schemas__.unwrap_or_default(),
sources: sources__.unwrap_or_default(),
sinks: sinks__.unwrap_or_default(),
tables: tables__.unwrap_or_default(),
indexes: indexes__.unwrap_or_default(),
views: views__.unwrap_or_default(),
functions: functions__.unwrap_or_default(),
connections: connections__.unwrap_or_default(),
subscriptions: subscriptions__.unwrap_or_default(),
users: users__.unwrap_or_default(),
session_params: session_params__,
secrets: secrets__.unwrap_or_default(),
nodes: nodes__.unwrap_or_default(),
hummock_version: hummock_version__,
meta_backup_manifest_id: meta_backup_manifest_id__,
hummock_write_limits: hummock_write_limits__,
streaming_worker_slot_mappings: streaming_worker_slot_mappings__.unwrap_or_default(),
serving_worker_slot_mappings: serving_worker_slot_mappings__.unwrap_or_default(),
version: version__,
})
}
}
deserializer.deserialize_struct("meta.MetaSnapshot", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for meta_snapshot::SnapshotVersion {
#[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.catalog_version != 0 {
len += 1;
}
if self.worker_node_version != 0 {
len += 1;
}
if self.streaming_worker_slot_mapping_version != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.MetaSnapshot.SnapshotVersion", len)?;
if self.catalog_version != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("catalogVersion", ToString::to_string(&self.catalog_version).as_str())?;
}
if self.worker_node_version != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("workerNodeVersion", ToString::to_string(&self.worker_node_version).as_str())?;
}
if self.streaming_worker_slot_mapping_version != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("streamingWorkerSlotMappingVersion", ToString::to_string(&self.streaming_worker_slot_mapping_version).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for meta_snapshot::SnapshotVersion {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"catalog_version",
"catalogVersion",
"worker_node_version",
"workerNodeVersion",
"streaming_worker_slot_mapping_version",
"streamingWorkerSlotMappingVersion",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
CatalogVersion,
WorkerNodeVersion,
StreamingWorkerSlotMappingVersion,
}
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 {
"catalogVersion" | "catalog_version" => Ok(GeneratedField::CatalogVersion),
"workerNodeVersion" | "worker_node_version" => Ok(GeneratedField::WorkerNodeVersion),
"streamingWorkerSlotMappingVersion" | "streaming_worker_slot_mapping_version" => Ok(GeneratedField::StreamingWorkerSlotMappingVersion),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = meta_snapshot::SnapshotVersion;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.MetaSnapshot.SnapshotVersion")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<meta_snapshot::SnapshotVersion, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut catalog_version__ = None;
let mut worker_node_version__ = None;
let mut streaming_worker_slot_mapping_version__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::CatalogVersion => {
if catalog_version__.is_some() {
return Err(serde::de::Error::duplicate_field("catalogVersion"));
}
catalog_version__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::WorkerNodeVersion => {
if worker_node_version__.is_some() {
return Err(serde::de::Error::duplicate_field("workerNodeVersion"));
}
worker_node_version__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::StreamingWorkerSlotMappingVersion => {
if streaming_worker_slot_mapping_version__.is_some() {
return Err(serde::de::Error::duplicate_field("streamingWorkerSlotMappingVersion"));
}
streaming_worker_slot_mapping_version__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(meta_snapshot::SnapshotVersion {
catalog_version: catalog_version__.unwrap_or_default(),
worker_node_version: worker_node_version__.unwrap_or_default(),
streaming_worker_slot_mapping_version: streaming_worker_slot_mapping_version__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.MetaSnapshot.SnapshotVersion", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for MigrationPlan {
#[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.worker_slot_migration_plan.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.MigrationPlan", len)?;
if !self.worker_slot_migration_plan.is_empty() {
let v: std::collections::HashMap<_, _> = self.worker_slot_migration_plan.iter()
.map(|(k, v)| (k, v.to_string())).collect();
struct_ser.serialize_field("workerSlotMigrationPlan", &v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for MigrationPlan {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"worker_slot_migration_plan",
"workerSlotMigrationPlan",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
WorkerSlotMigrationPlan,
}
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 {
"workerSlotMigrationPlan" | "worker_slot_migration_plan" => Ok(GeneratedField::WorkerSlotMigrationPlan),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = MigrationPlan;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.MigrationPlan")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<MigrationPlan, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut worker_slot_migration_plan__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::WorkerSlotMigrationPlan => {
if worker_slot_migration_plan__.is_some() {
return Err(serde::de::Error::duplicate_field("workerSlotMigrationPlan"));
}
worker_slot_migration_plan__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u64>, ::pbjson::private::NumberDeserialize<u64>>>()?
.into_iter().map(|(k,v)| (k.0, v.0)).collect()
);
}
}
}
Ok(MigrationPlan {
worker_slot_migration_plan: worker_slot_migration_plan__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.MigrationPlan", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for PauseRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.PauseRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for PauseRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = PauseRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.PauseRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<PauseRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(PauseRequest {
})
}
}
deserializer.deserialize_struct("meta.PauseRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for PauseResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.PauseResponse", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for PauseResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = PauseResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.PauseResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<PauseResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(PauseResponse {
})
}
}
deserializer.deserialize_struct("meta.PauseResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for PausedReason {
#[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 => "PAUSED_REASON_UNSPECIFIED",
Self::ConfigChange => "PAUSED_REASON_CONFIG_CHANGE",
Self::Manual => "PAUSED_REASON_MANUAL",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for PausedReason {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"PAUSED_REASON_UNSPECIFIED",
"PAUSED_REASON_CONFIG_CHANGE",
"PAUSED_REASON_MANUAL",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = PausedReason;
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 {
"PAUSED_REASON_UNSPECIFIED" => Ok(PausedReason::Unspecified),
"PAUSED_REASON_CONFIG_CHANGE" => Ok(PausedReason::ConfigChange),
"PAUSED_REASON_MANUAL" => Ok(PausedReason::Manual),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for RecoverRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.RecoverRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RecoverRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RecoverRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.RecoverRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RecoverRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(RecoverRequest {
})
}
}
deserializer.deserialize_struct("meta.RecoverRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RecoverResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.RecoverResponse", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RecoverResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RecoverResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.RecoverResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RecoverResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(RecoverResponse {
})
}
}
deserializer.deserialize_struct("meta.RecoverResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for Recovery {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.Recovery", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for Recovery {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = Recovery;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.Recovery")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<Recovery, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(Recovery {
})
}
}
deserializer.deserialize_struct("meta.Recovery", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RecoveryStatus {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
let variant = match self {
Self::StatusUnspecified => "STATUS_UNSPECIFIED",
Self::StatusStarting => "STATUS_STARTING",
Self::StatusRecovering => "STATUS_RECOVERING",
Self::StatusRunning => "STATUS_RUNNING",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for RecoveryStatus {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"STATUS_UNSPECIFIED",
"STATUS_STARTING",
"STATUS_RECOVERING",
"STATUS_RUNNING",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RecoveryStatus;
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 {
"STATUS_UNSPECIFIED" => Ok(RecoveryStatus::StatusUnspecified),
"STATUS_STARTING" => Ok(RecoveryStatus::StatusStarting),
"STATUS_RECOVERING" => Ok(RecoveryStatus::StatusRecovering),
"STATUS_RUNNING" => Ok(RecoveryStatus::StatusRunning),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for Relation {
#[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.relation_info.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.Relation", len)?;
if let Some(v) = self.relation_info.as_ref() {
match v {
relation::RelationInfo::Table(v) => {
struct_ser.serialize_field("table", v)?;
}
relation::RelationInfo::Source(v) => {
struct_ser.serialize_field("source", v)?;
}
relation::RelationInfo::Sink(v) => {
struct_ser.serialize_field("sink", v)?;
}
relation::RelationInfo::Index(v) => {
struct_ser.serialize_field("index", v)?;
}
relation::RelationInfo::View(v) => {
struct_ser.serialize_field("view", v)?;
}
relation::RelationInfo::Subscription(v) => {
struct_ser.serialize_field("subscription", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for Relation {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table",
"source",
"sink",
"index",
"view",
"subscription",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Table,
Source,
Sink,
Index,
View,
Subscription,
}
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 {
"table" => Ok(GeneratedField::Table),
"source" => Ok(GeneratedField::Source),
"sink" => Ok(GeneratedField::Sink),
"index" => Ok(GeneratedField::Index),
"view" => Ok(GeneratedField::View),
"subscription" => Ok(GeneratedField::Subscription),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = Relation;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.Relation")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<Relation, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut relation_info__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Table => {
if relation_info__.is_some() {
return Err(serde::de::Error::duplicate_field("table"));
}
relation_info__ = map_.next_value::<::std::option::Option<_>>()?.map(relation::RelationInfo::Table)
;
}
GeneratedField::Source => {
if relation_info__.is_some() {
return Err(serde::de::Error::duplicate_field("source"));
}
relation_info__ = map_.next_value::<::std::option::Option<_>>()?.map(relation::RelationInfo::Source)
;
}
GeneratedField::Sink => {
if relation_info__.is_some() {
return Err(serde::de::Error::duplicate_field("sink"));
}
relation_info__ = map_.next_value::<::std::option::Option<_>>()?.map(relation::RelationInfo::Sink)
;
}
GeneratedField::Index => {
if relation_info__.is_some() {
return Err(serde::de::Error::duplicate_field("index"));
}
relation_info__ = map_.next_value::<::std::option::Option<_>>()?.map(relation::RelationInfo::Index)
;
}
GeneratedField::View => {
if relation_info__.is_some() {
return Err(serde::de::Error::duplicate_field("view"));
}
relation_info__ = map_.next_value::<::std::option::Option<_>>()?.map(relation::RelationInfo::View)
;
}
GeneratedField::Subscription => {
if relation_info__.is_some() {
return Err(serde::de::Error::duplicate_field("subscription"));
}
relation_info__ = map_.next_value::<::std::option::Option<_>>()?.map(relation::RelationInfo::Subscription)
;
}
}
}
Ok(Relation {
relation_info: relation_info__,
})
}
}
deserializer.deserialize_struct("meta.Relation", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RelationGroup {
#[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.relations.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.RelationGroup", len)?;
if !self.relations.is_empty() {
struct_ser.serialize_field("relations", &self.relations)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RelationGroup {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"relations",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Relations,
}
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 {
"relations" => Ok(GeneratedField::Relations),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RelationGroup;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.RelationGroup")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RelationGroup, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut relations__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Relations => {
if relations__.is_some() {
return Err(serde::de::Error::duplicate_field("relations"));
}
relations__ = Some(map_.next_value()?);
}
}
}
Ok(RelationGroup {
relations: relations__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.RelationGroup", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RelationIdInfos {
#[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.map.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.RelationIdInfos", len)?;
if !self.map.is_empty() {
struct_ser.serialize_field("map", &self.map)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RelationIdInfos {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"map",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Map,
}
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 {
"map" => Ok(GeneratedField::Map),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RelationIdInfos;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.RelationIdInfos")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RelationIdInfos, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut map__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Map => {
if map__.is_some() {
return Err(serde::de::Error::duplicate_field("map"));
}
map__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
}
}
Ok(RelationIdInfos {
map: map__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.RelationIdInfos", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RescheduleRequest {
#[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.revision != 0 {
len += 1;
}
if self.resolve_no_shuffle_upstream {
len += 1;
}
if !self.worker_reschedules.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.RescheduleRequest", len)?;
if self.revision != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("revision", ToString::to_string(&self.revision).as_str())?;
}
if self.resolve_no_shuffle_upstream {
struct_ser.serialize_field("resolveNoShuffleUpstream", &self.resolve_no_shuffle_upstream)?;
}
if !self.worker_reschedules.is_empty() {
struct_ser.serialize_field("workerReschedules", &self.worker_reschedules)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RescheduleRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"revision",
"resolve_no_shuffle_upstream",
"resolveNoShuffleUpstream",
"worker_reschedules",
"workerReschedules",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Revision,
ResolveNoShuffleUpstream,
WorkerReschedules,
}
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 {
"revision" => Ok(GeneratedField::Revision),
"resolveNoShuffleUpstream" | "resolve_no_shuffle_upstream" => Ok(GeneratedField::ResolveNoShuffleUpstream),
"workerReschedules" | "worker_reschedules" => Ok(GeneratedField::WorkerReschedules),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RescheduleRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.RescheduleRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RescheduleRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut revision__ = None;
let mut resolve_no_shuffle_upstream__ = None;
let mut worker_reschedules__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Revision => {
if revision__.is_some() {
return Err(serde::de::Error::duplicate_field("revision"));
}
revision__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::ResolveNoShuffleUpstream => {
if resolve_no_shuffle_upstream__.is_some() {
return Err(serde::de::Error::duplicate_field("resolveNoShuffleUpstream"));
}
resolve_no_shuffle_upstream__ = Some(map_.next_value()?);
}
GeneratedField::WorkerReschedules => {
if worker_reschedules__.is_some() {
return Err(serde::de::Error::duplicate_field("workerReschedules"));
}
worker_reschedules__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
}
}
Ok(RescheduleRequest {
revision: revision__.unwrap_or_default(),
resolve_no_shuffle_upstream: resolve_no_shuffle_upstream__.unwrap_or_default(),
worker_reschedules: worker_reschedules__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.RescheduleRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RescheduleResponse {
#[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.success {
len += 1;
}
if self.revision != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.RescheduleResponse", len)?;
if self.success {
struct_ser.serialize_field("success", &self.success)?;
}
if self.revision != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("revision", ToString::to_string(&self.revision).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RescheduleResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"success",
"revision",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Success,
Revision,
}
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 {
"success" => Ok(GeneratedField::Success),
"revision" => Ok(GeneratedField::Revision),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RescheduleResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.RescheduleResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RescheduleResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut success__ = None;
let mut revision__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Success => {
if success__.is_some() {
return Err(serde::de::Error::duplicate_field("success"));
}
success__ = Some(map_.next_value()?);
}
GeneratedField::Revision => {
if revision__.is_some() {
return Err(serde::de::Error::duplicate_field("revision"));
}
revision__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(RescheduleResponse {
success: success__.unwrap_or_default(),
revision: revision__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.RescheduleResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ResumeRequest {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.ResumeRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ResumeRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ResumeRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ResumeRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ResumeRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(ResumeRequest {
})
}
}
deserializer.deserialize_struct("meta.ResumeRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ResumeResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.ResumeResponse", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ResumeResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ResumeResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.ResumeResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ResumeResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(ResumeResponse {
})
}
}
deserializer.deserialize_struct("meta.ResumeResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SetSessionParamRequest {
#[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.param.is_empty() {
len += 1;
}
if self.value.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.SetSessionParamRequest", len)?;
if !self.param.is_empty() {
struct_ser.serialize_field("param", &self.param)?;
}
if let Some(v) = self.value.as_ref() {
struct_ser.serialize_field("value", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SetSessionParamRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"param",
"value",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Param,
Value,
}
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 {
"param" => Ok(GeneratedField::Param),
"value" => Ok(GeneratedField::Value),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SetSessionParamRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.SetSessionParamRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SetSessionParamRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut param__ = None;
let mut value__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Param => {
if param__.is_some() {
return Err(serde::de::Error::duplicate_field("param"));
}
param__ = Some(map_.next_value()?);
}
GeneratedField::Value => {
if value__.is_some() {
return Err(serde::de::Error::duplicate_field("value"));
}
value__ = map_.next_value()?;
}
}
}
Ok(SetSessionParamRequest {
param: param__.unwrap_or_default(),
value: value__,
})
}
}
deserializer.deserialize_struct("meta.SetSessionParamRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SetSessionParamResponse {
#[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.param.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.SetSessionParamResponse", len)?;
if !self.param.is_empty() {
struct_ser.serialize_field("param", &self.param)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SetSessionParamResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"param",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Param,
}
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 {
"param" => Ok(GeneratedField::Param),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SetSessionParamResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.SetSessionParamResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SetSessionParamResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut param__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Param => {
if param__.is_some() {
return Err(serde::de::Error::duplicate_field("param"));
}
param__ = Some(map_.next_value()?);
}
}
}
Ok(SetSessionParamResponse {
param: param__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.SetSessionParamResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SetSystemParamRequest {
#[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.param.is_empty() {
len += 1;
}
if self.value.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.SetSystemParamRequest", len)?;
if !self.param.is_empty() {
struct_ser.serialize_field("param", &self.param)?;
}
if let Some(v) = self.value.as_ref() {
struct_ser.serialize_field("value", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SetSystemParamRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"param",
"value",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Param,
Value,
}
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 {
"param" => Ok(GeneratedField::Param),
"value" => Ok(GeneratedField::Value),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SetSystemParamRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.SetSystemParamRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SetSystemParamRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut param__ = None;
let mut value__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Param => {
if param__.is_some() {
return Err(serde::de::Error::duplicate_field("param"));
}
param__ = Some(map_.next_value()?);
}
GeneratedField::Value => {
if value__.is_some() {
return Err(serde::de::Error::duplicate_field("value"));
}
value__ = map_.next_value()?;
}
}
}
Ok(SetSystemParamRequest {
param: param__.unwrap_or_default(),
value: value__,
})
}
}
deserializer.deserialize_struct("meta.SetSystemParamRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SetSystemParamResponse {
#[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.params.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.SetSystemParamResponse", len)?;
if let Some(v) = self.params.as_ref() {
struct_ser.serialize_field("params", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SetSystemParamResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"params",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Params,
}
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 {
"params" => Ok(GeneratedField::Params),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SetSystemParamResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.SetSystemParamResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SetSystemParamResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut params__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Params => {
if params__.is_some() {
return Err(serde::de::Error::duplicate_field("params"));
}
params__ = map_.next_value()?;
}
}
}
Ok(SetSystemParamResponse {
params: params__,
})
}
}
deserializer.deserialize_struct("meta.SetSystemParamResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SubscribeRequest {
#[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.subscribe_type != 0 {
len += 1;
}
if self.host.is_some() {
len += 1;
}
if self.worker_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.SubscribeRequest", len)?;
if self.subscribe_type != 0 {
let v = SubscribeType::try_from(self.subscribe_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.subscribe_type)))?;
struct_ser.serialize_field("subscribeType", &v)?;
}
if let Some(v) = self.host.as_ref() {
struct_ser.serialize_field("host", v)?;
}
if self.worker_id != 0 {
struct_ser.serialize_field("workerId", &self.worker_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SubscribeRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"subscribe_type",
"subscribeType",
"host",
"worker_id",
"workerId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SubscribeType,
Host,
WorkerId,
}
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 {
"subscribeType" | "subscribe_type" => Ok(GeneratedField::SubscribeType),
"host" => Ok(GeneratedField::Host),
"workerId" | "worker_id" => Ok(GeneratedField::WorkerId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SubscribeRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.SubscribeRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SubscribeRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut subscribe_type__ = None;
let mut host__ = None;
let mut worker_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::SubscribeType => {
if subscribe_type__.is_some() {
return Err(serde::de::Error::duplicate_field("subscribeType"));
}
subscribe_type__ = Some(map_.next_value::<SubscribeType>()? as i32);
}
GeneratedField::Host => {
if host__.is_some() {
return Err(serde::de::Error::duplicate_field("host"));
}
host__ = map_.next_value()?;
}
GeneratedField::WorkerId => {
if worker_id__.is_some() {
return Err(serde::de::Error::duplicate_field("workerId"));
}
worker_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(SubscribeRequest {
subscribe_type: subscribe_type__.unwrap_or_default(),
host: host__,
worker_id: worker_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.SubscribeRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SubscribeResponse {
#[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;
}
if self.operation != 0 {
len += 1;
}
if self.version != 0 {
len += 1;
}
if self.info.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.SubscribeResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if self.operation != 0 {
let v = subscribe_response::Operation::try_from(self.operation)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.operation)))?;
struct_ser.serialize_field("operation", &v)?;
}
if self.version != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("version", ToString::to_string(&self.version).as_str())?;
}
if let Some(v) = self.info.as_ref() {
match v {
subscribe_response::Info::Database(v) => {
struct_ser.serialize_field("database", v)?;
}
subscribe_response::Info::Schema(v) => {
struct_ser.serialize_field("schema", v)?;
}
subscribe_response::Info::Function(v) => {
struct_ser.serialize_field("function", v)?;
}
subscribe_response::Info::User(v) => {
struct_ser.serialize_field("user", v)?;
}
subscribe_response::Info::SessionParam(v) => {
struct_ser.serialize_field("sessionParam", v)?;
}
subscribe_response::Info::Node(v) => {
struct_ser.serialize_field("node", v)?;
}
subscribe_response::Info::HummockVersionDeltas(v) => {
struct_ser.serialize_field("hummockVersionDeltas", v)?;
}
subscribe_response::Info::Snapshot(v) => {
struct_ser.serialize_field("snapshot", v)?;
}
subscribe_response::Info::MetaBackupManifestId(v) => {
struct_ser.serialize_field("metaBackupManifestId", v)?;
}
subscribe_response::Info::SystemParams(v) => {
struct_ser.serialize_field("systemParams", v)?;
}
subscribe_response::Info::HummockWriteLimits(v) => {
struct_ser.serialize_field("hummockWriteLimits", v)?;
}
subscribe_response::Info::RelationGroup(v) => {
struct_ser.serialize_field("relationGroup", v)?;
}
subscribe_response::Info::Connection(v) => {
struct_ser.serialize_field("connection", v)?;
}
subscribe_response::Info::HummockStats(v) => {
struct_ser.serialize_field("hummockStats", v)?;
}
subscribe_response::Info::Recovery(v) => {
struct_ser.serialize_field("recovery", v)?;
}
subscribe_response::Info::StreamingWorkerSlotMapping(v) => {
struct_ser.serialize_field("streamingWorkerSlotMapping", v)?;
}
subscribe_response::Info::ServingWorkerSlotMappings(v) => {
struct_ser.serialize_field("servingWorkerSlotMappings", v)?;
}
subscribe_response::Info::Secret(v) => {
struct_ser.serialize_field("secret", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SubscribeResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"operation",
"version",
"database",
"schema",
"function",
"user",
"session_param",
"sessionParam",
"node",
"hummock_version_deltas",
"hummockVersionDeltas",
"snapshot",
"meta_backup_manifest_id",
"metaBackupManifestId",
"system_params",
"systemParams",
"hummock_write_limits",
"hummockWriteLimits",
"relation_group",
"relationGroup",
"connection",
"hummock_stats",
"hummockStats",
"recovery",
"streaming_worker_slot_mapping",
"streamingWorkerSlotMapping",
"serving_worker_slot_mappings",
"servingWorkerSlotMappings",
"secret",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
Operation,
Version,
Database,
Schema,
Function,
User,
SessionParam,
Node,
HummockVersionDeltas,
Snapshot,
MetaBackupManifestId,
SystemParams,
HummockWriteLimits,
RelationGroup,
Connection,
HummockStats,
Recovery,
StreamingWorkerSlotMapping,
ServingWorkerSlotMappings,
Secret,
}
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),
"operation" => Ok(GeneratedField::Operation),
"version" => Ok(GeneratedField::Version),
"database" => Ok(GeneratedField::Database),
"schema" => Ok(GeneratedField::Schema),
"function" => Ok(GeneratedField::Function),
"user" => Ok(GeneratedField::User),
"sessionParam" | "session_param" => Ok(GeneratedField::SessionParam),
"node" => Ok(GeneratedField::Node),
"hummockVersionDeltas" | "hummock_version_deltas" => Ok(GeneratedField::HummockVersionDeltas),
"snapshot" => Ok(GeneratedField::Snapshot),
"metaBackupManifestId" | "meta_backup_manifest_id" => Ok(GeneratedField::MetaBackupManifestId),
"systemParams" | "system_params" => Ok(GeneratedField::SystemParams),
"hummockWriteLimits" | "hummock_write_limits" => Ok(GeneratedField::HummockWriteLimits),
"relationGroup" | "relation_group" => Ok(GeneratedField::RelationGroup),
"connection" => Ok(GeneratedField::Connection),
"hummockStats" | "hummock_stats" => Ok(GeneratedField::HummockStats),
"recovery" => Ok(GeneratedField::Recovery),
"streamingWorkerSlotMapping" | "streaming_worker_slot_mapping" => Ok(GeneratedField::StreamingWorkerSlotMapping),
"servingWorkerSlotMappings" | "serving_worker_slot_mappings" => Ok(GeneratedField::ServingWorkerSlotMappings),
"secret" => Ok(GeneratedField::Secret),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SubscribeResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.SubscribeResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SubscribeResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut operation__ = None;
let mut version__ = None;
let mut info__ = 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()?;
}
GeneratedField::Operation => {
if operation__.is_some() {
return Err(serde::de::Error::duplicate_field("operation"));
}
operation__ = Some(map_.next_value::<subscribe_response::Operation>()? as i32);
}
GeneratedField::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Database => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("database"));
}
info__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_response::Info::Database)
;
}
GeneratedField::Schema => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("schema"));
}
info__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_response::Info::Schema)
;
}
GeneratedField::Function => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("function"));
}
info__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_response::Info::Function)
;
}
GeneratedField::User => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("user"));
}
info__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_response::Info::User)
;
}
GeneratedField::SessionParam => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("sessionParam"));
}
info__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_response::Info::SessionParam)
;
}
GeneratedField::Node => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("node"));
}
info__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_response::Info::Node)
;
}
GeneratedField::HummockVersionDeltas => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("hummockVersionDeltas"));
}
info__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_response::Info::HummockVersionDeltas)
;
}
GeneratedField::Snapshot => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("snapshot"));
}
info__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_response::Info::Snapshot)
;
}
GeneratedField::MetaBackupManifestId => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("metaBackupManifestId"));
}
info__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_response::Info::MetaBackupManifestId)
;
}
GeneratedField::SystemParams => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("systemParams"));
}
info__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_response::Info::SystemParams)
;
}
GeneratedField::HummockWriteLimits => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("hummockWriteLimits"));
}
info__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_response::Info::HummockWriteLimits)
;
}
GeneratedField::RelationGroup => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("relationGroup"));
}
info__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_response::Info::RelationGroup)
;
}
GeneratedField::Connection => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("connection"));
}
info__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_response::Info::Connection)
;
}
GeneratedField::HummockStats => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("hummockStats"));
}
info__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_response::Info::HummockStats)
;
}
GeneratedField::Recovery => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("recovery"));
}
info__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_response::Info::Recovery)
;
}
GeneratedField::StreamingWorkerSlotMapping => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("streamingWorkerSlotMapping"));
}
info__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_response::Info::StreamingWorkerSlotMapping)
;
}
GeneratedField::ServingWorkerSlotMappings => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("servingWorkerSlotMappings"));
}
info__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_response::Info::ServingWorkerSlotMappings)
;
}
GeneratedField::Secret => {
if info__.is_some() {
return Err(serde::de::Error::duplicate_field("secret"));
}
info__ = map_.next_value::<::std::option::Option<_>>()?.map(subscribe_response::Info::Secret)
;
}
}
}
Ok(SubscribeResponse {
status: status__,
operation: operation__.unwrap_or_default(),
version: version__.unwrap_or_default(),
info: info__,
})
}
}
deserializer.deserialize_struct("meta.SubscribeResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for subscribe_response::Operation {
#[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::Add => "ADD",
Self::Delete => "DELETE",
Self::Update => "UPDATE",
Self::Snapshot => "SNAPSHOT",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for subscribe_response::Operation {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"UNSPECIFIED",
"ADD",
"DELETE",
"UPDATE",
"SNAPSHOT",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = subscribe_response::Operation;
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(subscribe_response::Operation::Unspecified),
"ADD" => Ok(subscribe_response::Operation::Add),
"DELETE" => Ok(subscribe_response::Operation::Delete),
"UPDATE" => Ok(subscribe_response::Operation::Update),
"SNAPSHOT" => Ok(subscribe_response::Operation::Snapshot),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for SubscribeType {
#[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::Frontend => "FRONTEND",
Self::Hummock => "HUMMOCK",
Self::Compactor => "COMPACTOR",
Self::Compute => "COMPUTE",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for SubscribeType {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"UNSPECIFIED",
"FRONTEND",
"HUMMOCK",
"COMPACTOR",
"COMPUTE",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SubscribeType;
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(SubscribeType::Unspecified),
"FRONTEND" => Ok(SubscribeType::Frontend),
"HUMMOCK" => Ok(SubscribeType::Hummock),
"COMPACTOR" => Ok(SubscribeType::Compactor),
"COMPUTE" => Ok(SubscribeType::Compute),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for SystemParams {
#[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.barrier_interval_ms.is_some() {
len += 1;
}
if self.checkpoint_frequency.is_some() {
len += 1;
}
if self.sstable_size_mb.is_some() {
len += 1;
}
if self.block_size_kb.is_some() {
len += 1;
}
if self.bloom_false_positive.is_some() {
len += 1;
}
if self.state_store.is_some() {
len += 1;
}
if self.data_directory.is_some() {
len += 1;
}
if self.backup_storage_url.is_some() {
len += 1;
}
if self.backup_storage_directory.is_some() {
len += 1;
}
if self.telemetry_enabled.is_some() {
len += 1;
}
if self.parallel_compact_size_mb.is_some() {
len += 1;
}
if self.max_concurrent_creating_streaming_jobs.is_some() {
len += 1;
}
if self.pause_on_next_bootstrap.is_some() {
len += 1;
}
if self.wasm_storage_url.is_some() {
len += 1;
}
if self.enable_tracing.is_some() {
len += 1;
}
if self.use_new_object_prefix_strategy.is_some() {
len += 1;
}
if self.license_key.is_some() {
len += 1;
}
if self.time_travel_retention_ms.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.SystemParams", len)?;
if let Some(v) = self.barrier_interval_ms.as_ref() {
struct_ser.serialize_field("barrierIntervalMs", v)?;
}
if let Some(v) = self.checkpoint_frequency.as_ref() {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("checkpointFrequency", ToString::to_string(&v).as_str())?;
}
if let Some(v) = self.sstable_size_mb.as_ref() {
struct_ser.serialize_field("sstableSizeMb", v)?;
}
if let Some(v) = self.block_size_kb.as_ref() {
struct_ser.serialize_field("blockSizeKb", v)?;
}
if let Some(v) = self.bloom_false_positive.as_ref() {
struct_ser.serialize_field("bloomFalsePositive", v)?;
}
if let Some(v) = self.state_store.as_ref() {
struct_ser.serialize_field("stateStore", v)?;
}
if let Some(v) = self.data_directory.as_ref() {
struct_ser.serialize_field("dataDirectory", v)?;
}
if let Some(v) = self.backup_storage_url.as_ref() {
struct_ser.serialize_field("backupStorageUrl", v)?;
}
if let Some(v) = self.backup_storage_directory.as_ref() {
struct_ser.serialize_field("backupStorageDirectory", v)?;
}
if let Some(v) = self.telemetry_enabled.as_ref() {
struct_ser.serialize_field("telemetryEnabled", v)?;
}
if let Some(v) = self.parallel_compact_size_mb.as_ref() {
struct_ser.serialize_field("parallelCompactSizeMb", v)?;
}
if let Some(v) = self.max_concurrent_creating_streaming_jobs.as_ref() {
struct_ser.serialize_field("maxConcurrentCreatingStreamingJobs", v)?;
}
if let Some(v) = self.pause_on_next_bootstrap.as_ref() {
struct_ser.serialize_field("pauseOnNextBootstrap", v)?;
}
if let Some(v) = self.wasm_storage_url.as_ref() {
struct_ser.serialize_field("wasmStorageUrl", v)?;
}
if let Some(v) = self.enable_tracing.as_ref() {
struct_ser.serialize_field("enableTracing", v)?;
}
if let Some(v) = self.use_new_object_prefix_strategy.as_ref() {
struct_ser.serialize_field("useNewObjectPrefixStrategy", v)?;
}
if let Some(v) = self.license_key.as_ref() {
struct_ser.serialize_field("licenseKey", v)?;
}
if let Some(v) = self.time_travel_retention_ms.as_ref() {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("timeTravelRetentionMs", ToString::to_string(&v).as_str())?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SystemParams {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"barrier_interval_ms",
"barrierIntervalMs",
"checkpoint_frequency",
"checkpointFrequency",
"sstable_size_mb",
"sstableSizeMb",
"block_size_kb",
"blockSizeKb",
"bloom_false_positive",
"bloomFalsePositive",
"state_store",
"stateStore",
"data_directory",
"dataDirectory",
"backup_storage_url",
"backupStorageUrl",
"backup_storage_directory",
"backupStorageDirectory",
"telemetry_enabled",
"telemetryEnabled",
"parallel_compact_size_mb",
"parallelCompactSizeMb",
"max_concurrent_creating_streaming_jobs",
"maxConcurrentCreatingStreamingJobs",
"pause_on_next_bootstrap",
"pauseOnNextBootstrap",
"wasm_storage_url",
"wasmStorageUrl",
"enable_tracing",
"enableTracing",
"use_new_object_prefix_strategy",
"useNewObjectPrefixStrategy",
"license_key",
"licenseKey",
"time_travel_retention_ms",
"timeTravelRetentionMs",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
BarrierIntervalMs,
CheckpointFrequency,
SstableSizeMb,
BlockSizeKb,
BloomFalsePositive,
StateStore,
DataDirectory,
BackupStorageUrl,
BackupStorageDirectory,
TelemetryEnabled,
ParallelCompactSizeMb,
MaxConcurrentCreatingStreamingJobs,
PauseOnNextBootstrap,
WasmStorageUrl,
EnableTracing,
UseNewObjectPrefixStrategy,
LicenseKey,
TimeTravelRetentionMs,
}
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 {
"barrierIntervalMs" | "barrier_interval_ms" => Ok(GeneratedField::BarrierIntervalMs),
"checkpointFrequency" | "checkpoint_frequency" => Ok(GeneratedField::CheckpointFrequency),
"sstableSizeMb" | "sstable_size_mb" => Ok(GeneratedField::SstableSizeMb),
"blockSizeKb" | "block_size_kb" => Ok(GeneratedField::BlockSizeKb),
"bloomFalsePositive" | "bloom_false_positive" => Ok(GeneratedField::BloomFalsePositive),
"stateStore" | "state_store" => Ok(GeneratedField::StateStore),
"dataDirectory" | "data_directory" => Ok(GeneratedField::DataDirectory),
"backupStorageUrl" | "backup_storage_url" => Ok(GeneratedField::BackupStorageUrl),
"backupStorageDirectory" | "backup_storage_directory" => Ok(GeneratedField::BackupStorageDirectory),
"telemetryEnabled" | "telemetry_enabled" => Ok(GeneratedField::TelemetryEnabled),
"parallelCompactSizeMb" | "parallel_compact_size_mb" => Ok(GeneratedField::ParallelCompactSizeMb),
"maxConcurrentCreatingStreamingJobs" | "max_concurrent_creating_streaming_jobs" => Ok(GeneratedField::MaxConcurrentCreatingStreamingJobs),
"pauseOnNextBootstrap" | "pause_on_next_bootstrap" => Ok(GeneratedField::PauseOnNextBootstrap),
"wasmStorageUrl" | "wasm_storage_url" => Ok(GeneratedField::WasmStorageUrl),
"enableTracing" | "enable_tracing" => Ok(GeneratedField::EnableTracing),
"useNewObjectPrefixStrategy" | "use_new_object_prefix_strategy" => Ok(GeneratedField::UseNewObjectPrefixStrategy),
"licenseKey" | "license_key" => Ok(GeneratedField::LicenseKey),
"timeTravelRetentionMs" | "time_travel_retention_ms" => Ok(GeneratedField::TimeTravelRetentionMs),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SystemParams;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.SystemParams")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SystemParams, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut barrier_interval_ms__ = None;
let mut checkpoint_frequency__ = None;
let mut sstable_size_mb__ = None;
let mut block_size_kb__ = None;
let mut bloom_false_positive__ = None;
let mut state_store__ = None;
let mut data_directory__ = None;
let mut backup_storage_url__ = None;
let mut backup_storage_directory__ = None;
let mut telemetry_enabled__ = None;
let mut parallel_compact_size_mb__ = None;
let mut max_concurrent_creating_streaming_jobs__ = None;
let mut pause_on_next_bootstrap__ = None;
let mut wasm_storage_url__ = None;
let mut enable_tracing__ = None;
let mut use_new_object_prefix_strategy__ = None;
let mut license_key__ = None;
let mut time_travel_retention_ms__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::BarrierIntervalMs => {
if barrier_interval_ms__.is_some() {
return Err(serde::de::Error::duplicate_field("barrierIntervalMs"));
}
barrier_interval_ms__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::CheckpointFrequency => {
if checkpoint_frequency__.is_some() {
return Err(serde::de::Error::duplicate_field("checkpointFrequency"));
}
checkpoint_frequency__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::SstableSizeMb => {
if sstable_size_mb__.is_some() {
return Err(serde::de::Error::duplicate_field("sstableSizeMb"));
}
sstable_size_mb__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::BlockSizeKb => {
if block_size_kb__.is_some() {
return Err(serde::de::Error::duplicate_field("blockSizeKb"));
}
block_size_kb__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::BloomFalsePositive => {
if bloom_false_positive__.is_some() {
return Err(serde::de::Error::duplicate_field("bloomFalsePositive"));
}
bloom_false_positive__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::StateStore => {
if state_store__.is_some() {
return Err(serde::de::Error::duplicate_field("stateStore"));
}
state_store__ = map_.next_value()?;
}
GeneratedField::DataDirectory => {
if data_directory__.is_some() {
return Err(serde::de::Error::duplicate_field("dataDirectory"));
}
data_directory__ = map_.next_value()?;
}
GeneratedField::BackupStorageUrl => {
if backup_storage_url__.is_some() {
return Err(serde::de::Error::duplicate_field("backupStorageUrl"));
}
backup_storage_url__ = map_.next_value()?;
}
GeneratedField::BackupStorageDirectory => {
if backup_storage_directory__.is_some() {
return Err(serde::de::Error::duplicate_field("backupStorageDirectory"));
}
backup_storage_directory__ = map_.next_value()?;
}
GeneratedField::TelemetryEnabled => {
if telemetry_enabled__.is_some() {
return Err(serde::de::Error::duplicate_field("telemetryEnabled"));
}
telemetry_enabled__ = map_.next_value()?;
}
GeneratedField::ParallelCompactSizeMb => {
if parallel_compact_size_mb__.is_some() {
return Err(serde::de::Error::duplicate_field("parallelCompactSizeMb"));
}
parallel_compact_size_mb__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::MaxConcurrentCreatingStreamingJobs => {
if max_concurrent_creating_streaming_jobs__.is_some() {
return Err(serde::de::Error::duplicate_field("maxConcurrentCreatingStreamingJobs"));
}
max_concurrent_creating_streaming_jobs__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::PauseOnNextBootstrap => {
if pause_on_next_bootstrap__.is_some() {
return Err(serde::de::Error::duplicate_field("pauseOnNextBootstrap"));
}
pause_on_next_bootstrap__ = map_.next_value()?;
}
GeneratedField::WasmStorageUrl => {
if wasm_storage_url__.is_some() {
return Err(serde::de::Error::duplicate_field("wasmStorageUrl"));
}
wasm_storage_url__ = map_.next_value()?;
}
GeneratedField::EnableTracing => {
if enable_tracing__.is_some() {
return Err(serde::de::Error::duplicate_field("enableTracing"));
}
enable_tracing__ = map_.next_value()?;
}
GeneratedField::UseNewObjectPrefixStrategy => {
if use_new_object_prefix_strategy__.is_some() {
return Err(serde::de::Error::duplicate_field("useNewObjectPrefixStrategy"));
}
use_new_object_prefix_strategy__ = map_.next_value()?;
}
GeneratedField::LicenseKey => {
if license_key__.is_some() {
return Err(serde::de::Error::duplicate_field("licenseKey"));
}
license_key__ = map_.next_value()?;
}
GeneratedField::TimeTravelRetentionMs => {
if time_travel_retention_ms__.is_some() {
return Err(serde::de::Error::duplicate_field("timeTravelRetentionMs"));
}
time_travel_retention_ms__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
}
}
Ok(SystemParams {
barrier_interval_ms: barrier_interval_ms__,
checkpoint_frequency: checkpoint_frequency__,
sstable_size_mb: sstable_size_mb__,
block_size_kb: block_size_kb__,
bloom_false_positive: bloom_false_positive__,
state_store: state_store__,
data_directory: data_directory__,
backup_storage_url: backup_storage_url__,
backup_storage_directory: backup_storage_directory__,
telemetry_enabled: telemetry_enabled__,
parallel_compact_size_mb: parallel_compact_size_mb__,
max_concurrent_creating_streaming_jobs: max_concurrent_creating_streaming_jobs__,
pause_on_next_bootstrap: pause_on_next_bootstrap__,
wasm_storage_url: wasm_storage_url__,
enable_tracing: enable_tracing__,
use_new_object_prefix_strategy: use_new_object_prefix_strategy__,
license_key: license_key__,
time_travel_retention_ms: time_travel_retention_ms__,
})
}
}
deserializer.deserialize_struct("meta.SystemParams", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for TableFragments {
#[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.table_id != 0 {
len += 1;
}
if self.state != 0 {
len += 1;
}
if !self.fragments.is_empty() {
len += 1;
}
if !self.actor_status.is_empty() {
len += 1;
}
if !self.actor_splits.is_empty() {
len += 1;
}
if self.ctx.is_some() {
len += 1;
}
if self.parallelism.is_some() {
len += 1;
}
if self.max_parallelism.is_some() {
len += 1;
}
if !self.node_label.is_empty() {
len += 1;
}
if self.backfill_done {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.TableFragments", len)?;
if self.table_id != 0 {
struct_ser.serialize_field("tableId", &self.table_id)?;
}
if self.state != 0 {
let v = table_fragments::State::try_from(self.state)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.state)))?;
struct_ser.serialize_field("state", &v)?;
}
if !self.fragments.is_empty() {
struct_ser.serialize_field("fragments", &self.fragments)?;
}
if !self.actor_status.is_empty() {
struct_ser.serialize_field("actorStatus", &self.actor_status)?;
}
if !self.actor_splits.is_empty() {
struct_ser.serialize_field("actorSplits", &self.actor_splits)?;
}
if let Some(v) = self.ctx.as_ref() {
struct_ser.serialize_field("ctx", v)?;
}
if let Some(v) = self.parallelism.as_ref() {
struct_ser.serialize_field("parallelism", v)?;
}
if let Some(v) = self.max_parallelism.as_ref() {
struct_ser.serialize_field("maxParallelism", v)?;
}
if !self.node_label.is_empty() {
struct_ser.serialize_field("nodeLabel", &self.node_label)?;
}
if self.backfill_done {
struct_ser.serialize_field("backfillDone", &self.backfill_done)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TableFragments {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table_id",
"tableId",
"state",
"fragments",
"actor_status",
"actorStatus",
"actor_splits",
"actorSplits",
"ctx",
"parallelism",
"max_parallelism",
"maxParallelism",
"node_label",
"nodeLabel",
"backfill_done",
"backfillDone",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableId,
State,
Fragments,
ActorStatus,
ActorSplits,
Ctx,
Parallelism,
MaxParallelism,
NodeLabel,
BackfillDone,
}
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 {
"tableId" | "table_id" => Ok(GeneratedField::TableId),
"state" => Ok(GeneratedField::State),
"fragments" => Ok(GeneratedField::Fragments),
"actorStatus" | "actor_status" => Ok(GeneratedField::ActorStatus),
"actorSplits" | "actor_splits" => Ok(GeneratedField::ActorSplits),
"ctx" => Ok(GeneratedField::Ctx),
"parallelism" => Ok(GeneratedField::Parallelism),
"maxParallelism" | "max_parallelism" => Ok(GeneratedField::MaxParallelism),
"nodeLabel" | "node_label" => Ok(GeneratedField::NodeLabel),
"backfillDone" | "backfill_done" => Ok(GeneratedField::BackfillDone),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TableFragments;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.TableFragments")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TableFragments, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_id__ = None;
let mut state__ = None;
let mut fragments__ = None;
let mut actor_status__ = None;
let mut actor_splits__ = None;
let mut ctx__ = None;
let mut parallelism__ = None;
let mut max_parallelism__ = None;
let mut node_label__ = None;
let mut backfill_done__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TableId => {
if table_id__.is_some() {
return Err(serde::de::Error::duplicate_field("tableId"));
}
table_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::State => {
if state__.is_some() {
return Err(serde::de::Error::duplicate_field("state"));
}
state__ = Some(map_.next_value::<table_fragments::State>()? as i32);
}
GeneratedField::Fragments => {
if fragments__.is_some() {
return Err(serde::de::Error::duplicate_field("fragments"));
}
fragments__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::ActorStatus => {
if actor_status__.is_some() {
return Err(serde::de::Error::duplicate_field("actorStatus"));
}
actor_status__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::ActorSplits => {
if actor_splits__.is_some() {
return Err(serde::de::Error::duplicate_field("actorSplits"));
}
actor_splits__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
GeneratedField::Ctx => {
if ctx__.is_some() {
return Err(serde::de::Error::duplicate_field("ctx"));
}
ctx__ = map_.next_value()?;
}
GeneratedField::Parallelism => {
if parallelism__.is_some() {
return Err(serde::de::Error::duplicate_field("parallelism"));
}
parallelism__ = map_.next_value()?;
}
GeneratedField::MaxParallelism => {
if max_parallelism__.is_some() {
return Err(serde::de::Error::duplicate_field("maxParallelism"));
}
max_parallelism__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
GeneratedField::NodeLabel => {
if node_label__.is_some() {
return Err(serde::de::Error::duplicate_field("nodeLabel"));
}
node_label__ = Some(map_.next_value()?);
}
GeneratedField::BackfillDone => {
if backfill_done__.is_some() {
return Err(serde::de::Error::duplicate_field("backfillDone"));
}
backfill_done__ = Some(map_.next_value()?);
}
}
}
Ok(TableFragments {
table_id: table_id__.unwrap_or_default(),
state: state__.unwrap_or_default(),
fragments: fragments__.unwrap_or_default(),
actor_status: actor_status__.unwrap_or_default(),
actor_splits: actor_splits__.unwrap_or_default(),
ctx: ctx__,
parallelism: parallelism__,
max_parallelism: max_parallelism__,
node_label: node_label__.unwrap_or_default(),
backfill_done: backfill_done__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.TableFragments", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for table_fragments::ActorStatus {
#[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.location.is_some() {
len += 1;
}
if self.state != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.TableFragments.ActorStatus", len)?;
if let Some(v) = self.location.as_ref() {
struct_ser.serialize_field("location", v)?;
}
if self.state != 0 {
let v = table_fragments::actor_status::ActorState::try_from(self.state)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.state)))?;
struct_ser.serialize_field("state", &v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for table_fragments::ActorStatus {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"location",
"state",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Location,
State,
}
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 {
"location" => Ok(GeneratedField::Location),
"state" => Ok(GeneratedField::State),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = table_fragments::ActorStatus;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.TableFragments.ActorStatus")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<table_fragments::ActorStatus, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut location__ = None;
let mut state__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Location => {
if location__.is_some() {
return Err(serde::de::Error::duplicate_field("location"));
}
location__ = map_.next_value()?;
}
GeneratedField::State => {
if state__.is_some() {
return Err(serde::de::Error::duplicate_field("state"));
}
state__ = Some(map_.next_value::<table_fragments::actor_status::ActorState>()? as i32);
}
}
}
Ok(table_fragments::ActorStatus {
location: location__,
state: state__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.TableFragments.ActorStatus", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for table_fragments::actor_status::ActorState {
#[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::Inactive => "INACTIVE",
Self::Running => "RUNNING",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for table_fragments::actor_status::ActorState {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"UNSPECIFIED",
"INACTIVE",
"RUNNING",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = table_fragments::actor_status::ActorState;
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(table_fragments::actor_status::ActorState::Unspecified),
"INACTIVE" => Ok(table_fragments::actor_status::ActorState::Inactive),
"RUNNING" => Ok(table_fragments::actor_status::ActorState::Running),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for table_fragments::Fragment {
#[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.fragment_id != 0 {
len += 1;
}
if self.fragment_type_mask != 0 {
len += 1;
}
if self.distribution_type != 0 {
len += 1;
}
if !self.actors.is_empty() {
len += 1;
}
if !self.state_table_ids.is_empty() {
len += 1;
}
if !self.upstream_fragment_ids.is_empty() {
len += 1;
}
if self.maybe_vnode_count.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.TableFragments.Fragment", len)?;
if self.fragment_id != 0 {
struct_ser.serialize_field("fragmentId", &self.fragment_id)?;
}
if self.fragment_type_mask != 0 {
struct_ser.serialize_field("fragmentTypeMask", &self.fragment_type_mask)?;
}
if self.distribution_type != 0 {
let v = table_fragments::fragment::FragmentDistributionType::try_from(self.distribution_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.distribution_type)))?;
struct_ser.serialize_field("distributionType", &v)?;
}
if !self.actors.is_empty() {
struct_ser.serialize_field("actors", &self.actors)?;
}
if !self.state_table_ids.is_empty() {
struct_ser.serialize_field("stateTableIds", &self.state_table_ids)?;
}
if !self.upstream_fragment_ids.is_empty() {
struct_ser.serialize_field("upstreamFragmentIds", &self.upstream_fragment_ids)?;
}
if let Some(v) = self.maybe_vnode_count.as_ref() {
struct_ser.serialize_field("maybeVnodeCount", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for table_fragments::Fragment {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"fragment_id",
"fragmentId",
"fragment_type_mask",
"fragmentTypeMask",
"distribution_type",
"distributionType",
"actors",
"state_table_ids",
"stateTableIds",
"upstream_fragment_ids",
"upstreamFragmentIds",
"maybe_vnode_count",
"maybeVnodeCount",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
FragmentId,
FragmentTypeMask,
DistributionType,
Actors,
StateTableIds,
UpstreamFragmentIds,
MaybeVnodeCount,
}
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 {
"fragmentId" | "fragment_id" => Ok(GeneratedField::FragmentId),
"fragmentTypeMask" | "fragment_type_mask" => Ok(GeneratedField::FragmentTypeMask),
"distributionType" | "distribution_type" => Ok(GeneratedField::DistributionType),
"actors" => Ok(GeneratedField::Actors),
"stateTableIds" | "state_table_ids" => Ok(GeneratedField::StateTableIds),
"upstreamFragmentIds" | "upstream_fragment_ids" => Ok(GeneratedField::UpstreamFragmentIds),
"maybeVnodeCount" | "maybe_vnode_count" => Ok(GeneratedField::MaybeVnodeCount),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = table_fragments::Fragment;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.TableFragments.Fragment")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<table_fragments::Fragment, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut fragment_id__ = None;
let mut fragment_type_mask__ = None;
let mut distribution_type__ = None;
let mut actors__ = None;
let mut state_table_ids__ = None;
let mut upstream_fragment_ids__ = None;
let mut maybe_vnode_count__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::FragmentId => {
if fragment_id__.is_some() {
return Err(serde::de::Error::duplicate_field("fragmentId"));
}
fragment_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::FragmentTypeMask => {
if fragment_type_mask__.is_some() {
return Err(serde::de::Error::duplicate_field("fragmentTypeMask"));
}
fragment_type_mask__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::DistributionType => {
if distribution_type__.is_some() {
return Err(serde::de::Error::duplicate_field("distributionType"));
}
distribution_type__ = Some(map_.next_value::<table_fragments::fragment::FragmentDistributionType>()? as i32);
}
GeneratedField::Actors => {
if actors__.is_some() {
return Err(serde::de::Error::duplicate_field("actors"));
}
actors__ = Some(map_.next_value()?);
}
GeneratedField::StateTableIds => {
if state_table_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("stateTableIds"));
}
state_table_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::UpstreamFragmentIds => {
if upstream_fragment_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("upstreamFragmentIds"));
}
upstream_fragment_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::MaybeVnodeCount => {
if maybe_vnode_count__.is_some() {
return Err(serde::de::Error::duplicate_field("maybeVnodeCount"));
}
maybe_vnode_count__ =
map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0)
;
}
}
}
Ok(table_fragments::Fragment {
fragment_id: fragment_id__.unwrap_or_default(),
fragment_type_mask: fragment_type_mask__.unwrap_or_default(),
distribution_type: distribution_type__.unwrap_or_default(),
actors: actors__.unwrap_or_default(),
state_table_ids: state_table_ids__.unwrap_or_default(),
upstream_fragment_ids: upstream_fragment_ids__.unwrap_or_default(),
maybe_vnode_count: maybe_vnode_count__,
})
}
}
deserializer.deserialize_struct("meta.TableFragments.Fragment", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for table_fragments::fragment::FragmentDistributionType {
#[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::Single => "SINGLE",
Self::Hash => "HASH",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for table_fragments::fragment::FragmentDistributionType {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"UNSPECIFIED",
"SINGLE",
"HASH",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = table_fragments::fragment::FragmentDistributionType;
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(table_fragments::fragment::FragmentDistributionType::Unspecified),
"SINGLE" => Ok(table_fragments::fragment::FragmentDistributionType::Single),
"HASH" => Ok(table_fragments::fragment::FragmentDistributionType::Hash),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for table_fragments::State {
#[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::Initial => "INITIAL",
Self::Creating => "CREATING",
Self::Created => "CREATED",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for table_fragments::State {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"UNSPECIFIED",
"INITIAL",
"CREATING",
"CREATED",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = table_fragments::State;
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(table_fragments::State::Unspecified),
"INITIAL" => Ok(table_fragments::State::Initial),
"CREATING" => Ok(table_fragments::State::Creating),
"CREATED" => Ok(table_fragments::State::Created),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for TableParallelism {
#[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.parallelism.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.TableParallelism", len)?;
if let Some(v) = self.parallelism.as_ref() {
match v {
table_parallelism::Parallelism::Fixed(v) => {
struct_ser.serialize_field("fixed", v)?;
}
table_parallelism::Parallelism::Auto(v) => {
struct_ser.serialize_field("auto", v)?;
}
table_parallelism::Parallelism::Custom(v) => {
struct_ser.serialize_field("custom", v)?;
}
table_parallelism::Parallelism::Adaptive(v) => {
struct_ser.serialize_field("adaptive", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TableParallelism {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"fixed",
"auto",
"custom",
"adaptive",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Fixed,
Auto,
Custom,
Adaptive,
}
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 {
"fixed" => Ok(GeneratedField::Fixed),
"auto" => Ok(GeneratedField::Auto),
"custom" => Ok(GeneratedField::Custom),
"adaptive" => Ok(GeneratedField::Adaptive),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TableParallelism;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.TableParallelism")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TableParallelism, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut parallelism__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Fixed => {
if parallelism__.is_some() {
return Err(serde::de::Error::duplicate_field("fixed"));
}
parallelism__ = map_.next_value::<::std::option::Option<_>>()?.map(table_parallelism::Parallelism::Fixed)
;
}
GeneratedField::Auto => {
if parallelism__.is_some() {
return Err(serde::de::Error::duplicate_field("auto"));
}
parallelism__ = map_.next_value::<::std::option::Option<_>>()?.map(table_parallelism::Parallelism::Auto)
;
}
GeneratedField::Custom => {
if parallelism__.is_some() {
return Err(serde::de::Error::duplicate_field("custom"));
}
parallelism__ = map_.next_value::<::std::option::Option<_>>()?.map(table_parallelism::Parallelism::Custom)
;
}
GeneratedField::Adaptive => {
if parallelism__.is_some() {
return Err(serde::de::Error::duplicate_field("adaptive"));
}
parallelism__ = map_.next_value::<::std::option::Option<_>>()?.map(table_parallelism::Parallelism::Adaptive)
;
}
}
}
Ok(TableParallelism {
parallelism: parallelism__,
})
}
}
deserializer.deserialize_struct("meta.TableParallelism", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for table_parallelism::AdaptiveParallelism {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.TableParallelism.AdaptiveParallelism", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for table_parallelism::AdaptiveParallelism {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = table_parallelism::AdaptiveParallelism;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.TableParallelism.AdaptiveParallelism")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<table_parallelism::AdaptiveParallelism, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(table_parallelism::AdaptiveParallelism {
})
}
}
deserializer.deserialize_struct("meta.TableParallelism.AdaptiveParallelism", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for table_parallelism::AutoParallelism {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.TableParallelism.AutoParallelism", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for table_parallelism::AutoParallelism {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = table_parallelism::AutoParallelism;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.TableParallelism.AutoParallelism")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<table_parallelism::AutoParallelism, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(table_parallelism::AutoParallelism {
})
}
}
deserializer.deserialize_struct("meta.TableParallelism.AutoParallelism", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for table_parallelism::CustomParallelism {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.TableParallelism.CustomParallelism", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for table_parallelism::CustomParallelism {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = table_parallelism::CustomParallelism;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.TableParallelism.CustomParallelism")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<table_parallelism::CustomParallelism, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(table_parallelism::CustomParallelism {
})
}
}
deserializer.deserialize_struct("meta.TableParallelism.CustomParallelism", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for table_parallelism::FixedParallelism {
#[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.parallelism != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.TableParallelism.FixedParallelism", len)?;
if self.parallelism != 0 {
struct_ser.serialize_field("parallelism", &self.parallelism)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for table_parallelism::FixedParallelism {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"parallelism",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Parallelism,
}
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 {
"parallelism" => Ok(GeneratedField::Parallelism),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = table_parallelism::FixedParallelism;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.TableParallelism.FixedParallelism")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<table_parallelism::FixedParallelism, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut parallelism__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Parallelism => {
if parallelism__.is_some() {
return Err(serde::de::Error::duplicate_field("parallelism"));
}
parallelism__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(table_parallelism::FixedParallelism {
parallelism: parallelism__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.TableParallelism.FixedParallelism", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for TelemetryInfoResponse {
#[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.tracking_id.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.TelemetryInfoResponse", len)?;
if let Some(v) = self.tracking_id.as_ref() {
struct_ser.serialize_field("trackingId", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TelemetryInfoResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"tracking_id",
"trackingId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TrackingId,
}
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 {
"trackingId" | "tracking_id" => Ok(GeneratedField::TrackingId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TelemetryInfoResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.TelemetryInfoResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TelemetryInfoResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut tracking_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TrackingId => {
if tracking_id__.is_some() {
return Err(serde::de::Error::duplicate_field("trackingId"));
}
tracking_id__ = map_.next_value()?;
}
}
}
Ok(TelemetryInfoResponse {
tracking_id: tracking_id__,
})
}
}
deserializer.deserialize_struct("meta.TelemetryInfoResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ThrottleTarget {
#[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 => "THROTTLE_TARGET_UNSPECIFIED",
Self::Source => "SOURCE",
Self::Mv => "MV",
Self::TableWithSource => "TABLE_WITH_SOURCE",
Self::CdcTable => "CDC_TABLE",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for ThrottleTarget {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"THROTTLE_TARGET_UNSPECIFIED",
"SOURCE",
"MV",
"TABLE_WITH_SOURCE",
"CDC_TABLE",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ThrottleTarget;
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 {
"THROTTLE_TARGET_UNSPECIFIED" => Ok(ThrottleTarget::Unspecified),
"SOURCE" => Ok(ThrottleTarget::Source),
"MV" => Ok(ThrottleTarget::Mv),
"TABLE_WITH_SOURCE" => Ok(ThrottleTarget::TableWithSource),
"CDC_TABLE" => Ok(ThrottleTarget::CdcTable),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for UpdateStreamingJobNodeLabelsRequest {
#[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.id != 0 {
len += 1;
}
if !self.node_label.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.UpdateStreamingJobNodeLabelsRequest", len)?;
if self.id != 0 {
struct_ser.serialize_field("id", &self.id)?;
}
if !self.node_label.is_empty() {
struct_ser.serialize_field("nodeLabel", &self.node_label)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for UpdateStreamingJobNodeLabelsRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"id",
"node_label",
"nodeLabel",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Id,
NodeLabel,
}
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 {
"id" => Ok(GeneratedField::Id),
"nodeLabel" | "node_label" => Ok(GeneratedField::NodeLabel),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = UpdateStreamingJobNodeLabelsRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.UpdateStreamingJobNodeLabelsRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<UpdateStreamingJobNodeLabelsRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut id__ = None;
let mut node_label__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Id => {
if id__.is_some() {
return Err(serde::de::Error::duplicate_field("id"));
}
id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::NodeLabel => {
if node_label__.is_some() {
return Err(serde::de::Error::duplicate_field("nodeLabel"));
}
node_label__ = Some(map_.next_value()?);
}
}
}
Ok(UpdateStreamingJobNodeLabelsRequest {
id: id__.unwrap_or_default(),
node_label: node_label__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.UpdateStreamingJobNodeLabelsRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for UpdateStreamingJobNodeLabelsResponse {
#[allow(deprecated)]
fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
use serde::ser::SerializeStruct;
let len = 0;
let struct_ser = serializer.serialize_struct("meta.UpdateStreamingJobNodeLabelsResponse", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for UpdateStreamingJobNodeLabelsResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
}
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,
{
Err(serde::de::Error::unknown_field(value, FIELDS))
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = UpdateStreamingJobNodeLabelsResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.UpdateStreamingJobNodeLabelsResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<UpdateStreamingJobNodeLabelsResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(UpdateStreamingJobNodeLabelsResponse {
})
}
}
deserializer.deserialize_struct("meta.UpdateStreamingJobNodeLabelsResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for UpdateWorkerNodeSchedulabilityRequest {
#[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.worker_ids.is_empty() {
len += 1;
}
if self.schedulability != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.UpdateWorkerNodeSchedulabilityRequest", len)?;
if !self.worker_ids.is_empty() {
struct_ser.serialize_field("workerIds", &self.worker_ids)?;
}
if self.schedulability != 0 {
let v = update_worker_node_schedulability_request::Schedulability::try_from(self.schedulability)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.schedulability)))?;
struct_ser.serialize_field("schedulability", &v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for UpdateWorkerNodeSchedulabilityRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"worker_ids",
"workerIds",
"schedulability",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
WorkerIds,
Schedulability,
}
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 {
"workerIds" | "worker_ids" => Ok(GeneratedField::WorkerIds),
"schedulability" => Ok(GeneratedField::Schedulability),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = UpdateWorkerNodeSchedulabilityRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.UpdateWorkerNodeSchedulabilityRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<UpdateWorkerNodeSchedulabilityRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut worker_ids__ = None;
let mut schedulability__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::WorkerIds => {
if worker_ids__.is_some() {
return Err(serde::de::Error::duplicate_field("workerIds"));
}
worker_ids__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
GeneratedField::Schedulability => {
if schedulability__.is_some() {
return Err(serde::de::Error::duplicate_field("schedulability"));
}
schedulability__ = Some(map_.next_value::<update_worker_node_schedulability_request::Schedulability>()? as i32);
}
}
}
Ok(UpdateWorkerNodeSchedulabilityRequest {
worker_ids: worker_ids__.unwrap_or_default(),
schedulability: schedulability__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.UpdateWorkerNodeSchedulabilityRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for update_worker_node_schedulability_request::Schedulability {
#[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::Schedulable => "SCHEDULABLE",
Self::Unschedulable => "UNSCHEDULABLE",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for update_worker_node_schedulability_request::Schedulability {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"UNSPECIFIED",
"SCHEDULABLE",
"UNSCHEDULABLE",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = update_worker_node_schedulability_request::Schedulability;
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(update_worker_node_schedulability_request::Schedulability::Unspecified),
"SCHEDULABLE" => Ok(update_worker_node_schedulability_request::Schedulability::Schedulable),
"UNSCHEDULABLE" => Ok(update_worker_node_schedulability_request::Schedulability::Unschedulable),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for UpdateWorkerNodeSchedulabilityResponse {
#[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("meta.UpdateWorkerNodeSchedulabilityResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for UpdateWorkerNodeSchedulabilityResponse {
#[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 = UpdateWorkerNodeSchedulabilityResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.UpdateWorkerNodeSchedulabilityResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<UpdateWorkerNodeSchedulabilityResponse, 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(UpdateWorkerNodeSchedulabilityResponse {
status: status__,
})
}
}
deserializer.deserialize_struct("meta.UpdateWorkerNodeSchedulabilityResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for WorkerReschedule {
#[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.worker_actor_diff.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("meta.WorkerReschedule", len)?;
if !self.worker_actor_diff.is_empty() {
struct_ser.serialize_field("workerActorDiff", &self.worker_actor_diff)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for WorkerReschedule {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"worker_actor_diff",
"workerActorDiff",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
WorkerActorDiff,
}
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 {
"workerActorDiff" | "worker_actor_diff" => Ok(GeneratedField::WorkerActorDiff),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = WorkerReschedule;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct meta.WorkerReschedule")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<WorkerReschedule, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut worker_actor_diff__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::WorkerActorDiff => {
if worker_actor_diff__.is_some() {
return Err(serde::de::Error::duplicate_field("workerActorDiff"));
}
worker_actor_diff__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, ::pbjson::private::NumberDeserialize<i32>>>()?
.into_iter().map(|(k,v)| (k.0, v.0)).collect()
);
}
}
}
Ok(WorkerReschedule {
worker_actor_diff: worker_actor_diff__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("meta.WorkerReschedule", FIELDS, GeneratedVisitor)
}
}