Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 2 | // source: src/proto/grpc/testing/messages.proto |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 3 | #pragma warning disable 1591, 0612, 3021 |
| 4 | #region Designer generated code |
Jan Tattermusch | a7608b0 | 2015-02-03 17:54:38 -0800 | [diff] [blame] | 5 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 6 | using pb = global::Google.Protobuf; |
| 7 | using pbc = global::Google.Protobuf.Collections; |
| 8 | using pbr = global::Google.Protobuf.Reflection; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 9 | using scg = global::System.Collections.Generic; |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 10 | namespace Grpc.Testing { |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 11 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 12 | /// <summary>Holder for reflection information generated from src/proto/grpc/testing/messages.proto</summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 13 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 14 | public static partial class MessagesReflection { |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 15 | |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 16 | #region Descriptor |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 17 | /// <summary>File descriptor for src/proto/grpc/testing/messages.proto</summary> |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 18 | public static pbr::FileDescriptor Descriptor { |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 19 | get { return descriptor; } |
| 20 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 21 | private static pbr::FileDescriptor descriptor; |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 22 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 23 | static MessagesReflection() { |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 24 | byte[] descriptorData = global::System.Convert.FromBase64String( |
| 25 | string.Concat( |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 26 | "CiVzcmMvcHJvdG8vZ3JwYy90ZXN0aW5nL21lc3NhZ2VzLnByb3RvEgxncnBj", |
| 27 | "LnRlc3RpbmciQAoHUGF5bG9hZBInCgR0eXBlGAEgASgOMhkuZ3JwYy50ZXN0", |
| 28 | "aW5nLlBheWxvYWRUeXBlEgwKBGJvZHkYAiABKAwiKwoKRWNob1N0YXR1cxIM", |
| 29 | "CgRjb2RlGAEgASgFEg8KB21lc3NhZ2UYAiABKAkioQIKDVNpbXBsZVJlcXVl", |
| 30 | "c3QSMAoNcmVzcG9uc2VfdHlwZRgBIAEoDjIZLmdycGMudGVzdGluZy5QYXls", |
| 31 | "b2FkVHlwZRIVCg1yZXNwb25zZV9zaXplGAIgASgFEiYKB3BheWxvYWQYAyAB", |
| 32 | "KAsyFS5ncnBjLnRlc3RpbmcuUGF5bG9hZBIVCg1maWxsX3VzZXJuYW1lGAQg", |
| 33 | "ASgIEhgKEGZpbGxfb2F1dGhfc2NvcGUYBSABKAgSOwoUcmVzcG9uc2VfY29t", |
| 34 | "cHJlc3Npb24YBiABKA4yHS5ncnBjLnRlc3RpbmcuQ29tcHJlc3Npb25UeXBl", |
| 35 | "EjEKD3Jlc3BvbnNlX3N0YXR1cxgHIAEoCzIYLmdycGMudGVzdGluZy5FY2hv", |
| 36 | "U3RhdHVzIl8KDlNpbXBsZVJlc3BvbnNlEiYKB3BheWxvYWQYASABKAsyFS5n", |
| 37 | "cnBjLnRlc3RpbmcuUGF5bG9hZBIQCgh1c2VybmFtZRgCIAEoCRITCgtvYXV0", |
| 38 | "aF9zY29wZRgDIAEoCSJDChlTdHJlYW1pbmdJbnB1dENhbGxSZXF1ZXN0EiYK", |
| 39 | "B3BheWxvYWQYASABKAsyFS5ncnBjLnRlc3RpbmcuUGF5bG9hZCI9ChpTdHJl", |
| 40 | "YW1pbmdJbnB1dENhbGxSZXNwb25zZRIfChdhZ2dyZWdhdGVkX3BheWxvYWRf", |
| 41 | "c2l6ZRgBIAEoBSI3ChJSZXNwb25zZVBhcmFtZXRlcnMSDAoEc2l6ZRgBIAEo", |
| 42 | "BRITCgtpbnRlcnZhbF91cxgCIAEoBSKlAgoaU3RyZWFtaW5nT3V0cHV0Q2Fs", |
| 43 | "bFJlcXVlc3QSMAoNcmVzcG9uc2VfdHlwZRgBIAEoDjIZLmdycGMudGVzdGlu", |
| 44 | "Zy5QYXlsb2FkVHlwZRI9ChNyZXNwb25zZV9wYXJhbWV0ZXJzGAIgAygLMiAu", |
| 45 | "Z3JwYy50ZXN0aW5nLlJlc3BvbnNlUGFyYW1ldGVycxImCgdwYXlsb2FkGAMg", |
| 46 | "ASgLMhUuZ3JwYy50ZXN0aW5nLlBheWxvYWQSOwoUcmVzcG9uc2VfY29tcHJl", |
| 47 | "c3Npb24YBiABKA4yHS5ncnBjLnRlc3RpbmcuQ29tcHJlc3Npb25UeXBlEjEK", |
| 48 | "D3Jlc3BvbnNlX3N0YXR1cxgHIAEoCzIYLmdycGMudGVzdGluZy5FY2hvU3Rh", |
| 49 | "dHVzIkUKG1N0cmVhbWluZ091dHB1dENhbGxSZXNwb25zZRImCgdwYXlsb2Fk", |
| 50 | "GAEgASgLMhUuZ3JwYy50ZXN0aW5nLlBheWxvYWQiMwoNUmVjb25uZWN0SW5m", |
| 51 | "bxIOCgZwYXNzZWQYASABKAgSEgoKYmFja29mZl9tcxgCIAMoBSo/CgtQYXls", |
| 52 | "b2FkVHlwZRIQCgxDT01QUkVTU0FCTEUQABISCg5VTkNPTVBSRVNTQUJMRRAB", |
| 53 | "EgoKBlJBTkRPTRACKjIKD0NvbXByZXNzaW9uVHlwZRIICgROT05FEAASCAoE", |
| 54 | "R1pJUBABEgsKB0RFRkxBVEUQAmIGcHJvdG8z")); |
| 55 | descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 56 | new pbr::FileDescriptor[] { }, |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 57 | new pbr::GeneratedCodeInfo(new[] {typeof(global::Grpc.Testing.PayloadType), typeof(global::Grpc.Testing.CompressionType), }, new pbr::GeneratedCodeInfo[] { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 58 | new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.Payload), global::Grpc.Testing.Payload.Parser, new[]{ "Type", "Body" }, null, null, null), |
| 59 | new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.EchoStatus), global::Grpc.Testing.EchoStatus.Parser, new[]{ "Code", "Message" }, null, null, null), |
| 60 | new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.SimpleRequest), global::Grpc.Testing.SimpleRequest.Parser, new[]{ "ResponseType", "ResponseSize", "Payload", "FillUsername", "FillOauthScope", "ResponseCompression", "ResponseStatus" }, null, null, null), |
| 61 | new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.SimpleResponse), global::Grpc.Testing.SimpleResponse.Parser, new[]{ "Payload", "Username", "OauthScope" }, null, null, null), |
| 62 | new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.StreamingInputCallRequest), global::Grpc.Testing.StreamingInputCallRequest.Parser, new[]{ "Payload" }, null, null, null), |
| 63 | new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.StreamingInputCallResponse), global::Grpc.Testing.StreamingInputCallResponse.Parser, new[]{ "AggregatedPayloadSize" }, null, null, null), |
| 64 | new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.ResponseParameters), global::Grpc.Testing.ResponseParameters.Parser, new[]{ "Size", "IntervalUs" }, null, null, null), |
| 65 | new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.StreamingOutputCallRequest), global::Grpc.Testing.StreamingOutputCallRequest.Parser, new[]{ "ResponseType", "ResponseParameters", "Payload", "ResponseCompression", "ResponseStatus" }, null, null, null), |
| 66 | new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.StreamingOutputCallResponse), global::Grpc.Testing.StreamingOutputCallResponse.Parser, new[]{ "Payload" }, null, null, null), |
| 67 | new pbr::GeneratedCodeInfo(typeof(global::Grpc.Testing.ReconnectInfo), global::Grpc.Testing.ReconnectInfo.Parser, new[]{ "Passed", "BackoffMs" }, null, null, null) |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 68 | })); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 69 | } |
| 70 | #endregion |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 71 | |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 72 | } |
| 73 | #region Enums |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 74 | /// <summary> |
| 75 | /// The type of payload that should be returned. |
| 76 | /// </summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 77 | public enum PayloadType { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 78 | /// <summary> |
| 79 | /// Compressable text format. |
| 80 | /// </summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 81 | COMPRESSABLE = 0, |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 82 | /// <summary> |
| 83 | /// Uncompressable binary format. |
| 84 | /// </summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 85 | UNCOMPRESSABLE = 1, |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 86 | /// <summary> |
| 87 | /// Randomly chosen from all other formats defined in this enum. |
| 88 | /// </summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 89 | RANDOM = 2, |
| 90 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 91 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 92 | /// <summary> |
| 93 | /// Compression algorithms |
| 94 | /// </summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 95 | public enum CompressionType { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 96 | /// <summary> |
| 97 | /// No compression |
| 98 | /// </summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 99 | NONE = 0, |
| 100 | GZIP = 1, |
| 101 | DEFLATE = 2, |
| 102 | } |
| 103 | |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 104 | #endregion |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 105 | |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 106 | #region Messages |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 107 | /// <summary> |
| 108 | /// A block of data, to simply increase gRPC message size. |
| 109 | /// </summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 110 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 111 | public sealed partial class Payload : pb::IMessage<Payload> { |
| 112 | private static readonly pb::MessageParser<Payload> _parser = new pb::MessageParser<Payload>(() => new Payload()); |
| 113 | public static pb::MessageParser<Payload> Parser { get { return _parser; } } |
| 114 | |
| 115 | public static pbr::MessageDescriptor Descriptor { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 116 | get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[0]; } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 117 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 118 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 119 | pbr::MessageDescriptor pb::IMessage.Descriptor { |
| 120 | get { return Descriptor; } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 121 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 122 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 123 | public Payload() { |
| 124 | OnConstruction(); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 125 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 126 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 127 | partial void OnConstruction(); |
| 128 | |
| 129 | public Payload(Payload other) : this() { |
| 130 | type_ = other.type_; |
| 131 | body_ = other.body_; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 132 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 133 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 134 | public Payload Clone() { |
| 135 | return new Payload(this); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 136 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 137 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 138 | /// <summary>Field number for the "type" field.</summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 139 | public const int TypeFieldNumber = 1; |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 140 | private global::Grpc.Testing.PayloadType type_ = global::Grpc.Testing.PayloadType.COMPRESSABLE; |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 141 | /// <summary> |
| 142 | /// The type of data in body. |
| 143 | /// </summary> |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 144 | public global::Grpc.Testing.PayloadType Type { |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 145 | get { return type_; } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 146 | set { |
| 147 | type_ = value; |
| 148 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 149 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 150 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 151 | /// <summary>Field number for the "body" field.</summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 152 | public const int BodyFieldNumber = 2; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 153 | private pb::ByteString body_ = pb::ByteString.Empty; |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 154 | /// <summary> |
| 155 | /// Primary contents of payload. |
| 156 | /// </summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 157 | public pb::ByteString Body { |
| 158 | get { return body_; } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 159 | set { |
| 160 | body_ = pb::Preconditions.CheckNotNull(value, "value"); |
| 161 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 162 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 163 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 164 | public override bool Equals(object other) { |
| 165 | return Equals(other as Payload); |
| 166 | } |
| 167 | |
| 168 | public bool Equals(Payload other) { |
| 169 | if (ReferenceEquals(other, null)) { |
| 170 | return false; |
| 171 | } |
| 172 | if (ReferenceEquals(other, this)) { |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 173 | return true; |
| 174 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 175 | if (Type != other.Type) return false; |
| 176 | if (Body != other.Body) return false; |
| 177 | return true; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 178 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 179 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 180 | public override int GetHashCode() { |
| 181 | int hash = 1; |
| 182 | if (Type != global::Grpc.Testing.PayloadType.COMPRESSABLE) hash ^= Type.GetHashCode(); |
| 183 | if (Body.Length != 0) hash ^= Body.GetHashCode(); |
| 184 | return hash; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 185 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 186 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 187 | public override string ToString() { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 188 | return pb::JsonFormatter.ToDiagnosticString(this); |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 189 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 190 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 191 | public void WriteTo(pb::CodedOutputStream output) { |
| 192 | if (Type != global::Grpc.Testing.PayloadType.COMPRESSABLE) { |
| 193 | output.WriteRawTag(8); |
| 194 | output.WriteEnum((int) Type); |
| 195 | } |
| 196 | if (Body.Length != 0) { |
| 197 | output.WriteRawTag(18); |
| 198 | output.WriteBytes(Body); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 199 | } |
| 200 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 201 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 202 | public int CalculateSize() { |
| 203 | int size = 0; |
| 204 | if (Type != global::Grpc.Testing.PayloadType.COMPRESSABLE) { |
| 205 | size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type); |
| 206 | } |
| 207 | if (Body.Length != 0) { |
| 208 | size += 1 + pb::CodedOutputStream.ComputeBytesSize(Body); |
| 209 | } |
| 210 | return size; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 211 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 212 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 213 | public void MergeFrom(Payload other) { |
| 214 | if (other == null) { |
| 215 | return; |
| 216 | } |
| 217 | if (other.Type != global::Grpc.Testing.PayloadType.COMPRESSABLE) { |
| 218 | Type = other.Type; |
| 219 | } |
| 220 | if (other.Body.Length != 0) { |
| 221 | Body = other.Body; |
| 222 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 223 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 224 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 225 | public void MergeFrom(pb::CodedInputStream input) { |
| 226 | uint tag; |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 227 | while ((tag = input.ReadTag()) != 0) { |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 228 | switch(tag) { |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 229 | default: |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 230 | input.SkipLastField(); |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 231 | break; |
| 232 | case 8: { |
| 233 | type_ = (global::Grpc.Testing.PayloadType) input.ReadEnum(); |
| 234 | break; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 235 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 236 | case 18: { |
| 237 | Body = input.ReadBytes(); |
| 238 | break; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 239 | } |
| 240 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 241 | } |
| 242 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 243 | |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 244 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 245 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 246 | /// <summary> |
| 247 | /// A protobuf representation for grpc status. This is used by test |
| 248 | /// clients to specify a status that the server should attempt to return. |
| 249 | /// </summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 250 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 251 | public sealed partial class EchoStatus : pb::IMessage<EchoStatus> { |
| 252 | private static readonly pb::MessageParser<EchoStatus> _parser = new pb::MessageParser<EchoStatus>(() => new EchoStatus()); |
| 253 | public static pb::MessageParser<EchoStatus> Parser { get { return _parser; } } |
| 254 | |
| 255 | public static pbr::MessageDescriptor Descriptor { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 256 | get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[1]; } |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 257 | } |
| 258 | |
| 259 | pbr::MessageDescriptor pb::IMessage.Descriptor { |
| 260 | get { return Descriptor; } |
| 261 | } |
| 262 | |
| 263 | public EchoStatus() { |
| 264 | OnConstruction(); |
| 265 | } |
| 266 | |
| 267 | partial void OnConstruction(); |
| 268 | |
| 269 | public EchoStatus(EchoStatus other) : this() { |
| 270 | code_ = other.code_; |
| 271 | message_ = other.message_; |
| 272 | } |
| 273 | |
| 274 | public EchoStatus Clone() { |
| 275 | return new EchoStatus(this); |
| 276 | } |
| 277 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 278 | /// <summary>Field number for the "code" field.</summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 279 | public const int CodeFieldNumber = 1; |
| 280 | private int code_; |
| 281 | public int Code { |
| 282 | get { return code_; } |
| 283 | set { |
| 284 | code_ = value; |
| 285 | } |
| 286 | } |
| 287 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 288 | /// <summary>Field number for the "message" field.</summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 289 | public const int MessageFieldNumber = 2; |
| 290 | private string message_ = ""; |
| 291 | public string Message { |
| 292 | get { return message_; } |
| 293 | set { |
| 294 | message_ = pb::Preconditions.CheckNotNull(value, "value"); |
| 295 | } |
| 296 | } |
| 297 | |
| 298 | public override bool Equals(object other) { |
| 299 | return Equals(other as EchoStatus); |
| 300 | } |
| 301 | |
| 302 | public bool Equals(EchoStatus other) { |
| 303 | if (ReferenceEquals(other, null)) { |
| 304 | return false; |
| 305 | } |
| 306 | if (ReferenceEquals(other, this)) { |
| 307 | return true; |
| 308 | } |
| 309 | if (Code != other.Code) return false; |
| 310 | if (Message != other.Message) return false; |
| 311 | return true; |
| 312 | } |
| 313 | |
| 314 | public override int GetHashCode() { |
| 315 | int hash = 1; |
| 316 | if (Code != 0) hash ^= Code.GetHashCode(); |
| 317 | if (Message.Length != 0) hash ^= Message.GetHashCode(); |
| 318 | return hash; |
| 319 | } |
| 320 | |
| 321 | public override string ToString() { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 322 | return pb::JsonFormatter.ToDiagnosticString(this); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 323 | } |
| 324 | |
| 325 | public void WriteTo(pb::CodedOutputStream output) { |
| 326 | if (Code != 0) { |
| 327 | output.WriteRawTag(8); |
| 328 | output.WriteInt32(Code); |
| 329 | } |
| 330 | if (Message.Length != 0) { |
| 331 | output.WriteRawTag(18); |
| 332 | output.WriteString(Message); |
| 333 | } |
| 334 | } |
| 335 | |
| 336 | public int CalculateSize() { |
| 337 | int size = 0; |
| 338 | if (Code != 0) { |
| 339 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(Code); |
| 340 | } |
| 341 | if (Message.Length != 0) { |
| 342 | size += 1 + pb::CodedOutputStream.ComputeStringSize(Message); |
| 343 | } |
| 344 | return size; |
| 345 | } |
| 346 | |
| 347 | public void MergeFrom(EchoStatus other) { |
| 348 | if (other == null) { |
| 349 | return; |
| 350 | } |
| 351 | if (other.Code != 0) { |
| 352 | Code = other.Code; |
| 353 | } |
| 354 | if (other.Message.Length != 0) { |
| 355 | Message = other.Message; |
| 356 | } |
| 357 | } |
| 358 | |
| 359 | public void MergeFrom(pb::CodedInputStream input) { |
| 360 | uint tag; |
| 361 | while ((tag = input.ReadTag()) != 0) { |
| 362 | switch(tag) { |
| 363 | default: |
| 364 | input.SkipLastField(); |
| 365 | break; |
| 366 | case 8: { |
| 367 | Code = input.ReadInt32(); |
| 368 | break; |
| 369 | } |
| 370 | case 18: { |
| 371 | Message = input.ReadString(); |
| 372 | break; |
| 373 | } |
| 374 | } |
| 375 | } |
| 376 | } |
| 377 | |
| 378 | } |
| 379 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 380 | /// <summary> |
| 381 | /// Unary request. |
| 382 | /// </summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 383 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 384 | public sealed partial class SimpleRequest : pb::IMessage<SimpleRequest> { |
| 385 | private static readonly pb::MessageParser<SimpleRequest> _parser = new pb::MessageParser<SimpleRequest>(() => new SimpleRequest()); |
| 386 | public static pb::MessageParser<SimpleRequest> Parser { get { return _parser; } } |
| 387 | |
| 388 | public static pbr::MessageDescriptor Descriptor { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 389 | get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[2]; } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 390 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 391 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 392 | pbr::MessageDescriptor pb::IMessage.Descriptor { |
| 393 | get { return Descriptor; } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 394 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 395 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 396 | public SimpleRequest() { |
| 397 | OnConstruction(); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 398 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 399 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 400 | partial void OnConstruction(); |
| 401 | |
| 402 | public SimpleRequest(SimpleRequest other) : this() { |
| 403 | responseType_ = other.responseType_; |
| 404 | responseSize_ = other.responseSize_; |
| 405 | Payload = other.payload_ != null ? other.Payload.Clone() : null; |
| 406 | fillUsername_ = other.fillUsername_; |
| 407 | fillOauthScope_ = other.fillOauthScope_; |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 408 | responseCompression_ = other.responseCompression_; |
| 409 | ResponseStatus = other.responseStatus_ != null ? other.ResponseStatus.Clone() : null; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 410 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 411 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 412 | public SimpleRequest Clone() { |
| 413 | return new SimpleRequest(this); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 414 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 415 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 416 | /// <summary>Field number for the "response_type" field.</summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 417 | public const int ResponseTypeFieldNumber = 1; |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 418 | private global::Grpc.Testing.PayloadType responseType_ = global::Grpc.Testing.PayloadType.COMPRESSABLE; |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 419 | /// <summary> |
| 420 | /// Desired payload type in the response from the server. |
| 421 | /// If response_type is RANDOM, server randomly chooses one from other formats. |
| 422 | /// </summary> |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 423 | public global::Grpc.Testing.PayloadType ResponseType { |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 424 | get { return responseType_; } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 425 | set { |
| 426 | responseType_ = value; |
| 427 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 428 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 429 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 430 | /// <summary>Field number for the "response_size" field.</summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 431 | public const int ResponseSizeFieldNumber = 2; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 432 | private int responseSize_; |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 433 | /// <summary> |
| 434 | /// Desired payload size in the response from the server. |
| 435 | /// If response_type is COMPRESSABLE, this denotes the size before compression. |
| 436 | /// </summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 437 | public int ResponseSize { |
| 438 | get { return responseSize_; } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 439 | set { |
| 440 | responseSize_ = value; |
| 441 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 442 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 443 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 444 | /// <summary>Field number for the "payload" field.</summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 445 | public const int PayloadFieldNumber = 3; |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 446 | private global::Grpc.Testing.Payload payload_; |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 447 | /// <summary> |
| 448 | /// Optional input payload sent along with the request. |
| 449 | /// </summary> |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 450 | public global::Grpc.Testing.Payload Payload { |
| 451 | get { return payload_; } |
| 452 | set { |
| 453 | payload_ = value; |
| 454 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 455 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 456 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 457 | /// <summary>Field number for the "fill_username" field.</summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 458 | public const int FillUsernameFieldNumber = 4; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 459 | private bool fillUsername_; |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 460 | /// <summary> |
| 461 | /// Whether SimpleResponse should include username. |
| 462 | /// </summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 463 | public bool FillUsername { |
| 464 | get { return fillUsername_; } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 465 | set { |
| 466 | fillUsername_ = value; |
| 467 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 468 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 469 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 470 | /// <summary>Field number for the "fill_oauth_scope" field.</summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 471 | public const int FillOauthScopeFieldNumber = 5; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 472 | private bool fillOauthScope_; |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 473 | /// <summary> |
| 474 | /// Whether SimpleResponse should include OAuth scope. |
| 475 | /// </summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 476 | public bool FillOauthScope { |
| 477 | get { return fillOauthScope_; } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 478 | set { |
| 479 | fillOauthScope_ = value; |
| 480 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 481 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 482 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 483 | /// <summary>Field number for the "response_compression" field.</summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 484 | public const int ResponseCompressionFieldNumber = 6; |
| 485 | private global::Grpc.Testing.CompressionType responseCompression_ = global::Grpc.Testing.CompressionType.NONE; |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 486 | /// <summary> |
| 487 | /// Compression algorithm to be used by the server for the response (stream) |
| 488 | /// </summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 489 | public global::Grpc.Testing.CompressionType ResponseCompression { |
| 490 | get { return responseCompression_; } |
| 491 | set { |
| 492 | responseCompression_ = value; |
| 493 | } |
| 494 | } |
| 495 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 496 | /// <summary>Field number for the "response_status" field.</summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 497 | public const int ResponseStatusFieldNumber = 7; |
| 498 | private global::Grpc.Testing.EchoStatus responseStatus_; |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 499 | /// <summary> |
| 500 | /// Whether server should return a given status |
| 501 | /// </summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 502 | public global::Grpc.Testing.EchoStatus ResponseStatus { |
| 503 | get { return responseStatus_; } |
| 504 | set { |
| 505 | responseStatus_ = value; |
| 506 | } |
| 507 | } |
| 508 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 509 | public override bool Equals(object other) { |
| 510 | return Equals(other as SimpleRequest); |
| 511 | } |
| 512 | |
| 513 | public bool Equals(SimpleRequest other) { |
| 514 | if (ReferenceEquals(other, null)) { |
| 515 | return false; |
| 516 | } |
| 517 | if (ReferenceEquals(other, this)) { |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 518 | return true; |
| 519 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 520 | if (ResponseType != other.ResponseType) return false; |
| 521 | if (ResponseSize != other.ResponseSize) return false; |
| 522 | if (!object.Equals(Payload, other.Payload)) return false; |
| 523 | if (FillUsername != other.FillUsername) return false; |
| 524 | if (FillOauthScope != other.FillOauthScope) return false; |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 525 | if (ResponseCompression != other.ResponseCompression) return false; |
| 526 | if (!object.Equals(ResponseStatus, other.ResponseStatus)) return false; |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 527 | return true; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 528 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 529 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 530 | public override int GetHashCode() { |
| 531 | int hash = 1; |
| 532 | if (ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) hash ^= ResponseType.GetHashCode(); |
| 533 | if (ResponseSize != 0) hash ^= ResponseSize.GetHashCode(); |
| 534 | if (payload_ != null) hash ^= Payload.GetHashCode(); |
| 535 | if (FillUsername != false) hash ^= FillUsername.GetHashCode(); |
| 536 | if (FillOauthScope != false) hash ^= FillOauthScope.GetHashCode(); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 537 | if (ResponseCompression != global::Grpc.Testing.CompressionType.NONE) hash ^= ResponseCompression.GetHashCode(); |
| 538 | if (responseStatus_ != null) hash ^= ResponseStatus.GetHashCode(); |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 539 | return hash; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 540 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 541 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 542 | public override string ToString() { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 543 | return pb::JsonFormatter.ToDiagnosticString(this); |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 544 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 545 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 546 | public void WriteTo(pb::CodedOutputStream output) { |
| 547 | if (ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) { |
| 548 | output.WriteRawTag(8); |
| 549 | output.WriteEnum((int) ResponseType); |
| 550 | } |
| 551 | if (ResponseSize != 0) { |
| 552 | output.WriteRawTag(16); |
| 553 | output.WriteInt32(ResponseSize); |
| 554 | } |
| 555 | if (payload_ != null) { |
| 556 | output.WriteRawTag(26); |
| 557 | output.WriteMessage(Payload); |
| 558 | } |
| 559 | if (FillUsername != false) { |
| 560 | output.WriteRawTag(32); |
| 561 | output.WriteBool(FillUsername); |
| 562 | } |
| 563 | if (FillOauthScope != false) { |
| 564 | output.WriteRawTag(40); |
| 565 | output.WriteBool(FillOauthScope); |
| 566 | } |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 567 | if (ResponseCompression != global::Grpc.Testing.CompressionType.NONE) { |
| 568 | output.WriteRawTag(48); |
| 569 | output.WriteEnum((int) ResponseCompression); |
| 570 | } |
| 571 | if (responseStatus_ != null) { |
| 572 | output.WriteRawTag(58); |
| 573 | output.WriteMessage(ResponseStatus); |
| 574 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 575 | } |
| 576 | |
| 577 | public int CalculateSize() { |
| 578 | int size = 0; |
| 579 | if (ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) { |
| 580 | size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ResponseType); |
| 581 | } |
| 582 | if (ResponseSize != 0) { |
| 583 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(ResponseSize); |
| 584 | } |
| 585 | if (payload_ != null) { |
| 586 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Payload); |
| 587 | } |
| 588 | if (FillUsername != false) { |
| 589 | size += 1 + 1; |
| 590 | } |
| 591 | if (FillOauthScope != false) { |
| 592 | size += 1 + 1; |
| 593 | } |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 594 | if (ResponseCompression != global::Grpc.Testing.CompressionType.NONE) { |
| 595 | size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ResponseCompression); |
| 596 | } |
| 597 | if (responseStatus_ != null) { |
| 598 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(ResponseStatus); |
| 599 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 600 | return size; |
| 601 | } |
| 602 | |
| 603 | public void MergeFrom(SimpleRequest other) { |
| 604 | if (other == null) { |
| 605 | return; |
| 606 | } |
| 607 | if (other.ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) { |
| 608 | ResponseType = other.ResponseType; |
| 609 | } |
| 610 | if (other.ResponseSize != 0) { |
| 611 | ResponseSize = other.ResponseSize; |
| 612 | } |
| 613 | if (other.payload_ != null) { |
| 614 | if (payload_ == null) { |
| 615 | payload_ = new global::Grpc.Testing.Payload(); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 616 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 617 | Payload.MergeFrom(other.Payload); |
| 618 | } |
| 619 | if (other.FillUsername != false) { |
| 620 | FillUsername = other.FillUsername; |
| 621 | } |
| 622 | if (other.FillOauthScope != false) { |
| 623 | FillOauthScope = other.FillOauthScope; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 624 | } |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 625 | if (other.ResponseCompression != global::Grpc.Testing.CompressionType.NONE) { |
| 626 | ResponseCompression = other.ResponseCompression; |
| 627 | } |
| 628 | if (other.responseStatus_ != null) { |
| 629 | if (responseStatus_ == null) { |
| 630 | responseStatus_ = new global::Grpc.Testing.EchoStatus(); |
| 631 | } |
| 632 | ResponseStatus.MergeFrom(other.ResponseStatus); |
| 633 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 634 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 635 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 636 | public void MergeFrom(pb::CodedInputStream input) { |
| 637 | uint tag; |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 638 | while ((tag = input.ReadTag()) != 0) { |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 639 | switch(tag) { |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 640 | default: |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 641 | input.SkipLastField(); |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 642 | break; |
| 643 | case 8: { |
| 644 | responseType_ = (global::Grpc.Testing.PayloadType) input.ReadEnum(); |
| 645 | break; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 646 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 647 | case 16: { |
| 648 | ResponseSize = input.ReadInt32(); |
| 649 | break; |
| 650 | } |
| 651 | case 26: { |
| 652 | if (payload_ == null) { |
| 653 | payload_ = new global::Grpc.Testing.Payload(); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 654 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 655 | input.ReadMessage(payload_); |
| 656 | break; |
| 657 | } |
| 658 | case 32: { |
| 659 | FillUsername = input.ReadBool(); |
| 660 | break; |
| 661 | } |
| 662 | case 40: { |
| 663 | FillOauthScope = input.ReadBool(); |
| 664 | break; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 665 | } |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 666 | case 48: { |
| 667 | responseCompression_ = (global::Grpc.Testing.CompressionType) input.ReadEnum(); |
| 668 | break; |
| 669 | } |
| 670 | case 58: { |
| 671 | if (responseStatus_ == null) { |
| 672 | responseStatus_ = new global::Grpc.Testing.EchoStatus(); |
| 673 | } |
| 674 | input.ReadMessage(responseStatus_); |
| 675 | break; |
| 676 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 677 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 678 | } |
| 679 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 680 | |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 681 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 682 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 683 | /// <summary> |
| 684 | /// Unary response, as configured by the request. |
| 685 | /// </summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 686 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 687 | public sealed partial class SimpleResponse : pb::IMessage<SimpleResponse> { |
| 688 | private static readonly pb::MessageParser<SimpleResponse> _parser = new pb::MessageParser<SimpleResponse>(() => new SimpleResponse()); |
| 689 | public static pb::MessageParser<SimpleResponse> Parser { get { return _parser; } } |
| 690 | |
| 691 | public static pbr::MessageDescriptor Descriptor { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 692 | get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[3]; } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 693 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 694 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 695 | pbr::MessageDescriptor pb::IMessage.Descriptor { |
| 696 | get { return Descriptor; } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 697 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 698 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 699 | public SimpleResponse() { |
| 700 | OnConstruction(); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 701 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 702 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 703 | partial void OnConstruction(); |
| 704 | |
| 705 | public SimpleResponse(SimpleResponse other) : this() { |
| 706 | Payload = other.payload_ != null ? other.Payload.Clone() : null; |
| 707 | username_ = other.username_; |
| 708 | oauthScope_ = other.oauthScope_; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 709 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 710 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 711 | public SimpleResponse Clone() { |
| 712 | return new SimpleResponse(this); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 713 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 714 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 715 | /// <summary>Field number for the "payload" field.</summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 716 | public const int PayloadFieldNumber = 1; |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 717 | private global::Grpc.Testing.Payload payload_; |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 718 | /// <summary> |
| 719 | /// Payload to increase message size. |
| 720 | /// </summary> |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 721 | public global::Grpc.Testing.Payload Payload { |
| 722 | get { return payload_; } |
| 723 | set { |
| 724 | payload_ = value; |
| 725 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 726 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 727 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 728 | /// <summary>Field number for the "username" field.</summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 729 | public const int UsernameFieldNumber = 2; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 730 | private string username_ = ""; |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 731 | /// <summary> |
| 732 | /// The user the request came from, for verifying authentication was |
| 733 | /// successful when the client expected it. |
| 734 | /// </summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 735 | public string Username { |
| 736 | get { return username_; } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 737 | set { |
| 738 | username_ = pb::Preconditions.CheckNotNull(value, "value"); |
| 739 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 740 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 741 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 742 | /// <summary>Field number for the "oauth_scope" field.</summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 743 | public const int OauthScopeFieldNumber = 3; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 744 | private string oauthScope_ = ""; |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 745 | /// <summary> |
| 746 | /// OAuth scope. |
| 747 | /// </summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 748 | public string OauthScope { |
| 749 | get { return oauthScope_; } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 750 | set { |
| 751 | oauthScope_ = pb::Preconditions.CheckNotNull(value, "value"); |
| 752 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 753 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 754 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 755 | public override bool Equals(object other) { |
| 756 | return Equals(other as SimpleResponse); |
| 757 | } |
| 758 | |
| 759 | public bool Equals(SimpleResponse other) { |
| 760 | if (ReferenceEquals(other, null)) { |
| 761 | return false; |
| 762 | } |
| 763 | if (ReferenceEquals(other, this)) { |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 764 | return true; |
| 765 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 766 | if (!object.Equals(Payload, other.Payload)) return false; |
| 767 | if (Username != other.Username) return false; |
| 768 | if (OauthScope != other.OauthScope) return false; |
| 769 | return true; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 770 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 771 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 772 | public override int GetHashCode() { |
| 773 | int hash = 1; |
| 774 | if (payload_ != null) hash ^= Payload.GetHashCode(); |
| 775 | if (Username.Length != 0) hash ^= Username.GetHashCode(); |
| 776 | if (OauthScope.Length != 0) hash ^= OauthScope.GetHashCode(); |
| 777 | return hash; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 778 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 779 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 780 | public override string ToString() { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 781 | return pb::JsonFormatter.ToDiagnosticString(this); |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 782 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 783 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 784 | public void WriteTo(pb::CodedOutputStream output) { |
| 785 | if (payload_ != null) { |
| 786 | output.WriteRawTag(10); |
| 787 | output.WriteMessage(Payload); |
| 788 | } |
| 789 | if (Username.Length != 0) { |
| 790 | output.WriteRawTag(18); |
| 791 | output.WriteString(Username); |
| 792 | } |
| 793 | if (OauthScope.Length != 0) { |
| 794 | output.WriteRawTag(26); |
| 795 | output.WriteString(OauthScope); |
| 796 | } |
| 797 | } |
| 798 | |
| 799 | public int CalculateSize() { |
| 800 | int size = 0; |
| 801 | if (payload_ != null) { |
| 802 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Payload); |
| 803 | } |
| 804 | if (Username.Length != 0) { |
| 805 | size += 1 + pb::CodedOutputStream.ComputeStringSize(Username); |
| 806 | } |
| 807 | if (OauthScope.Length != 0) { |
| 808 | size += 1 + pb::CodedOutputStream.ComputeStringSize(OauthScope); |
| 809 | } |
| 810 | return size; |
| 811 | } |
| 812 | |
| 813 | public void MergeFrom(SimpleResponse other) { |
| 814 | if (other == null) { |
| 815 | return; |
| 816 | } |
| 817 | if (other.payload_ != null) { |
| 818 | if (payload_ == null) { |
| 819 | payload_ = new global::Grpc.Testing.Payload(); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 820 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 821 | Payload.MergeFrom(other.Payload); |
| 822 | } |
| 823 | if (other.Username.Length != 0) { |
| 824 | Username = other.Username; |
| 825 | } |
| 826 | if (other.OauthScope.Length != 0) { |
| 827 | OauthScope = other.OauthScope; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 828 | } |
| 829 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 830 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 831 | public void MergeFrom(pb::CodedInputStream input) { |
| 832 | uint tag; |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 833 | while ((tag = input.ReadTag()) != 0) { |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 834 | switch(tag) { |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 835 | default: |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 836 | input.SkipLastField(); |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 837 | break; |
| 838 | case 10: { |
| 839 | if (payload_ == null) { |
| 840 | payload_ = new global::Grpc.Testing.Payload(); |
| 841 | } |
| 842 | input.ReadMessage(payload_); |
| 843 | break; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 844 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 845 | case 18: { |
| 846 | Username = input.ReadString(); |
| 847 | break; |
| 848 | } |
| 849 | case 26: { |
| 850 | OauthScope = input.ReadString(); |
| 851 | break; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 852 | } |
| 853 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 854 | } |
| 855 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 856 | |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 857 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 858 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 859 | /// <summary> |
| 860 | /// Client-streaming request. |
| 861 | /// </summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 862 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 863 | public sealed partial class StreamingInputCallRequest : pb::IMessage<StreamingInputCallRequest> { |
| 864 | private static readonly pb::MessageParser<StreamingInputCallRequest> _parser = new pb::MessageParser<StreamingInputCallRequest>(() => new StreamingInputCallRequest()); |
| 865 | public static pb::MessageParser<StreamingInputCallRequest> Parser { get { return _parser; } } |
| 866 | |
| 867 | public static pbr::MessageDescriptor Descriptor { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 868 | get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[4]; } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 869 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 870 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 871 | pbr::MessageDescriptor pb::IMessage.Descriptor { |
| 872 | get { return Descriptor; } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 873 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 874 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 875 | public StreamingInputCallRequest() { |
| 876 | OnConstruction(); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 877 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 878 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 879 | partial void OnConstruction(); |
| 880 | |
| 881 | public StreamingInputCallRequest(StreamingInputCallRequest other) : this() { |
| 882 | Payload = other.payload_ != null ? other.Payload.Clone() : null; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 883 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 884 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 885 | public StreamingInputCallRequest Clone() { |
| 886 | return new StreamingInputCallRequest(this); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 887 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 888 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 889 | /// <summary>Field number for the "payload" field.</summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 890 | public const int PayloadFieldNumber = 1; |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 891 | private global::Grpc.Testing.Payload payload_; |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 892 | /// <summary> |
| 893 | /// Optional input payload sent along with the request. |
| 894 | /// </summary> |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 895 | public global::Grpc.Testing.Payload Payload { |
| 896 | get { return payload_; } |
| 897 | set { |
| 898 | payload_ = value; |
| 899 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 900 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 901 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 902 | public override bool Equals(object other) { |
| 903 | return Equals(other as StreamingInputCallRequest); |
| 904 | } |
| 905 | |
| 906 | public bool Equals(StreamingInputCallRequest other) { |
| 907 | if (ReferenceEquals(other, null)) { |
| 908 | return false; |
| 909 | } |
| 910 | if (ReferenceEquals(other, this)) { |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 911 | return true; |
| 912 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 913 | if (!object.Equals(Payload, other.Payload)) return false; |
| 914 | return true; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 915 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 916 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 917 | public override int GetHashCode() { |
| 918 | int hash = 1; |
| 919 | if (payload_ != null) hash ^= Payload.GetHashCode(); |
| 920 | return hash; |
| 921 | } |
| 922 | |
| 923 | public override string ToString() { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 924 | return pb::JsonFormatter.ToDiagnosticString(this); |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 925 | } |
| 926 | |
| 927 | public void WriteTo(pb::CodedOutputStream output) { |
| 928 | if (payload_ != null) { |
| 929 | output.WriteRawTag(10); |
| 930 | output.WriteMessage(Payload); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 931 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 932 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 933 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 934 | public int CalculateSize() { |
| 935 | int size = 0; |
| 936 | if (payload_ != null) { |
| 937 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Payload); |
| 938 | } |
| 939 | return size; |
| 940 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 941 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 942 | public void MergeFrom(StreamingInputCallRequest other) { |
| 943 | if (other == null) { |
| 944 | return; |
| 945 | } |
| 946 | if (other.payload_ != null) { |
| 947 | if (payload_ == null) { |
| 948 | payload_ = new global::Grpc.Testing.Payload(); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 949 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 950 | Payload.MergeFrom(other.Payload); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 951 | } |
| 952 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 953 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 954 | public void MergeFrom(pb::CodedInputStream input) { |
| 955 | uint tag; |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 956 | while ((tag = input.ReadTag()) != 0) { |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 957 | switch(tag) { |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 958 | default: |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 959 | input.SkipLastField(); |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 960 | break; |
| 961 | case 10: { |
| 962 | if (payload_ == null) { |
| 963 | payload_ = new global::Grpc.Testing.Payload(); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 964 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 965 | input.ReadMessage(payload_); |
| 966 | break; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 967 | } |
| 968 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 969 | } |
| 970 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 971 | |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 972 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 973 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 974 | /// <summary> |
| 975 | /// Client-streaming response. |
| 976 | /// </summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 977 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 978 | public sealed partial class StreamingInputCallResponse : pb::IMessage<StreamingInputCallResponse> { |
| 979 | private static readonly pb::MessageParser<StreamingInputCallResponse> _parser = new pb::MessageParser<StreamingInputCallResponse>(() => new StreamingInputCallResponse()); |
| 980 | public static pb::MessageParser<StreamingInputCallResponse> Parser { get { return _parser; } } |
| 981 | |
| 982 | public static pbr::MessageDescriptor Descriptor { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 983 | get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[5]; } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 984 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 985 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 986 | pbr::MessageDescriptor pb::IMessage.Descriptor { |
| 987 | get { return Descriptor; } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 988 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 989 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 990 | public StreamingInputCallResponse() { |
| 991 | OnConstruction(); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 992 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 993 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 994 | partial void OnConstruction(); |
| 995 | |
| 996 | public StreamingInputCallResponse(StreamingInputCallResponse other) : this() { |
| 997 | aggregatedPayloadSize_ = other.aggregatedPayloadSize_; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 998 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 999 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1000 | public StreamingInputCallResponse Clone() { |
| 1001 | return new StreamingInputCallResponse(this); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1002 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1003 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1004 | /// <summary>Field number for the "aggregated_payload_size" field.</summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1005 | public const int AggregatedPayloadSizeFieldNumber = 1; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1006 | private int aggregatedPayloadSize_; |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1007 | /// <summary> |
| 1008 | /// Aggregated size of payloads received from the client. |
| 1009 | /// </summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1010 | public int AggregatedPayloadSize { |
| 1011 | get { return aggregatedPayloadSize_; } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1012 | set { |
| 1013 | aggregatedPayloadSize_ = value; |
| 1014 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1015 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1016 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1017 | public override bool Equals(object other) { |
| 1018 | return Equals(other as StreamingInputCallResponse); |
| 1019 | } |
| 1020 | |
| 1021 | public bool Equals(StreamingInputCallResponse other) { |
| 1022 | if (ReferenceEquals(other, null)) { |
| 1023 | return false; |
| 1024 | } |
| 1025 | if (ReferenceEquals(other, this)) { |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1026 | return true; |
| 1027 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1028 | if (AggregatedPayloadSize != other.AggregatedPayloadSize) return false; |
| 1029 | return true; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1030 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1031 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1032 | public override int GetHashCode() { |
| 1033 | int hash = 1; |
| 1034 | if (AggregatedPayloadSize != 0) hash ^= AggregatedPayloadSize.GetHashCode(); |
| 1035 | return hash; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1036 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1037 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1038 | public override string ToString() { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1039 | return pb::JsonFormatter.ToDiagnosticString(this); |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1040 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1041 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1042 | public void WriteTo(pb::CodedOutputStream output) { |
| 1043 | if (AggregatedPayloadSize != 0) { |
| 1044 | output.WriteRawTag(8); |
| 1045 | output.WriteInt32(AggregatedPayloadSize); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1046 | } |
| 1047 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1048 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1049 | public int CalculateSize() { |
| 1050 | int size = 0; |
| 1051 | if (AggregatedPayloadSize != 0) { |
| 1052 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(AggregatedPayloadSize); |
| 1053 | } |
| 1054 | return size; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1055 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1056 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1057 | public void MergeFrom(StreamingInputCallResponse other) { |
| 1058 | if (other == null) { |
| 1059 | return; |
| 1060 | } |
| 1061 | if (other.AggregatedPayloadSize != 0) { |
| 1062 | AggregatedPayloadSize = other.AggregatedPayloadSize; |
| 1063 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1064 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1065 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1066 | public void MergeFrom(pb::CodedInputStream input) { |
| 1067 | uint tag; |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 1068 | while ((tag = input.ReadTag()) != 0) { |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1069 | switch(tag) { |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1070 | default: |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 1071 | input.SkipLastField(); |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1072 | break; |
| 1073 | case 8: { |
| 1074 | AggregatedPayloadSize = input.ReadInt32(); |
| 1075 | break; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1076 | } |
| 1077 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1078 | } |
| 1079 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1080 | |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1081 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1082 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1083 | /// <summary> |
| 1084 | /// Configuration for a particular response. |
| 1085 | /// </summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1086 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1087 | public sealed partial class ResponseParameters : pb::IMessage<ResponseParameters> { |
| 1088 | private static readonly pb::MessageParser<ResponseParameters> _parser = new pb::MessageParser<ResponseParameters>(() => new ResponseParameters()); |
| 1089 | public static pb::MessageParser<ResponseParameters> Parser { get { return _parser; } } |
| 1090 | |
| 1091 | public static pbr::MessageDescriptor Descriptor { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1092 | get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[6]; } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1093 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1094 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1095 | pbr::MessageDescriptor pb::IMessage.Descriptor { |
| 1096 | get { return Descriptor; } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1097 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1098 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1099 | public ResponseParameters() { |
| 1100 | OnConstruction(); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1101 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1102 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1103 | partial void OnConstruction(); |
| 1104 | |
| 1105 | public ResponseParameters(ResponseParameters other) : this() { |
| 1106 | size_ = other.size_; |
| 1107 | intervalUs_ = other.intervalUs_; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1108 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1109 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1110 | public ResponseParameters Clone() { |
| 1111 | return new ResponseParameters(this); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1112 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1113 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1114 | /// <summary>Field number for the "size" field.</summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1115 | public const int SizeFieldNumber = 1; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1116 | private int size_; |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1117 | /// <summary> |
| 1118 | /// Desired payload sizes in responses from the server. |
| 1119 | /// If response_type is COMPRESSABLE, this denotes the size before compression. |
| 1120 | /// </summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1121 | public int Size { |
| 1122 | get { return size_; } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1123 | set { |
| 1124 | size_ = value; |
| 1125 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1126 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1127 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1128 | /// <summary>Field number for the "interval_us" field.</summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1129 | public const int IntervalUsFieldNumber = 2; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1130 | private int intervalUs_; |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1131 | /// <summary> |
| 1132 | /// Desired interval between consecutive responses in the response stream in |
| 1133 | /// microseconds. |
| 1134 | /// </summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1135 | public int IntervalUs { |
| 1136 | get { return intervalUs_; } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1137 | set { |
| 1138 | intervalUs_ = value; |
| 1139 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1140 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1141 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1142 | public override bool Equals(object other) { |
| 1143 | return Equals(other as ResponseParameters); |
| 1144 | } |
| 1145 | |
| 1146 | public bool Equals(ResponseParameters other) { |
| 1147 | if (ReferenceEquals(other, null)) { |
| 1148 | return false; |
| 1149 | } |
| 1150 | if (ReferenceEquals(other, this)) { |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1151 | return true; |
| 1152 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1153 | if (Size != other.Size) return false; |
| 1154 | if (IntervalUs != other.IntervalUs) return false; |
| 1155 | return true; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1156 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1157 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1158 | public override int GetHashCode() { |
| 1159 | int hash = 1; |
| 1160 | if (Size != 0) hash ^= Size.GetHashCode(); |
| 1161 | if (IntervalUs != 0) hash ^= IntervalUs.GetHashCode(); |
| 1162 | return hash; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1163 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1164 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1165 | public override string ToString() { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1166 | return pb::JsonFormatter.ToDiagnosticString(this); |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1167 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1168 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1169 | public void WriteTo(pb::CodedOutputStream output) { |
| 1170 | if (Size != 0) { |
| 1171 | output.WriteRawTag(8); |
| 1172 | output.WriteInt32(Size); |
| 1173 | } |
| 1174 | if (IntervalUs != 0) { |
| 1175 | output.WriteRawTag(16); |
| 1176 | output.WriteInt32(IntervalUs); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1177 | } |
| 1178 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1179 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1180 | public int CalculateSize() { |
| 1181 | int size = 0; |
| 1182 | if (Size != 0) { |
| 1183 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(Size); |
| 1184 | } |
| 1185 | if (IntervalUs != 0) { |
| 1186 | size += 1 + pb::CodedOutputStream.ComputeInt32Size(IntervalUs); |
| 1187 | } |
| 1188 | return size; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1189 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1190 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1191 | public void MergeFrom(ResponseParameters other) { |
| 1192 | if (other == null) { |
| 1193 | return; |
| 1194 | } |
| 1195 | if (other.Size != 0) { |
| 1196 | Size = other.Size; |
| 1197 | } |
| 1198 | if (other.IntervalUs != 0) { |
| 1199 | IntervalUs = other.IntervalUs; |
| 1200 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1201 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1202 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1203 | public void MergeFrom(pb::CodedInputStream input) { |
| 1204 | uint tag; |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 1205 | while ((tag = input.ReadTag()) != 0) { |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1206 | switch(tag) { |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1207 | default: |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 1208 | input.SkipLastField(); |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1209 | break; |
| 1210 | case 8: { |
| 1211 | Size = input.ReadInt32(); |
| 1212 | break; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1213 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1214 | case 16: { |
| 1215 | IntervalUs = input.ReadInt32(); |
| 1216 | break; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1217 | } |
| 1218 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1219 | } |
| 1220 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1221 | |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1222 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1223 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1224 | /// <summary> |
| 1225 | /// Server-streaming request. |
| 1226 | /// </summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1227 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1228 | public sealed partial class StreamingOutputCallRequest : pb::IMessage<StreamingOutputCallRequest> { |
| 1229 | private static readonly pb::MessageParser<StreamingOutputCallRequest> _parser = new pb::MessageParser<StreamingOutputCallRequest>(() => new StreamingOutputCallRequest()); |
| 1230 | public static pb::MessageParser<StreamingOutputCallRequest> Parser { get { return _parser; } } |
| 1231 | |
| 1232 | public static pbr::MessageDescriptor Descriptor { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1233 | get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[7]; } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1234 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1235 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1236 | pbr::MessageDescriptor pb::IMessage.Descriptor { |
| 1237 | get { return Descriptor; } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1238 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1239 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1240 | public StreamingOutputCallRequest() { |
| 1241 | OnConstruction(); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1242 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1243 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1244 | partial void OnConstruction(); |
| 1245 | |
| 1246 | public StreamingOutputCallRequest(StreamingOutputCallRequest other) : this() { |
| 1247 | responseType_ = other.responseType_; |
| 1248 | responseParameters_ = other.responseParameters_.Clone(); |
| 1249 | Payload = other.payload_ != null ? other.Payload.Clone() : null; |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 1250 | responseCompression_ = other.responseCompression_; |
| 1251 | ResponseStatus = other.responseStatus_ != null ? other.ResponseStatus.Clone() : null; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1252 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1253 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1254 | public StreamingOutputCallRequest Clone() { |
| 1255 | return new StreamingOutputCallRequest(this); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1256 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1257 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1258 | /// <summary>Field number for the "response_type" field.</summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1259 | public const int ResponseTypeFieldNumber = 1; |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1260 | private global::Grpc.Testing.PayloadType responseType_ = global::Grpc.Testing.PayloadType.COMPRESSABLE; |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1261 | /// <summary> |
| 1262 | /// Desired payload type in the response from the server. |
| 1263 | /// If response_type is RANDOM, the payload from each response in the stream |
| 1264 | /// might be of different types. This is to simulate a mixed type of payload |
| 1265 | /// stream. |
| 1266 | /// </summary> |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1267 | public global::Grpc.Testing.PayloadType ResponseType { |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1268 | get { return responseType_; } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1269 | set { |
| 1270 | responseType_ = value; |
| 1271 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1272 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1273 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1274 | /// <summary>Field number for the "response_parameters" field.</summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1275 | public const int ResponseParametersFieldNumber = 2; |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1276 | private static readonly pb::FieldCodec<global::Grpc.Testing.ResponseParameters> _repeated_responseParameters_codec |
| 1277 | = pb::FieldCodec.ForMessage(18, global::Grpc.Testing.ResponseParameters.Parser); |
| 1278 | private readonly pbc::RepeatedField<global::Grpc.Testing.ResponseParameters> responseParameters_ = new pbc::RepeatedField<global::Grpc.Testing.ResponseParameters>(); |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1279 | /// <summary> |
| 1280 | /// Configuration for each expected response message. |
| 1281 | /// </summary> |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1282 | public pbc::RepeatedField<global::Grpc.Testing.ResponseParameters> ResponseParameters { |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1283 | get { return responseParameters_; } |
| 1284 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1285 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1286 | /// <summary>Field number for the "payload" field.</summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1287 | public const int PayloadFieldNumber = 3; |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1288 | private global::Grpc.Testing.Payload payload_; |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1289 | /// <summary> |
| 1290 | /// Optional input payload sent along with the request. |
| 1291 | /// </summary> |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1292 | public global::Grpc.Testing.Payload Payload { |
| 1293 | get { return payload_; } |
| 1294 | set { |
| 1295 | payload_ = value; |
| 1296 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1297 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1298 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1299 | /// <summary>Field number for the "response_compression" field.</summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 1300 | public const int ResponseCompressionFieldNumber = 6; |
| 1301 | private global::Grpc.Testing.CompressionType responseCompression_ = global::Grpc.Testing.CompressionType.NONE; |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1302 | /// <summary> |
| 1303 | /// Compression algorithm to be used by the server for the response (stream) |
| 1304 | /// </summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 1305 | public global::Grpc.Testing.CompressionType ResponseCompression { |
| 1306 | get { return responseCompression_; } |
| 1307 | set { |
| 1308 | responseCompression_ = value; |
| 1309 | } |
| 1310 | } |
| 1311 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1312 | /// <summary>Field number for the "response_status" field.</summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 1313 | public const int ResponseStatusFieldNumber = 7; |
| 1314 | private global::Grpc.Testing.EchoStatus responseStatus_; |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1315 | /// <summary> |
| 1316 | /// Whether server should return a given status |
| 1317 | /// </summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 1318 | public global::Grpc.Testing.EchoStatus ResponseStatus { |
| 1319 | get { return responseStatus_; } |
| 1320 | set { |
| 1321 | responseStatus_ = value; |
| 1322 | } |
| 1323 | } |
| 1324 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1325 | public override bool Equals(object other) { |
| 1326 | return Equals(other as StreamingOutputCallRequest); |
| 1327 | } |
| 1328 | |
| 1329 | public bool Equals(StreamingOutputCallRequest other) { |
| 1330 | if (ReferenceEquals(other, null)) { |
| 1331 | return false; |
| 1332 | } |
| 1333 | if (ReferenceEquals(other, this)) { |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1334 | return true; |
| 1335 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1336 | if (ResponseType != other.ResponseType) return false; |
| 1337 | if(!responseParameters_.Equals(other.responseParameters_)) return false; |
| 1338 | if (!object.Equals(Payload, other.Payload)) return false; |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 1339 | if (ResponseCompression != other.ResponseCompression) return false; |
| 1340 | if (!object.Equals(ResponseStatus, other.ResponseStatus)) return false; |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1341 | return true; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1342 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1343 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1344 | public override int GetHashCode() { |
| 1345 | int hash = 1; |
| 1346 | if (ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) hash ^= ResponseType.GetHashCode(); |
| 1347 | hash ^= responseParameters_.GetHashCode(); |
| 1348 | if (payload_ != null) hash ^= Payload.GetHashCode(); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 1349 | if (ResponseCompression != global::Grpc.Testing.CompressionType.NONE) hash ^= ResponseCompression.GetHashCode(); |
| 1350 | if (responseStatus_ != null) hash ^= ResponseStatus.GetHashCode(); |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1351 | return hash; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1352 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1353 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1354 | public override string ToString() { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1355 | return pb::JsonFormatter.ToDiagnosticString(this); |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1356 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1357 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1358 | public void WriteTo(pb::CodedOutputStream output) { |
| 1359 | if (ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) { |
| 1360 | output.WriteRawTag(8); |
| 1361 | output.WriteEnum((int) ResponseType); |
| 1362 | } |
| 1363 | responseParameters_.WriteTo(output, _repeated_responseParameters_codec); |
| 1364 | if (payload_ != null) { |
| 1365 | output.WriteRawTag(26); |
| 1366 | output.WriteMessage(Payload); |
| 1367 | } |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 1368 | if (ResponseCompression != global::Grpc.Testing.CompressionType.NONE) { |
| 1369 | output.WriteRawTag(48); |
| 1370 | output.WriteEnum((int) ResponseCompression); |
| 1371 | } |
| 1372 | if (responseStatus_ != null) { |
| 1373 | output.WriteRawTag(58); |
| 1374 | output.WriteMessage(ResponseStatus); |
| 1375 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1376 | } |
| 1377 | |
| 1378 | public int CalculateSize() { |
| 1379 | int size = 0; |
| 1380 | if (ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) { |
| 1381 | size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ResponseType); |
| 1382 | } |
| 1383 | size += responseParameters_.CalculateSize(_repeated_responseParameters_codec); |
| 1384 | if (payload_ != null) { |
| 1385 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Payload); |
| 1386 | } |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 1387 | if (ResponseCompression != global::Grpc.Testing.CompressionType.NONE) { |
| 1388 | size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) ResponseCompression); |
| 1389 | } |
| 1390 | if (responseStatus_ != null) { |
| 1391 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(ResponseStatus); |
| 1392 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1393 | return size; |
| 1394 | } |
| 1395 | |
| 1396 | public void MergeFrom(StreamingOutputCallRequest other) { |
| 1397 | if (other == null) { |
| 1398 | return; |
| 1399 | } |
| 1400 | if (other.ResponseType != global::Grpc.Testing.PayloadType.COMPRESSABLE) { |
| 1401 | ResponseType = other.ResponseType; |
| 1402 | } |
| 1403 | responseParameters_.Add(other.responseParameters_); |
| 1404 | if (other.payload_ != null) { |
| 1405 | if (payload_ == null) { |
| 1406 | payload_ = new global::Grpc.Testing.Payload(); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1407 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1408 | Payload.MergeFrom(other.Payload); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1409 | } |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 1410 | if (other.ResponseCompression != global::Grpc.Testing.CompressionType.NONE) { |
| 1411 | ResponseCompression = other.ResponseCompression; |
| 1412 | } |
| 1413 | if (other.responseStatus_ != null) { |
| 1414 | if (responseStatus_ == null) { |
| 1415 | responseStatus_ = new global::Grpc.Testing.EchoStatus(); |
| 1416 | } |
| 1417 | ResponseStatus.MergeFrom(other.ResponseStatus); |
| 1418 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1419 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1420 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1421 | public void MergeFrom(pb::CodedInputStream input) { |
| 1422 | uint tag; |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 1423 | while ((tag = input.ReadTag()) != 0) { |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1424 | switch(tag) { |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1425 | default: |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 1426 | input.SkipLastField(); |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1427 | break; |
| 1428 | case 8: { |
| 1429 | responseType_ = (global::Grpc.Testing.PayloadType) input.ReadEnum(); |
| 1430 | break; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1431 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1432 | case 18: { |
| 1433 | responseParameters_.AddEntriesFrom(input, _repeated_responseParameters_codec); |
| 1434 | break; |
| 1435 | } |
| 1436 | case 26: { |
| 1437 | if (payload_ == null) { |
| 1438 | payload_ = new global::Grpc.Testing.Payload(); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1439 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1440 | input.ReadMessage(payload_); |
| 1441 | break; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1442 | } |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 1443 | case 48: { |
| 1444 | responseCompression_ = (global::Grpc.Testing.CompressionType) input.ReadEnum(); |
| 1445 | break; |
| 1446 | } |
| 1447 | case 58: { |
| 1448 | if (responseStatus_ == null) { |
| 1449 | responseStatus_ = new global::Grpc.Testing.EchoStatus(); |
| 1450 | } |
| 1451 | input.ReadMessage(responseStatus_); |
| 1452 | break; |
| 1453 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1454 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1455 | } |
| 1456 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1457 | |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1458 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1459 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1460 | /// <summary> |
| 1461 | /// Server-streaming response, as configured by the request and parameters. |
| 1462 | /// </summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1463 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1464 | public sealed partial class StreamingOutputCallResponse : pb::IMessage<StreamingOutputCallResponse> { |
| 1465 | private static readonly pb::MessageParser<StreamingOutputCallResponse> _parser = new pb::MessageParser<StreamingOutputCallResponse>(() => new StreamingOutputCallResponse()); |
| 1466 | public static pb::MessageParser<StreamingOutputCallResponse> Parser { get { return _parser; } } |
| 1467 | |
| 1468 | public static pbr::MessageDescriptor Descriptor { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1469 | get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[8]; } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1470 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1471 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1472 | pbr::MessageDescriptor pb::IMessage.Descriptor { |
| 1473 | get { return Descriptor; } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1474 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1475 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1476 | public StreamingOutputCallResponse() { |
| 1477 | OnConstruction(); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1478 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1479 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1480 | partial void OnConstruction(); |
| 1481 | |
| 1482 | public StreamingOutputCallResponse(StreamingOutputCallResponse other) : this() { |
| 1483 | Payload = other.payload_ != null ? other.Payload.Clone() : null; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1484 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1485 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1486 | public StreamingOutputCallResponse Clone() { |
| 1487 | return new StreamingOutputCallResponse(this); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1488 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1489 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1490 | /// <summary>Field number for the "payload" field.</summary> |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1491 | public const int PayloadFieldNumber = 1; |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1492 | private global::Grpc.Testing.Payload payload_; |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1493 | /// <summary> |
| 1494 | /// Payload to increase response size. |
| 1495 | /// </summary> |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1496 | public global::Grpc.Testing.Payload Payload { |
| 1497 | get { return payload_; } |
| 1498 | set { |
| 1499 | payload_ = value; |
| 1500 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1501 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1502 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1503 | public override bool Equals(object other) { |
| 1504 | return Equals(other as StreamingOutputCallResponse); |
| 1505 | } |
| 1506 | |
| 1507 | public bool Equals(StreamingOutputCallResponse other) { |
| 1508 | if (ReferenceEquals(other, null)) { |
| 1509 | return false; |
| 1510 | } |
| 1511 | if (ReferenceEquals(other, this)) { |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1512 | return true; |
| 1513 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1514 | if (!object.Equals(Payload, other.Payload)) return false; |
| 1515 | return true; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1516 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1517 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1518 | public override int GetHashCode() { |
| 1519 | int hash = 1; |
| 1520 | if (payload_ != null) hash ^= Payload.GetHashCode(); |
| 1521 | return hash; |
| 1522 | } |
| 1523 | |
| 1524 | public override string ToString() { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1525 | return pb::JsonFormatter.ToDiagnosticString(this); |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1526 | } |
| 1527 | |
| 1528 | public void WriteTo(pb::CodedOutputStream output) { |
| 1529 | if (payload_ != null) { |
| 1530 | output.WriteRawTag(10); |
| 1531 | output.WriteMessage(Payload); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1532 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1533 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1534 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1535 | public int CalculateSize() { |
| 1536 | int size = 0; |
| 1537 | if (payload_ != null) { |
| 1538 | size += 1 + pb::CodedOutputStream.ComputeMessageSize(Payload); |
| 1539 | } |
| 1540 | return size; |
| 1541 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1542 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1543 | public void MergeFrom(StreamingOutputCallResponse other) { |
| 1544 | if (other == null) { |
| 1545 | return; |
| 1546 | } |
| 1547 | if (other.payload_ != null) { |
| 1548 | if (payload_ == null) { |
| 1549 | payload_ = new global::Grpc.Testing.Payload(); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1550 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1551 | Payload.MergeFrom(other.Payload); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1552 | } |
| 1553 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1554 | |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1555 | public void MergeFrom(pb::CodedInputStream input) { |
| 1556 | uint tag; |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 1557 | while ((tag = input.ReadTag()) != 0) { |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1558 | switch(tag) { |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1559 | default: |
Jan Tattermusch | 38536a7 | 2015-08-08 00:45:52 -0700 | [diff] [blame] | 1560 | input.SkipLastField(); |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1561 | break; |
| 1562 | case 10: { |
| 1563 | if (payload_ == null) { |
| 1564 | payload_ = new global::Grpc.Testing.Payload(); |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1565 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1566 | input.ReadMessage(payload_); |
| 1567 | break; |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1568 | } |
| 1569 | } |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1570 | } |
| 1571 | } |
Jan Tattermusch | 475f75a | 2015-08-03 09:46:04 -0700 | [diff] [blame] | 1572 | |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1573 | } |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1574 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1575 | /// <summary> |
| 1576 | /// For reconnect interop test only. |
| 1577 | /// Server tells client whether its reconnects are following the spec and the |
| 1578 | /// reconnect backoffs it saw. |
| 1579 | /// </summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 1580 | [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] |
| 1581 | public sealed partial class ReconnectInfo : pb::IMessage<ReconnectInfo> { |
| 1582 | private static readonly pb::MessageParser<ReconnectInfo> _parser = new pb::MessageParser<ReconnectInfo>(() => new ReconnectInfo()); |
| 1583 | public static pb::MessageParser<ReconnectInfo> Parser { get { return _parser; } } |
| 1584 | |
| 1585 | public static pbr::MessageDescriptor Descriptor { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1586 | get { return global::Grpc.Testing.MessagesReflection.Descriptor.MessageTypes[9]; } |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 1587 | } |
| 1588 | |
| 1589 | pbr::MessageDescriptor pb::IMessage.Descriptor { |
| 1590 | get { return Descriptor; } |
| 1591 | } |
| 1592 | |
| 1593 | public ReconnectInfo() { |
| 1594 | OnConstruction(); |
| 1595 | } |
| 1596 | |
| 1597 | partial void OnConstruction(); |
| 1598 | |
| 1599 | public ReconnectInfo(ReconnectInfo other) : this() { |
| 1600 | passed_ = other.passed_; |
| 1601 | backoffMs_ = other.backoffMs_.Clone(); |
| 1602 | } |
| 1603 | |
| 1604 | public ReconnectInfo Clone() { |
| 1605 | return new ReconnectInfo(this); |
| 1606 | } |
| 1607 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1608 | /// <summary>Field number for the "passed" field.</summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 1609 | public const int PassedFieldNumber = 1; |
| 1610 | private bool passed_; |
| 1611 | public bool Passed { |
| 1612 | get { return passed_; } |
| 1613 | set { |
| 1614 | passed_ = value; |
| 1615 | } |
| 1616 | } |
| 1617 | |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1618 | /// <summary>Field number for the "backoff_ms" field.</summary> |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 1619 | public const int BackoffMsFieldNumber = 2; |
| 1620 | private static readonly pb::FieldCodec<int> _repeated_backoffMs_codec |
| 1621 | = pb::FieldCodec.ForInt32(18); |
| 1622 | private readonly pbc::RepeatedField<int> backoffMs_ = new pbc::RepeatedField<int>(); |
| 1623 | public pbc::RepeatedField<int> BackoffMs { |
| 1624 | get { return backoffMs_; } |
| 1625 | } |
| 1626 | |
| 1627 | public override bool Equals(object other) { |
| 1628 | return Equals(other as ReconnectInfo); |
| 1629 | } |
| 1630 | |
| 1631 | public bool Equals(ReconnectInfo other) { |
| 1632 | if (ReferenceEquals(other, null)) { |
| 1633 | return false; |
| 1634 | } |
| 1635 | if (ReferenceEquals(other, this)) { |
| 1636 | return true; |
| 1637 | } |
| 1638 | if (Passed != other.Passed) return false; |
| 1639 | if(!backoffMs_.Equals(other.backoffMs_)) return false; |
| 1640 | return true; |
| 1641 | } |
| 1642 | |
| 1643 | public override int GetHashCode() { |
| 1644 | int hash = 1; |
| 1645 | if (Passed != false) hash ^= Passed.GetHashCode(); |
| 1646 | hash ^= backoffMs_.GetHashCode(); |
| 1647 | return hash; |
| 1648 | } |
| 1649 | |
| 1650 | public override string ToString() { |
Jan Tattermusch | 72ce442 | 2016-01-20 13:54:38 -0800 | [diff] [blame^] | 1651 | return pb::JsonFormatter.ToDiagnosticString(this); |
Jan Tattermusch | 70f8652 | 2015-10-07 18:23:51 -0700 | [diff] [blame] | 1652 | } |
| 1653 | |
| 1654 | public void WriteTo(pb::CodedOutputStream output) { |
| 1655 | if (Passed != false) { |
| 1656 | output.WriteRawTag(8); |
| 1657 | output.WriteBool(Passed); |
| 1658 | } |
| 1659 | backoffMs_.WriteTo(output, _repeated_backoffMs_codec); |
| 1660 | } |
| 1661 | |
| 1662 | public int CalculateSize() { |
| 1663 | int size = 0; |
| 1664 | if (Passed != false) { |
| 1665 | size += 1 + 1; |
| 1666 | } |
| 1667 | size += backoffMs_.CalculateSize(_repeated_backoffMs_codec); |
| 1668 | return size; |
| 1669 | } |
| 1670 | |
| 1671 | public void MergeFrom(ReconnectInfo other) { |
| 1672 | if (other == null) { |
| 1673 | return; |
| 1674 | } |
| 1675 | if (other.Passed != false) { |
| 1676 | Passed = other.Passed; |
| 1677 | } |
| 1678 | backoffMs_.Add(other.backoffMs_); |
| 1679 | } |
| 1680 | |
| 1681 | public void MergeFrom(pb::CodedInputStream input) { |
| 1682 | uint tag; |
| 1683 | while ((tag = input.ReadTag()) != 0) { |
| 1684 | switch(tag) { |
| 1685 | default: |
| 1686 | input.SkipLastField(); |
| 1687 | break; |
| 1688 | case 8: { |
| 1689 | Passed = input.ReadBool(); |
| 1690 | break; |
| 1691 | } |
| 1692 | case 18: |
| 1693 | case 16: { |
| 1694 | backoffMs_.AddEntriesFrom(input, _repeated_backoffMs_codec); |
| 1695 | break; |
| 1696 | } |
| 1697 | } |
| 1698 | } |
| 1699 | } |
| 1700 | |
| 1701 | } |
| 1702 | |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1703 | #endregion |
Craig Tiller | 190d360 | 2015-02-18 09:23:38 -0800 | [diff] [blame] | 1704 | |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1705 | } |
Jan Tattermusch | a7608b0 | 2015-02-03 17:54:38 -0800 | [diff] [blame] | 1706 | |
Jan Tattermusch | a4b63bf | 2015-02-06 10:07:59 -0800 | [diff] [blame] | 1707 | #endregion Designer generated code |