/// <summary> /// Asynchronously lists the objects in a given bucket, returning the results as a list. /// </summary> /// <remarks> /// This lists the objects within a bucket before the returned task completes. /// This does not support reporting progress, or streaming the results. /// </remarks> /// <param name="bucket">The bucket to list the objects from. Must not be null.</param> /// <param name="prefix">The prefix to match. Only objects with names that start with this string will be returned. /// This parameter may be null, in which case no filtering is performed.</param> /// <param name="options">The options for the operation. May be null, in which case /// defaults will be supplied.</param> /// <param name="cancellationToken">The token to monitor for cancellation requests.</param> /// <returns>A list of objects within the bucket.</returns> public virtual Task <IList <Object> > ListAllObjectsAsync( string bucket, string prefix, ListObjectsOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { throw new NotImplementedException(); }
/// <inheritdoc /> public override IPagedAsyncEnumerable <Objects, Object> ListObjectsAsync( string bucket, string prefix, ListObjectsOptions options = null) { ValidateBucketName(bucket); return(new PagedAsyncEnumerable <ObjectsResource.ListRequest, Objects, Object>( () => CreateListObjectsRequest(bucket, prefix, options), ObjectPageManager.Instance)); }
/// <inheritdoc /> public override Task <IList <Object> > ListAllObjectsAsync( string bucket, string prefix, ListObjectsOptions options = null, CancellationToken cancellationToken = default(CancellationToken)) { var initialRequest = CreateListObjectsRequest(bucket, prefix, options); return(s_objectPageStreamer.FetchAllAsync(initialRequest, cancellationToken)); }
private ObjectsResource.ListRequest CreateListObjectsRequest(string bucket, string prefix, ListObjectsOptions options) { var request = Service.Objects.List(bucket); request.Prefix = prefix; options?.ModifyRequest(request); return(request); }
/// <inheritdoc /> public override IEnumerable <Object> ListObjects(string bucket, string prefix, ListObjectsOptions options = null) { var initialRequest = CreateListObjectsRequest(bucket, prefix, options); return(s_objectPageStreamer.Fetch(initialRequest)); }
/// <summary> /// Lists the objects in a given bucket, synchronously but lazily. /// </summary> /// <remarks> /// This method fetches the objects lazily, making requests to the underlying service /// for a page of results at a time, as required. /// </remarks> /// <param name="bucket">The bucket to list the objects from. Must not be null.</param> /// <param name="prefix">The prefix to match. Only objects with names that start with this string will be returned. /// This parameter may be null, in which case no filtering is performed.</param> /// <param name="options">The options for the operation. May be null, in which case /// defaults will be supplied.</param> /// <returns>A sequence of pages of objects in the specified bucket.</returns> public virtual IPagedEnumerable <Objects, Object> ListObjects(string bucket, string prefix, ListObjectsOptions options = null) { throw new NotImplementedException(); }