Skip to content

Commit 2a5aafb

Browse files
committed
Add an overload initializer for UploadOptions
1 parent fe4407e commit 2a5aafb

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

Sources/MuxUploadSDK/PublicAPI/Options/UploadOptions.swift

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ public struct UploadOptions {
185185
UploadOptions()
186186
}
187187

188-
// MARK: Upload Options Initializer
188+
// MARK: Upload Options Initializers
189189

190190
/// - Parameters:
191191
/// - inputStandardization: options to enable or
@@ -207,6 +207,33 @@ public struct UploadOptions {
207207
self.eventTracking = eventTracking
208208
}
209209

210+
/// - Parameters:
211+
/// - eventTracking: event tracking options for the
212+
/// direct upload
213+
/// - inputStandardization: options to enable or
214+
/// disable standardizing the format of the direct
215+
/// upload inputs, it is requested by default. To
216+
/// prevent the SDK from making any changes to the
217+
/// format of the input use ``UploadOptions.InputStandardization.skipped``
218+
/// - chunkSize: the size of each file chunk in
219+
/// bytes the SDK sends when uploading, default
220+
/// value is 8MB
221+
/// - retriesPerChunk: number of retry attempts
222+
/// if the chunk request fails, default value is 3
223+
public init(
224+
eventTracking: EventTracking = .default,
225+
inputStandardization: InputStandardization = .default,
226+
chunkSizeInBytes: Int,
227+
retryLimitPerChunk: Int
228+
) {
229+
self.eventTracking = eventTracking
230+
self.inputStandardization = inputStandardization
231+
self.transport = Transport(
232+
chunkSizeInBytes: chunkSizeInBytes,
233+
retryLimitPerChunk: retryLimitPerChunk
234+
)
235+
}
236+
210237
}
211238

212239
// MARK: - Extensions

0 commit comments

Comments
 (0)