public async virtual Task <long> GetCountAsync(IEnumerable <KeyValuePair <string, object> > filter) { var q = new OrganizationStructuresCountGetQuery(); q.FilterTag = OrganizationStructureProxyUtils.GetFilterTagQueryValueString(filter); var req = new OrganizationStructuresCountGetRequest(); req.Query = q; var resp = await _ramlClient.OrganizationStructuresCount.Get(req); OrganizationStructureProxyUtils.ThrowOnHttpResponseError(resp); return(long.Parse(await resp.RawContent.ReadAsStringAsync())); }
public async Task <IEnumerable <IOrganizationStructureState> > GetAsync(IEnumerable <KeyValuePair <string, object> > filter, IList <string> orders = null, int firstResult = 0, int maxResults = int.MaxValue, IList <string> fields = null) { IEnumerable <IOrganizationStructureState> states = null; var q = new OrganizationStructuresGetQuery(); q.FirstResult = firstResult; q.MaxResults = maxResults; q.Sort = OrganizationStructureProxyUtils.GetOrdersQueryValueString(orders); q.Fields = OrganizationStructureProxyUtils.GetReturnedFieldsQueryValueString(fields, QueryFieldValueSeparator); q.FilterTag = OrganizationStructureProxyUtils.GetFilterTagQueryValueString(filter); var req = new OrganizationStructuresGetRequest(); req.Query = q; var resp = await _ramlClient.OrganizationStructures.Get(req); OrganizationStructureProxyUtils.ThrowOnHttpResponseError(resp); states = (resp.Content == null) ? null : resp.Content.Select(e => e.ToOrganizationStructureState()); return(states); }