/// <summary> /// Creates the Slack-bot. /// </summary> /// <param name="slackIntegration">Used for talking to the Slack APIs.</param> /// <param name="slackProfileValidator">Used for checking user profiles for completeness.</param> /// <param name="adminUser">Used for sending the results to the Slack admin.</param> /// <param name="faceWhitelist">Knows about whitelisted users.</param> public ProfilebotImplmentation(ISlackIntegration slackIntegration, ISlackProfileValidator slackProfileValidator, SlackUser adminUser, IFaceWhitelist faceWhitelist) { this.slackIntegration = slackIntegration ?? throw new ArgumentNullException(nameof(slackIntegration)); this.slackProfileValidator = slackProfileValidator ?? throw new ArgumentNullException(nameof(slackProfileValidator)); if (string.IsNullOrEmpty(adminUser.Id)) { throw new ArgumentException(nameof(adminUser.Id)); } this.adminUser = new SlackUser { Id = adminUser.Id }; this.faceWhitelist = faceWhitelist ?? throw new ArgumentNullException(nameof(faceWhitelist)); }
/// <summary> /// Constructor. /// </summary> /// <param name="faceServiceClient">Client for calling Azure Cognitive Services.</param> /// <param name="faceWhitelist">Knows about whitelisted users.</param> /// <param name="configuration">The configuration to use.</param> public FaceDetectionClient(IFaceServiceClient faceServiceClient, IFaceWhitelist faceWhitelist, FaceDetectionConfiguration configuration) { this.faceServiceClient = faceServiceClient ?? throw new ArgumentNullException(nameof(faceServiceClient)); this.faceWhitelist = faceWhitelist ?? throw new ArgumentNullException(nameof(faceWhitelist)); delay = configuration.Delay.Milliseconds; }