Class ProductClient
Read-only access to PAPI products. Obtain it from Products.
Inheritance
ProductClient
Namespace: Activout.Blue5
Assembly: Activout.Blue5.dll
Syntax
public sealed class ProductClient
Fields
|
Edit this page
View Source
MaxPageSize
Largest page PAPI accepts for /products/list (observed: "itemsPerPage cannot be greater than the max value of 50").
Declaration
public const int MaxPageSize = 50
Field Value
Methods
|
Edit this page
View Source
Find(ProductQuery, int, int, CancellationToken)
Searches products and returns one page, including the total match count.
Declaration
public Task<ProductPage> Find(ProductQuery query, int page = 0, int pageSize = 50, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
FindAll(ProductQuery, CancellationToken)
Streams every product matching query, walking search pages lazily.
Declaration
public IAsyncEnumerable<Product> FindAll(ProductQuery query, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
GetAll(CancellationToken)
Streams every product in the context using PAPI's cursor API. Pages of 100 are fetched only as enumeration
needs them, so GetAll().Take(10) makes a single request.
Declaration
public IAsyncEnumerable<Product> GetAll(CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
GetById(string, CancellationToken)
Gets a product by its PAPI id (Id), or null if it is not published in this context.
Declaration
public Task<Product?> GetById(string id, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
GetByIds(IEnumerable<string>, CancellationToken)
Gets the products with the given PAPI ids (Id, as found in other products' references).
Ids that do not exist are simply absent from the result. Large inputs are split into batches of 100 (the PAPI limit).
Declaration
public Task<IReadOnlyList<Product>> GetByIds(IEnumerable<string> ids, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
GetByNumber(string, CancellationToken)
Gets a product by its number, or null if it is not published in this context.
Declaration
public Task<Product?> GetByNumber(string number, CancellationToken cancellationToken = default)
Parameters
Returns
|
Edit this page
View Source
GetByNumbers(IEnumerable<string>, CancellationToken)
Gets the products with the given numbers. Numbers that do not exist are simply absent from the result.
Large inputs are split into batches of 100 (the PAPI limit).
Declaration
public Task<IReadOnlyList<Product>> GetByNumbers(IEnumerable<string> numbers, CancellationToken cancellationToken = default)
Parameters
Returns