/// <summary> /// Initializes a new instance of the <see cref="CommandCenterEMailHelper"/> class. /// </summary> /// <param name="optionsMonitor">Options monitor.</param> /// <param name="marketplaceClient">Marketplace API client.</param> public CommandCenterEMailHelper( IOptionsMonitor <CommandCenterOptions> optionsMonitor, IMarketplaceSaaSClient marketplaceClient) { if (optionsMonitor == null) { throw new ArgumentNullException(nameof(optionsMonitor)); } this.marketplaceClient = marketplaceClient; this.options = optionsMonitor.CurrentValue; }
/// <summary> /// Initializes a new instance of the <see cref="SubscriptionsController"/> class. /// </summary> /// <param name="marketplaceClient">Marketplace API client.</param> /// <param name="operationsStore">Operations store.</param> /// <param name="options">Solution options.</param> public SubscriptionsController( IMarketplaceSaaSClient marketplaceClient, IOperationsStore operationsStore, IOptionsMonitor <CommandCenterOptions> options) { if (options == null) { throw new ArgumentNullException(nameof(options)); } this.marketplaceClient = marketplaceClient; this.operationsStore = operationsStore; this.options = options.CurrentValue; }
/// <summary> /// Initializes a new instance of the <see cref="WebHookController"/> class. /// </summary> /// <param name="optionsMonitor">Options.</param> /// <param name="marketplaceProcessor">Marketplace processor.</param> /// <param name="logger">Logger.</param> public WebHookController( IOptionsMonitor <CommandCenterOptions> optionsMonitor, IMarketplaceProcessor marketplaceProcessor, ILogger <WebHookController> logger) { if (optionsMonitor == null) { throw new ArgumentNullException(nameof(optionsMonitor)); } this.marketplaceProcessor = marketplaceProcessor; this.logger = logger; this.options = optionsMonitor.CurrentValue; }
/// <summary> /// Initializes a new instance of the <see cref="LandingPageController"/> class. /// </summary> /// <param name="commandCenterOptions">Options.</param> /// <param name="marketplaceProcessor">Marketplace processor.</param> /// <param name="notificationHandler">Notification handler.</param> /// <param name="marketplaceClient">Marketplace client.</param> /// <param name="logger">Logger.</param> public LandingPageController( IOptionsMonitor <CommandCenterOptions> commandCenterOptions, IMarketplaceProcessor marketplaceProcessor, IMarketplaceNotificationHandler notificationHandler, IMarketplaceSaaSClient marketplaceClient, ILogger <LandingPageController> logger) { if (commandCenterOptions == null) { throw new ArgumentNullException(nameof(commandCenterOptions)); } this.marketplaceProcessor = marketplaceProcessor; this.notificationHandler = notificationHandler; this.marketplaceClient = marketplaceClient; this.logger = logger; this.options = commandCenterOptions.CurrentValue; }
/// <summary> /// Initializes a new instance of the <see cref="AzureQueueNotificationHandler"/> class. /// </summary> /// <param name="optionsMonitor">Adapter options.</param> /// <param name="marketplaceClient">Marketplace API client.</param> public AzureQueueNotificationHandler(IOptionsMonitor <CommandCenterOptions> optionsMonitor, IMarketplaceSaaSClient marketplaceClient) { if (optionsMonitor == null) { throw new ArgumentNullException(nameof(optionsMonitor)); } this.marketplaceClient = marketplaceClient; this.options = optionsMonitor.CurrentValue; if (this.options.AzureQueue == null) { throw new ApplicationException("AzureQueue options are needed."); } if (string.IsNullOrEmpty(this.options.AzureQueue.QueueName) || string.IsNullOrEmpty(this.options.AzureQueue.StorageConnectionString)) { throw new ApplicationException("Queue name or connection string is empty for the Azure Queue options."); } this.queueClient = new QueueClient(this.options.AzureQueue.StorageConnectionString, this.options.AzureQueue.QueueName); this.queueClient.CreateIfNotExists(); }