Skip to content

Commit 39bdd49

Browse files
feat(specs): push source type (generated)
algolia/api-clients-automation#3600 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 297b972 commit 39bdd49

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

Sources/Ingestion/Models/IngestionSource.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ public struct IngestionSource: Codable, JSONEncodable {
1111
public var sourceID: String
1212
public var type: SourceType
1313
public var name: String
14-
public var input: SourceInput
14+
public var input: SourceInput?
1515
/// Universally unique identifier (UUID) of an authentication resource.
1616
public var authenticationID: String?
1717
/// Date of creation in RFC 3339 format.
@@ -23,7 +23,7 @@ public struct IngestionSource: Codable, JSONEncodable {
2323
sourceID: String,
2424
type: SourceType,
2525
name: String,
26-
input: SourceInput,
26+
input: SourceInput? = nil,
2727
authenticationID: String? = nil,
2828
createdAt: String,
2929
updatedAt: String? = nil
@@ -54,7 +54,7 @@ public struct IngestionSource: Codable, JSONEncodable {
5454
try container.encode(self.sourceID, forKey: .sourceID)
5555
try container.encode(self.type, forKey: .type)
5656
try container.encode(self.name, forKey: .name)
57-
try container.encode(self.input, forKey: .input)
57+
try container.encodeIfPresent(self.input, forKey: .input)
5858
try container.encodeIfPresent(self.authenticationID, forKey: .authenticationID)
5959
try container.encode(self.createdAt, forKey: .createdAt)
6060
try container.encodeIfPresent(self.updatedAt, forKey: .updatedAt)
@@ -78,7 +78,7 @@ extension IngestionSource: Hashable {
7878
hasher.combine(self.sourceID.hashValue)
7979
hasher.combine(self.type.hashValue)
8080
hasher.combine(self.name.hashValue)
81-
hasher.combine(self.input.hashValue)
81+
hasher.combine(self.input?.hashValue)
8282
hasher.combine(self.authenticationID?.hashValue)
8383
hasher.combine(self.createdAt.hashValue)
8484
hasher.combine(self.updatedAt?.hashValue)

Sources/Ingestion/Models/SourceCreate.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ public struct SourceCreate: Codable, JSONEncodable {
1010
public var type: SourceType
1111
/// Descriptive name of the source.
1212
public var name: String
13-
public var input: SourceInput
13+
public var input: SourceInput?
1414
/// Universally unique identifier (UUID) of an authentication resource.
1515
public var authenticationID: String?
1616

17-
public init(type: SourceType, name: String, input: SourceInput, authenticationID: String? = nil) {
17+
public init(type: SourceType, name: String, input: SourceInput? = nil, authenticationID: String? = nil) {
1818
self.type = type
1919
self.name = name
2020
self.input = input
@@ -34,7 +34,7 @@ public struct SourceCreate: Codable, JSONEncodable {
3434
var container = encoder.container(keyedBy: CodingKeys.self)
3535
try container.encode(self.type, forKey: .type)
3636
try container.encode(self.name, forKey: .name)
37-
try container.encode(self.input, forKey: .input)
37+
try container.encodeIfPresent(self.input, forKey: .input)
3838
try container.encodeIfPresent(self.authenticationID, forKey: .authenticationID)
3939
}
4040
}
@@ -52,7 +52,7 @@ extension SourceCreate: Hashable {
5252
public func hash(into hasher: inout Hasher) {
5353
hasher.combine(self.type.hashValue)
5454
hasher.combine(self.name.hashValue)
55-
hasher.combine(self.input.hashValue)
55+
hasher.combine(self.input?.hashValue)
5656
hasher.combine(self.authenticationID?.hashValue)
5757
}
5858
}

Sources/Ingestion/Models/SourceType.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ public enum SourceType: String, Codable, CaseIterable {
1616
case json
1717
case shopify
1818
case sfcc
19+
case push
1920
}
2021

2122
extension SourceType: Hashable {}

0 commit comments

Comments
 (0)