-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(specs): ingestion push task payload [skip-bc] (generated)
algolia/api-clients-automation#3607 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]> Co-authored-by: Pierre Millot <[email protected]>
- Loading branch information
1 parent
7d447a8
commit 6e7c5a6
Showing
4 changed files
with
105 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
// Code generated by OpenAPI Generator (https://openapi-generator.tech), manual changes will be lost - read more on | ||
// https://github.com/algolia/api-clients-automation. DO NOT EDIT. | ||
|
||
import Foundation | ||
#if canImport(Core) | ||
import Core | ||
#endif | ||
|
||
public struct PushTaskRecords: Codable, JSONEncodable { | ||
/// Unique record identifier. | ||
public var objectID: String | ||
|
||
public init(objectID: String) { | ||
self.objectID = objectID | ||
} | ||
|
||
public enum CodingKeys: String, CodingKey, CaseIterable { | ||
case objectID | ||
} | ||
|
||
public var additionalProperties: [String: AnyCodable] = [:] | ||
|
||
public subscript(key: String) -> AnyCodable? { | ||
get { | ||
if let value = additionalProperties[key] { | ||
return value | ||
} | ||
return nil | ||
} | ||
|
||
set { | ||
self.additionalProperties[key] = newValue | ||
} | ||
} | ||
|
||
public init(from dictionary: [String: AnyCodable]) throws { | ||
guard let objectID = dictionary["objectID"]?.value as? String else { | ||
throw GenericError(description: "Failed to cast") | ||
} | ||
self.objectID = objectID | ||
for (key, value) in dictionary { | ||
switch key { | ||
case "objectID": | ||
continue | ||
default: | ||
self.additionalProperties[key] = value | ||
} | ||
} | ||
} | ||
|
||
// Encodable protocol methods | ||
|
||
public func encode(to encoder: Encoder) throws { | ||
var container = encoder.container(keyedBy: CodingKeys.self) | ||
try container.encode(self.objectID, forKey: .objectID) | ||
var additionalPropertiesContainer = encoder.container(keyedBy: String.self) | ||
try additionalPropertiesContainer.encodeMap(self.additionalProperties) | ||
} | ||
|
||
// Decodable protocol methods | ||
|
||
public init(from decoder: Decoder) throws { | ||
let container = try decoder.container(keyedBy: CodingKeys.self) | ||
|
||
self.objectID = try container.decode(String.self, forKey: .objectID) | ||
var nonAdditionalPropertyKeys = Set<String>() | ||
nonAdditionalPropertyKeys.insert("objectID") | ||
let additionalPropertiesContainer = try decoder.container(keyedBy: String.self) | ||
self.additionalProperties = try additionalPropertiesContainer.decodeMap( | ||
AnyCodable.self, | ||
excludedKeys: nonAdditionalPropertyKeys | ||
) | ||
} | ||
} | ||
|
||
extension PushTaskRecords: Equatable { | ||
public static func ==(lhs: PushTaskRecords, rhs: PushTaskRecords) -> Bool { | ||
lhs.objectID == rhs.objectID | ||
&& lhs.additionalProperties == rhs.additionalProperties | ||
} | ||
} | ||
|
||
extension PushTaskRecords: Hashable { | ||
public func hash(into hasher: inout Hasher) { | ||
hasher.combine(self.objectID.hashValue) | ||
hasher.combine(self.additionalProperties.hashValue) | ||
} | ||
} |