All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.gu.salesforce.SimpleContactRepository.scala Maven / Gradle / Ivy

There is a newer version: 0.605
Show newest version
package com.gu.salesforce

import akka.actor.Scheduler
import com.gu.okhttp.RequestRunners
import okhttp3.{Request, Response}

import scala.concurrent.{ExecutionContext, Future}

class SimpleContactRepository(
    salesforceConfig: SalesforceConfig,
    scheduler: Scheduler,
    appName: String)(implicit executionContext: ExecutionContext)
  extends ContactRepository {

  val salesforce: Scalaforce = new Scalaforce {
    val application: String = appName
    val stage: String = salesforceConfig.envName
    val sfConfig: SalesforceConfig = salesforceConfig
    val httpClient: (Request) => Future[Response] = RequestRunners.futureRunner
    val sfScheduler = scheduler
  }
  salesforce.startAuth()
  val recordTypes: ContactRecordTypes = new ContactRecordTypes(salesforceConfig.recordTypeIds)
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy