Box.V2.Managers.BoxRetentionPoliciesManager.GetRetentionPoliciesAsync C# (CSharp) Method

GetRetentionPoliciesAsync() public method

Retrieves all of the retention policies for the given enterprise.
public GetRetentionPoliciesAsync ( string policyName = null, string policyType = null, string createdByUserId = null, List fields = null, int limit = 100, string marker = null, bool autoPaginate = false ) : Task>
policyName string A name to filter the retention policies by. A trailing partial match search is performed.
policyType string A policy type to filter the retention policies by.
createdByUserId string A user id to filter the retention policies by.
fields List Attribute(s) to include in the response.
limit int Limit result size to this number. Defaults to 100, maximum is 1,000.
marker string Take from "next_marker" column of a prior call to get the next page.
autoPaginate bool Whether or not to auto-paginate to fetch all items; defaults to false.
return Task>
        public async Task<BoxCollectionMarkerBased<BoxRetentionPolicy>> GetRetentionPoliciesAsync(string policyName = null, string policyType = null, string createdByUserId = null, List<string> fields = null, int limit = 100, string marker = null, bool autoPaginate = false)
        {
            BoxRequest request = new BoxRequest(_config.RetentionPoliciesEndpointUri)
                .Param("policy_name", policyName)
                .Param("policy_type", policyType)
                .Param("created_by_user_id", createdByUserId)
                .Param(ParamFields, fields)
                .Param("limit", limit.ToString())
                .Param("marker", marker);

            if (autoPaginate)
            {
                return await AutoPaginateMarker<BoxRetentionPolicy>(request, limit);
            }
            else
            {
                IBoxResponse<BoxCollectionMarkerBased<BoxRetentionPolicy>> response = await ToResponseAsync<BoxCollectionMarkerBased<BoxRetentionPolicy>>(request).ConfigureAwait(false);
                return response.ResponseObject;
            }
        }