Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,12 @@ nonisolated struct ProtobufTestMessages_Editions_TestAllTypesEdition2023: SwiftP
/// Clears the value of `delimitedField`. Subsequent reads from it will return its default value.
mutating func clearDelimitedField() {_uniqueStorage()._delimitedField = nil}

/// recursive
var mapRecursive: Dictionary<Int32,ProtobufTestMessages_Editions_TestAllTypesEdition2023> {
get {_storage._mapRecursive}
set {_uniqueStorage()._mapRecursive = newValue}
}

var unknownFields = SwiftProtobuf.UnknownStorage()

nonisolated enum OneOf_OneofField: Equatable, Sendable {
Expand Down Expand Up @@ -1083,7 +1089,7 @@ nonisolated extension ProtobufTestMessages_Editions_ComplexMessage: SwiftProtobu

nonisolated extension ProtobufTestMessages_Editions_TestAllTypesEdition2023: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
static let protoMessageName: String = _protobuf_package + ".TestAllTypesEdition2023"
static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}optional_int32\0\u{3}optional_int64\0\u{3}optional_uint32\0\u{3}optional_uint64\0\u{3}optional_sint32\0\u{3}optional_sint64\0\u{3}optional_fixed32\0\u{3}optional_fixed64\0\u{3}optional_sfixed32\0\u{3}optional_sfixed64\0\u{3}optional_float\0\u{3}optional_double\0\u{3}optional_bool\0\u{3}optional_string\0\u{3}optional_bytes\0\u{4}\u{3}optional_nested_message\0\u{3}optional_foreign_message\0\u{4}\u{2}optional_nested_enum\0\u{3}optional_foreign_enum\0\u{4}\u{2}optional_string_piece\0\u{3}optional_cord\0\u{4}\u{2}recursive_message\0\u{4}\u{4}repeated_int32\0\u{3}repeated_int64\0\u{3}repeated_uint32\0\u{3}repeated_uint64\0\u{3}repeated_sint32\0\u{3}repeated_sint64\0\u{3}repeated_fixed32\0\u{3}repeated_fixed64\0\u{3}repeated_sfixed32\0\u{3}repeated_sfixed64\0\u{3}repeated_float\0\u{3}repeated_double\0\u{3}repeated_bool\0\u{3}repeated_string\0\u{3}repeated_bytes\0\u{4}\u{3}repeated_nested_message\0\u{3}repeated_foreign_message\0\u{4}\u{2}repeated_nested_enum\0\u{3}repeated_foreign_enum\0\u{4}\u{2}repeated_string_piece\0\u{3}repeated_cord\0\u{3}map_int32_int32\0\u{3}map_int64_int64\0\u{3}map_uint32_uint32\0\u{3}map_uint64_uint64\0\u{3}map_sint32_sint32\0\u{3}map_sint64_sint64\0\u{3}map_fixed32_fixed32\0\u{3}map_fixed64_fixed64\0\u{3}map_sfixed32_sfixed32\0\u{3}map_sfixed64_sfixed64\0\u{3}map_int32_float\0\u{3}map_int32_double\0\u{3}map_bool_bool\0\u{3}map_string_string\0\u{3}map_string_bytes\0\u{3}map_string_nested_message\0\u{3}map_string_foreign_message\0\u{3}map_string_nested_enum\0\u{3}map_string_foreign_enum\0\u{3}packed_int32\0\u{3}packed_int64\0\u{3}packed_uint32\0\u{3}packed_uint64\0\u{3}packed_sint32\0\u{3}packed_sint64\0\u{3}packed_fixed32\0\u{3}packed_fixed64\0\u{3}packed_sfixed32\0\u{3}packed_sfixed64\0\u{3}packed_float\0\u{3}packed_double\0\u{3}packed_bool\0\u{3}packed_nested_enum\0\u{3}unpacked_int32\0\u{3}unpacked_int64\0\u{3}unpacked_uint32\0\u{3}unpacked_uint64\0\u{3}unpacked_sint32\0\u{3}unpacked_sint64\0\u{3}unpacked_fixed32\0\u{3}unpacked_fixed64\0\u{3}unpacked_sfixed32\0\u{3}unpacked_sfixed64\0\u{3}unpacked_float\0\u{3}unpacked_double\0\u{3}unpacked_bool\0\u{3}unpacked_nested_enum\0\u{4}\u{9}oneof_uint32\0\u{3}oneof_nested_message\0\u{3}oneof_string\0\u{3}oneof_bytes\0\u{3}oneof_bool\0\u{3}oneof_uint64\0\u{3}oneof_float\0\u{3}oneof_double\0\u{3}oneof_enum\0\u{8}R\u{1}GroupLikeType\0\u{3}delimited_field\0")
static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}optional_int32\0\u{3}optional_int64\0\u{3}optional_uint32\0\u{3}optional_uint64\0\u{3}optional_sint32\0\u{3}optional_sint64\0\u{3}optional_fixed32\0\u{3}optional_fixed64\0\u{3}optional_sfixed32\0\u{3}optional_sfixed64\0\u{3}optional_float\0\u{3}optional_double\0\u{3}optional_bool\0\u{3}optional_string\0\u{3}optional_bytes\0\u{4}\u{3}optional_nested_message\0\u{3}optional_foreign_message\0\u{4}\u{2}optional_nested_enum\0\u{3}optional_foreign_enum\0\u{4}\u{2}optional_string_piece\0\u{3}optional_cord\0\u{4}\u{2}recursive_message\0\u{4}\u{4}repeated_int32\0\u{3}repeated_int64\0\u{3}repeated_uint32\0\u{3}repeated_uint64\0\u{3}repeated_sint32\0\u{3}repeated_sint64\0\u{3}repeated_fixed32\0\u{3}repeated_fixed64\0\u{3}repeated_sfixed32\0\u{3}repeated_sfixed64\0\u{3}repeated_float\0\u{3}repeated_double\0\u{3}repeated_bool\0\u{3}repeated_string\0\u{3}repeated_bytes\0\u{4}\u{3}repeated_nested_message\0\u{3}repeated_foreign_message\0\u{4}\u{2}repeated_nested_enum\0\u{3}repeated_foreign_enum\0\u{4}\u{2}repeated_string_piece\0\u{3}repeated_cord\0\u{3}map_int32_int32\0\u{3}map_int64_int64\0\u{3}map_uint32_uint32\0\u{3}map_uint64_uint64\0\u{3}map_sint32_sint32\0\u{3}map_sint64_sint64\0\u{3}map_fixed32_fixed32\0\u{3}map_fixed64_fixed64\0\u{3}map_sfixed32_sfixed32\0\u{3}map_sfixed64_sfixed64\0\u{3}map_int32_float\0\u{3}map_int32_double\0\u{3}map_bool_bool\0\u{3}map_string_string\0\u{3}map_string_bytes\0\u{3}map_string_nested_message\0\u{3}map_string_foreign_message\0\u{3}map_string_nested_enum\0\u{3}map_string_foreign_enum\0\u{3}packed_int32\0\u{3}packed_int64\0\u{3}packed_uint32\0\u{3}packed_uint64\0\u{3}packed_sint32\0\u{3}packed_sint64\0\u{3}packed_fixed32\0\u{3}packed_fixed64\0\u{3}packed_sfixed32\0\u{3}packed_sfixed64\0\u{3}packed_float\0\u{3}packed_double\0\u{3}packed_bool\0\u{3}packed_nested_enum\0\u{3}unpacked_int32\0\u{3}unpacked_int64\0\u{3}unpacked_uint32\0\u{3}unpacked_uint64\0\u{3}unpacked_sint32\0\u{3}unpacked_sint64\0\u{3}unpacked_fixed32\0\u{3}unpacked_fixed64\0\u{3}unpacked_sfixed32\0\u{3}unpacked_sfixed64\0\u{3}unpacked_float\0\u{3}unpacked_double\0\u{3}unpacked_bool\0\u{3}unpacked_nested_enum\0\u{4}\u{9}oneof_uint32\0\u{3}oneof_nested_message\0\u{3}oneof_string\0\u{3}oneof_bytes\0\u{3}oneof_bool\0\u{3}oneof_uint64\0\u{3}oneof_float\0\u{3}oneof_double\0\u{3}oneof_enum\0\u{8}R\u{1}GroupLikeType\0\u{3}delimited_field\0\u{4}c\u{1}map_recursive\0")

fileprivate class _StorageClass {
var _optionalInt32: Int32? = nil
Expand Down Expand Up @@ -1179,6 +1185,7 @@ nonisolated extension ProtobufTestMessages_Editions_TestAllTypesEdition2023: Swi
var _oneofField: ProtobufTestMessages_Editions_TestAllTypesEdition2023.OneOf_OneofField?
var _groupLikeType: ProtobufTestMessages_Editions_TestAllTypesEdition2023.GroupLikeType? = nil
var _delimitedField: ProtobufTestMessages_Editions_TestAllTypesEdition2023.GroupLikeType? = nil
var _mapRecursive: Dictionary<Int32,ProtobufTestMessages_Editions_TestAllTypesEdition2023> = [:]

// This property is used as the initial default value for new instances of the type.
// The type itself is protecting the reference to its storage via CoW semantics.
Expand Down Expand Up @@ -1282,6 +1289,7 @@ nonisolated extension ProtobufTestMessages_Editions_TestAllTypesEdition2023: Swi
_oneofField = source._oneofField
_groupLikeType = source._groupLikeType
_delimitedField = source._delimitedField
_mapRecursive = source._mapRecursive
}
}

Expand All @@ -1300,6 +1308,7 @@ nonisolated extension ProtobufTestMessages_Editions_TestAllTypesEdition2023: Swi
if !SwiftProtobuf.Internal.areAllInitialized(_storage._repeatedNestedMessage) {return false}
if !SwiftProtobuf.Internal.areAllInitialized(_storage._mapStringNestedMessage) {return false}
if let v = _storage._oneofField, !v.isInitialized {return false}
if !SwiftProtobuf.Internal.areAllInitialized(_storage._mapRecursive) {return false}
return true
}
}
Expand Down Expand Up @@ -1481,6 +1490,7 @@ nonisolated extension ProtobufTestMessages_Editions_TestAllTypesEdition2023: Swi
}()
case 201: try { try decoder.decodeSingularGroupField(value: &_storage._groupLikeType) }()
case 202: try { try decoder.decodeSingularGroupField(value: &_storage._delimitedField) }()
case 301: try { try decoder.decodeMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,ProtobufTestMessages_Editions_TestAllTypesEdition2023>.self, value: &_storage._mapRecursive) }()
case 120..<201:
try { try decoder.decodeExtensionField(values: &_protobuf_extensionFieldValues, messageType: ProtobufTestMessages_Editions_TestAllTypesEdition2023.self, fieldNumber: fieldNumber) }()
default: break
Expand Down Expand Up @@ -1811,6 +1821,9 @@ nonisolated extension ProtobufTestMessages_Editions_TestAllTypesEdition2023: Swi
try { if let v = _storage._delimitedField {
try visitor.visitSingularGroupField(value: v, fieldNumber: 202)
} }()
if !_storage._mapRecursive.isEmpty {
try visitor.visitMapField(fieldType: SwiftProtobuf._ProtobufMessageMap<SwiftProtobuf.ProtobufInt32,ProtobufTestMessages_Editions_TestAllTypesEdition2023>.self, value: _storage._mapRecursive, fieldNumber: 301)
}
}
try unknownFields.traverse(visitor: &visitor)
}
Expand Down Expand Up @@ -1913,6 +1926,7 @@ nonisolated extension ProtobufTestMessages_Editions_TestAllTypesEdition2023: Swi
if _storage._oneofField != rhs_storage._oneofField {return false}
if _storage._groupLikeType != rhs_storage._groupLikeType {return false}
if _storage._delimitedField != rhs_storage._delimitedField {return false}
if _storage._mapRecursive != rhs_storage._mapRecursive {return false}
return true
}
if !storagesAreEqual {return false}
Expand Down
150 changes: 48 additions & 102 deletions Reference/upstream/google/protobuf/any.pb.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,127 +58,73 @@ fileprivate nonisolated struct _GeneratedWithProtocGenSwiftVersion: ProtobufAPIV
/// `Any` contains an arbitrary serialized protocol buffer message along with a
/// URL that describes the type of the serialized message.
///
/// Protobuf library provides support to pack/unpack Any values in the form
/// of utility functions or additional generated methods of the Any type.
/// In its binary encoding, an `Any` is an ordinary message; but in other wire
/// forms like JSON, it has a special encoding. The format of the type URL is
/// described on the `type_url` field.
///
/// Example 1: Pack and unpack a message in C++.
/// Protobuf APIs provide utilities to interact with `Any` values:
///
/// Foo foo = ...;
/// Any any;
/// any.PackFrom(foo);
/// ...
/// if (any.UnpackTo(&foo)) {
/// ...
/// }
/// - A 'pack' operation accepts a message and constructs a generic `Any` wrapper
/// around it.
/// - An 'unpack' operation reads the content of an `Any` message, either into an
/// existing message or a new one. Unpack operations must check the type of the
/// value they unpack against the declared `type_url`.
/// - An 'is' operation decides whether an `Any` contains a message of the given
/// type, i.e. whether it can 'unpack' that type.
///
/// Example 2: Pack and unpack a message in Java.
/// The JSON format representation of an `Any` follows one of these cases:
///
/// Foo foo = ...;
/// Any any = Any.pack(foo);
/// ...
/// if (any.is(Foo.class)) {
/// foo = any.unpack(Foo.class);
/// }
/// // or ...
/// if (any.isSameTypeAs(Foo.getDefaultInstance())) {
/// foo = any.unpack(Foo.getDefaultInstance());
/// }
/// - For types without special-cased JSON encodings, the JSON format
/// representation of the `Any` is the same as that of the message, with an
/// additional `@type` field which contains the type URL.
/// - For types with special-cased JSON encodings (typically called 'well-known'
/// types, listed in https://protobuf.dev/programming-guides/json/#any), the
/// JSON format representation has a key `@type` which contains the type URL
/// and a key `value` which contains the JSON-serialized value.
///
/// Example 3: Pack and unpack a message in Python.
///
/// foo = Foo(...)
/// any = Any()
/// any.Pack(foo)
/// ...
/// if any.Is(Foo.DESCRIPTOR):
/// any.Unpack(foo)
/// ...
///
/// Example 4: Pack and unpack a message in Go
///
/// foo := &pb.Foo{...}
/// any, err := anypb.New(foo)
/// if err != nil {
/// ...
/// }
/// ...
/// foo := &pb.Foo{}
/// if err := any.UnmarshalTo(foo); err != nil {
/// ...
/// }
///
/// The pack methods provided by protobuf library will by default use
/// 'type.googleapis.com/full.type.name' as the type URL and the unpack
/// methods only use the fully qualified type name after the last '/'
/// 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:
///
/// package google.profile;
/// message Person {
/// string first_name = 1;
/// string last_name = 2;
/// }
///
/// {
/// "@type": "type.googleapis.com/google.profile.Person",
/// "firstName": <string>,
/// "lastName": <string>
/// }
///
/// If the embedded message type is well-known and has a custom JSON
/// representation, that representation will be embedded adding a field
/// `value` which holds the custom JSON in addition to the `@type`
/// field. Example (for message [google.protobuf.Duration][]):
///
/// {
/// "@type": "type.googleapis.com/google.protobuf.Duration",
/// "value": "1.212s"
/// }
/// The text format representation of an `Any` is like a message with one field
/// whose name is the type URL in brackets. For example, an `Any` containing a
/// `foo.Bar` message may be written `[type.googleapis.com/foo.Bar] { a: 2 }`.
nonisolated struct Google_Protobuf_Any: @unchecked Sendable {
// SwiftProtobuf.Message conformance is added in an extension below. See the
// `Message` and `Message+*Additions` files in the SwiftProtobuf library for
// methods supported on all messages.

/// A URL/resource name that uniquely identifies the type of the serialized
/// protocol buffer message. This string must contain at least
/// one "/" character. The last segment of the URL's path must represent
/// the fully qualified name of the type (as in
/// `path/google.protobuf.Duration`). The name should be in a canonical form
/// (e.g., leading "." is not accepted).
/// Identifies the type of the serialized Protobuf message with a URI reference
/// consisting of a prefix ending in a slash and the fully-qualified type name.
///
/// Example: type.googleapis.com/google.protobuf.StringValue
///
/// In practice, teams usually precompile into the binary all types that they
/// expect it to use in the context of Any. However, for URLs which use the
/// scheme `http`, `https`, or no scheme, one can optionally set up a type
/// server that maps type URLs to message definitions as follows:
/// This string must contain at least one `/` character, and the content after
/// the last `/` must be the fully-qualified name of the type in canonical
/// form, without a leading dot. Do not write a scheme on these URI references
/// so that clients do not attempt to contact them.
///
/// * If no scheme is provided, `https` is assumed.
/// * An HTTP GET on the URL must yield a [google.protobuf.Type][]
/// value in binary format, or produce an error.
/// * Applications are allowed to cache lookup results based on the
/// URL, or have them precompiled into a binary to avoid any
/// lookup. Therefore, binary compatibility needs to be preserved
/// on changes to types. (Use versioned type names to manage
/// breaking changes.)
/// The prefix is arbitrary and Protobuf implementations are expected to
/// simply strip off everything up to and including the last `/` to identify
/// the type. `type.googleapis.com/` is a common default prefix that some
/// legacy implementations require. This prefix does not indicate the origin of
/// the type, and URIs containing it are not expected to respond to any
/// requests.
///
/// 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. As of May 2023, there are no widely used type server
/// implementations and no plans to implement one.
/// All type URL strings must be legal URI references with the additional
/// restriction (for the text format) that the content of the reference
/// must consist only of alphanumeric characters, percent-encoded escapes, and
/// characters in the following set (not including the outer backticks):
/// `/-.~_!$&()*+,;=`. Despite our allowing percent encodings, implementations
/// should not unescape them to prevent confusion with existing parsers. For
/// example, `type.googleapis.com%2FFoo` should be rejected.
///
/// Schemes other than `http`, `https` (or the empty scheme) might be
/// used with implementation specific semantics.
/// In the original design of `Any`, the possibility of launching a type
/// resolution service at these type URLs was considered but Protobuf never
/// implemented one and considers contacting these URLs to be problematic and
/// a potential security issue. Do not attempt to contact type URLs.
var typeURL: String {
get {_storage._typeURL}
set {_uniqueStorage()._typeURL = newValue}
}

/// Must be a valid serialized protocol buffer of the above specified type.
/// Holds a Protobuf serialization of the type described by type_url.
var value: Data {
get {_storage._value}
set {_uniqueStorage()._value = newValue}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1142,6 +1142,21 @@ nonisolated extension EditionUnittest_TestConflictingSymbolNames {
clearExtensionValue(ext: EditionUnittest_Extensions_void)
}

var EditionUnittest_module: Int32 {
get {return getExtensionValue(ext: EditionUnittest_Extensions_module) ?? 0}
set {setExtensionValue(ext: EditionUnittest_Extensions_module, value: newValue)}
}
/// Returns true if extension `EditionUnittest_Extensions_module`
/// has been explicitly set.
var hasEditionUnittest_module: Bool {
return hasExtensionValue(ext: EditionUnittest_Extensions_module)
}
/// Clears the value of extension `EditionUnittest_Extensions_module`.
/// Subsequent reads from it will return its default value.
mutating func clearEditionUnittest_module() {
clearExtensionValue(ext: EditionUnittest_Extensions_module)
}

var EditionUnittest_TestConflictingSymbolNamesExtension_repeatedInt32Ext: [Int32] {
get {return getExtensionValue(ext: EditionUnittest_TestConflictingSymbolNamesExtension.Extensions.repeated_int32_ext) ?? []}
set {setExtensionValue(ext: EditionUnittest_TestConflictingSymbolNamesExtension.Extensions.repeated_int32_ext, value: newValue)}
Expand Down Expand Up @@ -1315,6 +1330,7 @@ nonisolated let EditionUnittest_TestBadIdentifiersEditions_Extensions: SwiftProt
EditionUnittest_Extensions_default_instance,
EditionUnittest_Extensions_swap,
EditionUnittest_Extensions_void,
EditionUnittest_Extensions_module,
EditionUnittest_TestConflictingSymbolNames.BadKnownNamesValues.Extensions.unknown_fields,
EditionUnittest_TestConflictingSymbolNames.BadKnownNamesValues.Extensions.mutable_unknown_fields,
EditionUnittest_TestConflictingSymbolNames.BadKnownNamesValues.Extensions.descriptor,
Expand Down Expand Up @@ -1357,6 +1373,11 @@ nonisolated let EditionUnittest_Extensions_void = SwiftProtobuf.MessageExtension
fieldName: "edition_unittest.void"
)

nonisolated let EditionUnittest_Extensions_module = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalExtensionField<SwiftProtobuf.ProtobufInt32>, EditionUnittest_TestConflictingSymbolNames>(
_protobuf_fieldNumber: 314254,
fieldName: "edition_unittest.module"
)

nonisolated extension EditionUnittest_TestConflictingSymbolNames.BadKnownNamesValues {
enum Extensions {
static let unknown_fields = SwiftProtobuf.MessageExtension<SwiftProtobuf.OptionalExtensionField<SwiftProtobuf.ProtobufInt32>, EditionUnittest_TestConflictingSymbolNames.BadKnownNamesValues>(
Expand Down
Loading
Loading