#
google_cloud_pubsub/generated/gapic_dataplane/model/
deserialize.rs

    1// Copyright 2025 Google LLC
    2//
    3// Licensed under the Apache License, Version 2.0 (the "License");
    4// you may not use this file except in compliance with the License.
    5// You may obtain a copy of the License at
    6//
    7//     https://www.apache.org/licenses/LICENSE-2.0
    8//
    9// Unless required by applicable law or agreed to in writing, software
    10// distributed under the License is distributed on an "AS IS" BASIS,
    11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    12// See the License for the specific language governing permissions and
    13// limitations under the License.
    14//
    15// Code generated by sidekick. DO NOT EDIT.
    16
    17#[allow(unused_imports)]
    18use super::*;
    19
    20#[doc(hidden)]
    21impl<'de> serde::de::Deserialize<'de> for super::PubsubMessage {
    22    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    23    where
    24        D: serde::Deserializer<'de>,
    25    {
    26        #[allow(non_camel_case_types)]
    27        #[doc(hidden)]
    28        #[derive(PartialEq, Eq, Hash)]
    29        enum __FieldTag {
    30            __data,
    31            __attributes,
    32            __message_id,
    33            __publish_time,
    34            __ordering_key,
    35            Unknown(std::string::String),
    36        }
    37        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
    38            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    39            where
    40                D: serde::Deserializer<'de>,
    41            {
    42                struct Visitor;
    43                impl<'de> serde::de::Visitor<'de> for Visitor {
    44                    type Value = __FieldTag;
    45                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    46                        formatter.write_str("a field name for PubsubMessage")
    47                    }
    48                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
    49                    where
    50                        E: serde::de::Error,
    51                    {
    52                        use std::result::Result::Ok;
    53                        use std::string::ToString;
    54                        match value {
    55                            "data" => Ok(__FieldTag::__data),
    56                            "attributes" => Ok(__FieldTag::__attributes),
    57                            "messageId" => Ok(__FieldTag::__message_id),
    58                            "message_id" => Ok(__FieldTag::__message_id),
    59                            "publishTime" => Ok(__FieldTag::__publish_time),
    60                            "publish_time" => Ok(__FieldTag::__publish_time),
    61                            "orderingKey" => Ok(__FieldTag::__ordering_key),
    62                            "ordering_key" => Ok(__FieldTag::__ordering_key),
    63                            _ => Ok(__FieldTag::Unknown(value.to_string())),
    64                        }
    65                    }
    66                }
    67                deserializer.deserialize_identifier(Visitor)
    68            }
    69        }
    70        struct Visitor;
    71        impl<'de> serde::de::Visitor<'de> for Visitor {
    72            type Value = super::PubsubMessage;
    73            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    74                formatter.write_str("struct PubsubMessage")
    75            }
    76            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
    77            where
    78                A: serde::de::MapAccess<'de>,
    79            {
    80                #[allow(unused_imports)]
    81                use serde::de::Error;
    82                use std::option::Option::Some;
    83                let mut fields = std::collections::HashSet::new();
    84                let mut result = Self::Value::new();
    85                while let Some(tag) = map.next_key::<__FieldTag>()? {
    86                    #[allow(clippy::match_single_binding)]
    87                    match tag {
    88                        __FieldTag::__data => {
    89                            if !fields.insert(__FieldTag::__data) {
    90                                return std::result::Result::Err(A::Error::duplicate_field(
    91                                    "multiple values for data",
    92                                ));
    93                            }
    94                            struct __With(std::option::Option<::bytes::Bytes>);
    95                            impl<'de> serde::de::Deserialize<'de> for __With {
    96                                fn deserialize<D>(
    97                                    deserializer: D,
    98                                ) -> std::result::Result<Self, D::Error>
    99                                where
    100                                    D: serde::de::Deserializer<'de>,
    101                                {
    102                                    serde_with::As::< std::option::Option<serde_with::base64::Base64> >::deserialize(deserializer).map(__With)
    103                                }
    104                            }
    105                            result.data = map.next_value::<__With>()?.0.unwrap_or_default();
    106                        }
    107                        __FieldTag::__attributes => {
    108                            if !fields.insert(__FieldTag::__attributes) {
    109                                return std::result::Result::Err(A::Error::duplicate_field(
    110                                    "multiple values for attributes",
    111                                ));
    112                            }
    113                            result.attributes = map
    114                                .next_value::<std::option::Option<
    115                                    std::collections::HashMap<
    116                                        std::string::String,
    117                                        std::string::String,
    118                                    >,
    119                                >>()?
    120                                .unwrap_or_default();
    121                        }
    122                        __FieldTag::__message_id => {
    123                            if !fields.insert(__FieldTag::__message_id) {
    124                                return std::result::Result::Err(A::Error::duplicate_field(
    125                                    "multiple values for message_id",
    126                                ));
    127                            }
    128                            result.message_id = map
    129                                .next_value::<std::option::Option<std::string::String>>()?
    130                                .unwrap_or_default();
    131                        }
    132                        __FieldTag::__publish_time => {
    133                            if !fields.insert(__FieldTag::__publish_time) {
    134                                return std::result::Result::Err(A::Error::duplicate_field(
    135                                    "multiple values for publish_time",
    136                                ));
    137                            }
    138                            result.publish_time =
    139                                map.next_value::<std::option::Option<wkt::Timestamp>>()?;
    140                        }
    141                        __FieldTag::__ordering_key => {
    142                            if !fields.insert(__FieldTag::__ordering_key) {
    143                                return std::result::Result::Err(A::Error::duplicate_field(
    144                                    "multiple values for ordering_key",
    145                                ));
    146                            }
    147                            result.ordering_key = map
    148                                .next_value::<std::option::Option<std::string::String>>()?
    149                                .unwrap_or_default();
    150                        }
    151                        __FieldTag::Unknown(key) => {
    152                            let value = map.next_value::<serde_json::Value>()?;
    153                            result._unknown_fields.insert(key, value);
    154                        }
    155                    }
    156                }
    157                std::result::Result::Ok(result)
    158            }
    159        }
    160        deserializer.deserialize_any(Visitor)
    161    }
    162}
    163
    164#[doc(hidden)]
    165impl<'de> serde::de::Deserialize<'de> for super::PublishRequest {
    166    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    167    where
    168        D: serde::Deserializer<'de>,
    169    {
    170        #[allow(non_camel_case_types)]
    171        #[doc(hidden)]
    172        #[derive(PartialEq, Eq, Hash)]
    173        enum __FieldTag {
    174            __topic,
    175            __messages,
    176            Unknown(std::string::String),
    177        }
    178        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
    179            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    180            where
    181                D: serde::Deserializer<'de>,
    182            {
    183                struct Visitor;
    184                impl<'de> serde::de::Visitor<'de> for Visitor {
    185                    type Value = __FieldTag;
    186                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    187                        formatter.write_str("a field name for PublishRequest")
    188                    }
    189                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
    190                    where
    191                        E: serde::de::Error,
    192                    {
    193                        use std::result::Result::Ok;
    194                        use std::string::ToString;
    195                        match value {
    196                            "topic" => Ok(__FieldTag::__topic),
    197                            "messages" => Ok(__FieldTag::__messages),
    198                            _ => Ok(__FieldTag::Unknown(value.to_string())),
    199                        }
    200                    }
    201                }
    202                deserializer.deserialize_identifier(Visitor)
    203            }
    204        }
    205        struct Visitor;
    206        impl<'de> serde::de::Visitor<'de> for Visitor {
    207            type Value = super::PublishRequest;
    208            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    209                formatter.write_str("struct PublishRequest")
    210            }
    211            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
    212            where
    213                A: serde::de::MapAccess<'de>,
    214            {
    215                #[allow(unused_imports)]
    216                use serde::de::Error;
    217                use std::option::Option::Some;
    218                let mut fields = std::collections::HashSet::new();
    219                let mut result = Self::Value::new();
    220                while let Some(tag) = map.next_key::<__FieldTag>()? {
    221                    #[allow(clippy::match_single_binding)]
    222                    match tag {
    223                        __FieldTag::__topic => {
    224                            if !fields.insert(__FieldTag::__topic) {
    225                                return std::result::Result::Err(A::Error::duplicate_field(
    226                                    "multiple values for topic",
    227                                ));
    228                            }
    229                            result.topic = map
    230                                .next_value::<std::option::Option<std::string::String>>()?
    231                                .unwrap_or_default();
    232                        }
    233                        __FieldTag::__messages => {
    234                            if !fields.insert(__FieldTag::__messages) {
    235                                return std::result::Result::Err(A::Error::duplicate_field(
    236                                    "multiple values for messages",
    237                                ));
    238                            }
    239                            result.messages = map.next_value::<std::option::Option<std::vec::Vec<crate::model::PubsubMessage>>>()?.unwrap_or_default();
    240                        }
    241                        __FieldTag::Unknown(key) => {
    242                            let value = map.next_value::<serde_json::Value>()?;
    243                            result._unknown_fields.insert(key, value);
    244                        }
    245                    }
    246                }
    247                std::result::Result::Ok(result)
    248            }
    249        }
    250        deserializer.deserialize_any(Visitor)
    251    }
    252}
    253
    254#[doc(hidden)]
    255impl<'de> serde::de::Deserialize<'de> for super::PublishResponse {
    256    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    257    where
    258        D: serde::Deserializer<'de>,
    259    {
    260        #[allow(non_camel_case_types)]
    261        #[doc(hidden)]
    262        #[derive(PartialEq, Eq, Hash)]
    263        enum __FieldTag {
    264            __message_ids,
    265            Unknown(std::string::String),
    266        }
    267        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
    268            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    269            where
    270                D: serde::Deserializer<'de>,
    271            {
    272                struct Visitor;
    273                impl<'de> serde::de::Visitor<'de> for Visitor {
    274                    type Value = __FieldTag;
    275                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    276                        formatter.write_str("a field name for PublishResponse")
    277                    }
    278                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
    279                    where
    280                        E: serde::de::Error,
    281                    {
    282                        use std::result::Result::Ok;
    283                        use std::string::ToString;
    284                        match value {
    285                            "messageIds" => Ok(__FieldTag::__message_ids),
    286                            "message_ids" => Ok(__FieldTag::__message_ids),
    287                            _ => Ok(__FieldTag::Unknown(value.to_string())),
    288                        }
    289                    }
    290                }
    291                deserializer.deserialize_identifier(Visitor)
    292            }
    293        }
    294        struct Visitor;
    295        impl<'de> serde::de::Visitor<'de> for Visitor {
    296            type Value = super::PublishResponse;
    297            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    298                formatter.write_str("struct PublishResponse")
    299            }
    300            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
    301            where
    302                A: serde::de::MapAccess<'de>,
    303            {
    304                #[allow(unused_imports)]
    305                use serde::de::Error;
    306                use std::option::Option::Some;
    307                let mut fields = std::collections::HashSet::new();
    308                let mut result = Self::Value::new();
    309                while let Some(tag) = map.next_key::<__FieldTag>()? {
    310                    #[allow(clippy::match_single_binding)]
    311                    match tag {
    312                        __FieldTag::__message_ids => {
    313                            if !fields.insert(__FieldTag::__message_ids) {
    314                                return std::result::Result::Err(A::Error::duplicate_field(
    315                                    "multiple values for message_ids",
    316                                ));
    317                            }
    318                            result.message_ids = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
    319                        }
    320                        __FieldTag::Unknown(key) => {
    321                            let value = map.next_value::<serde_json::Value>()?;
    322                            result._unknown_fields.insert(key, value);
    323                        }
    324                    }
    325                }
    326                std::result::Result::Ok(result)
    327            }
    328        }
    329        deserializer.deserialize_any(Visitor)
    330    }
    331}
    332
    333#[doc(hidden)]
    334impl<'de> serde::de::Deserialize<'de> for super::ReceivedMessage {
    335    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    336    where
    337        D: serde::Deserializer<'de>,
    338    {
    339        #[allow(non_camel_case_types)]
    340        #[doc(hidden)]
    341        #[derive(PartialEq, Eq, Hash)]
    342        enum __FieldTag {
    343            __ack_id,
    344            __message,
    345            __delivery_attempt,
    346            Unknown(std::string::String),
    347        }
    348        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
    349            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    350            where
    351                D: serde::Deserializer<'de>,
    352            {
    353                struct Visitor;
    354                impl<'de> serde::de::Visitor<'de> for Visitor {
    355                    type Value = __FieldTag;
    356                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    357                        formatter.write_str("a field name for ReceivedMessage")
    358                    }
    359                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
    360                    where
    361                        E: serde::de::Error,
    362                    {
    363                        use std::result::Result::Ok;
    364                        use std::string::ToString;
    365                        match value {
    366                            "ackId" => Ok(__FieldTag::__ack_id),
    367                            "ack_id" => Ok(__FieldTag::__ack_id),
    368                            "message" => Ok(__FieldTag::__message),
    369                            "deliveryAttempt" => Ok(__FieldTag::__delivery_attempt),
    370                            "delivery_attempt" => Ok(__FieldTag::__delivery_attempt),
    371                            _ => Ok(__FieldTag::Unknown(value.to_string())),
    372                        }
    373                    }
    374                }
    375                deserializer.deserialize_identifier(Visitor)
    376            }
    377        }
    378        struct Visitor;
    379        impl<'de> serde::de::Visitor<'de> for Visitor {
    380            type Value = super::ReceivedMessage;
    381            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    382                formatter.write_str("struct ReceivedMessage")
    383            }
    384            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
    385            where
    386                A: serde::de::MapAccess<'de>,
    387            {
    388                #[allow(unused_imports)]
    389                use serde::de::Error;
    390                use std::option::Option::Some;
    391                let mut fields = std::collections::HashSet::new();
    392                let mut result = Self::Value::new();
    393                while let Some(tag) = map.next_key::<__FieldTag>()? {
    394                    #[allow(clippy::match_single_binding)]
    395                    match tag {
    396                        __FieldTag::__ack_id => {
    397                            if !fields.insert(__FieldTag::__ack_id) {
    398                                return std::result::Result::Err(A::Error::duplicate_field(
    399                                    "multiple values for ack_id",
    400                                ));
    401                            }
    402                            result.ack_id = map
    403                                .next_value::<std::option::Option<std::string::String>>()?
    404                                .unwrap_or_default();
    405                        }
    406                        __FieldTag::__message => {
    407                            if !fields.insert(__FieldTag::__message) {
    408                                return std::result::Result::Err(A::Error::duplicate_field(
    409                                    "multiple values for message",
    410                                ));
    411                            }
    412                            result.message = map
    413                                .next_value::<std::option::Option<crate::model::PubsubMessage>>()?;
    414                        }
    415                        __FieldTag::__delivery_attempt => {
    416                            if !fields.insert(__FieldTag::__delivery_attempt) {
    417                                return std::result::Result::Err(A::Error::duplicate_field(
    418                                    "multiple values for delivery_attempt",
    419                                ));
    420                            }
    421                            struct __With(std::option::Option<i32>);
    422                            impl<'de> serde::de::Deserialize<'de> for __With {
    423                                fn deserialize<D>(
    424                                    deserializer: D,
    425                                ) -> std::result::Result<Self, D::Error>
    426                                where
    427                                    D: serde::de::Deserializer<'de>,
    428                                {
    429                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
    430                                }
    431                            }
    432                            result.delivery_attempt =
    433                                map.next_value::<__With>()?.0.unwrap_or_default();
    434                        }
    435                        __FieldTag::Unknown(key) => {
    436                            let value = map.next_value::<serde_json::Value>()?;
    437                            result._unknown_fields.insert(key, value);
    438                        }
    439                    }
    440                }
    441                std::result::Result::Ok(result)
    442            }
    443        }
    444        deserializer.deserialize_any(Visitor)
    445    }
    446}
    447
    448#[doc(hidden)]
    449impl<'de> serde::de::Deserialize<'de> for super::ModifyAckDeadlineRequest {
    450    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    451    where
    452        D: serde::Deserializer<'de>,
    453    {
    454        #[allow(non_camel_case_types)]
    455        #[doc(hidden)]
    456        #[derive(PartialEq, Eq, Hash)]
    457        enum __FieldTag {
    458            __subscription,
    459            __ack_ids,
    460            __ack_deadline_seconds,
    461            Unknown(std::string::String),
    462        }
    463        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
    464            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    465            where
    466                D: serde::Deserializer<'de>,
    467            {
    468                struct Visitor;
    469                impl<'de> serde::de::Visitor<'de> for Visitor {
    470                    type Value = __FieldTag;
    471                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    472                        formatter.write_str("a field name for ModifyAckDeadlineRequest")
    473                    }
    474                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
    475                    where
    476                        E: serde::de::Error,
    477                    {
    478                        use std::result::Result::Ok;
    479                        use std::string::ToString;
    480                        match value {
    481                            "subscription" => Ok(__FieldTag::__subscription),
    482                            "ackIds" => Ok(__FieldTag::__ack_ids),
    483                            "ack_ids" => Ok(__FieldTag::__ack_ids),
    484                            "ackDeadlineSeconds" => Ok(__FieldTag::__ack_deadline_seconds),
    485                            "ack_deadline_seconds" => Ok(__FieldTag::__ack_deadline_seconds),
    486                            _ => Ok(__FieldTag::Unknown(value.to_string())),
    487                        }
    488                    }
    489                }
    490                deserializer.deserialize_identifier(Visitor)
    491            }
    492        }
    493        struct Visitor;
    494        impl<'de> serde::de::Visitor<'de> for Visitor {
    495            type Value = super::ModifyAckDeadlineRequest;
    496            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    497                formatter.write_str("struct ModifyAckDeadlineRequest")
    498            }
    499            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
    500            where
    501                A: serde::de::MapAccess<'de>,
    502            {
    503                #[allow(unused_imports)]
    504                use serde::de::Error;
    505                use std::option::Option::Some;
    506                let mut fields = std::collections::HashSet::new();
    507                let mut result = Self::Value::new();
    508                while let Some(tag) = map.next_key::<__FieldTag>()? {
    509                    #[allow(clippy::match_single_binding)]
    510                    match tag {
    511                        __FieldTag::__subscription => {
    512                            if !fields.insert(__FieldTag::__subscription) {
    513                                return std::result::Result::Err(A::Error::duplicate_field(
    514                                    "multiple values for subscription",
    515                                ));
    516                            }
    517                            result.subscription = map
    518                                .next_value::<std::option::Option<std::string::String>>()?
    519                                .unwrap_or_default();
    520                        }
    521                        __FieldTag::__ack_ids => {
    522                            if !fields.insert(__FieldTag::__ack_ids) {
    523                                return std::result::Result::Err(A::Error::duplicate_field(
    524                                    "multiple values for ack_ids",
    525                                ));
    526                            }
    527                            result.ack_ids = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
    528                        }
    529                        __FieldTag::__ack_deadline_seconds => {
    530                            if !fields.insert(__FieldTag::__ack_deadline_seconds) {
    531                                return std::result::Result::Err(A::Error::duplicate_field(
    532                                    "multiple values for ack_deadline_seconds",
    533                                ));
    534                            }
    535                            struct __With(std::option::Option<i32>);
    536                            impl<'de> serde::de::Deserialize<'de> for __With {
    537                                fn deserialize<D>(
    538                                    deserializer: D,
    539                                ) -> std::result::Result<Self, D::Error>
    540                                where
    541                                    D: serde::de::Deserializer<'de>,
    542                                {
    543                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
    544                                }
    545                            }
    546                            result.ack_deadline_seconds =
    547                                map.next_value::<__With>()?.0.unwrap_or_default();
    548                        }
    549                        __FieldTag::Unknown(key) => {
    550                            let value = map.next_value::<serde_json::Value>()?;
    551                            result._unknown_fields.insert(key, value);
    552                        }
    553                    }
    554                }
    555                std::result::Result::Ok(result)
    556            }
    557        }
    558        deserializer.deserialize_any(Visitor)
    559    }
    560}
    561
    562#[doc(hidden)]
    563impl<'de> serde::de::Deserialize<'de> for super::AcknowledgeRequest {
    564    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    565    where
    566        D: serde::Deserializer<'de>,
    567    {
    568        #[allow(non_camel_case_types)]
    569        #[doc(hidden)]
    570        #[derive(PartialEq, Eq, Hash)]
    571        enum __FieldTag {
    572            __subscription,
    573            __ack_ids,
    574            Unknown(std::string::String),
    575        }
    576        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
    577            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    578            where
    579                D: serde::Deserializer<'de>,
    580            {
    581                struct Visitor;
    582                impl<'de> serde::de::Visitor<'de> for Visitor {
    583                    type Value = __FieldTag;
    584                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    585                        formatter.write_str("a field name for AcknowledgeRequest")
    586                    }
    587                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
    588                    where
    589                        E: serde::de::Error,
    590                    {
    591                        use std::result::Result::Ok;
    592                        use std::string::ToString;
    593                        match value {
    594                            "subscription" => Ok(__FieldTag::__subscription),
    595                            "ackIds" => Ok(__FieldTag::__ack_ids),
    596                            "ack_ids" => Ok(__FieldTag::__ack_ids),
    597                            _ => Ok(__FieldTag::Unknown(value.to_string())),
    598                        }
    599                    }
    600                }
    601                deserializer.deserialize_identifier(Visitor)
    602            }
    603        }
    604        struct Visitor;
    605        impl<'de> serde::de::Visitor<'de> for Visitor {
    606            type Value = super::AcknowledgeRequest;
    607            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    608                formatter.write_str("struct AcknowledgeRequest")
    609            }
    610            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
    611            where
    612                A: serde::de::MapAccess<'de>,
    613            {
    614                #[allow(unused_imports)]
    615                use serde::de::Error;
    616                use std::option::Option::Some;
    617                let mut fields = std::collections::HashSet::new();
    618                let mut result = Self::Value::new();
    619                while let Some(tag) = map.next_key::<__FieldTag>()? {
    620                    #[allow(clippy::match_single_binding)]
    621                    match tag {
    622                        __FieldTag::__subscription => {
    623                            if !fields.insert(__FieldTag::__subscription) {
    624                                return std::result::Result::Err(A::Error::duplicate_field(
    625                                    "multiple values for subscription",
    626                                ));
    627                            }
    628                            result.subscription = map
    629                                .next_value::<std::option::Option<std::string::String>>()?
    630                                .unwrap_or_default();
    631                        }
    632                        __FieldTag::__ack_ids => {
    633                            if !fields.insert(__FieldTag::__ack_ids) {
    634                                return std::result::Result::Err(A::Error::duplicate_field(
    635                                    "multiple values for ack_ids",
    636                                ));
    637                            }
    638                            result.ack_ids = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
    639                        }
    640                        __FieldTag::Unknown(key) => {
    641                            let value = map.next_value::<serde_json::Value>()?;
    642                            result._unknown_fields.insert(key, value);
    643                        }
    644                    }
    645                }
    646                std::result::Result::Ok(result)
    647            }
    648        }
    649        deserializer.deserialize_any(Visitor)
    650    }
    651}
    652
    653#[doc(hidden)]
    654impl<'de> serde::de::Deserialize<'de> for super::StreamingPullRequest {
    655    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    656    where
    657        D: serde::Deserializer<'de>,
    658    {
    659        #[allow(non_camel_case_types)]
    660        #[doc(hidden)]
    661        #[derive(PartialEq, Eq, Hash)]
    662        enum __FieldTag {
    663            __subscription,
    664            __ack_ids,
    665            __modify_deadline_seconds,
    666            __modify_deadline_ack_ids,
    667            __stream_ack_deadline_seconds,
    668            __client_id,
    669            __max_outstanding_messages,
    670            __max_outstanding_bytes,
    671            __protocol_version,
    672            Unknown(std::string::String),
    673        }
    674        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
    675            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    676            where
    677                D: serde::Deserializer<'de>,
    678            {
    679                struct Visitor;
    680                impl<'de> serde::de::Visitor<'de> for Visitor {
    681                    type Value = __FieldTag;
    682                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    683                        formatter.write_str("a field name for StreamingPullRequest")
    684                    }
    685                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
    686                    where
    687                        E: serde::de::Error,
    688                    {
    689                        use std::result::Result::Ok;
    690                        use std::string::ToString;
    691                        match value {
    692                            "subscription" => Ok(__FieldTag::__subscription),
    693                            "ackIds" => Ok(__FieldTag::__ack_ids),
    694                            "ack_ids" => Ok(__FieldTag::__ack_ids),
    695                            "modifyDeadlineSeconds" => Ok(__FieldTag::__modify_deadline_seconds),
    696                            "modify_deadline_seconds" => Ok(__FieldTag::__modify_deadline_seconds),
    697                            "modifyDeadlineAckIds" => Ok(__FieldTag::__modify_deadline_ack_ids),
    698                            "modify_deadline_ack_ids" => Ok(__FieldTag::__modify_deadline_ack_ids),
    699                            "streamAckDeadlineSeconds" => {
    700                                Ok(__FieldTag::__stream_ack_deadline_seconds)
    701                            }
    702                            "stream_ack_deadline_seconds" => {
    703                                Ok(__FieldTag::__stream_ack_deadline_seconds)
    704                            }
    705                            "clientId" => Ok(__FieldTag::__client_id),
    706                            "client_id" => Ok(__FieldTag::__client_id),
    707                            "maxOutstandingMessages" => Ok(__FieldTag::__max_outstanding_messages),
    708                            "max_outstanding_messages" => {
    709                                Ok(__FieldTag::__max_outstanding_messages)
    710                            }
    711                            "maxOutstandingBytes" => Ok(__FieldTag::__max_outstanding_bytes),
    712                            "max_outstanding_bytes" => Ok(__FieldTag::__max_outstanding_bytes),
    713                            "protocolVersion" => Ok(__FieldTag::__protocol_version),
    714                            "protocol_version" => Ok(__FieldTag::__protocol_version),
    715                            _ => Ok(__FieldTag::Unknown(value.to_string())),
    716                        }
    717                    }
    718                }
    719                deserializer.deserialize_identifier(Visitor)
    720            }
    721        }
    722        struct Visitor;
    723        impl<'de> serde::de::Visitor<'de> for Visitor {
    724            type Value = super::StreamingPullRequest;
    725            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    726                formatter.write_str("struct StreamingPullRequest")
    727            }
    728            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
    729            where
    730                A: serde::de::MapAccess<'de>,
    731            {
    732                #[allow(unused_imports)]
    733                use serde::de::Error;
    734                use std::option::Option::Some;
    735                let mut fields = std::collections::HashSet::new();
    736                let mut result = Self::Value::new();
    737                while let Some(tag) = map.next_key::<__FieldTag>()? {
    738                    #[allow(clippy::match_single_binding)]
    739                    match tag {
    740                        __FieldTag::__subscription => {
    741                            if !fields.insert(__FieldTag::__subscription) {
    742                                return std::result::Result::Err(A::Error::duplicate_field(
    743                                    "multiple values for subscription",
    744                                ));
    745                            }
    746                            result.subscription = map
    747                                .next_value::<std::option::Option<std::string::String>>()?
    748                                .unwrap_or_default();
    749                        }
    750                        __FieldTag::__ack_ids => {
    751                            if !fields.insert(__FieldTag::__ack_ids) {
    752                                return std::result::Result::Err(A::Error::duplicate_field(
    753                                    "multiple values for ack_ids",
    754                                ));
    755                            }
    756                            result.ack_ids = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
    757                        }
    758                        __FieldTag::__modify_deadline_seconds => {
    759                            if !fields.insert(__FieldTag::__modify_deadline_seconds) {
    760                                return std::result::Result::Err(A::Error::duplicate_field(
    761                                    "multiple values for modify_deadline_seconds",
    762                                ));
    763                            }
    764                            struct __With(std::option::Option<std::vec::Vec<i32>>);
    765                            impl<'de> serde::de::Deserialize<'de> for __With {
    766                                fn deserialize<D>(
    767                                    deserializer: D,
    768                                ) -> std::result::Result<Self, D::Error>
    769                                where
    770                                    D: serde::de::Deserializer<'de>,
    771                                {
    772                                    serde_with::As::<
    773                                        std::option::Option<std::vec::Vec<wkt::internal::I32>>,
    774                                    >::deserialize(deserializer)
    775                                    .map(__With)
    776                                }
    777                            }
    778                            result.modify_deadline_seconds =
    779                                map.next_value::<__With>()?.0.unwrap_or_default();
    780                        }
    781                        __FieldTag::__modify_deadline_ack_ids => {
    782                            if !fields.insert(__FieldTag::__modify_deadline_ack_ids) {
    783                                return std::result::Result::Err(A::Error::duplicate_field(
    784                                    "multiple values for modify_deadline_ack_ids",
    785                                ));
    786                            }
    787                            result.modify_deadline_ack_ids = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
    788                        }
    789                        __FieldTag::__stream_ack_deadline_seconds => {
    790                            if !fields.insert(__FieldTag::__stream_ack_deadline_seconds) {
    791                                return std::result::Result::Err(A::Error::duplicate_field(
    792                                    "multiple values for stream_ack_deadline_seconds",
    793                                ));
    794                            }
    795                            struct __With(std::option::Option<i32>);
    796                            impl<'de> serde::de::Deserialize<'de> for __With {
    797                                fn deserialize<D>(
    798                                    deserializer: D,
    799                                ) -> std::result::Result<Self, D::Error>
    800                                where
    801                                    D: serde::de::Deserializer<'de>,
    802                                {
    803                                    serde_with::As::< std::option::Option<wkt::internal::I32> >::deserialize(deserializer).map(__With)
    804                                }
    805                            }
    806                            result.stream_ack_deadline_seconds =
    807                                map.next_value::<__With>()?.0.unwrap_or_default();
    808                        }
    809                        __FieldTag::__client_id => {
    810                            if !fields.insert(__FieldTag::__client_id) {
    811                                return std::result::Result::Err(A::Error::duplicate_field(
    812                                    "multiple values for client_id",
    813                                ));
    814                            }
    815                            result.client_id = map
    816                                .next_value::<std::option::Option<std::string::String>>()?
    817                                .unwrap_or_default();
    818                        }
    819                        __FieldTag::__max_outstanding_messages => {
    820                            if !fields.insert(__FieldTag::__max_outstanding_messages) {
    821                                return std::result::Result::Err(A::Error::duplicate_field(
    822                                    "multiple values for max_outstanding_messages",
    823                                ));
    824                            }
    825                            struct __With(std::option::Option<i64>);
    826                            impl<'de> serde::de::Deserialize<'de> for __With {
    827                                fn deserialize<D>(
    828                                    deserializer: D,
    829                                ) -> std::result::Result<Self, D::Error>
    830                                where
    831                                    D: serde::de::Deserializer<'de>,
    832                                {
    833                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
    834                                }
    835                            }
    836                            result.max_outstanding_messages =
    837                                map.next_value::<__With>()?.0.unwrap_or_default();
    838                        }
    839                        __FieldTag::__max_outstanding_bytes => {
    840                            if !fields.insert(__FieldTag::__max_outstanding_bytes) {
    841                                return std::result::Result::Err(A::Error::duplicate_field(
    842                                    "multiple values for max_outstanding_bytes",
    843                                ));
    844                            }
    845                            struct __With(std::option::Option<i64>);
    846                            impl<'de> serde::de::Deserialize<'de> for __With {
    847                                fn deserialize<D>(
    848                                    deserializer: D,
    849                                ) -> std::result::Result<Self, D::Error>
    850                                where
    851                                    D: serde::de::Deserializer<'de>,
    852                                {
    853                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
    854                                }
    855                            }
    856                            result.max_outstanding_bytes =
    857                                map.next_value::<__With>()?.0.unwrap_or_default();
    858                        }
    859                        __FieldTag::__protocol_version => {
    860                            if !fields.insert(__FieldTag::__protocol_version) {
    861                                return std::result::Result::Err(A::Error::duplicate_field(
    862                                    "multiple values for protocol_version",
    863                                ));
    864                            }
    865                            struct __With(std::option::Option<i64>);
    866                            impl<'de> serde::de::Deserialize<'de> for __With {
    867                                fn deserialize<D>(
    868                                    deserializer: D,
    869                                ) -> std::result::Result<Self, D::Error>
    870                                where
    871                                    D: serde::de::Deserializer<'de>,
    872                                {
    873                                    serde_with::As::< std::option::Option<wkt::internal::I64> >::deserialize(deserializer).map(__With)
    874                                }
    875                            }
    876                            result.protocol_version =
    877                                map.next_value::<__With>()?.0.unwrap_or_default();
    878                        }
    879                        __FieldTag::Unknown(key) => {
    880                            let value = map.next_value::<serde_json::Value>()?;
    881                            result._unknown_fields.insert(key, value);
    882                        }
    883                    }
    884                }
    885                std::result::Result::Ok(result)
    886            }
    887        }
    888        deserializer.deserialize_any(Visitor)
    889    }
    890}
    891
    892#[doc(hidden)]
    893impl<'de> serde::de::Deserialize<'de> for super::StreamingPullResponse {
    894    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    895    where
    896        D: serde::Deserializer<'de>,
    897    {
    898        #[allow(non_camel_case_types)]
    899        #[doc(hidden)]
    900        #[derive(PartialEq, Eq, Hash)]
    901        enum __FieldTag {
    902            __received_messages,
    903            __acknowledge_confirmation,
    904            __modify_ack_deadline_confirmation,
    905            __subscription_properties,
    906            Unknown(std::string::String),
    907        }
    908        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
    909            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    910            where
    911                D: serde::Deserializer<'de>,
    912            {
    913                struct Visitor;
    914                impl<'de> serde::de::Visitor<'de> for Visitor {
    915                    type Value = __FieldTag;
    916                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    917                        formatter.write_str("a field name for StreamingPullResponse")
    918                    }
    919                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
    920                    where
    921                        E: serde::de::Error,
    922                    {
    923                        use std::result::Result::Ok;
    924                        use std::string::ToString;
    925                        match value {
    926                            "receivedMessages" => Ok(__FieldTag::__received_messages),
    927                            "received_messages" => Ok(__FieldTag::__received_messages),
    928                            "acknowledgeConfirmation" => Ok(__FieldTag::__acknowledge_confirmation),
    929                            "acknowledge_confirmation" => {
    930                                Ok(__FieldTag::__acknowledge_confirmation)
    931                            }
    932                            "modifyAckDeadlineConfirmation" => {
    933                                Ok(__FieldTag::__modify_ack_deadline_confirmation)
    934                            }
    935                            "modify_ack_deadline_confirmation" => {
    936                                Ok(__FieldTag::__modify_ack_deadline_confirmation)
    937                            }
    938                            "subscriptionProperties" => Ok(__FieldTag::__subscription_properties),
    939                            "subscription_properties" => Ok(__FieldTag::__subscription_properties),
    940                            _ => Ok(__FieldTag::Unknown(value.to_string())),
    941                        }
    942                    }
    943                }
    944                deserializer.deserialize_identifier(Visitor)
    945            }
    946        }
    947        struct Visitor;
    948        impl<'de> serde::de::Visitor<'de> for Visitor {
    949            type Value = super::StreamingPullResponse;
    950            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    951                formatter.write_str("struct StreamingPullResponse")
    952            }
    953            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
    954            where
    955                A: serde::de::MapAccess<'de>,
    956            {
    957                #[allow(unused_imports)]
    958                use serde::de::Error;
    959                use std::option::Option::Some;
    960                let mut fields = std::collections::HashSet::new();
    961                let mut result = Self::Value::new();
    962                while let Some(tag) = map.next_key::<__FieldTag>()? {
    963                    #[allow(clippy::match_single_binding)]
    964                    match tag {
    965                        __FieldTag::__received_messages => {
    966                            if !fields.insert(__FieldTag::__received_messages) {
    967                                return std::result::Result::Err(A::Error::duplicate_field(
    968                                    "multiple values for received_messages",
    969                                ));
    970                            }
    971                            result.received_messages =
    972                                map.next_value::<std::option::Option<
    973                                    std::vec::Vec<crate::model::ReceivedMessage>,
    974                                >>()?
    975                                .unwrap_or_default();
    976                        }
    977                        __FieldTag::__acknowledge_confirmation => {
    978                            if !fields.insert(__FieldTag::__acknowledge_confirmation) {
    979                                return std::result::Result::Err(A::Error::duplicate_field(
    980                                    "multiple values for acknowledge_confirmation",
    981                                ));
    982                            }
    983                            result.acknowledge_confirmation = map
    984                                .next_value::<std::option::Option<
    985                                    crate::model::streaming_pull_response::AcknowledgeConfirmation,
    986                                >>()?;
    987                        }
    988                        __FieldTag::__modify_ack_deadline_confirmation => {
    989                            if !fields.insert(__FieldTag::__modify_ack_deadline_confirmation) {
    990                                return std::result::Result::Err(A::Error::duplicate_field(
    991                                    "multiple values for modify_ack_deadline_confirmation",
    992                                ));
    993                            }
    994                            result.modify_ack_deadline_confirmation = map.next_value::<std::option::Option<crate::model::streaming_pull_response::ModifyAckDeadlineConfirmation>>()?
    995                                ;
    996                        }
    997                        __FieldTag::__subscription_properties => {
    998                            if !fields.insert(__FieldTag::__subscription_properties) {
    999                                return std::result::Result::Err(A::Error::duplicate_field(
    1000                                    "multiple values for subscription_properties",
    1001                                ));
    1002                            }
    1003                            result.subscription_properties = map.next_value::<std::option::Option<
    1004                                crate::model::streaming_pull_response::SubscriptionProperties,
    1005                            >>()?;
    1006                        }
    1007                        __FieldTag::Unknown(key) => {
    1008                            let value = map.next_value::<serde_json::Value>()?;
    1009                            result._unknown_fields.insert(key, value);
    1010                        }
    1011                    }
    1012                }
    1013                std::result::Result::Ok(result)
    1014            }
    1015        }
    1016        deserializer.deserialize_any(Visitor)
    1017    }
    1018}
    1019
    1020#[doc(hidden)]
    1021impl<'de> serde::de::Deserialize<'de> for super::streaming_pull_response::AcknowledgeConfirmation {
    1022    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    1023    where
    1024        D: serde::Deserializer<'de>,
    1025    {
    1026        #[allow(non_camel_case_types)]
    1027        #[doc(hidden)]
    1028        #[derive(PartialEq, Eq, Hash)]
    1029        enum __FieldTag {
    1030            __ack_ids,
    1031            __invalid_ack_ids,
    1032            __unordered_ack_ids,
    1033            __temporary_failed_ack_ids,
    1034            Unknown(std::string::String),
    1035        }
    1036        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
    1037            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    1038            where
    1039                D: serde::Deserializer<'de>,
    1040            {
    1041                struct Visitor;
    1042                impl<'de> serde::de::Visitor<'de> for Visitor {
    1043                    type Value = __FieldTag;
    1044                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    1045                        formatter.write_str("a field name for AcknowledgeConfirmation")
    1046                    }
    1047                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
    1048                    where
    1049                        E: serde::de::Error,
    1050                    {
    1051                        use std::result::Result::Ok;
    1052                        use std::string::ToString;
    1053                        match value {
    1054                            "ackIds" => Ok(__FieldTag::__ack_ids),
    1055                            "ack_ids" => Ok(__FieldTag::__ack_ids),
    1056                            "invalidAckIds" => Ok(__FieldTag::__invalid_ack_ids),
    1057                            "invalid_ack_ids" => Ok(__FieldTag::__invalid_ack_ids),
    1058                            "unorderedAckIds" => Ok(__FieldTag::__unordered_ack_ids),
    1059                            "unordered_ack_ids" => Ok(__FieldTag::__unordered_ack_ids),
    1060                            "temporaryFailedAckIds" => Ok(__FieldTag::__temporary_failed_ack_ids),
    1061                            "temporary_failed_ack_ids" => {
    1062                                Ok(__FieldTag::__temporary_failed_ack_ids)
    1063                            }
    1064                            _ => Ok(__FieldTag::Unknown(value.to_string())),
    1065                        }
    1066                    }
    1067                }
    1068                deserializer.deserialize_identifier(Visitor)
    1069            }
    1070        }
    1071        struct Visitor;
    1072        impl<'de> serde::de::Visitor<'de> for Visitor {
    1073            type Value = super::streaming_pull_response::AcknowledgeConfirmation;
    1074            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    1075                formatter.write_str("struct AcknowledgeConfirmation")
    1076            }
    1077            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
    1078            where
    1079                A: serde::de::MapAccess<'de>,
    1080            {
    1081                #[allow(unused_imports)]
    1082                use serde::de::Error;
    1083                use std::option::Option::Some;
    1084                let mut fields = std::collections::HashSet::new();
    1085                let mut result = Self::Value::new();
    1086                while let Some(tag) = map.next_key::<__FieldTag>()? {
    1087                    #[allow(clippy::match_single_binding)]
    1088                    match tag {
    1089                        __FieldTag::__ack_ids => {
    1090                            if !fields.insert(__FieldTag::__ack_ids) {
    1091                                return std::result::Result::Err(A::Error::duplicate_field(
    1092                                    "multiple values for ack_ids",
    1093                                ));
    1094                            }
    1095                            result.ack_ids = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
    1096                        }
    1097                        __FieldTag::__invalid_ack_ids => {
    1098                            if !fields.insert(__FieldTag::__invalid_ack_ids) {
    1099                                return std::result::Result::Err(A::Error::duplicate_field(
    1100                                    "multiple values for invalid_ack_ids",
    1101                                ));
    1102                            }
    1103                            result.invalid_ack_ids = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
    1104                        }
    1105                        __FieldTag::__unordered_ack_ids => {
    1106                            if !fields.insert(__FieldTag::__unordered_ack_ids) {
    1107                                return std::result::Result::Err(A::Error::duplicate_field(
    1108                                    "multiple values for unordered_ack_ids",
    1109                                ));
    1110                            }
    1111                            result.unordered_ack_ids = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
    1112                        }
    1113                        __FieldTag::__temporary_failed_ack_ids => {
    1114                            if !fields.insert(__FieldTag::__temporary_failed_ack_ids) {
    1115                                return std::result::Result::Err(A::Error::duplicate_field(
    1116                                    "multiple values for temporary_failed_ack_ids",
    1117                                ));
    1118                            }
    1119                            result.temporary_failed_ack_ids = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
    1120                        }
    1121                        __FieldTag::Unknown(key) => {
    1122                            let value = map.next_value::<serde_json::Value>()?;
    1123                            result._unknown_fields.insert(key, value);
    1124                        }
    1125                    }
    1126                }
    1127                std::result::Result::Ok(result)
    1128            }
    1129        }
    1130        deserializer.deserialize_any(Visitor)
    1131    }
    1132}
    1133
    1134#[doc(hidden)]
    1135impl<'de> serde::de::Deserialize<'de>
    1136    for super::streaming_pull_response::ModifyAckDeadlineConfirmation
    1137{
    1138    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    1139    where
    1140        D: serde::Deserializer<'de>,
    1141    {
    1142        #[allow(non_camel_case_types)]
    1143        #[doc(hidden)]
    1144        #[derive(PartialEq, Eq, Hash)]
    1145        enum __FieldTag {
    1146            __ack_ids,
    1147            __invalid_ack_ids,
    1148            __temporary_failed_ack_ids,
    1149            Unknown(std::string::String),
    1150        }
    1151        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
    1152            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    1153            where
    1154                D: serde::Deserializer<'de>,
    1155            {
    1156                struct Visitor;
    1157                impl<'de> serde::de::Visitor<'de> for Visitor {
    1158                    type Value = __FieldTag;
    1159                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    1160                        formatter.write_str("a field name for ModifyAckDeadlineConfirmation")
    1161                    }
    1162                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
    1163                    where
    1164                        E: serde::de::Error,
    1165                    {
    1166                        use std::result::Result::Ok;
    1167                        use std::string::ToString;
    1168                        match value {
    1169                            "ackIds" => Ok(__FieldTag::__ack_ids),
    1170                            "ack_ids" => Ok(__FieldTag::__ack_ids),
    1171                            "invalidAckIds" => Ok(__FieldTag::__invalid_ack_ids),
    1172                            "invalid_ack_ids" => Ok(__FieldTag::__invalid_ack_ids),
    1173                            "temporaryFailedAckIds" => Ok(__FieldTag::__temporary_failed_ack_ids),
    1174                            "temporary_failed_ack_ids" => {
    1175                                Ok(__FieldTag::__temporary_failed_ack_ids)
    1176                            }
    1177                            _ => Ok(__FieldTag::Unknown(value.to_string())),
    1178                        }
    1179                    }
    1180                }
    1181                deserializer.deserialize_identifier(Visitor)
    1182            }
    1183        }
    1184        struct Visitor;
    1185        impl<'de> serde::de::Visitor<'de> for Visitor {
    1186            type Value = super::streaming_pull_response::ModifyAckDeadlineConfirmation;
    1187            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    1188                formatter.write_str("struct ModifyAckDeadlineConfirmation")
    1189            }
    1190            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
    1191            where
    1192                A: serde::de::MapAccess<'de>,
    1193            {
    1194                #[allow(unused_imports)]
    1195                use serde::de::Error;
    1196                use std::option::Option::Some;
    1197                let mut fields = std::collections::HashSet::new();
    1198                let mut result = Self::Value::new();
    1199                while let Some(tag) = map.next_key::<__FieldTag>()? {
    1200                    #[allow(clippy::match_single_binding)]
    1201                    match tag {
    1202                        __FieldTag::__ack_ids => {
    1203                            if !fields.insert(__FieldTag::__ack_ids) {
    1204                                return std::result::Result::Err(A::Error::duplicate_field(
    1205                                    "multiple values for ack_ids",
    1206                                ));
    1207                            }
    1208                            result.ack_ids = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
    1209                        }
    1210                        __FieldTag::__invalid_ack_ids => {
    1211                            if !fields.insert(__FieldTag::__invalid_ack_ids) {
    1212                                return std::result::Result::Err(A::Error::duplicate_field(
    1213                                    "multiple values for invalid_ack_ids",
    1214                                ));
    1215                            }
    1216                            result.invalid_ack_ids = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
    1217                        }
    1218                        __FieldTag::__temporary_failed_ack_ids => {
    1219                            if !fields.insert(__FieldTag::__temporary_failed_ack_ids) {
    1220                                return std::result::Result::Err(A::Error::duplicate_field(
    1221                                    "multiple values for temporary_failed_ack_ids",
    1222                                ));
    1223                            }
    1224                            result.temporary_failed_ack_ids = map.next_value::<std::option::Option<std::vec::Vec<std::string::String>>>()?.unwrap_or_default();
    1225                        }
    1226                        __FieldTag::Unknown(key) => {
    1227                            let value = map.next_value::<serde_json::Value>()?;
    1228                            result._unknown_fields.insert(key, value);
    1229                        }
    1230                    }
    1231                }
    1232                std::result::Result::Ok(result)
    1233            }
    1234        }
    1235        deserializer.deserialize_any(Visitor)
    1236    }
    1237}
    1238
    1239#[doc(hidden)]
    1240impl<'de> serde::de::Deserialize<'de> for super::streaming_pull_response::SubscriptionProperties {
    1241    fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    1242    where
    1243        D: serde::Deserializer<'de>,
    1244    {
    1245        #[allow(non_camel_case_types)]
    1246        #[doc(hidden)]
    1247        #[derive(PartialEq, Eq, Hash)]
    1248        enum __FieldTag {
    1249            __exactly_once_delivery_enabled,
    1250            __message_ordering_enabled,
    1251            Unknown(std::string::String),
    1252        }
    1253        impl<'de> serde::de::Deserialize<'de> for __FieldTag {
    1254            fn deserialize<D>(deserializer: D) -> std::result::Result<Self, D::Error>
    1255            where
    1256                D: serde::Deserializer<'de>,
    1257            {
    1258                struct Visitor;
    1259                impl<'de> serde::de::Visitor<'de> for Visitor {
    1260                    type Value = __FieldTag;
    1261                    fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    1262                        formatter.write_str("a field name for SubscriptionProperties")
    1263                    }
    1264                    fn visit_str<E>(self, value: &str) -> std::result::Result<Self::Value, E>
    1265                    where
    1266                        E: serde::de::Error,
    1267                    {
    1268                        use std::result::Result::Ok;
    1269                        use std::string::ToString;
    1270                        match value {
    1271                            "exactlyOnceDeliveryEnabled" => {
    1272                                Ok(__FieldTag::__exactly_once_delivery_enabled)
    1273                            }
    1274                            "exactly_once_delivery_enabled" => {
    1275                                Ok(__FieldTag::__exactly_once_delivery_enabled)
    1276                            }
    1277                            "messageOrderingEnabled" => Ok(__FieldTag::__message_ordering_enabled),
    1278                            "message_ordering_enabled" => {
    1279                                Ok(__FieldTag::__message_ordering_enabled)
    1280                            }
    1281                            _ => Ok(__FieldTag::Unknown(value.to_string())),
    1282                        }
    1283                    }
    1284                }
    1285                deserializer.deserialize_identifier(Visitor)
    1286            }
    1287        }
    1288        struct Visitor;
    1289        impl<'de> serde::de::Visitor<'de> for Visitor {
    1290            type Value = super::streaming_pull_response::SubscriptionProperties;
    1291            fn expecting(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
    1292                formatter.write_str("struct SubscriptionProperties")
    1293            }
    1294            fn visit_map<A>(self, mut map: A) -> std::result::Result<Self::Value, A::Error>
    1295            where
    1296                A: serde::de::MapAccess<'de>,
    1297            {
    1298                #[allow(unused_imports)]
    1299                use serde::de::Error;
    1300                use std::option::Option::Some;
    1301                let mut fields = std::collections::HashSet::new();
    1302                let mut result = Self::Value::new();
    1303                while let Some(tag) = map.next_key::<__FieldTag>()? {
    1304                    #[allow(clippy::match_single_binding)]
    1305                    match tag {
    1306                        __FieldTag::__exactly_once_delivery_enabled => {
    1307                            if !fields.insert(__FieldTag::__exactly_once_delivery_enabled) {
    1308                                return std::result::Result::Err(A::Error::duplicate_field(
    1309                                    "multiple values for exactly_once_delivery_enabled",
    1310                                ));
    1311                            }
    1312                            result.exactly_once_delivery_enabled = map
    1313                                .next_value::<std::option::Option<bool>>()?
    1314                                .unwrap_or_default();
    1315                        }
    1316                        __FieldTag::__message_ordering_enabled => {
    1317                            if !fields.insert(__FieldTag::__message_ordering_enabled) {
    1318                                return std::result::Result::Err(A::Error::duplicate_field(
    1319                                    "multiple values for message_ordering_enabled",
    1320                                ));
    1321                            }
    1322                            result.message_ordering_enabled = map
    1323                                .next_value::<std::option::Option<bool>>()?
    1324                                .unwrap_or_default();
    1325                        }
    1326                        __FieldTag::Unknown(key) => {
    1327                            let value = map.next_value::<serde_json::Value>()?;
    1328                            result._unknown_fields.insert(key, value);
    1329                        }
    1330                    }
    1331                }
    1332                std::result::Result::Ok(result)
    1333            }
    1334        }
    1335        deserializer.deserialize_any(Visitor)
    1336    }
    1337}