reflection-v1alpha.pb.swift 34 KB

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