2
0

reflection-v1alpha.pb.swift 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788
  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: @unchecked 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 = [
  296. 1: .same(proto: "host"),
  297. 3: .standard(proto: "file_by_filename"),
  298. 4: .standard(proto: "file_containing_symbol"),
  299. 5: .standard(proto: "file_containing_extension"),
  300. 6: .standard(proto: "all_extension_numbers_of_type"),
  301. 7: .standard(proto: "list_services"),
  302. ]
  303. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  304. while let fieldNumber = try decoder.nextFieldNumber() {
  305. // The use of inline closures is to circumvent an issue where the compiler
  306. // allocates stack space for every case branch when no optimizations are
  307. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  308. switch fieldNumber {
  309. case 1: try { try decoder.decodeSingularStringField(value: &self.host) }()
  310. case 3: try {
  311. var v: String?
  312. try decoder.decodeSingularStringField(value: &v)
  313. if let v = v {
  314. if self.messageRequest != nil {try decoder.handleConflictingOneOf()}
  315. self.messageRequest = .fileByFilename(v)
  316. }
  317. }()
  318. case 4: try {
  319. var v: String?
  320. try decoder.decodeSingularStringField(value: &v)
  321. if let v = v {
  322. if self.messageRequest != nil {try decoder.handleConflictingOneOf()}
  323. self.messageRequest = .fileContainingSymbol(v)
  324. }
  325. }()
  326. case 5: try {
  327. var v: Grpc_Reflection_V1alpha_ExtensionRequest?
  328. var hadOneofValue = false
  329. if let current = self.messageRequest {
  330. hadOneofValue = true
  331. if case .fileContainingExtension(let m) = current {v = m}
  332. }
  333. try decoder.decodeSingularMessageField(value: &v)
  334. if let v = v {
  335. if hadOneofValue {try decoder.handleConflictingOneOf()}
  336. self.messageRequest = .fileContainingExtension(v)
  337. }
  338. }()
  339. case 6: try {
  340. var v: String?
  341. try decoder.decodeSingularStringField(value: &v)
  342. if let v = v {
  343. if self.messageRequest != nil {try decoder.handleConflictingOneOf()}
  344. self.messageRequest = .allExtensionNumbersOfType(v)
  345. }
  346. }()
  347. case 7: try {
  348. var v: String?
  349. try decoder.decodeSingularStringField(value: &v)
  350. if let v = v {
  351. if self.messageRequest != nil {try decoder.handleConflictingOneOf()}
  352. self.messageRequest = .listServices(v)
  353. }
  354. }()
  355. default: break
  356. }
  357. }
  358. }
  359. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  360. // The use of inline closures is to circumvent an issue where the compiler
  361. // allocates stack space for every if/case branch local when no optimizations
  362. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  363. // https://github.com/apple/swift-protobuf/issues/1182
  364. if !self.host.isEmpty {
  365. try visitor.visitSingularStringField(value: self.host, fieldNumber: 1)
  366. }
  367. switch self.messageRequest {
  368. case .fileByFilename?: try {
  369. guard case .fileByFilename(let v)? = self.messageRequest else { preconditionFailure() }
  370. try visitor.visitSingularStringField(value: v, fieldNumber: 3)
  371. }()
  372. case .fileContainingSymbol?: try {
  373. guard case .fileContainingSymbol(let v)? = self.messageRequest else { preconditionFailure() }
  374. try visitor.visitSingularStringField(value: v, fieldNumber: 4)
  375. }()
  376. case .fileContainingExtension?: try {
  377. guard case .fileContainingExtension(let v)? = self.messageRequest else { preconditionFailure() }
  378. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  379. }()
  380. case .allExtensionNumbersOfType?: try {
  381. guard case .allExtensionNumbersOfType(let v)? = self.messageRequest else { preconditionFailure() }
  382. try visitor.visitSingularStringField(value: v, fieldNumber: 6)
  383. }()
  384. case .listServices?: try {
  385. guard case .listServices(let v)? = self.messageRequest else { preconditionFailure() }
  386. try visitor.visitSingularStringField(value: v, fieldNumber: 7)
  387. }()
  388. case nil: break
  389. }
  390. try unknownFields.traverse(visitor: &visitor)
  391. }
  392. public static func ==(lhs: Grpc_Reflection_V1alpha_ServerReflectionRequest, rhs: Grpc_Reflection_V1alpha_ServerReflectionRequest) -> Bool {
  393. if lhs.host != rhs.host {return false}
  394. if lhs.messageRequest != rhs.messageRequest {return false}
  395. if lhs.unknownFields != rhs.unknownFields {return false}
  396. return true
  397. }
  398. }
  399. extension Grpc_Reflection_V1alpha_ExtensionRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  400. public static let protoMessageName: String = _protobuf_package + ".ExtensionRequest"
  401. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  402. 1: .standard(proto: "containing_type"),
  403. 2: .standard(proto: "extension_number"),
  404. ]
  405. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  406. while let fieldNumber = try decoder.nextFieldNumber() {
  407. // The use of inline closures is to circumvent an issue where the compiler
  408. // allocates stack space for every case branch when no optimizations are
  409. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  410. switch fieldNumber {
  411. case 1: try { try decoder.decodeSingularStringField(value: &self.containingType) }()
  412. case 2: try { try decoder.decodeSingularInt32Field(value: &self.extensionNumber) }()
  413. default: break
  414. }
  415. }
  416. }
  417. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  418. if !self.containingType.isEmpty {
  419. try visitor.visitSingularStringField(value: self.containingType, fieldNumber: 1)
  420. }
  421. if self.extensionNumber != 0 {
  422. try visitor.visitSingularInt32Field(value: self.extensionNumber, fieldNumber: 2)
  423. }
  424. try unknownFields.traverse(visitor: &visitor)
  425. }
  426. public static func ==(lhs: Grpc_Reflection_V1alpha_ExtensionRequest, rhs: Grpc_Reflection_V1alpha_ExtensionRequest) -> Bool {
  427. if lhs.containingType != rhs.containingType {return false}
  428. if lhs.extensionNumber != rhs.extensionNumber {return false}
  429. if lhs.unknownFields != rhs.unknownFields {return false}
  430. return true
  431. }
  432. }
  433. extension Grpc_Reflection_V1alpha_ServerReflectionResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  434. public static let protoMessageName: String = _protobuf_package + ".ServerReflectionResponse"
  435. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  436. 1: .standard(proto: "valid_host"),
  437. 2: .standard(proto: "original_request"),
  438. 4: .standard(proto: "file_descriptor_response"),
  439. 5: .standard(proto: "all_extension_numbers_response"),
  440. 6: .standard(proto: "list_services_response"),
  441. 7: .standard(proto: "error_response"),
  442. ]
  443. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  444. while let fieldNumber = try decoder.nextFieldNumber() {
  445. // The use of inline closures is to circumvent an issue where the compiler
  446. // allocates stack space for every case branch when no optimizations are
  447. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  448. switch fieldNumber {
  449. case 1: try { try decoder.decodeSingularStringField(value: &self.validHost) }()
  450. case 2: try { try decoder.decodeSingularMessageField(value: &self._originalRequest) }()
  451. case 4: try {
  452. var v: Grpc_Reflection_V1alpha_FileDescriptorResponse?
  453. var hadOneofValue = false
  454. if let current = self.messageResponse {
  455. hadOneofValue = true
  456. if case .fileDescriptorResponse(let m) = current {v = m}
  457. }
  458. try decoder.decodeSingularMessageField(value: &v)
  459. if let v = v {
  460. if hadOneofValue {try decoder.handleConflictingOneOf()}
  461. self.messageResponse = .fileDescriptorResponse(v)
  462. }
  463. }()
  464. case 5: try {
  465. var v: Grpc_Reflection_V1alpha_ExtensionNumberResponse?
  466. var hadOneofValue = false
  467. if let current = self.messageResponse {
  468. hadOneofValue = true
  469. if case .allExtensionNumbersResponse(let m) = current {v = m}
  470. }
  471. try decoder.decodeSingularMessageField(value: &v)
  472. if let v = v {
  473. if hadOneofValue {try decoder.handleConflictingOneOf()}
  474. self.messageResponse = .allExtensionNumbersResponse(v)
  475. }
  476. }()
  477. case 6: try {
  478. var v: Grpc_Reflection_V1alpha_ListServiceResponse?
  479. var hadOneofValue = false
  480. if let current = self.messageResponse {
  481. hadOneofValue = true
  482. if case .listServicesResponse(let m) = current {v = m}
  483. }
  484. try decoder.decodeSingularMessageField(value: &v)
  485. if let v = v {
  486. if hadOneofValue {try decoder.handleConflictingOneOf()}
  487. self.messageResponse = .listServicesResponse(v)
  488. }
  489. }()
  490. case 7: try {
  491. var v: Grpc_Reflection_V1alpha_ErrorResponse?
  492. var hadOneofValue = false
  493. if let current = self.messageResponse {
  494. hadOneofValue = true
  495. if case .errorResponse(let m) = current {v = m}
  496. }
  497. try decoder.decodeSingularMessageField(value: &v)
  498. if let v = v {
  499. if hadOneofValue {try decoder.handleConflictingOneOf()}
  500. self.messageResponse = .errorResponse(v)
  501. }
  502. }()
  503. default: break
  504. }
  505. }
  506. }
  507. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  508. // The use of inline closures is to circumvent an issue where the compiler
  509. // allocates stack space for every if/case branch local when no optimizations
  510. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  511. // https://github.com/apple/swift-protobuf/issues/1182
  512. if !self.validHost.isEmpty {
  513. try visitor.visitSingularStringField(value: self.validHost, fieldNumber: 1)
  514. }
  515. try { if let v = self._originalRequest {
  516. try visitor.visitSingularMessageField(value: v, fieldNumber: 2)
  517. } }()
  518. switch self.messageResponse {
  519. case .fileDescriptorResponse?: try {
  520. guard case .fileDescriptorResponse(let v)? = self.messageResponse else { preconditionFailure() }
  521. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  522. }()
  523. case .allExtensionNumbersResponse?: try {
  524. guard case .allExtensionNumbersResponse(let v)? = self.messageResponse else { preconditionFailure() }
  525. try visitor.visitSingularMessageField(value: v, fieldNumber: 5)
  526. }()
  527. case .listServicesResponse?: try {
  528. guard case .listServicesResponse(let v)? = self.messageResponse else { preconditionFailure() }
  529. try visitor.visitSingularMessageField(value: v, fieldNumber: 6)
  530. }()
  531. case .errorResponse?: try {
  532. guard case .errorResponse(let v)? = self.messageResponse else { preconditionFailure() }
  533. try visitor.visitSingularMessageField(value: v, fieldNumber: 7)
  534. }()
  535. case nil: break
  536. }
  537. try unknownFields.traverse(visitor: &visitor)
  538. }
  539. public static func ==(lhs: Grpc_Reflection_V1alpha_ServerReflectionResponse, rhs: Grpc_Reflection_V1alpha_ServerReflectionResponse) -> Bool {
  540. if lhs.validHost != rhs.validHost {return false}
  541. if lhs._originalRequest != rhs._originalRequest {return false}
  542. if lhs.messageResponse != rhs.messageResponse {return false}
  543. if lhs.unknownFields != rhs.unknownFields {return false}
  544. return true
  545. }
  546. }
  547. extension Grpc_Reflection_V1alpha_FileDescriptorResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  548. public static let protoMessageName: String = _protobuf_package + ".FileDescriptorResponse"
  549. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  550. 1: .standard(proto: "file_descriptor_proto"),
  551. ]
  552. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  553. while let fieldNumber = try decoder.nextFieldNumber() {
  554. // The use of inline closures is to circumvent an issue where the compiler
  555. // allocates stack space for every case branch when no optimizations are
  556. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  557. switch fieldNumber {
  558. case 1: try { try decoder.decodeRepeatedBytesField(value: &self.fileDescriptorProto) }()
  559. default: break
  560. }
  561. }
  562. }
  563. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  564. if !self.fileDescriptorProto.isEmpty {
  565. try visitor.visitRepeatedBytesField(value: self.fileDescriptorProto, fieldNumber: 1)
  566. }
  567. try unknownFields.traverse(visitor: &visitor)
  568. }
  569. public static func ==(lhs: Grpc_Reflection_V1alpha_FileDescriptorResponse, rhs: Grpc_Reflection_V1alpha_FileDescriptorResponse) -> Bool {
  570. if lhs.fileDescriptorProto != rhs.fileDescriptorProto {return false}
  571. if lhs.unknownFields != rhs.unknownFields {return false}
  572. return true
  573. }
  574. }
  575. extension Grpc_Reflection_V1alpha_ExtensionNumberResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  576. public static let protoMessageName: String = _protobuf_package + ".ExtensionNumberResponse"
  577. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  578. 1: .standard(proto: "base_type_name"),
  579. 2: .standard(proto: "extension_number"),
  580. ]
  581. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  582. while let fieldNumber = try decoder.nextFieldNumber() {
  583. // The use of inline closures is to circumvent an issue where the compiler
  584. // allocates stack space for every case branch when no optimizations are
  585. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  586. switch fieldNumber {
  587. case 1: try { try decoder.decodeSingularStringField(value: &self.baseTypeName) }()
  588. case 2: try { try decoder.decodeRepeatedInt32Field(value: &self.extensionNumber) }()
  589. default: break
  590. }
  591. }
  592. }
  593. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  594. if !self.baseTypeName.isEmpty {
  595. try visitor.visitSingularStringField(value: self.baseTypeName, fieldNumber: 1)
  596. }
  597. if !self.extensionNumber.isEmpty {
  598. try visitor.visitPackedInt32Field(value: self.extensionNumber, fieldNumber: 2)
  599. }
  600. try unknownFields.traverse(visitor: &visitor)
  601. }
  602. public static func ==(lhs: Grpc_Reflection_V1alpha_ExtensionNumberResponse, rhs: Grpc_Reflection_V1alpha_ExtensionNumberResponse) -> Bool {
  603. if lhs.baseTypeName != rhs.baseTypeName {return false}
  604. if lhs.extensionNumber != rhs.extensionNumber {return false}
  605. if lhs.unknownFields != rhs.unknownFields {return false}
  606. return true
  607. }
  608. }
  609. extension Grpc_Reflection_V1alpha_ListServiceResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  610. public static let protoMessageName: String = _protobuf_package + ".ListServiceResponse"
  611. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  612. 1: .same(proto: "service"),
  613. ]
  614. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  615. while let fieldNumber = try decoder.nextFieldNumber() {
  616. // The use of inline closures is to circumvent an issue where the compiler
  617. // allocates stack space for every case branch when no optimizations are
  618. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  619. switch fieldNumber {
  620. case 1: try { try decoder.decodeRepeatedMessageField(value: &self.service) }()
  621. default: break
  622. }
  623. }
  624. }
  625. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  626. if !self.service.isEmpty {
  627. try visitor.visitRepeatedMessageField(value: self.service, fieldNumber: 1)
  628. }
  629. try unknownFields.traverse(visitor: &visitor)
  630. }
  631. public static func ==(lhs: Grpc_Reflection_V1alpha_ListServiceResponse, rhs: Grpc_Reflection_V1alpha_ListServiceResponse) -> Bool {
  632. if lhs.service != rhs.service {return false}
  633. if lhs.unknownFields != rhs.unknownFields {return false}
  634. return true
  635. }
  636. }
  637. extension Grpc_Reflection_V1alpha_ServiceResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  638. public static let protoMessageName: String = _protobuf_package + ".ServiceResponse"
  639. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  640. 1: .same(proto: "name"),
  641. ]
  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.decodeSingularStringField(value: &self.name) }()
  649. default: break
  650. }
  651. }
  652. }
  653. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  654. if !self.name.isEmpty {
  655. try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
  656. }
  657. try unknownFields.traverse(visitor: &visitor)
  658. }
  659. public static func ==(lhs: Grpc_Reflection_V1alpha_ServiceResponse, rhs: Grpc_Reflection_V1alpha_ServiceResponse) -> Bool {
  660. if lhs.name != rhs.name {return false}
  661. if lhs.unknownFields != rhs.unknownFields {return false}
  662. return true
  663. }
  664. }
  665. extension Grpc_Reflection_V1alpha_ErrorResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  666. public static let protoMessageName: String = _protobuf_package + ".ErrorResponse"
  667. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  668. 1: .standard(proto: "error_code"),
  669. 2: .standard(proto: "error_message"),
  670. ]
  671. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  672. while let fieldNumber = try decoder.nextFieldNumber() {
  673. // The use of inline closures is to circumvent an issue where the compiler
  674. // allocates stack space for every case branch when no optimizations are
  675. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  676. switch fieldNumber {
  677. case 1: try { try decoder.decodeSingularInt32Field(value: &self.errorCode) }()
  678. case 2: try { try decoder.decodeSingularStringField(value: &self.errorMessage) }()
  679. default: break
  680. }
  681. }
  682. }
  683. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  684. if self.errorCode != 0 {
  685. try visitor.visitSingularInt32Field(value: self.errorCode, fieldNumber: 1)
  686. }
  687. if !self.errorMessage.isEmpty {
  688. try visitor.visitSingularStringField(value: self.errorMessage, fieldNumber: 2)
  689. }
  690. try unknownFields.traverse(visitor: &visitor)
  691. }
  692. public static func ==(lhs: Grpc_Reflection_V1alpha_ErrorResponse, rhs: Grpc_Reflection_V1alpha_ErrorResponse) -> Bool {
  693. if lhs.errorCode != rhs.errorCode {return false}
  694. if lhs.errorMessage != rhs.errorMessage {return false}
  695. if lhs.unknownFields != rhs.unknownFields {return false}
  696. return true
  697. }
  698. }