/// <summary> /// [Authentication required] Listings of Group discussion boards /// </summary> /// <param name="urlName">The urlName path element may be any valid group urlname or domain name.</param> /// <param name="cancellationToken">Cancellation Token</param> /// <returns>Task<IEnumerable<Board>></returns> /// <exception cref="HttpRequestException"> /// Ops! Something went wrong :S. Please try again, if the error persist contact /// with the developer to fix the issue. /// </exception> public async Task <IEnumerable <Board> > All([NotNull] string urlName, CancellationToken cancellationToken) { if (string.IsNullOrEmpty(urlName)) { throw new ArgumentException("Argument is null or empty", nameof(urlName)); } if (string.IsNullOrWhiteSpace(urlName)) { throw new ArgumentException("Argument is null or whitespace", nameof(urlName)); } if (!await MeetupBase.RenewAccessToken()) { throw new HttpRequestException( "MeetupApi is unable to get the listings of group discussion boards, please re-login for renew your access token."); } var queryUrl = new StringBuilder(MeetupBase.BASE_URL); #if DEBUG queryUrl.Append($"/{urlName}/boards?{SecretKeys.ApiKeyUrl}"); #else queryUrl.Append($"/{urlName}/boards"); #endif var response = await MeetupBase.ExecuteQueryAsync <IEnumerable <Board> >(queryUrl, cancellationToken); if (response == null) { throw new HttpRequestException( "Ops! Something went wrong :S. Please try again, if the error persist contact with the developer to fix the issue."); } return(response); }
/// <summary> /// [Authentication required] Listings of Group discussion boards /// </summary> /// <param name="urlName">The urlName path element may be any valid group urlname or domain name.</param> /// <param name="cancellationToken">Cancellation Token</param> /// <returns>Task<IEnumerable<Board>></returns> /// <exception cref="HttpRequestException"> /// Ops! Something went wrong :S. Please try again, if the error persist contact /// with the developer to fix the issue. /// </exception> public async Task <IEnumerable <Board> > All([NotNull] string urlName, CancellationToken cancellationToken) { if (string.IsNullOrEmpty(urlName)) { throw new ArgumentException("Argument is null or empty", nameof(urlName)); } if (string.IsNullOrWhiteSpace(urlName)) { throw new ArgumentException("Argument is null or whitespace", nameof(urlName)); } if (!await MeetupBase.RenewAccessToken()) { throw new HttpRequestException(Resources.ErrorMessage); } var queryUrl = new StringBuilder(MeetupBase.BASE_URL); #if DEBUG queryUrl.Append($"/{urlName}/boards?{SecretKeys.ApiKeyUrl}"); #else queryUrl.Append($"/{urlName}/boards"); #endif var response = await MeetupBase.ExecuteQueryAsync <IEnumerable <Board> >(queryUrl, cancellationToken); if (response == null) { throw new HttpRequestException(Resources.ErrorMessage); } return(response); }