pplu / aws-sdk-perl

A community AWS SDK for Perl Programmers
Other
170 stars 94 forks source link

S3::ListObjectVersions does not support a prefix #171

Open readparse opened 7 years ago

readparse commented 7 years ago

I would submit a pull request, but since my patch was in generated code, and I have not yet figured out how to make the same change in this repo, I am just letting you know what I did to make it work.

It's also entirely possible that there is a more appropriate way to support this additional property. Please advise if I have missed the mark.

In the S3::ListObjectVersions class, the _api_uri attribute is set to /{Bucket}?versions. I changed it to /{Bucket}?versions&prefix={Prefix}. Now it sends the prefix if one was provided, but continues to work correctly without one as well.

castaway commented 6 years ago

Untested, but it looks like you're supposed to provide Prefix as a parameter: See for example: https://github.com/pplu/aws-sdk-perl/blob/master/examples/s3-common-methods.pl#L185

This is ListObjects, ListObjectVersions has the same parameter - https://metacpan.org/pod/Paws::S3::ListObjectVersions#Prefix-=>-Str

castaway commented 4 years ago

This looks like it works as-is, a test for this has been added in #265 (tests/stabilisations branch), see t/s3/prefix.t

byterock commented 4 years ago

That one is passing as well on

https://github.com/byterock/aws-sdk-perl/tree/s3ObjectTagging

1..2 ok All tests successful.