Skip to content

Commit

Permalink
Changes for version 6.0.0. (#247)
Browse files Browse the repository at this point in the history
  • Loading branch information
AnashOommen authored Nov 12, 2020
1 parent a546f47 commit b4c7f0b
Show file tree
Hide file tree
Showing 1,904 changed files with 173,344 additions and 90,043 deletions.
64 changes: 64 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,67 @@
6.0.0
=====
- Added support for v6 of Google Ads API. See
https://developers.google.com/google-ads/api/docs/release-notes#v6 for release notes.
- Removed support for v2 of the Google Ads API. See
https://developers.google.com/google-ads/api/docs/sunset-dates and
https://ads-developers.googleblog.com/2020/08/google-ads-api-v2-sunset-reminder.html
for more details.
- The library dependencies were bumped as listed below:
- Google.Api.Gax and related assemblies: 3.2.0
- Grpc.Core and related assemblies: 2.33.1
- Microsoft.Extensions and related assemblies: 3.1.9
- Fixed the README.md file to make it minimal. See
https://developers.google.com/google-ads/api/docs/client-libs/dotnet for detailed
documentation.
- Fixed the conditional compilation for net472.
- Added a utility method in FieldMasks.cs to fetch field values given a fieldmask.
- Added additional masking for PII in logs.
- Fixed the broken documentation links in multiple source files.
- Fixed broken examples.
- Billing\AddBillingSetup.cs
- Fixed issue 246 - Reporting\ParallelReportDownload.cs.
- Updated some examples.
- Updated the query in Billing\AddBillingSetup.cs.
- Fix a comment in Remarketing\UploadStoreSalesTransactions.cs.
- Simplified the paged search iteration in Billing\GetBillingSetup.cs.
- Renamed Authentication\AuthenticateInStandaloneApplication => Authentication\AuthenticateInDesktopApplication.
- Minor grammar fix in Remarketing\UploadCallConversion.cs.
- Renamed AccountManagement\GetAccountChanges.cs => AccountManagement\GetChangeSummary.cs.
- Fixed the resource name for DomainCategory.
- Fixed the PartialFailureError condition logic.
- Migrated all code examples to use proto3 presence instead of wrapper types. This improves
the API performance and makes the API easier to work with native C# types.
- Added support for reading the settings.json file from an environment variable named
GOOGLE_ADS_CONFIGURATION_FILE_PATH. The client library will try to load settings from this file
if App.config is missing, and this environment variable is provided.
- Added support for reading individual settings from an environment variable. Supported settings
are:
- GOOGLE_ADS_OAUTH2_MODE
- GOOGLE_ADS_CLIENT_ID
- GOOGLE_ADS_CLIENT_SECRET
- GOOGLE_ADS_REFRESH_TOKEN
- GOOGLE_ADS_JSON_KEY_FILE_PATH
- GOOGLE_ADS_IMPERSONATED_EMAIL
- GOOGLE_ADS_DEVELOPER_TOKEN
- GOOGLE_ADS_LOGIN_CUSTOMER_ID
- GOOGLE_ADS_LINKED_CUSTOMER_ID
- Add new code examples.
- Remarketing\SetupRemarketing.cs.
- Remarketing\SetupAdvancedRemarketing.cs
- Remarketing\UpdateAudienceTargetRestriction.cs.
- AdvancedOperations\AddLocalCampaign.cs.
- HotelAds\AddHotelListingGroupTree.cs.
- AccountManagement\UpdateUserAccess.cs.
- AdvancedOperations\GetChangeDetails.cs.
- Extensions\UpdateSitelinkCampaignExtensionSetting.cs.
- Extensions\UpdateSitelink.cs.
- Extensions\RemoveEntireSitelinkCampaignExtensionSetting.cs.
- Extensions\AddLeadFormExtension.cs.
- Extensions\AddHotelCallout.cs.
- Fixed the PackageIconUrl property in Google.Ads.GoogleAds.csproj with PackageIcon as required
by the latest .NET library.
- Downgrade the tests to use .netcoreapp3.0.

5.0.0
=====
- Added support for v5 of Google Ads API. See
Expand Down
6 changes: 3 additions & 3 deletions Google.Ads.GoogleAds.sln
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2027
# Visual Studio Version 16
VisualStudioVersion = 16.0.29920.165
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Google.Ads.GoogleAds", "src\Google.Ads.GoogleAds.csproj", "{C691BD4D-683D-425B-8BC7-52F161475C7C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Google.Ads.GoogleAds.Tests", "tests\Google.Ads.GoogleAds.Tests.csproj", "{CE67A7AE-5C95-4C89-A7C5-EB6C88940B36}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Google.Ads.GoogleAds.Examples", "examples\Google.Ads.GoogleAds.Examples.csproj", "{7172CCB7-70B9-41A4-9D45-FCB156F9DF60}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AuthenticateInStandaloneApplication", "examples\Authentication\AuthenticateInStandaloneApplication\AuthenticateInStandaloneApplication.csproj", "{C64FFE8B-8464-4D71-814A-9397E6C2CFC2}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AuthenticateInDesktopApplication", "examples\Authentication\AuthenticateInDesktopApplication\AuthenticateInDesktopApplication.csproj", "{C64FFE8B-8464-4D71-814A-9397E6C2CFC2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
110 changes: 5 additions & 105 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,115 +14,15 @@ This project hosts the .NET client library for the Google Ads API.

## Supported Frameworks

- .NET Framework 4.5.2+
- .NET Standard 2.0
- .NET Framework 4.7.2+ (net472)
- .NET Standard 2.0 (netstandard2.0)
- .NET Core 3.0 (netcoreapp3.0)

## Announcements and updates

For API and client library updates and news, please follow our Google
Ads Developers blog: http://googleadsdeveloper.blogspot.com/.


## Running the code examples

We provide a zip package for the examples. To run the code examples,
follow these steps:

1. Download the Google.Ads.GoogleAds.Examples zip file from
https://github.com/googleads/google-ads-dotnet/releases/latest.
1. Extract the examples zip file into a local folder.
1. Open `Google.Ads.GoogleAds.Examples.sln in Visual Studio and build it.
1. Follow the instructions on the
[Authentication guide](https://developers.google.com/google-ads/api/docs/oauth/cloud-project)
to create an OAuth2 client ID and Secret.
1. Run the `AuthenticateInStandaloneApplication` code example from the
Visual Studio project. When prompted, provide the client ID and client secret
from the previous step. `AuthenticateInStandaloneApplication` performs
the authentication and prints the configuration in XML format. Copy the
configuration into the `App.config` of the `Google.Ads.GoogleAds.Examples`
project.
1. Open the **Properties** dialog for the Examples project by
right clicking `Google.Ads.GoogleAds.Examples` project in the Solution
Explorer and selecting the **Properties** option from the context
menu.
1. Navigate to the **Debug Tab** and enter the command-line options,
which are of the form `version.examplename`. For instance,
`V0.GetCampaigns` is the command-line option to run `GetCampaigns`
in the `V0` version of the Google Ads API.
1. Compile and run the `Google.Ads.GoogleAds.Examples` project.

As an alternative to steps 8-10, each code example has a `main()`
method, so you can set the appropriate code example as the Startup
object (Select the **Application tab** on the Examples Properties dialog
and pick the desired class from the "Startup object" dropdown.).


## Using the client library in your own project


The client library binaries are distributed via Nuget. Add a Nuget
reference to the [Google.Ads.GoogleAds package](https://www.nuget.org/packages/Google.Ads.GoogleAds)
in your project to use the client library.


## How do I make API calls?

```
// Create a Google Ads client.
GoogleAdsClient client = new GoogleAdsClient();
// Create the required service.
CampaignServiceClient campaignService =
client.GetService(Services.V0.CampaignService);
// make more calls to service class.
```

See the [Getting Started](https://github.com/googleads/google-ads-dotnet/wiki/Getting-started) guide
for more details, and examples folder for code examples that show how to use various services.

## How do I enable logging?

You can enable logging by adding the following line in your Program.cs before making any API calls.

```
TraceUtilities.Configure(TraceUtilities.DETAILED_REQUEST_LOGS_SOURCE,
"C:\\logs\\details.log", System.Diagnostics.SourceLevels.All);
```

In most cases, the logs generated by the client library should provide enough details to troubleshoot
your issues. When reaching out to the support forum / aliases, you can either provide the logs (which
redacts sensitive information by default), or just share the request ID (which is logged as part of
the response log).

If you prefer capturing the request ID yourself, then you need to provide a GoogleResponseMetadata object
to capture the request ID, as follows:

```
GoogleAdsResponseMetadata metadata = new GoogleAdsResponseMetadata(client.Config);
// Add the campaigns.
MutateCampaignsResponse retVal = campaignService.MutateCampaigns(
customerId.ToString(), operations.ToArray(), metadata.CallSettings);
Console.WriteLine(metadata.RequestId);
```

If the API log doesn't give you enough details, then you can enable more low level logging at grpc
level. Keep in mind that this can get pretty detailed and long. The grpc logs are written to
`stderr`, but you can attach your own logger like shown below. You can find all the supported
environment variables here:
https://github.com/grpc/grpc/blob/master/doc/environment_variables.md

```
Environment.SetEnvironmentVariable("GRPC_VERBOSITY", "DEBUG");
Environment.SetEnvironmentVariable("GRPC_TRACE", "http");
GrpcEnvironment.SetLogger(new ConsoleLogger());
```
## Documentation

Our documentation is available [here](https://developers.google.com/google-ads/api/docs/client-libs/dotnet).
## Miscellaneous


### Wiki

- https://github.com/googleads/google-ads-dotnet/wiki
Expand Down
2 changes: 1 addition & 1 deletion buildscript/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function dotnet_library::build_library() {

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

Expand Down
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.V5.Errors;
using Google.Ads.GoogleAds.V5.Resources;
using Google.Ads.GoogleAds.V5.Services;
using Google.Ads.GoogleAds.V6.Errors;
using Google.Ads.GoogleAds.V6.Resources;
using Google.Ads.GoogleAds.V6.Services;

using System;

namespace Google.Ads.GoogleAds.Examples.V5
namespace Google.Ads.GoogleAds.Examples.V6
{
/// <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.V5.CustomerService);
CustomerServiceClient customerService = client.GetService(Services.V6.CustomerService);

Customer customer = new Customer()
{
Expand Down
20 changes: 10 additions & 10 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.V5.Errors;
using Google.Ads.GoogleAds.V5.Resources;
using Google.Ads.GoogleAds.V5.Services;
using Google.Ads.GoogleAds.V6.Errors;
using Google.Ads.GoogleAds.V6.Resources;
using Google.Ads.GoogleAds.V6.Services;
using Google.Api.Gax;

namespace Google.Ads.GoogleAds.Examples.V5
namespace Google.Ads.GoogleAds.Examples.V6
{
/// <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.V5.GoogleAdsService);
googleAdsClient.GetService(Services.V6.GoogleAdsService);

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

// List of Customer IDs to handle.
List<long> seedCustomerIds = new List<long>();
Expand Down Expand Up @@ -178,13 +178,13 @@ FROM customer_client

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

if (customerClient.Manager.HasValue)
if (customerClient.Manager)
// 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.
if (!customerIdsToChildAccounts.ContainsKey(customerClient.Id.Value) &&
if (!customerIdsToChildAccounts.ContainsKey(customerClient.Id) &&
customerClient.Level == 1)
unprocessedCustomerIds.Enqueue(customerClient.Id.Value);
unprocessedCustomerIds.Enqueue(customerClient.Id);
}
}

Expand Down Expand Up @@ -221,7 +221,7 @@ private void PrintAccountHierarchy(CustomerClient customerClient,
if (depth == 0)
Console.WriteLine("Customer ID (Descriptive Name, Currency Code, Time Zone)");

long customerId = customerClient.Id.Value;
long customerId = customerClient.Id;
Console.Write(new string('-', depth * 2));
Console.WriteLine("{0} ({1}, {2}, {3})",
customerId, customerClient.DescriptiveName, customerClient.CurrencyCode,
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.V5.Errors;
using Google.Ads.GoogleAds.V5.Resources;
using Google.Ads.GoogleAds.V5.Services;
using Google.Ads.GoogleAds.V6.Errors;
using Google.Ads.GoogleAds.V6.Resources;
using Google.Ads.GoogleAds.V6.Services;

using System;

namespace Google.Ads.GoogleAds.Examples.V5
namespace Google.Ads.GoogleAds.Examples.V6
{
/// <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.V5.CustomerService);
CustomerServiceClient customerService = client.GetService(Services.V6.CustomerService);

try
{
Expand Down
Loading

0 comments on commit b4c7f0b

Please sign in to comment.