Skip to content

Commit ae55908

Browse files
fix(specs): make optional for tasks [skip-bc] (generated)
algolia/api-clients-automation#4095 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 6073cad commit ae55908

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

Sources/Ingestion/Models/Task.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public struct Task: Codable, JSONEncodable {
2424
public var enabled: Bool
2525
/// Maximum accepted percentage of failures for a task run to finish successfully.
2626
public var failureThreshold: Int?
27-
public var action: ActionType
27+
public var action: ActionType?
2828
/// Date of the last cursor in RFC 3339 format.
2929
public var cursor: String?
3030
/// Date of creation in RFC 3339 format.
@@ -42,7 +42,7 @@ public struct Task: Codable, JSONEncodable {
4242
input: TaskInput? = nil,
4343
enabled: Bool,
4444
failureThreshold: Int? = nil,
45-
action: ActionType,
45+
action: ActionType? = nil,
4646
cursor: String? = nil,
4747
createdAt: String,
4848
updatedAt: String? = nil
@@ -91,7 +91,7 @@ public struct Task: Codable, JSONEncodable {
9191
try container.encodeIfPresent(self.input, forKey: .input)
9292
try container.encode(self.enabled, forKey: .enabled)
9393
try container.encodeIfPresent(self.failureThreshold, forKey: .failureThreshold)
94-
try container.encode(self.action, forKey: .action)
94+
try container.encodeIfPresent(self.action, forKey: .action)
9595
try container.encodeIfPresent(self.cursor, forKey: .cursor)
9696
try container.encode(self.createdAt, forKey: .createdAt)
9797
try container.encodeIfPresent(self.updatedAt, forKey: .updatedAt)
@@ -127,7 +127,7 @@ extension Task: Hashable {
127127
hasher.combine(self.input?.hashValue)
128128
hasher.combine(self.enabled.hashValue)
129129
hasher.combine(self.failureThreshold?.hashValue)
130-
hasher.combine(self.action.hashValue)
130+
hasher.combine(self.action?.hashValue)
131131
hasher.combine(self.cursor?.hashValue)
132132
hasher.combine(self.createdAt.hashValue)
133133
hasher.combine(self.updatedAt?.hashValue)

Sources/Ingestion/Models/TaskV1.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public struct TaskV1: Codable, JSONEncodable {
2121
public var enabled: Bool
2222
/// Maximum accepted percentage of failures for a task run to finish successfully.
2323
public var failureThreshold: Int?
24-
public var action: ActionType
24+
public var action: ActionType?
2525
/// Date of the last cursor in RFC 3339 format.
2626
public var cursor: String?
2727
/// Date of creation in RFC 3339 format.
@@ -37,7 +37,7 @@ public struct TaskV1: Codable, JSONEncodable {
3737
input: TaskInput? = nil,
3838
enabled: Bool,
3939
failureThreshold: Int? = nil,
40-
action: ActionType,
40+
action: ActionType? = nil,
4141
cursor: String? = nil,
4242
createdAt: String,
4343
updatedAt: String? = nil
@@ -80,7 +80,7 @@ public struct TaskV1: Codable, JSONEncodable {
8080
try container.encodeIfPresent(self.input, forKey: .input)
8181
try container.encode(self.enabled, forKey: .enabled)
8282
try container.encodeIfPresent(self.failureThreshold, forKey: .failureThreshold)
83-
try container.encode(self.action, forKey: .action)
83+
try container.encodeIfPresent(self.action, forKey: .action)
8484
try container.encodeIfPresent(self.cursor, forKey: .cursor)
8585
try container.encode(self.createdAt, forKey: .createdAt)
8686
try container.encodeIfPresent(self.updatedAt, forKey: .updatedAt)
@@ -112,7 +112,7 @@ extension TaskV1: Hashable {
112112
hasher.combine(self.input?.hashValue)
113113
hasher.combine(self.enabled.hashValue)
114114
hasher.combine(self.failureThreshold?.hashValue)
115-
hasher.combine(self.action.hashValue)
115+
hasher.combine(self.action?.hashValue)
116116
hasher.combine(self.cursor?.hashValue)
117117
hasher.combine(self.createdAt.hashValue)
118118
hasher.combine(self.updatedAt?.hashValue)

0 commit comments

Comments
 (0)