Skip to content

Instantly share code, notes, and snippets.

@recursivecodes
Created March 1, 2019 15:16
Show Gist options
  • Select an option

  • Save recursivecodes/27dc8f108c583fce018b52117f8fb36b to your computer and use it in GitHub Desktop.

Select an option

Save recursivecodes/27dc8f108c583fce018b52117f8fb36b to your computer and use it in GitHub Desktop.
/**
* Lists the objects in a bucket.
* @param {ListObjectsRequest} listObjectsRequest An instance of ListObjectsRequest
* @method
*/
listObjects(listObjectsRequest){
const params = this.Utils.cleanObject( listObjectsRequest.queryParams );
const qs = this.querystring.stringify( params );
const url = `${this.serviceBaseUrl}/n/${listObjectsRequest.pathParams.namespaceName}/b/${listObjectsRequest.pathParams.bucketName}/o${qs ? '?' + qs : ''}`;
return this.doRequest(url, 'GET', {
headers: this.Utils.cleanObject( listObjectsRequest.headers )
}, JSON.stringify(listObjectsRequest.body));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment