Esempio n. 1
0
 public Handler()
 {
     _slackService     = new SlackService();
     _dynamoRepository = new DynamoRepository();
     _slackMessage     = new SlackMessage(_dynamoRepository); //hacky...
     _eventIdList      = new List <EventId>();
 }
Esempio n. 2
0
 public Communicator(ILogger <Communicator> logger, Mapper mapper, ISlackService slackService)
 {
     client = new HttpClient {
         Timeout = TimeSpan.FromSeconds(15)
     };
     this.logger                 = logger;
     this.mapper                 = mapper;
     this.slackService           = slackService;
     statsCache                  = new();
     patientsCache               = new();
     hospitalsCache              = new();
     hospitalsListCache          = new();
     municipalitiesListCache     = new();
     retirementHomesListCache    = new();
     retirementHomesCache        = new();
     municipalityCache           = new();
     regionCasesCache            = new();
     healthCentersDayCache       = new();
     statsWeeklyDayCache         = new();
     owidCountriesCache          = new();
     monthlyDeathsSloveniaCache  = new();
     labTestsCache               = new();
     dailyDeathsSloveniaCache    = new();
     ageDailyDeathsSloveniaCache = new();
     sewageCache                 = new();
     schoolCasesCache            = new();
     schoolAbsencesCache         = new();
     schoolRegimesCache          = new();
     vaccinationsCache           = new();
     summaryCache                = new SummaryCache(default, default, default, default, default, default, default);
Esempio n. 3
0
 public SlackController(IRestaurantService restaurantService, ISlackService slackService, IStorageService storageService, ILogger <SlackController> log)
 {
     RestaurantService = restaurantService;
     SlackService      = slackService;
     StorageService    = storageService;
     Log = log;
 }
Esempio n. 4
0
        public SlackNotifyer(IServiceProvider serviceProvider)
        {
            this._slackService = serviceProvider.GetService <ISlackService>();
            var configuration = serviceProvider.GetService <IConfiguration>();

            this._webHookUrl = configuration["Slack:WebHookUrl"];
        }
Esempio n. 5
0
 public Communicator(ILogger <Communicator> logger, Mapper mapper, ISlackService slackService)
 {
     client = new HttpClient {
         Timeout = TimeSpan.FromSeconds(15)
     };
     this.logger                 = logger;
     this.mapper                 = mapper;
     this.slackService           = slackService;
     statsCache                  = new ArrayEndpointCache <StatsDaily>();
     regionCache                 = new ArrayEndpointCache <RegionsDay>();
     patientsCache               = new ArrayEndpointCache <PatientsDay>();
     hospitalsCache              = new ArrayEndpointCache <HospitalsDay>();
     hospitalsListCache          = new ArrayEndpointCache <Hospital>();
     municipalitiesListCache     = new ArrayEndpointCache <Municipality>();
     retirementHomesListCache    = new ArrayEndpointCache <RetirementHome>();
     retirementHomesCache        = new ArrayEndpointCache <RetirementHomesDay>();
     deceasedPerRegionsDayCache  = new ArrayEndpointCache <DeceasedPerRegionsDay>();
     municipalityDayCache        = new ArrayEndpointCache <MunicipalityDay>();
     healthCentersDayCache       = new ArrayEndpointCache <HealthCentersDay>();
     statsWeeklyDayCache         = new ArrayEndpointCache <StatsWeeklyDay>();
     owidCountriesCache          = new DictionaryEndpointCache <string, Models.Owid.Country>();
     monthlyDeathsSloveniaCache  = new ArrayEndpointCache <MonthlyDeathsSlovenia>();
     labTestsCache               = new ArrayEndpointCache <LabTestDay>();
     dailyDeathsSloveniaCache    = new ArrayEndpointCache <DailyDeathsSlovenia>();
     ageDailyDeathsSloveniaCache = new ArrayEndpointCache <AgeDailyDeathsSloveniaDay>();
     errors = new ConcurrentDictionary <string, object>();
 }
 public CeoPersonaAsistantService(ISlackService slackService, IFirebaseService firebaseService
                                  , IConfiguration configuration)
 {
     _slackService    = slackService;
     _firebaseService = firebaseService;
     _ceoMemberId     = configuration["SlackSettings:CeoMemberId"];
 }
Esempio n. 7
0
 public TaskRepeater(ILogger <TaskRepeater> logger, IQueuingService queuingService, ISapService sapService, ISlackService slackService)
 {
     _logger         = logger;
     _queuingService = queuingService;
     _sapService     = sapService;
     _slackService   = slackService;
 }
Esempio n. 8
0
 public JwtSecurity(UserManager <Dal.Entities.Identity.ApplicationUser> userManager, ILogger <JwtSecurity> logger, IMapper mapper, IEmailService emailService, ISlackService slackService)
 {
     _userManager  = userManager;
     _logger       = logger;
     _mapper       = mapper;
     _emailService = emailService;
     _slackService = slackService;
 }
Esempio n. 9
0
 public RunCommand(IMediator mediator, IIdGenerator <long> idGenerator, ISystemClock clock, ISlackService slackService, ILogger <RunCommand> logger) : base(slackService)
 {
     _mediator     = mediator;
     _idGenerator  = idGenerator;
     _clock        = clock;
     _slackService = slackService;
     _logger       = logger;
 }
Esempio n. 10
0
 public SlackController(ICommandRunner commandRunner, ISlackService slackService,
                        ISlackMessageVerifier messageVerifier, ILogger <SlackController> logger)
 {
     _commandRunner   = commandRunner;
     _slackService    = slackService;
     _messageVerifier = messageVerifier;
     _logger          = logger;
 }
 public ContractNotificationService(IESIService esiService, IMapper mapper,
                                    IDiscordService discordService, ISlackService slackService, IDataStorageService dataStorageService)
 {
     _esiService         = esiService;
     _mapper             = mapper;
     _slackService       = slackService;
     _discordService     = discordService;
     _dataStorageService = dataStorageService;
 }
Esempio n. 12
0
        public SlackNotifyerTest()
        {
            this._stubSlackService  = Substitute.For <ISlackService>();
            this._stubConfiguration = Substitute.For <IConfiguration>();

            this._stubServiceProvider = Substitute.For <IServiceProvider>();
            this._stubServiceProvider.GetService <ISlackService>().Returns(this._stubSlackService);
            this._stubServiceProvider.GetService <IConfiguration>().Returns(this._stubConfiguration);
        }
Esempio n. 13
0
        public SlackNotifyer(IServiceProvider serviceProvider)
        {
            _slackService = serviceProvider.GetService <ISlackService>();
            var configuration = serviceProvider.GetService <IConfiguration>();

            _webHookUrl = configuration["Slack:WebHookUrl"];

            _slackGroupIdDictionary = configuration.GetSection("Slack:GroupId").Get <Dictionary <string, string> >();
        }
Esempio n. 14
0
 public SlackTenant(
     ILogger logger,
     ISlackService slackService,
     IComponentContext componentContext)
 {
     _logger = logger;
     _slackService = slackService;
     _componentContext = componentContext;
 }
 public BusinessPartnerController(
     ILogger <BusinessPartnerController> logger,
     IBusinessPartnerService businessPartnerService,
     ISlackService slackService)
 {
     _logger = logger;
     _businessPartnerService = businessPartnerService;
     _slackService           = slackService;
 }
Esempio n. 16
0
 public SlackTenant(
     ILogger logger,
     ISlackService slackService,
     IComponentContext componentContext)
 {
     _logger           = logger;
     _slackService     = slackService;
     _componentContext = componentContext;
 }
Esempio n. 17
0
 public Worker(ILogger <Worker> logger, IServiceScopeFactory serviceScopeFactory, ISlackService serviceSlack)
 {
     _logger = logger;
     _serviceScopeFactory = serviceScopeFactory;
     _schedule            = CrontabSchedule.Parse(Schedule, new CrontabSchedule.ParseOptions {
         IncludingSeconds = true
     });
     _nextRun      = _schedule.GetNextOccurrence(DateTime.Now);
     _serviceSlack = serviceSlack;
 }
Esempio n. 18
0
        public LimboAction(IServiceProvider services, LimboSettings settings)
        {
            this.Settings = settings;

            this.GitHub = services.GetService <IGitHubService>();
            this.GitHub.SetCredentials(settings.GitHubUsername, settings.GitHubPersonalAccessToken);
            this.GitHub.BaseAddress = settings.GithubApiBaseUrl;

            this.Slack = services.GetService <ISlackService>();
            this.Slack.SetCredentials(settings.SlackBotApiToken);
        }
Esempio n. 19
0
 public App(
     ISlackService slack,
     IStatisticsService statistics,
     IOptions <AppSettings> config,
     ILogger <App> logger)
 {
     _slack      = slack;
     _statistics = statistics;
     _logger     = logger;
     _config     = config.Value;
 }
 public SlackMemberJoinedCapabilityDomainEventHandler(
     ILogger <SlackMemberJoinedCapabilityDomainEventHandler> logger,
     ISlackFacade slackFacade,
     ICapabilityRepository capabilityRepository,
     ISlackService slackService)
 {
     _logger               = logger;
     _slackFacade          = slackFacade;
     _capabilityRepository = capabilityRepository;
     _slackService         = slackService;
 }
Esempio n. 21
0
 public GitHubController(
     IDataStore dataStore,
     IGitHubService gitHubService,
     ISlackService slackService,
     IDevOpsService devOpsService)
 {
     this.dataStore = dataStore;
     _gitHubService = gitHubService;
     _slackService  = slackService;
     _devOpsService = devOpsService;
 }
Esempio n. 22
0
 public EntitySubscriber(
     ICapturedRouterUrlHelper capturedRouterUrlHelper,
     ILogger <EntitySubscriber> logger,
     ISlackService slackService,
     IBroker broker)
 {
     _capturedRouterUrlHelper = capturedRouterUrlHelper;
     _slackService            = slackService;
     _broker = broker;
     _logger = logger;
 }
Esempio n. 23
0
 public JobsController(IJobsService jobsService, ICategoriesService categoriesService, IHireTypesService hiretypesService, ITwitterService twitterService, LegacyApiClient apiClient, IConfiguration configuration, ICompaniesService companiesService, ISlackService slackService)
 {
     _jobsService       = jobsService;
     _categoriesService = categoriesService;
     _hiretypesService  = hiretypesService;
     _twitterService    = twitterService;
     _apiClient         = apiClient;
     _configuration     = configuration;
     _companiesService  = companiesService;
     _slackService      = slackService;
 }
        public SlackIntegration(SlackIntegrationConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration),
                                                "Slack Integration configuration has not been provided.");
            }

            _configuration = configuration;
            _slackService  = _configuration.SlackServiceProvider();
        }
Esempio n. 25
0
        public SlackIntegration(SlackIntegrationConfiguration configuration)
        {
            if (configuration == null)
            {
                throw new ArgumentNullException(nameof(configuration),
                    "Slack Integration configuration has not been provided.");
            }

            _configuration = configuration;
            _slackService = _configuration.SlackServiceProvider();
        }
Esempio n. 26
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app, ISlackService slackService, ICommunicator communicator)
        {
            if (env.IsDevelopment())
            {
                app.UseDeveloperExceptionPage();
            }

            app.UseRouting();
            app.UseCors(CorsPolicy);
            app.UseResponseCompression();
            app.UseResponseCaching();

            app.UseAuthorization();
            app.Use(async(context, next) =>
            {
                context.Response.Headers.Add("SchemaVersion", SchemaVersion);
                context.Response.GetTypedHeaders().CacheControl =
                    new Microsoft.Net.Http.Headers.CacheControlHeaderValue()
                {
                    Public = true,
                    MaxAge = System.TimeSpan.FromSeconds(10)
                };
                context.Response.Headers[Microsoft.Net.Http.Headers.HeaderNames.Vary] =
                    new string[] { "Accept-Encoding" };
                await next.Invoke();
            });
            // Register the Swagger generator and the Swagger UI middleware
            app.UseOpenApi();
            app.UseSwaggerUi3();

            // notifies slack when an exception occurs
            app.UseExceptionHandler(errorApp =>
            {
                errorApp.Run(async context =>
                {
                    //var exceptionHandlerPathFeature = context.Features.Get<IExceptionHandlerPathFeature>();
                    //var exception = exceptionHandlerPathFeature?.Error;
                    try
                    {
                        await slackService.SendNotificationAsync($"DATA API REST service failed on {context.Request?.Path}", CancellationToken.None);
                    }
                    catch
                    { }
                });
            });

            app.UseEndpoints(endpoints =>
            {
                endpoints.MapMetrics();
                endpoints.MapControllers();
            });
        }
Esempio n. 27
0
 public EntityReplySubscriber(
     ICapturedRouterUrlHelper capturedRouterUrlHelper,
     ILogger <EntitySubscriber> logger,
     IEntityStore <Question> entityStore,
     ISlackService slackService,
     IBroker broker)
 {
     _capturedRouterUrlHelper = capturedRouterUrlHelper;
     _slackService            = slackService;
     _entityStore             = entityStore;
     _broker = broker;
     _logger = logger;
 }
Esempio n. 28
0
 public NotificationService(
     ILogger <NotificationService> logger,
     IConfiguration config,
     IDataContext context,
     IEmailService email,
     ISlackService slack
     )
 {
     _logger  = logger;
     _config  = config;
     _context = context;
     _email   = email;
     _slack   = slack;
 }
Esempio n. 29
0
        public ConnectionsController(
            IQueryHandler <FindConnectionsByClientTypeClientIdChannelTypeChannelId, IEnumerable <Connection> >
            findConnectionsByClientTypeClientIdChannelTypeChannelIdQueryHandler,
            ISlackFacade slackFacade,
            ICapabilityRepository capabilityRepository,
            ISlackService slackService)
        {
            _findConnectionsByClientTypeClientIdChannelTypeChannelIdQueryHandler =
                findConnectionsByClientTypeClientIdChannelTypeChannelIdQueryHandler;

            _slackFacade          = slackFacade;
            _capabilityRepository = capabilityRepository;
            _slackService         = slackService;
        }
Esempio n. 30
0
 public BillingService(
     IQueuingService queuingService,
     IDateTimeProvider dateTimeProvider,
     ILogger <BillingService> logger,
     ISlackService slackService,
     IEnumerable <IBillingMapper> billingMappers,
     IEnumerable <IBillingValidation> billingValidations)
 {
     _queuingService     = queuingService;
     _dateTimeProvider   = dateTimeProvider;
     _logger             = logger;
     _slackService       = slackService;
     _billingMappers     = billingMappers;
     _billingValidations = billingValidations;
 }
Esempio n. 31
0
 public PhotosService(
     IUnitOfWork unitOfWork,
     IUsersService usersService,
     IImageUploader imageUploader,
     IClassMapper mapper,
     IConfiguration configuration,
     ISlackService slackService
     )
 {
     _unitOfWork    = unitOfWork ?? throw new ArgumentNullException(nameof(unitOfWork));
     _usersService  = usersService ?? throw new ArgumentNullException(nameof(usersService));
     _imageUploader = imageUploader ?? throw new ArgumentNullException(nameof(imageUploader));
     _mapper        = mapper ?? throw new ArgumentNullException(nameof(mapper));
     _configuration = configuration ?? throw new ArgumentNullException(nameof(configuration));
     _slackService  = slackService ?? throw new ArgumentNullException(nameof(slackService));
 }
Esempio n. 32
0
        public Worker(ILogger <Worker> logger, IConfiguration configuration, ISlackService slackService)
        {
            _logger                  = logger;
            _slackService            = slackService;
            _cancellationTokenSource = new CancellationTokenSource();

            var conf = new ConsumerConfig
            {
                GroupId          = "aoj69-consumer",
                BootstrapServers = configuration.GetSection("KafkaServer").Value,
                AutoOffsetReset  = AutoOffsetReset.Earliest,
                EnableAutoCommit = false
            };

            _consumer = new ConsumerBuilder <Ignore, string>(conf).Build();
            _consumer.Subscribe(configuration.GetSection("KafkaTopic").Value);
        }
Esempio n. 33
0
 public Security()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
 public LoggedIn()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
 public LoggedIn(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
 public TeamAuthenticationTest(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
 public TeamAuthenticationTest()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
 public TestStart()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
 public TestStart(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
 public Shutdown()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
 public Publish(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
Esempio n. 42
0
 public Security(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
Esempio n. 43
0
 public Event()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
Esempio n. 44
0
 public ListDeletion()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
 public Initialize()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
Esempio n. 46
0
 public Social(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
 public Shutdown(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
Esempio n. 48
0
 public Social()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
 public Initialize(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
 public Membership()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
Esempio n. 51
0
 public ListDeletion(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
 public MvcException()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
Esempio n. 53
0
 public Event(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
 public Indexing(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
 public Membership(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
 public Indexing()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
 //TODO: After the hackathon we should introduce Dependency Injection 
 public Publish()
 {
    _message = new SlackMessage();
     _service = new SlackService(); 
 }
 public MvcException(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }
Esempio n. 59
0
 public Campaign()
 {
     _message = new SlackMessage();
     _service = new SlackService();
 }
Esempio n. 60
0
 public Campaign(ISlackService service, ISlackMessage message)
 {
     _message = message;
     _service = service;
 }