echo.pb.swift 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  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. public struct Echo_EchoRequest {
  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 text of a message to be echoed.
  37. public var text: String = String()
  38. public var unknownFields = SwiftProtobuf.UnknownStorage()
  39. public init() {}
  40. }
  41. public struct Echo_EchoResponse {
  42. // SwiftProtobuf.Message conformance is added in an extension below. See the
  43. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  44. // methods supported on all messages.
  45. /// The text of an echo response.
  46. public var text: String = String()
  47. public var unknownFields = SwiftProtobuf.UnknownStorage()
  48. public init() {}
  49. }
  50. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  51. fileprivate let _protobuf_package = "echo"
  52. extension Echo_EchoRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  53. public static let protoMessageName: String = _protobuf_package + ".EchoRequest"
  54. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  55. 1: .same(proto: "text"),
  56. ]
  57. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  58. while let fieldNumber = try decoder.nextFieldNumber() {
  59. switch fieldNumber {
  60. case 1: try decoder.decodeSingularStringField(value: &self.text)
  61. default: break
  62. }
  63. }
  64. }
  65. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  66. if !self.text.isEmpty {
  67. try visitor.visitSingularStringField(value: self.text, fieldNumber: 1)
  68. }
  69. try unknownFields.traverse(visitor: &visitor)
  70. }
  71. public static func ==(lhs: Echo_EchoRequest, rhs: Echo_EchoRequest) -> Bool {
  72. if lhs.text != rhs.text {return false}
  73. if lhs.unknownFields != rhs.unknownFields {return false}
  74. return true
  75. }
  76. }
  77. extension Echo_EchoResponse: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  78. public static let protoMessageName: String = _protobuf_package + ".EchoResponse"
  79. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  80. 1: .same(proto: "text"),
  81. ]
  82. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  83. while let fieldNumber = try decoder.nextFieldNumber() {
  84. switch fieldNumber {
  85. case 1: try decoder.decodeSingularStringField(value: &self.text)
  86. default: break
  87. }
  88. }
  89. }
  90. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  91. if !self.text.isEmpty {
  92. try visitor.visitSingularStringField(value: self.text, fieldNumber: 1)
  93. }
  94. try unknownFields.traverse(visitor: &visitor)
  95. }
  96. public static func ==(lhs: Echo_EchoResponse, rhs: Echo_EchoResponse) -> Bool {
  97. if lhs.text != rhs.text {return false}
  98. if lhs.unknownFields != rhs.unknownFields {return false}
  99. return true
  100. }
  101. }