helloworld.pb.swift 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. // DO NOT EDIT.
  2. //
  3. // Generated by the Swift generator plugin for the protocol buffer compiler.
  4. // Source: helloworld.proto
  5. //
  6. // For information on using the generated types, please see the documenation:
  7. // https://github.com/apple/swift-protobuf/
  8. // Copyright 2015 gRPC authors.
  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. /// The request message containing the user's name.
  33. public struct Helloworld_HelloRequest {
  34. // SwiftProtobuf.Message conformance is added in an extension below. See the
  35. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  36. // methods supported on all messages.
  37. public var name: String = String()
  38. public var unknownFields = SwiftProtobuf.UnknownStorage()
  39. public init() {}
  40. }
  41. /// The response message containing the greetings.
  42. public struct Helloworld_HelloReply {
  43. // SwiftProtobuf.Message conformance is added in an extension below. See the
  44. // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  45. // methods supported on all messages.
  46. public var message: 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 = "helloworld"
  52. extension Helloworld_HelloRequest: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  53. public static let protoMessageName: String = _protobuf_package + ".HelloRequest"
  54. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  55. 1: .same(proto: "name"),
  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.name)
  61. default: break
  62. }
  63. }
  64. }
  65. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  66. if !self.name.isEmpty {
  67. try visitor.visitSingularStringField(value: self.name, fieldNumber: 1)
  68. }
  69. try unknownFields.traverse(visitor: &visitor)
  70. }
  71. public static func ==(lhs: Helloworld_HelloRequest, rhs: Helloworld_HelloRequest) -> Bool {
  72. if lhs.name != rhs.name {return false}
  73. if lhs.unknownFields != rhs.unknownFields {return false}
  74. return true
  75. }
  76. }
  77. extension Helloworld_HelloReply: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  78. public static let protoMessageName: String = _protobuf_package + ".HelloReply"
  79. public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
  80. 1: .same(proto: "message"),
  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.message)
  86. default: break
  87. }
  88. }
  89. }
  90. public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
  91. if !self.message.isEmpty {
  92. try visitor.visitSingularStringField(value: self.message, fieldNumber: 1)
  93. }
  94. try unknownFields.traverse(visitor: &visitor)
  95. }
  96. public static func ==(lhs: Helloworld_HelloReply, rhs: Helloworld_HelloReply) -> Bool {
  97. if lhs.message != rhs.message {return false}
  98. if lhs.unknownFields != rhs.unknownFields {return false}
  99. return true
  100. }
  101. }