Table of Contents

Interface IActivityPubClient

Namespace
ActivityPub.Client
Assembly
ActivityPub.Client.dll

Client for accessing resources over ActivityPub

public interface IActivityPubClient : IDisposable
Inherited Members

Properties

DefaultGetRecursion

Default recursion depth for Get<T>(Uri, int?, CancellationToken).

[Range(0, 2147483647)]
int DefaultGetRecursion { get; set; }

Property Value

int
See Also

DefaultResolveRecursion

[Range(0, 2147483647)]
int DefaultResolveRecursion { get; set; }

Property Value

int
See Also

Methods

Get<T>(Uri, int?, CancellationToken)

Retrieves and validates an ActivityPub object. Links are automatically followed, up to

maxRecursion
layers of recursion.
Task<T> Get<T>(Uri uri, int? maxRecursion = null, CancellationToken cancellationToken = default) where T : ASType

Parameters

uri Uri

URI to the object

maxRecursion int?

Maximum depth to recurse while populating the returned object. Defaults to DefaultGetRecursion.

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<T>

Returns the object

Type Parameters

T

Type of object to return. The actual returned object may be a subclass of

T
.

Resolve<T>(LinkableList<T>, int?, CancellationToken)

Resolves a LinkableList<T> to objects. Each linkable is resolved using Resolve<T>(Linkable<T>, int?, CancellationToken).

Task<List<T>> Resolve<T>(LinkableList<T> linkables, int? maxRecursion = null, CancellationToken cancellationToken = default) where T : ASObject

Parameters

linkables LinkableList<T>

List of linkables to resolve

maxRecursion int?

Maximum depth to recurse while populating the returned objects. DefaultResolveRecursion.

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<List<T>>

Returns a list of resolved objects.

Type Parameters

T

Type of objects to return. The actual returned objects may be subclasses of

T
.

Resolve<T>(Linkable<T>, int?, CancellationToken)

Resolves a Linkable<T> to an object. If the linkable has an object, then its returned. If it has a link, then the link is retrieved using Get<T>(Uri, int?, CancellationToken).

Task<T> Resolve<T>(Linkable<T> linkable, int? maxRecursion = null, CancellationToken cancellationToken = default) where T : ASObject

Parameters

linkable Linkable<T>

Linkable to resolve

maxRecursion int?

Maximum depth to recurse while populating the returned object. DefaultResolveRecursion.

cancellationToken CancellationToken

Optional cancellation token

Returns

Task<T>

Returns the object

Type Parameters

T

Type of object to return. The actual returned object may be a subclass of

T
.