/// <summary> /// Add a ScraperTarget label. /// </summary> /// <param name="labelId">the ID of a label</param> /// <param name="scraperTargetId">the ID of a ScraperTarget</param> /// <returns>added label</returns> public async Task <Label> AddLabel(string labelId, string scraperTargetId) { Arguments.CheckNonEmptyString(scraperTargetId, nameof(scraperTargetId)); Arguments.CheckNonEmptyString(labelId, nameof(labelId)); var mapping = new LabelMapping(labelId); return(await _service.PostScrapersIDLabelsAsync(scraperTargetId, mapping).ContinueWith(t => t.Result.Label)); }
/// <summary> /// Add a ScraperTarget label. /// </summary> /// <param name="labelId">the ID of a label</param> /// <param name="scraperTargetId">the ID of a ScraperTarget</param> /// <returns>added label</returns> public async Task <Label> AddLabelAsync(string labelId, string scraperTargetId) { Arguments.CheckNonEmptyString(scraperTargetId, nameof(scraperTargetId)); Arguments.CheckNonEmptyString(labelId, nameof(labelId)); var mapping = new LabelMapping(labelId); var response = await _service.PostScrapersIDLabelsAsync(scraperTargetId, mapping).ConfigureAwait(false); return(response.Label); }