I'm working on an account that has two BudgetOrders associated with it. one of them is fully viewable in the UI, but the other one is only returned by an API call. I'm trying to figure out how to perform a REMOVE operation on this budget order in Ruby, but all the examples for how to do this are in Java. I'm not really a developer, so I can't quite explain it, but I'm not able to convert the Java approach into Ruby. I suspect this is because a BudgetOrder object in Java doesn't really have a counterpart in Ruby. Instea,d it look slike the Ruby way is to create a generic hash-type object and pass that into the desired service as an operand.
Here's my lame attempt at performing a REMOVE operation on this Budget Order in Ruby:
require 'adwords_api'
adwords = AdwordsApi::Api.new
budget_order_srv = adwords.service(:BudgetOrderService, :v201509)
budget_order = {
:id => 196272963
}
budget_order_operation = {:operator => 'REMOVE', :operand => budget_order}
return_budget_order = budget_order_srv.mutate([budget_order_operation])
puts return_budget_order
The error I get is this:
/home/pspringer/.rvm/gems/ruby-2.1.2/gems/google-ads-common-0.11.1/lib/ads_common/savon_service.rb:121:in `handle_errors': [BudgetOrderError.NO_SUCH_BUDGET_FOUND @ operations[0].operand, RequestError.INVALID_INPUT @ operations[0].operand.primaryBillingId, RequestError.INVALID_INPUT @ operations[0].operand.billingAccountId] (AdwordsApi::V201509::BudgetOrderService::ApiException)
from /home/pspringer/.rvm/gems/ruby-2.1.2/gems/google-ads-common-0.11.1/lib/ads_common/savon_service.rb:90:in `execute_action'
from /home/pspringer/.rvm/gems/ruby-2.1.2/gems/google-adwords-api-0.18.0/lib/adwords_api/v201509/budget_order_service.rb:37:in `mutate'
Google's API support people don't know enough Ruby to be able to help me, so I turn to you guys. Is there anyone who can give me any pointers? I think my problem is rooted in not understanding the fundamentals of how to use Ruby to talk to the Google API for something other than simple GET requests.
Thanks!