Skip to content

Commit 0769787

Browse files
feat(specs): add subscriptionAction to ingestion specs (generated)
algolia/api-clients-automation#4587 Co-authored-by: algolia-bot <[email protected]> Co-authored-by: Clément Vannicatte <[email protected]>
1 parent 0d2ad6d commit 0769787

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

Sources/Ingestion/Models/IngestionTask.swift

+7
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ public struct IngestionTask: Codable, JSONEncodable {
2525
/// Maximum accepted percentage of failures for a task run to finish successfully.
2626
public var failureThreshold: Int?
2727
public var action: ActionType?
28+
public var subscriptionAction: ActionType?
2829
/// Date of the last cursor in RFC 3339 format.
2930
public var cursor: String?
3031
public var notifications: Notifications?
@@ -45,6 +46,7 @@ public struct IngestionTask: Codable, JSONEncodable {
4546
enabled: Bool,
4647
failureThreshold: Int? = nil,
4748
action: ActionType? = nil,
49+
subscriptionAction: ActionType? = nil,
4850
cursor: String? = nil,
4951
notifications: Notifications? = nil,
5052
policies: Policies? = nil,
@@ -61,6 +63,7 @@ public struct IngestionTask: Codable, JSONEncodable {
6163
self.enabled = enabled
6264
self.failureThreshold = failureThreshold
6365
self.action = action
66+
self.subscriptionAction = subscriptionAction
6467
self.cursor = cursor
6568
self.notifications = notifications
6669
self.policies = policies
@@ -79,6 +82,7 @@ public struct IngestionTask: Codable, JSONEncodable {
7982
case enabled
8083
case failureThreshold
8184
case action
85+
case subscriptionAction
8286
case cursor
8387
case notifications
8488
case policies
@@ -100,6 +104,7 @@ public struct IngestionTask: Codable, JSONEncodable {
100104
try container.encode(self.enabled, forKey: .enabled)
101105
try container.encodeIfPresent(self.failureThreshold, forKey: .failureThreshold)
102106
try container.encodeIfPresent(self.action, forKey: .action)
107+
try container.encodeIfPresent(self.subscriptionAction, forKey: .subscriptionAction)
103108
try container.encodeIfPresent(self.cursor, forKey: .cursor)
104109
try container.encodeIfPresent(self.notifications, forKey: .notifications)
105110
try container.encodeIfPresent(self.policies, forKey: .policies)
@@ -120,6 +125,7 @@ extension IngestionTask: Equatable {
120125
lhs.enabled == rhs.enabled &&
121126
lhs.failureThreshold == rhs.failureThreshold &&
122127
lhs.action == rhs.action &&
128+
lhs.subscriptionAction == rhs.subscriptionAction &&
123129
lhs.cursor == rhs.cursor &&
124130
lhs.notifications == rhs.notifications &&
125131
lhs.policies == rhs.policies &&
@@ -140,6 +146,7 @@ extension IngestionTask: Hashable {
140146
hasher.combine(self.enabled.hashValue)
141147
hasher.combine(self.failureThreshold?.hashValue)
142148
hasher.combine(self.action?.hashValue)
149+
hasher.combine(self.subscriptionAction?.hashValue)
143150
hasher.combine(self.cursor?.hashValue)
144151
hasher.combine(self.notifications?.hashValue)
145152
hasher.combine(self.policies?.hashValue)

Sources/Ingestion/Models/TaskCreate.swift

+7
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ public struct TaskCreate: Codable, JSONEncodable {
1313
/// Universally unique identifier (UUID) of a destination resource.
1414
public var destinationID: String
1515
public var action: ActionType
16+
public var subscriptionAction: ActionType?
1617
/// Cron expression for the task's schedule.
1718
public var cron: String?
1819
/// Whether the task is enabled.
@@ -29,6 +30,7 @@ public struct TaskCreate: Codable, JSONEncodable {
2930
sourceID: String,
3031
destinationID: String,
3132
action: ActionType,
33+
subscriptionAction: ActionType? = nil,
3234
cron: String? = nil,
3335
enabled: Bool? = nil,
3436
failureThreshold: Int? = nil,
@@ -40,6 +42,7 @@ public struct TaskCreate: Codable, JSONEncodable {
4042
self.sourceID = sourceID
4143
self.destinationID = destinationID
4244
self.action = action
45+
self.subscriptionAction = subscriptionAction
4346
self.cron = cron
4447
self.enabled = enabled
4548
self.failureThreshold = failureThreshold
@@ -53,6 +56,7 @@ public struct TaskCreate: Codable, JSONEncodable {
5356
case sourceID
5457
case destinationID
5558
case action
59+
case subscriptionAction
5660
case cron
5761
case enabled
5862
case failureThreshold
@@ -69,6 +73,7 @@ public struct TaskCreate: Codable, JSONEncodable {
6973
try container.encode(self.sourceID, forKey: .sourceID)
7074
try container.encode(self.destinationID, forKey: .destinationID)
7175
try container.encode(self.action, forKey: .action)
76+
try container.encodeIfPresent(self.subscriptionAction, forKey: .subscriptionAction)
7277
try container.encodeIfPresent(self.cron, forKey: .cron)
7378
try container.encodeIfPresent(self.enabled, forKey: .enabled)
7479
try container.encodeIfPresent(self.failureThreshold, forKey: .failureThreshold)
@@ -84,6 +89,7 @@ extension TaskCreate: Equatable {
8489
lhs.sourceID == rhs.sourceID &&
8590
lhs.destinationID == rhs.destinationID &&
8691
lhs.action == rhs.action &&
92+
lhs.subscriptionAction == rhs.subscriptionAction &&
8793
lhs.cron == rhs.cron &&
8894
lhs.enabled == rhs.enabled &&
8995
lhs.failureThreshold == rhs.failureThreshold &&
@@ -99,6 +105,7 @@ extension TaskCreate: Hashable {
99105
hasher.combine(self.sourceID.hashValue)
100106
hasher.combine(self.destinationID.hashValue)
101107
hasher.combine(self.action.hashValue)
108+
hasher.combine(self.subscriptionAction?.hashValue)
102109
hasher.combine(self.cron?.hashValue)
103110
hasher.combine(self.enabled?.hashValue)
104111
hasher.combine(self.failureThreshold?.hashValue)

Sources/Ingestion/Models/TaskUpdate.swift

+7
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ public struct TaskUpdate: Codable, JSONEncodable {
1515
public var input: TaskInput?
1616
/// Whether the task is enabled.
1717
public var enabled: Bool?
18+
public var subscriptionAction: ActionType?
1819
/// Maximum accepted percentage of failures for a task run to finish successfully.
1920
public var failureThreshold: Int?
2021
public var notifications: Notifications?
@@ -25,6 +26,7 @@ public struct TaskUpdate: Codable, JSONEncodable {
2526
cron: String? = nil,
2627
input: TaskInput? = nil,
2728
enabled: Bool? = nil,
29+
subscriptionAction: ActionType? = nil,
2830
failureThreshold: Int? = nil,
2931
notifications: Notifications? = nil,
3032
policies: Policies? = nil
@@ -33,6 +35,7 @@ public struct TaskUpdate: Codable, JSONEncodable {
3335
self.cron = cron
3436
self.input = input
3537
self.enabled = enabled
38+
self.subscriptionAction = subscriptionAction
3639
self.failureThreshold = failureThreshold
3740
self.notifications = notifications
3841
self.policies = policies
@@ -43,6 +46,7 @@ public struct TaskUpdate: Codable, JSONEncodable {
4346
case cron
4447
case input
4548
case enabled
49+
case subscriptionAction
4650
case failureThreshold
4751
case notifications
4852
case policies
@@ -56,6 +60,7 @@ public struct TaskUpdate: Codable, JSONEncodable {
5660
try container.encodeIfPresent(self.cron, forKey: .cron)
5761
try container.encodeIfPresent(self.input, forKey: .input)
5862
try container.encodeIfPresent(self.enabled, forKey: .enabled)
63+
try container.encodeIfPresent(self.subscriptionAction, forKey: .subscriptionAction)
5964
try container.encodeIfPresent(self.failureThreshold, forKey: .failureThreshold)
6065
try container.encodeIfPresent(self.notifications, forKey: .notifications)
6166
try container.encodeIfPresent(self.policies, forKey: .policies)
@@ -68,6 +73,7 @@ extension TaskUpdate: Equatable {
6873
lhs.cron == rhs.cron &&
6974
lhs.input == rhs.input &&
7075
lhs.enabled == rhs.enabled &&
76+
lhs.subscriptionAction == rhs.subscriptionAction &&
7177
lhs.failureThreshold == rhs.failureThreshold &&
7278
lhs.notifications == rhs.notifications &&
7379
lhs.policies == rhs.policies
@@ -80,6 +86,7 @@ extension TaskUpdate: Hashable {
8086
hasher.combine(self.cron?.hashValue)
8187
hasher.combine(self.input?.hashValue)
8288
hasher.combine(self.enabled?.hashValue)
89+
hasher.combine(self.subscriptionAction?.hashValue)
8390
hasher.combine(self.failureThreshold?.hashValue)
8491
hasher.combine(self.notifications?.hashValue)
8592
hasher.combine(self.policies?.hashValue)

0 commit comments

Comments
 (0)