// DO NOT EDIT.
// swift-format-ignore-file
// swiftlint:disable all
//
// Generated by the Swift generator plugin for the protocol buffer compiler.
// Source: push_notification.proto
//
// For information on using the generated types, please see the documentation:
//   https://github.com/apple/swift-protobuf/

import Foundation
import SwiftProtobuf

// If the compiler emits an error on this type, it is because this file
// was generated by a version of the `protoc` Swift plug-in that is
// incompatible with the version of SwiftProtobuf to which you are linking.
// Please ensure that you are building against the same version of the API
// that was used to generate this file.
fileprivate struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  typealias Version = _2
}

enum PushKind: SwiftProtobuf.Enum, Swift.CaseIterable {
  typealias RawValue = Int
  case reaction // = 0
  case response // = 1
  case text // = 2
  case video // = 3
  case twonly // = 4
  case image // = 5
  case contactRequest // = 6
  case acceptRequest // = 7
  case storedMediaFile // = 8
  case testNotification // = 9
  case reopenedMedia // = 10
  case reactionToVideo // = 11
  case reactionToText // = 12
  case reactionToImage // = 13
  case UNRECOGNIZED(Int)

  init() {
    self = .reaction
  }

  init?(rawValue: Int) {
    switch rawValue {
    case 0: self = .reaction
    case 1: self = .response
    case 2: self = .text
    case 3: self = .video
    case 4: self = .twonly
    case 5: self = .image
    case 6: self = .contactRequest
    case 7: self = .acceptRequest
    case 8: self = .storedMediaFile
    case 9: self = .testNotification
    case 10: self = .reopenedMedia
    case 11: self = .reactionToVideo
    case 12: self = .reactionToText
    case 13: self = .reactionToImage
    default: self = .UNRECOGNIZED(rawValue)
    }
  }

  var rawValue: Int {
    switch self {
    case .reaction: return 0
    case .response: return 1
    case .text: return 2
    case .video: return 3
    case .twonly: return 4
    case .image: return 5
    case .contactRequest: return 6
    case .acceptRequest: return 7
    case .storedMediaFile: return 8
    case .testNotification: return 9
    case .reopenedMedia: return 10
    case .reactionToVideo: return 11
    case .reactionToText: return 12
    case .reactionToImage: return 13
    case .UNRECOGNIZED(let i): return i
    }
  }

  // The compiler won't synthesize support with the UNRECOGNIZED case.
  static let allCases: [PushKind] = [
    .reaction,
    .response,
    .text,
    .video,
    .twonly,
    .image,
    .contactRequest,
    .acceptRequest,
    .storedMediaFile,
    .testNotification,
    .reopenedMedia,
    .reactionToVideo,
    .reactionToText,
    .reactionToImage,
  ]

}

struct EncryptedPushNotification: @unchecked Sendable {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  var keyID: Int64 = 0

  var nonce: Data = Data()

  var ciphertext: Data = Data()

  var mac: Data = Data()

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}
}

struct PushNotification: Sendable {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  var kind: PushKind = .reaction

  var messageID: Int64 {
    get {return _messageID ?? 0}
    set {_messageID = newValue}
  }
  /// Returns true if `messageID` has been explicitly set.
  var hasMessageID: Bool {return self._messageID != nil}
  /// Clears the value of `messageID`. Subsequent reads from it will return its default value.
  mutating func clearMessageID() {self._messageID = nil}

  var reactionContent: String {
    get {return _reactionContent ?? String()}
    set {_reactionContent = newValue}
  }
  /// Returns true if `reactionContent` has been explicitly set.
  var hasReactionContent: Bool {return self._reactionContent != nil}
  /// Clears the value of `reactionContent`. Subsequent reads from it will return its default value.
  mutating func clearReactionContent() {self._reactionContent = nil}

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}

  fileprivate var _messageID: Int64? = nil
  fileprivate var _reactionContent: String? = nil
}

struct PushUsers: Sendable {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  var users: [PushUser] = []

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}
}

struct PushUser: Sendable {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  var userID: Int64 = 0

  var displayName: String = String()

  var blocked: Bool = false

  var lastMessageID: Int64 {
    get {return _lastMessageID ?? 0}
    set {_lastMessageID = newValue}
  }
  /// Returns true if `lastMessageID` has been explicitly set.
  var hasLastMessageID: Bool {return self._lastMessageID != nil}
  /// Clears the value of `lastMessageID`. Subsequent reads from it will return its default value.
  mutating func clearLastMessageID() {self._lastMessageID = nil}

  var pushKeys: [PushKey] = []

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}

  fileprivate var _lastMessageID: Int64? = nil
}

struct PushKey: @unchecked Sendable {
  // SwiftProtobuf.Message conformance is added in an extension below. See the
  // `Message` and `Message+*Additions` files in the SwiftProtobuf library for
  // methods supported on all messages.

  var id: Int64 = 0

  var key: Data = Data()

  var createdAtUnixTimestamp: Int64 = 0

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}
}

// MARK: - Code below here is support for the SwiftProtobuf runtime.

extension PushKind: SwiftProtobuf._ProtoNameProviding {
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    0: .same(proto: "reaction"),
    1: .same(proto: "response"),
    2: .same(proto: "text"),
    3: .same(proto: "video"),
    4: .same(proto: "twonly"),
    5: .same(proto: "image"),
    6: .same(proto: "contactRequest"),
    7: .same(proto: "acceptRequest"),
    8: .same(proto: "storedMediaFile"),
    9: .same(proto: "testNotification"),
    10: .same(proto: "reopenedMedia"),
    11: .same(proto: "reactionToVideo"),
    12: .same(proto: "reactionToText"),
    13: .same(proto: "reactionToImage"),
  ]
}

extension EncryptedPushNotification: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = "EncryptedPushNotification"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "keyId"),
    2: .same(proto: "nonce"),
    3: .same(proto: "ciphertext"),
    4: .same(proto: "mac"),
  ]

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      // The use of inline closures is to circumvent an issue where the compiler
      // allocates stack space for every case branch when no optimizations are
      // enabled. https://github.com/apple/swift-protobuf/issues/1034
      switch fieldNumber {
      case 1: try { try decoder.decodeSingularInt64Field(value: &self.keyID) }()
      case 2: try { try decoder.decodeSingularBytesField(value: &self.nonce) }()
      case 3: try { try decoder.decodeSingularBytesField(value: &self.ciphertext) }()
      case 4: try { try decoder.decodeSingularBytesField(value: &self.mac) }()
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if self.keyID != 0 {
      try visitor.visitSingularInt64Field(value: self.keyID, fieldNumber: 1)
    }
    if !self.nonce.isEmpty {
      try visitor.visitSingularBytesField(value: self.nonce, fieldNumber: 2)
    }
    if !self.ciphertext.isEmpty {
      try visitor.visitSingularBytesField(value: self.ciphertext, fieldNumber: 3)
    }
    if !self.mac.isEmpty {
      try visitor.visitSingularBytesField(value: self.mac, fieldNumber: 4)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: EncryptedPushNotification, rhs: EncryptedPushNotification) -> Bool {
    if lhs.keyID != rhs.keyID {return false}
    if lhs.nonce != rhs.nonce {return false}
    if lhs.ciphertext != rhs.ciphertext {return false}
    if lhs.mac != rhs.mac {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension PushNotification: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = "PushNotification"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "kind"),
    2: .same(proto: "messageId"),
    3: .same(proto: "reactionContent"),
  ]

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      // The use of inline closures is to circumvent an issue where the compiler
      // allocates stack space for every case branch when no optimizations are
      // enabled. https://github.com/apple/swift-protobuf/issues/1034
      switch fieldNumber {
      case 1: try { try decoder.decodeSingularEnumField(value: &self.kind) }()
      case 2: try { try decoder.decodeSingularInt64Field(value: &self._messageID) }()
      case 3: try { try decoder.decodeSingularStringField(value: &self._reactionContent) }()
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    // The use of inline closures is to circumvent an issue where the compiler
    // allocates stack space for every if/case branch local when no optimizations
    // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
    // https://github.com/apple/swift-protobuf/issues/1182
    if self.kind != .reaction {
      try visitor.visitSingularEnumField(value: self.kind, fieldNumber: 1)
    }
    try { if let v = self._messageID {
      try visitor.visitSingularInt64Field(value: v, fieldNumber: 2)
    } }()
    try { if let v = self._reactionContent {
      try visitor.visitSingularStringField(value: v, fieldNumber: 3)
    } }()
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: PushNotification, rhs: PushNotification) -> Bool {
    if lhs.kind != rhs.kind {return false}
    if lhs._messageID != rhs._messageID {return false}
    if lhs._reactionContent != rhs._reactionContent {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension PushUsers: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = "PushUsers"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "users"),
  ]

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      // The use of inline closures is to circumvent an issue where the compiler
      // allocates stack space for every case branch when no optimizations are
      // enabled. https://github.com/apple/swift-protobuf/issues/1034
      switch fieldNumber {
      case 1: try { try decoder.decodeRepeatedMessageField(value: &self.users) }()
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.users.isEmpty {
      try visitor.visitRepeatedMessageField(value: self.users, fieldNumber: 1)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: PushUsers, rhs: PushUsers) -> Bool {
    if lhs.users != rhs.users {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension PushUser: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = "PushUser"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "userId"),
    2: .same(proto: "displayName"),
    3: .same(proto: "blocked"),
    4: .same(proto: "lastMessageId"),
    5: .same(proto: "pushKeys"),
  ]

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      // The use of inline closures is to circumvent an issue where the compiler
      // allocates stack space for every case branch when no optimizations are
      // enabled. https://github.com/apple/swift-protobuf/issues/1034
      switch fieldNumber {
      case 1: try { try decoder.decodeSingularInt64Field(value: &self.userID) }()
      case 2: try { try decoder.decodeSingularStringField(value: &self.displayName) }()
      case 3: try { try decoder.decodeSingularBoolField(value: &self.blocked) }()
      case 4: try { try decoder.decodeSingularInt64Field(value: &self._lastMessageID) }()
      case 5: try { try decoder.decodeRepeatedMessageField(value: &self.pushKeys) }()
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    // The use of inline closures is to circumvent an issue where the compiler
    // allocates stack space for every if/case branch local when no optimizations
    // are enabled. https://github.com/apple/swift-protobuf/issues/1034 and
    // https://github.com/apple/swift-protobuf/issues/1182
    if self.userID != 0 {
      try visitor.visitSingularInt64Field(value: self.userID, fieldNumber: 1)
    }
    if !self.displayName.isEmpty {
      try visitor.visitSingularStringField(value: self.displayName, fieldNumber: 2)
    }
    if self.blocked != false {
      try visitor.visitSingularBoolField(value: self.blocked, fieldNumber: 3)
    }
    try { if let v = self._lastMessageID {
      try visitor.visitSingularInt64Field(value: v, fieldNumber: 4)
    } }()
    if !self.pushKeys.isEmpty {
      try visitor.visitRepeatedMessageField(value: self.pushKeys, fieldNumber: 5)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: PushUser, rhs: PushUser) -> Bool {
    if lhs.userID != rhs.userID {return false}
    if lhs.displayName != rhs.displayName {return false}
    if lhs.blocked != rhs.blocked {return false}
    if lhs._lastMessageID != rhs._lastMessageID {return false}
    if lhs.pushKeys != rhs.pushKeys {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension PushKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = "PushKey"
  static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .same(proto: "id"),
    2: .same(proto: "key"),
    3: .same(proto: "createdAtUnixTimestamp"),
  ]

  mutating func decodeMessage<D: SwiftProtobuf.Decoder>(decoder: inout D) throws {
    while let fieldNumber = try decoder.nextFieldNumber() {
      // The use of inline closures is to circumvent an issue where the compiler
      // allocates stack space for every case branch when no optimizations are
      // enabled. https://github.com/apple/swift-protobuf/issues/1034
      switch fieldNumber {
      case 1: try { try decoder.decodeSingularInt64Field(value: &self.id) }()
      case 2: try { try decoder.decodeSingularBytesField(value: &self.key) }()
      case 3: try { try decoder.decodeSingularInt64Field(value: &self.createdAtUnixTimestamp) }()
      default: break
      }
    }
  }

  func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if self.id != 0 {
      try visitor.visitSingularInt64Field(value: self.id, fieldNumber: 1)
    }
    if !self.key.isEmpty {
      try visitor.visitSingularBytesField(value: self.key, fieldNumber: 2)
    }
    if self.createdAtUnixTimestamp != 0 {
      try visitor.visitSingularInt64Field(value: self.createdAtUnixTimestamp, fieldNumber: 3)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  static func ==(lhs: PushKey, rhs: PushKey) -> Bool {
    if lhs.id != rhs.id {return false}
    if lhs.key != rhs.key {return false}
    if lhs.createdAtUnixTimestamp != rhs.createdAtUnixTimestamp {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}
