2
0

reflection-v1alpha.pb.swift 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759
  1. // DO NOT EDIT.
  2. // swift-format-ignore-file
  3. // swiftlint:disable all
  4. //
  5. // Generated by the Swift generator plugin for the protocol buffer compiler.
  6. // Source: reflection.proto
  7. //
  8. // For information on using the generated types, please see the documentation:
  9. // https://github.com/apple/swift-protobuf/
  10. // Copyright 2016 The gRPC Authors
  11. //
  12. // Licensed under the Apache License, Version 2.0 (the "License");
  13. // you may not use this file except in compliance with the License.
  14. // You may obtain a copy of the License at
  15. //
  16. // http://www.apache.org/licenses/LICENSE-2.0
  17. //
  18. // Unless required by applicable law or agreed to in writing, software
  19. // distributed under the License is distributed on an "AS IS" BASIS,
  20. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  21. // See the License for the specific language governing permissions and
  22. // limitations under the License.
  23. // Service exported by server reflection
  24. // Warning: this entire file is deprecated. Use this instead:
  25. // https://github.com/grpc/grpc-proto/blob/master/grpc/reflection/v1/reflection.proto
  26. import Foundation
  27. import SwiftProtobuf
  28. // If the compiler emits an error on this type, it is because this file
  29. // was generated by a version of the `protoc` Swift plug-in that is
  30. // incompatible with the version of SwiftProtobuf to which you are linking.
  31. // Please ensure that you are building against the same version of the API
  32. // that was used to generate this file.
  33. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  34. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  35. typealias Version = _2
  36. }
  37. /// The message sent by the client when calling ServerReflectionInfo method.
  38. ///
  39. /// NOTE: The whole .proto file that defined this message was marked as deprecated.
  40. public struct Grpc_Reflection_V1alpha_ServerReflectionRequest: Sendable {
  41. // SwiftProtobuf.Message conformance is added in an extension below. See the
  42. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  43. // methods supported on all messages.
  44. public var host: String = String()
  45. /// To use reflection service, the client should set one of the following
  46. /// fields in message_request. The server distinguishes requests by their
  47. /// defined field and then handles them using corresponding methods.
  48. public var messageRequest: Grpc_Reflection_V1alpha_ServerReflectionRequest.OneOf_MessageRequest? = nil
  49. /// Find a proto file by the file name.
  50. public var fileByFilename: String {
  51. get {
  52. if case .fileByFilename(let v)? = messageRequest {return v}
  53. return String()
  54. }
  55. set {messageRequest = .fileByFilename(newValue)}
  56. }
  57. /// Find the proto file that declares the given fully-qualified symbol name.
  58. /// This field should be a fully-qualified symbol name
  59. /// (e.g. <package>.<service>[.<method>] or <package>.<type>).
  60. public var fileContainingSymbol: String {
  61. get {
  62. if case .fileContainingSymbol(let v)? = messageRequest {return v}
  63. return String()
  64. }
  65. set {messageRequest = .fileContainingSymbol(newValue)}
  66. }
  67. /// Find the proto file which defines an extension extending the given
  68. /// message type with the given field number.
  69. public var fileContainingExtension: Grpc_Reflection_V1alpha_ExtensionRequest {
  70. get {
  71. if case .fileContainingExtension(let v)? = messageRequest {return v}
  72. return Grpc_Reflection_V1alpha_ExtensionRequest()
  73. }
  74. set {messageRequest = .fileContainingExtension(newValue)}
  75. }
  76. /// Finds the tag numbers used by all known extensions of extendee_type, and
  77. /// appends them to ExtensionNumberResponse in an undefined order.
  78. /// Its corresponding method is best-effort: it's not guaranteed that the
  79. /// reflection service will implement this method, and it's not guaranteed
  80. /// that this method will provide all extensions. Returns
  81. /// StatusCode::UNIMPLEMENTED if it's not implemented.
  82. /// This field should be a fully-qualified type name. The format is
  83. /// <package>.<type>
  84. public var allExtensionNumbersOfType: String {
  85. get {
  86. if case .allExtensionNumbersOfType(let v)? = messageRequest {return v}
  87. return String()
  88. }
  89. set {messageRequest = .allExtensionNumbersOfType(newValue)}
  90. }
  91. /// List the full names of registered services. The content will not be
  92. /// checked.
  93. public var listServices: String {
  94. get {
  95. if case .listServices(let v)? = messageRequest {return v}
  96. return String()
  97. }
  98. set {messageRequest = .listServices(newValue)}
  99. }
  100. public var unknownFields = SwiftProtobuf.UnknownStorage()
  101. /// To use reflection service, the client should set one of the following
  102. /// fields in message_request. The server distinguishes requests by their
  103. /// defined field and then handles them using corresponding methods.
  104. public enum OneOf_MessageRequest: Equatable, Sendable {
  105. /// Find a proto file by the file name.
  106. case fileByFilename(String)
  107. /// Find the proto file that declares the given fully-qualified symbol name.
  108. /// This field should be a fully-qualified symbol name
  109. /// (e.g. <package>.<service>[.<method>] or <package>.<type>).
  110. case fileContainingSymbol(String)
  111. /// Find the proto file which defines an extension extending the given
  112. /// message type with the given field number.
  113. case fileContainingExtension(Grpc_Reflection_V1alpha_ExtensionRequest)
  114. /// Finds the tag numbers used by all known extensions of extendee_type, and
  115. /// appends them to ExtensionNumberResponse in an undefined order.
  116. /// Its corresponding method is best-effort: it's not guaranteed that the
  117. /// reflection service will implement this method, and it's not guaranteed
  118. /// that this method will provide all extensions. Returns
  119. /// StatusCode::UNIMPLEMENTED if it's not implemented.
  120. /// This field should be a fully-qualified type name. The format is
  121. /// <package>.<type>
  122. case allExtensionNumbersOfType(String)
  123. /// List the full names of registered services. The content will not be
  124. /// checked.
  125. case listServices(String)
  126. }
  127. public init() {}
  128. }
  129. /// The type name and extension number sent by the client when requesting
  130. /// file_containing_extension.
  131. ///
  132. /// NOTE: The whole .proto file that defined this message was marked as deprecated.
  133. public struct Grpc_Reflection_V1alpha_ExtensionRequest: Sendable {
  134. // SwiftProtobuf.Message conformance is added in an extension below. See the
  135. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  136. // methods supported on all messages.
  137. /// Fully-qualified type name. The format should be <package>.<type>
  138. public var containingType: String = String()
  139. public var extensionNumber: Int32 = 0
  140. public var unknownFields = SwiftProtobuf.UnknownStorage()
  141. public init() {}
  142. }
  143. /// The message sent by the server to answer ServerReflectionInfo method.
  144. ///
  145. /// NOTE: The whole .proto file that defined this message was marked as deprecated.
  146. public struct Grpc_Reflection_V1alpha_ServerReflectionResponse: Sendable {
  147. // SwiftProtobuf.Message conformance is added in an extension below. See the
  148. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  149. // methods supported on all messages.
  150. public var validHost: String = String()
  151. public var originalRequest: Grpc_Reflection_V1alpha_ServerReflectionRequest {
  152. get {return _originalRequest ?? Grpc_Reflection_V1alpha_ServerReflectionRequest()}
  153. set {_originalRequest = newValue}
  154. }
  155. /// Returns true if `originalRequest` has been explicitly set.
  156. public var hasOriginalRequest: Bool {return self._originalRequest != nil}
  157. /// Clears the value of `originalRequest`. Subsequent reads from it will return its default value.
  158. public mutating func clearOriginalRequest() {self._originalRequest = nil}
  159. /// The server set one of the following fields according to the message_request
  160. /// in the request.
  161. public var messageResponse: Grpc_Reflection_V1alpha_ServerReflectionResponse.OneOf_MessageResponse? = nil
  162. /// This message is used to answer file_by_filename, file_containing_symbol,
  163. /// file_containing_extension requests with transitive dependencies. As
  164. /// the repeated label is not allowed in oneof fields, we use a
  165. /// FileDescriptorResponse message to encapsulate the repeated fields.
  166. /// The reflection service is allowed to avoid sending FileDescriptorProtos
  167. /// that were previously sent in response to earlier requests in the stream.
  168. public var fileDescriptorResponse: Grpc_Reflection_V1alpha_FileDescriptorResponse {
  169. get {
  170. if case .fileDescriptorResponse(let v)? = messageResponse {return v}
  171. return Grpc_Reflection_V1alpha_FileDescriptorResponse()
  172. }
  173. set {messageResponse = .fileDescriptorResponse(newValue)}
  174. }
  175. /// This message is used to answer all_extension_numbers_of_type requst.
  176. public var allExtensionNumbersResponse: Grpc_Reflection_V1alpha_ExtensionNumberResponse {
  177. get {
  178. if case .allExtensionNumbersResponse(let v)? = messageResponse {return v}
  179. return Grpc_Reflection_V1alpha_ExtensionNumberResponse()
  180. }
  181. set {messageResponse = .allExtensionNumbersResponse(newValue)}
  182. }
  183. /// This message is used to answer list_services request.
  184. public var listServicesResponse: Grpc_Reflection_V1alpha_ListServiceResponse {
  185. get {
  186. if case .listServicesResponse(let v)? = messageResponse {return v}
  187. return Grpc_Reflection_V1alpha_ListServiceResponse()
  188. }
  189. set {messageResponse = .listServicesResponse(newValue)}
  190. }
  191. /// This message is used when an error occurs.
  192. public var errorResponse: Grpc_Reflection_V1alpha_ErrorResponse {
  193. get {
  194. if case .errorResponse(let v)? = messageResponse {return v}
  195. return Grpc_Reflection_V1alpha_ErrorResponse()
  196. }
  197. set {messageResponse = .errorResponse(newValue)}
  198. }
  199. public var unknownFields = SwiftProtobuf.UnknownStorage()
  200. /// The server set one of the following fields according to the message_request
  201. /// in the request.
  202. public enum OneOf_MessageResponse: Equatable, Sendable {
  203. /// This message is used to answer file_by_filename, file_containing_symbol,
  204. /// file_containing_extension requests with transitive dependencies. As
  205. /// the repeated label is not allowed in oneof fields, we use a
  206. /// FileDescriptorResponse message to encapsulate the repeated fields.
  207. /// The reflection service is allowed to avoid sending FileDescriptorProtos
  208. /// that were previously sent in response to earlier requests in the stream.
  209. case fileDescriptorResponse(Grpc_Reflection_V1alpha_FileDescriptorResponse)
  210. /// This message is used to answer all_extension_numbers_of_type requst.
  211. case allExtensionNumbersResponse(Grpc_Reflection_V1alpha_ExtensionNumberResponse)
  212. /// This message is used to answer list_services request.
  213. case listServicesResponse(Grpc_Reflection_V1alpha_ListServiceResponse)
  214. /// This message is used when an error occurs.
  215. case errorResponse(Grpc_Reflection_V1alpha_ErrorResponse)
  216. }
  217. public init() {}
  218. fileprivate var _originalRequest: Grpc_Reflection_V1alpha_ServerReflectionRequest? = nil
  219. }
  220. /// Serialized FileDescriptorProto messages sent by the server answering
  221. /// a file_by_filename, file_containing_symbol, or file_containing_extension
  222. /// request.
  223. ///
  224. /// NOTE: The whole .proto file that defined this message was marked as deprecated.
  225. public struct Grpc_Reflection_V1alpha_FileDescriptorResponse: Sendable {
  226. // SwiftProtobuf.Message conformance is added in an extension below. See the
  227. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  228. // methods supported on all messages.
  229. /// Serialized FileDescriptorProto messages. We avoid taking a dependency on
  230. /// descriptor.proto, which uses proto2 only features, by making them opaque
  231. /// bytes instead.
  232. public var fileDescriptorProto: [Data] = []
  233. public var unknownFields = SwiftProtobuf.UnknownStorage()
  234. public init() {}
  235. }
  236. /// A list of extension numbers sent by the server answering
  237. /// all_extension_numbers_of_type request.
  238. ///
  239. /// NOTE: The whole .proto file that defined this message was marked as deprecated.
  240. public struct Grpc_Reflection_V1alpha_ExtensionNumberResponse: Sendable {
  241. // SwiftProtobuf.Message conformance is added in an extension below. See the
  242. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  243. // methods supported on all messages.
  244. /// Full name of the base type, including the package name. The format
  245. /// is <package>.<type>
  246. public var baseTypeName: String = String()
  247. public var extensionNumber: [Int32] = []
  248. public var unknownFields = SwiftProtobuf.UnknownStorage()
  249. public init() {}
  250. }
  251. /// A list of ServiceResponse sent by the server answering list_services request.
  252. ///
  253. /// NOTE: The whole .proto file that defined this message was marked as deprecated.
  254. public struct Grpc_Reflection_V1alpha_ListServiceResponse: Sendable {
  255. // SwiftProtobuf.Message conformance is added in an extension below. See the
  256. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  257. // methods supported on all messages.
  258. /// The information of each service may be expanded in the future, so we use
  259. /// ServiceResponse message to encapsulate it.
  260. public var service: [Grpc_Reflection_V1alpha_ServiceResponse] = []
  261. public var unknownFields = SwiftProtobuf.UnknownStorage()
  262. public init() {}
  263. }
  264. /// The information of a single service used by ListServiceResponse to answer
  265. /// list_services request.
  266. ///
  267. /// NOTE: The whole .proto file that defined this message was marked as deprecated.
  268. public struct Grpc_Reflection_V1alpha_ServiceResponse: Sendable {
  269. // SwiftProtobuf.Message conformance is added in an extension below. See the
  270. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  271. // methods supported on all messages.
  272. /// Full name of a registered service, including its package name. The format
  273. /// is <package>.<service>
  274. public var name: String = String()
  275. public var unknownFields = SwiftProtobuf.UnknownStorage()
  276. public init() {}
  277. }
  278. /// The error code and error message sent by the server when an error occurs.
  279. ///
  280. /// NOTE: The whole .proto file that defined this message was marked as deprecated.
  281. public struct Grpc_Reflection_V1alpha_ErrorResponse: Sendable {
  282. // SwiftProtobuf.Message conformance is added in an extension below. See the
  283. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  284. // methods supported on all messages.
  285. /// This field uses the error codes defined in grpc::StatusCode.
  286. public var errorCode: Int32 = 0
  287. public var errorMessage: String = String()
  288. public var unknownFields = SwiftProtobuf.UnknownStorage()
  289. public init() {}
  290. }
  291. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  292. fileprivate let _protobuf_package = "grpc.reflection.v1alpha"
  293. extension Grpc_Reflection_V1alpha_ServerReflectionRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  294. public static let protoMessageName: String = _protobuf_package + ".ServerReflectionRequest"
  295. public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}host\0\u{4}\u{2}file_by_filename\0\u{3}file_containing_symbol\0\u{3}file_containing_extension\0\u{3}all_extension_numbers_of_type\0\u{3}list_services\0")
  296. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  297. while let fieldNumber = try decoder.nextFieldNumber() {
  298. // The use of inline closures is to circumvent an issue where the compiler
  299. // allocates stack space for every case branch when no optimizations are
  300. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  301. switch fieldNumber {
  302. case 1: try { try decoder.decodeSingularStringField(value: &self.host) }()
  303. case 3: try {
  304. var v: String?
  305. try decoder.decodeSingularStringField(value: &v)
  306. if let v = v {
  307. if self.messageRequest != nil {try decoder.handleConflictingOneOf()}
  308. self.messageRequest = .fileByFilename(v)
  309. }
  310. }()
  311. case 4: try {
  312. var v: String?
  313. try decoder.decodeSingularStringField(value: &v)
  314. if let v = v {
  315. if self.messageRequest != nil {try decoder.handleConflictingOneOf()}
  316. self.messageRequest = .fileContainingSymbol(v)
  317. }
  318. }()
  319. case 5: try {
  320. var v: Grpc_Reflection_V1alpha_ExtensionRequest?
  321. var hadOneofValue = false
  322. if let current = self.messageRequest {
  323. hadOneofValue = true
  324. if case .fileContainingExtension(let m) = current {v = m}
  325. }
  326. try decoder.decodeSingularMessageField(value: &v)
  327. if let v = v {
  328. if hadOneofValue {try decoder.handleConflictingOneOf()}
  329. self.messageRequest = .fileContainingExtension(v)
  330. }
  331. }()
  332. case 6: try {
  333. var v: String?
  334. try decoder.decodeSingularStringField(value: &v)
  335. if let v = v {
  336. if self.messageRequest != nil {try decoder.handleConflictingOneOf()}
  337. self.messageRequest = .allExtensionNumbersOfType(v)
  338. }
  339. }()
  340. case 7: try {
  341. var v: String?
  342. try decoder.decodeSingularStringField(value: &v)
  343. if let v = v {
  344. if self.messageRequest != nil {try decoder.handleConflictingOneOf()}
  345. self.messageRequest = .listServices(v)
  346. }
  347. }()
  348. default: break
  349. }
  350. }
  351. }
  352. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  353. // The use of inline closures is to circumvent an issue where the compiler
  354. // allocates stack space for every if/case branch local when no optimizations
  355. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  356. // https://github.com/apple/swift-protobuf/issues/1182
  357. if !self.host.isEmpty {
  358. try visitor.visitSingularStringField(value: self.host, fieldNumber: 1)
  359. }
  360. switch self.messageRequest {
  361. case .fileByFilename?: try {
  362. guard case .fileByFilename(let v)? = self.messageRequest else { preconditionFailure() }
  363. try visitor.visitSingularStringField(value: v, fieldNumber: 3)
  364. }()
  365. case .fileContainingSymbol?: try {
  366. guard case .fileContainingSymbol(let v)? = self.messageRequest else { preconditionFailure() }
  367. try visitor.visitSingularStringField(value: v, fieldNumber: 4)
  368. }()
  369. case .fileContainingExtension?: try {
  370. guard case .fileContainingExtension(let v)? = self.messageRequest else { preconditionFailure() }
  371. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  372. }()
  373. case .allExtensionNumbersOfType?: try {
  374. guard case .allExtensionNumbersOfType(let v)? = self.messageRequest else { preconditionFailure() }
  375. try visitor.visitSingularStringField(value: v, fieldNumber: 6)
  376. }()
  377. case .listServices?: try {
  378. guard case .listServices(let v)? = self.messageRequest else { preconditionFailure() }
  379. try visitor.visitSingularStringField(value: v, fieldNumber: 7)
  380. }()
  381. case nil: break
  382. }
  383. try unknownFields.traverse(visitor: &visitor)
  384. }
  385. public static func ==(lhs: Grpc_Reflection_V1alpha_ServerReflectionRequest, rhs: Grpc_Reflection_V1alpha_ServerReflectionRequest) -> Bool {
  386. if lhs.host != rhs.host {return false}
  387. if lhs.messageRequest != rhs.messageRequest {return false}
  388. if lhs.unknownFields != rhs.unknownFields {return false}
  389. return true
  390. }
  391. }
  392. extension Grpc_Reflection_V1alpha_ExtensionRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  393. public static let protoMessageName: String = _protobuf_package + ".ExtensionRequest"
  394. public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}containing_type\0\u{3}extension_number\0")
  395. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  396. while let fieldNumber = try decoder.nextFieldNumber() {
  397. // The use of inline closures is to circumvent an issue where the compiler
  398. // allocates stack space for every case branch when no optimizations are
  399. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  400. switch fieldNumber {
  401. case 1: try { try decoder.decodeSingularStringField(value: &self.containingType) }()
  402. case 2: try { try decoder.decodeSingularInt32Field(value: &self.extensionNumber) }()
  403. default: break
  404. }
  405. }
  406. }
  407. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  408. if !self.containingType.isEmpty {
  409. try visitor.visitSingularStringField(value: self.containingType, fieldNumber: 1)
  410. }
  411. if self.extensionNumber != 0 {
  412. try visitor.visitSingularInt32Field(value: self.extensionNumber, fieldNumber: 2)
  413. }
  414. try unknownFields.traverse(visitor: &visitor)
  415. }
  416. public static func ==(lhs: Grpc_Reflection_V1alpha_ExtensionRequest, rhs: Grpc_Reflection_V1alpha_ExtensionRequest) -> Bool {
  417. if lhs.containingType != rhs.containingType {return false}
  418. if lhs.extensionNumber != rhs.extensionNumber {return false}
  419. if lhs.unknownFields != rhs.unknownFields {return false}
  420. return true
  421. }
  422. }
  423. extension Grpc_Reflection_V1alpha_ServerReflectionResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  424. public static let protoMessageName: String = _protobuf_package + ".ServerReflectionResponse"
  425. public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}valid_host\0\u{3}original_request\0\u{4}\u{2}file_descriptor_response\0\u{3}all_extension_numbers_response\0\u{3}list_services_response\0\u{3}error_response\0")
  426. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  427. while let fieldNumber = try decoder.nextFieldNumber() {
  428. // The use of inline closures is to circumvent an issue where the compiler
  429. // allocates stack space for every case branch when no optimizations are
  430. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  431. switch fieldNumber {
  432. case 1: try { try decoder.decodeSingularStringField(value: &self.validHost) }()
  433. case 2: try { try decoder.decodeSingularMessageField(value: &self._originalRequest) }()
  434. case 4: try {
  435. var v: Grpc_Reflection_V1alpha_FileDescriptorResponse?
  436. var hadOneofValue = false
  437. if let current = self.messageResponse {
  438. hadOneofValue = true
  439. if case .fileDescriptorResponse(let m) = current {v = m}
  440. }
  441. try decoder.decodeSingularMessageField(value: &v)
  442. if let v = v {
  443. if hadOneofValue {try decoder.handleConflictingOneOf()}
  444. self.messageResponse = .fileDescriptorResponse(v)
  445. }
  446. }()
  447. case 5: try {
  448. var v: Grpc_Reflection_V1alpha_ExtensionNumberResponse?
  449. var hadOneofValue = false
  450. if let current = self.messageResponse {
  451. hadOneofValue = true
  452. if case .allExtensionNumbersResponse(let m) = current {v = m}
  453. }
  454. try decoder.decodeSingularMessageField(value: &v)
  455. if let v = v {
  456. if hadOneofValue {try decoder.handleConflictingOneOf()}
  457. self.messageResponse = .allExtensionNumbersResponse(v)
  458. }
  459. }()
  460. case 6: try {
  461. var v: Grpc_Reflection_V1alpha_ListServiceResponse?
  462. var hadOneofValue = false
  463. if let current = self.messageResponse {
  464. hadOneofValue = true
  465. if case .listServicesResponse(let m) = current {v = m}
  466. }
  467. try decoder.decodeSingularMessageField(value: &v)
  468. if let v = v {
  469. if hadOneofValue {try decoder.handleConflictingOneOf()}
  470. self.messageResponse = .listServicesResponse(v)
  471. }
  472. }()
  473. case 7: try {
  474. var v: Grpc_Reflection_V1alpha_ErrorResponse?
  475. var hadOneofValue = false
  476. if let current = self.messageResponse {
  477. hadOneofValue = true
  478. if case .errorResponse(let m) = current {v = m}
  479. }
  480. try decoder.decodeSingularMessageField(value: &v)
  481. if let v = v {
  482. if hadOneofValue {try decoder.handleConflictingOneOf()}
  483. self.messageResponse = .errorResponse(v)
  484. }
  485. }()
  486. default: break
  487. }
  488. }
  489. }
  490. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  491. // The use of inline closures is to circumvent an issue where the compiler
  492. // allocates stack space for every if/case branch local when no optimizations
  493. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  494. // https://github.com/apple/swift-protobuf/issues/1182
  495. if !self.validHost.isEmpty {
  496. try visitor.visitSingularStringField(value: self.validHost, fieldNumber: 1)
  497. }
  498. try { if let v = self._originalRequest {
  499. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  500. } }()
  501. switch self.messageResponse {
  502. case .fileDescriptorResponse?: try {
  503. guard case .fileDescriptorResponse(let v)? = self.messageResponse else { preconditionFailure() }
  504. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  505. }()
  506. case .allExtensionNumbersResponse?: try {
  507. guard case .allExtensionNumbersResponse(let v)? = self.messageResponse else { preconditionFailure() }
  508. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  509. }()
  510. case .listServicesResponse?: try {
  511. guard case .listServicesResponse(let v)? = self.messageResponse else { preconditionFailure() }
  512. try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
  513. }()
  514. case .errorResponse?: try {
  515. guard case .errorResponse(let v)? = self.messageResponse else { preconditionFailure() }
  516. try visitor.visitSingularMessageField(value: v, fieldNumber: 7)
  517. }()
  518. case nil: break
  519. }
  520. try unknownFields.traverse(visitor: &visitor)
  521. }
  522. public static func ==(lhs: Grpc_Reflection_V1alpha_ServerReflectionResponse, rhs: Grpc_Reflection_V1alpha_ServerReflectionResponse) -> Bool {
  523. if lhs.validHost != rhs.validHost {return false}
  524. if lhs._originalRequest != rhs._originalRequest {return false}
  525. if lhs.messageResponse != rhs.messageResponse {return false}
  526. if lhs.unknownFields != rhs.unknownFields {return false}
  527. return true
  528. }
  529. }
  530. extension Grpc_Reflection_V1alpha_FileDescriptorResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  531. public static let protoMessageName: String = _protobuf_package + ".FileDescriptorResponse"
  532. public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}file_descriptor_proto\0")
  533. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  534. while let fieldNumber = try decoder.nextFieldNumber() {
  535. // The use of inline closures is to circumvent an issue where the compiler
  536. // allocates stack space for every case branch when no optimizations are
  537. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  538. switch fieldNumber {
  539. case 1: try { try decoder.decodeRepeatedBytesField(value: &self.fileDescriptorProto) }()
  540. default: break
  541. }
  542. }
  543. }
  544. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  545. if !self.fileDescriptorProto.isEmpty {
  546. try visitor.visitRepeatedBytesField(value: self.fileDescriptorProto, fieldNumber: 1)
  547. }
  548. try unknownFields.traverse(visitor: &visitor)
  549. }
  550. public static func ==(lhs: Grpc_Reflection_V1alpha_FileDescriptorResponse, rhs: Grpc_Reflection_V1alpha_FileDescriptorResponse) -> Bool {
  551. if lhs.fileDescriptorProto != rhs.fileDescriptorProto {return false}
  552. if lhs.unknownFields != rhs.unknownFields {return false}
  553. return true
  554. }
  555. }
  556. extension Grpc_Reflection_V1alpha_ExtensionNumberResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  557. public static let protoMessageName: String = _protobuf_package + ".ExtensionNumberResponse"
  558. public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}base_type_name\0\u{3}extension_number\0")
  559. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  560. while let fieldNumber = try decoder.nextFieldNumber() {
  561. // The use of inline closures is to circumvent an issue where the compiler
  562. // allocates stack space for every case branch when no optimizations are
  563. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  564. switch fieldNumber {
  565. case 1: try { try decoder.decodeSingularStringField(value: &self.baseTypeName) }()
  566. case 2: try { try decoder.decodeRepeatedInt32Field(value: &self.extensionNumber) }()
  567. default: break
  568. }
  569. }
  570. }
  571. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  572. if !self.baseTypeName.isEmpty {
  573. try visitor.visitSingularStringField(value: self.baseTypeName, fieldNumber: 1)
  574. }
  575. if !self.extensionNumber.isEmpty {
  576. try visitor.visitPackedInt32Field(value: self.extensionNumber, fieldNumber: 2)
  577. }
  578. try unknownFields.traverse(visitor: &visitor)
  579. }
  580. public static func ==(lhs: Grpc_Reflection_V1alpha_ExtensionNumberResponse, rhs: Grpc_Reflection_V1alpha_ExtensionNumberResponse) -> Bool {
  581. if lhs.baseTypeName != rhs.baseTypeName {return false}
  582. if lhs.extensionNumber != rhs.extensionNumber {return false}
  583. if lhs.unknownFields != rhs.unknownFields {return false}
  584. return true
  585. }
  586. }
  587. extension Grpc_Reflection_V1alpha_ListServiceResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  588. public static let protoMessageName: String = _protobuf_package + ".ListServiceResponse"
  589. public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}service\0")
  590. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  591. while let fieldNumber = try decoder.nextFieldNumber() {
  592. // The use of inline closures is to circumvent an issue where the compiler
  593. // allocates stack space for every case branch when no optimizations are
  594. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  595. switch fieldNumber {
  596. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.service) }()
  597. default: break
  598. }
  599. }
  600. }
  601. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  602. if !self.service.isEmpty {
  603. try visitor.visitRepeatedMessageField(value: self.service, fieldNumber: 1)
  604. }
  605. try unknownFields.traverse(visitor: &visitor)
  606. }
  607. public static func ==(lhs: Grpc_Reflection_V1alpha_ListServiceResponse, rhs: Grpc_Reflection_V1alpha_ListServiceResponse) -> Bool {
  608. if lhs.service != rhs.service {return false}
  609. if lhs.unknownFields != rhs.unknownFields {return false}
  610. return true
  611. }
  612. }
  613. extension Grpc_Reflection_V1alpha_ServiceResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  614. public static let protoMessageName: String = _protobuf_package + ".ServiceResponse"
  615. public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}name\0")
  616. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  617. while let fieldNumber = try decoder.nextFieldNumber() {
  618. // The use of inline closures is to circumvent an issue where the compiler
  619. // allocates stack space for every case branch when no optimizations are
  620. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  621. switch fieldNumber {
  622. case 1: try { try decoder.decodeSingularStringField(value: &self.name) }()
  623. default: break
  624. }
  625. }
  626. }
  627. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  628. if !self.name.isEmpty {
  629. try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
  630. }
  631. try unknownFields.traverse(visitor: &visitor)
  632. }
  633. public static func ==(lhs: Grpc_Reflection_V1alpha_ServiceResponse, rhs: Grpc_Reflection_V1alpha_ServiceResponse) -> Bool {
  634. if lhs.name != rhs.name {return false}
  635. if lhs.unknownFields != rhs.unknownFields {return false}
  636. return true
  637. }
  638. }
  639. extension Grpc_Reflection_V1alpha_ErrorResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  640. public static let protoMessageName: String = _protobuf_package + ".ErrorResponse"
  641. public static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}error_code\0\u{3}error_message\0")
  642. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  643. while let fieldNumber = try decoder.nextFieldNumber() {
  644. // The use of inline closures is to circumvent an issue where the compiler
  645. // allocates stack space for every case branch when no optimizations are
  646. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  647. switch fieldNumber {
  648. case 1: try { try decoder.decodeSingularInt32Field(value: &self.errorCode) }()
  649. case 2: try { try decoder.decodeSingularStringField(value: &self.errorMessage) }()
  650. default: break
  651. }
  652. }
  653. }
  654. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  655. if self.errorCode != 0 {
  656. try visitor.visitSingularInt32Field(value: self.errorCode, fieldNumber: 1)
  657. }
  658. if !self.errorMessage.isEmpty {
  659. try visitor.visitSingularStringField(value: self.errorMessage, fieldNumber: 2)
  660. }
  661. try unknownFields.traverse(visitor: &visitor)
  662. }
  663. public static func ==(lhs: Grpc_Reflection_V1alpha_ErrorResponse, rhs: Grpc_Reflection_V1alpha_ErrorResponse) -> Bool {
  664. if lhs.errorCode != rhs.errorCode {return false}
  665. if lhs.errorMessage != rhs.errorMessage {return false}
  666. if lhs.unknownFields != rhs.unknownFields {return false}
  667. return true
  668. }
  669. }