// 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/

#if canImport(FoundationEssentials)
import FoundationEssentials
#else
import Foundation
#endif
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 nonisolated struct _GeneratedWithProtocGenSwiftVersion: SwiftProtobuf.ProtobufAPIVersionCheck {
  struct _2: SwiftProtobuf.ProtobufAPIVersion_2 {}
  typealias Version = _2
}

nonisolated 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 reactionToAudio // = 14
  case addedToGroup // = 15
  case audio // = 16
  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
    case 14: self = .reactionToAudio
    case 15: self = .addedToGroup
    case 16: self = .audio
    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 .reactionToAudio: return 14
    case .addedToGroup: return 15
    case .audio: return 16
    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,
    .reactionToAudio,
    .addedToGroup,
    .audio,
  ]

}

nonisolated struct EncryptedPushNotification: 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() {}
}

nonisolated 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: String {
    get {_messageID ?? String()}
    set {_messageID = newValue}
  }
  /// Returns true if `messageID` has been explicitly set.
  var hasMessageID: Bool {self._messageID != nil}
  /// Clears the value of `messageID`. Subsequent reads from it will return its default value.
  mutating func clearMessageID() {self._messageID = nil}

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

  var unknownFields = SwiftProtobuf.UnknownStorage()

  init() {}

  fileprivate var _messageID: String? = nil
  fileprivate var _additionalContent: String? = nil
}

nonisolated 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() {}
}

nonisolated 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: String {
    get {_lastMessageID ?? String()}
    set {_lastMessageID = newValue}
  }
  /// Returns true if `lastMessageID` has been explicitly set.
  var hasLastMessageID: Bool {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: String? = nil
}

nonisolated struct PushKey: 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.

nonisolated extension PushKind: SwiftProtobuf._ProtoNameProviding {
  static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{2}\0REACTION\0\u{1}RESPONSE\0\u{1}TEXT\0\u{1}VIDEO\0\u{1}TWONLY\0\u{1}IMAGE\0\u{1}CONTACT_REQUEST\0\u{1}ACCEPT_REQUEST\0\u{1}STORED_MEDIA_FILE\0\u{1}TEST_NOTIFICATION\0\u{1}REOPENED_MEDIA\0\u{1}REACTION_TO_VIDEO\0\u{1}REACTION_TO_TEXT\0\u{1}REACTION_TO_IMAGE\0\u{1}REACTION_TO_AUDIO\0\u{1}ADDED_TO_GROUP\0\u{1}AUDIO\0")
}

nonisolated extension EncryptedPushNotification: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = "EncryptedPushNotification"
  static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}key_id\0\u{1}nonce\0\u{1}ciphertext\0\u{1}mac\0")

  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
  }
}

nonisolated extension PushNotification: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = "PushNotification"
  static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}kind\0\u{3}message_id\0\u{3}additional_content\0")

  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.decodeSingularStringField(value: &self._messageID) }()
      case 3: try { try decoder.decodeSingularStringField(value: &self._additionalContent) }()
      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.visitSingularStringField(value: v, fieldNumber: 2)
    } }()
    try { if let v = self._additionalContent {
      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._additionalContent != rhs._additionalContent {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

nonisolated extension PushUsers: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = "PushUsers"
  static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}users\0")

  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
  }
}

nonisolated extension PushUser: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = "PushUser"
  static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{3}user_id\0\u{3}display_name\0\u{1}blocked\0\u{3}last_message_id\0\u{3}push_keys\0")

  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.decodeSingularStringField(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.visitSingularStringField(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
  }
}

nonisolated extension PushKey: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  static let protoMessageName: String = "PushKey"
  static let _protobuf_nameMap = SwiftProtobuf._NameMap(bytecode: "\0\u{1}id\0\u{1}key\0\u{3}created_at_unix_timestamp\0")

  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
  }
}
