Skip to content

Commit

Permalink
fix(specs): add secrets payload for updates (generated)
Browse files Browse the repository at this point in the history
algolia/api-clients-automation#4061

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 Oct 31, 2024
1 parent a209704 commit 044b879
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Sources/Ingestion/Models/AuthInputPartial.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ public enum AuthInputPartial: Codable, JSONEncodable, AbstractEncodable {
case authOAuthPartial(AuthOAuthPartial)
case authAlgoliaPartial(AuthAlgoliaPartial)
case authAlgoliaInsightsPartial(AuthAlgoliaInsightsPartial)
case dictionaryOfStringToString([String: String])

public func encode(to encoder: Encoder) throws {
var container = encoder.singleValueContainer()
Expand All @@ -29,6 +30,8 @@ public enum AuthInputPartial: Codable, JSONEncodable, AbstractEncodable {
try container.encode(value)
case let .authAlgoliaInsightsPartial(value):
try container.encode(value)
case let .dictionaryOfStringToString(value):
try container.encode(value)
}
}

Expand All @@ -46,6 +49,8 @@ public enum AuthInputPartial: Codable, JSONEncodable, AbstractEncodable {
self = .authAlgoliaPartial(value)
} else if let value = try? container.decode(AuthAlgoliaInsightsPartial.self) {
self = .authAlgoliaInsightsPartial(value)
} else if let value = try? container.decode([String: String].self) {
self = .dictionaryOfStringToString(value)
} else {
throw DecodingError.typeMismatch(
Self.Type.self,
Expand All @@ -68,6 +73,8 @@ public enum AuthInputPartial: Codable, JSONEncodable, AbstractEncodable {
value as AuthAlgoliaPartial
case let .authAlgoliaInsightsPartial(value):
value as AuthAlgoliaInsightsPartial
case let .dictionaryOfStringToString(value):
value as [String: String]
}
}
}
Expand Down

0 comments on commit 044b879

Please sign in to comment.