Skip to content

Commit 029266d

Browse files
author
Ruben Nine
committed
Declaring StorageOptions asDictionary() extension public.
1 parent 52231cf commit 029266d

File tree

2 files changed

+49
-28
lines changed

2 files changed

+49
-28
lines changed

Sources/FilestackSDK/Internal/Extensions/StorageOptions+asDictionary.swift

Lines changed: 0 additions & 28 deletions
This file was deleted.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
//
2+
// StorageOptions+asDictionary.swift
3+
// FilestackSDK
4+
//
5+
// Created by Ruben Nine on 16/01/2020.
6+
// Copyright © 2020 Filestack. All rights reserved.
7+
//
8+
9+
import Alamofire
10+
import Foundation
11+
12+
extension StorageOptions {
13+
/// :nodoc:
14+
public func asDictionary() -> [String: Any] {
15+
var options: [String: Any] = [
16+
"location": location.description.lowercased(),
17+
]
18+
19+
if let region = region {
20+
options["region"] = region
21+
}
22+
23+
if let container = container {
24+
options["container"] = container
25+
}
26+
27+
if let path = path {
28+
options["path"] = path
29+
}
30+
31+
if let filename = filename {
32+
options["filename"] = filename
33+
}
34+
35+
if let mimeType = mimeType {
36+
options["mimetype"] = mimeType
37+
}
38+
39+
if let access = access?.description {
40+
options["access"] = access
41+
}
42+
43+
if let workflows = workflows {
44+
options["workflows"] = workflows
45+
}
46+
47+
return options
48+
}
49+
}

0 commit comments

Comments
 (0)