echo.pb.swift 3.1 KB

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