Ads API .NET library
|
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... | |
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();
|
inline |
Constructs a statement builder for partial query building.
|
inline |
Adds a new string value to the list of query parameters.
key | The parameter name. |
value | The parameter value. |
|
inline |
Adds a new boolean value to the list of query parameters.
key | The parameter name. |
value | The parameter value. |
|
inline |
Adds a new decimal value to the list of query parameters.
key | The parameter name. |
value | The parameter value. |
|
inline |
Adds a new DateTime value to the list of query parameters.
key | The parameter name. |
value | The parameter value. |
|
inline |
Adds a new Date value to the list of query parameters.
key | The parameter name. |
value | The parameter value. |
|
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.
table | The statement from clause without "FROM" |
|
inline |
Gets the curent offset
Referenced by Google.Api.Ads.AdManager.Examples.CSharp.v202402.DeActivateCreativeWrappers.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.DeactivatePlacement.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllCompanies.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllContacts.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllAdUnits.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetActiveLabels.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllLabels.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetUninvitedContacts.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllLineItems.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllContent.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetLineItemsThatNeedCreatives.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetRecentlyUpdatedLineItems.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllActivities.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllForecastAdjustments.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllNativeStyles.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllOrders.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetRecentlyModifiedContent.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetOrdersStartingSoon.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllCreatives.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetImageCreatives.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetActivePlacements.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllPlacements.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllCreativeSets.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetActiveActivities.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllTrafficForecastSegments.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllProposals.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetProposalsAwaitingSellerReivew.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllSites.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAdvertisers.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllTeams.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllUsers.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllCustomFields.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetCustomFieldsForLineItems.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.SubmitSiteForApproval.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetActiveCreativeWrappers.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllUserTeamAssociations.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllCmsMetadataValues.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetSystemDefinedCreativeTemplates.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllAudienceSegments.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetUserByEmailAddress.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.ApproveSuggestedAdUnits.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllProposalLineItems.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetCreativeSetsForMasterCreative.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetSitesRequiringApproval.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllCreativeWrappers.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllSuggestedAdUnits.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllCreativeTemplates.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllCdnConfigurations.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetCmsMetadataValuesForKey.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllCmsMetadataKeys.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetActiveActivityGroups.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllActivityGroups.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetFirstPartyAudienceSegments.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllTargetingPresets.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllLicas.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.RequestBuyerAcceptance.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetHighlyRequestedSuggestedAdUnits.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetProposalLineItemsForProposal.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetUserTeamAssociationsForUser.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.ActivateCmsMetadataValues.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetLicasForLineItem.Run(), and Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetForecastAdjustmentsForTrafficForecastSegment.Run().
|
inline |
Increases the offset by the given amount.
amount | the amount to increase the offset |
|
inline |
Sets the statement LIMIT clause in the form of
"LIMIT <count>"
count | the statement limit |
|
inline |
Sets the statement OFFSET clause in the form of
"OFFSET <count>"
count | the statement offset |
|
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.
orderBy | the statement order by without "ORDER BY" |
|
inline |
Removes the limit and offset from the query.
|
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.
columns | The statement serlect clause without "SELECT". |
|
inline |
Gets the Statement representing the state of this statement builder.
|
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.
conditions | The statement query without "WHERE" |
const int Google.Api.Ads.AdManager.Util.v202402.StatementBuilder.SUGGESTED_PAGE_LIMIT = 500 |
The suggested default page size.
Referenced by Google.Api.Ads.AdManager.Examples.CSharp.OAuth.Default.OnGetUsersButtonClick(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.CreatePlacements.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetMcmEarnings.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllProgrammaticBuyers.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetLineItemsNamedLike.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.FetchMatchTables.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetAllLineItemsUsingPql.Run(), Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetGeoTargets.Run(), and Google.Api.Ads.AdManager.Examples.CSharp.v202402.GetRecentChanges.Run().