/// <summary>
        /// Gets all the Payment Requests from an existing user using HTTP GET.
        /// </summary>
        /// <param name="request">The UserPaymentRequest object</param>
        /// <returns>The UserPaymentResponse object</returns>
        /// <exception cref="ArgumentNullException">If the UserPaymentRequest object is null</exception>
        /// <exception cref="TikkieErrorResponseException">If the Tikkie API returns an error response.</exception>
        public async Task <UserPaymentResponse> GetUserPaymentRequestsAsync(UserPaymentRequest request)
        {
            if (request == null)
            {
                throw new ArgumentNullException(nameof(request));
            }

            var queryString = GetUserPaymentRequestQueryString(request);

            return(await _authorizedRequestsHandler
                   .GetOrExceptionAsync <UserPaymentResponse>($"{UrlProvider.GetUserPaymentsUrlSuffix(request.PlatformToken, request.UserToken)}{queryString}"));
        }
Esempio n. 2
0
        /// <summary>
        /// Gets all users from an existing platform of a certain API consumer using HTTP GET.
        /// </summary>
        /// <param name="platformToken">The platform token to fetch the users from</param>
        /// <returns>An array of UserResponse object.</returns>
        /// <exception cref="ArgumentException">If the argument is null or empty.</exception>
        /// <exception cref="TikkieErrorResponseException">If the Tikkie API returns an error response.</exception>
        public async Task <UserResponse[]> GetUsersAsync(string platformToken)
        {
            if (string.IsNullOrEmpty(platformToken))
            {
                throw new ArgumentException(nameof(platformToken));
            }

            return(await _authorizedRequestsHandler
                   .GetOrExceptionAsync <UserResponse[]>(UrlProvider.UserUrlSuffix(platformToken)));
        }
 /// <summary>
 /// Gets all the existing Platforms created for a certain API consumer using HTTP GET.
 /// </summary>
 /// <returns>An array of PlatformResponse object.</returns>
 /// <exception cref="TikkieErrorResponseException">If the Tikkie API returns an error response.</exception>
 public async Task <PlatformResponse[]> GetPlatformsAsync()
 {
     return(await _authorizedRequestsHandler
            .GetOrExceptionAsync <PlatformResponse[]>(UrlProvider.PlatformUrlSuffix));
 }