/*
 * DO NOT EDIT.
 *
 * Generated by the protocol buffer compiler.
 * Source: note.proto
 *
 */

import Foundation
import SwiftProtobuf


public struct Note_Note: ProtobufGeneratedMessage {
  public var swiftClassName: String {return "Note_Note"}
  public var protoMessageName: String {return "Note"}
  public var protoPackageName: String {return "note"}
  public var jsonFieldNames: [String: Int] {return [
    "id": 1,
    "title": 2,
    "content": 3,
  ]}
  public var protoFieldNames: [String: Int] {return [
    "id": 1,
    "title": 2,
    "content": 3,
  ]}

  public var id: Int32 = 0

  public var title: String = ""

  public var content: String = ""

  public init() {}

  public init(id: Int32? = nil,
    title: String? = nil,
    content: String? = nil)
  {
    if let v = id {
      self.id = v
    }
    if let v = title {
      self.title = v
    }
    if let v = content {
      self.content = v
    }
  }

  public mutating func _protoc_generated_decodeField(setter: inout ProtobufFieldDecoder, protoFieldNumber: Int) throws -> Bool {
    let handled: Bool
    switch protoFieldNumber {
    case 1: handled = try setter.decodeSingularField(fieldType: ProtobufInt32.self, value: &id)
    case 2: handled = try setter.decodeSingularField(fieldType: ProtobufString.self, value: &title)
    case 3: handled = try setter.decodeSingularField(fieldType: ProtobufString.self, value: &content)
    default:
      handled = false
    }
    return handled
  }

  public func _protoc_generated_traverse(visitor: inout ProtobufVisitor) throws {
    if id != 0 {
      try visitor.visitSingularField(fieldType: ProtobufInt32.self, value: id, protoFieldNumber: 1, protoFieldName: "id", jsonFieldName: "id", swiftFieldName: "id")
    }
    if title != "" {
      try visitor.visitSingularField(fieldType: ProtobufString.self, value: title, protoFieldNumber: 2, protoFieldName: "title", jsonFieldName: "title", swiftFieldName: "title")
    }
    if content != "" {
      try visitor.visitSingularField(fieldType: ProtobufString.self, value: content, protoFieldNumber: 3, protoFieldName: "content", jsonFieldName: "content", swiftFieldName: "content")
    }
  }

  public func _protoc_generated_isEqualTo(other: Note_Note) -> Bool {
    if id != other.id {return false}
    if title != other.title {return false}
    if content != other.content {return false}
    return true
  }
}
