tla-sbuilder-salesforce - Salesforce API interface loader (for tla-sbuilder) - $Release:0.0.4$
API loader plugin for Sbuilder to load Salasforce API interfaces in a Sbuilder specification model.
Usage
Create Gemfile
Create Gemfile
with the following content
source "https://rubygems.org"
gem 'tla-sbuilder-salesforce'
and run
bundle install
Include Plugin to Sbuilder
To include the plugin into Sbuilder add an entry to extend.loaders
array in sbuilder.yaml
-configuration file as shown below:
extend:
loaders:
- gem: tla-sbuilder-salesforce
className: Sbuilder::Interfaces::Salesforce::SalesforceLoader
configuration:
client_id: xxxxxxxxxxxxxxx
client_secret: xxxxxxxxxx
username: xxxxxxxe
password: 'xxxxxxxx'
security_token: 'xxxxxxxxxx'
In the entry, modify following properties to match your environment:
cliend_id
: salesforce client_id to use in connectionclient_secret
: salesforce client_secret to use in connectionusername
: username to login to salesforcepassword
: password to login to salesforcesecurity_token
: additional security_token needed in salesforce login
Additional confiuration properties supported:
api_version
: api version to use (default 34.0)
Configure API Loader Instanace
Add an array entry interfaces
section in sbuilder.yaml
-configuration file referring to an interface configuration file for
the plugin:
interfaces:
- className: Sbuilder::Interfaces::Salesforce::SalesforceLoader
infrastructureServices: true
file: salesforce-api.yaml
cache: sf
In the configuration above:
className
:Sbuilder::Interfaces::Salesforce::SalesforceLoader
matchesclassName
property inextend.loaders
sectioninfrastructureServices
: valuetrue
when embedding Salesforce services as part of composite service, valuefalse
, when Salesforce services be called directly in the generated specification modelfile
: name of configuration file incnf
-directory defining Salesforce API (see below)cache
: optional cache file name prefix for the API loader to cache Salesforce API descriptions
Define Salaseforce API
Saleforce API Loader plugin uses a configuration file to define API operation on Salesforce sObjects. The configuration file is an array of entries with the following properties:
sObject
: Salesforce sObject for the API operationpath
: REST entrypoint for the interfaceaction
: REST action (put, get, post, ..)request
: type name (sObject) of request attributereply
: type name (sObject) of reply attribute
For example, to access Salasesforce sObjects Lead
and Account
use
configuration:
- sObject: Account
path: /sf/account
action: get
request: Account
reply: Account
- sObject: Lead
path: /sf/lead
action: post
request: Account
reply: Account
License
MIT