echo.pb.swift 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  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. public struct Echo_EchoRequest: ProtobufGeneratedMessage {
  24. public var swiftClassName: String {return "Echo_EchoRequest"}
  25. public var protoMessageName: String {return "EchoRequest"}
  26. public var protoPackageName: String {return "echo"}
  27. public var jsonFieldNames: [String: Int] {return [
  28. "text": 1,
  29. ]}
  30. public var protoFieldNames: [String: Int] {return [
  31. "text": 1,
  32. ]}
  33. public var text: String = ""
  34. public init() {}
  35. public init(text: String? = nil)
  36. {
  37. if let v = text {
  38. self.text = v
  39. }
  40. }
  41. public mutating func _protoc_generated_decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws -> Bool {
  42. let handled: Bool
  43. switch protoFieldNumber {
  44. case 1: handled = try setter.decodeSingularField(fieldType: ProtobufString.self, value: &text)
  45. default:
  46. handled = false
  47. }
  48. return handled
  49. }
  50. public func _protoc_generated_traverse(visitor: inout ProtobufVisitor) throws {
  51. if text != "" {
  52. try visitor.visitSingularField(fieldType: ProtobufString.self, value: text, protoFieldNumber: 1, protoFieldName: "text", jsonFieldName: "text", swiftFieldName: "text")
  53. }
  54. }
  55. public func _protoc_generated_isEqualTo(other: Echo_EchoRequest) -> Bool {
  56. if text != other.text {return false}
  57. return true
  58. }
  59. }
  60. public struct Echo_EchoResponse: ProtobufGeneratedMessage {
  61. public var swiftClassName: String {return "Echo_EchoResponse"}
  62. public var protoMessageName: String {return "EchoResponse"}
  63. public var protoPackageName: String {return "echo"}
  64. public var jsonFieldNames: [String: Int] {return [
  65. "text": 1,
  66. ]}
  67. public var protoFieldNames: [String: Int] {return [
  68. "text": 1,
  69. ]}
  70. public var text: String = ""
  71. public init() {}
  72. public init(text: String? = nil)
  73. {
  74. if let v = text {
  75. self.text = v
  76. }
  77. }
  78. public mutating func _protoc_generated_decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws -> Bool {
  79. let handled: Bool
  80. switch protoFieldNumber {
  81. case 1: handled = try setter.decodeSingularField(fieldType: ProtobufString.self, value: &text)
  82. default:
  83. handled = false
  84. }
  85. return handled
  86. }
  87. public func _protoc_generated_traverse(visitor: inout ProtobufVisitor) throws {
  88. if text != "" {
  89. try visitor.visitSingularField(fieldType: ProtobufString.self, value: text, protoFieldNumber: 1, protoFieldName: "text", jsonFieldName: "text", swiftFieldName: "text")
  90. }
  91. }
  92. public func _protoc_generated_isEqualTo(other: Echo_EchoResponse) -> Bool {
  93. if text != other.text {return false}
  94. return true
  95. }
  96. }