Example #1
0
        /// <summary>
        /// List all users. List all the users in this instance of Firefly III.
        /// </summary>
        /// <exception cref="FireflyIII.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="page">The page number, if necessary. The default pagination is 50, so 50 users per page. (optional)</param>
        /// <returns>ApiResponse of UserArray</returns>
        public FireflyIII.Client.ApiResponse <UserArray> ListUserWithHttpInfo(int?page = default(int?))
        {
            FireflyIII.Client.RequestOptions localVarRequestOptions = new FireflyIII.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = FireflyIII.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = FireflyIII.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            if (page != null)
            {
                foreach (var _kvp in FireflyIII.Client.ClientUtils.ParameterToMultiMap("", "page", page))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }

            // authentication (firefly_iii_auth) required
            // oauth required
            if (!String.IsNullOrEmpty(this.Configuration.AccessToken))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken);
            }

            // make the HTTP request
            var localVarResponse = this.Client.Get <UserArray>("/api/v1/users", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("ListUser", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Example #2
0
        /// <summary>
        /// Store a new user Creates a new user. The data required can be submitted as a JSON body or as a list of parameters. The user will be given a random password, which they can reset using the \&quot;forgot password\&quot; function.
        /// </summary>
        /// <exception cref="FireflyIII.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="user">JSON array or key&#x3D;value pairs with the necessary user information. See the model for the exact specifications.</param>
        /// <returns>ApiResponse of UserSingle</returns>
        public FireflyIII.Client.ApiResponse <UserSingle> StoreUserWithHttpInfo(User user)
        {
            // verify the required parameter 'user' is set
            if (user == null)
            {
                throw new FireflyIII.Client.ApiException(400, "Missing required parameter 'user' when calling UsersApi->StoreUser");
            }

            FireflyIII.Client.RequestOptions localVarRequestOptions = new FireflyIII.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/json",
                "application/x-www-form-urlencoded"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = FireflyIII.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = FireflyIII.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            localVarRequestOptions.Data = user;

            // authentication (firefly_iii_auth) required
            // oauth required
            if (!String.IsNullOrEmpty(this.Configuration.AccessToken))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken);
            }

            // make the HTTP request
            var localVarResponse = this.Client.Post <UserSingle>("/api/v1/users", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("StoreUser", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Example #3
0
        /// <summary>
        /// Show info on a single import Show info on single import.
        /// </summary>
        /// <exception cref="FireflyIII.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="key">The job key of an import job.</param>
        /// <returns>ApiResponse of ImportJobSingle</returns>
        public FireflyIII.Client.ApiResponse <ImportJobSingle> GetImportWithHttpInfo(string key)
        {
            // verify the required parameter 'key' is set
            if (key == null)
            {
                throw new FireflyIII.Client.ApiException(400, "Missing required parameter 'key' when calling ImportApi->GetImport");
            }

            FireflyIII.Client.RequestOptions localVarRequestOptions = new FireflyIII.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = FireflyIII.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = FireflyIII.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }

            if (key != null)
            {
                localVarRequestOptions.PathParameters.Add("key", FireflyIII.Client.ClientUtils.ParameterToString(key)); // path parameter
            }
            // authentication (firefly_iii_auth) required
            // oauth required
            if (!String.IsNullOrEmpty(this.Configuration.AccessToken))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken);
            }

            // make the HTTP request
            var localVarResponse = this.Client.Get <ImportJobSingle>("/api/v1/import/{key}", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetImport", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Example #4
0
        /// <summary>
        /// Delete a user. Delete a user. You cannot delete the current user.
        /// </summary>
        /// <exception cref="FireflyIII.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="id">The user ID.</param>
        /// <returns>ApiResponse of Object(void)</returns>
        public FireflyIII.Client.ApiResponse <Object> DeleteUserWithHttpInfo(int id)
        {
            // verify the required parameter 'id' is set
            if (id == 0)
            {
                throw new FireflyIII.Client.ApiException(400, "Missing required parameter 'id' when calling UsersApi->DeleteUser");
            }

            FireflyIII.Client.RequestOptions localVarRequestOptions = new FireflyIII.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
            };

            var localVarContentType = FireflyIII.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = FireflyIII.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }


            localVarRequestOptions.PathParameters.Add("id", FireflyIII.Client.ClientUtils.ParameterToString(id));     // path parameter

            // authentication (firefly_iii_auth) required
            // oauth required
            if (!String.IsNullOrEmpty(this.Configuration.AccessToken))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken);
            }

            // make the HTTP request
            var localVarResponse = this.Client.Delete <Object>("/api/v1/users/{id}", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("DeleteUser", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Example #5
0
        /// <summary>
        /// List al imports List all imports
        /// </summary>
        /// <exception cref="FireflyIII.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="page">Page number. The default pagination is per 50 items. (optional)</param>
        /// <returns>Task of ApiResponse (ImportJobArray)</returns>
        public async System.Threading.Tasks.Task <FireflyIII.Client.ApiResponse <ImportJobArray> > ListImportAsyncWithHttpInfo(int?page = default(int?))
        {
            FireflyIII.Client.RequestOptions localVarRequestOptions = new FireflyIII.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            if (page != null)
            {
                foreach (var _kvp in FireflyIII.Client.ClientUtils.ParameterToMultiMap("", "page", page))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }

            // authentication (firefly_iii_auth) required
            // oauth required
            if (!String.IsNullOrEmpty(this.Configuration.AccessToken))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken);
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <ImportJobArray>("/api/v1/import/list", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("ListImport", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Example #6
0
        /// <summary>
        /// Get a single user. Gets all info of a single user.
        /// </summary>
        /// <exception cref="FireflyIII.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="id">The user ID.</param>
        /// <returns>Task of ApiResponse (UserSingle)</returns>
        public async System.Threading.Tasks.Task <FireflyIII.Client.ApiResponse <UserSingle> > GetUserAsyncWithHttpInfo(int id)
        {
            // verify the required parameter 'id' is set
            if (id == 0)
            {
                throw new FireflyIII.Client.ApiException(400, "Missing required parameter 'id' when calling UsersApi->GetUser");
            }


            FireflyIII.Client.RequestOptions localVarRequestOptions = new FireflyIII.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }


            localVarRequestOptions.PathParameters.Add("id", FireflyIII.Client.ClientUtils.ParameterToString(id));     // path parameter

            // authentication (firefly_iii_auth) required
            // oauth required
            if (!String.IsNullOrEmpty(this.Configuration.AccessToken))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken);
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <UserSingle>("/api/v1/users/{id}", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetUser", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Example #7
0
        /// <summary>
        /// Get Firefly III system configuration. Get system configuration
        /// </summary>
        /// <exception cref="FireflyIII.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>ApiResponse of SystemConfiguration</returns>
        public FireflyIII.Client.ApiResponse <SystemConfiguration> GetConfigurationWithHttpInfo()
        {
            FireflyIII.Client.RequestOptions localVarRequestOptions = new FireflyIII.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            var localVarContentType = FireflyIII.Client.ClientUtils.SelectHeaderContentType(_contentTypes);

            if (localVarContentType != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType);
            }

            var localVarAccept = FireflyIII.Client.ClientUtils.SelectHeaderAccept(_accepts);

            if (localVarAccept != null)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept);
            }


            // authentication (firefly_iii_auth) required
            // oauth required
            if (!String.IsNullOrEmpty(this.Configuration.AccessToken))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken);
            }

            // make the HTTP request
            var localVarResponse = this.Client.Get <SystemConfiguration>("/api/v1/configuration", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetConfiguration", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Example #8
0
        /// <summary>
        /// Get Firefly III system configuration. Get system configuration
        /// </summary>
        /// <exception cref="FireflyIII.Client.ApiException">Thrown when fails to make API call</exception>
        /// <returns>Task of ApiResponse (SystemConfiguration)</returns>
        public async System.Threading.Tasks.Task <FireflyIII.Client.ApiResponse <SystemConfiguration> > GetConfigurationAsyncWithHttpInfo()
        {
            FireflyIII.Client.RequestOptions localVarRequestOptions = new FireflyIII.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }


            // authentication (firefly_iii_auth) required
            // oauth required
            if (!String.IsNullOrEmpty(this.Configuration.AccessToken))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken);
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <SystemConfiguration>("/api/v1/configuration", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetConfiguration", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Example #9
0
        /// <summary>
        /// Get an exchange rate. Get an exchange rate. If Firefly III doesn&#39;t know the rate it will set the rate to 1.0.
        /// </summary>
        /// <exception cref="FireflyIII.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="from">The source currency code. If omitted, defaults to EUR. (optional)</param>
        /// <param name="to">The destination currency code. If omitted, defaults to USD. (optional)</param>
        /// <param name="date">The date you want to know the exchange rate on. (optional)</param>
        /// <param name="amount">The amount in the source currency. If added, Firefly III will calculate the amount in the destination currency. (optional)</param>
        /// <returns>Task of ApiResponse (ExchangeRate)</returns>
        public async System.Threading.Tasks.Task <FireflyIII.Client.ApiResponse <ExchangeRate> > GetExchangeRateAsyncWithHttpInfo(string from = default(string), string to = default(string), DateTime?date = default(DateTime?), double?amount = default(double?))
        {
            FireflyIII.Client.RequestOptions localVarRequestOptions = new FireflyIII.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            if (from != null)
            {
                foreach (var _kvp in FireflyIII.Client.ClientUtils.ParameterToMultiMap("", "from", from))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (to != null)
            {
                foreach (var _kvp in FireflyIII.Client.ClientUtils.ParameterToMultiMap("", "to", to))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (date != null)
            {
                foreach (var _kvp in FireflyIII.Client.ClientUtils.ParameterToMultiMap("", "date", date))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (amount != null)
            {
                foreach (var _kvp in FireflyIII.Client.ClientUtils.ParameterToMultiMap("", "amount", amount))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }

            // authentication (firefly_iii_auth) required
            // oauth required
            if (!String.IsNullOrEmpty(this.Configuration.AccessToken))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken);
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <ExchangeRate>("/api/v1/cer", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetExchangeRate", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Example #10
0
        /// <summary>
        /// Update configuration Set a single config value.
        /// </summary>
        /// <exception cref="FireflyIII.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="name">The configuration value name.</param>
        /// <param name="value">Can be a number or a boolean. This depends on the actual configuration value.</param>
        /// <returns>Task of ApiResponse (SystemConfiguration)</returns>
        public async System.Threading.Tasks.Task <FireflyIII.Client.ApiResponse <SystemConfiguration> > SetConfigurationAsyncWithHttpInfo(string name, string value)
        {
            // verify the required parameter 'name' is set
            if (name == null)
            {
                throw new FireflyIII.Client.ApiException(400, "Missing required parameter 'name' when calling ConfigurationApi->SetConfiguration");
            }

            // verify the required parameter 'value' is set
            if (value == null)
            {
                throw new FireflyIII.Client.ApiException(400, "Missing required parameter 'value' when calling ConfigurationApi->SetConfiguration");
            }


            FireflyIII.Client.RequestOptions localVarRequestOptions = new FireflyIII.Client.RequestOptions();

            String[] _contentTypes = new String[] {
                "application/x-www-form-urlencoded",
                "application/json"
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            if (name != null)
            {
                localVarRequestOptions.PathParameters.Add("name", FireflyIII.Client.ClientUtils.ParameterToString(name)); // path parameter
            }
            if (value != null)
            {
                localVarRequestOptions.FormParameters.Add("value", FireflyIII.Client.ClientUtils.ParameterToString(value)); // form parameter
            }

            // authentication (firefly_iii_auth) required
            // oauth required
            if (!String.IsNullOrEmpty(this.Configuration.AccessToken))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken);
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.PostAsync <SystemConfiguration>("/api/v1/configuration/{name}", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("SetConfiguration", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Example #11
0
        /// <summary>
        /// Returns basic sums of the users data. Returns basic sums of the users data, like the net worth, spent and earned amounts. It is multi-currency, and is in Firefly III to populate the dashboard.
        /// </summary>
        /// <exception cref="FireflyIII.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="start">A date formatted YYYY-MM-DD. </param>
        /// <param name="end">A date formatted YYYY-MM-DD. </param>
        /// <param name="currencyCode">A currency code like EUR or USD, to filter the result.  (optional)</param>
        /// <returns>Task of ApiResponse (List&lt;BasicSummaryEntry&gt;)</returns>
        public async System.Threading.Tasks.Task <FireflyIII.Client.ApiResponse <List <BasicSummaryEntry> > > GetBasicSummaryAsyncWithHttpInfo(DateTime start, DateTime end, string currencyCode = default(string))
        {
            // verify the required parameter 'start' is set
            if (start == null)
            {
                throw new FireflyIII.Client.ApiException(400, "Missing required parameter 'start' when calling SummaryApi->GetBasicSummary");
            }

            // verify the required parameter 'end' is set
            if (end == null)
            {
                throw new FireflyIII.Client.ApiException(400, "Missing required parameter 'end' when calling SummaryApi->GetBasicSummary");
            }


            FireflyIII.Client.RequestOptions localVarRequestOptions = new FireflyIII.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            if (start != null)
            {
                foreach (var _kvp in FireflyIII.Client.ClientUtils.ParameterToMultiMap("", "start", start))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (end != null)
            {
                foreach (var _kvp in FireflyIII.Client.ClientUtils.ParameterToMultiMap("", "end", end))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (currencyCode != null)
            {
                foreach (var _kvp in FireflyIII.Client.ClientUtils.ParameterToMultiMap("", "currency_code", currencyCode))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }

            // authentication (firefly_iii_auth) required
            // oauth required
            if (!String.IsNullOrEmpty(this.Configuration.AccessToken))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken);
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <List <BasicSummaryEntry> >("/api/v1/summary/basic", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("GetBasicSummary", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }
Example #12
0
        /// <summary>
        /// List all transactions related to the import job. The correlation is made through the tag. See summary
        /// </summary>
        /// <exception cref="FireflyIII.Client.ApiException">Thrown when fails to make API call</exception>
        /// <param name="key">The key of the import job</param>
        /// <param name="page">Page number. The default pagination is 50. (optional)</param>
        /// <param name="start">A date formatted YYYY-MM-DD. This is the start date of the selected range (inclusive).  (optional)</param>
        /// <param name="end">A date formatted YYYY-MM-DD. This is the end date of the selected range (inclusive).  (optional)</param>
        /// <param name="type">Optional filter on the transaction type(s) returned. (optional)</param>
        /// <returns>Task of ApiResponse (TransactionArray)</returns>
        public async System.Threading.Tasks.Task <FireflyIII.Client.ApiResponse <TransactionArray> > ListTransactionByImportAsyncWithHttpInfo(string key, int?page = default(int?), DateTime?start = default(DateTime?), DateTime?end = default(DateTime?), TransactionTypeFilter type = default(TransactionTypeFilter))
        {
            // verify the required parameter 'key' is set
            if (key == null)
            {
                throw new FireflyIII.Client.ApiException(400, "Missing required parameter 'key' when calling ImportApi->ListTransactionByImport");
            }


            FireflyIII.Client.RequestOptions localVarRequestOptions = new FireflyIII.Client.RequestOptions();

            String[] _contentTypes = new String[] {
            };

            // to determine the Accept header
            String[] _accepts = new String[] {
                "application/json"
            };

            foreach (var _contentType in _contentTypes)
            {
                localVarRequestOptions.HeaderParameters.Add("Content-Type", _contentType);
            }

            foreach (var _accept in _accepts)
            {
                localVarRequestOptions.HeaderParameters.Add("Accept", _accept);
            }

            if (key != null)
            {
                localVarRequestOptions.PathParameters.Add("key", FireflyIII.Client.ClientUtils.ParameterToString(key)); // path parameter
            }
            if (page != null)
            {
                foreach (var _kvp in FireflyIII.Client.ClientUtils.ParameterToMultiMap("", "page", page))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (start != null)
            {
                foreach (var _kvp in FireflyIII.Client.ClientUtils.ParameterToMultiMap("", "start", start))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (end != null)
            {
                foreach (var _kvp in FireflyIII.Client.ClientUtils.ParameterToMultiMap("", "end", end))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }
            if (type != 0)
            {
                foreach (var _kvp in FireflyIII.Client.ClientUtils.ParameterToMultiMap("", "type", type))
                {
                    foreach (var _kvpValue in _kvp.Value)
                    {
                        localVarRequestOptions.QueryParameters.Add(_kvp.Key, _kvpValue);
                    }
                }
            }

            // authentication (firefly_iii_auth) required
            // oauth required
            if (!String.IsNullOrEmpty(this.Configuration.AccessToken))
            {
                localVarRequestOptions.HeaderParameters.Add("Authorization", "Bearer " + this.Configuration.AccessToken);
            }

            // make the HTTP request

            var localVarResponse = await this.AsynchronousClient.GetAsync <TransactionArray>("/api/v1/import/{key}/transactions", localVarRequestOptions, this.Configuration);

            if (this.ExceptionFactory != null)
            {
                Exception _exception = this.ExceptionFactory("ListTransactionByImport", localVarResponse);
                if (_exception != null)
                {
                    throw _exception;
                }
            }

            return(localVarResponse);
        }