﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[System.Serializable]
public class Config{

	public enum Gender
	{
		MALE, FEMALE
	}

	public string userId;

	public string gender;

	public string dateOfBirth;

	public int age;

	public Config SetUserId(string userId){
		this.userId = userId;
		return this;
	}

	public Config SetGender(Gender gender){
		if (gender != null) {
			this.gender = gender.ToString ().ToLower();
		}
		return this;
	}

	public Config SetDateOfBirth(string dateOfBirth){
		if (dateOfBirth != null && dateOfBirth.Length > 0)
			this.dateOfBirth = dateOfBirth;
		return this;
	}

	public Config SetAge(int age){
		if (age > 0 && age < 200)
			this.age = age;
		return this;
	}
		
	public string ToJson(){
		return JsonUtility.ToJson(this);
	}
}
