From e9ea621b93fbb58d9edfca8375918791637bbd52 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 30 Dec 2020 20:59:04 +0800 Subject: +init --- .../GoogleMobileAds/Api/AdRequest.cs | 113 +++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 Client/Assembly-CSharp/GoogleMobileAds/Api/AdRequest.cs (limited to 'Client/Assembly-CSharp/GoogleMobileAds/Api/AdRequest.cs') diff --git a/Client/Assembly-CSharp/GoogleMobileAds/Api/AdRequest.cs b/Client/Assembly-CSharp/GoogleMobileAds/Api/AdRequest.cs new file mode 100644 index 0000000..a303ea9 --- /dev/null +++ b/Client/Assembly-CSharp/GoogleMobileAds/Api/AdRequest.cs @@ -0,0 +1,113 @@ +using System; +using System.Collections.Generic; +using GoogleMobileAds.Api.Mediation; + +namespace GoogleMobileAds.Api +{ + public class AdRequest + { + public List TestDevices { get; private set; } + + public HashSet Keywords { get; private set; } + + public DateTime? Birthday { get; private set; } + + public Gender? Gender { get; private set; } + + public bool? TagForChildDirectedTreatment { get; private set; } + + public Dictionary Extras { get; private set; } + + public List MediationExtras { get; private set; } + + public const string Version = "3.17.0"; + + public const string TestDeviceSimulator = "SIMULATOR"; + + public class Builder + { + internal List TestDevices { get; private set; } + + internal HashSet Keywords { get; private set; } + + internal DateTime? Birthday { get; private set; } + + internal Gender? Gender { get; private set; } + + internal bool? ChildDirectedTreatmentTag { get; private set; } + + internal Dictionary Extras { get; private set; } + + internal List MediationExtras { get; private set; } + + public Builder() + { + this.TestDevices = new List(); + this.Keywords = new HashSet(); + this.Birthday = null; + this.Gender = null; + this.ChildDirectedTreatmentTag = null; + this.Extras = new Dictionary(); + this.MediationExtras = new List(); + } + + public AdRequest.Builder AddKeyword(string keyword) + { + this.Keywords.Add(keyword); + return this; + } + + public AdRequest.Builder AddTestDevice(string deviceId) + { + this.TestDevices.Add(deviceId); + return this; + } + + public AdRequest Build() + { + return new AdRequest(this); + } + + public AdRequest.Builder SetBirthday(DateTime birthday) + { + this.Birthday = new DateTime?(birthday); + return this; + } + + public AdRequest.Builder SetGender(Gender gender) + { + this.Gender = new Gender?(gender); + return this; + } + + public AdRequest.Builder AddMediationExtras(MediationExtras extras) + { + this.MediationExtras.Add(extras); + return this; + } + + public AdRequest.Builder TagForChildDirectedTreatment(bool tagForChildDirectedTreatment) + { + this.ChildDirectedTreatmentTag = new bool?(tagForChildDirectedTreatment); + return this; + } + + public AdRequest.Builder AddExtra(string key, string value) + { + this.Extras.Add(key, value); + return this; + } + } + + private AdRequest(AdRequest.Builder builder) + { + this.TestDevices = new List(builder.TestDevices); + this.Keywords = new HashSet(builder.Keywords); + this.Birthday = builder.Birthday; + this.Gender = builder.Gender; + this.TagForChildDirectedTreatment = builder.ChildDirectedTreatmentTag; + this.Extras = new Dictionary(builder.Extras); + this.MediationExtras = builder.MediationExtras; + } + } +} -- cgit v1.1-26-g67d0