2using System.Collections.Generic;
5using YandexMobileAds.Base;
18 [Tooltip(
"User age passed to Yandex ad targeting.")]
22 [Tooltip(
"User gender passed to Yandex ad targeting.")]
26 [Tooltip(
"Context query passed to Yandex ad targeting.")]
30 [Tooltip(
"User location passed to Yandex ad targeting.")]
34 [Tooltip(
"Context tags passed to Yandex ad targeting.")]
37#if !LEGACY_YANDEX_MOBILE_ADS
39 [Tooltip(
"Preferred ad theme passed to Yandex ad requests.")]
44 [Tooltip(
"Additional ad request parameters passed as key-value pairs.")]
47#if !LEGACY_YANDEX_MOBILE_ADS
57 return string.IsNullOrEmpty(
Age) &&
58 string.IsNullOrEmpty(
Gender) &&
64 age:
string.IsNullOrEmpty(
Age) ?
null :
Age,
68 contextTags: hasContextTags ?
new List<string>(
ContextTags) :
null);
83 var parameters =
new Dictionary<string, string>();
84 foreach (var parameter
in Parameters.Where(parameter => parameter !=
null && !
string.IsNullOrEmpty(parameter.Key)))
86 parameters[parameter.Key] = parameter.Value ??
string.Empty;
89 return parameters.Count > 0 ? parameters :
null;
102 [Tooltip(
"Controls whether location targeting is added to ad requests.")]
106 [Tooltip(
"User latitude passed to Yandex ad targeting.")]
110 [Tooltip(
"User longitude passed to Yandex ad targeting.")]
114 [Tooltip(
"User horizontal accuracy passed to Yandex ad targeting.")]
117#if !LEGACY_YANDEX_MOBILE_ADS
125 new Location.Builder()
142 [Tooltip(
"Request parameter key.")]
146 [Tooltip(
"Request parameter value.")]
bool Enabled
Controls whether location targeting is added to ad requests.
Location CreateLocation()
Creates an SDK Location object from the configured inspector values. The method is called only when l...
Inspector-friendly Yandex user location options. The SDK Location type is immutable and created throu...
List< string > ContextTags
AdTargeting CreateTargeting()
Builds SDK targeting data from the configured fields. Empty targeting fields are skipped so requests ...
List< YandexRequestParameter > Parameters
Specifies the parameters.
AdTheme AdTheme
Preferred ad theme passed to Yandex ad requests.
Dictionary< string, string > CreateParameters()
Builds SDK request parameters from the inspector list. Empty keys are ignored and later duplicate key...
YandexLocationOptions Location
Stores common Yandex request settings for ad loading. Inspector values are converted to targeting,...
string Value
Request parameter value.
string Key
Request parameter key.
Inspector-friendly key-value pair for Yandex request parameters. Unity does not serialize dictionarie...