echo.pb.swift 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. // DO NOT EDIT.
  2. //
  3. // Generated by the Swift generator plugin for the protocol buffer compiler.
  4. // Source: echo.proto
  5. //
  6. // For information on using the generated types, please see the documenation:
  7. // https://github.com/apple/swift-protobuf/
  8. // Copyright (c) 2015, Google Inc.
  9. //
  10. // Licensed under the Apache License, Version 2.0 (the "License");
  11. // you may not use this file except in compliance with the License.
  12. // You may obtain a copy of the License at
  13. //
  14. // http://www.apache.org/licenses/LICENSE-2.0
  15. //
  16. // Unless required by applicable law or agreed to in writing, software
  17. // distributed under the License is distributed on an "AS IS" BASIS,
  18. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  19. // See the License for the specific language governing permissions and
  20. // limitations under the License.
  21. import Foundation
  22. import SwiftProtobuf
  23. // If the compiler emits an error on this type, it is because this file
  24. // was generated by a version of the `protoc` Swift plug-in that is
  25. // incompatible with the version of SwiftProtobuf to which you are linking.
  26. // Please ensure that your are building against the same version of the API
  27. // that was used to generate this file.
  28. fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  29. struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  30. typealias Version = _2
  31. }
  32. struct Echo_EchoRequest: SwiftProtobuf.Message {
  33. static let protoMessageName: String = _protobuf_package + ".EchoRequest"
  34. /// The text of a message to be echoed.
  35. var text: String = String()
  36. var unknownFields = SwiftProtobuf.UnknownStorage()
  37. init() {}
  38. /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  39. /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  40. /// initializers are defined in the SwiftProtobuf library. See the Message and
  41. /// Message+*Additions` files.
  42. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  43. while let fieldNumber = try decoder.nextFieldNumber() {
  44. switch fieldNumber {
  45. case 1: try decoder.decodeSingularStringField(value: &self.text)
  46. default: break
  47. }
  48. }
  49. }
  50. /// Used by the encoding methods of the SwiftProtobuf library, not generally
  51. /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  52. /// other serializer methods are defined in the SwiftProtobuf library. See the
  53. /// `Message` and `Message+*Additions` files.
  54. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  55. if !self.text.isEmpty {
  56. try visitor.visitSingularStringField(value: self.text, fieldNumber: 1)
  57. }
  58. try unknownFields.traverse(visitor: &visitor)
  59. }
  60. }
  61. struct Echo_EchoResponse: SwiftProtobuf.Message {
  62. static let protoMessageName: String = _protobuf_package + ".EchoResponse"
  63. /// The text of an echo response.
  64. var text: String = String()
  65. var unknownFields = SwiftProtobuf.UnknownStorage()
  66. init() {}
  67. /// Used by the decoding initializers in the SwiftProtobuf library, not generally
  68. /// used directly. `init(serializedData:)`, `init(jsonUTF8Data:)`, and other decoding
  69. /// initializers are defined in the SwiftProtobuf library. See the Message and
  70. /// Message+*Additions` files.
  71. mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  72. while let fieldNumber = try decoder.nextFieldNumber() {
  73. switch fieldNumber {
  74. case 1: try decoder.decodeSingularStringField(value: &self.text)
  75. default: break
  76. }
  77. }
  78. }
  79. /// Used by the encoding methods of the SwiftProtobuf library, not generally
  80. /// used directly. `Message.serializedData()`, `Message.jsonUTF8Data()`, and
  81. /// other serializer methods are defined in the SwiftProtobuf library. See the
  82. /// `Message` and `Message+*Additions` files.
  83. func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  84. if !self.text.isEmpty {
  85. try visitor.visitSingularStringField(value: self.text, fieldNumber: 1)
  86. }
  87. try unknownFields.traverse(visitor: &visitor)
  88. }
  89. }
  90. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  91. fileprivate let _protobuf_package = "echo"
  92. extension Echo_EchoRequest: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  93. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  94. 1: .same(proto: "text"),
  95. ]
  96. func _protobuf_generated_isEqualTo(other: Echo_EchoRequest) -> Bool {
  97. if self.text != other.text {return false}
  98. if unknownFields != other.unknownFields {return false}
  99. return true
  100. }
  101. }
  102. extension Echo_EchoResponse: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  103. static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  104. 1: .same(proto: "text"),
  105. ]
  106. func _protobuf_generated_isEqualTo(other: Echo_EchoResponse) -> Bool {
  107. if self.text != other.text {return false}
  108. if unknownFields != other.unknownFields {return false}
  109. return true
  110. }
  111. }