Skip to content

Commit

Permalink
Merge pull request #594 from googleads/release-V22.0.0-29f4d474ae8157…
Browse files Browse the repository at this point in the history
…e4f99d

Changes for release V22.0.0.
  • Loading branch information
Raibaz authored Jan 20, 2025
2 parents b96df47 + 0ff1a65 commit 9416a50
Show file tree
Hide file tree
Showing 1,405 changed files with 74 additions and 800,771 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
22.0.0
======
- Removed support for version 16 of the Google Ads API.
- Added support for setting more configuration properties via dependency injection (fixes #592).

21.1.1
======
- Added support for configuring service account credentials from a JSON stream.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,9 @@
// limitations under the License.

using Google.Ads.GoogleAds.Config;
using Newtonsoft.Json;
using NUnit.Framework;
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;

namespace Google.Ads.GoogleAds.Tests.Config
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,39 @@ public class GoogleAdsApiOptions
/// <remarks>This setting is applicable only when using OAuth2 web / application
/// flow in offline mode.</remarks>
public string OAuth2RefreshToken { get; set; }

/// <summary>
/// Gets or sets the OAuth2 PRN email.
/// </summary>
public string OAuth2PrnEmail { get; set; }

/// <summary>
/// Gets or sets the OAuth2 secrets JSON path.
/// </summary>
public string OAuth2SecretsJsonPath { get; set; }

/// <summary>
/// Gets or sets the OAuth2 scope.
/// </summary>
public string OAuth2Scope { get; set; }

/// <summary>
/// Gets or sets the 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 bool UseCloudOrgForApiAccess { get; set; }

/// <summary>
/// Gets or sets the maximum size in bytes of the message that can be received by the
/// service client.
/// </summary>
public int MaxReceiveMessageSizeInBytes { get; set; }

/// <summary>
/// Gets or sets the maximum size in bytes of the metadata that can be received by the
/// service client.
/// </summary>
public int MaxMetadataSizeInBytes { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ public GoogleAdsConfig(IOptions<GoogleAdsApiOptions> options)
OAuth2ClientId = options.Value.OAuth2ClientId;
OAuth2ClientSecret = options.Value.OAuth2ClientSecret;
OAuth2RefreshToken = options.Value.OAuth2RefreshToken;
OAuth2PrnEmail = options.Value.OAuth2PrnEmail;
OAuth2SecretsJsonPath = options.Value.OAuth2SecretsJsonPath;
OAuth2Scope = options.Value.OAuth2Scope + "";
UseCloudOrgForApiAccess = options.Value.UseCloudOrgForApiAccess;
MaxReceiveMessageSizeInBytes = options.Value.MaxReceiveMessageSizeInBytes;
MaxMetadataSizeInBytes = options.Value.MaxMetadataSizeInBytes;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
<IncludeSource>true</IncludeSource>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AssemblyVersion>2.0.3</AssemblyVersion>
<FileVersion>2.0.3</FileVersion>
<AssemblyVersion>2.0.4</AssemblyVersion>
<FileVersion>2.0.4</FileVersion>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
using System.IO;
using Google.Ads.GoogleAds.Lib;
using Google.Ads.GoogleAds.V18.Services;
using Grpc.Auth;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using NUnit.Framework;
Expand Down Expand Up @@ -44,6 +43,13 @@ public void TestGetGoogleAdsClientFromDIContainer()
Assert.AreEqual("TEST_OAUTH2_CLIENT_ID", googleAdsService.ServiceContext.Client.Config.OAuth2ClientId);
Assert.AreEqual("TEST_OAUTH2_CLIENT_SECRET", googleAdsService.ServiceContext.Client.Config.OAuth2ClientSecret);
Assert.AreEqual("TEST_OAUTH2_REFRESH_TOKEN", googleAdsService.ServiceContext.Client.Config.OAuth2RefreshToken);
Assert.AreEqual("TEST_OAUTH2_PRN_EMAIL", googleAdsService.ServiceContext.Client.Config.OAuth2PrnEmail);
Assert.AreEqual("TEST_EMAIL", googleAdsService.ServiceContext.Client.Config.OAuth2ServiceAccountEmail);
Assert.AreEqual("TEST_PRIVATE_KEY", googleAdsService.ServiceContext.Client.Config.OAuth2PrivateKey);
Assert.AreEqual("TEST_SCOPE", googleAdsService.ServiceContext.Client.Config.OAuth2Scope);
Assert.IsTrue(googleAdsService.ServiceContext.Client.Config.UseCloudOrgForApiAccess);
Assert.AreEqual(12345, googleAdsService.ServiceContext.Client.Config.MaxReceiveMessageSizeInBytes);
Assert.AreEqual(54321, googleAdsService.ServiceContext.Client.Config.MaxMetadataSizeInBytes);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,15 @@
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<PackageReference Condition="!Exists('..\..\Google.Ads.GoogleAds\src\Google.Ads.GoogleAds.csproj')" Include="Google.Ads.GoogleAds" Version="21.1.1" />
<PackageReference Condition="!Exists('..\..\Google.Ads.GoogleAds\src\Google.Ads.GoogleAds.csproj')" Include="Google.Ads.GoogleAds" Version="22.0.0" />
<ProjectReference Condition="Exists('..\..\Google.Ads.GoogleAds\src\Google.Ads.GoogleAds.csproj')" Include="..\..\Google.Ads.GoogleAds\src\Google.Ads.GoogleAds.csproj" />
</ItemGroup>
<ItemGroup>
<None Update="appsettings.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="oauth_test_credentials.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
8 changes: 7 additions & 1 deletion Google.Ads.GoogleAds.Extensions/tests/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
"OAuth2ClientId": "TEST_OAUTH2_CLIENT_ID",
"DeveloperToken": "abcdefghijkl1234567890",
"OAuth2ClientSecret": "TEST_OAUTH2_CLIENT_SECRET",
"OAuth2RefreshToken": "TEST_OAUTH2_REFRESH_TOKEN"
"OAuth2RefreshToken": "TEST_OAUTH2_REFRESH_TOKEN",
"OAuth2PrnEmail": "TEST_OAUTH2_PRN_EMAIL",
"OAuth2Scope": "TEST_SCOPE",
"OAuth2SecretsJsonPath": "oauth_test_credentials.json",
"UseCloudOrgForApiAccess": true,
"MaxReceiveMessageSizeInBytes": 12345,
"MaxMetadataSizeInBytes": 54321
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"client_email": "TEST_EMAIL",
"private_key": "TEST_PRIVATE_KEY"
}
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
</ItemGroup>
<ItemGroup>
<!-- Include local projects over nuget dependencies if available -->
<PackageReference Condition="!Exists('..\src\Google.Ads.GoogleAds.csproj')" Include="Google.Ads.GoogleAds" Version="21.1.1" />
<PackageReference Condition="!Exists('..\src\Google.Ads.GoogleAds.csproj')" Include="Google.Ads.GoogleAds" Version="22.0.0" />
<ProjectReference Condition="Exists('..\src\Google.Ads.GoogleAds.csproj')" Include="..\src\Google.Ads.GoogleAds.csproj" />
<PackageReference Condition="!Exists('..\..\Google.Ads.GoogleAds.Extensions\src\Google.Ads.GoogleAds.Extensions.csproj')" Include="Google.Ads.GoogleAds.Extensions" Version="2.0.3" />
<PackageReference Condition="!Exists('..\..\Google.Ads.GoogleAds.Extensions\src\Google.Ads.GoogleAds.Extensions.csproj')" Include="Google.Ads.GoogleAds.Extensions" Version="2.0.4" />
<ProjectReference Condition="Exists('..\..\Google.Ads.GoogleAds.Extensions\src\Google.Ads.GoogleAds.Extensions.csproj')" Include="..\..\Google.Ads.GoogleAds.Extensions\src\Google.Ads.GoogleAds.Extensions.csproj" />
</ItemGroup>
<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions Google.Ads.GoogleAds/src/Google.Ads.GoogleAds.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PropertyGroup>
<Title>Google Ads API Dotnet Client Library</Title>
<PackageId>Google.Ads.GoogleAds</PackageId>
<Version>21.1.1</Version>
<Version>22.0.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 @@ -30,8 +30,8 @@
<IncludeSource>true</IncludeSource>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<AssemblyVersion>21.1.1</AssemblyVersion>
<FileVersion>21.1.1</FileVersion>
<AssemblyVersion>22.0.0</AssemblyVersion>
<FileVersion>22.0.0</FileVersion>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
Expand Down
Loading

0 comments on commit 9416a50

Please sign in to comment.