示例#1
0
        /// <summary>
        /// Creates a new instance of the <see cref="LogicAppsProvider"/> class.
        /// </summary>
        /// <param name="resourceGroup">The resource group where the logic apps should be located.</param>
        /// <param name="logicAppName">The name of the logic app resource running in Azure.</param>
        /// <param name="authentication">The authentication mechanism to authenticate with Azure.</param>
        public static LogicAppsProvider LocatedAt(
            string resourceGroup,
            string logicAppName,
            LogicAppAuthentication authentication)
        {
            Guard.NotNullOrWhitespace(resourceGroup, nameof(resourceGroup));
            Guard.NotNullOrWhitespace(logicAppName, nameof(logicAppName));
            Guard.NotNull(authentication, nameof(authentication));

            return(LocatedAt(resourceGroup, logicAppName, authentication, NullLogger.Instance));
        }
示例#2
0
        /// <summary>
        /// Creates a new authenticated instance of the <see cref="LogicAppClient"/>.
        /// </summary>
        /// <param name="resourceGroup">The resource group where the logic app is located.</param>
        /// <param name="logicAppName">The name of the logic app resource running in Azure.</param>
        /// <param name="authentication">The authentication mechanism to authenticate this client.</param>
        /// <returns>
        ///     An authenticated client capable of interacting with the logic app resource running in Azure.
        /// </returns>
        public static async Task <LogicAppClient> CreateAsync(
            string resourceGroup,
            string logicAppName,
            LogicAppAuthentication authentication)
        {
            Guard.NotNullOrEmpty(resourceGroup, nameof(resourceGroup));
            Guard.NotNullOrEmpty(logicAppName, nameof(logicAppName));
            Guard.NotNull(authentication, nameof(authentication));

            return(await CreateAsync(resourceGroup, logicAppName, authentication, NullLogger.Instance));
        }
示例#3
0
        /// <summary>
        /// Creates a new instance of the <see cref="LogicAppsProvider"/> class.
        /// </summary>
        /// <param name="resourceGroup">The resource group where the logic apps should be located.</param>
        /// <param name="logicAppName">The name of the logic app resource running in Azure.</param>
        /// <param name="authentication">The authentication mechanism to authenticate with Azure.</param>
        /// <param name="logger">The instance to write diagnostic trace messages while interacting with the provider.</param>
        public static LogicAppsProvider LocatedAt(
            string resourceGroup,
            string logicAppName,
            LogicAppAuthentication authentication,
            ILogger logger)
        {
            Guard.NotNullOrEmpty(resourceGroup, nameof(resourceGroup));
            Guard.NotNullOrEmpty(logicAppName, nameof(logicAppName));
            Guard.NotNull(authentication, nameof(authentication));

            logger = logger ?? NullLogger.Instance;
            return(new LogicAppsProvider(resourceGroup, logicAppName, authentication, logger));
        }
        /// <summary>
        /// Creates a new authenticated instance of the <see cref="LogicAppClient"/>.
        /// </summary>
        /// <param name="resourceGroup">The resource group where the logic app is located.</param>
        /// <param name="logicAppName">The name of the logic app resource running in Azure.</param>
        /// <param name="authentication">The authentication mechanism to authenticate this client.</param>
        /// <param name="logger">The instance to write diagnostic trace messages while interacting with the logic app.</param>
        /// <returns>
        ///     An authenticated client capable of interacting with the logic app resource running in Azure.
        /// </returns>
        public static async Task<LogicAppClient> CreateAsync(
            string resourceGroup,
            string logicAppName,
            LogicAppAuthentication authentication,
            ILogger logger)
        {
            Guard.NotNullOrEmpty(resourceGroup, nameof(resourceGroup));
            Guard.NotNullOrEmpty(logicAppName, nameof(logicAppName));
            Guard.NotNull(authentication, nameof(authentication));

            LogicManagementClient managementClient = await authentication.AuthenticateAsync();
            logger = logger ?? NullLogger.Instance;
            return new LogicAppClient(resourceGroup, logicAppName, managementClient, logger);
        }
示例#5
0
        private LogicAppsProvider(
            string resourceGroup,
            string logicAppName,
            LogicAppAuthentication authentication,
            ILogger logger)
        {
            Guard.NotNullOrWhitespace(resourceGroup, nameof(resourceGroup));
            Guard.NotNullOrWhitespace(logicAppName, nameof(logicAppName));
            Guard.NotNull(authentication, nameof(authentication));
            Guard.NotNull(logger, nameof(logger));

            _resourceGroup  = resourceGroup;
            _logicAppName   = logicAppName;
            _authentication = authentication;
            _logger         = logger;
        }