/// <summary>
        /// Returns a [cursor-paginated](#api-usage-cursor-pagination) list of
        /// all exchange rates.
        /// </summary>
        /// <param name="request">An optional `CurrencyExchangeRateListRequest` representing the query parameters for this list request.</param>
        /// <param name="customiseRequestMessage">An optional `RequestSettings` allowing you to configure the request</param>
        /// <returns>A set of currency exchange rate resources</returns>
        public Task <CurrencyExchangeRateListResponse> ListAsync(CurrencyExchangeRateListRequest request = null, RequestSettings customiseRequestMessage = null)
        {
            request = request ?? new CurrencyExchangeRateListRequest();

            var urlParams = new List <KeyValuePair <string, object> >
            {
            };

            return(_goCardlessClient.ExecuteAsync <CurrencyExchangeRateListResponse>("GET", "/currency_exchange_rates", urlParams, request, null, null, customiseRequestMessage));
        }
        /// <summary>
        /// Get a lazily enumerated list of currency exchange rates.
        /// This acts like the #list method, but paginates for you automatically.
        /// </summary>
        public IEnumerable <Task <IReadOnlyList <CurrencyExchangeRate> > > AllAsync(CurrencyExchangeRateListRequest request = null, RequestSettings customiseRequestMessage = null)
        {
            request = request ?? new CurrencyExchangeRateListRequest();

            return(new TaskEnumerable <IReadOnlyList <CurrencyExchangeRate>, string>(async after =>
            {
                request.After = after;
                var list = await this.ListAsync(request, customiseRequestMessage);
                return Tuple.Create(list.CurrencyExchangeRates, list.Meta?.Cursors?.After);
            }));
        }
        /// <summary>
        /// Get a lazily enumerated list of currency exchange rates.
        /// This acts like the #list method, but paginates for you automatically.
        /// </summary>
        public IEnumerable <CurrencyExchangeRate> All(CurrencyExchangeRateListRequest request = null, RequestSettings customiseRequestMessage = null)
        {
            request = request ?? new CurrencyExchangeRateListRequest();

            string cursor = null;

            do
            {
                request.After = cursor;

                var result = Task.Run(() => ListAsync(request, customiseRequestMessage)).Result;
                foreach (var item in result.CurrencyExchangeRates)
                {
                    yield return(item);
                }
                cursor = result.Meta?.Cursors?.After;
            } while (cursor != null);
        }