//
//  MaxTargetingData.cs
//  AppLovin MAX Unity Plugin
//
// Created by Harry Arakkal on 11/19/21.
// Copyright © 2020 AppLovin. All rights reserved.
//
/// 
/// This class allows you to provide user or app data that will improve how we target ads.
/// 
public class MaxTargetingData
{
    /// 
    /// This enumeration represents content ratings for the ads shown to users.
    /// They correspond to IQG Media Ratings.
    /// 
     public enum AdContentRating
    {
        None,
        AllAudiences,
        EveryoneOverTwelve,
        MatureAudiences
    }
    /// 
    /// This enumeration represents gender.
    /// 
    public enum UserGender
    {
        Unknown,
        Female,
        Male,
        Other
    }
    /// 
    /// The year of birth of the user.
    /// Set this property to 0 to clear this value.
    /// 
    public int YearOfBirth
    {
        set
        {
            MaxSdk.SetTargetingDataYearOfBirth(value);
        }
    }
    /// 
    /// The gender of the user.
    /// Set this property to UserGender.Unknown to clear this value.
    /// 
    public UserGender Gender
    {
        set
        {
            string genderString = "";
            if ( value == UserGender.Female )
            {
                genderString = "F";
            }
            else if ( value == UserGender.Male )
            {
                genderString = "M";
            }
            else if ( value == UserGender.Other )
            {
                genderString = "O";
            }
            MaxSdk.SetTargetingDataGender(genderString);
        }
    }
    /// 
    /// The maximum ad content rating to show the user.
    /// Set this property to AdContentRating.None to clear this value.
    /// 
    public AdContentRating MaximumAdContentRating
    {
        set
        {
            MaxSdk.SetTargetingDataMaximumAdContentRating((int) value);
        }
    }
    /// 
    /// The email of the user.
    /// Set this property to null to clear this value.
    /// 
    public string Email
    {
        set
        {
            MaxSdk.SetTargetingDataEmail(value);
        }
    }
    /// 
    /// The phone number of the user. Do not include the country calling code.
    /// Set this property to null to clear this value.
    /// 
    public string PhoneNumber
    {
        set
        {
            MaxSdk.SetTargetingDataPhoneNumber(value);
        }
    }
    /// 
    /// The keywords describing the application.
    /// Set this property to null to clear this value.
    /// 
    public string[] Keywords
    {
        set
        {
            MaxSdk.SetTargetingDataKeywords(value);
        }
    }
    /// 
    /// The interests of the user.
    /// Set this property to null to clear this value.
    /// 
    public string[] Interests
    {
        set
        {
            MaxSdk.SetTargetingDataInterests(value);
        }
    }
    /// 
    /// Clear all saved data from this class.
    /// 
    public void ClearAll()
    {
        MaxSdk.ClearAllTargetingData();
    }
}