From 86975301f1876ce1934612777b8ca6c76520f5cc Mon Sep 17 00:00:00 2001 From: Jisi Liu Date: Tue, 18 Jul 2017 15:44:24 -0700 Subject: Update csharp and php descriptor --- csharp/src/Google.Protobuf/WellKnownTypes/Any.cs | 10 +++++ csharp/src/Google.Protobuf/WellKnownTypes/Api.cs | 50 ++++++++++++++---------- 2 files changed, 39 insertions(+), 21 deletions(-) (limited to 'csharp/src/Google.Protobuf/WellKnownTypes') diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs index b90c9a2a..5b39b809 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Any.cs @@ -73,6 +73,16 @@ namespace Google.Protobuf.WellKnownTypes { /// any.Unpack(foo) /// ... /// + /// Example 4: Pack and unpack a message in Go + /// + /// foo := &pb.Foo{...} + /// any, err := ptypes.MarshalAny(foo) + /// ... + /// foo := &pb.Foo{} + /// if err := ptypes.UnmarshalAny(any, 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 '/' diff --git a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs index aeeb8e73..6705e092 100644 --- a/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs +++ b/csharp/src/Google.Protobuf/WellKnownTypes/Api.cs @@ -52,7 +52,15 @@ namespace Google.Protobuf.WellKnownTypes { } #region Messages /// - /// Api is a light-weight descriptor for a protocol buffer service. + /// Api is a light-weight descriptor for an API Interface. + /// + /// Interfaces are also described as "protocol buffer services" in some contexts, + /// such as by the "service" keyword in a .proto file, but they are different + /// from API Services, which represent a concrete implementation of an interface + /// as opposed to simply a description of methods and bindings. They are also + /// sometimes simply referred to as "APIs" in other contexts, such as the name of + /// this message itself. See https://cloud.google.com/apis/design/glossary for + /// detailed terminology. /// public sealed partial class Api : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Api()); @@ -96,8 +104,8 @@ namespace Google.Protobuf.WellKnownTypes { public const int NameFieldNumber = 1; private string name_ = ""; /// - /// The fully qualified name of this api, including package name - /// followed by the api's simple name. + /// The fully qualified name of this interface, including package name + /// followed by the interface's simple name. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Name { @@ -113,7 +121,7 @@ namespace Google.Protobuf.WellKnownTypes { = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Method.Parser); private readonly pbc::RepeatedField methods_ = new pbc::RepeatedField(); /// - /// The methods of this api, in unspecified order. + /// The methods of this interface, in unspecified order. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField Methods { @@ -126,7 +134,7 @@ namespace Google.Protobuf.WellKnownTypes { = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser); private readonly pbc::RepeatedField options_ = new pbc::RepeatedField(); /// - /// Any metadata attached to the API. + /// Any metadata attached to the interface. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField Options { @@ -137,13 +145,12 @@ namespace Google.Protobuf.WellKnownTypes { public const int VersionFieldNumber = 4; private string version_ = ""; /// - /// A version string for this api. If specified, must have the form - /// `major-version.minor-version`, as in `1.10`. If the minor version - /// is omitted, it defaults to zero. If the entire version field is - /// empty, the major version is derived from the package name, as - /// outlined below. If the field is not empty, the version in the - /// package name will be verified to be consistent with what is - /// provided here. + /// A version string for this interface. If specified, must have the form + /// `major-version.minor-version`, as in `1.10`. If the minor version is + /// omitted, it defaults to zero. If the entire version field is empty, the + /// major version is derived from the package name, as outlined below. If the + /// field is not empty, the version in the package name will be verified to be + /// consistent with what is provided here. /// /// The versioning schema uses [semantic /// versioning](http://semver.org) where the major version number @@ -153,10 +160,10 @@ namespace Google.Protobuf.WellKnownTypes { /// chosen based on the product plan. /// /// The major version is also reflected in the package name of the - /// API, which must end in `v<major-version>`, as in + /// interface, which must end in `v<major-version>`, as in /// `google.feature.v1`. For major versions 0 and 1, the suffix can /// be omitted. Zero major versions must only be used for - /// experimental, none-GA apis. + /// experimental, non-GA interfaces. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Version { @@ -187,7 +194,7 @@ namespace Google.Protobuf.WellKnownTypes { = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.WellKnownTypes.Mixin.Parser); private readonly pbc::RepeatedField mixins_ = new pbc::RepeatedField(); /// - /// Included APIs. See [Mixin][]. + /// Included interfaces. See [Mixin][]. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public pbc::RepeatedField Mixins { @@ -364,7 +371,7 @@ namespace Google.Protobuf.WellKnownTypes { } /// - /// Method represents a method of an api. + /// Method represents a method of an API interface. /// public sealed partial class Method : pb::IMessage { private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Method()); @@ -665,9 +672,9 @@ namespace Google.Protobuf.WellKnownTypes { } /// - /// Declares an API to be included in this API. The including API must - /// redeclare all the methods from the included API, but documentation - /// and options are inherited as follows: + /// Declares an API Interface to be included in this interface. The including + /// interface must redeclare all the methods from the included interface, but + /// documentation and options are inherited as follows: /// /// - If after comment and whitespace stripping, the documentation /// string of the redeclared method is empty, it will be inherited @@ -679,7 +686,8 @@ namespace Google.Protobuf.WellKnownTypes { /// /// - If an http annotation is inherited, the path pattern will be /// modified as follows. Any version prefix will be replaced by the - /// version of the including API plus the [root][] path if specified. + /// version of the including interface plus the [root][] path if + /// specified. /// /// Example of a simple mixin: /// @@ -780,7 +788,7 @@ namespace Google.Protobuf.WellKnownTypes { public const int NameFieldNumber = 1; private string name_ = ""; /// - /// The fully qualified name of the API which is included. + /// The fully qualified name of the interface which is included. /// [global::System.Diagnostics.DebuggerNonUserCodeAttribute] public string Name { -- cgit v1.2.3