11using System.Collections.Generic;
12using System.Diagnostics;
29 public string Age {
get;
private set; }
44 public string Gender {
get;
private set; }
59 public Dictionary<string, string>
Parameters {
get;
private set; }
64 this.Age = builder.Age;
65 this.ContextQuery = builder.ContextQuery;
67 if (builder.ContextTags !=
null)
69 this.ContextTags =
new List<string>(builder.ContextTags);
72 this.Gender = builder.Gender;
73 this.Location = builder.Location;
74 this.AdTheme = builder.AdTheme;
76 if (builder.Parameters !=
null)
78 this.Parameters =
new Dictionary<string, string>(builder.Parameters);
88 internal string AdUnitId {
get;
private set; }
90 internal string Age {
get;
private set; }
92 internal string ContextQuery {
get;
private set; }
94 internal List<string> ContextTags {
get;
private set; }
96 internal string Gender {
get;
private set; }
102 internal Dictionary<string, string> Parameters {
get;
private set; }
110 this.AdUnitId = adUnitId;
131 this.ContextQuery = contextQuery;
142 this.ContextTags = contextTags;
153 this.Gender = gender;
164 this.Location = location;
175 this.AdTheme = preferredTheme;
186 this.Parameters = parameters;
197 if (adRequestConfiguration !=
null)
199 this.ContextQuery = adRequestConfiguration.
ContextQuery;
200 this.ContextTags = adRequestConfiguration.
ContextTags;
201 this.Parameters = adRequestConfiguration.
Parameters;
202 this.Location = adRequestConfiguration.
Location;
203 this.Age = adRequestConfiguration.
Age;
204 this.AdTheme = adRequestConfiguration.
AdTheme;
205 this.Gender = adRequestConfiguration.
Gender;
216 if (this.Parameters ==
null)
218 this.Parameters =
new Dictionary<string, string>();
A class responsible for creating AdRequest objects.
Builder WithAge(string age)
AdRequest Builder initialized with user's Age for targeting process.
Builder WithContextQuery(string contextQuery)
AdRequest Builder initialized with current user query entered inside app.
Builder WithPreferredTheme(AdTheme preferredTheme)
Sets preferred theme.
Builder WithContextTags(List< string > contextTags)
AdRequest Builder initialized with tags describing current user context inside app.
Builder(string adUnitId)
Instantiates a Builder instance.
AdRequestConfiguration Build()
Creates AdRequest based on current builder parameters.
Builder WithGender(string gender)
AdRequest Builder initialized with user's Gender for targeting process.
Builder WithParameters(Dictionary< string, string > parameters)
AdRequest Builder initialized with custom Parameters.
Builder WithAdRequestConfiguration(AdRequestConfiguration adRequestConfiguration)
AdRequest Builder initialized with AdRequest.
Builder WithLocation(Location location)
AdRequest Builder initialized with user's Location for targeting process.
A class with data for a targeted ad request.
Location Location
User location.
AdTheme AdTheme
Preferred theme.
string Gender
The string representation of user's gender. See the list of values in Gender.
string Age
The string representation of user's age.
string AdUnitId
The string representation of user's age.
List< string > ContextTags
An array of tags.Matches the context in which the ad will be displayed.
string ContextQuery
The search query that the user entered in the app.
Dictionary< string, string > Parameters
A set of arbitrary input parameters.