AWSS3ServiceClient
public protocol AWSS3ServiceClient
The AWS S3 service client, which can be used to interact with AWS Simple Storage Service (S3) via MongoDB Stitch.
-
Puts an object into an AWS S3 bucket as a string.
Declaration
Swift
func putObject(bucket: String, key: String, acl: String, contentType: String, body: String, _ completionHandler: @escaping (StitchResult<AWSS3PutObjectResult>) -> Void)Parameters
bucketthe bucket to put the object in
keythe key (or name) of the object
aclthe ACL to apply to the object (e.g. private)
contentTypethe content type of the object (e.g.
application/json
)bodythe body of the object as a string
completionHandlerThe completion handler to call when the object is put or the operation fails. This handler is executed on a non-main global
DispatchQueue. If the operation is successful, the result will contain the result of the put request as anAWSS3PutObjectResult. -
Puts a binary object into an AWS S3 bucket as a Foundation
Dataobject.Declaration
Swift
func putObject(bucket: String, key: String, acl: String, contentType: String, body: Data, _ completionHandler: @escaping (StitchResult<AWSS3PutObjectResult>) -> Void)Parameters
bucketthe bucket to put the object in
keythe key (or name) of the object
aclthe ACL to apply to the object (e.g. private)
contentTypethe content type of the object (e.g.
application/json
)bodythe body of the object as a
DatacompletionHandlerThe completion handler to call when the object is put or the operation fails. This handler is executed on a non-main global
DispatchQueue. If the operation is successful, the result will contain the result of the put request as anAWSS3PutObjectResult. -
Puts a binary object into an AWS S3 bucket as a BSON
Binaryobject.Declaration
Swift
func putObject(bucket: String, key: String, acl: String, contentType: String, body: Binary, _ completionHandler: @escaping (StitchResult<AWSS3PutObjectResult>) -> Void)Parameters
bucketthe bucket to put the object in
keythe key (or name) of the object
aclthe ACL to apply to the object (e.g. private)
contentTypethe content type of the object (e.g.
application/json
)bodythe body of the object as a BSON
BinarycompletionHandlerThe completion handler to call when the object is put or the operation fails. This handler is executed on a non-main global
DispatchQueue. If the operation is successful, the result will contain the result of the put request as anAWSS3PutObjectResult. -
Signs an AWS S3 security policy for a future put object request. This future request would be made outside of the Stitch SDK. This is typically used for large requests that are better sent directly to AWS.
Declaration
Swift
func signPolicy(bucket: String, key: String, acl: String, contentType: String, _ completionHandler: @escaping (StitchResult<AWSS3SignPolicyResult>) -> Void)Parameters
bucketthe bucket to put the object in
keythe key (or name) of the object
aclthe ACL to apply to the object (e.g. private)
contentTypethe content type of the object (e.g.
application/json
)completionHandlerThe completion handler to call when the policy is signed or the operation fails. This handler is executed on a non-main global
DispatchQueue. If the operation is successful, the result will contain the result of the sign policy request as anAWSS3SignPolicyResult.
AWSS3ServiceClient Protocol Reference