/// <summary> /// Gets all the device pins within a given enterprise. Must be an enterprise admin with the manage enterprise scope to make this call. /// </summary> /// <param name="enterpriseId">Box enterprise id.</param> /// <param name="marker">Needs not be passed or can be empty for first invocation of the API. Use the one returned in response for each subsequent call.</param> /// <param name="limit">Default value is 100. Max value is 10000.</param> /// <param name="direction">Default is "asc". Valid values are asc, desc. Case in-sensitive, ASC/DESC works just fine.</param> /// <param name="autoPaginate">Whether or not to auto-paginate to fetch all items; defaults to false.</param> /// <returns>Returns all the device pins within a given enterprise up to limit amount.</returns> public async Task<BoxCollectionMarkerBased<BoxDevicePin>> GetEnterpriseDevicePinsAsync(string enterpriseId, string marker = null, int limit = 100, BoxSortDirection direction = BoxSortDirection.ASC, bool autoPaginate = false) { BoxRequest request = new BoxRequest(_config.EnterprisesUri, string.Format(Constants.GetEnterpriseDevicePinsPathString, enterpriseId)) .Param("limit", limit.ToString()) .Param("marker", marker) .Param("direction", direction.ToString()); if (autoPaginate) { return await AutoPaginateMarker<BoxDevicePin>(request, limit); } else { IBoxResponse<BoxCollectionMarkerBased<BoxDevicePin>> response = await ToResponseAsync<BoxCollectionMarkerBased<BoxDevicePin>>(request).ConfigureAwait(false); return response.ResponseObject; } }
/// <summary> /// Gets all the device pins within a given enterprise. Must be an enterprise admin with the manage enterprise scope to make this call. /// </summary> /// <param name="enterpriseId">Box enterprise id.</param> /// <param name="marker">Needs not be passed or can be empty for first invocation of the API. Use the one returned in response for each subsequent call.</param> /// <param name="limit">Default value is 100. Max value is 10000.</param> /// <param name="direction">Default is "asc". Valid values are asc, desc. Case in-sensitive, ASC/DESC works just fine.</param> /// <param name="autoPaginate">Whether or not to auto-paginate to fetch all items; defaults to false.</param> /// <returns>Returns all the device pins within a given enterprise up to limit amount.</returns> public async Task <BoxCollectionMarkerBased <BoxDevicePin> > GetEnterpriseDevicePinsAsync(string enterpriseId, string marker = null, int limit = 100, BoxSortDirection direction = BoxSortDirection.ASC, bool autoPaginate = false) { BoxRequest request = new BoxRequest(_config.EnterprisesUri, string.Format(Constants.GetEnterpriseDevicePinsPathString, enterpriseId)) .Param("limit", limit.ToString()) .Param("marker", marker) .Param("direction", direction.ToString()); if (autoPaginate) { return(await AutoPaginateMarker <BoxDevicePin>(request, limit)); } else { IBoxResponse <BoxCollectionMarkerBased <BoxDevicePin> > response = await ToResponseAsync <BoxCollectionMarkerBased <BoxDevicePin> >(request).ConfigureAwait(false); return(response.ResponseObject); } }