class OrderCloud::SpendingAccountApi
Attributes
Public Class Methods
# File lib/order_cloud/api/spending_account_api.rb, line 30 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
@param buyer_id ID of the buyer. @param spending_account @param [Hash] opts the optional parameters @return [SpendingAccount]
# File lib/order_cloud/api/spending_account_api.rb, line 40 def create(buyer_id, spending_account, opts = {}) data, _status_code, _headers = create_with_http_info(buyer_id, spending_account, opts) return data end
@param buyer_id ID of the buyer. @param spending_account @param [Hash] opts the optional parameters @return [Array<(SpendingAccount
, Fixnum, Hash)>] SpendingAccount
data, response status code and response headers
# File lib/order_cloud/api/spending_account_api.rb, line 51 def create_with_http_info(buyer_id, spending_account, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SpendingAccountApi.create ..." end # verify the required parameter 'buyer_id' is set fail ArgumentError, "Missing the required parameter 'buyer_id' when calling SpendingAccountApi.create" if buyer_id.nil? # verify the required parameter 'spending_account' is set fail ArgumentError, "Missing the required parameter 'spending_account' when calling SpendingAccountApi.create" if spending_account.nil? # resource path local_var_path = "/buyers/{buyerID}/spendingaccounts".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'text/plain; charset=utf-8'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(spending_account) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SpendingAccount') if @api_client.config.debugging @api_client.config.logger.debug "API called: SpendingAccountApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
@param buyer_id ID of the buyer. @param spending_account_id ID of the spending account. @param [Hash] opts the optional parameters @return [nil]
# File lib/order_cloud/api/spending_account_api.rb, line 101 def delete(buyer_id, spending_account_id, opts = {}) delete_with_http_info(buyer_id, spending_account_id, opts) return nil end
@param buyer_id ID of the buyer. @param spending_account_id ID of the spending account. @param [Hash] opts the optional parameters @option opts [String] :user_id ID of the user. @option opts [String] :user_group_id ID of the user group. @return [nil]
# File lib/order_cloud/api/spending_account_api.rb, line 163 def delete_assignment(buyer_id, spending_account_id, opts = {}) delete_assignment_with_http_info(buyer_id, spending_account_id, opts) return nil end
@param buyer_id ID of the buyer. @param spending_account_id ID of the spending account. @param [Hash] opts the optional parameters @option opts [String] :user_id ID of the user. @option opts [String] :user_group_id ID of the user group. @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/order_cloud/api/spending_account_api.rb, line 176 def delete_assignment_with_http_info(buyer_id, spending_account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SpendingAccountApi.delete_assignment ..." end # verify the required parameter 'buyer_id' is set fail ArgumentError, "Missing the required parameter 'buyer_id' when calling SpendingAccountApi.delete_assignment" if buyer_id.nil? # verify the required parameter 'spending_account_id' is set fail ArgumentError, "Missing the required parameter 'spending_account_id' when calling SpendingAccountApi.delete_assignment" if spending_account_id.nil? # resource path local_var_path = "/buyers/{buyerID}/spendingaccounts/{spendingAccountID}/assignments".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s).sub('{' + 'spendingAccountID' + '}', spending_account_id.to_s) # query parameters query_params = {} query_params[:'userID'] = opts[:'user_id'] if !opts[:'user_id'].nil? query_params[:'userGroupID'] = opts[:'user_group_id'] if !opts[:'user_group_id'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'text/plain; charset=utf-8'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: SpendingAccountApi#delete_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
@param buyer_id ID of the buyer. @param spending_account_id ID of the spending account. @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/order_cloud/api/spending_account_api.rb, line 112 def delete_with_http_info(buyer_id, spending_account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SpendingAccountApi.delete ..." end # verify the required parameter 'buyer_id' is set fail ArgumentError, "Missing the required parameter 'buyer_id' when calling SpendingAccountApi.delete" if buyer_id.nil? # verify the required parameter 'spending_account_id' is set fail ArgumentError, "Missing the required parameter 'spending_account_id' when calling SpendingAccountApi.delete" if spending_account_id.nil? # resource path local_var_path = "/buyers/{buyerID}/spendingaccounts/{spendingAccountID}".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s).sub('{' + 'spendingAccountID' + '}', spending_account_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'text/plain; charset=utf-8'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: SpendingAccountApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
@param buyer_id ID of the buyer. @param spending_account_id ID of the spending account. @param [Hash] opts the optional parameters @return [SpendingAccount]
# File lib/order_cloud/api/spending_account_api.rb, line 227 def get(buyer_id, spending_account_id, opts = {}) data, _status_code, _headers = get_with_http_info(buyer_id, spending_account_id, opts) return data end
@param buyer_id ID of the buyer. @param spending_account_id ID of the spending account. @param [Hash] opts the optional parameters @return [Array<(SpendingAccount
, Fixnum, Hash)>] SpendingAccount
data, response status code and response headers
# File lib/order_cloud/api/spending_account_api.rb, line 238 def get_with_http_info(buyer_id, spending_account_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SpendingAccountApi.get ..." end # verify the required parameter 'buyer_id' is set fail ArgumentError, "Missing the required parameter 'buyer_id' when calling SpendingAccountApi.get" if buyer_id.nil? # verify the required parameter 'spending_account_id' is set fail ArgumentError, "Missing the required parameter 'spending_account_id' when calling SpendingAccountApi.get" if spending_account_id.nil? # resource path local_var_path = "/buyers/{buyerID}/spendingaccounts/{spendingAccountID}".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s).sub('{' + 'spendingAccountID' + '}', spending_account_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'text/plain; charset=utf-8'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SpendingAccount') if @api_client.config.debugging @api_client.config.logger.debug "API called: SpendingAccountApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
@param buyer_id ID of the buyer. @param [Hash] opts the optional parameters @option opts [String] :search Search of the spending account. @option opts [Array<String>] :search_on Search on of the spending account. @option opts [Array<String>] :sort_by Sort by of the spending account. @option opts [Integer] :page Page of the spending account. @option opts [Integer] :page_size Page size of the spending account. @option opts [Hash<String, String>] :filters Filters of the spending account. @return [ListSpendingAccount]
# File lib/order_cloud/api/spending_account_api.rb, line 293 def list(buyer_id, opts = {}) data, _status_code, _headers = list_with_http_info(buyer_id, opts) return data end
@param buyer_id ID of the buyer. @param [Hash] opts the optional parameters @option opts [String] :spending_account_id ID of the spending account. @option opts [String] :user_id ID of the user. @option opts [String] :user_group_id ID of the user group. @option opts [String] :level Level of the spending account. @option opts [Integer] :page Page of the spending account. @option opts [Integer] :page_size Page size of the spending account. @return [ListSpendingAccountAssignment]
# File lib/order_cloud/api/spending_account_api.rb, line 368 def list_assignments(buyer_id, opts = {}) data, _status_code, _headers = list_assignments_with_http_info(buyer_id, opts) return data end
@param buyer_id ID of the buyer. @param [Hash] opts the optional parameters @option opts [String] :spending_account_id ID of the spending account. @option opts [String] :user_id ID of the user. @option opts [String] :user_group_id ID of the user group. @option opts [String] :level Level of the spending account. @option opts [Integer] :page Page of the spending account. @option opts [Integer] :page_size Page size of the spending account. @return [Array<(ListSpendingAccountAssignment
, Fixnum, Hash)>] ListSpendingAccountAssignment
data, response status code and response headers
# File lib/order_cloud/api/spending_account_api.rb, line 384 def list_assignments_with_http_info(buyer_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SpendingAccountApi.list_assignments ..." end # verify the required parameter 'buyer_id' is set fail ArgumentError, "Missing the required parameter 'buyer_id' when calling SpendingAccountApi.list_assignments" if buyer_id.nil? # resource path local_var_path = "/buyers/{buyerID}/spendingaccounts/assignments".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s) # query parameters query_params = {} query_params[:'spendingAccountID'] = opts[:'spending_account_id'] if !opts[:'spending_account_id'].nil? query_params[:'userID'] = opts[:'user_id'] if !opts[:'user_id'].nil? query_params[:'userGroupID'] = opts[:'user_group_id'] if !opts[:'user_group_id'].nil? query_params[:'level'] = opts[:'level'] if !opts[:'level'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'text/plain; charset=utf-8'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ListSpendingAccountAssignment') if @api_client.config.debugging @api_client.config.logger.debug "API called: SpendingAccountApi#list_assignments\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
@param buyer_id ID of the buyer. @param [Hash] opts the optional parameters @option opts [String] :search Search of the spending account. @option opts [Array<String>] :search_on Search on of the spending account. @option opts [Array<String>] :sort_by Sort by of the spending account. @option opts [Integer] :page Page of the spending account. @option opts [Integer] :page_size Page size of the spending account. @option opts [Hash<String, String>] :filters Filters of the spending account. @return [Array<(ListSpendingAccount
, Fixnum, Hash)>] ListSpendingAccount
data, response status code and response headers
# File lib/order_cloud/api/spending_account_api.rb, line 309 def list_with_http_info(buyer_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SpendingAccountApi.list ..." end # verify the required parameter 'buyer_id' is set fail ArgumentError, "Missing the required parameter 'buyer_id' when calling SpendingAccountApi.list" if buyer_id.nil? # resource path local_var_path = "/buyers/{buyerID}/spendingaccounts".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s) # query parameters query_params = {} query_params[:'search'] = opts[:'search'] if !opts[:'search'].nil? query_params[:'searchOn'] = @api_client.build_collection_param(opts[:'search_on'], :csv) if !opts[:'search_on'].nil? query_params[:'sortBy'] = @api_client.build_collection_param(opts[:'sort_by'], :csv) if !opts[:'sort_by'].nil? query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil? query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil? query_params[:'filters'] = opts[:'filters'] if !opts[:'filters'].nil? # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'text/plain; charset=utf-8'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'ListSpendingAccount') if @api_client.config.debugging @api_client.config.logger.debug "API called: SpendingAccountApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
@param buyer_id ID of the buyer. @param spending_account_id ID of the spending account. @param spending_account @param [Hash] opts the optional parameters @return [SpendingAccount]
# File lib/order_cloud/api/spending_account_api.rb, line 439 def patch(buyer_id, spending_account_id, spending_account, opts = {}) data, _status_code, _headers = patch_with_http_info(buyer_id, spending_account_id, spending_account, opts) return data end
@param buyer_id ID of the buyer. @param spending_account_id ID of the spending account. @param spending_account @param [Hash] opts the optional parameters @return [Array<(SpendingAccount
, Fixnum, Hash)>] SpendingAccount
data, response status code and response headers
# File lib/order_cloud/api/spending_account_api.rb, line 451 def patch_with_http_info(buyer_id, spending_account_id, spending_account, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SpendingAccountApi.patch ..." end # verify the required parameter 'buyer_id' is set fail ArgumentError, "Missing the required parameter 'buyer_id' when calling SpendingAccountApi.patch" if buyer_id.nil? # verify the required parameter 'spending_account_id' is set fail ArgumentError, "Missing the required parameter 'spending_account_id' when calling SpendingAccountApi.patch" if spending_account_id.nil? # verify the required parameter 'spending_account' is set fail ArgumentError, "Missing the required parameter 'spending_account' when calling SpendingAccountApi.patch" if spending_account.nil? # resource path local_var_path = "/buyers/{buyerID}/spendingaccounts/{spendingAccountID}".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s).sub('{' + 'spendingAccountID' + '}', spending_account_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'text/plain; charset=utf-8'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(spending_account) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SpendingAccount') if @api_client.config.debugging @api_client.config.logger.debug "API called: SpendingAccountApi#patch\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
@param buyer_id ID of the buyer. @param assignment @param [Hash] opts the optional parameters @return [nil]
# File lib/order_cloud/api/spending_account_api.rb, line 503 def save_assignment(buyer_id, assignment, opts = {}) save_assignment_with_http_info(buyer_id, assignment, opts) return nil end
@param buyer_id ID of the buyer. @param assignment @param [Hash] opts the optional parameters @return [Array<(nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/order_cloud/api/spending_account_api.rb, line 514 def save_assignment_with_http_info(buyer_id, assignment, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SpendingAccountApi.save_assignment ..." end # verify the required parameter 'buyer_id' is set fail ArgumentError, "Missing the required parameter 'buyer_id' when calling SpendingAccountApi.save_assignment" if buyer_id.nil? # verify the required parameter 'assignment' is set fail ArgumentError, "Missing the required parameter 'assignment' when calling SpendingAccountApi.save_assignment" if assignment.nil? # resource path local_var_path = "/buyers/{buyerID}/spendingaccounts/assignments".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'text/plain; charset=utf-8'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(assignment) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: SpendingAccountApi#save_assignment\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
@param buyer_id ID of the buyer. @param spending_account_id ID of the spending account. @param spending_account @param [Hash] opts the optional parameters @return [SpendingAccount]
# File lib/order_cloud/api/spending_account_api.rb, line 564 def update(buyer_id, spending_account_id, spending_account, opts = {}) data, _status_code, _headers = update_with_http_info(buyer_id, spending_account_id, spending_account, opts) return data end
@param buyer_id ID of the buyer. @param spending_account_id ID of the spending account. @param spending_account @param [Hash] opts the optional parameters @return [Array<(SpendingAccount
, Fixnum, Hash)>] SpendingAccount
data, response status code and response headers
# File lib/order_cloud/api/spending_account_api.rb, line 576 def update_with_http_info(buyer_id, spending_account_id, spending_account, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug "Calling API: SpendingAccountApi.update ..." end # verify the required parameter 'buyer_id' is set fail ArgumentError, "Missing the required parameter 'buyer_id' when calling SpendingAccountApi.update" if buyer_id.nil? # verify the required parameter 'spending_account_id' is set fail ArgumentError, "Missing the required parameter 'spending_account_id' when calling SpendingAccountApi.update" if spending_account_id.nil? # verify the required parameter 'spending_account' is set fail ArgumentError, "Missing the required parameter 'spending_account' when calling SpendingAccountApi.update" if spending_account.nil? # resource path local_var_path = "/buyers/{buyerID}/spendingaccounts/{spendingAccountID}".sub('{format}','json').sub('{' + 'buyerID' + '}', buyer_id.to_s).sub('{' + 'spendingAccountID' + '}', spending_account_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) local_header_accept = ['application/json'] local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result # HTTP header 'Content-Type' local_header_content_type = ['application/json', 'text/plain; charset=utf-8'] header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(spending_account) auth_names = ['oauth2'] data, status_code, headers = @api_client.call_api(:PUT, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => 'SpendingAccount') if @api_client.config.debugging @api_client.config.logger.debug "API called: SpendingAccountApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end