Esempio n. 1
0
 public BaseRestService(IRestHandler restHandler, IFormat formator, IRestRequest restRequest)
 {
     _restHandler = restHandler;
     _formator = formator;
     _restRequest = restRequest;
     Initialize();
 }
Esempio n. 2
0
        public override string InitIO(string port)
        {
            _iniSettings = new IniSettings(HS);

            //_iniSettings.IniSettingsChangedForCheckInterval += IniSettingsChangedForCheckInterval;
            _iniSettings.IniSettingsChangedForUserNamePassword += IniSettingsChangedForUserNamePassword;;

            _log = new Log(HS, _iniSettings);

            _log.Info("Starting plugin");
            _config = new ConfigHandler(HS, Callback, _iniSettings, _log);
            _config.Register();

            _deviceHandler = new DeviceHandler(HS, _log);

            _settings = new Setting(HS);
            _settings.DoIniFileTemplateIfFileMissing();

            _restHandler = new RestHandler(_log);

            StartLoginAndDataFetchingInNewThread();

            Shutdown = false;
            _log.Debug("Done init io");
            return("");
        }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EntitlementService"/> class.
 /// </summary>
 /// <param name="serviceContext"></param>
 public EntitlementService(ServiceContext serviceContext)
 {
     ServiceContextValidation(serviceContext);
     this.serviceContext = serviceContext;
     restHandler         = new SyncRestHandler(this.serviceContext);
     // Set the Service type to QBO by calling a method.
     this.serviceContext.UseDataServices();
 }
Esempio n. 4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Batch"/> class.
 /// </summary>
 /// <param name="serviceContext">The service context.</param>
 /// <param name="restHandler">The rest handler.</param>
 internal RecurringTransactions(ServiceContext serviceContext, IRestHandler restHandler)
 {
     this.serviceContext           = serviceContext;
     this.restHandler              = restHandler;
     this.responseSerializer       = CoreHelper.GetSerializer(this.serviceContext, false);
     this.recurringTxnRequests     = new List <RecurringTransaction>();
     this.batchResponses           = new List <BatchItemResponse>();
     this.intuitBatchItemResponses = new List <IntuitBatchResponse>();
 }
Esempio n. 5
0
        /// <summary>
        /// GlobalTaxService class
        /// </summary>
        /// <param name="serviceContext">IPP Service Context</param>
        public GlobalTaxService(ServiceContext serviceContext)
        {
            ServiceContextValidation(serviceContext);
            this.serviceContext = serviceContext;
            this.restHandler    = new SyncRestHandler(this.serviceContext);

            // Set the Service type to either QBO by calling a method.
            this.serviceContext.UseDataServices();
        }
Esempio n. 6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Batch"/> class.
 /// </summary>
 /// <param name="serviceContext">The service context.</param>
 /// <param name="restHandler">The rest handler.</param>
 internal Batch(ServiceContext serviceContext, IRestHandler restHandler)
 {
     this.serviceContext           = serviceContext;
     this.restHandler              = restHandler;
     this.responseSerializer       = CoreHelper.GetSerializer(this.serviceContext, false);
     this.batchRequests            = new List <BatchItemRequest>();
     this.batchResponses           = new List <BatchItemResponse>();
     this.intuitBatchItemResponses = new List <IntuitBatchResponse>();
 }
        // Actual Responder
        public ActionResult Index(string version, string modelname, string parameters)
        {
            string data = string.Empty;

            // Key Api Key First
            string key = Request.QueryString["key"];
            ApiResponse <object> FailedKeyResponse = new ApiResponse <object>();

            if (!AuthenticateKey(key, FailedKeyResponse))
            {
                data = MerchantTribe.Web.Json.ObjectToJson(FailedKeyResponse);
            }
            else
            {
                // Create Handler
                IRestHandler handler = RestHandlerFactory.Instantiate(version, modelname, MTApp);

                // Read Posted JSON
                string postedString = string.Empty;
                Stream inputStream  = Request.InputStream;
                if (inputStream != null)
                {
                    StreamReader rdr = new StreamReader(inputStream);
                    postedString = rdr.ReadToEnd();
                }

                switch (Request.HttpMethod.ToUpperInvariant())
                {
                case "GET":
                    data = handler.GetAction(parameters, Request.QueryString);
                    break;

                case "POST":
                    data = handler.PostAction(parameters, Request.QueryString, postedString);
                    break;

                case "PUT":
                    data = handler.PutAction(parameters, Request.QueryString, postedString);
                    break;

                case "DELETE":
                    data = handler.DeleteAction(parameters, Request.QueryString, postedString);
                    break;
                }
            }

            // Return Result (or text formatted result)
            if (Request.QueryString["apiformat"] == "text")
            {
                return(new RawResult(data, "text/html"));
            }
            return(new PreJsonResult(data));
        }
Esempio n. 8
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="membershipService"></param>
        /// <param name="eventService"></param>
        /// <param name="restHandler"></param>
        /// <param name="webhookRepository"></param>
        public WebhookService(
            IMembershipService membershipService,
            IEventService eventService,
            IRestHandler restHandler,
            IWebhookRepository webhookRepository) : base(membershipService, webhookRepository)
        {
            this.eventService = eventService;
            this.restHandler  = restHandler;

            this.eventService.EventFired += EventServiceOnEventFired;

            this.OnCreated += this.WebhookCreatedEventHandler;
            this.OnUpdated += this.WebhookUpdatedEventHandler;
            this.OnDeleted += this.WebhookDeletedEventHandler;
        }
Esempio n. 9
0
        ///// <summary>
        ///// Collection of Not expressions.
        ///// </summary>
        //[Obsolete("Deprecated. Use QueryService->ExecuteIdsQuery")]
        //private IEnumerable<LinqExtender.Ast.Expression> notExpressions;

        #endregion

        /// <summary>
        /// Initializes a new instance of the QueryService class.
        /// </summary>
        /// <param name="serviceContext">The ServiceContext class.</param>
        public QueryService(ServiceContext serviceContext)
        {
            this.serviceContext = serviceContext;

            // Set the Service type to either QBO by calling a method.
            this.serviceContext.UseDataServices();

            this.restHandler        = new SyncRestHandler(this.serviceContext);
            this.responseSerializer = CoreHelper.GetSerializer(this.serviceContext, false);
            this.queryBuilder       = new StringBuilder();
            this.selectBuilder      = new StringBuilder();
            this.countBuilder       = new StringBuilder();
            this.orderByBuilder     = new StringBuilder();
            this.whereBuilder       = new StringBuilder();
            this.fromBuilder        = new StringBuilder();
            this.pageBuilder        = new StringBuilder();
            //this.notExpressions = new List<LinqExtender.Ast.Expression>();
        }
Esempio n. 10
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ertisAuthOptions"></param>
 /// <param name="restHandler"></param>
 public PasswordService(IErtisAuthOptions ertisAuthOptions, IRestHandler restHandler) : base(ertisAuthOptions, restHandler)
 {
 }
Esempio n. 11
0
 public static void Override(IRestHandler implementation)
 {
     (Current as RestHandler).Implementation = implementation;
 }
Esempio n. 12
0
 public BaseRestService(IRestHandler restHandler)
 {
     _restRequest = new RestRequest();
     _restHandler = restHandler;
     Initialize();
 }
Esempio n. 13
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="restHandler"></param>
 /// <param name="ip2LocationOptions"></param>
 public GeoLocationService(IRestHandler restHandler, IIp2LocationOptions ip2LocationOptions) : base(restHandler)
 {
     this.ip2LocationOptions = ip2LocationOptions;
 }
Esempio n. 14
0
 public PingDefault(PingEnv env, IRestHandler handler)
 {
     this.env     = env;
     this.handler = handler;
 }
Esempio n. 15
0
 public static string GetVerificationToken(this IRestHandler client)
 {
     return(client.GetCookies(new Uri(ChomikujBase.MainAddress))[3].Value);
 }
Esempio n. 16
0
 public void Setup()
 {
     this.restHandler = new SystemRestHandler();
 }
Esempio n. 17
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ertisAuthOptions"></param>
 /// <param name="restHandler"></param>
 public WebhookService(IErtisAuthOptions ertisAuthOptions, IRestHandler restHandler) : base(ertisAuthOptions, restHandler)
 {
 }
Esempio n. 18
0
 private RestHandler()
 {
     this.Implementation = new SystemRestHandler();
 }
Esempio n. 19
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ertisAuthOptions"></param>
 /// <param name="restHandler"></param>
 public ProviderService(IErtisAuthOptions ertisAuthOptions, IRestHandler restHandler) : base(ertisAuthOptions, restHandler)
 {
 }
Esempio n. 20
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ertisAuthOptions"></param>
 /// <param name="restHandler"></param>
 public MembershipService(IErtisAuthOptions ertisAuthOptions, IRestHandler restHandler) : base(restHandler)
 {
     this.AuthApiBaseUrl = ertisAuthOptions.BaseUrl;
 }
Esempio n. 21
0
 public FactRepository(IRestHandler restHandler, string queueName)
 {
     RestHandler = restHandler;
     QueueName   = queueName;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ertisAuthOptions"></param>
 /// <param name="restHandler"></param>
 protected MembershipBoundedService(IErtisAuthOptions ertisAuthOptions, IRestHandler restHandler) : base(restHandler)
 {
     this.BaseUrl      = ertisAuthOptions.BaseUrl;
     this.MembershipId = ertisAuthOptions.MembershipId;
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ertisAuthOptions"></param>
 /// <param name="restHandler"></param>
 public ActiveTokensService(IErtisAuthOptions ertisAuthOptions, IRestHandler restHandler) : base(ertisAuthOptions, restHandler)
 {
 }
Esempio n. 24
0
 public RestRequest(IRestHandler handler)
 {
     Handler = handler;
 }
Esempio n. 25
0
	    /// <summary>
	    /// Constructor
	    /// </summary>
	    /// <param name="ertisAuthOptions"></param>
	    /// <param name="restHandler"></param>
	    protected ReadonlyMembershipBoundedService(IErtisAuthOptions ertisAuthOptions, IRestHandler restHandler) : base(ertisAuthOptions, restHandler)
	    {
		    
	    }
Esempio n. 26
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ertisAuthOptions"></param>
 /// <param name="restHandler"></param>
 public RoleService(IErtisAuthOptions ertisAuthOptions, IRestHandler restHandler) : base(ertisAuthOptions, restHandler)
 {
 }
Esempio n. 27
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="restHandler"></param>
 protected BaseRestService(IRestHandler restHandler)
 {
     this.restHandler = restHandler;
 }
Esempio n. 28
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="ertisAuthOptions"></param>
 /// <param name="restHandler"></param>
 public ApplicationService(IErtisAuthOptions ertisAuthOptions, IRestHandler restHandler) : base(ertisAuthOptions, restHandler)
 {
 }