Skip to content

Commit

Permalink
fix(specs): ingestion expected and received events type [skip-bc] (ge…
Browse files Browse the repository at this point in the history
…nerated)

algolia/api-clients-automation#4356

Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com>
Co-authored-by: Clément Vannicatte <vannicattec@gmail.com>
  • Loading branch information
algolia-bot and shortcuts committed Jan 13, 2025
1 parent 2e5b18c commit 4460361
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Sources/Ingestion/Models/RunProgress.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import Foundation
#endif

public struct RunProgress: Codable, JSONEncodable {
public var expectedNbOfEvents: Int?
public var receivedNbOfEvents: Int?
public var expectedNbOfEvents: Int
public var receivedNbOfEvents: Int

public init(expectedNbOfEvents: Int? = nil, receivedNbOfEvents: Int? = nil) {
public init(expectedNbOfEvents: Int, receivedNbOfEvents: Int) {
self.expectedNbOfEvents = expectedNbOfEvents
self.receivedNbOfEvents = receivedNbOfEvents
}
Expand All @@ -24,8 +24,8 @@ public struct RunProgress: Codable, JSONEncodable {

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(self.expectedNbOfEvents, forKey: .expectedNbOfEvents)
try container.encodeIfPresent(self.receivedNbOfEvents, forKey: .receivedNbOfEvents)
try container.encode(self.expectedNbOfEvents, forKey: .expectedNbOfEvents)
try container.encode(self.receivedNbOfEvents, forKey: .receivedNbOfEvents)
}
}

Expand All @@ -38,7 +38,7 @@ extension RunProgress: Equatable {

extension RunProgress: Hashable {
public func hash(into hasher: inout Hasher) {
hasher.combine(self.expectedNbOfEvents?.hashValue)
hasher.combine(self.receivedNbOfEvents?.hashValue)
hasher.combine(self.expectedNbOfEvents.hashValue)
hasher.combine(self.receivedNbOfEvents.hashValue)
}
}

0 comments on commit 4460361

Please sign in to comment.