diff --git a/Bucketeer/Sources/Internal/Remote/RequestBody/RegisterEventsRequestBody.swift b/Bucketeer/Sources/Internal/Remote/RequestBody/RegisterEventsRequestBody.swift index 1fffc5fa..904fd687 100644 --- a/Bucketeer/Sources/Internal/Remote/RequestBody/RegisterEventsRequestBody.swift +++ b/Bucketeer/Sources/Internal/Remote/RequestBody/RegisterEventsRequestBody.swift @@ -1,6 +1,16 @@ import Foundation struct RegisterEventsRequestBody: Codable { + internal init(events: [Event] = [], + sdkVersion: String = Version.current, + sourceId: SourceID = SourceID.ios + ) { + self.events = events + self.sdkVersion = sdkVersion + self.sourceId = sourceId + } + let events: [Event] let sdkVersion: String + let sourceId: SourceID } diff --git a/BucketeerTests/ApiClientTests.swift b/BucketeerTests/ApiClientTests.swift index ade7e756..2fd005d5 100644 --- a/BucketeerTests/ApiClientTests.swift +++ b/BucketeerTests/ApiClientTests.swift @@ -250,7 +250,8 @@ class ApiClientTests: XCTestCase { "type" : 3 } ], - "sdkVersion" : "\(Version.current)" + "sdkVersion" : "\(Version.current)", + "sourceId" : 2 } """ XCTAssertEqual(jsonString, expected) @@ -360,7 +361,8 @@ class ApiClientTests: XCTestCase { "type" : 3 } ], - "sdkVersion" : "\(Version.current)" + "sdkVersion" : "\(Version.current)", + "sourceId" : 2 } """ XCTAssertEqual(jsonString, expected)