Imgur.API.Endpoints.Impl.CustomGalleryEndpoint.RemoveFilteredOutGalleryTagAsync C# (CSharp) Method

RemoveFilteredOutGalleryTagAsync() public method

Remove a filtered out tag. OAuth authentication required.
/// Thrown when a null reference is passed to a method that does not accept it as a /// valid argument. /// Thrown when an error is found in a response from an Imgur endpoint. Thrown when an error is found in a response from a Mashape endpoint.
public RemoveFilteredOutGalleryTagAsync ( string tag ) : Task
tag string The tag that should be removed.
return Task
        public async Task<bool> RemoveFilteredOutGalleryTagAsync(string tag)
        {
            if (string.IsNullOrWhiteSpace(tag))
                throw new ArgumentNullException(nameof(tag));

            if (ApiClient.OAuth2Token == null)
                throw new ArgumentNullException(nameof(ApiClient.OAuth2Token), OAuth2RequiredExceptionMessage);

            var url = "g/unblock_tag";

            using (var request = RequestBuilder.RemoveFilteredOutGalleryTagRequest(url, tag))
            {
                var removed = await SendRequestAsync<bool?>(request).ConfigureAwait(false);
                return removed ?? true;
            }
        }
    }

Usage Example

コード例 #1
0
        public async Task RemoveFilteredOutGalleryTagAsync_WithTagsNull_ThrowsArgumentNullException()
        {
            var client = new ImgurClient("123", "1234");
            var endpoint = new CustomGalleryEndpoint(client);

            var exception =
                await
                    Record.ExceptionAsync(
                        async () => await endpoint.RemoveFilteredOutGalleryTagAsync(null).ConfigureAwait(false))
                        .ConfigureAwait(false);
            Assert.NotNull(exception);
            Assert.IsType<ArgumentNullException>(exception);
        }
All Usage Examples Of Imgur.API.Endpoints.Impl.CustomGalleryEndpoint::RemoveFilteredOutGalleryTagAsync