AdWordsApp.​SharedNegativeKeywordSelector

Fetches shared negative keyword. Supports filtering and sorting.

Typical usage:

 var sharedNegativeKeywordSelector = negativeKeywordList.negativeKeywords()
     .withCondition("KeywordText STARTS_WITH 'test'")
     .withLimit(1)
     .withIds([10,20])
     .orderBy("SharedSetId DESC");

 var sharedNegativeKeywordIterator = sharedNegativeKeywordSelector.get();

 while (sharedNegativeKeywordIterator.hasNext()) {
   var sharedNegativeKeyword = sharedNegativeKeywordIterator.next();
 }

Methods:

MemberTypeDescription
get AdWordsApp.SharedNegativeKeywordIterator Fetches the requested shared negative keyword and returns an iterator.
orderBy AdWordsApp.SharedNegativeKeywordSelector Specifies the ordering of the resulting entities.
withCondition AdWordsApp.SharedNegativeKeywordSelector Adds the specified condition to the selector in order to narrow down the results.
withLimit AdWordsApp.SharedNegativeKeywordSelector Specifies limit for the selector to use.

get()

Fetches the requested shared negative keyword and returns an iterator.

Return values:

TypeDescription
AdWordsApp.SharedNegativeKeywordIterator Iterator of the requested shared negative keyword.

orderBy(orderBy)

Specifies the ordering of the resulting entities. orderBy parameter can have one of the following forms:
  • orderBy("Name") - orders results by Name, in ascending order.
  • orderBy("SharedSetId ASC") - orders results by SharedSetId, in ascending order.
  • orderBy("Name DESC") - orders results by Name, in descending order.

See SharedNegativeKeywordSelector.withCondition(String) for enumeration of columns that can be used.

orderBy() may be called multiple times. Consider the following example:

 sharedNegativeKeywordSelector = sharedNegativeKeywordselector
     .orderBy("SharedSetId DESC");

The results will be ordered by SharedSetId in descending order.

Arguments:

NameTypeDescription
orderBy String Ordering to apply.

Return values:

TypeDescription
AdWordsApp.SharedNegativeKeywordSelector The selector with ordering applied.

withCondition(condition)

Adds the specified condition to the selector in order to narrow down the results.

Multiple conditions may be added to the same selector:

 sharedNegativeKeywordSelector = sharedNegativeKeywordSelector
     .withCondition("SharedSetId > 5")
     .withCondition("Name CONTAINS 'shared negative keyword'");
All specified conditions are AND-ed together. The above example will retrieve shared negative keyword that have a Shared Set Id greater than 5 and contains "shared negative keyword" in its name.

The parameter to be passed into this method must be of the following form:

"COLUMN_NAME OPERATOR VALUE"

Operators

The operator that can be used in a condition depends on the type of column.
  • For Long columns (e.g. SharedSetId):
    <  <=  >  >=  =  !=
  • For String columns (e.g. Name):
    =  !=  STARTS_WITH  STARTS_WITH_IGNORE_CASE  CONTAINS
     CONTAINS_IGNORE_CASE  DOES_NOT_CONTAIN  DOES_NOT_CONTAIN_IGNORE_CASE
Conditions using IN, NOT_IN, CONTAINS_ALL, CONTAINS_ANY and CONTAINS_NONE operators look as follows:
 withCondition("Name IN [Value1, Value2]")
Operators are case-sensitive: starts_with won't work.

Columns

All column names are case-sensitive, and so are all values of enumerated columns (such as Status).

Column Type Example
Shared Set Criterion Attributes
Id Long withCondition("Id = 5")
SharedSetId Long withCondition("SharedSetId = 5")
KeywordText String withCondition("KeywordText STARTS_WITH 'leather'")
KeywordMatchType String withCondition("KeywordMatchtype = PHRASE")

Arguments:

NameTypeDescription
condition String Condition to add to the selector.

Return values:

TypeDescription
AdWordsApp.SharedNegativeKeywordSelector The selector with the condition applied.

withLimit(limit)

Specifies limit for the selector to use. For instance, withLimit(50) returns only the first 50 entities.

Arguments:

NameTypeDescription
limit int How many entities to return.

Return values:

TypeDescription
AdWordsApp.SharedNegativeKeywordSelector The selector with limit applied.

发送以下问题的反馈:

此网页
AdWords Scripts
AdWords Scripts
需要帮助?请访问我们的支持页面