diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1a1470a45..d7c2cad06 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,17 @@
+18.1.0
+======
+- Added support for version 16.0 of the Google Ads API.
+- Upgraded the Google.Api.Gax.Grpc dependency to 4.5.0 and the Google.Protobuf dependency to 3.25.0.
+- Updated code examples:
+ * DetectAndApplyRecommendations
+ * AddResponsiveSearchAdFull
+ * AddCall
+ * AddHotelCallout
+ * AddLeadFormAsset
+ * AddPrices
+ * AddSitelinks
+- Added the VerifyAdvertiserIdentity example.
+
18.0.0
======
- Removed support for version 13.0 of the Google Ads API.
diff --git a/Google.Ads.Gax/src/Google.Ads.Gax.csproj b/Google.Ads.Gax/src/Google.Ads.Gax.csproj
index a3acb01ae..9312d4674 100644
--- a/Google.Ads.Gax/src/Google.Ads.Gax.csproj
+++ b/Google.Ads.Gax/src/Google.Ads.Gax.csproj
@@ -3,7 +3,7 @@
Google Ads GAPIC Extensions Dotnet Client Library
Google.Ads.Gax
- 3.1.0
+ 3.2.0
This library provides functionality that makes it easier to work with Generated
API Client GAPIC client libraries for Google's Ads APIs.
https://github.com/googleads/google-ads-dotnet/blob/main/ChangeLog
@@ -31,8 +31,8 @@
true
true
true
- 3.1.0
- 3.1.0
+ 3.2.0
+ 3.2.0
latest
@@ -42,10 +42,10 @@
-
+
-
+
all
diff --git a/Google.Ads.Gax/tests/Google.Ads.Gax.Tests.csproj b/Google.Ads.Gax/tests/Google.Ads.Gax.Tests.csproj
index b07b42300..22f93eee9 100644
--- a/Google.Ads.Gax/tests/Google.Ads.Gax.Tests.csproj
+++ b/Google.Ads.Gax/tests/Google.Ads.Gax.Tests.csproj
@@ -18,7 +18,6 @@
-
diff --git a/Google.Ads.GoogleAds.Core/src/Google.Ads.GoogleAds.Core.csproj b/Google.Ads.GoogleAds.Core/src/Google.Ads.GoogleAds.Core.csproj
index ef96286f6..19147e174 100644
--- a/Google.Ads.GoogleAds.Core/src/Google.Ads.GoogleAds.Core.csproj
+++ b/Google.Ads.GoogleAds.Core/src/Google.Ads.GoogleAds.Core.csproj
@@ -3,7 +3,7 @@
Google Ads API Core Dotnet Client Library
Google.Ads.GoogleAds.Core
- 3.1.0
+ 3.2.0
This library provides you with functionality to access the Google Ads API. The Google Ads API is the modern programmatic interface to Google Ads and the next generation of the AdWords API. See https://developers.google.com/google-ads/api to learn more about Google Ads API.
https://github.com/googleads/google-ads-dotnet/blob/master/ChangeLog
GoogleAds Google
@@ -30,8 +30,8 @@
true
true
true
- 3.1.0
- 3.1.0
+ 3.2.0
+ 3.2.0
latest
@@ -40,7 +40,7 @@
-
+
diff --git a/Google.Ads.GoogleAds.Core/tests/Google.Ads.GoogleAds.Core.Tests.csproj b/Google.Ads.GoogleAds.Core/tests/Google.Ads.GoogleAds.Core.Tests.csproj
index 9e493e785..a3d8f00cd 100644
--- a/Google.Ads.GoogleAds.Core/tests/Google.Ads.GoogleAds.Core.Tests.csproj
+++ b/Google.Ads.GoogleAds.Core/tests/Google.Ads.GoogleAds.Core.Tests.csproj
@@ -13,7 +13,6 @@
..\..\GoogleAds.snk
-
diff --git a/Google.Ads.GoogleAds.Extensions/src/Google.Ads.GoogleAds.Extensions.csproj b/Google.Ads.GoogleAds.Extensions/src/Google.Ads.GoogleAds.Extensions.csproj
index b57633553..cedfbfdd0 100644
--- a/Google.Ads.GoogleAds.Extensions/src/Google.Ads.GoogleAds.Extensions.csproj
+++ b/Google.Ads.GoogleAds.Extensions/src/Google.Ads.GoogleAds.Extensions.csproj
@@ -45,9 +45,9 @@
-
+
-
+
diff --git a/Google.Ads.GoogleAds.Extensions/tests/Google.Ads.GoogleAds.Extensions.Tests.csproj b/Google.Ads.GoogleAds.Extensions/tests/Google.Ads.GoogleAds.Extensions.Tests.csproj
index 42dca7a8e..92bc72311 100644
--- a/Google.Ads.GoogleAds.Extensions/tests/Google.Ads.GoogleAds.Extensions.Tests.csproj
+++ b/Google.Ads.GoogleAds.Extensions/tests/Google.Ads.GoogleAds.Extensions.Tests.csproj
@@ -13,7 +13,6 @@
..\..\GoogleAds.snk
-
diff --git a/Google.Ads.GoogleAds/examples/AccountManagement/CreateCustomer.cs b/Google.Ads.GoogleAds/examples/AccountManagement/CreateCustomer.cs
index fbd548143..3e939b08b 100644
--- a/Google.Ads.GoogleAds/examples/AccountManagement/CreateCustomer.cs
+++ b/Google.Ads.GoogleAds/examples/AccountManagement/CreateCustomer.cs
@@ -15,13 +15,13 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example illustrates how to create a new customer under a given manager account.
@@ -76,7 +76,7 @@ public static void Main(string[] args)
public void Run(GoogleAdsClient client, long managerCustomerId)
{
// Get the CustomerService.
- CustomerServiceClient customerService = client.GetService(Services.V15.CustomerService);
+ CustomerServiceClient customerService = client.GetService(Services.V16.CustomerService);
Customer customer = new Customer()
{
diff --git a/Google.Ads.GoogleAds/examples/AccountManagement/GetAccountHierarchy.cs b/Google.Ads.GoogleAds/examples/AccountManagement/GetAccountHierarchy.cs
index 3c6dbe3b0..2a3534b2b 100644
--- a/Google.Ads.GoogleAds/examples/AccountManagement/GetAccountHierarchy.cs
+++ b/Google.Ads.GoogleAds/examples/AccountManagement/GetAccountHierarchy.cs
@@ -15,13 +15,13 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Api.Gax;
using System;
using System.Collections.Generic;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This example gets the account hierarchy of the specified manager account. If you don't
@@ -99,10 +99,10 @@ public void Run(GoogleAdsClient googleAdsClient, long? managerCustomerId = null,
}
GoogleAdsServiceClient googleAdsServiceClient =
- googleAdsClient.GetService(Services.V15.GoogleAdsService);
+ googleAdsClient.GetService(Services.V16.GoogleAdsService);
CustomerServiceClient customerServiceClient =
- googleAdsClient.GetService(Services.V15.CustomerService);
+ googleAdsClient.GetService(Services.V16.CustomerService);
// List of Customer IDs to handle.
List seedCustomerIds = new List();
diff --git a/Google.Ads.GoogleAds/examples/AccountManagement/GetChangeDetails.cs b/Google.Ads.GoogleAds/examples/AccountManagement/GetChangeDetails.cs
index 4946ca8a5..9be42e479 100644
--- a/Google.Ads.GoogleAds/examples/AccountManagement/GetChangeDetails.cs
+++ b/Google.Ads.GoogleAds/examples/AccountManagement/GetChangeDetails.cs
@@ -16,17 +16,17 @@
using Google.Ads.Gax.Examples;
using Google.Ads.Gax.Util;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Protobuf;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.ChangeEventResourceTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.ResourceChangeOperationEnum.Types;
-using static Google.Ads.GoogleAds.V15.Resources.ChangeEvent.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ChangeEventResourceTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ResourceChangeOperationEnum.Types;
+using static Google.Ads.GoogleAds.V16.Resources.ChangeEvent.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example gets the changes in an account during the last 25 days.
@@ -76,7 +76,7 @@ public void Run(GoogleAdsClient client, long customerId)
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
// Construct a query to find details for recent changes in your account.
// The LIMIT clause is required for the change_event resource.
diff --git a/Google.Ads.GoogleAds/examples/AccountManagement/GetChangeSummary.cs b/Google.Ads.GoogleAds/examples/AccountManagement/GetChangeSummary.cs
index ef5132f99..2e6d9fa8c 100644
--- a/Google.Ads.GoogleAds/examples/AccountManagement/GetChangeSummary.cs
+++ b/Google.Ads.GoogleAds/examples/AccountManagement/GetChangeSummary.cs
@@ -15,14 +15,14 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Api.Gax;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.ChangeStatusResourceTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ChangeStatusResourceTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example gets a list of which resources have been changed in your account
@@ -78,7 +78,7 @@ public void Run(GoogleAdsClient client, long customerId)
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
string searchQuery = @"
SELECT
diff --git a/Google.Ads.GoogleAds/examples/AccountManagement/InviteUserWithAccessRole.cs b/Google.Ads.GoogleAds/examples/AccountManagement/InviteUserWithAccessRole.cs
index 90d0b7456..5b00daba9 100644
--- a/Google.Ads.GoogleAds/examples/AccountManagement/InviteUserWithAccessRole.cs
+++ b/Google.Ads.GoogleAds/examples/AccountManagement/InviteUserWithAccessRole.cs
@@ -15,14 +15,14 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.AccessRoleEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AccessRoleEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example sends an invitation email to a user to manage a customer
@@ -92,7 +92,7 @@ public void Run(GoogleAdsClient client, long customerId, string emailAddress,
{
// Get the CustomerUserAccessInvitationService.
CustomerUserAccessInvitationServiceClient service = client.GetService(
- Services.V15.CustomerUserAccessInvitationService);
+ Services.V16.CustomerUserAccessInvitationService);
// [START invite_user_with_access_role]
MutateCustomerUserAccessInvitationRequest invitationRequest =
diff --git a/Google.Ads.GoogleAds/examples/AccountManagement/LinkManagerToClient.cs b/Google.Ads.GoogleAds/examples/AccountManagement/LinkManagerToClient.cs
index df4a057f6..7d5f0e767 100644
--- a/Google.Ads.GoogleAds/examples/AccountManagement/LinkManagerToClient.cs
+++ b/Google.Ads.GoogleAds/examples/AccountManagement/LinkManagerToClient.cs
@@ -16,15 +16,15 @@
using Google.Ads.Gax.Examples;
using Google.Ads.Gax.Util;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.ManagerLinkStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ManagerLinkStatusEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example demonstrates how to link an existing Google Ads manager customer
@@ -124,7 +124,7 @@ private string CreateInvitation(GoogleAdsClient client, long managerCustomerId,
{
// Get the CustomerClientLinkService.
CustomerClientLinkServiceClient customerClientLinkService =
- client.GetService(Services.V15.CustomerClientLinkService);
+ client.GetService(Services.V16.CustomerClientLinkService);
// Create a client with the manager customer ID as login customer ID.
client.Config.LoginCustomerId = managerCustomerId.ToString();
@@ -175,7 +175,7 @@ private string GetManagerLinkResourceName(GoogleAdsClient client, long managerCu
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
// Create a client with the manager customer ID as login customer ID.
client.Config.LoginCustomerId = managerCustomerId.ToString();
@@ -211,7 +211,7 @@ private void AcceptInvitation(GoogleAdsClient client, long clientCustomerId,
{
// Get the CustomerManagerLinkService.
CustomerManagerLinkServiceClient customerManagerLinkService =
- client.GetService(Services.V15.CustomerManagerLinkService);
+ client.GetService(Services.V16.CustomerManagerLinkService);
// Create a client with the client customer ID as login customer ID.
client.Config.LoginCustomerId = clientCustomerId.ToString();
diff --git a/Google.Ads.GoogleAds/examples/AccountManagement/ListAccessibleCustomers.cs b/Google.Ads.GoogleAds/examples/AccountManagement/ListAccessibleCustomers.cs
index 1d12810ab..f0cef6019 100644
--- a/Google.Ads.GoogleAds/examples/AccountManagement/ListAccessibleCustomers.cs
+++ b/Google.Ads.GoogleAds/examples/AccountManagement/ListAccessibleCustomers.cs
@@ -15,12 +15,12 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example lists the resource names for the customers that the authenticating user
@@ -70,7 +70,7 @@ public static void Main(string[] args)
public void Run(GoogleAdsClient client)
{
// Get the CustomerService.
- CustomerServiceClient customerService = client.GetService(Services.V15.CustomerService);
+ CustomerServiceClient customerService = client.GetService(Services.V16.CustomerService);
try
{
diff --git a/Google.Ads.GoogleAds/examples/AccountManagement/RejectMerchantCenterLink.cs b/Google.Ads.GoogleAds/examples/AccountManagement/RejectMerchantCenterLink.cs
index 4ba97e505..db9264c74 100644
--- a/Google.Ads.GoogleAds/examples/AccountManagement/RejectMerchantCenterLink.cs
+++ b/Google.Ads.GoogleAds/examples/AccountManagement/RejectMerchantCenterLink.cs
@@ -19,7 +19,6 @@
using Google.Ads.GoogleAds.V14.Resources;
using Google.Ads.GoogleAds.V14.Services;
using System;
-using System.Collections.Generic;
namespace Google.Ads.GoogleAds.Examples.V14
{
diff --git a/Google.Ads.GoogleAds/examples/AccountManagement/UpdateUserAccess.cs b/Google.Ads.GoogleAds/examples/AccountManagement/UpdateUserAccess.cs
index 3a56a5dfc..3bf9907a8 100644
--- a/Google.Ads.GoogleAds/examples/AccountManagement/UpdateUserAccess.cs
+++ b/Google.Ads.GoogleAds/examples/AccountManagement/UpdateUserAccess.cs
@@ -16,16 +16,16 @@
using Google.Ads.Gax.Examples;
using Google.Ads.Gax.Util;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Api.Gax;
using System;
using System.Collections.Generic;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.AccessRoleEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AccessRoleEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example updates the access role of a user, given the email address.
@@ -131,7 +131,7 @@ public void Run(GoogleAdsClient client, long customerId, string emailAddress,
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
// Create the search query. Use the LIKE query for filtering to ignore the text case
// for email address when searching for a match.
@@ -175,7 +175,7 @@ private void ModifyUserAccess(GoogleAdsClient client, long customerId, long user
{
// Get the CustomerUserAccessService.
CustomerUserAccessServiceClient userAccessService = client.GetService(
- Services.V15.CustomerUserAccessService);
+ Services.V16.CustomerUserAccessService);
// Creates the modified user access.
CustomerUserAccess userAccess = new CustomerUserAccess()
diff --git a/Google.Ads.GoogleAds/examples/AccountManagement/VerifyAdvertiserIdentity.cs b/Google.Ads.GoogleAds/examples/AccountManagement/VerifyAdvertiserIdentity.cs
new file mode 100644
index 000000000..97263f2e8
--- /dev/null
+++ b/Google.Ads.GoogleAds/examples/AccountManagement/VerifyAdvertiserIdentity.cs
@@ -0,0 +1,190 @@
+// Copyright 2024 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+using CommandLine;
+using Google.Ads.Gax.Examples;
+using Google.Ads.GoogleAds.Lib;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Services;
+using static Google.Ads.GoogleAds.V16.Enums.IdentityVerificationProgramEnum.Types;
+using System;
+
+namespace Google.Ads.GoogleAds.Examples.V16
+{
+ ///
+ /// This code example illustrates how to retrieve the status of the advertiser identity
+ /// verification program and, if required and not already started, how to start the verification
+ /// process.
+ ///
+ public class VerifyAdvertiserIdentity : ExampleBase
+ {
+ ///
+ /// Command line options for running the example.
+ ///
+ public class Options : OptionsBase
+ {
+ ///
+ /// The Google Ads customer ID for which the call is made.
+ ///
+ [Option("customerId", Required = true, HelpText =
+ "The Google Ads customer ID for which the call is made.")]
+ public long CustomerId { get; set; }
+ }
+
+ ///
+ /// Main method, to run this code example as a standalone application.
+ ///
+ /// The command line arguments.
+ public static void Main(string[] args)
+ {
+ Options options = ExampleUtilities.ParseCommandLine(args);
+
+ VerifyAdvertiserIdentity codeExample = new VerifyAdvertiserIdentity();
+ Console.WriteLine(codeExample.Description);
+ codeExample.Run(new GoogleAdsClient(), options.CustomerId);
+ }
+
+ ///
+ /// Returns a description about the code example.
+ ///
+ public override string Description =>
+ "This code example retrieves the status of the advertiser identity verification " +
+ "program and, if required and not already started, starts the verification process.";
+
+ ///
+ /// Runs the code example.
+ ///
+ /// The Google Ads client.
+ /// The Google Ads customer ID for which the call is made.
+ public void Run(GoogleAdsClient client, long customerId)
+ {
+ // Retrieve the current Advertiser Identity Verification status.
+ IdentityVerification identityVerification =
+ GetIdentityVerification(client, customerId);
+
+ if (identityVerification != null)
+ {
+ if (identityVerification.VerificationProgress.ActionUrl == null)
+ {
+ StartIdentityVerification(client, customerId);
+
+ // Call GetIdentityVerification again to retrieve the verification progress
+ // after starting an identity verification session.
+ GetIdentityVerification(client, customerId);
+
+ } else {
+ // If there is an identity verification session in progress, there is no need
+ // to start another one by calling StartIdentityVerification.
+ Console.WriteLine("There is an advertiser identity verification session in " +
+ "progress.\n" +
+ "The URL for the verification process is: " +
+ identityVerification.VerificationProgress.ActionUrl +
+ " and it will expire at " +
+ identityVerification.VerificationProgress.InvitationLinkExpirationTime);
+ }
+ }
+ else
+ {
+ // If GetIdentityVerification returned an empty response, the account is not
+ // enrolled in mandatory identity verification.
+ Console.WriteLine($"Account {customerId} is not required to perform advertiser " +
+ "identity verification.\n" +
+ "See https://support.google.com/adspolicy/answer/9703665 for details on how " +
+ "and when an account is required to undergo the advertiser identity " +
+ "verification program.");
+
+ }
+ }
+
+ ///
+ /// Retrieves the status of the advertiser identity verification process.
+ ///
+ /// The Google Ads client.
+ /// The Google Ads customer ID for which the call is made.
+ // [START verify_advertiser_identity_1]
+ private static IdentityVerification GetIdentityVerification(
+ GoogleAdsClient client, long customerId)
+ {
+ IdentityVerificationServiceClient identityVerificationService =
+ client.GetService(Services.V16.IdentityVerificationService);
+
+ try {
+ GetIdentityVerificationResponse response =
+ identityVerificationService.GetIdentityVerification(
+ new GetIdentityVerificationRequest()
+ {
+ CustomerId = customerId.ToString()
+ }
+ );
+
+ if (response.IdentityVerification.Count == 0)
+ {
+ return null;
+ }
+
+ IdentityVerification identityVerification = response.IdentityVerification[0];
+ string deadline =
+ identityVerification.IdentityVerificationRequirement.VerificationCompletionDeadlineTime;
+ IdentityVerificationProgress identityVerificationProgress =
+ identityVerification.VerificationProgress;
+ Console.WriteLine($"Account {customerId} has a verification completion " +
+ $"deadline of {deadline} and status " +
+ $"{identityVerificationProgress.ProgramStatus} for advertiser identity " +
+ "verification.");
+
+ return identityVerification;
+ } catch (GoogleAdsException e)
+ {
+ Console.WriteLine("Failure:");
+ Console.WriteLine($"Message: {e.Message}");
+ Console.WriteLine($"Failure: {e.Failure}");
+ Console.WriteLine($"Request ID: {e.RequestId}");
+ throw;
+ }
+
+
+ }
+ // [END verify_advertiser_identity_1]
+
+ ///
+ /// Starts the identity verification process.
+ ///
+ /// The Google Ads client.
+ /// The Google Ads customer ID for which the call is made.
+ // [START verify_advertiser_identity_2]
+ private static void StartIdentityVerification(GoogleAdsClient client, long customerId)
+ {
+ IdentityVerificationServiceClient identityVerificationService =
+ client.GetService(Services.V16.IdentityVerificationService);
+
+ StartIdentityVerificationRequest request = new StartIdentityVerificationRequest()
+ {
+ CustomerId = customerId.ToString(),
+ VerificationProgram = IdentityVerificationProgram.AdvertiserIdentityVerification
+ };
+
+ try {
+ identityVerificationService.StartIdentityVerification(request);
+ } catch (GoogleAdsException e)
+ {
+ Console.WriteLine("Failure:");
+ Console.WriteLine($"Message: {e.Message}");
+ Console.WriteLine($"Failure: {e.Failure}");
+ Console.WriteLine($"Request ID: {e.RequestId}");
+ throw;
+ }
+ }
+ // [END verify_advertiser_identity_2]
+ }
+}
diff --git a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddAdCustomizer.cs b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddAdCustomizer.cs
index 994a98e8f..2a0cd6297 100644
--- a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddAdCustomizer.cs
+++ b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddAdCustomizer.cs
@@ -15,16 +15,16 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using Google.Ads.GoogleAds.V15.Enums;
-using static Google.Ads.GoogleAds.V15.Enums.CustomizerAttributeTypeEnum.Types;
+using Google.Ads.GoogleAds.V16.Enums;
+using static Google.Ads.GoogleAds.V16.Enums.CustomizerAttributeTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example adds two ad customizer attributes and associates
@@ -85,7 +85,7 @@ public void Run(GoogleAdsClient client, long customerId, long adGroupId)
{
// Get the AdGroupBidModifierService.
AdGroupBidModifierServiceClient adGroupBidModifierService =
- client.GetService(Services.V15.AdGroupBidModifierService);
+ client.GetService(Services.V16.AdGroupBidModifierService);
string stringCustomizerName = "Planet_" + ExampleUtilities.GetShortRandomString();
string priceCustomizerName = "Price_" + ExampleUtilities.GetShortRandomString();
@@ -128,7 +128,7 @@ private string CreateTextCustomizerAttribute(GoogleAdsClient client, long custom
{
// Get the customizer attribute service.
CustomizerAttributeServiceClient customizerAttributeService =
- client.GetService(Services.V15.CustomizerAttributeService);
+ client.GetService(Services.V16.CustomizerAttributeService);
// Creates a text customizer attribute. The customizer attribute name is
// arbitrary and will be used as a placeholder in the ad text fields.
@@ -166,7 +166,7 @@ private string CreatePriceCustomizerAttribute(GoogleAdsClient client, long custo
{
// Get the customizer attribute service.
CustomizerAttributeServiceClient customizerAttributeService =
- client.GetService(Services.V15.CustomizerAttributeService);
+ client.GetService(Services.V16.CustomizerAttributeService);
// Creates a price customizer attribute. The customizer attribute name is
// arbitrary and will be used as a placeholder in the ad text fields.
@@ -210,7 +210,7 @@ private void LinkCustomizerAttributes(GoogleAdsClient client,
{
// Get the ad group customizer service.
AdGroupCustomizerServiceClient adGroupCustomizerService =
- client.GetService(Services.V15.AdGroupCustomizerService);
+ client.GetService(Services.V16.AdGroupCustomizerService);
List adGroupCustomizerOperations =
new List();
@@ -272,7 +272,7 @@ private void CreateAdWithCustomizations(GoogleAdsClient client, long customerId,
{
// Get the AdGroupAdServiceClient.
AdGroupAdServiceClient adGroupAdService =
- client.GetService(Services.V15.AdGroupAdService);
+ client.GetService(Services.V16.AdGroupAdService);
// Creates a responsive search ad using the attribute customizer names as
// placeholders and default values to be used in case there are no attribute
diff --git a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddAdGroupBidModifier.cs b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddAdGroupBidModifier.cs
index f21d118cb..f889b6931 100644
--- a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddAdGroupBidModifier.cs
+++ b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddAdGroupBidModifier.cs
@@ -15,15 +15,15 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.DeviceEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.DeviceEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example demonstrates how to add an ad group bid modifier for mobile devices.
@@ -93,7 +93,7 @@ public void Run(GoogleAdsClient client, long customerId, long adGroupId,
{
// Get the AdGroupBidModifierService.
AdGroupBidModifierServiceClient adGroupBidModifierService =
- client.GetService(Services.V15.AdGroupBidModifierService);
+ client.GetService(Services.V16.AdGroupBidModifierService);
// Creates an ad group bid modifier for mobile devices with the specified ad group
// ID and bid modifier value.
diff --git a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddAppCampaign.cs b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddAppCampaign.cs
index a16bbf2f6..03a9040b8 100644
--- a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddAppCampaign.cs
+++ b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddAppCampaign.cs
@@ -15,24 +15,24 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupAdStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdvertisingChannelSubTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdvertisingChannelTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AppCampaignAppStoreEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AppCampaignBiddingStrategyGoalTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.BudgetDeliveryMethodEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CampaignStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CriterionTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Resources.Campaign.Types;
-
-namespace Google.Ads.GoogleAds.Examples.V15
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupAdStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdvertisingChannelSubTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdvertisingChannelTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AppCampaignAppStoreEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AppCampaignBiddingStrategyGoalTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.BudgetDeliveryMethodEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CampaignStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CriterionTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Resources.Campaign.Types;
+
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example adds a new App Campaign.
@@ -116,7 +116,7 @@ private string CreateBudget(GoogleAdsClient client, long customerId)
{
// Get the BudgetService.
CampaignBudgetServiceClient budgetService = client.GetService(
- Services.V15.CampaignBudgetService);
+ Services.V16.CampaignBudgetService);
// Creates a campaign budget.
CampaignBudget budget = new CampaignBudget()
@@ -157,7 +157,7 @@ private string CreateCampaign(GoogleAdsClient client, long customerId,
string budgetResourceName)
{
// Get the CampaignService.
- CampaignServiceClient campaignService = client.GetService(Services.V15.CampaignService);
+ CampaignServiceClient campaignService = client.GetService(Services.V16.CampaignService);
// Create the campaign.
Campaign campaign = new Campaign()
@@ -235,7 +235,7 @@ private void SetCampaignTargetingCriteria(GoogleAdsClient client, long customerI
{
// Get the CampaignCriterionService.
CampaignCriterionServiceClient campaignCriterionService = client.GetService(
- Services.V15.CampaignCriterionService);
+ Services.V16.CampaignCriterionService);
List operations = new List();
@@ -325,7 +325,7 @@ private string CreateAdGroup(GoogleAdsClient client, long customerId,
string campaignResourceName)
{
// Get the AdGroupService.
- AdGroupServiceClient adGroupService = client.GetService(Services.V15.AdGroupService);
+ AdGroupServiceClient adGroupService = client.GetService(Services.V16.AdGroupService);
// Creates an ad group.
// Note that the ad group type must not be set.
@@ -368,7 +368,7 @@ private void CreateAppAd(GoogleAdsClient client, long customerId,
{
// Get the AdGroupAdService.
AdGroupAdServiceClient adGroupAdService = client.GetService(
- Services.V15.AdGroupAdService);
+ Services.V16.AdGroupAdService);
// Creates an ad group ad.
AdGroupAd adGroupAd = new AdGroupAd
diff --git a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddBiddingDataExclusion.cs b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddBiddingDataExclusion.cs
index 77256615f..70e50621a 100644
--- a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddBiddingDataExclusion.cs
+++ b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddBiddingDataExclusion.cs
@@ -15,15 +15,15 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.AdvertisingChannelTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.SeasonalityEventScopeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdvertisingChannelTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.SeasonalityEventScopeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example adds a channel-level data exclusion that excludes conversions from
@@ -98,7 +98,7 @@ public void Run(GoogleAdsClient client, long customerId, string startDateTime,
{
// Get the BiddingDataExclusionServiceClient.
BiddingDataExclusionServiceClient biddingDataExclusionService =
- client.GetService(Services.V15.BiddingDataExclusionService);
+ client.GetService(Services.V16.BiddingDataExclusionService);
// [START add_bidding_data_exclusion]
BiddingDataExclusion dataExclusion = new BiddingDataExclusion()
diff --git a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddBiddingSeasonalityAdjustment.cs b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddBiddingSeasonalityAdjustment.cs
index 6de06c7b8..60b92bda8 100644
--- a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddBiddingSeasonalityAdjustment.cs
+++ b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddBiddingSeasonalityAdjustment.cs
@@ -15,15 +15,15 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.AdvertisingChannelTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.SeasonalityEventScopeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdvertisingChannelTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.SeasonalityEventScopeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example adds a channel-level seasonality adjustment that adjusts Smart Bidding
@@ -114,7 +114,7 @@ public void Run(GoogleAdsClient client, long customerId, string startDateTime,
{
// Get the BiddingSeasonalityAdjustmentServiceClient.
BiddingSeasonalityAdjustmentServiceClient biddingSeasonalityAdjustmentService =
- client.GetService(Services.V15.BiddingSeasonalityAdjustmentService);
+ client.GetService(Services.V16.BiddingSeasonalityAdjustmentService);
// [START add_bidding_seasonality_adjustment]
diff --git a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddCallAd.cs b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddCallAd.cs
index 68c79c648..8a455de62 100644
--- a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddCallAd.cs
+++ b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddCallAd.cs
@@ -15,16 +15,16 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System.Linq;
using System;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupAdStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CallConversionReportingStateEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupAdStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CallConversionReportingStateEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This example adds a call ad to a given ad group. More information about call ads can be
@@ -180,7 +180,7 @@ public void Run(
// Issues a mutate request to add the ad group ad.
AdGroupAdServiceClient adGroupAdServiceClient =
- client.GetService(Services.V15.AdGroupAdService);
+ client.GetService(Services.V16.AdGroupAdService);
MutateAdGroupAdsResponse adGroupAdResponse =
adGroupAdServiceClient.MutateAdGroupAds(
diff --git a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddDisplayUploadAd.cs b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddDisplayUploadAd.cs
index 300bbcba0..d5d387c44 100644
--- a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddDisplayUploadAd.cs
+++ b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddDisplayUploadAd.cs
@@ -17,18 +17,18 @@
using Google.Ads.Gax.Util;
using Google.Ads.GoogleAds.Lib;
using Google.Ads.GoogleAds.Util;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Enums;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Enums;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Protobuf;
using System;
using System.Collections.Generic;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.DisplayUploadProductTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.DisplayUploadProductTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example adds a display upload ad to a given ad group. To get ad groups,
@@ -119,7 +119,7 @@ public void Run(GoogleAdsClient client, long customerId, long adGroupId)
private string CreateMediaBundleAsset(GoogleAdsClient client, long customerId)
{
// Gets the AssetService.
- AssetServiceClient assetServiceClient = client.GetService(Services.V15.AssetService);
+ AssetServiceClient assetServiceClient = client.GetService(Services.V16.AssetService);
// The HTML5 zip file contains all the HTML, CSS, and images needed for the
// HTML5 ad. For help on creating an HTML5 zip file, check out Google Web
@@ -169,7 +169,7 @@ private void CreateDisplayUploadAdGroupAd(GoogleAdsClient client, long customerI
{
// Get the AdGroupAdService.
AdGroupAdServiceClient adGroupAdServiceClient =
- client.GetService(Services.V15.AdGroupAdService);
+ client.GetService(Services.V16.AdGroupAdService);
// Creates the ad with the required fields.
Ad displayUploadAd = new Ad()
diff --git a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddDynamicPageFeedAsset.cs b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddDynamicPageFeedAsset.cs
index bae04b3aa..00acb5d79 100644
--- a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddDynamicPageFeedAsset.cs
+++ b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddDynamicPageFeedAsset.cs
@@ -15,20 +15,20 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.AdCustomizerPlaceholderFieldEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AssetSetTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.FeedAttributeTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.PlaceholderTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.WebpageConditionOperandEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdCustomizerPlaceholderFieldEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AssetSetTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.FeedAttributeTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.PlaceholderTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.WebpageConditionOperandEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example adds a page feed with URLs for a Dynamic Search Ads campaign.
@@ -134,7 +134,7 @@ public void Run(GoogleAdsClient client, long customerId, long campaignId, long a
private static List CreateAssets(GoogleAdsClient client, long customerId,
string dsaPageUrlLabel)
{
- AssetServiceClient assetService = client.GetService(Services.V15.AssetService);
+ AssetServiceClient assetService = client.GetService(Services.V16.AssetService);
string[] urls = new[]
{
@@ -192,7 +192,7 @@ private static List CreateAssets(GoogleAdsClient client, long customerId
private string CreateAssetSet(GoogleAdsClient client, long customerId)
{
AssetSetServiceClient assetSetService = client.GetService(
- Services.V15.AssetSetService);
+ Services.V16.AssetSetService);
// Creates an AssetSet which will be used to link the dynamic page feed assets
// to a campaign.
@@ -231,7 +231,7 @@ private void AddAssetsToAssetSet(GoogleAdsClient client, long customerId,
List assetResourceNames, string assetSetResourceName)
{
AssetSetAssetServiceClient assetSetAssetService = client.GetService(
- Services.V15.AssetSetAssetService);
+ Services.V16.AssetSetAssetService);
List operations = new List();
foreach (string assetResourceName in assetResourceNames)
@@ -271,7 +271,7 @@ private void LinkAssetSetToCampaign(GoogleAdsClient client, long customerId,
long campaignId, string assetSetResourceName)
{
CampaignAssetSetServiceClient campaignAssetSetService = client.GetService(
- Services.V15.CampaignAssetSetService);
+ Services.V16.CampaignAssetSetService);
// Creates a CampaignAssetSet representing the link between an AssetSet and a Campaign.
CampaignAssetSet campaignAssetSet = new CampaignAssetSet()
@@ -306,7 +306,7 @@ private static void AddDsaTarget(
GoogleAdsClient client, long customerId, long adGroupId, string dsaPageUrlLabel)
{
AdGroupCriterionServiceClient adGroupCriterionService = client.GetService(
- Services.V15.AdGroupCriterionService);
+ Services.V16.AdGroupCriterionService);
string adGroupResourceName = ResourceNames.AdGroup(customerId, adGroupId);
diff --git a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddDynamicSearchAds.cs b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddDynamicSearchAds.cs
index d6e5d2e7c..6a6d38b54 100644
--- a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddDynamicSearchAds.cs
+++ b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddDynamicSearchAds.cs
@@ -15,23 +15,23 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupAdStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupCriterionStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdvertisingChannelTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.BudgetDeliveryMethodEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CampaignStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.WebpageConditionOperandEnum.Types;
-using static Google.Ads.GoogleAds.V15.Resources.Campaign.Types;
-
-namespace Google.Ads.GoogleAds.Examples.V15
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupAdStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupCriterionStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdvertisingChannelTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.BudgetDeliveryMethodEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CampaignStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.WebpageConditionOperandEnum.Types;
+using static Google.Ads.GoogleAds.V16.Resources.Campaign.Types;
+
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example adds dynamic search ads to a given ad group. To list
@@ -107,7 +107,7 @@ private static string AddCampaignBudget(GoogleAdsClient client, long customerId)
{
// Get the CampaignBudgetService.
CampaignBudgetServiceClient campaignBudgetService =
- client.GetService(Services.V15.CampaignBudgetService);
+ client.GetService(Services.V16.CampaignBudgetService);
// Create the budget.
CampaignBudget campaignBudget = new CampaignBudget()
@@ -146,7 +146,7 @@ private static string AddCampaign(GoogleAdsClient client, long customerId,
string budgetResourceName)
{
// Get the CampaignService.
- CampaignServiceClient campaignService = client.GetService(Services.V15.CampaignService);
+ CampaignServiceClient campaignService = client.GetService(Services.V16.CampaignService);
// Create the campaign.
Campaign campaign = new Campaign()
@@ -196,7 +196,7 @@ private static string AddAdGroup(GoogleAdsClient client, long customerId,
string campaignResourceName)
{
// Get the AdGroupService.
- AdGroupServiceClient adGroupService = client.GetService(Services.V15.AdGroupService);
+ AdGroupServiceClient adGroupService = client.GetService(Services.V16.AdGroupService);
// Create the ad group.
AdGroup adGroup = new AdGroup()
@@ -238,7 +238,7 @@ private static void AddExpandedDSA(GoogleAdsClient client, long customerId,
{
// Get the AdGroupAdService.
AdGroupAdServiceClient adGroupAdService =
- client.GetService(Services.V15.AdGroupAdService);
+ client.GetService(Services.V16.AdGroupAdService);
// Create an ad group ad.
AdGroupAd adGroupAd = new AdGroupAd()
@@ -282,7 +282,7 @@ private static void AddWebPageCriteria(GoogleAdsClient client, long customerId,
{
// Get the AdGroupCriterionService.
AdGroupCriterionServiceClient adGroupCriterionService =
- client.GetService(Services.V15.AdGroupCriterionService);
+ client.GetService(Services.V16.AdGroupCriterionService);
// Create the criterion.
AdGroupCriterion adGroupCriterion = new AdGroupCriterion()
diff --git a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddPerformanceMaxCampaign.cs b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddPerformanceMaxCampaign.cs
index 1cb05ac1a..ef06fb936 100644
--- a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddPerformanceMaxCampaign.cs
+++ b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddPerformanceMaxCampaign.cs
@@ -17,21 +17,21 @@
using Google.Ads.Gax.Util;
using Google.Ads.GoogleAds.Config;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Protobuf;
using System;
using System.Collections.Generic;
using System.Threading;
-using static Google.Ads.GoogleAds.V15.Enums.AdvertisingChannelTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AssetFieldTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AssetGroupStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.BudgetDeliveryMethodEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CampaignStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdvertisingChannelTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AssetFieldTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AssetGroupStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.BudgetDeliveryMethodEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CampaignStatusEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This example shows how to create a Performance Max campaign.
@@ -141,7 +141,7 @@ public void Run(GoogleAdsClient client, long customerId, long? audienceId)
{
// [START add_performance_max_campaign_1]
GoogleAdsServiceClient googleAdsServiceClient =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
// Performance Max campaigns require that repeated assets such as headlines and
// descriptions be created before the campaign.
@@ -465,7 +465,7 @@ private List CreateMultipleTextAssets(
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsServiceClient =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
MutateGoogleAdsRequest request = new MutateGoogleAdsRequest()
{
diff --git a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddResponsiveSearchAdFull.cs b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddResponsiveSearchAdFull.cs
new file mode 100644
index 000000000..08fa10c23
--- /dev/null
+++ b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddResponsiveSearchAdFull.cs
@@ -0,0 +1,594 @@
+// Copyright 2021 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+using CommandLine;
+using Google.Ads.Gax.Examples;
+using Google.Ads.Gax.Util;
+using Google.Ads.GoogleAds.Lib;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
+using System.Collections.Generic;
+using System.Linq;
+using System;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupAdStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupCriterionStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdvertisingChannelTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.BudgetDeliveryMethodEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CampaignStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CustomizerAttributeTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.KeywordMatchTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Services.SuggestGeoTargetConstantsRequest.Types;
+using Google.Ads.GoogleAds.Config;
+using Google.Ads.GoogleAds.Extensions.Config;
+
+namespace Google.Ads.GoogleAds.Examples.V16
+{
+ ///
+ /// Adds a customizer attribute, links the customizer attribute to a customer, and then adds
+ /// a responsive search ad with a description using the ad customizer to the specified ad group.
+ ///
+ public class AddResponsiveSearchAdFull : ExampleBase
+ {
+ ///
+ ///
+ public class Options : OptionsBase
+ {
+ ///
+ /// The Google Ads customer ID.
+ ///
+ [Option("customerId", Required = true, HelpText =
+ "The Google Ads customer ID.")]
+ public long CustomerId { get; set; }
+
+ ///
+ /// The Google Ads customizer attribute name ID.
+ ///
+ [Option("customizerAttributeName", Required = false, HelpText =
+ "The Google Ads customizer attribute name.", Default = CUSTOMIZER_ATTRIBUTE_NAME)]
+ public string CustomizerAttributeName { get; set; }
+ }
+
+ ///
+ /// Main method, to run this code example as a standalone application.
+ ///
+ /// The command line arguments.
+ public static void Main(string[] args)
+ {
+ Options options = ExampleUtilities.ParseCommandLine(args);
+
+ AddResponsiveSearchAdFull codeExample =
+ new AddResponsiveSearchAdFull();
+
+ Console.WriteLine(codeExample.Description);
+
+ codeExample.Run(
+ new GoogleAdsClient(),
+ options.CustomerId,
+ options.CustomizerAttributeName
+ );
+ }
+
+ // The name of the customizer attribute to be used in the ad customizer must be unique for a
+ // given client account. To run this example multiple times, change this value or specify
+ // its corresponding argument. Note that there is a limit for the number of enabled
+ // customizer attributes in one account, so you shouldn't run this example more than
+ // necessary.
+ //
+ // Visit the following link for more details:
+ // https://developers.google.com/google-ads/api/docs/ads/customize-responsive-search-ads#rules_and_limitations
+ private const string CUSTOMIZER_ATTRIBUTE_NAME = "Price";
+
+ ///
+ /// Returns a description about the code example.
+ ///
+ public override string Description =>
+ "Adds a customizer attribute, links the customizer attribute to a customer, and then " +
+ "adds a responsive search ad with a description using the ad customizer to the " +
+ "specified ad group.";
+
+ ///
+ /// Runs the example.
+ ///
+ /// The Google Ads client.
+ /// The Google Ads customer ID.
+ /// The customizer attribute name.
+ public void Run(
+ GoogleAdsClient client,
+ long customerId,
+ string customizerAttributeName)
+ {
+ string customizerAttributeResourceName = CreateCustomizerAttribute(
+ client,
+ customerId,
+ customizerAttributeName
+ );
+
+ LinkCustomizerAttributeToCustomer(client, customerId, customizerAttributeResourceName);
+
+ string campaignBudgetResourceName = AddCampaignBudget(client, customerId);
+
+ string campaignResourceName = AddCampaign(client, customerId,
+ campaignBudgetResourceName);
+
+ string adGroupResourceName = AddAdGroup(client, customerId, campaignResourceName);
+
+ CreateResponsiveSearchAdWithCustomization(
+ client,
+ customerId,
+ adGroupResourceName,
+ customizerAttributeName
+ );
+
+ AddKeywords(client, customerId, adGroupResourceName);
+
+ AddGeoTargeting(client, customerId, campaignResourceName);
+ }
+
+ // [START add_responsive_search_ad_full_customizer_1]
+ ///
+ /// Creates a customizer attribute with the specified customizer attribute name.
+ ///
+ /// The Google Ads API client.
+ /// The customer ID.
+ /// The name of the customizer attribute.
+ /// The created customizer attribute resource name.
+ private string CreateCustomizerAttribute(
+ GoogleAdsClient client,
+ long customerId,
+ string customizerAttributeName)
+ {
+ // Creates a customizer attribute operation for creating a customizer attribute.
+ CustomizerAttributeOperation operation = new CustomizerAttributeOperation() {
+ // Creates a customizer attribute with the specified name.
+ Create = new CustomizerAttribute() {
+ Name = customizerAttributeName,
+
+ // Specifies the type to be 'PRICE' so that we can dynamically customize the part of
+ // the ad's description that is a price of a product/service we advertise.
+ Type = CustomizerAttributeType.Price
+ }
+ };
+
+ CustomizerAttributeServiceClient serviceClient =
+ client.GetService(Services.V16.CustomizerAttributeService);
+
+ // Issues a mutate request to add the customizer attribute and prints its information.
+ MutateCustomizerAttributesResponse response =
+ serviceClient.MutateCustomizerAttributes(
+ customerId.ToString(),
+ new [] { operation }.ToList()
+ );
+
+ string resourceName = response.Results[0].ResourceName;
+
+ Console.WriteLine($"Added a customizer attribute with resource name '{resourceName}'.");
+
+ return resourceName;
+ }
+ // [END add_responsive_search_ad_full_customizer_1]
+
+ // [START add_responsive_search_ad_full_customizer_2]
+ ///
+ /// Links the customizer attribute to the customer by providing a value to be used in a
+ /// responsive search ad that will be created in a later step.
+ ///
+ /// The Google Ads API client.
+ /// The customer ID.
+ /// The resource name of the customizer
+ /// attribute.
+ private void LinkCustomizerAttributeToCustomer(
+ GoogleAdsClient client,
+ long customerId,
+ string customizerAttributeResourceName)
+ {
+ // Creates a customer customizer operation.
+ CustomerCustomizerOperation operation = new CustomerCustomizerOperation() {
+ // Creates a customer customizer with the value to be used in the responsive search
+ // ad.
+ Create = new CustomerCustomizer() {
+ CustomizerAttribute = customizerAttributeResourceName,
+
+ Value = new CustomizerValue() {
+ Type = CustomizerAttributeType.Price,
+
+ // Specify '100USD' as a text value. The ad customizer will dynamically
+ // replace the placeholder with this value when the ad serves.
+ StringValue = "100USD"
+ }
+ }
+ };
+
+ CustomerCustomizerServiceClient serviceClient =
+ client.GetService(Services.V16.CustomerCustomizerService);
+
+ // Issues a mutate request to add the customer customizer and prints its information.
+ MutateCustomerCustomizersResponse response =
+ serviceClient.MutateCustomerCustomizers(
+ customerId.ToString(),
+ new [] { operation }.ToList()
+ );
+
+ string resourceName = response.Results[0].ResourceName;
+
+ Console.WriteLine($"Added a customer customizer with resource name '{resourceName}'.");
+ }
+ // [END add_responsive_search_ad_full_customizer_2]
+
+ ///
+ /// Adds a campaign budget.
+ ///
+ /// The Google Ads client.
+ /// The Google Ads customer ID for which the call is made.
+ /// The campaign budget resource name.
+ private static string AddCampaignBudget(GoogleAdsClient client, long customerId)
+ {
+ // Get the CampaignBudgetService.
+ CampaignBudgetServiceClient campaignBudgetService =
+ client.GetService(Services.V16.CampaignBudgetService);
+
+ // Create the budget.
+ CampaignBudget campaignBudget = new CampaignBudget()
+ {
+ Name = "Interplanetary Cruise Budget #" + ExampleUtilities.GetRandomString(),
+ AmountMicros = 3_000_000,
+ DeliveryMethod = BudgetDeliveryMethod.Standard
+ };
+
+ // Create the operation.
+ CampaignBudgetOperation operation = new CampaignBudgetOperation()
+ {
+ Create = campaignBudget
+ };
+
+ // Add the campaign budget.
+ MutateCampaignBudgetsResponse response =
+ campaignBudgetService.MutateCampaignBudgets(customerId.ToString(),
+ new CampaignBudgetOperation[] { operation });
+ // Display the result.
+
+ string budgetResourceName = response.Results[0].ResourceName;
+ Console.WriteLine($"Added budget with resource name '{budgetResourceName}'.");
+ return budgetResourceName;
+ }
+
+ ///
+ /// Adds a campaign.
+ ///
+ /// The Google Ads client.
+ /// The Google Ads customer ID for which the call is made.
+ /// The campaign budget resource name.
+ /// The campaign resource name.
+ private static string AddCampaign(GoogleAdsClient client, long customerId,
+ string budgetResourceName)
+ {
+ // Get the CampaignService.
+ CampaignServiceClient campaignService = client.GetService(Services.V16.CampaignService);
+
+ // Create the campaign.
+ Campaign campaign = new Campaign()
+ {
+ Name = "Testing RSA via API #" + ExampleUtilities.GetRandomString(),
+ AdvertisingChannelType = AdvertisingChannelType.Search,
+ Status = CampaignStatus.Paused,
+ ManualCpc = new ManualCpc(),
+ NetworkSettings = new Campaign.Types.NetworkSettings()
+ {
+ TargetGoogleSearch = true,
+ TargetSearchNetwork = true,
+ TargetPartnerSearchNetwork = false,
+ // Enable Display Expansion on Search campaigns. For more details see:
+ // https://support.google.com/google-ads/answer/7193800
+ TargetContentNetwork = true
+ },
+ CampaignBudget = budgetResourceName,
+
+ StartDate = DateTime.Now.AddDays(1).ToString("yyyyMMdd"),
+ EndDate = DateTime.Now.AddDays(30).ToString("yyyyMMdd")
+ };
+
+ // Create the operation.
+ CampaignOperation operation = new CampaignOperation()
+ {
+ Create = campaign
+ };
+
+ // Add the campaign.
+ MutateCampaignsResponse response =
+ campaignService.MutateCampaigns(customerId.ToString(),
+ new CampaignOperation[] { operation });
+
+ // Displays the result.
+ string campaignResourceName = response.Results[0].ResourceName;
+ Console.WriteLine($"Added campaign with resource name '{campaignResourceName}'.");
+ return campaignResourceName;
+ }
+
+ /// Adds an ad group.
+ /// The Google Ads client.
+ /// The Google Ads customer ID for which the call is made.
+ /// The campaign resource name.
+ /// The ad group resource name.
+ // [START add_dynamic_search_ads_1]
+ private static string AddAdGroup(GoogleAdsClient client, long customerId,
+ string campaignResourceName)
+ {
+ // Get the AdGroupService.
+ AdGroupServiceClient adGroupService = client.GetService(Services.V16.AdGroupService);
+
+ // Create the ad group.
+ AdGroup adGroup = new AdGroup()
+ {
+ Name = "Testing RSA via API #" + ExampleUtilities.GetRandomString(),
+ Campaign = campaignResourceName,
+ Type = AdGroupType.SearchStandard,
+ Status = AdGroupStatus.Enabled,
+
+ // If you want to set up a max CPC bid, uncomment the line below.
+ // CpcBidMicros = 50_000
+ };
+
+ // Create the operation.
+ AdGroupOperation operation = new AdGroupOperation()
+ {
+ Create = adGroup
+ };
+
+ // Add the ad group.
+ MutateAdGroupsResponse response =
+ adGroupService.MutateAdGroups(customerId.ToString(),
+ new AdGroupOperation[] { operation });
+
+ // Display the results.
+ string adGroupResourceName = response.Results[0].ResourceName;
+ Console.WriteLine($"Added ad group with resource name '{adGroupResourceName}'.");
+
+ return adGroupResourceName;
+ }
+
+ // [START add_responsive_search_ad_with_ad_customizer_3]
+ ///
+ /// Creates a responsive search ad that uses the specified customizer attribute.
+ ///
+ /// The Google Ads API client.
+ /// The customer ID.
+ /// The resource name of the ad group.
+ /// The name of the customizer attribute.
+ private void CreateResponsiveSearchAdWithCustomization(
+ GoogleAdsClient client,
+ long customerId,
+ string adGroupResourceName,
+ string customizerAttributeName)
+ {
+ // Creates an ad group ad operation.
+ AdGroupAdOperation operation = new AdGroupAdOperation() {
+
+ // Creates an ad group ad to hold the ad.
+ Create = new AdGroupAd() {
+
+ AdGroup = adGroupResourceName,
+ Status = AdGroupAdStatus.Enabled,
+
+ // Creates an ad and sets responsive search ad info.
+ Ad = new Ad() {
+
+ ResponsiveSearchAd = new ResponsiveSearchAdInfo() {
+ Headlines =
+ {
+ // Sets a pinning to always choose this asset for HEADLINE_1.
+ // Pinning is optional; if no pinning is set, then headlines and
+ // descriptions will be rotated and the ones that perform best will
+ //be used more often.
+ new AdTextAsset() { Text = "Cruise to Mars" },
+ new AdTextAsset() { Text = "Best Space Cruise Line" },
+ new AdTextAsset() { Text = "Experience the Stars" }
+ },
+
+ Descriptions =
+ {
+ new AdTextAsset() { Text = "Buy your tickets now" },
+
+ // Creates this particular description using the ad customizer. For
+ // details about the placeholder format, visit the following:
+ // https://developers.google.com/google-ads/api/docs/ads/customize-responsive-search-ads#ad_customizers_in_responsive_search_ads
+ //
+ // The ad customizer replaces the placeholder with the value we
+ // previously created and linked to the customer using
+ // `CustomerCustomizer`.
+ new AdTextAsset()
+ {
+ Text = $"Just {{CUSTOMIZER.{customizerAttributeName}:10USD}}"
+ }
+ },
+
+ Path1 = "all-inclusive",
+ Path2 = "deals"
+ },
+
+ FinalUrls = { "http://www.example.com" }
+ }
+ }
+ };
+
+ // Issues a mutate request to add the ad group ad and prints its information.
+ AdGroupAdServiceClient serviceClient = client.GetService(Services.V16.AdGroupAdService);
+
+ MutateAdGroupAdsResponse response = serviceClient.MutateAdGroupAds(
+ customerId.ToString(),
+ new [] { operation }.ToList()
+ );
+
+ string resourceName = response.Results[0].ResourceName;
+
+ Console.WriteLine($"Created responsive search ad with resource name '{resourceName}'.");
+ }
+ // [END add_responsive_search_ad_with_ad_customizer_3]
+
+ ///
+ /// Creates 3 keyword match types: EXACT, PHRASE, and BROAD.
+ /// EXACT: ads may show on searches that ARE the same meaning as your keyword.
+ /// PHRASE: ads may show on searches that INCLUDE the meaning of your keyword.
+ /// BROAD: ads may show on searches that RELATE to your keyword.
+ /// For smart bidding, BROAD is the recommended one.
+ ///
+ /// The Google Ads API client.
+ /// The customer ID.
+ /// The resource name of the ad group.
+ private void AddKeywords(GoogleAdsClient client, long customerId,
+ string adGroupResourceName)
+ {
+ // Get the AdGroupCriterionService.
+ AdGroupCriterionServiceClient adGroupCriterionService =
+ client.GetService(Services.V16.AdGroupCriterionService);
+
+ List operations = new List();
+
+ AdGroupCriterionOperation exactMatchOperation = new AdGroupCriterionOperation()
+ {
+ Create = new AdGroupCriterion()
+ {
+ AdGroup = adGroupResourceName,
+ Status = AdGroupCriterionStatus.Enabled,
+ Keyword = new KeywordInfo()
+ {
+ Text = "example of exact match",
+ MatchType = KeywordMatchType.Exact
+ },
+ // Uncomment the line below if you want to change this keyword to a negative
+ // target.
+ // Negative = true
+ }
+ };
+ // Optional repeated field
+ // exactMatchOperation.Create.FinalUrls.Add("https://www.example.com");
+ operations.Add(exactMatchOperation);
+
+ AdGroupCriterionOperation phraseMatchOperation = new AdGroupCriterionOperation()
+ {
+ Create = new AdGroupCriterion()
+ {
+ AdGroup = adGroupResourceName,
+ Status = AdGroupCriterionStatus.Enabled,
+ Keyword = new KeywordInfo()
+ {
+ Text = "example of phrase match",
+ MatchType = KeywordMatchType.Phrase
+ },
+ // Uncomment the line below if you want to change this keyword to a negative
+ // target.
+ // Negative = true
+ }
+ };
+ // Optional repeated field
+ // phraseMatchOperation.Create.FinalUrls.Add("https://www.example.com");
+ operations.Add(phraseMatchOperation);
+
+ AdGroupCriterionOperation broadMatchOperation = new AdGroupCriterionOperation()
+ {
+ Create = new AdGroupCriterion()
+ {
+ AdGroup = adGroupResourceName,
+ Status = AdGroupCriterionStatus.Enabled,
+ Keyword = new KeywordInfo()
+ {
+ Text = "example of broad match",
+ MatchType = KeywordMatchType.Broad
+ },
+ // Uncomment the line below if you want to change this keyword to a negative
+ // target.
+ // Negative = true
+ }
+ };
+ // Optional repeated field
+ // broadMatchOperation.Create.FinalUrls.Add("https://www.example.com");
+ operations.Add(broadMatchOperation);
+
+ MutateAdGroupCriteriaResponse response =
+ adGroupCriterionService.MutateAdGroupCriteria(customerId.ToString(), operations);
+
+ // Display the results.
+ foreach (MutateAdGroupCriterionResult newAdGroupCriterion in response.Results)
+ {
+ Console.WriteLine("Keyword with resource name '{0}' was created.",
+ newAdGroupCriterion.ResourceName);
+ }
+ }
+
+ ///
+ /// Creates geo targets.
+ ///
+ /// The Google Ads API client.
+ /// The customer ID.
+ /// The resource name of the campaign.
+ private void AddGeoTargeting(GoogleAdsClient client, long customerId,
+ string campaignResourceName)
+ {
+ GeoTargetConstantServiceClient geoTargetConstantService =
+ client.GetService(Services.V16.GeoTargetConstantService);
+
+ SuggestGeoTargetConstantsRequest suggestGeoTargetConstantsRequest =
+ new SuggestGeoTargetConstantsRequest()
+ {
+ // Locale uses the ISO 639-1 format.
+ Locale = "es",
+ // A list of available country codes can be referenced here:
+ // https://developers.google.com/google-ads/api/reference/data/geotargets
+ CountryCode = "AR",
+ LocationNames = new LocationNames()
+ {
+ Names = {"Buenos aires", "San Isidro", "Mar del Plata"}
+ }
+ };
+
+ SuggestGeoTargetConstantsResponse suggestGeoTargetConstantsResponse =
+ geoTargetConstantService.SuggestGeoTargetConstants(
+ suggestGeoTargetConstantsRequest);
+
+ List operations = new List();
+ foreach (GeoTargetConstantSuggestion suggestion in
+ suggestGeoTargetConstantsResponse.GeoTargetConstantSuggestions)
+ {
+ Console.WriteLine($"Geo target constant: {suggestion.GeoTargetConstant.Name} was " +
+ $"found in locale ({suggestion.Locale}) with reach ({suggestion.Reach}) from " +
+ $"search term ({suggestion.SearchTerm})");
+
+ CampaignCriterionOperation operation = new CampaignCriterionOperation()
+ {
+ Create = new CampaignCriterion()
+ {
+ Campaign = campaignResourceName,
+ Location = new LocationInfo()
+ {
+ GeoTargetConstant = suggestion.GeoTargetConstant.ResourceName
+ }
+ }
+ };
+ operations.Add(operation);
+ }
+
+ CampaignCriterionServiceClient campaignCriterionService =
+ client.GetService(Services.V16.CampaignCriterionService);
+
+ MutateCampaignCriteriaResponse mutateCampaignCriteriaResponse =
+ campaignCriterionService.MutateCampaignCriteria(customerId.ToString(), operations);
+
+ foreach (MutateCampaignCriterionResult result in mutateCampaignCriteriaResponse.Results)
+ {
+ Console.WriteLine($"Added campaign criterion {result.ResourceName}");
+ }
+ }
+ }
+}
diff --git a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddResponsiveSearchAdWithAdCustomizer.cs b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddResponsiveSearchAdWithAdCustomizer.cs
deleted file mode 100644
index e81e44e4f..000000000
--- a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddResponsiveSearchAdWithAdCustomizer.cs
+++ /dev/null
@@ -1,312 +0,0 @@
-// Copyright 2021 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using CommandLine;
-using Google.Ads.Gax.Examples;
-using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.Util;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Enums;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
-using Google.Protobuf;
-using System.Collections.Generic;
-using System.Linq;
-using System;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupAdStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdvertisingChannelSubTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdvertisingChannelTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AssetFieldTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AssetGroupStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AssetTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.BiddingStrategyTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.BudgetDeliveryMethodEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.BudgetTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CampaignStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CriterionTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CustomizerAttributeTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.MediaTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Services.SmartCampaignSuggestionInfo.Types;
-
-namespace Google.Ads.GoogleAds.Examples.V15
-{
- ///
- /// Adds a customizer attribute, links the customizer attribute to a customer, and then adds
- /// a responsive search ad with a description using the ad customizer to the specified ad group.
- ///
- public class AddResponsiveSearchAdWithAdCustomizer : ExampleBase
- {
- ///
- ///
- public class Options : OptionsBase
- {
- ///
- /// The Google Ads customer ID.
- ///
- [Option("customerId", Required = true, HelpText =
- "The Google Ads customer ID.")]
- public long CustomerId { get; set; }
-
- ///
- /// The Google Ads ad group ID.
- ///
- [Option("adGroupId", Required = true, HelpText =
- "The Google Ads ad group ID.")]
- public long AdGroupId { get; set; }
-
- ///
- /// The Google Ads customizer attribute name ID.
- ///
- [Option("customizerAttributeName", Required = false, HelpText =
- "The Google Ads customizer attribute name.", Default = CUSTOMIZER_ATTRIBUTE_NAME)]
- public string CustomizerAttributeName { get; set; }
- }
-
- ///
- /// Main method, to run this code example as a standalone application.
- ///
- /// The command line arguments.
- public static void Main(string[] args)
- {
- Options options = ExampleUtilities.ParseCommandLine(args);
-
- AddResponsiveSearchAdWithAdCustomizer codeExample =
- new AddResponsiveSearchAdWithAdCustomizer();
-
- Console.WriteLine(codeExample.Description);
-
- codeExample.Run(
- new GoogleAdsClient(),
- options.CustomerId,
- options.AdGroupId,
- options.CustomizerAttributeName
- );
- }
-
- // The name of the customizer attribute to be used in the ad customizer must be unique for a
- // given client account. To run this example multiple times, change this value or specify its
- // corresponding argument. Note that there is a limit for the number of enabled customizer
- // attributes in one account, so you shouldn't run this example more than necessary.
- //
- // Visit the following link for more details:
- // https://developers.google.com/google-ads/api/docs/ads/customize-responsive-search-ads#rules_and_limitations
- private const string CUSTOMIZER_ATTRIBUTE_NAME = "Price";
-
- ///
- /// Returns a description about the code example.
- ///
- public override string Description =>
- "Adds a customizer attribute, links the customizer attribute to a customer, and then " +
- "adds a responsive search ad with a description using the ad customizer to the " +
- "specified ad group.";
-
- ///
- /// Runs the example.
- ///
- /// The Google Ads client.
- /// The Google Ads customer ID.
- /// The Google Ads ad group ID.
- /// The customizer attribute name.
- public void Run(
- GoogleAdsClient client,
- long customerId,
- long adGroupId,
- string customizerAttributeName)
- {
- string customizerAttributeResourceName = CreateCustomizerAttribute(
- client,
- customerId,
- customizerAttributeName
- );
-
- LinkCustomizerAttributeToCustomer(client, customerId, customizerAttributeResourceName);
-
- CreateResponsiveSearchAdWithCustomization(
- client,
- customerId,
- adGroupId,
- customizerAttributeName
- );
- }
-
- // [START add_responsive_search_ad_with_ad_customizer_1]
- ///
- /// Creates a customizer attribute with the specified customizer attribute name.
- ///
- /// The Google Ads API client.
- /// The customer ID.
- /// The name of the customizer attribute.
- /// The created customizer attribute resource name.
- private string CreateCustomizerAttribute(
- GoogleAdsClient client,
- long customerId,
- string customizerAttributeName)
- {
- // Creates a customizer attribute operation for creating a customizer attribute.
- CustomizerAttributeOperation operation = new CustomizerAttributeOperation() {
- // Creates a customizer attribute with the specified name.
- Create = new CustomizerAttribute() {
- Name = customizerAttributeName,
-
- // Specifies the type to be 'PRICE' so that we can dynamically customize the part of
- // the ad's description that is a price of a product/service we advertise.
- Type = CustomizerAttributeType.Price
- }
- };
-
- CustomizerAttributeServiceClient serviceClient =
- client.GetService(Services.V15.CustomizerAttributeService);
-
- // Issues a mutate request to add the customizer attribute and prints its information.
- MutateCustomizerAttributesResponse response =
- serviceClient.MutateCustomizerAttributes(
- customerId.ToString(),
- new [] { operation }.ToList()
- );
-
- string resourceName = response.Results[0].ResourceName;
-
- Console.WriteLine($"Added a customizer attribute with resource name '{resourceName}'.");
-
- return resourceName;
- }
- // [END add_responsive_search_ad_with_ad_customizer_1]
-
- // [START add_responsive_search_ad_with_ad_customizer_2]
- ///
- /// Links the customizer attribute to the customer by providing a value to be used in a
- /// responsive search ad that will be created in a later step.
- ///
- /// The Google Ads API client.
- /// The customer ID.
- /// The resource name of the customizer
- /// attribute.
- private void LinkCustomizerAttributeToCustomer(
- GoogleAdsClient client,
- long customerId,
- string customizerAttributeResourceName)
- {
- // Creates a customer customizer operation.
- CustomerCustomizerOperation operation = new CustomerCustomizerOperation() {
- // Creates a customer customizer with the value to be used in the responsive search
- // ad.
- Create = new CustomerCustomizer() {
- CustomizerAttribute = customizerAttributeResourceName,
-
- Value = new CustomizerValue() {
- Type = CustomizerAttributeType.Price,
-
- // Specify '100USD' as a text value. The ad customizer will dynamically
- // replace the placeholder with this value when the ad serves.
- StringValue = "100USD"
- }
- }
- };
-
- CustomerCustomizerServiceClient serviceClient =
- client.GetService(Services.V15.CustomerCustomizerService);
-
- // Issues a mutate request to add the customer customizer and prints its information.
- MutateCustomerCustomizersResponse response =
- serviceClient.MutateCustomerCustomizers(
- customerId.ToString(),
- new [] { operation }.ToList()
- );
-
- string resourceName = response.Results[0].ResourceName;
-
- Console.WriteLine($"Added a customer customizer with resource name '{resourceName}'.");
- }
- // [END add_responsive_search_ad_with_ad_customizer_2]
-
- // [START add_responsive_search_ad_with_ad_customizer_3]
- ///
- /// Creates a responsive search ad that uses the specified customizer attribute.
- ///
- /// The Google Ads API client.
- /// The customer ID.
- /// The ad group ID.
- /// The name of the customizer attribute.
- private void CreateResponsiveSearchAdWithCustomization(
- GoogleAdsClient client,
- long customerId,
- long adGroupId,
- string customizerAttributeName)
- {
- // Creates an ad group ad operation.
- AdGroupAdOperation operation = new AdGroupAdOperation() {
-
- // Creates an ad group ad to hold the ad.
- Create = new AdGroupAd() {
-
- AdGroup = ResourceNames.AdGroup(customerId, adGroupId),
- Status = AdGroupAdStatus.Paused,
-
- // Creates an ad and sets responsive search ad info.
- Ad = new Ad() {
-
- ResponsiveSearchAd = new ResponsiveSearchAdInfo() {
- Headlines =
- {
- // Sets a pinning to always choose this asset for HEADLINE_1. Pinning is
- // optional; if no pinning is set, then headlines and descriptions will be
- // rotated and the ones that perform best will be used more often.
- new AdTextAsset() { Text = "Cruise to Mars" },
- new AdTextAsset() { Text = "Best Space Cruise Line" },
- new AdTextAsset() { Text = "Experience the Stars" }
- },
-
- Descriptions =
- {
- new AdTextAsset() { Text = "Buy your tickets now" },
-
- // Creates this particular description using the ad customizer. For
- // details about the placeholder format, visit the following:
- // https://developers.google.com/google-ads/api/docs/ads/customize-responsive-search-ads#ad_customizers_in_responsive_search_ads
- //
- // The ad customizer replaces the placeholder with the value we
- // previously created and linked to the customer using
- // `CustomerCustomizer`.
- new AdTextAsset()
- {
- Text = $"Just {{CUSTOMIZER.{customizerAttributeName}:10USD}}"
- }
- },
-
- Path1 = "all-inclusive",
- Path2 = "deals"
- },
-
- FinalUrls = { "http://www.example.com" }
- }
- }
- };
-
- // Issues a mutate request to add the ad group ad and prints its information.
- AdGroupAdServiceClient serviceClient = client.GetService(Services.V15.AdGroupAdService);
-
- MutateAdGroupAdsResponse response = serviceClient.MutateAdGroupAds(
- customerId.ToString(),
- new [] { operation }.ToList()
- );
-
- string resourceName = response.Results[0].ResourceName;
-
- Console.WriteLine($"Created responsive search ad with resource name '{resourceName}'.");
- }
- // [END add_responsive_search_ad_with_ad_customizer_3]
- }
-}
diff --git a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddSmartCampaign.cs b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddSmartCampaign.cs
index 3eaf21e53..7c18f8abf 100644
--- a/Google.Ads.GoogleAds/examples/AdvancedOperations/AddSmartCampaign.cs
+++ b/Google.Ads.GoogleAds/examples/AdvancedOperations/AddSmartCampaign.cs
@@ -19,19 +19,19 @@
using Google.Ads.Gax.Examples;
using Google.Ads.Gax.Util;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Enums;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdvertisingChannelTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdvertisingChannelSubTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.BudgetTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CampaignStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Services.SmartCampaignSuggestionInfo.Types;
-
-namespace Google.Ads.GoogleAds.Examples.V15
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Enums;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdvertisingChannelTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdvertisingChannelSubTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.BudgetTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CampaignStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Services.SmartCampaignSuggestionInfo.Types;
+
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This example shows how to create a Smart Campaign.
@@ -150,7 +150,7 @@ public void Run(GoogleAdsClient client, long customerId, string keywordText,
string freeFormKeywordText, string businessProfileLocation, string businessName)
{
GoogleAdsServiceClient googleAdsServiceClient =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
try
{
@@ -268,7 +268,7 @@ private List GetKeywordThemeSuggestions(
GoogleAdsClient client, long customerId, SmartCampaignSuggestionInfo suggestionInfo)
{
SmartCampaignSuggestServiceClient smartCampaignSuggestService =
- client.GetService(Services.V15.SmartCampaignSuggestService);
+ client.GetService(Services.V16.SmartCampaignSuggestService);
SuggestKeywordThemesRequest request = new SuggestKeywordThemesRequest()
{
@@ -300,7 +300,7 @@ private IEnumerable GetKeywordTextAutoCompletions(
GoogleAdsClient client, string keywordText)
{
KeywordThemeConstantServiceClient keywordThemeConstantServiceClient =
- client.GetService(Services.V15.KeywordThemeConstantService);
+ client.GetService(Services.V16.KeywordThemeConstantService);
SuggestKeywordThemeConstantsRequest request = new SuggestKeywordThemeConstantsRequest
{
@@ -429,7 +429,7 @@ private long GetBudgetSuggestion(GoogleAdsClient client, long customerId,
SmartCampaignSuggestionInfo suggestionInfo)
{
SmartCampaignSuggestServiceClient smartCampaignSuggestServiceClient = client.GetService
- (Services.V15.SmartCampaignSuggestService);
+ (Services.V16.SmartCampaignSuggestService);
SuggestSmartCampaignBudgetOptionsRequest request =
new SuggestSmartCampaignBudgetOptionsRequest
@@ -486,7 +486,7 @@ private SmartCampaignAdInfo GetAdSuggestions(GoogleAdsClient client,
long customerId, SmartCampaignSuggestionInfo suggestionInfo)
{
SmartCampaignSuggestServiceClient smartCampaignSuggestService =
- client.GetService(Services.V15.SmartCampaignSuggestService);
+ client.GetService(Services.V16.SmartCampaignSuggestService);
SuggestSmartCampaignAdRequest request = new SuggestSmartCampaignAdRequest
{
diff --git a/Google.Ads.GoogleAds/examples/AdvancedOperations/CreateAndAttachSharedKeywordSet.cs b/Google.Ads.GoogleAds/examples/AdvancedOperations/CreateAndAttachSharedKeywordSet.cs
index 2f19e1879..c2a21f1a4 100644
--- a/Google.Ads.GoogleAds/examples/AdvancedOperations/CreateAndAttachSharedKeywordSet.cs
+++ b/Google.Ads.GoogleAds/examples/AdvancedOperations/CreateAndAttachSharedKeywordSet.cs
@@ -15,16 +15,16 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.KeywordMatchTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.SharedSetTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.KeywordMatchTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.SharedSetTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example creates a shared list of negative broad match keywords. It then
@@ -83,11 +83,11 @@ public static void Main(string[] args)
public void Run(GoogleAdsClient client, long customerId, long campaignId)
{
SharedSetServiceClient sharedSetService = client.GetService(
- Services.V15.SharedSetService);
+ Services.V16.SharedSetService);
SharedCriterionServiceClient sharedCriterionService =
- client.GetService(Services.V15.SharedCriterionService);
+ client.GetService(Services.V16.SharedCriterionService);
CampaignSharedSetServiceClient campaignSharedSetService =
- client.GetService(Services.V15.CampaignSharedSetService);
+ client.GetService(Services.V16.CampaignSharedSetService);
try
{
diff --git a/Google.Ads.GoogleAds/examples/AdvancedOperations/FindAndRemoveCriteriaFromSharedSet.cs b/Google.Ads.GoogleAds/examples/AdvancedOperations/FindAndRemoveCriteriaFromSharedSet.cs
index b271b6a60..a5aa1fc58 100644
--- a/Google.Ads.GoogleAds/examples/AdvancedOperations/FindAndRemoveCriteriaFromSharedSet.cs
+++ b/Google.Ads.GoogleAds/examples/AdvancedOperations/FindAndRemoveCriteriaFromSharedSet.cs
@@ -15,15 +15,15 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Api.Gax;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.CriterionTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CriterionTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example demonstrates how to find shared sets, shared set criteria, and
@@ -85,10 +85,10 @@ public void Run(GoogleAdsClient client, long customerId, long campaignId)
try
{
SharedCriterionServiceClient sharedCriterionService = client.GetService(
- Services.V15.SharedCriterionService);
+ Services.V16.SharedCriterionService);
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
List sharedSetIds = new List();
List criterionResources = new List();
diff --git a/Google.Ads.GoogleAds/examples/AdvancedOperations/GetAdGroupBidModifiers.cs b/Google.Ads.GoogleAds/examples/AdvancedOperations/GetAdGroupBidModifiers.cs
index e713b5e1e..770ec440e 100644
--- a/Google.Ads.GoogleAds/examples/AdvancedOperations/GetAdGroupBidModifiers.cs
+++ b/Google.Ads.GoogleAds/examples/AdvancedOperations/GetAdGroupBidModifiers.cs
@@ -15,14 +15,14 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Api.Gax;
using System;
-using static Google.Ads.GoogleAds.V15.Resources.AdGroupBidModifier;
+using static Google.Ads.GoogleAds.V16.Resources.AdGroupBidModifier;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example gets ad group bid modifiers.
@@ -83,7 +83,7 @@ public void Run(GoogleAdsClient client, long customerId, long? adGroupId)
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
string searchQuery = @"
SELECT
diff --git a/Google.Ads.GoogleAds/examples/AdvancedOperations/UseCrossAccountBiddingStrategy.cs b/Google.Ads.GoogleAds/examples/AdvancedOperations/UseCrossAccountBiddingStrategy.cs
index fde1842a5..0ffd81a50 100644
--- a/Google.Ads.GoogleAds/examples/AdvancedOperations/UseCrossAccountBiddingStrategy.cs
+++ b/Google.Ads.GoogleAds/examples/AdvancedOperations/UseCrossAccountBiddingStrategy.cs
@@ -19,13 +19,13 @@
using Google.Ads.Gax.Examples;
using Google.Ads.Gax.Util;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
-using static Google.Ads.GoogleAds.V15.Enums.BiddingStrategyTypeEnum.Types;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
+using static Google.Ads.GoogleAds.V16.Enums.BiddingStrategyTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example adds a cross-account bidding strategy to a manager account and attaches it
@@ -133,7 +133,7 @@ public void Run(GoogleAdsClient client, long customerId, long managerCustomerId,
private string CreateBiddingStrategy(GoogleAdsClient client, long managerCustomerId)
{
BiddingStrategyServiceClient biddingStrategyServiceClient =
- client.GetService(Services.V15.BiddingStrategyService);
+ client.GetService(Services.V16.BiddingStrategyService);
// Create a portfolio bidding strategy.
// [START set_currency_code]
@@ -179,7 +179,7 @@ private void ListManagerOwnedBiddingStrategies(GoogleAdsClient client,
long managerCustomerId)
{
GoogleAdsServiceClient googleAdsServiceClient =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
// Create a GAQL query that will retrieve all cross-account bidding strategies.
string query = @"
@@ -225,7 +225,7 @@ private void ListCustomerAccessibleBiddingStrategies(GoogleAdsClient client,
long customerId)
{
GoogleAdsServiceClient googleAdsServiceClient =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
// Create a GAQL query that will retrieve all accessible bidding strategies.
string query = @"
@@ -281,7 +281,7 @@ private void AttachCrossAccountBiddingStrategyToCampaign(GoogleAdsClient client,
long customerId, long campaignId, string biddingStrategyResourceName)
{
CampaignServiceClient campaignServiceClient =
- client.GetService(Services.V15.CampaignService);
+ client.GetService(Services.V16.CampaignService);
Campaign campaign = new Campaign
{
diff --git a/Google.Ads.GoogleAds/examples/AdvancedOperations/UsePortfolioBiddingStrategy.cs b/Google.Ads.GoogleAds/examples/AdvancedOperations/UsePortfolioBiddingStrategy.cs
index 73cd233cd..61e644778 100644
--- a/Google.Ads.GoogleAds/examples/AdvancedOperations/UsePortfolioBiddingStrategy.cs
+++ b/Google.Ads.GoogleAds/examples/AdvancedOperations/UsePortfolioBiddingStrategy.cs
@@ -15,18 +15,18 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Enums;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Enums;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.AdvertisingChannelTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CampaignStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Resources.Campaign.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdvertisingChannelTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CampaignStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Resources.Campaign.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example adds a portfolio bidding strategy and uses it to construct a campaign.
@@ -130,7 +130,7 @@ private string CreatePortfolioBiddingStrategy(GoogleAdsClient client,
{
// Get the BiddingStrategyService.
BiddingStrategyServiceClient biddingStrategyService = client.GetService(
- Services.V15.BiddingStrategyService);
+ Services.V16.BiddingStrategyService);
// Create a portfolio bidding strategy.
BiddingStrategy biddingStrategy = new BiddingStrategy()
@@ -172,7 +172,7 @@ private string CreateSharedBudget(GoogleAdsClient client, long customerId, strin
{
// Get the CampaignBudgetService.
CampaignBudgetServiceClient campaignBudgetService =
- client.GetService(Services.V15.CampaignBudgetService);
+ client.GetService(Services.V16.CampaignBudgetService);
// Create a shared budget.
CampaignBudget budget = new CampaignBudget()
@@ -210,7 +210,7 @@ private string CreateCampaignWithBiddingStrategy(GoogleAdsClient client,
string campaignBudgetResourceName)
{
// Get the CampaignService.
- CampaignServiceClient campaignService = client.GetService(Services.V15.CampaignService);
+ CampaignServiceClient campaignService = client.GetService(Services.V16.CampaignService);
// [START use_portfolio_bidding_strategy_2]
// Create the campaign.
diff --git a/Google.Ads.GoogleAds/examples/Extensions/AddCall.cs b/Google.Ads.GoogleAds/examples/Assets/AddCall.cs
similarity index 91%
rename from Google.Ads.GoogleAds/examples/Extensions/AddCall.cs
rename to Google.Ads.GoogleAds/examples/Assets/AddCall.cs
index a94de5bc6..74eb6d3b6 100644
--- a/Google.Ads.GoogleAds/examples/Extensions/AddCall.cs
+++ b/Google.Ads.GoogleAds/examples/Assets/AddCall.cs
@@ -15,23 +15,23 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System.Linq;
using System;
-using static Google.Ads.GoogleAds.V15.Enums.AssetFieldTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CallConversionReportingStateEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.MinuteOfHourEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AssetFieldTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CallConversionReportingStateEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.MinuteOfHourEnum.Types;
using SystemDayOfWeek = System.DayOfWeek;
-using DayOfWeek = Google.Ads.GoogleAds.V15.Enums.DayOfWeekEnum.Types.DayOfWeek;
+using DayOfWeek = Google.Ads.GoogleAds.V16.Enums.DayOfWeekEnum.Types.DayOfWeek;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
- /// This example adds a call extension to a specific account.
+ /// This example adds a call asset to a specific account.
///
public class AddCall : ExampleBase
{
@@ -116,8 +116,8 @@ public void Run(
{
try
{
- // Creates the asset for the call extensions.
- string assetResourceName = AddExtensionAsset(
+ // Creates the call asset for the call.
+ string assetResourceName = AddCallAsset(
client,
customerId,
phoneCountry,
@@ -125,7 +125,7 @@ public void Run(
conversionActionId
);
- // Adds the extensions at the account level, so these will serve in all eligible
+ // Adds the asset at the account level, so these will serve in all eligible
// campaigns.
LinkAssetToAccount(client, customerId, assetResourceName);
}
@@ -148,7 +148,7 @@ public void Run(
/// The phone number itself.
/// The conversion action ID or null.
/// The resource name of the created call asset
- private string AddExtensionAsset(
+ private string AddCallAsset(
GoogleAdsClient client,
long customerId,
string phoneCountry,
@@ -202,7 +202,7 @@ private string AddExtensionAsset(
};
AssetServiceClient assetServiceClient =
- client.GetService(Services.V15.AssetService);
+ client.GetService(Services.V16.AssetService);
// Issues a mutate request to add the asset and prints its information.
MutateAssetsResponse response = assetServiceClient.MutateAssets(
@@ -241,7 +241,7 @@ private void LinkAssetToAccount(
};
CustomerAssetServiceClient customerAssetServiceClient =
- client.GetService(Services.V15.CustomerAssetService);
+ client.GetService(Services.V16.CustomerAssetService);
// Issues a mutate request to add the customer asset and prints its information.
MutateCustomerAssetsResponse response = customerAssetServiceClient.MutateCustomerAssets(
diff --git a/Google.Ads.GoogleAds/examples/Extensions/AddHotelCallout.cs b/Google.Ads.GoogleAds/examples/Assets/AddHotelCallout.cs
similarity index 86%
rename from Google.Ads.GoogleAds/examples/Extensions/AddHotelCallout.cs
rename to Google.Ads.GoogleAds/examples/Assets/AddHotelCallout.cs
index 19f8b9086..52a80d2f3 100644
--- a/Google.Ads.GoogleAds/examples/Extensions/AddHotelCallout.cs
+++ b/Google.Ads.GoogleAds/examples/Assets/AddHotelCallout.cs
@@ -15,20 +15,19 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.ExtensionTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AssetFieldTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AssetFieldTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
- /// This example adds a hotel callout extension to a specific account, campaign within the
+ /// This example adds a hotel callout asset to a specific account, campaign within the
/// account, and ad group within the campaign.
///
public class AddHotelCallout : ExampleBase
@@ -72,7 +71,7 @@ public static void Main(string[] args)
/// Returns a description about the code example.
///
public override string Description =>
- "This example adds a hotel callout extension to a specific account.";
+ "This example adds a hotel callout asset to a specific account.";
///
/// Runs the code example.
@@ -85,11 +84,11 @@ public void Run(GoogleAdsClient client, long customerId, string languageCode)
{
try
{
- // Creates assets for the hotel callout extensions.
+ // Creates assets for the hotel callout asset.
List assetResourceNames =
- AddExtensionAsset(client, customerId, languageCode);
+ AddHotelCalloutAsset(client, customerId, languageCode);
- // Adds the extensions at the account level, so these will serve in all eligible
+ // Adds the asset at the account level, so these will serve in all eligible
// campaigns.
LinkAssetToAccount(client, customerId, assetResourceNames);
}
@@ -109,8 +108,8 @@ public void Run(GoogleAdsClient client, long customerId, string languageCode)
/// The Google Ads API client.
/// The client customer ID.
/// The language code for the text.
- /// The created extension feed item's resource name.
- private List AddExtensionAsset(GoogleAdsClient client, in long customerId,
+ /// The created asset resource name.
+ private List AddHotelCalloutAsset(GoogleAdsClient client, in long customerId,
string languageCode)
{
List hotelCalloutAssets = new List();
@@ -146,7 +145,7 @@ private List AddExtensionAsset(GoogleAdsClient client, in long customerI
// Issues the create request to create the assets.
- AssetServiceClient assetClient = client.GetService(Services.V15.AssetService);
+ AssetServiceClient assetClient = client.GetService(Services.V16.AssetService);
MutateAssetsResponse response =
assetClient.MutateAssets(customerId.ToString(), operations);
List results = response.Results.ToList();
@@ -168,7 +167,6 @@ private List AddExtensionAsset(GoogleAdsClient client, in long customerI
/// The Google Ads API client.
/// The client customer ID.
/// The asset resource names.
- /// The created extension feed item's resource name.
private void LinkAssetToAccount(GoogleAdsClient client, in long customerId,
List assetResourceNames)
{
@@ -192,7 +190,7 @@ private void LinkAssetToAccount(GoogleAdsClient client, in long customerId,
// Issues the create request to add the callout.
CustomerAssetServiceClient customerAssetServiceClient =
- client.GetService(Services.V15.CustomerAssetService);
+ client.GetService(Services.V16.CustomerAssetService);
MutateCustomerAssetsResponse response =
customerAssetServiceClient.MutateCustomerAssets(customerId.ToString(),
@@ -200,7 +198,7 @@ private void LinkAssetToAccount(GoogleAdsClient client, in long customerId,
foreach (MutateCustomerAssetResult result in response.Results)
{
- Console.WriteLine("Added an account extension with resource name: " +
+ Console.WriteLine("Added an account asset with resource name: " +
result.ResourceName);
}
}
diff --git a/Google.Ads.GoogleAds/examples/Extensions/AddLeadFormExtension.cs b/Google.Ads.GoogleAds/examples/Assets/AddLeadFormAsset.cs
similarity index 71%
rename from Google.Ads.GoogleAds/examples/Extensions/AddLeadFormExtension.cs
rename to Google.Ads.GoogleAds/examples/Assets/AddLeadFormAsset.cs
index 9b461be91..c61d17b7c 100644
--- a/Google.Ads.GoogleAds/examples/Extensions/AddLeadFormExtension.cs
+++ b/Google.Ads.GoogleAds/examples/Assets/AddLeadFormAsset.cs
@@ -15,27 +15,25 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Enums;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
-using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.LeadFormCallToActionTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.LeadFormFieldUserInputTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.LeadFormPostSubmitCallToActionTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.LeadFormCallToActionTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.LeadFormFieldUserInputTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.LeadFormPostSubmitCallToActionTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
- /// This code example creates a lead form and a lead form extension for a campaign. Run
+ /// This code example creates a lead form asset for a campaign. Run
/// AddCampaigns.cs to create a campaign.
///
- public class AddLeadFormExtension : ExampleBase
+ public class AddLeadFormAsset : ExampleBase
{
///
- /// Command line options for running the example.
+ /// Command line options for running the example.
///
public class Options : OptionsBase
{
@@ -47,10 +45,10 @@ public class Options : OptionsBase
public long CustomerId { get; set; }
///
- /// ID of the campaign to which lead form extensions are added.
+ /// ID of the campaign to which lead form assets are added.
///
[Option("campaignId", Required = true, HelpText =
- "ID of the campaign to which lead form extensions are added.")]
+ "ID of the campaign to which lead form assets are added.")]
public long CampaignId { get; set; }
}
@@ -62,7 +60,7 @@ public static void Main(string[] args)
{
Options options = ExampleUtilities.ParseCommandLine(args);
- AddLeadFormExtension codeExample = new AddLeadFormExtension();
+ AddLeadFormAsset codeExample = new AddLeadFormAsset();
Console.WriteLine(codeExample.Description);
codeExample.Run(new GoogleAdsClient(), options.CustomerId, options.CampaignId);
}
@@ -71,7 +69,7 @@ public static void Main(string[] args)
/// Returns a description about the code example.
///
public override string Description =>
- "This code example creates a lead form and a lead form extension for a campaign. " +
+ "This code example creates a lead form for a campaign. " +
"Run AddCampaigns.cs to create a campaign.";
///
@@ -80,7 +78,7 @@ public static void Main(string[] args)
/// The Google Ads client.
/// The customer ID for which the call is made.
///
- /// ID of the campaign to which lead form extensions are added.
+ /// ID of the campaign to which lead form assets are added.
///
public void Run(GoogleAdsClient client, long customerId, long campaignId)
{
@@ -88,9 +86,6 @@ public void Run(GoogleAdsClient client, long customerId, long campaignId)
{
// Create a lead form asset.
string leadFormAssetResourceName = CreateLeadFormAsset(client, customerId);
-
- // Create a lead form extension for the campaign.
- CreateLeadFormExtension(client, customerId, campaignId, leadFormAssetResourceName);
}
catch (GoogleAdsException e)
{
@@ -102,56 +97,16 @@ public void Run(GoogleAdsClient client, long customerId, long campaignId)
}
}
- ///
- /// Creates the lead form extension.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- ///
- /// ID of the campaign to which lead form extensions are added.
- ///
- /// The lead form asset resource name.
- // [START add_lead_form_extension_1]
- private void CreateLeadFormExtension(GoogleAdsClient client, long customerId,
- long campaignId, string leadFormAssetResourceName)
- {
- CampaignAssetServiceClient campaignAssetService = client.GetService(
- Services.V15.CampaignAssetService);
-
- // Creates the campaign asset for the lead form.
- CampaignAsset campaignAsset = new CampaignAsset()
- {
- Asset = leadFormAssetResourceName,
- FieldType = AssetFieldTypeEnum.Types.AssetFieldType.LeadForm,
- Campaign = ResourceNames.Campaign(customerId, campaignId),
- };
-
- CampaignAssetOperation operation = new CampaignAssetOperation()
- {
- Create = campaignAsset
- };
-
- MutateCampaignAssetsResponse response = campaignAssetService.MutateCampaignAssets(
- customerId.ToString(), new[] { operation });
-
- foreach (MutateCampaignAssetResult result in response.Results)
- {
- Console.WriteLine("Created campaign asset with resource name =" +
- $" '{result.ResourceName}' for campaign ID {campaignId}.");
- }
- }
- // [END add_lead_form_extension_1]
-
///
/// Creates the lead form asset.
///
/// The Google Ads client.
/// The customer ID for which the call is made.
/// The lead form asset resource name.
- // [START add_lead_form_extension]
+ // [START add_lead_form_asset]
private string CreateLeadFormAsset(GoogleAdsClient client, long customerId)
{
- AssetServiceClient assetService = client.GetService(Services.V15.AssetService);
+ AssetServiceClient assetService = client.GetService(Services.V16.AssetService);
// Creates the lead form asset.
Asset leadFormAsset = new Asset()
@@ -159,7 +114,7 @@ private string CreateLeadFormAsset(GoogleAdsClient client, long customerId)
Name = $"Interplanetary Cruise #{ExampleUtilities.GetRandomString()} Lead Form",
LeadFormAsset = new LeadFormAsset()
{
- // Specify the details of the extension that the users will see.
+ // Specify the details of the asset that the users will see.
CallToActionType = LeadFormCallToActionType.BookNow,
CallToActionDescription = "Latest trip to Jupiter!",
@@ -247,6 +202,6 @@ private string CreateLeadFormAsset(GoogleAdsClient client, long customerId)
"was created.");
return leadFormAssetResourceName;
}
- // [END add_lead_form_extension]
+ // [END add_lead_form_asset]
}
}
diff --git a/Google.Ads.GoogleAds/examples/Extensions/AddPrices.cs b/Google.Ads.GoogleAds/examples/Assets/AddPrices.cs
similarity index 93%
rename from Google.Ads.GoogleAds/examples/Extensions/AddPrices.cs
rename to Google.Ads.GoogleAds/examples/Assets/AddPrices.cs
index e1eebddc1..a75335241 100644
--- a/Google.Ads.GoogleAds/examples/Extensions/AddPrices.cs
+++ b/Google.Ads.GoogleAds/examples/Assets/AddPrices.cs
@@ -15,18 +15,18 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Enums;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Enums;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.PriceExtensionPriceQualifierEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.PriceExtensionPriceUnitEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.PriceExtensionTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.PriceExtensionPriceQualifierEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.PriceExtensionPriceUnitEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.PriceExtensionTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example adds a price extension and associates it with an account.
@@ -148,7 +148,7 @@ private string CreatePriceAsset(GoogleAdsClient client, long customerId)
Create = asset,
};
- AssetServiceClient assetClient = client.GetService(Services.V15.AssetService);
+ AssetServiceClient assetClient = client.GetService(Services.V16.AssetService);
MutateAssetsResponse response = assetClient.MutateAssets(customerId.ToString(),
new[] { operation });
string resourceName = response.Results[0].ResourceName;
@@ -177,14 +177,14 @@ private void AddExtensionToAccount(GoogleAdsClient client, long customerId,
// Issues the create request to add the callout.
CustomerAssetServiceClient customerAssetServiceClient =
- client.GetService(Services.V15.CustomerAssetService);
+ client.GetService(Services.V16.CustomerAssetService);
CustomerAssetOperation operation = new CustomerAssetOperation
{
Create = customerAsset,
};
CustomerAssetServiceClient assetClient =
- client.GetService(Services.V15.CustomerAssetService);
+ client.GetService(Services.V16.CustomerAssetService);
MutateCustomerAssetsResponse response =
assetClient.MutateCustomerAssets(customerId.ToString(), new[] { operation });
diff --git a/Google.Ads.GoogleAds/examples/Extensions/AddSitelinksUsingAssets.cs b/Google.Ads.GoogleAds/examples/Assets/AddSitelinks.cs
similarity index 90%
rename from Google.Ads.GoogleAds/examples/Extensions/AddSitelinksUsingAssets.cs
rename to Google.Ads.GoogleAds/examples/Assets/AddSitelinks.cs
index 68b402549..4ac74f390 100644
--- a/Google.Ads.GoogleAds/examples/Extensions/AddSitelinksUsingAssets.cs
+++ b/Google.Ads.GoogleAds/examples/Assets/AddSitelinks.cs
@@ -15,25 +15,25 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.AssetFieldTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AssetFieldTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example adds sitelinks to a campaign using assets. Run AddCampaigns.cs to
/// create a campaign.
///
- public class AddSitelinksUsingAssets : ExampleBase
+ public class AddSitelinks : ExampleBase
{
///
- /// Command line options for running the example.
+ /// Command line options for running the example.
///
public class Options : OptionsBase
{
@@ -60,7 +60,7 @@ public static void Main(string[] args)
{
Options options = ExampleUtilities.ParseCommandLine(args);
- AddSitelinksUsingAssets codeExample = new AddSitelinksUsingAssets();
+ AddSitelinks codeExample = new AddSitelinks();
Console.WriteLine(codeExample.Description);
codeExample.Run(new GoogleAdsClient(), options.CustomerId, options.CampaignId);
}
@@ -107,24 +107,24 @@ public void Run(GoogleAdsClient client, long customerId, long campaignId)
/// The list of sitelink resource names.
private List CreateSitelinkAssets(GoogleAdsClient client, long customerId)
{
- AssetServiceClient assetService = client.GetService(Services.V15.AssetService);
+ AssetServiceClient assetService = client.GetService(Services.V16.AssetService);
// Creates some sitelink assets.
- SitelinkAsset storeLocatorExtension = new SitelinkAsset()
+ SitelinkAsset storeLocatorAsset = new SitelinkAsset()
{
Description1 = "Get in touch",
Description2 = "Find your local store",
LinkText = "Store locator"
};
- SitelinkAsset storeExtension = new SitelinkAsset()
+ SitelinkAsset storeAsset = new SitelinkAsset()
{
Description1 = "Buy some stuff",
Description2 = "It's really good",
LinkText = "Store"
};
- SitelinkAsset storeAdditionalExtension = new SitelinkAsset()
+ SitelinkAsset storeAdditionalAsset = new SitelinkAsset()
{
Description1 = "Even more stuff",
Description2 = "There's never enough",
@@ -136,21 +136,21 @@ private List CreateSitelinkAssets(GoogleAdsClient client, long customerI
{
new Asset()
{
- SitelinkAsset = storeLocatorExtension,
+ SitelinkAsset = storeLocatorAsset,
FinalUrls = { "http://example.com/contact/store-finder" },
// Optionally sets a different URL for mobile.
FinalMobileUrls = { "http://example.com/mobile/contact/store-finder" }
},
new Asset()
{
- SitelinkAsset = storeExtension,
+ SitelinkAsset = storeAsset,
FinalUrls = { "http://example.com/store" },
// Optionally sets a different URL for mobile.
FinalMobileUrls = {"http://example.com/mobile/store" }
},
new Asset()
{
- SitelinkAsset = storeAdditionalExtension,
+ SitelinkAsset = storeAdditionalAsset,
FinalUrls = { "http://example.com/store/more" },
// Optionally sets a different URL for mobile.
FinalMobileUrls = { "http://example.com/mobile/store/more" }
@@ -193,7 +193,7 @@ private void LinkSitelinksToCampaign(GoogleAdsClient client, long customerId,
long campaignId, List sitelinkAssetResourceNames)
{
CampaignAssetServiceClient campaignAssetService = client.GetService(
- Services.V15.CampaignAssetService);
+ Services.V16.CampaignAssetService);
string campaignResourceName = ResourceNames.Campaign(customerId, campaignId);
diff --git a/Google.Ads.GoogleAds/examples/Authentication/AuthenticateInAspNetCoreApplication/AdsController.cs b/Google.Ads.GoogleAds/examples/Authentication/AuthenticateInAspNetCoreApplication/AdsController.cs
index 4ccc7b7f3..c8701c9cf 100644
--- a/Google.Ads.GoogleAds/examples/Authentication/AuthenticateInAspNetCoreApplication/AdsController.cs
+++ b/Google.Ads.GoogleAds/examples/Authentication/AuthenticateInAspNetCoreApplication/AdsController.cs
@@ -15,8 +15,8 @@
using Google.Ads.GoogleAds.Config;
using Google.Ads.GoogleAds.Extensions.Config;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Protobuf;
using Microsoft.AspNetCore.Mvc;
@@ -81,7 +81,7 @@ public IActionResult GetCampaigns(long customerId)
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
string query = "SELECT campaign.id, campaign.name, campaign.status FROM campaign " +
"ORDER BY campaign.id limit 100";
diff --git a/Google.Ads.GoogleAds/examples/Authentication/AuthenticateInAspNetCoreApplication/AuthenticateInAspNetCoreApplication.csproj b/Google.Ads.GoogleAds/examples/Authentication/AuthenticateInAspNetCoreApplication/AuthenticateInAspNetCoreApplication.csproj
index 459706dbc..c4431365c 100644
--- a/Google.Ads.GoogleAds/examples/Authentication/AuthenticateInAspNetCoreApplication/AuthenticateInAspNetCoreApplication.csproj
+++ b/Google.Ads.GoogleAds/examples/Authentication/AuthenticateInAspNetCoreApplication/AuthenticateInAspNetCoreApplication.csproj
@@ -14,11 +14,11 @@
-
+
+ Include="Google.Ads.GoogleAds" Version="19.0.0" />
+ Include="Google.Ads.GoogleAds.Extensions" Version="1.1.0" />
diff --git a/Google.Ads.GoogleAds/examples/Authentication/AuthenticateInAspNetWebApplication/Default.aspx.cs b/Google.Ads.GoogleAds/examples/Authentication/AuthenticateInAspNetWebApplication/Default.aspx.cs
index 95be83212..4cb884c15 100644
--- a/Google.Ads.GoogleAds/examples/Authentication/AuthenticateInAspNetWebApplication/Default.aspx.cs
+++ b/Google.Ads.GoogleAds/examples/Authentication/AuthenticateInAspNetWebApplication/Default.aspx.cs
@@ -13,7 +13,7 @@
// limitations under the License.
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Api.Gax;
using System;
using System.Web.UI;
@@ -82,7 +82,7 @@ async protected void btnGetCampaigns_Click(object sender, EventArgs e)
string customerId = txtCustomerId.Text;
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
// Create a request that will retrieve all campaigns using pages of the specified
// page size.
diff --git a/Google.Ads.GoogleAds/examples/BasicOperations/AddAdGroups.cs b/Google.Ads.GoogleAds/examples/BasicOperations/AddAdGroups.cs
index 3a57eec83..319863ba9 100644
--- a/Google.Ads.GoogleAds/examples/BasicOperations/AddAdGroups.cs
+++ b/Google.Ads.GoogleAds/examples/BasicOperations/AddAdGroups.cs
@@ -15,14 +15,14 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Enums;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Enums;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example illustrates how to create ad groups. To create campaigns, run
@@ -86,7 +86,7 @@ public static void Main(string[] args)
public void Run(GoogleAdsClient client, long customerId, long campaignId)
{
// Get the AdGroupService.
- AdGroupServiceClient adGroupService = client.GetService(Services.V15.AdGroupService);
+ AdGroupServiceClient adGroupService = client.GetService(Services.V16.AdGroupService);
List operations = new List();
diff --git a/Google.Ads.GoogleAds/examples/BasicOperations/AddCampaigns.cs b/Google.Ads.GoogleAds/examples/BasicOperations/AddCampaigns.cs
index a1797887d..b2f9d46c9 100644
--- a/Google.Ads.GoogleAds/examples/BasicOperations/AddCampaigns.cs
+++ b/Google.Ads.GoogleAds/examples/BasicOperations/AddCampaigns.cs
@@ -15,18 +15,18 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.AdvertisingChannelTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.BudgetDeliveryMethodEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CampaignStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Resources.Campaign.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdvertisingChannelTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.BudgetDeliveryMethodEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CampaignStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Resources.Campaign.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example adds campaigns.
@@ -79,7 +79,7 @@ public static void Main(string[] args)
public void Run(GoogleAdsClient client, long customerId)
{
// Get the CampaignService.
- CampaignServiceClient campaignService = client.GetService(Services.V15.CampaignService);
+ CampaignServiceClient campaignService = client.GetService(Services.V16.CampaignService);
// Create a budget to be used for the campaign.
string budget = CreateBudget(client, customerId);
@@ -167,7 +167,7 @@ private static string CreateBudget(GoogleAdsClient client, long customerId)
{
// Get the BudgetService.
CampaignBudgetServiceClient budgetService = client.GetService(
- Services.V15.CampaignBudgetService);
+ Services.V16.CampaignBudgetService);
// Create the campaign budget.
CampaignBudget budget = new CampaignBudget()
diff --git a/Google.Ads.GoogleAds/examples/BasicOperations/GetCampaigns.cs b/Google.Ads.GoogleAds/examples/BasicOperations/GetCampaigns.cs
index ec02aff42..f3f6cf460 100644
--- a/Google.Ads.GoogleAds/examples/BasicOperations/GetCampaigns.cs
+++ b/Google.Ads.GoogleAds/examples/BasicOperations/GetCampaigns.cs
@@ -15,11 +15,11 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Services;
using System;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example gets all campaigns. To add campaigns, run AddCampaigns.cs.
@@ -69,7 +69,7 @@ public void Run(GoogleAdsClient client, long customerId)
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
// Create a query that will retrieve all campaigns.
string query = @"SELECT
diff --git a/Google.Ads.GoogleAds/examples/BasicOperations/GetResponsiveSearchAds.cs b/Google.Ads.GoogleAds/examples/BasicOperations/GetResponsiveSearchAds.cs
index a7c2afa5b..cfff59680 100644
--- a/Google.Ads.GoogleAds/examples/BasicOperations/GetResponsiveSearchAds.cs
+++ b/Google.Ads.GoogleAds/examples/BasicOperations/GetResponsiveSearchAds.cs
@@ -15,17 +15,17 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Api.Gax;
using Google.Protobuf.Collections;
using System;
using System.Collections.Generic;
using System.Linq;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example gets non-removed responsive search ads in a specified ad group.
@@ -92,7 +92,7 @@ public void Run(GoogleAdsClient client, long customerId, long? adGroupId)
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
string searchQuery =
$@"SELECT
diff --git a/Google.Ads.GoogleAds/examples/BasicOperations/PauseAd.cs b/Google.Ads.GoogleAds/examples/BasicOperations/PauseAd.cs
index 198fc7aea..55988ce71 100644
--- a/Google.Ads.GoogleAds/examples/BasicOperations/PauseAd.cs
+++ b/Google.Ads.GoogleAds/examples/BasicOperations/PauseAd.cs
@@ -16,14 +16,14 @@
using Google.Ads.Gax.Examples;
using Google.Ads.Gax.Util;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupAdStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupAdStatusEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example pauses a given ad. To list all ads, run GetExpandedTextAds.cs.
@@ -90,7 +90,7 @@ public void Run(GoogleAdsClient client, long customerId, long adGroupId, long ad
{
// Get the AdGroupAdService.
AdGroupAdServiceClient adGroupAdService = client.GetService(
- Services.V15.AdGroupAdService);
+ Services.V16.AdGroupAdService);
// Create the ad group ad.
AdGroupAd adGroupAd = new AdGroupAd
diff --git a/Google.Ads.GoogleAds/examples/BasicOperations/RemoveCampaign.cs b/Google.Ads.GoogleAds/examples/BasicOperations/RemoveCampaign.cs
index b83003299..7a287b81a 100644
--- a/Google.Ads.GoogleAds/examples/BasicOperations/RemoveCampaign.cs
+++ b/Google.Ads.GoogleAds/examples/BasicOperations/RemoveCampaign.cs
@@ -15,13 +15,13 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example removes a campaign. To get campaigns, run GetCampaigns.cs.
@@ -78,7 +78,7 @@ public static void Main(string[] args)
public void Run(GoogleAdsClient client, long customerId, long campaignId)
{
// Get the CampaignService.
- CampaignServiceClient campaignService = client.GetService(Services.V15.CampaignService);
+ CampaignServiceClient campaignService = client.GetService(Services.V16.CampaignService);
// Create the operation, and set the Remove field to the resource name of the
// campaign to be removed.
diff --git a/Google.Ads.GoogleAds/examples/BasicOperations/SearchForGoogleAdsFields.cs b/Google.Ads.GoogleAds/examples/BasicOperations/SearchForGoogleAdsFields.cs
index 123abe681..56806dc01 100644
--- a/Google.Ads.GoogleAds/examples/BasicOperations/SearchForGoogleAdsFields.cs
+++ b/Google.Ads.GoogleAds/examples/BasicOperations/SearchForGoogleAdsFields.cs
@@ -15,15 +15,15 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Api.Gax;
using System;
using System.Collections.Generic;
using System.Linq;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example searches for that match a given prefix,
@@ -81,7 +81,7 @@ public void Run(GoogleAdsClient client, string namePrefix)
{
// Get the GoogleAdsFieldService.
GoogleAdsFieldServiceClient googleAdsFieldService = client.GetService(
- Services.V15.GoogleAdsFieldService);
+ Services.V16.GoogleAdsFieldService);
// Create the query.
string searchQuery = $"SELECT name, category, selectable, filterable, sortable, " +
diff --git a/Google.Ads.GoogleAds/examples/BasicOperations/UpdateAdGroup.cs b/Google.Ads.GoogleAds/examples/BasicOperations/UpdateAdGroup.cs
index 591c39e68..d9d57147a 100644
--- a/Google.Ads.GoogleAds/examples/BasicOperations/UpdateAdGroup.cs
+++ b/Google.Ads.GoogleAds/examples/BasicOperations/UpdateAdGroup.cs
@@ -16,14 +16,14 @@
using Google.Ads.Gax.Examples;
using Google.Ads.Gax.Util;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Enums;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Enums;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example illustrates how to update an ad group, setting its status to 'PAUSED',
@@ -93,7 +93,7 @@ public static void Main(string[] args)
public void Run(GoogleAdsClient client, long customerId, long adGroupId,
long? cpcBidMicroAmount)
{
- AdGroupServiceClient adGroupService = client.GetService(Services.V15.AdGroupService);
+ AdGroupServiceClient adGroupService = client.GetService(Services.V16.AdGroupService);
// Create an ad group with the specified ID.
AdGroup adGroup = new AdGroup();
diff --git a/Google.Ads.GoogleAds/examples/BasicOperations/UpdateCampaign.cs b/Google.Ads.GoogleAds/examples/BasicOperations/UpdateCampaign.cs
index ad5844e92..4a5d7410e 100644
--- a/Google.Ads.GoogleAds/examples/BasicOperations/UpdateCampaign.cs
+++ b/Google.Ads.GoogleAds/examples/BasicOperations/UpdateCampaign.cs
@@ -16,15 +16,15 @@
using Google.Ads.Gax.Examples;
using Google.Ads.Gax.Util;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.CampaignStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Resources.Campaign.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CampaignStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Resources.Campaign.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example updates a campaign. To get campaigns, run GetCampaigns.cs.
@@ -81,7 +81,7 @@ public static void Main(string[] args)
public void Run(GoogleAdsClient client, long customerId, long campaignId)
{
// Get the CampaignService.
- CampaignServiceClient campaignService = client.GetService(Services.V15.CampaignService);
+ CampaignServiceClient campaignService = client.GetService(Services.V16.CampaignService);
// Update campaign by setting its status to paused, and "Search network" to false.
Campaign campaignToUpdate = new Campaign()
diff --git a/Google.Ads.GoogleAds/examples/BasicOperations/UpdateResponsiveSearchAd.cs b/Google.Ads.GoogleAds/examples/BasicOperations/UpdateResponsiveSearchAd.cs
index a86c6d75f..65935b822 100644
--- a/Google.Ads.GoogleAds/examples/BasicOperations/UpdateResponsiveSearchAd.cs
+++ b/Google.Ads.GoogleAds/examples/BasicOperations/UpdateResponsiveSearchAd.cs
@@ -16,15 +16,14 @@
using Google.Ads.Gax.Examples;
using Google.Ads.Gax.Util;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
-using System.Collections.Generic;
-using Google.Ads.GoogleAds.V15.Enums;
+using Google.Ads.GoogleAds.V16.Enums;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example updates a responsive search ad. To get responsive search ads,
@@ -84,7 +83,7 @@ public static void Main(string[] args)
public void Run(GoogleAdsClient client, long customerId, long adId)
{
// Get the AdService.
- AdServiceClient adService = client.GetService(Services.V15.AdService);
+ AdServiceClient adService = client.GetService(Services.V16.AdService);
Ad ad = new Ad()
{
diff --git a/Google.Ads.GoogleAds/examples/Billing/AddAccountBudgetProposal.cs b/Google.Ads.GoogleAds/examples/Billing/AddAccountBudgetProposal.cs
index 7f0bd115f..9494ad21d 100644
--- a/Google.Ads.GoogleAds/examples/Billing/AddAccountBudgetProposal.cs
+++ b/Google.Ads.GoogleAds/examples/Billing/AddAccountBudgetProposal.cs
@@ -15,15 +15,15 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.AccountBudgetProposalTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.TimeTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AccountBudgetProposalTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.TimeTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example creates an account budget proposal using the 'CREATE' operation. To get
@@ -87,7 +87,7 @@ public void Run(GoogleAdsClient client, long customerId, long billingSetupId)
{
// Get the AccountBudgetProposalServiceClient.
AccountBudgetProposalServiceClient proposalService =
- client.GetService(Services.V15.AccountBudgetProposalService);
+ client.GetService(Services.V16.AccountBudgetProposalService);
// Create an AccountBudgetProposal. The proposal will be reviewed offline by Google Ads,
// and if approved will become an AccountBudget.
diff --git a/Google.Ads.GoogleAds/examples/Billing/AddBillingSetup.cs b/Google.Ads.GoogleAds/examples/Billing/AddBillingSetup.cs
index 9bb88c6ad..f78cf51dd 100644
--- a/Google.Ads.GoogleAds/examples/Billing/AddBillingSetup.cs
+++ b/Google.Ads.GoogleAds/examples/Billing/AddBillingSetup.cs
@@ -15,16 +15,16 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Api.Gax;
using System;
using System.Collections.Generic;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.TimeTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.TimeTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This example creates a billing setup for a customer. A billing setup is a link between a
@@ -116,11 +116,11 @@ public void Run(GoogleAdsClient client, long customerId, string paymentsAccountI
{
// Gets the GoogleAdsServiceClient.
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
// Gets the BillingSetupServiceClient.
BillingSetupServiceClient billingSetupServiceClient =
- client.GetService(Services.V15.BillingSetupService);
+ client.GetService(Services.V16.BillingSetupService);
try
{
diff --git a/Google.Ads.GoogleAds/examples/Billing/GetInvoices.cs b/Google.Ads.GoogleAds/examples/Billing/GetInvoices.cs
index 1f9333443..52558d57b 100644
--- a/Google.Ads.GoogleAds/examples/Billing/GetInvoices.cs
+++ b/Google.Ads.GoogleAds/examples/Billing/GetInvoices.cs
@@ -15,15 +15,15 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.MonthOfYearEnum.Types;
-using static Google.Ads.GoogleAds.V15.Resources.Invoice.Types;
+using static Google.Ads.GoogleAds.V16.Enums.MonthOfYearEnum.Types;
+using static Google.Ads.GoogleAds.V16.Resources.Invoice.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example retrieves the invoices issued last month for a given billing setup.
@@ -79,7 +79,7 @@ public void Run(GoogleAdsClient client, long customerId, long billingSetupId)
{
// Get the InvoiceService client.
InvoiceServiceClient invoiceServiceClient =
- client.GetService(Services.V15.InvoiceService);
+ client.GetService(Services.V16.InvoiceService);
// Get the last month before today.
DateTime lastMonthDateTime = DateTime.Today.AddMonths(-1);
diff --git a/Google.Ads.GoogleAds/examples/CampaignManagement/AddCampaignLabels.cs b/Google.Ads.GoogleAds/examples/CampaignManagement/AddCampaignLabels.cs
index 16de03f49..73fd2d7e8 100644
--- a/Google.Ads.GoogleAds/examples/CampaignManagement/AddCampaignLabels.cs
+++ b/Google.Ads.GoogleAds/examples/CampaignManagement/AddCampaignLabels.cs
@@ -15,14 +15,14 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
using System.Linq;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example adds a campaign label to a list of campaigns.
@@ -89,7 +89,7 @@ public void Run(GoogleAdsClient client, long customerId, long[] campaignIds, lon
{
// Get the CampaignLabelServiceClient.
CampaignLabelServiceClient campaignLabelService =
- client.GetService(Services.V15.CampaignLabelService);
+ client.GetService(Services.V16.CampaignLabelService);
// Gets the resource name of the label to be added across all given campaigns.
string labelResourceName = ResourceNames.Label(customerId, labelId);
diff --git a/Google.Ads.GoogleAds/examples/CampaignManagement/AddCompleteCampaignsUsingBatchJob.cs b/Google.Ads.GoogleAds/examples/CampaignManagement/AddCompleteCampaignsUsingBatchJob.cs
index 4d26e3b92..2bc3dfffd 100644
--- a/Google.Ads.GoogleAds/examples/CampaignManagement/AddCompleteCampaignsUsingBatchJob.cs
+++ b/Google.Ads.GoogleAds/examples/CampaignManagement/AddCompleteCampaignsUsingBatchJob.cs
@@ -15,25 +15,25 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Api.Gax;
using Google.LongRunning;
using Google.Protobuf.WellKnownTypes;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupAdStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupCriterionStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdvertisingChannelTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.BudgetDeliveryMethodEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CampaignStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.KeywordMatchTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Resources.BatchJob.Types;
-
-namespace Google.Ads.GoogleAds.Examples.V15
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupAdStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupCriterionStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdvertisingChannelTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.BudgetDeliveryMethodEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CampaignStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.KeywordMatchTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Resources.BatchJob.Types;
+
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example adds complete campaigns including campaign budgets, campaigns, ad groups
@@ -114,7 +114,7 @@ public void Run(GoogleAdsClient client, long customerId)
{
// Gets the BatchJobService.
BatchJobServiceClient batchJobService =
- client.GetService(Services.V15.BatchJobService);
+ client.GetService(Services.V16.BatchJobService);
try
{
diff --git a/Google.Ads.GoogleAds/examples/CampaignManagement/CreateExperiment.cs b/Google.Ads.GoogleAds/examples/CampaignManagement/CreateExperiment.cs
index 91c71a38a..28cd26565 100644
--- a/Google.Ads.GoogleAds/examples/CampaignManagement/CreateExperiment.cs
+++ b/Google.Ads.GoogleAds/examples/CampaignManagement/CreateExperiment.cs
@@ -16,16 +16,16 @@
using Google.Ads.Gax.Examples;
using Google.Ads.Gax.Util;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.ExperimentStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.ExperimentTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.ResponseContentTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ExperimentStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ExperimentTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ResponseContentTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example creates a new experiment, experiment arms, and demonstrates
@@ -83,7 +83,7 @@ public void Run(GoogleAdsClient client, long customerId, long baseCampaignId)
{
// Get the ExperimentService.
ExperimentServiceClient experimentService = client.GetService(
- Services.V15.ExperimentService);
+ Services.V16.ExperimentService);
try
{
@@ -121,7 +121,7 @@ private static string CreateAnExperiment(GoogleAdsClient client, long customerId
{
// Get the ExperimentService.
ExperimentServiceClient experimentService = client.GetService(
- Services.V15.ExperimentService);
+ Services.V16.ExperimentService);
// Creates the experiment.
Experiment experiment = new Experiment()
@@ -169,7 +169,7 @@ private static (MutateExperimentArmResult, MutateExperimentArmResult)
{
// Get the ExperimentArmService.
ExperimentArmServiceClient experimentService = client.GetService(
- Services.V15.ExperimentArmService);
+ Services.V16.ExperimentArmService);
// Create the control arm. The control arm references an already-existing campaign.
ExperimentArmOperation controlArmOperation = new ExperimentArmOperation()
@@ -240,7 +240,7 @@ private static void ModifyDraftCampaign(GoogleAdsClient client, long customerId,
{
// Get the CampaignService.
CampaignServiceClient campaignService = client.GetService(
- Services.V15.CampaignService);
+ Services.V16.CampaignService);
// You can change anything you like about the campaign. These are the changes you're
// testing by doing this experiment. Here we just change the name for illustrative
diff --git a/Google.Ads.GoogleAds/examples/CampaignManagement/GetAllDisapprovedAds.cs b/Google.Ads.GoogleAds/examples/CampaignManagement/GetAllDisapprovedAds.cs
index 6b7b2ed3d..7ba3dfda1 100644
--- a/Google.Ads.GoogleAds/examples/CampaignManagement/GetAllDisapprovedAds.cs
+++ b/Google.Ads.GoogleAds/examples/CampaignManagement/GetAllDisapprovedAds.cs
@@ -15,16 +15,16 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Api.Gax;
using System;
using System.Collections.Generic;
using System.Linq;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example retrieves all the disapproved ads in a given campaign.
@@ -86,7 +86,7 @@ public void Run(GoogleAdsClient client, long customerId, long campaignId)
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
string searchQuery = $@"
SELECT
diff --git a/Google.Ads.GoogleAds/examples/CampaignManagement/SetAdParameters.cs b/Google.Ads.GoogleAds/examples/CampaignManagement/SetAdParameters.cs
index b2659fce6..6d8ed4a36 100644
--- a/Google.Ads.GoogleAds/examples/CampaignManagement/SetAdParameters.cs
+++ b/Google.Ads.GoogleAds/examples/CampaignManagement/SetAdParameters.cs
@@ -15,13 +15,13 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example sets ad parameters for a keyword. To get ad group criteria,
@@ -89,7 +89,7 @@ public void Run(GoogleAdsClient client, long customerId, long adGroupId, long cr
{
// Get the AdParameterServiceClient.
AdParameterServiceClient adParameterService =
- client.GetService(Services.V15.AdParameterService);
+ client.GetService(Services.V16.AdParameterService);
// Creates ad parameters.
// There can be a maximum of two AdParameters per ad group criterion.
diff --git a/Google.Ads.GoogleAds/examples/CampaignManagement/UpdateCampaignCriterionBidModifier.cs b/Google.Ads.GoogleAds/examples/CampaignManagement/UpdateCampaignCriterionBidModifier.cs
index c2e150531..2b8923e5d 100644
--- a/Google.Ads.GoogleAds/examples/CampaignManagement/UpdateCampaignCriterionBidModifier.cs
+++ b/Google.Ads.GoogleAds/examples/CampaignManagement/UpdateCampaignCriterionBidModifier.cs
@@ -16,13 +16,13 @@
using Google.Ads.Gax.Examples;
using Google.Ads.Gax.Util;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example updates a campaign criterion with a new bid modifier.
@@ -97,7 +97,7 @@ public void Run(GoogleAdsClient client, long customerId, long campaignId, long c
{
// Get the CampaignCriterionServiceClient .
CampaignCriterionServiceClient campaignCriterionService =
- client.GetService(Services.V15.CampaignCriterionService);
+ client.GetService(Services.V16.CampaignCriterionService);
string criterionResourceName = ResourceNames.CampaignCriteria(customerId,
campaignId, criterionId);
diff --git a/Google.Ads.GoogleAds/examples/CampaignManagement/ValidateAd.cs b/Google.Ads.GoogleAds/examples/CampaignManagement/ValidateAd.cs
index c553868a7..834c2309f 100644
--- a/Google.Ads.GoogleAds/examples/CampaignManagement/ValidateAd.cs
+++ b/Google.Ads.GoogleAds/examples/CampaignManagement/ValidateAd.cs
@@ -15,18 +15,18 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupAdStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.ServedAssetFieldTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Errors.PolicyFindingErrorEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupAdStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ServedAssetFieldTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Errors.PolicyFindingErrorEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example shows how to use the validateOnly request parameter to validate a
@@ -85,7 +85,7 @@ public void Run(GoogleAdsClient client, long customerId, long adGroupId)
{
// Get the AdGroupAdService.
AdGroupAdServiceClient adGroupAdService = client.GetService(
- Services.V15.AdGroupAdService);
+ Services.V16.AdGroupAdService);
// Create the ad group ad object.
AdGroupAd adGroupAd = new AdGroupAd
diff --git a/Google.Ads.GoogleAds/examples/ErrorHandling/HandleKeywordPolicyViolations.cs b/Google.Ads.GoogleAds/examples/ErrorHandling/HandleKeywordPolicyViolations.cs
index 29db8dd08..91f274733 100644
--- a/Google.Ads.GoogleAds/examples/ErrorHandling/HandleKeywordPolicyViolations.cs
+++ b/Google.Ads.GoogleAds/examples/ErrorHandling/HandleKeywordPolicyViolations.cs
@@ -15,16 +15,16 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupCriterionStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.KeywordMatchTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupCriterionStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.KeywordMatchTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example demonstrates how to request an exemption for policy violations of a
@@ -109,7 +109,7 @@ public void Run(GoogleAdsClient client, long customerId, long adGroupId,
{
// Get the AdGroupCriterionServiceClient.
AdGroupCriterionServiceClient service = client.GetService(
- Services.V15.AdGroupCriterionService);
+ Services.V16.AdGroupCriterionService);
if (string.IsNullOrEmpty(keywordText))
{
diff --git a/Google.Ads.GoogleAds/examples/ErrorHandling/HandlePartialFailure.cs b/Google.Ads.GoogleAds/examples/ErrorHandling/HandlePartialFailure.cs
index 76a1491e7..9c63ca5ed 100644
--- a/Google.Ads.GoogleAds/examples/ErrorHandling/HandlePartialFailure.cs
+++ b/Google.Ads.GoogleAds/examples/ErrorHandling/HandlePartialFailure.cs
@@ -16,13 +16,13 @@
using Google.Ads.Gax.Examples;
using Google.Ads.Gax.Lib;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example demonstrates how to handle partial failures.
@@ -162,7 +162,7 @@ private static MutateAdGroupsResponse CreateAdGroups(GoogleAdsClient client,
long customerId, long campaignId)
{
// Get the AdGroupServiceClient.
- AdGroupServiceClient adGroupService = client.GetService(Services.V15.AdGroupService);
+ AdGroupServiceClient adGroupService = client.GetService(Services.V16.AdGroupService);
string validAdGroupName = "Valid AdGroup: " + ExampleUtilities.GetRandomString();
diff --git a/Google.Ads.GoogleAds/examples/ErrorHandling/HandleRateExceededError.cs b/Google.Ads.GoogleAds/examples/ErrorHandling/HandleRateExceededError.cs
index da9fa56c2..254ecc477 100644
--- a/Google.Ads.GoogleAds/examples/ErrorHandling/HandleRateExceededError.cs
+++ b/Google.Ads.GoogleAds/examples/ErrorHandling/HandleRateExceededError.cs
@@ -15,20 +15,20 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupCriterionStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.KeywordMatchTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Errors.QuotaErrorEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupCriterionStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.KeywordMatchTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Errors.QuotaErrorEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example demonstrates how to handle RateExceededError in an application.
@@ -122,7 +122,7 @@ await Task.Run(() =>
{
// Get the AdGroupCriterionServiceClient.
AdGroupCriterionServiceClient adGroupCriterionService =
- client.GetService(Services.V15.AdGroupCriterionService);
+ client.GetService(Services.V16.AdGroupCriterionService);
List operations = new List();
diff --git a/Google.Ads.GoogleAds/examples/ErrorHandling/HandleResponsiveSearchAdPolicyViolations.cs b/Google.Ads.GoogleAds/examples/ErrorHandling/HandleResponsiveSearchAdPolicyViolations.cs
index 9a3710d0a..9a591d988 100644
--- a/Google.Ads.GoogleAds/examples/ErrorHandling/HandleResponsiveSearchAdPolicyViolations.cs
+++ b/Google.Ads.GoogleAds/examples/ErrorHandling/HandleResponsiveSearchAdPolicyViolations.cs
@@ -15,15 +15,15 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupAdStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupAdStatusEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example demonstrates how to request an exemption for policy violations of a
@@ -86,7 +86,7 @@ public void Run(GoogleAdsClient client, long customerId, long adGroupId)
{
// Get the AdGroupAdServiceClient.
AdGroupAdServiceClient adGroupAdService = client.GetService(
- Services.V15.AdGroupAdService);
+ Services.V16.AdGroupAdService);
string adGroupResourceName = ResourceNames.AdGroup(customerId, adGroupId);
ResponsiveSearchAdInfo responsiveSearchAdInfo = new ResponsiveSearchAdInfo()
diff --git a/Google.Ads.GoogleAds/examples/Extensions/AddAffiliateLocationExtensions.cs b/Google.Ads.GoogleAds/examples/Extensions/AddAffiliateLocationExtensions.cs
deleted file mode 100644
index 4651b7be5..000000000
--- a/Google.Ads.GoogleAds/examples/Extensions/AddAffiliateLocationExtensions.cs
+++ /dev/null
@@ -1,477 +0,0 @@
-// Copyright 2020 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using CommandLine;
-using Google.Ads.Gax.Examples;
-using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
-using Google.Api.Gax;
-using Grpc.Core;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading;
-using static Google.Ads.GoogleAds.V15.Enums.AffiliateLocationFeedRelationshipTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AffiliateLocationPlaceholderFieldEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.FeedOriginEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.PlaceholderTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Resources.Feed.Types;
-
-namespace Google.Ads.GoogleAds.Examples.V15
-{
- ///
- /// This code example adds a feed that syncs retail addresses for a given retail chain ID and
- /// associates the feed with a campaign for serving affiliate location extensions.
- ///
- public class AddAffiliateLocationExtensions : ExampleBase
- {
- ///
- /// Command line options for running the
- /// example.
- ///
- public class Options : OptionsBase
- {
- ///
- /// The customer ID for which the call is made.
- ///
- [Option("customerId", Required = true, HelpText =
- "The customer ID for which the call is made.")]
- public long CustomerId { get; set; }
-
- ///
- /// The retail chain ID.
- ///
- [Option("chainId", Required = true, HelpText =
- "The retail chain ID.")]
- public long ChainId { get; set; }
-
- ///
- /// The campaign ID for which the affiliate location extensions are added.
- ///
- [Option("campaignId", Required = true, HelpText =
- "The campaign ID for which the affiliate location extensions are added.")]
- public long CampaignId { get; set; }
- }
-
- ///
- /// Main method, to run this code example as a standalone application.
- ///
- /// The command line arguments.
- public static void Main(string[] args)
- {
- Options options = ExampleUtilities.ParseCommandLine(args);
-
- AddAffiliateLocationExtensions codeExample = new AddAffiliateLocationExtensions();
- Console.WriteLine(codeExample.Description);
- codeExample.Run(new GoogleAdsClient(), options.CustomerId, options.ChainId, options.CampaignId);
- }
-
- // The maximum number of attempts to make to retrieve the FeedMappings before throwing an
- // exception.
- private const int MAX_FEEDMAPPING_RETRIEVAL_ATTEMPTS = 10;
-
- ///
- /// Returns a description about the code example.
- ///
- public override string Description =>
- "This code example adds a feed that syncs retail addresses for a given retail chain " +
- "ID and associates the feed with a campaign for serving affiliate location extensions.";
-
- ///
- /// Runs the code example.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- /// The retail chain ID.
- ///
- /// The campaign ID for which the affiliate location extensions are added.
- ///
- public void Run(GoogleAdsClient client, long customerId, long chainId, long campaignId)
- {
- try
- {
- string feedResourceName = CreateAffiliateLocationExtensionFeed(
- client, customerId, chainId);
- // After the completion of the feed creation operation above the added feed will not
- // be available for usage in a campaign feed until the feed mappings are created. We
- // will wait with an exponential back-off policy until the feed mappings have been
- // created.
- FeedMapping feedMapping = WaitForFeedToBeReady(client, customerId,
- feedResourceName);
- CreateCampaignFeed(client, customerId, campaignId, feedMapping,
- feedResourceName, chainId);
- }
- catch (GoogleAdsException e)
- {
- Console.WriteLine("Failure:");
- Console.WriteLine($"Message: {e.Message}");
- Console.WriteLine($"Failure: {e.Failure}");
- Console.WriteLine($"Request ID: {e.RequestId}");
- throw;
- }
- }
-
- ///
- /// Creates the Affiliate Location Extension feed.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- /// The retail chain ID.
- /// Resource name of the newly created Affiliate Location Extension feed.
- // [START add_affiliate_location_extensions]
- private static string CreateAffiliateLocationExtensionFeed(GoogleAdsClient client,
- long customerId, long chainId)
- {
- // Optional: Delete all existing location extension feeds. This is an optional step, and
- // is required for this code example to run correctly more than once.
- // 1. Google Ads only allows one location extension feed per email address.
- // 2. A Google Ads account cannot have a location extension feed and an affiliate
- // location extension feed at the same time.
- DeleteLocationExtensionFeeds(client, customerId);
-
- // Get the FeedServiceClient.
- FeedServiceClient feedService = client.GetService(Services.V15.FeedService);
-
- // Creates a feed that will sync to retail addresses for a given retail chain ID. Do not
- // add FeedAttributes to this object as Google Ads will add them automatically because
- // this will be a system generated feed.
- Feed feed = new Feed()
- {
- Name = "Affiliate Location Extension feed #" + ExampleUtilities.GetRandomString(),
-
- AffiliateLocationFeedData = new AffiliateLocationFeedData()
- {
- ChainIds = { chainId },
- RelationshipType = AffiliateLocationFeedRelationshipType.GeneralRetailer
- },
- // Since this feed's contents will be managed by Google, you must set its origin to
- // GOOGLE.
- Origin = FeedOrigin.Google
- };
-
- FeedOperation operation = new FeedOperation()
- {
- Create = feed
- };
-
- // Adds the feed.
- MutateFeedsResponse response =
- feedService.MutateFeeds(customerId.ToString(), new[] { operation });
-
- // Displays the results.
- string feedResourceName = response.Results[0].ResourceName;
- Console.WriteLine($"Affliate location extension feed created with resource name: " +
- $"{feedResourceName}.");
- return feedResourceName;
- }
- // [END add_affiliate_location_extensions]
-
- ///
- /// Deletes the old location extension feeds.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- private static void DeleteLocationExtensionFeeds(GoogleAdsClient client, long customerId)
- {
- // To delete a location extension feed, you need to
- // 1. Delete the CustomerFeed so that the location extensions from the feed stop
- // serving.
- // 2. Delete the feed so that Google Ads will no longer sync from the Business Profile
- // account.
- CustomerFeed[] oldCustomerFeeds =
- GetLocationExtensionCustomerFeeds(client, customerId);
- if (oldCustomerFeeds.Length != 0)
- {
- // Optional: You may also want to delete the CampaignFeeds and AdGroupFeeds.
- DeleteCustomerFeeds(client, customerId, oldCustomerFeeds);
- }
- Feed[] feeds = GetLocationExtensionFeeds(client, customerId);
-
- if (feeds.Length != 0)
- {
- RemoveFeeds(client, customerId, feeds);
- }
- }
-
- ///
- /// Gets the location extension feeds.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- /// The list of location extension feeds.
- private static Feed[] GetLocationExtensionFeeds(GoogleAdsClient client, long customerId)
- {
- List feeds = new List();
- GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
-
- // Create the query.
- string query = $"SELECT feed.resource_name, feed.status, " +
- $"feed.places_location_feed_data.email_address, " +
- $"feed.affiliate_location_feed_data.chain_ids " +
- $" from feed where feed.status = ENABLED";
-
- PagedEnumerable result =
- googleAdsService.Search(customerId.ToString(), query);
-
- foreach (GoogleAdsRow row in result)
- {
- // A location extension feed can be identified by checking whether the
- // PlacesLocationFeedData field is set (Location extensions feeds) or
- // AffiliateLocationFeedData field is set (Affiliate location extension feeds)
- Feed feed = row.Feed;
- if (feed.PlacesLocationFeedData != null || feed.AffiliateLocationFeedData != null)
- {
- feeds.Add(feed);
- }
- }
- return feeds.ToArray();
- }
-
- ///
- /// Removes the feeds.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- /// The list of feeds to remove.
- private static void RemoveFeeds(GoogleAdsClient client, long customerId, Feed[] feeds)
- {
- List operations = new List();
- foreach (Feed feed in feeds)
- {
- FeedOperation operation = new FeedOperation()
- {
- Remove = feed.ResourceName,
- };
- operations.Add(operation);
- }
- FeedServiceClient feedService = client.GetService(
- Services.V15.FeedService);
-
- feedService.MutateFeeds(customerId.ToString(), operations.ToArray());
- }
-
- ///
- /// Gets the location extension customer feeds.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- /// The list of location extension customer feeds.
- private static CustomerFeed[] GetLocationExtensionCustomerFeeds(GoogleAdsClient client,
- long customerId)
- {
- List customerFeeds = new List();
- GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
-
- // Create the query. A location extension customer feed can be identified by filtering
- // for placeholder_types=LOCATION (location extension feeds) or placeholder_types
- // =AFFILIATE_LOCATION (affiliate location extension feeds)
- string query = $"SELECT customer_feed.resource_name, customer_feed.feed, " +
- $"customer_feed.status, customer_feed.matching_function.function_string from " +
- $"customer_feed " +
- $"WHERE customer_feed.placeholder_types CONTAINS " +
- $"ANY(LOCATION, AFFILIATE_LOCATION) and customer_feed.status=ENABLED";
-
- PagedEnumerable result =
- googleAdsService.Search(customerId.ToString(), query);
-
- foreach (GoogleAdsRow row in result)
- {
- customerFeeds.Add(row.CustomerFeed);
- }
- return customerFeeds.ToArray();
- }
-
- ///
- /// Deletes the customer feeds.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- /// The customer feeds to delete.
- private static void DeleteCustomerFeeds(GoogleAdsClient client, long customerId,
- CustomerFeed[] customerFeeds)
- {
- List operations = new List();
- foreach (CustomerFeed customerFeed in customerFeeds)
- {
- CustomerFeedOperation operation = new CustomerFeedOperation()
- {
- Remove = customerFeed.ResourceName,
- };
- operations.Add(operation);
- }
-
- CustomerFeedServiceClient feedService = client.GetService(
- Services.V15.CustomerFeedService);
-
- feedService.MutateCustomerFeeds(customerId.ToString(), operations.ToArray());
- }
-
- ///
- /// Gets the Affiliate Location Extension feed mapping.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- /// The feed resource name.
- /// The newly created feed mapping.
- // [START add_affiliate_location_extensions_1]
- private static FeedMapping GetAffiliateLocationExtensionFeedMapping(GoogleAdsClient client,
- long customerId, string feedResourceName)
- {
- // Get the GoogleAdsService.
- GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
-
- // Create the query.
- string query = $"SELECT feed_mapping.resource_name, " +
- $"feed_mapping.attribute_field_mappings, feed_mapping.status FROM " +
- $"feed_mapping WHERE feed_mapping.feed = '{feedResourceName}' and " +
- $"feed_mapping.status = ENABLED and feed_mapping.placeholder_type = " +
- "AFFILIATE_LOCATION LIMIT 1";
-
- // Issue a search request.
- PagedEnumerable result =
- googleAdsService.Search(customerId.ToString(), query);
-
- // Display the results.
- GoogleAdsRow googleAdsRow = result.FirstOrDefault();
- return (googleAdsRow == null) ? null : googleAdsRow.FeedMapping;
- }
- // [END add_affiliate_location_extensions_1]
-
- ///
- /// Waits for the Affliate location extension feed to be ready.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- /// Resource name of the feed.
- // [START add_affiliate_location_extensions_2]
- private static FeedMapping WaitForFeedToBeReady(GoogleAdsClient client, long customerId,
- string feedResourceName)
- {
- int numAttempts = 0;
- int sleepSeconds = 0;
-
- while (numAttempts < MAX_FEEDMAPPING_RETRIEVAL_ATTEMPTS)
- {
- // Once you create a feed, Google's servers will setup the feed by creating feed
- // attributes and feed mapping. Once the feed mapping is created, it is ready to be
- // used for creating customer feed. This process is asynchronous, so we wait until
- // the feed mapping is created, peforming exponential backoff.
- FeedMapping feedMapping = GetAffiliateLocationExtensionFeedMapping(
- client, customerId, feedResourceName);
-
- if (feedMapping == null)
- {
- numAttempts++;
- sleepSeconds = (int) (5 * Math.Pow(2, numAttempts));
- Console.WriteLine($"Checked: #{numAttempts} time(s). Feed is not ready " +
- $"yet. Waiting {sleepSeconds} seconds before trying again.");
- Thread.Sleep(sleepSeconds * 1000);
- }
- else
- {
- Console.WriteLine($"Feed {feedResourceName} is now ready.");
- return feedMapping;
- }
- }
- throw new RpcException(new Status(StatusCode.DeadlineExceeded,
- $"Feed is not ready after {MAX_FEEDMAPPING_RETRIEVAL_ATTEMPTS}" +
- $" retries."));
- }
- // [END add_affiliate_location_extensions_2]
-
- ///
- /// Creates the campaign feed.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- ///
- /// The campaign ID for which the affiliate location extensions are added.
- ///
- ///
- /// The affliate location extension feedmapping for
- ///
- /// The feed resource name.
- /// The retail chain ID.
- // [START add_affiliate_location_extensions_3]
- private static void CreateCampaignFeed(GoogleAdsClient client, long customerId,
- long campaignId, FeedMapping feedMapping, string feedResourceName, long chainId)
- {
- // Get the CampaignFeedService.
- CampaignFeedServiceClient campaignFeedService = client.GetService(
- Services.V15.CampaignFeedService);
-
- long attributeIdForChainId = GetAttributeIdForChainId(feedMapping);
- string feedId = FeedName.Parse(feedResourceName).FeedId;
-
- string matchingFunction =
- $"IN(FeedAttribute[{feedId}, {attributeIdForChainId}], {chainId})";
- // Adds a CampaignFeed that associates the feed with this campaign for the
- // AFFILIATE_LOCATION placeholder type.
- CampaignFeed campaignFeed = new CampaignFeed()
- {
- Feed = feedResourceName,
- PlaceholderTypes = { PlaceholderType.AffiliateLocation },
- MatchingFunction = new MatchingFunction()
- {
- FunctionString = matchingFunction
- },
- Campaign = ResourceNames.Campaign(customerId, campaignId),
- };
-
- CampaignFeedOperation operation = new CampaignFeedOperation()
- {
- Create = campaignFeed
- };
-
- MutateCampaignFeedsResponse campaignFeedsResponse =
- campaignFeedService.MutateCampaignFeeds(
- customerId.ToString(), new[] { operation });
-
- // Displays the result.
- string addedCampaignFeed = campaignFeedsResponse.Results[0].ResourceName;
- Console.WriteLine($"Campaign feed created with resource name: {addedCampaignFeed}.");
- return;
- }
- // [END add_affiliate_location_extensions_3]
-
- ///
- /// Gets the feed attribute ID for the retail chain Id.
- ///
- /// The feed mapping.
- /// The feeed attribute ID.
- ///
- /// Affiliate location feed mapping isn't setup correctly.
- ///
- // [START add_affiliate_location_extensions_4]
- public static long GetAttributeIdForChainId(FeedMapping feedMapping)
- {
- foreach (AttributeFieldMapping fieldMapping in feedMapping.AttributeFieldMappings)
- {
- if (fieldMapping.AffiliateLocationField ==
- AffiliateLocationPlaceholderField.ChainId)
- {
- return fieldMapping.FeedAttributeId;
- }
- }
- throw new ArgumentException("Affiliate location feed mapping isn't setup correctly.");
- }
- // [END add_affiliate_location_extensions_4]
- }
-}
diff --git a/Google.Ads.GoogleAds/examples/Extensions/AddBusinessProfileLocationExtensions.cs b/Google.Ads.GoogleAds/examples/Extensions/AddBusinessProfileLocationExtensions.cs
deleted file mode 100644
index 8f6e49e70..000000000
--- a/Google.Ads.GoogleAds/examples/Extensions/AddBusinessProfileLocationExtensions.cs
+++ /dev/null
@@ -1,492 +0,0 @@
-// Copyright 2020 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using CommandLine;
-using Google.Ads.Gax.Examples;
-using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
-using Google.Api.Gax;
-using Grpc.Core;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading;
-using static Google.Ads.GoogleAds.V15.Common.Operand.Types;
-using static Google.Ads.GoogleAds.V15.Enums.FeedOriginEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.MatchingFunctionOperatorEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.PlaceholderTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Resources.Feed.Types;
-using static Google.Ads.GoogleAds.V15.Resources.Feed.Types.PlacesLocationFeedData.Types;
-
-namespace Google.Ads.GoogleAds.Examples.V15
-{
- ///
- /// This code example adds a feed that syncs feed items from a Business Profile account
- /// and associates the feed with a customer.
- ///
- public class AddBusinessProfileLocationExtensions : ExampleBase
- {
- ///
- /// Command line options for running the
- /// example.
- ///
- public class Options : OptionsBase
- {
- ///
- /// The customer ID for which the call is made.
- ///
- [Option("customerId", Required = true, HelpText =
- "The customer ID for which the call is made.")]
- public long CustomerId { get; set; }
-
- ///
- /// The Business Profile login email address.
- ///
- [Option("businessProfileEmailAddress", Required = true, HelpText =
- "The Business Profile login email address.")]
- public string BusinessProfileEmailAddress { get; set; }
-
- ///
- /// The Business Profile account identifier.
- ///
- [Option("businessAccountId", Required = false, HelpText =
- "The Business Profile account identifier.")]
- public string BusinessAccountId { get; set; }
-
- ///
- /// The OAuth2 access token for the Business Profile account.
- ///
- [Option("businessProfileAccessToken", Required = false, HelpText =
- "The OAuth2 access token for the Business Profile account.")]
- public string BusinessProfileAccessToken { get; set; }
- }
-
- ///
- /// Main method, to run this code example as a standalone application.
- ///
- /// The command line arguments.
- public static void Main(string[] args)
- {
- Options options = ExampleUtilities.ParseCommandLine(args);
-
- AddBusinessProfileLocationExtensions codeExample =
- new AddBusinessProfileLocationExtensions();
- Console.WriteLine(codeExample.Description);
- codeExample.Run(new GoogleAdsClient(), options.CustomerId,
- options.BusinessProfileEmailAddress,
- options.BusinessAccountId, options.BusinessProfileAccessToken);
- }
-
- // The required scope for setting the OAuth info.
- private const string GOOGLE_ADS_SCOPE = "https://www.googleapis.com/auth/adwords";
-
- // The maximum number of attempts to make to retrieve the FeedMappings before throwing an
- // exception.
- private const int MAX_FEEDMAPPING_RETRIEVAL_ATTEMPTS = 10;
-
- ///
- /// Returns a description about the code example.
- ///
- public override string Description =>
- "This code example adds a feed that syncs feed items from a Business Profile " +
- "account and associates the feed with a customer.";
-
- ///
- /// Runs the code example.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- /// The Business Profile login email address.
- ///
- /// The Business Profile account identifier.
- /// The OAuth2 access token for the Business
- /// Profile account.
- public void Run(GoogleAdsClient client, long customerId,
- string businessProfileEmailAddress, string businessAccountId,
- string businessProfileAccessToken)
- {
- try
- {
- if (string.IsNullOrEmpty(businessProfileAccessToken))
- {
- businessProfileAccessToken = client.Config.OAuth2AccessToken;
- }
- string businessProfileFeedResourceName = CreateBusinessProfileFeed(client, customerId, businessProfileEmailAddress,
- businessAccountId, businessProfileAccessToken);
- // After the completion of the Feed ADD operation above the added feed will not be
- // available for usage in a CustomerFeed until the FeedMappings are created.
- // We will wait with an exponential back-off policy until the feedmappings have
- // been created.
- WaitForBusinessProfileFeedToBeReady(client, customerId, businessProfileFeedResourceName);
- CreateCustomerFeed(client, customerId, businessProfileFeedResourceName);
- }
- catch (GoogleAdsException e)
- {
- Console.WriteLine("Failure:");
- Console.WriteLine($"Message: {e.Message}");
- Console.WriteLine($"Failure: {e.Failure}");
- Console.WriteLine($"Request ID: {e.RequestId}");
- throw;
- }
- }
-
- ///
- /// Creates the Business Profile feed.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- /// The Business Profile login email address.
- ///
- /// The Business Profile account ID.
- /// The OAuth2 access token for the Business
- /// Profile account.
- /// ID of the newly created Business Profile feed.
- // [START add_business_profile_location_extensions]
- private static string CreateBusinessProfileFeed(GoogleAdsClient client, long customerId,
- string businessProfileEmailAddress, string businessAccountId,
- string businessProfileAccessToken)
- {
- // Optional: Delete all existing location extension feeds. This is an optional step,
- // and is required for this code example to run correctly more than once.
- // 1. Google Ads only allows one location extension feed per email address.
- // 2. A Google Ads account cannot have a location extension feed and an affiliate
- // location extension feed at the same time.
- DeleteLocationExtensionFeeds(client, customerId);
-
- // Get the FeedServiceClient.
- FeedServiceClient feedService = client.GetService(Services.V15.FeedService);
-
- // Creates a feed that will sync to the Business Profile account specified by
- // businessProfileEmailAddress. Do not add FeedAttributes to this object as Google Ads
- // will add them automatically because this will be a system generated feed.
- Feed businessProfileFeed = new Feed()
- {
- Name = "Business Profile feed #" + ExampleUtilities.GetRandomString(),
-
- PlacesLocationFeedData = new PlacesLocationFeedData()
- {
- EmailAddress = businessProfileEmailAddress,
- // If the EmailAddress is for a Business Profile manager instead of the
- // Business Profile account owner, then set BusinessAccountId to the Google+
- // Page ID of a location for which the manager has access. This information is
- // available through the Business Profile API. See
- // https://developers.google.com/my-business/reference/rest/v4/accounts.locations#locationkey
- // for details.
- BusinessAccountId = string.IsNullOrEmpty(businessAccountId) ?
- null : businessAccountId,
- // Used to filter Business Profile listings by labels. If entries exist in
- // label_filters, only listings that have at least one of the labels set are
- // candidates to be synchronized into FeedItems. If no entries exist in
- // label_filters, then all listings are candidates for syncing.
- LabelFilters = { "Stores in New York" },
- // Sets the authentication info to be able to connect Google Ads to the
- // Business Profile account.
- OauthInfo = new OAuthInfo()
- {
- HttpMethod = "GET",
- HttpRequestUrl = GOOGLE_ADS_SCOPE,
- HttpAuthorizationHeader = $"Bearer {businessProfileAccessToken}"
- },
- },
- // Since this feed's feed items will be managed by Google,
- // you must set its origin to GOOGLE.
- Origin = FeedOrigin.Google
- };
-
- FeedOperation operation = new FeedOperation()
- {
- Create = businessProfileFeed
- };
-
- // Adds the feed.
- MutateFeedsResponse response =
- feedService.MutateFeeds(customerId.ToString(), new[] { operation });
-
- // Displays the results.
- string businessProfileFeedResourceName = response.Results[0].ResourceName;
- Console.WriteLine($"Business Profile feed created with resource name: " +
- $"{businessProfileFeedResourceName}.");
- return businessProfileFeedResourceName;
- }
- // [END add_business_profile_location_extensions]
-
- ///
- /// Deletes the old location extension feeds.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- private static void DeleteLocationExtensionFeeds(GoogleAdsClient client, long customerId)
- {
- // To delete a location extension feed, you need to
- // 1. Delete the CustomerFeed so that the location extensions from the feed stop
- // serving.
- // 2. Delete the feed so that Google Ads will no longer sync from the Business Profile
- // account.
- CustomerFeed[] oldCustomerFeeds =
- GetLocationExtensionCustomerFeeds(client, customerId);
- if (oldCustomerFeeds.Length != 0)
- {
- DeleteCustomerFeeds(client, customerId, oldCustomerFeeds);
- }
- Feed[] feeds = GetLocationExtensionFeeds(client, customerId);
-
- if (feeds.Length != 0)
- {
- RemoveFeeds(client, customerId, feeds);
- }
- }
-
- ///
- /// Gets the location extension feeds.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- /// The list of location extension feeds.
- private static Feed[] GetLocationExtensionFeeds(GoogleAdsClient client, long customerId)
- {
- List feeds = new List();
- GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
-
- // Create the query.
- string query = $"SELECT feed.resource_name, feed.status, " +
- $"feed.places_location_feed_data.email_address, " +
- $"feed.affiliate_location_feed_data.chain_ids " +
- $" from feed where feed.status = ENABLED";
-
- PagedEnumerable result =
- googleAdsService.Search(customerId.ToString(), query);
-
- foreach (GoogleAdsRow row in result)
- {
- // A location extension feed can be identified by checking whether the
- // PlacesLocationFeedData field is set (Location extensions feeds) or
- // AffiliateLocationFeedData field is set (Affiliate location extension feeds)
- Feed feed = row.Feed;
- if (feed.PlacesLocationFeedData != null || feed.AffiliateLocationFeedData != null)
- {
- feeds.Add(feed);
- }
- }
- return feeds.ToArray();
- }
-
- ///
- /// Removes the feeds.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- /// The list of feeds to remove.
- private static void RemoveFeeds(GoogleAdsClient client, long customerId, Feed[] feeds)
- {
- List operations = new List();
- foreach (Feed feed in feeds)
- {
- FeedOperation operation = new FeedOperation()
- {
- Remove = feed.ResourceName,
- };
- operations.Add(operation);
- }
- FeedServiceClient feedService = client.GetService(
- Services.V15.FeedService);
-
- feedService.MutateFeeds(customerId.ToString(), operations.ToArray());
- }
-
- private static CustomerFeed[] GetLocationExtensionCustomerFeeds(GoogleAdsClient client,
- long customerId)
- {
- List customerFeeds = new List();
- GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
-
- // Create the query. A location extension customer feed can be identified by filtering
- // for placeholder_types=LOCATION (location extension feeds) or
- // placeholder_types =AFFILIATE_LOCATION (affiliate location extension feeds)
- string query = $"SELECT customer_feed.resource_name, customer_feed.feed, " +
- $"customer_feed.status, customer_feed.matching_function.function_string from " +
- $"customer_feed " +
- $"WHERE customer_feed.placeholder_types CONTAINS " +
- $"ANY(LOCATION, AFFILIATE_LOCATION) and customer_feed.status=ENABLED";
-
- PagedEnumerable result =
- googleAdsService.Search(customerId.ToString(), query);
-
- foreach (GoogleAdsRow row in result)
- {
- customerFeeds.Add(row.CustomerFeed);
- }
- return customerFeeds.ToArray();
- }
-
- ///
- /// Deletes the customer feeds.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- /// The customer feeds to delete.
- private static void DeleteCustomerFeeds(GoogleAdsClient client, long customerId,
- CustomerFeed[] customerFeeds)
- {
- List operations = new List();
- foreach (CustomerFeed customerFeed in customerFeeds)
- {
- CustomerFeedOperation operation = new CustomerFeedOperation()
- {
- Remove = customerFeed.ResourceName,
- };
- operations.Add(operation);
- }
-
- CustomerFeedServiceClient feedService = client.GetService(
- Services.V15.CustomerFeedService);
-
- feedService.MutateCustomerFeeds(customerId.ToString(), operations.ToArray());
- }
-
- ///
- /// Gets the Business Profile feed mapping.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- /// The Business Profile feed resource name.
- ///
- /// The newly created feed mapping.
- // [START add_business_profile_location_extensions_1]
- private static FeedMapping GetBusinessProfileFeedMapping(GoogleAdsClient client,
- long customerId, string businessProfileFeedResourceName)
- {
- // Get the GoogleAdsService.
- GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
-
- // Create the query.
- string query = $"SELECT feed_mapping.resource_name, feed_mapping.status FROM " +
- $"feed_mapping WHERE feed_mapping.feed = '{businessProfileFeedResourceName}' and " +
- $"feed_mapping.status = ENABLED and feed_mapping.placeholder_type = LOCATION" +
- $" LIMIT 1";
-
- // Issue a search request.
- PagedEnumerable result =
- googleAdsService.Search(customerId.ToString(), query);
-
- // Display the results.
- GoogleAdsRow googleAdsRow = result.FirstOrDefault();
- return (googleAdsRow == null) ? null : googleAdsRow.FeedMapping;
- }
- // [END add_business_profile_location_extensions_1]
-
- ///
- /// Waits for the Business Profile feed to be ready.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- /// The Business Profile feed resource name.
- ///
- // [START add_business_profile_location_extensions_3]
- private static void WaitForBusinessProfileFeedToBeReady(GoogleAdsClient client,
- long customerId, string businessProfileFeedResourceName)
- {
- int numAttempts = 0;
- while (numAttempts < MAX_FEEDMAPPING_RETRIEVAL_ATTEMPTS)
- {
- // Once you create a feed, Google's servers will setup the feed by creating feed
- // attributes and feedmapping. Once the feedmapping is created, it is ready to be
- // used for creating customer feed.
- // This process is asynchronous, so we wait until the feed mapping is created,
- // peforming exponential backoff.
- FeedMapping feedMapping = GetBusinessProfileFeedMapping(client,
- customerId, businessProfileFeedResourceName);
-
- if (feedMapping == null)
- {
- numAttempts++;
- int sleepSeconds = (int)(5 * Math.Pow(2, numAttempts));
- Console.WriteLine($"Checked: #{numAttempts} time(s). Business Profile feed " +
- $"is not ready yet. Waiting {sleepSeconds} seconds before trying again.");
- Thread.Sleep(sleepSeconds * 1000);
- }
- else
- {
- Console.WriteLine($"Business Profile Feed {businessProfileFeedResourceName} " +
- $"is now ready.");
- return;
- }
- }
- throw new RpcException(new Status(StatusCode.DeadlineExceeded,
- $"Business Profile Feed is not ready after {MAX_FEEDMAPPING_RETRIEVAL_ATTEMPTS} " +
- $"retries."));
- }
- // [END add_business_profile_location_extensions_3]
-
- ///
- /// Creates the customer feed.
- ///
- /// The client.
- /// The customer identifier.
- /// The Business Profile feed resource name.
- ///
- // [START add_business_profile_location_extensions_2]
- private static void CreateCustomerFeed(GoogleAdsClient client, long customerId,
- string businessProfileFeedResourceName)
- {
- // Get the CustomerFeedService.
- CustomerFeedServiceClient customerFeedService = client.GetService(
- Services.V15.CustomerFeedService);
-
- // Adds a CustomerFeed that associates the feed with this customer for
- // the LOCATION placeholder type.
- CustomerFeed customerFeed = new CustomerFeed()
- {
- Feed = businessProfileFeedResourceName,
- PlaceholderTypes = { PlaceholderType.Location },
- MatchingFunction = new MatchingFunction()
- {
- LeftOperands =
- {
- new Operand()
- {
- ConstantOperand = new ConstantOperand()
- {
- BooleanValue = true
- }
- }
- },
- // Specify the function string as IDENTITY(true) to mark this feed as enabled.
- FunctionString = "IDENTITY(true)",
- Operator = MatchingFunctionOperator.Identity
- },
- };
-
- CustomerFeedOperation operation = new CustomerFeedOperation()
- {
- Create = customerFeed
- };
-
- MutateCustomerFeedsResponse customerFeedsResponse =
- customerFeedService.MutateCustomerFeeds(
- customerId.ToString(), new[] { operation });
-
- // Displays the result.
- string addedCustomerFeed = customerFeedsResponse.Results[0].ResourceName;
- Console.WriteLine($"Customer feed created with resource name: {addedCustomerFeed}.");
- return;
- }
- // [END add_business_profile_location_extensions_2]
- }
-}
diff --git a/Google.Ads.GoogleAds/examples/Extensions/AddGeoTarget.cs b/Google.Ads.GoogleAds/examples/Extensions/AddGeoTarget.cs
deleted file mode 100644
index e9c3fdf7e..000000000
--- a/Google.Ads.GoogleAds/examples/Extensions/AddGeoTarget.cs
+++ /dev/null
@@ -1,143 +0,0 @@
-// Copyright 2020 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using CommandLine;
-using Google.Ads.Gax.Examples;
-using Google.Ads.Gax.Util;
-using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace Google.Ads.GoogleAds.Examples.V15
-{
- ///
- /// Adds a geo target to a extension feed item for targeting.
- ///
- public class AddGeoTarget : ExampleBase
- {
- ///
- /// Command line options for running the example.
- ///
- public class Options : OptionsBase
- {
- ///
- /// The Google Ads customer ID for which the call is made.
- ///
- [Option("customerId", Required = true, HelpText =
- "The Google Ads customer ID for which the call is made.")]
- public long CustomerId { get; set; }
-
- ///
- /// The feed item ID.
- ///
- [Option("feedItemId", Required = true, HelpText =
- "The feed item ID.")]
- public long FeedItemId { get; set; }
-
- ///
- /// Geo target constant ID to add to the extension feed item. Reverts to the United
- /// States (2840) if no value passed.
- ///
- [Option("geoTargetConstantId", Required = false, HelpText =
- "Geo target constant ID to add to the extension feed item. Reverts to the United" +
- " States (2840) if no value passed.")]
- public long? GeoTargetConstantId { get; set; }
- }
-
- ///
- /// Main method, to run this code example as a standalone application.
- ///
- /// The command line arguments.
- public static void Main(string[] args)
- {
- Options options = ExampleUtilities.ParseCommandLine(args);
-
- AddGeoTarget codeExample = new AddGeoTarget();
- Console.WriteLine(codeExample.Description);
- codeExample.Run(new GoogleAdsClient(), options.CustomerId, options.FeedItemId,
- options.GeoTargetConstantId);
- }
-
- ///
- /// Returns a description about the code example.
- ///
- public override string Description =>
- "Adds a geo target to an extension feed item for targeting.";
-
- ///
- /// Runs the code example.
- ///
- /// The Google Ads client.
- /// The Google Ads customer ID for which the call is made.
- /// The feed item ID.
- /// Geo target constant ID to add to the extension
- /// feed item. Reverts to the United States (2840) if no value passed.
- // [START add_geo_target]
- public void Run(GoogleAdsClient client, long customerId, long feedItemId,
- long? geoTargetConstantId)
- {
- // Get the ExtensionFeedItemServiceClient.
- ExtensionFeedItemServiceClient extensionFeedItemServiceClient =
- client.GetService(Services.V15.ExtensionFeedItemService);
-
- // Apply the default geo target constant ID (USA) if none was passed to the function.
- if (!geoTargetConstantId.HasValue)
- {
- geoTargetConstantId = 2840L;
- }
-
- // Creates an extension feed item using the specified feed item ID and geo target
- // constant ID for targeting.
- ExtensionFeedItem extensionFeedItem = new ExtensionFeedItem()
- {
- ResourceName = ResourceNames.ExtensionFeedItem(customerId, feedItemId),
- TargetedGeoTargetConstant = ResourceNames.GeoTargetConstant(geoTargetConstantId.Value)
- };
-
- // Constructs an operation that will update the extension feed item, using the
- // FieldMasks utility to derive the update mask. This mask tells the Google Ads API
- // which attributes of the extension feed item you want to change.
- ExtensionFeedItemOperation operation = new ExtensionFeedItemOperation()
- {
- Update = extensionFeedItem,
- UpdateMask = FieldMasks.AllSetFieldsOf(extensionFeedItem)
- };
-
- try
- {
- // Issues a mutate request to update the extension feed item.
- MutateExtensionFeedItemsResponse response =
- extensionFeedItemServiceClient.MutateExtensionFeedItems(customerId.ToString(),
- new[] { operation });
-
- // Prints the resource name of the updated extension feed item.
- Console.WriteLine("Updated extension feed item with resource name " +
- $"{response.Results.First().ResourceName}.");
- }
- catch (GoogleAdsException e)
- {
- Console.WriteLine("Failure:");
- Console.WriteLine($"Message: {e.Message}");
- Console.WriteLine($"Failure: {e.Failure}");
- Console.WriteLine($"Request ID: {e.RequestId}");
- throw;
- }
- }
- // [END add_geo_target]
- }
-}
diff --git a/Google.Ads.GoogleAds/examples/Extensions/AddImageExtension.cs b/Google.Ads.GoogleAds/examples/Extensions/AddImageExtension.cs
deleted file mode 100644
index a3ef0bda9..000000000
--- a/Google.Ads.GoogleAds/examples/Extensions/AddImageExtension.cs
+++ /dev/null
@@ -1,184 +0,0 @@
-// Copyright 2021 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using CommandLine;
-using Google.Ads.Gax.Examples;
-using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.ExtensionTypeEnum.Types;
-
-namespace Google.Ads.GoogleAds.Examples.V15
-{
- ///
- /// This code example adds an image extension to a campaign. To create a campaign, run
- /// AddCampaigns.cs. To create an image asset, run UploadImageAsset.cs.
- ///
- public class AddImageExtension : ExampleBase
- {
- ///
- /// Command line options for running the example.
- ///
- public class Options : OptionsBase
- {
- ///
- /// The customer ID for which the call is made.
- ///
- [Option("customerId", Required = true, HelpText =
- "The customer ID for which the call is made.")]
- public long CustomerId { get; set; }
-
- ///
- /// ID of the campaign to which sitelinks are added.
- ///
- [Option("campaignId", Required = true, HelpText =
- "ID of the campaign to which sitelinks are added.")]
- public long CampaignId { get; set; }
-
- ///
- /// ID of the image asset to be used for creating the extension.
- ///
- [Option("imageAssetId", Required = true, HelpText =
- "ID of the image asset to be used for creating the extension.")]
- public long ImageAssetId { get; set; }
- }
-
- ///
- /// Main method, to run this code example as a standalone application.
- ///
- /// The command line arguments.
- public static void Main(string[] args)
- {
- Options options = ExampleUtilities.ParseCommandLine(args);
-
- AddImageExtension codeExample = new AddImageExtension();
- Console.WriteLine(codeExample.Description);
- codeExample.Run(new GoogleAdsClient(), options.CustomerId, options.CampaignId,
- options.ImageAssetId);
- }
-
- ///
- /// Returns a description about the code example.
- ///
- public override string Description =>
- "This code example adds an image extension to a campaign. To create a campaign, run " +
- "AddCampaigns.cs. To create an image asset, run UploadImageAsset.cs.";
-
- ///
- /// Runs the code example.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- /// ID of the campaign to which sitelinks are added.
- /// ID of the image asset to be used for creating the extension.
- ///
- public void Run(GoogleAdsClient client, long customerId, long campaignId,
- long imageAssetId)
- {
- // Get the CampaignExtensionSettingServiceClient.
- CampaignExtensionSettingServiceClient campaignExtensionSettingService =
- client.GetService(Services.V15.CampaignExtensionSettingService);
-
- try
- {
- // Creates an image extension.
- string imageExtensionResourceName =
- CreateImageExtension(client, customerId, imageAssetId);
- string campaignResourceName = ResourceNames.Campaign(customerId, campaignId);
-
- // Creates a CampaignExtensionSetting.
- CampaignExtensionSetting campaignExtensionSetting = new CampaignExtensionSetting()
- {
- Campaign = campaignResourceName,
- ExtensionType = ExtensionType.Image,
- ExtensionFeedItems = { imageExtensionResourceName }
- };
-
- // Creates the operation.
- CampaignExtensionSettingOperation operation =
- new CampaignExtensionSettingOperation()
- {
- Create = campaignExtensionSetting
- };
-
- // Creates the campaign extension.
- MutateCampaignExtensionSettingsResponse response =
- campaignExtensionSettingService.MutateCampaignExtensionSettings(
- customerId.ToString(), new[] { operation });
- foreach (MutateCampaignExtensionSettingResult result in response.Results)
- {
- Console.WriteLine($"Created campaign extension setting with resource " +
- $"name '{result.ResourceName}'.");
- }
- }
- catch (GoogleAdsException e)
- {
- Console.WriteLine("Failure:");
- Console.WriteLine($"Message: {e.Message}");
- Console.WriteLine($"Failure: {e.Failure}");
- Console.WriteLine($"Request ID: {e.RequestId}");
- throw;
- }
- }
-
- ///
- /// Creates an image extension.
- ///
- /// The Google Ads API client.
- /// The client customer ID.
- /// The ID of the image asset to be used for creating image
- /// extension.
- /// Resource name of the newly created image extension.
- private static string CreateImageExtension(GoogleAdsClient client, long customerId,
- long imageAssetId)
- {
- // Get the ExtensionFeedItemServiceClient.
- ExtensionFeedItemServiceClient extensionFeedItemService =
- client.GetService(Services.V15.ExtensionFeedItemService);
-
- // Creates the image feed item using the provided image.
- ImageFeedItem imageFeedItem = new ImageFeedItem()
- {
- ImageAsset = ResourceNames.Asset(customerId, imageAssetId)
- };
-
- // Creates an ExtensionFeedItem from the ImageFeedItem.
- ExtensionFeedItem extensionFeedItem = new ExtensionFeedItem()
- {
- ImageFeedItem = imageFeedItem
- };
-
- ExtensionFeedItemOperation operation = new ExtensionFeedItemOperation()
- {
- Create = extensionFeedItem
- };
-
- // Adds the ExtensionFeedItem.
- MutateExtensionFeedItemsResponse response =
- extensionFeedItemService.MutateExtensionFeedItems(customerId.ToString(),
- new[] { operation });
-
- // Displays the result.
- string resourceName = response.Results.First().ResourceName;
- Console.WriteLine($"Created an image extension with resource name '{resourceName}'.");
-
- return resourceName;
- }
- }
-}
diff --git a/Google.Ads.GoogleAds/examples/Extensions/MigratePromotionFeedToAsset.cs b/Google.Ads.GoogleAds/examples/Extensions/MigratePromotionFeedToAsset.cs
deleted file mode 100644
index cd8f94c7a..000000000
--- a/Google.Ads.GoogleAds/examples/Extensions/MigratePromotionFeedToAsset.cs
+++ /dev/null
@@ -1,505 +0,0 @@
-// Copyright 2021 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using CommandLine;
-using Google.Ads.Gax.Examples;
-using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Enums;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
-using Google.Protobuf.Collections;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-
-namespace Google.Ads.GoogleAds.Examples.V15
-{
- ///
- /// This code example retrieves the full details of a Promotion Feed-based extension and
- /// creates a matching Promotion asset-based extension. The new Asset-based extension will
- /// then be associated with the same campaigns and ad groups as the original Feed-based
- /// extension.
- /// Once copied, you should remove the Feed-based extension; see
- /// RemoveEntireSitelinkCampaignExtensionSetting.cs for an example.
- ///
- public class MigratePromotionFeedToAsset : ExampleBase
- {
- ///
- /// Command line options for running the example.
- ///
- public class Options : OptionsBase
- {
- ///
- /// The customer ID for which the call is made.
- ///
- [Option("customerId", Required = true, HelpText =
- "The customer ID for which the call is made.")]
- public long CustomerId { get; set; }
-
- ///
- /// ID of the extension feed item to migrate.
- ///
- [Option("feedItemId", Required = true, HelpText =
- "ID of the extension feed item to migrate.")]
- public long FeedItemId { get; set; }
- }
-
- ///
- /// Main method, to run this code example as a standalone application.
- ///
- /// The command line arguments.
- public static void Main(string[] args)
- {
- Options options = ExampleUtilities.ParseCommandLine(args);
-
- MigratePromotionFeedToAsset codeExample = new MigratePromotionFeedToAsset();
- Console.WriteLine(codeExample.Description);
- codeExample.Run(new GoogleAdsClient(), options.CustomerId, options.FeedItemId);
- }
-
- ///
- /// Returns a description about the code example.
- ///
- public override string Description =>
- "This code example retrieves the full details of a Promotion Feed-based extension " +
- "and creates a matching Promotion asset-based extension. The new Asset-based " +
- "extension will then be associated with the same campaigns and ad groups as the " +
- "original Feed-based extension.\n" +
- "Once copied, you should remove the Feed-based extension; see " +
- "RemoveEntireSitelinkCampaignExtensionSetting.cs for an example.";
-
- ///
- /// Runs the code example.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- /// ID of the extension feed item to migrate.
- public void Run(GoogleAdsClient client, long customerId, long feedItemId)
- {
- // Get the GoogleAdsService client.
- GoogleAdsServiceClient googleAdsServiceClient =
- client.GetService(Services.V15.GoogleAdsService);
-
- string extensionFeedItemResourceName =
- ResourceNames.ExtensionFeedItem(customerId, feedItemId);
-
- try
- {
- // Get the target extension feed item.
- ExtensionFeedItem extensionFeedItem =
- GetExtensionFeedItem(googleAdsServiceClient, customerId, feedItemId);
-
- // Get all campaign IDs associated with the extension feed item.
- List campaignIds = GetTargetedCampaignIds(googleAdsServiceClient, customerId,
- extensionFeedItemResourceName);
-
- // Get all ad group IDs associated with the extension feed item.
- List adGroupIds = GetTargetedAdGroupIds(googleAdsServiceClient, customerId,
- extensionFeedItemResourceName);
-
- // Create a new Promotion asset that matches the target extension feed item.
- string promotionAssetResourceName = CreatePromotionAssetFromFeed(client,
- customerId, extensionFeedItem);
-
- // Associate the new Promotion asset with the same campaigns as the original.
- AssociateAssetWithCampaigns(client, customerId, promotionAssetResourceName,
- campaignIds);
-
- // Associate the new Promotion asset with the same ad groups as the original.
- AssociateAssetWithAdGroups(client, customerId, promotionAssetResourceName,
- adGroupIds);
- }
- catch (GoogleAdsException e)
- {
- Console.WriteLine("Failure:");
- Console.WriteLine($"Message: {e.Message}");
- Console.WriteLine($"Failure: {e.Failure}");
- Console.WriteLine($"Request ID: {e.RequestId}");
- throw;
- }
- catch (Exception e)
- {
- Console.WriteLine(e.Message);
- Console.WriteLine(e.StackTrace);
- throw;
- }
- }
-
- ///
- /// Gets the requested Promotion-type extension feed item.
- ///
- /// Note that extension feed items pertain to feeds that were created by Google. Use
- /// FeedService to instead retrieve a user-created Feed.
- ///
- /// An initialized Google Ads API Service
- /// client.
- /// The customer ID for which the call is made.
- /// ID of the extension feed item to migrate.
- /// The requested ExtensionFeedItem, or null if no matching item was
- /// found.
- private ExtensionFeedItem GetExtensionFeedItem(
- GoogleAdsServiceClient googleAdsServiceClient,
- long customerId, long feedItemId)
- {
- // Create a query that will retrieve the requested Promotion-type extension feed item
- // and ensure that all fields are populated.
- string extensionFeedItemQuery = $@"
- SELECT
- extension_feed_item.id,
- extension_feed_item.ad_schedules,
- extension_feed_item.device,
- extension_feed_item.status,
- extension_feed_item.start_date_time,
- extension_feed_item.end_date_time,
- extension_feed_item.targeted_campaign,
- extension_feed_item.targeted_ad_group,
- extension_feed_item.promotion_feed_item.discount_modifier,
- extension_feed_item.promotion_feed_item.final_mobile_urls,
- extension_feed_item.promotion_feed_item.final_url_suffix,
- extension_feed_item.promotion_feed_item.final_urls,
- extension_feed_item.promotion_feed_item.language_code,
- extension_feed_item.promotion_feed_item.money_amount_off.amount_micros,
- extension_feed_item.promotion_feed_item.money_amount_off.currency_code,
- extension_feed_item.promotion_feed_item.occasion,
- extension_feed_item.promotion_feed_item.orders_over_amount.amount_micros,
- extension_feed_item.promotion_feed_item.orders_over_amount.currency_code,
- extension_feed_item.promotion_feed_item.percent_off,
- extension_feed_item.promotion_feed_item.promotion_code,
- extension_feed_item.promotion_feed_item.promotion_end_date,
- extension_feed_item.promotion_feed_item.promotion_start_date,
- extension_feed_item.promotion_feed_item.promotion_target,
- extension_feed_item.promotion_feed_item.tracking_url_template
- FROM extension_feed_item
- WHERE
- extension_feed_item.extension_type = 'PROMOTION'
- AND extension_feed_item.id = {feedItemId}
- LIMIT 1";
-
- ExtensionFeedItem fetchedExtensionFeedItem = null;
-
- // Issue a search request to get the extension feed item contents.
- googleAdsServiceClient.SearchStream(customerId.ToString(), extensionFeedItemQuery,
- delegate (SearchGoogleAdsStreamResponse response)
- {
- fetchedExtensionFeedItem = response.Results.First().ExtensionFeedItem;
- }
- );
- Console.WriteLine(
- $"Retrieved details for ad extension with ID {fetchedExtensionFeedItem.Id}.");
-
- // Create a query to retrieve any URL customer parameters attached to the feed item.
- string urlCustomParametersQuery = $@"
- SELECT feed_item.url_custom_parameters
- FROM feed_item
- WHERE feed_item.id = {feedItemId}";
-
- // Issue a search request to get any URL custom parameters.
- googleAdsServiceClient.SearchStream(customerId.ToString(), urlCustomParametersQuery,
- delegate (SearchGoogleAdsStreamResponse response)
- {
- RepeatedField urlCustomParameters =
- response.Results.First().FeedItem.UrlCustomParameters;
- Console.WriteLine(
- $"Retrieved {urlCustomParameters.Count} attached URL custom parameters.");
- if (urlCustomParameters.Count > 0)
- {
- fetchedExtensionFeedItem.PromotionFeedItem.UrlCustomParameters.Add(
- urlCustomParameters);
- }
- }
- );
-
- return fetchedExtensionFeedItem;
- }
-
- ///
- /// Finds and returns all of the campaigns that are associated with the specified Promotion
- /// extension feed item.
- ///
- /// An initialized Google Ads API Service
- /// client.
- /// The customer ID for which the call is made.
- /// ID of the extension feed item to
- /// migrate.
- /// A list of campaign IDs.
- // [START migrate_promotion_feed_to_asset_1]
- private List GetTargetedCampaignIds(GoogleAdsServiceClient googleAdsServiceClient,
- long customerId, string extensionFeedResourceName)
- {
- List campaignIds = new List();
-
- string query = @"
- SELECT campaign.id, campaign_extension_setting.extension_feed_items
- FROM campaign_extension_setting
- WHERE campaign_extension_setting.extension_type = 'PROMOTION'
- AND campaign.status != 'REMOVED'";
-
- googleAdsServiceClient.SearchStream(customerId.ToString(), query,
- delegate (SearchGoogleAdsStreamResponse response)
- {
- foreach (GoogleAdsRow googleAdsRow in response.Results)
- {
- // Add the campaign ID to the list of IDs if the extension feed item is
- // associated with this extension setting.
- if (googleAdsRow.CampaignExtensionSetting.ExtensionFeedItems.Contains(
- extensionFeedResourceName))
- {
- Console.WriteLine(
- $"Found matching campaign with ID {googleAdsRow.Campaign.Id}.");
- campaignIds.Add(googleAdsRow.Campaign.Id);
- }
- }
- }
- );
-
- return campaignIds;
- }
- // [END migrate_promotion_feed_to_asset_1]
-
- ///
- /// Finds and returns all of the ad groups that are associated with the specified Promotion
- /// extension feed item.
- ///
- /// An initialized Google Ads API Service
- /// client.
- /// The customer ID for which the call is made.
- /// Resource name of the extension feed item to
- /// migrate.
- /// A list of ad group IDs.
- private List GetTargetedAdGroupIds(
- GoogleAdsServiceClient googleAdsServiceClient, long customerId,
- string extensionFeedItemResourceName)
- {
- List adGroupIds = new List();
-
- string query = @"
- SELECT ad_group.id, ad_group_extension_setting.extension_feed_items
- FROM ad_group_extension_setting
- WHERE ad_group_extension_setting.extension_type = 'PROMOTION'
- AND ad_group.status != 'REMOVED'";
-
- googleAdsServiceClient.SearchStream(customerId.ToString(), query,
- delegate (SearchGoogleAdsStreamResponse response)
- {
- foreach (GoogleAdsRow googleAdsRow in response.Results)
- {
- // Add the ad group ID to the list of IDs if the extension feed item is
- // associated with this extension setting.
- if (googleAdsRow.AdGroupExtensionSetting.ExtensionFeedItems.Contains(
- extensionFeedItemResourceName))
- {
- Console.WriteLine(
- $"Found matching ad group with ID {googleAdsRow.AdGroup.Id}.");
- adGroupIds.Add(googleAdsRow.AdGroup.Id);
- }
- }
- }
- );
-
- return adGroupIds;
- }
-
- ///
- /// Create a Promotion asset that copies values from the specified extension feed item.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- /// The extension feed item to be migrated.
- /// The resource name of the newly created Promotion asset.
- // [START migrate_promotion_feed_to_asset]
- private string CreatePromotionAssetFromFeed(GoogleAdsClient client, long customerId,
- ExtensionFeedItem extensionFeedItem)
- {
- // Get the Asset Service client.
- AssetServiceClient assetServiceClient = client.GetService(Services.V15.AssetService);
-
- PromotionFeedItem promotionFeedItem = extensionFeedItem.PromotionFeedItem;
-
- // Create the Promotion asset.
- Asset asset = new Asset
- {
- // Name field is optional.
- Name = $"Migrated from feed item #{extensionFeedItem.Id}",
- PromotionAsset = new PromotionAsset
- {
- PromotionTarget = promotionFeedItem.PromotionTarget,
- DiscountModifier = promotionFeedItem.DiscountModifier,
- RedemptionStartDate = promotionFeedItem.PromotionStartDate,
- RedemptionEndDate = promotionFeedItem.PromotionEndDate,
- Occasion = promotionFeedItem.Occasion,
- LanguageCode = promotionFeedItem.LanguageCode,
- },
- TrackingUrlTemplate = promotionFeedItem.TrackingUrlTemplate,
- FinalUrlSuffix = promotionFeedItem.FinalUrlSuffix
- };
-
- // Either PercentOff or MoneyAmountOff must be set.
- if (promotionFeedItem.PercentOff > 0)
- {
- // Adjust the percent off scale when copying.
- asset.PromotionAsset.PercentOff = promotionFeedItem.PercentOff / 100;
- }
- else
- {
- asset.PromotionAsset.MoneyAmountOff = new Money
- {
- AmountMicros = promotionFeedItem.MoneyAmountOff.AmountMicros,
- CurrencyCode = promotionFeedItem.MoneyAmountOff.CurrencyCode
- };
- }
-
- // Either PromotionCode or OrdersOverAmount must be set.
- if (!string.IsNullOrEmpty(promotionFeedItem.PromotionCode))
- {
- asset.PromotionAsset.PromotionCode = promotionFeedItem.PromotionCode;
- }
- else
- {
- asset.PromotionAsset.OrdersOverAmount = new Money
- {
- AmountMicros = promotionFeedItem.OrdersOverAmount.AmountMicros,
- CurrencyCode = promotionFeedItem.OrdersOverAmount.CurrencyCode
- };
- }
-
- // Set the start and end dates if set in the existing extension.
- if (extensionFeedItem.HasStartDateTime)
- {
- asset.PromotionAsset.StartDate = DateTime.Parse(extensionFeedItem.StartDateTime)
- .ToString("yyyy-MM-dd");
- }
-
- if (extensionFeedItem.HasEndDateTime)
- {
- asset.PromotionAsset.EndDate = DateTime.Parse(extensionFeedItem.EndDateTime)
- .ToString("yyyy-MM-dd");
- }
-
- asset.PromotionAsset.AdScheduleTargets.Add(extensionFeedItem.AdSchedules);
- asset.FinalUrls.Add(promotionFeedItem.FinalUrls);
- asset.FinalMobileUrls.Add(promotionFeedItem.FinalMobileUrls);
- asset.UrlCustomParameters.Add(promotionFeedItem.UrlCustomParameters);
-
- // Build an operation to create the Promotion asset.
- AssetOperation operation = new AssetOperation
- {
- Create = asset
- };
-
- // Issue the request and return the resource name of the new Promotion asset.
- MutateAssetsResponse response = assetServiceClient.MutateAssets(
- customerId.ToString(), new[] { operation });
- Console.WriteLine("Created Promotion asset with resource name " +
- $"{response.Results.First().ResourceName}");
- return response.Results.First().ResourceName;
- }
- // [END migrate_promotion_feed_to_asset]
-
- ///
- /// Associates the specified Promotion asset with the specified campaigns.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- /// The string resource name of the Promotion
- /// Asset.
- /// A list of campaign IDs with which the Asset should be
- /// associated.
- // [START migrate_promotion_feed_to_asset_2]
- private void AssociateAssetWithCampaigns(GoogleAdsClient client, long customerId,
- string promotionAssetResourceName, List campaignIds)
- {
- if (campaignIds.Count == 0)
- {
- Console.WriteLine("Asset was not associated with any campaigns.");
- return;
- }
-
- CampaignAssetServiceClient campaignAssetServiceClient = client.GetService(Services.V15
- .CampaignAssetService);
-
- List operations = new List();
-
- foreach (long campaignId in campaignIds)
- {
- operations.Add(new CampaignAssetOperation
- {
- Create = new CampaignAsset
- {
- Asset = promotionAssetResourceName,
- FieldType = AssetFieldTypeEnum.Types.AssetFieldType.Promotion,
- Campaign = ResourceNames.Campaign(customerId, campaignId),
- }
- });
- }
-
- MutateCampaignAssetsResponse response = campaignAssetServiceClient.MutateCampaignAssets(
- customerId.ToString(), operations);
-
- foreach (MutateCampaignAssetResult result in response.Results)
- {
- Console.WriteLine($"Created campaign asset with resource name " +
- $"{result.ResourceName}.");
- }
- }
- // [END migrate_promotion_feed_to_asset_2]
-
- ///
- /// Associates the specified Promotion asset with the specified ad groups.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- /// The string resource name of the Promotion
- /// Asset.
- /// A list of ad group IDs with which the Asset should be
- /// associated.
- private void AssociateAssetWithAdGroups(GoogleAdsClient client, long customerId,
- string promotionAssetResourceName, List adGroupIds)
- {
- if (adGroupIds.Count == 0)
- {
- Console.WriteLine("Asset was not associated with any ad groups.");
- return;
- }
-
- AdGroupAssetServiceClient adGroupAssetServiceClient = client.GetService(Services.V15
- .AdGroupAssetService);
-
- List operations = new List();
-
- foreach (long adGroupId in adGroupIds)
- {
- operations.Add(new AdGroupAssetOperation
- {
- Create = new AdGroupAsset
- {
- Asset = promotionAssetResourceName,
- FieldType = AssetFieldTypeEnum.Types.AssetFieldType.Promotion,
- AdGroup = ResourceNames.AdGroup(customerId, adGroupId),
- }
- });
- }
-
- MutateAdGroupAssetsResponse response = adGroupAssetServiceClient.MutateAdGroupAssets(
- customerId.ToString(), operations);
-
- foreach (MutateAdGroupAssetResult result in response.Results)
- {
- Console.WriteLine($"Created ad group asset with resource name " +
- $"{result.ResourceName}.");
- }
- }
- }
-}
diff --git a/Google.Ads.GoogleAds/examples/Feeds/CreateFeedItemSet.cs b/Google.Ads.GoogleAds/examples/Feeds/CreateFeedItemSet.cs
index d24652e79..232c46888 100644
--- a/Google.Ads.GoogleAds/examples/Feeds/CreateFeedItemSet.cs
+++ b/Google.Ads.GoogleAds/examples/Feeds/CreateFeedItemSet.cs
@@ -15,13 +15,13 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example creates a new feed item set for a specified feed, which must belong to
@@ -82,7 +82,7 @@ public void Run(GoogleAdsClient client, long customerId, long feedId)
{
// Get the FeedItemSetService.
FeedItemSetServiceClient feedItemService = client.GetService(
- Services.V15.FeedItemSetService);
+ Services.V16.FeedItemSetService);
FeedItemSet feedItemSet = new FeedItemSet()
{
diff --git a/Google.Ads.GoogleAds/examples/Feeds/GetFeedItemsOfFeedItemSet.cs b/Google.Ads.GoogleAds/examples/Feeds/GetFeedItemsOfFeedItemSet.cs
index 2679d1655..0019b1519 100644
--- a/Google.Ads.GoogleAds/examples/Feeds/GetFeedItemsOfFeedItemSet.cs
+++ b/Google.Ads.GoogleAds/examples/Feeds/GetFeedItemsOfFeedItemSet.cs
@@ -15,13 +15,13 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example gets all feed items of the specified feed item set by fetching all feed
@@ -90,7 +90,7 @@ public void Run(GoogleAdsClient client, long customerId, long feedId, long feedI
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
string feedItemSetResourceName = ResourceNames.FeedItemSet(
customerId, feedId, feedItemSetId);
diff --git a/Google.Ads.GoogleAds/examples/Feeds/LinkFeedItemSet.cs b/Google.Ads.GoogleAds/examples/Feeds/LinkFeedItemSet.cs
index a5404cb72..423bd1b65 100644
--- a/Google.Ads.GoogleAds/examples/Feeds/LinkFeedItemSet.cs
+++ b/Google.Ads.GoogleAds/examples/Feeds/LinkFeedItemSet.cs
@@ -15,13 +15,13 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example links the specified feed item to the specified feed item set. The
@@ -104,7 +104,7 @@ public void Run(GoogleAdsClient client, long customerId, long feedId, long feedI
{
// Get the FeedItemSetLinkService.
FeedItemSetLinkServiceClient feedItemSetLinkService = client.GetService(
- Services.V15.FeedItemSetLinkService);
+ Services.V16.FeedItemSetLinkService);
// Creates a new feed item set link that binds the specified feed item set and feed
// item.
diff --git a/Google.Ads.GoogleAds/examples/Feeds/RemoveFeedItems.cs b/Google.Ads.GoogleAds/examples/Feeds/RemoveFeedItems.cs
index 40cabd02e..103913f67 100644
--- a/Google.Ads.GoogleAds/examples/Feeds/RemoveFeedItems.cs
+++ b/Google.Ads.GoogleAds/examples/Feeds/RemoveFeedItems.cs
@@ -15,14 +15,14 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
using System.Linq;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// Removes feed items from a feed.
@@ -85,7 +85,7 @@ public static void Main(string[] args)
public void Run(GoogleAdsClient client, long customerId, long feedId, long[] feedItemIds)
{
FeedItemServiceClient feedItemServiceClient = client.GetService(
- Services.V15.FeedItemService);
+ Services.V16.FeedItemService);
// Creates the remove operations.
List operations = new List();
diff --git a/Google.Ads.GoogleAds/examples/Feeds/RemoveFlightsFeedItemAttributeValue.cs b/Google.Ads.GoogleAds/examples/Feeds/RemoveFlightsFeedItemAttributeValue.cs
index 9106cfe06..68931a0b4 100644
--- a/Google.Ads.GoogleAds/examples/Feeds/RemoveFlightsFeedItemAttributeValue.cs
+++ b/Google.Ads.GoogleAds/examples/Feeds/RemoveFlightsFeedItemAttributeValue.cs
@@ -16,16 +16,16 @@
using Google.Ads.Gax.Examples;
using Google.Ads.Gax.Util;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Api.Gax;
using System;
using System.Collections.Generic;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.FlightPlaceholderFieldEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.FlightPlaceholderFieldEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// Removes a feed item attribute value of a feed item in a flights feed. To create a flights
@@ -111,7 +111,7 @@ public void Run(GoogleAdsClient client, long customerId, long feedId, long feedI
{
// Creates the Feed Item service client.
FeedItemServiceClient feedItemServiceClient = client.GetService(
- Services.V15.FeedItemService);
+ Services.V16.FeedItemService);
try
{
@@ -175,7 +175,7 @@ public Dictionary GetFeed(
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
string feedResourceName = ResourceNames.Feed(customerId, feedId);
@@ -302,7 +302,7 @@ private FeedItem GetFeedItem(GoogleAdsClient client, long customerId,
{
// Gets the Google Ads service.
GoogleAdsServiceClient googleAdsServiceClient = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
// Constructs the resource name for the feed item.
string feedItemResourceName = ResourceNames.FeedItem(customerId, feedId, feedItemId);
diff --git a/Google.Ads.GoogleAds/examples/Feeds/UpdateFlightsFeedItemStringAttributeValue.cs b/Google.Ads.GoogleAds/examples/Feeds/UpdateFlightsFeedItemStringAttributeValue.cs
index e36e423f6..5eea16410 100644
--- a/Google.Ads.GoogleAds/examples/Feeds/UpdateFlightsFeedItemStringAttributeValue.cs
+++ b/Google.Ads.GoogleAds/examples/Feeds/UpdateFlightsFeedItemStringAttributeValue.cs
@@ -16,15 +16,15 @@
using Google.Ads.Gax.Examples;
using Google.Ads.Gax.Util;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.FlightPlaceholderFieldEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.FlightPlaceholderFieldEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example updates a FeedItemAttributeValue in a flights feed. To create a flights
@@ -149,7 +149,7 @@ private void UpdateFeedItem(GoogleAdsClient client, long customerId, long feedId
{
// Get the FeedItemServiceClient.
FeedItemServiceClient feedItemService =
- client.GetService(Services.V15.FeedItemService);
+ client.GetService(Services.V16.FeedItemService);
// Gets the feed resource name.
string feedResourceName = ResourceNames.Feed(customerId, feedId);
@@ -230,7 +230,7 @@ public Dictionary GetFeed(
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
// Constructs the query.
string query = "SELECT feed.attributes FROM feed WHERE feed.resource_name = " +
@@ -300,7 +300,7 @@ private FeedItem GetFeedItem(GoogleAdsClient client, long customerId,
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
// Constructs the query.
string query = "SELECT feed_item.attribute_values FROM feed_item WHERE " +
diff --git a/Google.Ads.GoogleAds/examples/Misc/CampaignReportToCsv.cs b/Google.Ads.GoogleAds/examples/Misc/CampaignReportToCsv.cs
index 00e2ccb03..313963624 100644
--- a/Google.Ads.GoogleAds/examples/Misc/CampaignReportToCsv.cs
+++ b/Google.Ads.GoogleAds/examples/Misc/CampaignReportToCsv.cs
@@ -15,14 +15,14 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Api.Ads.Common.Util;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example illustrates how to use Google Ads API to get metrics about a campaign and
@@ -83,7 +83,7 @@ public static void Main(string[] args)
public void Run(GoogleAdsClient client, long customerId, string outputFilePath)
{
GoogleAdsServiceClient googleAdsServiceClient =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
// Create a query that retrieves campaigns.
string query = @"
diff --git a/Google.Ads.GoogleAds/examples/Misc/NavigateSearchResultPagesCachingTokens.cs b/Google.Ads.GoogleAds/examples/Misc/NavigateSearchResultPagesCachingTokens.cs
index 4ddbd8761..4f32059f4 100644
--- a/Google.Ads.GoogleAds/examples/Misc/NavigateSearchResultPagesCachingTokens.cs
+++ b/Google.Ads.GoogleAds/examples/Misc/NavigateSearchResultPagesCachingTokens.cs
@@ -15,14 +15,14 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
using System.Linq;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// GoogleAdsService.Search results are paginated but they can only be retrieved in sequence
@@ -96,7 +96,7 @@ public void Run(GoogleAdsClient client, long customerId)
{
// Get the GoogleAdsServiceClient.
GoogleAdsServiceClient googleAdsService =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
// The cache of page tokens. The first page's token is always an empty string.
Dictionary pageTokens = new Dictionary();
diff --git a/Google.Ads.GoogleAds/examples/Misc/SetCustomClientTimeouts.cs b/Google.Ads.GoogleAds/examples/Misc/SetCustomClientTimeouts.cs
index 5b0c93ae9..5e14c56dd 100644
--- a/Google.Ads.GoogleAds/examples/Misc/SetCustomClientTimeouts.cs
+++ b/Google.Ads.GoogleAds/examples/Misc/SetCustomClientTimeouts.cs
@@ -15,15 +15,15 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Api.Gax;
using Google.Api.Gax.Grpc;
using Grpc.Core;
using System;
using System.IO;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example illustrates the use of custom client timeouts in the context
@@ -118,7 +118,7 @@ private void MakeServerStreamingCall(GoogleAdsClient client, long customerId)
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
string query = "SELECT campaign.id FROM campaign";
SearchGoogleAdsStreamRequest request = new SearchGoogleAdsStreamRequest()
@@ -180,7 +180,7 @@ private void MakeUnaryCall(GoogleAdsClient client, long customerId)
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
string query = "SELECT campaign.id FROM campaign";
SearchGoogleAdsRequest request = new SearchGoogleAdsRequest()
diff --git a/Google.Ads.GoogleAds/examples/Misc/UploadImage.cs b/Google.Ads.GoogleAds/examples/Misc/UploadImage.cs
deleted file mode 100644
index bb8a15fa7..000000000
--- a/Google.Ads.GoogleAds/examples/Misc/UploadImage.cs
+++ /dev/null
@@ -1,123 +0,0 @@
-// Copyright 2020 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using CommandLine;
-using Google.Ads.Gax.Examples;
-using Google.Ads.Gax.Util;
-using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.Util;
-using Google.Ads.GoogleAds.V14.Errors;
-using Google.Ads.GoogleAds.V14.Resources;
-using Google.Ads.GoogleAds.V14.Services;
-using Google.Protobuf;
-using System;
-using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V14.Enums.MediaTypeEnum.Types;
-
-namespace Google.Ads.GoogleAds.Examples.V14
-{
- ///
- /// This code example uploads an image.
- ///
- /// This code example uses version v14 of the Google Ads API. Google Ads is migrating
- /// from individual media files to assets, and version v15 of the API removed support for
- /// MediaFileService as part of this migration. Once your Ads account is migrated, this code
- /// example will stop working, and you should use UploadImageAsset.cs instead. This code
- /// example will be removed once the migration completes. See
- /// https://ads-developers.googleblog.com/2023/07/image-and-location-auto-migration.html for
- /// more details.
- ///
- public class UploadImage : ExampleBase
- {
- ///
- /// Command line options for running the example.
- ///
- public class Options : OptionsBase
- {
- ///
- /// The customer ID for which the call is made.
- ///
- [Option("customerId", Required = true, HelpText =
- "The customer ID for which the call is made.")]
- public long CustomerId { get; set; }
- }
-
- ///
- /// Main method, to run this code example as a standalone application.
- ///
- /// The command line arguments.
- public static void Main(string[] args)
- {
- Options options = ExampleUtilities.ParseCommandLine(args);
-
- UploadImage codeExample = new UploadImage();
- Console.WriteLine(codeExample.Description);
- codeExample.Run(new GoogleAdsClient(), options.CustomerId);
- }
-
- ///
- /// Returns a description about the code example.
- ///
- public override string Description => "This code example uploads an image.";
-
- ///
- /// Runs the code example.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- public void Run(GoogleAdsClient client, long customerId)
- {
- // Get the MediaFileServiceClient.
- MediaFileServiceClient mediaFileService =
- client.GetService(Services.V14.MediaFileService);
-
- const string URL = "https://gaagl.page.link/Eit5";
-
- MediaFile file = new MediaFile()
- {
- Name = "Ad Image",
- Type = MediaType.Image,
- SourceUrl = URL,
- Image = new MediaImage()
- {
- Data = ByteString.CopyFrom(MediaUtilities.GetAssetDataFromUrl(
- URL, client.Config))
- }
- };
- MediaFileOperation operation = new MediaFileOperation()
- {
- Create = file
- };
-
- try
- {
- MutateMediaFilesResponse response =
- mediaFileService.MutateMediaFiles(customerId.ToString(), new[] { operation });
- Console.WriteLine($"Added {response.Results} images:");
- foreach (MutateMediaFileResult result in response.Results)
- {
- Console.WriteLine(result.ResourceName);
- }
- }
- catch (GoogleAdsException e)
- {
- Console.WriteLine("Failure:");
- Console.WriteLine($"Message: {e.Message}");
- Console.WriteLine($"Failure: {e.Failure}");
- Console.WriteLine($"Request ID: {e.RequestId}");
- throw;
- }
- }
- }
-}
diff --git a/Google.Ads.GoogleAds/examples/Misc/UploadImageAsset.cs b/Google.Ads.GoogleAds/examples/Misc/UploadImageAsset.cs
index c9f26c94d..925a6767a 100644
--- a/Google.Ads.GoogleAds/examples/Misc/UploadImageAsset.cs
+++ b/Google.Ads.GoogleAds/examples/Misc/UploadImageAsset.cs
@@ -17,18 +17,18 @@
using Google.Ads.Gax.Util;
using Google.Ads.GoogleAds.Lib;
using Google.Ads.GoogleAds.Util;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Protobuf;
using System;
using System.Collections.Generic;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.AssetTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.MimeTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AssetTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.MimeTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example uploads an image asset. To get image assets, run GetAllImageAssets.cs.
@@ -83,7 +83,7 @@ public void Run(GoogleAdsClient client, long customerId)
{
// Get the AssetServiceClient.
AssetServiceClient assetService =
- client.GetService(Services.V15.AssetService);
+ client.GetService(Services.V16.AssetService);
// Creates an image content.
byte[] imageContent = MediaUtilities.GetAssetDataFromUrl(IMAGE_URL, client.Config);
diff --git a/Google.Ads.GoogleAds/examples/Misc/UploadMediaBundle.cs b/Google.Ads.GoogleAds/examples/Misc/UploadMediaBundle.cs
deleted file mode 100644
index 97ba369e2..000000000
--- a/Google.Ads.GoogleAds/examples/Misc/UploadMediaBundle.cs
+++ /dev/null
@@ -1,132 +0,0 @@
-// Copyright 2020 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using CommandLine;
-using Google.Ads.Gax.Examples;
-using Google.Ads.Gax.Util;
-using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.Util;
-using Google.Ads.GoogleAds.V14.Errors;
-using Google.Ads.GoogleAds.V14.Resources;
-using Google.Ads.GoogleAds.V14.Services;
-using Google.Protobuf;
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using static Google.Ads.GoogleAds.V14.Enums.MediaTypeEnum.Types;
-
-namespace Google.Ads.GoogleAds.Examples.V14
-{
- ///
- /// This code example uploads an HTML5 zip file as a media bundle.
- ///
- /// This code example uses version v14 of the Google Ads API. Google Ads is migrating
- /// from individual media files to assets, and version v15 of the API removed support for
- /// MediaFileService as part of this migration. Once your Ads account is migrated, this code
- /// example will stop working, and you should use UploadImageAsset.cs instead. This code
- /// example will be removed once the migration completes. See
- /// https://ads-developers.googleblog.com/2023/07/image-and-location-auto-migration.html for
- /// more details.
- ///
- public class UploadMediaBundle : ExampleBase
- {
- ///
- /// Command line options for running the example.
- ///
- public class Options : OptionsBase
- {
- ///
- /// The customer ID for which the call is made.
- ///
- [Option("customerId", Required = true, HelpText =
- "The customer ID for which the call is made.")]
- public long CustomerId { get; set; }
- }
-
- ///
- /// Main method, to run this code example as a standalone application.
- ///
- /// The command line arguments.
- public static void Main(string[] args)
- {
- Options options = ExampleUtilities.ParseCommandLine(args);
-
- UploadMediaBundle codeExample = new UploadMediaBundle();
- Console.WriteLine(codeExample.Description);
- codeExample.Run(new GoogleAdsClient(), options.CustomerId);
- }
-
- ///
- /// The asset bundle to upload.
- ///
- private const string BUNDLE_URL = "https://gaagl.page.link/ib87";
-
- ///
- /// Returns a description about the code example.
- ///
- public override string Description =>
- "This code example uploads an HTML5 zip file as a media bundle.";
-
- ///
- /// Runs the code example.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- public void Run(GoogleAdsClient client, long customerId)
- {
- // Get the MediaFileServiceClient.
- MediaFileServiceClient mediaFileService = client.GetService(
- Services.V14.MediaFileService);
-
- // Creates an HTML5 zip file media bundle content.
- byte[] bundleContent = MediaUtilities.GetAssetDataFromUrl(BUNDLE_URL, client.Config);
-
- // Creates a media file.
- MediaFile mediaFile = new MediaFile()
- {
- Name = "Ad Media Bundle",
- Type = MediaType.MediaBundle,
- MediaBundle = new MediaBundle()
- {
- Data = ByteString.CopyFrom(bundleContent),
- }
- };
-
- // Creates a media file operation.
- MediaFileOperation operation = new MediaFileOperation()
- {
- Create = mediaFile
- };
-
- try
- {
- // Issues a mutate request to add the media file.
- MutateMediaFilesResponse response =
- mediaFileService.MutateMediaFiles(customerId.ToString(), new[] { operation });
-
- // Displays the result.
- Console.WriteLine($"The media bundle with resource name " +
- $"'{response.Results.First().ResourceName}' is created.");
- }
- catch (GoogleAdsException e)
- {
- Console.WriteLine("Failure:");
- Console.WriteLine($"Message: {e.Message}");
- Console.WriteLine($"Failure: {e.Failure}");
- Console.WriteLine($"Request ID: {e.RequestId}");
- throw;
- }
- }
- }
-}
diff --git a/Google.Ads.GoogleAds/examples/Planning/ForecastReach.cs b/Google.Ads.GoogleAds/examples/Planning/ForecastReach.cs
index 526c4b570..c9281d490 100644
--- a/Google.Ads.GoogleAds/examples/Planning/ForecastReach.cs
+++ b/Google.Ads.GoogleAds/examples/Planning/ForecastReach.cs
@@ -15,16 +15,16 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.DeviceEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.GenderTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.ReachPlanAgeRangeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.DeviceEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.GenderTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ReachPlanAgeRangeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This example demonstrates how to interact with the ReachPlanService to find plannable
@@ -68,7 +68,7 @@ public static void Main(string[] args)
///
/// Runs the code example, showing a typical series of calls to the
- /// .
+ /// .
///
/// The Google Ads API client.
/// The Google Ads customer ID for which the call is made.
@@ -78,7 +78,7 @@ public void Run(GoogleAdsClient client, long customerId)
string currencyCode = "USD";
long budgetMicros = 5_000_000L;
ReachPlanServiceClient reachPlanService =
- client.GetService(Services.V15.ReachPlanService);
+ client.GetService(Services.V16.ReachPlanService);
try
{
diff --git a/Google.Ads.GoogleAds/examples/Planning/GenerateForecastMetrics.cs b/Google.Ads.GoogleAds/examples/Planning/GenerateForecastMetrics.cs
index 57172f101..456df2b28 100644
--- a/Google.Ads.GoogleAds/examples/Planning/GenerateForecastMetrics.cs
+++ b/Google.Ads.GoogleAds/examples/Planning/GenerateForecastMetrics.cs
@@ -15,15 +15,15 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
-using static Google.Ads.GoogleAds.V15.Enums.KeywordMatchTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.KeywordPlanNetworkEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.KeywordMatchTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.KeywordPlanNetworkEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15;
+namespace Google.Ads.GoogleAds.Examples.V16;
///
/// This code example generates forecast metrics for keyword planning.
@@ -74,7 +74,7 @@ public void Run(GoogleAdsClient client, long customerId)
CampaignToForecast campaignToForecast = CreateCampaignToForecast();
KeywordPlanIdeaServiceClient keywordPlanIdeaService =
- client.GetService(Services.V15.KeywordPlanIdeaService);
+ client.GetService(Services.V16.KeywordPlanIdeaService);
GenerateKeywordForecastMetricsRequest request = new GenerateKeywordForecastMetricsRequest()
{
diff --git a/Google.Ads.GoogleAds/examples/Planning/GenerateHistoricalMetrics.cs b/Google.Ads.GoogleAds/examples/Planning/GenerateHistoricalMetrics.cs
index 4f9dbaa43..b93cc3c49 100644
--- a/Google.Ads.GoogleAds/examples/Planning/GenerateHistoricalMetrics.cs
+++ b/Google.Ads.GoogleAds/examples/Planning/GenerateHistoricalMetrics.cs
@@ -15,14 +15,14 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
-using static Google.Ads.GoogleAds.V15.Enums.KeywordPlanNetworkEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.KeywordPlanNetworkEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15;
+namespace Google.Ads.GoogleAds.Examples.V16;
///
/// This code example generates historical metrics for keyword planning.
@@ -71,7 +71,7 @@ public static void Main(string[] args)
public void Run(GoogleAdsClient client, long customerId)
{
KeywordPlanIdeaServiceClient keywordPlanIdeaService =
- client.GetService(Services.V15.KeywordPlanIdeaService);
+ client.GetService(Services.V16.KeywordPlanIdeaService);
GenerateKeywordHistoricalMetricsRequest request =
new GenerateKeywordHistoricalMetricsRequest()
diff --git a/Google.Ads.GoogleAds/examples/Planning/GenerateKeywordIdeas.cs b/Google.Ads.GoogleAds/examples/Planning/GenerateKeywordIdeas.cs
index 96d683237..b0b1fb222 100644
--- a/Google.Ads.GoogleAds/examples/Planning/GenerateKeywordIdeas.cs
+++ b/Google.Ads.GoogleAds/examples/Planning/GenerateKeywordIdeas.cs
@@ -15,16 +15,16 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.KeywordPlanNetworkEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.KeywordPlanNetworkEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example generates keyword ideas from a list of seed keywords or a seed page URL.
@@ -122,7 +122,7 @@ public void Run(GoogleAdsClient client, long customerId, long[] locationIds,
long languageId, string[] keywordTexts, string pageUrl)
{
KeywordPlanIdeaServiceClient keywordPlanIdeaService =
- client.GetService(Services.V15.KeywordPlanIdeaService);
+ client.GetService(Services.V16.KeywordPlanIdeaService);
// Make sure that keywords and/or page URL were specified. The request must have
// exactly one of urlSeed, keywordSeed, or keywordAndUrlSeed set.
diff --git a/Google.Ads.GoogleAds/examples/Planning/GetAdGroupCriterionCpcBidSimulations.cs b/Google.Ads.GoogleAds/examples/Planning/GetAdGroupCriterionCpcBidSimulations.cs
index 54c141b82..f7ed2c019 100644
--- a/Google.Ads.GoogleAds/examples/Planning/GetAdGroupCriterionCpcBidSimulations.cs
+++ b/Google.Ads.GoogleAds/examples/Planning/GetAdGroupCriterionCpcBidSimulations.cs
@@ -15,14 +15,14 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This example gets all available ad group criterion CPC bid simulations for a given ad group.
@@ -84,7 +84,7 @@ public void Run(GoogleAdsClient client, long customerId, long adGroupId)
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
try
{
diff --git a/Google.Ads.GoogleAds/examples/Recommendations/ApplyRecommendation.cs b/Google.Ads.GoogleAds/examples/Recommendations/ApplyRecommendation.cs
deleted file mode 100644
index bef1c5092..000000000
--- a/Google.Ads.GoogleAds/examples/Recommendations/ApplyRecommendation.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-// Copyright 2019 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using CommandLine;
-using Google.Ads.Gax.Examples;
-using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
-using System;
-using System.Collections.Generic;
-
-namespace Google.Ads.GoogleAds.Examples.V15
-{
- ///
- /// This code example applies a given recommendation. To retrieve recommendations for text ads,
- /// run GetTextAdRecommendations.cs.
- ///
- public class ApplyRecommendation : ExampleBase
- {
- ///
- /// Command line options for running the example.
- ///
- public class Options : OptionsBase
- {
- ///
- /// The customer ID for which the call is made.
- ///
- [Option("customerId", Required = true, HelpText =
- "The customer ID for which the call is made.")]
- public long CustomerId { get; set; }
-
- ///
- /// ID of the recommendation to apply.
- ///
- [Option("recommendationId", Required = true, HelpText =
- "ID of the recommendation to apply.")]
- public long RecommendationId { get; set; }
- }
-
- ///
- /// Main method, to run this code example as a standalone application.
- ///
- /// The command line arguments.
- public static void Main(string[] args)
- {
- Options options = ExampleUtilities.ParseCommandLine(args);
-
- ApplyRecommendation codeExample = new ApplyRecommendation();
- Console.WriteLine(codeExample.Description);
- codeExample.Run(new GoogleAdsClient(), options.CustomerId, options.RecommendationId);
- }
-
- ///
- /// Returns a description about the code example.
- ///
- public override string Description =>
- "This code example applies a given recommendation. To retrieve recommendations for " +
- "text ads, run GetTextAdRecommendations.cs.";
-
- ///
- /// Runs the code example.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- /// ID of the recommendation to apply.
- // [START apply_recommendation]
- public void Run(GoogleAdsClient client, long customerId, long recommendationId)
- {
- // Get the RecommendationServiceClient.
- RecommendationServiceClient service = client.GetService(
- Services.V15.RecommendationService);
-
- ApplyRecommendationOperation operation = new ApplyRecommendationOperation()
- {
- ResourceName = ResourceNames.Recommendation(customerId, recommendationId),
-
- // Each recommendation types has optional parameters to override the recommended
- // values. For example, you can override a recommended ad when a
- // TextAdRecommendation is applied, as shown below.
- // Please read https://developers.google.com/google-ads/api/reference/rpc/latest/ApplyRecommendationOperation
- // for details.
- // TextAd = new TextAdParameters() {
- // Ad = new Ad() {
- // Id = long.Parse("INSERT_AD_ID_HERE")
- // }
- // }
- };
-
- try
- {
- ApplyRecommendationResponse response = service.ApplyRecommendation(
- customerId.ToString(), new ApplyRecommendationOperation[] {
- operation
- });
- Console.WriteLine($"Applied {0} recommendation(s):", response.Results.Count);
- foreach (ApplyRecommendationResult result in response.Results)
- {
- Console.WriteLine($"- {result.ResourceName}");
- }
- }
- catch (GoogleAdsException e)
- {
- Console.WriteLine("Failure:");
- Console.WriteLine($"Message: {e.Message}");
- Console.WriteLine($"Failure: {e.Failure}");
- Console.WriteLine($"Request ID: {e.RequestId}");
- throw;
- }
- }
- // [END apply_recommendation]
- }
-}
diff --git a/Google.Ads.GoogleAds/examples/Recommendations/DetectAndApplyRecommendations.cs b/Google.Ads.GoogleAds/examples/Recommendations/DetectAndApplyRecommendations.cs
index de681b3ab..5852c8f50 100644
--- a/Google.Ads.GoogleAds/examples/Recommendations/DetectAndApplyRecommendations.cs
+++ b/Google.Ads.GoogleAds/examples/Recommendations/DetectAndApplyRecommendations.cs
@@ -15,23 +15,32 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Services;
using System;
-using System.Collections.Generic;
using System.Threading;
+using System.Collections.Generic;
+using Google.Ads.GoogleAds.Config;
+using Google.Ads.GoogleAds.Extensions.Config;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
- /// The auto-apply feature, which automatically applies recommendations as they become
- /// eligible, is currently supported by the Google Ads UI but not by the Google Ads API. See
- /// https://support.google.com/google-ads/answer/10279006 for more information on
- /// using auto-apply in the Google Ads UI.
+ /// This example shows how to retrieve recommendations and apply them in a batch.
+ /// Recommendations should be applied shortly after they're retrieved. Depending on the
+ /// recommendation type, a recommendation can become obsolete quickly, and obsolete
+ /// recommendations throw an error when applied. For more details, see:
+ /// https://developers.google.com/google-ads/api/docs/recommendations#take_action
+ ///
+ /// As of Google Ads API V15, users can subscribe to certain recommendation types to apply
+ /// them automatically. For more details, see:
+ /// https://developers.google.com/google-ads/api/docs/recommendations#auto-apply
///
- /// This code example demonstrates how an alternative can be implemented with the features that
- /// are currently supported by the Google Ads API. It periodically retrieves and applies
- /// KEYWORD
recommendations with default parameters.
+ /// As of Google Ads API V16, users can proactively generate certain recommendation types
+ /// during the campaign construction process. For more details, see:
+ /// https://developers.google.com/google-ads/api/docs/recommendations#recommendations-in-campaign-construction
///
public class DetectAndApplyRecommendations : ExampleBase
{
@@ -49,24 +58,6 @@ public class Options : OptionsBase
public long CustomerId { get; set; }
}
- ///
- /// The maximum number of recommendations to periodically retrieve and apply. In a real
- /// application, such a limit would typically not be used.
- ///
- private const int MAX_RESULT_SIZE = 2;
-
- ///
- /// The number of times to retrieve and apply recommendations. In a real application, such
- /// a limit would typically not be used.
- ///
- private const int NUMBER_OF_RUNS = 3;
-
- ///
- /// The time to wait between two runs. In a real application, this would typically be set
- /// to minutes or hours instead of seconds.
- ///
- private const int WAIT_TIME_IN_SECONDS = 5;
-
///
/// Main method, to run this code example as a standalone application.
///
@@ -77,20 +68,26 @@ public static void Main(string[] args)
DetectAndApplyRecommendations codeExample = new DetectAndApplyRecommendations();
Console.WriteLine(codeExample.Description);
- codeExample.Run(new GoogleAdsClient(), options.CustomerId);
+ GoogleAdsConfig config = new GoogleAdsConfig();
+ config.LoadFromEnvironmentVariables();
+ codeExample.Run(new GoogleAdsClient(config), options.CustomerId);
}
///
/// Returns a description about the code example.
///
public override string Description =>
- "The auto-apply feature, which automatically applies recommendations as they become " +
- "eligible, is currently supported by the Google Ads UI but not by the Google Ads " +
- "API. See https://support.google.com/google-ads/answer/10279006 for more " +
- "information on using auto-apply in the Google Ads UI. " +
- "This code example demonstrates how an alternative can be implemented with the " +
- "features that are currently supported by the Google Ads API. It periodically " +
- "retrieves and applies KEYWORD
recommendations with default parameters.";
+ "This example shows how to retrieve recommendations and apply them in a batch.\n" +
+ "Recommendations should be applied shortly after they're retrieved. Depending on the " +
+ "recommendation type, a recommendation can become obsolete quickly, and obsolete " +
+ "recommendations throw an error when applied. For more details, see: " +
+ "https://developers.google.com/google-ads/api/docs/recommendations#take_action\n" +
+ "As of Google Ads API V15, users can subscribe to certain recommendation types to " +
+ "apply them automatically. For more details, see: " +
+ "https://developers.google.com/google-ads/api/docs/recommendations#auto-apply\n" +
+ "As of Google Ads API V16, users can proactively generate certain recommendation " +
+ "types during the campaign construction process. For more details, see: " +
+ "https://developers.google.com/google-ads/api/docs/recommendations#recommendations-in-campaign-construction";
///
/// Runs the code example.
@@ -99,62 +96,52 @@ public static void Main(string[] args)
/// The customer ID for which the call is made.
public void Run(GoogleAdsClient client, long customerId)
{
- // Get the RecommendationServiceClient.
- RecommendationServiceClient recommendationService = client.GetService(
- Services.V15.RecommendationService);
-
// Get the GoogleAdsServiceClient.
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
// Creates a query that retrieves keyword recommendations.
- string query = "SELECT recommendation.resource_name FROM recommendation WHERE " +
- $"recommendation.type = KEYWORD LIMIT {MAX_RESULT_SIZE}";
+ string query = "SELECT recommendation.resource_name, " +
+ "recommendation.campaign, recommendation.keyword_recommendation " +
+ "FROM recommendation WHERE " +
+ $"recommendation.type = KEYWORD";
+
+ List operations =
+ new List();
try
{
- // Creates apply operations for all the recommendations found.
- for (int i = 0; i < NUMBER_OF_RUNS; i++)
- {
- List operations =
- new List();
- // Issue a search request.
- googleAdsService.SearchStream(customerId.ToString(), query,
- delegate (SearchGoogleAdsStreamResponse resp)
+ // Issue a search request.
+ googleAdsService.SearchStream(customerId.ToString(), query,
+ delegate (SearchGoogleAdsStreamResponse resp)
+ {
+ Console.WriteLine($"Found {resp.Results.Count} recommendations.");
+ foreach (GoogleAdsRow googleAdsRow in resp.Results)
{
- foreach (GoogleAdsRow googleAdsRow in resp.Results)
+ Recommendation recommendation = googleAdsRow.Recommendation;
+ Console.WriteLine("Keyword recommendation " +
+ $"{recommendation.ResourceName} was found for campaign " +
+ $"{recommendation.Campaign}.");
+
+ if (recommendation.KeywordRecommendation != null)
{
- operations.Add(new ApplyRecommendationOperation()
- {
- ResourceName = googleAdsRow.Recommendation.ResourceName
- });
+ KeywordInfo keyword =
+ recommendation.KeywordRecommendation.Keyword;
+ Console.WriteLine($"Keyword = {keyword.Text}, type = " +
+ "{keyword.MatchType}");
}
- }
- );
- // Sends the apply recommendation request and prints information.
- if (operations.Count > 0)
- {
- ApplyRecommendationResponse response =
- recommendationService.ApplyRecommendation(
- customerId.ToString(), operations);
- Console.WriteLine($"Applied {0} recommendation(s):", response.Results.Count);
- foreach (ApplyRecommendationResult result in response.Results)
- {
- Console.WriteLine($"- {result.ResourceName}");
+ operations.Add(new ApplyRecommendationOperation()
+ {
+ // If you have a recommendation_id instead of the resource_name
+ // you can create a resource name from it like this:
+ // string recommendationResourceName =
+ // ResourceNames.Recommendation(customerId, recommendationId)
+ ResourceName = recommendation.ResourceName
+ });
}
}
- else
- {
- Console.WriteLine("No recommendations were found.");
- }
- if (i < NUMBER_OF_RUNS - 1)
- {
- Console.WriteLine($"Waiting {WAIT_TIME_IN_SECONDS} seconds before " +
- $"applying recommendations.");
- Thread.Sleep(WAIT_TIME_IN_SECONDS * 1000);
- }
- }
+ );
}
catch (GoogleAdsException e)
{
@@ -165,5 +152,36 @@ public void Run(GoogleAdsClient client, long customerId)
throw;
}
}
+
+ ///
+ /// Applies a list of recommendation.
+ ///
+ /// The Google Ads client.
+ /// The customer ID for which the call is made.
+ /// The recommendations to apply.
+ // [START apply_recommendation]
+ private void ApplyRecommendation(GoogleAdsClient client, long customerId,
+ List operations)
+ {
+ // Get the RecommendationServiceClient.
+ RecommendationServiceClient recommendationService = client.GetService(
+ Services.V16.RecommendationService);
+
+ ApplyRecommendationRequest applyRecommendationRequest = new ApplyRecommendationRequest()
+ {
+ CustomerId = customerId.ToString(),
+ };
+
+ applyRecommendationRequest.Operations.AddRange(operations);
+
+ ApplyRecommendationResponse response =
+ recommendationService.ApplyRecommendation(applyRecommendationRequest);
+ foreach (ApplyRecommendationResult result in response.Results)
+ {
+ Console.WriteLine("Applied a recommendation with resource name: " +
+ result.ResourceName);
+ }
+ }
+ // [END apply_recommendation]
}
}
\ No newline at end of file
diff --git a/Google.Ads.GoogleAds/examples/Recommendations/DismissRecommendation.cs b/Google.Ads.GoogleAds/examples/Recommendations/DismissRecommendation.cs
index 5b2862abf..ac5a686cf 100644
--- a/Google.Ads.GoogleAds/examples/Recommendations/DismissRecommendation.cs
+++ b/Google.Ads.GoogleAds/examples/Recommendations/DismissRecommendation.cs
@@ -15,15 +15,15 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Services.DismissRecommendationRequest.Types;
-using static Google.Ads.GoogleAds.V15.Services.DismissRecommendationResponse.Types;
+using static Google.Ads.GoogleAds.V16.Services.DismissRecommendationRequest.Types;
+using static Google.Ads.GoogleAds.V16.Services.DismissRecommendationResponse.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example dismisses a given recommendation. To retrieve recommendations for text
@@ -81,7 +81,7 @@ public void Run(GoogleAdsClient client, long customerId, long recommendationId)
{
// Get the RecommendationServiceClient.
RecommendationServiceClient service = client.GetService(
- Services.V15.RecommendationService);
+ Services.V16.RecommendationService);
DismissRecommendationOperation operation = new DismissRecommendationOperation()
{
diff --git a/Google.Ads.GoogleAds/examples/Recommendations/GetTextAdRecommendations.cs b/Google.Ads.GoogleAds/examples/Recommendations/GetTextAdRecommendations.cs
deleted file mode 100644
index 372289a4e..000000000
--- a/Google.Ads.GoogleAds/examples/Recommendations/GetTextAdRecommendations.cs
+++ /dev/null
@@ -1,145 +0,0 @@
-// Copyright 2019 Google LLC
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-using CommandLine;
-using Google.Ads.Gax.Examples;
-using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
-using Google.Api.Gax;
-using System;
-using System.Collections.Generic;
-
-namespace Google.Ads.GoogleAds.Examples.V15
-{
- ///
- /// This code example gets all TEXT_AD recommendations.
- ///
- public class GetTextAdRecommendations : ExampleBase
- {
- ///
- /// Command line options for running the example.
- ///
- public class Options : OptionsBase
- {
- ///
- /// The customer ID for which the call is made.
- ///
- [Option("customerId", Required = true, HelpText =
- "The customer ID for which the call is made.")]
- public long CustomerId { get; set; }
- }
-
- ///
- /// Main method, to run this code example as a standalone application.
- ///
- /// The command line arguments.
- public static void Main(string[] args)
- {
- Options options = ExampleUtilities.ParseCommandLine(args);
-
- GetTextAdRecommendations codeExample = new GetTextAdRecommendations();
- Console.WriteLine(codeExample.Description);
- codeExample.Run(new GoogleAdsClient(), options.CustomerId);
- }
-
- ///
- /// The page size of results.
- ///
- private const int PAGE_SIZE = 1_000;
-
- ///
- /// Returns a description about the code example.
- ///
- public override string Description => "This code example gets all TEXT_AD recommendations.";
-
- ///
- /// Runs the code example.
- ///
- /// The Google Ads client.
- /// The customer ID for which the call is made.
- // [START get_text_ad_recommendations]
- public void Run(GoogleAdsClient client, long customerId)
- {
- // Get the GoogleAdsServiceClient .
- GoogleAdsServiceClient service = client.GetService(Services.V15.GoogleAdsService);
-
- string query =
- @"SELECT
- recommendation.type,
- recommendation.campaign,
- recommendation.text_ad_recommendation
- FROM
- recommendation
- WHERE
- recommendation.type = TEXT_AD";
-
- // Create a request that will retrieve all recommendations using pages of the
- // specified page size.
- SearchGoogleAdsRequest request = new SearchGoogleAdsRequest()
- {
- CustomerId = customerId.ToString(),
- PageSize = PAGE_SIZE,
- Query = query
- };
-
- try
- {
- // Issue the search request.
- PagedEnumerable searchPagedResponse =
- service.Search(customerId.ToString(), query);
-
- // Iterates over all rows in all pages and prints the requested field values
- // for the recommendation in each row.
- foreach (GoogleAdsRow googleAdsRow in searchPagedResponse)
- {
- Recommendation recommendation = googleAdsRow.Recommendation;
- // [START_EXCLUDE]
- Ad recommendedAd = recommendation.TextAdRecommendation.Ad;
-
- Console.WriteLine($"Recommendation ({recommendation.ResourceName}) was " +
- $"found for campaign {recommendation.Campaign}:");
- if (recommendedAd.ExpandedTextAd != null)
- {
- ExpandedTextAdInfo eta = recommendedAd.ExpandedTextAd;
- Console.WriteLine("\tHeadline 1 = {0}\n\tHeadline 2 = {1}\t" +
- "Description = {2}",
- eta.HeadlinePart1, eta.HeadlinePart2, eta.Description);
- }
- Console.WriteLine($"\tDisplay URL = {recommendedAd.DisplayUrl}");
- foreach (string url in recommendedAd.FinalUrls)
- {
- Console.WriteLine($"\tFinal URL = {url}");
- }
- foreach (string url in recommendedAd.FinalMobileUrls)
- {
- Console.WriteLine($"\tFinal Mobile URL = {url}");
- }
- // [END_EXCLUDE]
- }
- }
- catch (GoogleAdsException e)
- {
- Console.WriteLine("Failure:");
- Console.WriteLine($"Message: {e.Message}");
- Console.WriteLine($"Failure: {e.Failure}");
- Console.WriteLine($"Request ID: {e.RequestId}");
- throw;
- }
- }
- // [END get_text_ad_recommendations]
- }
-}
diff --git a/Google.Ads.GoogleAds/examples/Remarketing/AddConversionAction.cs b/Google.Ads.GoogleAds/examples/Remarketing/AddConversionAction.cs
index f01d5d032..a23e3b035 100644
--- a/Google.Ads.GoogleAds/examples/Remarketing/AddConversionAction.cs
+++ b/Google.Ads.GoogleAds/examples/Remarketing/AddConversionAction.cs
@@ -15,16 +15,15 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
-using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.ConversionActionCategoryEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.ConversionActionStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.ConversionActionTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ConversionActionCategoryEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ConversionActionStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ConversionActionTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example illustrates adding a conversion action.
@@ -74,12 +73,18 @@ public void Run(GoogleAdsClient client, long customerId)
{
// Get the ConversionActionService.
ConversionActionServiceClient conversionActionService =
- client.GetService(Services.V15.ConversionActionService);
+ client.GetService(Services.V16.ConversionActionService);
+
+ // Note that conversion action names must be unique.
+ // If a conversion action already exists with the specified name the create operation
+ // will fail with a ConversionAction.DUPLICATE_NAME error.
+ string ConversionActionName = "Earth to Mars Cruises Conversion #"
+ + ExampleUtilities.GetRandomString();
// Add a conversion action.
ConversionAction conversionAction = new ConversionAction()
{
- Name = "Earth to Mars Cruises Conversion #" + ExampleUtilities.GetRandomString(),
+ Name = ConversionActionName,
Category = ConversionActionCategory.Default,
Type = ConversionActionType.Webpage,
Status = ConversionActionStatus.Enabled,
diff --git a/Google.Ads.GoogleAds/examples/Remarketing/AddConversionBasedUserList.cs b/Google.Ads.GoogleAds/examples/Remarketing/AddConversionBasedUserList.cs
index e3565bc01..f7e3d55ab 100644
--- a/Google.Ads.GoogleAds/examples/Remarketing/AddConversionBasedUserList.cs
+++ b/Google.Ads.GoogleAds/examples/Remarketing/AddConversionBasedUserList.cs
@@ -15,16 +15,16 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.UserListMembershipStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.UserListMembershipStatusEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example creates a basic user list consisting of people who triggered one or more
@@ -85,7 +85,7 @@ public void Run(GoogleAdsClient client, long customerId, long[] conversionAction
{
// Creates the service client.
UserListServiceClient userListServiceClient =
- client.GetService(Services.V15.UserListService);
+ client.GetService(Services.V16.UserListService);
List userListActionInfoList = new List();
foreach (long conversionActionId in conversionActionIds)
diff --git a/Google.Ads.GoogleAds/examples/Remarketing/AddCustomAudience.cs b/Google.Ads.GoogleAds/examples/Remarketing/AddCustomAudience.cs
index c742fa334..d606341da 100644
--- a/Google.Ads.GoogleAds/examples/Remarketing/AddCustomAudience.cs
+++ b/Google.Ads.GoogleAds/examples/Remarketing/AddCustomAudience.cs
@@ -15,17 +15,17 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.CustomAudienceMemberTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CustomAudienceStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CustomAudienceTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CustomAudienceMemberTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CustomAudienceStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CustomAudienceTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This example illustrates adding a custom audience. Custom audiences help you reach your
@@ -80,7 +80,7 @@ public void Run(GoogleAdsClient client, long customerId)
{
// Get the CustomAudienceService client.
CustomAudienceServiceClient customAudienceServiceClient =
- client.GetService(Services.V15.CustomAudienceService);
+ client.GetService(Services.V16.CustomAudienceService);
// Create a custom audience.
CustomAudience customAudience = new CustomAudience
diff --git a/Google.Ads.GoogleAds/examples/Remarketing/AddCustomerMatchUserList.cs b/Google.Ads.GoogleAds/examples/Remarketing/AddCustomerMatchUserList.cs
index 17b15e742..571af82b7 100644
--- a/Google.Ads.GoogleAds/examples/Remarketing/AddCustomerMatchUserList.cs
+++ b/Google.Ads.GoogleAds/examples/Remarketing/AddCustomerMatchUserList.cs
@@ -15,10 +15,10 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using Google.LongRunning;
using Google.Protobuf.WellKnownTypes;
using System;
@@ -26,12 +26,12 @@
using System.Linq;
using System.Security.Cryptography;
using System.Text;
-using static Google.Ads.GoogleAds.V15.Enums.ConsentStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CustomerMatchUploadKeyTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.OfflineUserDataJobStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.OfflineUserDataJobTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ConsentStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CustomerMatchUploadKeyTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.OfflineUserDataJobStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.OfflineUserDataJobTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// Creates operations to add members to a user list (a.k.a. audience) using an
@@ -200,7 +200,7 @@ public void Run(GoogleAdsClient client, long customerId, bool runJob,
private string CreateCustomerMatchUserList(GoogleAdsClient client, long customerId)
{
// Get the UserListService.
- UserListServiceClient service = client.GetService(Services.V15.UserListService);
+ UserListServiceClient service = client.GetService(Services.V16.UserListService);
// Creates the user list.
UserList userList = new UserList()
@@ -257,7 +257,7 @@ private static string AddUsersToCustomerMatchUserList(GoogleAdsClient client,
{
// Get the OfflineUserDataJobService.
OfflineUserDataJobServiceClient service = client.GetService(
- Services.V15.OfflineUserDataJobService);
+ Services.V16.OfflineUserDataJobService);
string offlineUserDataJobResourceName;
if (offlineUserDataJobId == null)
@@ -373,7 +373,7 @@ private static void CheckJobStatusAndPrintResults(GoogleAdsClient client, long c
string offlineUserDataJobResourceName)
{
// Get the GoogleAdsService.
- GoogleAdsServiceClient service = client.GetService(Services.V15.GoogleAdsService);
+ GoogleAdsServiceClient service = client.GetService(Services.V16.GoogleAdsService);
string query = "SELECT offline_user_data_job.resource_name, " +
"offline_user_data_job.id, offline_user_data_job.status, " +
@@ -578,7 +578,7 @@ private static void PrintCustomerMatchUserListInfo(GoogleAdsClient client, long
// [START add_customer_match_user_list_5]
// Get the GoogleAdsService.
GoogleAdsServiceClient service =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
// Creates a query that retrieves the user list.
string query =
diff --git a/Google.Ads.GoogleAds/examples/Remarketing/AddDynamicRemarketingAsset.cs b/Google.Ads.GoogleAds/examples/Remarketing/AddDynamicRemarketingAsset.cs
index 6e36bbd65..361d2bda3 100644
--- a/Google.Ads.GoogleAds/examples/Remarketing/AddDynamicRemarketingAsset.cs
+++ b/Google.Ads.GoogleAds/examples/Remarketing/AddDynamicRemarketingAsset.cs
@@ -15,15 +15,15 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.AssetSetTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AssetSetTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example adds an asset for use in dynamic remarketing and links it to a campaign.
@@ -113,7 +113,7 @@ public void Run(GoogleAdsClient client, long customerId, long campaignId)
/// The resource name of the newly created asset.
private string CreateAsset(GoogleAdsClient client, long customerId)
{
- AssetServiceClient assetService = client.GetService(Services.V15.AssetService);
+ AssetServiceClient assetService = client.GetService(Services.V16.AssetService);
// Creates a DynamicEducationAsset.
// See https://support.google.com/google-ads/answer/6053288?#zippy=%2Ceducation for a
@@ -170,7 +170,7 @@ private string CreateAsset(GoogleAdsClient client, long customerId)
private string CreateAssetSet(GoogleAdsClient client, long customerId)
{
AssetSetServiceClient assetSetService = client.GetService(
- Services.V15.AssetSetService);
+ Services.V16.AssetSetService);
// Creates an AssetSet which will be used to link the dynamic remarketing assets
// to a campaign.
@@ -207,7 +207,7 @@ private void AddAssetsToAssetSet(GoogleAdsClient client, long customerId,
string assetResourceName, string assetSetResourceName)
{
AssetSetAssetServiceClient assetSetAssetService = client.GetService(
- Services.V15.AssetSetAssetService);
+ Services.V16.AssetSetAssetService);
AssetSetAsset assetSetAsset = new AssetSetAsset()
{
@@ -247,7 +247,7 @@ private void LinkAssetSetToCampaign(GoogleAdsClient client, long customerId,
long campaignId, string assetSetResourceName)
{
CampaignAssetSetServiceClient campaignAssetSetService = client.GetService(
- Services.V15.CampaignAssetSetService);
+ Services.V16.CampaignAssetSetService);
// Creates a CampaignAssetSet representing the link between an AssetSet and a Campaign.
CampaignAssetSet campaignAssetSet = new CampaignAssetSet()
diff --git a/Google.Ads.GoogleAds/examples/Remarketing/AddFlexibleRuleUserList.cs b/Google.Ads.GoogleAds/examples/Remarketing/AddFlexibleRuleUserList.cs
index cd3b324ae..2c4061a91 100644
--- a/Google.Ads.GoogleAds/examples/Remarketing/AddFlexibleRuleUserList.cs
+++ b/Google.Ads.GoogleAds/examples/Remarketing/AddFlexibleRuleUserList.cs
@@ -15,17 +15,17 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
-using static Google.Ads.GoogleAds.V15.Enums.UserListFlexibleRuleOperatorEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.UserListMembershipStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.UserListPrepopulationStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.UserListStringRuleItemOperatorEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.UserListFlexibleRuleOperatorEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.UserListMembershipStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.UserListPrepopulationStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.UserListStringRuleItemOperatorEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// Creates a rule-based user list defined by a combination of rules for users who have visited
@@ -147,7 +147,7 @@ public void Run(GoogleAdsClient client, long customerId)
try
{
UserListServiceClient userListServiceClient =
- client.GetService(Services.V15.UserListService);
+ client.GetService(Services.V16.UserListService);
MutateUserListsResponse response =
userListServiceClient.MutateUserLists(customerId.ToString(),
new[] { operation });
diff --git a/Google.Ads.GoogleAds/examples/Remarketing/AddFlightsFeed.cs b/Google.Ads.GoogleAds/examples/Remarketing/AddFlightsFeed.cs
index 7dbf91dc0..706d8d32f 100644
--- a/Google.Ads.GoogleAds/examples/Remarketing/AddFlightsFeed.cs
+++ b/Google.Ads.GoogleAds/examples/Remarketing/AddFlightsFeed.cs
@@ -15,17 +15,17 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.FeedAttributeTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.FlightPlaceholderFieldEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.PlaceholderTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.FeedAttributeTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.FlightPlaceholderFieldEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.PlaceholderTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example adds a flights feed, creates the associated feed mapping, and
@@ -110,7 +110,7 @@ public void Run(GoogleAdsClient client, long customerId)
private string CreateFeed(GoogleAdsClient client, long customerId)
{
// Get the FeedService.
- FeedServiceClient feedService = client.GetService(Services.V15.FeedService);
+ FeedServiceClient feedService = client.GetService(Services.V16.FeedService);
// Creates a Flight Description attribute.
FeedAttribute flightDescriptionAttribute = new FeedAttribute()
@@ -198,7 +198,7 @@ public Dictionary GetFeed(
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
// Constructs the query.
string query = $"SELECT feed.attributes FROM feed WHERE feed.resource_name = " +
@@ -267,7 +267,7 @@ private void CreateFeedMapping(GoogleAdsClient client, long customerId,
{
// Get the FeedMappingServiceClient.
FeedMappingServiceClient feedMappingService = client.GetService(
- Services.V15.FeedMappingService);
+ Services.V16.FeedMappingService);
// Maps the FeedAttributeIds to the fieldId constants.
AttributeFieldMapping flightDescriptionMapping = new AttributeFieldMapping()
@@ -347,7 +347,7 @@ private void CreateFeedItem(GoogleAdsClient client, long customerId,
{
// Get the FeedItemServiceClient.
FeedItemServiceClient feedItemService = client.GetService(
- Services.V15.FeedItemService);
+ Services.V16.FeedItemService);
// Creates the flight description feed attribute value.
FeedItemAttributeValue flightDescription = new FeedItemAttributeValue()
diff --git a/Google.Ads.GoogleAds/examples/Remarketing/AddLogicalUserList.cs b/Google.Ads.GoogleAds/examples/Remarketing/AddLogicalUserList.cs
index b5bc23f91..0f0915195 100644
--- a/Google.Ads.GoogleAds/examples/Remarketing/AddLogicalUserList.cs
+++ b/Google.Ads.GoogleAds/examples/Remarketing/AddLogicalUserList.cs
@@ -15,16 +15,16 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Enums;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Enums;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
using System.Linq;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example creates a combination user list containing users that are present on any
@@ -85,7 +85,7 @@ public void Run(GoogleAdsClient client, long customerId, long[] userListIds)
{
// Gets the UserListService client.
UserListServiceClient userListServiceClient =
- client.GetService(Services.V15.UserListService);
+ client.GetService(Services.V16.UserListService);
// Adds each of the provided list IDs to a list of rule operands specifying which lists
// the operator should target.
diff --git a/Google.Ads.GoogleAds/examples/Remarketing/AddMerchantCenterDynamicRemarketingCampaign.cs b/Google.Ads.GoogleAds/examples/Remarketing/AddMerchantCenterDynamicRemarketingCampaign.cs
index 0c02fbf5d..7710f8204 100644
--- a/Google.Ads.GoogleAds/examples/Remarketing/AddMerchantCenterDynamicRemarketingCampaign.cs
+++ b/Google.Ads.GoogleAds/examples/Remarketing/AddMerchantCenterDynamicRemarketingCampaign.cs
@@ -17,21 +17,21 @@
using Google.Ads.Gax.Util;
using Google.Ads.GoogleAds.Lib;
using Google.Ads.GoogleAds.Util;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Protobuf;
using System;
using System.Collections.Generic;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdvertisingChannelTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AssetTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CampaignStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.DisplayAdFormatSettingEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdvertisingChannelTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AssetTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CampaignStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.DisplayAdFormatSettingEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example creates a shopping campaign associated with an existing Merchant Center
@@ -151,7 +151,7 @@ private string CreateCampaign(GoogleAdsClient client, long customerId,
{
// Creates the Campaign Service client.
CampaignServiceClient campaignServiceClient =
- client.GetService(Services.V15.CampaignService);
+ client.GetService(Services.V16.CampaignService);
string budgetResourceName = ResourceNames.CampaignBudget(customerId, campaignBudgetId);
@@ -202,7 +202,7 @@ private string CreateAdGroup(GoogleAdsClient client, long customerId,
{
// Creates the ad group service client.
AdGroupServiceClient adGroupServiceClient =
- client.GetService(Services.V15.AdGroupService);
+ client.GetService(Services.V16.AdGroupService);
// Creates the ad group.
AdGroup adGroup = new AdGroup()
@@ -239,7 +239,7 @@ private void CreateAd(GoogleAdsClient client, long customerId, string adGroupRes
{
// Creates the ad group ad service client.
AdGroupAdServiceClient adGroupAdServiceClient =
- client.GetService(Services.V15.AdGroupAdService);
+ client.GetService(Services.V16.AdGroupAdService);
string marketingImageUrl = "https://gaagl.page.link/Eit5";
string marketingImageName = "Marketing Image";
@@ -352,7 +352,7 @@ private string UploadAsset(GoogleAdsClient client, long customerId,
string imageUrl, string assetName)
{
// Creates the asset service client.
- AssetServiceClient assetServiceClient = client.GetService(Services.V15.AssetService);
+ AssetServiceClient assetServiceClient = client.GetService(Services.V16.AssetService);
byte[] imageData = MediaUtilities.GetAssetDataFromUrl(imageUrl, client.Config);
@@ -394,7 +394,7 @@ private void AttachUserList(GoogleAdsClient client, long customerId,
{
// Creates the ad group criterion service client.
AdGroupCriterionServiceClient adGroupCriterionServiceClient = client.GetService
- (Services.V15.AdGroupCriterionService);
+ (Services.V16.AdGroupCriterionService);
string userListResourceName = ResourceNames.UserList(customerId, userListId);
diff --git a/Google.Ads.GoogleAds/examples/Remarketing/AddRealEstateFeed.cs b/Google.Ads.GoogleAds/examples/Remarketing/AddRealEstateFeed.cs
index 3e471235a..12ea1eccf 100644
--- a/Google.Ads.GoogleAds/examples/Remarketing/AddRealEstateFeed.cs
+++ b/Google.Ads.GoogleAds/examples/Remarketing/AddRealEstateFeed.cs
@@ -15,17 +15,17 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.FeedAttributeTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.PlaceholderTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.RealEstatePlaceholderFieldEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.FeedAttributeTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.PlaceholderTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.RealEstatePlaceholderFieldEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example adds a real estate feed, creates the feed mapping, and adds items to
@@ -110,7 +110,7 @@ public void Run(GoogleAdsClient client, long customerId)
private string CreateFeed(GoogleAdsClient client, long customerId)
{
// Get the FeedService.
- FeedServiceClient feedService = client.GetService(Services.V15.FeedService);
+ FeedServiceClient feedService = client.GetService(Services.V16.FeedService);
// Creates a Listing ID attribute.
FeedAttribute listingIdAttribute = new FeedAttribute()
@@ -199,7 +199,7 @@ public Dictionary GetFeed(
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
// Constructs the query.
string query = $"SELECT feed.attributes FROM feed WHERE feed.resource_name = " +
@@ -270,7 +270,7 @@ private void CreateFeedMapping(GoogleAdsClient client, long customerId,
{
// Get the FeedMappingServiceClient.
FeedMappingServiceClient feedMappingService = client.GetService(
- Services.V15.FeedMappingService);
+ Services.V16.FeedMappingService);
// Maps the FeedAttributeIds to the placeholder values. The FeedAttributeId is the
// ID of the FeedAttribute created in the CreatedFeed method. This can be thought of
@@ -359,7 +359,7 @@ private void CreateFeedItem(GoogleAdsClient client, long customerId,
{
// Get the FeedItemServiceClient.
FeedItemServiceClient feedItemService = client.GetService(
- Services.V15.FeedItemService);
+ Services.V16.FeedItemService);
// Creates the listing ID feed attribute value.
FeedItemAttributeValue listingId = new FeedItemAttributeValue()
diff --git a/Google.Ads.GoogleAds/examples/Remarketing/SetUpAdvancedRemarketing.cs b/Google.Ads.GoogleAds/examples/Remarketing/SetUpAdvancedRemarketing.cs
index 5725ec379..f0f144391 100644
--- a/Google.Ads.GoogleAds/examples/Remarketing/SetUpAdvancedRemarketing.cs
+++ b/Google.Ads.GoogleAds/examples/Remarketing/SetUpAdvancedRemarketing.cs
@@ -15,20 +15,20 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.UserListDateRuleItemOperatorEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.UserListMembershipStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.UserListNumberRuleItemOperatorEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.UserListPrepopulationStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.UserListStringRuleItemOperatorEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.UserListDateRuleItemOperatorEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.UserListMembershipStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.UserListNumberRuleItemOperatorEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.UserListPrepopulationStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.UserListStringRuleItemOperatorEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// Creates a rule-based user list defined by an expression rule for users who have either
@@ -81,7 +81,7 @@ public void Run(GoogleAdsClient client, long customerId)
{
// Get the user list service client.
UserListServiceClient userListServiceClient =
- client.GetService(Services.V15.UserListService);
+ client.GetService(Services.V16.UserListService);
try
{
diff --git a/Google.Ads.GoogleAds/examples/Remarketing/SetUpRemarketing.cs b/Google.Ads.GoogleAds/examples/Remarketing/SetUpRemarketing.cs
index 35b76d868..32ab01b2a 100644
--- a/Google.Ads.GoogleAds/examples/Remarketing/SetUpRemarketing.cs
+++ b/Google.Ads.GoogleAds/examples/Remarketing/SetUpRemarketing.cs
@@ -16,19 +16,19 @@
using Google.Ads.Gax.Examples;
using Google.Ads.Gax.Util;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.UserListMembershipStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.UserListPrepopulationStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.UserListStringRuleItemOperatorEnum.Types;
-using static Google.Ads.GoogleAds.V15.Errors.CriterionErrorEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.UserListMembershipStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.UserListPrepopulationStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.UserListStringRuleItemOperatorEnum.Types;
+using static Google.Ads.GoogleAds.V16.Errors.CriterionErrorEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// Demonstrates various operations involved in remarketing, including:
@@ -176,7 +176,7 @@ private string CreateUserList(GoogleAdsClient client, long customerId)
{
// Get the UserListService client.
UserListServiceClient userListServiceClient =
- client.GetService(Services.V15.UserListService);
+ client.GetService(Services.V16.UserListService);
// Create a rule targeting any user that visited a url containing 'example.com'.
UserListRuleItemInfo rule = new UserListRuleItemInfo
@@ -250,7 +250,7 @@ private string TargetAdsInAdGroupToUserList(
{
// Get the AdGroupCriterionService client.
AdGroupCriterionServiceClient adGroupCriterionServiceClient = client.GetService
- (Services.V15.AdGroupCriterionService);
+ (Services.V16.AdGroupCriterionService);
// Create the ad group criterion targeting members of the user list.
AdGroupCriterion adGroupCriterion = new AdGroupCriterion
@@ -297,7 +297,7 @@ private void ModifyAdGroupBids(
{
// Get the AdGroupCriterionService client.
AdGroupCriterionServiceClient adGroupCriterionServiceClient =
- client.GetService(Services.V15.AdGroupCriterionService);
+ client.GetService(Services.V16.AdGroupCriterionService);
// Create the ad group criterion with a bid modifier. You may alternatively set the bid
// for the ad group criterion directly.
@@ -335,7 +335,7 @@ private void RemoveExistingListCriteriaFromAdGroup(GoogleAdsClient client, long
{
// Get the AdGroupCriterionService client.
AdGroupCriterionServiceClient adGroupCriterionServiceClient =
- client.GetService(Services.V15.AdGroupCriterionService);
+ client.GetService(Services.V16.AdGroupCriterionService);
// Retrieve all of the ad group criteria under a campaign.
List adGroupCriteria =
@@ -373,7 +373,7 @@ private List GetUserListAdGroupCriteria(
{
// Get the GoogleAdsService client.
GoogleAdsServiceClient googleAdsServiceClient =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
List userListCriteriaResourceNames = new List();
@@ -419,7 +419,7 @@ private string TargetAdsInCampaignToUserList(
{
// Get the CampaignCriterionService client.
CampaignCriterionServiceClient campaignCriterionServiceClient =
- client.GetService(Services.V15.CampaignCriterionService);
+ client.GetService(Services.V16.CampaignCriterionService);
// Create the campaign criterion.
CampaignCriterion campaignCriterion = new CampaignCriterion
@@ -467,7 +467,7 @@ private void ModifyCampaignBids(
{
// Get the CampaignCriterionService client.
CampaignCriterionServiceClient campaignCriterionServiceClient =
- client.GetService(Services.V15.CampaignCriterionService);
+ client.GetService(Services.V16.CampaignCriterionService);
// Create the campaign criterion to update.
CampaignCriterion campaignCriterion = new CampaignCriterion
diff --git a/Google.Ads.GoogleAds/examples/Remarketing/UpdateAudienceTargetRestriction.cs b/Google.Ads.GoogleAds/examples/Remarketing/UpdateAudienceTargetRestriction.cs
index adc87f79a..118dfdec6 100644
--- a/Google.Ads.GoogleAds/examples/Remarketing/UpdateAudienceTargetRestriction.cs
+++ b/Google.Ads.GoogleAds/examples/Remarketing/UpdateAudienceTargetRestriction.cs
@@ -16,18 +16,18 @@
using Google.Ads.Gax.Examples;
using Google.Ads.Gax.Util;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Api.Gax;
using Google.Protobuf.Collections;
using System;
using System.Collections.Generic;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.TargetingDimensionEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.TargetingDimensionEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example updates the AUDIENCE target restriction of a given ad group to bid only.
@@ -87,7 +87,7 @@ public void Run(GoogleAdsClient client, long customerId, long adGroupId)
{
// Get the GoogleAdsService client.
GoogleAdsServiceClient googleAdsServiceClient =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
// Create a search request that retrieves the targeting settings from a given ad group.
// [START update_audience_target_restriction]
@@ -198,7 +198,7 @@ private void UpdateTargetingSetting(GoogleAdsClient client, long customerId, lon
{
// Get the AdGroupService client.
AdGroupServiceClient adGroupServiceClient =
- client.GetService(Services.V15.AdGroupService);
+ client.GetService(Services.V16.AdGroupService);
// Create an ad group object with the updated targeting setting.
AdGroup adGroup = new AdGroup
diff --git a/Google.Ads.GoogleAds/examples/Remarketing/UploadCallConversion.cs b/Google.Ads.GoogleAds/examples/Remarketing/UploadCallConversion.cs
index a309016f4..d8d47ef26 100644
--- a/Google.Ads.GoogleAds/examples/Remarketing/UploadCallConversion.cs
+++ b/Google.Ads.GoogleAds/examples/Remarketing/UploadCallConversion.cs
@@ -15,14 +15,14 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.ConsentStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ConsentStatusEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example imports offline call conversion values for calls related to the
@@ -152,7 +152,7 @@ public void Run(GoogleAdsClient client, long customerId,
{
// Get the ConversionUploadService.
ConversionUploadServiceClient conversionUploadService =
- client.GetService(Services.V15.ConversionUploadService);
+ client.GetService(Services.V16.ConversionUploadService);
// Create a call conversion by specifying currency as USD.
CallConversion callConversion = new CallConversion()
diff --git a/Google.Ads.GoogleAds/examples/Remarketing/UploadConversionAdjustment.cs b/Google.Ads.GoogleAds/examples/Remarketing/UploadConversionAdjustment.cs
index c6e1aabe9..2fefee827 100644
--- a/Google.Ads.GoogleAds/examples/Remarketing/UploadConversionAdjustment.cs
+++ b/Google.Ads.GoogleAds/examples/Remarketing/UploadConversionAdjustment.cs
@@ -15,14 +15,14 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.ConversionAdjustmentTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ConversionAdjustmentTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example imports conversion adjustments for conversions that already exist.
@@ -128,7 +128,7 @@ public void Run(GoogleAdsClient client, long customerId, long conversionActionId
{
// Get the ConversionAdjustmentUploadService.
ConversionAdjustmentUploadServiceClient conversionAdjustmentUploadService =
- client.GetService(Services.V15.ConversionAdjustmentUploadService);
+ client.GetService(Services.V16.ConversionAdjustmentUploadService);
// Associate conversion adjustments with the existing conversion action.
// The GCLID should have been uploaded before with a conversion.
diff --git a/Google.Ads.GoogleAds/examples/Remarketing/UploadEnhancedConversionsForLeads.cs b/Google.Ads.GoogleAds/examples/Remarketing/UploadEnhancedConversionsForLeads.cs
index eda6fe51a..37824b8cf 100644
--- a/Google.Ads.GoogleAds/examples/Remarketing/UploadEnhancedConversionsForLeads.cs
+++ b/Google.Ads.GoogleAds/examples/Remarketing/UploadEnhancedConversionsForLeads.cs
@@ -15,16 +15,16 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Security.Cryptography;
using System.Text;
-using static Google.Ads.GoogleAds.V15.Enums.ConsentStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.UserIdentifierSourceEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ConsentStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.UserIdentifierSourceEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example uploads an enhanced conversion for leads by uploading a ClickConversion
@@ -129,7 +129,7 @@ public void Run(GoogleAdsClient client, long customerId, long conversionActionId
{
// Get the ConversionUploadService.
ConversionUploadServiceClient conversionUploadService =
- client.GetService(Services.V15.ConversionUploadService);
+ client.GetService(Services.V16.ConversionUploadService);
// [START create_conversion]
// Creates an empty click conversion.
diff --git a/Google.Ads.GoogleAds/examples/Remarketing/UploadEnhancedConversionsForWeb.cs b/Google.Ads.GoogleAds/examples/Remarketing/UploadEnhancedConversionsForWeb.cs
index 98876a9dd..c67786edb 100644
--- a/Google.Ads.GoogleAds/examples/Remarketing/UploadEnhancedConversionsForWeb.cs
+++ b/Google.Ads.GoogleAds/examples/Remarketing/UploadEnhancedConversionsForWeb.cs
@@ -15,18 +15,18 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
-using static Google.Ads.GoogleAds.V15.Enums.ConversionAdjustmentTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.UserIdentifierSourceEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ConversionAdjustmentTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.UserIdentifierSourceEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example enhances a web conversion by uploading a {@link ConversionAdjustment}
@@ -122,7 +122,7 @@ public void Run(GoogleAdsClient client, long customerId, long conversionActionId
{
// Get the ConversionAdjustmentUploadService.
ConversionAdjustmentUploadServiceClient conversionAdjustmentUploadService =
- client.GetService(Services.V15.ConversionAdjustmentUploadService);
+ client.GetService(Services.V16.ConversionAdjustmentUploadService);
// [START create_adjustment]
// Creates the enhancement adjustment.
diff --git a/Google.Ads.GoogleAds/examples/Remarketing/UploadOfflineConversion.cs b/Google.Ads.GoogleAds/examples/Remarketing/UploadOfflineConversion.cs
index 74eae9172..f77ac9863 100644
--- a/Google.Ads.GoogleAds/examples/Remarketing/UploadOfflineConversion.cs
+++ b/Google.Ads.GoogleAds/examples/Remarketing/UploadOfflineConversion.cs
@@ -15,14 +15,14 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.ConsentStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ConsentStatusEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example imports offline conversion values for specific clicks to your account.
@@ -145,7 +145,7 @@ public void Run(GoogleAdsClient client, long customerId, long conversionActionId
{
// Get the ConversionActionService.
ConversionUploadServiceClient conversionUploadService =
- client.GetService(Services.V15.ConversionUploadService);
+ client.GetService(Services.V16.ConversionUploadService);
// Creates a click conversion by specifying currency as USD.
ClickConversion clickConversion = new ClickConversion()
diff --git a/Google.Ads.GoogleAds/examples/Remarketing/UploadStoreSalesTransactions.cs b/Google.Ads.GoogleAds/examples/Remarketing/UploadStoreSalesTransactions.cs
index b4c4347ff..ec81f0af7 100644
--- a/Google.Ads.GoogleAds/examples/Remarketing/UploadStoreSalesTransactions.cs
+++ b/Google.Ads.GoogleAds/examples/Remarketing/UploadStoreSalesTransactions.cs
@@ -20,15 +20,15 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
-using static Google.Ads.GoogleAds.V15.Enums.ConsentStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.OfflineUserDataJobStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.OfflineUserDataJobTypeEnum.Types;
-
-namespace Google.Ads.GoogleAds.Examples.V15
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
+using static Google.Ads.GoogleAds.V16.Enums.ConsentStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.OfflineUserDataJobStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.OfflineUserDataJobTypeEnum.Types;
+
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example uploads offline data for store sales transactions.
@@ -264,7 +264,7 @@ public void Run(GoogleAdsClient client, long customerId, long conversionActionId
{
// Get the OfflineUserDataJobServiceClient.
OfflineUserDataJobServiceClient offlineUserDataJobServiceClient =
- client.GetService(Services.V15.OfflineUserDataJobService);
+ client.GetService(Services.V16.OfflineUserDataJobService);
// Ensure that a valid job type is provided.
if (offlineUserDataJobType != OfflineUserDataJobType.StoreSalesUploadFirstParty &
@@ -726,7 +726,7 @@ private void CheckJobStatus(GoogleAdsClient client, long customerId,
string offlineUserDataJobResourceName)
{
GoogleAdsServiceClient googleAdsServiceClient =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
string query = $@"SELECT offline_user_data_job.resource_name,
offline_user_data_job.id,
diff --git a/Google.Ads.GoogleAds/examples/Reporting/ParallelReportDownload.cs b/Google.Ads.GoogleAds/examples/Reporting/ParallelReportDownload.cs
index 9543d0369..29d7fdff7 100644
--- a/Google.Ads.GoogleAds/examples/Reporting/ParallelReportDownload.cs
+++ b/Google.Ads.GoogleAds/examples/Reporting/ParallelReportDownload.cs
@@ -15,15 +15,15 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// Shows how to download a set of reports from a list of accounts in parallel. If you need
@@ -109,7 +109,7 @@ public void Run(GoogleAdsClient client, long[] customerIds, long? loginCustomerI
// Get the GoogleAdsService. A single client can be shared by all threads.
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
try
{
diff --git a/Google.Ads.GoogleAds/examples/ShoppingAds/AddListingScope.cs b/Google.Ads.GoogleAds/examples/ShoppingAds/AddListingScope.cs
index c1fd65cd7..37b9fd077 100644
--- a/Google.Ads.GoogleAds/examples/ShoppingAds/AddListingScope.cs
+++ b/Google.Ads.GoogleAds/examples/ShoppingAds/AddListingScope.cs
@@ -15,16 +15,16 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.ProductCustomAttributeIndexEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.ProductTypeLevelEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ProductCustomAttributeIndexEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ProductTypeLevelEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example adds a shopping listing scope to a shopping campaign. The example will
@@ -101,7 +101,7 @@ public void Run(GoogleAdsClient client, long customerId, long campaignId)
{
// Get the CampaignCriterionService.
CampaignCriterionServiceClient campaignCriterionService =
- client.GetService(Services.V15.CampaignCriterionService);
+ client.GetService(Services.V16.CampaignCriterionService);
// A listing scope allows you to filter the products that will be included in a given
// campaign. You can specify multiple dimensions with conditions that must be met for
diff --git a/Google.Ads.GoogleAds/examples/ShoppingAds/AddPerformanceMaxProductListingGroupTree.cs b/Google.Ads.GoogleAds/examples/ShoppingAds/AddPerformanceMaxProductListingGroupTree.cs
index 8c1571a91..4d56b5bc5 100644
--- a/Google.Ads.GoogleAds/examples/ShoppingAds/AddPerformanceMaxProductListingGroupTree.cs
+++ b/Google.Ads.GoogleAds/examples/ShoppingAds/AddPerformanceMaxProductListingGroupTree.cs
@@ -15,19 +15,19 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Api.Gax;
using System;
using System.Collections.Generic;
using System.Threading;
-using static Google.Ads.GoogleAds.V15.Enums.ListingGroupFilterListingSourceEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.ListingGroupFilterProductConditionEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.ListingGroupFilterTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Resources.ListingGroupFilterDimension.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ListingGroupFilterListingSourceEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ListingGroupFilterProductConditionEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ListingGroupFilterTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Resources.ListingGroupFilterDimension.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This example shows how to add product partitions to a Performance Max retail campaign.
@@ -453,7 +453,7 @@ public void Run(
bool replaceExistingTree)
{
GoogleAdsServiceClient googleAdsServiceClient =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
string assetGroupResourceName = ResourceNames.AssetGroup(customerId, assetGroupId);
@@ -612,7 +612,7 @@ private List
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
SearchGoogleAdsRequest request = new SearchGoogleAdsRequest()
{
diff --git a/Google.Ads.GoogleAds/examples/ShoppingAds/AddPerformanceMaxRetailCampaign.cs b/Google.Ads.GoogleAds/examples/ShoppingAds/AddPerformanceMaxRetailCampaign.cs
index 8ad066137..19a0ee56f 100644
--- a/Google.Ads.GoogleAds/examples/ShoppingAds/AddPerformanceMaxRetailCampaign.cs
+++ b/Google.Ads.GoogleAds/examples/ShoppingAds/AddPerformanceMaxRetailCampaign.cs
@@ -17,27 +17,27 @@
using Google.Ads.Gax.Util;
using Google.Ads.GoogleAds.Config;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Api.Gax;
using Google.Protobuf;
using System;
using System.Collections.Generic;
using System.Threading;
-using static Google.Ads.GoogleAds.V15.Enums.AdvertisingChannelTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AssetFieldTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AssetGroupStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.BudgetDeliveryMethodEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CampaignStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.ConversionActionCategoryEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.ConversionOriginEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.ListingGroupFilterListingSourceEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.ListingGroupFilterTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Resources.Campaign.Types;
-
-namespace Google.Ads.GoogleAds.Examples.V15
+using static Google.Ads.GoogleAds.V16.Enums.AdvertisingChannelTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AssetFieldTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AssetGroupStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.BudgetDeliveryMethodEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CampaignStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ConversionActionCategoryEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ConversionOriginEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ListingGroupFilterListingSourceEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ListingGroupFilterTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Resources.Campaign.Types;
+
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This example shows how to create a Performance Max retail campaign.
@@ -167,7 +167,7 @@ public void Run(
{
// [START add_performance_max_retail_campaign_1]
GoogleAdsServiceClient googleAdsServiceClient =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
// This campaign will override the customer conversion goals.
// Retrieve the current list of customer conversion goals.
@@ -528,7 +528,7 @@ private List CreateMultipleTextAssets(
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsServiceClient =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
MutateGoogleAdsRequest request = new MutateGoogleAdsRequest()
{
@@ -874,7 +874,7 @@ private List GetCustomerConversionGoals(
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsServiceClient =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
List conversionGoals = new List();
diff --git a/Google.Ads.GoogleAds/examples/ShoppingAds/AddShoppingProductAd.cs b/Google.Ads.GoogleAds/examples/ShoppingAds/AddShoppingProductAd.cs
index 36732fa94..c6dd37727 100644
--- a/Google.Ads.GoogleAds/examples/ShoppingAds/AddShoppingProductAd.cs
+++ b/Google.Ads.GoogleAds/examples/ShoppingAds/AddShoppingProductAd.cs
@@ -15,23 +15,23 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupAdStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupCriterionStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdvertisingChannelTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.BudgetDeliveryMethodEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CampaignStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.ListingGroupTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Resources.Campaign.Types;
-
-namespace Google.Ads.GoogleAds.Examples.V15
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupAdStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupCriterionStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdvertisingChannelTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.BudgetDeliveryMethodEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CampaignStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ListingGroupTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Resources.Campaign.Types;
+
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example creates a standard shopping campaign, a shopping product ad group and a
@@ -163,7 +163,7 @@ private string AddCampaignBudget(GoogleAdsClient client, long customerId)
{
// Get the CampaignBudgetService.
CampaignBudgetServiceClient campaignBudgetService =
- client.GetService(Services.V15.CampaignBudgetService);
+ client.GetService(Services.V16.CampaignBudgetService);
CampaignBudget budget = new CampaignBudget()
{
@@ -202,7 +202,7 @@ private string AddStandardShoppingCampaign(GoogleAdsClient client, long customer
{
// Get the CampaignService.
CampaignServiceClient campaignService =
- client.GetService(Services.V15.CampaignService);
+ client.GetService(Services.V16.CampaignService);
// Configures the shopping settings.
ShoppingSetting shoppingSetting = new ShoppingSetting()
@@ -283,7 +283,7 @@ private string AddProductShoppingAdGroup(GoogleAdsClient client, long customerId
string campaignResourceName)
{
// Get the AdGroupService.
- AdGroupServiceClient adGroupService = client.GetService(Services.V15.AdGroupService);
+ AdGroupServiceClient adGroupService = client.GetService(Services.V16.AdGroupService);
// Creates an ad group.
AdGroup adGroup = new AdGroup()
@@ -330,7 +330,7 @@ private string AddProductShoppingAdGroupAd(GoogleAdsClient client, long customer
{
// Get the AdGroupAdService.
AdGroupAdServiceClient adGroupAdService = client.GetService(
- Services.V15.AdGroupAdService);
+ Services.V16.AdGroupAdService);
// Creates a new shopping product ad.
Ad ad = new Ad()
@@ -386,7 +386,7 @@ private string AddDefaultShoppingListingGroup(GoogleAdsClient client, long custo
{
// Get the AdGroupCriterionService.
AdGroupCriterionServiceClient adGroupCriterionService = client.GetService(
- Services.V15.AdGroupCriterionService);
+ Services.V16.AdGroupCriterionService);
// Creates a new ad group criterion. This will contain the "default" listing group (All
// products).
diff --git a/Google.Ads.GoogleAds/examples/ShoppingAds/AddShoppingProductListingGroupTree.cs b/Google.Ads.GoogleAds/examples/ShoppingAds/AddShoppingProductListingGroupTree.cs
index 2b9e028d9..e189bc87b 100644
--- a/Google.Ads.GoogleAds/examples/ShoppingAds/AddShoppingProductListingGroupTree.cs
+++ b/Google.Ads.GoogleAds/examples/ShoppingAds/AddShoppingProductListingGroupTree.cs
@@ -15,18 +15,18 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
using System.Linq;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupCriterionStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.ListingGroupTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.ProductConditionEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupCriterionStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ListingGroupTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ProductConditionEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example shows how to add a shopping listing group tree to a shopping ad group.
@@ -128,7 +128,7 @@ public void Run(GoogleAdsClient client, long customerId, long adGroupId,
{
// Get the AdGroupCriterionService.
AdGroupCriterionServiceClient adGroupCriterionService =
- client.GetService(Services.V15.AdGroupCriterionService);
+ client.GetService(Services.V16.AdGroupCriterionService);
try
{
@@ -329,11 +329,11 @@ private void RemoveListingGroupTree(GoogleAdsClient client, long customerId,
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService = client.GetService(
- Services.V15.GoogleAdsService);
+ Services.V16.GoogleAdsService);
// Get the AdGroupCriterionService.
AdGroupCriterionServiceClient adGroupCriterionService =
- client.GetService(Services.V15.AdGroupCriterionService);
+ client.GetService(Services.V16.AdGroupCriterionService);
String searchQuery = "SELECT ad_group_criterion.resource_name FROM " +
"ad_group_criterion WHERE ad_group_criterion.type = LISTING_GROUP AND " +
diff --git a/Google.Ads.GoogleAds/examples/ShoppingAds/GetProductCategoryConstants.cs b/Google.Ads.GoogleAds/examples/ShoppingAds/GetProductCategoryConstants.cs
index e3bbeae61..aca420b0a 100644
--- a/Google.Ads.GoogleAds/examples/ShoppingAds/GetProductCategoryConstants.cs
+++ b/Google.Ads.GoogleAds/examples/ShoppingAds/GetProductCategoryConstants.cs
@@ -16,14 +16,14 @@
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Extensions.Config;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
using System.Linq;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example fetches the set of valid ProductCategories.
@@ -127,7 +127,7 @@ public void Run(GoogleAdsClient client, long customerId)
{
// Get the GoogleAdsServiceClient .
GoogleAdsServiceClient googleAdsService =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
// Creates the query.
string query = "SELECT product_category_constant.localizations, " +
diff --git a/Google.Ads.GoogleAds/examples/Targeting/AddCampaignTargetingCriteria.cs b/Google.Ads.GoogleAds/examples/Targeting/AddCampaignTargetingCriteria.cs
index 17c59708c..e97feb3cd 100644
--- a/Google.Ads.GoogleAds/examples/Targeting/AddCampaignTargetingCriteria.cs
+++ b/Google.Ads.GoogleAds/examples/Targeting/AddCampaignTargetingCriteria.cs
@@ -15,16 +15,16 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.KeywordMatchTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.ProximityRadiusUnitsEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.KeywordMatchTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ProximityRadiusUnitsEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example illustrates adding campaign targeting criteria.
@@ -102,7 +102,7 @@ public void Run(GoogleAdsClient client, long customerId, long campaignId,
{
// Get the CampaignCriterionService.
CampaignCriterionServiceClient campaignCriterionService =
- client.GetService(Services.V15.CampaignCriterionService);
+ client.GetService(Services.V16.CampaignCriterionService);
// Set the Campaign Resource Name
string campaignResourceName = ResourceNames.Campaign(customerId, campaignId);
diff --git a/Google.Ads.GoogleAds/examples/Targeting/AddCustomerNegativeCriteria.cs b/Google.Ads.GoogleAds/examples/Targeting/AddCustomerNegativeCriteria.cs
index 5d0eb04ed..8cda89b8a 100644
--- a/Google.Ads.GoogleAds/examples/Targeting/AddCustomerNegativeCriteria.cs
+++ b/Google.Ads.GoogleAds/examples/Targeting/AddCustomerNegativeCriteria.cs
@@ -15,15 +15,15 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.ContentLabelTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ContentLabelTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example adds various types of negative criteria as exclusions at the customer
@@ -73,7 +73,7 @@ public void Run(GoogleAdsClient client, long customerId)
{
// Get the CustomerNegativeCriterionServiceClient .
CustomerNegativeCriterionServiceClient customerNegativeCriterionService =
- client.GetService(Services.V15.CustomerNegativeCriterionService);
+ client.GetService(Services.V16.CustomerNegativeCriterionService);
// Creates a negative customer criterion excluding the content label type of 'TRAGEDY'.
CustomerNegativeCriterion tragedyCriterion = new CustomerNegativeCriterion()
diff --git a/Google.Ads.GoogleAds/examples/Targeting/AddDemographicTargetingCriteria.cs b/Google.Ads.GoogleAds/examples/Targeting/AddDemographicTargetingCriteria.cs
index 23925b016..15939281f 100644
--- a/Google.Ads.GoogleAds/examples/Targeting/AddDemographicTargetingCriteria.cs
+++ b/Google.Ads.GoogleAds/examples/Targeting/AddDemographicTargetingCriteria.cs
@@ -15,16 +15,16 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.AgeRangeTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.GenderTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AgeRangeTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.GenderTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example adds demographic criteria to an ad group. To get ad groups,
@@ -84,7 +84,7 @@ public void Run(GoogleAdsClient client, long customerId, long adGroupId)
{
// Get the AdGroupCriterionService.
AdGroupCriterionServiceClient adGroupCriterionService =
- client.GetService(Services.V15.AdGroupCriterionService);
+ client.GetService(Services.V16.AdGroupCriterionService);
string adGroupResourceName = ResourceNames.AdGroup(customerId, adGroupId);
diff --git a/Google.Ads.GoogleAds/examples/Targeting/GetGeoTargetConstantsByNames.cs b/Google.Ads.GoogleAds/examples/Targeting/GetGeoTargetConstantsByNames.cs
index fcee43f40..2d59b5457 100644
--- a/Google.Ads.GoogleAds/examples/Targeting/GetGeoTargetConstantsByNames.cs
+++ b/Google.Ads.GoogleAds/examples/Targeting/GetGeoTargetConstantsByNames.cs
@@ -15,12 +15,12 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example illustrates getting GeoTargetConstants by given location names.
@@ -62,7 +62,7 @@ public void Run(GoogleAdsClient client)
{
// Get the GeoTargetConstantServiceClient.
GeoTargetConstantServiceClient geoService =
- client.GetService(Services.V15.GeoTargetConstantService);
+ client.GetService(Services.V16.GeoTargetConstantService);
// Locale is using ISO 639-1 format. If an invalid locale is given,
// 'en' is used by default.
diff --git a/Google.Ads.GoogleAds/examples/Travel/AddHotelAd.cs b/Google.Ads.GoogleAds/examples/Travel/AddHotelAd.cs
index d762de0d5..13b4dcf7d 100644
--- a/Google.Ads.GoogleAds/examples/Travel/AddHotelAd.cs
+++ b/Google.Ads.GoogleAds/examples/Travel/AddHotelAd.cs
@@ -15,21 +15,21 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupAdStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdvertisingChannelTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.BudgetDeliveryMethodEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CampaignStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Resources.Campaign.Types;
-
-namespace Google.Ads.GoogleAds.Examples.V15
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupAdStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdvertisingChannelTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.BudgetDeliveryMethodEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CampaignStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Resources.Campaign.Types;
+
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example creates a hotel campaign, a hotel ad group and hotel ad group ad.
@@ -149,7 +149,7 @@ private static string AddCampaignBudget(GoogleAdsClient client, long customerId)
{
// Get the CampaignBudgetService.
CampaignBudgetServiceClient service = client.GetService(
- Services.V15.CampaignBudgetService);
+ Services.V16.CampaignBudgetService);
// Create a campaign budget.
CampaignBudget budget = new CampaignBudget()
@@ -188,7 +188,7 @@ private static string AddHotelCampaign(GoogleAdsClient client, long customerId,
string budgetResourceName, long hotelCenterAccountId, long cpcBidCeilingMicroAmount)
{
// Get the CampaignService.
- CampaignServiceClient service = client.GetService(Services.V15.CampaignService);
+ CampaignServiceClient service = client.GetService(Services.V16.CampaignService);
// [START add_hotel_ad_1]
// Create a campaign.
@@ -254,7 +254,7 @@ private static string AddHotelAdGroup(GoogleAdsClient client, long customerId,
string campaignResourceName)
{
// Get the AdGroupService.
- AdGroupServiceClient service = client.GetService(Services.V15.AdGroupService);
+ AdGroupServiceClient service = client.GetService(Services.V16.AdGroupService);
// Create an ad group.
AdGroup adGroup = new AdGroup()
@@ -297,7 +297,7 @@ private static void AddHotelAdGroupAd(GoogleAdsClient client, long customerId,
string adGroupResourceName)
{
// Get the AdGroupAdService.
- AdGroupAdServiceClient service = client.GetService(Services.V15.AdGroupAdService);
+ AdGroupAdServiceClient service = client.GetService(Services.V16.AdGroupAdService);
// Create a new ad group ad and sets the hotel ad to it.
AdGroupAd adGroupAd = new AdGroupAd()
diff --git a/Google.Ads.GoogleAds/examples/Travel/AddHotelAdGroupBidModifiers.cs b/Google.Ads.GoogleAds/examples/Travel/AddHotelAdGroupBidModifiers.cs
index 723c869b1..d43024474 100644
--- a/Google.Ads.GoogleAds/examples/Travel/AddHotelAdGroupBidModifiers.cs
+++ b/Google.Ads.GoogleAds/examples/Travel/AddHotelAdGroupBidModifiers.cs
@@ -15,15 +15,15 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using DayOfWeek = Google.Ads.GoogleAds.V15.Enums.DayOfWeekEnum.Types.DayOfWeek;
+using DayOfWeek = Google.Ads.GoogleAds.V16.Enums.DayOfWeekEnum.Types.DayOfWeek;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This code example shows how to add ad group bid modifiers to a hotel ad group based on
@@ -82,7 +82,7 @@ public void Run(GoogleAdsClient client, long customerId, long adGroupId)
{
// Get the AdGroupBidModifierService.
AdGroupBidModifierServiceClient service = client.GetService(
- Services.V15.AdGroupBidModifierService);
+ Services.V16.AdGroupBidModifierService);
// Constructs the ad group resource name to use for each bid modifier.
string adGroupResourceName = ResourceNames.AdGroup(customerId, adGroupId);
diff --git a/Google.Ads.GoogleAds/examples/Travel/AddHotelListingGroupTree.cs b/Google.Ads.GoogleAds/examples/Travel/AddHotelListingGroupTree.cs
index 05147a44e..93be01512 100644
--- a/Google.Ads.GoogleAds/examples/Travel/AddHotelListingGroupTree.cs
+++ b/Google.Ads.GoogleAds/examples/Travel/AddHotelListingGroupTree.cs
@@ -15,16 +15,16 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupCriterionStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.ListingGroupTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupCriterionStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.ListingGroupTypeEnum.Types;
-namespace Google.Ads.GoogleAds.Examples.V15
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This example shows how to add a hotel listing group tree, which has two levels. The first
@@ -124,7 +124,7 @@ public void Run(GoogleAdsClient client, long customerId, long adGroupId,
{
// Get the AdGroupCriterionService client.
AdGroupCriterionServiceClient adGroupCriterionService =
- client.GetService(Services.V15.AdGroupCriterionService);
+ client.GetService(Services.V16.AdGroupCriterionService);
List operations = new List();
diff --git a/Google.Ads.GoogleAds/examples/Travel/AddPerformanceMaxForTravelGoalsCampaign.cs b/Google.Ads.GoogleAds/examples/Travel/AddPerformanceMaxForTravelGoalsCampaign.cs
index 23094ad00..85a1a13f7 100644
--- a/Google.Ads.GoogleAds/examples/Travel/AddPerformanceMaxForTravelGoalsCampaign.cs
+++ b/Google.Ads.GoogleAds/examples/Travel/AddPerformanceMaxForTravelGoalsCampaign.cs
@@ -17,22 +17,22 @@
using Google.Ads.Gax.Util;
using Google.Ads.GoogleAds.Config;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Protobuf;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.AdvertisingChannelTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AssetFieldTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AssetGroupStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AssetSetTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.BudgetDeliveryMethodEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CampaignStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.HotelAssetSuggestionStatusEnum.Types;
-
-namespace Google.Ads.GoogleAds.Examples.V15
+using static Google.Ads.GoogleAds.V16.Enums.AdvertisingChannelTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AssetFieldTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AssetGroupStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AssetSetTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.BudgetDeliveryMethodEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CampaignStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.HotelAssetSuggestionStatusEnum.Types;
+
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This example shows how to create a Performance Max for travel goals campaign. It also uses
@@ -258,7 +258,7 @@ public void Run(GoogleAdsClient client, long customerId, string placeId)
// Issues a mutate request to create everything and prints the results.
GoogleAdsServiceClient googleAdsServiceClient =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
MutateGoogleAdsResponse response =
googleAdsServiceClient.Mutate(customerId.ToString(), mutateOperations);
Console.WriteLine("Created the following entities for a campaign budget, a campaign, " +
@@ -279,7 +279,7 @@ private HotelAssetSuggestion GetHotelAssetSuggestion(GoogleAdsClient client,
{
// Get the TravelAssetSuggestionService client.
TravelAssetSuggestionServiceClient travelAssetSuggestionService =
- client.GetService(Services.V15.TravelAssetSuggestionService);
+ client.GetService(Services.V16.TravelAssetSuggestionService);
SuggestTravelAssetsRequest request = new SuggestTravelAssetsRequest
{
@@ -365,7 +365,7 @@ private List CreateMultipleTextAssets(GoogleAdsClient client, long custo
}
GoogleAdsServiceClient googleAdsService =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
MutateGoogleAdsResponse response =
googleAdsService.Mutate(customerId.ToString(), mutateOperations);
@@ -402,7 +402,7 @@ private string CreateHotelAssetSet(GoogleAdsClient client, long customerId)
}
};
- AssetSetServiceClient assetSetService = client.GetService(Services.V15.AssetSetService);
+ AssetSetServiceClient assetSetService = client.GetService(Services.V16.AssetSetService);
MutateAssetSetsResponse response = assetSetService.MutateAssetSets(
customerId.ToString(),
@@ -470,7 +470,7 @@ private string CreateHotelAsset(
// Issues a mutate request to create all entities.
GoogleAdsServiceClient googleAdsServiceClient =
- client.GetService(Services.V15.GoogleAdsService);
+ client.GetService(Services.V16.GoogleAdsService);
MutateGoogleAdsResponse response =
googleAdsServiceClient.Mutate(customerId.ToString(), mutateOperations);
diff --git a/Google.Ads.GoogleAds/examples/Travel/AddThingsToDoAd.cs b/Google.Ads.GoogleAds/examples/Travel/AddThingsToDoAd.cs
index c8c39af86..9a328818e 100644
--- a/Google.Ads.GoogleAds/examples/Travel/AddThingsToDoAd.cs
+++ b/Google.Ads.GoogleAds/examples/Travel/AddThingsToDoAd.cs
@@ -18,23 +18,23 @@
using Google.Ads.GoogleAds.Extensions.Config;
using Google.Ads.GoogleAds.Config;
using Google.Ads.GoogleAds.Lib;
-using Google.Ads.GoogleAds.V15.Common;
-using Google.Ads.GoogleAds.V15.Errors;
-using Google.Ads.GoogleAds.V15.Resources;
-using Google.Ads.GoogleAds.V15.Services;
+using Google.Ads.GoogleAds.V16.Common;
+using Google.Ads.GoogleAds.V16.Errors;
+using Google.Ads.GoogleAds.V16.Resources;
+using Google.Ads.GoogleAds.V16.Services;
using Google.Protobuf;
using System;
using System.Collections.Generic;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupAdStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdGroupTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdvertisingChannelTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.AdvertisingChannelSubTypeEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.BudgetDeliveryMethodEnum.Types;
-using static Google.Ads.GoogleAds.V15.Enums.CampaignStatusEnum.Types;
-using static Google.Ads.GoogleAds.V15.Resources.Campaign.Types;
-
-namespace Google.Ads.GoogleAds.Examples.V15
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupAdStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdGroupTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdvertisingChannelTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.AdvertisingChannelSubTypeEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.BudgetDeliveryMethodEnum.Types;
+using static Google.Ads.GoogleAds.V16.Enums.CampaignStatusEnum.Types;
+using static Google.Ads.GoogleAds.V16.Resources.Campaign.Types;
+
+namespace Google.Ads.GoogleAds.Examples.V16
{
///
/// This example creates a Things to do campaign, an ad group and a Things to do ad.
@@ -120,7 +120,7 @@ private static string CreateBudget(GoogleAdsClient client, long customerId)
{
// Get the BudgetService.
CampaignBudgetServiceClient budgetService = client.GetService(
- Services.V15.CampaignBudgetService);
+ Services.V16.CampaignBudgetService);
// Create the campaign budget.
CampaignBudget budget = new CampaignBudget()
@@ -156,7 +156,7 @@ private static string CreateThingsToDoCampaign(GoogleAdsClient client, long cust
{
// Get the CampaignService.
- CampaignServiceClient campaignService = client.GetService(Services.V15.CampaignService);
+ CampaignServiceClient campaignService = client.GetService(Services.V16.CampaignService);
// [START add_things_to_do_ad]
// Creates a campaign.
@@ -212,7 +212,7 @@ private static string CreateAdGroup(GoogleAdsClient client, long customerId,
string campaign)
{
// Get the AdGroupService.
- AdGroupServiceClient adGroupService = client.GetService(Services.V15.AdGroupService);
+ AdGroupServiceClient adGroupService = client.GetService(Services.V16.AdGroupService);
// Create the ad group.
AdGroup adGroup = new AdGroup()
@@ -249,7 +249,7 @@ private static void CreateAdGroupAd(GoogleAdsClient client, long customerId,
// Get the AdGroupAdService.
AdGroupAdServiceClient adGroupAdService =
- client.GetService(Services.V15.AdGroupAdService);
+ client.GetService(Services.V16.AdGroupAdService);
// Creates a new ad group ad and sets a travel ad info.
AdGroupAd adGroupAd = new AdGroupAd()
diff --git a/Google.Ads.GoogleAds/src/Google.Ads.GoogleAds.csproj b/Google.Ads.GoogleAds/src/Google.Ads.GoogleAds.csproj
index 2263d3412..ea2da9ee9 100644
--- a/Google.Ads.GoogleAds/src/Google.Ads.GoogleAds.csproj
+++ b/Google.Ads.GoogleAds/src/Google.Ads.GoogleAds.csproj
@@ -3,7 +3,7 @@
Google Ads API Dotnet Client Library
Google.Ads.GoogleAds
- 18.0.0
+ 18.1.0
This library provides you with functionality to access the Google Ads API. The Google Ads API is the modern programmatic interface to Google Ads and the next generation of the AdWords API. See https://developers.google.com/google-ads/api to learn more about Google Ads API.
https://github.com/googleads/google-ads-dotnet/blob/master/ChangeLog
GoogleAds Google
@@ -30,8 +30,8 @@
true
true
true
- 18.0.0
- 18.0.0
+ 18.1.0
+ 18.1.0
latest
@@ -40,7 +40,7 @@
-
+
diff --git a/Google.Ads.GoogleAds/src/V16/AccessInvitationError.g.cs b/Google.Ads.GoogleAds/src/V16/AccessInvitationError.g.cs
new file mode 100755
index 000000000..2551d5950
--- /dev/null
+++ b/Google.Ads.GoogleAds/src/V16/AccessInvitationError.g.cs
@@ -0,0 +1,269 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/ads/googleads/v16/errors/access_invitation_error.proto
+//
+#pragma warning disable 1591, 0612, 3021, 8981
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Google.Ads.GoogleAds.V16.Errors {
+
+ /// Holder for reflection information generated from google/ads/googleads/v16/errors/access_invitation_error.proto
+ public static partial class AccessInvitationErrorReflection {
+
+ #region Descriptor
+ /// File descriptor for google/ads/googleads/v16/errors/access_invitation_error.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static AccessInvitationErrorReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "Cj1nb29nbGUvYWRzL2dvb2dsZWFkcy92MTYvZXJyb3JzL2FjY2Vzc19pbnZp",
+ "dGF0aW9uX2Vycm9yLnByb3RvEh9nb29nbGUuYWRzLmdvb2dsZWFkcy52MTYu",
+ "ZXJyb3JzIvMCChlBY2Nlc3NJbnZpdGF0aW9uRXJyb3JFbnVtItUCChVBY2Nl",
+ "c3NJbnZpdGF0aW9uRXJyb3ISDwoLVU5TUEVDSUZJRUQQABILCgdVTktOT1dO",
+ "EAESGQoVSU5WQUxJRF9FTUFJTF9BRERSRVNTEAISJAogRU1BSUxfQUREUkVT",
+ "U19BTFJFQURZX0hBU19BQ0NFU1MQAxIdChlJTlZBTElEX0lOVklUQVRJT05f",
+ "U1RBVFVTEAQSJwojR09PR0xFX0NPTlNVTUVSX0FDQ09VTlRfTk9UX0FMTE9X",
+ "RUQQBRIZChVJTlZBTElEX0lOVklUQVRJT05fSUQQBhIwCixFTUFJTF9BRERS",
+ "RVNTX0FMUkVBRFlfSEFTX1BFTkRJTkdfSU5WSVRBVElPThAHEiYKIlBFTkRJ",
+ "TkdfSU5WSVRBVElPTlNfTElNSVRfRVhDRUVERUQQCBIgChxFTUFJTF9ET01B",
+ "SU5fUE9MSUNZX1ZJT0xBVEVEEAlC+gEKI2NvbS5nb29nbGUuYWRzLmdvb2ds",
+ "ZWFkcy52MTYuZXJyb3JzQhpBY2Nlc3NJbnZpdGF0aW9uRXJyb3JQcm90b1AB",
+ "WkVnb29nbGUuZ29sYW5nLm9yZy9nZW5wcm90by9nb29nbGVhcGlzL2Fkcy9n",
+ "b29nbGVhZHMvdjE2L2Vycm9ycztlcnJvcnOiAgNHQUGqAh9Hb29nbGUuQWRz",
+ "Lkdvb2dsZUFkcy5WMTYuRXJyb3JzygIfR29vZ2xlXEFkc1xHb29nbGVBZHNc",
+ "VjE2XEVycm9yc+oCI0dvb2dsZTo6QWRzOjpHb29nbGVBZHM6OlYxNjo6RXJy",
+ "b3JzYgZwcm90bzM="));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { },
+ new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Ads.GoogleAds.V16.Errors.AccessInvitationErrorEnum), global::Google.Ads.GoogleAds.V16.Errors.AccessInvitationErrorEnum.Parser, null, null, new[]{ typeof(global::Google.Ads.GoogleAds.V16.Errors.AccessInvitationErrorEnum.Types.AccessInvitationError) }, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ ///
+ /// Container for enum describing possible AccessInvitation errors.
+ ///
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class AccessInvitationErrorEnum : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AccessInvitationErrorEnum());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Ads.GoogleAds.V16.Errors.AccessInvitationErrorReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public AccessInvitationErrorEnum() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public AccessInvitationErrorEnum(AccessInvitationErrorEnum other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public AccessInvitationErrorEnum Clone() {
+ return new AccessInvitationErrorEnum(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as AccessInvitationErrorEnum);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(AccessInvitationErrorEnum other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(AccessInvitationErrorEnum other) {
+ if (other == null) {
+ return;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ }
+ }
+ }
+ #endif
+
+ #region Nested types
+ /// Container for nested types declared in the AccessInvitationErrorEnum message type.
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static partial class Types {
+ ///
+ /// Enum describing possible AccessInvitation errors.
+ ///
+ public enum AccessInvitationError {
+ ///
+ /// Enum unspecified.
+ ///
+ [pbr::OriginalName("UNSPECIFIED")] Unspecified = 0,
+ ///
+ /// The received error code is not known in this version.
+ ///
+ [pbr::OriginalName("UNKNOWN")] Unknown = 1,
+ ///
+ /// The email address is invalid for sending an invitation.
+ ///
+ [pbr::OriginalName("INVALID_EMAIL_ADDRESS")] InvalidEmailAddress = 2,
+ ///
+ /// Email address already has access to this customer.
+ ///
+ [pbr::OriginalName("EMAIL_ADDRESS_ALREADY_HAS_ACCESS")] EmailAddressAlreadyHasAccess = 3,
+ ///
+ /// Invalid invitation status for the operation.
+ ///
+ [pbr::OriginalName("INVALID_INVITATION_STATUS")] InvalidInvitationStatus = 4,
+ ///
+ /// Email address cannot be like abc+foo@google.com.
+ ///
+ [pbr::OriginalName("GOOGLE_CONSUMER_ACCOUNT_NOT_ALLOWED")] GoogleConsumerAccountNotAllowed = 5,
+ ///
+ /// Invalid invitation ID.
+ ///
+ [pbr::OriginalName("INVALID_INVITATION_ID")] InvalidInvitationId = 6,
+ ///
+ /// Email address already has a pending invitation.
+ ///
+ [pbr::OriginalName("EMAIL_ADDRESS_ALREADY_HAS_PENDING_INVITATION")] EmailAddressAlreadyHasPendingInvitation = 7,
+ ///
+ /// Pending invitation limit exceeded for the customer.
+ ///
+ [pbr::OriginalName("PENDING_INVITATIONS_LIMIT_EXCEEDED")] PendingInvitationsLimitExceeded = 8,
+ ///
+ /// Email address doesn't conform to the email domain policy. See
+ /// https://support.google.com/google-ads/answer/2375456
+ ///
+ [pbr::OriginalName("EMAIL_DOMAIN_POLICY_VIOLATED")] EmailDomainPolicyViolated = 9,
+ }
+
+ }
+ #endregion
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/Google.Ads.GoogleAds/src/V16/AccessInvitationStatus.g.cs b/Google.Ads.GoogleAds/src/V16/AccessInvitationStatus.g.cs
new file mode 100755
index 000000000..eeb56738b
--- /dev/null
+++ b/Google.Ads.GoogleAds/src/V16/AccessInvitationStatus.g.cs
@@ -0,0 +1,244 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/ads/googleads/v16/enums/access_invitation_status.proto
+//
+#pragma warning disable 1591, 0612, 3021, 8981
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Google.Ads.GoogleAds.V16.Enums {
+
+ /// Holder for reflection information generated from google/ads/googleads/v16/enums/access_invitation_status.proto
+ public static partial class AccessInvitationStatusReflection {
+
+ #region Descriptor
+ /// File descriptor for google/ads/googleads/v16/enums/access_invitation_status.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static AccessInvitationStatusReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "Cj1nb29nbGUvYWRzL2dvb2dsZWFkcy92MTYvZW51bXMvYWNjZXNzX2ludml0",
+ "YXRpb25fc3RhdHVzLnByb3RvEh5nb29nbGUuYWRzLmdvb2dsZWFkcy52MTYu",
+ "ZW51bXMifAoaQWNjZXNzSW52aXRhdGlvblN0YXR1c0VudW0iXgoWQWNjZXNz",
+ "SW52aXRhdGlvblN0YXR1cxIPCgtVTlNQRUNJRklFRBAAEgsKB1VOS05PV04Q",
+ "ARILCgdQRU5ESU5HEAISDAoIREVDTElORUQQAxILCgdFWFBJUkVEEARC9QEK",
+ "ImNvbS5nb29nbGUuYWRzLmdvb2dsZWFkcy52MTYuZW51bXNCG0FjY2Vzc0lu",
+ "dml0YXRpb25TdGF0dXNQcm90b1ABWkNnb29nbGUuZ29sYW5nLm9yZy9nZW5w",
+ "cm90by9nb29nbGVhcGlzL2Fkcy9nb29nbGVhZHMvdjE2L2VudW1zO2VudW1z",
+ "ogIDR0FBqgIeR29vZ2xlLkFkcy5Hb29nbGVBZHMuVjE2LkVudW1zygIeR29v",
+ "Z2xlXEFkc1xHb29nbGVBZHNcVjE2XEVudW1z6gIiR29vZ2xlOjpBZHM6Okdv",
+ "b2dsZUFkczo6VjE2OjpFbnVtc2IGcHJvdG8z"));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { },
+ new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Ads.GoogleAds.V16.Enums.AccessInvitationStatusEnum), global::Google.Ads.GoogleAds.V16.Enums.AccessInvitationStatusEnum.Parser, null, null, new[]{ typeof(global::Google.Ads.GoogleAds.V16.Enums.AccessInvitationStatusEnum.Types.AccessInvitationStatus) }, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ ///
+ /// Container for enum for identifying the status of access invitation
+ ///
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class AccessInvitationStatusEnum : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AccessInvitationStatusEnum());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Ads.GoogleAds.V16.Enums.AccessInvitationStatusReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public AccessInvitationStatusEnum() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public AccessInvitationStatusEnum(AccessInvitationStatusEnum other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public AccessInvitationStatusEnum Clone() {
+ return new AccessInvitationStatusEnum(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as AccessInvitationStatusEnum);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(AccessInvitationStatusEnum other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(AccessInvitationStatusEnum other) {
+ if (other == null) {
+ return;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ }
+ }
+ }
+ #endif
+
+ #region Nested types
+ /// Container for nested types declared in the AccessInvitationStatusEnum message type.
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static partial class Types {
+ ///
+ /// Possible access invitation status of a user
+ ///
+ public enum AccessInvitationStatus {
+ ///
+ /// Not specified.
+ ///
+ [pbr::OriginalName("UNSPECIFIED")] Unspecified = 0,
+ ///
+ /// Used for return value only. Represents value unknown in this version.
+ ///
+ [pbr::OriginalName("UNKNOWN")] Unknown = 1,
+ ///
+ /// The initial state of an invitation, before being acted upon by anyone.
+ ///
+ [pbr::OriginalName("PENDING")] Pending = 2,
+ ///
+ /// Invitation process was terminated by the email recipient. No new user was
+ /// created.
+ ///
+ [pbr::OriginalName("DECLINED")] Declined = 3,
+ ///
+ /// Invitation URLs expired without being acted upon. No new user can be
+ /// created. Invitations expire 20 days after creation.
+ ///
+ [pbr::OriginalName("EXPIRED")] Expired = 4,
+ }
+
+ }
+ #endregion
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/Google.Ads.GoogleAds/src/V16/AccessReason.g.cs b/Google.Ads.GoogleAds/src/V16/AccessReason.g.cs
new file mode 100755
index 000000000..2df6f4df4
--- /dev/null
+++ b/Google.Ads.GoogleAds/src/V16/AccessReason.g.cs
@@ -0,0 +1,250 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/ads/googleads/v16/enums/access_reason.proto
+//
+#pragma warning disable 1591, 0612, 3021, 8981
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Google.Ads.GoogleAds.V16.Enums {
+
+ /// Holder for reflection information generated from google/ads/googleads/v16/enums/access_reason.proto
+ public static partial class AccessReasonReflection {
+
+ #region Descriptor
+ /// File descriptor for google/ads/googleads/v16/enums/access_reason.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static AccessReasonReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "CjJnb29nbGUvYWRzL2dvb2dsZWFkcy92MTYvZW51bXMvYWNjZXNzX3JlYXNv",
+ "bi5wcm90bxIeZ29vZ2xlLmFkcy5nb29nbGVhZHMudjE2LmVudW1zIoUBChBB",
+ "Y2Nlc3NSZWFzb25FbnVtInEKDEFjY2Vzc1JlYXNvbhIPCgtVTlNQRUNJRklF",
+ "RBAAEgsKB1VOS05PV04QARIJCgVPV05FRBACEgoKBlNIQVJFRBADEgwKCExJ",
+ "Q0VOU0VEEAQSDgoKU1VCU0NSSUJFRBAFEg4KCkFGRklMSUFURUQQBkLrAQoi",
+ "Y29tLmdvb2dsZS5hZHMuZ29vZ2xlYWRzLnYxNi5lbnVtc0IRQWNjZXNzUmVh",
+ "c29uUHJvdG9QAVpDZ29vZ2xlLmdvbGFuZy5vcmcvZ2VucHJvdG8vZ29vZ2xl",
+ "YXBpcy9hZHMvZ29vZ2xlYWRzL3YxNi9lbnVtcztlbnVtc6ICA0dBQaoCHkdv",
+ "b2dsZS5BZHMuR29vZ2xlQWRzLlYxNi5FbnVtc8oCHkdvb2dsZVxBZHNcR29v",
+ "Z2xlQWRzXFYxNlxFbnVtc+oCIkdvb2dsZTo6QWRzOjpHb29nbGVBZHM6OlYx",
+ "Njo6RW51bXNiBnByb3RvMw=="));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { },
+ new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Ads.GoogleAds.V16.Enums.AccessReasonEnum), global::Google.Ads.GoogleAds.V16.Enums.AccessReasonEnum.Parser, null, null, new[]{ typeof(global::Google.Ads.GoogleAds.V16.Enums.AccessReasonEnum.Types.AccessReason) }, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ ///
+ /// Indicates the way the resource such as user list is related to a user.
+ ///
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class AccessReasonEnum : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AccessReasonEnum());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Ads.GoogleAds.V16.Enums.AccessReasonReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public AccessReasonEnum() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public AccessReasonEnum(AccessReasonEnum other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public AccessReasonEnum Clone() {
+ return new AccessReasonEnum(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as AccessReasonEnum);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(AccessReasonEnum other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(AccessReasonEnum other) {
+ if (other == null) {
+ return;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ }
+ }
+ }
+ #endif
+
+ #region Nested types
+ /// Container for nested types declared in the AccessReasonEnum message type.
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static partial class Types {
+ ///
+ /// Enum describing possible access reasons.
+ ///
+ public enum AccessReason {
+ ///
+ /// Not specified.
+ ///
+ [pbr::OriginalName("UNSPECIFIED")] Unspecified = 0,
+ ///
+ /// Used for return value only. Represents value unknown in this version.
+ ///
+ [pbr::OriginalName("UNKNOWN")] Unknown = 1,
+ ///
+ /// The resource is owned by the user.
+ ///
+ [pbr::OriginalName("OWNED")] Owned = 2,
+ ///
+ /// The resource is shared to the user.
+ ///
+ [pbr::OriginalName("SHARED")] Shared = 3,
+ ///
+ /// The resource is licensed to the user.
+ ///
+ [pbr::OriginalName("LICENSED")] Licensed = 4,
+ ///
+ /// The user subscribed to the resource.
+ ///
+ [pbr::OriginalName("SUBSCRIBED")] Subscribed = 5,
+ ///
+ /// The resource is accessible to the user.
+ ///
+ [pbr::OriginalName("AFFILIATED")] Affiliated = 6,
+ }
+
+ }
+ #endregion
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/Google.Ads.GoogleAds/src/V16/AccessRole.g.cs b/Google.Ads.GoogleAds/src/V16/AccessRole.g.cs
new file mode 100755
index 000000000..a4238df7e
--- /dev/null
+++ b/Google.Ads.GoogleAds/src/V16/AccessRole.g.cs
@@ -0,0 +1,246 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/ads/googleads/v16/enums/access_role.proto
+//
+#pragma warning disable 1591, 0612, 3021, 8981
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Google.Ads.GoogleAds.V16.Enums {
+
+ /// Holder for reflection information generated from google/ads/googleads/v16/enums/access_role.proto
+ public static partial class AccessRoleReflection {
+
+ #region Descriptor
+ /// File descriptor for google/ads/googleads/v16/enums/access_role.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static AccessRoleReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "CjBnb29nbGUvYWRzL2dvb2dsZWFkcy92MTYvZW51bXMvYWNjZXNzX3JvbGUu",
+ "cHJvdG8SHmdvb2dsZS5hZHMuZ29vZ2xlYWRzLnYxNi5lbnVtcyJ0Cg5BY2Nl",
+ "c3NSb2xlRW51bSJiCgpBY2Nlc3NSb2xlEg8KC1VOU1BFQ0lGSUVEEAASCwoH",
+ "VU5LTk9XThABEgkKBUFETUlOEAISDAoIU1RBTkRBUkQQAxINCglSRUFEX09O",
+ "TFkQBBIOCgpFTUFJTF9PTkxZEAVC6QEKImNvbS5nb29nbGUuYWRzLmdvb2ds",
+ "ZWFkcy52MTYuZW51bXNCD0FjY2Vzc1JvbGVQcm90b1ABWkNnb29nbGUuZ29s",
+ "YW5nLm9yZy9nZW5wcm90by9nb29nbGVhcGlzL2Fkcy9nb29nbGVhZHMvdjE2",
+ "L2VudW1zO2VudW1zogIDR0FBqgIeR29vZ2xlLkFkcy5Hb29nbGVBZHMuVjE2",
+ "LkVudW1zygIeR29vZ2xlXEFkc1xHb29nbGVBZHNcVjE2XEVudW1z6gIiR29v",
+ "Z2xlOjpBZHM6Okdvb2dsZUFkczo6VjE2OjpFbnVtc2IGcHJvdG8z"));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { },
+ new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Ads.GoogleAds.V16.Enums.AccessRoleEnum), global::Google.Ads.GoogleAds.V16.Enums.AccessRoleEnum.Parser, null, null, new[]{ typeof(global::Google.Ads.GoogleAds.V16.Enums.AccessRoleEnum.Types.AccessRole) }, null, null)
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ ///
+ /// Container for enum describing possible access role for user.
+ ///
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class AccessRoleEnum : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AccessRoleEnum());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Ads.GoogleAds.V16.Enums.AccessRoleReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public AccessRoleEnum() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public AccessRoleEnum(AccessRoleEnum other) : this() {
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public AccessRoleEnum Clone() {
+ return new AccessRoleEnum(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as AccessRoleEnum);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(AccessRoleEnum other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(AccessRoleEnum other) {
+ if (other == null) {
+ return;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ }
+ }
+ }
+ #endif
+
+ #region Nested types
+ /// Container for nested types declared in the AccessRoleEnum message type.
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static partial class Types {
+ ///
+ /// Possible access role of a user.
+ ///
+ public enum AccessRole {
+ ///
+ /// Not specified.
+ ///
+ [pbr::OriginalName("UNSPECIFIED")] Unspecified = 0,
+ ///
+ /// Used for return value only. Represents value unknown in this version.
+ ///
+ [pbr::OriginalName("UNKNOWN")] Unknown = 1,
+ ///
+ /// Owns its account and can control the addition of other users.
+ ///
+ [pbr::OriginalName("ADMIN")] Admin = 2,
+ ///
+ /// Can modify campaigns, but can't affect other users.
+ ///
+ [pbr::OriginalName("STANDARD")] Standard = 3,
+ ///
+ /// Can view campaigns and account changes, but cannot make edits.
+ ///
+ [pbr::OriginalName("READ_ONLY")] ReadOnly = 4,
+ ///
+ /// Role for \"email only\" access. Represents an email recipient rather than
+ /// a true User entity.
+ ///
+ [pbr::OriginalName("EMAIL_ONLY")] EmailOnly = 5,
+ }
+
+ }
+ #endregion
+
+ }
+
+ #endregion
+
+}
+
+#endregion Designer generated code
diff --git a/Google.Ads.GoogleAds/src/V16/AccessibleBiddingStrategy.g.cs b/Google.Ads.GoogleAds/src/V16/AccessibleBiddingStrategy.g.cs
new file mode 100755
index 000000000..e2c7ce8a8
--- /dev/null
+++ b/Google.Ads.GoogleAds/src/V16/AccessibleBiddingStrategy.g.cs
@@ -0,0 +1,2304 @@
+//
+// Generated by the protocol buffer compiler. DO NOT EDIT!
+// source: google/ads/googleads/v16/resources/accessible_bidding_strategy.proto
+//
+#pragma warning disable 1591, 0612, 3021, 8981
+#region Designer generated code
+
+using pb = global::Google.Protobuf;
+using pbc = global::Google.Protobuf.Collections;
+using pbr = global::Google.Protobuf.Reflection;
+using scg = global::System.Collections.Generic;
+namespace Google.Ads.GoogleAds.V16.Resources {
+
+ /// Holder for reflection information generated from google/ads/googleads/v16/resources/accessible_bidding_strategy.proto
+ public static partial class AccessibleBiddingStrategyReflection {
+
+ #region Descriptor
+ /// File descriptor for google/ads/googleads/v16/resources/accessible_bidding_strategy.proto
+ public static pbr::FileDescriptor Descriptor {
+ get { return descriptor; }
+ }
+ private static pbr::FileDescriptor descriptor;
+
+ static AccessibleBiddingStrategyReflection() {
+ byte[] descriptorData = global::System.Convert.FromBase64String(
+ string.Concat(
+ "CkRnb29nbGUvYWRzL2dvb2dsZWFkcy92MTYvcmVzb3VyY2VzL2FjY2Vzc2li",
+ "bGVfYmlkZGluZ19zdHJhdGVneS5wcm90bxIiZ29vZ2xlLmFkcy5nb29nbGVh",
+ "ZHMudjE2LnJlc291cmNlcxo6Z29vZ2xlL2Fkcy9nb29nbGVhZHMvdjE2L2Vu",
+ "dW1zL2JpZGRpbmdfc3RyYXRlZ3lfdHlwZS5wcm90bxpFZ29vZ2xlL2Fkcy9n",
+ "b29nbGVhZHMvdjE2L2VudW1zL3RhcmdldF9pbXByZXNzaW9uX3NoYXJlX2xv",
+ "Y2F0aW9uLnByb3RvGh9nb29nbGUvYXBpL2ZpZWxkX2JlaGF2aW9yLnByb3Rv",
+ "Ghlnb29nbGUvYXBpL3Jlc291cmNlLnByb3RvIpAOChlBY2Nlc3NpYmxlQmlk",
+ "ZGluZ1N0cmF0ZWd5ElEKDXJlc291cmNlX25hbWUYASABKAlCOuBBA/pBNAoy",
+ "Z29vZ2xlYWRzLmdvb2dsZWFwaXMuY29tL0FjY2Vzc2libGVCaWRkaW5nU3Ry",
+ "YXRlZ3kSDwoCaWQYAiABKANCA+BBAxIRCgRuYW1lGAMgASgJQgPgQQMSXgoE",
+ "dHlwZRgEIAEoDjJLLmdvb2dsZS5hZHMuZ29vZ2xlYWRzLnYxNi5lbnVtcy5C",
+ "aWRkaW5nU3RyYXRlZ3lUeXBlRW51bS5CaWRkaW5nU3RyYXRlZ3lUeXBlQgPg",
+ "QQMSHgoRb3duZXJfY3VzdG9tZXJfaWQYBSABKANCA+BBAxIjChZvd25lcl9k",
+ "ZXNjcmlwdGl2ZV9uYW1lGAYgASgJQgPgQQMSfwoZbWF4aW1pemVfY29udmVy",
+ "c2lvbl92YWx1ZRgHIAEoCzJVLmdvb2dsZS5hZHMuZ29vZ2xlYWRzLnYxNi5y",
+ "ZXNvdXJjZXMuQWNjZXNzaWJsZUJpZGRpbmdTdHJhdGVneS5NYXhpbWl6ZUNv",
+ "bnZlcnNpb25WYWx1ZUID4EEDSAASdgoUbWF4aW1pemVfY29udmVyc2lvbnMY",
+ "CCABKAsyUS5nb29nbGUuYWRzLmdvb2dsZWFkcy52MTYucmVzb3VyY2VzLkFj",
+ "Y2Vzc2libGVCaWRkaW5nU3RyYXRlZ3kuTWF4aW1pemVDb252ZXJzaW9uc0ID",
+ "4EEDSAASYgoKdGFyZ2V0X2NwYRgJIAEoCzJHLmdvb2dsZS5hZHMuZ29vZ2xl",
+ "YWRzLnYxNi5yZXNvdXJjZXMuQWNjZXNzaWJsZUJpZGRpbmdTdHJhdGVneS5U",
+ "YXJnZXRDcGFCA+BBA0gAEnsKF3RhcmdldF9pbXByZXNzaW9uX3NoYXJlGAog",
+ "ASgLMlMuZ29vZ2xlLmFkcy5nb29nbGVhZHMudjE2LnJlc291cmNlcy5BY2Nl",
+ "c3NpYmxlQmlkZGluZ1N0cmF0ZWd5LlRhcmdldEltcHJlc3Npb25TaGFyZUID",
+ "4EEDSAASZAoLdGFyZ2V0X3JvYXMYCyABKAsySC5nb29nbGUuYWRzLmdvb2ds",
+ "ZWFkcy52MTYucmVzb3VyY2VzLkFjY2Vzc2libGVCaWRkaW5nU3RyYXRlZ3ku",
+ "VGFyZ2V0Um9hc0ID4EEDSAASZgoMdGFyZ2V0X3NwZW5kGAwgASgLMkkuZ29v",
+ "Z2xlLmFkcy5nb29nbGVhZHMudjE2LnJlc291cmNlcy5BY2Nlc3NpYmxlQmlk",
+ "ZGluZ1N0cmF0ZWd5LlRhcmdldFNwZW5kQgPgQQNIABozChdNYXhpbWl6ZUNv",
+ "bnZlcnNpb25WYWx1ZRIYCgt0YXJnZXRfcm9hcxgBIAEoAUID4EEDGjUKE01h",
+ "eGltaXplQ29udmVyc2lvbnMSHgoRdGFyZ2V0X2NwYV9taWNyb3MYAiABKANC",
+ "A+BBAxpGCglUYXJnZXRDcGESIwoRdGFyZ2V0X2NwYV9taWNyb3MYASABKANC",
+ "A+BBA0gAiAEBQhQKEl90YXJnZXRfY3BhX21pY3JvcxqYAgoVVGFyZ2V0SW1w",
+ "cmVzc2lvblNoYXJlEnYKCGxvY2F0aW9uGAEgASgOMl8uZ29vZ2xlLmFkcy5n",
+ "b29nbGVhZHMudjE2LmVudW1zLlRhcmdldEltcHJlc3Npb25TaGFyZUxvY2F0",
+ "aW9uRW51bS5UYXJnZXRJbXByZXNzaW9uU2hhcmVMb2NhdGlvbkID4EEDEiUK",
+ "GGxvY2F0aW9uX2ZyYWN0aW9uX21pY3JvcxgCIAEoA0gAiAEBEigKFmNwY19i",
+ "aWRfY2VpbGluZ19taWNyb3MYAyABKANCA+BBA0gBiAEBQhsKGV9sb2NhdGlv",
+ "bl9mcmFjdGlvbl9taWNyb3NCGQoXX2NwY19iaWRfY2VpbGluZ19taWNyb3Ma",
+ "OwoKVGFyZ2V0Um9hcxIdCgt0YXJnZXRfcm9hcxgBIAEoAUID4EEDSACIAQFC",
+ "DgoMX3RhcmdldF9yb2FzGpMBCgtUYXJnZXRTcGVuZBInChN0YXJnZXRfc3Bl",
+ "bmRfbWljcm9zGAEgASgDQgUYAeBBA0gAiAEBEigKFmNwY19iaWRfY2VpbGlu",
+ "Z19taWNyb3MYAiABKANCA+BBA0gBiAEBQhYKFF90YXJnZXRfc3BlbmRfbWlj",
+ "cm9zQhkKF19jcGNfYmlkX2NlaWxpbmdfbWljcm9zOoIB6kF/CjJnb29nbGVh",
+ "ZHMuZ29vZ2xlYXBpcy5jb20vQWNjZXNzaWJsZUJpZGRpbmdTdHJhdGVneRJJ",
+ "Y3VzdG9tZXJzL3tjdXN0b21lcl9pZH0vYWNjZXNzaWJsZUJpZGRpbmdTdHJh",
+ "dGVnaWVzL3tiaWRkaW5nX3N0cmF0ZWd5X2lkfUIICgZzY2hlbWVCkAIKJmNv",
+ "bS5nb29nbGUuYWRzLmdvb2dsZWFkcy52MTYucmVzb3VyY2VzQh5BY2Nlc3Np",
+ "YmxlQmlkZGluZ1N0cmF0ZWd5UHJvdG9QAVpLZ29vZ2xlLmdvbGFuZy5vcmcv",
+ "Z2VucHJvdG8vZ29vZ2xlYXBpcy9hZHMvZ29vZ2xlYWRzL3YxNi9yZXNvdXJj",
+ "ZXM7cmVzb3VyY2VzogIDR0FBqgIiR29vZ2xlLkFkcy5Hb29nbGVBZHMuVjE2",
+ "LlJlc291cmNlc8oCIkdvb2dsZVxBZHNcR29vZ2xlQWRzXFYxNlxSZXNvdXJj",
+ "ZXPqAiZHb29nbGU6OkFkczo6R29vZ2xlQWRzOjpWMTY6OlJlc291cmNlc2IG",
+ "cHJvdG8z"));
+ descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
+ new pbr::FileDescriptor[] { global::Google.Ads.GoogleAds.V16.Enums.BiddingStrategyTypeReflection.Descriptor, global::Google.Ads.GoogleAds.V16.Enums.TargetImpressionShareLocationReflection.Descriptor, global::Google.Api.FieldBehaviorReflection.Descriptor, global::Google.Api.ResourceReflection.Descriptor, },
+ new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] {
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy), global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Parser, new[]{ "ResourceName", "Id", "Name", "Type", "OwnerCustomerId", "OwnerDescriptiveName", "MaximizeConversionValue", "MaximizeConversions", "TargetCpa", "TargetImpressionShare", "TargetRoas", "TargetSpend" }, new[]{ "Scheme" }, null, null, new pbr::GeneratedClrTypeInfo[] { new pbr::GeneratedClrTypeInfo(typeof(global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.MaximizeConversionValue), global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.MaximizeConversionValue.Parser, new[]{ "TargetRoas" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.MaximizeConversions), global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.MaximizeConversions.Parser, new[]{ "TargetCpaMicros" }, null, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetCpa), global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetCpa.Parser, new[]{ "TargetCpaMicros" }, new[]{ "TargetCpaMicros" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetImpressionShare), global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetImpressionShare.Parser, new[]{ "Location", "LocationFractionMicros", "CpcBidCeilingMicros" }, new[]{ "LocationFractionMicros", "CpcBidCeilingMicros" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetRoas), global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetRoas.Parser, new[]{ "TargetRoas_" }, new[]{ "TargetRoas" }, null, null, null),
+ new pbr::GeneratedClrTypeInfo(typeof(global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetSpend), global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetSpend.Parser, new[]{ "TargetSpendMicros", "CpcBidCeilingMicros" }, new[]{ "TargetSpendMicros", "CpcBidCeilingMicros" }, null, null, null)})
+ }));
+ }
+ #endregion
+
+ }
+ #region Messages
+ ///
+ /// Represents a view of BiddingStrategies owned by and shared with the customer.
+ ///
+ /// In contrast to BiddingStrategy, this resource includes strategies owned by
+ /// managers of the customer and shared with this customer - in addition to
+ /// strategies owned by this customer. This resource does not provide metrics and
+ /// only exposes a limited subset of the BiddingStrategy attributes.
+ ///
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class AccessibleBiddingStrategy : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new AccessibleBiddingStrategy());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategyReflection.Descriptor.MessageTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public AccessibleBiddingStrategy() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public AccessibleBiddingStrategy(AccessibleBiddingStrategy other) : this() {
+ resourceName_ = other.resourceName_;
+ id_ = other.id_;
+ name_ = other.name_;
+ type_ = other.type_;
+ ownerCustomerId_ = other.ownerCustomerId_;
+ ownerDescriptiveName_ = other.ownerDescriptiveName_;
+ switch (other.SchemeCase) {
+ case SchemeOneofCase.MaximizeConversionValue:
+ MaximizeConversionValue = other.MaximizeConversionValue.Clone();
+ break;
+ case SchemeOneofCase.MaximizeConversions:
+ MaximizeConversions = other.MaximizeConversions.Clone();
+ break;
+ case SchemeOneofCase.TargetCpa:
+ TargetCpa = other.TargetCpa.Clone();
+ break;
+ case SchemeOneofCase.TargetImpressionShare:
+ TargetImpressionShare = other.TargetImpressionShare.Clone();
+ break;
+ case SchemeOneofCase.TargetRoas:
+ TargetRoas = other.TargetRoas.Clone();
+ break;
+ case SchemeOneofCase.TargetSpend:
+ TargetSpend = other.TargetSpend.Clone();
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public AccessibleBiddingStrategy Clone() {
+ return new AccessibleBiddingStrategy(this);
+ }
+
+ /// Field number for the "resource_name" field.
+ public const int ResourceNameFieldNumber = 1;
+ private string resourceName_ = "";
+ ///
+ /// Output only. The resource name of the accessible bidding strategy.
+ /// AccessibleBiddingStrategy resource names have the form:
+ ///
+ /// `customers/{customer_id}/accessibleBiddingStrategies/{bidding_strategy_id}`
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public string ResourceName {
+ get { return resourceName_; }
+ set {
+ resourceName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "id" field.
+ public const int IdFieldNumber = 2;
+ private long id_;
+ ///
+ /// Output only. The ID of the bidding strategy.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long Id {
+ get { return id_; }
+ set {
+ id_ = value;
+ }
+ }
+
+ /// Field number for the "name" field.
+ public const int NameFieldNumber = 3;
+ private string name_ = "";
+ ///
+ /// Output only. The name of the bidding strategy.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public string Name {
+ get { return name_; }
+ set {
+ name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "type" field.
+ public const int TypeFieldNumber = 4;
+ private global::Google.Ads.GoogleAds.V16.Enums.BiddingStrategyTypeEnum.Types.BiddingStrategyType type_ = global::Google.Ads.GoogleAds.V16.Enums.BiddingStrategyTypeEnum.Types.BiddingStrategyType.Unspecified;
+ ///
+ /// Output only. The type of the bidding strategy.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Ads.GoogleAds.V16.Enums.BiddingStrategyTypeEnum.Types.BiddingStrategyType Type {
+ get { return type_; }
+ set {
+ type_ = value;
+ }
+ }
+
+ /// Field number for the "owner_customer_id" field.
+ public const int OwnerCustomerIdFieldNumber = 5;
+ private long ownerCustomerId_;
+ ///
+ /// Output only. The ID of the Customer which owns the bidding strategy.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long OwnerCustomerId {
+ get { return ownerCustomerId_; }
+ set {
+ ownerCustomerId_ = value;
+ }
+ }
+
+ /// Field number for the "owner_descriptive_name" field.
+ public const int OwnerDescriptiveNameFieldNumber = 6;
+ private string ownerDescriptiveName_ = "";
+ ///
+ /// Output only. descriptive_name of the Customer which owns the bidding
+ /// strategy.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public string OwnerDescriptiveName {
+ get { return ownerDescriptiveName_; }
+ set {
+ ownerDescriptiveName_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
+ }
+ }
+
+ /// Field number for the "maximize_conversion_value" field.
+ public const int MaximizeConversionValueFieldNumber = 7;
+ ///
+ /// Output only. An automated bidding strategy to help get the most
+ /// conversion value for your campaigns while spending your budget.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.MaximizeConversionValue MaximizeConversionValue {
+ get { return schemeCase_ == SchemeOneofCase.MaximizeConversionValue ? (global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.MaximizeConversionValue) scheme_ : null; }
+ set {
+ scheme_ = value;
+ schemeCase_ = value == null ? SchemeOneofCase.None : SchemeOneofCase.MaximizeConversionValue;
+ }
+ }
+
+ /// Field number for the "maximize_conversions" field.
+ public const int MaximizeConversionsFieldNumber = 8;
+ ///
+ /// Output only. An automated bidding strategy to help get the most
+ /// conversions for your campaigns while spending your budget.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.MaximizeConversions MaximizeConversions {
+ get { return schemeCase_ == SchemeOneofCase.MaximizeConversions ? (global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.MaximizeConversions) scheme_ : null; }
+ set {
+ scheme_ = value;
+ schemeCase_ = value == null ? SchemeOneofCase.None : SchemeOneofCase.MaximizeConversions;
+ }
+ }
+
+ /// Field number for the "target_cpa" field.
+ public const int TargetCpaFieldNumber = 9;
+ ///
+ /// Output only. A bidding strategy that sets bids to help get as many
+ /// conversions as possible at the target cost-per-acquisition (CPA) you set.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetCpa TargetCpa {
+ get { return schemeCase_ == SchemeOneofCase.TargetCpa ? (global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetCpa) scheme_ : null; }
+ set {
+ scheme_ = value;
+ schemeCase_ = value == null ? SchemeOneofCase.None : SchemeOneofCase.TargetCpa;
+ }
+ }
+
+ /// Field number for the "target_impression_share" field.
+ public const int TargetImpressionShareFieldNumber = 10;
+ ///
+ /// Output only. A bidding strategy that automatically optimizes towards a
+ /// chosen percentage of impressions.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetImpressionShare TargetImpressionShare {
+ get { return schemeCase_ == SchemeOneofCase.TargetImpressionShare ? (global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetImpressionShare) scheme_ : null; }
+ set {
+ scheme_ = value;
+ schemeCase_ = value == null ? SchemeOneofCase.None : SchemeOneofCase.TargetImpressionShare;
+ }
+ }
+
+ /// Field number for the "target_roas" field.
+ public const int TargetRoasFieldNumber = 11;
+ ///
+ /// Output only. A bidding strategy that helps you maximize revenue while
+ /// averaging a specific target Return On Ad Spend (ROAS).
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetRoas TargetRoas {
+ get { return schemeCase_ == SchemeOneofCase.TargetRoas ? (global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetRoas) scheme_ : null; }
+ set {
+ scheme_ = value;
+ schemeCase_ = value == null ? SchemeOneofCase.None : SchemeOneofCase.TargetRoas;
+ }
+ }
+
+ /// Field number for the "target_spend" field.
+ public const int TargetSpendFieldNumber = 12;
+ ///
+ /// Output only. A bid strategy that sets your bids to help get as many
+ /// clicks as possible within your budget.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetSpend TargetSpend {
+ get { return schemeCase_ == SchemeOneofCase.TargetSpend ? (global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetSpend) scheme_ : null; }
+ set {
+ scheme_ = value;
+ schemeCase_ = value == null ? SchemeOneofCase.None : SchemeOneofCase.TargetSpend;
+ }
+ }
+
+ private object scheme_;
+ /// Enum of possible cases for the "scheme" oneof.
+ public enum SchemeOneofCase {
+ None = 0,
+ MaximizeConversionValue = 7,
+ MaximizeConversions = 8,
+ TargetCpa = 9,
+ TargetImpressionShare = 10,
+ TargetRoas = 11,
+ TargetSpend = 12,
+ }
+ private SchemeOneofCase schemeCase_ = SchemeOneofCase.None;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public SchemeOneofCase SchemeCase {
+ get { return schemeCase_; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void ClearScheme() {
+ schemeCase_ = SchemeOneofCase.None;
+ scheme_ = null;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as AccessibleBiddingStrategy);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(AccessibleBiddingStrategy other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (ResourceName != other.ResourceName) return false;
+ if (Id != other.Id) return false;
+ if (Name != other.Name) return false;
+ if (Type != other.Type) return false;
+ if (OwnerCustomerId != other.OwnerCustomerId) return false;
+ if (OwnerDescriptiveName != other.OwnerDescriptiveName) return false;
+ if (!object.Equals(MaximizeConversionValue, other.MaximizeConversionValue)) return false;
+ if (!object.Equals(MaximizeConversions, other.MaximizeConversions)) return false;
+ if (!object.Equals(TargetCpa, other.TargetCpa)) return false;
+ if (!object.Equals(TargetImpressionShare, other.TargetImpressionShare)) return false;
+ if (!object.Equals(TargetRoas, other.TargetRoas)) return false;
+ if (!object.Equals(TargetSpend, other.TargetSpend)) return false;
+ if (SchemeCase != other.SchemeCase) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (ResourceName.Length != 0) hash ^= ResourceName.GetHashCode();
+ if (Id != 0L) hash ^= Id.GetHashCode();
+ if (Name.Length != 0) hash ^= Name.GetHashCode();
+ if (Type != global::Google.Ads.GoogleAds.V16.Enums.BiddingStrategyTypeEnum.Types.BiddingStrategyType.Unspecified) hash ^= Type.GetHashCode();
+ if (OwnerCustomerId != 0L) hash ^= OwnerCustomerId.GetHashCode();
+ if (OwnerDescriptiveName.Length != 0) hash ^= OwnerDescriptiveName.GetHashCode();
+ if (schemeCase_ == SchemeOneofCase.MaximizeConversionValue) hash ^= MaximizeConversionValue.GetHashCode();
+ if (schemeCase_ == SchemeOneofCase.MaximizeConversions) hash ^= MaximizeConversions.GetHashCode();
+ if (schemeCase_ == SchemeOneofCase.TargetCpa) hash ^= TargetCpa.GetHashCode();
+ if (schemeCase_ == SchemeOneofCase.TargetImpressionShare) hash ^= TargetImpressionShare.GetHashCode();
+ if (schemeCase_ == SchemeOneofCase.TargetRoas) hash ^= TargetRoas.GetHashCode();
+ if (schemeCase_ == SchemeOneofCase.TargetSpend) hash ^= TargetSpend.GetHashCode();
+ hash ^= (int) schemeCase_;
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (ResourceName.Length != 0) {
+ output.WriteRawTag(10);
+ output.WriteString(ResourceName);
+ }
+ if (Id != 0L) {
+ output.WriteRawTag(16);
+ output.WriteInt64(Id);
+ }
+ if (Name.Length != 0) {
+ output.WriteRawTag(26);
+ output.WriteString(Name);
+ }
+ if (Type != global::Google.Ads.GoogleAds.V16.Enums.BiddingStrategyTypeEnum.Types.BiddingStrategyType.Unspecified) {
+ output.WriteRawTag(32);
+ output.WriteEnum((int) Type);
+ }
+ if (OwnerCustomerId != 0L) {
+ output.WriteRawTag(40);
+ output.WriteInt64(OwnerCustomerId);
+ }
+ if (OwnerDescriptiveName.Length != 0) {
+ output.WriteRawTag(50);
+ output.WriteString(OwnerDescriptiveName);
+ }
+ if (schemeCase_ == SchemeOneofCase.MaximizeConversionValue) {
+ output.WriteRawTag(58);
+ output.WriteMessage(MaximizeConversionValue);
+ }
+ if (schemeCase_ == SchemeOneofCase.MaximizeConversions) {
+ output.WriteRawTag(66);
+ output.WriteMessage(MaximizeConversions);
+ }
+ if (schemeCase_ == SchemeOneofCase.TargetCpa) {
+ output.WriteRawTag(74);
+ output.WriteMessage(TargetCpa);
+ }
+ if (schemeCase_ == SchemeOneofCase.TargetImpressionShare) {
+ output.WriteRawTag(82);
+ output.WriteMessage(TargetImpressionShare);
+ }
+ if (schemeCase_ == SchemeOneofCase.TargetRoas) {
+ output.WriteRawTag(90);
+ output.WriteMessage(TargetRoas);
+ }
+ if (schemeCase_ == SchemeOneofCase.TargetSpend) {
+ output.WriteRawTag(98);
+ output.WriteMessage(TargetSpend);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (ResourceName.Length != 0) {
+ output.WriteRawTag(10);
+ output.WriteString(ResourceName);
+ }
+ if (Id != 0L) {
+ output.WriteRawTag(16);
+ output.WriteInt64(Id);
+ }
+ if (Name.Length != 0) {
+ output.WriteRawTag(26);
+ output.WriteString(Name);
+ }
+ if (Type != global::Google.Ads.GoogleAds.V16.Enums.BiddingStrategyTypeEnum.Types.BiddingStrategyType.Unspecified) {
+ output.WriteRawTag(32);
+ output.WriteEnum((int) Type);
+ }
+ if (OwnerCustomerId != 0L) {
+ output.WriteRawTag(40);
+ output.WriteInt64(OwnerCustomerId);
+ }
+ if (OwnerDescriptiveName.Length != 0) {
+ output.WriteRawTag(50);
+ output.WriteString(OwnerDescriptiveName);
+ }
+ if (schemeCase_ == SchemeOneofCase.MaximizeConversionValue) {
+ output.WriteRawTag(58);
+ output.WriteMessage(MaximizeConversionValue);
+ }
+ if (schemeCase_ == SchemeOneofCase.MaximizeConversions) {
+ output.WriteRawTag(66);
+ output.WriteMessage(MaximizeConversions);
+ }
+ if (schemeCase_ == SchemeOneofCase.TargetCpa) {
+ output.WriteRawTag(74);
+ output.WriteMessage(TargetCpa);
+ }
+ if (schemeCase_ == SchemeOneofCase.TargetImpressionShare) {
+ output.WriteRawTag(82);
+ output.WriteMessage(TargetImpressionShare);
+ }
+ if (schemeCase_ == SchemeOneofCase.TargetRoas) {
+ output.WriteRawTag(90);
+ output.WriteMessage(TargetRoas);
+ }
+ if (schemeCase_ == SchemeOneofCase.TargetSpend) {
+ output.WriteRawTag(98);
+ output.WriteMessage(TargetSpend);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (ResourceName.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(ResourceName);
+ }
+ if (Id != 0L) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(Id);
+ }
+ if (Name.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
+ }
+ if (Type != global::Google.Ads.GoogleAds.V16.Enums.BiddingStrategyTypeEnum.Types.BiddingStrategyType.Unspecified) {
+ size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Type);
+ }
+ if (OwnerCustomerId != 0L) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(OwnerCustomerId);
+ }
+ if (OwnerDescriptiveName.Length != 0) {
+ size += 1 + pb::CodedOutputStream.ComputeStringSize(OwnerDescriptiveName);
+ }
+ if (schemeCase_ == SchemeOneofCase.MaximizeConversionValue) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(MaximizeConversionValue);
+ }
+ if (schemeCase_ == SchemeOneofCase.MaximizeConversions) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(MaximizeConversions);
+ }
+ if (schemeCase_ == SchemeOneofCase.TargetCpa) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(TargetCpa);
+ }
+ if (schemeCase_ == SchemeOneofCase.TargetImpressionShare) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(TargetImpressionShare);
+ }
+ if (schemeCase_ == SchemeOneofCase.TargetRoas) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(TargetRoas);
+ }
+ if (schemeCase_ == SchemeOneofCase.TargetSpend) {
+ size += 1 + pb::CodedOutputStream.ComputeMessageSize(TargetSpend);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(AccessibleBiddingStrategy other) {
+ if (other == null) {
+ return;
+ }
+ if (other.ResourceName.Length != 0) {
+ ResourceName = other.ResourceName;
+ }
+ if (other.Id != 0L) {
+ Id = other.Id;
+ }
+ if (other.Name.Length != 0) {
+ Name = other.Name;
+ }
+ if (other.Type != global::Google.Ads.GoogleAds.V16.Enums.BiddingStrategyTypeEnum.Types.BiddingStrategyType.Unspecified) {
+ Type = other.Type;
+ }
+ if (other.OwnerCustomerId != 0L) {
+ OwnerCustomerId = other.OwnerCustomerId;
+ }
+ if (other.OwnerDescriptiveName.Length != 0) {
+ OwnerDescriptiveName = other.OwnerDescriptiveName;
+ }
+ switch (other.SchemeCase) {
+ case SchemeOneofCase.MaximizeConversionValue:
+ if (MaximizeConversionValue == null) {
+ MaximizeConversionValue = new global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.MaximizeConversionValue();
+ }
+ MaximizeConversionValue.MergeFrom(other.MaximizeConversionValue);
+ break;
+ case SchemeOneofCase.MaximizeConversions:
+ if (MaximizeConversions == null) {
+ MaximizeConversions = new global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.MaximizeConversions();
+ }
+ MaximizeConversions.MergeFrom(other.MaximizeConversions);
+ break;
+ case SchemeOneofCase.TargetCpa:
+ if (TargetCpa == null) {
+ TargetCpa = new global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetCpa();
+ }
+ TargetCpa.MergeFrom(other.TargetCpa);
+ break;
+ case SchemeOneofCase.TargetImpressionShare:
+ if (TargetImpressionShare == null) {
+ TargetImpressionShare = new global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetImpressionShare();
+ }
+ TargetImpressionShare.MergeFrom(other.TargetImpressionShare);
+ break;
+ case SchemeOneofCase.TargetRoas:
+ if (TargetRoas == null) {
+ TargetRoas = new global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetRoas();
+ }
+ TargetRoas.MergeFrom(other.TargetRoas);
+ break;
+ case SchemeOneofCase.TargetSpend:
+ if (TargetSpend == null) {
+ TargetSpend = new global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetSpend();
+ }
+ TargetSpend.MergeFrom(other.TargetSpend);
+ break;
+ }
+
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 10: {
+ ResourceName = input.ReadString();
+ break;
+ }
+ case 16: {
+ Id = input.ReadInt64();
+ break;
+ }
+ case 26: {
+ Name = input.ReadString();
+ break;
+ }
+ case 32: {
+ Type = (global::Google.Ads.GoogleAds.V16.Enums.BiddingStrategyTypeEnum.Types.BiddingStrategyType) input.ReadEnum();
+ break;
+ }
+ case 40: {
+ OwnerCustomerId = input.ReadInt64();
+ break;
+ }
+ case 50: {
+ OwnerDescriptiveName = input.ReadString();
+ break;
+ }
+ case 58: {
+ global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.MaximizeConversionValue subBuilder = new global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.MaximizeConversionValue();
+ if (schemeCase_ == SchemeOneofCase.MaximizeConversionValue) {
+ subBuilder.MergeFrom(MaximizeConversionValue);
+ }
+ input.ReadMessage(subBuilder);
+ MaximizeConversionValue = subBuilder;
+ break;
+ }
+ case 66: {
+ global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.MaximizeConversions subBuilder = new global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.MaximizeConversions();
+ if (schemeCase_ == SchemeOneofCase.MaximizeConversions) {
+ subBuilder.MergeFrom(MaximizeConversions);
+ }
+ input.ReadMessage(subBuilder);
+ MaximizeConversions = subBuilder;
+ break;
+ }
+ case 74: {
+ global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetCpa subBuilder = new global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetCpa();
+ if (schemeCase_ == SchemeOneofCase.TargetCpa) {
+ subBuilder.MergeFrom(TargetCpa);
+ }
+ input.ReadMessage(subBuilder);
+ TargetCpa = subBuilder;
+ break;
+ }
+ case 82: {
+ global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetImpressionShare subBuilder = new global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetImpressionShare();
+ if (schemeCase_ == SchemeOneofCase.TargetImpressionShare) {
+ subBuilder.MergeFrom(TargetImpressionShare);
+ }
+ input.ReadMessage(subBuilder);
+ TargetImpressionShare = subBuilder;
+ break;
+ }
+ case 90: {
+ global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetRoas subBuilder = new global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetRoas();
+ if (schemeCase_ == SchemeOneofCase.TargetRoas) {
+ subBuilder.MergeFrom(TargetRoas);
+ }
+ input.ReadMessage(subBuilder);
+ TargetRoas = subBuilder;
+ break;
+ }
+ case 98: {
+ global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetSpend subBuilder = new global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetSpend();
+ if (schemeCase_ == SchemeOneofCase.TargetSpend) {
+ subBuilder.MergeFrom(TargetSpend);
+ }
+ input.ReadMessage(subBuilder);
+ TargetSpend = subBuilder;
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 10: {
+ ResourceName = input.ReadString();
+ break;
+ }
+ case 16: {
+ Id = input.ReadInt64();
+ break;
+ }
+ case 26: {
+ Name = input.ReadString();
+ break;
+ }
+ case 32: {
+ Type = (global::Google.Ads.GoogleAds.V16.Enums.BiddingStrategyTypeEnum.Types.BiddingStrategyType) input.ReadEnum();
+ break;
+ }
+ case 40: {
+ OwnerCustomerId = input.ReadInt64();
+ break;
+ }
+ case 50: {
+ OwnerDescriptiveName = input.ReadString();
+ break;
+ }
+ case 58: {
+ global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.MaximizeConversionValue subBuilder = new global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.MaximizeConversionValue();
+ if (schemeCase_ == SchemeOneofCase.MaximizeConversionValue) {
+ subBuilder.MergeFrom(MaximizeConversionValue);
+ }
+ input.ReadMessage(subBuilder);
+ MaximizeConversionValue = subBuilder;
+ break;
+ }
+ case 66: {
+ global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.MaximizeConversions subBuilder = new global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.MaximizeConversions();
+ if (schemeCase_ == SchemeOneofCase.MaximizeConversions) {
+ subBuilder.MergeFrom(MaximizeConversions);
+ }
+ input.ReadMessage(subBuilder);
+ MaximizeConversions = subBuilder;
+ break;
+ }
+ case 74: {
+ global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetCpa subBuilder = new global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetCpa();
+ if (schemeCase_ == SchemeOneofCase.TargetCpa) {
+ subBuilder.MergeFrom(TargetCpa);
+ }
+ input.ReadMessage(subBuilder);
+ TargetCpa = subBuilder;
+ break;
+ }
+ case 82: {
+ global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetImpressionShare subBuilder = new global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetImpressionShare();
+ if (schemeCase_ == SchemeOneofCase.TargetImpressionShare) {
+ subBuilder.MergeFrom(TargetImpressionShare);
+ }
+ input.ReadMessage(subBuilder);
+ TargetImpressionShare = subBuilder;
+ break;
+ }
+ case 90: {
+ global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetRoas subBuilder = new global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetRoas();
+ if (schemeCase_ == SchemeOneofCase.TargetRoas) {
+ subBuilder.MergeFrom(TargetRoas);
+ }
+ input.ReadMessage(subBuilder);
+ TargetRoas = subBuilder;
+ break;
+ }
+ case 98: {
+ global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetSpend subBuilder = new global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Types.TargetSpend();
+ if (schemeCase_ == SchemeOneofCase.TargetSpend) {
+ subBuilder.MergeFrom(TargetSpend);
+ }
+ input.ReadMessage(subBuilder);
+ TargetSpend = subBuilder;
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ #region Nested types
+ /// Container for nested types declared in the AccessibleBiddingStrategy message type.
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static partial class Types {
+ ///
+ /// An automated bidding strategy to help get the most conversion value for
+ /// your campaigns while spending your budget.
+ ///
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class MaximizeConversionValue : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MaximizeConversionValue());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Descriptor.NestedTypes[0]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public MaximizeConversionValue() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public MaximizeConversionValue(MaximizeConversionValue other) : this() {
+ targetRoas_ = other.targetRoas_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public MaximizeConversionValue Clone() {
+ return new MaximizeConversionValue(this);
+ }
+
+ /// Field number for the "target_roas" field.
+ public const int TargetRoasFieldNumber = 1;
+ private double targetRoas_;
+ ///
+ /// Output only. The target return on ad spend (ROAS) option. If set, the bid
+ /// strategy will maximize revenue while averaging the target return on ad
+ /// spend. If the target ROAS is high, the bid strategy may not be able to
+ /// spend the full budget. If the target ROAS is not set, the bid strategy
+ /// will aim to achieve the highest possible ROAS for the budget.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public double TargetRoas {
+ get { return targetRoas_; }
+ set {
+ targetRoas_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as MaximizeConversionValue);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(MaximizeConversionValue other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(TargetRoas, other.TargetRoas)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (TargetRoas != 0D) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(TargetRoas);
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (TargetRoas != 0D) {
+ output.WriteRawTag(9);
+ output.WriteDouble(TargetRoas);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (TargetRoas != 0D) {
+ output.WriteRawTag(9);
+ output.WriteDouble(TargetRoas);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (TargetRoas != 0D) {
+ size += 1 + 8;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(MaximizeConversionValue other) {
+ if (other == null) {
+ return;
+ }
+ if (other.TargetRoas != 0D) {
+ TargetRoas = other.TargetRoas;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 9: {
+ TargetRoas = input.ReadDouble();
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 9: {
+ TargetRoas = input.ReadDouble();
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ ///
+ /// An automated bidding strategy to help get the most conversions for your
+ /// campaigns while spending your budget.
+ ///
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class MaximizeConversions : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new MaximizeConversions());
+ private pb::UnknownFieldSet _unknownFields;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Descriptor.NestedTypes[1]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public MaximizeConversions() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public MaximizeConversions(MaximizeConversions other) : this() {
+ targetCpaMicros_ = other.targetCpaMicros_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public MaximizeConversions Clone() {
+ return new MaximizeConversions(this);
+ }
+
+ /// Field number for the "target_cpa_micros" field.
+ public const int TargetCpaMicrosFieldNumber = 2;
+ private long targetCpaMicros_;
+ ///
+ /// Output only. The target cost per acquisition (CPA) option. This is the
+ /// average amount that you would like to spend per acquisition.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long TargetCpaMicros {
+ get { return targetCpaMicros_; }
+ set {
+ targetCpaMicros_ = value;
+ }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as MaximizeConversions);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(MaximizeConversions other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (TargetCpaMicros != other.TargetCpaMicros) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (TargetCpaMicros != 0L) hash ^= TargetCpaMicros.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (TargetCpaMicros != 0L) {
+ output.WriteRawTag(16);
+ output.WriteInt64(TargetCpaMicros);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (TargetCpaMicros != 0L) {
+ output.WriteRawTag(16);
+ output.WriteInt64(TargetCpaMicros);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (TargetCpaMicros != 0L) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(TargetCpaMicros);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(MaximizeConversions other) {
+ if (other == null) {
+ return;
+ }
+ if (other.TargetCpaMicros != 0L) {
+ TargetCpaMicros = other.TargetCpaMicros;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 16: {
+ TargetCpaMicros = input.ReadInt64();
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 16: {
+ TargetCpaMicros = input.ReadInt64();
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ ///
+ /// An automated bid strategy that sets bids to help get as many conversions as
+ /// possible at the target cost-per-acquisition (CPA) you set.
+ ///
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class TargetCpa : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TargetCpa());
+ private pb::UnknownFieldSet _unknownFields;
+ private int _hasBits0;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Descriptor.NestedTypes[2]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public TargetCpa() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public TargetCpa(TargetCpa other) : this() {
+ _hasBits0 = other._hasBits0;
+ targetCpaMicros_ = other.targetCpaMicros_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public TargetCpa Clone() {
+ return new TargetCpa(this);
+ }
+
+ /// Field number for the "target_cpa_micros" field.
+ public const int TargetCpaMicrosFieldNumber = 1;
+ private readonly static long TargetCpaMicrosDefaultValue = 0L;
+
+ private long targetCpaMicros_;
+ ///
+ /// Output only. Average CPA target.
+ /// This target should be greater than or equal to minimum billable unit
+ /// based on the currency for the account.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long TargetCpaMicros {
+ get { if ((_hasBits0 & 1) != 0) { return targetCpaMicros_; } else { return TargetCpaMicrosDefaultValue; } }
+ set {
+ _hasBits0 |= 1;
+ targetCpaMicros_ = value;
+ }
+ }
+ /// Gets whether the "target_cpa_micros" field is set
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool HasTargetCpaMicros {
+ get { return (_hasBits0 & 1) != 0; }
+ }
+ /// Clears the value of the "target_cpa_micros" field
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void ClearTargetCpaMicros() {
+ _hasBits0 &= ~1;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as TargetCpa);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(TargetCpa other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (TargetCpaMicros != other.TargetCpaMicros) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (HasTargetCpaMicros) hash ^= TargetCpaMicros.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (HasTargetCpaMicros) {
+ output.WriteRawTag(8);
+ output.WriteInt64(TargetCpaMicros);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (HasTargetCpaMicros) {
+ output.WriteRawTag(8);
+ output.WriteInt64(TargetCpaMicros);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (HasTargetCpaMicros) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(TargetCpaMicros);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(TargetCpa other) {
+ if (other == null) {
+ return;
+ }
+ if (other.HasTargetCpaMicros) {
+ TargetCpaMicros = other.TargetCpaMicros;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 8: {
+ TargetCpaMicros = input.ReadInt64();
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 8: {
+ TargetCpaMicros = input.ReadInt64();
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ ///
+ /// An automated bidding strategy that sets bids so that a certain percentage
+ /// of search ads are shown at the top of the first page (or other targeted
+ /// location).
+ ///
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class TargetImpressionShare : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TargetImpressionShare());
+ private pb::UnknownFieldSet _unknownFields;
+ private int _hasBits0;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Descriptor.NestedTypes[3]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public TargetImpressionShare() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public TargetImpressionShare(TargetImpressionShare other) : this() {
+ _hasBits0 = other._hasBits0;
+ location_ = other.location_;
+ locationFractionMicros_ = other.locationFractionMicros_;
+ cpcBidCeilingMicros_ = other.cpcBidCeilingMicros_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public TargetImpressionShare Clone() {
+ return new TargetImpressionShare(this);
+ }
+
+ /// Field number for the "location" field.
+ public const int LocationFieldNumber = 1;
+ private global::Google.Ads.GoogleAds.V16.Enums.TargetImpressionShareLocationEnum.Types.TargetImpressionShareLocation location_ = global::Google.Ads.GoogleAds.V16.Enums.TargetImpressionShareLocationEnum.Types.TargetImpressionShareLocation.Unspecified;
+ ///
+ /// Output only. The targeted location on the search results page.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public global::Google.Ads.GoogleAds.V16.Enums.TargetImpressionShareLocationEnum.Types.TargetImpressionShareLocation Location {
+ get { return location_; }
+ set {
+ location_ = value;
+ }
+ }
+
+ /// Field number for the "location_fraction_micros" field.
+ public const int LocationFractionMicrosFieldNumber = 2;
+ private readonly static long LocationFractionMicrosDefaultValue = 0L;
+
+ private long locationFractionMicros_;
+ ///
+ /// The chosen fraction of ads to be shown in the targeted location in
+ /// micros. For example, 1% equals 10,000.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long LocationFractionMicros {
+ get { if ((_hasBits0 & 1) != 0) { return locationFractionMicros_; } else { return LocationFractionMicrosDefaultValue; } }
+ set {
+ _hasBits0 |= 1;
+ locationFractionMicros_ = value;
+ }
+ }
+ /// Gets whether the "location_fraction_micros" field is set
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool HasLocationFractionMicros {
+ get { return (_hasBits0 & 1) != 0; }
+ }
+ /// Clears the value of the "location_fraction_micros" field
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void ClearLocationFractionMicros() {
+ _hasBits0 &= ~1;
+ }
+
+ /// Field number for the "cpc_bid_ceiling_micros" field.
+ public const int CpcBidCeilingMicrosFieldNumber = 3;
+ private readonly static long CpcBidCeilingMicrosDefaultValue = 0L;
+
+ private long cpcBidCeilingMicros_;
+ ///
+ /// Output only. The highest CPC bid the automated bidding system is
+ /// permitted to specify. This is a required field entered by the advertiser
+ /// that sets the ceiling and specified in local micros.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public long CpcBidCeilingMicros {
+ get { if ((_hasBits0 & 2) != 0) { return cpcBidCeilingMicros_; } else { return CpcBidCeilingMicrosDefaultValue; } }
+ set {
+ _hasBits0 |= 2;
+ cpcBidCeilingMicros_ = value;
+ }
+ }
+ /// Gets whether the "cpc_bid_ceiling_micros" field is set
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool HasCpcBidCeilingMicros {
+ get { return (_hasBits0 & 2) != 0; }
+ }
+ /// Clears the value of the "cpc_bid_ceiling_micros" field
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void ClearCpcBidCeilingMicros() {
+ _hasBits0 &= ~2;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as TargetImpressionShare);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(TargetImpressionShare other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (Location != other.Location) return false;
+ if (LocationFractionMicros != other.LocationFractionMicros) return false;
+ if (CpcBidCeilingMicros != other.CpcBidCeilingMicros) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (Location != global::Google.Ads.GoogleAds.V16.Enums.TargetImpressionShareLocationEnum.Types.TargetImpressionShareLocation.Unspecified) hash ^= Location.GetHashCode();
+ if (HasLocationFractionMicros) hash ^= LocationFractionMicros.GetHashCode();
+ if (HasCpcBidCeilingMicros) hash ^= CpcBidCeilingMicros.GetHashCode();
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (Location != global::Google.Ads.GoogleAds.V16.Enums.TargetImpressionShareLocationEnum.Types.TargetImpressionShareLocation.Unspecified) {
+ output.WriteRawTag(8);
+ output.WriteEnum((int) Location);
+ }
+ if (HasLocationFractionMicros) {
+ output.WriteRawTag(16);
+ output.WriteInt64(LocationFractionMicros);
+ }
+ if (HasCpcBidCeilingMicros) {
+ output.WriteRawTag(24);
+ output.WriteInt64(CpcBidCeilingMicros);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (Location != global::Google.Ads.GoogleAds.V16.Enums.TargetImpressionShareLocationEnum.Types.TargetImpressionShareLocation.Unspecified) {
+ output.WriteRawTag(8);
+ output.WriteEnum((int) Location);
+ }
+ if (HasLocationFractionMicros) {
+ output.WriteRawTag(16);
+ output.WriteInt64(LocationFractionMicros);
+ }
+ if (HasCpcBidCeilingMicros) {
+ output.WriteRawTag(24);
+ output.WriteInt64(CpcBidCeilingMicros);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (Location != global::Google.Ads.GoogleAds.V16.Enums.TargetImpressionShareLocationEnum.Types.TargetImpressionShareLocation.Unspecified) {
+ size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Location);
+ }
+ if (HasLocationFractionMicros) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(LocationFractionMicros);
+ }
+ if (HasCpcBidCeilingMicros) {
+ size += 1 + pb::CodedOutputStream.ComputeInt64Size(CpcBidCeilingMicros);
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(TargetImpressionShare other) {
+ if (other == null) {
+ return;
+ }
+ if (other.Location != global::Google.Ads.GoogleAds.V16.Enums.TargetImpressionShareLocationEnum.Types.TargetImpressionShareLocation.Unspecified) {
+ Location = other.Location;
+ }
+ if (other.HasLocationFractionMicros) {
+ LocationFractionMicros = other.LocationFractionMicros;
+ }
+ if (other.HasCpcBidCeilingMicros) {
+ CpcBidCeilingMicros = other.CpcBidCeilingMicros;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 8: {
+ Location = (global::Google.Ads.GoogleAds.V16.Enums.TargetImpressionShareLocationEnum.Types.TargetImpressionShareLocation) input.ReadEnum();
+ break;
+ }
+ case 16: {
+ LocationFractionMicros = input.ReadInt64();
+ break;
+ }
+ case 24: {
+ CpcBidCeilingMicros = input.ReadInt64();
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 8: {
+ Location = (global::Google.Ads.GoogleAds.V16.Enums.TargetImpressionShareLocationEnum.Types.TargetImpressionShareLocation) input.ReadEnum();
+ break;
+ }
+ case 16: {
+ LocationFractionMicros = input.ReadInt64();
+ break;
+ }
+ case 24: {
+ CpcBidCeilingMicros = input.ReadInt64();
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ ///
+ /// An automated bidding strategy that helps you maximize revenue while
+ /// averaging a specific target return on ad spend (ROAS).
+ ///
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class TargetRoas : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new TargetRoas());
+ private pb::UnknownFieldSet _unknownFields;
+ private int _hasBits0;
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pb::MessageParser Parser { get { return _parser; } }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public static pbr::MessageDescriptor Descriptor {
+ get { return global::Google.Ads.GoogleAds.V16.Resources.AccessibleBiddingStrategy.Descriptor.NestedTypes[4]; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ pbr::MessageDescriptor pb::IMessage.Descriptor {
+ get { return Descriptor; }
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public TargetRoas() {
+ OnConstruction();
+ }
+
+ partial void OnConstruction();
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public TargetRoas(TargetRoas other) : this() {
+ _hasBits0 = other._hasBits0;
+ targetRoas_ = other.targetRoas_;
+ _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public TargetRoas Clone() {
+ return new TargetRoas(this);
+ }
+
+ /// Field number for the "target_roas" field.
+ public const int TargetRoas_FieldNumber = 1;
+ private readonly static double TargetRoas_DefaultValue = 0D;
+
+ private double targetRoas_;
+ ///
+ /// Output only. The chosen revenue (based on conversion data) per unit of
+ /// spend.
+ ///
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public double TargetRoas_ {
+ get { if ((_hasBits0 & 1) != 0) { return targetRoas_; } else { return TargetRoas_DefaultValue; } }
+ set {
+ _hasBits0 |= 1;
+ targetRoas_ = value;
+ }
+ }
+ /// Gets whether the "target_roas" field is set
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool HasTargetRoas_ {
+ get { return (_hasBits0 & 1) != 0; }
+ }
+ /// Clears the value of the "target_roas" field
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void ClearTargetRoas_() {
+ _hasBits0 &= ~1;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override bool Equals(object other) {
+ return Equals(other as TargetRoas);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public bool Equals(TargetRoas other) {
+ if (ReferenceEquals(other, null)) {
+ return false;
+ }
+ if (ReferenceEquals(other, this)) {
+ return true;
+ }
+ if (!pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.Equals(TargetRoas_, other.TargetRoas_)) return false;
+ return Equals(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override int GetHashCode() {
+ int hash = 1;
+ if (HasTargetRoas_) hash ^= pbc::ProtobufEqualityComparers.BitwiseDoubleEqualityComparer.GetHashCode(TargetRoas_);
+ if (_unknownFields != null) {
+ hash ^= _unknownFields.GetHashCode();
+ }
+ return hash;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public override string ToString() {
+ return pb::JsonFormatter.ToDiagnosticString(this);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void WriteTo(pb::CodedOutputStream output) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ output.WriteRawMessage(this);
+ #else
+ if (HasTargetRoas_) {
+ output.WriteRawTag(9);
+ output.WriteDouble(TargetRoas_);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(output);
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
+ if (HasTargetRoas_) {
+ output.WriteRawTag(9);
+ output.WriteDouble(TargetRoas_);
+ }
+ if (_unknownFields != null) {
+ _unknownFields.WriteTo(ref output);
+ }
+ }
+ #endif
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public int CalculateSize() {
+ int size = 0;
+ if (HasTargetRoas_) {
+ size += 1 + 8;
+ }
+ if (_unknownFields != null) {
+ size += _unknownFields.CalculateSize();
+ }
+ return size;
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(TargetRoas other) {
+ if (other == null) {
+ return;
+ }
+ if (other.HasTargetRoas_) {
+ TargetRoas_ = other.TargetRoas_;
+ }
+ _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields);
+ }
+
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ public void MergeFrom(pb::CodedInputStream input) {
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ input.ReadRawMessage(this);
+ #else
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input);
+ break;
+ case 9: {
+ TargetRoas_ = input.ReadDouble();
+ break;
+ }
+ }
+ }
+ #endif
+ }
+
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
+ [global::System.CodeDom.Compiler.GeneratedCode("protoc", null)]
+ void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
+ uint tag;
+ while ((tag = input.ReadTag()) != 0) {
+ switch(tag) {
+ default:
+ _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
+ break;
+ case 9: {
+ TargetRoas_ = input.ReadDouble();
+ break;
+ }
+ }
+ }
+ }
+ #endif
+
+ }
+
+ ///
+ /// An automated bid strategy that sets your bids to help get as many clicks
+ /// as possible within your budget.
+ ///
+ [global::System.Diagnostics.DebuggerDisplayAttribute("{ToString(),nq}")]
+ public sealed partial class TargetSpend : pb::IMessage
+ #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
+ , pb::IBufferMessage
+ #endif
+ {
+ private static readonly pb::MessageParser