Table of Contents

Class CliEndpointProvider<T>

Namespace
TypedRest.CommandLine
Assembly
TypedRest.CommandLine.dll

Builds EntryEndpoints using config files, interactive authentication, OAuth tokens, etc.

public class CliEndpointProvider<T> : EndpointProviderBase<T>, IEndpointProvider<T> where T : EntryEndpoint

Type Parameters

T

The type of entry endpoint to be created. Must have a constructor with the following signature: (Uri)

Inheritance
CliEndpointProvider<T>
Implements
Inherited Members

Properties

Console

The text input/output device used for user interaction.

public IConsole Console { get; set; }

Property Value

IConsole

Methods

RequestToken(Uri)

Asks the user or a service for the OAuth token to present as a "Bearer" to the REST API.

protected override string RequestToken(Uri uri)

Parameters

uri Uri

Returns

string

The OAuth token or null if it cannot be requested.

RequestUri()

Asks the user or a service for the base URI of the REST API.

protected override Uri RequestUri()

Returns

Uri

The endpoint URI or null if it cannot be requested.

ShowTokenProvider(Uri)

Tries to determine a website that provides tokens for uri and opens it in the default browser.

protected virtual void ShowTokenProvider(Uri uri)

Parameters

uri Uri