Skip to content

Commit

Permalink
Merge pull request #214 from ydb-platform/update-grpc
Browse files Browse the repository at this point in the history
updated protobufs
  • Loading branch information
rekby authored Oct 9, 2024
2 parents f40d47f + 464aa29 commit af5ef3a
Show file tree
Hide file tree
Showing 17 changed files with 1,142 additions and 53 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified ydb-grpc/src/descriptors.bin
Binary file not shown.
151 changes: 114 additions & 37 deletions ydb-grpc/src/generated/google.protobuf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ pub struct FileDescriptorProto {
/// 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, which is an opaque string.
#[prost(string, optional, tag = "13")]
pub edition: ::core::option::Option<::prost::alloc::string::String>,
/// The edition of the proto file.
#[prost(enumeration = "Edition", optional, tag = "14")]
pub edition: ::core::option::Option<i32>,
}
/// Describes a message type.
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down Expand Up @@ -281,7 +281,7 @@ pub struct ExtensionRangeOptions {
#[prost(message, optional, tag = "50")]
pub features: ::core::option::Option<FeatureSet>,
/// The verification state of the range.
/// TODO(b/278783756): flip the default to DECLARATION once all empty ranges
/// TODO: flip the default to DECLARATION once all empty ranges
/// are marked as UNVERIFIED.
#[prost(
enumeration = "extension_range_options::VerificationState",
Expand Down Expand Up @@ -441,9 +441,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,
Expand Down Expand Up @@ -500,8 +501,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.
Expand All @@ -510,8 +514,8 @@ 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",
}
}
}
Expand Down Expand Up @@ -811,7 +815,7 @@ pub struct MessageOptions {
/// 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(b/261750190) This is legacy behavior we plan to remove once downstream
/// TODO This is legacy behavior we plan to remove once downstream
/// teams have had time to migrate.
#[deprecated]
#[prost(bool, optional, tag = "11")]
Expand Down Expand Up @@ -842,7 +846,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<bool>,
/// The jstype option determines the JavaScript type used for values of the
Expand Down Expand Up @@ -930,8 +936,8 @@ pub struct FieldOptions {
pub mod field_options {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EditionDefault {
#[prost(string, optional, tag = "1")]
pub edition: ::core::option::Option<::prost::alloc::string::String>,
#[prost(enumeration = "super::Edition", optional, tag = "3")]
pub edition: ::core::option::Option<i32>,
/// Textproto value.
#[prost(string, optional, tag = "2")]
pub value: ::core::option::Option<::prost::alloc::string::String>,
Expand Down Expand Up @@ -1111,7 +1117,7 @@ pub struct EnumOptions {
/// 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(b/261750190) Remove this legacy behavior once downstream teams have
/// TODO Remove this legacy behavior once downstream teams have
/// had time to migrate.
#[deprecated]
#[prost(bool, optional, tag = "6")]
Expand Down Expand Up @@ -1257,7 +1263,7 @@ pub mod uninterpreted_option {
pub is_extension: bool,
}
}
/// TODO(b/274655146) Enums in C++ gencode (and potentially other languages) are
/// 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
Expand All @@ -1271,14 +1277,12 @@ pub struct FeatureSet {
pub enum_type: ::core::option::Option<i32>,
#[prost(enumeration = "feature_set::RepeatedFieldEncoding", optional, tag = "3")]
pub repeated_field_encoding: ::core::option::Option<i32>,
#[prost(enumeration = "feature_set::StringFieldValidation", optional, tag = "4")]
pub string_field_validation: ::core::option::Option<i32>,
#[prost(enumeration = "feature_set::Utf8Validation", optional, tag = "4")]
pub utf8_validation: ::core::option::Option<i32>,
#[prost(enumeration = "feature_set::MessageEncoding", optional, tag = "5")]
pub message_encoding: ::core::option::Option<i32>,
#[prost(enumeration = "feature_set::JsonFormat", optional, tag = "6")]
pub json_format: ::core::option::Option<i32>,
#[prost(message, optional, boxed, tag = "999")]
pub raw_features: ::core::option::Option<::prost::alloc::boxed::Box<FeatureSet>>,
}
/// Nested message and enum types in `FeatureSet`.
pub mod feature_set {
Expand Down Expand Up @@ -1383,22 +1387,20 @@ pub mod feature_set {
::prost::Enumeration
)]
#[repr(i32)]
pub enum StringFieldValidation {
pub enum Utf8Validation {
Unknown = 0,
Mandatory = 1,
Hint = 2,
None = 3,
None = 1,
Verify = 2,
}
impl StringFieldValidation {
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 {
StringFieldValidation::Unknown => "STRING_FIELD_VALIDATION_UNKNOWN",
StringFieldValidation::Mandatory => "MANDATORY",
StringFieldValidation::Hint => "HINT",
StringFieldValidation::None => "NONE",
Utf8Validation::Unknown => "UTF8_VALIDATION_UNKNOWN",
Utf8Validation::None => "NONE",
Utf8Validation::Verify => "VERIFY",
}
}
}
Expand Down Expand Up @@ -1461,6 +1463,39 @@ pub mod feature_set {
}
}
}
/// 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.
#[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<i32>,
/// 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<i32>,
}
/// 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.
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct FeatureSetEditionDefault {
#[prost(enumeration = "super::Edition", optional, tag = "3")]
pub edition: ::core::option::Option<i32>,
#[prost(message, optional, tag = "2")]
pub features: ::core::option::Option<super::FeatureSet>,
}
}
/// Encapsulates information about the original source file from which a
/// FileDescriptorProto was generated.
#[derive(Clone, PartialEq, ::prost::Message)]
Expand Down Expand Up @@ -1660,6 +1695,48 @@ pub mod generated_code_info {
}
}
}
/// 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",
}
}
}
/// `Struct` represents a structured data value, consisting of fields
/// which map to dynamically typed values. In some languages, `Struct`
/// might be supported by a native representation. For example, in
Expand Down Expand Up @@ -1736,15 +1813,6 @@ impl NullValue {
}
}
}
/// A generic empty message that you can re-use to avoid defining duplicated
/// empty messages in your APIs. A typical example is to use it as the request
/// or the response type of an API method. For instance:
/// service Foo {
/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
/// }
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Empty {}
/// 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
Expand Down Expand Up @@ -1825,4 +1893,13 @@ pub struct Timestamp {
/// inclusive.
#[prost(int32, tag = "2")]
pub nanos: i32,
}
}
/// A generic empty message that you can re-use to avoid defining duplicated
/// empty messages in your APIs. A typical example is to use it as the request
/// or the response type of an API method. For instance:
/// service Foo {
/// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
/// }
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Empty {}
29 changes: 29 additions & 0 deletions ydb-grpc/src/generated/ydb.discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,4 +73,33 @@ pub struct WhoAmIResult {
pub struct WhoAmIResponse {
#[prost(message, optional, tag = "1")]
pub operation: ::core::option::Option<super::operations::Operation>,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NodeLocation {
/// compatibility section -- will be removed in future versions
#[deprecated]
#[prost(uint32, optional, tag = "1")]
pub data_center_num: ::core::option::Option<u32>,
#[deprecated]
#[prost(uint32, optional, tag = "2")]
pub room_num: ::core::option::Option<u32>,
#[deprecated]
#[prost(uint32, optional, tag = "3")]
pub rack_num: ::core::option::Option<u32>,
#[deprecated]
#[prost(uint32, optional, tag = "4")]
pub body_num: ::core::option::Option<u32>,
/// for compatibility with WalleLocation
#[deprecated]
#[prost(uint32, optional, tag = "100500")]
pub body: ::core::option::Option<u32>,
#[prost(string, optional, tag = "10")]
pub data_center: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "20")]
pub module: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "30")]
pub rack: ::core::option::Option<::prost::alloc::string::String>,
#[prost(string, optional, tag = "40")]
pub unit: ::core::option::Option<::prost::alloc::string::String>,
}
38 changes: 37 additions & 1 deletion ydb-grpc/src/generated/ydb.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,21 @@ pub struct CostInfo {
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QuotaExceeded {
#[prost(bool, tag = "1")]
pub disk: bool,
}
/// Specifies a point in database time
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct VirtualTimestamp {
#[prost(uint64, tag = "1")]
pub plan_step: u64,
#[prost(uint64, tag = "2")]
pub tx_id: u64,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct StatusIds {}
/// Nested message and enum types in `StatusIds`.
pub mod status_ids {
Expand Down Expand Up @@ -122,6 +137,7 @@ pub mod status_ids {
Undetermined = 400170,
Unsupported = 400180,
SessionBusy = 400190,
ExternalError = 400200,
}
impl StatusCode {
/// String value of the enum field names used in the ProtoBuf definition.
Expand Down Expand Up @@ -149,6 +165,7 @@ pub mod status_ids {
StatusCode::Undetermined => "UNDETERMINED",
StatusCode::Unsupported => "UNSUPPORTED",
StatusCode::SessionBusy => "SESSION_BUSY",
StatusCode::ExternalError => "EXTERNAL_ERROR",
}
}
}
Expand Down Expand Up @@ -228,10 +245,27 @@ pub struct TaggedType {
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PgType {
#[prost(string, tag = "10")]
pub type_name: ::prost::alloc::string::String,
#[prost(string, tag = "11")]
pub type_modifier: ::prost::alloc::string::String,
/// pg object id of the type
/// full registry could be found here: <https://github.com/postgres/postgres/blob/master/src/include/catalog/pg_type.dat>
#[prost(uint32, tag = "1")]
pub oid: u32,
/// advanced type details useful for pg wire format proxying
#[prost(int32, tag = "2")]
pub typlen: i32,
#[prost(int32, tag = "3")]
pub typmod: i32,
}
#[derive(serde::Serialize, serde::Deserialize)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Type {
#[prost(
oneof = "r#type::Type",
tags = "1, 2, 101, 102, 103, 104, 105, 106, 107, 201, 202, 203, 204"
tags = "1, 2, 101, 102, 103, 104, 105, 106, 107, 201, 202, 203, 204, 205"
)]
pub r#type: ::core::option::Option<r#type::Type>,
}
Expand Down Expand Up @@ -345,6 +379,8 @@ pub mod r#type {
EmptyListType(i32),
#[prost(enumeration = "super::super::google::protobuf::NullValue", tag = "204")]
EmptyDictType(i32),
#[prost(message, tag = "205")]
PgType(super::PgType),
}
}
#[derive(serde::Serialize, serde::Deserialize)]
Expand Down
Loading

0 comments on commit af5ef3a

Please sign in to comment.