def get_budget_by_id_with_http_info(self, budget_id, **kwargs): # noqa: E501 """Single budget # noqa: E501 Returns a single budget with all related entities. This resource is effectively a full budget export. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_budget_by_id_with_http_info(budget_id, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str budget_id: 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) (required) :param int last_knowledge_of_server: The starting server knowledge. If provided, only entities that have changed since `last_knowledge_of_server` will be included. :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(BudgetDetailResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['budget_id', 'last_knowledge_of_server'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_budget_by_id" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'budget_id' is set if self.api_client.client_side_validation and ('budget_id' not in local_var_params or # noqa: E501 local_var_params['budget_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `budget_id` when calling `get_budget_by_id`") # noqa: E501 collection_formats = {} path_params = {} if 'budget_id' in local_var_params: path_params['budget_id'] = local_var_params['budget_id'] # noqa: E501 query_params = [] if 'last_knowledge_of_server' in local_var_params and local_var_params['last_knowledge_of_server'] is not None: # noqa: E501 query_params.append(('last_knowledge_of_server', local_var_params['last_knowledge_of_server'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['bearer'] # noqa: E501 return self.api_client.call_api( '/budgets/{budget_id}', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='BudgetDetailResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def bulk_create_transactions_with_http_info(self, budget_id, transactions, **kwargs): # noqa: E501 """Bulk create transactions # noqa: E501 Creates multiple transactions. Although this endpoint is still supported, it is recommended to use 'POST /budgets/{budget_id}/transactions' to create multiple transactions. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.bulk_create_transactions_with_http_info(budget_id, transactions, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str budget_id: 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) (required) :param BulkTransactions transactions: The list of transactions to create (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(BulkResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['budget_id', 'transactions'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError("Got an unexpected keyword argument '%s'" " to method bulk_create_transactions" % key) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'budget_id' is set if self.api_client.client_side_validation and ( 'budget_id' not in local_var_params or # noqa: E501 local_var_params['budget_id'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `budget_id` when calling `bulk_create_transactions`" ) # noqa: E501 # verify the required parameter 'transactions' is set if self.api_client.client_side_validation and ( 'transactions' not in local_var_params or # noqa: E501 local_var_params['transactions'] is None): # noqa: E501 raise ApiValueError( "Missing the required parameter `transactions` when calling `bulk_create_transactions`" ) # noqa: E501 collection_formats = {} path_params = {} if 'budget_id' in local_var_params: path_params['budget_id'] = local_var_params[ 'budget_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'transactions' in local_var_params: body_params = local_var_params['transactions'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['bearer'] # noqa: E501 return self.api_client.call_api( '/budgets/{budget_id}/transactions/bulk', 'POST', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='BulkResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get( '_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def get_budgets_with_http_info(self, **kwargs): # noqa: E501 """List budgets # noqa: E501 Returns budgets list with summary information # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.get_budgets_with_http_info(async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param bool include_accounts: Whether to include the list of budget accounts :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(BudgetSummaryResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['include_accounts'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method get_budgets" % key ) local_var_params[key] = val del local_var_params['kwargs'] collection_formats = {} path_params = {} query_params = [] if 'include_accounts' in local_var_params and local_var_params['include_accounts'] is not None: # noqa: E501 query_params.append(('include_accounts', local_var_params['include_accounts'])) # noqa: E501 header_params = {} form_params = [] local_var_files = {} body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['bearer'] # noqa: E501 return self.api_client.call_api( '/budgets', 'GET', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='BudgetSummaryResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)
def update_month_category_with_http_info(self, budget_id, month, category_id, data, **kwargs): # noqa: E501 """Update a category for a specific month # noqa: E501 Update a category for a specific month. Only `budgeted` amount can be updated. # noqa: E501 This method makes a synchronous HTTP request by default. To make an asynchronous HTTP request, please pass async_req=True >>> thread = api.update_month_category_with_http_info(budget_id, month, category_id, data, async_req=True) >>> result = thread.get() :param async_req bool: execute request asynchronously :param str budget_id: 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) (required) :param date month: The budget month in ISO format (e.g. 2016-12-01) (\"current\" can also be used to specify the current calendar month (UTC)) (required) :param str category_id: The id of the category (required) :param SaveMonthCategoryWrapper data: The category to update. Only `budgeted` amount can be updated and any other fields specified will be ignored. (required) :param _return_http_data_only: response data without head status code and headers :param _preload_content: if False, the urllib3.HTTPResponse object will be returned without reading/decoding response data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. :return: tuple(SaveCategoryResponse, status_code(int), headers(HTTPHeaderDict)) If the method is called asynchronously, returns the request thread. """ local_var_params = locals() all_params = ['budget_id', 'month', 'category_id', 'data'] # noqa: E501 all_params.append('async_req') all_params.append('_return_http_data_only') all_params.append('_preload_content') all_params.append('_request_timeout') for key, val in six.iteritems(local_var_params['kwargs']): if key not in all_params: raise ApiTypeError( "Got an unexpected keyword argument '%s'" " to method update_month_category" % key ) local_var_params[key] = val del local_var_params['kwargs'] # verify the required parameter 'budget_id' is set if self.api_client.client_side_validation and ('budget_id' not in local_var_params or # noqa: E501 local_var_params['budget_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `budget_id` when calling `update_month_category`") # noqa: E501 # verify the required parameter 'month' is set if self.api_client.client_side_validation and ('month' not in local_var_params or # noqa: E501 local_var_params['month'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `month` when calling `update_month_category`") # noqa: E501 # verify the required parameter 'category_id' is set if self.api_client.client_side_validation and ('category_id' not in local_var_params or # noqa: E501 local_var_params['category_id'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `category_id` when calling `update_month_category`") # noqa: E501 # verify the required parameter 'data' is set if self.api_client.client_side_validation and ('data' not in local_var_params or # noqa: E501 local_var_params['data'] is None): # noqa: E501 raise ApiValueError("Missing the required parameter `data` when calling `update_month_category`") # noqa: E501 collection_formats = {} path_params = {} if 'budget_id' in local_var_params: path_params['budget_id'] = local_var_params['budget_id'] # noqa: E501 if 'month' in local_var_params: path_params['month'] = local_var_params['month'] # noqa: E501 if 'category_id' in local_var_params: path_params['category_id'] = local_var_params['category_id'] # noqa: E501 query_params = [] header_params = {} form_params = [] local_var_files = {} body_params = None if 'data' in local_var_params: body_params = local_var_params['data'] # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['bearer'] # noqa: E501 return self.api_client.call_api( '/budgets/{budget_id}/months/{month}/categories/{category_id}', 'PATCH', path_params, query_params, header_params, body=body_params, post_params=form_params, files=local_var_files, response_type='SaveCategoryResponse', # noqa: E501 auth_settings=auth_settings, async_req=local_var_params.get('async_req'), _return_http_data_only=local_var_params.get('_return_http_data_only'), # noqa: E501 _preload_content=local_var_params.get('_preload_content', True), _request_timeout=local_var_params.get('_request_timeout'), collection_formats=collection_formats)