Skip to content

Commit

Permalink
Merge V5 (#234)
Browse files Browse the repository at this point in the history
Change-Id: I203ec9763cc44bb38342a3a4f57973fc3590beb5
  • Loading branch information
AndrewMBurke authored Sep 3, 2020
1 parent 3b6cfde commit 272f884
Show file tree
Hide file tree
Showing 3,713 changed files with 737,147 additions and 17,811 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
32 changes: 30 additions & 2 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
5.0.0
=====
- Added support for v5 of Google Ads API. See
https://developers.google.com/google-ads/api/docs/release-notes#500_beta_2020-08-26 for release notes.
- The library dependencies were bumped as listed below:
- Google.Api.CommonProtos: 2.1.0
- Google.Apis and related assemblies: 1.49.0.0
- Google.Api.Gax and related assemblies: 3.1.0
- Google.Protobuf: 3.13.0.0
- Grpc.Core and related assemblies: 2.31.0
- Microsoft.Extensions and related assemblies: 3.1.7
- DotNetCompilerPlatform: 3.6.0
- Added new code examples:
- Extensions/AddGeoTarget.cs
- Remarketing/AddLogicalUserList.cs
- Remarketing/AddCombinedRuleUserList.cs
- Remarketing/AddExpressionRuleUserList.cs
- Remarketing/AddConversionBasedUserList.cs
- Feeds/RemoveFeedItems.cs
- Feeds/RemoveFlightsFeedItemAttributeValue.cs
- Various minor changes to code examples for consistency with other client libraries.
- Renamed code examples:
- ShoppingAds/RejectMerchantCenterLink.cs => AccountManagement/RejectMerchantCenterLink.cs
- Extensions/UpdateFlightsFeedItemStringAttributeValue.cs => Feeds/UpdateFlightsFeedItemStringAttributeValue.cs
- Targeting/SearchForTargetableLanguagesAndCarriers.cs => Targeting/SearchForLanguageAndCarrierConstants.cs
- Fixed https://github.com/googleads/google-ads-dotnet/issues/211
- Fixed https://github.com/googleads/google-ads-dotnet/issues/231

4.0.0
=====
- Added support for v4 of Google Ads API. See https://developers.google.com/google-ads/api/docs/release-notes#400_beta_2020-07-08
Expand All @@ -6,7 +34,7 @@
https://ads-developers.googleblog.com/2020/06/google-ads-api-beta-v1-sunset-reminder.html. We are
doing a major version bump for the library, since removing support for an API version is backward
incompatible change.
- Added new code examples
- Added new code examples:
- Reporting/ParallelReportDownload.cs
- Reporting/UploadStoreSalesTransactions.cs
- Planning/GetAdGroupCriterionCpcBidSimulations.cs
Expand All @@ -15,7 +43,7 @@
- ErrorHandling/HandleExpandedTextAdPolicyViolations.cs
- AdvancedOperations/AddDisplayUploadAd.cs
- Billing/AddBillingSetup.cs
- Renamed code examples.
- Renamed code examples:
- AddCompleteCampaignsUsingMutateJob.cs => AddCompleteCampaignsUsingBatchJob.cs
- Fixed https://github.com/googleads/google-ads-dotnet/issues/185
- Fixed https://github.com/googleads/google-ads-dotnet/issues/197
Expand Down
8 changes: 7 additions & 1 deletion buildscript/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ function dotnet_library::install_dotnet() {
sudo apt-get install apt-transport-https -y
sudo apt-get update
sudo apt-get install dotnet-sdk-3.1 -y

# "Verify dotnet install"
dotnet --info
}
Expand All @@ -62,11 +63,16 @@ function dotnet_library::build_library() {
--source "https://api.nuget.org/v3/index.json;${DOTNET_CLIENT_LIBRARY_CUSTOM_NUGET_PATH}" \
"${DOTNET_CLIENT_LIBRARY_PATH}/examples/Google.Ads.GoogleAds.Examples.csproj"

echo "Run the tests."
echo "Build the tests."
echo "=============="
dotnet build --configuration Release \
--source "https://api.nuget.org/v3/index.json;${DOTNET_CLIENT_LIBRARY_CUSTOM_NUGET_PATH}" \
"${DOTNET_CLIENT_LIBRARY_PATH}/tests/Google.Ads.GoogleAds.Tests.csproj"

echo "Run the smoke tests."
echo "==================="
dotnet test "${DOTNET_CLIENT_LIBRARY_PATH}/tests/bin/Release/netcoreapp3.1/Google.Ads.GoogleAds.Tests.dll" \
-v d --filter TestCategory=Smoke
}

dotnet_library::main
10 changes: 5 additions & 5 deletions examples/AccountManagement/CreateCustomer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
// limitations under the License.

using Google.Ads.GoogleAds.Lib;
using Google.Ads.GoogleAds.V4.Errors;
using Google.Ads.GoogleAds.V4.Resources;
using Google.Ads.GoogleAds.V4.Services;
using Google.Ads.GoogleAds.V5.Errors;
using Google.Ads.GoogleAds.V5.Resources;
using Google.Ads.GoogleAds.V5.Services;

using System;

namespace Google.Ads.GoogleAds.Examples.V4
namespace Google.Ads.GoogleAds.Examples.V5
{
/// <summary>
/// This code example illustrates how to create a new customer under a given manager account.
Expand Down Expand Up @@ -59,7 +59,7 @@ public static void Main(string[] args)
public void Run(GoogleAdsClient client, long managerCustomerId)
{
// Get the CustomerService.
CustomerServiceClient customerService = client.GetService(Services.V4.CustomerService);
CustomerServiceClient customerService = client.GetService(Services.V5.CustomerService);

Customer customer = new Customer()
{
Expand Down
10 changes: 5 additions & 5 deletions examples/AccountManagement/GetAccountChanges.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
// limitations under the License.

using Google.Ads.GoogleAds.Lib;
using Google.Ads.GoogleAds.V4.Errors;
using Google.Ads.GoogleAds.V4.Services;
using Google.Ads.GoogleAds.V5.Errors;
using Google.Ads.GoogleAds.V5.Services;
using Google.Api.Gax;
using static Google.Ads.GoogleAds.V4.Enums.ChangeStatusResourceTypeEnum.Types;
using static Google.Ads.GoogleAds.V5.Enums.ChangeStatusResourceTypeEnum.Types;

using System;

namespace Google.Ads.GoogleAds.Examples.V4
namespace Google.Ads.GoogleAds.Examples.V5
{
/// <summary>
/// This code example gets the changes in an account during the last 7 days.
Expand Down Expand Up @@ -63,7 +63,7 @@ public void Run(GoogleAdsClient client, long customerId)
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService = client.GetService(
Services.V4.GoogleAdsService);
Services.V5.GoogleAdsService);

string searchQuery = "SELECT change_status.resource_name, " +
"change_status.last_change_date_time, change_status.resource_type, " +
Expand Down
18 changes: 9 additions & 9 deletions examples/AccountManagement/GetAccountHierarchy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
using System;
using System.Collections.Generic;
using Google.Ads.GoogleAds.Lib;
using Google.Ads.GoogleAds.V4.Errors;
using Google.Ads.GoogleAds.V4.Resources;
using Google.Ads.GoogleAds.V4.Services;
using Google.Ads.GoogleAds.V5.Errors;
using Google.Ads.GoogleAds.V5.Resources;
using Google.Ads.GoogleAds.V5.Services;
using Google.Api.Gax;

namespace Google.Ads.GoogleAds.Examples.V4
namespace Google.Ads.GoogleAds.Examples.V5
{
/// <summary>
/// This example gets the account hierarchy of the specified manager account. If you don't
Expand Down Expand Up @@ -87,10 +87,10 @@ public void Run(GoogleAdsClient googleAdsClient, long? managerCustomerId = null,
}

GoogleAdsServiceClient googleAdsServiceClient =
googleAdsClient.GetService(Services.V4.GoogleAdsService);
googleAdsClient.GetService(Services.V5.GoogleAdsService);

CustomerServiceClient customerServiceClient =
googleAdsClient.GetService(Services.V4.CustomerService);
googleAdsClient.GetService(Services.V5.CustomerService);

// List of Customer IDs to handle.
List<long> seedCustomerIds = new List<long>();
Expand All @@ -113,8 +113,8 @@ public void Run(GoogleAdsClient googleAdsClient, long? managerCustomerId = null,
foreach (string customerResourceName in customerResourceNames)
{
Customer customer = customerServiceClient.GetCustomer(customerResourceName);
Console.WriteLine(customer.Id.Value);
seedCustomerIds.Add(customer.Id.Value);
Console.WriteLine(customer.Id);
seedCustomerIds.Add(customer.Id);
}

Console.WriteLine();
Expand Down Expand Up @@ -178,7 +178,7 @@ FROM customer_client

customerIdsToChildAccounts[managerCustomerId.Value].Add(customerClient);

if (customerClient.Manager.HasValue && customerClient.Manager.Value)
if (customerClient.Manager.HasValue)
// A customer can be managed by multiple managers, so to prevent
// visiting the same customer many times, we need to check if it's
// already in the Dictionary.
Expand Down
10 changes: 5 additions & 5 deletions examples/AccountManagement/GetAccountInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@
// limitations under the License.

using Google.Ads.GoogleAds.Lib;
using Google.Ads.GoogleAds.V4.Errors;
using Google.Ads.GoogleAds.V4.Resources;
using Google.Ads.GoogleAds.V4.Services;
using Google.Ads.GoogleAds.V5.Errors;
using Google.Ads.GoogleAds.V5.Resources;
using Google.Ads.GoogleAds.V5.Services;

using System;

namespace Google.Ads.GoogleAds.Examples.V4
namespace Google.Ads.GoogleAds.Examples.V5
{
/// <summary>
/// This code example lists basic information about an advertising account, like the name,
Expand Down Expand Up @@ -58,7 +58,7 @@ public static void Main(string[] args)
public void Run(GoogleAdsClient client, long customerId)
{
// Get the CustomerService.
CustomerServiceClient customerService = client.GetService(Services.V4.CustomerService);
CustomerServiceClient customerService = client.GetService(Services.V5.CustomerService);

try
{
Expand Down
16 changes: 8 additions & 8 deletions examples/AccountManagement/LinkManagerToClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

using Google.Ads.GoogleAds.Lib;
using Google.Ads.GoogleAds.Util;
using Google.Ads.GoogleAds.V4.Errors;
using Google.Ads.GoogleAds.V4.Resources;
using Google.Ads.GoogleAds.V4.Services;
using Google.Ads.GoogleAds.V5.Errors;
using Google.Ads.GoogleAds.V5.Resources;
using Google.Ads.GoogleAds.V5.Services;

using System;
using System.Linq;
using static Google.Ads.GoogleAds.V4.Enums.ManagerLinkStatusEnum.Types;
using static Google.Ads.GoogleAds.V5.Enums.ManagerLinkStatusEnum.Types;

namespace Google.Ads.GoogleAds.Examples.V4
namespace Google.Ads.GoogleAds.Examples.V5
{
/// <summary>
/// This code example demonstrates how to link an existing Google Ads manager customer
Expand Down Expand Up @@ -105,7 +105,7 @@ private string CreateInvitation(GoogleAdsClient client, long managerCustomerId,
{
// Get the CustomerClientLinkService.
CustomerClientLinkServiceClient customerClientLinkService =
client.GetService(Services.V4.CustomerClientLinkService);
client.GetService(Services.V5.CustomerClientLinkService);

// Create a client with the manager customer ID as login customer ID.
client.Config.LoginCustomerId = managerCustomerId.ToString();
Expand Down Expand Up @@ -156,7 +156,7 @@ private string GetManagerLinkResourceName(GoogleAdsClient client, long managerCu
{
// Get the GoogleAdsService.
GoogleAdsServiceClient googleAdsService =
client.GetService(Services.V4.GoogleAdsService);
client.GetService(Services.V5.GoogleAdsService);

// Create a client with the manager customer ID as login customer ID.
client.Config.LoginCustomerId = managerCustomerId.ToString();
Expand Down Expand Up @@ -192,7 +192,7 @@ private void AcceptInvitation(GoogleAdsClient client, long clientCustomerId,
{
// Get the CustomerManagerLinkService.
CustomerManagerLinkServiceClient customerManagerLinkService =
client.GetService(Services.V4.CustomerManagerLinkService);
client.GetService(Services.V5.CustomerManagerLinkService);

// Create a client with the manager customer ID as login customer ID.
client.Config.LoginCustomerId = clientCustomerId.ToString();
Expand Down
8 changes: 4 additions & 4 deletions examples/AccountManagement/ListAccessibleCustomers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@
// limitations under the License.

using Google.Ads.GoogleAds.Lib;
using Google.Ads.GoogleAds.V4.Errors;
using Google.Ads.GoogleAds.V4.Services;
using Google.Ads.GoogleAds.V5.Errors;
using Google.Ads.GoogleAds.V5.Services;

using System;

namespace Google.Ads.GoogleAds.Examples.V4
namespace Google.Ads.GoogleAds.Examples.V5
{
/// <summary>
/// This code example lists the resource names for the customers that the authenticating user
Expand Down Expand Up @@ -59,7 +59,7 @@ public static void Main(string[] args)
public void Run(GoogleAdsClient client)
{
// Get the CustomerService.
CustomerServiceClient customerService = client.GetService(Services.V4.CustomerService);
CustomerServiceClient customerService = client.GetService(Services.V5.CustomerService);

try
{
Expand Down
30 changes: 15 additions & 15 deletions examples/AdvancedOperations/AddAdCustomizer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,19 @@
// limitations under the License.

using Google.Ads.GoogleAds.Lib;
using Google.Ads.GoogleAds.V4.Common;
using Google.Ads.GoogleAds.V4.Errors;
using Google.Ads.GoogleAds.V4.Resources;
using Google.Ads.GoogleAds.V4.Services;
using Google.Ads.GoogleAds.V5.Common;
using Google.Ads.GoogleAds.V5.Errors;
using Google.Ads.GoogleAds.V5.Resources;
using Google.Ads.GoogleAds.V5.Services;

using System;
using System.Collections.Generic;
using System.Linq;
using static Google.Ads.GoogleAds.V4.Enums.AdCustomizerPlaceholderFieldEnum.Types;
using static Google.Ads.GoogleAds.V4.Enums.FeedAttributeTypeEnum.Types;
using static Google.Ads.GoogleAds.V4.Enums.PlaceholderTypeEnum.Types;
using static Google.Ads.GoogleAds.V5.Enums.AdCustomizerPlaceholderFieldEnum.Types;
using static Google.Ads.GoogleAds.V5.Enums.FeedAttributeTypeEnum.Types;
using static Google.Ads.GoogleAds.V5.Enums.PlaceholderTypeEnum.Types;

namespace Google.Ads.GoogleAds.Examples.V4
namespace Google.Ads.GoogleAds.Examples.V5
{
/// <summary>
/// This code example adds an ad customizer feed and associates it with the customer.
Expand Down Expand Up @@ -72,7 +72,7 @@ public void Run(GoogleAdsClient client, long customerId, long[] adGroupIds)
{
// Get the AdGroupBidModifierService.
AdGroupBidModifierServiceClient adGroupBidModifierService =
client.GetService(Services.V4.AdGroupBidModifierService);
client.GetService(Services.V5.AdGroupBidModifierService);

string feedName = "Ad_Customizer_example_feed_" + ExampleUtilities.GetShortRandomString();

Expand Down Expand Up @@ -125,7 +125,7 @@ private string CreateAdCustomizerFeed(GoogleAdsClient client, long customerId,
string feedName)
{
// Get the FeedServiceClient.
FeedServiceClient feedService = client.GetService(Services.V4.FeedService);
FeedServiceClient feedService = client.GetService(Services.V5.FeedService);

// Creates three feed attributes: a name, a price and a date. The attribute names
// are arbitrary choices and will be used as placeholders in the ad text fields.
Expand Down Expand Up @@ -179,7 +179,7 @@ private Dictionary<string, FeedAttribute> GetFeedAttributes(GoogleAdsClient clie
{
// Get the GoogleAdsServiceClient.
GoogleAdsServiceClient googleAdsService =
client.GetService(Services.V4.GoogleAdsService);
client.GetService(Services.V5.GoogleAdsService);

string query = $"SELECT feed.attributes, feed.name FROM feed WHERE " +
$"feed.resource_name = '{feedResourceName}'";
Expand Down Expand Up @@ -217,7 +217,7 @@ private void CreateAdCustomizerMapping(GoogleAdsClient client, long customerId,
{
// Get the FeedMappingService.
FeedMappingServiceClient feedMappingService =
client.GetService(Services.V4.FeedMappingService);
client.GetService(Services.V5.FeedMappingService);

// Map the feed attributes to ad customizer placeholder fields.
// For a full list of ad customizer placeholder fields, see
Expand Down Expand Up @@ -272,7 +272,7 @@ private List<string> CreateFeedItems(GoogleAdsClient client, long customerId,
{
// Get the FeedItemServiceClient.
FeedItemServiceClient feedItemService =
client.GetService(Services.V4.FeedItemService);
client.GetService(Services.V5.FeedItemService);

List<FeedItemOperation> feedItemOperations = new List<FeedItemOperation>();

Expand Down Expand Up @@ -357,7 +357,7 @@ private void CreateFeedItemTargets(GoogleAdsClient client,
{
// Get the FeedItemTargetServiceClient.
FeedItemTargetServiceClient feedItemTargetService =
client.GetService(Services.V4.FeedItemTargetService);
client.GetService(Services.V5.FeedItemTargetService);

// Bind each feed item to a specific ad group to make sure it will only be used to
// customize ads inside that ad group; using the feed item elsewhere will result
Expand Down Expand Up @@ -400,7 +400,7 @@ private void CreateAdsWithCustomizations(GoogleAdsClient client, long customerId
{
// Get the AdGroupAdServiceClient.
AdGroupAdServiceClient adGroupAdService =
client.GetService(Services.V4.AdGroupAdService);
client.GetService(Services.V5.AdGroupAdService);


// Creates an expanded text ad using the feed attribute names as placeholders.
Expand Down
Loading

0 comments on commit 272f884

Please sign in to comment.