echo.pb.swift 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. /*
  2. * DO NOT EDIT.
  3. *
  4. * Generated by the protocol buffer compiler.
  5. * Source: echo.proto
  6. *
  7. */
  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 _1: SwiftProtobuf.ProtobufAPIVersion_1 {}
  30. typealias Version = _1
  31. }
  32. public struct Echo_EchoRequest: SwiftProtobuf.Message {
  33. public static let protoMessageName: String = _protobuf_package + ".EchoRequest"
  34. /// The text of a message to be echoed.
  35. public var text: String = String()
  36. public var unknownFields = SwiftProtobuf.UnknownStorage()
  37. public init() {}
  38. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  39. while let fieldNumber = try decoder.nextFieldNumber() {
  40. switch fieldNumber {
  41. case 1: try decoder.decodeSingularStringField(value: &text)
  42. default: break
  43. }
  44. }
  45. }
  46. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  47. if !text.isEmpty {
  48. try visitor.visitSingularStringField(value: text, fieldNumber: 1)
  49. }
  50. try unknownFields.traverse(visitor: &visitor)
  51. }
  52. }
  53. public struct Echo_EchoResponse: SwiftProtobuf.Message {
  54. public static let protoMessageName: String = _protobuf_package + ".EchoResponse"
  55. /// The text of an echo response.
  56. public var text: String = String()
  57. public var unknownFields = SwiftProtobuf.UnknownStorage()
  58. public init() {}
  59. public mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
  60. while let fieldNumber = try decoder.nextFieldNumber() {
  61. switch fieldNumber {
  62. case 1: try decoder.decodeSingularStringField(value: &text)
  63. default: break
  64. }
  65. }
  66. }
  67. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  68. if !text.isEmpty {
  69. try visitor.visitSingularStringField(value: text, fieldNumber: 1)
  70. }
  71. try unknownFields.traverse(visitor: &visitor)
  72. }
  73. }
  74. // MARK: - Code below here is support for the SwiftProtobuf runtime.
  75. fileprivate let _protobuf_package = "echo"
  76. extension Echo_EchoRequest: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  77. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  78. 1: .same(proto: "text"),
  79. ]
  80. public func _protobuf_generated_isEqualTo(other: Echo_EchoRequest) -> Bool {
  81. if text != other.text {return false}
  82. if unknownFields != other.unknownFields {return false}
  83. return true
  84. }
  85. }
  86. extension Echo_EchoResponse: SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  87. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  88. 1: .same(proto: "text"),
  89. ]
  90. public func _protobuf_generated_isEqualTo(other: Echo_EchoResponse) -> Bool {
  91. if text != other.text {return false}
  92. if unknownFields != other.unknownFields {return false}
  93. return true
  94. }
  95. }