Search Results for

    Show / Hide Table of Contents

    Class ProductClient

    Read-only access to PAPI products. Obtain it from Products.

    Inheritance
    object
    ProductClient
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    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
    Type Description
    int

    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
    Type Name Description
    ProductQuery query

    Filters; All for everything.

    int page

    0-based page number (as PAPI's pageNo).

    int pageSize

    Page size, 1 to MaxPageSize.

    CancellationToken cancellationToken

    Cancellation.

    Returns
    Type Description
    Task<ProductPage>
    | 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
    Type Name Description
    ProductQuery query
    CancellationToken cancellationToken
    Returns
    Type Description
    IAsyncEnumerable<Product>
    | 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
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    IAsyncEnumerable<Product>
    | 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
    Type Name Description
    string id
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<Product>
    | 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
    Type Name Description
    IEnumerable<string> ids
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<IReadOnlyList<Product>>
    | 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
    Type Name Description
    string number
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<Product>
    | 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
    Type Name Description
    IEnumerable<string> numbers
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<IReadOnlyList<Product>>
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX