diff --git a/build.sbt b/build.sbt index f4cb2ad..5d88398 100644 --- a/build.sbt +++ b/build.sbt @@ -2,7 +2,7 @@ name := "salesforce2hadoop" organization := "co.datadudes" -version := "1.0" +version := "1.2" scalaVersion := "2.11.4" diff --git a/src/main/scala/co/datadudes/sf2hadoop/SFImportCLIRunner.scala b/src/main/scala/co/datadudes/sf2hadoop/SFImportCLIRunner.scala index 456b77a..2dc82a1 100644 --- a/src/main/scala/co/datadudes/sf2hadoop/SFImportCLIRunner.scala +++ b/src/main/scala/co/datadudes/sf2hadoop/SFImportCLIRunner.scala @@ -16,6 +16,7 @@ object SFImportCLIRunner extends App with LazyLogging { sfWSDL: File = new File("."), stateFile: URI = new URI("file://" + System.getProperty("user.home") + "/.sf2hadoop/state"), apiBaseUrl: String = "https://login.salesforce.com", + apiVersion: String = "37.0", records: Seq[String] = Seq()) val parser = new scopt.OptionParser[Config]("sf2hadoop") { @@ -29,6 +30,7 @@ object SFImportCLIRunner extends App with LazyLogging { opt[File]('w', "wsdl") required() valueName "" action { (x, c) => c.copy(sfWSDL = x)} text "Path to Salesforce Enterprise WSDL" opt[URI]('s', "state") optional() valueName "" action { (x, c) => c.copy(stateFile = x)} text "URI to state file to keep track of last updated timestamps" opt[String]('a', "api-base-url") optional() valueName "" action { (x, c) => c.copy(apiBaseUrl = x)} text "Base URL of Salesforce instance" + opt[String]('v', "api-version") optional() valueName "" action { (x, c) => c.copy(apiVersion = x)} text "API version of Salesforce instance" arg[String]("...") unbounded() action { (x, c) => c.copy(records = c.records :+ x)} text "List of Salesforce record types to import" help("help") text "prints this usage text" } @@ -44,7 +46,7 @@ object SFImportCLIRunner extends App with LazyLogging { println("You need to enter a valid command (init|update)") } else { val schemas = WSDL2Avro.convert(config.sfWSDL.getCanonicalPath, filterSFInternalFields) - val connection = SalesforceService(config.sfUsername, config.sfPassword, config.apiBaseUrl) + val connection = SalesforceService(config.sfUsername, config.sfPassword, config.apiBaseUrl, config.apiVersion) val importer = new SFImporter(schemas, config.datasetBasePath, connection) val state = new ImportState(config) state.createDirs