NAME

Google::Ads::AdWords::Utilities::ServiceQueryBuilder

DESCRIPTION

A query builder for building AWQL queries for services.

ATTRIBUTES

The attributes properties may be set in new() and accessed using get_ATTRIBUTE methods:

select

An array of fields that are selected to be filtered on.

order_by

A hash of field names to ASC or DESC by which results will be ordered.

start_index

The start index of the results to be retunred.

page_size

The size of each page that to be returned.

METHODS

new

Constructor. The following data structure may be passed to new():

{ # Google::Ads::AdWords::Utilities::ReportQueryBuilder
  client # Required: Google::Ads::AdWords::Client
  query_builder # Optional: the Google::Ads::AdWords::Utilities::QueryBuilder
  to be copied
},

METHODS

select

Sets the specified list of fields to be added to a SELECT clause.

Parameters

  • A reference to an array of fields selected.

Returns

A query builder (this instance).

order_by

Adds the provided field to the order-by list with the provided direction.

Parameters

  • The specified field to be added to the order-by list.

  • If true, the newly created order-by clause will be in ascending order. Otherwise, it will be in descending order.

Returns

A query builder (this instance).

limit

Sets the LIMIT clause using the provided start index and page size.

Parameters

  • The specified start index for the LIMIT clause.

  • The page size for the LIMIT clause.

Returns

A query builder (this instance).

build

Builds the AWQL query.

Returns

A string that is the AWQL query.

has_next

Checks if there is still a page left to query. This is used in conjunction with next_page. The page_size is necessary when using DataService, as its paging mechanism is different from other services. For details, see https://developers.google.com/adwords/api/docs/guides/bid-landscapes#paging_through_results.

Parameters

  • The current page.

  • Optional: The total number of entries left.

Returns

Returns 1 if there is another page to process.

next_page

Sets the LIMIT clause of the AWQL to the next page. This is meant to be used with HasNext(). The page_size is necessary when using DataService, as its paging mechanism is different from other services. For details, see https://developers.google.com/adwords/api/docs/guides/bid-landscapes#paging_through_results.

Parameters

  • Optional: A different size in which to increment other than the current page size.