com.gu.salesforce.SalesforceConfig.scala Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of membership-common_2.12 Show documentation
Show all versions of membership-common_2.12 Show documentation
Scala library for common Guardian Membership/Subscriptions functionality.
package com.gu.salesforce
import com.typesafe.config.Config
case class SalesforceConfig(
envName: String,
url: String,
key: String,
secret: String,
username: String,
password: String,
token: String,
recordTypeIds: Config
)
object SalesforceConfig {
def from(config: Config, environmentName: String) = SalesforceConfig(
environmentName,
url = config.getString("salesforce.url"),
key = config.getString("salesforce.consumer.key"),
secret = config.getString("salesforce.consumer.secret"),
username = config.getString("salesforce.api.username"),
password = config.getString("salesforce.api.password"),
token = config.getString("salesforce.api.token"),
recordTypeIds = config.getConfig("salesforce.record-type-ids")
)
}