// @generated impl serde::Serialize for CreateRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; let mut len = 0; if !self.data.is_empty() { len += 1; } if !self.context.is_empty() { len += 1; } let mut struct_ser = serializer.serialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.CreateRequest", len)?; if !self.data.is_empty() { struct_ser.serialize_field("data", &self.data)?; } if !self.context.is_empty() { struct_ser.serialize_field("context", &self.context)?; } struct_ser.end() } } impl<'de> serde::Deserialize<'de> for CreateRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ "data", "context", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { Data, Context, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result 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(self, value: &str) -> std::result::Result where E: serde::de::Error, { match value { "data" => Ok(GeneratedField::Data), "context" => Ok(GeneratedField::Context), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } } deserializer.deserialize_identifier(GeneratedVisitor) } } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { type Value = CreateRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { formatter.write_str("struct envoy.extensions.filters.network.sip_proxy.tra.v3alpha.CreateRequest") } fn visit_map(self, mut map: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut data__ = None; let mut context__ = None; while let Some(k) = map.next_key()? { match k { GeneratedField::Data => { if data__.is_some() { return Err(serde::de::Error::duplicate_field("data")); } data__ = Some( map.next_value::>()? ); } GeneratedField::Context => { if context__.is_some() { return Err(serde::de::Error::duplicate_field("context")); } context__ = Some( map.next_value::>()? ); } } } Ok(CreateRequest { data: data__.unwrap_or_default(), context: context__.unwrap_or_default(), }) } } deserializer.deserialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.CreateRequest", FIELDS, GeneratedVisitor) } } impl serde::Serialize for CreateResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; let len = 0; let struct_ser = serializer.serialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.CreateResponse", len)?; struct_ser.end() } } impl<'de> serde::Deserialize<'de> for CreateResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result 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(self, value: &str) -> std::result::Result 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 = CreateResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { formatter.write_str("struct envoy.extensions.filters.network.sip_proxy.tra.v3alpha.CreateResponse") } fn visit_map(self, mut map: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { while map.next_key::()?.is_some() { let _ = map.next_value::()?; } Ok(CreateResponse { }) } } deserializer.deserialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.CreateResponse", FIELDS, GeneratedVisitor) } } impl serde::Serialize for DeleteRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; let mut len = 0; if !self.key.is_empty() { len += 1; } if !self.context.is_empty() { len += 1; } let mut struct_ser = serializer.serialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.DeleteRequest", len)?; if !self.key.is_empty() { struct_ser.serialize_field("key", &self.key)?; } if !self.context.is_empty() { struct_ser.serialize_field("context", &self.context)?; } struct_ser.end() } } impl<'de> serde::Deserialize<'de> for DeleteRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ "key", "context", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { Key, Context, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result 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(self, value: &str) -> std::result::Result where E: serde::de::Error, { match value { "key" => Ok(GeneratedField::Key), "context" => Ok(GeneratedField::Context), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } } deserializer.deserialize_identifier(GeneratedVisitor) } } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { type Value = DeleteRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { formatter.write_str("struct envoy.extensions.filters.network.sip_proxy.tra.v3alpha.DeleteRequest") } fn visit_map(self, mut map: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut key__ = None; let mut context__ = None; while let Some(k) = map.next_key()? { match k { GeneratedField::Key => { if key__.is_some() { return Err(serde::de::Error::duplicate_field("key")); } key__ = Some(map.next_value()?); } GeneratedField::Context => { if context__.is_some() { return Err(serde::de::Error::duplicate_field("context")); } context__ = Some( map.next_value::>()? ); } } } Ok(DeleteRequest { key: key__.unwrap_or_default(), context: context__.unwrap_or_default(), }) } } deserializer.deserialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.DeleteRequest", FIELDS, GeneratedVisitor) } } impl serde::Serialize for DeleteResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; let len = 0; let struct_ser = serializer.serialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.DeleteResponse", len)?; struct_ser.end() } } impl<'de> serde::Deserialize<'de> for DeleteResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result 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(self, value: &str) -> std::result::Result 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 = DeleteResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { formatter.write_str("struct envoy.extensions.filters.network.sip_proxy.tra.v3alpha.DeleteResponse") } fn visit_map(self, mut map: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { while map.next_key::()?.is_some() { let _ = map.next_value::()?; } Ok(DeleteResponse { }) } } deserializer.deserialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.DeleteResponse", FIELDS, GeneratedVisitor) } } impl serde::Serialize for RetrieveRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; let mut len = 0; if !self.key.is_empty() { len += 1; } if !self.context.is_empty() { len += 1; } let mut struct_ser = serializer.serialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.RetrieveRequest", len)?; if !self.key.is_empty() { struct_ser.serialize_field("key", &self.key)?; } if !self.context.is_empty() { struct_ser.serialize_field("context", &self.context)?; } struct_ser.end() } } impl<'de> serde::Deserialize<'de> for RetrieveRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ "key", "context", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { Key, Context, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result 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(self, value: &str) -> std::result::Result where E: serde::de::Error, { match value { "key" => Ok(GeneratedField::Key), "context" => Ok(GeneratedField::Context), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } } deserializer.deserialize_identifier(GeneratedVisitor) } } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { type Value = RetrieveRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { formatter.write_str("struct envoy.extensions.filters.network.sip_proxy.tra.v3alpha.RetrieveRequest") } fn visit_map(self, mut map: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut key__ = None; let mut context__ = None; while let Some(k) = map.next_key()? { match k { GeneratedField::Key => { if key__.is_some() { return Err(serde::de::Error::duplicate_field("key")); } key__ = Some(map.next_value()?); } GeneratedField::Context => { if context__.is_some() { return Err(serde::de::Error::duplicate_field("context")); } context__ = Some( map.next_value::>()? ); } } } Ok(RetrieveRequest { key: key__.unwrap_or_default(), context: context__.unwrap_or_default(), }) } } deserializer.deserialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.RetrieveRequest", FIELDS, GeneratedVisitor) } } impl serde::Serialize for RetrieveResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; let mut len = 0; if !self.data.is_empty() { len += 1; } let mut struct_ser = serializer.serialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.RetrieveResponse", len)?; if !self.data.is_empty() { struct_ser.serialize_field("data", &self.data)?; } struct_ser.end() } } impl<'de> serde::Deserialize<'de> for RetrieveResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ "data", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { Data, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result 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(self, value: &str) -> std::result::Result where E: serde::de::Error, { match value { "data" => Ok(GeneratedField::Data), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } } deserializer.deserialize_identifier(GeneratedVisitor) } } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { type Value = RetrieveResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { formatter.write_str("struct envoy.extensions.filters.network.sip_proxy.tra.v3alpha.RetrieveResponse") } fn visit_map(self, mut map: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut data__ = None; while let Some(k) = map.next_key()? { match k { GeneratedField::Data => { if data__.is_some() { return Err(serde::de::Error::duplicate_field("data")); } data__ = Some( map.next_value::>()? ); } } } Ok(RetrieveResponse { data: data__.unwrap_or_default(), }) } } deserializer.deserialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.RetrieveResponse", FIELDS, GeneratedVisitor) } } impl serde::Serialize for SubscribeRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; let len = 0; let struct_ser = serializer.serialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.SubscribeRequest", len)?; struct_ser.end() } } impl<'de> serde::Deserialize<'de> for SubscribeRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result 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(self, value: &str) -> std::result::Result 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 = SubscribeRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { formatter.write_str("struct envoy.extensions.filters.network.sip_proxy.tra.v3alpha.SubscribeRequest") } fn visit_map(self, mut map: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { while map.next_key::()?.is_some() { let _ = map.next_value::()?; } Ok(SubscribeRequest { }) } } deserializer.deserialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.SubscribeRequest", FIELDS, GeneratedVisitor) } } impl serde::Serialize for SubscribeResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; let mut len = 0; if !self.data.is_empty() { len += 1; } let mut struct_ser = serializer.serialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.SubscribeResponse", len)?; if !self.data.is_empty() { struct_ser.serialize_field("data", &self.data)?; } struct_ser.end() } } impl<'de> serde::Deserialize<'de> for SubscribeResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ "data", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { Data, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result 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(self, value: &str) -> std::result::Result where E: serde::de::Error, { match value { "data" => Ok(GeneratedField::Data), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } } deserializer.deserialize_identifier(GeneratedVisitor) } } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { type Value = SubscribeResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { formatter.write_str("struct envoy.extensions.filters.network.sip_proxy.tra.v3alpha.SubscribeResponse") } fn visit_map(self, mut map: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut data__ = None; while let Some(k) = map.next_key()? { match k { GeneratedField::Data => { if data__.is_some() { return Err(serde::de::Error::duplicate_field("data")); } data__ = Some( map.next_value::>()? ); } } } Ok(SubscribeResponse { data: data__.unwrap_or_default(), }) } } deserializer.deserialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.SubscribeResponse", FIELDS, GeneratedVisitor) } } impl serde::Serialize for TraServiceConfig { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; let mut len = 0; if self.grpc_service.is_some() { len += 1; } if self.transport_api_version != 0 { len += 1; } if self.timeout.is_some() { len += 1; } let mut struct_ser = serializer.serialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.TraServiceConfig", len)?; if let Some(v) = self.grpc_service.as_ref() { struct_ser.serialize_field("grpcService", v)?; } if self.transport_api_version != 0 { let v = super::super::super::super::super::super::config::core::v3::ApiVersion::from_i32(self.transport_api_version) .ok_or_else(|| serde::ser::Error::custom(format!("Invalid variant {}", self.transport_api_version)))?; struct_ser.serialize_field("transportApiVersion", &v)?; } if let Some(v) = self.timeout.as_ref() { struct_ser.serialize_field("timeout", v)?; } struct_ser.end() } } impl<'de> serde::Deserialize<'de> for TraServiceConfig { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ "grpc_service", "grpcService", "transport_api_version", "transportApiVersion", "timeout", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { GrpcService, TransportApiVersion, Timeout, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result 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(self, value: &str) -> std::result::Result where E: serde::de::Error, { match value { "grpcService" | "grpc_service" => Ok(GeneratedField::GrpcService), "transportApiVersion" | "transport_api_version" => Ok(GeneratedField::TransportApiVersion), "timeout" => Ok(GeneratedField::Timeout), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } } deserializer.deserialize_identifier(GeneratedVisitor) } } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { type Value = TraServiceConfig; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { formatter.write_str("struct envoy.extensions.filters.network.sip_proxy.tra.v3alpha.TraServiceConfig") } fn visit_map(self, mut map: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut grpc_service__ = None; let mut transport_api_version__ = None; let mut timeout__ = None; while let Some(k) = map.next_key()? { match k { GeneratedField::GrpcService => { if grpc_service__.is_some() { return Err(serde::de::Error::duplicate_field("grpcService")); } grpc_service__ = map.next_value()?; } GeneratedField::TransportApiVersion => { if transport_api_version__.is_some() { return Err(serde::de::Error::duplicate_field("transportApiVersion")); } transport_api_version__ = Some(map.next_value::()? as i32); } GeneratedField::Timeout => { if timeout__.is_some() { return Err(serde::de::Error::duplicate_field("timeout")); } timeout__ = map.next_value()?; } } } Ok(TraServiceConfig { grpc_service: grpc_service__, transport_api_version: transport_api_version__.unwrap_or_default(), timeout: timeout__, }) } } deserializer.deserialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.TraServiceConfig", FIELDS, GeneratedVisitor) } } impl serde::Serialize for TraServiceRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; let mut len = 0; if !self.r#type.is_empty() { len += 1; } if self.request.is_some() { len += 1; } let mut struct_ser = serializer.serialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.TraServiceRequest", len)?; if !self.r#type.is_empty() { struct_ser.serialize_field("type", &self.r#type)?; } if let Some(v) = self.request.as_ref() { match v { tra_service_request::Request::CreateRequest(v) => { struct_ser.serialize_field("createRequest", v)?; } tra_service_request::Request::UpdateRequest(v) => { struct_ser.serialize_field("updateRequest", v)?; } tra_service_request::Request::RetrieveRequest(v) => { struct_ser.serialize_field("retrieveRequest", v)?; } tra_service_request::Request::DeleteRequest(v) => { struct_ser.serialize_field("deleteRequest", v)?; } tra_service_request::Request::SubscribeRequest(v) => { struct_ser.serialize_field("subscribeRequest", v)?; } } } struct_ser.end() } } impl<'de> serde::Deserialize<'de> for TraServiceRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ "type", "create_request", "createRequest", "update_request", "updateRequest", "retrieve_request", "retrieveRequest", "delete_request", "deleteRequest", "subscribe_request", "subscribeRequest", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { Type, CreateRequest, UpdateRequest, RetrieveRequest, DeleteRequest, SubscribeRequest, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result 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(self, value: &str) -> std::result::Result where E: serde::de::Error, { match value { "type" => Ok(GeneratedField::Type), "createRequest" | "create_request" => Ok(GeneratedField::CreateRequest), "updateRequest" | "update_request" => Ok(GeneratedField::UpdateRequest), "retrieveRequest" | "retrieve_request" => Ok(GeneratedField::RetrieveRequest), "deleteRequest" | "delete_request" => Ok(GeneratedField::DeleteRequest), "subscribeRequest" | "subscribe_request" => Ok(GeneratedField::SubscribeRequest), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } } deserializer.deserialize_identifier(GeneratedVisitor) } } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { type Value = TraServiceRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { formatter.write_str("struct envoy.extensions.filters.network.sip_proxy.tra.v3alpha.TraServiceRequest") } fn visit_map(self, mut map: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut r#type__ = None; let mut request__ = None; while let Some(k) = map.next_key()? { match k { GeneratedField::Type => { if r#type__.is_some() { return Err(serde::de::Error::duplicate_field("type")); } r#type__ = Some(map.next_value()?); } GeneratedField::CreateRequest => { if request__.is_some() { return Err(serde::de::Error::duplicate_field("createRequest")); } request__ = map.next_value::<::std::option::Option<_>>()?.map(tra_service_request::Request::CreateRequest) ; } GeneratedField::UpdateRequest => { if request__.is_some() { return Err(serde::de::Error::duplicate_field("updateRequest")); } request__ = map.next_value::<::std::option::Option<_>>()?.map(tra_service_request::Request::UpdateRequest) ; } GeneratedField::RetrieveRequest => { if request__.is_some() { return Err(serde::de::Error::duplicate_field("retrieveRequest")); } request__ = map.next_value::<::std::option::Option<_>>()?.map(tra_service_request::Request::RetrieveRequest) ; } GeneratedField::DeleteRequest => { if request__.is_some() { return Err(serde::de::Error::duplicate_field("deleteRequest")); } request__ = map.next_value::<::std::option::Option<_>>()?.map(tra_service_request::Request::DeleteRequest) ; } GeneratedField::SubscribeRequest => { if request__.is_some() { return Err(serde::de::Error::duplicate_field("subscribeRequest")); } request__ = map.next_value::<::std::option::Option<_>>()?.map(tra_service_request::Request::SubscribeRequest) ; } } } Ok(TraServiceRequest { r#type: r#type__.unwrap_or_default(), request: request__, }) } } deserializer.deserialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.TraServiceRequest", FIELDS, GeneratedVisitor) } } impl serde::Serialize for TraServiceResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; let mut len = 0; if !self.r#type.is_empty() { len += 1; } if self.ret != 0 { len += 1; } if !self.reason.is_empty() { len += 1; } if self.response.is_some() { len += 1; } let mut struct_ser = serializer.serialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.TraServiceResponse", len)?; if !self.r#type.is_empty() { struct_ser.serialize_field("type", &self.r#type)?; } if self.ret != 0 { struct_ser.serialize_field("ret", &self.ret)?; } if !self.reason.is_empty() { struct_ser.serialize_field("reason", &self.reason)?; } if let Some(v) = self.response.as_ref() { match v { tra_service_response::Response::CreateResponse(v) => { struct_ser.serialize_field("createResponse", v)?; } tra_service_response::Response::UpdateResponse(v) => { struct_ser.serialize_field("updateResponse", v)?; } tra_service_response::Response::RetrieveResponse(v) => { struct_ser.serialize_field("retrieveResponse", v)?; } tra_service_response::Response::DeleteResponse(v) => { struct_ser.serialize_field("deleteResponse", v)?; } tra_service_response::Response::SubscribeResponse(v) => { struct_ser.serialize_field("subscribeResponse", v)?; } } } struct_ser.end() } } impl<'de> serde::Deserialize<'de> for TraServiceResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ "type", "ret", "reason", "create_response", "createResponse", "update_response", "updateResponse", "retrieve_response", "retrieveResponse", "delete_response", "deleteResponse", "subscribe_response", "subscribeResponse", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { Type, Ret, Reason, CreateResponse, UpdateResponse, RetrieveResponse, DeleteResponse, SubscribeResponse, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result 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(self, value: &str) -> std::result::Result where E: serde::de::Error, { match value { "type" => Ok(GeneratedField::Type), "ret" => Ok(GeneratedField::Ret), "reason" => Ok(GeneratedField::Reason), "createResponse" | "create_response" => Ok(GeneratedField::CreateResponse), "updateResponse" | "update_response" => Ok(GeneratedField::UpdateResponse), "retrieveResponse" | "retrieve_response" => Ok(GeneratedField::RetrieveResponse), "deleteResponse" | "delete_response" => Ok(GeneratedField::DeleteResponse), "subscribeResponse" | "subscribe_response" => Ok(GeneratedField::SubscribeResponse), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } } deserializer.deserialize_identifier(GeneratedVisitor) } } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { type Value = TraServiceResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { formatter.write_str("struct envoy.extensions.filters.network.sip_proxy.tra.v3alpha.TraServiceResponse") } fn visit_map(self, mut map: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut r#type__ = None; let mut ret__ = None; let mut reason__ = None; let mut response__ = None; while let Some(k) = map.next_key()? { match k { GeneratedField::Type => { if r#type__.is_some() { return Err(serde::de::Error::duplicate_field("type")); } r#type__ = Some(map.next_value()?); } GeneratedField::Ret => { if ret__.is_some() { return Err(serde::de::Error::duplicate_field("ret")); } ret__ = Some(map.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) ; } GeneratedField::Reason => { if reason__.is_some() { return Err(serde::de::Error::duplicate_field("reason")); } reason__ = Some(map.next_value()?); } GeneratedField::CreateResponse => { if response__.is_some() { return Err(serde::de::Error::duplicate_field("createResponse")); } response__ = map.next_value::<::std::option::Option<_>>()?.map(tra_service_response::Response::CreateResponse) ; } GeneratedField::UpdateResponse => { if response__.is_some() { return Err(serde::de::Error::duplicate_field("updateResponse")); } response__ = map.next_value::<::std::option::Option<_>>()?.map(tra_service_response::Response::UpdateResponse) ; } GeneratedField::RetrieveResponse => { if response__.is_some() { return Err(serde::de::Error::duplicate_field("retrieveResponse")); } response__ = map.next_value::<::std::option::Option<_>>()?.map(tra_service_response::Response::RetrieveResponse) ; } GeneratedField::DeleteResponse => { if response__.is_some() { return Err(serde::de::Error::duplicate_field("deleteResponse")); } response__ = map.next_value::<::std::option::Option<_>>()?.map(tra_service_response::Response::DeleteResponse) ; } GeneratedField::SubscribeResponse => { if response__.is_some() { return Err(serde::de::Error::duplicate_field("subscribeResponse")); } response__ = map.next_value::<::std::option::Option<_>>()?.map(tra_service_response::Response::SubscribeResponse) ; } } } Ok(TraServiceResponse { r#type: r#type__.unwrap_or_default(), ret: ret__.unwrap_or_default(), reason: reason__.unwrap_or_default(), response: response__, }) } } deserializer.deserialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.TraServiceResponse", FIELDS, GeneratedVisitor) } } impl serde::Serialize for UpdateRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; let mut len = 0; if !self.data.is_empty() { len += 1; } if !self.context.is_empty() { len += 1; } let mut struct_ser = serializer.serialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.UpdateRequest", len)?; if !self.data.is_empty() { struct_ser.serialize_field("data", &self.data)?; } if !self.context.is_empty() { struct_ser.serialize_field("context", &self.context)?; } struct_ser.end() } } impl<'de> serde::Deserialize<'de> for UpdateRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ "data", "context", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { Data, Context, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result 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(self, value: &str) -> std::result::Result where E: serde::de::Error, { match value { "data" => Ok(GeneratedField::Data), "context" => Ok(GeneratedField::Context), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } } deserializer.deserialize_identifier(GeneratedVisitor) } } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { type Value = UpdateRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { formatter.write_str("struct envoy.extensions.filters.network.sip_proxy.tra.v3alpha.UpdateRequest") } fn visit_map(self, mut map: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut data__ = None; let mut context__ = None; while let Some(k) = map.next_key()? { match k { GeneratedField::Data => { if data__.is_some() { return Err(serde::de::Error::duplicate_field("data")); } data__ = Some( map.next_value::>()? ); } GeneratedField::Context => { if context__.is_some() { return Err(serde::de::Error::duplicate_field("context")); } context__ = Some( map.next_value::>()? ); } } } Ok(UpdateRequest { data: data__.unwrap_or_default(), context: context__.unwrap_or_default(), }) } } deserializer.deserialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.UpdateRequest", FIELDS, GeneratedVisitor) } } impl serde::Serialize for UpdateResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; let len = 0; let struct_ser = serializer.serialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.UpdateResponse", len)?; struct_ser.end() } } impl<'de> serde::Deserialize<'de> for UpdateResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result 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(self, value: &str) -> std::result::Result 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 = UpdateResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { formatter.write_str("struct envoy.extensions.filters.network.sip_proxy.tra.v3alpha.UpdateResponse") } fn visit_map(self, mut map: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { while map.next_key::()?.is_some() { let _ = map.next_value::()?; } Ok(UpdateResponse { }) } } deserializer.deserialize_struct("envoy.extensions.filters.network.sip_proxy.tra.v3alpha.UpdateResponse", FIELDS, GeneratedVisitor) } }