health.pb.swift 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  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: health.proto
  7. //
  8. // For information on using the generated types, please see the documentation:
  9. // https://github.com/apple/swift-protobuf/
  10. // Copyright 2015 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. // The canonical version of this proto can be found at
  24. // https://github.com/grpc/grpc-proto/blob/master/grpc/health/v1/health.proto
  25. package import SwiftProtobuf
  26. // If the compiler emits an error on this type, it is because this file
  27. // was generated by a version of the `protoc` Swift plug-in that is
  28. // incompatible with the version of SwiftProtobuf to which you are linking.
  29. // Please ensure that you are building against the same version of the API
  30. // that was used to generate this file.
  31. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  32. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  33. typealias Version = _2
  34. }
  35. package struct Grpc_Health_V1_HealthCheckRequest: Sendable {
  36. // SwiftProtobuf.Message conformance is added in an extension below. See the
  37. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  38. // methods supported on all messages.
  39. package var service: String = String()
  40. package var unknownFields = SwiftProtobuf.UnknownStorage()
  41. package init() {}
  42. }
  43. package struct Grpc_Health_V1_HealthCheckResponse: Sendable {
  44. // SwiftProtobuf.Message conformance is added in an extension below. See the
  45. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  46. // methods supported on all messages.
  47. package var status: Grpc_Health_V1_HealthCheckResponse.ServingStatus = .unknown
  48. package var unknownFields = SwiftProtobuf.UnknownStorage()
  49. package enum ServingStatus: SwiftProtobuf.Enum, Swift.CaseIterable {
  50. package typealias RawValue = Int
  51. case unknown // = 0
  52. case serving // = 1
  53. case notServing // = 2
  54. /// Used only by the Watch method.
  55. case serviceUnknown // = 3
  56. case UNRECOGNIZED(Int)
  57. package init() {
  58. self = .unknown
  59. }
  60. package init?(rawValue: Int) {
  61. switch rawValue {
  62. case 0: self = .unknown
  63. case 1: self = .serving
  64. case 2: self = .notServing
  65. case 3: self = .serviceUnknown
  66. default: self = .UNRECOGNIZED(rawValue)
  67. }
  68. }
  69. package var rawValue: Int {
  70. switch self {
  71. case .unknown: return 0
  72. case .serving: return 1
  73. case .notServing: return 2
  74. case .serviceUnknown: return 3
  75. case .UNRECOGNIZED(let i): return i
  76. }
  77. }
  78. // The compiler won't synthesize support with the UNRECOGNIZED case.
  79. package static let allCases: [Grpc_Health_V1_HealthCheckResponse.ServingStatus] = [
  80. .unknown,
  81. .serving,
  82. .notServing,
  83. .serviceUnknown,
  84. ]
  85. }
  86. package init() {}
  87. }
  88. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  89. fileprivate let _protobuf_package = "grpc.health.v1"
  90. extension Grpc_Health_V1_HealthCheckRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  91. package static let protoMessageName: String = _protobuf_package + ".HealthCheckRequest"
  92. package static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  93. 1: .same(proto: "service"),
  94. ]
  95. package mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  96. while let fieldNumber = try decoder.nextFieldNumber() {
  97. // The use of inline closures is to circumvent an issue where the compiler
  98. // allocates stack space for every case branch when no optimizations are
  99. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  100. switch fieldNumber {
  101. case 1: try { try decoder.decodeSingularStringField(value: &self.service) }()
  102. default: break
  103. }
  104. }
  105. }
  106. package func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  107. if !self.service.isEmpty {
  108. try visitor.visitSingularStringField(value: self.service, fieldNumber: 1)
  109. }
  110. try unknownFields.traverse(visitor: &visitor)
  111. }
  112. package static func ==(lhs: Grpc_Health_V1_HealthCheckRequest, rhs: Grpc_Health_V1_HealthCheckRequest) -> Bool {
  113. if lhs.service != rhs.service {return false}
  114. if lhs.unknownFields != rhs.unknownFields {return false}
  115. return true
  116. }
  117. }
  118. extension Grpc_Health_V1_HealthCheckResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  119. package static let protoMessageName: String = _protobuf_package + ".HealthCheckResponse"
  120. package static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  121. 1: .same(proto: "status"),
  122. ]
  123. package mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  124. while let fieldNumber = try decoder.nextFieldNumber() {
  125. // The use of inline closures is to circumvent an issue where the compiler
  126. // allocates stack space for every case branch when no optimizations are
  127. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  128. switch fieldNumber {
  129. case 1: try { try decoder.decodeSingularEnumField(value: &self.status) }()
  130. default: break
  131. }
  132. }
  133. }
  134. package func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  135. if self.status != .unknown {
  136. try visitor.visitSingularEnumField(value: self.status, fieldNumber: 1)
  137. }
  138. try unknownFields.traverse(visitor: &visitor)
  139. }
  140. package static func ==(lhs: Grpc_Health_V1_HealthCheckResponse, rhs: Grpc_Health_V1_HealthCheckResponse) -> Bool {
  141. if lhs.status != rhs.status {return false}
  142. if lhs.unknownFields != rhs.unknownFields {return false}
  143. return true
  144. }
  145. }
  146. extension Grpc_Health_V1_HealthCheckResponse.ServingStatus: SwiftProtobuf._ProtoNameProviding {
  147. package static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  148. 0: .same(proto: "UNKNOWN"),
  149. 1: .same(proto: "SERVING"),
  150. 2: .same(proto: "NOT_SERVING"),
  151. 3: .same(proto: "SERVICE_UNKNOWN"),
  152. ]
  153. }