Skip to content

Commit f4b28d8

Browse files
feat(specs): add secrets authentications to ingestion (generated)
algolia/api-clients-automation#4054 Co-authored-by: algolia-bot <accounts+algolia-api-client-bot@algolia.com> Co-authored-by: Clément Vannicatte <vannicattec@gmail.com>
1 parent d642979 commit f4b28d8

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Sources/Ingestion/Models/AuthInput.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public enum AuthInput: Codable, JSONEncodable, AbstractEncodable {
1313
case authAPIKey(AuthAPIKey)
1414
case authAlgolia(AuthAlgolia)
1515
case authAlgoliaInsights(AuthAlgoliaInsights)
16+
case dictionaryOfStringToString([String: String])
1617

1718
public func encode(to encoder: Encoder) throws {
1819
var container = encoder.singleValueContainer()
@@ -29,6 +30,8 @@ public enum AuthInput: Codable, JSONEncodable, AbstractEncodable {
2930
try container.encode(value)
3031
case let .authAlgoliaInsights(value):
3132
try container.encode(value)
33+
case let .dictionaryOfStringToString(value):
34+
try container.encode(value)
3235
}
3336
}
3437

@@ -46,6 +49,8 @@ public enum AuthInput: Codable, JSONEncodable, AbstractEncodable {
4649
self = .authAlgolia(value)
4750
} else if let value = try? container.decode(AuthAlgoliaInsights.self) {
4851
self = .authAlgoliaInsights(value)
52+
} else if let value = try? container.decode([String: String].self) {
53+
self = .dictionaryOfStringToString(value)
4954
} else {
5055
throw DecodingError.typeMismatch(
5156
Self.Type.self,
@@ -68,6 +73,8 @@ public enum AuthInput: Codable, JSONEncodable, AbstractEncodable {
6873
value as AuthAlgolia
6974
case let .authAlgoliaInsights(value):
7075
value as AuthAlgoliaInsights
76+
case let .dictionaryOfStringToString(value):
77+
value as [String: String]
7178
}
7279
}
7380
}

Sources/Ingestion/Models/AuthenticationType.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ public enum AuthenticationType: String, Codable, CaseIterable {
1414
case oauth
1515
case algolia
1616
case algoliaInsights
17+
case secrets
1718
}
1819

1920
extension AuthenticationType: Hashable {}

0 commit comments

Comments
 (0)