namespace JustTrack
{
///
/// Defines the different types of ad units supported by the SDK.
///
public enum AdUnit
{
///
/// Banner ad unit.
///
Banner,
///
/// Interstitial ad unit.
///
Interstitial,
///
/// Rewarded ad unit.
///
Rewarded,
///
/// Rewarded interstitial ad unit.
///
RewardedInterstitial,
///
/// Native ad unit.
///
Native,
///
/// App open ad unit.
///
AppOpen,
}
///
/// Internal utility class for converting AdUnit enum values to string representations.
///
internal static class AdUnitInternalConversation
{
///
/// Converts an AdUnit enum value to its internal string representation.
///
/// The ad unit to convert.
/// The string representation of the ad unit.
internal static string ToInternalString(AdUnit adFormat)
{
switch (adFormat)
{
case AdUnit.Banner:
return "banner";
case AdUnit.Interstitial:
return "interstitial";
case AdUnit.Rewarded:
return "rewarded";
case AdUnit.RewardedInterstitial:
return "rewarded_interstitial";
case AdUnit.Native:
return "native";
case AdUnit.AppOpen:
return "app_open";
default:
return string.Empty;
}
}
}
///
/// Internal utility class for converting IronSource ad format strings to AdUnit enum values.
///
internal static class AdUnitFromIronsourceConversion
{
///
/// Converts an IronSource ad format string to an AdUnit enum value.
///
/// The IronSource ad format string.
/// The corresponding AdUnit enum value, or null if not found.
internal static AdUnit? ToAdUnit(string adFormat)
{
switch (adFormat)
{
case "banner":
return AdUnit.Banner;
case "interstitial":
return AdUnit.Interstitial;
case "rewarded_video":
return AdUnit.Rewarded;
}
return null;
}
}
}