A utility class that allows for statements to be constructed in parts. Typical usage is:
More...
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();
Google.Api.Ads.AdManager.Util.v202405.StatementBuilder.StatementBuilder |
( |
| ) |
|
|
inline |
Constructs a statement builder for partial query building.
StatementBuilder Google.Api.Ads.AdManager.Util.v202405.StatementBuilder.AddValue |
( |
string |
key, |
|
|
string |
value |
|
) |
| |
|
inline |
Adds a new string value to the list of query parameters.
- Parameters
-
key | The parameter name. |
value | The parameter value. |
- Returns
- The statement builder, for chaining method calls.
StatementBuilder Google.Api.Ads.AdManager.Util.v202405.StatementBuilder.AddValue |
( |
string |
key, |
|
|
bool |
value |
|
) |
| |
|
inline |
Adds a new boolean value to the list of query parameters.
- Parameters
-
key | The parameter name. |
value | The parameter value. |
- Returns
- The statement builder, for chaining method calls.
StatementBuilder Google.Api.Ads.AdManager.Util.v202405.StatementBuilder.AddValue |
( |
string |
key, |
|
|
decimal |
value |
|
) |
| |
|
inline |
Adds a new decimal value to the list of query parameters.
- Parameters
-
key | The parameter name. |
value | The parameter value. |
- Returns
- The statement builder, for chaining method calls.
Adds a new DateTime value to the list of query parameters.
- Parameters
-
key | The parameter name. |
value | The parameter value. |
- Returns
- The statement builder, for chaining method calls.
StatementBuilder Google.Api.Ads.AdManager.Util.v202405.StatementBuilder.AddValue |
( |
string |
key, |
|
|
Date |
value |
|
) |
| |
|
inline |
Adds a new Date value to the list of query parameters.
- Parameters
-
key | The parameter name. |
value | The parameter value. |
- Returns
- The statement builder, for chaining method calls.
StatementBuilder Google.Api.Ads.AdManager.Util.v202405.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
-
table | The statement from clause without "FROM" |
- Returns
- The statement builder, for chaining method calls.
int Google.Api.Ads.AdManager.Util.v202405.StatementBuilder.GetOffset |
( |
| ) |
|
|
inline |
Gets the curent offset
- Returns
- The current offset
StatementBuilder Google.Api.Ads.AdManager.Util.v202405.StatementBuilder.IncreaseOffsetBy |
( |
Int32 |
amount | ) |
|
|
inline |
Increases the offset by the given amount.
- Parameters
-
amount | the amount to increase the offset |
- Returns
- The statement builder, for chaining method calls.
StatementBuilder Google.Api.Ads.AdManager.Util.v202405.StatementBuilder.Limit |
( |
Int32 |
count | ) |
|
|
inline |
Sets the statement LIMIT clause in the form of
"LIMIT <count>"
- Parameters
-
- Returns
- The statement builder, for chaining method calls.
StatementBuilder Google.Api.Ads.AdManager.Util.v202405.StatementBuilder.Offset |
( |
Int32 |
count | ) |
|
|
inline |
Sets the statement OFFSET clause in the form of
"OFFSET <count>"
- Parameters
-
count | the statement offset |
- Returns
- The statement builder, for chaining method calls.
StatementBuilder Google.Api.Ads.AdManager.Util.v202405.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
-
orderBy | the statement order by without "ORDER BY" |
- Returns
- The statement builder, for chaining method calls.
StatementBuilder Google.Api.Ads.AdManager.Util.v202405.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.v202405.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
-
columns | The statement serlect clause without "SELECT". |
- Returns
- The statement builder, for chaining method calls.
Statement Google.Api.Ads.AdManager.Util.v202405.StatementBuilder.ToStatement |
( |
| ) |
|
|
inline |
Gets the Statement representing the state of this statement builder.
- Returns
- The statement.
StatementBuilder Google.Api.Ads.AdManager.Util.v202405.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
-
conditions | The statement query without "WHERE" |
- Returns
- The statement builder, for chaining method calls.
const int Google.Api.Ads.AdManager.Util.v202405.StatementBuilder.SUGGESTED_PAGE_LIMIT = 500 |
The suggested default page size.
The documentation for this class was generated from the following file: