Skip to content

Commit 508ecc9

Browse files
authored
correct edgeFunction key and add middlewareSettings (#147)
1 parent c2c7743 commit 508ecc9

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Sources/Segment/Settings.swift

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@ import Foundation
1010
public struct Settings: Codable {
1111
public var integrations: JSON? = nil
1212
public var plan: JSON? = nil
13-
public var edgeFunctions: JSON? = nil
14-
13+
public var edgeFunction: JSON? = nil
14+
public var middlewareSettings: JSON? = nil
15+
1516
public init(writeKey: String, apiHost: String) {
1617
integrations = try! JSON([
1718
SegmentDestination.Constants.integrationName.rawValue: [
@@ -34,13 +35,15 @@ public struct Settings: Codable {
3435
let values = try decoder.container(keyedBy: CodingKeys.self)
3536
self.integrations = try? values.decode(JSON.self, forKey: CodingKeys.integrations)
3637
self.plan = try? values.decode(JSON.self, forKey: CodingKeys.plan)
37-
self.edgeFunctions = try? values.decode(JSON.self, forKey: CodingKeys.edgeFunctions)
38+
self.edgeFunction = try? values.decode(JSON.self, forKey: CodingKeys.edgeFunction)
39+
self.middlewareSettings = try? values.decode(JSON.self, forKey: CodingKeys.middlewareSettings)
3840
}
3941

4042
enum CodingKeys: String, CodingKey {
4143
case integrations
4244
case plan
43-
case edgeFunctions
45+
case edgeFunction
46+
case middlewareSettings
4447
}
4548

4649
/**

0 commit comments

Comments
 (0)