TypedRest for .NET 1.3.6
build type-safe fluent-style REST API clients
TypedRest.Endpoints.Rpc.IFunctionEndpoint< in in TEntity, TResult > Interface Template Reference

RPC endpoint that takes TEntity as input and returns TResult as output when invoked. More...

Inheritance diagram for TypedRest.Endpoints.Rpc.IFunctionEndpoint< in in TEntity, TResult >:
TypedRest.Endpoints.Rpc.IRpcEndpoint TypedRest.Endpoints.IEndpoint

Public Member Functions

Task< TResult > InvokeAsync (TEntity entity, CancellationToken cancellationToken=default)
 Invokes the function. More...
 
- Public Member Functions inherited from TypedRest.Endpoints.Rpc.IRpcEndpoint
Task ProbeAsync (CancellationToken cancellationToken=default)
 Queries the server about capabilities of the endpoint without performing any action. More...
 
- Public Member Functions inherited from TypedRest.Endpoints.IEndpoint
IReadOnlyList<(Uri uri, string? title)> GetLinks (string rel)
 Resolves all links with a specific relation type. Uses cached data from last response. More...
 
Uri Link (string rel)
 Resolves a single link with a specific relation type. Uses cached data from last response if possible. Tries lazy lookup with HTTP HEAD on cache miss. More...
 
Uri LinkTemplate (string rel, IDictionary< string, object > variables)
 Resolves a link template with a specific relation type. Uses cached data from last response if possible. Tries lazy lookup with HTTP HEAD on cache miss. More...
 
Uri LinkTemplate (string rel, object variables)
 Resolves a link template with a specific relation type. More...
 

Additional Inherited Members

- Properties inherited from TypedRest.Endpoints.Rpc.IRpcEndpoint
bool? InvokeAllowed [get]
 Shows whether the server has indicated that the invoke method is currently allowed. More...
 
- Properties inherited from TypedRest.Endpoints.IEndpoint
Uri Uri [get]
 The HTTP URI of the remote resource.
 
HttpClient HttpClient [get]
 The HTTP client used to communicate with the remote resource.
 
MediaTypeFormatter Serializer [get]
 Controls the serialization of entities sent to and received from the server.
 
IErrorHandler ErrorHandler [get]
 Handles errors in responses.
 
ILinkExtractor LinkExtractor [get]
 Extracts links from responses.
 

Detailed Description

RPC endpoint that takes TEntity as input and returns TResult as output when invoked.

Template Parameters
TEntityThe type of entity the endpoint takes as input.
TResultThe type of entity the endpoint returns as output.

Member Function Documentation

◆ InvokeAsync()

Task< TResult > TypedRest.Endpoints.Rpc.IFunctionEndpoint< in in TEntity, TResult >.InvokeAsync ( TEntity  entity,
CancellationToken  cancellationToken = default 
)

Invokes the function.

Parameters
entityThe TEntity to post as input.
cancellationTokenUsed to cancel the request.
Returns
The TResult returned by the server.
Exceptions
AuthenticationExceptionHttpStatusCode.Unauthorized
UnauthorizedAccessExceptionHttpStatusCode.Forbidden
KeyNotFoundExceptionHttpStatusCode.NotFound or HttpStatusCode.Gone
HttpRequestExceptionOther non-success status code.

The documentation for this interface was generated from the following file: