Skip to content

Commit 5baf22e

Browse files
Mobile Ads Developer Relationscopybara-github
authored andcommitted
No public description
PiperOrigin-RevId: 794293747
1 parent 944025b commit 5baf22e

28 files changed

+696
-398
lines changed
Lines changed: 21 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// <copyright file="AdChoicesPlacement.cs" company="Google LLC">
12
// Copyright (C) 2023 Google, Inc.
23
//
34
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -11,6 +12,7 @@
1112
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1213
// See the License for the specific language governing permissions and
1314
// limitations under the License.
15+
// </copyright>
1416

1517
namespace GoogleMobileAds.Api
1618
{
@@ -19,21 +21,24 @@ namespace GoogleMobileAds.Api
1921
/// </summary>
2022
public enum AdChoicesPlacement
2123
{
22-
/// <summary>
23-
/// Ad Choices icon in top right corner
24-
/// </summary>
25-
TopRightCorner = 0,
26-
/// <summary>
27-
/// Ad Choices icon in top left corner
28-
/// </summary>
29-
TopLeftCorner = 1,
30-
/// <summary>
31-
/// Ad Choices icon in bottom right corner
32-
/// </summary>
33-
BottomRightCorner = 2,
34-
/// <summary>
35-
/// Ad Choices icon in bottom left corner
36-
/// </summary>
37-
BottomLeftCorner = 3,
24+
/// <summary>
25+
/// Ad Choices icon in top right corner.
26+
/// </summary>
27+
TopRightCorner = 0,
28+
29+
/// <summary>
30+
/// Ad Choices icon in top left corner.
31+
/// </summary>
32+
TopLeftCorner = 1,
33+
34+
/// <summary>
35+
/// Ad Choices icon in bottom right corner.
36+
/// </summary>
37+
BottomRightCorner = 2,
38+
39+
/// <summary>
40+
/// Ad Choices icon in bottom left corner.
41+
/// </summary>
42+
BottomLeftCorner = 3,
3843
}
3944
}

source/plugin/Assets/GoogleMobileAds/Api/Core/AdFormat.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// <copyright file="AdFormat.cs" company="Google LLC">
12
// Copyright (C) 2024 Google, Inc.
23
//
34
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -11,6 +12,7 @@
1112
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1213
// See the License for the specific language governing permissions and
1314
// limitations under the License.
15+
// </copyright>
1416

1517
namespace GoogleMobileAds.Api
1618
{
@@ -19,17 +21,34 @@ namespace GoogleMobileAds.Api
1921
/// </summary>
2022
public enum AdFormat
2123
{
24+
/// <summary>
2225
/// Banner ad format.
26+
/// </summary>
2327
BANNER = 0,
28+
29+
/// <summary>
2430
/// Interstitial ad format.
31+
/// </summary>
2532
INTERSTITIAL = 1,
33+
34+
/// <summary>
2635
/// Rewarded ad format.
36+
/// </summary>
2737
REWARDED = 2,
38+
39+
/// <summary>
2840
/// Rewarded interstitial ad format.
41+
/// </summary>
2942
REWARDED_INTERSTITIAL = 3,
43+
44+
/// <summary>
3045
/// Native ad format.
46+
/// </summary>
3147
NATIVE = 4,
48+
49+
/// <summary>
3250
/// App open ad format.
51+
/// </summary>
3352
APP_OPEN_AD = 5
3453
}
3554
}

source/plugin/Assets/GoogleMobileAds/Api/Core/AdManagerAdRequest.cs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
1+
// <copyright file="AdManagerAdRequest.cs" company="Google LLC">
22
// Copyright (C) 2023 Google, Inc.
33
//
44
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -12,12 +12,13 @@
1212
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1313
// See the License for the specific language governing permissions and
1414
// limitations under the License.
15-
16-
using System;
17-
using System.Collections.Generic;
15+
// </copyright>
1816

1917
namespace GoogleMobileAds.Api.AdManager
2018
{
19+
using System;
20+
using System.Collections.Generic;
21+
2122
/// <summary>
2223
/// An <see cref="AdManagerAdRequest"/> contains targeting information used to fetch an ad from
2324
/// Google Ad Manager.
@@ -40,11 +41,14 @@ public class AdManagerAdRequest : AdRequest
4041
/// <summary>
4142
/// Create a new AdManagerAdRequest object.
4243
/// </summary>
43-
public AdManagerAdRequest() : base() {}
44+
public AdManagerAdRequest() : base()
45+
{
46+
}
4447

4548
/// <summary>
4649
/// Create a copy of AdManagerAdRequest object.
4750
/// </summary>
51+
/// <param name="request">The AdManagerAdRequest to copy.</param>
4852
public AdManagerAdRequest(AdManagerAdRequest request) : base(request)
4953
{
5054
PublisherProvidedId = request.PublisherProvidedId;
Lines changed: 30 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// <copyright file="AdPosition.cs" company="Google LLC">
12
// Copyright (C) 2015 Google, Inc.
23
//
34
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -11,6 +12,7 @@
1112
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1213
// See the License for the specific language governing permissions and
1314
// limitations under the License.
15+
// </copyright>
1416

1517
namespace GoogleMobileAds.Api
1618
{
@@ -19,19 +21,40 @@ namespace GoogleMobileAds.Api
1921
/// </summary>
2022
public enum AdPosition
2123
{
22-
/// Top
24+
25+
/// <summary>
26+
/// Top of the screen, center aligned.
27+
/// </summary>
2328
Top = 0,
24-
/// Bottom
29+
30+
/// <summary>
31+
/// Bottom of the screen, center aligned.
32+
/// </summary>
2533
Bottom = 1,
26-
/// Top left
34+
35+
/// <summary>
36+
/// Top left corner of the screen.
37+
/// </summary>
2738
TopLeft = 2,
28-
/// Top right
39+
40+
/// <summary>
41+
/// Top right corner of the screen.
42+
/// </summary>
2943
TopRight = 3,
30-
/// Bottom left
44+
45+
/// <summary>
46+
/// Bottom left corner of the screen.
47+
/// </summary>
3148
BottomLeft = 4,
32-
/// Bottom right
49+
50+
/// <summary>
51+
/// Bottom right corner of the screen.
52+
/// </summary>
3353
BottomRight = 5,
34-
/// Center
54+
55+
/// <summary>
56+
/// Centered on the screen both horizontally and vertically.
57+
/// </summary>
3558
Center = 6
3659
}
3760
}

source/plugin/Assets/GoogleMobileAds/Api/Core/AdRequest.cs

Lines changed: 38 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// <copyright file="AdRequest.cs" company="Google LLC">
12
// Copyright (C) 2015 Google, Inc.
23
//
34
// Licensed under the Apache License, Version 2.0 (the "License");
@@ -11,28 +12,23 @@
1112
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1213
// See the License for the specific language governing permissions and
1314
// limitations under the License.
14-
15-
using System;
16-
using System.Text;
17-
using System.Collections.Generic;
18-
using UnityEngine;
19-
20-
using GoogleMobileAds.Api.Mediation;
15+
// </copyright>
2116

2217
namespace GoogleMobileAds.Api
2318
{
19+
using System;
20+
using System.Collections.Generic;
21+
using System.Text;
22+
using GoogleMobileAds.Api.Mediation;
23+
using UnityEngine;
24+
2425
/// <summary>
2526
/// An <see cref="AdRequest"/> contains targeting information used to fetch an ad.
2627
/// Ad requests are created using <see cref="AdRequest.Builder"/>.
2728
/// </summary>
2829
[Serializable]
2930
public class AdRequest
3031
{
31-
/// <summary>
32-
/// Request version string.
33-
/// </summary>
34-
public static string Version { get; private set; }
35-
3632
/// <summary>
3733
/// Test device ID used to load test ads.
3834
/// <seealso href="https://developers.google.com/admob/unity/test-ads"/>.
@@ -44,14 +40,38 @@ public class AdRequest
4440
/// </summary>
4541
public Dictionary<string, string> CustomTargeting = new Dictionary<string, string>();
4642

43+
/// <summary>
44+
/// Targeting information keywords set. Empty if no keywords were added.
45+
/// </summary>
46+
public HashSet<string> Keywords = new HashSet<string>();
47+
48+
/// <summary>
49+
/// Dictionary of extra parameters to be sent in the ad request.
50+
/// </summary>
51+
public Dictionary<string, string> Extras = new Dictionary<string, string>();
52+
53+
/// <summary>
54+
/// Extra parameters to be sent to a specific ad partner in the ad request.
55+
/// </summary>
56+
public List<MediationExtras> MediationExtras = new List<MediationExtras>();
57+
4758
static AdRequest()
4859
{
4960
Version version = typeof(AdRequest).Assembly.GetName().Version;
5061
Version = string.Format("{0}.{1}.{2}", version.Major, version.Minor, version.Build);
5162
}
5263

53-
public AdRequest() {}
64+
/// <summary>
65+
/// Initializes a new instance of the <see cref="AdRequest"/> class.
66+
/// </summary>
67+
public AdRequest()
68+
{
69+
}
5470

71+
/// <summary>
72+
/// Initializes a new instance of the <see cref="AdRequest"/> class.
73+
/// </summary>
74+
/// <param name="request">The <see cref="AdRequest"/> to copy.</param>
5575
public AdRequest(AdRequest request)
5676
{
5777
Keywords = request.Keywords;
@@ -61,28 +81,20 @@ public AdRequest(AdRequest request)
6181
}
6282

6383
/// <summary>
64-
/// Returns targeting information keywords. Returns an empty set if no keywords were added.
65-
/// </summary>
66-
public HashSet<string> Keywords = new HashSet<string>();
67-
68-
/// <summary>
69-
/// Returns extra parameters to be sent in the ad request.
84+
/// Gets the request version string.
7085
/// </summary>
71-
public Dictionary<string, string> Extras = new Dictionary<string, string>();
72-
73-
/// <summary>
74-
/// Returns extra parameters to be sent to a specific ad partner in the ad request.
75-
/// </summary>
76-
public List<MediationExtras> MediationExtras = new List<MediationExtras>();
86+
public static string Version { get; private set; }
7787

7888
internal static string BuildVersionString(string nativePluginVersion = null)
7989
{
8090
var versionBuilder = new StringBuilder("unity-");
8191
versionBuilder.Append(AdRequest.Version);
82-
if (!string.IsNullOrEmpty(nativePluginVersion)) {
92+
if (!string.IsNullOrEmpty(nativePluginVersion))
93+
{
8394
versionBuilder.Append("-native-");
8495
versionBuilder.Append(nativePluginVersion);
8596
}
97+
8698
return versionBuilder.ToString();
8799
}
88100
}

0 commit comments

Comments
 (0)