/// <summary> /// Retrieves a list of all suppliers. /// </summary> /// <param name="query">The query.</param> /// <param name="token">The cancellation token.</param> /// <returns> /// A task that represents the asynchronous operation. /// The task result contains the list of suppliers. /// </returns> public async Task <Types.PagedList <Supplier> > GetListAsync(Query <Supplier, SupplierFilter> query, CancellationToken token = default) { var jsonModel = await GetListAsync <SupplierListWrapper>($"/api/{EntityUrlFragment}", QueryString.For(query), token).ConfigureAwait(false); return(jsonModel.ToDomain()); }
public async Task <Types.PagedList <InboxDocument> > GetListAsync(CancellationToken token = default) { var jsonModel = await GetListAsync <InboxDocumentListWrapper>($"/api/{EntityUrlFragment}", QueryString.For((Query <InboxDocument, InboxDocumentFilter>)null), token).ConfigureAwait(false); return(jsonModel.ToDomain()); }
/// <summary> /// Retrieves the tag list for specific articles. /// </summary> /// <param name="query">The filter and sort options.</param> /// <param name="token">The cancellation token.</param> /// <returns></returns> public async Task <Types.PagedList <ArticleTag> > GetTagListAsync(Query <ArticleTag, ArticleTagFilter> query, CancellationToken token = default(CancellationToken)) { if (query?.Filter == null) { throw new ArgumentException("filter has to be set", nameof(query)); } var jsonModel = await GetListAsync <ArticleTagListWrapper>("/api/article-tags", QueryString.For(query), token).ConfigureAwait(false); return(jsonModel.ToDomain()); }
/// <summary> /// Retrieves a list of articles. /// </summary> /// <param name="query">The filter and sort options.</param> /// <param name="token">The cancellation token.</param> /// <returns></returns> public async Task <Types.PagedList <Article> > GetListAsync(Query <Article, ArticleFilter> query, CancellationToken token = default(CancellationToken)) { var jsonModel = await GetListAsync <ArticleListWrapper>("/api/articles", QueryString.For(query), token).ConfigureAwait(false); return(jsonModel.ToDomain()); }
/// <summary> /// Retrieves a list of all properties. /// </summary> /// <param name="query">The query.</param> /// <param name="token">The token.</param> /// <returns> /// A task that represents the asynchronous operation. /// The task result returns the client property list. /// </returns> /// <exception cref="NotAuthorizedException">Thrown when not authorized to access this resource.</exception> public async Task <Types.PagedList <ClientProperty> > GetPropertyListAsync(Query <ClientProperty, ClientPropertyFilter> query, CancellationToken token = default) { var jsonModel = await GetListAsync <ClientPropertyListWrapper>("/api/client-property-values", QueryString.For(query), token).ConfigureAwait(false); return(jsonModel.ToDomain()); }
/// <summary> /// Retrieves a list of units and applies the filter. /// </summary> /// <param name="query">The query.</param> /// <param name="token">The cancellation token.</param> /// <returns> /// A task that represents the asynchronous operation. /// The task result contains the list of units. /// </returns> public async Task <Types.PagedList <Unit> > GetListAsync(Query <Unit, UnitFilter> query, CancellationToken token = default) { var jsonModel = await GetListAsync <UnitListWrapper>("/api/units", QueryString.For(query), token).ConfigureAwait(false); return(jsonModel.ToDomain()); }
/// <summary> /// Retrieves a list of all incoming invoices. /// </summary> /// <param name="query">The query.</param> /// <param name="token">The cancellation token.</param> /// <returns> /// A task that represents the asynchronous operation. /// The task result contains the list of incoming invoices. /// </returns> public async Task <Types.PagedList <PurchaseInvoice> > GetListAsync(Query <PurchaseInvoice, PurchaseInvoiceFilter> query, CancellationToken token) { var jsonModel = await GetListAsync <IncomingListWrapper>($"/api/{EntityUrlFragment}", QueryString.For(query), token).ConfigureAwait(false); return(jsonModel.ToDomain()); }
/// <summary> /// Retrieves a list of invoice payments appropriate to the filter. /// </summary> /// <param name="query">The filter with the property and value</param> /// <param name="token">The cancellation token.</param> /// <returns> /// A task that represents the asynchronous operation. /// The task result contains the invoice payment list. /// </returns> /// <exception cref="ArgumentException">Thrown when the parameter check fails.</exception> /// <exception cref="NotAuthorizedException">Thrown when not authorized to access this resource.</exception> /// <exception cref="NotFoundException">Thrown when the resource url could not be found.</exception> public async Task <Types.PagedList <InvoicePayment> > GetPaymentListAsync(Query <InvoicePayment, InvoicePaymentFilter> query, CancellationToken token = default) { var jsonModel = await GetListAsync <InvoicePaymentListWrapper>("/api/invoice-payments", QueryString.For(query), token).ConfigureAwait(false); return(jsonModel.ToDomain()); }
/// <summary> /// Retrieves a list of invoice comments appropriate to the filter. /// </summary> /// <param name="query">The filter.</param> /// <param name="token">The token.</param> /// <returns> /// A task that represents the asynchronous operation. /// The task result contains the filtered list of invoice comment. /// </returns> /// <exception cref="ArgumentException">Thrown when the parameter check fails.</exception> /// <exception cref="NotAuthorizedException">Thrown when not authorized to access this resource.</exception> /// <exception cref="NotFoundException">Thrown when the resource url could not be found.</exception> public async Task <Types.PagedList <InvoiceComment> > GetCommentListAsync(Query <InvoiceComment, InvoiceCommentFilter> query, CancellationToken token = default) { if (query == null) { throw new ArgumentNullException(nameof(query)); } if (query.Filter?.InvoiceId.GetValueOrDefault(0) <= 0) { throw new ArgumentException("a required value of the filter invalid", nameof(query)); } var jsonModel = await GetListAsync <InvoiceCommentListWrapper>("/api/invoice-comments", QueryString.For(query), token).ConfigureAwait(false); return(jsonModel.ToDomain()); }