/// <summary>
        /// Enables use of File System extensions
        /// </summary>
        /// <param name="config">The <see cref="JobHostConfiguration"/> to configure.</param>
        /// <param name="filesConfig">The <see cref="FilesConfiguration"></see> to use./></param>
        public static void UseFiles(this JobHostConfiguration config, FilesConfiguration filesConfig)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }
            if (filesConfig == null)
            {
                throw new ArgumentNullException("filesConfig");
            }

            config.RegisterExtensionConfigProvider(new FilesExtensionConfig(filesConfig));
        }
        /// <summary>
        /// Enables use of the Timer extensions
        /// </summary>
        /// <param name="config">The <see cref="JobHostConfiguration"/> to configure.</param>
        /// <param name="timersConfig">The <see cref="TimersConfiguration"/> to use.</param>
        public static void UseTimers(this JobHostConfiguration config, TimersConfiguration timersConfig)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }
            if (timersConfig == null)
            {
                throw new ArgumentNullException("timersConfig");
            }

            config.RegisterExtensionConfigProvider(new TimersExtensionConfig(timersConfig));
        }
        /// <summary>
        /// Enables use of NotificationHubs extension
        /// </summary>
        /// <param name="config">The <see cref="JobHostConfiguration"/> to configure.</param>
        /// <param name="notificationHubsConfig">The <see cref="NotificationHubsConfiguration"/>to use</param>
        public static void UseNotificationHubs(this JobHostConfiguration config, NotificationHubsConfiguration notificationHubsConfig = null)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            if (notificationHubsConfig == null)
            {
                notificationHubsConfig = new NotificationHubsConfiguration();
            }
            config.RegisterExtensionConfigProvider(notificationHubsConfig);
        }
示例#4
0
        /// <summary>
        /// Enables use of the Twilio extensions
        /// </summary>
        /// <param name="config">The <see cref="JobHostConfiguration"/> to configure.</param>
        /// <param name="twilioSmsConfig">The <see cref="TwilioSmsConfiguration"/> to use.</param>
        public static void UseTwilioSms(this JobHostConfiguration config, TwilioSmsConfiguration twilioSmsConfig = null)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            if (twilioSmsConfig == null)
            {
                twilioSmsConfig = new TwilioSmsConfiguration();
            }

            config.RegisterExtensionConfigProvider(twilioSmsConfig);
        }
        /// <summary>
        /// Enables use of the SendGrid extensions
        /// </summary>
        /// <param name="config">The <see cref="JobHostConfiguration"/> to configure.</param>
        /// <param name="sendGridConfig">The <see cref="SendGridConfiguration"/> to use.</param>
        public static void UseSendGrid(this JobHostConfiguration config, SendGridConfiguration sendGridConfig = null)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            if (sendGridConfig == null)
            {
                sendGridConfig = new SendGridConfiguration();
            }

            config.RegisterExtensionConfigProvider(sendGridConfig);
        }
        /// <summary>
        /// Enables use of the CosmosDB extensions
        /// </summary>
        /// <param name="config">The <see cref="JobHostConfiguration"/> to configure.</param>
        /// <param name="cosmosDBConfig">The <see cref="CosmosDBConfiguration"/> to use.</param>
        public static void UseCosmosDB(this JobHostConfiguration config, CosmosDBConfiguration cosmosDBConfig = null)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            if (cosmosDBConfig == null)
            {
                cosmosDBConfig = new CosmosDBConfiguration();
            }

            config.RegisterExtensionConfigProvider(cosmosDBConfig);
        }
示例#7
0
        /// <summary>
        /// Enables use of the DocumentDB extensions
        /// </summary>
        /// <param name="config">The <see cref="JobHostConfiguration"/> to configure.</param>
        /// <param name="documentDBConfig">The <see cref="DocumentDBConfiguration"/> to use.</param>
        public static void UseDocumentDB(this JobHostConfiguration config, DocumentDBConfiguration documentDBConfig = null)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            if (documentDBConfig == null)
            {
                documentDBConfig = new DocumentDBConfiguration();
            }

            config.RegisterExtensionConfigProvider(documentDBConfig);
        }
示例#8
0
        /// <summary>
        /// Enables use of Http extensions
        /// </summary>
        /// <param name="config">The <see cref="JobHostConfiguration"/> to configure.</param>
        /// <param name="httpConfig">The <see cref="HttpExtensionConfiguration"/> to use.</param>
        public static void UseHttp(this JobHostConfiguration config, HttpExtensionConfiguration httpConfig = null)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            if (httpConfig == null)
            {
                httpConfig = new HttpExtensionConfiguration();
            }

            config.RegisterExtensionConfigProvider(httpConfig);
        }
        /// <summary>
        /// Enables use of the EasyTable extensions.
        /// </summary>
        /// <param name="config">The <see cref="JobHostConfiguration"/> to configure.</param>
        /// <param name="easyTablesConfig">The <see cref="EasyTablesConfiguration"/> to use.</param>
        public static void UseEasyTables(this JobHostConfiguration config, EasyTablesConfiguration easyTablesConfig = null)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            if (easyTablesConfig == null)
            {
                easyTablesConfig = new EasyTablesConfiguration();
            }

            config.RegisterExtensionConfigProvider(easyTablesConfig);
        }
示例#10
0
        /// <summary>
        /// Enables use of the Mobile App extensions.
        /// </summary>
        /// <param name="config">The <see cref="JobHostConfiguration"/> to configure.</param>
        /// <param name="mobileAppsConfig">The <see cref="MobileAppsConfiguration"/> to use.</param>
        public static void UseMobileApps(this JobHostConfiguration config, MobileAppsConfiguration mobileAppsConfig = null)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            if (mobileAppsConfig == null)
            {
                mobileAppsConfig = new MobileAppsConfiguration();
            }

            config.RegisterExtensionConfigProvider(mobileAppsConfig);
        }
        /// <summary>
        /// Enables use of the Slack extensions
        /// </summary>
        /// <param name="config">The <see cref="JobHostConfiguration"/> to configure.</param>
        /// <param name="slackConfig">The <see cref="SlackConfiguration"/> to use.</param>
        public static void UseSlack(this JobHostConfiguration config, SlackConfiguration slackConfig = null)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            if (slackConfig == null)
            {
                slackConfig = new SlackConfiguration();
            }

            config.RegisterExtensionConfigProvider(new SlackExtensionConfig(slackConfig));
        }
示例#12
0
        /// <summary>
        /// Enables use of the WebHooks extensions.
        /// </summary>
        /// <remarks>
        /// <para>
        /// In addition to enabling HTTP POST invocation of functions decorated with <see cref="WebHookTriggerAttribute"/>
        /// this also enables HTTP invocation of other functions as well. For functions not decorated with
        /// <see cref="WebHookTriggerAttribute"/>, they can be invoked via an implicit route of the form
        /// {TypeName}/{FunctionName}. The body should be a valid json string representing the data that you would
        /// pass in to <see cref="JobHost.Call(System.Reflection.MethodInfo, object)"/>.
        /// </para>
        /// <para>
        /// Authentication of incoming requests is handled outside of this extension. When running under the normal
        /// Azure Web App host, the extension will be listening on a loopback port that the SCM host has opened for
        /// the job, and SCM forwards authenticated requests through (SCM credentials are required to invoke the SCM endpoints).
        /// </para>
        /// </remarks>
        /// <param name="config">The <see cref="JobHostConfiguration"/> to configure.</param>
        /// <param name="webHooksConfig">The <see cref="WebHooksConfiguration"/> to use.</param>
        public static void UseWebHooks(this JobHostConfiguration config, WebHooksConfiguration webHooksConfig = null)
        {
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            if (webHooksConfig == null)
            {
                webHooksConfig = new WebHooksConfiguration();
            }

            config.RegisterExtensionConfigProvider(new WebHooksExtensionConfig(webHooksConfig));
        }