use crate::ddl_service::*;
impl serde::Serialize for AlterNameRequest {
#[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.new_name.is_empty() {
len += 1;
}
if self.object.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.AlterNameRequest", len)?;
if !self.new_name.is_empty() {
struct_ser.serialize_field("newName", &self.new_name)?;
}
if let Some(v) = self.object.as_ref() {
match v {
alter_name_request::Object::TableId(v) => {
struct_ser.serialize_field("tableId", v)?;
}
alter_name_request::Object::ViewId(v) => {
struct_ser.serialize_field("viewId", v)?;
}
alter_name_request::Object::IndexId(v) => {
struct_ser.serialize_field("indexId", v)?;
}
alter_name_request::Object::SinkId(v) => {
struct_ser.serialize_field("sinkId", v)?;
}
alter_name_request::Object::SourceId(v) => {
struct_ser.serialize_field("sourceId", v)?;
}
alter_name_request::Object::SchemaId(v) => {
struct_ser.serialize_field("schemaId", v)?;
}
alter_name_request::Object::DatabaseId(v) => {
struct_ser.serialize_field("databaseId", v)?;
}
alter_name_request::Object::SubscriptionId(v) => {
struct_ser.serialize_field("subscriptionId", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for AlterNameRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"new_name",
"newName",
"table_id",
"tableId",
"view_id",
"viewId",
"index_id",
"indexId",
"sink_id",
"sinkId",
"source_id",
"sourceId",
"schema_id",
"schemaId",
"database_id",
"databaseId",
"subscription_id",
"subscriptionId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
NewName,
TableId,
ViewId,
IndexId,
SinkId,
SourceId,
SchemaId,
DatabaseId,
SubscriptionId,
}
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 {
"newName" | "new_name" => Ok(GeneratedField::NewName),
"tableId" | "table_id" => Ok(GeneratedField::TableId),
"viewId" | "view_id" => Ok(GeneratedField::ViewId),
"indexId" | "index_id" => Ok(GeneratedField::IndexId),
"sinkId" | "sink_id" => Ok(GeneratedField::SinkId),
"sourceId" | "source_id" => Ok(GeneratedField::SourceId),
"schemaId" | "schema_id" => Ok(GeneratedField::SchemaId),
"databaseId" | "database_id" => Ok(GeneratedField::DatabaseId),
"subscriptionId" | "subscription_id" => Ok(GeneratedField::SubscriptionId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = AlterNameRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.AlterNameRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<AlterNameRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut new_name__ = None;
let mut object__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::NewName => {
if new_name__.is_some() {
return Err(serde::de::Error::duplicate_field("newName"));
}
new_name__ = Some(map_.next_value()?);
}
GeneratedField::TableId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("tableId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_name_request::Object::TableId(x.0));
}
GeneratedField::ViewId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("viewId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_name_request::Object::ViewId(x.0));
}
GeneratedField::IndexId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("indexId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_name_request::Object::IndexId(x.0));
}
GeneratedField::SinkId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("sinkId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_name_request::Object::SinkId(x.0));
}
GeneratedField::SourceId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("sourceId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_name_request::Object::SourceId(x.0));
}
GeneratedField::SchemaId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("schemaId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_name_request::Object::SchemaId(x.0));
}
GeneratedField::DatabaseId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("databaseId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_name_request::Object::DatabaseId(x.0));
}
GeneratedField::SubscriptionId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("subscriptionId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_name_request::Object::SubscriptionId(x.0));
}
}
}
Ok(AlterNameRequest {
new_name: new_name__.unwrap_or_default(),
object: object__,
})
}
}
deserializer.deserialize_struct("ddl_service.AlterNameRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for AlterNameResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.AlterNameResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for AlterNameResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = AlterNameResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.AlterNameResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<AlterNameResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(AlterNameResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.AlterNameResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for AlterOwnerRequest {
#[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.owner_id != 0 {
len += 1;
}
if self.object.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.AlterOwnerRequest", len)?;
if self.owner_id != 0 {
struct_ser.serialize_field("ownerId", &self.owner_id)?;
}
if let Some(v) = self.object.as_ref() {
match v {
alter_owner_request::Object::TableId(v) => {
struct_ser.serialize_field("tableId", v)?;
}
alter_owner_request::Object::ViewId(v) => {
struct_ser.serialize_field("viewId", v)?;
}
alter_owner_request::Object::SourceId(v) => {
struct_ser.serialize_field("sourceId", v)?;
}
alter_owner_request::Object::SinkId(v) => {
struct_ser.serialize_field("sinkId", v)?;
}
alter_owner_request::Object::SchemaId(v) => {
struct_ser.serialize_field("schemaId", v)?;
}
alter_owner_request::Object::DatabaseId(v) => {
struct_ser.serialize_field("databaseId", v)?;
}
alter_owner_request::Object::SubscriptionId(v) => {
struct_ser.serialize_field("subscriptionId", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for AlterOwnerRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"owner_id",
"ownerId",
"table_id",
"tableId",
"view_id",
"viewId",
"source_id",
"sourceId",
"sink_id",
"sinkId",
"schema_id",
"schemaId",
"database_id",
"databaseId",
"subscription_id",
"subscriptionId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
OwnerId,
TableId,
ViewId,
SourceId,
SinkId,
SchemaId,
DatabaseId,
SubscriptionId,
}
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 {
"ownerId" | "owner_id" => Ok(GeneratedField::OwnerId),
"tableId" | "table_id" => Ok(GeneratedField::TableId),
"viewId" | "view_id" => Ok(GeneratedField::ViewId),
"sourceId" | "source_id" => Ok(GeneratedField::SourceId),
"sinkId" | "sink_id" => Ok(GeneratedField::SinkId),
"schemaId" | "schema_id" => Ok(GeneratedField::SchemaId),
"databaseId" | "database_id" => Ok(GeneratedField::DatabaseId),
"subscriptionId" | "subscription_id" => Ok(GeneratedField::SubscriptionId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = AlterOwnerRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.AlterOwnerRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<AlterOwnerRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut owner_id__ = None;
let mut object__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::OwnerId => {
if owner_id__.is_some() {
return Err(serde::de::Error::duplicate_field("ownerId"));
}
owner_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TableId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("tableId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_owner_request::Object::TableId(x.0));
}
GeneratedField::ViewId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("viewId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_owner_request::Object::ViewId(x.0));
}
GeneratedField::SourceId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("sourceId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_owner_request::Object::SourceId(x.0));
}
GeneratedField::SinkId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("sinkId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_owner_request::Object::SinkId(x.0));
}
GeneratedField::SchemaId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("schemaId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_owner_request::Object::SchemaId(x.0));
}
GeneratedField::DatabaseId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("databaseId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_owner_request::Object::DatabaseId(x.0));
}
GeneratedField::SubscriptionId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("subscriptionId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_owner_request::Object::SubscriptionId(x.0));
}
}
}
Ok(AlterOwnerRequest {
owner_id: owner_id__.unwrap_or_default(),
object: object__,
})
}
}
deserializer.deserialize_struct("ddl_service.AlterOwnerRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for AlterOwnerResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.AlterOwnerResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for AlterOwnerResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = AlterOwnerResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.AlterOwnerResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<AlterOwnerResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(AlterOwnerResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.AlterOwnerResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for AlterParallelismRequest {
#[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.parallelism.is_some() {
len += 1;
}
if self.deferred {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.AlterParallelismRequest", len)?;
if self.table_id != 0 {
struct_ser.serialize_field("tableId", &self.table_id)?;
}
if let Some(v) = self.parallelism.as_ref() {
struct_ser.serialize_field("parallelism", v)?;
}
if self.deferred {
struct_ser.serialize_field("deferred", &self.deferred)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for AlterParallelismRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table_id",
"tableId",
"parallelism",
"deferred",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableId,
Parallelism,
Deferred,
}
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),
"parallelism" => Ok(GeneratedField::Parallelism),
"deferred" => Ok(GeneratedField::Deferred),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = AlterParallelismRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.AlterParallelismRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<AlterParallelismRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_id__ = None;
let mut parallelism__ = None;
let mut deferred__ = 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::Parallelism => {
if parallelism__.is_some() {
return Err(serde::de::Error::duplicate_field("parallelism"));
}
parallelism__ = map_.next_value()?;
}
GeneratedField::Deferred => {
if deferred__.is_some() {
return Err(serde::de::Error::duplicate_field("deferred"));
}
deferred__ = Some(map_.next_value()?);
}
}
}
Ok(AlterParallelismRequest {
table_id: table_id__.unwrap_or_default(),
parallelism: parallelism__,
deferred: deferred__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.AlterParallelismRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for AlterParallelismResponse {
#[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("ddl_service.AlterParallelismResponse", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for AlterParallelismResponse {
#[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 = AlterParallelismResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.AlterParallelismResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<AlterParallelismResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(AlterParallelismResponse {
})
}
}
deserializer.deserialize_struct("ddl_service.AlterParallelismResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for AlterSetSchemaRequest {
#[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.new_schema_id != 0 {
len += 1;
}
if self.object.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.AlterSetSchemaRequest", len)?;
if self.new_schema_id != 0 {
struct_ser.serialize_field("newSchemaId", &self.new_schema_id)?;
}
if let Some(v) = self.object.as_ref() {
match v {
alter_set_schema_request::Object::TableId(v) => {
struct_ser.serialize_field("tableId", v)?;
}
alter_set_schema_request::Object::ViewId(v) => {
struct_ser.serialize_field("viewId", v)?;
}
alter_set_schema_request::Object::SourceId(v) => {
struct_ser.serialize_field("sourceId", v)?;
}
alter_set_schema_request::Object::SinkId(v) => {
struct_ser.serialize_field("sinkId", v)?;
}
alter_set_schema_request::Object::FunctionId(v) => {
struct_ser.serialize_field("functionId", v)?;
}
alter_set_schema_request::Object::ConnectionId(v) => {
struct_ser.serialize_field("connectionId", v)?;
}
alter_set_schema_request::Object::SubscriptionId(v) => {
struct_ser.serialize_field("subscriptionId", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for AlterSetSchemaRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"new_schema_id",
"newSchemaId",
"table_id",
"tableId",
"view_id",
"viewId",
"source_id",
"sourceId",
"sink_id",
"sinkId",
"function_id",
"functionId",
"connection_id",
"connectionId",
"subscription_id",
"subscriptionId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
NewSchemaId,
TableId,
ViewId,
SourceId,
SinkId,
FunctionId,
ConnectionId,
SubscriptionId,
}
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 {
"newSchemaId" | "new_schema_id" => Ok(GeneratedField::NewSchemaId),
"tableId" | "table_id" => Ok(GeneratedField::TableId),
"viewId" | "view_id" => Ok(GeneratedField::ViewId),
"sourceId" | "source_id" => Ok(GeneratedField::SourceId),
"sinkId" | "sink_id" => Ok(GeneratedField::SinkId),
"functionId" | "function_id" => Ok(GeneratedField::FunctionId),
"connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId),
"subscriptionId" | "subscription_id" => Ok(GeneratedField::SubscriptionId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = AlterSetSchemaRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.AlterSetSchemaRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<AlterSetSchemaRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut new_schema_id__ = None;
let mut object__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::NewSchemaId => {
if new_schema_id__.is_some() {
return Err(serde::de::Error::duplicate_field("newSchemaId"));
}
new_schema_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::TableId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("tableId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_set_schema_request::Object::TableId(x.0));
}
GeneratedField::ViewId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("viewId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_set_schema_request::Object::ViewId(x.0));
}
GeneratedField::SourceId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("sourceId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_set_schema_request::Object::SourceId(x.0));
}
GeneratedField::SinkId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("sinkId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_set_schema_request::Object::SinkId(x.0));
}
GeneratedField::FunctionId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("functionId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_set_schema_request::Object::FunctionId(x.0));
}
GeneratedField::ConnectionId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("connectionId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_set_schema_request::Object::ConnectionId(x.0));
}
GeneratedField::SubscriptionId => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("subscriptionId"));
}
object__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| alter_set_schema_request::Object::SubscriptionId(x.0));
}
}
}
Ok(AlterSetSchemaRequest {
new_schema_id: new_schema_id__.unwrap_or_default(),
object: object__,
})
}
}
deserializer.deserialize_struct("ddl_service.AlterSetSchemaRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for AlterSetSchemaResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.AlterSetSchemaResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for AlterSetSchemaResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = AlterSetSchemaResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.AlterSetSchemaResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<AlterSetSchemaResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(AlterSetSchemaResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.AlterSetSchemaResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for AlterSourceRequest {
#[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.source.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.AlterSourceRequest", len)?;
if let Some(v) = self.source.as_ref() {
struct_ser.serialize_field("source", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for AlterSourceRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"source",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Source,
}
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 {
"source" => Ok(GeneratedField::Source),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = AlterSourceRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.AlterSourceRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<AlterSourceRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut source__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Source => {
if source__.is_some() {
return Err(serde::de::Error::duplicate_field("source"));
}
source__ = map_.next_value()?;
}
}
}
Ok(AlterSourceRequest {
source: source__,
})
}
}
deserializer.deserialize_struct("ddl_service.AlterSourceRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for AlterSourceResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.AlterSourceResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for AlterSourceResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = AlterSourceResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.AlterSourceResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<AlterSourceResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(AlterSourceResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.AlterSourceResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for AlterSwapRenameRequest {
#[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.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.AlterSwapRenameRequest", len)?;
if let Some(v) = self.object.as_ref() {
match v {
alter_swap_rename_request::Object::Schema(v) => {
struct_ser.serialize_field("schema", v)?;
}
alter_swap_rename_request::Object::Table(v) => {
struct_ser.serialize_field("table", v)?;
}
alter_swap_rename_request::Object::View(v) => {
struct_ser.serialize_field("view", v)?;
}
alter_swap_rename_request::Object::Source(v) => {
struct_ser.serialize_field("source", v)?;
}
alter_swap_rename_request::Object::Sink(v) => {
struct_ser.serialize_field("sink", v)?;
}
alter_swap_rename_request::Object::Subscription(v) => {
struct_ser.serialize_field("subscription", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for AlterSwapRenameRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"schema",
"table",
"view",
"source",
"sink",
"subscription",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Schema,
Table,
View,
Source,
Sink,
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 {
"schema" => Ok(GeneratedField::Schema),
"table" => Ok(GeneratedField::Table),
"view" => Ok(GeneratedField::View),
"source" => Ok(GeneratedField::Source),
"sink" => Ok(GeneratedField::Sink),
"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 = AlterSwapRenameRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.AlterSwapRenameRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<AlterSwapRenameRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut object__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Schema => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("schema"));
}
object__ = map_.next_value::<::std::option::Option<_>>()?.map(alter_swap_rename_request::Object::Schema)
;
}
GeneratedField::Table => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("table"));
}
object__ = map_.next_value::<::std::option::Option<_>>()?.map(alter_swap_rename_request::Object::Table)
;
}
GeneratedField::View => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("view"));
}
object__ = map_.next_value::<::std::option::Option<_>>()?.map(alter_swap_rename_request::Object::View)
;
}
GeneratedField::Source => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("source"));
}
object__ = map_.next_value::<::std::option::Option<_>>()?.map(alter_swap_rename_request::Object::Source)
;
}
GeneratedField::Sink => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("sink"));
}
object__ = map_.next_value::<::std::option::Option<_>>()?.map(alter_swap_rename_request::Object::Sink)
;
}
GeneratedField::Subscription => {
if object__.is_some() {
return Err(serde::de::Error::duplicate_field("subscription"));
}
object__ = map_.next_value::<::std::option::Option<_>>()?.map(alter_swap_rename_request::Object::Subscription)
;
}
}
}
Ok(AlterSwapRenameRequest {
object: object__,
})
}
}
deserializer.deserialize_struct("ddl_service.AlterSwapRenameRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for alter_swap_rename_request::ObjectNameSwapPair {
#[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.src_object_id != 0 {
len += 1;
}
if self.dst_object_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.AlterSwapRenameRequest.ObjectNameSwapPair", len)?;
if self.src_object_id != 0 {
struct_ser.serialize_field("srcObjectId", &self.src_object_id)?;
}
if self.dst_object_id != 0 {
struct_ser.serialize_field("dstObjectId", &self.dst_object_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for alter_swap_rename_request::ObjectNameSwapPair {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"src_object_id",
"srcObjectId",
"dst_object_id",
"dstObjectId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SrcObjectId,
DstObjectId,
}
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 {
"srcObjectId" | "src_object_id" => Ok(GeneratedField::SrcObjectId),
"dstObjectId" | "dst_object_id" => Ok(GeneratedField::DstObjectId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = alter_swap_rename_request::ObjectNameSwapPair;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.AlterSwapRenameRequest.ObjectNameSwapPair")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<alter_swap_rename_request::ObjectNameSwapPair, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut src_object_id__ = None;
let mut dst_object_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::SrcObjectId => {
if src_object_id__.is_some() {
return Err(serde::de::Error::duplicate_field("srcObjectId"));
}
src_object_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::DstObjectId => {
if dst_object_id__.is_some() {
return Err(serde::de::Error::duplicate_field("dstObjectId"));
}
dst_object_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(alter_swap_rename_request::ObjectNameSwapPair {
src_object_id: src_object_id__.unwrap_or_default(),
dst_object_id: dst_object_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.AlterSwapRenameRequest.ObjectNameSwapPair", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for AlterSwapRenameResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.AlterSwapRenameResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for AlterSwapRenameResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = AlterSwapRenameResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.AlterSwapRenameResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<AlterSwapRenameResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(AlterSwapRenameResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.AlterSwapRenameResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for AutoSchemaChangeRequest {
#[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.schema_change.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.AutoSchemaChangeRequest", len)?;
if let Some(v) = self.schema_change.as_ref() {
struct_ser.serialize_field("schemaChange", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for AutoSchemaChangeRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"schema_change",
"schemaChange",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SchemaChange,
}
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 {
"schemaChange" | "schema_change" => Ok(GeneratedField::SchemaChange),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = AutoSchemaChangeRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.AutoSchemaChangeRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<AutoSchemaChangeRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut schema_change__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::SchemaChange => {
if schema_change__.is_some() {
return Err(serde::de::Error::duplicate_field("schemaChange"));
}
schema_change__ = map_.next_value()?;
}
}
}
Ok(AutoSchemaChangeRequest {
schema_change: schema_change__,
})
}
}
deserializer.deserialize_struct("ddl_service.AutoSchemaChangeRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for AutoSchemaChangeResponse {
#[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("ddl_service.AutoSchemaChangeResponse", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for AutoSchemaChangeResponse {
#[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 = AutoSchemaChangeResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.AutoSchemaChangeResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<AutoSchemaChangeResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(AutoSchemaChangeResponse {
})
}
}
deserializer.deserialize_struct("ddl_service.AutoSchemaChangeResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CommentOnRequest {
#[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.comment.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CommentOnRequest", len)?;
if let Some(v) = self.comment.as_ref() {
struct_ser.serialize_field("comment", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CommentOnRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"comment",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Comment,
}
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 {
"comment" => Ok(GeneratedField::Comment),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CommentOnRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CommentOnRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CommentOnRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut comment__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Comment => {
if comment__.is_some() {
return Err(serde::de::Error::duplicate_field("comment"));
}
comment__ = map_.next_value()?;
}
}
}
Ok(CommentOnRequest {
comment: comment__,
})
}
}
deserializer.deserialize_struct("ddl_service.CommentOnRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CommentOnResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CommentOnResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CommentOnResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = CommentOnResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CommentOnResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CommentOnResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(CommentOnResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.CommentOnResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateConnectionRequest {
#[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.name.is_empty() {
len += 1;
}
if self.database_id != 0 {
len += 1;
}
if self.schema_id != 0 {
len += 1;
}
if self.owner_id != 0 {
len += 1;
}
if self.payload.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateConnectionRequest", len)?;
if !self.name.is_empty() {
struct_ser.serialize_field("name", &self.name)?;
}
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.owner_id != 0 {
struct_ser.serialize_field("ownerId", &self.owner_id)?;
}
if let Some(v) = self.payload.as_ref() {
match v {
create_connection_request::Payload::PrivateLink(v) => {
struct_ser.serialize_field("privateLink", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateConnectionRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"name",
"database_id",
"databaseId",
"schema_id",
"schemaId",
"owner_id",
"ownerId",
"private_link",
"privateLink",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Name,
DatabaseId,
SchemaId,
OwnerId,
PrivateLink,
}
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 {
"name" => Ok(GeneratedField::Name),
"databaseId" | "database_id" => Ok(GeneratedField::DatabaseId),
"schemaId" | "schema_id" => Ok(GeneratedField::SchemaId),
"ownerId" | "owner_id" => Ok(GeneratedField::OwnerId),
"privateLink" | "private_link" => Ok(GeneratedField::PrivateLink),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CreateConnectionRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateConnectionRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateConnectionRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut name__ = None;
let mut database_id__ = None;
let mut schema_id__ = None;
let mut owner_id__ = None;
let mut payload__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Name => {
if name__.is_some() {
return Err(serde::de::Error::duplicate_field("name"));
}
name__ = Some(map_.next_value()?);
}
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::OwnerId => {
if owner_id__.is_some() {
return Err(serde::de::Error::duplicate_field("ownerId"));
}
owner_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::PrivateLink => {
if payload__.is_some() {
return Err(serde::de::Error::duplicate_field("privateLink"));
}
payload__ = map_.next_value::<::std::option::Option<_>>()?.map(create_connection_request::Payload::PrivateLink)
;
}
}
}
Ok(CreateConnectionRequest {
name: name__.unwrap_or_default(),
database_id: database_id__.unwrap_or_default(),
schema_id: schema_id__.unwrap_or_default(),
owner_id: owner_id__.unwrap_or_default(),
payload: payload__,
})
}
}
deserializer.deserialize_struct("ddl_service.CreateConnectionRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for create_connection_request::PrivateLink {
#[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.provider != 0 {
len += 1;
}
if !self.service_name.is_empty() {
len += 1;
}
if self.tags.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateConnectionRequest.PrivateLink", len)?;
if self.provider != 0 {
let v = super::catalog::connection::private_link_service::PrivateLinkProvider::try_from(self.provider)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.provider)))?;
struct_ser.serialize_field("provider", &v)?;
}
if !self.service_name.is_empty() {
struct_ser.serialize_field("serviceName", &self.service_name)?;
}
if let Some(v) = self.tags.as_ref() {
struct_ser.serialize_field("tags", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for create_connection_request::PrivateLink {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"provider",
"service_name",
"serviceName",
"tags",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Provider,
ServiceName,
Tags,
}
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 {
"provider" => Ok(GeneratedField::Provider),
"serviceName" | "service_name" => Ok(GeneratedField::ServiceName),
"tags" => Ok(GeneratedField::Tags),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = create_connection_request::PrivateLink;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateConnectionRequest.PrivateLink")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<create_connection_request::PrivateLink, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut provider__ = None;
let mut service_name__ = None;
let mut tags__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Provider => {
if provider__.is_some() {
return Err(serde::de::Error::duplicate_field("provider"));
}
provider__ = Some(map_.next_value::<super::catalog::connection::private_link_service::PrivateLinkProvider>()? as i32);
}
GeneratedField::ServiceName => {
if service_name__.is_some() {
return Err(serde::de::Error::duplicate_field("serviceName"));
}
service_name__ = Some(map_.next_value()?);
}
GeneratedField::Tags => {
if tags__.is_some() {
return Err(serde::de::Error::duplicate_field("tags"));
}
tags__ = map_.next_value()?;
}
}
}
Ok(create_connection_request::PrivateLink {
provider: provider__.unwrap_or_default(),
service_name: service_name__.unwrap_or_default(),
tags: tags__,
})
}
}
deserializer.deserialize_struct("ddl_service.CreateConnectionRequest.PrivateLink", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateConnectionResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateConnectionResponse", len)?;
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateConnectionResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
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 {
"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 = CreateConnectionResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateConnectionResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateConnectionResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut version__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(CreateConnectionResponse {
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.CreateConnectionResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateDatabaseRequest {
#[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.db.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateDatabaseRequest", len)?;
if let Some(v) = self.db.as_ref() {
struct_ser.serialize_field("db", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateDatabaseRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"db",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Db,
}
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 {
"db" => Ok(GeneratedField::Db),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CreateDatabaseRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateDatabaseRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateDatabaseRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut db__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Db => {
if db__.is_some() {
return Err(serde::de::Error::duplicate_field("db"));
}
db__ = map_.next_value()?;
}
}
}
Ok(CreateDatabaseRequest {
db: db__,
})
}
}
deserializer.deserialize_struct("ddl_service.CreateDatabaseRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateDatabaseResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateDatabaseResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateDatabaseResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = CreateDatabaseResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateDatabaseResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateDatabaseResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(CreateDatabaseResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.CreateDatabaseResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateFunctionRequest {
#[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.function.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateFunctionRequest", len)?;
if let Some(v) = self.function.as_ref() {
struct_ser.serialize_field("function", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateFunctionRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"function",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Function,
}
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 {
"function" => Ok(GeneratedField::Function),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CreateFunctionRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateFunctionRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateFunctionRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut function__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Function => {
if function__.is_some() {
return Err(serde::de::Error::duplicate_field("function"));
}
function__ = map_.next_value()?;
}
}
}
Ok(CreateFunctionRequest {
function: function__,
})
}
}
deserializer.deserialize_struct("ddl_service.CreateFunctionRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateFunctionResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateFunctionResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateFunctionResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = CreateFunctionResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateFunctionResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateFunctionResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(CreateFunctionResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.CreateFunctionResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateIndexRequest {
#[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.index.is_some() {
len += 1;
}
if self.index_table.is_some() {
len += 1;
}
if self.fragment_graph.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateIndexRequest", len)?;
if let Some(v) = self.index.as_ref() {
struct_ser.serialize_field("index", v)?;
}
if let Some(v) = self.index_table.as_ref() {
struct_ser.serialize_field("indexTable", v)?;
}
if let Some(v) = self.fragment_graph.as_ref() {
struct_ser.serialize_field("fragmentGraph", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateIndexRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"index",
"index_table",
"indexTable",
"fragment_graph",
"fragmentGraph",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Index,
IndexTable,
FragmentGraph,
}
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 {
"index" => Ok(GeneratedField::Index),
"indexTable" | "index_table" => Ok(GeneratedField::IndexTable),
"fragmentGraph" | "fragment_graph" => Ok(GeneratedField::FragmentGraph),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CreateIndexRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateIndexRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateIndexRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut index__ = None;
let mut index_table__ = None;
let mut fragment_graph__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Index => {
if index__.is_some() {
return Err(serde::de::Error::duplicate_field("index"));
}
index__ = map_.next_value()?;
}
GeneratedField::IndexTable => {
if index_table__.is_some() {
return Err(serde::de::Error::duplicate_field("indexTable"));
}
index_table__ = map_.next_value()?;
}
GeneratedField::FragmentGraph => {
if fragment_graph__.is_some() {
return Err(serde::de::Error::duplicate_field("fragmentGraph"));
}
fragment_graph__ = map_.next_value()?;
}
}
}
Ok(CreateIndexRequest {
index: index__,
index_table: index_table__,
fragment_graph: fragment_graph__,
})
}
}
deserializer.deserialize_struct("ddl_service.CreateIndexRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateIndexResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateIndexResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateIndexResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = CreateIndexResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateIndexResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateIndexResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(CreateIndexResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.CreateIndexResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateMaterializedViewRequest {
#[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.materialized_view.is_some() {
len += 1;
}
if self.fragment_graph.is_some() {
len += 1;
}
if self.backfill != 0 {
len += 1;
}
if !self.dependencies.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateMaterializedViewRequest", len)?;
if let Some(v) = self.materialized_view.as_ref() {
struct_ser.serialize_field("materializedView", v)?;
}
if let Some(v) = self.fragment_graph.as_ref() {
struct_ser.serialize_field("fragmentGraph", v)?;
}
if self.backfill != 0 {
let v = create_materialized_view_request::BackfillType::try_from(self.backfill)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.backfill)))?;
struct_ser.serialize_field("backfill", &v)?;
}
if !self.dependencies.is_empty() {
struct_ser.serialize_field("dependencies", &self.dependencies)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateMaterializedViewRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"materialized_view",
"materializedView",
"fragment_graph",
"fragmentGraph",
"backfill",
"dependencies",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
MaterializedView,
FragmentGraph,
Backfill,
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 {
"materializedView" | "materialized_view" => Ok(GeneratedField::MaterializedView),
"fragmentGraph" | "fragment_graph" => Ok(GeneratedField::FragmentGraph),
"backfill" => Ok(GeneratedField::Backfill),
"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 = CreateMaterializedViewRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateMaterializedViewRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateMaterializedViewRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut materialized_view__ = None;
let mut fragment_graph__ = None;
let mut backfill__ = None;
let mut dependencies__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::MaterializedView => {
if materialized_view__.is_some() {
return Err(serde::de::Error::duplicate_field("materializedView"));
}
materialized_view__ = map_.next_value()?;
}
GeneratedField::FragmentGraph => {
if fragment_graph__.is_some() {
return Err(serde::de::Error::duplicate_field("fragmentGraph"));
}
fragment_graph__ = map_.next_value()?;
}
GeneratedField::Backfill => {
if backfill__.is_some() {
return Err(serde::de::Error::duplicate_field("backfill"));
}
backfill__ = Some(map_.next_value::<create_materialized_view_request::BackfillType>()? as i32);
}
GeneratedField::Dependencies => {
if dependencies__.is_some() {
return Err(serde::de::Error::duplicate_field("dependencies"));
}
dependencies__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(CreateMaterializedViewRequest {
materialized_view: materialized_view__,
fragment_graph: fragment_graph__,
backfill: backfill__.unwrap_or_default(),
dependencies: dependencies__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.CreateMaterializedViewRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for create_materialized_view_request::BackfillType {
#[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::Regular => "REGULAR",
Self::Serverless => "SERVERLESS",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for create_materialized_view_request::BackfillType {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"UNSPECIFIED",
"REGULAR",
"SERVERLESS",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = create_materialized_view_request::BackfillType;
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(create_materialized_view_request::BackfillType::Unspecified),
"REGULAR" => Ok(create_materialized_view_request::BackfillType::Regular),
"SERVERLESS" => Ok(create_materialized_view_request::BackfillType::Serverless),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for CreateMaterializedViewResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateMaterializedViewResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateMaterializedViewResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = CreateMaterializedViewResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateMaterializedViewResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateMaterializedViewResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(CreateMaterializedViewResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.CreateMaterializedViewResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateSchemaRequest {
#[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.schema.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateSchemaRequest", len)?;
if let Some(v) = self.schema.as_ref() {
struct_ser.serialize_field("schema", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateSchemaRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"schema",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Schema,
}
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 {
"schema" => Ok(GeneratedField::Schema),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CreateSchemaRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateSchemaRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateSchemaRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut schema__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Schema => {
if schema__.is_some() {
return Err(serde::de::Error::duplicate_field("schema"));
}
schema__ = map_.next_value()?;
}
}
}
Ok(CreateSchemaRequest {
schema: schema__,
})
}
}
deserializer.deserialize_struct("ddl_service.CreateSchemaRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateSchemaResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateSchemaResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateSchemaResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = CreateSchemaResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateSchemaResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateSchemaResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(CreateSchemaResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.CreateSchemaResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateSecretRequest {
#[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.name.is_empty() {
len += 1;
}
if !self.value.is_empty() {
len += 1;
}
if self.database_id != 0 {
len += 1;
}
if self.schema_id != 0 {
len += 1;
}
if self.owner_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateSecretRequest", len)?;
if !self.name.is_empty() {
struct_ser.serialize_field("name", &self.name)?;
}
if !self.value.is_empty() {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?;
}
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.owner_id != 0 {
struct_ser.serialize_field("ownerId", &self.owner_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateSecretRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"name",
"value",
"database_id",
"databaseId",
"schema_id",
"schemaId",
"owner_id",
"ownerId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Name,
Value,
DatabaseId,
SchemaId,
OwnerId,
}
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 {
"name" => Ok(GeneratedField::Name),
"value" => Ok(GeneratedField::Value),
"databaseId" | "database_id" => Ok(GeneratedField::DatabaseId),
"schemaId" | "schema_id" => Ok(GeneratedField::SchemaId),
"ownerId" | "owner_id" => Ok(GeneratedField::OwnerId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CreateSecretRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateSecretRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateSecretRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut name__ = None;
let mut value__ = None;
let mut database_id__ = None;
let mut schema_id__ = None;
let mut owner_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Name => {
if name__.is_some() {
return Err(serde::de::Error::duplicate_field("name"));
}
name__ = Some(map_.next_value()?);
}
GeneratedField::Value => {
if value__.is_some() {
return Err(serde::de::Error::duplicate_field("value"));
}
value__ =
Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0)
;
}
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::OwnerId => {
if owner_id__.is_some() {
return Err(serde::de::Error::duplicate_field("ownerId"));
}
owner_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(CreateSecretRequest {
name: name__.unwrap_or_default(),
value: value__.unwrap_or_default(),
database_id: database_id__.unwrap_or_default(),
schema_id: schema_id__.unwrap_or_default(),
owner_id: owner_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.CreateSecretRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateSecretResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateSecretResponse", len)?;
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateSecretResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
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 {
"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 = CreateSecretResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateSecretResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateSecretResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut version__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(CreateSecretResponse {
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.CreateSecretResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateSinkRequest {
#[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.is_some() {
len += 1;
}
if self.fragment_graph.is_some() {
len += 1;
}
if self.affected_table_change.is_some() {
len += 1;
}
if !self.dependencies.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateSinkRequest", len)?;
if let Some(v) = self.sink.as_ref() {
struct_ser.serialize_field("sink", v)?;
}
if let Some(v) = self.fragment_graph.as_ref() {
struct_ser.serialize_field("fragmentGraph", v)?;
}
if let Some(v) = self.affected_table_change.as_ref() {
struct_ser.serialize_field("affectedTableChange", v)?;
}
if !self.dependencies.is_empty() {
struct_ser.serialize_field("dependencies", &self.dependencies)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateSinkRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"sink",
"fragment_graph",
"fragmentGraph",
"affected_table_change",
"affectedTableChange",
"dependencies",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Sink,
FragmentGraph,
AffectedTableChange,
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 {
"sink" => Ok(GeneratedField::Sink),
"fragmentGraph" | "fragment_graph" => Ok(GeneratedField::FragmentGraph),
"affectedTableChange" | "affected_table_change" => Ok(GeneratedField::AffectedTableChange),
"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 = CreateSinkRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateSinkRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateSinkRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut sink__ = None;
let mut fragment_graph__ = None;
let mut affected_table_change__ = None;
let mut dependencies__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Sink => {
if sink__.is_some() {
return Err(serde::de::Error::duplicate_field("sink"));
}
sink__ = map_.next_value()?;
}
GeneratedField::FragmentGraph => {
if fragment_graph__.is_some() {
return Err(serde::de::Error::duplicate_field("fragmentGraph"));
}
fragment_graph__ = map_.next_value()?;
}
GeneratedField::AffectedTableChange => {
if affected_table_change__.is_some() {
return Err(serde::de::Error::duplicate_field("affectedTableChange"));
}
affected_table_change__ = map_.next_value()?;
}
GeneratedField::Dependencies => {
if dependencies__.is_some() {
return Err(serde::de::Error::duplicate_field("dependencies"));
}
dependencies__ =
Some(map_.next_value::<Vec<::pbjson::private::NumberDeserialize<_>>>()?
.into_iter().map(|x| x.0).collect())
;
}
}
}
Ok(CreateSinkRequest {
sink: sink__,
fragment_graph: fragment_graph__,
affected_table_change: affected_table_change__,
dependencies: dependencies__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.CreateSinkRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateSinkResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateSinkResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateSinkResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = CreateSinkResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateSinkResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateSinkResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(CreateSinkResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.CreateSinkResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateSourceRequest {
#[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.source.is_some() {
len += 1;
}
if self.fragment_graph.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateSourceRequest", len)?;
if let Some(v) = self.source.as_ref() {
struct_ser.serialize_field("source", v)?;
}
if let Some(v) = self.fragment_graph.as_ref() {
struct_ser.serialize_field("fragmentGraph", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateSourceRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"source",
"fragment_graph",
"fragmentGraph",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Source,
FragmentGraph,
}
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 {
"source" => Ok(GeneratedField::Source),
"fragmentGraph" | "fragment_graph" => Ok(GeneratedField::FragmentGraph),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CreateSourceRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateSourceRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateSourceRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut source__ = None;
let mut fragment_graph__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Source => {
if source__.is_some() {
return Err(serde::de::Error::duplicate_field("source"));
}
source__ = map_.next_value()?;
}
GeneratedField::FragmentGraph => {
if fragment_graph__.is_some() {
return Err(serde::de::Error::duplicate_field("fragmentGraph"));
}
fragment_graph__ = map_.next_value()?;
}
}
}
Ok(CreateSourceRequest {
source: source__,
fragment_graph: fragment_graph__,
})
}
}
deserializer.deserialize_struct("ddl_service.CreateSourceRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateSourceResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateSourceResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateSourceResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = CreateSourceResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateSourceResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateSourceResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(CreateSourceResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.CreateSourceResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateSubscriptionRequest {
#[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.subscription.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateSubscriptionRequest", len)?;
if let Some(v) = self.subscription.as_ref() {
struct_ser.serialize_field("subscription", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateSubscriptionRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"subscription",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
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 {
"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 = CreateSubscriptionRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateSubscriptionRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateSubscriptionRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut subscription__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Subscription => {
if subscription__.is_some() {
return Err(serde::de::Error::duplicate_field("subscription"));
}
subscription__ = map_.next_value()?;
}
}
}
Ok(CreateSubscriptionRequest {
subscription: subscription__,
})
}
}
deserializer.deserialize_struct("ddl_service.CreateSubscriptionRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateSubscriptionResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateSubscriptionResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateSubscriptionResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = CreateSubscriptionResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateSubscriptionResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateSubscriptionResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(CreateSubscriptionResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.CreateSubscriptionResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateTableRequest {
#[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.source.is_some() {
len += 1;
}
if self.materialized_view.is_some() {
len += 1;
}
if self.fragment_graph.is_some() {
len += 1;
}
if self.job_type != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateTableRequest", len)?;
if let Some(v) = self.source.as_ref() {
struct_ser.serialize_field("source", v)?;
}
if let Some(v) = self.materialized_view.as_ref() {
struct_ser.serialize_field("materializedView", v)?;
}
if let Some(v) = self.fragment_graph.as_ref() {
struct_ser.serialize_field("fragmentGraph", v)?;
}
if self.job_type != 0 {
let v = TableJobType::try_from(self.job_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.job_type)))?;
struct_ser.serialize_field("jobType", &v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateTableRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"source",
"materialized_view",
"materializedView",
"fragment_graph",
"fragmentGraph",
"job_type",
"jobType",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Source,
MaterializedView,
FragmentGraph,
JobType,
}
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 {
"source" => Ok(GeneratedField::Source),
"materializedView" | "materialized_view" => Ok(GeneratedField::MaterializedView),
"fragmentGraph" | "fragment_graph" => Ok(GeneratedField::FragmentGraph),
"jobType" | "job_type" => Ok(GeneratedField::JobType),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CreateTableRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateTableRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateTableRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut source__ = None;
let mut materialized_view__ = None;
let mut fragment_graph__ = None;
let mut job_type__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Source => {
if source__.is_some() {
return Err(serde::de::Error::duplicate_field("source"));
}
source__ = map_.next_value()?;
}
GeneratedField::MaterializedView => {
if materialized_view__.is_some() {
return Err(serde::de::Error::duplicate_field("materializedView"));
}
materialized_view__ = map_.next_value()?;
}
GeneratedField::FragmentGraph => {
if fragment_graph__.is_some() {
return Err(serde::de::Error::duplicate_field("fragmentGraph"));
}
fragment_graph__ = map_.next_value()?;
}
GeneratedField::JobType => {
if job_type__.is_some() {
return Err(serde::de::Error::duplicate_field("jobType"));
}
job_type__ = Some(map_.next_value::<TableJobType>()? as i32);
}
}
}
Ok(CreateTableRequest {
source: source__,
materialized_view: materialized_view__,
fragment_graph: fragment_graph__,
job_type: job_type__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.CreateTableRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateTableResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateTableResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateTableResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = CreateTableResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateTableResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateTableResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(CreateTableResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.CreateTableResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateViewRequest {
#[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.view.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateViewRequest", len)?;
if let Some(v) = self.view.as_ref() {
struct_ser.serialize_field("view", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateViewRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"view",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
View,
}
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 {
"view" => Ok(GeneratedField::View),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = CreateViewRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateViewRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateViewRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut view__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::View => {
if view__.is_some() {
return Err(serde::de::Error::duplicate_field("view"));
}
view__ = map_.next_value()?;
}
}
}
Ok(CreateViewRequest {
view: view__,
})
}
}
deserializer.deserialize_struct("ddl_service.CreateViewRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for CreateViewResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.CreateViewResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for CreateViewResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = CreateViewResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.CreateViewResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<CreateViewResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(CreateViewResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.CreateViewResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DdlProgress {
#[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.statement.is_empty() {
len += 1;
}
if !self.progress.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DdlProgress", len)?;
if self.id != 0 {
#[allow(clippy::needless_borrow)]
#[allow(clippy::needless_borrows_for_generic_args)]
struct_ser.serialize_field("id", ToString::to_string(&self.id).as_str())?;
}
if !self.statement.is_empty() {
struct_ser.serialize_field("statement", &self.statement)?;
}
if !self.progress.is_empty() {
struct_ser.serialize_field("progress", &self.progress)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DdlProgress {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"id",
"statement",
"progress",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Id,
Statement,
Progress,
}
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),
"statement" => Ok(GeneratedField::Statement),
"progress" => Ok(GeneratedField::Progress),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DdlProgress;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DdlProgress")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DdlProgress, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut id__ = None;
let mut statement__ = None;
let mut progress__ = 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::Statement => {
if statement__.is_some() {
return Err(serde::de::Error::duplicate_field("statement"));
}
statement__ = Some(map_.next_value()?);
}
GeneratedField::Progress => {
if progress__.is_some() {
return Err(serde::de::Error::duplicate_field("progress"));
}
progress__ = Some(map_.next_value()?);
}
}
}
Ok(DdlProgress {
id: id__.unwrap_or_default(),
statement: statement__.unwrap_or_default(),
progress: progress__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.DdlProgress", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropConnectionRequest {
#[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.connection_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropConnectionRequest", len)?;
if self.connection_id != 0 {
struct_ser.serialize_field("connectionId", &self.connection_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropConnectionRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"connection_id",
"connectionId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ConnectionId,
}
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 {
"connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DropConnectionRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropConnectionRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropConnectionRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut connection_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ConnectionId => {
if connection_id__.is_some() {
return Err(serde::de::Error::duplicate_field("connectionId"));
}
connection_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(DropConnectionRequest {
connection_id: connection_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.DropConnectionRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropConnectionResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropConnectionResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropConnectionResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = DropConnectionResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropConnectionResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropConnectionResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(DropConnectionResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.DropConnectionResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropDatabaseRequest {
#[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("ddl_service.DropDatabaseRequest", len)?;
if self.database_id != 0 {
struct_ser.serialize_field("databaseId", &self.database_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropDatabaseRequest {
#[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 = DropDatabaseRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropDatabaseRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropDatabaseRequest, 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(DropDatabaseRequest {
database_id: database_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.DropDatabaseRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropDatabaseResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropDatabaseResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropDatabaseResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = DropDatabaseResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropDatabaseResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropDatabaseResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(DropDatabaseResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.DropDatabaseResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropFunctionRequest {
#[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.function_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropFunctionRequest", len)?;
if self.function_id != 0 {
struct_ser.serialize_field("functionId", &self.function_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropFunctionRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"function_id",
"functionId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
FunctionId,
}
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 {
"functionId" | "function_id" => Ok(GeneratedField::FunctionId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DropFunctionRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropFunctionRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropFunctionRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut function_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::FunctionId => {
if function_id__.is_some() {
return Err(serde::de::Error::duplicate_field("functionId"));
}
function_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(DropFunctionRequest {
function_id: function_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.DropFunctionRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropFunctionResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropFunctionResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropFunctionResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = DropFunctionResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropFunctionResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropFunctionResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(DropFunctionResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.DropFunctionResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropIndexRequest {
#[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.index_id != 0 {
len += 1;
}
if self.cascade {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropIndexRequest", len)?;
if self.index_id != 0 {
struct_ser.serialize_field("indexId", &self.index_id)?;
}
if self.cascade {
struct_ser.serialize_field("cascade", &self.cascade)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropIndexRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"index_id",
"indexId",
"cascade",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
IndexId,
Cascade,
}
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 {
"indexId" | "index_id" => Ok(GeneratedField::IndexId),
"cascade" => Ok(GeneratedField::Cascade),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DropIndexRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropIndexRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropIndexRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut index_id__ = None;
let mut cascade__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::IndexId => {
if index_id__.is_some() {
return Err(serde::de::Error::duplicate_field("indexId"));
}
index_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Cascade => {
if cascade__.is_some() {
return Err(serde::de::Error::duplicate_field("cascade"));
}
cascade__ = Some(map_.next_value()?);
}
}
}
Ok(DropIndexRequest {
index_id: index_id__.unwrap_or_default(),
cascade: cascade__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.DropIndexRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropIndexResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropIndexResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropIndexResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = DropIndexResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropIndexResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropIndexResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(DropIndexResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.DropIndexResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropMaterializedViewRequest {
#[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.cascade {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropMaterializedViewRequest", len)?;
if self.table_id != 0 {
struct_ser.serialize_field("tableId", &self.table_id)?;
}
if self.cascade {
struct_ser.serialize_field("cascade", &self.cascade)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropMaterializedViewRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table_id",
"tableId",
"cascade",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableId,
Cascade,
}
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),
"cascade" => Ok(GeneratedField::Cascade),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DropMaterializedViewRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropMaterializedViewRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropMaterializedViewRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_id__ = None;
let mut cascade__ = 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::Cascade => {
if cascade__.is_some() {
return Err(serde::de::Error::duplicate_field("cascade"));
}
cascade__ = Some(map_.next_value()?);
}
}
}
Ok(DropMaterializedViewRequest {
table_id: table_id__.unwrap_or_default(),
cascade: cascade__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.DropMaterializedViewRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropMaterializedViewResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropMaterializedViewResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropMaterializedViewResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = DropMaterializedViewResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropMaterializedViewResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropMaterializedViewResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(DropMaterializedViewResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.DropMaterializedViewResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropSchemaRequest {
#[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.schema_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropSchemaRequest", len)?;
if self.schema_id != 0 {
struct_ser.serialize_field("schemaId", &self.schema_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropSchemaRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"schema_id",
"schemaId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SchemaId,
}
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 {
"schemaId" | "schema_id" => Ok(GeneratedField::SchemaId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DropSchemaRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropSchemaRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropSchemaRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut schema_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
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)
;
}
}
}
Ok(DropSchemaRequest {
schema_id: schema_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.DropSchemaRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropSchemaResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropSchemaResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropSchemaResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = DropSchemaResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropSchemaResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropSchemaResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(DropSchemaResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.DropSchemaResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropSecretRequest {
#[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.secret_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropSecretRequest", len)?;
if self.secret_id != 0 {
struct_ser.serialize_field("secretId", &self.secret_id)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropSecretRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"secret_id",
"secretId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SecretId,
}
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 {
"secretId" | "secret_id" => Ok(GeneratedField::SecretId),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DropSecretRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropSecretRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropSecretRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut secret_id__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::SecretId => {
if secret_id__.is_some() {
return Err(serde::de::Error::duplicate_field("secretId"));
}
secret_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
}
}
Ok(DropSecretRequest {
secret_id: secret_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.DropSecretRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropSecretResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropSecretResponse", len)?;
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropSecretResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
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 {
"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 = DropSecretResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropSecretResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropSecretResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut version__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(DropSecretResponse {
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.DropSecretResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropSinkRequest {
#[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.cascade {
len += 1;
}
if self.affected_table_change.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropSinkRequest", len)?;
if self.sink_id != 0 {
struct_ser.serialize_field("sinkId", &self.sink_id)?;
}
if self.cascade {
struct_ser.serialize_field("cascade", &self.cascade)?;
}
if let Some(v) = self.affected_table_change.as_ref() {
struct_ser.serialize_field("affectedTableChange", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropSinkRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"sink_id",
"sinkId",
"cascade",
"affected_table_change",
"affectedTableChange",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SinkId,
Cascade,
AffectedTableChange,
}
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),
"cascade" => Ok(GeneratedField::Cascade),
"affectedTableChange" | "affected_table_change" => Ok(GeneratedField::AffectedTableChange),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DropSinkRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropSinkRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropSinkRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut sink_id__ = None;
let mut cascade__ = None;
let mut affected_table_change__ = 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::Cascade => {
if cascade__.is_some() {
return Err(serde::de::Error::duplicate_field("cascade"));
}
cascade__ = Some(map_.next_value()?);
}
GeneratedField::AffectedTableChange => {
if affected_table_change__.is_some() {
return Err(serde::de::Error::duplicate_field("affectedTableChange"));
}
affected_table_change__ = map_.next_value()?;
}
}
}
Ok(DropSinkRequest {
sink_id: sink_id__.unwrap_or_default(),
cascade: cascade__.unwrap_or_default(),
affected_table_change: affected_table_change__,
})
}
}
deserializer.deserialize_struct("ddl_service.DropSinkRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropSinkResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropSinkResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropSinkResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = DropSinkResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropSinkResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropSinkResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(DropSinkResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.DropSinkResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropSourceRequest {
#[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.source_id != 0 {
len += 1;
}
if self.cascade {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropSourceRequest", len)?;
if self.source_id != 0 {
struct_ser.serialize_field("sourceId", &self.source_id)?;
}
if self.cascade {
struct_ser.serialize_field("cascade", &self.cascade)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropSourceRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"source_id",
"sourceId",
"cascade",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SourceId,
Cascade,
}
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 {
"sourceId" | "source_id" => Ok(GeneratedField::SourceId),
"cascade" => Ok(GeneratedField::Cascade),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DropSourceRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropSourceRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropSourceRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut source_id__ = None;
let mut cascade__ = None;
while let Some(k) = map_.next_key()? {
match k {
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::Cascade => {
if cascade__.is_some() {
return Err(serde::de::Error::duplicate_field("cascade"));
}
cascade__ = Some(map_.next_value()?);
}
}
}
Ok(DropSourceRequest {
source_id: source_id__.unwrap_or_default(),
cascade: cascade__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.DropSourceRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropSourceResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropSourceResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropSourceResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = DropSourceResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropSourceResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropSourceResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(DropSourceResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.DropSourceResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropSubscriptionRequest {
#[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.subscription_id != 0 {
len += 1;
}
if self.cascade {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropSubscriptionRequest", len)?;
if self.subscription_id != 0 {
struct_ser.serialize_field("subscriptionId", &self.subscription_id)?;
}
if self.cascade {
struct_ser.serialize_field("cascade", &self.cascade)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropSubscriptionRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"subscription_id",
"subscriptionId",
"cascade",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
SubscriptionId,
Cascade,
}
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 {
"subscriptionId" | "subscription_id" => Ok(GeneratedField::SubscriptionId),
"cascade" => Ok(GeneratedField::Cascade),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DropSubscriptionRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropSubscriptionRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropSubscriptionRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut subscription_id__ = None;
let mut cascade__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::SubscriptionId => {
if subscription_id__.is_some() {
return Err(serde::de::Error::duplicate_field("subscriptionId"));
}
subscription_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Cascade => {
if cascade__.is_some() {
return Err(serde::de::Error::duplicate_field("cascade"));
}
cascade__ = Some(map_.next_value()?);
}
}
}
Ok(DropSubscriptionRequest {
subscription_id: subscription_id__.unwrap_or_default(),
cascade: cascade__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.DropSubscriptionRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropSubscriptionResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropSubscriptionResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropSubscriptionResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = DropSubscriptionResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropSubscriptionResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropSubscriptionResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(DropSubscriptionResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.DropSubscriptionResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropTableRequest {
#[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.cascade {
len += 1;
}
if self.source_id.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropTableRequest", len)?;
if self.table_id != 0 {
struct_ser.serialize_field("tableId", &self.table_id)?;
}
if self.cascade {
struct_ser.serialize_field("cascade", &self.cascade)?;
}
if let Some(v) = self.source_id.as_ref() {
match v {
drop_table_request::SourceId::Id(v) => {
struct_ser.serialize_field("id", v)?;
}
}
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropTableRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table_id",
"tableId",
"cascade",
"id",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableId,
Cascade,
Id,
}
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),
"cascade" => Ok(GeneratedField::Cascade),
"id" => Ok(GeneratedField::Id),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DropTableRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropTableRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropTableRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_id__ = None;
let mut cascade__ = None;
let mut source_id__ = 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::Cascade => {
if cascade__.is_some() {
return Err(serde::de::Error::duplicate_field("cascade"));
}
cascade__ = Some(map_.next_value()?);
}
GeneratedField::Id => {
if source_id__.is_some() {
return Err(serde::de::Error::duplicate_field("id"));
}
source_id__ = map_.next_value::<::std::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| drop_table_request::SourceId::Id(x.0));
}
}
}
Ok(DropTableRequest {
table_id: table_id__.unwrap_or_default(),
cascade: cascade__.unwrap_or_default(),
source_id: source_id__,
})
}
}
deserializer.deserialize_struct("ddl_service.DropTableRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropTableResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropTableResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropTableResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = DropTableResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropTableResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropTableResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(DropTableResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.DropTableResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropViewRequest {
#[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.view_id != 0 {
len += 1;
}
if self.cascade {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropViewRequest", len)?;
if self.view_id != 0 {
struct_ser.serialize_field("viewId", &self.view_id)?;
}
if self.cascade {
struct_ser.serialize_field("cascade", &self.cascade)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropViewRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"view_id",
"viewId",
"cascade",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ViewId,
Cascade,
}
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 {
"viewId" | "view_id" => Ok(GeneratedField::ViewId),
"cascade" => Ok(GeneratedField::Cascade),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = DropViewRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropViewRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropViewRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut view_id__ = None;
let mut cascade__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ViewId => {
if view_id__.is_some() {
return Err(serde::de::Error::duplicate_field("viewId"));
}
view_id__ =
Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0)
;
}
GeneratedField::Cascade => {
if cascade__.is_some() {
return Err(serde::de::Error::duplicate_field("cascade"));
}
cascade__ = Some(map_.next_value()?);
}
}
}
Ok(DropViewRequest {
view_id: view_id__.unwrap_or_default(),
cascade: cascade__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.DropViewRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for DropViewResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.DropViewResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for DropViewResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = DropViewResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.DropViewResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<DropViewResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(DropViewResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.DropViewResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetDdlProgressRequest {
#[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("ddl_service.GetDdlProgressRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetDdlProgressRequest {
#[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 = GetDdlProgressRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.GetDdlProgressRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetDdlProgressRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(GetDdlProgressRequest {
})
}
}
deserializer.deserialize_struct("ddl_service.GetDdlProgressRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetDdlProgressResponse {
#[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.ddl_progress.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.GetDdlProgressResponse", len)?;
if !self.ddl_progress.is_empty() {
struct_ser.serialize_field("ddlProgress", &self.ddl_progress)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetDdlProgressResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"ddl_progress",
"ddlProgress",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
DdlProgress,
}
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 {
"ddlProgress" | "ddl_progress" => Ok(GeneratedField::DdlProgress),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetDdlProgressResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.GetDdlProgressResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetDdlProgressResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut ddl_progress__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::DdlProgress => {
if ddl_progress__.is_some() {
return Err(serde::de::Error::duplicate_field("ddlProgress"));
}
ddl_progress__ = Some(map_.next_value()?);
}
}
}
Ok(GetDdlProgressResponse {
ddl_progress: ddl_progress__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.GetDdlProgressResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetTableRequest {
#[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_name.is_empty() {
len += 1;
}
if !self.table_name.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.GetTableRequest", len)?;
if !self.database_name.is_empty() {
struct_ser.serialize_field("databaseName", &self.database_name)?;
}
if !self.table_name.is_empty() {
struct_ser.serialize_field("tableName", &self.table_name)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetTableRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"database_name",
"databaseName",
"table_name",
"tableName",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
DatabaseName,
TableName,
}
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 {
"databaseName" | "database_name" => Ok(GeneratedField::DatabaseName),
"tableName" | "table_name" => Ok(GeneratedField::TableName),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetTableRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.GetTableRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetTableRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut database_name__ = None;
let mut table_name__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::DatabaseName => {
if database_name__.is_some() {
return Err(serde::de::Error::duplicate_field("databaseName"));
}
database_name__ = Some(map_.next_value()?);
}
GeneratedField::TableName => {
if table_name__.is_some() {
return Err(serde::de::Error::duplicate_field("tableName"));
}
table_name__ = Some(map_.next_value()?);
}
}
}
Ok(GetTableRequest {
database_name: database_name__.unwrap_or_default(),
table_name: table_name__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.GetTableRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetTableResponse {
#[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.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.GetTableResponse", len)?;
if let Some(v) = self.table.as_ref() {
struct_ser.serialize_field("table", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetTableResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Table,
}
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),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetTableResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.GetTableResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetTableResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Table => {
if table__.is_some() {
return Err(serde::de::Error::duplicate_field("table"));
}
table__ = map_.next_value()?;
}
}
}
Ok(GetTableResponse {
table: table__,
})
}
}
deserializer.deserialize_struct("ddl_service.GetTableResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetTablesRequest {
#[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("ddl_service.GetTablesRequest", len)?;
if !self.table_ids.is_empty() {
struct_ser.serialize_field("tableIds", &self.table_ids)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetTablesRequest {
#[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 = GetTablesRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.GetTablesRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetTablesRequest, 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(GetTablesRequest {
table_ids: table_ids__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.GetTablesRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for GetTablesResponse {
#[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.tables.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.GetTablesResponse", len)?;
if !self.tables.is_empty() {
struct_ser.serialize_field("tables", &self.tables)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for GetTablesResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"tables",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Tables,
}
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 {
"tables" => Ok(GeneratedField::Tables),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = GetTablesResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.GetTablesResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<GetTablesResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut tables__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Tables => {
if tables__.is_some() {
return Err(serde::de::Error::duplicate_field("tables"));
}
tables__ = Some(
map_.next_value::<std::collections::HashMap<::pbjson::private::NumberDeserialize<u32>, _>>()?
.into_iter().map(|(k,v)| (k.0, v)).collect()
);
}
}
}
Ok(GetTablesResponse {
tables: tables__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.GetTablesResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListConnectionsRequest {
#[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("ddl_service.ListConnectionsRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListConnectionsRequest {
#[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 = ListConnectionsRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.ListConnectionsRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListConnectionsRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(ListConnectionsRequest {
})
}
}
deserializer.deserialize_struct("ddl_service.ListConnectionsRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ListConnectionsResponse {
#[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.connections.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.ListConnectionsResponse", len)?;
if !self.connections.is_empty() {
struct_ser.serialize_field("connections", &self.connections)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ListConnectionsResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"connections",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Connections,
}
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 {
"connections" => Ok(GeneratedField::Connections),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ListConnectionsResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.ListConnectionsResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ListConnectionsResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut connections__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Connections => {
if connections__.is_some() {
return Err(serde::de::Error::duplicate_field("connections"));
}
connections__ = Some(map_.next_value()?);
}
}
}
Ok(ListConnectionsResponse {
connections: connections__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.ListConnectionsResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ReplaceTablePlan {
#[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.is_some() {
len += 1;
}
if self.fragment_graph.is_some() {
len += 1;
}
if self.table_col_index_mapping.is_some() {
len += 1;
}
if self.source.is_some() {
len += 1;
}
if self.job_type != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.ReplaceTablePlan", len)?;
if let Some(v) = self.table.as_ref() {
struct_ser.serialize_field("table", v)?;
}
if let Some(v) = self.fragment_graph.as_ref() {
struct_ser.serialize_field("fragmentGraph", v)?;
}
if let Some(v) = self.table_col_index_mapping.as_ref() {
struct_ser.serialize_field("tableColIndexMapping", v)?;
}
if let Some(v) = self.source.as_ref() {
struct_ser.serialize_field("source", v)?;
}
if self.job_type != 0 {
let v = TableJobType::try_from(self.job_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.job_type)))?;
struct_ser.serialize_field("jobType", &v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ReplaceTablePlan {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table",
"fragment_graph",
"fragmentGraph",
"table_col_index_mapping",
"tableColIndexMapping",
"source",
"job_type",
"jobType",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Table,
FragmentGraph,
TableColIndexMapping,
Source,
JobType,
}
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),
"fragmentGraph" | "fragment_graph" => Ok(GeneratedField::FragmentGraph),
"tableColIndexMapping" | "table_col_index_mapping" => Ok(GeneratedField::TableColIndexMapping),
"source" => Ok(GeneratedField::Source),
"jobType" | "job_type" => Ok(GeneratedField::JobType),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ReplaceTablePlan;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.ReplaceTablePlan")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ReplaceTablePlan, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table__ = None;
let mut fragment_graph__ = None;
let mut table_col_index_mapping__ = None;
let mut source__ = None;
let mut job_type__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Table => {
if table__.is_some() {
return Err(serde::de::Error::duplicate_field("table"));
}
table__ = map_.next_value()?;
}
GeneratedField::FragmentGraph => {
if fragment_graph__.is_some() {
return Err(serde::de::Error::duplicate_field("fragmentGraph"));
}
fragment_graph__ = map_.next_value()?;
}
GeneratedField::TableColIndexMapping => {
if table_col_index_mapping__.is_some() {
return Err(serde::de::Error::duplicate_field("tableColIndexMapping"));
}
table_col_index_mapping__ = map_.next_value()?;
}
GeneratedField::Source => {
if source__.is_some() {
return Err(serde::de::Error::duplicate_field("source"));
}
source__ = map_.next_value()?;
}
GeneratedField::JobType => {
if job_type__.is_some() {
return Err(serde::de::Error::duplicate_field("jobType"));
}
job_type__ = Some(map_.next_value::<TableJobType>()? as i32);
}
}
}
Ok(ReplaceTablePlan {
table: table__,
fragment_graph: fragment_graph__,
table_col_index_mapping: table_col_index_mapping__,
source: source__,
job_type: job_type__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.ReplaceTablePlan", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ReplaceTablePlanRequest {
#[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.plan.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.ReplaceTablePlanRequest", len)?;
if let Some(v) = self.plan.as_ref() {
struct_ser.serialize_field("plan", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ReplaceTablePlanRequest {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"plan",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Plan,
}
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 {
"plan" => Ok(GeneratedField::Plan),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = ReplaceTablePlanRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.ReplaceTablePlanRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ReplaceTablePlanRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut plan__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Plan => {
if plan__.is_some() {
return Err(serde::de::Error::duplicate_field("plan"));
}
plan__ = map_.next_value()?;
}
}
}
Ok(ReplaceTablePlanRequest {
plan: plan__,
})
}
}
deserializer.deserialize_struct("ddl_service.ReplaceTablePlanRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for ReplaceTablePlanResponse {
#[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.version.is_some() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.ReplaceTablePlanResponse", len)?;
if let Some(v) = self.status.as_ref() {
struct_ser.serialize_field("status", v)?;
}
if let Some(v) = self.version.as_ref() {
struct_ser.serialize_field("version", v)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for ReplaceTablePlanResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"status",
"version",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Status,
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 {
"status" => Ok(GeneratedField::Status),
"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 = ReplaceTablePlanResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.ReplaceTablePlanResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<ReplaceTablePlanResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut status__ = None;
let mut version__ = 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::Version => {
if version__.is_some() {
return Err(serde::de::Error::duplicate_field("version"));
}
version__ = map_.next_value()?;
}
}
}
Ok(ReplaceTablePlanResponse {
status: status__,
version: version__,
})
}
}
deserializer.deserialize_struct("ddl_service.ReplaceTablePlanResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RisectlListStateTablesRequest {
#[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("ddl_service.RisectlListStateTablesRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RisectlListStateTablesRequest {
#[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 = RisectlListStateTablesRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.RisectlListStateTablesRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RisectlListStateTablesRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(RisectlListStateTablesRequest {
})
}
}
deserializer.deserialize_struct("ddl_service.RisectlListStateTablesRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for RisectlListStateTablesResponse {
#[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.tables.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.RisectlListStateTablesResponse", len)?;
if !self.tables.is_empty() {
struct_ser.serialize_field("tables", &self.tables)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for RisectlListStateTablesResponse {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"tables",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
Tables,
}
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 {
"tables" => Ok(GeneratedField::Tables),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = RisectlListStateTablesResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.RisectlListStateTablesResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<RisectlListStateTablesResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut tables__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::Tables => {
if tables__.is_some() {
return Err(serde::de::Error::duplicate_field("tables"));
}
tables__ = Some(map_.next_value()?);
}
}
}
Ok(RisectlListStateTablesResponse {
tables: tables__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.RisectlListStateTablesResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for SchemaChangeEnvelope {
#[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_changes.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.SchemaChangeEnvelope", len)?;
if !self.table_changes.is_empty() {
struct_ser.serialize_field("tableChanges", &self.table_changes)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for SchemaChangeEnvelope {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"table_changes",
"tableChanges",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
TableChanges,
}
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 {
"tableChanges" | "table_changes" => Ok(GeneratedField::TableChanges),
_ => Err(serde::de::Error::unknown_field(value, FIELDS)),
}
}
}
deserializer.deserialize_identifier(GeneratedVisitor)
}
}
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = SchemaChangeEnvelope;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.SchemaChangeEnvelope")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<SchemaChangeEnvelope, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut table_changes__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::TableChanges => {
if table_changes__.is_some() {
return Err(serde::de::Error::duplicate_field("tableChanges"));
}
table_changes__ = Some(map_.next_value()?);
}
}
}
Ok(SchemaChangeEnvelope {
table_changes: table_changes__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.SchemaChangeEnvelope", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for TableJobType {
#[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 => "TABLE_JOB_TYPE_UNSPECIFIED",
Self::General => "TABLE_JOB_TYPE_GENERAL",
Self::SharedCdcSource => "TABLE_JOB_TYPE_SHARED_CDC_SOURCE",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for TableJobType {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"TABLE_JOB_TYPE_UNSPECIFIED",
"TABLE_JOB_TYPE_GENERAL",
"TABLE_JOB_TYPE_SHARED_CDC_SOURCE",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = TableJobType;
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 {
"TABLE_JOB_TYPE_UNSPECIFIED" => Ok(TableJobType::Unspecified),
"TABLE_JOB_TYPE_GENERAL" => Ok(TableJobType::General),
"TABLE_JOB_TYPE_SHARED_CDC_SOURCE" => Ok(TableJobType::SharedCdcSource),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for TableSchemaChange {
#[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.change_type != 0 {
len += 1;
}
if !self.cdc_table_id.is_empty() {
len += 1;
}
if !self.columns.is_empty() {
len += 1;
}
if !self.upstream_ddl.is_empty() {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.TableSchemaChange", len)?;
if self.change_type != 0 {
let v = table_schema_change::TableChangeType::try_from(self.change_type)
.map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.change_type)))?;
struct_ser.serialize_field("changeType", &v)?;
}
if !self.cdc_table_id.is_empty() {
struct_ser.serialize_field("cdcTableId", &self.cdc_table_id)?;
}
if !self.columns.is_empty() {
struct_ser.serialize_field("columns", &self.columns)?;
}
if !self.upstream_ddl.is_empty() {
struct_ser.serialize_field("upstreamDdl", &self.upstream_ddl)?;
}
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for TableSchemaChange {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"change_type",
"changeType",
"cdc_table_id",
"cdcTableId",
"columns",
"upstream_ddl",
"upstreamDdl",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
ChangeType,
CdcTableId,
Columns,
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 {
"changeType" | "change_type" => Ok(GeneratedField::ChangeType),
"cdcTableId" | "cdc_table_id" => Ok(GeneratedField::CdcTableId),
"columns" => Ok(GeneratedField::Columns),
"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 = TableSchemaChange;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.TableSchemaChange")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<TableSchemaChange, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut change_type__ = None;
let mut cdc_table_id__ = None;
let mut columns__ = None;
let mut upstream_ddl__ = None;
while let Some(k) = map_.next_key()? {
match k {
GeneratedField::ChangeType => {
if change_type__.is_some() {
return Err(serde::de::Error::duplicate_field("changeType"));
}
change_type__ = Some(map_.next_value::<table_schema_change::TableChangeType>()? as i32);
}
GeneratedField::CdcTableId => {
if cdc_table_id__.is_some() {
return Err(serde::de::Error::duplicate_field("cdcTableId"));
}
cdc_table_id__ = Some(map_.next_value()?);
}
GeneratedField::Columns => {
if columns__.is_some() {
return Err(serde::de::Error::duplicate_field("columns"));
}
columns__ = 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(TableSchemaChange {
change_type: change_type__.unwrap_or_default(),
cdc_table_id: cdc_table_id__.unwrap_or_default(),
columns: columns__.unwrap_or_default(),
upstream_ddl: upstream_ddl__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.TableSchemaChange", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for table_schema_change::TableChangeType {
#[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::Alter => "ALTER",
Self::Create => "CREATE",
Self::Drop => "DROP",
};
serializer.serialize_str(variant)
}
}
impl<'de> serde::Deserialize<'de> for table_schema_change::TableChangeType {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"UNSPECIFIED",
"ALTER",
"CREATE",
"DROP",
];
struct GeneratedVisitor;
impl<'de> serde::de::Visitor<'de> for GeneratedVisitor {
type Value = table_schema_change::TableChangeType;
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_schema_change::TableChangeType::Unspecified),
"ALTER" => Ok(table_schema_change::TableChangeType::Alter),
"CREATE" => Ok(table_schema_change::TableChangeType::Create),
"DROP" => Ok(table_schema_change::TableChangeType::Drop),
_ => Err(serde::de::Error::unknown_variant(value, FIELDS)),
}
}
}
deserializer.deserialize_any(GeneratedVisitor)
}
}
impl serde::Serialize for WaitRequest {
#[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("ddl_service.WaitRequest", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for WaitRequest {
#[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 = WaitRequest;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.WaitRequest")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<WaitRequest, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(WaitRequest {
})
}
}
deserializer.deserialize_struct("ddl_service.WaitRequest", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for WaitResponse {
#[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("ddl_service.WaitResponse", len)?;
struct_ser.end()
}
}
impl<'de> serde::Deserialize<'de> for WaitResponse {
#[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 = WaitResponse;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.WaitResponse")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<WaitResponse, V::Error>
where
V: serde::de::MapAccess<'de>,
{
while map_.next_key::<GeneratedField>()?.is_some() {
let _ = map_.next_value::<serde::de::IgnoredAny>()?;
}
Ok(WaitResponse {
})
}
}
deserializer.deserialize_struct("ddl_service.WaitResponse", FIELDS, GeneratedVisitor)
}
}
impl serde::Serialize for WaitVersion {
#[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.hummock_version_id != 0 {
len += 1;
}
let mut struct_ser = serializer.serialize_struct("ddl_service.WaitVersion", 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.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 WaitVersion {
#[allow(deprecated)]
fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
where
D: serde::Deserializer<'de>,
{
const FIELDS: &[&str] = &[
"catalog_version",
"catalogVersion",
"hummock_version_id",
"hummockVersionId",
];
#[allow(clippy::enum_variant_names)]
enum GeneratedField {
CatalogVersion,
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 {
"catalogVersion" | "catalog_version" => Ok(GeneratedField::CatalogVersion),
"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 = WaitVersion;
fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
formatter.write_str("struct ddl_service.WaitVersion")
}
fn visit_map<V>(self, mut map_: V) -> std::result::Result<WaitVersion, V::Error>
where
V: serde::de::MapAccess<'de>,
{
let mut catalog_version__ = None;
let mut hummock_version_id__ = 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::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(WaitVersion {
catalog_version: catalog_version__.unwrap_or_default(),
hummock_version_id: hummock_version_id__.unwrap_or_default(),
})
}
}
deserializer.deserialize_struct("ddl_service.WaitVersion", FIELDS, GeneratedVisitor)
}
}