File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Amplify/Categories/Storage Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,6 @@ public extension StorageBucket where Self == ResolvedStorageBucket {
50
50
}
51
51
}
52
52
53
-
54
53
/// Conforms to `StorageBucket`. Represents a Storage Bucket defined by a name in the AmplifyOutputs file.
55
54
///
56
55
/// - Tag: OutputsStorageBucket
@@ -64,3 +63,19 @@ public struct OutputsStorageBucket: StorageBucket {
64
63
public struct ResolvedStorageBucket : StorageBucket {
65
64
public let bucketInfo : BucketInfo
66
65
}
66
+
67
+ public extension Optional where Wrapped == any StorageBucket {
68
+ /// References a `StorageBucket` in the AmplifyOutputs file using the given name.
69
+ ///
70
+ /// - Parameter name: The name of the bucket
71
+ static func fromOutputs( name: String ) -> ( any StorageBucket ) ? {
72
+ return OutputsStorageBucket . fromOutputs ( name: name)
73
+ }
74
+
75
+ /// References a `StorageBucket` using the data from the given `BucketInfo`.
76
+ ///
77
+ /// - Parameter bucketInfo: A `BucketInfo` instance
78
+ static func fromBucketInfo( _ bucketInfo: BucketInfo ) -> ( any StorageBucket ) ? {
79
+ return ResolvedStorageBucket . fromBucketInfo ( bucketInfo)
80
+ }
81
+ }
You can’t perform that action at this time.
0 commit comments