如何获得 AdgroupCriterion 的运算符(添加/删除/设置)?
MutateJobService mutateJobService = (MutateJobService)user.GetService(AdWordsService.v201309.MutateJobService);
JobResult jobResult = mutateJobService.getResult(new BulkMutateJobSelector { includeStats = true, jobIds = jobIDs });
SimpleMutateResult results = (SimpleMutateResult)jobResult.Item;
if (results.results != null)
{
for (int i = 0; i < results.results.Length; i++)
{
Operand operand = results.results[i];
var operandType = operand.Item.GetType();
if (operandType.BaseType.Name == "AdGroupCriterion")
{
AdGroupCriterion adGroupCriterion = (AdGroupCriterion)operand.Item;
// how to get operator (add/remove/set)?
}
}
}
这是我创建操作的方式:
public static AdGroupCriterionOperation GetAdgroupNegativeKeywordOperation(Keyword keyword, long adgroupID, Google.Api.Ads.AdWords.v201309.Operator operat)
{
NegativeAdGroupCriterion criterion = new NegativeAdGroupCriterion
{
adGroupId = adgroupID,
criterion = keyword
};
AdGroupCriterionOperation operation = new AdGroupCriterionOperation
{
@operator = operat,
operand = criterion
};
return operation;
}