Skip to content

Commit

Permalink
updated swiftformat rules
Browse files Browse the repository at this point in the history
  • Loading branch information
phantumcode committed Sep 9, 2024
1 parent b69b17e commit 3a2d81a
Show file tree
Hide file tree
Showing 95 changed files with 2,066 additions and 1,412 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,10 @@ public extension AWSS3StoragePlugin {
throw error
}
let prefixResolver = storageConfiguration.prefixResolver ?? StorageAccessLevelAwarePrefixResolver(authService: authService)
let prefix = try await prefixResolver.resolvePrefix(for: options.accessLevel,
targetIdentityId: options.targetIdentityId)
let prefix = try await prefixResolver.resolvePrefix(
for: options.accessLevel,
targetIdentityId: options.targetIdentityId
)
let serviceKey = prefix + request.key
if let pluginOptions = options.pluginOptions as? AWSStorageGetURLOptions, pluginOptions.validateObjectExistence {
try await storageService.validateObjectExistence(serviceKey: serviceKey)
Expand All @@ -37,7 +39,8 @@ public extension AWSS3StoragePlugin {
signingOperation: .getObject,
metadata: nil,
accelerate: accelerate,
expires: options.expires)
expires: options.expires
)

let channel = HubChannel(from: categoryType)
let payload = HubPayload(eventName: HubPayload.EventName.Storage.getURL, context: options, data: result)
Expand All @@ -53,7 +56,8 @@ public extension AWSS3StoragePlugin {
let request = StorageGetURLRequest(path: path, options: options)
let task = AWSS3StorageGetURLTask(
request,
storageBehaviour: storageService)
storageBehaviour: storageService
)
return try await task.value
}

Expand All @@ -63,10 +67,12 @@ public extension AWSS3StoragePlugin {
) -> StorageDownloadDataTask {
let options = options ?? StorageDownloadDataRequest.Options()
let request = StorageDownloadDataRequest(path: path, options: options)
let operation = AWSS3StorageDownloadDataOperation(request,
storageConfiguration: storageConfiguration,
storageService: storageService,
authService: authService)
let operation = AWSS3StorageDownloadDataOperation(
request,
storageConfiguration: storageConfiguration,
storageService: storageService,
authService: authService
)
let taskAdapter = AmplifyInProcessReportingOperationTaskAdapter(operation: operation)
queue.addOperation(operation)

Expand All @@ -80,10 +86,12 @@ public extension AWSS3StoragePlugin {
) -> StorageDownloadDataTask {
let options = options ?? StorageDownloadDataRequest.Options()
let request = StorageDownloadDataRequest(key: key, options: options)
let operation = AWSS3StorageDownloadDataOperation(request,
storageConfiguration: storageConfiguration,
storageService: storageService,
authService: authService)
let operation = AWSS3StorageDownloadDataOperation(
request,
storageConfiguration: storageConfiguration,
storageService: storageService,
authService: authService
)
let taskAdapter = AmplifyInProcessReportingOperationTaskAdapter(operation: operation)
queue.addOperation(operation)

Expand All @@ -98,10 +106,12 @@ public extension AWSS3StoragePlugin {
) -> StorageDownloadFileTask {
let options = options ?? StorageDownloadFileRequest.Options()
let request = StorageDownloadFileRequest(key: key, local: local, options: options)
let operation = AWSS3StorageDownloadFileOperation(request,
storageConfiguration: storageConfiguration,
storageService: storageService,
authService: authService)
let operation = AWSS3StorageDownloadFileOperation(
request,
storageConfiguration: storageConfiguration,
storageService: storageService,
authService: authService
)
let taskAdapter = AmplifyInProcessReportingOperationTaskAdapter(operation: operation)
queue.addOperation(operation)

Expand All @@ -116,10 +126,12 @@ public extension AWSS3StoragePlugin {
) -> StorageDownloadFileTask {
let options = options ?? StorageDownloadFileRequest.Options()
let request = StorageDownloadFileRequest(path: path, local: local, options: options)
let operation = AWSS3StorageDownloadFileOperation(request,
storageConfiguration: storageConfiguration,
storageService: storageService,
authService: authService)
let operation = AWSS3StorageDownloadFileOperation(
request,
storageConfiguration: storageConfiguration,
storageService: storageService,
authService: authService
)
let taskAdapter = AmplifyInProcessReportingOperationTaskAdapter(operation: operation)
queue.addOperation(operation)

Expand All @@ -134,10 +146,12 @@ public extension AWSS3StoragePlugin {
) -> StorageUploadDataTask {
let options = options ?? StorageUploadDataRequest.Options()
let request = StorageUploadDataRequest(key: key, data: data, options: options)
let operation = AWSS3StorageUploadDataOperation(request,
storageConfiguration: storageConfiguration,
storageService: storageService,
authService: authService)
let operation = AWSS3StorageUploadDataOperation(
request,
storageConfiguration: storageConfiguration,
storageService: storageService,
authService: authService
)
let taskAdapter = AmplifyInProcessReportingOperationTaskAdapter(operation: operation)
queue.addOperation(operation)

Expand All @@ -152,10 +166,12 @@ public extension AWSS3StoragePlugin {
) -> StorageUploadDataTask {
let options = options ?? StorageUploadDataRequest.Options()
let request = StorageUploadDataRequest(path: path, data: data, options: options)
let operation = AWSS3StorageUploadDataOperation(request,
storageConfiguration: storageConfiguration,
storageService: storageService,
authService: authService)
let operation = AWSS3StorageUploadDataOperation(
request,
storageConfiguration: storageConfiguration,
storageService: storageService,
authService: authService
)
let taskAdapter = AmplifyInProcessReportingOperationTaskAdapter(operation: operation)
queue.addOperation(operation)

Expand All @@ -170,10 +186,12 @@ public extension AWSS3StoragePlugin {
) -> StorageUploadFileTask {
let options = options ?? StorageUploadFileRequest.Options()
let request = StorageUploadFileRequest(key: key, local: local, options: options)
let operation = AWSS3StorageUploadFileOperation(request,
storageConfiguration: storageConfiguration,
storageService: storageService,
authService: authService)
let operation = AWSS3StorageUploadFileOperation(
request,
storageConfiguration: storageConfiguration,
storageService: storageService,
authService: authService
)
let taskAdapter = AmplifyInProcessReportingOperationTaskAdapter(operation: operation)
queue.addOperation(operation)

Expand All @@ -188,10 +206,12 @@ public extension AWSS3StoragePlugin {
) -> StorageUploadFileTask {
let options = options ?? StorageUploadFileRequest.Options()
let request = StorageUploadFileRequest(path: path, local: local, options: options)
let operation = AWSS3StorageUploadFileOperation(request,
storageConfiguration: storageConfiguration,
storageService: storageService,
authService: authService)
let operation = AWSS3StorageUploadFileOperation(
request,
storageConfiguration: storageConfiguration,
storageService: storageService,
authService: authService
)
let taskAdapter = AmplifyInProcessReportingOperationTaskAdapter(operation: operation)
queue.addOperation(operation)

Expand All @@ -205,10 +225,12 @@ public extension AWSS3StoragePlugin {
) async throws -> String {
let options = options ?? StorageRemoveRequest.Options()
let request = StorageRemoveRequest(key: key, options: options)
let operation = AWSS3StorageRemoveOperation(request,
storageConfiguration: storageConfiguration,
storageService: storageService,
authService: authService)
let operation = AWSS3StorageRemoveOperation(
request,
storageConfiguration: storageConfiguration,
storageService: storageService,
authService: authService
)
let taskAdapter = AmplifyOperationTaskAdapter(operation: operation)
queue.addOperation(operation)

Expand All @@ -225,7 +247,8 @@ public extension AWSS3StoragePlugin {
let task = AWSS3StorageRemoveTask(
request,
storageConfiguration: storageConfiguration,
storageBehaviour: storageService)
storageBehaviour: storageService
)
return try await task.value
}

Expand Down Expand Up @@ -253,7 +276,8 @@ public extension AWSS3StoragePlugin {
let task = AWSS3StorageListObjectsTask(
request,
storageConfiguration: storageConfiguration,
storageBehaviour: storageService)
storageBehaviour: storageService
)
return try await task.value
}

Expand Down
Loading

0 comments on commit 3a2d81a

Please sign in to comment.