graphql_error.pb.swift 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258
  1. // DO NOT EDIT.
  2. // swift-format-ignore-file
  3. //
  4. // Generated by the Swift generator plugin for the protocol buffer compiler.
  5. // Source: graphql_error.proto
  6. //
  7. // For information on using the generated types, please see the documentation:
  8. // https://github.com/apple/swift-protobuf/
  9. // Adapted from third_party/firebase/dataconnect/emulator/server/api/graphql_error.proto
  10. import Foundation
  11. import SwiftProtobuf
  12. // If the compiler emits an error on this type, it is because this file
  13. // was generated by a version of the `protoc` Swift plug-in that is
  14. // incompatible with the version of SwiftProtobuf to which you are linking.
  15. // Please ensure that you are building against the same version of the API
  16. // that was used to generate this file.
  17. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  18. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  19. typealias Version = _2
  20. }
  21. /// GraphqlError conforms to the GraphQL error spec.
  22. /// https://spec.graphql.org/draft/#sec-Errors
  23. ///
  24. /// Firebase Data Connect API surfaces `GraphqlError` in various APIs:
  25. /// - Upon compile error, `UpdateSchema` and `UpdateConnector` return
  26. /// Code.Invalid_Argument with a list of `GraphqlError` in error details.
  27. /// - Upon query compile error, `ExecuteGraphql` and `ExecuteGraphqlRead` return
  28. /// Code.OK with a list of `GraphqlError` in response body.
  29. /// - Upon query execution error, `ExecuteGraphql`, `ExecuteGraphqlRead`,
  30. /// `ExecuteMutation` and `ExecuteQuery` all return Code.OK with a list of
  31. /// `GraphqlError` in response body.
  32. public struct Google_Firebase_Dataconnect_V1alpha_GraphqlError {
  33. // SwiftProtobuf.Message conformance is added in an extension below. See the
  34. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  35. // methods supported on all messages.
  36. /// The detailed error message.
  37. /// The message should help developer understand the underlying problem without
  38. /// leaking internal data.
  39. public var message: String = String()
  40. /// The source locations where the error occurred.
  41. /// Locations should help developers and toolings identify the source of error
  42. /// quickly.
  43. ///
  44. /// Included in admin endpoints (`ExecuteGraphql`, `ExecuteGraphqlRead`,
  45. /// `UpdateSchema` and `UpdateConnector`) to reference the provided GraphQL
  46. /// GQL document.
  47. ///
  48. /// Omitted in `ExecuteMutation` and `ExecuteQuery` since the caller shouldn't
  49. /// have access access the underlying GQL source.
  50. public var locations: [Google_Firebase_Dataconnect_V1alpha_SourceLocation] = []
  51. /// The result field which could not be populated due to error.
  52. ///
  53. /// Clients can use path to identify whether a null result is intentional or
  54. /// caused by a runtime error.
  55. /// It should be a list of string or index from the root of GraphQL query
  56. /// document.
  57. public var path: SwiftProtobuf.Google_Protobuf_ListValue {
  58. get {return _path ?? SwiftProtobuf.Google_Protobuf_ListValue()}
  59. set {_path = newValue}
  60. }
  61. /// Returns true if `path` has been explicitly set.
  62. public var hasPath: Bool {return self._path != nil}
  63. /// Clears the value of `path`. Subsequent reads from it will return its default value.
  64. public mutating func clearPath() {self._path = nil}
  65. /// Additional error information.
  66. public var extensions: Google_Firebase_Dataconnect_V1alpha_GraphqlErrorExtensions {
  67. get {return _extensions ?? Google_Firebase_Dataconnect_V1alpha_GraphqlErrorExtensions()}
  68. set {_extensions = newValue}
  69. }
  70. /// Returns true if `extensions` has been explicitly set.
  71. public var hasExtensions: Bool {return self._extensions != nil}
  72. /// Clears the value of `extensions`. Subsequent reads from it will return its default value.
  73. public mutating func clearExtensions() {self._extensions = nil}
  74. public var unknownFields = SwiftProtobuf.UnknownStorage()
  75. public init() {}
  76. fileprivate var _path: SwiftProtobuf.Google_Protobuf_ListValue? = nil
  77. fileprivate var _extensions: Google_Firebase_Dataconnect_V1alpha_GraphqlErrorExtensions? = nil
  78. }
  79. /// SourceLocation references a location in a GraphQL source.
  80. public struct Google_Firebase_Dataconnect_V1alpha_SourceLocation {
  81. // SwiftProtobuf.Message conformance is added in an extension below. See the
  82. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  83. // methods supported on all messages.
  84. /// Line number starting at 1.
  85. public var line: Int32 = 0
  86. /// Column number starting at 1.
  87. public var column: Int32 = 0
  88. public var unknownFields = SwiftProtobuf.UnknownStorage()
  89. public init() {}
  90. }
  91. /// GraphqlErrorExtensions contains additional information of `GraphqlError`.
  92. /// (-- TODO(b/305311379): include more detailed error fields:
  93. /// go/firemat:api:gql-errors. --)
  94. public struct Google_Firebase_Dataconnect_V1alpha_GraphqlErrorExtensions {
  95. // SwiftProtobuf.Message conformance is added in an extension below. See the
  96. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  97. // methods supported on all messages.
  98. /// The source file name where the error occurred.
  99. /// Included only for `UpdateSchema` and `UpdateConnector`, it corresponds
  100. /// to `File.path` of the provided `Source`.
  101. public var file: String = String()
  102. public var unknownFields = SwiftProtobuf.UnknownStorage()
  103. public init() {}
  104. }
  105. #if swift(>=5.5) && canImport(_Concurrency)
  106. extension Google_Firebase_Dataconnect_V1alpha_GraphqlError: @unchecked Sendable {}
  107. extension Google_Firebase_Dataconnect_V1alpha_SourceLocation: @unchecked Sendable {}
  108. extension Google_Firebase_Dataconnect_V1alpha_GraphqlErrorExtensions: @unchecked Sendable {}
  109. #endif // swift(>=5.5) && canImport(_Concurrency)
  110. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  111. fileprivate let _protobuf_package = "google.firebase.dataconnect.v1alpha"
  112. extension Google_Firebase_Dataconnect_V1alpha_GraphqlError: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  113. public static let protoMessageName: String = _protobuf_package + ".GraphqlError"
  114. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  115. 1: .same(proto: "message"),
  116. 2: .same(proto: "locations"),
  117. 3: .same(proto: "path"),
  118. 4: .same(proto: "extensions"),
  119. ]
  120. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  121. while let fieldNumber = try decoder.nextFieldNumber() {
  122. // The use of inline closures is to circumvent an issue where the compiler
  123. // allocates stack space for every case branch when no optimizations are
  124. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  125. switch fieldNumber {
  126. case 1: try { try decoder.decodeSingularStringField(value: &self.message) }()
  127. case 2: try { try decoder.decodeRepeatedMessageField(value: &self.locations) }()
  128. case 3: try { try decoder.decodeSingularMessageField(value: &self._path) }()
  129. case 4: try { try decoder.decodeSingularMessageField(value: &self._extensions) }()
  130. default: break
  131. }
  132. }
  133. }
  134. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  135. // The use of inline closures is to circumvent an issue where the compiler
  136. // allocates stack space for every if/case branch local when no optimizations
  137. // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
  138. // https://github.com/apple/swift-protobuf/issues/1182
  139. if !self.message.isEmpty {
  140. try visitor.visitSingularStringField(value: self.message, fieldNumber: 1)
  141. }
  142. if !self.locations.isEmpty {
  143. try visitor.visitRepeatedMessageField(value: self.locations, fieldNumber: 2)
  144. }
  145. try { if let v = self._path {
  146. try visitor.visitSingularMessageField(value: v, fieldNumber: 3)
  147. } }()
  148. try { if let v = self._extensions {
  149. try visitor.visitSingularMessageField(value: v, fieldNumber: 4)
  150. } }()
  151. try unknownFields.traverse(visitor: &visitor)
  152. }
  153. public static func ==(lhs: Google_Firebase_Dataconnect_V1alpha_GraphqlError, rhs: Google_Firebase_Dataconnect_V1alpha_GraphqlError) -> Bool {
  154. if lhs.message != rhs.message {return false}
  155. if lhs.locations != rhs.locations {return false}
  156. if lhs._path != rhs._path {return false}
  157. if lhs._extensions != rhs._extensions {return false}
  158. if lhs.unknownFields != rhs.unknownFields {return false}
  159. return true
  160. }
  161. }
  162. extension Google_Firebase_Dataconnect_V1alpha_SourceLocation: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  163. public static let protoMessageName: String = _protobuf_package + ".SourceLocation"
  164. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  165. 1: .same(proto: "line"),
  166. 2: .same(proto: "column"),
  167. ]
  168. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  169. while let fieldNumber = try decoder.nextFieldNumber() {
  170. // The use of inline closures is to circumvent an issue where the compiler
  171. // allocates stack space for every case branch when no optimizations are
  172. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  173. switch fieldNumber {
  174. case 1: try { try decoder.decodeSingularInt32Field(value: &self.line) }()
  175. case 2: try { try decoder.decodeSingularInt32Field(value: &self.column) }()
  176. default: break
  177. }
  178. }
  179. }
  180. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  181. if self.line != 0 {
  182. try visitor.visitSingularInt32Field(value: self.line, fieldNumber: 1)
  183. }
  184. if self.column != 0 {
  185. try visitor.visitSingularInt32Field(value: self.column, fieldNumber: 2)
  186. }
  187. try unknownFields.traverse(visitor: &visitor)
  188. }
  189. public static func ==(lhs: Google_Firebase_Dataconnect_V1alpha_SourceLocation, rhs: Google_Firebase_Dataconnect_V1alpha_SourceLocation) -> Bool {
  190. if lhs.line != rhs.line {return false}
  191. if lhs.column != rhs.column {return false}
  192. if lhs.unknownFields != rhs.unknownFields {return false}
  193. return true
  194. }
  195. }
  196. extension Google_Firebase_Dataconnect_V1alpha_GraphqlErrorExtensions: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  197. public static let protoMessageName: String = _protobuf_package + ".GraphqlErrorExtensions"
  198. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  199. 1: .same(proto: "file"),
  200. ]
  201. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  202. while let fieldNumber = try decoder.nextFieldNumber() {
  203. // The use of inline closures is to circumvent an issue where the compiler
  204. // allocates stack space for every case branch when no optimizations are
  205. // enabled. https://github.com/apple/swift-protobuf/issues/1034
  206. switch fieldNumber {
  207. case 1: try { try decoder.decodeSingularStringField(value: &self.file) }()
  208. default: break
  209. }
  210. }
  211. }
  212. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  213. if !self.file.isEmpty {
  214. try visitor.visitSingularStringField(value: self.file, fieldNumber: 1)
  215. }
  216. try unknownFields.traverse(visitor: &visitor)
  217. }
  218. public static func ==(lhs: Google_Firebase_Dataconnect_V1alpha_GraphqlErrorExtensions, rhs: Google_Firebase_Dataconnect_V1alpha_GraphqlErrorExtensions) -> Bool {
  219. if lhs.file != rhs.file {return false}
  220. if lhs.unknownFields != rhs.unknownFields {return false}
  221. return true
  222. }
  223. }