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
- See Also
DefaultResolveRecursion
Default recursion depth for Resolve<T>(Linkable<T>, int?, CancellationToken) and Resolve<T>(LinkableList<T>, int?, CancellationToken)
[Range(0, 2147483647)]
int DefaultResolveRecursion { get; set; }
Property Value
- 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
uriUriURI to the object
maxRecursionint?Maximum depth to recurse while populating the returned object. Defaults to DefaultGetRecursion.
cancellationTokenCancellationTokenOptional cancellation token
Returns
- Task<T>
Returns the object
Type Parameters
TType 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
linkablesLinkableList<T>List of linkables to resolve
maxRecursionint?Maximum depth to recurse while populating the returned objects. DefaultResolveRecursion.
cancellationTokenCancellationTokenOptional cancellation token
Returns
Type Parameters
TType 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
linkableLinkable<T>Linkable to resolve
maxRecursionint?Maximum depth to recurse while populating the returned object. DefaultResolveRecursion.
cancellationTokenCancellationTokenOptional cancellation token
Returns
- Task<T>
Returns the object
Type Parameters
TType of object to return. The actual returned object may be a subclass of
.T