/// <summary>
        /// Returns a [cursor-paginated](#api-usage-cursor-pagination) list of
        /// your subscriptions.
        /// </summary>
        /// <param name="request">An optional `SubscriptionListRequest` 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 subscription resources</returns>
        public Task <SubscriptionListResponse> ListAsync(SubscriptionListRequest request = null, RequestSettings customiseRequestMessage = null)
        {
            request = request ?? new SubscriptionListRequest();

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

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

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

            string cursor = null;

            do
            {
                request.After = cursor;

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