Ejemplo n.º 1
0
        /// <summary>
        /// Add a label to a notification rule.
        /// </summary>
        /// <param name="labelId">Label to add</param>
        /// <param name="ruleId">The notification rule ID.</param>
        /// <returns>The label was added to the notification rule</returns>
        public async Task <Label> AddLabelAsync(string labelId, string ruleId)
        {
            Arguments.CheckNonEmptyString(ruleId, nameof(ruleId));
            Arguments.CheckNonEmptyString(labelId, nameof(labelId));

            var mapping = new LabelMapping(labelId);

            return((await _service.PostNotificationRuleIDLabelsAsync(ruleId, mapping)).Label);
        }
        /// <summary>
        /// Add a label to a notification rule.
        /// </summary>
        /// <param name="labelId">Label to add</param>
        /// <param name="ruleId">The notification rule ID.</param>
        /// <returns>The label was added to the notification rule</returns>
        public async Task <Label> AddLabelAsync(string labelId, string ruleId)
        {
            Arguments.CheckNonEmptyString(ruleId, nameof(ruleId));
            Arguments.CheckNonEmptyString(labelId, nameof(labelId));

            var mapping = new LabelMapping(labelId);

            var response = await _service.PostNotificationRuleIDLabelsAsync(ruleId, mapping).ConfigureAwait(false);

            return(response.Label);
        }