Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
| 2 | // source: google/protobuf/api.proto |
| 3 | #pragma warning disable 1591, 0612, 3021 |
| 4 | #region Designer generated code |
| 5 | |
| 6 | using pb = global::Google.Protobuf; |
| 7 | using pbc = global::Google.Protobuf.Collections; |
| 8 | using pbr = global::Google.Protobuf.Reflection; |
| 9 | using scg = global::System.Collections.Generic; |
| 10 | namespace Google.Protobuf.WellKnownTypes { |
| 11 | |
| 12 | namespace Proto { |
| 13 | |
Jon Skeet | b0888a4 | 2015-09-29 13:37:30 +0100 | [diff] [blame] | 14 | /// <summary>Holder for reflection information generated from google/protobuf/api.proto</summary> |
Jon Skeet | e2c8230 | 2015-09-29 14:34:31 +0100 | [diff] [blame] | 15 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 16 | public static partial class Api { |
| 17 | |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 18 | #region Descriptor |
Jon Skeet | b0888a4 | 2015-09-29 13:37:30 +0100 | [diff] [blame] | 19 | /// <summary>File descriptor for google/protobuf/api.proto</summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 20 | public static pbr::FileDescriptor Descriptor { |
| 21 | get { return descriptor; } |
| 22 | } |
| 23 | private static pbr::FileDescriptor descriptor; |
| 24 | |
| 25 | static Api() { |
| 26 | byte[] descriptorData = global::System.Convert.FromBase64String( |
| 27 | string.Concat( |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 28 | "Chlnb29nbGUvcHJvdG9idWYvYXBpLnByb3RvEg9nb29nbGUucHJvdG9idWYa", |
| 29 | "JGdvb2dsZS9wcm90b2J1Zi9zb3VyY2VfY29udGV4dC5wcm90bxoaZ29vZ2xl", |
| 30 | "L3Byb3RvYnVmL3R5cGUucHJvdG8igQIKA0FwaRIMCgRuYW1lGAEgASgJEigK", |
| 31 | "B21ldGhvZHMYAiADKAsyFy5nb29nbGUucHJvdG9idWYuTWV0aG9kEigKB29w", |
| 32 | "dGlvbnMYAyADKAsyFy5nb29nbGUucHJvdG9idWYuT3B0aW9uEg8KB3ZlcnNp", |
| 33 | "b24YBCABKAkSNgoOc291cmNlX2NvbnRleHQYBSABKAsyHi5nb29nbGUucHJv", |
| 34 | "dG9idWYuU291cmNlQ29udGV4dBImCgZtaXhpbnMYBiADKAsyFi5nb29nbGUu", |
| 35 | "cHJvdG9idWYuTWl4aW4SJwoGc3ludGF4GAcgASgOMhcuZ29vZ2xlLnByb3Rv", |
| 36 | "YnVmLlN5bnRheCLVAQoGTWV0aG9kEgwKBG5hbWUYASABKAkSGAoQcmVxdWVz", |
| 37 | "dF90eXBlX3VybBgCIAEoCRIZChFyZXF1ZXN0X3N0cmVhbWluZxgDIAEoCBIZ", |
| 38 | "ChFyZXNwb25zZV90eXBlX3VybBgEIAEoCRIaChJyZXNwb25zZV9zdHJlYW1p", |
| 39 | "bmcYBSABKAgSKAoHb3B0aW9ucxgGIAMoCzIXLmdvb2dsZS5wcm90b2J1Zi5P", |
| 40 | "cHRpb24SJwoGc3ludGF4GAcgASgOMhcuZ29vZ2xlLnByb3RvYnVmLlN5bnRh", |
| 41 | "eCIjCgVNaXhpbhIMCgRuYW1lGAEgASgJEgwKBHJvb3QYAiABKAlCSwoTY29t", |
| 42 | "Lmdvb2dsZS5wcm90b2J1ZkIIQXBpUHJvdG9QAaABAaICA0dQQqoCHkdvb2ds", |
| 43 | "ZS5Qcm90b2J1Zi5XZWxsS25vd25UeXBlc2IGcHJvdG8z")); |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 44 | descriptor = pbr::FileDescriptor.InternalBuildGeneratedFileFrom(descriptorData, |
Jon Skeet | 96cffaa | 2015-07-20 19:25:07 +0100 | [diff] [blame] | 45 | new pbr::FileDescriptor[] { global::Google.Protobuf.WellKnownTypes.Proto.SourceContext.Descriptor, global::Google.Protobuf.WellKnownTypes.Proto.Type.Descriptor, }, |
Jon Skeet | 47bf49b | 2015-07-22 11:39:38 +0100 | [diff] [blame] | 46 | new pbr::GeneratedCodeInfo(null, new pbr::GeneratedCodeInfo[] { |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 47 | new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Api), new[]{ "Name", "Methods", "Options", "Version", "SourceContext", "Mixins", "Syntax" }, null, null, null), |
| 48 | new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Method), new[]{ "Name", "RequestTypeUrl", "RequestStreaming", "ResponseTypeUrl", "ResponseStreaming", "Options", "Syntax" }, null, null, null), |
| 49 | new pbr::GeneratedCodeInfo(typeof(global::Google.Protobuf.WellKnownTypes.Mixin), new[]{ "Name", "Root" }, null, null, null) |
Jon Skeet | 47bf49b | 2015-07-22 11:39:38 +0100 | [diff] [blame] | 50 | })); |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 51 | } |
| 52 | #endregion |
| 53 | |
| 54 | } |
| 55 | } |
| 56 | #region Messages |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 57 | /// <summary> |
| 58 | /// Api is a light-weight descriptor for a protocol buffer service. |
| 59 | /// </summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 60 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
| 61 | public sealed partial class Api : pb::IMessage<Api> { |
| 62 | private static readonly pb::MessageParser<Api> _parser = new pb::MessageParser<Api>(() => new Api()); |
| 63 | public static pb::MessageParser<Api> Parser { get { return _parser; } } |
| 64 | |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 65 | public static pbr::MessageDescriptor Descriptor { |
| 66 | get { return global::Google.Protobuf.WellKnownTypes.Proto.Api.Descriptor.MessageTypes[0]; } |
| 67 | } |
| 68 | |
Jon Skeet | 96cffaa | 2015-07-20 19:25:07 +0100 | [diff] [blame] | 69 | pbr::MessageDescriptor pb::IMessage.Descriptor { |
| 70 | get { return Descriptor; } |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 71 | } |
| 72 | |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 73 | public Api() { |
| 74 | OnConstruction(); |
| 75 | } |
| 76 | |
| 77 | partial void OnConstruction(); |
| 78 | |
| 79 | public Api(Api other) : this() { |
| 80 | name_ = other.name_; |
| 81 | methods_ = other.methods_.Clone(); |
| 82 | options_ = other.options_.Clone(); |
| 83 | version_ = other.version_; |
| 84 | SourceContext = other.sourceContext_ != null ? other.SourceContext.Clone() : null; |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 85 | mixins_ = other.mixins_.Clone(); |
| 86 | syntax_ = other.syntax_; |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 87 | } |
| 88 | |
| 89 | public Api Clone() { |
| 90 | return new Api(this); |
| 91 | } |
| 92 | |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 93 | /// <summary>Field number for the "name" field.</summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 94 | public const int NameFieldNumber = 1; |
| 95 | private string name_ = ""; |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 96 | /// <summary> |
| 97 | /// The fully qualified name of this api, including package name |
| 98 | /// followed by the api's simple name. |
| 99 | /// </summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 100 | public string Name { |
| 101 | get { return name_; } |
| 102 | set { |
Jon Skeet | d18cc08 | 2015-07-30 13:50:02 +0100 | [diff] [blame] | 103 | name_ = pb::Preconditions.CheckNotNull(value, "value"); |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 104 | } |
| 105 | } |
| 106 | |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 107 | /// <summary>Field number for the "methods" field.</summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 108 | public const int MethodsFieldNumber = 2; |
| 109 | private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Method> _repeated_methods_codec |
| 110 | = pb::FieldCodec.ForMessage(18, global::Google.Protobuf.WellKnownTypes.Method.Parser); |
| 111 | private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Method> methods_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Method>(); |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 112 | /// <summary> |
| 113 | /// The methods of this api, in unspecified order. |
| 114 | /// </summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 115 | public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Method> Methods { |
| 116 | get { return methods_; } |
| 117 | } |
| 118 | |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 119 | /// <summary>Field number for the "options" field.</summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 120 | public const int OptionsFieldNumber = 3; |
| 121 | private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec |
| 122 | = pb::FieldCodec.ForMessage(26, global::Google.Protobuf.WellKnownTypes.Option.Parser); |
| 123 | private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>(); |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 124 | /// <summary> |
| 125 | /// Any metadata attached to the API. |
| 126 | /// </summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 127 | public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options { |
| 128 | get { return options_; } |
| 129 | } |
| 130 | |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 131 | /// <summary>Field number for the "version" field.</summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 132 | public const int VersionFieldNumber = 4; |
| 133 | private string version_ = ""; |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 134 | /// <summary> |
| 135 | /// A version string for this api. If specified, must have the form |
| 136 | /// `major-version.minor-version`, as in `1.10`. If the minor version |
| 137 | /// is omitted, it defaults to zero. If the entire version field is |
| 138 | /// empty, the major version is derived from the package name, as |
| 139 | /// outlined below. If the field is not empty, the version in the |
| 140 | /// package name will be verified to be consistent with what is |
| 141 | /// provided here. |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame^] | 142 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 143 | /// The versioning schema uses [semantic |
| 144 | /// versioning](http://semver.org) where the major version number |
| 145 | /// indicates a breaking change and the minor version an additive, |
| 146 | /// non-breaking change. Both version numbers are signals to users |
| 147 | /// what to expect from different versions, and should be carefully |
| 148 | /// chosen based on the product plan. |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame^] | 149 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 150 | /// The major version is also reflected in the package name of the |
| 151 | /// API, which must end in `v<major-version>`, as in |
| 152 | /// `google.feature.v1`. For major versions 0 and 1, the suffix can |
| 153 | /// be omitted. Zero major versions must only be used for |
| 154 | /// experimental, none-GA apis. |
| 155 | /// </summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 156 | public string Version { |
| 157 | get { return version_; } |
| 158 | set { |
Jon Skeet | d18cc08 | 2015-07-30 13:50:02 +0100 | [diff] [blame] | 159 | version_ = pb::Preconditions.CheckNotNull(value, "value"); |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 160 | } |
| 161 | } |
| 162 | |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 163 | /// <summary>Field number for the "source_context" field.</summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 164 | public const int SourceContextFieldNumber = 5; |
| 165 | private global::Google.Protobuf.WellKnownTypes.SourceContext sourceContext_; |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 166 | /// <summary> |
| 167 | /// Source context for the protocol buffer service represented by this |
| 168 | /// message. |
| 169 | /// </summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 170 | public global::Google.Protobuf.WellKnownTypes.SourceContext SourceContext { |
| 171 | get { return sourceContext_; } |
| 172 | set { |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 173 | sourceContext_ = value; |
| 174 | } |
| 175 | } |
| 176 | |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 177 | /// <summary>Field number for the "mixins" field.</summary> |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 178 | public const int MixinsFieldNumber = 6; |
| 179 | private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Mixin> _repeated_mixins_codec |
| 180 | = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.WellKnownTypes.Mixin.Parser); |
| 181 | private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Mixin> mixins_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Mixin>(); |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 182 | /// <summary> |
| 183 | /// Included APIs. See [Mixin][]. |
| 184 | /// </summary> |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 185 | public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Mixin> Mixins { |
| 186 | get { return mixins_; } |
| 187 | } |
| 188 | |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 189 | /// <summary>Field number for the "syntax" field.</summary> |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 190 | public const int SyntaxFieldNumber = 7; |
| 191 | private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2; |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 192 | /// <summary> |
| 193 | /// The source syntax of the service. |
| 194 | /// </summary> |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 195 | public global::Google.Protobuf.WellKnownTypes.Syntax Syntax { |
| 196 | get { return syntax_; } |
| 197 | set { |
| 198 | syntax_ = value; |
| 199 | } |
| 200 | } |
| 201 | |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 202 | public override bool Equals(object other) { |
| 203 | return Equals(other as Api); |
| 204 | } |
| 205 | |
| 206 | public bool Equals(Api other) { |
| 207 | if (ReferenceEquals(other, null)) { |
| 208 | return false; |
| 209 | } |
| 210 | if (ReferenceEquals(other, this)) { |
| 211 | return true; |
| 212 | } |
| 213 | if (Name != other.Name) return false; |
| 214 | if(!methods_.Equals(other.methods_)) return false; |
| 215 | if(!options_.Equals(other.options_)) return false; |
| 216 | if (Version != other.Version) return false; |
| 217 | if (!object.Equals(SourceContext, other.SourceContext)) return false; |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 218 | if(!mixins_.Equals(other.mixins_)) return false; |
| 219 | if (Syntax != other.Syntax) return false; |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 220 | return true; |
| 221 | } |
| 222 | |
| 223 | public override int GetHashCode() { |
| 224 | int hash = 1; |
| 225 | if (Name.Length != 0) hash ^= Name.GetHashCode(); |
| 226 | hash ^= methods_.GetHashCode(); |
| 227 | hash ^= options_.GetHashCode(); |
| 228 | if (Version.Length != 0) hash ^= Version.GetHashCode(); |
| 229 | if (sourceContext_ != null) hash ^= SourceContext.GetHashCode(); |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 230 | hash ^= mixins_.GetHashCode(); |
| 231 | if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) hash ^= Syntax.GetHashCode(); |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 232 | return hash; |
| 233 | } |
| 234 | |
| 235 | public override string ToString() { |
| 236 | return pb::JsonFormatter.Default.Format(this); |
| 237 | } |
| 238 | |
| 239 | public void WriteTo(pb::CodedOutputStream output) { |
| 240 | if (Name.Length != 0) { |
| 241 | output.WriteRawTag(10); |
| 242 | output.WriteString(Name); |
| 243 | } |
| 244 | methods_.WriteTo(output, _repeated_methods_codec); |
| 245 | options_.WriteTo(output, _repeated_options_codec); |
| 246 | if (Version.Length != 0) { |
| 247 | output.WriteRawTag(34); |
| 248 | output.WriteString(Version); |
| 249 | } |
| 250 | if (sourceContext_ != null) { |
| 251 | output.WriteRawTag(42); |
| 252 | output.WriteMessage(SourceContext); |
| 253 | } |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 254 | mixins_.WriteTo(output, _repeated_mixins_codec); |
| 255 | if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { |
| 256 | output.WriteRawTag(56); |
| 257 | output.WriteEnum((int) Syntax); |
| 258 | } |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 259 | } |
| 260 | |
| 261 | public int CalculateSize() { |
| 262 | int size = 0; |
| 263 | if (Name.Length != 0) { |
| 264 | size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); |
| 265 | } |
| 266 | size += methods_.CalculateSize(_repeated_methods_codec); |
| 267 | size += options_.CalculateSize(_repeated_options_codec); |
| 268 | if (Version.Length != 0) { |
| 269 | size += 1 + pb::CodedOutputStream.ComputeStringSize(Version); |
| 270 | } |
| 271 | if (sourceContext_ != null) { |
| 272 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(SourceContext); |
| 273 | } |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 274 | size += mixins_.CalculateSize(_repeated_mixins_codec); |
| 275 | if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { |
| 276 | size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax); |
| 277 | } |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 278 | return size; |
| 279 | } |
| 280 | |
| 281 | public void MergeFrom(Api other) { |
| 282 | if (other == null) { |
| 283 | return; |
| 284 | } |
| 285 | if (other.Name.Length != 0) { |
| 286 | Name = other.Name; |
| 287 | } |
| 288 | methods_.Add(other.methods_); |
| 289 | options_.Add(other.options_); |
| 290 | if (other.Version.Length != 0) { |
| 291 | Version = other.Version; |
| 292 | } |
| 293 | if (other.sourceContext_ != null) { |
| 294 | if (sourceContext_ == null) { |
| 295 | sourceContext_ = new global::Google.Protobuf.WellKnownTypes.SourceContext(); |
| 296 | } |
| 297 | SourceContext.MergeFrom(other.SourceContext); |
| 298 | } |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 299 | mixins_.Add(other.mixins_); |
| 300 | if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { |
| 301 | Syntax = other.Syntax; |
| 302 | } |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 303 | } |
| 304 | |
| 305 | public void MergeFrom(pb::CodedInputStream input) { |
| 306 | uint tag; |
Jon Skeet | 1a57ad8 | 2015-08-05 11:23:52 +0100 | [diff] [blame] | 307 | while ((tag = input.ReadTag()) != 0) { |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 308 | switch(tag) { |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 309 | default: |
Jon Skeet | 5bdc572 | 2015-08-06 11:40:43 +0100 | [diff] [blame] | 310 | input.SkipLastField(); |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 311 | break; |
| 312 | case 10: { |
| 313 | Name = input.ReadString(); |
| 314 | break; |
| 315 | } |
| 316 | case 18: { |
| 317 | methods_.AddEntriesFrom(input, _repeated_methods_codec); |
| 318 | break; |
| 319 | } |
| 320 | case 26: { |
| 321 | options_.AddEntriesFrom(input, _repeated_options_codec); |
| 322 | break; |
| 323 | } |
| 324 | case 34: { |
| 325 | Version = input.ReadString(); |
| 326 | break; |
| 327 | } |
| 328 | case 42: { |
| 329 | if (sourceContext_ == null) { |
| 330 | sourceContext_ = new global::Google.Protobuf.WellKnownTypes.SourceContext(); |
| 331 | } |
| 332 | input.ReadMessage(sourceContext_); |
| 333 | break; |
| 334 | } |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 335 | case 50: { |
| 336 | mixins_.AddEntriesFrom(input, _repeated_mixins_codec); |
| 337 | break; |
| 338 | } |
| 339 | case 56: { |
| 340 | syntax_ = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); |
| 341 | break; |
| 342 | } |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 343 | } |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | } |
| 348 | |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 349 | /// <summary> |
| 350 | /// Method represents a method of an api. |
| 351 | /// </summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 352 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
| 353 | public sealed partial class Method : pb::IMessage<Method> { |
| 354 | private static readonly pb::MessageParser<Method> _parser = new pb::MessageParser<Method>(() => new Method()); |
| 355 | public static pb::MessageParser<Method> Parser { get { return _parser; } } |
| 356 | |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 357 | public static pbr::MessageDescriptor Descriptor { |
| 358 | get { return global::Google.Protobuf.WellKnownTypes.Proto.Api.Descriptor.MessageTypes[1]; } |
| 359 | } |
| 360 | |
Jon Skeet | 96cffaa | 2015-07-20 19:25:07 +0100 | [diff] [blame] | 361 | pbr::MessageDescriptor pb::IMessage.Descriptor { |
| 362 | get { return Descriptor; } |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 363 | } |
| 364 | |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 365 | public Method() { |
| 366 | OnConstruction(); |
| 367 | } |
| 368 | |
| 369 | partial void OnConstruction(); |
| 370 | |
| 371 | public Method(Method other) : this() { |
| 372 | name_ = other.name_; |
| 373 | requestTypeUrl_ = other.requestTypeUrl_; |
| 374 | requestStreaming_ = other.requestStreaming_; |
| 375 | responseTypeUrl_ = other.responseTypeUrl_; |
| 376 | responseStreaming_ = other.responseStreaming_; |
| 377 | options_ = other.options_.Clone(); |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 378 | syntax_ = other.syntax_; |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 379 | } |
| 380 | |
| 381 | public Method Clone() { |
| 382 | return new Method(this); |
| 383 | } |
| 384 | |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 385 | /// <summary>Field number for the "name" field.</summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 386 | public const int NameFieldNumber = 1; |
| 387 | private string name_ = ""; |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 388 | /// <summary> |
| 389 | /// The simple name of this method. |
| 390 | /// </summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 391 | public string Name { |
| 392 | get { return name_; } |
| 393 | set { |
Jon Skeet | d18cc08 | 2015-07-30 13:50:02 +0100 | [diff] [blame] | 394 | name_ = pb::Preconditions.CheckNotNull(value, "value"); |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 395 | } |
| 396 | } |
| 397 | |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 398 | /// <summary>Field number for the "request_type_url" field.</summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 399 | public const int RequestTypeUrlFieldNumber = 2; |
| 400 | private string requestTypeUrl_ = ""; |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 401 | /// <summary> |
| 402 | /// A URL of the input message type. |
| 403 | /// </summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 404 | public string RequestTypeUrl { |
| 405 | get { return requestTypeUrl_; } |
| 406 | set { |
Jon Skeet | d18cc08 | 2015-07-30 13:50:02 +0100 | [diff] [blame] | 407 | requestTypeUrl_ = pb::Preconditions.CheckNotNull(value, "value"); |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 408 | } |
| 409 | } |
| 410 | |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 411 | /// <summary>Field number for the "request_streaming" field.</summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 412 | public const int RequestStreamingFieldNumber = 3; |
| 413 | private bool requestStreaming_; |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 414 | /// <summary> |
| 415 | /// If true, the request is streamed. |
| 416 | /// </summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 417 | public bool RequestStreaming { |
| 418 | get { return requestStreaming_; } |
| 419 | set { |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 420 | requestStreaming_ = value; |
| 421 | } |
| 422 | } |
| 423 | |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 424 | /// <summary>Field number for the "response_type_url" field.</summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 425 | public const int ResponseTypeUrlFieldNumber = 4; |
| 426 | private string responseTypeUrl_ = ""; |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 427 | /// <summary> |
| 428 | /// The URL of the output message type. |
| 429 | /// </summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 430 | public string ResponseTypeUrl { |
| 431 | get { return responseTypeUrl_; } |
| 432 | set { |
Jon Skeet | d18cc08 | 2015-07-30 13:50:02 +0100 | [diff] [blame] | 433 | responseTypeUrl_ = pb::Preconditions.CheckNotNull(value, "value"); |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 434 | } |
| 435 | } |
| 436 | |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 437 | /// <summary>Field number for the "response_streaming" field.</summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 438 | public const int ResponseStreamingFieldNumber = 5; |
| 439 | private bool responseStreaming_; |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 440 | /// <summary> |
| 441 | /// If true, the response is streamed. |
| 442 | /// </summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 443 | public bool ResponseStreaming { |
| 444 | get { return responseStreaming_; } |
| 445 | set { |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 446 | responseStreaming_ = value; |
| 447 | } |
| 448 | } |
| 449 | |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 450 | /// <summary>Field number for the "options" field.</summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 451 | public const int OptionsFieldNumber = 6; |
| 452 | private static readonly pb::FieldCodec<global::Google.Protobuf.WellKnownTypes.Option> _repeated_options_codec |
| 453 | = pb::FieldCodec.ForMessage(50, global::Google.Protobuf.WellKnownTypes.Option.Parser); |
| 454 | private readonly pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> options_ = new pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option>(); |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 455 | /// <summary> |
| 456 | /// Any metadata attached to the method. |
| 457 | /// </summary> |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 458 | public pbc::RepeatedField<global::Google.Protobuf.WellKnownTypes.Option> Options { |
| 459 | get { return options_; } |
| 460 | } |
| 461 | |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 462 | /// <summary>Field number for the "syntax" field.</summary> |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 463 | public const int SyntaxFieldNumber = 7; |
| 464 | private global::Google.Protobuf.WellKnownTypes.Syntax syntax_ = global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2; |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 465 | /// <summary> |
| 466 | /// The source syntax of this method. |
| 467 | /// </summary> |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 468 | public global::Google.Protobuf.WellKnownTypes.Syntax Syntax { |
| 469 | get { return syntax_; } |
| 470 | set { |
| 471 | syntax_ = value; |
| 472 | } |
| 473 | } |
| 474 | |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 475 | public override bool Equals(object other) { |
| 476 | return Equals(other as Method); |
| 477 | } |
| 478 | |
| 479 | public bool Equals(Method other) { |
| 480 | if (ReferenceEquals(other, null)) { |
| 481 | return false; |
| 482 | } |
| 483 | if (ReferenceEquals(other, this)) { |
| 484 | return true; |
| 485 | } |
| 486 | if (Name != other.Name) return false; |
| 487 | if (RequestTypeUrl != other.RequestTypeUrl) return false; |
| 488 | if (RequestStreaming != other.RequestStreaming) return false; |
| 489 | if (ResponseTypeUrl != other.ResponseTypeUrl) return false; |
| 490 | if (ResponseStreaming != other.ResponseStreaming) return false; |
| 491 | if(!options_.Equals(other.options_)) return false; |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 492 | if (Syntax != other.Syntax) return false; |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 493 | return true; |
| 494 | } |
| 495 | |
| 496 | public override int GetHashCode() { |
| 497 | int hash = 1; |
| 498 | if (Name.Length != 0) hash ^= Name.GetHashCode(); |
| 499 | if (RequestTypeUrl.Length != 0) hash ^= RequestTypeUrl.GetHashCode(); |
| 500 | if (RequestStreaming != false) hash ^= RequestStreaming.GetHashCode(); |
| 501 | if (ResponseTypeUrl.Length != 0) hash ^= ResponseTypeUrl.GetHashCode(); |
| 502 | if (ResponseStreaming != false) hash ^= ResponseStreaming.GetHashCode(); |
| 503 | hash ^= options_.GetHashCode(); |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 504 | if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) hash ^= Syntax.GetHashCode(); |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 505 | return hash; |
| 506 | } |
| 507 | |
| 508 | public override string ToString() { |
| 509 | return pb::JsonFormatter.Default.Format(this); |
| 510 | } |
| 511 | |
| 512 | public void WriteTo(pb::CodedOutputStream output) { |
| 513 | if (Name.Length != 0) { |
| 514 | output.WriteRawTag(10); |
| 515 | output.WriteString(Name); |
| 516 | } |
| 517 | if (RequestTypeUrl.Length != 0) { |
| 518 | output.WriteRawTag(18); |
| 519 | output.WriteString(RequestTypeUrl); |
| 520 | } |
| 521 | if (RequestStreaming != false) { |
| 522 | output.WriteRawTag(24); |
| 523 | output.WriteBool(RequestStreaming); |
| 524 | } |
| 525 | if (ResponseTypeUrl.Length != 0) { |
| 526 | output.WriteRawTag(34); |
| 527 | output.WriteString(ResponseTypeUrl); |
| 528 | } |
| 529 | if (ResponseStreaming != false) { |
| 530 | output.WriteRawTag(40); |
| 531 | output.WriteBool(ResponseStreaming); |
| 532 | } |
| 533 | options_.WriteTo(output, _repeated_options_codec); |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 534 | if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { |
| 535 | output.WriteRawTag(56); |
| 536 | output.WriteEnum((int) Syntax); |
| 537 | } |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 538 | } |
| 539 | |
| 540 | public int CalculateSize() { |
| 541 | int size = 0; |
| 542 | if (Name.Length != 0) { |
| 543 | size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); |
| 544 | } |
| 545 | if (RequestTypeUrl.Length != 0) { |
| 546 | size += 1 + pb::CodedOutputStream.ComputeStringSize(RequestTypeUrl); |
| 547 | } |
| 548 | if (RequestStreaming != false) { |
| 549 | size += 1 + 1; |
| 550 | } |
| 551 | if (ResponseTypeUrl.Length != 0) { |
| 552 | size += 1 + pb::CodedOutputStream.ComputeStringSize(ResponseTypeUrl); |
| 553 | } |
| 554 | if (ResponseStreaming != false) { |
| 555 | size += 1 + 1; |
| 556 | } |
| 557 | size += options_.CalculateSize(_repeated_options_codec); |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 558 | if (Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { |
| 559 | size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Syntax); |
| 560 | } |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 561 | return size; |
| 562 | } |
| 563 | |
| 564 | public void MergeFrom(Method other) { |
| 565 | if (other == null) { |
| 566 | return; |
| 567 | } |
| 568 | if (other.Name.Length != 0) { |
| 569 | Name = other.Name; |
| 570 | } |
| 571 | if (other.RequestTypeUrl.Length != 0) { |
| 572 | RequestTypeUrl = other.RequestTypeUrl; |
| 573 | } |
| 574 | if (other.RequestStreaming != false) { |
| 575 | RequestStreaming = other.RequestStreaming; |
| 576 | } |
| 577 | if (other.ResponseTypeUrl.Length != 0) { |
| 578 | ResponseTypeUrl = other.ResponseTypeUrl; |
| 579 | } |
| 580 | if (other.ResponseStreaming != false) { |
| 581 | ResponseStreaming = other.ResponseStreaming; |
| 582 | } |
| 583 | options_.Add(other.options_); |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 584 | if (other.Syntax != global::Google.Protobuf.WellKnownTypes.Syntax.SYNTAX_PROTO2) { |
| 585 | Syntax = other.Syntax; |
| 586 | } |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 587 | } |
| 588 | |
| 589 | public void MergeFrom(pb::CodedInputStream input) { |
| 590 | uint tag; |
Jon Skeet | 1a57ad8 | 2015-08-05 11:23:52 +0100 | [diff] [blame] | 591 | while ((tag = input.ReadTag()) != 0) { |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 592 | switch(tag) { |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 593 | default: |
Jon Skeet | 5bdc572 | 2015-08-06 11:40:43 +0100 | [diff] [blame] | 594 | input.SkipLastField(); |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 595 | break; |
| 596 | case 10: { |
| 597 | Name = input.ReadString(); |
| 598 | break; |
| 599 | } |
| 600 | case 18: { |
| 601 | RequestTypeUrl = input.ReadString(); |
| 602 | break; |
| 603 | } |
| 604 | case 24: { |
| 605 | RequestStreaming = input.ReadBool(); |
| 606 | break; |
| 607 | } |
| 608 | case 34: { |
| 609 | ResponseTypeUrl = input.ReadString(); |
| 610 | break; |
| 611 | } |
| 612 | case 40: { |
| 613 | ResponseStreaming = input.ReadBool(); |
| 614 | break; |
| 615 | } |
| 616 | case 50: { |
| 617 | options_.AddEntriesFrom(input, _repeated_options_codec); |
| 618 | break; |
| 619 | } |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 620 | case 56: { |
| 621 | syntax_ = (global::Google.Protobuf.WellKnownTypes.Syntax) input.ReadEnum(); |
| 622 | break; |
| 623 | } |
| 624 | } |
| 625 | } |
| 626 | } |
| 627 | |
| 628 | } |
| 629 | |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 630 | /// <summary> |
| 631 | /// Declares an API to be included in this API. The including API must |
| 632 | /// redeclare all the methods from the included API, but documentation |
| 633 | /// and options are inherited as follows: |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame^] | 634 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 635 | /// - If after comment and whitespace stripping, the documentation |
| 636 | /// string of the redeclared method is empty, it will be inherited |
| 637 | /// from the original method. |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame^] | 638 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 639 | /// - Each annotation belonging to the service config (http, |
| 640 | /// visibility) which is not set in the redeclared method will be |
| 641 | /// inherited. |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame^] | 642 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 643 | /// - If an http annotation is inherited, the path pattern will be |
| 644 | /// modified as follows. Any version prefix will be replaced by the |
| 645 | /// version of the including API plus the [root][] path if specified. |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame^] | 646 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 647 | /// Example of a simple mixin: |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame^] | 648 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 649 | /// package google.acl.v1; |
| 650 | /// service AccessControl { |
| 651 | /// // Get the underlying ACL object. |
| 652 | /// rpc GetAcl(GetAclRequest) returns (Acl) { |
| 653 | /// option (google.api.http).get = "/v1/{resource=**}:getAcl"; |
| 654 | /// } |
| 655 | /// } |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame^] | 656 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 657 | /// package google.storage.v2; |
| 658 | /// service Storage { |
| 659 | /// // (-- see AccessControl.GetAcl --) |
| 660 | /// rpc GetAcl(GetAclRequest) returns (Acl); |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame^] | 661 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 662 | /// // Get a data record. |
| 663 | /// rpc GetData(GetDataRequest) returns (Data) { |
| 664 | /// option (google.api.http).get = "/v2/{resource=**}"; |
| 665 | /// } |
| 666 | /// } |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame^] | 667 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 668 | /// Example of a mixin configuration: |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame^] | 669 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 670 | /// apis: |
| 671 | /// - name: google.storage.v2.Storage |
| 672 | /// mixins: |
| 673 | /// - name: google.acl.v1.AccessControl |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame^] | 674 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 675 | /// The mixin construct implies that all methods in `AccessControl` are |
| 676 | /// also declared with same name and request/response types in |
| 677 | /// `Storage`. A documentation generator or annotation processor will |
| 678 | /// see the effective `Storage.GetAcl` method after inherting |
| 679 | /// documentation and annotations as follows: |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame^] | 680 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 681 | /// service Storage { |
| 682 | /// // Get the underlying ACL object. |
| 683 | /// rpc GetAcl(GetAclRequest) returns (Acl) { |
| 684 | /// option (google.api.http).get = "/v2/{resource=**}:getAcl"; |
| 685 | /// } |
| 686 | /// ... |
| 687 | /// } |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame^] | 688 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 689 | /// Note how the version in the path pattern changed from `v1` to `v2`. |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame^] | 690 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 691 | /// If the `root` field in the mixin is specified, it should be a |
| 692 | /// relative path under which inherited HTTP paths are placed. Example: |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame^] | 693 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 694 | /// apis: |
| 695 | /// - name: google.storage.v2.Storage |
| 696 | /// mixins: |
| 697 | /// - name: google.acl.v1.AccessControl |
| 698 | /// root: acls |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame^] | 699 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 700 | /// This implies the following inherited HTTP annotation: |
Jon Skeet | cff900e | 2015-11-06 18:38:31 +0000 | [diff] [blame^] | 701 | /// |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 702 | /// service Storage { |
| 703 | /// // Get the underlying ACL object. |
| 704 | /// rpc GetAcl(GetAclRequest) returns (Acl) { |
| 705 | /// option (google.api.http).get = "/v2/acls/{resource=**}:getAcl"; |
| 706 | /// } |
| 707 | /// ... |
| 708 | /// } |
| 709 | /// </summary> |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 710 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
| 711 | public sealed partial class Mixin : pb::IMessage<Mixin> { |
| 712 | private static readonly pb::MessageParser<Mixin> _parser = new pb::MessageParser<Mixin>(() => new Mixin()); |
| 713 | public static pb::MessageParser<Mixin> Parser { get { return _parser; } } |
| 714 | |
| 715 | public static pbr::MessageDescriptor Descriptor { |
| 716 | get { return global::Google.Protobuf.WellKnownTypes.Proto.Api.Descriptor.MessageTypes[2]; } |
| 717 | } |
| 718 | |
| 719 | pbr::MessageDescriptor pb::IMessage.Descriptor { |
| 720 | get { return Descriptor; } |
| 721 | } |
| 722 | |
| 723 | public Mixin() { |
| 724 | OnConstruction(); |
| 725 | } |
| 726 | |
| 727 | partial void OnConstruction(); |
| 728 | |
| 729 | public Mixin(Mixin other) : this() { |
| 730 | name_ = other.name_; |
| 731 | root_ = other.root_; |
| 732 | } |
| 733 | |
| 734 | public Mixin Clone() { |
| 735 | return new Mixin(this); |
| 736 | } |
| 737 | |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 738 | /// <summary>Field number for the "name" field.</summary> |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 739 | public const int NameFieldNumber = 1; |
| 740 | private string name_ = ""; |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 741 | /// <summary> |
| 742 | /// The fully qualified name of the API which is included. |
| 743 | /// </summary> |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 744 | public string Name { |
| 745 | get { return name_; } |
| 746 | set { |
| 747 | name_ = pb::Preconditions.CheckNotNull(value, "value"); |
| 748 | } |
| 749 | } |
| 750 | |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 751 | /// <summary>Field number for the "root" field.</summary> |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 752 | public const int RootFieldNumber = 2; |
| 753 | private string root_ = ""; |
Jon Skeet | 18e0a2e | 2015-10-01 10:38:01 +0100 | [diff] [blame] | 754 | /// <summary> |
| 755 | /// If non-empty specifies a path under which inherited HTTP paths |
| 756 | /// are rooted. |
| 757 | /// </summary> |
Jon Skeet | 9489817 | 2015-09-01 15:47:48 +0100 | [diff] [blame] | 758 | public string Root { |
| 759 | get { return root_; } |
| 760 | set { |
| 761 | root_ = pb::Preconditions.CheckNotNull(value, "value"); |
| 762 | } |
| 763 | } |
| 764 | |
| 765 | public override bool Equals(object other) { |
| 766 | return Equals(other as Mixin); |
| 767 | } |
| 768 | |
| 769 | public bool Equals(Mixin other) { |
| 770 | if (ReferenceEquals(other, null)) { |
| 771 | return false; |
| 772 | } |
| 773 | if (ReferenceEquals(other, this)) { |
| 774 | return true; |
| 775 | } |
| 776 | if (Name != other.Name) return false; |
| 777 | if (Root != other.Root) return false; |
| 778 | return true; |
| 779 | } |
| 780 | |
| 781 | public override int GetHashCode() { |
| 782 | int hash = 1; |
| 783 | if (Name.Length != 0) hash ^= Name.GetHashCode(); |
| 784 | if (Root.Length != 0) hash ^= Root.GetHashCode(); |
| 785 | return hash; |
| 786 | } |
| 787 | |
| 788 | public override string ToString() { |
| 789 | return pb::JsonFormatter.Default.Format(this); |
| 790 | } |
| 791 | |
| 792 | public void WriteTo(pb::CodedOutputStream output) { |
| 793 | if (Name.Length != 0) { |
| 794 | output.WriteRawTag(10); |
| 795 | output.WriteString(Name); |
| 796 | } |
| 797 | if (Root.Length != 0) { |
| 798 | output.WriteRawTag(18); |
| 799 | output.WriteString(Root); |
| 800 | } |
| 801 | } |
| 802 | |
| 803 | public int CalculateSize() { |
| 804 | int size = 0; |
| 805 | if (Name.Length != 0) { |
| 806 | size += 1 + pb::CodedOutputStream.ComputeStringSize(Name); |
| 807 | } |
| 808 | if (Root.Length != 0) { |
| 809 | size += 1 + pb::CodedOutputStream.ComputeStringSize(Root); |
| 810 | } |
| 811 | return size; |
| 812 | } |
| 813 | |
| 814 | public void MergeFrom(Mixin other) { |
| 815 | if (other == null) { |
| 816 | return; |
| 817 | } |
| 818 | if (other.Name.Length != 0) { |
| 819 | Name = other.Name; |
| 820 | } |
| 821 | if (other.Root.Length != 0) { |
| 822 | Root = other.Root; |
| 823 | } |
| 824 | } |
| 825 | |
| 826 | public void MergeFrom(pb::CodedInputStream input) { |
| 827 | uint tag; |
| 828 | while ((tag = input.ReadTag()) != 0) { |
| 829 | switch(tag) { |
| 830 | default: |
| 831 | input.SkipLastField(); |
| 832 | break; |
| 833 | case 10: { |
| 834 | Name = input.ReadString(); |
| 835 | break; |
| 836 | } |
| 837 | case 18: { |
| 838 | Root = input.ReadString(); |
| 839 | break; |
| 840 | } |
Jon Skeet | 62a4aa5 | 2015-07-14 14:26:49 +0100 | [diff] [blame] | 841 | } |
| 842 | } |
| 843 | } |
| 844 | |
| 845 | } |
| 846 | |
| 847 | #endregion |
| 848 | |
| 849 | } |
| 850 | |
| 851 | #endregion Designer generated code |