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 operation = CampaignOperation()
operation.operand = campaign
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?