/// <summary>Makes a call to the MangoPay API.
        /// This generic method handles calls targeting collections of
        /// DTO instances. In order to process single objects,
        /// use <code>Request</code> method instead.
        /// </summary>
        /// <typeparam name="T">Type on behalf of which the request is being called.</typeparam>
        /// <param name="endPoint">An instance of <see cref="ApiEndPoint"/> that specifies API url and method to call</param>
        /// <param name="requestData">Collection of key-value pairs of request parameters.</param>
        /// <param name="pagination">Pagination object.</param>
        /// <param name="additionalUrlParams"></param>
        /// <returns>Collection of DTO instances returned from API.</returns>
        public async Task <ListPaginated <T> > RequestList <T>(ApiEndPoint endPoint, Dictionary <String, String> requestData, Pagination pagination, Dictionary <String, String> additionalUrlParams)
            where T : new()
        {
            this._requestType     = endPoint.RequestType;
            this._includeClientId = endPoint.IncludeClientId;
            this._requestData     = requestData;

            ListPaginated <T> responseResult = await this.DoRequestList <T>(endPoint.GetUrl(), pagination, additionalUrlParams);

            return(responseResult);
        }
        /// <summary>Makes a call to the MangoPay API.
        /// This generic method handles calls targeting single
        /// DTO instances. In order to process collections of objects,
        /// use <code>RequestList</code> method instead.
        /// </summary>
        /// <typeparam name="U">Return type.</typeparam>
        /// <typeparam name="T">Type on behalf of which the request is being called.</typeparam>
        /// <param name="idempotencyKey">Idempotency key for this request.</param>
        /// <param name="endPoint">An instance of <see cref="ApiEndPoint"/> that specifies API url and method to call</param>
        /// <param name="requestData">Collection of key-value pairs of request parameters.</param>
        /// <param name="pagination">Pagination object.</param>
        /// <param name="entity">Instance of DTO class that is going to be sent in case of PUTting or POSTing.</param>
        /// <returns>The DTO instance returned from API.</returns>
        public async Task <U> Request <U, T>(String idempotencyKey, ApiEndPoint endPoint, Dictionary <String, String> requestData, Pagination pagination, T entity)
            where U : new()
        {
            this._requestType     = endPoint.RequestType;
            this._includeClientId = endPoint.IncludeClientId;
            this._requestData     = requestData;

            U responseResult = await this.DoRequest <U, T>(idempotencyKey, endPoint.GetUrl(), pagination, entity);

            return(responseResult);
        }
 /// <summary>Makes a call to the MangoPay API.
 /// This generic method handles calls targeting collections of
 /// DTO instances. In order to process single objects,
 /// use <code>Request</code> method instead.
 /// </summary>
 /// <typeparam name="T">Type on behalf of which the request is being called.</typeparam>
 /// <param name="endPoint">An instance of <see cref="ApiEndPoint"/> that specifies API url and method to call</param>
 /// <param name="requestData">Collection of key-value pairs of request parameters.</param>
 /// <param name="pagination">Pagination object.</param>
 /// <returns>Collection of DTO instances returned from API.</returns>
 public async Task <ListPaginated <T> > RequestList <T>(ApiEndPoint endPoint, Dictionary <String, String> requestData, Pagination pagination)
     where T : new()
 {
     return(await RequestList <T>(endPoint, requestData, pagination, null));
 }
 /// <summary>Makes a call to the MangoPay API.
 /// This generic method handles calls targeting collections of
 /// DTO instances. In order to process single objects,
 /// use <code>Request</code> method instead.
 /// </summary>
 /// <typeparam name="T">Type on behalf of which the request is being called.</typeparam>
 /// <param name="endPoint">An instance of <see cref="ApiEndPoint"/> that specifies API url and method to call</param>
 /// <returns>Collection of DTO instances returned from API.</returns>
 public async Task <ListPaginated <T> > RequestList <T>(ApiEndPoint endPoint)
     where T : new()
 {
     return(await RequestList <T>(endPoint, null, null, null));
 }
 /// <summary>Makes a call to the MangoPay API.
 /// This generic method handles calls targeting single
 /// DTO instances. In order to process collections of objects,
 /// use <code>RequestList</code> method instead.
 /// </summary>
 /// <typeparam name="U">Return type.</typeparam>
 /// <typeparam name="T">Type on behalf of which the request is being called.</typeparam>
 /// <param name="idempotencyKey">Idempotency key for this request.</param>
 /// <param name="endPoint">An instance of <see cref="ApiEndPoint"/> that specifies API url and method to call</param>
 /// <param name="requestData">Collection of key-value pairs of request parameters.</param>
 /// <param name="pagination">Pagination object.</param>
 /// <returns>The DTO instance returned from API.</returns>
 public async Task <U> Request <U, T>(String idempotencyKey, ApiEndPoint endPoint, Dictionary <String, String> requestData, Pagination pagination)
     where U : new()
 {
     return(await Request <U, T>(idempotencyKey, endPoint, requestData, pagination, default(T)));
 }
 /// <summary>Makes a call to the MangoPay API.
 /// This generic method handles calls targeting single
 /// DTO instances. In order to process collections of objects,
 /// use <code>RequestList</code> method instead.
 /// </summary>
 /// <typeparam name="U">Return type.</typeparam>
 /// <typeparam name="T">Type on behalf of which the request is being called.</typeparam>
 /// <param name="endPoint">An instance of <see cref="ApiEndPoint"/> that specifies API url and method to call</param>
 /// <param name="requestData">Collection of key-value pairs of request parameters.</param>
 /// <returns>The DTO instance returned from API.</returns>
 public async Task <U> Request <U, T>(ApiEndPoint endPoint, Dictionary <String, String> requestData)
     where U : new()
 {
     return(await Request <U, T>(null, endPoint, requestData, null, default(T)));
 }
 /// <summary>Makes a call to the MangoPay API.
 /// This generic method handles calls targeting single
 /// DTO instances. In order to process collections of objects,
 /// use <code>RequestList</code> method instead.
 /// </summary>
 /// <typeparam name="U">Return type.</typeparam>
 /// <typeparam name="T">Type on behalf of which the request is being called.</typeparam>
 /// <param name="idempotencyKey">Idempotency key for this request.</param>
 /// <param name="endPoint">An instance of <see cref="ApiEndPoint"/> that specifies API url and method to call</param>
 /// <returns>The DTO instance returned from API.</returns>
 public async Task <U> Request <U, T>(String idempotencyKey, ApiEndPoint endPoint)
     where U : new()
 {
     return(await Request <U, T>(idempotencyKey, endPoint, null, null, default(T)));
 }
 /// <summary>Makes a call to the MangoPay API.
 /// This generic method handles calls targeting single
 /// DTO instances. In order to process collections of objects,
 /// use <code>RequestList</code> method instead.
 /// </summary>
 /// <typeparam name="U">Return type.</typeparam>
 /// <typeparam name="T">Type on behalf of which the request is being called.</typeparam>
 /// <param name="endPoint">An instance of <see cref="ApiEndPoint"/> that specifies API url and method to call</param>
 /// <returns>The DTO instance returned from API.</returns>
 public async Task <U> Request <U, T>(ApiEndPoint endPoint)
     where U : new()
 {
     return(await Request <U, T>(null, endPoint, null, null, default(T)));
 }
Example #9
0
 /// <summary>Makes a call to the MangoPay API.
 /// This generic method handles calls targeting collections of
 /// DTO instances. In order to process single objects,
 /// use <code>Request</code> method instead.
 /// </summary>
 /// <typeparam name="T">Type on behalf of which the request is being called.</typeparam>
 /// <param name="endPoint">An instance of <see cref="ApiEndPoint"/> that specifies API url and method to call</param>
 /// <param name="requestData">Collection of key-value pairs of request parameters.</param>
 /// <returns>Collection of DTO instances returned from API.</returns>
 public ListPaginated <T> RequestList <T>(ApiEndPoint endPoint, Dictionary <String, String> requestData)
     where T : new()
 {
     return(RequestList <T>(endPoint, requestData, null, null));
 }
Example #10
0
 /// <summary>Makes a call to the MangoPay API.
 /// This generic method handles calls targeting collections of
 /// DTO instances. In order to process single objects,
 /// use <code>Request</code> method instead.
 /// </summary>
 /// <typeparam name="T">Type on behalf of which the request is being called.</typeparam>
 /// <param name="endPoint">An instance of <see cref="ApiEndPoint"/> that specifies API url and method to call</param>
 /// <returns>Collection of DTO instances returned from API.</returns>
 public ListPaginated <T> RequestList <T>(ApiEndPoint endPoint)
     where T : new()
 {
     return(RequestList <T>(endPoint, null, null, null));
 }
Example #11
0
 /// <summary>Makes a call to the MangoPay API.
 /// This generic method handles calls targeting single
 /// DTO instances. In order to process collections of objects,
 /// use <code>RequestList</code> method instead.
 /// </summary>
 /// <typeparam name="U">Return type.</typeparam>
 /// <typeparam name="T">Type on behalf of which the request is being called.</typeparam>
 /// <param name="endPoint">An instance of <see cref="ApiEndPoint"/> that specifies API url and method to call</param>
 /// <param name="requestData">Collection of key-value pairs of request parameters.</param>
 /// <param name="pagination">Pagination object.</param>
 /// <returns>The DTO instance returned from API.</returns>
 public U Request <U, T>(ApiEndPoint endPoint, Dictionary <String, String> requestData, Pagination pagination)
     where U : new()
 {
     return(Request <U, T>(null, endPoint, requestData, pagination, default(T)));
 }
Example #12
0
 /// <summary>Makes a call to the MangoPay API.
 /// This generic method handles calls targeting single
 /// DTO instances. In order to process collections of objects,
 /// use <code>RequestList</code> method instead.
 /// </summary>
 /// <typeparam name="U">Return type.</typeparam>
 /// <typeparam name="T">Type on behalf of which the request is being called.</typeparam>
 /// <param name="endPoint">An instance of <see cref="ApiEndPoint"/> that specifies API url and method to call</param>
 /// <param name="requestType">HTTP request term, one of the GET, PUT or POST.</param>
 /// <param name="requestData">Collection of key-value pairs of request parameters.</param>
 /// <returns>The DTO instance returned from API.</returns>
 public U Request <U, T>(String idempotencyKey, ApiEndPoint endPoint, Dictionary <String, String> requestData)
     where U : new()
 {
     return(Request <U, T>(idempotencyKey, endPoint, requestData, null, default(T)));
 }
Example #13
0
 /// <summary>Makes a call to the MangoPay API.
 /// This generic method handles calls targeting single
 /// DTO instances. In order to process collections of objects,
 /// use <code>RequestList</code> method instead.
 /// </summary>
 /// <typeparam name="U">Return type.</typeparam>
 /// <typeparam name="T">Type on behalf of which the request is being called.</typeparam>
 /// <param name="idempotencyKey">Idempotency key for this request.</param>
 /// <param name="endPoint">An instance of <see cref="ApiEndPoint"/> that specifies API url and method to call</param>
 /// <returns>The DTO instance returned from API.</returns>
 public U Request <U, T>(String idempotencyKey, ApiEndPoint endPoint)
     where U : new()
 {
     return(Request <U, T>(idempotencyKey, endPoint, null, null, default(T)));
 }
Example #14
0
 /// <summary>Makes a call to the MangoPay API.
 /// This generic method handles calls targeting single
 /// DTO instances. In order to process collections of objects,
 /// use <code>RequestList</code> method instead.
 /// </summary>
 /// <typeparam name="U">Return type.</typeparam>
 /// <typeparam name="T">Type on behalf of which the request is being called.</typeparam>
 /// <param name="endPoint">An instance of <see cref="ApiEndPoint"/> that specifies API url and method to call</param>
 /// <returns>The DTO instance returned from API.</returns>
 public U Request <U, T>(ApiEndPoint endPoint)
     where U : new()
 {
     return(Request <U, T>(null, endPoint, null, null, default(T)));
 }