I'm doing everything as was told at the 

https://developers.google.com/adwords/api/docs/guides/budgets#removing_a_budget

. The code runs smoothly without an error, but I'm getting Budget with 
status "ENABLED" as a result. It seems like my remove operation didn't make 
any changes to the Budget.
Here goes the function which I'm using to remove the Budget and SOAP XMLs 
follow.
def remove_budget(budget_service, budget_id):
'''function to remove budget
https://developers.google.com/adwords/api/docs/guides/budgets#common_errors
we need this because there is a limitation on a number of the budget 
instances
we are allowed to create'''

# Construct operations to remove budget.

budget = {
'budgetId': budget_id,
'status': 'REMOVED'
}

operations = [{
'operator': 'SET',
'operand': budget

}]

budgets = budget_service.mutate(operations)

return budgets

# Here goes SOAP XML:
[2020-03-05 20:03:01,764 - googleads.soap - INFO] Request made: Service: 
"BudgetService" Method: "mutate" URL: 
"https://adwords.google.com/api/adwords/cm/v201809/BudgetService"; 
[2020-03-05 20:03:01,766 - googleads.soap - DEBUG] Outgoing request: 
{'SOAPAction': '""', 'Content-Type': 'text/xml; charset=utf-8', 
'authorization': 'REDACTED'} <soap-env:Envelope 
xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/";> 
<soap-env:Header> <ns0:RequestHeader 
xmlns:ns0="https://adwords.google.com/api/adwords/cm/v201809";> 
<ns0:clientCustomerId> ANONYMYZED </ns0:clientCustomerId> 
<ns0:developerToken>REDACTED</ns0:developerToken> <ns0:userAgent>Zavient 
(AwApi-Python, googleads/22.0.0, Python/3.7.3, zeep)</ns0:userAgent> 
<ns0:validateOnly>false</ns0:validateOnly> 
<ns0:partialFailure>false</ns0:partialFailure> </ns0:RequestHeader> 
</soap-env:Header> <soap-env:Body> <ns0:mutate 
xmlns:ns0="https://adwords.google.com/api/adwords/cm/v201809";> 
<ns0:operations> <ns0:operator>SET</ns0:operator> <ns0:operand> 
<ns0:budgetId>ANONYMYZED</ns0:budgetId> <ns0:status>REMOVED</ns0:status> 
</ns0:operand> </ns0:operations> </ns0:mutate> </soap-env:Body> 
</soap-env:Envelope> [2020-03-05 20:03:04,074 - googleads.soap - DEBUG] 
Incoming response: b'<soap:Envelope 
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/";>\n <soap:Header>\n 
<ResponseHeader 
xmlns="https://adwords.google.com/api/adwords/cm/v201809";>\n 
<requestId> ANONYMYZED </requestId>\n 
<serviceName>BudgetService</serviceName>\n 
<methodName>mutate</methodName>\n 
<operations>1</operations>\n <responseTime>218</responseTime>\n 
</ResponseHeader>\n </soap:Header>\n <soap:Body>\n 
<mutateResponse 
xmlns="https://adwords.google.com/api/adwords/cm/v201809";>\n 
<rval>\n <ListReturnValue.Type>BudgetReturnValue</ListReturnValue.Type>\n 
<value>\n 
<budgetId> ANONYMYZED </budgetId>\n 
<name> ANONYMYZED </name>\n 
<amount>\n <ComparableValue.Type>Money</ComparableValue.Type>\n 
<microAmount>1100000</microAmount>\n </amount>\n 
<deliveryMethod>STANDARD</deliveryMethod>\n 
<isExplicitlyShared>false</isExplicitlyShared>\n 
<status>ENABLED</status>\n </value>\n </rval>\n </mutateResponse>\n 
</soap:Body>\n</soap:Envelope>\n'

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to adwords-api@googlegroups.com
To unsubscribe from this group, send email to
adwords-api+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"AdWords API and Google Ads API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to adwords-api+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/adwords-api/d5b0192b-51f3-477c-a526-2b14c12d28e3%40googlegroups.com.

Reply via email to