Skip to content

Instantly share code, notes, and snippets.

@mouadcherkaoui
Created June 25, 2019 16:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mouadcherkaoui/deb2317b401915f725627a983a50a934 to your computer and use it in GitHub Desktop.
Save mouadcherkaoui/deb2317b401915f725627a983a50a934 to your computer and use it in GitHub Desktop.
public interface IFluentApiDefinition
{
IFluentEndpoint HasEndpointUri(string endpoint);
}
public interface IFluentEndpoint
{
IWithVersion OfVersion(string apiVersion);
}
public interface IWithVersion
{
IWithVersion WithSubscriptionKey(string SubscriptionKey);
IWithMethod AndMethod(string method);
}
public interface IWithMethod
{
IWithContentType WithContentType(string ContentType);
IWithHeaders WithHeaders(Dictionary<string, string> headers);
IWithParameters WithParameters(Dictionary<string, string> headers);
TResponse ProcessRequest<TRequest, TResponse>(TRequest request);
}
public interface IWithHeaders
{
IWithHeaders AndContentType(string ContentType);
IWithHeaders AndParameters(Dictionary<string, string> headers);
TResponse ProcessRequest<TRequest, TResponse>();
}
public interface IWithParameters
{
IWithContentTypeAndParameters AndContentType(string ContentType);
IWithHeadersAndParameters AndHeaders(Dictionary<string, string> ContentType);
TResponse ProcessRequest<TRequest, TResponse>();
}
public interface IWithContentType
{
IWithContentTypeAndParameters AndParameters(Dictionary<string, string> ContentType);
IWithContentTypeAndHeaders AndHeaders(Dictionary<string, string> ContentType);
TResponse ProcessRequest<TRequest, TResponse>();
}
public interface IWithContentTypeAndHeaders
{
IDefinedMethod AndParameters(Dictionary<string, string> headers);
TResponse ProcessRequest<TRequest, TResponse>();
}
public interface IWithContentTypeAndParameters
{
IDefinedMethod AndHeaders(Dictionary<string, string> headers);
TResponse ProcessRequest<TRequest, TResponse>();
}
public interface IWithHeadersAndParameters
{
IDefinedMethod AndContentType(string contentType);
TResponse ProcessRequest<TRequest, TResponse>();
}
public interface IDefinedMethod
{
TResponse ProcessRequest<TRequest, TResponse>();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment