diff --git a/.changelog/unreleased/features/168-add-wasm-client-protos.md b/.changelog/unreleased/features/168-add-wasm-client-protos.md new file mode 100644 index 00000000..f0c59e3d --- /dev/null +++ b/.changelog/unreleased/features/168-add-wasm-client-protos.md @@ -0,0 +1,3 @@ +- Integrate Wasm light client proto types by updating `IBC_GO_COMMIT` to the + hash associated with the ibc-go `wasm-v8.0.0` tag + ([#168](https://github.com/cosmos/ibc-proto-rs/issues/168)). diff --git a/src/IBC_GO_COMMIT b/src/IBC_GO_COMMIT index 47f08cce..90e668bc 100644 --- a/src/IBC_GO_COMMIT +++ b/src/IBC_GO_COMMIT @@ -1 +1 @@ -2551dea41cd3c512845007ca895c8402afa9b79f +57fcdb9a9a9db9b206f7df2f955866dc4e10fef4 diff --git a/src/lib.rs b/src/lib.rs index f32a2f6f..37e76f5b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -361,6 +361,13 @@ pub mod ibc { include_proto!("ibc.lightclients.tendermint.v1.serde.rs"); } } + pub mod wasm { + pub mod v1 { + include_proto!("ibc.lightclients.wasm.v1.rs"); + #[cfg(feature = "serde")] + include_proto!("ibc.lightclients.wasm.v1.serde.rs"); + } + } } pub mod mock { include_proto!("ibc.mock.rs"); diff --git a/src/prost/google.protobuf.rs b/src/prost/google.protobuf.rs index d58b594a..5976a8b1 100644 --- a/src/prost/google.protobuf.rs +++ b/src/prost/google.protobuf.rs @@ -22,8 +22,12 @@ /// if (any.is(Foo.class)) { /// foo = any.unpack(Foo.class); /// } +/// // or ... +/// if (any.isSameTypeAs(Foo.getDefaultInstance())) { +/// foo = any.unpack(Foo.getDefaultInstance()); +/// } /// -/// Example 3: Pack and unpack a message in Python. +/// Example 3: Pack and unpack a message in Python. /// /// foo = Foo(...) /// any = Any() @@ -33,7 +37,7 @@ /// any.Unpack(foo) /// ... /// -/// Example 4: Pack and unpack a message in Go +/// Example 4: Pack and unpack a message in Go /// /// foo := &pb.Foo{...} /// any, err := anypb.New(foo) @@ -52,9 +56,8 @@ /// in the type URL, for example "foo.bar.com/x/y.z" will yield type /// name "y.z". /// -/// /// JSON -/// +/// ==== /// The JSON representation of an `Any` value uses the regular /// representation of the deserialized, embedded message, with an /// additional field `@type` which contains the type URL. Example: @@ -112,7 +115,8 @@ pub struct Any { /// /// Note: this functionality is not currently available in the official /// protobuf release, and it is not used for type URLs beginning with - /// type.googleapis.com. + /// type.googleapis.com. As of May 2023, there are no widely used type server + /// implementations and no plans to implement one. /// /// Schemes other than `http`, `https` (or the empty scheme) might be /// used with implementation specific semantics. @@ -183,9 +187,14 @@ pub struct FileDescriptorProto { #[prost(message, optional, tag = "9")] pub source_code_info: ::core::option::Option, /// The syntax of the proto file. - /// The supported values are "proto2" and "proto3". + /// The supported values are "proto2", "proto3", and "editions". + /// + /// If `edition` is present, this value must be "editions". #[prost(string, optional, tag = "12")] pub syntax: ::core::option::Option<::prost::alloc::string::String>, + /// The edition of the proto file. + #[prost(enumeration = "Edition", optional, tag = "14")] + pub edition: ::core::option::Option, } impl ::prost::Name for FileDescriptorProto { const NAME: &'static str = "FileDescriptorProto"; @@ -276,6 +285,99 @@ pub struct ExtensionRangeOptions { /// The parser stores options it doesn't recognize here. See above. #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, + /// For external users: DO NOT USE. We are in the process of open sourcing + /// extension declaration and executing internal cleanups before it can be + /// used externally. + #[prost(message, repeated, tag = "2")] + pub declaration: ::prost::alloc::vec::Vec, + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "50")] + pub features: ::core::option::Option, + /// The verification state of the range. + /// TODO: flip the default to DECLARATION once all empty ranges + /// are marked as UNVERIFIED. + #[prost( + enumeration = "extension_range_options::VerificationState", + optional, + tag = "3", + default = "Unverified" + )] + pub verification: ::core::option::Option, +} +/// Nested message and enum types in `ExtensionRangeOptions`. +pub mod extension_range_options { + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Declaration { + /// The extension number declared within the extension range. + #[prost(int32, optional, tag = "1")] + pub number: ::core::option::Option, + /// The fully-qualified name of the extension field. There must be a leading + /// dot in front of the full name. + #[prost(string, optional, tag = "2")] + pub full_name: ::core::option::Option<::prost::alloc::string::String>, + /// The fully-qualified type name of the extension field. Unlike + /// Metadata.type, Declaration.type must have a leading dot for messages + /// and enums. + #[prost(string, optional, tag = "3")] + pub r#type: ::core::option::Option<::prost::alloc::string::String>, + /// If true, indicates that the number is reserved in the extension range, + /// and any extension field with the number will fail to compile. Set this + /// when a declared extension field is deleted. + #[prost(bool, optional, tag = "5")] + pub reserved: ::core::option::Option, + /// If true, indicates that the extension must be defined as repeated. + /// Otherwise the extension must be defined as optional. + #[prost(bool, optional, tag = "6")] + pub repeated: ::core::option::Option, + } + impl ::prost::Name for Declaration { + const NAME: &'static str = "Declaration"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "google.protobuf.ExtensionRangeOptions.{}", Self::NAME + ) + } + } + /// The verification state of the extension range. + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum VerificationState { + /// All the extensions of the range must be declared. + Declaration = 0, + Unverified = 1, + } + impl VerificationState { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + VerificationState::Declaration => "DECLARATION", + VerificationState::Unverified => "UNVERIFIED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DECLARATION" => Some(Self::Declaration), + "UNVERIFIED" => Some(Self::Unverified), + _ => None, + } + } + } } impl ::prost::Name for ExtensionRangeOptions { const NAME: &'static str = "ExtensionRangeOptions"; @@ -382,9 +484,10 @@ pub mod field_descriptor_proto { Bool = 8, String = 9, /// Tag-delimited aggregate. - /// Group type is deprecated and not supported in proto3. However, Proto3 + /// Group type is deprecated and not supported after google.protobuf. However, Proto3 /// implementations should still be able to parse the group wire format and - /// treat group fields as unknown fields. + /// treat group fields as unknown fields. In Editions, the group wire format + /// can be enabled via the `message_encoding` feature. Group = 10, /// Length-delimited aggregate. Message = 11, @@ -466,8 +569,11 @@ pub mod field_descriptor_proto { pub enum Label { /// 0 is reserved for errors Optional = 1, - Required = 2, Repeated = 3, + /// The required label is only allowed in google.protobuf. In proto3 and Editions + /// it's explicitly prohibited. In Editions, the `field_presence` feature + /// can be used to get this behavior. + Required = 2, } impl Label { /// String value of the enum field names used in the ProtoBuf definition. @@ -477,16 +583,16 @@ pub mod field_descriptor_proto { pub fn as_str_name(&self) -> &'static str { match self { Label::Optional => "LABEL_OPTIONAL", - Label::Required => "LABEL_REQUIRED", Label::Repeated => "LABEL_REPEATED", + Label::Required => "LABEL_REQUIRED", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { "LABEL_OPTIONAL" => Some(Self::Optional), - "LABEL_REQUIRED" => Some(Self::Required), "LABEL_REPEATED" => Some(Self::Repeated), + "LABEL_REQUIRED" => Some(Self::Required), _ => None, } } @@ -744,6 +850,9 @@ pub struct FileOptions { /// determining the ruby package. #[prost(string, optional, tag = "45")] pub ruby_package: ::core::option::Option<::prost::alloc::string::String>, + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "50")] + pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. /// See the documentation for the "Options" section above. #[prost(message, repeated, tag = "999")] @@ -838,6 +947,10 @@ pub struct MessageOptions { /// this is a formalization for deprecating messages. #[prost(bool, optional, tag = "3", default = "false")] pub deprecated: ::core::option::Option, + /// NOTE: Do not set the option in .proto files. Always use the maps syntax + /// instead. The option should only be implicitly set by the proto compiler + /// parser. + /// /// Whether the message is an automatically generated map entry type for the /// maps field. /// @@ -855,12 +968,24 @@ pub struct MessageOptions { /// use a native map in the target language to hold the keys and values. /// The reflection APIs in such implementations still need to work as /// if the field is a repeated message field. - /// - /// NOTE: Do not set the option in .proto files. Always use the maps syntax - /// instead. The option should only be implicitly set by the proto compiler - /// parser. #[prost(bool, optional, tag = "7")] pub map_entry: ::core::option::Option, + /// Enable the legacy handling of JSON field name conflicts. This lowercases + /// and strips underscored from the fields before comparison in proto3 only. + /// The new behavior takes `json_name` into account and applies to proto2 as + /// well. + /// + /// This should only be used as a temporary measure against broken builds due + /// to the change in behavior for JSON field name conflicts. + /// + /// TODO This is legacy behavior we plan to remove once downstream + /// teams have had time to migrate. + #[deprecated] + #[prost(bool, optional, tag = "11")] + pub deprecated_legacy_json_field_conflicts: ::core::option::Option, + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "12")] + pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, @@ -877,8 +1002,10 @@ impl ::prost::Name for MessageOptions { pub struct FieldOptions { /// The ctype option instructs the C++ code generator to use a different /// representation of the field than it normally would. See the specific - /// options below. This option is not yet implemented in the open source - /// release -- sorry, we'll try to include it in a future version! + /// options below. This option is only implemented to support use of + /// \[ctype=CORD\] and \[ctype=STRING\] (the default) on non-repeated fields of + /// type "bytes" in the open source release -- sorry, we'll try to include + /// other types in a future version! #[prost( enumeration = "field_options::CType", optional, @@ -890,7 +1017,9 @@ pub struct FieldOptions { /// a more efficient representation on the wire. Rather than repeatedly /// writing the tag and type for each element, the entire array is encoded as /// a single length-delimited blob. In proto3, only explicit setting it to - /// false will avoid using packed encoding. + /// false will avoid using packed encoding. This option is prohibited in + /// Editions, but the `repeated_field_encoding` feature can be used to control + /// the behavior. #[prost(bool, optional, tag = "2")] pub packed: ::core::option::Option, /// The jstype option determines the JavaScript type used for values of the @@ -928,7 +1057,6 @@ pub struct FieldOptions { /// call from multiple threads concurrently, while non-const methods continue /// to require exclusive access. /// - /// /// Note that implementations may choose not to check required fields within /// a lazy sub-message. That is, calling IsInitialized() on the outer message /// may return true even if the inner message has missing required fields. @@ -940,11 +1068,8 @@ pub struct FieldOptions { /// check its required fields, regardless of whether or not the message has /// been parsed. /// - /// As of 2021, lazy does no correctness checks on the byte stream during - /// parsing. This may lead to crashes if and when an invalid byte stream is - /// finally parsed upon access. - /// - /// TODO(b/211906113): Enable validation on lazy fields. + /// As of May 2022, lazy verifies the contents of the byte stream during + /// parsing. An invalid byte stream will cause the overall parsing to fail. #[prost(bool, optional, tag = "5", default = "false")] pub lazy: ::core::option::Option, /// unverified_lazy does no correctness checks on the byte stream. This should @@ -961,12 +1086,46 @@ pub struct FieldOptions { /// For Google-internal migration only. Do not use. #[prost(bool, optional, tag = "10", default = "false")] pub weak: ::core::option::Option, + /// Indicate that the field value should not be printed out when using debug + /// formats, e.g. when the field contains sensitive credentials. + #[prost(bool, optional, tag = "16", default = "false")] + pub debug_redact: ::core::option::Option, + #[prost(enumeration = "field_options::OptionRetention", optional, tag = "17")] + pub retention: ::core::option::Option, + #[prost( + enumeration = "field_options::OptionTargetType", + repeated, + packed = "false", + tag = "19" + )] + pub targets: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "20")] + pub edition_defaults: ::prost::alloc::vec::Vec, + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "21")] + pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, } /// Nested message and enum types in `FieldOptions`. pub mod field_options { + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct EditionDefault { + #[prost(enumeration = "super::Edition", optional, tag = "3")] + pub edition: ::core::option::Option, + /// Textproto value. + #[prost(string, optional, tag = "2")] + pub value: ::core::option::Option<::prost::alloc::string::String>, + } + impl ::prost::Name for EditionDefault { + const NAME: &'static str = "EditionDefault"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.FieldOptions.{}", Self::NAME) + } + } #[derive( Clone, Copy, @@ -982,6 +1141,12 @@ pub mod field_options { pub enum CType { /// Default mode. String = 0, + /// The option \[ctype=CORD\] may be applied to a non-repeated field of type + /// "bytes". It indicates that in C++, the data should be stored in a Cord + /// instead of a string. For very large strings, this may reduce memory + /// fragmentation. It may also allow better performance when parsing from a + /// Cord, or when parsing with aliasing enabled, as the parsed Cord may then + /// alias the original buffer. Cord = 1, StringPiece = 2, } @@ -1049,6 +1214,114 @@ pub mod field_options { } } } + /// If set to RETENTION_SOURCE, the option will be omitted from the binary. + /// Note: as of January 2023, support for this is in progress and does not yet + /// have an effect (b/264593489). + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum OptionRetention { + RetentionUnknown = 0, + RetentionRuntime = 1, + RetentionSource = 2, + } + impl OptionRetention { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + OptionRetention::RetentionUnknown => "RETENTION_UNKNOWN", + OptionRetention::RetentionRuntime => "RETENTION_RUNTIME", + OptionRetention::RetentionSource => "RETENTION_SOURCE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "RETENTION_UNKNOWN" => Some(Self::RetentionUnknown), + "RETENTION_RUNTIME" => Some(Self::RetentionRuntime), + "RETENTION_SOURCE" => Some(Self::RetentionSource), + _ => None, + } + } + } + /// This indicates the types of entities that the field may apply to when used + /// as an option. If it is unset, then the field may be freely used as an + /// option on any kind of entity. Note: as of January 2023, support for this is + /// in progress and does not yet have an effect (b/264593489). + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum OptionTargetType { + TargetTypeUnknown = 0, + TargetTypeFile = 1, + TargetTypeExtensionRange = 2, + TargetTypeMessage = 3, + TargetTypeField = 4, + TargetTypeOneof = 5, + TargetTypeEnum = 6, + TargetTypeEnumEntry = 7, + TargetTypeService = 8, + TargetTypeMethod = 9, + } + impl OptionTargetType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + OptionTargetType::TargetTypeUnknown => "TARGET_TYPE_UNKNOWN", + OptionTargetType::TargetTypeFile => "TARGET_TYPE_FILE", + OptionTargetType::TargetTypeExtensionRange => { + "TARGET_TYPE_EXTENSION_RANGE" + } + OptionTargetType::TargetTypeMessage => "TARGET_TYPE_MESSAGE", + OptionTargetType::TargetTypeField => "TARGET_TYPE_FIELD", + OptionTargetType::TargetTypeOneof => "TARGET_TYPE_ONEOF", + OptionTargetType::TargetTypeEnum => "TARGET_TYPE_ENUM", + OptionTargetType::TargetTypeEnumEntry => "TARGET_TYPE_ENUM_ENTRY", + OptionTargetType::TargetTypeService => "TARGET_TYPE_SERVICE", + OptionTargetType::TargetTypeMethod => "TARGET_TYPE_METHOD", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "TARGET_TYPE_UNKNOWN" => Some(Self::TargetTypeUnknown), + "TARGET_TYPE_FILE" => Some(Self::TargetTypeFile), + "TARGET_TYPE_EXTENSION_RANGE" => Some(Self::TargetTypeExtensionRange), + "TARGET_TYPE_MESSAGE" => Some(Self::TargetTypeMessage), + "TARGET_TYPE_FIELD" => Some(Self::TargetTypeField), + "TARGET_TYPE_ONEOF" => Some(Self::TargetTypeOneof), + "TARGET_TYPE_ENUM" => Some(Self::TargetTypeEnum), + "TARGET_TYPE_ENUM_ENTRY" => Some(Self::TargetTypeEnumEntry), + "TARGET_TYPE_SERVICE" => Some(Self::TargetTypeService), + "TARGET_TYPE_METHOD" => Some(Self::TargetTypeMethod), + _ => None, + } + } + } } impl ::prost::Name for FieldOptions { const NAME: &'static str = "FieldOptions"; @@ -1060,6 +1333,9 @@ impl ::prost::Name for FieldOptions { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OneofOptions { + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "1")] + pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, @@ -1084,6 +1360,18 @@ pub struct EnumOptions { /// is a formalization for deprecating enums. #[prost(bool, optional, tag = "3", default = "false")] pub deprecated: ::core::option::Option, + /// Enable the legacy handling of JSON field name conflicts. This lowercases + /// and strips underscored from the fields before comparison in proto3 only. + /// The new behavior takes `json_name` into account and applies to proto2 as + /// well. + /// TODO Remove this legacy behavior once downstream teams have + /// had time to migrate. + #[deprecated] + #[prost(bool, optional, tag = "6")] + pub deprecated_legacy_json_field_conflicts: ::core::option::Option, + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "7")] + pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, @@ -1104,6 +1392,14 @@ pub struct EnumValueOptions { /// this is a formalization for deprecating enum values. #[prost(bool, optional, tag = "1", default = "false")] pub deprecated: ::core::option::Option, + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "2")] + pub features: ::core::option::Option, + /// Indicate that fields annotated with this enum value should not be printed + /// out when using debug formats, e.g. when the field contains sensitive + /// credentials. + #[prost(bool, optional, tag = "3", default = "false")] + pub debug_redact: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, @@ -1118,6 +1414,9 @@ impl ::prost::Name for EnumValueOptions { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ServiceOptions { + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "34")] + pub features: ::core::option::Option, /// Is this service deprecated? /// Depending on the target platform, this can emit Deprecated annotations /// for the service, or it will be completely ignored; in the very least, @@ -1151,6 +1450,9 @@ pub struct MethodOptions { default = "IdempotencyUnknown" )] pub idempotency_level: ::core::option::Option, + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "35")] + pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, @@ -1265,6 +1567,324 @@ impl ::prost::Name for UninterpretedOption { ::prost::alloc::format!("google.protobuf.{}", Self::NAME) } } +/// TODO Enums in C++ gencode (and potentially other languages) are +/// not well scoped. This means that each of the feature enums below can clash +/// with each other. The short names we've chosen maximize call-site +/// readability, but leave us very open to this scenario. A future feature will +/// be designed and implemented to handle this, hopefully before we ever hit a +/// conflict here. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FeatureSet { + #[prost(enumeration = "feature_set::FieldPresence", optional, tag = "1")] + pub field_presence: ::core::option::Option, + #[prost(enumeration = "feature_set::EnumType", optional, tag = "2")] + pub enum_type: ::core::option::Option, + #[prost(enumeration = "feature_set::RepeatedFieldEncoding", optional, tag = "3")] + pub repeated_field_encoding: ::core::option::Option, + #[prost(enumeration = "feature_set::Utf8Validation", optional, tag = "4")] + pub utf8_validation: ::core::option::Option, + #[prost(enumeration = "feature_set::MessageEncoding", optional, tag = "5")] + pub message_encoding: ::core::option::Option, + #[prost(enumeration = "feature_set::JsonFormat", optional, tag = "6")] + pub json_format: ::core::option::Option, +} +/// Nested message and enum types in `FeatureSet`. +pub mod feature_set { + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum FieldPresence { + Unknown = 0, + Explicit = 1, + Implicit = 2, + LegacyRequired = 3, + } + impl FieldPresence { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + FieldPresence::Unknown => "FIELD_PRESENCE_UNKNOWN", + FieldPresence::Explicit => "EXPLICIT", + FieldPresence::Implicit => "IMPLICIT", + FieldPresence::LegacyRequired => "LEGACY_REQUIRED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "FIELD_PRESENCE_UNKNOWN" => Some(Self::Unknown), + "EXPLICIT" => Some(Self::Explicit), + "IMPLICIT" => Some(Self::Implicit), + "LEGACY_REQUIRED" => Some(Self::LegacyRequired), + _ => None, + } + } + } + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum EnumType { + Unknown = 0, + Open = 1, + Closed = 2, + } + impl EnumType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + EnumType::Unknown => "ENUM_TYPE_UNKNOWN", + EnumType::Open => "OPEN", + EnumType::Closed => "CLOSED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ENUM_TYPE_UNKNOWN" => Some(Self::Unknown), + "OPEN" => Some(Self::Open), + "CLOSED" => Some(Self::Closed), + _ => None, + } + } + } + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum RepeatedFieldEncoding { + Unknown = 0, + Packed = 1, + Expanded = 2, + } + impl RepeatedFieldEncoding { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + RepeatedFieldEncoding::Unknown => "REPEATED_FIELD_ENCODING_UNKNOWN", + RepeatedFieldEncoding::Packed => "PACKED", + RepeatedFieldEncoding::Expanded => "EXPANDED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "REPEATED_FIELD_ENCODING_UNKNOWN" => Some(Self::Unknown), + "PACKED" => Some(Self::Packed), + "EXPANDED" => Some(Self::Expanded), + _ => None, + } + } + } + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum Utf8Validation { + Unknown = 0, + None = 1, + Verify = 2, + } + impl Utf8Validation { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Utf8Validation::Unknown => "UTF8_VALIDATION_UNKNOWN", + Utf8Validation::None => "NONE", + Utf8Validation::Verify => "VERIFY", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "UTF8_VALIDATION_UNKNOWN" => Some(Self::Unknown), + "NONE" => Some(Self::None), + "VERIFY" => Some(Self::Verify), + _ => None, + } + } + } + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum MessageEncoding { + Unknown = 0, + LengthPrefixed = 1, + Delimited = 2, + } + impl MessageEncoding { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + MessageEncoding::Unknown => "MESSAGE_ENCODING_UNKNOWN", + MessageEncoding::LengthPrefixed => "LENGTH_PREFIXED", + MessageEncoding::Delimited => "DELIMITED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "MESSAGE_ENCODING_UNKNOWN" => Some(Self::Unknown), + "LENGTH_PREFIXED" => Some(Self::LengthPrefixed), + "DELIMITED" => Some(Self::Delimited), + _ => None, + } + } + } + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum JsonFormat { + Unknown = 0, + Allow = 1, + LegacyBestEffort = 2, + } + impl JsonFormat { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + JsonFormat::Unknown => "JSON_FORMAT_UNKNOWN", + JsonFormat::Allow => "ALLOW", + JsonFormat::LegacyBestEffort => "LEGACY_BEST_EFFORT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "JSON_FORMAT_UNKNOWN" => Some(Self::Unknown), + "ALLOW" => Some(Self::Allow), + "LEGACY_BEST_EFFORT" => Some(Self::LegacyBestEffort), + _ => None, + } + } + } +} +impl ::prost::Name for FeatureSet { + const NAME: &'static str = "FeatureSet"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } +} +/// A compiled specification for the defaults of a set of features. These +/// messages are generated from FeatureSet extensions and can be used to seed +/// feature resolution. The resolution with this object becomes a simple search +/// for the closest matching edition, followed by proto merges. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FeatureSetDefaults { + #[prost(message, repeated, tag = "1")] + pub defaults: ::prost::alloc::vec::Vec< + feature_set_defaults::FeatureSetEditionDefault, + >, + /// The minimum supported edition (inclusive) when this was constructed. + /// Editions before this will not have defaults. + #[prost(enumeration = "Edition", optional, tag = "4")] + pub minimum_edition: ::core::option::Option, + /// The maximum known edition (inclusive) when this was constructed. Editions + /// after this will not have reliable defaults. + #[prost(enumeration = "Edition", optional, tag = "5")] + pub maximum_edition: ::core::option::Option, +} +/// Nested message and enum types in `FeatureSetDefaults`. +pub mod feature_set_defaults { + /// A map from every known edition with a unique set of defaults to its + /// defaults. Not all editions may be contained here. For a given edition, + /// the defaults at the closest matching edition ordered at or before it should + /// be used. This field must be in strict ascending order by edition. + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct FeatureSetEditionDefault { + #[prost(enumeration = "super::Edition", optional, tag = "3")] + pub edition: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub features: ::core::option::Option, + } + impl ::prost::Name for FeatureSetEditionDefault { + const NAME: &'static str = "FeatureSetEditionDefault"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.FeatureSetDefaults.{}", Self::NAME) + } + } +} +impl ::prost::Name for FeatureSetDefaults { + const NAME: &'static str = "FeatureSetDefaults"; + const PACKAGE: &'static str = "google.protobuf"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("google.protobuf.{}", Self::NAME) + } +} /// Encapsulates information about the original source file from which a /// FileDescriptorProto was generated. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1452,10 +2072,59 @@ pub mod generated_code_info { #[prost(int32, optional, tag = "3")] pub begin: ::core::option::Option, /// Identifies the ending offset in bytes in the generated code that - /// relates to the identified offset. The end offset should be one past + /// relates to the identified object. The end offset should be one past /// the last relevant byte (so the length of the text = end - begin). #[prost(int32, optional, tag = "4")] pub end: ::core::option::Option, + #[prost(enumeration = "annotation::Semantic", optional, tag = "5")] + pub semantic: ::core::option::Option, + } + /// Nested message and enum types in `Annotation`. + pub mod annotation { + /// Represents the identified object's effect on the element in the original + /// .proto file. + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum Semantic { + /// There is no effect or the effect is indescribable. + None = 0, + /// The element is set or otherwise mutated. + Set = 1, + /// An alias to the element is returned. + Alias = 2, + } + impl Semantic { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Semantic::None => "NONE", + Semantic::Set => "SET", + Semantic::Alias => "ALIAS", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "NONE" => Some(Self::None), + "SET" => Some(Self::Set), + "ALIAS" => Some(Self::Alias), + _ => None, + } + } + } } impl ::prost::Name for Annotation { const NAME: &'static str = "Annotation"; @@ -1472,6 +2141,64 @@ impl ::prost::Name for GeneratedCodeInfo { ::prost::alloc::format!("google.protobuf.{}", Self::NAME) } } +/// The full set of known editions. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum Edition { + /// A placeholder for an unknown edition value. + Unknown = 0, + /// Legacy syntax "editions". These pre-date editions, but behave much like + /// distinct editions. These can't be used to specify the edition of proto + /// files, but feature definitions must supply proto2/proto3 defaults for + /// backwards compatibility. + Proto2 = 998, + Proto3 = 999, + /// Editions that have been released. The specific values are arbitrary and + /// should not be depended on, but they will always be time-ordered for easy + /// comparison. + Edition2023 = 1000, + /// Placeholder editions for testing feature resolution. These should not be + /// used or relyed on outside of tests. + Edition1TestOnly = 1, + Edition2TestOnly = 2, + Edition99997TestOnly = 99997, + Edition99998TestOnly = 99998, + Edition99999TestOnly = 99999, +} +impl Edition { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + Edition::Unknown => "EDITION_UNKNOWN", + Edition::Proto2 => "EDITION_PROTO2", + Edition::Proto3 => "EDITION_PROTO3", + Edition::Edition2023 => "EDITION_2023", + Edition::Edition1TestOnly => "EDITION_1_TEST_ONLY", + Edition::Edition2TestOnly => "EDITION_2_TEST_ONLY", + Edition::Edition99997TestOnly => "EDITION_99997_TEST_ONLY", + Edition::Edition99998TestOnly => "EDITION_99998_TEST_ONLY", + Edition::Edition99999TestOnly => "EDITION_99999_TEST_ONLY", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "EDITION_UNKNOWN" => Some(Self::Unknown), + "EDITION_PROTO2" => Some(Self::Proto2), + "EDITION_PROTO3" => Some(Self::Proto3), + "EDITION_2023" => Some(Self::Edition2023), + "EDITION_1_TEST_ONLY" => Some(Self::Edition1TestOnly), + "EDITION_2_TEST_ONLY" => Some(Self::Edition2TestOnly), + "EDITION_99997_TEST_ONLY" => Some(Self::Edition99997TestOnly), + "EDITION_99998_TEST_ONLY" => Some(Self::Edition99998TestOnly), + "EDITION_99999_TEST_ONLY" => Some(Self::Edition99999TestOnly), + _ => None, + } + } +} /// A Timestamp represents a point in time independent of any time zone or local /// calendar, encoded as a count of seconds and fractions of seconds at /// nanosecond resolution. The count is relative to an epoch at UTC midnight on @@ -1522,7 +2249,6 @@ impl ::prost::Name for GeneratedCodeInfo { /// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) /// .setNanos((int) ((millis % 1000) * 1000000)).build(); /// -/// /// Example 5: Compute Timestamp from Java `Instant.now()`. /// /// Instant now = Instant.now(); @@ -1531,7 +2257,6 @@ impl ::prost::Name for GeneratedCodeInfo { /// Timestamp.newBuilder().setSeconds(now.getEpochSecond()) /// .setNanos(now.getNano()).build(); /// -/// /// Example 6: Compute Timestamp from current time in Python. /// /// timestamp = Timestamp() @@ -1561,10 +2286,9 @@ impl ::prost::Name for GeneratedCodeInfo { /// [`strftime`]() with /// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use /// the Joda Time's [`ISODateTimeFormat.dateTime()`]( -/// +/// ) /// ) to obtain a formatter capable of generating timestamps in this format. /// -/// #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Timestamp { @@ -1646,7 +2370,6 @@ impl ::prost::Name for Timestamp { /// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 /// microsecond should be expressed in JSON format as "3.000001s". /// -/// #[derive(Eq)] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/src/prost/google.protobuf.serde.rs b/src/prost/google.protobuf.serde.rs index a974819b..1467d307 100644 --- a/src/prost/google.protobuf.serde.rs +++ b/src/prost/google.protobuf.serde.rs @@ -712,6 +712,100 @@ impl<'de> serde::Deserialize<'de> for Duration { deserializer.deserialize_struct("google.protobuf.Duration", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for Edition { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unknown => "EDITION_UNKNOWN", + Self::Proto2 => "EDITION_PROTO2", + Self::Proto3 => "EDITION_PROTO3", + Self::Edition2023 => "EDITION_2023", + Self::Edition1TestOnly => "EDITION_1_TEST_ONLY", + Self::Edition2TestOnly => "EDITION_2_TEST_ONLY", + Self::Edition99997TestOnly => "EDITION_99997_TEST_ONLY", + Self::Edition99998TestOnly => "EDITION_99998_TEST_ONLY", + Self::Edition99999TestOnly => "EDITION_99999_TEST_ONLY", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for Edition { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "EDITION_UNKNOWN", + "EDITION_PROTO2", + "EDITION_PROTO3", + "EDITION_2023", + "EDITION_1_TEST_ONLY", + "EDITION_2_TEST_ONLY", + "EDITION_99997_TEST_ONLY", + "EDITION_99998_TEST_ONLY", + "EDITION_99999_TEST_ONLY", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Edition; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(Edition::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(Edition::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "EDITION_UNKNOWN" => Ok(Edition::Unknown), + "EDITION_PROTO2" => Ok(Edition::Proto2), + "EDITION_PROTO3" => Ok(Edition::Proto3), + "EDITION_2023" => Ok(Edition::Edition2023), + "EDITION_1_TEST_ONLY" => Ok(Edition::Edition1TestOnly), + "EDITION_2_TEST_ONLY" => Ok(Edition::Edition2TestOnly), + "EDITION_99997_TEST_ONLY" => Ok(Edition::Edition99997TestOnly), + "EDITION_99998_TEST_ONLY" => Ok(Edition::Edition99998TestOnly), + "EDITION_99999_TEST_ONLY" => Ok(Edition::Edition99999TestOnly), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} impl serde::Serialize for EnumDescriptorProto { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result @@ -1002,6 +1096,12 @@ impl serde::Serialize for EnumOptions { if true { len += 1; } + if true { + len += 1; + } + if true { + len += 1; + } let mut struct_ser = serializer.serialize_struct("google.protobuf.EnumOptions", len)?; if let Some(v) = self.allow_alias.as_ref() { struct_ser.serialize_field("allowAlias", v)?; @@ -1009,6 +1109,12 @@ impl serde::Serialize for EnumOptions { if let Some(v) = self.deprecated.as_ref() { struct_ser.serialize_field("deprecated", v)?; } + if let Some(v) = self.deprecated_legacy_json_field_conflicts.as_ref() { + struct_ser.serialize_field("deprecatedLegacyJsonFieldConflicts", v)?; + } + if let Some(v) = self.features.as_ref() { + struct_ser.serialize_field("features", v)?; + } if true { struct_ser.serialize_field("uninterpretedOption", &self.uninterpreted_option)?; } @@ -1025,6 +1131,9 @@ impl<'de> serde::Deserialize<'de> for EnumOptions { "allow_alias", "allowAlias", "deprecated", + "deprecated_legacy_json_field_conflicts", + "deprecatedLegacyJsonFieldConflicts", + "features", "uninterpreted_option", "uninterpretedOption", ]; @@ -1033,6 +1142,8 @@ impl<'de> serde::Deserialize<'de> for EnumOptions { enum GeneratedField { AllowAlias, Deprecated, + DeprecatedLegacyJsonFieldConflicts, + Features, UninterpretedOption, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -1057,6 +1168,8 @@ impl<'de> serde::Deserialize<'de> for EnumOptions { match value { "allowAlias" | "allow_alias" => Ok(GeneratedField::AllowAlias), "deprecated" => Ok(GeneratedField::Deprecated), + "deprecatedLegacyJsonFieldConflicts" | "deprecated_legacy_json_field_conflicts" => Ok(GeneratedField::DeprecatedLegacyJsonFieldConflicts), + "features" => Ok(GeneratedField::Features), "uninterpretedOption" | "uninterpreted_option" => Ok(GeneratedField::UninterpretedOption), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } @@ -1079,6 +1192,8 @@ impl<'de> serde::Deserialize<'de> for EnumOptions { { let mut allow_alias__ = None; let mut deprecated__ = None; + let mut deprecated_legacy_json_field_conflicts__ = None; + let mut features__ = None; let mut uninterpreted_option__ = None; while let Some(k) = map.next_key()? { match k { @@ -1094,6 +1209,18 @@ impl<'de> serde::Deserialize<'de> for EnumOptions { } deprecated__ = map.next_value()?; } + GeneratedField::DeprecatedLegacyJsonFieldConflicts => { + if deprecated_legacy_json_field_conflicts__.is_some() { + return Err(serde::de::Error::duplicate_field("deprecatedLegacyJsonFieldConflicts")); + } + deprecated_legacy_json_field_conflicts__ = map.next_value()?; + } + GeneratedField::Features => { + if features__.is_some() { + return Err(serde::de::Error::duplicate_field("features")); + } + features__ = map.next_value()?; + } GeneratedField::UninterpretedOption => { if uninterpreted_option__.is_some() { return Err(serde::de::Error::duplicate_field("uninterpretedOption")); @@ -1105,6 +1232,8 @@ impl<'de> serde::Deserialize<'de> for EnumOptions { Ok(EnumOptions { allow_alias: allow_alias__, deprecated: deprecated__, + deprecated_legacy_json_field_conflicts: deprecated_legacy_json_field_conflicts__, + features: features__, uninterpreted_option: uninterpreted_option__.unwrap_or_default(), }) } @@ -1253,10 +1382,22 @@ impl serde::Serialize for EnumValueOptions { if true { len += 1; } + if true { + len += 1; + } + if true { + len += 1; + } let mut struct_ser = serializer.serialize_struct("google.protobuf.EnumValueOptions", len)?; if let Some(v) = self.deprecated.as_ref() { struct_ser.serialize_field("deprecated", v)?; } + if let Some(v) = self.features.as_ref() { + struct_ser.serialize_field("features", v)?; + } + if let Some(v) = self.debug_redact.as_ref() { + struct_ser.serialize_field("debugRedact", v)?; + } if true { struct_ser.serialize_field("uninterpretedOption", &self.uninterpreted_option)?; } @@ -1271,6 +1412,9 @@ impl<'de> serde::Deserialize<'de> for EnumValueOptions { { const FIELDS: &[&str] = &[ "deprecated", + "features", + "debug_redact", + "debugRedact", "uninterpreted_option", "uninterpretedOption", ]; @@ -1278,6 +1422,8 @@ impl<'de> serde::Deserialize<'de> for EnumValueOptions { #[allow(clippy::enum_variant_names)] enum GeneratedField { Deprecated, + Features, + DebugRedact, UninterpretedOption, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -1301,6 +1447,8 @@ impl<'de> serde::Deserialize<'de> for EnumValueOptions { { match value { "deprecated" => Ok(GeneratedField::Deprecated), + "features" => Ok(GeneratedField::Features), + "debugRedact" | "debug_redact" => Ok(GeneratedField::DebugRedact), "uninterpretedOption" | "uninterpreted_option" => Ok(GeneratedField::UninterpretedOption), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } @@ -1322,6 +1470,8 @@ impl<'de> serde::Deserialize<'de> for EnumValueOptions { V: serde::de::MapAccess<'de>, { let mut deprecated__ = None; + let mut features__ = None; + let mut debug_redact__ = None; let mut uninterpreted_option__ = None; while let Some(k) = map.next_key()? { match k { @@ -1331,6 +1481,18 @@ impl<'de> serde::Deserialize<'de> for EnumValueOptions { } deprecated__ = map.next_value()?; } + GeneratedField::Features => { + if features__.is_some() { + return Err(serde::de::Error::duplicate_field("features")); + } + features__ = map.next_value()?; + } + GeneratedField::DebugRedact => { + if debug_redact__.is_some() { + return Err(serde::de::Error::duplicate_field("debugRedact")); + } + debug_redact__ = map.next_value()?; + } GeneratedField::UninterpretedOption => { if uninterpreted_option__.is_some() { return Err(serde::de::Error::duplicate_field("uninterpretedOption")); @@ -1341,6 +1503,8 @@ impl<'de> serde::Deserialize<'de> for EnumValueOptions { } Ok(EnumValueOptions { deprecated: deprecated__, + features: features__, + debug_redact: debug_redact__, uninterpreted_option: uninterpreted_option__.unwrap_or_default(), }) } @@ -1359,10 +1523,30 @@ impl serde::Serialize for ExtensionRangeOptions { if true { len += 1; } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } let mut struct_ser = serializer.serialize_struct("google.protobuf.ExtensionRangeOptions", len)?; if true { struct_ser.serialize_field("uninterpretedOption", &self.uninterpreted_option)?; } + if true { + struct_ser.serialize_field("declaration", &self.declaration)?; + } + if let Some(v) = self.features.as_ref() { + struct_ser.serialize_field("features", v)?; + } + if let Some(v) = self.verification.as_ref() { + let v = extension_range_options::VerificationState::from_i32(*v) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("verification", &v)?; + } struct_ser.end() } } @@ -1375,11 +1559,17 @@ impl<'de> serde::Deserialize<'de> for ExtensionRangeOptions { const FIELDS: &[&str] = &[ "uninterpreted_option", "uninterpretedOption", + "declaration", + "features", + "verification", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { UninterpretedOption, + Declaration, + Features, + Verification, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> core::result::Result @@ -1402,6 +1592,9 @@ impl<'de> serde::Deserialize<'de> for ExtensionRangeOptions { { match value { "uninterpretedOption" | "uninterpreted_option" => Ok(GeneratedField::UninterpretedOption), + "declaration" => Ok(GeneratedField::Declaration), + "features" => Ok(GeneratedField::Features), + "verification" => Ok(GeneratedField::Verification), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1422,6 +1615,9 @@ impl<'de> serde::Deserialize<'de> for ExtensionRangeOptions { V: serde::de::MapAccess<'de>, { let mut uninterpreted_option__ = None; + let mut declaration__ = None; + let mut features__ = None; + let mut verification__ = None; while let Some(k) = map.next_key()? { match k { GeneratedField::UninterpretedOption => { @@ -1430,17 +1626,38 @@ impl<'de> serde::Deserialize<'de> for ExtensionRangeOptions { } uninterpreted_option__ = Some(map.next_value()?); } + GeneratedField::Declaration => { + if declaration__.is_some() { + return Err(serde::de::Error::duplicate_field("declaration")); + } + declaration__ = Some(map.next_value()?); + } + GeneratedField::Features => { + if features__.is_some() { + return Err(serde::de::Error::duplicate_field("features")); + } + features__ = map.next_value()?; + } + GeneratedField::Verification => { + if verification__.is_some() { + return Err(serde::de::Error::duplicate_field("verification")); + } + verification__ = map.next_value::<::core::option::Option>()?.map(|x| x as i32); + } } } Ok(ExtensionRangeOptions { uninterpreted_option: uninterpreted_option__.unwrap_or_default(), + declaration: declaration__.unwrap_or_default(), + features: features__, + verification: verification__, }) } } deserializer.deserialize_struct("google.protobuf.ExtensionRangeOptions", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for FieldDescriptorProto { +impl serde::Serialize for extension_range_options::Declaration { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result where @@ -1463,103 +1680,47 @@ impl serde::Serialize for FieldDescriptorProto { if true { len += 1; } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("google.protobuf.FieldDescriptorProto", len)?; - if let Some(v) = self.name.as_ref() { - struct_ser.serialize_field("name", v)?; - } + let mut struct_ser = serializer.serialize_struct("google.protobuf.ExtensionRangeOptions.Declaration", len)?; if let Some(v) = self.number.as_ref() { struct_ser.serialize_field("number", v)?; } - if let Some(v) = self.label.as_ref() { - let v = field_descriptor_proto::Label::from_i32(*v) - .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; - struct_ser.serialize_field("label", &v)?; + if let Some(v) = self.full_name.as_ref() { + struct_ser.serialize_field("fullName", v)?; } if let Some(v) = self.r#type.as_ref() { - let v = field_descriptor_proto::Type::from_i32(*v) - .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; - struct_ser.serialize_field("type", &v)?; - } - if let Some(v) = self.type_name.as_ref() { - struct_ser.serialize_field("typeName", v)?; - } - if let Some(v) = self.extendee.as_ref() { - struct_ser.serialize_field("extendee", v)?; - } - if let Some(v) = self.default_value.as_ref() { - struct_ser.serialize_field("defaultValue", v)?; - } - if let Some(v) = self.oneof_index.as_ref() { - struct_ser.serialize_field("oneofIndex", v)?; + struct_ser.serialize_field("type", v)?; } - if let Some(v) = self.json_name.as_ref() { - struct_ser.serialize_field("jsonName", v)?; - } - if let Some(v) = self.options.as_ref() { - struct_ser.serialize_field("options", v)?; + if let Some(v) = self.reserved.as_ref() { + struct_ser.serialize_field("reserved", v)?; } - if let Some(v) = self.proto3_optional.as_ref() { - struct_ser.serialize_field("proto3Optional", v)?; + if let Some(v) = self.repeated.as_ref() { + struct_ser.serialize_field("repeated", v)?; } struct_ser.end() } } -impl<'de> serde::Deserialize<'de> for FieldDescriptorProto { +impl<'de> serde::Deserialize<'de> for extension_range_options::Declaration { #[allow(deprecated)] fn deserialize(deserializer: D) -> core::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "name", "number", - "label", + "full_name", + "fullName", "type", - "type_name", - "typeName", - "extendee", - "default_value", - "defaultValue", - "oneof_index", - "oneofIndex", - "json_name", - "jsonName", - "options", - "proto3_optional", - "proto3Optional", + "reserved", + "repeated", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Name, Number, - Label, + FullName, Type, - TypeName, - Extendee, - DefaultValue, - OneofIndex, - JsonName, - Options, - Proto3Optional, + Reserved, + Repeated, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> core::result::Result @@ -1581,17 +1742,11 @@ impl<'de> serde::Deserialize<'de> for FieldDescriptorProto { E: serde::de::Error, { match value { - "name" => Ok(GeneratedField::Name), "number" => Ok(GeneratedField::Number), - "label" => Ok(GeneratedField::Label), + "fullName" | "full_name" => Ok(GeneratedField::FullName), "type" => Ok(GeneratedField::Type), - "typeName" | "type_name" => Ok(GeneratedField::TypeName), - "extendee" => Ok(GeneratedField::Extendee), - "defaultValue" | "default_value" => Ok(GeneratedField::DefaultValue), - "oneofIndex" | "oneof_index" => Ok(GeneratedField::OneofIndex), - "jsonName" | "json_name" => Ok(GeneratedField::JsonName), - "options" => Ok(GeneratedField::Options), - "proto3Optional" | "proto3_optional" => Ok(GeneratedField::Proto3Optional), + "reserved" => Ok(GeneratedField::Reserved), + "repeated" => Ok(GeneratedField::Repeated), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1601,35 +1756,23 @@ impl<'de> serde::Deserialize<'de> for FieldDescriptorProto { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = FieldDescriptorProto; + type Value = extension_range_options::Declaration; fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct google.protobuf.FieldDescriptorProto") + formatter.write_str("struct google.protobuf.ExtensionRangeOptions.Declaration") } - fn visit_map(self, mut map: V) -> core::result::Result + fn visit_map(self, mut map: V) -> core::result::Result where V: serde::de::MapAccess<'de>, { - let mut name__ = None; let mut number__ = None; - let mut label__ = None; + let mut full_name__ = None; let mut r#type__ = None; - let mut type_name__ = None; - let mut extendee__ = None; - let mut default_value__ = None; - let mut oneof_index__ = None; - let mut json_name__ = None; - let mut options__ = None; - let mut proto3_optional__ = None; + let mut reserved__ = None; + let mut repeated__ = None; while let Some(k) = map.next_key()? { match k { - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = map.next_value()?; - } GeneratedField::Number => { if number__.is_some() { return Err(serde::de::Error::duplicate_field("number")); @@ -1638,71 +1781,1274 @@ impl<'de> serde::Deserialize<'de> for FieldDescriptorProto { map.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) ; } - GeneratedField::Label => { - if label__.is_some() { - return Err(serde::de::Error::duplicate_field("label")); + GeneratedField::FullName => { + if full_name__.is_some() { + return Err(serde::de::Error::duplicate_field("fullName")); } - label__ = map.next_value::<::core::option::Option>()?.map(|x| x as i32); + full_name__ = map.next_value()?; } GeneratedField::Type => { if r#type__.is_some() { return Err(serde::de::Error::duplicate_field("type")); } - r#type__ = map.next_value::<::core::option::Option>()?.map(|x| x as i32); - } - GeneratedField::TypeName => { - if type_name__.is_some() { - return Err(serde::de::Error::duplicate_field("typeName")); - } - type_name__ = map.next_value()?; - } - GeneratedField::Extendee => { - if extendee__.is_some() { - return Err(serde::de::Error::duplicate_field("extendee")); - } - extendee__ = map.next_value()?; - } - GeneratedField::DefaultValue => { - if default_value__.is_some() { - return Err(serde::de::Error::duplicate_field("defaultValue")); - } - default_value__ = map.next_value()?; - } - GeneratedField::OneofIndex => { - if oneof_index__.is_some() { - return Err(serde::de::Error::duplicate_field("oneofIndex")); - } - oneof_index__ = - map.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) - ; - } - GeneratedField::JsonName => { - if json_name__.is_some() { - return Err(serde::de::Error::duplicate_field("jsonName")); - } - json_name__ = map.next_value()?; + r#type__ = map.next_value()?; } - GeneratedField::Options => { - if options__.is_some() { - return Err(serde::de::Error::duplicate_field("options")); + GeneratedField::Reserved => { + if reserved__.is_some() { + return Err(serde::de::Error::duplicate_field("reserved")); } - options__ = map.next_value()?; + reserved__ = map.next_value()?; } - GeneratedField::Proto3Optional => { - if proto3_optional__.is_some() { - return Err(serde::de::Error::duplicate_field("proto3Optional")); + GeneratedField::Repeated => { + if repeated__.is_some() { + return Err(serde::de::Error::duplicate_field("repeated")); } - proto3_optional__ = map.next_value()?; + repeated__ = map.next_value()?; } } } - Ok(FieldDescriptorProto { - name: name__, + Ok(extension_range_options::Declaration { number: number__, - label: label__, + full_name: full_name__, r#type: r#type__, - type_name: type_name__, - extendee: extendee__, + reserved: reserved__, + repeated: repeated__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.ExtensionRangeOptions.Declaration", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for extension_range_options::VerificationState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Declaration => "DECLARATION", + Self::Unverified => "UNVERIFIED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for extension_range_options::VerificationState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "DECLARATION", + "UNVERIFIED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = extension_range_options::VerificationState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(extension_range_options::VerificationState::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(extension_range_options::VerificationState::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "DECLARATION" => Ok(extension_range_options::VerificationState::Declaration), + "UNVERIFIED" => Ok(extension_range_options::VerificationState::Unverified), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for FeatureSet { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.FeatureSet", len)?; + if let Some(v) = self.field_presence.as_ref() { + let v = feature_set::FieldPresence::from_i32(*v) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("fieldPresence", &v)?; + } + if let Some(v) = self.enum_type.as_ref() { + let v = feature_set::EnumType::from_i32(*v) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("enumType", &v)?; + } + if let Some(v) = self.repeated_field_encoding.as_ref() { + let v = feature_set::RepeatedFieldEncoding::from_i32(*v) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("repeatedFieldEncoding", &v)?; + } + if let Some(v) = self.utf8_validation.as_ref() { + let v = feature_set::Utf8Validation::from_i32(*v) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("utf8Validation", &v)?; + } + if let Some(v) = self.message_encoding.as_ref() { + let v = feature_set::MessageEncoding::from_i32(*v) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("messageEncoding", &v)?; + } + if let Some(v) = self.json_format.as_ref() { + let v = feature_set::JsonFormat::from_i32(*v) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("jsonFormat", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for FeatureSet { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "field_presence", + "fieldPresence", + "enum_type", + "enumType", + "repeated_field_encoding", + "repeatedFieldEncoding", + "utf8_validation", + "utf8Validation", + "message_encoding", + "messageEncoding", + "json_format", + "jsonFormat", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + FieldPresence, + EnumType, + RepeatedFieldEncoding, + Utf8Validation, + MessageEncoding, + JsonFormat, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "fieldPresence" | "field_presence" => Ok(GeneratedField::FieldPresence), + "enumType" | "enum_type" => Ok(GeneratedField::EnumType), + "repeatedFieldEncoding" | "repeated_field_encoding" => Ok(GeneratedField::RepeatedFieldEncoding), + "utf8Validation" | "utf8_validation" => Ok(GeneratedField::Utf8Validation), + "messageEncoding" | "message_encoding" => Ok(GeneratedField::MessageEncoding), + "jsonFormat" | "json_format" => Ok(GeneratedField::JsonFormat), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = FeatureSet; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.FeatureSet") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut field_presence__ = None; + let mut enum_type__ = None; + let mut repeated_field_encoding__ = None; + let mut utf8_validation__ = None; + let mut message_encoding__ = None; + let mut json_format__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::FieldPresence => { + if field_presence__.is_some() { + return Err(serde::de::Error::duplicate_field("fieldPresence")); + } + field_presence__ = map.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::EnumType => { + if enum_type__.is_some() { + return Err(serde::de::Error::duplicate_field("enumType")); + } + enum_type__ = map.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::RepeatedFieldEncoding => { + if repeated_field_encoding__.is_some() { + return Err(serde::de::Error::duplicate_field("repeatedFieldEncoding")); + } + repeated_field_encoding__ = map.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::Utf8Validation => { + if utf8_validation__.is_some() { + return Err(serde::de::Error::duplicate_field("utf8Validation")); + } + utf8_validation__ = map.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::MessageEncoding => { + if message_encoding__.is_some() { + return Err(serde::de::Error::duplicate_field("messageEncoding")); + } + message_encoding__ = map.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::JsonFormat => { + if json_format__.is_some() { + return Err(serde::de::Error::duplicate_field("jsonFormat")); + } + json_format__ = map.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + } + } + Ok(FeatureSet { + field_presence: field_presence__, + enum_type: enum_type__, + repeated_field_encoding: repeated_field_encoding__, + utf8_validation: utf8_validation__, + message_encoding: message_encoding__, + json_format: json_format__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.FeatureSet", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for feature_set::EnumType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unknown => "ENUM_TYPE_UNKNOWN", + Self::Open => "OPEN", + Self::Closed => "CLOSED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for feature_set::EnumType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "ENUM_TYPE_UNKNOWN", + "OPEN", + "CLOSED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = feature_set::EnumType; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(feature_set::EnumType::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(feature_set::EnumType::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "ENUM_TYPE_UNKNOWN" => Ok(feature_set::EnumType::Unknown), + "OPEN" => Ok(feature_set::EnumType::Open), + "CLOSED" => Ok(feature_set::EnumType::Closed), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for feature_set::FieldPresence { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unknown => "FIELD_PRESENCE_UNKNOWN", + Self::Explicit => "EXPLICIT", + Self::Implicit => "IMPLICIT", + Self::LegacyRequired => "LEGACY_REQUIRED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for feature_set::FieldPresence { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "FIELD_PRESENCE_UNKNOWN", + "EXPLICIT", + "IMPLICIT", + "LEGACY_REQUIRED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = feature_set::FieldPresence; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(feature_set::FieldPresence::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(feature_set::FieldPresence::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "FIELD_PRESENCE_UNKNOWN" => Ok(feature_set::FieldPresence::Unknown), + "EXPLICIT" => Ok(feature_set::FieldPresence::Explicit), + "IMPLICIT" => Ok(feature_set::FieldPresence::Implicit), + "LEGACY_REQUIRED" => Ok(feature_set::FieldPresence::LegacyRequired), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for feature_set::JsonFormat { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unknown => "JSON_FORMAT_UNKNOWN", + Self::Allow => "ALLOW", + Self::LegacyBestEffort => "LEGACY_BEST_EFFORT", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for feature_set::JsonFormat { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "JSON_FORMAT_UNKNOWN", + "ALLOW", + "LEGACY_BEST_EFFORT", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = feature_set::JsonFormat; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(feature_set::JsonFormat::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(feature_set::JsonFormat::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "JSON_FORMAT_UNKNOWN" => Ok(feature_set::JsonFormat::Unknown), + "ALLOW" => Ok(feature_set::JsonFormat::Allow), + "LEGACY_BEST_EFFORT" => Ok(feature_set::JsonFormat::LegacyBestEffort), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for feature_set::MessageEncoding { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unknown => "MESSAGE_ENCODING_UNKNOWN", + Self::LengthPrefixed => "LENGTH_PREFIXED", + Self::Delimited => "DELIMITED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for feature_set::MessageEncoding { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "MESSAGE_ENCODING_UNKNOWN", + "LENGTH_PREFIXED", + "DELIMITED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = feature_set::MessageEncoding; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(feature_set::MessageEncoding::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(feature_set::MessageEncoding::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "MESSAGE_ENCODING_UNKNOWN" => Ok(feature_set::MessageEncoding::Unknown), + "LENGTH_PREFIXED" => Ok(feature_set::MessageEncoding::LengthPrefixed), + "DELIMITED" => Ok(feature_set::MessageEncoding::Delimited), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for feature_set::RepeatedFieldEncoding { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unknown => "REPEATED_FIELD_ENCODING_UNKNOWN", + Self::Packed => "PACKED", + Self::Expanded => "EXPANDED", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for feature_set::RepeatedFieldEncoding { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "REPEATED_FIELD_ENCODING_UNKNOWN", + "PACKED", + "EXPANDED", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = feature_set::RepeatedFieldEncoding; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(feature_set::RepeatedFieldEncoding::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(feature_set::RepeatedFieldEncoding::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "REPEATED_FIELD_ENCODING_UNKNOWN" => Ok(feature_set::RepeatedFieldEncoding::Unknown), + "PACKED" => Ok(feature_set::RepeatedFieldEncoding::Packed), + "EXPANDED" => Ok(feature_set::RepeatedFieldEncoding::Expanded), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for feature_set::Utf8Validation { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unknown => "UTF8_VALIDATION_UNKNOWN", + Self::None => "NONE", + Self::Verify => "VERIFY", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for feature_set::Utf8Validation { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "UTF8_VALIDATION_UNKNOWN", + "NONE", + "VERIFY", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = feature_set::Utf8Validation; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(feature_set::Utf8Validation::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(feature_set::Utf8Validation::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "UTF8_VALIDATION_UNKNOWN" => Ok(feature_set::Utf8Validation::Unknown), + "NONE" => Ok(feature_set::Utf8Validation::None), + "VERIFY" => Ok(feature_set::Utf8Validation::Verify), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for FeatureSetDefaults { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.FeatureSetDefaults", len)?; + if true { + struct_ser.serialize_field("defaults", &self.defaults)?; + } + if let Some(v) = self.minimum_edition.as_ref() { + let v = Edition::from_i32(*v) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("minimumEdition", &v)?; + } + if let Some(v) = self.maximum_edition.as_ref() { + let v = Edition::from_i32(*v) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("maximumEdition", &v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for FeatureSetDefaults { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "defaults", + "minimum_edition", + "minimumEdition", + "maximum_edition", + "maximumEdition", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Defaults, + MinimumEdition, + MaximumEdition, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "defaults" => Ok(GeneratedField::Defaults), + "minimumEdition" | "minimum_edition" => Ok(GeneratedField::MinimumEdition), + "maximumEdition" | "maximum_edition" => Ok(GeneratedField::MaximumEdition), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = FeatureSetDefaults; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.FeatureSetDefaults") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut defaults__ = None; + let mut minimum_edition__ = None; + let mut maximum_edition__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::Defaults => { + if defaults__.is_some() { + return Err(serde::de::Error::duplicate_field("defaults")); + } + defaults__ = Some(map.next_value()?); + } + GeneratedField::MinimumEdition => { + if minimum_edition__.is_some() { + return Err(serde::de::Error::duplicate_field("minimumEdition")); + } + minimum_edition__ = map.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::MaximumEdition => { + if maximum_edition__.is_some() { + return Err(serde::de::Error::duplicate_field("maximumEdition")); + } + maximum_edition__ = map.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + } + } + Ok(FeatureSetDefaults { + defaults: defaults__.unwrap_or_default(), + minimum_edition: minimum_edition__, + maximum_edition: maximum_edition__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.FeatureSetDefaults", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for feature_set_defaults::FeatureSetEditionDefault { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault", len)?; + if let Some(v) = self.edition.as_ref() { + let v = Edition::from_i32(*v) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("edition", &v)?; + } + if let Some(v) = self.features.as_ref() { + struct_ser.serialize_field("features", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for feature_set_defaults::FeatureSetEditionDefault { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "edition", + "features", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Edition, + Features, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "edition" => Ok(GeneratedField::Edition), + "features" => Ok(GeneratedField::Features), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = feature_set_defaults::FeatureSetEditionDefault; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut edition__ = None; + let mut features__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::Edition => { + if edition__.is_some() { + return Err(serde::de::Error::duplicate_field("edition")); + } + edition__ = map.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::Features => { + if features__.is_some() { + return Err(serde::de::Error::duplicate_field("features")); + } + features__ = map.next_value()?; + } + } + } + Ok(feature_set_defaults::FeatureSetEditionDefault { + edition: edition__, + features: features__, + }) + } + } + deserializer.deserialize_struct("google.protobuf.FeatureSetDefaults.FeatureSetEditionDefault", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for FieldDescriptorProto { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.FieldDescriptorProto", len)?; + if let Some(v) = self.name.as_ref() { + struct_ser.serialize_field("name", v)?; + } + if let Some(v) = self.number.as_ref() { + struct_ser.serialize_field("number", v)?; + } + if let Some(v) = self.label.as_ref() { + let v = field_descriptor_proto::Label::from_i32(*v) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("label", &v)?; + } + if let Some(v) = self.r#type.as_ref() { + let v = field_descriptor_proto::Type::from_i32(*v) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("type", &v)?; + } + if let Some(v) = self.type_name.as_ref() { + struct_ser.serialize_field("typeName", v)?; + } + if let Some(v) = self.extendee.as_ref() { + struct_ser.serialize_field("extendee", v)?; + } + if let Some(v) = self.default_value.as_ref() { + struct_ser.serialize_field("defaultValue", v)?; + } + if let Some(v) = self.oneof_index.as_ref() { + struct_ser.serialize_field("oneofIndex", v)?; + } + if let Some(v) = self.json_name.as_ref() { + struct_ser.serialize_field("jsonName", v)?; + } + if let Some(v) = self.options.as_ref() { + struct_ser.serialize_field("options", v)?; + } + if let Some(v) = self.proto3_optional.as_ref() { + struct_ser.serialize_field("proto3Optional", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for FieldDescriptorProto { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "name", + "number", + "label", + "type", + "type_name", + "typeName", + "extendee", + "default_value", + "defaultValue", + "oneof_index", + "oneofIndex", + "json_name", + "jsonName", + "options", + "proto3_optional", + "proto3Optional", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Number, + Label, + Type, + TypeName, + Extendee, + DefaultValue, + OneofIndex, + JsonName, + Options, + Proto3Optional, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "name" => Ok(GeneratedField::Name), + "number" => Ok(GeneratedField::Number), + "label" => Ok(GeneratedField::Label), + "type" => Ok(GeneratedField::Type), + "typeName" | "type_name" => Ok(GeneratedField::TypeName), + "extendee" => Ok(GeneratedField::Extendee), + "defaultValue" | "default_value" => Ok(GeneratedField::DefaultValue), + "oneofIndex" | "oneof_index" => Ok(GeneratedField::OneofIndex), + "jsonName" | "json_name" => Ok(GeneratedField::JsonName), + "options" => Ok(GeneratedField::Options), + "proto3Optional" | "proto3_optional" => Ok(GeneratedField::Proto3Optional), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = FieldDescriptorProto; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.FieldDescriptorProto") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut number__ = None; + let mut label__ = None; + let mut r#type__ = None; + let mut type_name__ = None; + let mut extendee__ = None; + let mut default_value__ = None; + let mut oneof_index__ = None; + let mut json_name__ = None; + let mut options__ = None; + let mut proto3_optional__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = map.next_value()?; + } + GeneratedField::Number => { + if number__.is_some() { + return Err(serde::de::Error::duplicate_field("number")); + } + number__ = + map.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::Label => { + if label__.is_some() { + return Err(serde::de::Error::duplicate_field("label")); + } + label__ = map.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::Type => { + if r#type__.is_some() { + return Err(serde::de::Error::duplicate_field("type")); + } + r#type__ = map.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::TypeName => { + if type_name__.is_some() { + return Err(serde::de::Error::duplicate_field("typeName")); + } + type_name__ = map.next_value()?; + } + GeneratedField::Extendee => { + if extendee__.is_some() { + return Err(serde::de::Error::duplicate_field("extendee")); + } + extendee__ = map.next_value()?; + } + GeneratedField::DefaultValue => { + if default_value__.is_some() { + return Err(serde::de::Error::duplicate_field("defaultValue")); + } + default_value__ = map.next_value()?; + } + GeneratedField::OneofIndex => { + if oneof_index__.is_some() { + return Err(serde::de::Error::duplicate_field("oneofIndex")); + } + oneof_index__ = + map.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) + ; + } + GeneratedField::JsonName => { + if json_name__.is_some() { + return Err(serde::de::Error::duplicate_field("jsonName")); + } + json_name__ = map.next_value()?; + } + GeneratedField::Options => { + if options__.is_some() { + return Err(serde::de::Error::duplicate_field("options")); + } + options__ = map.next_value()?; + } + GeneratedField::Proto3Optional => { + if proto3_optional__.is_some() { + return Err(serde::de::Error::duplicate_field("proto3Optional")); + } + proto3_optional__ = map.next_value()?; + } + } + } + Ok(FieldDescriptorProto { + name: name__, + number: number__, + label: label__, + r#type: r#type__, + type_name: type_name__, + extendee: extendee__, default_value: default_value__, oneof_index: oneof_index__, json_name: json_name__, @@ -1722,8 +3068,8 @@ impl serde::Serialize for field_descriptor_proto::Label { { let variant = match self { Self::Optional => "LABEL_OPTIONAL", - Self::Required => "LABEL_REQUIRED", Self::Repeated => "LABEL_REPEATED", + Self::Required => "LABEL_REQUIRED", }; serializer.serialize_str(variant) } @@ -1736,8 +3082,8 @@ impl<'de> serde::Deserialize<'de> for field_descriptor_proto::Label { { const FIELDS: &[&str] = &[ "LABEL_OPTIONAL", - "LABEL_REQUIRED", "LABEL_REPEATED", + "LABEL_REQUIRED", ]; struct GeneratedVisitor; @@ -1781,8 +3127,8 @@ impl<'de> serde::Deserialize<'de> for field_descriptor_proto::Label { { match value { "LABEL_OPTIONAL" => Ok(field_descriptor_proto::Label::Optional), - "LABEL_REQUIRED" => Ok(field_descriptor_proto::Label::Required), "LABEL_REPEATED" => Ok(field_descriptor_proto::Label::Repeated), + "LABEL_REQUIRED" => Ok(field_descriptor_proto::Label::Required), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } } @@ -1943,6 +3289,21 @@ impl serde::Serialize for FieldOptions { if true { len += 1; } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } let mut struct_ser = serializer.serialize_struct("google.protobuf.FieldOptions", len)?; if let Some(v) = self.ctype.as_ref() { let v = field_options::CType::from_i32(*v) @@ -1969,6 +3330,27 @@ impl serde::Serialize for FieldOptions { if let Some(v) = self.weak.as_ref() { struct_ser.serialize_field("weak", v)?; } + if let Some(v) = self.debug_redact.as_ref() { + struct_ser.serialize_field("debugRedact", v)?; + } + if let Some(v) = self.retention.as_ref() { + let v = field_options::OptionRetention::from_i32(*v) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("retention", &v)?; + } + if true { + let v = self.targets.iter().cloned().map(|v| { + field_options::OptionTargetType::from_i32(v) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", v))) + }).collect::, _>>()?; + struct_ser.serialize_field("targets", &v)?; + } + if true { + struct_ser.serialize_field("editionDefaults", &self.edition_defaults)?; + } + if let Some(v) = self.features.as_ref() { + struct_ser.serialize_field("features", v)?; + } if true { struct_ser.serialize_field("uninterpretedOption", &self.uninterpreted_option)?; } @@ -1990,6 +3372,13 @@ impl<'de> serde::Deserialize<'de> for FieldOptions { "unverifiedLazy", "deprecated", "weak", + "debug_redact", + "debugRedact", + "retention", + "targets", + "edition_defaults", + "editionDefaults", + "features", "uninterpreted_option", "uninterpretedOption", ]; @@ -2003,6 +3392,11 @@ impl<'de> serde::Deserialize<'de> for FieldOptions { UnverifiedLazy, Deprecated, Weak, + DebugRedact, + Retention, + Targets, + EditionDefaults, + Features, UninterpretedOption, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -2032,6 +3426,11 @@ impl<'de> serde::Deserialize<'de> for FieldOptions { "unverifiedLazy" | "unverified_lazy" => Ok(GeneratedField::UnverifiedLazy), "deprecated" => Ok(GeneratedField::Deprecated), "weak" => Ok(GeneratedField::Weak), + "debugRedact" | "debug_redact" => Ok(GeneratedField::DebugRedact), + "retention" => Ok(GeneratedField::Retention), + "targets" => Ok(GeneratedField::Targets), + "editionDefaults" | "edition_defaults" => Ok(GeneratedField::EditionDefaults), + "features" => Ok(GeneratedField::Features), "uninterpretedOption" | "uninterpreted_option" => Ok(GeneratedField::UninterpretedOption), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } @@ -2059,6 +3458,11 @@ impl<'de> serde::Deserialize<'de> for FieldOptions { let mut unverified_lazy__ = None; let mut deprecated__ = None; let mut weak__ = None; + let mut debug_redact__ = None; + let mut retention__ = None; + let mut targets__ = None; + let mut edition_defaults__ = None; + let mut features__ = None; let mut uninterpreted_option__ = None; while let Some(k) = map.next_key()? { match k { @@ -2098,65 +3502,286 @@ impl<'de> serde::Deserialize<'de> for FieldOptions { } deprecated__ = map.next_value()?; } - GeneratedField::Weak => { - if weak__.is_some() { - return Err(serde::de::Error::duplicate_field("weak")); + GeneratedField::Weak => { + if weak__.is_some() { + return Err(serde::de::Error::duplicate_field("weak")); + } + weak__ = map.next_value()?; + } + GeneratedField::DebugRedact => { + if debug_redact__.is_some() { + return Err(serde::de::Error::duplicate_field("debugRedact")); + } + debug_redact__ = map.next_value()?; + } + GeneratedField::Retention => { + if retention__.is_some() { + return Err(serde::de::Error::duplicate_field("retention")); + } + retention__ = map.next_value::<::core::option::Option>()?.map(|x| x as i32); + } + GeneratedField::Targets => { + if targets__.is_some() { + return Err(serde::de::Error::duplicate_field("targets")); + } + targets__ = Some(map.next_value::<::alloc::vec::Vec>()?.into_iter().map(|x| x as i32).collect()); + } + GeneratedField::EditionDefaults => { + if edition_defaults__.is_some() { + return Err(serde::de::Error::duplicate_field("editionDefaults")); + } + edition_defaults__ = Some(map.next_value()?); + } + GeneratedField::Features => { + if features__.is_some() { + return Err(serde::de::Error::duplicate_field("features")); + } + features__ = map.next_value()?; + } + GeneratedField::UninterpretedOption => { + if uninterpreted_option__.is_some() { + return Err(serde::de::Error::duplicate_field("uninterpretedOption")); + } + uninterpreted_option__ = Some(map.next_value()?); + } + } + } + Ok(FieldOptions { + ctype: ctype__, + packed: packed__, + jstype: jstype__, + lazy: lazy__, + unverified_lazy: unverified_lazy__, + deprecated: deprecated__, + weak: weak__, + debug_redact: debug_redact__, + retention: retention__, + targets: targets__.unwrap_or_default(), + edition_defaults: edition_defaults__.unwrap_or_default(), + features: features__, + uninterpreted_option: uninterpreted_option__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("google.protobuf.FieldOptions", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for field_options::CType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::String => "STRING", + Self::Cord => "CORD", + Self::StringPiece => "STRING_PIECE", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for field_options::CType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "STRING", + "CORD", + "STRING_PIECE", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = field_options::CType; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(field_options::CType::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(field_options::CType::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "STRING" => Ok(field_options::CType::String), + "CORD" => Ok(field_options::CType::Cord), + "STRING_PIECE" => Ok(field_options::CType::StringPiece), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for field_options::EditionDefault { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("google.protobuf.FieldOptions.EditionDefault", len)?; + if let Some(v) = self.edition.as_ref() { + let v = Edition::from_i32(*v) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("edition", &v)?; + } + if let Some(v) = self.value.as_ref() { + struct_ser.serialize_field("value", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for field_options::EditionDefault { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "edition", + "value", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Edition, + Value, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "edition" => Ok(GeneratedField::Edition), + "value" => Ok(GeneratedField::Value), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = field_options::EditionDefault; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct google.protobuf.FieldOptions.EditionDefault") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut edition__ = None; + let mut value__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::Edition => { + if edition__.is_some() { + return Err(serde::de::Error::duplicate_field("edition")); } - weak__ = map.next_value()?; + edition__ = map.next_value::<::core::option::Option>()?.map(|x| x as i32); } - GeneratedField::UninterpretedOption => { - if uninterpreted_option__.is_some() { - return Err(serde::de::Error::duplicate_field("uninterpretedOption")); + GeneratedField::Value => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("value")); } - uninterpreted_option__ = Some(map.next_value()?); + value__ = map.next_value()?; } } } - Ok(FieldOptions { - ctype: ctype__, - packed: packed__, - jstype: jstype__, - lazy: lazy__, - unverified_lazy: unverified_lazy__, - deprecated: deprecated__, - weak: weak__, - uninterpreted_option: uninterpreted_option__.unwrap_or_default(), + Ok(field_options::EditionDefault { + edition: edition__, + value: value__, }) } } - deserializer.deserialize_struct("google.protobuf.FieldOptions", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("google.protobuf.FieldOptions.EditionDefault", FIELDS, GeneratedVisitor) } } -impl serde::Serialize for field_options::CType { +impl serde::Serialize for field_options::JsType { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result where S: serde::Serializer, { let variant = match self { - Self::String => "STRING", - Self::Cord => "CORD", - Self::StringPiece => "STRING_PIECE", + Self::JsNormal => "JS_NORMAL", + Self::JsString => "JS_STRING", + Self::JsNumber => "JS_NUMBER", }; serializer.serialize_str(variant) } } -impl<'de> serde::Deserialize<'de> for field_options::CType { +impl<'de> serde::Deserialize<'de> for field_options::JsType { #[allow(deprecated)] fn deserialize(deserializer: D) -> core::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "STRING", - "CORD", - "STRING_PIECE", + "JS_NORMAL", + "JS_STRING", + "JS_NUMBER", ]; struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = field_options::CType; + type Value = field_options::JsType; fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(formatter, "expected one of: {:?}", &FIELDS) @@ -2169,7 +3794,7 @@ impl<'de> serde::Deserialize<'de> for field_options::CType { use core::convert::TryFrom; i32::try_from(v) .ok() - .and_then(field_options::CType::from_i32) + .and_then(field_options::JsType::from_i32) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -2182,7 +3807,7 @@ impl<'de> serde::Deserialize<'de> for field_options::CType { use core::convert::TryFrom; i32::try_from(v) .ok() - .and_then(field_options::CType::from_i32) + .and_then(field_options::JsType::from_i32) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -2193,9 +3818,9 @@ impl<'de> serde::Deserialize<'de> for field_options::CType { E: serde::de::Error, { match value { - "STRING" => Ok(field_options::CType::String), - "CORD" => Ok(field_options::CType::Cord), - "STRING_PIECE" => Ok(field_options::CType::StringPiece), + "JS_NORMAL" => Ok(field_options::JsType::JsNormal), + "JS_STRING" => Ok(field_options::JsType::JsString), + "JS_NUMBER" => Ok(field_options::JsType::JsNumber), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } } @@ -2203,36 +3828,36 @@ impl<'de> serde::Deserialize<'de> for field_options::CType { deserializer.deserialize_any(GeneratedVisitor) } } -impl serde::Serialize for field_options::JsType { +impl serde::Serialize for field_options::OptionRetention { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result where S: serde::Serializer, { let variant = match self { - Self::JsNormal => "JS_NORMAL", - Self::JsString => "JS_STRING", - Self::JsNumber => "JS_NUMBER", + Self::RetentionUnknown => "RETENTION_UNKNOWN", + Self::RetentionRuntime => "RETENTION_RUNTIME", + Self::RetentionSource => "RETENTION_SOURCE", }; serializer.serialize_str(variant) } } -impl<'de> serde::Deserialize<'de> for field_options::JsType { +impl<'de> serde::Deserialize<'de> for field_options::OptionRetention { #[allow(deprecated)] fn deserialize(deserializer: D) -> core::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "JS_NORMAL", - "JS_STRING", - "JS_NUMBER", + "RETENTION_UNKNOWN", + "RETENTION_RUNTIME", + "RETENTION_SOURCE", ]; struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = field_options::JsType; + type Value = field_options::OptionRetention; fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { write!(formatter, "expected one of: {:?}", &FIELDS) @@ -2245,7 +3870,7 @@ impl<'de> serde::Deserialize<'de> for field_options::JsType { use core::convert::TryFrom; i32::try_from(v) .ok() - .and_then(field_options::JsType::from_i32) + .and_then(field_options::OptionRetention::from_i32) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) }) @@ -2258,7 +3883,7 @@ impl<'de> serde::Deserialize<'de> for field_options::JsType { use core::convert::TryFrom; i32::try_from(v) .ok() - .and_then(field_options::JsType::from_i32) + .and_then(field_options::OptionRetention::from_i32) .ok_or_else(|| { serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) }) @@ -2269,9 +3894,106 @@ impl<'de> serde::Deserialize<'de> for field_options::JsType { E: serde::de::Error, { match value { - "JS_NORMAL" => Ok(field_options::JsType::JsNormal), - "JS_STRING" => Ok(field_options::JsType::JsString), - "JS_NUMBER" => Ok(field_options::JsType::JsNumber), + "RETENTION_UNKNOWN" => Ok(field_options::OptionRetention::RetentionUnknown), + "RETENTION_RUNTIME" => Ok(field_options::OptionRetention::RetentionRuntime), + "RETENTION_SOURCE" => Ok(field_options::OptionRetention::RetentionSource), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +impl serde::Serialize for field_options::OptionTargetType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::TargetTypeUnknown => "TARGET_TYPE_UNKNOWN", + Self::TargetTypeFile => "TARGET_TYPE_FILE", + Self::TargetTypeExtensionRange => "TARGET_TYPE_EXTENSION_RANGE", + Self::TargetTypeMessage => "TARGET_TYPE_MESSAGE", + Self::TargetTypeField => "TARGET_TYPE_FIELD", + Self::TargetTypeOneof => "TARGET_TYPE_ONEOF", + Self::TargetTypeEnum => "TARGET_TYPE_ENUM", + Self::TargetTypeEnumEntry => "TARGET_TYPE_ENUM_ENTRY", + Self::TargetTypeService => "TARGET_TYPE_SERVICE", + Self::TargetTypeMethod => "TARGET_TYPE_METHOD", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for field_options::OptionTargetType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "TARGET_TYPE_UNKNOWN", + "TARGET_TYPE_FILE", + "TARGET_TYPE_EXTENSION_RANGE", + "TARGET_TYPE_MESSAGE", + "TARGET_TYPE_FIELD", + "TARGET_TYPE_ONEOF", + "TARGET_TYPE_ENUM", + "TARGET_TYPE_ENUM_ENTRY", + "TARGET_TYPE_SERVICE", + "TARGET_TYPE_METHOD", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = field_options::OptionTargetType; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(field_options::OptionTargetType::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(field_options::OptionTargetType::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "TARGET_TYPE_UNKNOWN" => Ok(field_options::OptionTargetType::TargetTypeUnknown), + "TARGET_TYPE_FILE" => Ok(field_options::OptionTargetType::TargetTypeFile), + "TARGET_TYPE_EXTENSION_RANGE" => Ok(field_options::OptionTargetType::TargetTypeExtensionRange), + "TARGET_TYPE_MESSAGE" => Ok(field_options::OptionTargetType::TargetTypeMessage), + "TARGET_TYPE_FIELD" => Ok(field_options::OptionTargetType::TargetTypeField), + "TARGET_TYPE_ONEOF" => Ok(field_options::OptionTargetType::TargetTypeOneof), + "TARGET_TYPE_ENUM" => Ok(field_options::OptionTargetType::TargetTypeEnum), + "TARGET_TYPE_ENUM_ENTRY" => Ok(field_options::OptionTargetType::TargetTypeEnumEntry), + "TARGET_TYPE_SERVICE" => Ok(field_options::OptionTargetType::TargetTypeService), + "TARGET_TYPE_METHOD" => Ok(field_options::OptionTargetType::TargetTypeMethod), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } } @@ -2323,6 +4045,9 @@ impl serde::Serialize for FileDescriptorProto { if true { len += 1; } + if true { + len += 1; + } let mut struct_ser = serializer.serialize_struct("google.protobuf.FileDescriptorProto", len)?; if let Some(v) = self.name.as_ref() { struct_ser.serialize_field("name", v)?; @@ -2360,6 +4085,11 @@ impl serde::Serialize for FileDescriptorProto { if let Some(v) = self.syntax.as_ref() { struct_ser.serialize_field("syntax", v)?; } + if let Some(v) = self.edition.as_ref() { + let v = Edition::from_i32(*v) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("edition", &v)?; + } struct_ser.end() } } @@ -2387,6 +4117,7 @@ impl<'de> serde::Deserialize<'de> for FileDescriptorProto { "source_code_info", "sourceCodeInfo", "syntax", + "edition", ]; #[allow(clippy::enum_variant_names)] @@ -2403,6 +4134,7 @@ impl<'de> serde::Deserialize<'de> for FileDescriptorProto { Options, SourceCodeInfo, Syntax, + Edition, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> core::result::Result @@ -2436,6 +4168,7 @@ impl<'de> serde::Deserialize<'de> for FileDescriptorProto { "options" => Ok(GeneratedField::Options), "sourceCodeInfo" | "source_code_info" => Ok(GeneratedField::SourceCodeInfo), "syntax" => Ok(GeneratedField::Syntax), + "edition" => Ok(GeneratedField::Edition), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -2467,6 +4200,7 @@ impl<'de> serde::Deserialize<'de> for FileDescriptorProto { let mut options__ = None; let mut source_code_info__ = None; let mut syntax__ = None; + let mut edition__ = None; while let Some(k) = map.next_key()? { match k { GeneratedField::Name => { @@ -2547,6 +4281,12 @@ impl<'de> serde::Deserialize<'de> for FileDescriptorProto { } syntax__ = map.next_value()?; } + GeneratedField::Edition => { + if edition__.is_some() { + return Err(serde::de::Error::duplicate_field("edition")); + } + edition__ = map.next_value::<::core::option::Option>()?.map(|x| x as i32); + } } } Ok(FileDescriptorProto { @@ -2562,6 +4302,7 @@ impl<'de> serde::Deserialize<'de> for FileDescriptorProto { options: options__, source_code_info: source_code_info__, syntax: syntax__, + edition: edition__, }) } } @@ -2730,6 +4471,9 @@ impl serde::Serialize for FileOptions { if true { len += 1; } + if true { + len += 1; + } let mut struct_ser = serializer.serialize_struct("google.protobuf.FileOptions", len)?; if let Some(v) = self.java_package.as_ref() { struct_ser.serialize_field("javaPackage", v)?; @@ -2793,6 +4537,9 @@ impl serde::Serialize for FileOptions { if let Some(v) = self.ruby_package.as_ref() { struct_ser.serialize_field("rubyPackage", v)?; } + if let Some(v) = self.features.as_ref() { + struct_ser.serialize_field("features", v)?; + } if true { struct_ser.serialize_field("uninterpretedOption", &self.uninterpreted_option)?; } @@ -2845,6 +4592,7 @@ impl<'de> serde::Deserialize<'de> for FileOptions { "phpMetadataNamespace", "ruby_package", "rubyPackage", + "features", "uninterpreted_option", "uninterpretedOption", ]; @@ -2871,6 +4619,7 @@ impl<'de> serde::Deserialize<'de> for FileOptions { PhpNamespace, PhpMetadataNamespace, RubyPackage, + Features, UninterpretedOption, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -2913,6 +4662,7 @@ impl<'de> serde::Deserialize<'de> for FileOptions { "phpNamespace" | "php_namespace" => Ok(GeneratedField::PhpNamespace), "phpMetadataNamespace" | "php_metadata_namespace" => Ok(GeneratedField::PhpMetadataNamespace), "rubyPackage" | "ruby_package" => Ok(GeneratedField::RubyPackage), + "features" => Ok(GeneratedField::Features), "uninterpretedOption" | "uninterpreted_option" => Ok(GeneratedField::UninterpretedOption), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } @@ -2953,6 +4703,7 @@ impl<'de> serde::Deserialize<'de> for FileOptions { let mut php_namespace__ = None; let mut php_metadata_namespace__ = None; let mut ruby_package__ = None; + let mut features__ = None; let mut uninterpreted_option__ = None; while let Some(k) = map.next_key()? { match k { @@ -3076,6 +4827,12 @@ impl<'de> serde::Deserialize<'de> for FileOptions { } ruby_package__ = map.next_value()?; } + GeneratedField::Features => { + if features__.is_some() { + return Err(serde::de::Error::duplicate_field("features")); + } + features__ = map.next_value()?; + } GeneratedField::UninterpretedOption => { if uninterpreted_option__.is_some() { return Err(serde::de::Error::duplicate_field("uninterpretedOption")); @@ -3105,6 +4862,7 @@ impl<'de> serde::Deserialize<'de> for FileOptions { php_namespace: php_namespace__, php_metadata_namespace: php_metadata_namespace__, ruby_package: ruby_package__, + features: features__, uninterpreted_option: uninterpreted_option__.unwrap_or_default(), }) } @@ -3299,6 +5057,9 @@ impl serde::Serialize for generated_code_info::Annotation { if true { len += 1; } + if true { + len += 1; + } let mut struct_ser = serializer.serialize_struct("google.protobuf.GeneratedCodeInfo.Annotation", len)?; if true { struct_ser.serialize_field("path", &self.path)?; @@ -3312,6 +5073,11 @@ impl serde::Serialize for generated_code_info::Annotation { if let Some(v) = self.end.as_ref() { struct_ser.serialize_field("end", v)?; } + if let Some(v) = self.semantic.as_ref() { + let v = generated_code_info::annotation::Semantic::from_i32(*v) + .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; + struct_ser.serialize_field("semantic", &v)?; + } struct_ser.end() } } @@ -3327,6 +5093,7 @@ impl<'de> serde::Deserialize<'de> for generated_code_info::Annotation { "sourceFile", "begin", "end", + "semantic", ]; #[allow(clippy::enum_variant_names)] @@ -3335,6 +5102,7 @@ impl<'de> serde::Deserialize<'de> for generated_code_info::Annotation { SourceFile, Begin, End, + Semantic, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> core::result::Result @@ -3360,6 +5128,7 @@ impl<'de> serde::Deserialize<'de> for generated_code_info::Annotation { "sourceFile" | "source_file" => Ok(GeneratedField::SourceFile), "begin" => Ok(GeneratedField::Begin), "end" => Ok(GeneratedField::End), + "semantic" => Ok(GeneratedField::Semantic), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -3383,6 +5152,7 @@ impl<'de> serde::Deserialize<'de> for generated_code_info::Annotation { let mut source_file__ = None; let mut begin__ = None; let mut end__ = None; + let mut semantic__ = None; while let Some(k) = map.next_key()? { match k { GeneratedField::Path => { @@ -3416,6 +5186,12 @@ impl<'de> serde::Deserialize<'de> for generated_code_info::Annotation { map.next_value::<::core::option::Option<::pbjson::private::NumberDeserialize<_>>>()?.map(|x| x.0) ; } + GeneratedField::Semantic => { + if semantic__.is_some() { + return Err(serde::de::Error::duplicate_field("semantic")); + } + semantic__ = map.next_value::<::core::option::Option>()?.map(|x| x as i32); + } } } Ok(generated_code_info::Annotation { @@ -3423,12 +5199,89 @@ impl<'de> serde::Deserialize<'de> for generated_code_info::Annotation { source_file: source_file__, begin: begin__, end: end__, + semantic: semantic__, }) } } deserializer.deserialize_struct("google.protobuf.GeneratedCodeInfo.Annotation", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for generated_code_info::annotation::Semantic { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::None => "NONE", + Self::Set => "SET", + Self::Alias => "ALIAS", + }; + serializer.serialize_str(variant) + } +} +impl<'de> serde::Deserialize<'de> for generated_code_info::annotation::Semantic { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "NONE", + "SET", + "ALIAS", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = generated_code_info::annotation::Semantic; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(generated_code_info::annotation::Semantic::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) + }) + } + + fn visit_u64(self, v: u64) -> core::result::Result + where + E: serde::de::Error, + { + use core::convert::TryFrom; + i32::try_from(v) + .ok() + .and_then(generated_code_info::annotation::Semantic::from_i32) + .ok_or_else(|| { + serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) + }) + } + + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "NONE" => Ok(generated_code_info::annotation::Semantic::None), + "SET" => Ok(generated_code_info::annotation::Semantic::Set), + "ALIAS" => Ok(generated_code_info::annotation::Semantic::Alias), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} impl serde::Serialize for MessageOptions { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result @@ -3452,6 +5305,12 @@ impl serde::Serialize for MessageOptions { if true { len += 1; } + if true { + len += 1; + } + if true { + len += 1; + } let mut struct_ser = serializer.serialize_struct("google.protobuf.MessageOptions", len)?; if let Some(v) = self.message_set_wire_format.as_ref() { struct_ser.serialize_field("messageSetWireFormat", v)?; @@ -3465,6 +5324,12 @@ impl serde::Serialize for MessageOptions { if let Some(v) = self.map_entry.as_ref() { struct_ser.serialize_field("mapEntry", v)?; } + if let Some(v) = self.deprecated_legacy_json_field_conflicts.as_ref() { + struct_ser.serialize_field("deprecatedLegacyJsonFieldConflicts", v)?; + } + if let Some(v) = self.features.as_ref() { + struct_ser.serialize_field("features", v)?; + } if true { struct_ser.serialize_field("uninterpretedOption", &self.uninterpreted_option)?; } @@ -3485,6 +5350,9 @@ impl<'de> serde::Deserialize<'de> for MessageOptions { "deprecated", "map_entry", "mapEntry", + "deprecated_legacy_json_field_conflicts", + "deprecatedLegacyJsonFieldConflicts", + "features", "uninterpreted_option", "uninterpretedOption", ]; @@ -3495,6 +5363,8 @@ impl<'de> serde::Deserialize<'de> for MessageOptions { NoStandardDescriptorAccessor, Deprecated, MapEntry, + DeprecatedLegacyJsonFieldConflicts, + Features, UninterpretedOption, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -3521,6 +5391,8 @@ impl<'de> serde::Deserialize<'de> for MessageOptions { "noStandardDescriptorAccessor" | "no_standard_descriptor_accessor" => Ok(GeneratedField::NoStandardDescriptorAccessor), "deprecated" => Ok(GeneratedField::Deprecated), "mapEntry" | "map_entry" => Ok(GeneratedField::MapEntry), + "deprecatedLegacyJsonFieldConflicts" | "deprecated_legacy_json_field_conflicts" => Ok(GeneratedField::DeprecatedLegacyJsonFieldConflicts), + "features" => Ok(GeneratedField::Features), "uninterpretedOption" | "uninterpreted_option" => Ok(GeneratedField::UninterpretedOption), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } @@ -3545,6 +5417,8 @@ impl<'de> serde::Deserialize<'de> for MessageOptions { let mut no_standard_descriptor_accessor__ = None; let mut deprecated__ = None; let mut map_entry__ = None; + let mut deprecated_legacy_json_field_conflicts__ = None; + let mut features__ = None; let mut uninterpreted_option__ = None; while let Some(k) = map.next_key()? { match k { @@ -3572,6 +5446,18 @@ impl<'de> serde::Deserialize<'de> for MessageOptions { } map_entry__ = map.next_value()?; } + GeneratedField::DeprecatedLegacyJsonFieldConflicts => { + if deprecated_legacy_json_field_conflicts__.is_some() { + return Err(serde::de::Error::duplicate_field("deprecatedLegacyJsonFieldConflicts")); + } + deprecated_legacy_json_field_conflicts__ = map.next_value()?; + } + GeneratedField::Features => { + if features__.is_some() { + return Err(serde::de::Error::duplicate_field("features")); + } + features__ = map.next_value()?; + } GeneratedField::UninterpretedOption => { if uninterpreted_option__.is_some() { return Err(serde::de::Error::duplicate_field("uninterpretedOption")); @@ -3585,6 +5471,8 @@ impl<'de> serde::Deserialize<'de> for MessageOptions { no_standard_descriptor_accessor: no_standard_descriptor_accessor__, deprecated: deprecated__, map_entry: map_entry__, + deprecated_legacy_json_field_conflicts: deprecated_legacy_json_field_conflicts__, + features: features__, uninterpreted_option: uninterpreted_option__.unwrap_or_default(), }) } @@ -3789,6 +5677,9 @@ impl serde::Serialize for MethodOptions { if true { len += 1; } + if true { + len += 1; + } let mut struct_ser = serializer.serialize_struct("google.protobuf.MethodOptions", len)?; if let Some(v) = self.deprecated.as_ref() { struct_ser.serialize_field("deprecated", v)?; @@ -3798,6 +5689,9 @@ impl serde::Serialize for MethodOptions { .ok_or_else(|| serde::ser::Error::custom(::alloc::format!("Invalid variant {}", *v)))?; struct_ser.serialize_field("idempotencyLevel", &v)?; } + if let Some(v) = self.features.as_ref() { + struct_ser.serialize_field("features", v)?; + } if true { struct_ser.serialize_field("uninterpretedOption", &self.uninterpreted_option)?; } @@ -3814,6 +5708,7 @@ impl<'de> serde::Deserialize<'de> for MethodOptions { "deprecated", "idempotency_level", "idempotencyLevel", + "features", "uninterpreted_option", "uninterpretedOption", ]; @@ -3822,6 +5717,7 @@ impl<'de> serde::Deserialize<'de> for MethodOptions { enum GeneratedField { Deprecated, IdempotencyLevel, + Features, UninterpretedOption, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -3846,6 +5742,7 @@ impl<'de> serde::Deserialize<'de> for MethodOptions { match value { "deprecated" => Ok(GeneratedField::Deprecated), "idempotencyLevel" | "idempotency_level" => Ok(GeneratedField::IdempotencyLevel), + "features" => Ok(GeneratedField::Features), "uninterpretedOption" | "uninterpreted_option" => Ok(GeneratedField::UninterpretedOption), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } @@ -3868,6 +5765,7 @@ impl<'de> serde::Deserialize<'de> for MethodOptions { { let mut deprecated__ = None; let mut idempotency_level__ = None; + let mut features__ = None; let mut uninterpreted_option__ = None; while let Some(k) = map.next_key()? { match k { @@ -3883,6 +5781,12 @@ impl<'de> serde::Deserialize<'de> for MethodOptions { } idempotency_level__ = map.next_value::<::core::option::Option>()?.map(|x| x as i32); } + GeneratedField::Features => { + if features__.is_some() { + return Err(serde::de::Error::duplicate_field("features")); + } + features__ = map.next_value()?; + } GeneratedField::UninterpretedOption => { if uninterpreted_option__.is_some() { return Err(serde::de::Error::duplicate_field("uninterpretedOption")); @@ -3894,6 +5798,7 @@ impl<'de> serde::Deserialize<'de> for MethodOptions { Ok(MethodOptions { deprecated: deprecated__, idempotency_level: idempotency_level__, + features: features__, uninterpreted_option: uninterpreted_option__.unwrap_or_default(), }) } @@ -4096,7 +6001,13 @@ impl serde::Serialize for OneofOptions { if true { len += 1; } + if true { + len += 1; + } let mut struct_ser = serializer.serialize_struct("google.protobuf.OneofOptions", len)?; + if let Some(v) = self.features.as_ref() { + struct_ser.serialize_field("features", v)?; + } if true { struct_ser.serialize_field("uninterpretedOption", &self.uninterpreted_option)?; } @@ -4110,12 +6021,14 @@ impl<'de> serde::Deserialize<'de> for OneofOptions { D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ + "features", "uninterpreted_option", "uninterpretedOption", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { + Features, UninterpretedOption, } impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -4138,6 +6051,7 @@ impl<'de> serde::Deserialize<'de> for OneofOptions { E: serde::de::Error, { match value { + "features" => Ok(GeneratedField::Features), "uninterpretedOption" | "uninterpreted_option" => Ok(GeneratedField::UninterpretedOption), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } @@ -4158,9 +6072,16 @@ impl<'de> serde::Deserialize<'de> for OneofOptions { where V: serde::de::MapAccess<'de>, { + let mut features__ = None; let mut uninterpreted_option__ = None; while let Some(k) = map.next_key()? { match k { + GeneratedField::Features => { + if features__.is_some() { + return Err(serde::de::Error::duplicate_field("features")); + } + features__ = map.next_value()?; + } GeneratedField::UninterpretedOption => { if uninterpreted_option__.is_some() { return Err(serde::de::Error::duplicate_field("uninterpretedOption")); @@ -4170,6 +6091,7 @@ impl<'de> serde::Deserialize<'de> for OneofOptions { } } Ok(OneofOptions { + features: features__, uninterpreted_option: uninterpreted_option__.unwrap_or_default(), }) } @@ -4316,7 +6238,13 @@ impl serde::Serialize for ServiceOptions { if true { len += 1; } + if true { + len += 1; + } let mut struct_ser = serializer.serialize_struct("google.protobuf.ServiceOptions", len)?; + if let Some(v) = self.features.as_ref() { + struct_ser.serialize_field("features", v)?; + } if let Some(v) = self.deprecated.as_ref() { struct_ser.serialize_field("deprecated", v)?; } @@ -4333,6 +6261,7 @@ impl<'de> serde::Deserialize<'de> for ServiceOptions { D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ + "features", "deprecated", "uninterpreted_option", "uninterpretedOption", @@ -4340,6 +6269,7 @@ impl<'de> serde::Deserialize<'de> for ServiceOptions { #[allow(clippy::enum_variant_names)] enum GeneratedField { + Features, Deprecated, UninterpretedOption, } @@ -4363,6 +6293,7 @@ impl<'de> serde::Deserialize<'de> for ServiceOptions { E: serde::de::Error, { match value { + "features" => Ok(GeneratedField::Features), "deprecated" => Ok(GeneratedField::Deprecated), "uninterpretedOption" | "uninterpreted_option" => Ok(GeneratedField::UninterpretedOption), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), @@ -4384,10 +6315,17 @@ impl<'de> serde::Deserialize<'de> for ServiceOptions { where V: serde::de::MapAccess<'de>, { + let mut features__ = None; let mut deprecated__ = None; let mut uninterpreted_option__ = None; while let Some(k) = map.next_key()? { match k { + GeneratedField::Features => { + if features__.is_some() { + return Err(serde::de::Error::duplicate_field("features")); + } + features__ = map.next_value()?; + } GeneratedField::Deprecated => { if deprecated__.is_some() { return Err(serde::de::Error::duplicate_field("deprecated")); @@ -4403,6 +6341,7 @@ impl<'de> serde::Deserialize<'de> for ServiceOptions { } } Ok(ServiceOptions { + features: features__, deprecated: deprecated__, uninterpreted_option: uninterpreted_option__.unwrap_or_default(), }) diff --git a/src/prost/ibc.lightclients.wasm.v1.rs b/src/prost/ibc.lightclients.wasm.v1.rs new file mode 100644 index 00000000..0d4a2936 --- /dev/null +++ b/src/prost/ibc.lightclients.wasm.v1.rs @@ -0,0 +1,1100 @@ +/// MsgStoreCode defines the request type for the StoreCode rpc. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgStoreCode { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// wasm byte code of light client contract. It can be raw or gzip compressed + #[prost(bytes = "vec", tag = "2")] + pub wasm_byte_code: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for MsgStoreCode { + const NAME: &'static str = "MsgStoreCode"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// MsgStoreCodeResponse defines the response type for the StoreCode rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgStoreCodeResponse { + /// checksum is the sha256 hash of the stored code + #[prost(bytes = "vec", tag = "1")] + pub checksum: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for MsgStoreCodeResponse { + const NAME: &'static str = "MsgStoreCodeResponse"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// MsgRemoveChecksum defines the request type for the MsgRemoveChecksum rpc. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRemoveChecksum { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// checksum is the sha256 hash to be removed from the store + #[prost(bytes = "vec", tag = "2")] + pub checksum: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for MsgRemoveChecksum { + const NAME: &'static str = "MsgRemoveChecksum"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// MsgStoreChecksumResponse defines the response type for the StoreCode rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRemoveChecksumResponse {} +impl ::prost::Name for MsgRemoveChecksumResponse { + const NAME: &'static str = "MsgRemoveChecksumResponse"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// MsgMigrateContract defines the request type for the MigrateContract rpc. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgMigrateContract { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// the client id of the contract + #[prost(string, tag = "2")] + pub client_id: ::prost::alloc::string::String, + /// checksum is the sha256 hash of the new wasm byte code for the contract + #[prost(bytes = "vec", tag = "3")] + pub checksum: ::prost::alloc::vec::Vec, + /// the json encoded message to be passed to the contract on migration + #[prost(bytes = "vec", tag = "4")] + pub msg: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for MsgMigrateContract { + const NAME: &'static str = "MsgMigrateContract"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// MsgMigrateContractResponse defines the response type for the MigrateContract rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgMigrateContractResponse {} +impl ::prost::Name for MsgMigrateContractResponse { + const NAME: &'static str = "MsgMigrateContractResponse"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// Generated client implementations. +#[cfg(feature = "client")] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + /// Msg defines the ibc/08-wasm Msg service. + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// StoreCode defines a rpc handler method for MsgStoreCode. + pub async fn store_code( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.lightclients.wasm.v1.Msg/StoreCode", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("ibc.lightclients.wasm.v1.Msg", "StoreCode")); + self.inner.unary(req, path, codec).await + } + /// RemoveChecksum defines a rpc handler method for MsgRemoveChecksum. + pub async fn remove_checksum( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.lightclients.wasm.v1.Msg/RemoveChecksum", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("ibc.lightclients.wasm.v1.Msg", "RemoveChecksum"), + ); + self.inner.unary(req, path, codec).await + } + /// MigrateContract defines a rpc handler method for MsgMigrateContract. + pub async fn migrate_contract( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.lightclients.wasm.v1.Msg/MigrateContract", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("ibc.lightclients.wasm.v1.Msg", "MigrateContract"), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "server")] +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + /// StoreCode defines a rpc handler method for MsgStoreCode. + async fn store_code( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// RemoveChecksum defines a rpc handler method for MsgRemoveChecksum. + async fn remove_checksum( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// MigrateContract defines a rpc handler method for MsgMigrateContract. + async fn migrate_contract( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /// Msg defines the ibc/08-wasm Msg service. + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/ibc.lightclients.wasm.v1.Msg/StoreCode" => { + #[allow(non_camel_case_types)] + struct StoreCodeSvc(pub Arc); + impl tonic::server::UnaryService + for StoreCodeSvc { + type Response = super::MsgStoreCodeResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::store_code(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = StoreCodeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.lightclients.wasm.v1.Msg/RemoveChecksum" => { + #[allow(non_camel_case_types)] + struct RemoveChecksumSvc(pub Arc); + impl tonic::server::UnaryService + for RemoveChecksumSvc { + type Response = super::MsgRemoveChecksumResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::remove_checksum(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = RemoveChecksumSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.lightclients.wasm.v1.Msg/MigrateContract" => { + #[allow(non_camel_case_types)] + struct MigrateContractSvc(pub Arc); + impl tonic::server::UnaryService + for MigrateContractSvc { + type Response = super::MsgMigrateContractResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::migrate_contract(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = MigrateContractSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "ibc.lightclients.wasm.v1.Msg"; + } +} +/// QueryChecksumsRequest is the request type for the Query/Checksums RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryChecksumsRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +impl ::prost::Name for QueryChecksumsRequest { + const NAME: &'static str = "QueryChecksumsRequest"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// QueryChecksumsResponse is the response type for the Query/Checksums RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryChecksumsResponse { + /// checksums is a list of the hex encoded checksums of all wasm codes stored. + #[prost(string, repeated, tag = "1")] + pub checksums: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryChecksumsResponse { + const NAME: &'static str = "QueryChecksumsResponse"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// QueryCodeRequest is the request type for the Query/Code RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryCodeRequest { + /// checksum is a hex encoded string of the code stored. + #[prost(string, tag = "1")] + pub checksum: ::prost::alloc::string::String, +} +impl ::prost::Name for QueryCodeRequest { + const NAME: &'static str = "QueryCodeRequest"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// QueryCodeResponse is the response type for the Query/Code RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryCodeResponse { + #[prost(bytes = "vec", tag = "1")] + pub data: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for QueryCodeResponse { + const NAME: &'static str = "QueryCodeResponse"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// Generated client implementations. +#[cfg(feature = "client")] +pub mod query_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + use tonic::codegen::http::Uri; + /// Query service for wasm module + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + , + >>::Error: Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// Get all Wasm checksums + pub async fn checksums( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.lightclients.wasm.v1.Query/Checksums", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("ibc.lightclients.wasm.v1.Query", "Checksums")); + self.inner.unary(req, path, codec).await + } + /// Get Wasm code for given code hash + pub async fn code( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.lightclients.wasm.v1.Query/Code", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("ibc.lightclients.wasm.v1.Query", "Code")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "server")] +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + /// Get all Wasm checksums + async fn checksums( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Get Wasm code for given code hash + async fn code( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /// Query service for wasm module + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/ibc.lightclients.wasm.v1.Query/Checksums" => { + #[allow(non_camel_case_types)] + struct ChecksumsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ChecksumsSvc { + type Response = super::QueryChecksumsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::checksums(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ChecksumsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.lightclients.wasm.v1.Query/Code" => { + #[allow(non_camel_case_types)] + struct CodeSvc(pub Arc); + impl tonic::server::UnaryService + for CodeSvc { + type Response = super::QueryCodeResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::code(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CodeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => { + Box::pin(async move { + Ok( + http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap(), + ) + }) + } + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "ibc.lightclients.wasm.v1.Query"; + } +} +/// GenesisState defines 08-wasm's keeper genesis state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + /// uploaded light client wasm contracts + #[prost(message, repeated, tag = "1")] + pub contracts: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// Contract stores contract code +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Contract { + /// contract byte code + #[prost(bytes = "vec", tag = "1")] + pub code_bytes: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for Contract { + const NAME: &'static str = "Contract"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// Wasm light client's Client state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ClientState { + /// bytes encoding the client state of the underlying light client + /// implemented as a Wasm contract. + #[prost(bytes = "vec", tag = "1")] + pub data: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + pub checksum: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub latest_height: ::core::option::Option< + super::super::super::core::client::v1::Height, + >, +} +impl ::prost::Name for ClientState { + const NAME: &'static str = "ClientState"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// Wasm light client's ConsensusState +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConsensusState { + /// bytes encoding the consensus state of the underlying light client + /// implemented as a Wasm contract. + #[prost(bytes = "vec", tag = "1")] + pub data: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for ConsensusState { + const NAME: &'static str = "ConsensusState"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// Wasm light client message (either header(s) or misbehaviour) +#[cfg_attr( + all(feature = "json-schema", feature = "serde"), + derive(::schemars::JsonSchema) +)] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ClientMessage { + #[prost(bytes = "vec", tag = "1")] + pub data: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for ClientMessage { + const NAME: &'static str = "ClientMessage"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} +/// Checksums defines a list of all checksums that are stored +/// +/// Deprecated: This message is deprecated in favor of storing the checksums +/// using a Collections.KeySet. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Checksums { + #[prost(bytes = "vec", repeated, tag = "1")] + pub checksums: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +impl ::prost::Name for Checksums { + const NAME: &'static str = "Checksums"; + const PACKAGE: &'static str = "ibc.lightclients.wasm.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.lightclients.wasm.v1.{}", Self::NAME) + } +} diff --git a/src/prost/ibc.lightclients.wasm.v1.serde.rs b/src/prost/ibc.lightclients.wasm.v1.serde.rs new file mode 100644 index 00000000..7eadd637 --- /dev/null +++ b/src/prost/ibc.lightclients.wasm.v1.serde.rs @@ -0,0 +1,1581 @@ +impl serde::Serialize for Checksums { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.lightclients.wasm.v1.Checksums", len)?; + if true { + struct_ser.serialize_field("checksums", &self.checksums.iter().map(pbjson::private::base64::encode).collect::<::alloc::vec::Vec<_>>())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Checksums { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "checksums", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Checksums, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "checksums" => Ok(GeneratedField::Checksums), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Checksums; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.Checksums") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut checksums__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::Checksums => { + if checksums__.is_some() { + return Err(serde::de::Error::duplicate_field("checksums")); + } + checksums__ = + Some(map.next_value::<::alloc::vec::Vec<::pbjson::private::BytesDeserialize<_>>>()? + .into_iter().map(|x| x.0).collect()) + ; + } + } + } + Ok(Checksums { + checksums: checksums__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.Checksums", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ClientMessage { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.lightclients.wasm.v1.ClientMessage", len)?; + if true { + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ClientMessage { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "data", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Data, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "data" => Ok(GeneratedField::Data), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ClientMessage; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.ClientMessage") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut data__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(ClientMessage { + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.ClientMessage", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ClientState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.lightclients.wasm.v1.ClientState", len)?; + if true { + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + if true { + struct_ser.serialize_field("checksum", pbjson::private::base64::encode(&self.checksum).as_str())?; + } + if let Some(v) = self.latest_height.as_ref() { + struct_ser.serialize_field("latestHeight", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ClientState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "data", + "checksum", + "latest_height", + "latestHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Data, + Checksum, + LatestHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "data" => Ok(GeneratedField::Data), + "checksum" => Ok(GeneratedField::Checksum), + "latestHeight" | "latest_height" => Ok(GeneratedField::LatestHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ClientState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.ClientState") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut data__ = None; + let mut checksum__ = None; + let mut latest_height__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Checksum => { + if checksum__.is_some() { + return Err(serde::de::Error::duplicate_field("checksum")); + } + checksum__ = + Some(map.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::LatestHeight => { + if latest_height__.is_some() { + return Err(serde::de::Error::duplicate_field("latestHeight")); + } + latest_height__ = map.next_value()?; + } + } + } + Ok(ClientState { + data: data__.unwrap_or_default(), + checksum: checksum__.unwrap_or_default(), + latest_height: latest_height__, + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.ClientState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for ConsensusState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.lightclients.wasm.v1.ConsensusState", len)?; + if true { + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for ConsensusState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "data", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Data, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "data" => Ok(GeneratedField::Data), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ConsensusState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.ConsensusState") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut data__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(ConsensusState { + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.ConsensusState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for Contract { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.lightclients.wasm.v1.Contract", len)?; + if true { + struct_ser.serialize_field("codeBytes", pbjson::private::base64::encode(&self.code_bytes).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for Contract { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "code_bytes", + "codeBytes", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CodeBytes, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "codeBytes" | "code_bytes" => Ok(GeneratedField::CodeBytes), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Contract; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.Contract") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut code_bytes__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::CodeBytes => { + if code_bytes__.is_some() { + return Err(serde::de::Error::duplicate_field("codeBytes")); + } + code_bytes__ = + Some(map.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(Contract { + code_bytes: code_bytes__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.Contract", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.lightclients.wasm.v1.GenesisState", len)?; + if true { + struct_ser.serialize_field("contracts", &self.contracts)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "contracts", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Contracts, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "contracts" => Ok(GeneratedField::Contracts), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GenesisState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.GenesisState") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut contracts__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::Contracts => { + if contracts__.is_some() { + return Err(serde::de::Error::duplicate_field("contracts")); + } + contracts__ = Some(map.next_value()?); + } + } + } + Ok(GenesisState { + contracts: contracts__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.GenesisState", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgMigrateContract { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.lightclients.wasm.v1.MsgMigrateContract", len)?; + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if true { + struct_ser.serialize_field("checksum", pbjson::private::base64::encode(&self.checksum).as_str())?; + } + if true { + struct_ser.serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgMigrateContract { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "signer", + "client_id", + "clientId", + "checksum", + "msg", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signer, + ClientId, + Checksum, + Msg, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "signer" => Ok(GeneratedField::Signer), + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "checksum" => Ok(GeneratedField::Checksum), + "msg" => Ok(GeneratedField::Msg), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgMigrateContract; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.MsgMigrateContract") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signer__ = None; + let mut client_id__ = None; + let mut checksum__ = None; + let mut msg__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map.next_value()?); + } + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map.next_value()?); + } + GeneratedField::Checksum => { + if checksum__.is_some() { + return Err(serde::de::Error::duplicate_field("checksum")); + } + checksum__ = + Some(map.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Msg => { + if msg__.is_some() { + return Err(serde::de::Error::duplicate_field("msg")); + } + msg__ = + Some(map.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgMigrateContract { + signer: signer__.unwrap_or_default(), + client_id: client_id__.unwrap_or_default(), + checksum: checksum__.unwrap_or_default(), + msg: msg__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.MsgMigrateContract", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgMigrateContractResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("ibc.lightclients.wasm.v1.MsgMigrateContractResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgMigrateContractResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgMigrateContractResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.MsgMigrateContractResponse") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map.next_key::()?.is_some() { + let _ = map.next_value::()?; + } + Ok(MsgMigrateContractResponse { + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.MsgMigrateContractResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgRemoveChecksum { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.lightclients.wasm.v1.MsgRemoveChecksum", len)?; + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + if true { + struct_ser.serialize_field("checksum", pbjson::private::base64::encode(&self.checksum).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgRemoveChecksum { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "signer", + "checksum", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signer, + Checksum, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "signer" => Ok(GeneratedField::Signer), + "checksum" => Ok(GeneratedField::Checksum), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgRemoveChecksum; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.MsgRemoveChecksum") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signer__ = None; + let mut checksum__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map.next_value()?); + } + GeneratedField::Checksum => { + if checksum__.is_some() { + return Err(serde::de::Error::duplicate_field("checksum")); + } + checksum__ = + Some(map.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgRemoveChecksum { + signer: signer__.unwrap_or_default(), + checksum: checksum__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.MsgRemoveChecksum", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgRemoveChecksumResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgRemoveChecksumResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgRemoveChecksumResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map.next_key::()?.is_some() { + let _ = map.next_value::()?; + } + Ok(MsgRemoveChecksumResponse { + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgStoreCode { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.lightclients.wasm.v1.MsgStoreCode", len)?; + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + if true { + struct_ser.serialize_field("wasmByteCode", pbjson::private::base64::encode(&self.wasm_byte_code).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgStoreCode { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "signer", + "wasm_byte_code", + "wasmByteCode", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signer, + WasmByteCode, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "signer" => Ok(GeneratedField::Signer), + "wasmByteCode" | "wasm_byte_code" => Ok(GeneratedField::WasmByteCode), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgStoreCode; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.MsgStoreCode") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signer__ = None; + let mut wasm_byte_code__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map.next_value()?); + } + GeneratedField::WasmByteCode => { + if wasm_byte_code__.is_some() { + return Err(serde::de::Error::duplicate_field("wasmByteCode")); + } + wasm_byte_code__ = + Some(map.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgStoreCode { + signer: signer__.unwrap_or_default(), + wasm_byte_code: wasm_byte_code__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.MsgStoreCode", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgStoreCodeResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.lightclients.wasm.v1.MsgStoreCodeResponse", len)?; + if true { + struct_ser.serialize_field("checksum", pbjson::private::base64::encode(&self.checksum).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgStoreCodeResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "checksum", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Checksum, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "checksum" => Ok(GeneratedField::Checksum), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgStoreCodeResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.MsgStoreCodeResponse") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut checksum__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::Checksum => { + if checksum__.is_some() { + return Err(serde::de::Error::duplicate_field("checksum")); + } + checksum__ = + Some(map.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgStoreCodeResponse { + checksum: checksum__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.MsgStoreCodeResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryChecksumsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.lightclients.wasm.v1.QueryChecksumsRequest", len)?; + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryChecksumsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryChecksumsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.QueryChecksumsRequest") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut pagination__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map.next_value()?; + } + } + } + Ok(QueryChecksumsRequest { + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.QueryChecksumsRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryChecksumsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.lightclients.wasm.v1.QueryChecksumsResponse", len)?; + if true { + struct_ser.serialize_field("checksums", &self.checksums)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryChecksumsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "checksums", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Checksums, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "checksums" => Ok(GeneratedField::Checksums), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryChecksumsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.QueryChecksumsResponse") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut checksums__ = None; + let mut pagination__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::Checksums => { + if checksums__.is_some() { + return Err(serde::de::Error::duplicate_field("checksums")); + } + checksums__ = Some(map.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map.next_value()?; + } + } + } + Ok(QueryChecksumsResponse { + checksums: checksums__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.QueryChecksumsResponse", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryCodeRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.lightclients.wasm.v1.QueryCodeRequest", len)?; + if true { + struct_ser.serialize_field("checksum", &self.checksum)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryCodeRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "checksum", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Checksum, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "checksum" => Ok(GeneratedField::Checksum), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryCodeRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.QueryCodeRequest") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut checksum__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::Checksum => { + if checksum__.is_some() { + return Err(serde::de::Error::duplicate_field("checksum")); + } + checksum__ = Some(map.next_value()?); + } + } + } + Ok(QueryCodeRequest { + checksum: checksum__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.QueryCodeRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryCodeResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.lightclients.wasm.v1.QueryCodeResponse", len)?; + if true { + struct_ser.serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryCodeResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "data", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Data, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "data" => Ok(GeneratedField::Data), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryCodeResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.lightclients.wasm.v1.QueryCodeResponse") + } + + fn visit_map(self, mut map: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut data__ = None; + while let Some(k) = map.next_key()? { + match k { + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = + Some(map.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(QueryCodeResponse { + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.lightclients.wasm.v1.QueryCodeResponse", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/proto_descriptor.bin b/src/prost/proto_descriptor.bin index bb1bdf04..4b581654 100644 Binary files a/src/prost/proto_descriptor.bin and b/src/prost/proto_descriptor.bin differ diff --git a/tools/proto-compiler/src/cmd/compile.rs b/tools/proto-compiler/src/cmd/compile.rs index 90164458..41fcb0f8 100644 --- a/tools/proto-compiler/src/cmd/compile.rs +++ b/tools/proto-compiler/src/cmd/compile.rs @@ -161,6 +161,7 @@ impl CompileCmd { .type_attribute(".ibc.core.connection.v1.ConnectionEnd", attrs_jsonschema) .type_attribute(".ibc.core.connection.v1.Counterparty", attrs_jsonschema) .type_attribute(".ibc.core.connection.v1.Version", attrs_jsonschema) + .type_attribute(".ibc.lightclients.wasm.v1.ClientMessage", attrs_jsonschema) .compile_with_config(config, &protos, &includes)?; println!("[info ] Protos compiled successfully");