示例#1
0
 /// <summary>
 /// Asynchronously lists the objects in a given bucket.
 /// </summary>
 /// <remarks>
 /// This method fetches the objects lazily, making requests to the underlying service
 /// for a page of results at a time, as required. No network requests are made until the returned sequence is enumerated.
 /// This means that any exception due to an invalid request will be deferred until that time. Callers should be prepared
 /// for exceptions to be thrown while enumerating the results. In addition to failures due to invalid requests, network
 /// or service failures can cause exceptions even after the first results have been returned.
 /// </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 or empty, 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>An asynchronous sequence of objects in the specified bucket.</returns>
 public virtual PagedAsyncEnumerable <Objects, Object> ListObjectsAsync(
     string bucket,
     string prefix = null,
     ListObjectsOptions options = null)
 {
     throw new NotImplementedException();
 }
示例#2
0
 /// <inheritdoc />
 public override PagedAsyncEnumerable <Objects, Object> ListObjectsAsync(
     string bucket,
     string prefix = null,
     ListObjectsOptions options = null)
 {
     ValidateBucketName(bucket);
     return(new RestPagedAsyncEnumerable <ObjectsResource.ListRequest, Objects, Object>(
                () => CreateListObjectsRequest(bucket, prefix, options), ObjectPageManager.Instance));
 }
示例#3
0
        private ObjectsResource.ListRequest CreateListObjectsRequest(string bucket, string prefix, ListObjectsOptions options)
        {
            var request = Service.Objects.List(bucket);

            request.Prefix = prefix;
            options?.ModifyRequest(request);
            return(request);
        }