This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ballerina/io; | |
public function main() { | |
io:println("Hello, World!"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# AUTO-GENERATED FILE. DO NOT MODIFY. | |
# This file is auto-generated by Ballerina for managing dependency versions. | |
# It should not be modified by hand. | |
[ballerina] | |
dependencies-toml-version = "2" | |
[[package]] | |
org = "ballerina" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Prints `Hello` with input string name. | |
# | |
# + name - the input sting name | |
# + return - "Hello " with the input string name | |
public function sayHello(string name) returns string { | |
if !(name is "") { | |
// We are adding "!" in the end and remove "," after hello as a bug fix. | |
return "Hello " + name + "!"; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ballerina/io; | |
import pramodya/greetings; | |
// Prints `Hello World`. | |
public function main() { | |
io:println(greetings:sayHello("Doe")); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function main() returns error? { | |
// Create salesforce bulk client. | |
sfdc46:SalesforceBulkClient sfBulkClient = salesforceClient->createSalesforceBulkClient(); | |
// Create CSV insert operator. | |
sfdc46:CsvInsertOperator csvInserter = check sfBulkClient->createCsvInsertOperator("Contact"); | |
// Read CSV file content. | |
io:ReadableByteChannel contacts = check io:openReadableFile("sfdc contacts - sheet1.csv"); | |
// Import csv contacts to Salesforce. | |
sfdc46:BatchInfo batch = check csvInserter->insert(<@untainted> contacts); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function main() returns error? { | |
// Create salesforce bulk client. | |
sfdc46:SalesforceBulkClient sfBulkClient = salesforceClient->createSalesforceBulkClient(); | |
// Create CSV insert operator. | |
sfdc46:CsvInsertOperator csvInserter = check sfBulkClient->createCsvInsertOperator("Contact"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BASE_URL="https://<YOUR_INSTANCE>.salesforce.com" | |
ACCESS_TOKEN="00D2v000001XKxi!AQ4AQF__SOMETHING" | |
CLIENT_ID="3MVG9G9pzCUSkzZt4BtawIPCq__SOMETHING" | |
CLIENT_SECRET="F76A05F3E49F73C640EC7__SOMETHING" | |
REFRESH_TOKEN="5Aep861dlMxAL.LhVTuPR__SOMETHING" | |
REFRESH_URL="https://login.salesforce.com/services/oauth2/token" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wso2/sfdc46; | |
import ballerina/config; | |
sfdc46:SalesforceConfiguration salesforceConfig = { | |
baseUrl: config:getAsString("BASE_URL"), | |
clientConfig: { | |
accessToken: config:getAsString("ACCESS_TOKEN"), | |
refreshConfig: { | |
clientId: config:getAsString("CLIENT_ID"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {Component} from 'react'; | |
import './App.css'; | |
class ItemAdder extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
widgetName: "Add items to cart", | |
name: "", |