Ads API .NET library
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
Google.Api.Ads.AdManager.Util.v202108.StatementBuilder Class Reference

A utility class that allows for statements to be constructed in parts. Typical usage is: More...

Public Member Functions

 StatementBuilder ()
 Constructs a statement builder for partial query building. More...
 
StatementBuilder Select (String columns)
 Sets the statement SELECT clause in the form of "a,b". Only necessary for statements being sent to the PublisherQueryLanguageService. The "SELECT " keyword will be ignored. More...
 
StatementBuilder From (String table)
 Sets the statement FROM clause in the form of "table". Only necessary for statements being sent to the PublisherQueryLanguageService. The "FROM " keyword will be ignored. More...
 
StatementBuilder Where (String conditions)
 Sets the statement WHERE clause in the form of More...
 
StatementBuilder Limit (Int32 count)
 Sets the statement LIMIT clause in the form of More...
 
StatementBuilder Offset (Int32 count)
 Sets the statement OFFSET clause in the form of More...
 
StatementBuilder IncreaseOffsetBy (Int32 amount)
 Increases the offset by the given amount. More...
 
int GetOffset ()
 Gets the curent offset More...
 
StatementBuilder RemoveLimitAndOffset ()
 Removes the limit and offset from the query. More...
 
StatementBuilder OrderBy (String orderBy)
 Sets the statement ORDER BY clause in the form of More...
 
StatementBuilder AddValue (string key, string value)
 Adds a new string value to the list of query parameters. More...
 
StatementBuilder AddValue (string key, bool value)
 Adds a new boolean value to the list of query parameters. More...
 
StatementBuilder AddValue (string key, decimal value)
 Adds a new decimal value to the list of query parameters. More...
 
StatementBuilder AddValue (string key, DateTime value)
 Adds a new DateTime value to the list of query parameters. More...
 
StatementBuilder AddValue (string key, Date value)
 Adds a new Date value to the list of query parameters. More...
 
Statement ToStatement ()
 Gets the Statement representing the state of this statement builder. More...
 

Public Attributes

const int SUGGESTED_PAGE_LIMIT = 500
 The suggested default page size. More...
 

Detailed Description

A utility class that allows for statements to be constructed in parts. Typical usage is:

StatementBuilder statementBuilder = new StatementBuilder() .Where("lastModifiedTime > :yesterday AND type = :type") .OrderBy("name DESC") .Limit(200) .Offset(20) .AddValue("yesterday", DateTimeUtilities.FromDateTime(System.DateTime.Now.AddDays(-1))) .AddValue("type", "Type"); Statement statement = statementBuilder.ToStatement(); // ... statementBuilder.increaseOffsetBy(20); statement = statementBuilder.ToStatement();

Constructor & Destructor Documentation

Google.Api.Ads.AdManager.Util.v202108.StatementBuilder.StatementBuilder ( )
inline

Constructs a statement builder for partial query building.

Member Function Documentation

StatementBuilder Google.Api.Ads.AdManager.Util.v202108.StatementBuilder.AddValue ( string  key,
string  value 
)
inline

Adds a new string value to the list of query parameters.

Parameters
keyThe parameter name.
valueThe parameter value.
Returns
The statement builder, for chaining method calls.
StatementBuilder Google.Api.Ads.AdManager.Util.v202108.StatementBuilder.AddValue ( string  key,
bool  value 
)
inline

Adds a new boolean value to the list of query parameters.

Parameters
keyThe parameter name.
valueThe parameter value.
Returns
The statement builder, for chaining method calls.
StatementBuilder Google.Api.Ads.AdManager.Util.v202108.StatementBuilder.AddValue ( string  key,
decimal  value 
)
inline

Adds a new decimal value to the list of query parameters.

Parameters
keyThe parameter name.
valueThe parameter value.
Returns
The statement builder, for chaining method calls.
StatementBuilder Google.Api.Ads.AdManager.Util.v202108.StatementBuilder.AddValue ( string  key,
DateTime  value 
)
inline

Adds a new DateTime value to the list of query parameters.

Parameters
keyThe parameter name.
valueThe parameter value.
Returns
The statement builder, for chaining method calls.
StatementBuilder Google.Api.Ads.AdManager.Util.v202108.StatementBuilder.AddValue ( string  key,
Date  value 
)
inline

Adds a new Date value to the list of query parameters.

Parameters
keyThe parameter name.
valueThe parameter value.
Returns
The statement builder, for chaining method calls.
StatementBuilder Google.Api.Ads.AdManager.Util.v202108.StatementBuilder.From ( String  table)
inline

Sets the statement FROM clause in the form of "table". Only necessary for statements being sent to the PublisherQueryLanguageService. The "FROM " keyword will be ignored.

Parameters
tableThe statement from clause without "FROM"
Returns
The statement builder, for chaining method calls.
int Google.Api.Ads.AdManager.Util.v202108.StatementBuilder.GetOffset ( )
inline

Gets the curent offset

Returns
The current offset
StatementBuilder Google.Api.Ads.AdManager.Util.v202108.StatementBuilder.IncreaseOffsetBy ( Int32  amount)
inline

Increases the offset by the given amount.

Parameters
amountthe amount to increase the offset
Returns
The statement builder, for chaining method calls.
StatementBuilder Google.Api.Ads.AdManager.Util.v202108.StatementBuilder.Limit ( Int32  count)
inline

Sets the statement LIMIT clause in the form of

"LIMIT <count>"

Parameters
countthe statement limit
Returns
The statement builder, for chaining method calls.
StatementBuilder Google.Api.Ads.AdManager.Util.v202108.StatementBuilder.Offset ( Int32  count)
inline

Sets the statement OFFSET clause in the form of

"OFFSET <count>"

Parameters
countthe statement offset
Returns
The statement builder, for chaining method calls.
StatementBuilder Google.Api.Ads.AdManager.Util.v202108.StatementBuilder.OrderBy ( String  orderBy)
inline

Sets the statement ORDER BY clause in the form of

"ORDER BY <property> [ASC | DESC]" e.g. "type ASC, lastModifiedDateTime DESC". The "ORDER BY " keyword will be ignored.

Parameters
orderBythe statement order by without "ORDER BY"
Returns
The statement builder, for chaining method calls.
StatementBuilder Google.Api.Ads.AdManager.Util.v202108.StatementBuilder.RemoveLimitAndOffset ( )
inline

Removes the limit and offset from the query.

Returns
The statement builder, for chaining method calls.
StatementBuilder Google.Api.Ads.AdManager.Util.v202108.StatementBuilder.Select ( String  columns)
inline

Sets the statement SELECT clause in the form of "a,b". Only necessary for statements being sent to the PublisherQueryLanguageService. The "SELECT " keyword will be ignored.

Parameters
columnsThe statement serlect clause without "SELECT".
Returns
The statement builder, for chaining method calls.
Statement Google.Api.Ads.AdManager.Util.v202108.StatementBuilder.ToStatement ( )
inline

Gets the Statement representing the state of this statement builder.

Returns
The statement.
StatementBuilder Google.Api.Ads.AdManager.Util.v202108.StatementBuilder.Where ( String  conditions)
inline

Sets the statement WHERE clause in the form of

"WHERE <condition> {[AND | OR] <condition> ...}" e.g. "a = b OR b = c". The "WHERE " keyword will be ignored.

Parameters
conditionsThe statement query without "WHERE"
Returns
The statement builder, for chaining method calls.

Member Data Documentation

const int Google.Api.Ads.AdManager.Util.v202108.StatementBuilder.SUGGESTED_PAGE_LIMIT = 500

The suggested default page size.


The documentation for this class was generated from the following file: