C# Class BridgeStack.ApiEndpointBuilder

Tasked with building endpoint URI strings to the different methods exposed by the API.
Inheritance: IApiEndpointBuilder
Show file Open project: bevacqua/BridgeStack

Public Methods

Method Description
ApiEndpointBuilder ( IStackClient client, ApiMethodEnum method, string appKey = null, string accessToken = null ) : System

Instances the ApiEndpointBuilder. appKey and accessToken aren't actually required parameters.

Params ( IQuery parameters ) : IApiEndpointBuilder

Assigns Query fluently.

ToString ( ) : string

Overrides the default ToString method call with a method call that actually builds the endpoint.

Vectorized ( ICollection vectors ) : IApiEndpointBuilder

Assigns Vectors fluently.

Private Methods

Method Description
ApiEndpointBuilder ( ) : System

Instances the ApiEndpointBuilder without setting any of the required parameters.

Build ( ) : string

Builds and returns the target endpoint Uri.

BuildParameters ( ) : string

Builds query string parameters, optionally appends authentication parameters.

GetAuthenticationParameters ( ) : string

Appends the application key and access token to the query string parameters. Both of these parameters are optional to the ApiEndpointBuilder.

GetQueryStringParameters ( ) : string

Through reflection, lists the query string parameters, verifies they are conform to constraint attributes, and returns the deserialized version of them.

Method Details

ApiEndpointBuilder() public method

Instances the ApiEndpointBuilder. appKey and accessToken aren't actually required parameters.
public ApiEndpointBuilder ( IStackClient client, ApiMethodEnum method, string appKey = null, string accessToken = null ) : System
client IStackClient The Stack Exchange client that owns this API endpoint builder.
method ApiMethodEnum The API method to target.
appKey string The application's key. Grants a higher request quota.
accessToken string The user's access token. Grants authentication and access to methods which require that the application be acting on behalf of a user in order to be invoked.
return System

Params() public method

Assigns Query fluently.
public Params ( IQuery parameters ) : IApiEndpointBuilder
parameters IQuery The value.
return IApiEndpointBuilder

ToString() public method

Overrides the default ToString method call with a method call that actually builds the endpoint.
public ToString ( ) : string
return string

Vectorized() public method

Assigns Vectors fluently.
public Vectorized ( ICollection vectors ) : IApiEndpointBuilder
vectors ICollection The value.
return IApiEndpointBuilder