| Index: third_party/protobuf/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs
|
| diff --git a/third_party/protobuf/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs b/third_party/protobuf/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs
|
| index efa60a6840c58b45472adc13fc6bacd92540dbc7..871a383f0d7df5fc9fd2c85f02a321cad2199c70 100644
|
| --- a/third_party/protobuf/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs
|
| +++ b/third_party/protobuf/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs
|
| @@ -24,13 +24,14 @@ namespace Google.Protobuf.WellKnownTypes {
|
| byte[] descriptorData = global::System.Convert.FromBase64String(
|
| string.Concat(
|
| "Chlnb29nbGUvcHJvdG9idWYvYW55LnByb3RvEg9nb29nbGUucHJvdG9idWYi",
|
| - "JgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQksKE2Nv",
|
| - "bS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAGgAQGiAgNHUEKqAh5Hb29n",
|
| - "bGUuUHJvdG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw=="));
|
| + "JgoDQW55EhAKCHR5cGVfdXJsGAEgASgJEg0KBXZhbHVlGAIgASgMQnIKE2Nv",
|
| + "bS5nb29nbGUucHJvdG9idWZCCEFueVByb3RvUAFaJWdpdGh1Yi5jb20vZ29s",
|
| + "YW5nL3Byb3RvYnVmL3B0eXBlcy9hbnmgAQGiAgNHUEKqAh5Hb29nbGUuUHJv",
|
| + "dG9idWYuV2VsbEtub3duVHlwZXNiBnByb3RvMw=="));
|
| descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
|
| new pbr::FileDescriptor[] { },
|
| - new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] {
|
| - new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Any), global::Google.Protobuf.WellKnownTypes.Any.Parser, new[]{ "TypeUrl", "Value" }, null, null, null)
|
| + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
|
| + new pbr::GeneratedClrTypeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Any), global::Google.Protobuf.WellKnownTypes.Any.Parser, new[]{ "TypeUrl", "Value" }, null, null, null)
|
| }));
|
| }
|
| #endregion
|
| @@ -38,8 +39,36 @@ namespace Google.Protobuf.WellKnownTypes {
|
| }
|
| #region Messages
|
| /// <summary>
|
| - /// `Any` contains an arbitrary serialized message along with a URL
|
| - /// that describes the type of the serialized message.
|
| + /// `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.
|
| + ///
|
| + /// Example 1: Pack and unpack a message in C++.
|
| + ///
|
| + /// Foo foo = ...;
|
| + /// Any any;
|
| + /// any.PackFrom(foo);
|
| + /// ...
|
| + /// if (any.UnpackTo(&foo)) {
|
| + /// ...
|
| + /// }
|
| + ///
|
| + /// Example 2: Pack and unpack a message in Java.
|
| + ///
|
| + /// Foo foo = ...;
|
| + /// Any any = Any.pack(foo);
|
| + /// ...
|
| + /// if (any.is(Foo.class)) {
|
| + /// foo = any.unpack(Foo.class);
|
| + /// }
|
| + ///
|
| + /// 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
|
| /// ====
|
| @@ -61,8 +90,8 @@ namespace Google.Protobuf.WellKnownTypes {
|
| ///
|
| /// 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 the `@type`
|
| - /// field. Example (for message [google.protobuf.Duration][google.protobuf.Duration]):
|
| + /// `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",
|
| @@ -102,7 +131,7 @@ namespace Google.Protobuf.WellKnownTypes {
|
| private string typeUrl_ = "";
|
| /// <summary>
|
| /// A URL/resource name whose content describes the type of the
|
| - /// serialized message.
|
| + /// serialized protocol buffer message.
|
| ///
|
| /// For URLs which use the schema `http`, `https`, or no schema, the
|
| /// following restrictions and interpretations apply:
|
| @@ -110,7 +139,9 @@ namespace Google.Protobuf.WellKnownTypes {
|
| /// * If no schema is provided, `https` is assumed.
|
| /// * The last segment of the URL's path must represent the fully
|
| /// qualified name of the type (as in `path/google.protobuf.Duration`).
|
| - /// * An HTTP GET on the URL must yield a [google.protobuf.Type][google.protobuf.Type]
|
| + /// The name should be in a canonical form (e.g., leading "." is
|
| + /// not accepted).
|
| + /// * 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
|
| @@ -124,7 +155,7 @@ namespace Google.Protobuf.WellKnownTypes {
|
| public string TypeUrl {
|
| get { return typeUrl_; }
|
| set {
|
| - typeUrl_ = pb::Preconditions.CheckNotNull(value, "value");
|
| + typeUrl_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
|
| }
|
| }
|
|
|
| @@ -132,12 +163,12 @@ namespace Google.Protobuf.WellKnownTypes {
|
| public const int ValueFieldNumber = 2;
|
| private pb::ByteString value_ = pb::ByteString.Empty;
|
| /// <summary>
|
| - /// Must be valid serialized data of the above specified type.
|
| + /// Must be a valid serialized protocol buffer of the above specified type.
|
| /// </summary>
|
| public pb::ByteString Value {
|
| get { return value_; }
|
| set {
|
| - value_ = pb::Preconditions.CheckNotNull(value, "value");
|
| + value_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
|
| }
|
| }
|
|
|
|
|