public async Task <HttpResponse> ExecuteApiCallAsync(HttpRequestPriority priority, HttpRequest request, int timeout = 0, params HttpStatusCode[] ignoreErrorCodes)
        {
            var response = await _client.ExecuteAsStringResponseAsync(priority, request, timeout).ConfigureAwait(false);

            if (response.IsSuccessful || ignoreErrorCodes.Contains(response.StatusCode))
            {
                return(response);
            }

            if (HttpStatusCodes.IsErrorStatus(response.StatusCode))
            {
                throw new HttpException("Error status code received", response);
            }

            return(response);
        }
        private bool ValidateResponse(HttpResponse response, bool shouldCheckIfForbidden = false, params HttpStatusCode[] ignoreErrorCodes)
        {
            if (response.IsSuccessful || ignoreErrorCodes.Contains(response.StatusCode))
            {
                return(true);
            }

            if (shouldCheckIfForbidden && !IsSessionValid(response))
            {
                return(false);
            }

            if (HttpStatusCodes.IsErrorStatus(response.StatusCode))
            {
                throw new HttpException("Error status code recieved", response);
            }

            return(true);
        }