Imgur.API.Endpoints.Impl.AccountEndpoint.VerifyEmailAsync C# (CSharp) Method

VerifyEmailAsync() public method

Checks to see if user has verified their email address. 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 VerifyEmailAsync ( ) : Task
return Task
        public async Task<bool> VerifyEmailAsync()
        {
            if (ApiClient.OAuth2Token == null)
                throw new ArgumentNullException(nameof(ApiClient.OAuth2Token), OAuth2RequiredExceptionMessage);

            var url = "account/me/verifyemail";

            using (var request = RequestBuilder.CreateRequest(HttpMethod.Get, url))
            {
                var verified = await SendRequestAsync<bool>(request).ConfigureAwait(false);
                return verified;
            }
        }
    }

Usage Example

コード例 #1
0
        public async Task VerifyEmailAsync_IsTrue()
        {
            var client = new ImgurClient(ClientId, ClientSecret, await GetOAuth2Token());
            var endpoint = new AccountEndpoint(client);

            var verified = await endpoint.VerifyEmailAsync();

            Assert.IsTrue(verified);
        }
All Usage Examples Of Imgur.API.Endpoints.Impl.AccountEndpoint::VerifyEmailAsync