Box.V2.Managers.BoxFoldersManager.GetFolderItemsAsync C# (CSharp) Méthode

GetFolderItemsAsync() public méthode

Retrieves the files and/or folders contained within this folder without any other metadata about the folder. Any attribute in the full files or folders objects can be passed in with the fields parameter to get specific attributes, and only those specific attributes back; otherwise, the mini format is returned for each item by default. Multiple attributes can be passed in using the fields parameter. Paginated results can be retrieved using the limit and offset parameters.
public GetFolderItemsAsync ( string id, int limit, int offset, List fields = null, bool autoPaginate = false ) : Task>
id string
limit int The maximum number of items to return in a page. The default is 100 and the max is 1000.
offset int The offset at which to begin the response. An offset of value of 0 will start at the beginning of the folder-listing. /// Note: If there are hidden items in your previous response, your next offset should be = offset + limit, not the # of records you received back. /// The default is 0.
fields List Attribute(s) to include in the response
autoPaginate bool Whether or not to auto-paginate to fetch all items; defaults to false.
Résultat Task>
        public async Task<BoxCollection<BoxItem>> GetFolderItemsAsync(string id, int limit, int offset = 0, List<string> fields = null, bool autoPaginate=false)
        {
            id.ThrowIfNullOrWhiteSpace("id");

            BoxRequest request = new BoxRequest(_config.FoldersEndpointUri, string.Format(Constants.ItemsPathString, id))
                .Param("limit", limit.ToString())
                .Param("offset", offset.ToString())
                .Param(ParamFields, fields);

            if (autoPaginate)
            {
                return await AutoPaginateLimitOffset<BoxItem>(request, limit);
            }
            else
            {
                IBoxResponse<BoxCollection<BoxItem>> response = await ToResponseAsync<BoxCollection<BoxItem>>(request).ConfigureAwait(false);
                return response.ResponseObject;
            }   
        }