#
google_cloud_pubsub/generated/gapic/model/
serialize.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 serde::ser::Serialize for super::MessageStoragePolicy {
    22    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    23    where
    24        S: serde::ser::Serializer,
    25    {
    26        use serde::ser::SerializeMap;
    27        #[allow(unused_imports)]
    28        use std::option::Option::Some;
    29        let mut state = serializer.serialize_map(std::option::Option::None)?;
    30        if !self.allowed_persistence_regions.is_empty() {
    31            state.serialize_entry(
    32                "allowedPersistenceRegions",
    33                &self.allowed_persistence_regions,
    34            )?;
    35        }
    36        if !wkt::internal::is_default(&self.enforce_in_transit) {
    37            state.serialize_entry("enforceInTransit", &self.enforce_in_transit)?;
    38        }
    39        if !self._unknown_fields.is_empty() {
    40            for (key, value) in self._unknown_fields.iter() {
    41                state.serialize_entry(key, &value)?;
    42            }
    43        }
    44        state.end()
    45    }
    46}
    47
    48#[doc(hidden)]
    49impl serde::ser::Serialize for super::SchemaSettings {
    50    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    51    where
    52        S: serde::ser::Serializer,
    53    {
    54        use serde::ser::SerializeMap;
    55        #[allow(unused_imports)]
    56        use std::option::Option::Some;
    57        let mut state = serializer.serialize_map(std::option::Option::None)?;
    58        if !self.schema.is_empty() {
    59            state.serialize_entry("schema", &self.schema)?;
    60        }
    61        if !wkt::internal::is_default(&self.encoding) {
    62            state.serialize_entry("encoding", &self.encoding)?;
    63        }
    64        if !self.first_revision_id.is_empty() {
    65            state.serialize_entry("firstRevisionId", &self.first_revision_id)?;
    66        }
    67        if !self.last_revision_id.is_empty() {
    68            state.serialize_entry("lastRevisionId", &self.last_revision_id)?;
    69        }
    70        if !self._unknown_fields.is_empty() {
    71            for (key, value) in self._unknown_fields.iter() {
    72                state.serialize_entry(key, &value)?;
    73            }
    74        }
    75        state.end()
    76    }
    77}
    78
    79#[doc(hidden)]
    80impl serde::ser::Serialize for super::IngestionDataSourceSettings {
    81    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    82    where
    83        S: serde::ser::Serializer,
    84    {
    85        use serde::ser::SerializeMap;
    86        #[allow(unused_imports)]
    87        use std::option::Option::Some;
    88        let mut state = serializer.serialize_map(std::option::Option::None)?;
    89        if let Some(value) = self.aws_kinesis() {
    90            state.serialize_entry("awsKinesis", value)?;
    91        }
    92        if let Some(value) = self.cloud_storage() {
    93            state.serialize_entry("cloudStorage", value)?;
    94        }
    95        if let Some(value) = self.azure_event_hubs() {
    96            state.serialize_entry("azureEventHubs", value)?;
    97        }
    98        if let Some(value) = self.aws_msk() {
    99            state.serialize_entry("awsMsk", value)?;
    100        }
    101        if let Some(value) = self.confluent_cloud() {
    102            state.serialize_entry("confluentCloud", value)?;
    103        }
    104        if self.platform_logs_settings.is_some() {
    105            state.serialize_entry("platformLogsSettings", &self.platform_logs_settings)?;
    106        }
    107        if !self._unknown_fields.is_empty() {
    108            for (key, value) in self._unknown_fields.iter() {
    109                state.serialize_entry(key, &value)?;
    110            }
    111        }
    112        state.end()
    113    }
    114}
    115
    116#[doc(hidden)]
    117impl serde::ser::Serialize for super::ingestion_data_source_settings::AwsKinesis {
    118    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    119    where
    120        S: serde::ser::Serializer,
    121    {
    122        use serde::ser::SerializeMap;
    123        #[allow(unused_imports)]
    124        use std::option::Option::Some;
    125        let mut state = serializer.serialize_map(std::option::Option::None)?;
    126        if !wkt::internal::is_default(&self.state) {
    127            state.serialize_entry("state", &self.state)?;
    128        }
    129        if !self.stream_arn.is_empty() {
    130            state.serialize_entry("streamArn", &self.stream_arn)?;
    131        }
    132        if !self.consumer_arn.is_empty() {
    133            state.serialize_entry("consumerArn", &self.consumer_arn)?;
    134        }
    135        if !self.aws_role_arn.is_empty() {
    136            state.serialize_entry("awsRoleArn", &self.aws_role_arn)?;
    137        }
    138        if !self.gcp_service_account.is_empty() {
    139            state.serialize_entry("gcpServiceAccount", &self.gcp_service_account)?;
    140        }
    141        if !self._unknown_fields.is_empty() {
    142            for (key, value) in self._unknown_fields.iter() {
    143                state.serialize_entry(key, &value)?;
    144            }
    145        }
    146        state.end()
    147    }
    148}
    149
    150#[doc(hidden)]
    151impl serde::ser::Serialize for super::ingestion_data_source_settings::CloudStorage {
    152    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    153    where
    154        S: serde::ser::Serializer,
    155    {
    156        use serde::ser::SerializeMap;
    157        #[allow(unused_imports)]
    158        use std::option::Option::Some;
    159        let mut state = serializer.serialize_map(std::option::Option::None)?;
    160        if !wkt::internal::is_default(&self.state) {
    161            state.serialize_entry("state", &self.state)?;
    162        }
    163        if !self.bucket.is_empty() {
    164            state.serialize_entry("bucket", &self.bucket)?;
    165        }
    166        if let Some(value) = self.text_format() {
    167            state.serialize_entry("textFormat", value)?;
    168        }
    169        if let Some(value) = self.avro_format() {
    170            state.serialize_entry("avroFormat", value)?;
    171        }
    172        if let Some(value) = self.pubsub_avro_format() {
    173            state.serialize_entry("pubsubAvroFormat", value)?;
    174        }
    175        if self.minimum_object_create_time.is_some() {
    176            state.serialize_entry("minimumObjectCreateTime", &self.minimum_object_create_time)?;
    177        }
    178        if !self.match_glob.is_empty() {
    179            state.serialize_entry("matchGlob", &self.match_glob)?;
    180        }
    181        if !self._unknown_fields.is_empty() {
    182            for (key, value) in self._unknown_fields.iter() {
    183                state.serialize_entry(key, &value)?;
    184            }
    185        }
    186        state.end()
    187    }
    188}
    189
    190#[doc(hidden)]
    191impl serde::ser::Serialize for super::ingestion_data_source_settings::cloud_storage::TextFormat {
    192    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    193    where
    194        S: serde::ser::Serializer,
    195    {
    196        use serde::ser::SerializeMap;
    197        #[allow(unused_imports)]
    198        use std::option::Option::Some;
    199        let mut state = serializer.serialize_map(std::option::Option::None)?;
    200        if self.delimiter.is_some() {
    201            state.serialize_entry("delimiter", &self.delimiter)?;
    202        }
    203        if !self._unknown_fields.is_empty() {
    204            for (key, value) in self._unknown_fields.iter() {
    205                state.serialize_entry(key, &value)?;
    206            }
    207        }
    208        state.end()
    209    }
    210}
    211
    212#[doc(hidden)]
    213impl serde::ser::Serialize for super::ingestion_data_source_settings::cloud_storage::AvroFormat {
    214    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    215    where
    216        S: serde::ser::Serializer,
    217    {
    218        use serde::ser::SerializeMap;
    219        #[allow(unused_imports)]
    220        use std::option::Option::Some;
    221        let mut state = serializer.serialize_map(std::option::Option::None)?;
    222        if !self._unknown_fields.is_empty() {
    223            for (key, value) in self._unknown_fields.iter() {
    224                state.serialize_entry(key, &value)?;
    225            }
    226        }
    227        state.end()
    228    }
    229}
    230
    231#[doc(hidden)]
    232impl serde::ser::Serialize
    233    for super::ingestion_data_source_settings::cloud_storage::PubSubAvroFormat
    234{
    235    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    236    where
    237        S: serde::ser::Serializer,
    238    {
    239        use serde::ser::SerializeMap;
    240        #[allow(unused_imports)]
    241        use std::option::Option::Some;
    242        let mut state = serializer.serialize_map(std::option::Option::None)?;
    243        if !self._unknown_fields.is_empty() {
    244            for (key, value) in self._unknown_fields.iter() {
    245                state.serialize_entry(key, &value)?;
    246            }
    247        }
    248        state.end()
    249    }
    250}
    251
    252#[doc(hidden)]
    253impl serde::ser::Serialize for super::ingestion_data_source_settings::AzureEventHubs {
    254    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    255    where
    256        S: serde::ser::Serializer,
    257    {
    258        use serde::ser::SerializeMap;
    259        #[allow(unused_imports)]
    260        use std::option::Option::Some;
    261        let mut state = serializer.serialize_map(std::option::Option::None)?;
    262        if !wkt::internal::is_default(&self.state) {
    263            state.serialize_entry("state", &self.state)?;
    264        }
    265        if !self.resource_group.is_empty() {
    266            state.serialize_entry("resourceGroup", &self.resource_group)?;
    267        }
    268        if !self.namespace.is_empty() {
    269            state.serialize_entry("namespace", &self.namespace)?;
    270        }
    271        if !self.event_hub.is_empty() {
    272            state.serialize_entry("eventHub", &self.event_hub)?;
    273        }
    274        if !self.client_id.is_empty() {
    275            state.serialize_entry("clientId", &self.client_id)?;
    276        }
    277        if !self.tenant_id.is_empty() {
    278            state.serialize_entry("tenantId", &self.tenant_id)?;
    279        }
    280        if !self.subscription_id.is_empty() {
    281            state.serialize_entry("subscriptionId", &self.subscription_id)?;
    282        }
    283        if !self.gcp_service_account.is_empty() {
    284            state.serialize_entry("gcpServiceAccount", &self.gcp_service_account)?;
    285        }
    286        if !self._unknown_fields.is_empty() {
    287            for (key, value) in self._unknown_fields.iter() {
    288                state.serialize_entry(key, &value)?;
    289            }
    290        }
    291        state.end()
    292    }
    293}
    294
    295#[doc(hidden)]
    296impl serde::ser::Serialize for super::ingestion_data_source_settings::AwsMsk {
    297    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    298    where
    299        S: serde::ser::Serializer,
    300    {
    301        use serde::ser::SerializeMap;
    302        #[allow(unused_imports)]
    303        use std::option::Option::Some;
    304        let mut state = serializer.serialize_map(std::option::Option::None)?;
    305        if !wkt::internal::is_default(&self.state) {
    306            state.serialize_entry("state", &self.state)?;
    307        }
    308        if !self.cluster_arn.is_empty() {
    309            state.serialize_entry("clusterArn", &self.cluster_arn)?;
    310        }
    311        if !self.topic.is_empty() {
    312            state.serialize_entry("topic", &self.topic)?;
    313        }
    314        if !self.aws_role_arn.is_empty() {
    315            state.serialize_entry("awsRoleArn", &self.aws_role_arn)?;
    316        }
    317        if !self.gcp_service_account.is_empty() {
    318            state.serialize_entry("gcpServiceAccount", &self.gcp_service_account)?;
    319        }
    320        if !self._unknown_fields.is_empty() {
    321            for (key, value) in self._unknown_fields.iter() {
    322                state.serialize_entry(key, &value)?;
    323            }
    324        }
    325        state.end()
    326    }
    327}
    328
    329#[doc(hidden)]
    330impl serde::ser::Serialize for super::ingestion_data_source_settings::ConfluentCloud {
    331    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    332    where
    333        S: serde::ser::Serializer,
    334    {
    335        use serde::ser::SerializeMap;
    336        #[allow(unused_imports)]
    337        use std::option::Option::Some;
    338        let mut state = serializer.serialize_map(std::option::Option::None)?;
    339        if !wkt::internal::is_default(&self.state) {
    340            state.serialize_entry("state", &self.state)?;
    341        }
    342        if !self.bootstrap_server.is_empty() {
    343            state.serialize_entry("bootstrapServer", &self.bootstrap_server)?;
    344        }
    345        if !self.cluster_id.is_empty() {
    346            state.serialize_entry("clusterId", &self.cluster_id)?;
    347        }
    348        if !self.topic.is_empty() {
    349            state.serialize_entry("topic", &self.topic)?;
    350        }
    351        if !self.identity_pool_id.is_empty() {
    352            state.serialize_entry("identityPoolId", &self.identity_pool_id)?;
    353        }
    354        if !self.gcp_service_account.is_empty() {
    355            state.serialize_entry("gcpServiceAccount", &self.gcp_service_account)?;
    356        }
    357        if !self._unknown_fields.is_empty() {
    358            for (key, value) in self._unknown_fields.iter() {
    359                state.serialize_entry(key, &value)?;
    360            }
    361        }
    362        state.end()
    363    }
    364}
    365
    366#[doc(hidden)]
    367impl serde::ser::Serialize for super::PlatformLogsSettings {
    368    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    369    where
    370        S: serde::ser::Serializer,
    371    {
    372        use serde::ser::SerializeMap;
    373        #[allow(unused_imports)]
    374        use std::option::Option::Some;
    375        let mut state = serializer.serialize_map(std::option::Option::None)?;
    376        if !wkt::internal::is_default(&self.severity) {
    377            state.serialize_entry("severity", &self.severity)?;
    378        }
    379        if !self._unknown_fields.is_empty() {
    380            for (key, value) in self._unknown_fields.iter() {
    381                state.serialize_entry(key, &value)?;
    382            }
    383        }
    384        state.end()
    385    }
    386}
    387
    388#[doc(hidden)]
    389impl serde::ser::Serialize for super::JavaScriptUDF {
    390    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    391    where
    392        S: serde::ser::Serializer,
    393    {
    394        use serde::ser::SerializeMap;
    395        #[allow(unused_imports)]
    396        use std::option::Option::Some;
    397        let mut state = serializer.serialize_map(std::option::Option::None)?;
    398        if !self.function_name.is_empty() {
    399            state.serialize_entry("functionName", &self.function_name)?;
    400        }
    401        if !self.code.is_empty() {
    402            state.serialize_entry("code", &self.code)?;
    403        }
    404        if !self._unknown_fields.is_empty() {
    405            for (key, value) in self._unknown_fields.iter() {
    406                state.serialize_entry(key, &value)?;
    407            }
    408        }
    409        state.end()
    410    }
    411}
    412
    413#[doc(hidden)]
    414impl serde::ser::Serialize for super::MessageTransform {
    415    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    416    where
    417        S: serde::ser::Serializer,
    418    {
    419        use serde::ser::SerializeMap;
    420        #[allow(unused_imports)]
    421        use std::option::Option::Some;
    422        let mut state = serializer.serialize_map(std::option::Option::None)?;
    423        if let Some(value) = self.javascript_udf() {
    424            state.serialize_entry("javascriptUdf", value)?;
    425        }
    426        if !wkt::internal::is_default(&self.enabled) {
    427            state.serialize_entry("enabled", &self.enabled)?;
    428        }
    429        if !wkt::internal::is_default(&self.disabled) {
    430            state.serialize_entry("disabled", &self.disabled)?;
    431        }
    432        if !self._unknown_fields.is_empty() {
    433            for (key, value) in self._unknown_fields.iter() {
    434                state.serialize_entry(key, &value)?;
    435            }
    436        }
    437        state.end()
    438    }
    439}
    440
    441#[doc(hidden)]
    442impl serde::ser::Serialize for super::Topic {
    443    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    444    where
    445        S: serde::ser::Serializer,
    446    {
    447        use serde::ser::SerializeMap;
    448        #[allow(unused_imports)]
    449        use std::option::Option::Some;
    450        let mut state = serializer.serialize_map(std::option::Option::None)?;
    451        if !self.name.is_empty() {
    452            state.serialize_entry("name", &self.name)?;
    453        }
    454        if !self.labels.is_empty() {
    455            state.serialize_entry("labels", &self.labels)?;
    456        }
    457        if self.message_storage_policy.is_some() {
    458            state.serialize_entry("messageStoragePolicy", &self.message_storage_policy)?;
    459        }
    460        if !self.kms_key_name.is_empty() {
    461            state.serialize_entry("kmsKeyName", &self.kms_key_name)?;
    462        }
    463        if self.schema_settings.is_some() {
    464            state.serialize_entry("schemaSettings", &self.schema_settings)?;
    465        }
    466        if !wkt::internal::is_default(&self.satisfies_pzs) {
    467            state.serialize_entry("satisfiesPzs", &self.satisfies_pzs)?;
    468        }
    469        if self.message_retention_duration.is_some() {
    470            state.serialize_entry("messageRetentionDuration", &self.message_retention_duration)?;
    471        }
    472        if !wkt::internal::is_default(&self.state) {
    473            state.serialize_entry("state", &self.state)?;
    474        }
    475        if self.ingestion_data_source_settings.is_some() {
    476            state.serialize_entry(
    477                "ingestionDataSourceSettings",
    478                &self.ingestion_data_source_settings,
    479            )?;
    480        }
    481        if !self.message_transforms.is_empty() {
    482            state.serialize_entry("messageTransforms", &self.message_transforms)?;
    483        }
    484        if !self.tags.is_empty() {
    485            state.serialize_entry("tags", &self.tags)?;
    486        }
    487        if !self._unknown_fields.is_empty() {
    488            for (key, value) in self._unknown_fields.iter() {
    489                state.serialize_entry(key, &value)?;
    490            }
    491        }
    492        state.end()
    493    }
    494}
    495
    496#[doc(hidden)]
    497impl serde::ser::Serialize for super::GetTopicRequest {
    498    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    499    where
    500        S: serde::ser::Serializer,
    501    {
    502        use serde::ser::SerializeMap;
    503        #[allow(unused_imports)]
    504        use std::option::Option::Some;
    505        let mut state = serializer.serialize_map(std::option::Option::None)?;
    506        if !self.topic.is_empty() {
    507            state.serialize_entry("topic", &self.topic)?;
    508        }
    509        if !self._unknown_fields.is_empty() {
    510            for (key, value) in self._unknown_fields.iter() {
    511                state.serialize_entry(key, &value)?;
    512            }
    513        }
    514        state.end()
    515    }
    516}
    517
    518#[doc(hidden)]
    519impl serde::ser::Serialize for super::UpdateTopicRequest {
    520    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    521    where
    522        S: serde::ser::Serializer,
    523    {
    524        use serde::ser::SerializeMap;
    525        #[allow(unused_imports)]
    526        use std::option::Option::Some;
    527        let mut state = serializer.serialize_map(std::option::Option::None)?;
    528        if self.topic.is_some() {
    529            state.serialize_entry("topic", &self.topic)?;
    530        }
    531        if self.update_mask.is_some() {
    532            state.serialize_entry("updateMask", &self.update_mask)?;
    533        }
    534        if !self._unknown_fields.is_empty() {
    535            for (key, value) in self._unknown_fields.iter() {
    536                state.serialize_entry(key, &value)?;
    537            }
    538        }
    539        state.end()
    540    }
    541}
    542
    543#[doc(hidden)]
    544impl serde::ser::Serialize for super::ListTopicsRequest {
    545    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    546    where
    547        S: serde::ser::Serializer,
    548    {
    549        use serde::ser::SerializeMap;
    550        #[allow(unused_imports)]
    551        use std::option::Option::Some;
    552        let mut state = serializer.serialize_map(std::option::Option::None)?;
    553        if !self.project.is_empty() {
    554            state.serialize_entry("project", &self.project)?;
    555        }
    556        if !wkt::internal::is_default(&self.page_size) {
    557            struct __With<'a>(&'a i32);
    558            impl<'a> serde::ser::Serialize for __With<'a> {
    559                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    560                where
    561                    S: serde::ser::Serializer,
    562                {
    563                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
    564                }
    565            }
    566            state.serialize_entry("pageSize", &__With(&self.page_size))?;
    567        }
    568        if !self.page_token.is_empty() {
    569            state.serialize_entry("pageToken", &self.page_token)?;
    570        }
    571        if !self._unknown_fields.is_empty() {
    572            for (key, value) in self._unknown_fields.iter() {
    573                state.serialize_entry(key, &value)?;
    574            }
    575        }
    576        state.end()
    577    }
    578}
    579
    580#[doc(hidden)]
    581impl serde::ser::Serialize for super::ListTopicsResponse {
    582    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    583    where
    584        S: serde::ser::Serializer,
    585    {
    586        use serde::ser::SerializeMap;
    587        #[allow(unused_imports)]
    588        use std::option::Option::Some;
    589        let mut state = serializer.serialize_map(std::option::Option::None)?;
    590        if !self.topics.is_empty() {
    591            state.serialize_entry("topics", &self.topics)?;
    592        }
    593        if !self.next_page_token.is_empty() {
    594            state.serialize_entry("nextPageToken", &self.next_page_token)?;
    595        }
    596        if !self._unknown_fields.is_empty() {
    597            for (key, value) in self._unknown_fields.iter() {
    598                state.serialize_entry(key, &value)?;
    599            }
    600        }
    601        state.end()
    602    }
    603}
    604
    605#[doc(hidden)]
    606impl serde::ser::Serialize for super::ListTopicSubscriptionsRequest {
    607    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    608    where
    609        S: serde::ser::Serializer,
    610    {
    611        use serde::ser::SerializeMap;
    612        #[allow(unused_imports)]
    613        use std::option::Option::Some;
    614        let mut state = serializer.serialize_map(std::option::Option::None)?;
    615        if !self.topic.is_empty() {
    616            state.serialize_entry("topic", &self.topic)?;
    617        }
    618        if !wkt::internal::is_default(&self.page_size) {
    619            struct __With<'a>(&'a i32);
    620            impl<'a> serde::ser::Serialize for __With<'a> {
    621                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    622                where
    623                    S: serde::ser::Serializer,
    624                {
    625                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
    626                }
    627            }
    628            state.serialize_entry("pageSize", &__With(&self.page_size))?;
    629        }
    630        if !self.page_token.is_empty() {
    631            state.serialize_entry("pageToken", &self.page_token)?;
    632        }
    633        if !self._unknown_fields.is_empty() {
    634            for (key, value) in self._unknown_fields.iter() {
    635                state.serialize_entry(key, &value)?;
    636            }
    637        }
    638        state.end()
    639    }
    640}
    641
    642#[doc(hidden)]
    643impl serde::ser::Serialize for super::ListTopicSubscriptionsResponse {
    644    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    645    where
    646        S: serde::ser::Serializer,
    647    {
    648        use serde::ser::SerializeMap;
    649        #[allow(unused_imports)]
    650        use std::option::Option::Some;
    651        let mut state = serializer.serialize_map(std::option::Option::None)?;
    652        if !self.subscriptions.is_empty() {
    653            state.serialize_entry("subscriptions", &self.subscriptions)?;
    654        }
    655        if !self.next_page_token.is_empty() {
    656            state.serialize_entry("nextPageToken", &self.next_page_token)?;
    657        }
    658        if !self._unknown_fields.is_empty() {
    659            for (key, value) in self._unknown_fields.iter() {
    660                state.serialize_entry(key, &value)?;
    661            }
    662        }
    663        state.end()
    664    }
    665}
    666
    667#[doc(hidden)]
    668impl serde::ser::Serialize for super::ListTopicSnapshotsRequest {
    669    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    670    where
    671        S: serde::ser::Serializer,
    672    {
    673        use serde::ser::SerializeMap;
    674        #[allow(unused_imports)]
    675        use std::option::Option::Some;
    676        let mut state = serializer.serialize_map(std::option::Option::None)?;
    677        if !self.topic.is_empty() {
    678            state.serialize_entry("topic", &self.topic)?;
    679        }
    680        if !wkt::internal::is_default(&self.page_size) {
    681            struct __With<'a>(&'a i32);
    682            impl<'a> serde::ser::Serialize for __With<'a> {
    683                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    684                where
    685                    S: serde::ser::Serializer,
    686                {
    687                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
    688                }
    689            }
    690            state.serialize_entry("pageSize", &__With(&self.page_size))?;
    691        }
    692        if !self.page_token.is_empty() {
    693            state.serialize_entry("pageToken", &self.page_token)?;
    694        }
    695        if !self._unknown_fields.is_empty() {
    696            for (key, value) in self._unknown_fields.iter() {
    697                state.serialize_entry(key, &value)?;
    698            }
    699        }
    700        state.end()
    701    }
    702}
    703
    704#[doc(hidden)]
    705impl serde::ser::Serialize for super::ListTopicSnapshotsResponse {
    706    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    707    where
    708        S: serde::ser::Serializer,
    709    {
    710        use serde::ser::SerializeMap;
    711        #[allow(unused_imports)]
    712        use std::option::Option::Some;
    713        let mut state = serializer.serialize_map(std::option::Option::None)?;
    714        if !self.snapshots.is_empty() {
    715            state.serialize_entry("snapshots", &self.snapshots)?;
    716        }
    717        if !self.next_page_token.is_empty() {
    718            state.serialize_entry("nextPageToken", &self.next_page_token)?;
    719        }
    720        if !self._unknown_fields.is_empty() {
    721            for (key, value) in self._unknown_fields.iter() {
    722                state.serialize_entry(key, &value)?;
    723            }
    724        }
    725        state.end()
    726    }
    727}
    728
    729#[doc(hidden)]
    730impl serde::ser::Serialize for super::DeleteTopicRequest {
    731    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    732    where
    733        S: serde::ser::Serializer,
    734    {
    735        use serde::ser::SerializeMap;
    736        #[allow(unused_imports)]
    737        use std::option::Option::Some;
    738        let mut state = serializer.serialize_map(std::option::Option::None)?;
    739        if !self.topic.is_empty() {
    740            state.serialize_entry("topic", &self.topic)?;
    741        }
    742        if !self._unknown_fields.is_empty() {
    743            for (key, value) in self._unknown_fields.iter() {
    744                state.serialize_entry(key, &value)?;
    745            }
    746        }
    747        state.end()
    748    }
    749}
    750
    751#[doc(hidden)]
    752impl serde::ser::Serialize for super::DetachSubscriptionRequest {
    753    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    754    where
    755        S: serde::ser::Serializer,
    756    {
    757        use serde::ser::SerializeMap;
    758        #[allow(unused_imports)]
    759        use std::option::Option::Some;
    760        let mut state = serializer.serialize_map(std::option::Option::None)?;
    761        if !self.subscription.is_empty() {
    762            state.serialize_entry("subscription", &self.subscription)?;
    763        }
    764        if !self._unknown_fields.is_empty() {
    765            for (key, value) in self._unknown_fields.iter() {
    766                state.serialize_entry(key, &value)?;
    767            }
    768        }
    769        state.end()
    770    }
    771}
    772
    773#[doc(hidden)]
    774impl serde::ser::Serialize for super::DetachSubscriptionResponse {
    775    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    776    where
    777        S: serde::ser::Serializer,
    778    {
    779        use serde::ser::SerializeMap;
    780        #[allow(unused_imports)]
    781        use std::option::Option::Some;
    782        let mut state = serializer.serialize_map(std::option::Option::None)?;
    783        if !self._unknown_fields.is_empty() {
    784            for (key, value) in self._unknown_fields.iter() {
    785                state.serialize_entry(key, &value)?;
    786            }
    787        }
    788        state.end()
    789    }
    790}
    791
    792#[doc(hidden)]
    793impl serde::ser::Serialize for super::Subscription {
    794    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    795    where
    796        S: serde::ser::Serializer,
    797    {
    798        use serde::ser::SerializeMap;
    799        #[allow(unused_imports)]
    800        use std::option::Option::Some;
    801        let mut state = serializer.serialize_map(std::option::Option::None)?;
    802        if !self.name.is_empty() {
    803            state.serialize_entry("name", &self.name)?;
    804        }
    805        if !self.topic.is_empty() {
    806            state.serialize_entry("topic", &self.topic)?;
    807        }
    808        if self.push_config.is_some() {
    809            state.serialize_entry("pushConfig", &self.push_config)?;
    810        }
    811        if self.bigquery_config.is_some() {
    812            state.serialize_entry("bigqueryConfig", &self.bigquery_config)?;
    813        }
    814        if self.cloud_storage_config.is_some() {
    815            state.serialize_entry("cloudStorageConfig", &self.cloud_storage_config)?;
    816        }
    817        if !wkt::internal::is_default(&self.ack_deadline_seconds) {
    818            struct __With<'a>(&'a i32);
    819            impl<'a> serde::ser::Serialize for __With<'a> {
    820                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    821                where
    822                    S: serde::ser::Serializer,
    823                {
    824                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
    825                }
    826            }
    827            state.serialize_entry("ackDeadlineSeconds", &__With(&self.ack_deadline_seconds))?;
    828        }
    829        if !wkt::internal::is_default(&self.retain_acked_messages) {
    830            state.serialize_entry("retainAckedMessages", &self.retain_acked_messages)?;
    831        }
    832        if self.message_retention_duration.is_some() {
    833            state.serialize_entry("messageRetentionDuration", &self.message_retention_duration)?;
    834        }
    835        if !self.labels.is_empty() {
    836            state.serialize_entry("labels", &self.labels)?;
    837        }
    838        if !wkt::internal::is_default(&self.enable_message_ordering) {
    839            state.serialize_entry("enableMessageOrdering", &self.enable_message_ordering)?;
    840        }
    841        if self.expiration_policy.is_some() {
    842            state.serialize_entry("expirationPolicy", &self.expiration_policy)?;
    843        }
    844        if !self.filter.is_empty() {
    845            state.serialize_entry("filter", &self.filter)?;
    846        }
    847        if self.dead_letter_policy.is_some() {
    848            state.serialize_entry("deadLetterPolicy", &self.dead_letter_policy)?;
    849        }
    850        if self.retry_policy.is_some() {
    851            state.serialize_entry("retryPolicy", &self.retry_policy)?;
    852        }
    853        if !wkt::internal::is_default(&self.detached) {
    854            state.serialize_entry("detached", &self.detached)?;
    855        }
    856        if !wkt::internal::is_default(&self.enable_exactly_once_delivery) {
    857            state.serialize_entry(
    858                "enableExactlyOnceDelivery",
    859                &self.enable_exactly_once_delivery,
    860            )?;
    861        }
    862        if self.topic_message_retention_duration.is_some() {
    863            state.serialize_entry(
    864                "topicMessageRetentionDuration",
    865                &self.topic_message_retention_duration,
    866            )?;
    867        }
    868        if !wkt::internal::is_default(&self.state) {
    869            state.serialize_entry("state", &self.state)?;
    870        }
    871        if self.analytics_hub_subscription_info.is_some() {
    872            state.serialize_entry(
    873                "analyticsHubSubscriptionInfo",
    874                &self.analytics_hub_subscription_info,
    875            )?;
    876        }
    877        if !self.message_transforms.is_empty() {
    878            state.serialize_entry("messageTransforms", &self.message_transforms)?;
    879        }
    880        if !self.tags.is_empty() {
    881            state.serialize_entry("tags", &self.tags)?;
    882        }
    883        if !self._unknown_fields.is_empty() {
    884            for (key, value) in self._unknown_fields.iter() {
    885                state.serialize_entry(key, &value)?;
    886            }
    887        }
    888        state.end()
    889    }
    890}
    891
    892#[doc(hidden)]
    893impl serde::ser::Serialize for super::subscription::AnalyticsHubSubscriptionInfo {
    894    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    895    where
    896        S: serde::ser::Serializer,
    897    {
    898        use serde::ser::SerializeMap;
    899        #[allow(unused_imports)]
    900        use std::option::Option::Some;
    901        let mut state = serializer.serialize_map(std::option::Option::None)?;
    902        if !self.listing.is_empty() {
    903            state.serialize_entry("listing", &self.listing)?;
    904        }
    905        if !self.subscription.is_empty() {
    906            state.serialize_entry("subscription", &self.subscription)?;
    907        }
    908        if !self._unknown_fields.is_empty() {
    909            for (key, value) in self._unknown_fields.iter() {
    910                state.serialize_entry(key, &value)?;
    911            }
    912        }
    913        state.end()
    914    }
    915}
    916
    917#[doc(hidden)]
    918impl serde::ser::Serialize for super::RetryPolicy {
    919    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    920    where
    921        S: serde::ser::Serializer,
    922    {
    923        use serde::ser::SerializeMap;
    924        #[allow(unused_imports)]
    925        use std::option::Option::Some;
    926        let mut state = serializer.serialize_map(std::option::Option::None)?;
    927        if self.minimum_backoff.is_some() {
    928            state.serialize_entry("minimumBackoff", &self.minimum_backoff)?;
    929        }
    930        if self.maximum_backoff.is_some() {
    931            state.serialize_entry("maximumBackoff", &self.maximum_backoff)?;
    932        }
    933        if !self._unknown_fields.is_empty() {
    934            for (key, value) in self._unknown_fields.iter() {
    935                state.serialize_entry(key, &value)?;
    936            }
    937        }
    938        state.end()
    939    }
    940}
    941
    942#[doc(hidden)]
    943impl serde::ser::Serialize for super::DeadLetterPolicy {
    944    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    945    where
    946        S: serde::ser::Serializer,
    947    {
    948        use serde::ser::SerializeMap;
    949        #[allow(unused_imports)]
    950        use std::option::Option::Some;
    951        let mut state = serializer.serialize_map(std::option::Option::None)?;
    952        if !self.dead_letter_topic.is_empty() {
    953            state.serialize_entry("deadLetterTopic", &self.dead_letter_topic)?;
    954        }
    955        if !wkt::internal::is_default(&self.max_delivery_attempts) {
    956            struct __With<'a>(&'a i32);
    957            impl<'a> serde::ser::Serialize for __With<'a> {
    958                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    959                where
    960                    S: serde::ser::Serializer,
    961                {
    962                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
    963                }
    964            }
    965            state.serialize_entry("maxDeliveryAttempts", &__With(&self.max_delivery_attempts))?;
    966        }
    967        if !self._unknown_fields.is_empty() {
    968            for (key, value) in self._unknown_fields.iter() {
    969                state.serialize_entry(key, &value)?;
    970            }
    971        }
    972        state.end()
    973    }
    974}
    975
    976#[doc(hidden)]
    977impl serde::ser::Serialize for super::ExpirationPolicy {
    978    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    979    where
    980        S: serde::ser::Serializer,
    981    {
    982        use serde::ser::SerializeMap;
    983        #[allow(unused_imports)]
    984        use std::option::Option::Some;
    985        let mut state = serializer.serialize_map(std::option::Option::None)?;
    986        if self.ttl.is_some() {
    987            state.serialize_entry("ttl", &self.ttl)?;
    988        }
    989        if !self._unknown_fields.is_empty() {
    990            for (key, value) in self._unknown_fields.iter() {
    991                state.serialize_entry(key, &value)?;
    992            }
    993        }
    994        state.end()
    995    }
    996}
    997
    998#[doc(hidden)]
    999impl serde::ser::Serialize for super::PushConfig {
    1000    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1001    where
    1002        S: serde::ser::Serializer,
    1003    {
    1004        use serde::ser::SerializeMap;
    1005        #[allow(unused_imports)]
    1006        use std::option::Option::Some;
    1007        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1008        if !self.push_endpoint.is_empty() {
    1009            state.serialize_entry("pushEndpoint", &self.push_endpoint)?;
    1010        }
    1011        if !self.attributes.is_empty() {
    1012            state.serialize_entry("attributes", &self.attributes)?;
    1013        }
    1014        if let Some(value) = self.oidc_token() {
    1015            state.serialize_entry("oidcToken", value)?;
    1016        }
    1017        if let Some(value) = self.pubsub_wrapper() {
    1018            state.serialize_entry("pubsubWrapper", value)?;
    1019        }
    1020        if let Some(value) = self.no_wrapper() {
    1021            state.serialize_entry("noWrapper", value)?;
    1022        }
    1023        if !self._unknown_fields.is_empty() {
    1024            for (key, value) in self._unknown_fields.iter() {
    1025                state.serialize_entry(key, &value)?;
    1026            }
    1027        }
    1028        state.end()
    1029    }
    1030}
    1031
    1032#[doc(hidden)]
    1033impl serde::ser::Serialize for super::push_config::OidcToken {
    1034    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1035    where
    1036        S: serde::ser::Serializer,
    1037    {
    1038        use serde::ser::SerializeMap;
    1039        #[allow(unused_imports)]
    1040        use std::option::Option::Some;
    1041        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1042        if !self.service_account_email.is_empty() {
    1043            state.serialize_entry("serviceAccountEmail", &self.service_account_email)?;
    1044        }
    1045        if !self.audience.is_empty() {
    1046            state.serialize_entry("audience", &self.audience)?;
    1047        }
    1048        if !self._unknown_fields.is_empty() {
    1049            for (key, value) in self._unknown_fields.iter() {
    1050                state.serialize_entry(key, &value)?;
    1051            }
    1052        }
    1053        state.end()
    1054    }
    1055}
    1056
    1057#[doc(hidden)]
    1058impl serde::ser::Serialize for super::push_config::PubsubWrapper {
    1059    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1060    where
    1061        S: serde::ser::Serializer,
    1062    {
    1063        use serde::ser::SerializeMap;
    1064        #[allow(unused_imports)]
    1065        use std::option::Option::Some;
    1066        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1067        if !self._unknown_fields.is_empty() {
    1068            for (key, value) in self._unknown_fields.iter() {
    1069                state.serialize_entry(key, &value)?;
    1070            }
    1071        }
    1072        state.end()
    1073    }
    1074}
    1075
    1076#[doc(hidden)]
    1077impl serde::ser::Serialize for super::push_config::NoWrapper {
    1078    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1079    where
    1080        S: serde::ser::Serializer,
    1081    {
    1082        use serde::ser::SerializeMap;
    1083        #[allow(unused_imports)]
    1084        use std::option::Option::Some;
    1085        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1086        if !wkt::internal::is_default(&self.write_metadata) {
    1087            state.serialize_entry("writeMetadata", &self.write_metadata)?;
    1088        }
    1089        if !self._unknown_fields.is_empty() {
    1090            for (key, value) in self._unknown_fields.iter() {
    1091                state.serialize_entry(key, &value)?;
    1092            }
    1093        }
    1094        state.end()
    1095    }
    1096}
    1097
    1098#[doc(hidden)]
    1099impl serde::ser::Serialize for super::BigQueryConfig {
    1100    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1101    where
    1102        S: serde::ser::Serializer,
    1103    {
    1104        use serde::ser::SerializeMap;
    1105        #[allow(unused_imports)]
    1106        use std::option::Option::Some;
    1107        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1108        if !self.table.is_empty() {
    1109            state.serialize_entry("table", &self.table)?;
    1110        }
    1111        if !wkt::internal::is_default(&self.use_topic_schema) {
    1112            state.serialize_entry("useTopicSchema", &self.use_topic_schema)?;
    1113        }
    1114        if !wkt::internal::is_default(&self.write_metadata) {
    1115            state.serialize_entry("writeMetadata", &self.write_metadata)?;
    1116        }
    1117        if !wkt::internal::is_default(&self.drop_unknown_fields) {
    1118            state.serialize_entry("dropUnknownFields", &self.drop_unknown_fields)?;
    1119        }
    1120        if !wkt::internal::is_default(&self.state) {
    1121            state.serialize_entry("state", &self.state)?;
    1122        }
    1123        if !wkt::internal::is_default(&self.use_table_schema) {
    1124            state.serialize_entry("useTableSchema", &self.use_table_schema)?;
    1125        }
    1126        if !self.service_account_email.is_empty() {
    1127            state.serialize_entry("serviceAccountEmail", &self.service_account_email)?;
    1128        }
    1129        if !self._unknown_fields.is_empty() {
    1130            for (key, value) in self._unknown_fields.iter() {
    1131                state.serialize_entry(key, &value)?;
    1132            }
    1133        }
    1134        state.end()
    1135    }
    1136}
    1137
    1138#[doc(hidden)]
    1139impl serde::ser::Serialize for super::CloudStorageConfig {
    1140    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1141    where
    1142        S: serde::ser::Serializer,
    1143    {
    1144        use serde::ser::SerializeMap;
    1145        #[allow(unused_imports)]
    1146        use std::option::Option::Some;
    1147        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1148        if !self.bucket.is_empty() {
    1149            state.serialize_entry("bucket", &self.bucket)?;
    1150        }
    1151        if !self.filename_prefix.is_empty() {
    1152            state.serialize_entry("filenamePrefix", &self.filename_prefix)?;
    1153        }
    1154        if !self.filename_suffix.is_empty() {
    1155            state.serialize_entry("filenameSuffix", &self.filename_suffix)?;
    1156        }
    1157        if !self.filename_datetime_format.is_empty() {
    1158            state.serialize_entry("filenameDatetimeFormat", &self.filename_datetime_format)?;
    1159        }
    1160        if let Some(value) = self.text_config() {
    1161            state.serialize_entry("textConfig", value)?;
    1162        }
    1163        if let Some(value) = self.avro_config() {
    1164            state.serialize_entry("avroConfig", value)?;
    1165        }
    1166        if self.max_duration.is_some() {
    1167            state.serialize_entry("maxDuration", &self.max_duration)?;
    1168        }
    1169        if !wkt::internal::is_default(&self.max_bytes) {
    1170            struct __With<'a>(&'a i64);
    1171            impl<'a> serde::ser::Serialize for __With<'a> {
    1172                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1173                where
    1174                    S: serde::ser::Serializer,
    1175                {
    1176                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
    1177                }
    1178            }
    1179            state.serialize_entry("maxBytes", &__With(&self.max_bytes))?;
    1180        }
    1181        if !wkt::internal::is_default(&self.max_messages) {
    1182            struct __With<'a>(&'a i64);
    1183            impl<'a> serde::ser::Serialize for __With<'a> {
    1184                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1185                where
    1186                    S: serde::ser::Serializer,
    1187                {
    1188                    serde_with::As::<wkt::internal::I64>::serialize(self.0, serializer)
    1189                }
    1190            }
    1191            state.serialize_entry("maxMessages", &__With(&self.max_messages))?;
    1192        }
    1193        if !wkt::internal::is_default(&self.state) {
    1194            state.serialize_entry("state", &self.state)?;
    1195        }
    1196        if !self.service_account_email.is_empty() {
    1197            state.serialize_entry("serviceAccountEmail", &self.service_account_email)?;
    1198        }
    1199        if !self._unknown_fields.is_empty() {
    1200            for (key, value) in self._unknown_fields.iter() {
    1201                state.serialize_entry(key, &value)?;
    1202            }
    1203        }
    1204        state.end()
    1205    }
    1206}
    1207
    1208#[doc(hidden)]
    1209impl serde::ser::Serialize for super::cloud_storage_config::TextConfig {
    1210    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1211    where
    1212        S: serde::ser::Serializer,
    1213    {
    1214        use serde::ser::SerializeMap;
    1215        #[allow(unused_imports)]
    1216        use std::option::Option::Some;
    1217        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1218        if !self._unknown_fields.is_empty() {
    1219            for (key, value) in self._unknown_fields.iter() {
    1220                state.serialize_entry(key, &value)?;
    1221            }
    1222        }
    1223        state.end()
    1224    }
    1225}
    1226
    1227#[doc(hidden)]
    1228impl serde::ser::Serialize for super::cloud_storage_config::AvroConfig {
    1229    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1230    where
    1231        S: serde::ser::Serializer,
    1232    {
    1233        use serde::ser::SerializeMap;
    1234        #[allow(unused_imports)]
    1235        use std::option::Option::Some;
    1236        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1237        if !wkt::internal::is_default(&self.write_metadata) {
    1238            state.serialize_entry("writeMetadata", &self.write_metadata)?;
    1239        }
    1240        if !wkt::internal::is_default(&self.use_topic_schema) {
    1241            state.serialize_entry("useTopicSchema", &self.use_topic_schema)?;
    1242        }
    1243        if !self._unknown_fields.is_empty() {
    1244            for (key, value) in self._unknown_fields.iter() {
    1245                state.serialize_entry(key, &value)?;
    1246            }
    1247        }
    1248        state.end()
    1249    }
    1250}
    1251
    1252#[doc(hidden)]
    1253impl serde::ser::Serialize for super::GetSubscriptionRequest {
    1254    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1255    where
    1256        S: serde::ser::Serializer,
    1257    {
    1258        use serde::ser::SerializeMap;
    1259        #[allow(unused_imports)]
    1260        use std::option::Option::Some;
    1261        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1262        if !self.subscription.is_empty() {
    1263            state.serialize_entry("subscription", &self.subscription)?;
    1264        }
    1265        if !self._unknown_fields.is_empty() {
    1266            for (key, value) in self._unknown_fields.iter() {
    1267                state.serialize_entry(key, &value)?;
    1268            }
    1269        }
    1270        state.end()
    1271    }
    1272}
    1273
    1274#[doc(hidden)]
    1275impl serde::ser::Serialize for super::UpdateSubscriptionRequest {
    1276    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1277    where
    1278        S: serde::ser::Serializer,
    1279    {
    1280        use serde::ser::SerializeMap;
    1281        #[allow(unused_imports)]
    1282        use std::option::Option::Some;
    1283        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1284        if self.subscription.is_some() {
    1285            state.serialize_entry("subscription", &self.subscription)?;
    1286        }
    1287        if self.update_mask.is_some() {
    1288            state.serialize_entry("updateMask", &self.update_mask)?;
    1289        }
    1290        if !self._unknown_fields.is_empty() {
    1291            for (key, value) in self._unknown_fields.iter() {
    1292                state.serialize_entry(key, &value)?;
    1293            }
    1294        }
    1295        state.end()
    1296    }
    1297}
    1298
    1299#[doc(hidden)]
    1300impl serde::ser::Serialize for super::ListSubscriptionsRequest {
    1301    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1302    where
    1303        S: serde::ser::Serializer,
    1304    {
    1305        use serde::ser::SerializeMap;
    1306        #[allow(unused_imports)]
    1307        use std::option::Option::Some;
    1308        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1309        if !self.project.is_empty() {
    1310            state.serialize_entry("project", &self.project)?;
    1311        }
    1312        if !wkt::internal::is_default(&self.page_size) {
    1313            struct __With<'a>(&'a i32);
    1314            impl<'a> serde::ser::Serialize for __With<'a> {
    1315                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1316                where
    1317                    S: serde::ser::Serializer,
    1318                {
    1319                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
    1320                }
    1321            }
    1322            state.serialize_entry("pageSize", &__With(&self.page_size))?;
    1323        }
    1324        if !self.page_token.is_empty() {
    1325            state.serialize_entry("pageToken", &self.page_token)?;
    1326        }
    1327        if !self._unknown_fields.is_empty() {
    1328            for (key, value) in self._unknown_fields.iter() {
    1329                state.serialize_entry(key, &value)?;
    1330            }
    1331        }
    1332        state.end()
    1333    }
    1334}
    1335
    1336#[doc(hidden)]
    1337impl serde::ser::Serialize for super::ListSubscriptionsResponse {
    1338    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1339    where
    1340        S: serde::ser::Serializer,
    1341    {
    1342        use serde::ser::SerializeMap;
    1343        #[allow(unused_imports)]
    1344        use std::option::Option::Some;
    1345        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1346        if !self.subscriptions.is_empty() {
    1347            state.serialize_entry("subscriptions", &self.subscriptions)?;
    1348        }
    1349        if !self.next_page_token.is_empty() {
    1350            state.serialize_entry("nextPageToken", &self.next_page_token)?;
    1351        }
    1352        if !self._unknown_fields.is_empty() {
    1353            for (key, value) in self._unknown_fields.iter() {
    1354                state.serialize_entry(key, &value)?;
    1355            }
    1356        }
    1357        state.end()
    1358    }
    1359}
    1360
    1361#[doc(hidden)]
    1362impl serde::ser::Serialize for super::DeleteSubscriptionRequest {
    1363    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1364    where
    1365        S: serde::ser::Serializer,
    1366    {
    1367        use serde::ser::SerializeMap;
    1368        #[allow(unused_imports)]
    1369        use std::option::Option::Some;
    1370        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1371        if !self.subscription.is_empty() {
    1372            state.serialize_entry("subscription", &self.subscription)?;
    1373        }
    1374        if !self._unknown_fields.is_empty() {
    1375            for (key, value) in self._unknown_fields.iter() {
    1376                state.serialize_entry(key, &value)?;
    1377            }
    1378        }
    1379        state.end()
    1380    }
    1381}
    1382
    1383#[doc(hidden)]
    1384impl serde::ser::Serialize for super::ModifyPushConfigRequest {
    1385    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1386    where
    1387        S: serde::ser::Serializer,
    1388    {
    1389        use serde::ser::SerializeMap;
    1390        #[allow(unused_imports)]
    1391        use std::option::Option::Some;
    1392        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1393        if !self.subscription.is_empty() {
    1394            state.serialize_entry("subscription", &self.subscription)?;
    1395        }
    1396        if self.push_config.is_some() {
    1397            state.serialize_entry("pushConfig", &self.push_config)?;
    1398        }
    1399        if !self._unknown_fields.is_empty() {
    1400            for (key, value) in self._unknown_fields.iter() {
    1401                state.serialize_entry(key, &value)?;
    1402            }
    1403        }
    1404        state.end()
    1405    }
    1406}
    1407
    1408#[doc(hidden)]
    1409impl serde::ser::Serialize for super::CreateSnapshotRequest {
    1410    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1411    where
    1412        S: serde::ser::Serializer,
    1413    {
    1414        use serde::ser::SerializeMap;
    1415        #[allow(unused_imports)]
    1416        use std::option::Option::Some;
    1417        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1418        if !self.name.is_empty() {
    1419            state.serialize_entry("name", &self.name)?;
    1420        }
    1421        if !self.subscription.is_empty() {
    1422            state.serialize_entry("subscription", &self.subscription)?;
    1423        }
    1424        if !self.labels.is_empty() {
    1425            state.serialize_entry("labels", &self.labels)?;
    1426        }
    1427        if !self.tags.is_empty() {
    1428            state.serialize_entry("tags", &self.tags)?;
    1429        }
    1430        if !self._unknown_fields.is_empty() {
    1431            for (key, value) in self._unknown_fields.iter() {
    1432                state.serialize_entry(key, &value)?;
    1433            }
    1434        }
    1435        state.end()
    1436    }
    1437}
    1438
    1439#[doc(hidden)]
    1440impl serde::ser::Serialize for super::UpdateSnapshotRequest {
    1441    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1442    where
    1443        S: serde::ser::Serializer,
    1444    {
    1445        use serde::ser::SerializeMap;
    1446        #[allow(unused_imports)]
    1447        use std::option::Option::Some;
    1448        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1449        if self.snapshot.is_some() {
    1450            state.serialize_entry("snapshot", &self.snapshot)?;
    1451        }
    1452        if self.update_mask.is_some() {
    1453            state.serialize_entry("updateMask", &self.update_mask)?;
    1454        }
    1455        if !self._unknown_fields.is_empty() {
    1456            for (key, value) in self._unknown_fields.iter() {
    1457                state.serialize_entry(key, &value)?;
    1458            }
    1459        }
    1460        state.end()
    1461    }
    1462}
    1463
    1464#[doc(hidden)]
    1465impl serde::ser::Serialize for super::Snapshot {
    1466    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1467    where
    1468        S: serde::ser::Serializer,
    1469    {
    1470        use serde::ser::SerializeMap;
    1471        #[allow(unused_imports)]
    1472        use std::option::Option::Some;
    1473        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1474        if !self.name.is_empty() {
    1475            state.serialize_entry("name", &self.name)?;
    1476        }
    1477        if !self.topic.is_empty() {
    1478            state.serialize_entry("topic", &self.topic)?;
    1479        }
    1480        if self.expire_time.is_some() {
    1481            state.serialize_entry("expireTime", &self.expire_time)?;
    1482        }
    1483        if !self.labels.is_empty() {
    1484            state.serialize_entry("labels", &self.labels)?;
    1485        }
    1486        if !self._unknown_fields.is_empty() {
    1487            for (key, value) in self._unknown_fields.iter() {
    1488                state.serialize_entry(key, &value)?;
    1489            }
    1490        }
    1491        state.end()
    1492    }
    1493}
    1494
    1495#[doc(hidden)]
    1496impl serde::ser::Serialize for super::GetSnapshotRequest {
    1497    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1498    where
    1499        S: serde::ser::Serializer,
    1500    {
    1501        use serde::ser::SerializeMap;
    1502        #[allow(unused_imports)]
    1503        use std::option::Option::Some;
    1504        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1505        if !self.snapshot.is_empty() {
    1506            state.serialize_entry("snapshot", &self.snapshot)?;
    1507        }
    1508        if !self._unknown_fields.is_empty() {
    1509            for (key, value) in self._unknown_fields.iter() {
    1510                state.serialize_entry(key, &value)?;
    1511            }
    1512        }
    1513        state.end()
    1514    }
    1515}
    1516
    1517#[doc(hidden)]
    1518impl serde::ser::Serialize for super::ListSnapshotsRequest {
    1519    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1520    where
    1521        S: serde::ser::Serializer,
    1522    {
    1523        use serde::ser::SerializeMap;
    1524        #[allow(unused_imports)]
    1525        use std::option::Option::Some;
    1526        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1527        if !self.project.is_empty() {
    1528            state.serialize_entry("project", &self.project)?;
    1529        }
    1530        if !wkt::internal::is_default(&self.page_size) {
    1531            struct __With<'a>(&'a i32);
    1532            impl<'a> serde::ser::Serialize for __With<'a> {
    1533                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1534                where
    1535                    S: serde::ser::Serializer,
    1536                {
    1537                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
    1538                }
    1539            }
    1540            state.serialize_entry("pageSize", &__With(&self.page_size))?;
    1541        }
    1542        if !self.page_token.is_empty() {
    1543            state.serialize_entry("pageToken", &self.page_token)?;
    1544        }
    1545        if !self._unknown_fields.is_empty() {
    1546            for (key, value) in self._unknown_fields.iter() {
    1547                state.serialize_entry(key, &value)?;
    1548            }
    1549        }
    1550        state.end()
    1551    }
    1552}
    1553
    1554#[doc(hidden)]
    1555impl serde::ser::Serialize for super::ListSnapshotsResponse {
    1556    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1557    where
    1558        S: serde::ser::Serializer,
    1559    {
    1560        use serde::ser::SerializeMap;
    1561        #[allow(unused_imports)]
    1562        use std::option::Option::Some;
    1563        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1564        if !self.snapshots.is_empty() {
    1565            state.serialize_entry("snapshots", &self.snapshots)?;
    1566        }
    1567        if !self.next_page_token.is_empty() {
    1568            state.serialize_entry("nextPageToken", &self.next_page_token)?;
    1569        }
    1570        if !self._unknown_fields.is_empty() {
    1571            for (key, value) in self._unknown_fields.iter() {
    1572                state.serialize_entry(key, &value)?;
    1573            }
    1574        }
    1575        state.end()
    1576    }
    1577}
    1578
    1579#[doc(hidden)]
    1580impl serde::ser::Serialize for super::DeleteSnapshotRequest {
    1581    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1582    where
    1583        S: serde::ser::Serializer,
    1584    {
    1585        use serde::ser::SerializeMap;
    1586        #[allow(unused_imports)]
    1587        use std::option::Option::Some;
    1588        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1589        if !self.snapshot.is_empty() {
    1590            state.serialize_entry("snapshot", &self.snapshot)?;
    1591        }
    1592        if !self._unknown_fields.is_empty() {
    1593            for (key, value) in self._unknown_fields.iter() {
    1594                state.serialize_entry(key, &value)?;
    1595            }
    1596        }
    1597        state.end()
    1598    }
    1599}
    1600
    1601#[doc(hidden)]
    1602impl serde::ser::Serialize for super::SeekRequest {
    1603    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1604    where
    1605        S: serde::ser::Serializer,
    1606    {
    1607        use serde::ser::SerializeMap;
    1608        #[allow(unused_imports)]
    1609        use std::option::Option::Some;
    1610        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1611        if !self.subscription.is_empty() {
    1612            state.serialize_entry("subscription", &self.subscription)?;
    1613        }
    1614        if let Some(value) = self.time() {
    1615            state.serialize_entry("time", value)?;
    1616        }
    1617        if let Some(value) = self.snapshot() {
    1618            state.serialize_entry("snapshot", value)?;
    1619        }
    1620        if !self._unknown_fields.is_empty() {
    1621            for (key, value) in self._unknown_fields.iter() {
    1622                state.serialize_entry(key, &value)?;
    1623            }
    1624        }
    1625        state.end()
    1626    }
    1627}
    1628
    1629#[doc(hidden)]
    1630impl serde::ser::Serialize for super::SeekResponse {
    1631    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1632    where
    1633        S: serde::ser::Serializer,
    1634    {
    1635        use serde::ser::SerializeMap;
    1636        #[allow(unused_imports)]
    1637        use std::option::Option::Some;
    1638        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1639        if !self._unknown_fields.is_empty() {
    1640            for (key, value) in self._unknown_fields.iter() {
    1641                state.serialize_entry(key, &value)?;
    1642            }
    1643        }
    1644        state.end()
    1645    }
    1646}
    1647
    1648#[doc(hidden)]
    1649impl serde::ser::Serialize for super::Schema {
    1650    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1651    where
    1652        S: serde::ser::Serializer,
    1653    {
    1654        use serde::ser::SerializeMap;
    1655        #[allow(unused_imports)]
    1656        use std::option::Option::Some;
    1657        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1658        if !self.name.is_empty() {
    1659            state.serialize_entry("name", &self.name)?;
    1660        }
    1661        if !wkt::internal::is_default(&self.r#type) {
    1662            state.serialize_entry("type", &self.r#type)?;
    1663        }
    1664        if !self.definition.is_empty() {
    1665            state.serialize_entry("definition", &self.definition)?;
    1666        }
    1667        if !self.revision_id.is_empty() {
    1668            state.serialize_entry("revisionId", &self.revision_id)?;
    1669        }
    1670        if self.revision_create_time.is_some() {
    1671            state.serialize_entry("revisionCreateTime", &self.revision_create_time)?;
    1672        }
    1673        if !self._unknown_fields.is_empty() {
    1674            for (key, value) in self._unknown_fields.iter() {
    1675                state.serialize_entry(key, &value)?;
    1676            }
    1677        }
    1678        state.end()
    1679    }
    1680}
    1681
    1682#[doc(hidden)]
    1683impl serde::ser::Serialize for super::CreateSchemaRequest {
    1684    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1685    where
    1686        S: serde::ser::Serializer,
    1687    {
    1688        use serde::ser::SerializeMap;
    1689        #[allow(unused_imports)]
    1690        use std::option::Option::Some;
    1691        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1692        if !self.parent.is_empty() {
    1693            state.serialize_entry("parent", &self.parent)?;
    1694        }
    1695        if self.schema.is_some() {
    1696            state.serialize_entry("schema", &self.schema)?;
    1697        }
    1698        if !self.schema_id.is_empty() {
    1699            state.serialize_entry("schemaId", &self.schema_id)?;
    1700        }
    1701        if !self._unknown_fields.is_empty() {
    1702            for (key, value) in self._unknown_fields.iter() {
    1703                state.serialize_entry(key, &value)?;
    1704            }
    1705        }
    1706        state.end()
    1707    }
    1708}
    1709
    1710#[doc(hidden)]
    1711impl serde::ser::Serialize for super::GetSchemaRequest {
    1712    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1713    where
    1714        S: serde::ser::Serializer,
    1715    {
    1716        use serde::ser::SerializeMap;
    1717        #[allow(unused_imports)]
    1718        use std::option::Option::Some;
    1719        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1720        if !self.name.is_empty() {
    1721            state.serialize_entry("name", &self.name)?;
    1722        }
    1723        if !wkt::internal::is_default(&self.view) {
    1724            state.serialize_entry("view", &self.view)?;
    1725        }
    1726        if !self._unknown_fields.is_empty() {
    1727            for (key, value) in self._unknown_fields.iter() {
    1728                state.serialize_entry(key, &value)?;
    1729            }
    1730        }
    1731        state.end()
    1732    }
    1733}
    1734
    1735#[doc(hidden)]
    1736impl serde::ser::Serialize for super::ListSchemasRequest {
    1737    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1738    where
    1739        S: serde::ser::Serializer,
    1740    {
    1741        use serde::ser::SerializeMap;
    1742        #[allow(unused_imports)]
    1743        use std::option::Option::Some;
    1744        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1745        if !self.parent.is_empty() {
    1746            state.serialize_entry("parent", &self.parent)?;
    1747        }
    1748        if !wkt::internal::is_default(&self.view) {
    1749            state.serialize_entry("view", &self.view)?;
    1750        }
    1751        if !wkt::internal::is_default(&self.page_size) {
    1752            struct __With<'a>(&'a i32);
    1753            impl<'a> serde::ser::Serialize for __With<'a> {
    1754                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1755                where
    1756                    S: serde::ser::Serializer,
    1757                {
    1758                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
    1759                }
    1760            }
    1761            state.serialize_entry("pageSize", &__With(&self.page_size))?;
    1762        }
    1763        if !self.page_token.is_empty() {
    1764            state.serialize_entry("pageToken", &self.page_token)?;
    1765        }
    1766        if !self._unknown_fields.is_empty() {
    1767            for (key, value) in self._unknown_fields.iter() {
    1768                state.serialize_entry(key, &value)?;
    1769            }
    1770        }
    1771        state.end()
    1772    }
    1773}
    1774
    1775#[doc(hidden)]
    1776impl serde::ser::Serialize for super::ListSchemasResponse {
    1777    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1778    where
    1779        S: serde::ser::Serializer,
    1780    {
    1781        use serde::ser::SerializeMap;
    1782        #[allow(unused_imports)]
    1783        use std::option::Option::Some;
    1784        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1785        if !self.schemas.is_empty() {
    1786            state.serialize_entry("schemas", &self.schemas)?;
    1787        }
    1788        if !self.next_page_token.is_empty() {
    1789            state.serialize_entry("nextPageToken", &self.next_page_token)?;
    1790        }
    1791        if !self._unknown_fields.is_empty() {
    1792            for (key, value) in self._unknown_fields.iter() {
    1793                state.serialize_entry(key, &value)?;
    1794            }
    1795        }
    1796        state.end()
    1797    }
    1798}
    1799
    1800#[doc(hidden)]
    1801impl serde::ser::Serialize for super::ListSchemaRevisionsRequest {
    1802    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1803    where
    1804        S: serde::ser::Serializer,
    1805    {
    1806        use serde::ser::SerializeMap;
    1807        #[allow(unused_imports)]
    1808        use std::option::Option::Some;
    1809        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1810        if !self.name.is_empty() {
    1811            state.serialize_entry("name", &self.name)?;
    1812        }
    1813        if !wkt::internal::is_default(&self.view) {
    1814            state.serialize_entry("view", &self.view)?;
    1815        }
    1816        if !wkt::internal::is_default(&self.page_size) {
    1817            struct __With<'a>(&'a i32);
    1818            impl<'a> serde::ser::Serialize for __With<'a> {
    1819                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1820                where
    1821                    S: serde::ser::Serializer,
    1822                {
    1823                    serde_with::As::<wkt::internal::I32>::serialize(self.0, serializer)
    1824                }
    1825            }
    1826            state.serialize_entry("pageSize", &__With(&self.page_size))?;
    1827        }
    1828        if !self.page_token.is_empty() {
    1829            state.serialize_entry("pageToken", &self.page_token)?;
    1830        }
    1831        if !self._unknown_fields.is_empty() {
    1832            for (key, value) in self._unknown_fields.iter() {
    1833                state.serialize_entry(key, &value)?;
    1834            }
    1835        }
    1836        state.end()
    1837    }
    1838}
    1839
    1840#[doc(hidden)]
    1841impl serde::ser::Serialize for super::ListSchemaRevisionsResponse {
    1842    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1843    where
    1844        S: serde::ser::Serializer,
    1845    {
    1846        use serde::ser::SerializeMap;
    1847        #[allow(unused_imports)]
    1848        use std::option::Option::Some;
    1849        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1850        if !self.schemas.is_empty() {
    1851            state.serialize_entry("schemas", &self.schemas)?;
    1852        }
    1853        if !self.next_page_token.is_empty() {
    1854            state.serialize_entry("nextPageToken", &self.next_page_token)?;
    1855        }
    1856        if !self._unknown_fields.is_empty() {
    1857            for (key, value) in self._unknown_fields.iter() {
    1858                state.serialize_entry(key, &value)?;
    1859            }
    1860        }
    1861        state.end()
    1862    }
    1863}
    1864
    1865#[doc(hidden)]
    1866impl serde::ser::Serialize for super::CommitSchemaRequest {
    1867    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1868    where
    1869        S: serde::ser::Serializer,
    1870    {
    1871        use serde::ser::SerializeMap;
    1872        #[allow(unused_imports)]
    1873        use std::option::Option::Some;
    1874        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1875        if !self.name.is_empty() {
    1876            state.serialize_entry("name", &self.name)?;
    1877        }
    1878        if self.schema.is_some() {
    1879            state.serialize_entry("schema", &self.schema)?;
    1880        }
    1881        if !self._unknown_fields.is_empty() {
    1882            for (key, value) in self._unknown_fields.iter() {
    1883                state.serialize_entry(key, &value)?;
    1884            }
    1885        }
    1886        state.end()
    1887    }
    1888}
    1889
    1890#[doc(hidden)]
    1891impl serde::ser::Serialize for super::RollbackSchemaRequest {
    1892    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1893    where
    1894        S: serde::ser::Serializer,
    1895    {
    1896        use serde::ser::SerializeMap;
    1897        #[allow(unused_imports)]
    1898        use std::option::Option::Some;
    1899        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1900        if !self.name.is_empty() {
    1901            state.serialize_entry("name", &self.name)?;
    1902        }
    1903        if !self.revision_id.is_empty() {
    1904            state.serialize_entry("revisionId", &self.revision_id)?;
    1905        }
    1906        if !self._unknown_fields.is_empty() {
    1907            for (key, value) in self._unknown_fields.iter() {
    1908                state.serialize_entry(key, &value)?;
    1909            }
    1910        }
    1911        state.end()
    1912    }
    1913}
    1914
    1915#[doc(hidden)]
    1916impl serde::ser::Serialize for super::DeleteSchemaRevisionRequest {
    1917    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1918    where
    1919        S: serde::ser::Serializer,
    1920    {
    1921        use serde::ser::SerializeMap;
    1922        #[allow(unused_imports)]
    1923        use std::option::Option::Some;
    1924        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1925        if !self.name.is_empty() {
    1926            state.serialize_entry("name", &self.name)?;
    1927        }
    1928        if !self.revision_id.is_empty() {
    1929            state.serialize_entry("revisionId", &self.revision_id)?;
    1930        }
    1931        if !self._unknown_fields.is_empty() {
    1932            for (key, value) in self._unknown_fields.iter() {
    1933                state.serialize_entry(key, &value)?;
    1934            }
    1935        }
    1936        state.end()
    1937    }
    1938}
    1939
    1940#[doc(hidden)]
    1941impl serde::ser::Serialize for super::DeleteSchemaRequest {
    1942    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1943    where
    1944        S: serde::ser::Serializer,
    1945    {
    1946        use serde::ser::SerializeMap;
    1947        #[allow(unused_imports)]
    1948        use std::option::Option::Some;
    1949        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1950        if !self.name.is_empty() {
    1951            state.serialize_entry("name", &self.name)?;
    1952        }
    1953        if !self._unknown_fields.is_empty() {
    1954            for (key, value) in self._unknown_fields.iter() {
    1955                state.serialize_entry(key, &value)?;
    1956            }
    1957        }
    1958        state.end()
    1959    }
    1960}
    1961
    1962#[doc(hidden)]
    1963impl serde::ser::Serialize for super::ValidateSchemaRequest {
    1964    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1965    where
    1966        S: serde::ser::Serializer,
    1967    {
    1968        use serde::ser::SerializeMap;
    1969        #[allow(unused_imports)]
    1970        use std::option::Option::Some;
    1971        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1972        if !self.parent.is_empty() {
    1973            state.serialize_entry("parent", &self.parent)?;
    1974        }
    1975        if self.schema.is_some() {
    1976            state.serialize_entry("schema", &self.schema)?;
    1977        }
    1978        if !self._unknown_fields.is_empty() {
    1979            for (key, value) in self._unknown_fields.iter() {
    1980                state.serialize_entry(key, &value)?;
    1981            }
    1982        }
    1983        state.end()
    1984    }
    1985}
    1986
    1987#[doc(hidden)]
    1988impl serde::ser::Serialize for super::ValidateSchemaResponse {
    1989    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    1990    where
    1991        S: serde::ser::Serializer,
    1992    {
    1993        use serde::ser::SerializeMap;
    1994        #[allow(unused_imports)]
    1995        use std::option::Option::Some;
    1996        let mut state = serializer.serialize_map(std::option::Option::None)?;
    1997        if !self._unknown_fields.is_empty() {
    1998            for (key, value) in self._unknown_fields.iter() {
    1999                state.serialize_entry(key, &value)?;
    2000            }
    2001        }
    2002        state.end()
    2003    }
    2004}
    2005
    2006#[doc(hidden)]
    2007impl serde::ser::Serialize for super::ValidateMessageRequest {
    2008    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    2009    where
    2010        S: serde::ser::Serializer,
    2011    {
    2012        use serde::ser::SerializeMap;
    2013        #[allow(unused_imports)]
    2014        use std::option::Option::Some;
    2015        let mut state = serializer.serialize_map(std::option::Option::None)?;
    2016        if !self.parent.is_empty() {
    2017            state.serialize_entry("parent", &self.parent)?;
    2018        }
    2019        if let Some(value) = self.name() {
    2020            state.serialize_entry("name", value)?;
    2021        }
    2022        if let Some(value) = self.schema() {
    2023            state.serialize_entry("schema", value)?;
    2024        }
    2025        if !self.message.is_empty() {
    2026            struct __With<'a>(&'a ::bytes::Bytes);
    2027            impl<'a> serde::ser::Serialize for __With<'a> {
    2028                fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    2029                where
    2030                    S: serde::ser::Serializer,
    2031                {
    2032                    serde_with::As::<serde_with::base64::Base64>::serialize(self.0, serializer)
    2033                }
    2034            }
    2035            state.serialize_entry("message", &__With(&self.message))?;
    2036        }
    2037        if !wkt::internal::is_default(&self.encoding) {
    2038            state.serialize_entry("encoding", &self.encoding)?;
    2039        }
    2040        if !self._unknown_fields.is_empty() {
    2041            for (key, value) in self._unknown_fields.iter() {
    2042                state.serialize_entry(key, &value)?;
    2043            }
    2044        }
    2045        state.end()
    2046    }
    2047}
    2048
    2049#[doc(hidden)]
    2050impl serde::ser::Serialize for super::ValidateMessageResponse {
    2051    fn serialize<S>(&self, serializer: S) -> std::result::Result<S::Ok, S::Error>
    2052    where
    2053        S: serde::ser::Serializer,
    2054    {
    2055        use serde::ser::SerializeMap;
    2056        #[allow(unused_imports)]
    2057        use std::option::Option::Some;
    2058        let mut state = serializer.serialize_map(std::option::Option::None)?;
    2059        if !self._unknown_fields.is_empty() {
    2060            for (key, value) in self._unknown_fields.iter() {
    2061                state.serialize_entry(key, &value)?;
    2062            }
    2063        }
    2064        state.end()
    2065    }
    2066}