Skip to content

Commit 9416a50

Browse files
authored
Merge pull request #594 from googleads/release-V22.0.0-29f4d474ae8157e4f99d
Changes for release V22.0.0.
2 parents b96df47 + 0ff1a65 commit 9416a50

File tree

1,405 files changed

+74
-800771
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,405 files changed

+74
-800771
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
22.0.0
2+
======
3+
- Removed support for version 16 of the Google Ads API.
4+
- Added support for setting more configuration properties via dependency injection (fixes #592).
5+
16
21.1.1
27
======
38
- Added support for configuring service account credentials from a JSON stream.

Google.Ads.GoogleAds.Core/tests/Config/GoogleAdsConfigTests.cs

-2
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,9 @@
1313
// limitations under the License.
1414

1515
using Google.Ads.GoogleAds.Config;
16-
using Newtonsoft.Json;
1716
using NUnit.Framework;
1817
using System;
1918
using System.Collections.Generic;
20-
using System.IO;
2119
using System.Net;
2220

2321
namespace Google.Ads.GoogleAds.Tests.Config

Google.Ads.GoogleAds.Extensions/src/DependencyInjection/GoogleAdsApiOptions.cs

+34
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,39 @@ public class GoogleAdsApiOptions
3636
/// <remarks>This setting is applicable only when using OAuth2 web / application
3737
/// flow in offline mode.</remarks>
3838
public string OAuth2RefreshToken { get; set; }
39+
40+
/// <summary>
41+
/// Gets or sets the OAuth2 PRN email.
42+
/// </summary>
43+
public string OAuth2PrnEmail { get; set; }
44+
45+
/// <summary>
46+
/// Gets or sets the OAuth2 secrets JSON path.
47+
/// </summary>
48+
public string OAuth2SecretsJsonPath { get; set; }
49+
50+
/// <summary>
51+
/// Gets or sets the OAuth2 scope.
52+
/// </summary>
53+
public string OAuth2Scope { get; set; }
54+
55+
/// <summary>
56+
/// Gets or sets the flag that specifies whether to use the Google Cloud Organization of
57+
/// your Google Cloud project instead of developer token to determine your Google Ads API
58+
/// access levels.
59+
/// </summary>
60+
public bool UseCloudOrgForApiAccess { get; set; }
61+
62+
/// <summary>
63+
/// Gets or sets the maximum size in bytes of the message that can be received by the
64+
/// service client.
65+
/// </summary>
66+
public int MaxReceiveMessageSizeInBytes { get; set; }
67+
68+
/// <summary>
69+
/// Gets or sets the maximum size in bytes of the metadata that can be received by the
70+
/// service client.
71+
/// </summary>
72+
public int MaxMetadataSizeInBytes { get; set; }
3973
}
4074
}

Google.Ads.GoogleAds.Extensions/src/DependencyInjection/GoogleAdsConfig.cs

+6
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ public GoogleAdsConfig(IOptions<GoogleAdsApiOptions> options)
2020
OAuth2ClientId = options.Value.OAuth2ClientId;
2121
OAuth2ClientSecret = options.Value.OAuth2ClientSecret;
2222
OAuth2RefreshToken = options.Value.OAuth2RefreshToken;
23+
OAuth2PrnEmail = options.Value.OAuth2PrnEmail;
24+
OAuth2SecretsJsonPath = options.Value.OAuth2SecretsJsonPath;
25+
OAuth2Scope = options.Value.OAuth2Scope + "";
26+
UseCloudOrgForApiAccess = options.Value.UseCloudOrgForApiAccess;
27+
MaxReceiveMessageSizeInBytes = options.Value.MaxReceiveMessageSizeInBytes;
28+
MaxMetadataSizeInBytes = options.Value.MaxMetadataSizeInBytes;
2329
}
2430
}
2531
}

Google.Ads.GoogleAds.Extensions/src/Google.Ads.GoogleAds.Extensions.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@
3131
<IncludeSource>true</IncludeSource>
3232
<GenerateDocumentationFile>true</GenerateDocumentationFile>
3333
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
34-
<AssemblyVersion>2.0.3</AssemblyVersion>
35-
<FileVersion>2.0.3</FileVersion>
34+
<AssemblyVersion>2.0.4</AssemblyVersion>
35+
<FileVersion>2.0.4</FileVersion>
3636
<LangVersion>latest</LangVersion>
3737
</PropertyGroup>
3838
<ItemGroup>

Google.Ads.GoogleAds.Extensions/tests/DependencyInjection/TestGoogleAdsClientServiceCollectionExtensions.cs

+7-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
using System.IO;
33
using Google.Ads.GoogleAds.Lib;
44
using Google.Ads.GoogleAds.V18.Services;
5-
using Grpc.Auth;
65
using Microsoft.Extensions.Configuration;
76
using Microsoft.Extensions.DependencyInjection;
87
using NUnit.Framework;
@@ -44,6 +43,13 @@ public void TestGetGoogleAdsClientFromDIContainer()
4443
Assert.AreEqual("TEST_OAUTH2_CLIENT_ID", googleAdsService.ServiceContext.Client.Config.OAuth2ClientId);
4544
Assert.AreEqual("TEST_OAUTH2_CLIENT_SECRET", googleAdsService.ServiceContext.Client.Config.OAuth2ClientSecret);
4645
Assert.AreEqual("TEST_OAUTH2_REFRESH_TOKEN", googleAdsService.ServiceContext.Client.Config.OAuth2RefreshToken);
46+
Assert.AreEqual("TEST_OAUTH2_PRN_EMAIL", googleAdsService.ServiceContext.Client.Config.OAuth2PrnEmail);
47+
Assert.AreEqual("TEST_EMAIL", googleAdsService.ServiceContext.Client.Config.OAuth2ServiceAccountEmail);
48+
Assert.AreEqual("TEST_PRIVATE_KEY", googleAdsService.ServiceContext.Client.Config.OAuth2PrivateKey);
49+
Assert.AreEqual("TEST_SCOPE", googleAdsService.ServiceContext.Client.Config.OAuth2Scope);
50+
Assert.IsTrue(googleAdsService.ServiceContext.Client.Config.UseCloudOrgForApiAccess);
51+
Assert.AreEqual(12345, googleAdsService.ServiceContext.Client.Config.MaxReceiveMessageSizeInBytes);
52+
Assert.AreEqual(54321, googleAdsService.ServiceContext.Client.Config.MaxMetadataSizeInBytes);
4753
}
4854

4955
}

Google.Ads.GoogleAds.Extensions/tests/Google.Ads.GoogleAds.Extensions.Tests.csproj

+4-1
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,15 @@
4343
</EmbeddedResource>
4444
</ItemGroup>
4545
<ItemGroup>
46-
<PackageReference Condition="!Exists('..\..\Google.Ads.GoogleAds\src\Google.Ads.GoogleAds.csproj')" Include="Google.Ads.GoogleAds" Version="21.1.1" />
46+
<PackageReference Condition="!Exists('..\..\Google.Ads.GoogleAds\src\Google.Ads.GoogleAds.csproj')" Include="Google.Ads.GoogleAds" Version="22.0.0" />
4747
<ProjectReference Condition="Exists('..\..\Google.Ads.GoogleAds\src\Google.Ads.GoogleAds.csproj')" Include="..\..\Google.Ads.GoogleAds\src\Google.Ads.GoogleAds.csproj" />
4848
</ItemGroup>
4949
<ItemGroup>
5050
<None Update="appsettings.json">
5151
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
5252
</None>
53+
<None Update="oauth_test_credentials.json">
54+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
55+
</None>
5356
</ItemGroup>
5457
</Project>

Google.Ads.GoogleAds.Extensions/tests/appsettings.json

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@
44
"OAuth2ClientId": "TEST_OAUTH2_CLIENT_ID",
55
"DeveloperToken": "abcdefghijkl1234567890",
66
"OAuth2ClientSecret": "TEST_OAUTH2_CLIENT_SECRET",
7-
"OAuth2RefreshToken": "TEST_OAUTH2_REFRESH_TOKEN"
7+
"OAuth2RefreshToken": "TEST_OAUTH2_REFRESH_TOKEN",
8+
"OAuth2PrnEmail": "TEST_OAUTH2_PRN_EMAIL",
9+
"OAuth2Scope": "TEST_SCOPE",
10+
"OAuth2SecretsJsonPath": "oauth_test_credentials.json",
11+
"UseCloudOrgForApiAccess": true,
12+
"MaxReceiveMessageSizeInBytes": 12345,
13+
"MaxMetadataSizeInBytes": 54321
814
}
915
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"client_email": "TEST_EMAIL",
3+
"private_key": "TEST_PRIVATE_KEY"
4+
}

Google.Ads.GoogleAds/examples/Google.Ads.GoogleAds.Examples.csproj

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@
3434
</ItemGroup>
3535
<ItemGroup>
3636
<!-- Include local projects over nuget dependencies if available -->
37-
<PackageReference Condition="!Exists('..\src\Google.Ads.GoogleAds.csproj')" Include="Google.Ads.GoogleAds" Version="21.1.1" />
37+
<PackageReference Condition="!Exists('..\src\Google.Ads.GoogleAds.csproj')" Include="Google.Ads.GoogleAds" Version="22.0.0" />
3838
<ProjectReference Condition="Exists('..\src\Google.Ads.GoogleAds.csproj')" Include="..\src\Google.Ads.GoogleAds.csproj" />
39-
<PackageReference Condition="!Exists('..\..\Google.Ads.GoogleAds.Extensions\src\Google.Ads.GoogleAds.Extensions.csproj')" Include="Google.Ads.GoogleAds.Extensions" Version="2.0.3" />
39+
<PackageReference Condition="!Exists('..\..\Google.Ads.GoogleAds.Extensions\src\Google.Ads.GoogleAds.Extensions.csproj')" Include="Google.Ads.GoogleAds.Extensions" Version="2.0.4" />
4040
<ProjectReference Condition="Exists('..\..\Google.Ads.GoogleAds.Extensions\src\Google.Ads.GoogleAds.Extensions.csproj')" Include="..\..\Google.Ads.GoogleAds.Extensions\src\Google.Ads.GoogleAds.Extensions.csproj" />
4141
</ItemGroup>
4242
<ItemGroup>

Google.Ads.GoogleAds/src/Google.Ads.GoogleAds.csproj

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<PropertyGroup>
44
<Title>Google Ads API Dotnet Client Library</Title>
55
<PackageId>Google.Ads.GoogleAds</PackageId>
6-
<Version>21.1.1</Version>
6+
<Version>22.0.0</Version>
77
<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>
88
<PackageReleaseNotes>https://github.com/googleads/google-ads-dotnet/blob/master/ChangeLog</PackageReleaseNotes>
99
<PackageTags>GoogleAds Google</PackageTags>
@@ -30,8 +30,8 @@
3030
<IncludeSource>true</IncludeSource>
3131
<GenerateDocumentationFile>true</GenerateDocumentationFile>
3232
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
33-
<AssemblyVersion>21.1.1</AssemblyVersion>
34-
<FileVersion>21.1.1</FileVersion>
33+
<AssemblyVersion>22.0.0</AssemblyVersion>
34+
<FileVersion>22.0.0</FileVersion>
3535
<LangVersion>latest</LangVersion>
3636
</PropertyGroup>
3737
<ItemGroup>

0 commit comments

Comments
 (0)