Skip to content

Commit

Permalink
Merge pull request #539 from googleads/release-v15_0-c4f493b713e44709…
Browse files Browse the repository at this point in the history
…15ee

Changes for release v15_0.
  • Loading branch information
Raibaz authored Oct 20, 2023
2 parents 73439fe + c625675 commit f5e6e11
Show file tree
Hide file tree
Showing 1,510 changed files with 779,433 additions and 1,240 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@
17.1.0
======
- Added support for version 15.0 of the Google Ads API. The following code examples still use
version 14 because the services in the examples were removed in version 15:
* ApproveMerchantCenterLink
* RejectMerchantCenterLink
* UploadImage
* UploadMediaBundle
- Added support for the net6.0 target framework.
- Updated [`LogFormatter`](https://github.com/googleads/google-ads-dotnet/blob/main/Google.Ads.GoogleAds.Core/src/Logging/LogFormatter.cs)
to redact fields of Local Services Lead and Local Services Lead Conversation.
- Added support for the `useCloudOrgForApiAccess` configuration flag. This is in preparation for a
pilot project that uses Google Cloud orgs for API Access levels.
- Updated code examples:
* AddBillingSetup
* AddPerformanceMaxProductListingGroupTree
* AddCustomerMatchUserList
* UploadCallConversion
* UploadOfflineConversion
* UploadStoreSalesTransactions
- Renamed and updated code examples:
* UploadConversionWithIdentifiers to UploadEnhancedConversionsForLeads
* UploadConversionEnhancement to UploadEnhancedConversionsForWeb
- Fixed the following Shopping examples after the `ShoppingSetting::sales_country` field was
removed:
* AddMerchantCenterDynamicRemarketingCampaign
* AddPerformanceMaxRetailCampaign
* AddShoppingProductAd

17.0.1
======
- Fixed a bug with navigating nested properties in field masks (#533): return null when an
Expand Down
7 changes: 7 additions & 0 deletions Google.Ads.Gax/src/Config/ConfigSettingNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,12 @@ public class ConfigSettingNames
/// The configuration setting name for the linked customer id.
/// </summary>
public const string LINKED_CUSTOMER_ID = "LinkedCustomerId";

/// <summary>
/// The configuration setting name for a flag that specifies whether to use the Google
/// Cloud Organization of your Google Cloud project instead of developer token to
/// determine your Google Ads API access levels.
/// </summary>
public const string USE_CLOUD_ORG_FOR_API_ACCESS = "UseCloudOrgForApiAccess";
}
}
8 changes: 4 additions & 4 deletions Google.Ads.Gax/src/Google.Ads.Gax.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Title>Google Ads GAPIC Extensions Dotnet Client Library</Title>
<PackageId>Google.Ads.Gax</PackageId>
<Version>3.0.1</Version>
<Version>3.1.0</Version>
<Description>This library provides functionality that makes it easier to work with Generated
API Client GAPIC client libraries for Google's Ads APIs.</Description>
<PackageReleaseNotes>https://github.com/googleads/google-ads-dotnet/blob/main/ChangeLog</PackageReleaseNotes>
Expand All @@ -21,7 +21,7 @@
</PropertyGroup>
<!-- build properties -->
<PropertyGroup>
<TargetFrameworks>netstandard2.1;net472;net5.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net472;net5.0;net6.0</TargetFrameworks>
<AssemblyName>Google.Ads.Gax</AssemblyName>
<RootNamespace>Google.Ads.Gax</RootNamespace>
<SignAssembly>true</SignAssembly>
Expand All @@ -31,8 +31,8 @@
<IncludeSource>true</IncludeSource>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AssemblyVersion>3.0.1</AssemblyVersion>
<FileVersion>3.0.1</FileVersion>
<AssemblyVersion>3.1.0</AssemblyVersion>
<FileVersion>3.1.0</FileVersion>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion Google.Ads.Gax/tests/Google.Ads.Gax.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<TargetFrameworks>net5.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
<RootNamespace>Google.Ads.Gax.Tests</RootNamespace>
<AssemblyName>Google.Ads.Gax.Tests</AssemblyName>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Title>Google Ads GAPIC Extensions Dotnet Client Library Test Utils</Title>
<PackageId>Google.Ads.Gax.TestUtilities</PackageId>
<Version>1.0.1</Version>
<Version>1.0.4</Version>
<Description>This library provides testing functionality for GAPIC client libraries for Google's Ads APIs.</Description>
<PackageReleaseNotes>https://github.com/googleads/google-ads-dotnet/blob/main/ChangeLog</PackageReleaseNotes>
<PackageTags>GoogleAds Google Gax</PackageTags>
Expand All @@ -20,7 +20,7 @@
</PropertyGroup>
<!-- build properties -->
<PropertyGroup>
<TargetFrameworks>netstandard2.1;net472;net5.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net472;net5.0;net6.0</TargetFrameworks>
<AssemblyName>Google.Ads.Gax.TestUtilities</AssemblyName>
<RootNamespace>Google.Ads.Gax.TestUtilities</RootNamespace>
<SignAssembly>true</SignAssembly>
Expand Down
23 changes: 23 additions & 0 deletions Google.Ads.GoogleAds.Core/src/Config/GoogleAdsConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,15 @@ public class GoogleAdsConfig : AdsConfig
private readonly StringConfigSetting linkedCustomerId = new StringConfigSetting(
ConfigSettingNames.LINKED_CUSTOMER_ID, "");

/// <summary>
/// A flag that specifies whether to use the Google Cloud Organization of your Google Cloud
/// project instead of developer token to determine your Google Ads API access levels. Use
/// this flag only if you are enrolled into a limited pilot that supports this
/// configuration.
/// </summary>
private readonly ConfigSetting<bool> useCloudOrgForApiAccess =
new ConfigSetting<bool>(ConfigSettingNames.USE_CLOUD_ORG_FOR_API_ACCESS, false);

/// <summary>
/// Gets or sets the Google Ads API server URL.
/// </summary>
Expand Down Expand Up @@ -127,6 +136,19 @@ internal long ClientCustomerId
set => SetPropertyAndNotify(clientCustomerId, value);
}

/// <summary>
/// Gets or sets whether to use the Google Cloud Organization of your Google Cloud
/// project instead of developer token to determine your Google Ads API access levels.
/// configuration.
/// </summary>
/// <remarks> Use this flag only if you are enrolled into a limited pilot that supports
/// this configuration.</remarks>
public bool UseCloudOrgForApiAccess
{
get => useCloudOrgForApiAccess.Value;
set => SetPropertyAndNotify(useCloudOrgForApiAccess, value);
}

/// <summary>
/// Public constructor. Loads the configuration from the <code>GoogleAdsApi</code> section
/// of the App.config / Web.config.
Expand Down Expand Up @@ -156,6 +178,7 @@ public override void ReadSettings(Dictionary<string, string> settings)
ReadSetting(settings, loginCustomerId);
ReadSetting(settings, linkedCustomerId);
ReadSetting(settings, clientCustomerId);
ReadSetting(settings, useCloudOrgForApiAccess);
}

/// <summary>
Expand Down
10 changes: 5 additions & 5 deletions Google.Ads.GoogleAds.Core/src/Google.Ads.GoogleAds.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Title>Google Ads API Core Dotnet Client Library</Title>
<PackageId>Google.Ads.GoogleAds.Core</PackageId>
<Version>3.0.1</Version>
<Version>3.1.0</Version>
<Description>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.</Description>
<PackageReleaseNotes>https://github.com/googleads/google-ads-dotnet/blob/master/ChangeLog</PackageReleaseNotes>
<PackageTags>GoogleAds Google</PackageTags>
Expand All @@ -20,7 +20,7 @@
</PropertyGroup>
<!-- build properties -->
<PropertyGroup>
<TargetFrameworks>netstandard2.1;net472;net5.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net472;net5.0;net6.0</TargetFrameworks>
<AssemblyName>Google.Ads.GoogleAds.Core</AssemblyName>
<RootNamespace>Google.Ads.GoogleAds</RootNamespace>
<SignAssembly>true</SignAssembly>
Expand All @@ -30,8 +30,8 @@
<IncludeSource>true</IncludeSource>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AssemblyVersion>3.0.1</AssemblyVersion>
<FileVersion>3.0.1</FileVersion>
<AssemblyVersion>3.1.0</AssemblyVersion>
<FileVersion>3.1.0</FileVersion>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
Expand All @@ -40,7 +40,7 @@
<None Include="..\..\logo.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Condition="!Exists('..\..\Google.Ads.Gax\src\Google.Ads.Gax.csproj')" Include="Google.Ads.Gax" Version="3.0.1" />
<PackageReference Condition="!Exists('..\..\Google.Ads.Gax\src\Google.Ads.Gax.csproj')" Include="Google.Ads.Gax" Version="3.1.0" />
<ProjectReference Condition="Exists('..\..\Google.Ads.Gax\src\Google.Ads.Gax.csproj')" Include="..\..\Google.Ads.Gax\src\Google.Ads.Gax.csproj" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="6.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="6.0.1" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,13 @@ private CallSettings CreateCallSettings<TServiceSetting>(GoogleAdsConfig config,
private CallSettings UpdateCallSettingsWithConfigParameters(CallSettings callSettings,
GoogleAdsConfig config, GoogleAdsServiceContext serviceContext)
{
callSettings = callSettings.WithHeader(MetadataKeyNames.DeveloperToken,
config.DeveloperToken)
.WithResponseMetadataHandler(delegate (Metadata metadata)
if (!config.UseCloudOrgForApiAccess)
{
callSettings = callSettings.WithHeader(MetadataKeyNames.DeveloperToken,
config.DeveloperToken);
}

callSettings = callSettings.WithResponseMetadataHandler(delegate (Metadata metadata)
{
AdsResponseMetadata responseMetadata = new AdsResponseMetadata(metadata);
serviceContext.OnResponseMetadataReceived(responseMetadata);
Expand Down
12 changes: 12 additions & 0 deletions Google.Ads.GoogleAds.Core/src/Lib/MetadataKeyNames.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,5 +82,17 @@ internal class MetadataKeyNames
/// </summary>
internal const string FeedPlaceholderEmailAddress =
"feed.places_location_feed_data.email_address";

/// <summary>
/// The metadata key name for the Local services lead contact details.
/// </summary>
internal const string LocalServicesLeadContactDetails =
"local_services_lead.contact_details";

/// <summary>
/// The metadata key name for the Local services lead conversation message details text.
/// </summary>
internal const string LocalServicesLeadConversationMessageDetailText =
"local_services_lead_conversation.message_details.text";
}
}
2 changes: 2 additions & 0 deletions Google.Ads.GoogleAds.Core/src/Logging/LogFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ internal class LogFormatter : ILogFormatter
MetadataKeyNames.ChangeEventUserEmail,
MetadataKeyNames.FeedPlaceholderEmailAddress,
MetadataKeyNames.CustomerUserAccessInvitationEmailAddress,
MetadataKeyNames.LocalServicesLeadContactDetails,
MetadataKeyNames.LocalServicesLeadConversationMessageDetailText,
};

private static readonly Regex GAQL_REDACTION_MATCHER =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ internal class GoogleAdsConfigTests : GoogleAdsConfig
/// </summary>
private const string DEVELOPER_TOKEN_VALUE = "abcdefghijkl1234567890";

/// <summary>
/// Test value for <see cref="GoogleAdsConfig.UseCloudOrgForApiAccess"/> property.
/// </summary>
private const bool USE_CLOUD_ORG_FOR_API_ACCESS_VALUE = true;

/// <summary>
/// Test value for <see cref="GoogleAdsConfig.LoginCustomerId"/> property.
/// </summary>
Expand Down Expand Up @@ -131,6 +136,7 @@ internal class GoogleAdsConfigTests : GoogleAdsConfig
{ "MaxMetadataSizeInBytes", MAX_METADATA_SIZE_IN_BYTES_VALUE.ToString() },
{ "GoogleAds.Server", SERVER_URL_VALUE },
{ "DeveloperToken", DEVELOPER_TOKEN_VALUE },
{ "UseCloudOrgForApiAccess", USE_CLOUD_ORG_FOR_API_ACCESS_VALUE.ToString() },
{ "LoginCustomerId", LOGIN_CUSTOMER_ID_VALUE },
{ "LinkedCustomerId", LINKED_CUSTOMER_ID_VALUE },
{ "ClientCustomerId", CLIENT_CUSTOMER_ID_VALUE },
Expand Down Expand Up @@ -160,6 +166,7 @@ public void TestReadSettings()
Assert.AreEqual(MAX_RECEIVE_MESSAGE_SIZE_IN_BYTES_VALUE,
this.MaxReceiveMessageSizeInBytes);
Assert.AreEqual(MAX_METADATA_SIZE_IN_BYTES_VALUE, this.MaxMetadataSizeInBytes);
Assert.AreEqual(USE_CLOUD_ORG_FOR_API_ACCESS_VALUE, this.UseCloudOrgForApiAccess);
Assert.AreEqual(DEVELOPER_TOKEN_VALUE, this.DeveloperToken);
Assert.AreEqual(LOGIN_CUSTOMER_ID_VALUE, this.LoginCustomerId);
Assert.AreEqual(LINKED_CUSTOMER_ID_VALUE, this.LinkedCustomerId);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<TargetFrameworks>net5.0;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
<RootNamespace>Google.Ads.GoogleAds.Tests</RootNamespace>
<AssemblyName>Google.Ads.GoogleAds.Core.Tests</AssemblyName>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Title>Google Ads API Dotnet Client Library Extensions</Title>
<PackageId>Google.Ads.GoogleAds.Extensions</PackageId>
<Version>1.0.2</Version>
<Version>1.1.0</Version>
<Description>This library provides you with extensions for the Google Ads API client library. The Google Ads API is the modern programmatic interface to Google Ads. See https://developers.google.com/google-ads/api to learn more about Google Ads API.</Description>
<PackageReleaseNotes>https://github.com/googleads/google-ads-dotnet/blob/master/ChangeLog</PackageReleaseNotes>
<PackageTags>GoogleAds Google</PackageTags>
Expand All @@ -21,7 +21,7 @@
</PropertyGroup>
<!-- build properties -->
<PropertyGroup>
<TargetFrameworks>netstandard2.1;net472;net5.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net472;net5.0;net6.0</TargetFrameworks>
<AssemblyName>Google.Ads.GoogleAds.Config</AssemblyName>
<RootNamespace>Google.Ads.GoogleAds</RootNamespace>
<SignAssembly>true</SignAssembly>
Expand All @@ -31,8 +31,8 @@
<IncludeSource>true</IncludeSource>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AssemblyVersion>1.0.2</AssemblyVersion>
<FileVersion>1.0.2</FileVersion>
<AssemblyVersion>1.1.0</AssemblyVersion>
<FileVersion>1.1.0</FileVersion>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
Expand All @@ -45,9 +45,9 @@
<None Include="..\..\logo.png" Pack="true" PackagePath="" />
</ItemGroup>
<ItemGroup>
<PackageReference Condition="!Exists('..\..\Google.Ads.GoogleAds.Core\src\Google.Ads.GoogleAds.Core.csproj')" Include="Google.Ads.GoogleAds.Core" Version="3.0.1" />
<PackageReference Condition="!Exists('..\..\Google.Ads.GoogleAds.Core\src\Google.Ads.GoogleAds.Core.csproj')" Include="Google.Ads.GoogleAds.Core" Version="3.1.0" />
<ProjectReference Condition="Exists('..\..\Google.Ads.GoogleAds.Core\src\Google.Ads.GoogleAds.Core.csproj')" Include="..\..\Google.Ads.GoogleAds.Core\src\Google.Ads.GoogleAds.Core.csproj" />
<PackageReference Condition="!Exists('..\..\Google.Ads.Gax\src\Google.Ads.Gax.csproj')" Include="Google.Ads.Gax" Version="3.0.1" />
<PackageReference Condition="!Exists('..\..\Google.Ads.Gax\src\Google.Ads.Gax.csproj')" Include="Google.Ads.Gax" Version="3.1.0" />
<ProjectReference Condition="Exists('..\..\Google.Ads.Gax\src\Google.Ads.Gax.csproj')" Include="..\..\Google.Ads.Gax\src\Google.Ads.Gax.csproj" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.1" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk" ToolsVersion="15.0">
<PropertyGroup>
<TargetFrameworks>net5.0;netcoreapp3.1;net6.0</TargetFrameworks>
<TargetFrameworks>net5.0;net6.0</TargetFrameworks>
<RootNamespace>Google.Ads.GoogleAds.Extensions.Tests</RootNamespace>
<AssemblyName>Google.Ads.GoogleAds.Extensions.Tests</AssemblyName>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ namespace Google.Ads.GoogleAds.Examples.V14
///
/// To run this code example, you must use the Merchant Center UI or the Content API for
/// Shopping to send a link request between your Merchant Center and Google Ads accounts.
///
/// <remarks>This code example uses version v14 of the Google Ads API. Version v15 of the
/// Google Ads API replaces MerchantCenterLinkService with ProductLinkInvitationService and
/// ProductLinkService. We will add new code examples using these services shortly.</remarks>
/// </summary>
public class ApproveMerchantCenterLink : ExampleBase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
using Google.Ads.GoogleAds.V14.Errors;
using Google.Ads.GoogleAds.V14.Resources;
using Google.Ads.GoogleAds.V14.Services;
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.V14
namespace Google.Ads.GoogleAds.Examples.V15
{
/// <summary>
/// This code example illustrates how to create a new customer under a given manager account.
Expand Down Expand Up @@ -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.V14.CustomerService);
CustomerServiceClient customerService = client.GetService(Services.V15.CustomerService);

Customer customer = new Customer()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
using CommandLine;
using Google.Ads.Gax.Examples;
using Google.Ads.GoogleAds.Lib;
using Google.Ads.GoogleAds.V14.Resources;
using Google.Ads.GoogleAds.V14.Services;
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.V14
namespace Google.Ads.GoogleAds.Examples.V15
{
/// <summary>
/// This example gets the account hierarchy of the specified manager account. If you don't
Expand Down Expand Up @@ -99,10 +99,10 @@ public void Run(GoogleAdsClient googleAdsClient, long? managerCustomerId = null,
}

GoogleAdsServiceClient googleAdsServiceClient =
googleAdsClient.GetService(Services.V14.GoogleAdsService);
googleAdsClient.GetService(Services.V15.GoogleAdsService);

CustomerServiceClient customerServiceClient =
googleAdsClient.GetService(Services.V14.CustomerService);
googleAdsClient.GetService(Services.V15.CustomerService);

// List of Customer IDs to handle.
List<long> seedCustomerIds = new List<long>();
Expand Down
Loading

0 comments on commit f5e6e11

Please sign in to comment.