File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -225,6 +225,28 @@ component {
225
225
if ( len ( arguments .VersionId ) ) queryParams [ ' versionId' ] = arguments .VersionId ;
226
226
return apiCall ( region , ' GET' , ' /' & Bucket & ' /' & ObjectKey , queryParams );
227
227
}
228
+
229
+ /**
230
+ * Retrieve an Object's tags from Amazon S3.
231
+ * https://docs.aws.amazon.com/AmazonS3/latest/API/RESTObjectGETtagging.html
232
+ * @Bucket the name of the bucket containing the object
233
+ * @ObjectKey the object to get
234
+ * @VersionId the specific version of an object to get (if versioning is enabled)
235
+ */
236
+ public any function getObjectTagging (
237
+ required string Bucket ,
238
+ required string ObjectKey ,
239
+ string VersionId = ' '
240
+ ) {
241
+ if ( ! structKeyExists ( arguments , ' Region' ) ) arguments .Region = variables .defaultRegion ;
242
+ var queryParams = {' tagging' : ' ' };
243
+ if ( len ( arguments .VersionId ) ) queryParams [ ' versionId' ] = arguments .VersionId ;
244
+ var apiResponse = apiCall ( region , ' GET' , ' /' & Bucket & ' /' & ObjectKey , queryParams );
245
+ if ( apiResponse .statusCode == 200 ) {
246
+ apiResponse [ ' data' ] = utils .parseXmlResponse ( apiResponse .rawData , ' TagSet' );
247
+ }
248
+ return apiResponse ;
249
+ }
228
250
229
251
/**
230
252
* Retrieves metadata from an object without returning the object itself.
You can’t perform that action at this time.
0 commit comments