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

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
}

/// ActiveRulesInfo
public struct FilterListManager_ActiveRulesInfo: 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.

  /// Filter id for these rules
  public var filterID: Int32 = 0

  /// Group id of the filter
  public var groupID: Int32 = 0

  /// Is this filter trusted?
  public var isTrusted: Bool = false

  /// List of active rules.
  public var rules: [String] = []

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}
}

/// ActiveRulesInfo raw
public struct FilterListManager_ActiveRulesInfoRaw: 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.

  /// Filter id for these rules
  public var filterID: Int32 = 0

  /// Group id of the filter
  public var groupID: Int32 = 0

  /// Is this filter trusted?
  public var isTrusted: Bool = false

  /// List of active rules as string.
  public var rules: String = String()

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}
}

/// UpdateResult
public struct FilterListManager_UpdateResult: 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.

  /// Currently updated filters.
  public var updatedList: [FilterListManager_FullFilterList] = []

  /// Number of filters not updated due to timeout.
  public var remainingFiltersCount: Int32 = 0

  /// List of entities containing the filter id and a string representation of the error
  public var filtersErrors: [FilterListManager_UpdateFilterError] = []

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}
}

/// UpdateFilterError
public struct FilterListManager_UpdateFilterError: 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.

  /// ID of that filter that couldn't be updated
  public var filterID: Int32 = 0

  /// Filter error converted to a string. For debugging purposes
  public var message: String = String()

  /// Filter url
  public var filterURL: String {
    get {return _filterURL ?? String()}
    set {_filterURL = newValue}
  }
  /// Returns true if `filterURL` has been explicitly set.
  public var hasFilterURL: Bool {return self._filterURL != nil}
  /// Clears the value of `filterURL`. Subsequent reads from it will return its default value.
  public mutating func clearFilterURL() {self._filterURL = nil}

  /// Http client error
  public var httpClientError: String {
    get {return _httpClientError ?? String()}
    set {_httpClientError = newValue}
  }
  /// Returns true if `httpClientError` has been explicitly set.
  public var hasHTTPClientError: Bool {return self._httpClientError != nil}
  /// Clears the value of `httpClientError`. Subsequent reads from it will return its default value.
  public mutating func clearHTTPClientError() {self._httpClientError = nil}

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}

  fileprivate var _filterURL: String? = nil
  fileprivate var _httpClientError: String? = nil
}

/// Information about filter movement during index metadata update
public struct FilterListManager_MovedFilterInfo: 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.

  //// Previous id of the filter
  public var previousID: Int32 = 0

  //// New id of the filter
  public var newID: Int32 = 0

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}
}

/// Result of index metadata update
public struct FilterListManager_PullMetadataResult: 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.

  /// List of filters added in the update
  public var addedFilters: [Int32] = []

  /// List of filters removed in the update
  public var removedFilters: [Int32] = []

  /// List of filters moved in the update
  public var movedFilters: [FilterListManager_MovedFilterInfo] = []

  public var unknownFields = SwiftProtobuf.UnknownStorage()

  public init() {}
}

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

fileprivate let _protobuf_package = "filter_list_manager"

extension FilterListManager_ActiveRulesInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let protoMessageName: String = _protobuf_package + ".ActiveRulesInfo"
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "filter_id"),
    2: .standard(proto: "group_id"),
    3: .standard(proto: "is_trusted"),
    4: .same(proto: "rules"),
  ]

  public 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.decodeSingularInt32Field(value: &self.filterID) }()
      case 2: try { try decoder.decodeSingularInt32Field(value: &self.groupID) }()
      case 3: try { try decoder.decodeSingularBoolField(value: &self.isTrusted) }()
      case 4: try { try decoder.decodeRepeatedStringField(value: &self.rules) }()
      default: break
      }
    }
  }

  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if self.filterID != 0 {
      try visitor.visitSingularInt32Field(value: self.filterID, fieldNumber: 1)
    }
    if self.groupID != 0 {
      try visitor.visitSingularInt32Field(value: self.groupID, fieldNumber: 2)
    }
    if self.isTrusted != false {
      try visitor.visitSingularBoolField(value: self.isTrusted, fieldNumber: 3)
    }
    if !self.rules.isEmpty {
      try visitor.visitRepeatedStringField(value: self.rules, fieldNumber: 4)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  public static func ==(lhs: FilterListManager_ActiveRulesInfo, rhs: FilterListManager_ActiveRulesInfo) -> Bool {
    if lhs.filterID != rhs.filterID {return false}
    if lhs.groupID != rhs.groupID {return false}
    if lhs.isTrusted != rhs.isTrusted {return false}
    if lhs.rules != rhs.rules {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension FilterListManager_ActiveRulesInfoRaw: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let protoMessageName: String = _protobuf_package + ".ActiveRulesInfoRaw"
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "filter_id"),
    2: .standard(proto: "group_id"),
    3: .standard(proto: "is_trusted"),
    4: .same(proto: "rules"),
  ]

  public 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.decodeSingularInt32Field(value: &self.filterID) }()
      case 2: try { try decoder.decodeSingularInt32Field(value: &self.groupID) }()
      case 3: try { try decoder.decodeSingularBoolField(value: &self.isTrusted) }()
      case 4: try { try decoder.decodeSingularStringField(value: &self.rules) }()
      default: break
      }
    }
  }

  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if self.filterID != 0 {
      try visitor.visitSingularInt32Field(value: self.filterID, fieldNumber: 1)
    }
    if self.groupID != 0 {
      try visitor.visitSingularInt32Field(value: self.groupID, fieldNumber: 2)
    }
    if self.isTrusted != false {
      try visitor.visitSingularBoolField(value: self.isTrusted, fieldNumber: 3)
    }
    if !self.rules.isEmpty {
      try visitor.visitSingularStringField(value: self.rules, fieldNumber: 4)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  public static func ==(lhs: FilterListManager_ActiveRulesInfoRaw, rhs: FilterListManager_ActiveRulesInfoRaw) -> Bool {
    if lhs.filterID != rhs.filterID {return false}
    if lhs.groupID != rhs.groupID {return false}
    if lhs.isTrusted != rhs.isTrusted {return false}
    if lhs.rules != rhs.rules {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension FilterListManager_UpdateResult: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let protoMessageName: String = _protobuf_package + ".UpdateResult"
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "updated_list"),
    2: .standard(proto: "remaining_filters_count"),
    3: .standard(proto: "filters_errors"),
  ]

  public 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.updatedList) }()
      case 2: try { try decoder.decodeSingularInt32Field(value: &self.remainingFiltersCount) }()
      case 3: try { try decoder.decodeRepeatedMessageField(value: &self.filtersErrors) }()
      default: break
      }
    }
  }

  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.updatedList.isEmpty {
      try visitor.visitRepeatedMessageField(value: self.updatedList, fieldNumber: 1)
    }
    if self.remainingFiltersCount != 0 {
      try visitor.visitSingularInt32Field(value: self.remainingFiltersCount, fieldNumber: 2)
    }
    if !self.filtersErrors.isEmpty {
      try visitor.visitRepeatedMessageField(value: self.filtersErrors, fieldNumber: 3)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  public static func ==(lhs: FilterListManager_UpdateResult, rhs: FilterListManager_UpdateResult) -> Bool {
    if lhs.updatedList != rhs.updatedList {return false}
    if lhs.remainingFiltersCount != rhs.remainingFiltersCount {return false}
    if lhs.filtersErrors != rhs.filtersErrors {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension FilterListManager_UpdateFilterError: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let protoMessageName: String = _protobuf_package + ".UpdateFilterError"
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "filter_id"),
    2: .same(proto: "message"),
    3: .standard(proto: "filter_url"),
    4: .standard(proto: "http_client_error"),
  ]

  public 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.decodeSingularInt32Field(value: &self.filterID) }()
      case 2: try { try decoder.decodeSingularStringField(value: &self.message) }()
      case 3: try { try decoder.decodeSingularStringField(value: &self._filterURL) }()
      case 4: try { try decoder.decodeSingularStringField(value: &self._httpClientError) }()
      default: break
      }
    }
  }

  public 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.filterID != 0 {
      try visitor.visitSingularInt32Field(value: self.filterID, fieldNumber: 1)
    }
    if !self.message.isEmpty {
      try visitor.visitSingularStringField(value: self.message, fieldNumber: 2)
    }
    try { if let v = self._filterURL {
      try visitor.visitSingularStringField(value: v, fieldNumber: 3)
    } }()
    try { if let v = self._httpClientError {
      try visitor.visitSingularStringField(value: v, fieldNumber: 4)
    } }()
    try unknownFields.traverse(visitor: &visitor)
  }

  public static func ==(lhs: FilterListManager_UpdateFilterError, rhs: FilterListManager_UpdateFilterError) -> Bool {
    if lhs.filterID != rhs.filterID {return false}
    if lhs.message != rhs.message {return false}
    if lhs._filterURL != rhs._filterURL {return false}
    if lhs._httpClientError != rhs._httpClientError {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension FilterListManager_MovedFilterInfo: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let protoMessageName: String = _protobuf_package + ".MovedFilterInfo"
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "previous_id"),
    2: .standard(proto: "new_id"),
  ]

  public 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.decodeSingularInt32Field(value: &self.previousID) }()
      case 2: try { try decoder.decodeSingularInt32Field(value: &self.newID) }()
      default: break
      }
    }
  }

  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if self.previousID != 0 {
      try visitor.visitSingularInt32Field(value: self.previousID, fieldNumber: 1)
    }
    if self.newID != 0 {
      try visitor.visitSingularInt32Field(value: self.newID, fieldNumber: 2)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  public static func ==(lhs: FilterListManager_MovedFilterInfo, rhs: FilterListManager_MovedFilterInfo) -> Bool {
    if lhs.previousID != rhs.previousID {return false}
    if lhs.newID != rhs.newID {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}

extension FilterListManager_PullMetadataResult: SwiftProtobuf.Message, SwiftProtobuf._MessageImplementationBase, SwiftProtobuf._ProtoNameProviding {
  public static let protoMessageName: String = _protobuf_package + ".PullMetadataResult"
  public static let _protobuf_nameMap: SwiftProtobuf._NameMap = [
    1: .standard(proto: "added_filters"),
    2: .standard(proto: "removed_filters"),
    3: .standard(proto: "moved_filters"),
  ]

  public 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.decodeRepeatedInt32Field(value: &self.addedFilters) }()
      case 2: try { try decoder.decodeRepeatedInt32Field(value: &self.removedFilters) }()
      case 3: try { try decoder.decodeRepeatedMessageField(value: &self.movedFilters) }()
      default: break
      }
    }
  }

  public func traverse<V: SwiftProtobuf.Visitor>(visitor: inout V) throws {
    if !self.addedFilters.isEmpty {
      try visitor.visitPackedInt32Field(value: self.addedFilters, fieldNumber: 1)
    }
    if !self.removedFilters.isEmpty {
      try visitor.visitPackedInt32Field(value: self.removedFilters, fieldNumber: 2)
    }
    if !self.movedFilters.isEmpty {
      try visitor.visitRepeatedMessageField(value: self.movedFilters, fieldNumber: 3)
    }
    try unknownFields.traverse(visitor: &visitor)
  }

  public static func ==(lhs: FilterListManager_PullMetadataResult, rhs: FilterListManager_PullMetadataResult) -> Bool {
    if lhs.addedFilters != rhs.addedFilters {return false}
    if lhs.removedFilters != rhs.removedFilters {return false}
    if lhs.movedFilters != rhs.movedFilters {return false}
    if lhs.unknownFields != rhs.unknownFields {return false}
    return true
  }
}
