/// <summary> /// Create a LevelUp client interface with a custom request engine /// </summary> /// <remarks> /// Use this only if you need to override certain behaviors in the way that /// the SDK makes calls into the levelup platform. Otherwise, use the /// standard Create<T> overload, which will use the default LevelUp /// implementation classes. /// </remarks> /// <typeparam name="T">The type of LevelUp client interface to generate.</typeparam> /// <param name="engine">An IRequestVisitor that can make calls to the /// LevelUp API for each type of request object.</param> /// <returns>The LevelUp client interface of the specified type T.</returns> public static T Create <T>(IRequestVisitor <IResponse> engine) where T : ILevelUpClientModule { var client = new LevelUpClient(engine); return((T)(object)client); }
public RequestExecutionEngine(IRestfulService restService, AgentIdentifier identifier, IRequestVisitor <string> endpointCreator, IRequestVisitor <string> headerTokenCreator, IRequestVisitor <Dictionary <HttpStatusCode, LevelUpRestWrapper.ResponseAction> > customHttpStatusCodeHandlers) { _restWrapper = new LevelUpRestWrapper(restService, identifier); _endpointCreator = endpointCreator; _headerTokenCreator = headerTokenCreator; _customHttpStatusCodeHandlers = customHttpStatusCodeHandlers; }
internal LevelUpClient(IRequestVisitor <IResponse> requestExecutionEngine) { if (requestExecutionEngine == null) { throw new ArgumentNullException("The LevelUpClient constructor requires a " + "non-null IRequestVisitor<Response>"); } _engine = requestExecutionEngine; }
/// <summary> /// Acceptance method for Request visitors. /// </summary> public override T Accept <T>(IRequestVisitor <T> visitor) { return(visitor.Visit(this)); }
/// <summary> /// Accept method required for visitor pattern. /// </summary> public abstract T Accept <T>(IRequestVisitor <T> visitor);
public override T Accept <T>(IRequestVisitor <T> visitor) { throw new NotImplementedException(); }