diff --git a/build-config/resources/Ballerina.toml b/build-config/resources/Ballerina.toml index d98e0620..29b9d4ab 100644 --- a/build-config/resources/Ballerina.toml +++ b/build-config/resources/Ballerina.toml @@ -3,7 +3,7 @@ distribution = "2201.8.0" org = "ballerinax" name = "salesforce" version = "@toml.version@" -export = ["salesforce", "salesforce.bulk", "salesforce.soap"] +export = ["salesforce", "salesforce.bulk", "salesforce.soap","salesforce.bulkv2", "salesforce.apex"] license= ["Apache-2.0"] authors = ["Ballerina"] keywords = ["Sales & CRM/Customer Relationship Management", "Cost/Freemium"] diff --git a/examples/apex_rest_api_usecases/create_case/invoke_apex_methods.bal b/examples/apex_rest_api_usecases/create_case/invoke_apex_methods.bal index 5467222c..dee9588a 100644 --- a/examples/apex_rest_api_usecases/create_case/invoke_apex_methods.bal +++ b/examples/apex_rest_api_usecases/create_case/invoke_apex_methods.bal @@ -15,7 +15,7 @@ // under the License. import ballerina/log; -import ballerinax/salesforce; +import ballerinax/salesforce.apex; import ballerina/lang.runtime; // Create Salesforce client configuration by reading from environment. @@ -26,7 +26,7 @@ configurable string refreshUrl = ?; configurable string baseUrl = ?; // Using direct-token config for client configuration -salesforce:ConnectionConfig sfConfig = { +apex:ConnectionConfig sfConfig = { baseUrl, auth: { clientId, @@ -38,7 +38,7 @@ salesforce:ConnectionConfig sfConfig = { public function main() returns error? { // Create Case using user defined APEX method - salesforce:Client baseClient = check new (sfConfig); + apex:Client baseClient = check new (sfConfig); string|error caseId = baseClient->apexRestExecute("Cases", "POST", {"subject" : "Item Fault!", diff --git a/examples/bulkv2_api_usecases/execute_bulkv2_ingest_job/bulkv2_insert.bal b/examples/bulkv2_api_usecases/execute_bulkv2_ingest_job/bulkv2_insert.bal index 1c1d9fe3..341b0b07 100644 --- a/examples/bulkv2_api_usecases/execute_bulkv2_ingest_job/bulkv2_insert.bal +++ b/examples/bulkv2_api_usecases/execute_bulkv2_ingest_job/bulkv2_insert.bal @@ -14,11 +14,11 @@ // specific language governing permissions and limitations // under the License. -import ballerinax/salesforce; +import ballerinax/salesforce.bulkv2; import ballerina/lang.runtime; import ballerina/io; -// Create Salesforce client configuration by reading from environment. +// Create Salesforce bulkv2 client configuration by reading from environment. configurable string clientId = ?; configurable string clientSecret = ?; configurable string refreshToken = ?; @@ -26,7 +26,7 @@ configurable string refreshUrl = ?; configurable string baseUrl = ?; // Using direct-token config for client configuration -salesforce:ConnectionConfig sfConfig = { +bulkv2:ConnectionConfig sfConfig = { baseUrl, auth: { clientId, @@ -38,19 +38,19 @@ salesforce:ConnectionConfig sfConfig = { public function main() returns error? { // Insert contacts using a CSV file - salesforce:Client baseClient = check new (sfConfig); + bulkv2:Client baseClient = check new (sfConfig); string csvContactsFilePath = "contacts1.csv"; //create job - salesforce:BulkCreatePayload payload = { + bulkv2:BulkCreatePayload payload = { 'object : "Contact", contentType : "CSV", operation : "insert", lineEnding : "LF" }; - error|salesforce:BulkJob insertJob = baseClient->createIngestJob(payload); + error|bulkv2:BulkJob insertJob = baseClient->createIngestJob(payload); - if insertJob is salesforce:BulkJob { + if insertJob is bulkv2:BulkJob { string[][] csvContent = check io:fileReadCsv(csvContactsFilePath); error? response = baseClient->addBatch(insertJob.id, csvContent); if response is error { @@ -58,14 +58,14 @@ public function main() returns error? { } runtime:sleep(5); //get job info - error|salesforce:BulkJobInfo jobInfo = baseClient->getJobInfo(insertJob.id, "ingest"); + error|bulkv2:BulkJobInfo jobInfo = baseClient->getJobInfo(insertJob.id, "ingest"); if jobInfo is error { io:println("Error occurred while getting job info: ", jobInfo.message()); } runtime:sleep(5); //close job - future closedJob = check baseClient->closeIngestJobAndWait(insertJob.id); - salesforce:BulkJobInfo|error closedJobInfo = wait closedJob; + future closedJob = check baseClient->closeIngestJobAndWait(insertJob.id); + bulkv2:BulkJobInfo|error closedJobInfo = wait closedJob; if closedJobInfo is error { io:println("Error occurred while closing job: ", closedJobInfo.message()); }