package in.gov.digilocker.uidai.services.properties;

import java.io.InputStream;
import java.util.Properties;

import org.springframework.stereotype.Service;

@Service
public class OTPAuthProperties {
	private String otpAutXmlns;
	private String otpAutVersion;	
	private String tid;
	private String ac;
	private String sa;
	private String lk;
	
	private String piUses;
	private String paUses;
	private String pfaUses;
	private String bioUses;
	private String btUses;
	private String pinUses;
	private String otpUses;
	
	private String udc;
	private String rdsId;
	private String rdsVer;
	private String dpId;
	private String dc;
	private String mi;
	private String mc;
	private String dataType;
	
	
	public OTPAuthProperties() {
		Properties props = new java.util.Properties();		
	    try {
	      InputStream uidaiInputStream = getClass().getClassLoader().getResourceAsStream("uidai-services.properties");
	      props.load(uidaiInputStream);
	    }catch (Exception e) {
	      throw new RuntimeException(e.getMessage());
	    }
	    this.otpAutXmlns= (null!= props.getProperty("uidai.request.auth.xmlns")) && !("".equals(props.getProperty("uidai.request.auth.xmlns"))) ? props.getProperty("uidai.request.auth.xmlns") : "";
	    this.otpAutVersion= (null!= props.getProperty("uidai.request.auth.ver")) && !("".equals( props.getProperty("uidai.request.auth.ver"))) ?  props.getProperty("uidai.request.auth.ver") : ""; 
	    
	    this.tid= (null!= props.getProperty("uidai.request.auth.tid")) && !("".equals(props.getProperty("uidai.request.auth.tid"))) ? props.getProperty("uidai.request.auth.tid") : "";
	    this.ac= (null!= props.getProperty("uidai.request.otp.ac")) && !("".equals(props.getProperty("uidai.request.otp.ac"))) ? props.getProperty("uidai.request.otp.ac") : "";
	    this.sa= (null!= props.getProperty("uidai.request.otp.sa")) && !("".equals(props.getProperty("uidai.request.otp.sa"))) ? props.getProperty("uidai.request.otp.sa") : "";
	    this.lk= (null!= props.getProperty("uidai.request.otp.lk")) && !("".equals(props.getProperty("uidai.request.otp.lk"))) ? props.getProperty("uidai.request.otp.lk") : "";
	    
	    this.piUses= (null!= props.getProperty("uidai.request.auth.uses.pi")) && !("".equals(props.getProperty("uidai.request.auth.uses.pi"))) ? props.getProperty("uidai.request.auth.uses.pi") : "";
	    this.paUses= (null!= props.getProperty("uidai.request.auth.uses.pa")) && !("".equals(props.getProperty("uidai.request.auth.uses.pa"))) ? props.getProperty("uidai.request.auth.uses.pa") : "";
	    this.pfaUses=(null!= props.getProperty("uidai.request.auth.uses.pfa")) && !("".equals(props.getProperty("uidai.request.auth.uses.pfa")))?props.getProperty("uidai.request.auth.uses.pfa"): "";
	    this.bioUses=(null!= props.getProperty("uidai.request.auth.uses.bio")) && !("".equals(props.getProperty("uidai.request.auth.uses.bio")))?props.getProperty("uidai.request.auth.uses.bio"): "";
	    this.btUses= (null!= props.getProperty("uidai.request.auth.uses.bt")) && !("".equals(props.getProperty("uidai.request.auth.uses.bt")))?  props.getProperty("uidai.request.auth.uses.bt") : "";
	    this.pinUses=(null!= props.getProperty("uidai.request.auth.uses.pin")) && !("".equals(props.getProperty("uidai.request.auth.uses.pin")))?props.getProperty("uidai.request.auth.uses.pin"): "";
	    this.otpUses=(null!= props.getProperty("uidai.request.auth.uses.otp")) && !("".equals(props.getProperty("uidai.request.auth.uses.otp")))?props.getProperty("uidai.request.auth.uses.otp"): "";
	    
	    this.udc= (null!=props.getProperty("uidai.auth.meta.udc.value")) && !("".equals(props.getProperty("uidai.auth.meta.udc.value")))?props.getProperty("uidai.auth.meta.udc.value"): "";
	    this.rdsId=(null!=props.getProperty("uidai.request.auth.meta.rdsId")) && !("".equals(props.getProperty("uidai.request.auth.meta.rdsId")))?props.getProperty("uidai.request.auth.meta.rdsId"): "";
	    this.rdsVer=(null!=props.getProperty("uidai.request.auth.meta.rdsVer")) && !("".equals(props.getProperty("uidai.request.auth.meta.rdsVer")))?props.getProperty("uidai.request.auth.meta.rdsVer"): "";
	    this.dpId=(null!=props.getProperty("uidai.request.auth.meta.dpId")) && !("".equals(props.getProperty("uidai.request.auth.meta.dpId")))?props.getProperty("uidai.request.auth.meta.dpId"): "";
	    this.dc=(null!=props.getProperty("uidai.request.auth.meta.dc")) && !("".equals(props.getProperty("uidai.request.auth.meta.dc")))?props.getProperty("uidai.request.auth.meta.dc"): "";
	    this.mi=(null!=props.getProperty("uidai.request.auth.meta.mi")) && !("".equals(props.getProperty("uidai.request.auth.meta.mi")))?props.getProperty("uidai.request.auth.meta.mi"): "";
	    this.mc=(null!=props.getProperty("uidai.request.auth.meta.mc")) && !("".equals(props.getProperty("uidai.request.auth.meta.mc")))?props.getProperty("uidai.request.auth.meta.mc"): "";
	    this.dataType=(null!=props.getProperty("uidai.request.auth.data.type")) && !("".equals(props.getProperty("uidai.request.auth.data.type")))?props.getProperty("uidai.request.auth.data.type"): "";
	}


	public String getOtpAutXmlns() {
		return otpAutXmlns;
	}


	public void setOtpAutXmlns(String otpAutXmlns) {
		this.otpAutXmlns = otpAutXmlns;
	}


	public String getOtpAutVersion() {
		return otpAutVersion;
	}


	public void setOtpAutVersion(String otpAutVersion) {
		this.otpAutVersion = otpAutVersion;
	}


	public String getTid() {
		return tid;
	}


	public void setTid(String tid) {
		this.tid = tid;
	}


	public String getAc() {
		return ac;
	}


	public void setAc(String ac) {
		this.ac = ac;
	}


	public String getSa() {
		return sa;
	}


	public void setSa(String sa) {
		this.sa = sa;
	}


	public String getLk() {
		return lk;
	}


	public void setLk(String lk) {
		this.lk = lk;
	}


	public String getPiUses() {
		return piUses;
	}


	public void setPiUses(String piUses) {
		this.piUses = piUses;
	}


	public String getPaUses() {
		return paUses;
	}


	public void setPaUses(String paUses) {
		this.paUses = paUses;
	}


	public String getPfaUses() {
		return pfaUses;
	}


	public void setPfaUses(String pfaUses) {
		this.pfaUses = pfaUses;
	}


	public String getBioUses() {
		return bioUses;
	}


	public void setBioUses(String bioUses) {
		this.bioUses = bioUses;
	}


	public String getBtUses() {
		return btUses;
	}


	public void setBtUses(String btUses) {
		this.btUses = btUses;
	}


	public String getPinUses() {
		return pinUses;
	}


	public void setPinUses(String pinUses) {
		this.pinUses = pinUses;
	}


	public String getOtpUses() {
		return otpUses;
	}


	public void setOtpUses(String otpUses) {
		this.otpUses = otpUses;
	}


	public String getUdc() {
		return udc;
	}


	public void setUdc(String udc) {
		this.udc = udc;
	}


	public String getRdsId() {
		return rdsId;
	}


	public void setRdsId(String rdsId) {
		this.rdsId = rdsId;
	}


	public String getRdsVer() {
		return rdsVer;
	}


	public void setRdsVer(String rdsVer) {
		this.rdsVer = rdsVer;
	}


	public String getDpId() {
		return dpId;
	}


	public void setDpId(String dpId) {
		this.dpId = dpId;
	}


	public String getDc() {
		return dc;
	}


	public void setDc(String dc) {
		this.dc = dc;
	}


	public String getMi() {
		return mi;
	}


	public void setMi(String mi) {
		this.mi = mi;
	}


	public String getMc() {
		return mc;
	}


	public void setMc(String mc) {
		this.mc = mc;
	}


	public String getDataType() {
		return dataType;
	}


	public void setDataType(String dataType) {
		this.dataType = dataType;
	}

}
