/// <summary> /// Single budget month Returns a single budget month /// </summary> /// <exception cref="YNAB.SDK.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="budgetId">The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).</param> /// <param name="month">The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC))</param> /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> /// <returns>Task of ApiResponse (MonthDetailResponse)</returns> public async System.Threading.Tasks.Task <YNAB.SDK.Client.ApiResponse <MonthDetailResponse> > GetBudgetMonthWithHttpInfoAsync(string budgetId, DateTime month, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { // verify the required parameter 'budgetId' is set if (budgetId == null) { throw new YNAB.SDK.Client.ApiException(400, "Missing required parameter 'budgetId' when calling MonthsApi->GetBudgetMonth"); } YNAB.SDK.Client.RequestOptions localVarRequestOptions = new YNAB.SDK.Client.RequestOptions(); String[] _contentTypes = new String[] { }; // to determine the Accept header String[] _accepts = new String[] { "application/json" }; var localVarContentType = YNAB.SDK.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = YNAB.SDK.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.PathParameters.Add("budget_id", YNAB.SDK.Client.ClientUtils.ParameterToString(budgetId)); // path parameter localVarRequestOptions.PathParameters.Add("month", YNAB.SDK.Client.ClientUtils.ParameterToString(month)); // path parameter // authentication (bearer) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request var localVarResponse = await this.AsynchronousClient.GetAsync <MonthDetailResponse>("/budgets/{budget_id}/months/{month}", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetBudgetMonth", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// List scheduled transactions Returns all scheduled transactions /// </summary> /// <exception cref="YNAB.SDK.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="budgetId">The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).</param> /// <param name="lastKnowledgeOfServer">The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. (optional)</param> /// <returns>ApiResponse of ScheduledTransactionsResponse</returns> public YNAB.SDK.Client.ApiResponse <ScheduledTransactionsResponse> GetScheduledTransactionsWithHttpInfo(string budgetId, long?lastKnowledgeOfServer = default(long?)) { // verify the required parameter 'budgetId' is set if (budgetId == null) { throw new YNAB.SDK.Client.ApiException(400, "Missing required parameter 'budgetId' when calling ScheduledTransactionsApi->GetScheduledTransactions"); } YNAB.SDK.Client.RequestOptions localVarRequestOptions = new YNAB.SDK.Client.RequestOptions(); String[] _contentTypes = new String[] { }; // to determine the Accept header String[] _accepts = new String[] { "application/json" }; var localVarContentType = YNAB.SDK.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = YNAB.SDK.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.PathParameters.Add("budget_id", YNAB.SDK.Client.ClientUtils.ParameterToString(budgetId)); // path parameter if (lastKnowledgeOfServer != null) { localVarRequestOptions.QueryParameters.Add(YNAB.SDK.Client.ClientUtils.ParameterToMultiMap("", "last_knowledge_of_server", lastKnowledgeOfServer)); } // authentication (bearer) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request var localVarResponse = this.Client.Get <ScheduledTransactionsResponse>("/budgets/{budget_id}/scheduled_transactions", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetScheduledTransactions", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// List payee locations Returns all payee locations /// </summary> /// <exception cref="YNAB.SDK.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="budgetId">The id of the budget (\"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget)</param> /// <returns>ApiResponse of PayeeLocationsResponse</returns> public YNAB.SDK.Client.ApiResponse <PayeeLocationsResponse> GetPayeeLocationsWithHttpInfo(string budgetId) { // verify the required parameter 'budgetId' is set if (budgetId == null) { throw new YNAB.SDK.Client.ApiException(400, "Missing required parameter 'budgetId' when calling PayeeLocationsApi->GetPayeeLocations"); } YNAB.SDK.Client.RequestOptions requestOptions = new YNAB.SDK.Client.RequestOptions(); String[] @contentTypes = new String[] { }; // to determine the Accept header String[] @accepts = new String[] { "application/json" }; var localVarContentType = YNAB.SDK.Client.ClientUtils.SelectHeaderContentType(@contentTypes); if (localVarContentType != null) { requestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = YNAB.SDK.Client.ClientUtils.SelectHeaderAccept(@accepts); if (localVarAccept != null) { requestOptions.HeaderParameters.Add("Accept", localVarAccept); } if (budgetId != null) { requestOptions.PathParameters.Add("budget_id", YNAB.SDK.Client.ClientUtils.ParameterToString(budgetId)); // path parameter } // authentication (bearer) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { requestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request var response = this.Client.Get <PayeeLocationsResponse>("/budgets/{budget_id}/payee_locations", requestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception exception = this.ExceptionFactory("GetPayeeLocations", response); if (exception != null) { throw exception; } } return(response); }
/// <summary> /// Single account Returns a single account /// </summary> /// <exception cref="YNAB.SDK.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="budgetId">The id of the budget. \"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget).</param> /// <param name="accountId">The id of the account</param> /// <returns>ApiResponse of AccountResponse</returns> public YNAB.SDK.Client.ApiResponse <AccountResponse> GetAccountByIdWithHttpInfo(string budgetId, Guid accountId) { // verify the required parameter 'budgetId' is set if (budgetId == null) { throw new YNAB.SDK.Client.ApiException(400, "Missing required parameter 'budgetId' when calling AccountsApi->GetAccountById"); } YNAB.SDK.Client.RequestOptions localVarRequestOptions = new YNAB.SDK.Client.RequestOptions(); String[] _contentTypes = new String[] { }; // to determine the Accept header String[] _accepts = new String[] { "application/json" }; var localVarContentType = YNAB.SDK.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = YNAB.SDK.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } localVarRequestOptions.PathParameters.Add("budget_id", YNAB.SDK.Client.ClientUtils.ParameterToString(budgetId)); // path parameter localVarRequestOptions.PathParameters.Add("account_id", YNAB.SDK.Client.ClientUtils.ParameterToString(accountId)); // path parameter // authentication (bearer) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request var localVarResponse = this.Client.Get <AccountResponse>("/budgets/{budget_id}/accounts/{account_id}", localVarRequestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetAccountById", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// List payee locations Returns all payee locations /// </summary> /// <exception cref="YNAB.SDK.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="budgetId">The id of the budget (\"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget)</param> /// <returns>Task of ApiResponse (PayeeLocationsResponse)</returns> public async System.Threading.Tasks.Task <YNAB.SDK.Client.ApiResponse <PayeeLocationsResponse> > GetPayeeLocationsAsyncWithHttpInfo(string budgetId) { // verify the required parameter 'budgetId' is set if (budgetId == null) { throw new YNAB.SDK.Client.ApiException(400, "Missing required parameter 'budgetId' when calling PayeeLocationsApi->GetPayeeLocations"); } YNAB.SDK.Client.RequestOptions requestOptions = new YNAB.SDK.Client.RequestOptions(); String[] @contentTypes = new String[] { }; // to determine the Accept header String[] @accepts = new String[] { "application/json" }; foreach (var contentType in @contentTypes) { requestOptions.HeaderParameters.Add("Content-Type", contentType); } foreach (var accept in @accepts) { requestOptions.HeaderParameters.Add("Accept", accept); } if (budgetId != null) { requestOptions.PathParameters.Add("budget_id", YNAB.SDK.Client.ClientUtils.ParameterToString(budgetId)); // path parameter } // authentication (bearer) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { requestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request var response = await this.AsynchronousClient.GetAsync <PayeeLocationsResponse>("/budgets/{budget_id}/payee_locations", requestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception exception = this.ExceptionFactory("GetPayeeLocations", response); if (exception != null) { throw exception; } } return(response); }
/// <summary> /// List budgets Returns budgets list with summary information /// </summary> /// <exception cref="YNAB.SDK.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="includeAccounts">Whether to include the list of budget accounts (optional)</param> /// <param name="cancellationToken">Cancellation Token to cancel the request.</param> /// <returns>Task of ApiResponse (BudgetSummaryResponse)</returns> public async System.Threading.Tasks.Task <YNAB.SDK.Client.ApiResponse <BudgetSummaryResponse> > GetBudgetsWithHttpInfoAsync(bool?includeAccounts = default(bool?), System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { YNAB.SDK.Client.RequestOptions localVarRequestOptions = new YNAB.SDK.Client.RequestOptions(); String[] _contentTypes = new String[] { }; // to determine the Accept header String[] _accepts = new String[] { "application/json" }; var localVarContentType = YNAB.SDK.Client.ClientUtils.SelectHeaderContentType(_contentTypes); if (localVarContentType != null) { localVarRequestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = YNAB.SDK.Client.ClientUtils.SelectHeaderAccept(_accepts); if (localVarAccept != null) { localVarRequestOptions.HeaderParameters.Add("Accept", localVarAccept); } if (includeAccounts != null) { localVarRequestOptions.QueryParameters.Add(YNAB.SDK.Client.ClientUtils.ParameterToMultiMap("", "include_accounts", includeAccounts)); } // authentication (bearer) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { localVarRequestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request var localVarResponse = await this.AsynchronousClient.GetAsync <BudgetSummaryResponse>("/budgets", localVarRequestOptions, this.Configuration, cancellationToken).ConfigureAwait(false); if (this.ExceptionFactory != null) { Exception _exception = this.ExceptionFactory("GetBudgets", localVarResponse); if (_exception != null) { throw _exception; } } return(localVarResponse); }
/// <summary> /// User info Returns authenticated user information /// </summary> /// <exception cref="YNAB.SDK.Client.ApiException">Thrown when fails to make API call</exception> /// <returns>ApiResponse of UserResponse</returns> public YNAB.SDK.Client.ApiResponse <UserResponse> GetUserWithHttpInfo() { YNAB.SDK.Client.RequestOptions requestOptions = new YNAB.SDK.Client.RequestOptions(); String[] @contentTypes = new String[] { }; // to determine the Accept header String[] @accepts = new String[] { "application/json" }; var localVarContentType = YNAB.SDK.Client.ClientUtils.SelectHeaderContentType(@contentTypes); if (localVarContentType != null) { requestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = YNAB.SDK.Client.ClientUtils.SelectHeaderAccept(@accepts); if (localVarAccept != null) { requestOptions.HeaderParameters.Add("Accept", localVarAccept); } // authentication (bearer) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { requestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request var response = this.Client.Get <UserResponse>("/user", requestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception exception = this.ExceptionFactory("GetUser", response); if (exception != null) { throw exception; } } return(response); }
/// <summary> /// User info Returns authenticated user information /// </summary> /// <exception cref="YNAB.SDK.Client.ApiException">Thrown when fails to make API call</exception> /// <returns>Task of ApiResponse (UserResponse)</returns> public async System.Threading.Tasks.Task <YNAB.SDK.Client.ApiResponse <UserResponse> > GetUserAsyncWithHttpInfo() { YNAB.SDK.Client.RequestOptions requestOptions = new YNAB.SDK.Client.RequestOptions(); String[] @contentTypes = new String[] { }; // to determine the Accept header String[] @accepts = new String[] { "application/json" }; foreach (var contentType in @contentTypes) { requestOptions.HeaderParameters.Add("Content-Type", contentType); } foreach (var accept in @accepts) { requestOptions.HeaderParameters.Add("Accept", accept); } // authentication (bearer) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { requestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request var response = await this.AsynchronousClient.GetAsync <UserResponse>("/user", requestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception exception = this.ExceptionFactory("GetUser", response); if (exception != null) { throw exception; } } return(response); }
/// <summary> /// List scheduled transactions Returns all scheduled transactions /// </summary> /// <exception cref="YNAB.SDK.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="budgetId">The id of the budget (\"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget)</param> /// <param name="lastKnowledgeOfServer">The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional)</param> /// <returns>Task of ApiResponse (ScheduledTransactionsResponse)</returns> public async System.Threading.Tasks.Task <YNAB.SDK.Client.ApiResponse <ScheduledTransactionsResponse> > GetScheduledTransactionsAsyncWithHttpInfo(string budgetId, long?lastKnowledgeOfServer = null) { // verify the required parameter 'budgetId' is set if (budgetId == null) { throw new YNAB.SDK.Client.ApiException(400, "Missing required parameter 'budgetId' when calling ScheduledTransactionsApi->GetScheduledTransactions"); } YNAB.SDK.Client.RequestOptions requestOptions = new YNAB.SDK.Client.RequestOptions(); String[] @contentTypes = new String[] { }; // to determine the Accept header String[] @accepts = new String[] { "application/json" }; foreach (var contentType in @contentTypes) { requestOptions.HeaderParameters.Add("Content-Type", contentType); } foreach (var accept in @accepts) { requestOptions.HeaderParameters.Add("Accept", accept); } if (budgetId != null) { requestOptions.PathParameters.Add("budget_id", YNAB.SDK.Client.ClientUtils.ParameterToString(budgetId)); // path parameter } if (lastKnowledgeOfServer != null) { foreach (var kvp in YNAB.SDK.Client.ClientUtils.ParameterToMultiMap("", "last_knowledge_of_server", lastKnowledgeOfServer)) { foreach (var value in kvp.Value) { requestOptions.QueryParameters.Add(kvp.Key, value); } } } // authentication (bearer) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { requestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request var response = await this.AsynchronousClient.GetAsync <ScheduledTransactionsResponse>("/budgets/{budget_id}/scheduled_transactions", requestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception exception = this.ExceptionFactory("GetScheduledTransactions", response); if (exception != null) { throw exception; } } return(response); }
/// <summary> /// Account list Returns all accounts /// </summary> /// <exception cref="YNAB.SDK.Client.ApiException">Thrown when fails to make API call</exception> /// <param name="budgetId">The id of the budget (\"last-used\" can be used to specify the last used budget and \"default\" can be used if default budget selection is enabled (see: https://api.youneedabudget.com/#oauth-default-budget)</param> /// <param name="lastKnowledgeOfServer">The starting server knowledge. If provided, only entities that have changed since last_knowledge_of_server will be included. (optional)</param> /// <returns>ApiResponse of AccountsResponse</returns> public YNAB.SDK.Client.ApiResponse <AccountsResponse> GetAccountsWithHttpInfo(string budgetId, long?lastKnowledgeOfServer = null) { // verify the required parameter 'budgetId' is set if (budgetId == null) { throw new YNAB.SDK.Client.ApiException(400, "Missing required parameter 'budgetId' when calling AccountsApi->GetAccounts"); } YNAB.SDK.Client.RequestOptions requestOptions = new YNAB.SDK.Client.RequestOptions(); String[] @contentTypes = new String[] { }; // to determine the Accept header String[] @accepts = new String[] { "application/json" }; var localVarContentType = YNAB.SDK.Client.ClientUtils.SelectHeaderContentType(@contentTypes); if (localVarContentType != null) { requestOptions.HeaderParameters.Add("Content-Type", localVarContentType); } var localVarAccept = YNAB.SDK.Client.ClientUtils.SelectHeaderAccept(@accepts); if (localVarAccept != null) { requestOptions.HeaderParameters.Add("Accept", localVarAccept); } if (budgetId != null) { requestOptions.PathParameters.Add("budget_id", YNAB.SDK.Client.ClientUtils.ParameterToString(budgetId)); // path parameter } if (lastKnowledgeOfServer != null) { foreach (var kvp in YNAB.SDK.Client.ClientUtils.ParameterToMultiMap("", "last_knowledge_of_server", lastKnowledgeOfServer)) { foreach (var value in kvp.Value) { requestOptions.QueryParameters.Add(kvp.Key, value); } } } // authentication (bearer) required if (!String.IsNullOrEmpty(this.Configuration.GetApiKeyWithPrefix("Authorization"))) { requestOptions.HeaderParameters.Add("Authorization", this.Configuration.GetApiKeyWithPrefix("Authorization")); } // make the HTTP request var response = this.Client.Get <AccountsResponse>("/budgets/{budget_id}/accounts", requestOptions, this.Configuration); if (this.ExceptionFactory != null) { Exception exception = this.ExceptionFactory("GetAccounts", response); if (exception != null) { throw exception; } } return(response); }