reflection-v1.pb.swift 32 KB

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