diff --git a/storage/bucket.go b/storage/bucket.go index 9d145f039636..54f4b45d4dd6 100644 --- a/storage/bucket.go +++ b/storage/bucket.go @@ -1543,6 +1543,7 @@ func (it *ObjectIterator) fetch(pageSize int, pageToken string) (string, error) req.StartOffset(it.query.StartOffset) req.EndOffset(it.query.EndOffset) req.Versions(it.query.Versions) + req.IncludeTrailingDelimiter(it.query.IncludeTrailingDelimiter) if len(it.query.fieldSelection) > 0 { req.Fields("nextPageToken", googleapi.Field(it.query.fieldSelection)) } diff --git a/storage/storage.go b/storage/storage.go index 457d77c8dbc9..cca34184d590 100644 --- a/storage/storage.go +++ b/storage/storage.go @@ -1588,6 +1588,11 @@ type Query struct { // which returns all properties. Passing ProjectionNoACL will omit Owner and ACL, // which may improve performance when listing many objects. Projection Projection + + // If true, objects that end in exactly one instance of delimiter have + // their metadata included in items[] in addition to the relevant part of + // the object name appearing in prefixes[]. + IncludeTrailingDelimiter bool } // attrToFieldMap maps the field names of ObjectAttrs to the underlying field