package com.bankaudit.spring.config;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

import com.twilio.sdk.TwilioRestClient;

/**
 * {@link TwilioConfig} class provides the {@link TwilioRestClient} bean configuration 
 * 
 * @author amit.patel
 * @version 1.0
 */
@Configuration
public class TwilioConfig {

	
	@Autowired
	Environment environment;
	
	@Bean
	TwilioRestClient twilioRestClient(){
		 return  new TwilioRestClient(environment.getRequiredProperty("twilio.account.sid"), environment.getRequiredProperty("twilio.auth.token"));
	}
	
}
