messages.pb.swift 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950
  1. // DO NOT EDIT.
  2. // swift-format-ignore-file
  3. //
  4. // Generated by the Swift generator plugin for the protocol buffer compiler.
  5. // Source: src/proto/grpc/testing/messages.proto
  6. //
  7. // For information on using the generated types, please see the documentation:
  8. // https://github.com/apple/swift-protobuf/
  9. // Copyright 2015-2016 gRPC authors.
  10. //
  11. // Licensed under the Apache License, Version 2.0 (the "License");
  12. // you may not use this file except in compliance with the License.
  13. // You may obtain a copy of the License at
  14. //
  15. // http://www.apache.org/licenses/LICENSE-2.0
  16. //
  17. // Unless required by applicable law or agreed to in writing, software
  18. // distributed under the License is distributed on an "AS IS" BASIS,
  19. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  20. // See the License for the specific language governing permissions and
  21. // limitations under the License.
  22. // Message definitions to be used by integration test service definitions.
  23. import Foundation
  24. import SwiftProtobuf
  25. // If the compiler emits an error on this type, it is because this file
  26. // was generated by a version of the `protoc` Swift plug-in that is
  27. // incompatible with the version of SwiftProtobuf to which you are linking.
  28. // Please ensure that you are building against the same version of the API
  29. // that was used to generate this file.
  30. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  31. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  32. typealias Version = _2
  33. }
  34. /// The type of payload that should be returned.
  35. public enum Grpc_Testing_PayloadType: SwiftProtobuf.Enum {
  36. public typealias RawValue = Int
  37. /// Compressable text format.
  38. case compressable // = 0
  39. case UNRECOGNIZED(Int)
  40. public init() {
  41. self = .compressable
  42. }
  43. public init?(rawValue: Int) {
  44. switch rawValue {
  45. case 0: self = .compressable
  46. default: self = .UNRECOGNIZED(rawValue)
  47. }
  48. }
  49. public var rawValue: Int {
  50. switch self {
  51. case .compressable: return 0
  52. case .UNRECOGNIZED(let i): return i
  53. }
  54. }
  55. }
  56. #if swift(>=4.2)
  57. extension Grpc_Testing_PayloadType: CaseIterable {
  58. // The compiler won't synthesize support with the UNRECOGNIZED case.
  59. public static let allCases: [Grpc_Testing_PayloadType] = [
  60. .compressable,
  61. ]
  62. }
  63. #endif // swift(>=4.2)
  64. /// TODO(dgq): Go back to using well-known types once
  65. /// https://github.com/grpc/grpc/issues/6980 has been fixed.
  66. /// import "google/protobuf/wrappers.proto";
  67. public struct Grpc_Testing_BoolValue {
  68. // SwiftProtobuf.Message conformance is added in an extension below. See the
  69. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  70. // methods supported on all messages.
  71. /// The bool value.
  72. public var value: Bool = false
  73. public var unknownFields = SwiftProtobuf.UnknownStorage()
  74. public init() {}
  75. }
  76. /// A block of data, to simply increase gRPC message size.
  77. public struct Grpc_Testing_Payload {
  78. // SwiftProtobuf.Message conformance is added in an extension below. See the
  79. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  80. // methods supported on all messages.
  81. /// The type of data in body.
  82. public var type: Grpc_Testing_PayloadType = .compressable
  83. /// Primary contents of payload.
  84. public var body: Data = Data()
  85. public var unknownFields = SwiftProtobuf.UnknownStorage()
  86. public init() {}
  87. }
  88. /// A protobuf representation for grpc status. This is used by test
  89. /// clients to specify a status that the server should attempt to return.
  90. public struct Grpc_Testing_EchoStatus {
  91. // SwiftProtobuf.Message conformance is added in an extension below. See the
  92. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  93. // methods supported on all messages.
  94. public var code: Int32 = 0
  95. public var message: String = String()
  96. public var unknownFields = SwiftProtobuf.UnknownStorage()
  97. public init() {}
  98. }
  99. /// Unary request.
  100. public struct Grpc_Testing_SimpleRequest {
  101. // SwiftProtobuf.Message conformance is added in an extension below. See the
  102. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  103. // methods supported on all messages.
  104. /// Desired payload type in the response from the server.
  105. /// If response_type is RANDOM, server randomly chooses one from other formats.
  106. public var responseType: Grpc_Testing_PayloadType = .compressable
  107. /// Desired payload size in the response from the server.
  108. public var responseSize: Int32 = 0
  109. /// Optional input payload sent along with the request.
  110. public var payload: Grpc_Testing_Payload {
  111. get {return _payload ?? Grpc_Testing_Payload()}
  112. set {_payload = newValue}
  113. }
  114. /// Returns true if `payload` has been explicitly set.
  115. public var hasPayload: Bool {return self._payload != nil}
  116. /// Clears the value of `payload`. Subsequent reads from it will return its default value.
  117. public mutating func clearPayload() {self._payload = nil}
  118. /// Whether SimpleResponse should include username.
  119. public var fillUsername: Bool = false
  120. /// Whether SimpleResponse should include OAuth scope.
  121. public var fillOauthScope: Bool = false
  122. /// Whether to request the server to compress the response. This field is
  123. /// "nullable" in order to interoperate seamlessly with clients not able to
  124. /// implement the full compression tests by introspecting the call to verify
  125. /// the response's compression status.
  126. public var responseCompressed: Grpc_Testing_BoolValue {
  127. get {return _responseCompressed ?? Grpc_Testing_BoolValue()}
  128. set {_responseCompressed = newValue}
  129. }
  130. /// Returns true if `responseCompressed` has been explicitly set.
  131. public var hasResponseCompressed: Bool {return self._responseCompressed != nil}
  132. /// Clears the value of `responseCompressed`. Subsequent reads from it will return its default value.
  133. public mutating func clearResponseCompressed() {self._responseCompressed = nil}
  134. /// Whether server should return a given status
  135. public var responseStatus: Grpc_Testing_EchoStatus {
  136. get {return _responseStatus ?? Grpc_Testing_EchoStatus()}
  137. set {_responseStatus = newValue}
  138. }
  139. /// Returns true if `responseStatus` has been explicitly set.
  140. public var hasResponseStatus: Bool {return self._responseStatus != nil}
  141. /// Clears the value of `responseStatus`. Subsequent reads from it will return its default value.
  142. public mutating func clearResponseStatus() {self._responseStatus = nil}
  143. /// Whether the server should expect this request to be compressed.
  144. public var expectCompressed: Grpc_Testing_BoolValue {
  145. get {return _expectCompressed ?? Grpc_Testing_BoolValue()}
  146. set {_expectCompressed = newValue}
  147. }
  148. /// Returns true if `expectCompressed` has been explicitly set.
  149. public var hasExpectCompressed: Bool {return self._expectCompressed != nil}
  150. /// Clears the value of `expectCompressed`. Subsequent reads from it will return its default value.
  151. public mutating func clearExpectCompressed() {self._expectCompressed = nil}
  152. public var unknownFields = SwiftProtobuf.UnknownStorage()
  153. public init() {}
  154. fileprivate var _payload: Grpc_Testing_Payload? = nil
  155. fileprivate var _responseCompressed: Grpc_Testing_BoolValue? = nil
  156. fileprivate var _responseStatus: Grpc_Testing_EchoStatus? = nil
  157. fileprivate var _expectCompressed: Grpc_Testing_BoolValue? = nil
  158. }
  159. /// Unary response, as configured by the request.
  160. public struct Grpc_Testing_SimpleResponse {
  161. // SwiftProtobuf.Message conformance is added in an extension below. See the
  162. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  163. // methods supported on all messages.
  164. /// Payload to increase message size.
  165. public var payload: Grpc_Testing_Payload {
  166. get {return _payload ?? Grpc_Testing_Payload()}
  167. set {_payload = newValue}
  168. }
  169. /// Returns true if `payload` has been explicitly set.
  170. public var hasPayload: Bool {return self._payload != nil}
  171. /// Clears the value of `payload`. Subsequent reads from it will return its default value.
  172. public mutating func clearPayload() {self._payload = nil}
  173. /// The user the request came from, for verifying authentication was
  174. /// successful when the client expected it.
  175. public var username: String = String()
  176. /// OAuth scope.
  177. public var oauthScope: String = String()
  178. public var unknownFields = SwiftProtobuf.UnknownStorage()
  179. public init() {}
  180. fileprivate var _payload: Grpc_Testing_Payload? = nil
  181. }
  182. /// Client-streaming request.
  183. public struct Grpc_Testing_StreamingInputCallRequest {
  184. // SwiftProtobuf.Message conformance is added in an extension below. See the
  185. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  186. // methods supported on all messages.
  187. /// Optional input payload sent along with the request.
  188. public var payload: Grpc_Testing_Payload {
  189. get {return _payload ?? Grpc_Testing_Payload()}
  190. set {_payload = newValue}
  191. }
  192. /// Returns true if `payload` has been explicitly set.
  193. public var hasPayload: Bool {return self._payload != nil}
  194. /// Clears the value of `payload`. Subsequent reads from it will return its default value.
  195. public mutating func clearPayload() {self._payload = nil}
  196. /// Whether the server should expect this request to be compressed. This field
  197. /// is "nullable" in order to interoperate seamlessly with servers not able to
  198. /// implement the full compression tests by introspecting the call to verify
  199. /// the request's compression status.
  200. public var expectCompressed: Grpc_Testing_BoolValue {
  201. get {return _expectCompressed ?? Grpc_Testing_BoolValue()}
  202. set {_expectCompressed = newValue}
  203. }
  204. /// Returns true if `expectCompressed` has been explicitly set.
  205. public var hasExpectCompressed: Bool {return self._expectCompressed != nil}
  206. /// Clears the value of `expectCompressed`. Subsequent reads from it will return its default value.
  207. public mutating func clearExpectCompressed() {self._expectCompressed = nil}
  208. public var unknownFields = SwiftProtobuf.UnknownStorage()
  209. public init() {}
  210. fileprivate var _payload: Grpc_Testing_Payload? = nil
  211. fileprivate var _expectCompressed: Grpc_Testing_BoolValue? = nil
  212. }
  213. /// Client-streaming response.
  214. public struct Grpc_Testing_StreamingInputCallResponse {
  215. // SwiftProtobuf.Message conformance is added in an extension below. See the
  216. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  217. // methods supported on all messages.
  218. /// Aggregated size of payloads received from the client.
  219. public var aggregatedPayloadSize: Int32 = 0
  220. public var unknownFields = SwiftProtobuf.UnknownStorage()
  221. public init() {}
  222. }
  223. /// Configuration for a particular response.
  224. public struct Grpc_Testing_ResponseParameters {
  225. // SwiftProtobuf.Message conformance is added in an extension below. See the
  226. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  227. // methods supported on all messages.
  228. /// Desired payload sizes in responses from the server.
  229. public var size: Int32 = 0
  230. /// Desired interval between consecutive responses in the response stream in
  231. /// microseconds.
  232. public var intervalUs: Int32 = 0
  233. /// Whether to request the server to compress the response. This field is
  234. /// "nullable" in order to interoperate seamlessly with clients not able to
  235. /// implement the full compression tests by introspecting the call to verify
  236. /// the response's compression status.
  237. public var compressed: Grpc_Testing_BoolValue {
  238. get {return _compressed ?? Grpc_Testing_BoolValue()}
  239. set {_compressed = newValue}
  240. }
  241. /// Returns true if `compressed` has been explicitly set.
  242. public var hasCompressed: Bool {return self._compressed != nil}
  243. /// Clears the value of `compressed`. Subsequent reads from it will return its default value.
  244. public mutating func clearCompressed() {self._compressed = nil}
  245. public var unknownFields = SwiftProtobuf.UnknownStorage()
  246. public init() {}
  247. fileprivate var _compressed: Grpc_Testing_BoolValue? = nil
  248. }
  249. /// Server-streaming request.
  250. public struct Grpc_Testing_StreamingOutputCallRequest {
  251. // SwiftProtobuf.Message conformance is added in an extension below. See the
  252. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  253. // methods supported on all messages.
  254. /// Desired payload type in the response from the server.
  255. /// If response_type is RANDOM, the payload from each response in the stream
  256. /// might be of different types. This is to simulate a mixed type of payload
  257. /// stream.
  258. public var responseType: Grpc_Testing_PayloadType = .compressable
  259. /// Configuration for each expected response message.
  260. public var responseParameters: [Grpc_Testing_ResponseParameters] = []
  261. /// Optional input payload sent along with the request.
  262. public var payload: Grpc_Testing_Payload {
  263. get {return _payload ?? Grpc_Testing_Payload()}
  264. set {_payload = newValue}
  265. }
  266. /// Returns true if `payload` has been explicitly set.
  267. public var hasPayload: Bool {return self._payload != nil}
  268. /// Clears the value of `payload`. Subsequent reads from it will return its default value.
  269. public mutating func clearPayload() {self._payload = nil}
  270. /// Whether server should return a given status
  271. public var responseStatus: Grpc_Testing_EchoStatus {
  272. get {return _responseStatus ?? Grpc_Testing_EchoStatus()}
  273. set {_responseStatus = newValue}
  274. }
  275. /// Returns true if `responseStatus` has been explicitly set.
  276. public var hasResponseStatus: Bool {return self._responseStatus != nil}
  277. /// Clears the value of `responseStatus`. Subsequent reads from it will return its default value.
  278. public mutating func clearResponseStatus() {self._responseStatus = nil}
  279. public var unknownFields = SwiftProtobuf.UnknownStorage()
  280. public init() {}
  281. fileprivate var _payload: Grpc_Testing_Payload? = nil
  282. fileprivate var _responseStatus: Grpc_Testing_EchoStatus? = nil
  283. }
  284. /// Server-streaming response, as configured by the request and parameters.
  285. public struct Grpc_Testing_StreamingOutputCallResponse {
  286. // SwiftProtobuf.Message conformance is added in an extension below. See the
  287. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  288. // methods supported on all messages.
  289. /// Payload to increase response size.
  290. public var payload: Grpc_Testing_Payload {
  291. get {return _payload ?? Grpc_Testing_Payload()}
  292. set {_payload = newValue}
  293. }
  294. /// Returns true if `payload` has been explicitly set.
  295. public var hasPayload: Bool {return self._payload != nil}
  296. /// Clears the value of `payload`. Subsequent reads from it will return its default value.
  297. public mutating func clearPayload() {self._payload = nil}
  298. public var unknownFields = SwiftProtobuf.UnknownStorage()
  299. public init() {}
  300. fileprivate var _payload: Grpc_Testing_Payload? = nil
  301. }
  302. /// For reconnect interop test only.
  303. /// Client tells server what reconnection parameters it used.
  304. public struct Grpc_Testing_ReconnectParams {
  305. // SwiftProtobuf.Message conformance is added in an extension below. See the
  306. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  307. // methods supported on all messages.
  308. public var maxReconnectBackoffMs: Int32 = 0
  309. public var unknownFields = SwiftProtobuf.UnknownStorage()
  310. public init() {}
  311. }
  312. /// For reconnect interop test only.
  313. /// Server tells client whether its reconnects are following the spec and the
  314. /// reconnect backoffs it saw.
  315. public struct Grpc_Testing_ReconnectInfo {
  316. // SwiftProtobuf.Message conformance is added in an extension below. See the
  317. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  318. // methods supported on all messages.
  319. public var passed: Bool = false
  320. public var backoffMs: [Int32] = []
  321. public var unknownFields = SwiftProtobuf.UnknownStorage()
  322. public init() {}
  323. }
  324. #if swift(>=5.5) && canImport(_Concurrency)
  325. extension Grpc_Testing_PayloadType: @unchecked Sendable {}
  326. extension Grpc_Testing_BoolValue: @unchecked Sendable {}
  327. extension Grpc_Testing_Payload: @unchecked Sendable {}
  328. extension Grpc_Testing_EchoStatus: @unchecked Sendable {}
  329. extension Grpc_Testing_SimpleRequest: @unchecked Sendable {}
  330. extension Grpc_Testing_SimpleResponse: @unchecked Sendable {}
  331. extension Grpc_Testing_StreamingInputCallRequest: @unchecked Sendable {}
  332. extension Grpc_Testing_StreamingInputCallResponse: @unchecked Sendable {}
  333. extension Grpc_Testing_ResponseParameters: @unchecked Sendable {}
  334. extension Grpc_Testing_StreamingOutputCallRequest: @unchecked Sendable {}
  335. extension Grpc_Testing_StreamingOutputCallResponse: @unchecked Sendable {}
  336. extension Grpc_Testing_ReconnectParams: @unchecked Sendable {}
  337. extension Grpc_Testing_ReconnectInfo: @unchecked Sendable {}
  338. #endif // swift(>=5.5) && canImport(_Concurrency)
  339. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  340. fileprivate let _protobuf_package = "grpc.testing"
  341. extension Grpc_Testing_PayloadType: SwiftProtobuf._ProtoNameProviding {
  342. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  343. 0: .same(proto: "COMPRESSABLE"),
  344. ]
  345. }
  346. extension Grpc_Testing_BoolValue: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  347. public static let protoMessageName: String = _protobuf_package + ".BoolValue"
  348. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  349. 1: .same(proto: "value"),
  350. ]
  351. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  352. while let fieldNumber = try decoder.nextFieldNumber() {
  353. // The use of inline closures is to circumvent an issue where the compiler
  354. // allocates stack space for every case branch when no optimizations are
  355. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  356. switch fieldNumber {
  357. case 1: try { try decoder.decodeSingularBoolField(value: &self.value) }()
  358. default: break
  359. }
  360. }
  361. }
  362. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  363. if self.value != false {
  364. try visitor.visitSingularBoolField(value: self.value, fieldNumber: 1)
  365. }
  366. try unknownFields.traverse(visitor: &visitor)
  367. }
  368. public static func ==(lhs: Grpc_Testing_BoolValue, rhs: Grpc_Testing_BoolValue) -> Bool {
  369. if lhs.value != rhs.value {return false}
  370. if lhs.unknownFields != rhs.unknownFields {return false}
  371. return true
  372. }
  373. }
  374. extension Grpc_Testing_Payload: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  375. public static let protoMessageName: String = _protobuf_package + ".Payload"
  376. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  377. 1: .same(proto: "type"),
  378. 2: .same(proto: "body"),
  379. ]
  380. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  381. while let fieldNumber = try decoder.nextFieldNumber() {
  382. // The use of inline closures is to circumvent an issue where the compiler
  383. // allocates stack space for every case branch when no optimizations are
  384. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  385. switch fieldNumber {
  386. case 1: try { try decoder.decodeSingularEnumField(value: &self.type) }()
  387. case 2: try { try decoder.decodeSingularBytesField(value: &self.body) }()
  388. default: break
  389. }
  390. }
  391. }
  392. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  393. if self.type != .compressable {
  394. try visitor.visitSingularEnumField(value: self.type, fieldNumber: 1)
  395. }
  396. if !self.body.isEmpty {
  397. try visitor.visitSingularBytesField(value: self.body, fieldNumber: 2)
  398. }
  399. try unknownFields.traverse(visitor: &visitor)
  400. }
  401. public static func ==(lhs: Grpc_Testing_Payload, rhs: Grpc_Testing_Payload) -> Bool {
  402. if lhs.type != rhs.type {return false}
  403. if lhs.body != rhs.body {return false}
  404. if lhs.unknownFields != rhs.unknownFields {return false}
  405. return true
  406. }
  407. }
  408. extension Grpc_Testing_EchoStatus: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  409. public static let protoMessageName: String = _protobuf_package + ".EchoStatus"
  410. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  411. 1: .same(proto: "code"),
  412. 2: .same(proto: "message"),
  413. ]
  414. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  415. while let fieldNumber = try decoder.nextFieldNumber() {
  416. // The use of inline closures is to circumvent an issue where the compiler
  417. // allocates stack space for every case branch when no optimizations are
  418. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  419. switch fieldNumber {
  420. case 1: try { try decoder.decodeSingularInt32Field(value: &self.code) }()
  421. case 2: try { try decoder.decodeSingularStringField(value: &self.message) }()
  422. default: break
  423. }
  424. }
  425. }
  426. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  427. if self.code != 0 {
  428. try visitor.visitSingularInt32Field(value: self.code, fieldNumber: 1)
  429. }
  430. if !self.message.isEmpty {
  431. try visitor.visitSingularStringField(value: self.message, fieldNumber: 2)
  432. }
  433. try unknownFields.traverse(visitor: &visitor)
  434. }
  435. public static func ==(lhs: Grpc_Testing_EchoStatus, rhs: Grpc_Testing_EchoStatus) -> Bool {
  436. if lhs.code != rhs.code {return false}
  437. if lhs.message != rhs.message {return false}
  438. if lhs.unknownFields != rhs.unknownFields {return false}
  439. return true
  440. }
  441. }
  442. extension Grpc_Testing_SimpleRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  443. public static let protoMessageName: String = _protobuf_package + ".SimpleRequest"
  444. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  445. 1: .standard(proto: "response_type"),
  446. 2: .standard(proto: "response_size"),
  447. 3: .same(proto: "payload"),
  448. 4: .standard(proto: "fill_username"),
  449. 5: .standard(proto: "fill_oauth_scope"),
  450. 6: .standard(proto: "response_compressed"),
  451. 7: .standard(proto: "response_status"),
  452. 8: .standard(proto: "expect_compressed"),
  453. ]
  454. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  455. while let fieldNumber = try decoder.nextFieldNumber() {
  456. // The use of inline closures is to circumvent an issue where the compiler
  457. // allocates stack space for every case branch when no optimizations are
  458. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  459. switch fieldNumber {
  460. case 1: try { try decoder.decodeSingularEnumField(value: &self.responseType) }()
  461. case 2: try { try decoder.decodeSingularInt32Field(value: &self.responseSize) }()
  462. case 3: try { try decoder.decodeSingularMessageField(value: &self._payload) }()
  463. case 4: try { try decoder.decodeSingularBoolField(value: &self.fillUsername) }()
  464. case 5: try { try decoder.decodeSingularBoolField(value: &self.fillOauthScope) }()
  465. case 6: try { try decoder.decodeSingularMessageField(value: &self._responseCompressed) }()
  466. case 7: try { try decoder.decodeSingularMessageField(value: &self._responseStatus) }()
  467. case 8: try { try decoder.decodeSingularMessageField(value: &self._expectCompressed) }()
  468. default: break
  469. }
  470. }
  471. }
  472. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  473. // The use of inline closures is to circumvent an issue where the compiler
  474. // allocates stack space for every if/case branch local when no optimizations
  475. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  476. // https://github.com/apple/swift-protobuf/issues/1182
  477. if self.responseType != .compressable {
  478. try visitor.visitSingularEnumField(value: self.responseType, fieldNumber: 1)
  479. }
  480. if self.responseSize != 0 {
  481. try visitor.visitSingularInt32Field(value: self.responseSize, fieldNumber: 2)
  482. }
  483. try { if let v = self._payload {
  484. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  485. } }()
  486. if self.fillUsername != false {
  487. try visitor.visitSingularBoolField(value: self.fillUsername, fieldNumber: 4)
  488. }
  489. if self.fillOauthScope != false {
  490. try visitor.visitSingularBoolField(value: self.fillOauthScope, fieldNumber: 5)
  491. }
  492. try { if let v = self._responseCompressed {
  493. try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
  494. } }()
  495. try { if let v = self._responseStatus {
  496. try visitor.visitSingularMessageField(value: v, fieldNumber: 7)
  497. } }()
  498. try { if let v = self._expectCompressed {
  499. try visitor.visitSingularMessageField(value: v, fieldNumber: 8)
  500. } }()
  501. try unknownFields.traverse(visitor: &visitor)
  502. }
  503. public static func ==(lhs: Grpc_Testing_SimpleRequest, rhs: Grpc_Testing_SimpleRequest) -> Bool {
  504. if lhs.responseType != rhs.responseType {return false}
  505. if lhs.responseSize != rhs.responseSize {return false}
  506. if lhs._payload != rhs._payload {return false}
  507. if lhs.fillUsername != rhs.fillUsername {return false}
  508. if lhs.fillOauthScope != rhs.fillOauthScope {return false}
  509. if lhs._responseCompressed != rhs._responseCompressed {return false}
  510. if lhs._responseStatus != rhs._responseStatus {return false}
  511. if lhs._expectCompressed != rhs._expectCompressed {return false}
  512. if lhs.unknownFields != rhs.unknownFields {return false}
  513. return true
  514. }
  515. }
  516. extension Grpc_Testing_SimpleResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  517. public static let protoMessageName: String = _protobuf_package + ".SimpleResponse"
  518. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  519. 1: .same(proto: "payload"),
  520. 2: .same(proto: "username"),
  521. 3: .standard(proto: "oauth_scope"),
  522. ]
  523. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  524. while let fieldNumber = try decoder.nextFieldNumber() {
  525. // The use of inline closures is to circumvent an issue where the compiler
  526. // allocates stack space for every case branch when no optimizations are
  527. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  528. switch fieldNumber {
  529. case 1: try { try decoder.decodeSingularMessageField(value: &self._payload) }()
  530. case 2: try { try decoder.decodeSingularStringField(value: &self.username) }()
  531. case 3: try { try decoder.decodeSingularStringField(value: &self.oauthScope) }()
  532. default: break
  533. }
  534. }
  535. }
  536. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  537. // The use of inline closures is to circumvent an issue where the compiler
  538. // allocates stack space for every if/case branch local when no optimizations
  539. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  540. // https://github.com/apple/swift-protobuf/issues/1182
  541. try { if let v = self._payload {
  542. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  543. } }()
  544. if !self.username.isEmpty {
  545. try visitor.visitSingularStringField(value: self.username, fieldNumber: 2)
  546. }
  547. if !self.oauthScope.isEmpty {
  548. try visitor.visitSingularStringField(value: self.oauthScope, fieldNumber: 3)
  549. }
  550. try unknownFields.traverse(visitor: &visitor)
  551. }
  552. public static func ==(lhs: Grpc_Testing_SimpleResponse, rhs: Grpc_Testing_SimpleResponse) -> Bool {
  553. if lhs._payload != rhs._payload {return false}
  554. if lhs.username != rhs.username {return false}
  555. if lhs.oauthScope != rhs.oauthScope {return false}
  556. if lhs.unknownFields != rhs.unknownFields {return false}
  557. return true
  558. }
  559. }
  560. extension Grpc_Testing_StreamingInputCallRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  561. public static let protoMessageName: String = _protobuf_package + ".StreamingInputCallRequest"
  562. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  563. 1: .same(proto: "payload"),
  564. 2: .standard(proto: "expect_compressed"),
  565. ]
  566. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  567. while let fieldNumber = try decoder.nextFieldNumber() {
  568. // The use of inline closures is to circumvent an issue where the compiler
  569. // allocates stack space for every case branch when no optimizations are
  570. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  571. switch fieldNumber {
  572. case 1: try { try decoder.decodeSingularMessageField(value: &self._payload) }()
  573. case 2: try { try decoder.decodeSingularMessageField(value: &self._expectCompressed) }()
  574. default: break
  575. }
  576. }
  577. }
  578. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  579. // The use of inline closures is to circumvent an issue where the compiler
  580. // allocates stack space for every if/case branch local when no optimizations
  581. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  582. // https://github.com/apple/swift-protobuf/issues/1182
  583. try { if let v = self._payload {
  584. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  585. } }()
  586. try { if let v = self._expectCompressed {
  587. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  588. } }()
  589. try unknownFields.traverse(visitor: &visitor)
  590. }
  591. public static func ==(lhs: Grpc_Testing_StreamingInputCallRequest, rhs: Grpc_Testing_StreamingInputCallRequest) -> Bool {
  592. if lhs._payload != rhs._payload {return false}
  593. if lhs._expectCompressed != rhs._expectCompressed {return false}
  594. if lhs.unknownFields != rhs.unknownFields {return false}
  595. return true
  596. }
  597. }
  598. extension Grpc_Testing_StreamingInputCallResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  599. public static let protoMessageName: String = _protobuf_package + ".StreamingInputCallResponse"
  600. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  601. 1: .standard(proto: "aggregated_payload_size"),
  602. ]
  603. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  604. while let fieldNumber = try decoder.nextFieldNumber() {
  605. // The use of inline closures is to circumvent an issue where the compiler
  606. // allocates stack space for every case branch when no optimizations are
  607. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  608. switch fieldNumber {
  609. case 1: try { try decoder.decodeSingularInt32Field(value: &self.aggregatedPayloadSize) }()
  610. default: break
  611. }
  612. }
  613. }
  614. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  615. if self.aggregatedPayloadSize != 0 {
  616. try visitor.visitSingularInt32Field(value: self.aggregatedPayloadSize, fieldNumber: 1)
  617. }
  618. try unknownFields.traverse(visitor: &visitor)
  619. }
  620. public static func ==(lhs: Grpc_Testing_StreamingInputCallResponse, rhs: Grpc_Testing_StreamingInputCallResponse) -> Bool {
  621. if lhs.aggregatedPayloadSize != rhs.aggregatedPayloadSize {return false}
  622. if lhs.unknownFields != rhs.unknownFields {return false}
  623. return true
  624. }
  625. }
  626. extension Grpc_Testing_ResponseParameters: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  627. public static let protoMessageName: String = _protobuf_package + ".ResponseParameters"
  628. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  629. 1: .same(proto: "size"),
  630. 2: .standard(proto: "interval_us"),
  631. 3: .same(proto: "compressed"),
  632. ]
  633. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  634. while let fieldNumber = try decoder.nextFieldNumber() {
  635. // The use of inline closures is to circumvent an issue where the compiler
  636. // allocates stack space for every case branch when no optimizations are
  637. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  638. switch fieldNumber {
  639. case 1: try { try decoder.decodeSingularInt32Field(value: &self.size) }()
  640. case 2: try { try decoder.decodeSingularInt32Field(value: &self.intervalUs) }()
  641. case 3: try { try decoder.decodeSingularMessageField(value: &self._compressed) }()
  642. default: break
  643. }
  644. }
  645. }
  646. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  647. // The use of inline closures is to circumvent an issue where the compiler
  648. // allocates stack space for every if/case branch local when no optimizations
  649. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  650. // https://github.com/apple/swift-protobuf/issues/1182
  651. if self.size != 0 {
  652. try visitor.visitSingularInt32Field(value: self.size, fieldNumber: 1)
  653. }
  654. if self.intervalUs != 0 {
  655. try visitor.visitSingularInt32Field(value: self.intervalUs, fieldNumber: 2)
  656. }
  657. try { if let v = self._compressed {
  658. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  659. } }()
  660. try unknownFields.traverse(visitor: &visitor)
  661. }
  662. public static func ==(lhs: Grpc_Testing_ResponseParameters, rhs: Grpc_Testing_ResponseParameters) -> Bool {
  663. if lhs.size != rhs.size {return false}
  664. if lhs.intervalUs != rhs.intervalUs {return false}
  665. if lhs._compressed != rhs._compressed {return false}
  666. if lhs.unknownFields != rhs.unknownFields {return false}
  667. return true
  668. }
  669. }
  670. extension Grpc_Testing_StreamingOutputCallRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  671. public static let protoMessageName: String = _protobuf_package + ".StreamingOutputCallRequest"
  672. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  673. 1: .standard(proto: "response_type"),
  674. 2: .standard(proto: "response_parameters"),
  675. 3: .same(proto: "payload"),
  676. 7: .standard(proto: "response_status"),
  677. ]
  678. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  679. while let fieldNumber = try decoder.nextFieldNumber() {
  680. // The use of inline closures is to circumvent an issue where the compiler
  681. // allocates stack space for every case branch when no optimizations are
  682. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  683. switch fieldNumber {
  684. case 1: try { try decoder.decodeSingularEnumField(value: &self.responseType) }()
  685. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.responseParameters) }()
  686. case 3: try { try decoder.decodeSingularMessageField(value: &self._payload) }()
  687. case 7: try { try decoder.decodeSingularMessageField(value: &self._responseStatus) }()
  688. default: break
  689. }
  690. }
  691. }
  692. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  693. // The use of inline closures is to circumvent an issue where the compiler
  694. // allocates stack space for every if/case branch local when no optimizations
  695. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  696. // https://github.com/apple/swift-protobuf/issues/1182
  697. if self.responseType != .compressable {
  698. try visitor.visitSingularEnumField(value: self.responseType, fieldNumber: 1)
  699. }
  700. if !self.responseParameters.isEmpty {
  701. try visitor.visitRepeatedMessageField(value: self.responseParameters, fieldNumber: 2)
  702. }
  703. try { if let v = self._payload {
  704. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  705. } }()
  706. try { if let v = self._responseStatus {
  707. try visitor.visitSingularMessageField(value: v, fieldNumber: 7)
  708. } }()
  709. try unknownFields.traverse(visitor: &visitor)
  710. }
  711. public static func ==(lhs: Grpc_Testing_StreamingOutputCallRequest, rhs: Grpc_Testing_StreamingOutputCallRequest) -> Bool {
  712. if lhs.responseType != rhs.responseType {return false}
  713. if lhs.responseParameters != rhs.responseParameters {return false}
  714. if lhs._payload != rhs._payload {return false}
  715. if lhs._responseStatus != rhs._responseStatus {return false}
  716. if lhs.unknownFields != rhs.unknownFields {return false}
  717. return true
  718. }
  719. }
  720. extension Grpc_Testing_StreamingOutputCallResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  721. public static let protoMessageName: String = _protobuf_package + ".StreamingOutputCallResponse"
  722. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  723. 1: .same(proto: "payload"),
  724. ]
  725. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  726. while let fieldNumber = try decoder.nextFieldNumber() {
  727. // The use of inline closures is to circumvent an issue where the compiler
  728. // allocates stack space for every case branch when no optimizations are
  729. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  730. switch fieldNumber {
  731. case 1: try { try decoder.decodeSingularMessageField(value: &self._payload) }()
  732. default: break
  733. }
  734. }
  735. }
  736. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  737. // The use of inline closures is to circumvent an issue where the compiler
  738. // allocates stack space for every if/case branch local when no optimizations
  739. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  740. // https://github.com/apple/swift-protobuf/issues/1182
  741. try { if let v = self._payload {
  742. try visitor.visitSingularMessageField(value: v, fieldNumber: 1)
  743. } }()
  744. try unknownFields.traverse(visitor: &visitor)
  745. }
  746. public static func ==(lhs: Grpc_Testing_StreamingOutputCallResponse, rhs: Grpc_Testing_StreamingOutputCallResponse) -> Bool {
  747. if lhs._payload != rhs._payload {return false}
  748. if lhs.unknownFields != rhs.unknownFields {return false}
  749. return true
  750. }
  751. }
  752. extension Grpc_Testing_ReconnectParams: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  753. public static let protoMessageName: String = _protobuf_package + ".ReconnectParams"
  754. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  755. 1: .standard(proto: "max_reconnect_backoff_ms"),
  756. ]
  757. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  758. while let fieldNumber = try decoder.nextFieldNumber() {
  759. // The use of inline closures is to circumvent an issue where the compiler
  760. // allocates stack space for every case branch when no optimizations are
  761. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  762. switch fieldNumber {
  763. case 1: try { try decoder.decodeSingularInt32Field(value: &self.maxReconnectBackoffMs) }()
  764. default: break
  765. }
  766. }
  767. }
  768. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  769. if self.maxReconnectBackoffMs != 0 {
  770. try visitor.visitSingularInt32Field(value: self.maxReconnectBackoffMs, fieldNumber: 1)
  771. }
  772. try unknownFields.traverse(visitor: &visitor)
  773. }
  774. public static func ==(lhs: Grpc_Testing_ReconnectParams, rhs: Grpc_Testing_ReconnectParams) -> Bool {
  775. if lhs.maxReconnectBackoffMs != rhs.maxReconnectBackoffMs {return false}
  776. if lhs.unknownFields != rhs.unknownFields {return false}
  777. return true
  778. }
  779. }
  780. extension Grpc_Testing_ReconnectInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  781. public static let protoMessageName: String = _protobuf_package + ".ReconnectInfo"
  782. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  783. 1: .same(proto: "passed"),
  784. 2: .standard(proto: "backoff_ms"),
  785. ]
  786. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  787. while let fieldNumber = try decoder.nextFieldNumber() {
  788. // The use of inline closures is to circumvent an issue where the compiler
  789. // allocates stack space for every case branch when no optimizations are
  790. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  791. switch fieldNumber {
  792. case 1: try { try decoder.decodeSingularBoolField(value: &self.passed) }()
  793. case 2: try { try decoder.decodeRepeatedInt32Field(value: &self.backoffMs) }()
  794. default: break
  795. }
  796. }
  797. }
  798. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  799. if self.passed != false {
  800. try visitor.visitSingularBoolField(value: self.passed, fieldNumber: 1)
  801. }
  802. if !self.backoffMs.isEmpty {
  803. try visitor.visitPackedInt32Field(value: self.backoffMs, fieldNumber: 2)
  804. }
  805. try unknownFields.traverse(visitor: &visitor)
  806. }
  807. public static func ==(lhs: Grpc_Testing_ReconnectInfo, rhs: Grpc_Testing_ReconnectInfo) -> Bool {
  808. if lhs.passed != rhs.passed {return false}
  809. if lhs.backoffMs != rhs.backoffMs {return false}
  810. if lhs.unknownFields != rhs.unknownFields {return false}
  811. return true
  812. }
  813. }