reflection-v1.pb.swift 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  1. // DO NOT EDIT.
  2. // swift-format-ignore-file
  3. //
  4. // Generated by the Swift generator plugin for the protocol buffer compiler.
  5. // Source: reflection.proto
  6. //
  7. // For information on using the generated types, please see the documentation:
  8. // https://github.com/apple/swift-protobuf/
  9. // Copyright 2016 The 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. // Service exported by server reflection. A more complete description of how
  23. // server reflection works can be found at
  24. // https://github.com/grpc/grpc/blob/master/doc/server-reflection.md
  25. //
  26. // The canonical version of this proto can be found at
  27. // https://github.com/grpc/grpc-proto/blob/master/grpc/reflection/v1/reflection.proto
  28. import Foundation
  29. import SwiftProtobuf
  30. // If the compiler emits an error on this type, it is because this file
  31. // was generated by a version of the `protoc` Swift plug-in that is
  32. // incompatible with the version of SwiftProtobuf to which you are linking.
  33. // Please ensure that you are building against the same version of the API
  34. // that was used to generate this file.
  35. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  36. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  37. typealias Version = _2
  38. }
  39. /// The message sent by the client when calling ServerReflectionInfo method.
  40. public struct Grpc_Reflection_V1_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_V1_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_V1_ExtensionRequest {
  70. get {
  71. if case .fileContainingExtension(let v)? = messageRequest {return v}
  72. return Grpc_Reflection_V1_ExtensionRequest()
  73. }
  74. set {messageRequest = .fileContainingExtension(newValue)}
  75. }
  76. /// Finds the tag numbers used by all known extensions of the given message
  77. /// type, and 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_V1_ExtensionRequest)
  114. /// Finds the tag numbers used by all known extensions of the given message
  115. /// type, and 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. public struct Grpc_Reflection_V1_ExtensionRequest: Sendable {
  132. // SwiftProtobuf.Message conformance is added in an extension below. See the
  133. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  134. // methods supported on all messages.
  135. /// Fully-qualified type name. The format should be <package>.<type>
  136. public var containingType: String = String()
  137. public var extensionNumber: Int32 = 0
  138. public var unknownFields = SwiftProtobuf.UnknownStorage()
  139. public init() {}
  140. }
  141. /// The message sent by the server to answer ServerReflectionInfo method.
  142. public struct Grpc_Reflection_V1_ServerReflectionResponse: Sendable {
  143. // SwiftProtobuf.Message conformance is added in an extension below. See the
  144. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  145. // methods supported on all messages.
  146. public var validHost: String = String()
  147. public var originalRequest: Grpc_Reflection_V1_ServerReflectionRequest {
  148. get {return _originalRequest ?? Grpc_Reflection_V1_ServerReflectionRequest()}
  149. set {_originalRequest = newValue}
  150. }
  151. /// Returns true if `originalRequest` has been explicitly set.
  152. public var hasOriginalRequest: Bool {return self._originalRequest != nil}
  153. /// Clears the value of `originalRequest`. Subsequent reads from it will return its default value.
  154. public mutating func clearOriginalRequest() {self._originalRequest = nil}
  155. /// The server sets one of the following fields according to the message_request
  156. /// in the request.
  157. public var messageResponse: Grpc_Reflection_V1_ServerReflectionResponse.OneOf_MessageResponse? = nil
  158. /// This message is used to answer file_by_filename, file_containing_symbol,
  159. /// file_containing_extension requests with transitive dependencies.
  160. /// As the repeated label is not allowed in oneof fields, we use a
  161. /// FileDescriptorResponse message to encapsulate the repeated fields.
  162. /// The reflection service is allowed to avoid sending FileDescriptorProtos
  163. /// that were previously sent in response to earlier requests in the stream.
  164. public var fileDescriptorResponse: Grpc_Reflection_V1_FileDescriptorResponse {
  165. get {
  166. if case .fileDescriptorResponse(let v)? = messageResponse {return v}
  167. return Grpc_Reflection_V1_FileDescriptorResponse()
  168. }
  169. set {messageResponse = .fileDescriptorResponse(newValue)}
  170. }
  171. /// This message is used to answer all_extension_numbers_of_type requests.
  172. public var allExtensionNumbersResponse: Grpc_Reflection_V1_ExtensionNumberResponse {
  173. get {
  174. if case .allExtensionNumbersResponse(let v)? = messageResponse {return v}
  175. return Grpc_Reflection_V1_ExtensionNumberResponse()
  176. }
  177. set {messageResponse = .allExtensionNumbersResponse(newValue)}
  178. }
  179. /// This message is used to answer list_services requests.
  180. public var listServicesResponse: Grpc_Reflection_V1_ListServiceResponse {
  181. get {
  182. if case .listServicesResponse(let v)? = messageResponse {return v}
  183. return Grpc_Reflection_V1_ListServiceResponse()
  184. }
  185. set {messageResponse = .listServicesResponse(newValue)}
  186. }
  187. /// This message is used when an error occurs.
  188. public var errorResponse: Grpc_Reflection_V1_ErrorResponse {
  189. get {
  190. if case .errorResponse(let v)? = messageResponse {return v}
  191. return Grpc_Reflection_V1_ErrorResponse()
  192. }
  193. set {messageResponse = .errorResponse(newValue)}
  194. }
  195. public var unknownFields = SwiftProtobuf.UnknownStorage()
  196. /// The server sets one of the following fields according to the message_request
  197. /// in the request.
  198. public enum OneOf_MessageResponse: Equatable, Sendable {
  199. /// This message is used to answer file_by_filename, file_containing_symbol,
  200. /// file_containing_extension requests with transitive dependencies.
  201. /// As the repeated label is not allowed in oneof fields, we use a
  202. /// FileDescriptorResponse message to encapsulate the repeated fields.
  203. /// The reflection service is allowed to avoid sending FileDescriptorProtos
  204. /// that were previously sent in response to earlier requests in the stream.
  205. case fileDescriptorResponse(Grpc_Reflection_V1_FileDescriptorResponse)
  206. /// This message is used to answer all_extension_numbers_of_type requests.
  207. case allExtensionNumbersResponse(Grpc_Reflection_V1_ExtensionNumberResponse)
  208. /// This message is used to answer list_services requests.
  209. case listServicesResponse(Grpc_Reflection_V1_ListServiceResponse)
  210. /// This message is used when an error occurs.
  211. case errorResponse(Grpc_Reflection_V1_ErrorResponse)
  212. }
  213. public init() {}
  214. fileprivate var _originalRequest: Grpc_Reflection_V1_ServerReflectionRequest? = nil
  215. }
  216. /// Serialized FileDescriptorProto messages sent by the server answering
  217. /// a file_by_filename, file_containing_symbol, or file_containing_extension
  218. /// request.
  219. public struct Grpc_Reflection_V1_FileDescriptorResponse: @unchecked Sendable {
  220. // SwiftProtobuf.Message conformance is added in an extension below. See the
  221. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  222. // methods supported on all messages.
  223. /// Serialized FileDescriptorProto messages. We avoid taking a dependency on
  224. /// descriptor.proto, which uses proto2 only features, by making them opaque
  225. /// bytes instead.
  226. public var fileDescriptorProto: [Data] = []
  227. public var unknownFields = SwiftProtobuf.UnknownStorage()
  228. public init() {}
  229. }
  230. /// A list of extension numbers sent by the server answering
  231. /// all_extension_numbers_of_type request.
  232. public struct Grpc_Reflection_V1_ExtensionNumberResponse: Sendable {
  233. // SwiftProtobuf.Message conformance is added in an extension below. See the
  234. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  235. // methods supported on all messages.
  236. /// Full name of the base type, including the package name. The format
  237. /// is <package>.<type>
  238. public var baseTypeName: String = String()
  239. public var extensionNumber: [Int32] = []
  240. public var unknownFields = SwiftProtobuf.UnknownStorage()
  241. public init() {}
  242. }
  243. /// A list of ServiceResponse sent by the server answering list_services request.
  244. public struct Grpc_Reflection_V1_ListServiceResponse: Sendable {
  245. // SwiftProtobuf.Message conformance is added in an extension below. See the
  246. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  247. // methods supported on all messages.
  248. /// The information of each service may be expanded in the future, so we use
  249. /// ServiceResponse message to encapsulate it.
  250. public var service: [Grpc_Reflection_V1_ServiceResponse] = []
  251. public var unknownFields = SwiftProtobuf.UnknownStorage()
  252. public init() {}
  253. }
  254. /// The information of a single service used by ListServiceResponse to answer
  255. /// list_services request.
  256. public struct Grpc_Reflection_V1_ServiceResponse: Sendable {
  257. // SwiftProtobuf.Message conformance is added in an extension below. See the
  258. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  259. // methods supported on all messages.
  260. /// Full name of a registered service, including its package name. The format
  261. /// is <package>.<service>
  262. public var name: String = String()
  263. public var unknownFields = SwiftProtobuf.UnknownStorage()
  264. public init() {}
  265. }
  266. /// The error code and error message sent by the server when an error occurs.
  267. public struct Grpc_Reflection_V1_ErrorResponse: Sendable {
  268. // SwiftProtobuf.Message conformance is added in an extension below. See the
  269. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  270. // methods supported on all messages.
  271. /// This field uses the error codes defined in grpc::StatusCode.
  272. public var errorCode: Int32 = 0
  273. public var errorMessage: String = String()
  274. public var unknownFields = SwiftProtobuf.UnknownStorage()
  275. public init() {}
  276. }
  277. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  278. fileprivate let _protobuf_package = "grpc.reflection.v1"
  279. extension Grpc_Reflection_V1_ServerReflectionRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  280. public static let protoMessageName: String = _protobuf_package + ".ServerReflectionRequest"
  281. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  282. 1: .same(proto: "host"),
  283. 3: .standard(proto: "file_by_filename"),
  284. 4: .standard(proto: "file_containing_symbol"),
  285. 5: .standard(proto: "file_containing_extension"),
  286. 6: .standard(proto: "all_extension_numbers_of_type"),
  287. 7: .standard(proto: "list_services"),
  288. ]
  289. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  290. while let fieldNumber = try decoder.nextFieldNumber() {
  291. // The use of inline closures is to circumvent an issue where the compiler
  292. // allocates stack space for every case branch when no optimizations are
  293. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  294. switch fieldNumber {
  295. case 1: try { try decoder.decodeSingularStringField(value: &self.host) }()
  296. case 3: try {
  297. var v: String?
  298. try decoder.decodeSingularStringField(value: &v)
  299. if let v = v {
  300. if self.messageRequest != nil {try decoder.handleConflictingOneOf()}
  301. self.messageRequest = .fileByFilename(v)
  302. }
  303. }()
  304. case 4: try {
  305. var v: String?
  306. try decoder.decodeSingularStringField(value: &v)
  307. if let v = v {
  308. if self.messageRequest != nil {try decoder.handleConflictingOneOf()}
  309. self.messageRequest = .fileContainingSymbol(v)
  310. }
  311. }()
  312. case 5: try {
  313. var v: Grpc_Reflection_V1_ExtensionRequest?
  314. var hadOneofValue = false
  315. if let current = self.messageRequest {
  316. hadOneofValue = true
  317. if case .fileContainingExtension(let m) = current {v = m}
  318. }
  319. try decoder.decodeSingularMessageField(value: &v)
  320. if let v = v {
  321. if hadOneofValue {try decoder.handleConflictingOneOf()}
  322. self.messageRequest = .fileContainingExtension(v)
  323. }
  324. }()
  325. case 6: try {
  326. var v: String?
  327. try decoder.decodeSingularStringField(value: &v)
  328. if let v = v {
  329. if self.messageRequest != nil {try decoder.handleConflictingOneOf()}
  330. self.messageRequest = .allExtensionNumbersOfType(v)
  331. }
  332. }()
  333. case 7: try {
  334. var v: String?
  335. try decoder.decodeSingularStringField(value: &v)
  336. if let v = v {
  337. if self.messageRequest != nil {try decoder.handleConflictingOneOf()}
  338. self.messageRequest = .listServices(v)
  339. }
  340. }()
  341. default: break
  342. }
  343. }
  344. }
  345. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  346. // The use of inline closures is to circumvent an issue where the compiler
  347. // allocates stack space for every if/case branch local when no optimizations
  348. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  349. // https://github.com/apple/swift-protobuf/issues/1182
  350. if !self.host.isEmpty {
  351. try visitor.visitSingularStringField(value: self.host, fieldNumber: 1)
  352. }
  353. switch self.messageRequest {
  354. case .fileByFilename?: try {
  355. guard case .fileByFilename(let v)? = self.messageRequest else { preconditionFailure() }
  356. try visitor.visitSingularStringField(value: v, fieldNumber: 3)
  357. }()
  358. case .fileContainingSymbol?: try {
  359. guard case .fileContainingSymbol(let v)? = self.messageRequest else { preconditionFailure() }
  360. try visitor.visitSingularStringField(value: v, fieldNumber: 4)
  361. }()
  362. case .fileContainingExtension?: try {
  363. guard case .fileContainingExtension(let v)? = self.messageRequest else { preconditionFailure() }
  364. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  365. }()
  366. case .allExtensionNumbersOfType?: try {
  367. guard case .allExtensionNumbersOfType(let v)? = self.messageRequest else { preconditionFailure() }
  368. try visitor.visitSingularStringField(value: v, fieldNumber: 6)
  369. }()
  370. case .listServices?: try {
  371. guard case .listServices(let v)? = self.messageRequest else { preconditionFailure() }
  372. try visitor.visitSingularStringField(value: v, fieldNumber: 7)
  373. }()
  374. case nil: break
  375. }
  376. try unknownFields.traverse(visitor: &visitor)
  377. }
  378. public static func ==(lhs: Grpc_Reflection_V1_ServerReflectionRequest, rhs: Grpc_Reflection_V1_ServerReflectionRequest) -> Bool {
  379. if lhs.host != rhs.host {return false}
  380. if lhs.messageRequest != rhs.messageRequest {return false}
  381. if lhs.unknownFields != rhs.unknownFields {return false}
  382. return true
  383. }
  384. }
  385. extension Grpc_Reflection_V1_ExtensionRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  386. public static let protoMessageName: String = _protobuf_package + ".ExtensionRequest"
  387. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  388. 1: .standard(proto: "containing_type"),
  389. 2: .standard(proto: "extension_number"),
  390. ]
  391. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  392. while let fieldNumber = try decoder.nextFieldNumber() {
  393. // The use of inline closures is to circumvent an issue where the compiler
  394. // allocates stack space for every case branch when no optimizations are
  395. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  396. switch fieldNumber {
  397. case 1: try { try decoder.decodeSingularStringField(value: &self.containingType) }()
  398. case 2: try { try decoder.decodeSingularInt32Field(value: &self.extensionNumber) }()
  399. default: break
  400. }
  401. }
  402. }
  403. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  404. if !self.containingType.isEmpty {
  405. try visitor.visitSingularStringField(value: self.containingType, fieldNumber: 1)
  406. }
  407. if self.extensionNumber != 0 {
  408. try visitor.visitSingularInt32Field(value: self.extensionNumber, fieldNumber: 2)
  409. }
  410. try unknownFields.traverse(visitor: &visitor)
  411. }
  412. public static func ==(lhs: Grpc_Reflection_V1_ExtensionRequest, rhs: Grpc_Reflection_V1_ExtensionRequest) -> Bool {
  413. if lhs.containingType != rhs.containingType {return false}
  414. if lhs.extensionNumber != rhs.extensionNumber {return false}
  415. if lhs.unknownFields != rhs.unknownFields {return false}
  416. return true
  417. }
  418. }
  419. extension Grpc_Reflection_V1_ServerReflectionResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  420. public static let protoMessageName: String = _protobuf_package + ".ServerReflectionResponse"
  421. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  422. 1: .standard(proto: "valid_host"),
  423. 2: .standard(proto: "original_request"),
  424. 4: .standard(proto: "file_descriptor_response"),
  425. 5: .standard(proto: "all_extension_numbers_response"),
  426. 6: .standard(proto: "list_services_response"),
  427. 7: .standard(proto: "error_response"),
  428. ]
  429. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  430. while let fieldNumber = try decoder.nextFieldNumber() {
  431. // The use of inline closures is to circumvent an issue where the compiler
  432. // allocates stack space for every case branch when no optimizations are
  433. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  434. switch fieldNumber {
  435. case 1: try { try decoder.decodeSingularStringField(value: &self.validHost) }()
  436. case 2: try { try decoder.decodeSingularMessageField(value: &self._originalRequest) }()
  437. case 4: try {
  438. var v: Grpc_Reflection_V1_FileDescriptorResponse?
  439. var hadOneofValue = false
  440. if let current = self.messageResponse {
  441. hadOneofValue = true
  442. if case .fileDescriptorResponse(let m) = current {v = m}
  443. }
  444. try decoder.decodeSingularMessageField(value: &v)
  445. if let v = v {
  446. if hadOneofValue {try decoder.handleConflictingOneOf()}
  447. self.messageResponse = .fileDescriptorResponse(v)
  448. }
  449. }()
  450. case 5: try {
  451. var v: Grpc_Reflection_V1_ExtensionNumberResponse?
  452. var hadOneofValue = false
  453. if let current = self.messageResponse {
  454. hadOneofValue = true
  455. if case .allExtensionNumbersResponse(let m) = current {v = m}
  456. }
  457. try decoder.decodeSingularMessageField(value: &v)
  458. if let v = v {
  459. if hadOneofValue {try decoder.handleConflictingOneOf()}
  460. self.messageResponse = .allExtensionNumbersResponse(v)
  461. }
  462. }()
  463. case 6: try {
  464. var v: Grpc_Reflection_V1_ListServiceResponse?
  465. var hadOneofValue = false
  466. if let current = self.messageResponse {
  467. hadOneofValue = true
  468. if case .listServicesResponse(let m) = current {v = m}
  469. }
  470. try decoder.decodeSingularMessageField(value: &v)
  471. if let v = v {
  472. if hadOneofValue {try decoder.handleConflictingOneOf()}
  473. self.messageResponse = .listServicesResponse(v)
  474. }
  475. }()
  476. case 7: try {
  477. var v: Grpc_Reflection_V1_ErrorResponse?
  478. var hadOneofValue = false
  479. if let current = self.messageResponse {
  480. hadOneofValue = true
  481. if case .errorResponse(let m) = current {v = m}
  482. }
  483. try decoder.decodeSingularMessageField(value: &v)
  484. if let v = v {
  485. if hadOneofValue {try decoder.handleConflictingOneOf()}
  486. self.messageResponse = .errorResponse(v)
  487. }
  488. }()
  489. default: break
  490. }
  491. }
  492. }
  493. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  494. // The use of inline closures is to circumvent an issue where the compiler
  495. // allocates stack space for every if/case branch local when no optimizations
  496. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  497. // https://github.com/apple/swift-protobuf/issues/1182
  498. if !self.validHost.isEmpty {
  499. try visitor.visitSingularStringField(value: self.validHost, fieldNumber: 1)
  500. }
  501. try { if let v = self._originalRequest {
  502. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  503. } }()
  504. switch self.messageResponse {
  505. case .fileDescriptorResponse?: try {
  506. guard case .fileDescriptorResponse(let v)? = self.messageResponse else { preconditionFailure() }
  507. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  508. }()
  509. case .allExtensionNumbersResponse?: try {
  510. guard case .allExtensionNumbersResponse(let v)? = self.messageResponse else { preconditionFailure() }
  511. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  512. }()
  513. case .listServicesResponse?: try {
  514. guard case .listServicesResponse(let v)? = self.messageResponse else { preconditionFailure() }
  515. try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
  516. }()
  517. case .errorResponse?: try {
  518. guard case .errorResponse(let v)? = self.messageResponse else { preconditionFailure() }
  519. try visitor.visitSingularMessageField(value: v, fieldNumber: 7)
  520. }()
  521. case nil: break
  522. }
  523. try unknownFields.traverse(visitor: &visitor)
  524. }
  525. public static func ==(lhs: Grpc_Reflection_V1_ServerReflectionResponse, rhs: Grpc_Reflection_V1_ServerReflectionResponse) -> Bool {
  526. if lhs.validHost != rhs.validHost {return false}
  527. if lhs._originalRequest != rhs._originalRequest {return false}
  528. if lhs.messageResponse != rhs.messageResponse {return false}
  529. if lhs.unknownFields != rhs.unknownFields {return false}
  530. return true
  531. }
  532. }
  533. extension Grpc_Reflection_V1_FileDescriptorResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  534. public static let protoMessageName: String = _protobuf_package + ".FileDescriptorResponse"
  535. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  536. 1: .standard(proto: "file_descriptor_proto"),
  537. ]
  538. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  539. while let fieldNumber = try decoder.nextFieldNumber() {
  540. // The use of inline closures is to circumvent an issue where the compiler
  541. // allocates stack space for every case branch when no optimizations are
  542. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  543. switch fieldNumber {
  544. case 1: try { try decoder.decodeRepeatedBytesField(value: &self.fileDescriptorProto) }()
  545. default: break
  546. }
  547. }
  548. }
  549. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  550. if !self.fileDescriptorProto.isEmpty {
  551. try visitor.visitRepeatedBytesField(value: self.fileDescriptorProto, fieldNumber: 1)
  552. }
  553. try unknownFields.traverse(visitor: &visitor)
  554. }
  555. public static func ==(lhs: Grpc_Reflection_V1_FileDescriptorResponse, rhs: Grpc_Reflection_V1_FileDescriptorResponse) -> Bool {
  556. if lhs.fileDescriptorProto != rhs.fileDescriptorProto {return false}
  557. if lhs.unknownFields != rhs.unknownFields {return false}
  558. return true
  559. }
  560. }
  561. extension Grpc_Reflection_V1_ExtensionNumberResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  562. public static let protoMessageName: String = _protobuf_package + ".ExtensionNumberResponse"
  563. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  564. 1: .standard(proto: "base_type_name"),
  565. 2: .standard(proto: "extension_number"),
  566. ]
  567. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  568. while let fieldNumber = try decoder.nextFieldNumber() {
  569. // The use of inline closures is to circumvent an issue where the compiler
  570. // allocates stack space for every case branch when no optimizations are
  571. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  572. switch fieldNumber {
  573. case 1: try { try decoder.decodeSingularStringField(value: &self.baseTypeName) }()
  574. case 2: try { try decoder.decodeRepeatedInt32Field(value: &self.extensionNumber) }()
  575. default: break
  576. }
  577. }
  578. }
  579. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  580. if !self.baseTypeName.isEmpty {
  581. try visitor.visitSingularStringField(value: self.baseTypeName, fieldNumber: 1)
  582. }
  583. if !self.extensionNumber.isEmpty {
  584. try visitor.visitPackedInt32Field(value: self.extensionNumber, fieldNumber: 2)
  585. }
  586. try unknownFields.traverse(visitor: &visitor)
  587. }
  588. public static func ==(lhs: Grpc_Reflection_V1_ExtensionNumberResponse, rhs: Grpc_Reflection_V1_ExtensionNumberResponse) -> Bool {
  589. if lhs.baseTypeName != rhs.baseTypeName {return false}
  590. if lhs.extensionNumber != rhs.extensionNumber {return false}
  591. if lhs.unknownFields != rhs.unknownFields {return false}
  592. return true
  593. }
  594. }
  595. extension Grpc_Reflection_V1_ListServiceResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  596. public static let protoMessageName: String = _protobuf_package + ".ListServiceResponse"
  597. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  598. 1: .same(proto: "service"),
  599. ]
  600. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  601. while let fieldNumber = try decoder.nextFieldNumber() {
  602. // The use of inline closures is to circumvent an issue where the compiler
  603. // allocates stack space for every case branch when no optimizations are
  604. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  605. switch fieldNumber {
  606. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.service) }()
  607. default: break
  608. }
  609. }
  610. }
  611. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  612. if !self.service.isEmpty {
  613. try visitor.visitRepeatedMessageField(value: self.service, fieldNumber: 1)
  614. }
  615. try unknownFields.traverse(visitor: &visitor)
  616. }
  617. public static func ==(lhs: Grpc_Reflection_V1_ListServiceResponse, rhs: Grpc_Reflection_V1_ListServiceResponse) -> Bool {
  618. if lhs.service != rhs.service {return false}
  619. if lhs.unknownFields != rhs.unknownFields {return false}
  620. return true
  621. }
  622. }
  623. extension Grpc_Reflection_V1_ServiceResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  624. public static let protoMessageName: String = _protobuf_package + ".ServiceResponse"
  625. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  626. 1: .same(proto: "name"),
  627. ]
  628. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  629. while let fieldNumber = try decoder.nextFieldNumber() {
  630. // The use of inline closures is to circumvent an issue where the compiler
  631. // allocates stack space for every case branch when no optimizations are
  632. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  633. switch fieldNumber {
  634. case 1: try { try decoder.decodeSingularStringField(value: &self.name) }()
  635. default: break
  636. }
  637. }
  638. }
  639. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  640. if !self.name.isEmpty {
  641. try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
  642. }
  643. try unknownFields.traverse(visitor: &visitor)
  644. }
  645. public static func ==(lhs: Grpc_Reflection_V1_ServiceResponse, rhs: Grpc_Reflection_V1_ServiceResponse) -> Bool {
  646. if lhs.name != rhs.name {return false}
  647. if lhs.unknownFields != rhs.unknownFields {return false}
  648. return true
  649. }
  650. }
  651. extension Grpc_Reflection_V1_ErrorResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  652. public static let protoMessageName: String = _protobuf_package + ".ErrorResponse"
  653. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  654. 1: .standard(proto: "error_code"),
  655. 2: .standard(proto: "error_message"),
  656. ]
  657. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  658. while let fieldNumber = try decoder.nextFieldNumber() {
  659. // The use of inline closures is to circumvent an issue where the compiler
  660. // allocates stack space for every case branch when no optimizations are
  661. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  662. switch fieldNumber {
  663. case 1: try { try decoder.decodeSingularInt32Field(value: &self.errorCode) }()
  664. case 2: try { try decoder.decodeSingularStringField(value: &self.errorMessage) }()
  665. default: break
  666. }
  667. }
  668. }
  669. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  670. if self.errorCode != 0 {
  671. try visitor.visitSingularInt32Field(value: self.errorCode, fieldNumber: 1)
  672. }
  673. if !self.errorMessage.isEmpty {
  674. try visitor.visitSingularStringField(value: self.errorMessage, fieldNumber: 2)
  675. }
  676. try unknownFields.traverse(visitor: &visitor)
  677. }
  678. public static func ==(lhs: Grpc_Reflection_V1_ErrorResponse, rhs: Grpc_Reflection_V1_ErrorResponse) -> Bool {
  679. if lhs.errorCode != rhs.errorCode {return false}
  680. if lhs.errorMessage != rhs.errorMessage {return false}
  681. if lhs.unknownFields != rhs.unknownFields {return false}
  682. return true
  683. }
  684. }