The code example should look like this sorry:
fun ChangeKeywordStatus(keywordId: Long, adGroupId: Long) {
val keyword = Criterion()
keyword.id = keywordId
val biddableAdGroupCriterion = BiddableAdGroupCriterion()
biddableAdGroupCriterion.adGroupId = adGroupId
biddableAdGroupCriterion.criterion = keyword
//WHAT DO I DO HERE?
// Create operations.
val operation = AdGroupCriterionOperation()
operation.operand = biddableAdGroupCriterion
operation.operator = Operator.SET
val result = campaignService.mutate(arrayOf(operation))
}
On Tuesday, October 24, 2017 at 6:56:15 AM UTC-7, [email protected] wrote:
>
> I'm trying to create a function in a Kotlin application (which uses the
> Java API) that will update the status of the keyword. By looking over the
> documentation i've been able to get close, but I'm not clear on what
> exactly I need to do to set the status. This is what I have so far:
>
> fun ChangeKeywordStatus(keywordId: Long, adGroupId: Long) {
> val keyword = Criterion()
> keyword.id = keywordId
>
>
> val biddableAdGroupCriterion = BiddableAdGroupCriterion()
> biddableAdGroupCriterion.adGroupId = adGroupId
> biddableAdGroupCriterion.criterion = keyword
>
> //WHAT DO I DO HERE?
>
>
> // Create operations.
> val operation = AdGroupCriterionOperation()
> operation.operand = biddableAdGroupCriterion
> operation.operator = Operator.SET
>
> val result = campaignService.mutate(arrayOf(operation))
> }
>
> I've looked at the Criterion class but there doesn't appear to be any
> thing that handles status. What step am I missing to set the status of my
> keyword?
>
--
--
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and Google+:
https://googleadsdeveloper.blogspot.com/
https://plus.google.com/+GoogleAdsDevelopers/posts
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
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 Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at https://groups.google.com/group/adwords-api.
To view this discussion on the web visit
https://groups.google.com/d/msgid/adwords-api/42b433f6-b9d3-414c-976e-08a398c612df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.