11using System.Collections.Generic;
24 public string Age {
get;
private set; }
39 public string Gender {
get;
private set; }
54 public Dictionary<string, string>
Parameters {
get;
private set; }
58 this.Age = builder.
Age;
59 this.ContextQuery = builder.ContextQuery;
61 if (builder.ContextTags !=
null)
63 this.ContextTags =
new List<string>(builder.ContextTags);
66 this.Gender = builder.Gender;
67 this.Location = builder.Location;
68 this.AdTheme = builder.AdTheme;
70 if (builder.Parameters !=
null)
72 this.Parameters =
new Dictionary<string, string>(builder.Parameters);
82 internal string Age {
get;
private set; }
84 internal string ContextQuery {
get;
private set; }
86 internal List<string> ContextTags {
get;
private set; }
88 internal string Gender {
get;
private set; }
94 internal Dictionary<string, string> Parameters {
get;
private set; }
114 this.ContextQuery = contextQuery;
125 this.ContextTags = contextTags;
136 this.Gender = gender;
147 this.Location = location;
158 this.AdTheme = preferredTheme;
169 this.Parameters = parameters;
180 if (adRequest !=
null)
186 this.Age = adRequest.
Age;
187 this.AdTheme = adRequest.
AdTheme;
188 this.Gender = adRequest.
Gender;
199 if (this.Parameters ==
null)
201 this.Parameters =
new Dictionary<string, string>();
A class responsible for creating AdRequest objects.
Builder WithParameters(Dictionary< string, string > parameters)
AdRequest Builder initialized with custom Parameters.
Builder WithAge(string age)
AdRequest Builder initialized with user's Age for targeting process.
Builder WithGender(string gender)
AdRequest Builder initialized with user's Gender for targeting process.
AdRequest Build()
Creates AdRequest based on current builder parameters.
Builder WithContextQuery(string contextQuery)
AdRequest Builder initialized with current user query entered inside app.
Builder WithAdRequest(AdRequest adRequest)
AdRequest Builder initialized with AdRequest.
Builder WithAdTheme(AdTheme preferredTheme)
Sets preferred theme.
Builder WithLocation(Location location)
AdRequest Builder initialized with user's Location for targeting process.
Builder WithContextTags(List< string > contextTags)
AdRequest Builder initialized with tags describing current user context inside app.
Contains targeting information used to fetch an ad. new instance should be created using AdRequestCon...
AdTheme AdTheme
Preferred theme.
Dictionary< string, string > Parameters
A set of arbitrary input parameters.
string Age
The string representation of user's age.
Location Location
User location.
List< string > ContextTags
An array of tags.Matches the context in which the ad will be displayed.
string Gender
The string representation of user's gender. See the list of values in Gender.
string ContextQuery
The search query that the user entered in the app.