public VkontakteClient( IFlightsConfiguration flightsConfiguration, ILogger <VkApi> log = null ) { client = new Lazy <Task <VkApi> >(() => CreateClientAsync(flightsConfiguration.VkApplicationId, flightsConfiguration.VkAccessToken, log)); }
public TelegramNotificationSender( IFlightsConfiguration configuration ) { sended = new List <FlightNews>(); botClient = new TelegramBotClient(configuration.TelegramBotToken); }
public LastNewsMenuCommand( IFlightsConfiguration configuration, ITelegramClient telegramClient ) { this.configuration = configuration; this.telegramClient = telegramClient; }
public SetUpSearchMenuCommand( ITelegramClient telegramClient, IFlightsConfiguration configuration ) { this.telegramClient = telegramClient; this.configuration = configuration; }
public TelegramClient( IFlightsConfiguration configuration, ILogger logger ) { this.logger = logger; telegramBotClient = new TelegramBotClient(configuration.TelegramBotToken); }
public static async Task <CloudTable> GetAzureTableAsync(this IFlightsConfiguration flightsConfiguration, string tableName) { var storageAccount = CloudStorageAccount.Parse(flightsConfiguration.AzureTableConnectionString); var tableClient = storageAccount.CreateCloudTableClient(); var table = tableClient.GetTableReference(tableName); await table.CreateIfNotExistsAsync(); return(table); }
public CommandParser( IFlightsConfiguration configuration, ILogger log, ICommandFactory commandFactory ) { this.configuration = configuration; this.log = log; this.commandFactory = commandFactory; }
public FlightsFunctions( IFlightsConfiguration flightsConfiguration ) { this.flightsConfiguration = flightsConfiguration; this.client = new RestClient(flightsConfiguration.AzureFunctionsUrl); //note: https://bytefish.de/blog/restsharp_custom_json_serializer/ client.AddHandler("application/json", Serializer.Instance); client.AddHandler("text/json", Serializer.Instance); client.AddHandler("text/x-json", Serializer.Instance); client.AddHandler("text/javascript", Serializer.Instance); client.AddHandler("*+json", Serializer.Instance); }
public CommandFactory( IFlightsConfiguration configuration, ITelegramClient telegramClient, INotifier notifier, ITimeline[] timelines, ILogger log, ISubscriberStorage subscriberStorage ) { this.configuration = configuration; this.telegramClient = telegramClient; this.notifier = notifier; this.timelines = timelines; this.log = log; this.subscriberStorage = subscriberStorage; }
public LastNewsCommand( int lastNewsDays, IFlightsConfiguration configuration, ITelegramClient telegramClient, INotifier notifier, ITimeline[] timelines, ILogger log ) { this.lastNewsDays = lastNewsDays; this.configuration = configuration; this.telegramClient = telegramClient; this.notifier = notifier; this.timelines = timelines; this.log = log; }
public SubscriberStorage(IFlightsConfiguration flightsConfiguration) { subscribersTable = flightsConfiguration.GetAzureTableAsync("Subscribers").Result; }
public AzureTableOffsetStorage(IFlightsConfiguration flightsConfiguration) { offsetsTable = flightsConfiguration.GetAzureTableAsync("Offsets").Result; }
public AzureTableFlightNewsStorage(IFlightsConfiguration flightsConfiguration) { flightNewsTable = flightsConfiguration.GetAzureTableAsync("FlightNews").Result; }