/// <summary>
 /// Initializes a new instance of the <see cref="ContosoWebhookHandler"/> class.
 /// </summary>
 /// <param name="notificationHelper">Custom handler for notifications.</param>
 /// <param name="marketplaceClient">Marketplace client.</param>
 public ContosoWebhookHandler(
     IMarketplaceNotificationHandler notificationHelper,
     IMarketplaceSaaSClient marketplaceClient)
 {
     this.notificationHelper = notificationHelper;
     this.marketplaceClient  = marketplaceClient;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="FulfillmentApiService" /> class.
 /// </summary>
 /// <param name="sdkSettings">The SDK settings.</param>
 /// <param name="logger">The logger.</param>
 public FulfillmentApiService(IMarketplaceSaaSClient marketplaceClient,
                              SaaSApiClientConfiguration sdkSettings,
                              ILogger logger) : base(logger)
 {
     this.marketplaceClient   = marketplaceClient;
     this.ClientConfiguration = sdkSettings;
     this.Logger = logger;
 }
Esempio n. 3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MarketplaceProcessor"/> class.
 /// </summary>
 /// <param name="marketplaceClient">Marketplace API client.</param>
 /// <param name="webhookHandler">Webhook handler.</param>
 /// <param name="logger">Logger.</param>
 public MarketplaceProcessor(
     IMarketplaceSaaSClient marketplaceClient,
     IWebhookHandler webhookHandler,
     ILogger <MarketplaceProcessor> logger)
 {
     this.logger            = logger;
     this.marketplaceClient = marketplaceClient;
     this.webhookHandler    = webhookHandler;
     this.marketplaceClient = marketplaceClient;
 }
        /// <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;
        }
Esempio n. 5
0
        /// <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="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();
        }
Esempio n. 8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MailLinkController"/> class.
 /// </summary>
 /// <param name="marketplaceProcessor">marketplaceProcessor.</param>
 /// <param name="marketplaceClient">Marketplace API client.</param>
 public MailLinkController(IMarketplaceProcessor marketplaceProcessor, IMarketplaceSaaSClient marketplaceClient)
 {
     this.marketplaceProcessor = marketplaceProcessor;
     this.marketplaceClient    = marketplaceClient;
 }