powertoolsdeveloper.text
Module powertoolsdeveloper.text
API
Definitions
ballerinax/powertoolsdeveloper.text Ballerina library
Overview
This is a generated connector from Apptigent PowerTools Developer API v2021.1.01 OpenAPI specification. Apptigent PowerTools Developer Edition is a powerful suite of API endpoints for custom applications running on any stack. Manipulate text, modify collections, format dates and times, convert currency, perform advanced mathematical calculations, shorten URL's, encode strings, convert text to speech, translate content into multiple languages, process images, and more. PowerTools is the ultimate developer toolkit. This connector provides the capability for String manipulation, parsing, conversion and related operations.
Prerequisites
Before using this connector in your Ballerina application, complete the following:
- Create Apptigent account
- Obtain tokens
- Log into Apptigent Developer Portal by visiting https://portal.apptigent.com
- Create an app and obtain the
Client ID
which will be used as theAPI Key
by following the guidelines described here.
Quickstart
To use the Apptigent PowerTools Developer connector in your Ballerina application, update the .bal file as follows:
Step 1: Import connector
Import the ballerinax/powertoolsdeveloper.text
module into the Ballerina project.
import ballerinax/powertoolsdeveloper.text as pt;
Step 2: Create a new connector instance
Create a text:ApiKeysConfig
with the Client ID obtained, and initialize the connector with it.
pt:ApiKeysConfig config = { axIbmClientId: "<CLIENT_ID>" } pt:Client baseClient = check new Client(config);
Step 3: Invoke connector operation
-
Now you can use the operations available within the connector. Note that they are in the form of remote operations.
Following is an example on how to perform a comparison of two strings using the connector by providing the
InputStringContains
record with the text to match, text to search and whether to convert strings to lowercase.Perform a comparison of two strings
public function main() { pt:InputStringContains inputStringContains = { find: "cow", input: "The brown cow", lower: "True" }; pt:OutputString|error response = baseClient->containsString(inputStringContains); if (response is pt:OutputString) { log:printInfo(response.toString()); } else { log:printError(response.message()); } }
-
Use
bal run
command to compile and run the Ballerina program.
Clients
powertoolsdeveloper.text: Client
This is a generated connector for Apptigent PowerTools Developer API v2021.1.01 OpenAPI specification. 'Apptigent PowerTools Developer Edition is a powerful suite of API endpoints for custom applications running on any stack. Manipulate text, modify collections, format dates and times, convert currency, perform advanced mathematical calculations, shorten URL's, encode strings, convert text to speech, translate content into multiple languages, process images, and more. PowerTools is the ultimate developer toolkit.' This connector provides the capability for String manipulation, parsing, conversion and related operations.
Constructor
Gets invoked to initialize the connector
.
The connector initialization requires setting the API credentials.
Create an Apptigent account and obtain tokens following this guide.
init (ApiKeysConfig apiKeyConfig, ConnectionConfig config, string serviceUrl)
- apiKeyConfig ApiKeysConfig - API keys for authorization
- config ConnectionConfig {} - The configurations to be used when initializing the
connector
- serviceUrl string "https://connect.apptigent.com/api/utilities" - URL of the target service
compareStrings
function compareStrings(InputStringComparison payload) returns OutputString|error
Text - Compare strings
Parameters
- payload InputStringComparison - Input string comparison parameters
Return Type
- OutputString|error - OK
containsString
function containsString(InputStringContains payload) returns OutputString|error
Text - Contains string
Parameters
- payload InputStringContains - Input string contains parameters
Return Type
- OutputString|error - OK
convertCase
function convertCase(InputCaseConversion payload) returns OutputString|error
Text - Convert case
Parameters
- payload InputCaseConversion - Input case conversion parameters
Return Type
- OutputString|error - OK
decodeString
function decodeString(DecodestringBody payload) returns OutputString|error
Text - Decode string
Parameters
- payload DecodestringBody - Input string parameters
Return Type
- OutputString|error - OK
encodeString
function encodeString(InputString payload) returns OutputString|error
Text - Encode string
Parameters
- payload InputString - Input string parameters
Return Type
- OutputString|error - OK
generateGuid
function generateGuid(InputGenerateUniqueID payload) returns OutputString|error
Text - Generate GUID
Parameters
- payload InputGenerateUniqueID - Input general unique ID parameters
Return Type
- OutputString|error - OK
generateHash
function generateHash(InputGenerateHash payload) returns OutputString|error
Text - Generate hash
Parameters
- payload InputGenerateHash - Input generate hash parameters
Return Type
- OutputString|error - OK
verifyHash
function verifyHash(InputVerifyHash payload) returns OutputBoolean|error
Text - Verify hash
Parameters
- payload InputVerifyHash - Input verfiy hash parameters
Return Type
- OutputBoolean|error - OK
joinStrings
function joinStrings(InputJoinStrings payload) returns OutputString|error
Text - Join strings
Parameters
- payload InputJoinStrings - Input join strings parameters
Return Type
- OutputString|error - OK
redactString
function redactString(InputRedactString payload) returns OutputString|error
Text - Redact string
Parameters
- payload InputRedactString - Input redact string parameters
Return Type
- OutputString|error - OK
replaceString
function replaceString(InputReplaceString payload) returns OutputString|error
Text - Replace string
Parameters
- payload InputReplaceString - Input replace string parameters
Return Type
- OutputString|error - OK
shortenLink
function shortenLink(ShortenlinkBody payload) returns OutputString|error
Text - Shorten hyperlink
Parameters
- payload ShortenlinkBody - Input shorten link parameters
Return Type
- OutputString|error - OK
splitString
function splitString(InputSplitString payload) returns OutputStringArray|error
Text - Split string
Parameters
- payload InputSplitString - Input split string parameters
Return Type
- OutputStringArray|error - OK
textToSpeech
function textToSpeech(InputTextToSpeech payload) returns string|error
Text - Text to Speech
Parameters
- payload InputTextToSpeech - Input text to speech parameters
translateString
function translateString(InputTranslateString payload) returns OutputString|error
Text - Translate string
Parameters
- payload InputTranslateString - Input translate string parameters
Return Type
- OutputString|error - OK
trimString
function trimString(InputTrimString payload) returns OutputString|error
Text - Trim string
Parameters
- payload InputTrimString - Input trim string parameters
Return Type
- OutputString|error - OK
urlDecode
function urlDecode(UrldecodeBody payload) returns OutputString|error
Text - Decode URL
Parameters
- payload UrldecodeBody - Input Url decode parameters
Return Type
- OutputString|error - OK
urlEncode
function urlEncode(InputString payload) returns OutputString|error
Text - Encode URL
Parameters
- payload InputString - Input string parameters
Return Type
- OutputString|error - OK
validateEmail
function validateEmail(ValidateemailBody payload) returns OutputString|error
Text - Validate email
Parameters
- payload ValidateemailBody - Input validate email parameters
Return Type
- OutputString|error - OK
stringToFile
function stringToFile(InputStringToFile payload) returns string|error
Text - String to File
Parameters
- payload InputStringToFile - Input string to file parameters
Records
powertoolsdeveloper.text: ApiKeysConfig
Provides API key configurations needed when communicating with a remote HTTP endpoint.
Fields
- xIbmClientId string - Represents API Key
X-IBM-Client-Id
powertoolsdeveloper.text: ClientHttp1Settings
Provides settings related to HTTP/1.x protocol.
Fields
- keepAlive KeepAlive(default http:KEEPALIVE_AUTO) - Specifies whether to reuse a connection for multiple requests
- chunking Chunking(default http:CHUNKING_AUTO) - The chunking behaviour of the request
- proxy ProxyConfig? - Proxy server related options
powertoolsdeveloper.text: ConnectionConfig
Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint.
Fields
- httpVersion HttpVersion(default http:HTTP_2_0) - The HTTP version understood by the client
- http1Settings ClientHttp1Settings? - Configurations related to HTTP/1.x protocol
- http2Settings ClientHttp2Settings? - Configurations related to HTTP/2 protocol
- timeout decimal(default 60) - The maximum time to wait (in seconds) for a response before closing the connection
- forwarded string(default "disable") - The choice of setting
forwarded
/x-forwarded
header
- poolConfig PoolConfiguration? - Configurations associated with request pooling
- cache CacheConfig? - HTTP caching related configurations
- compression Compression(default http:COMPRESSION_AUTO) - Specifies the way of handling compression (
accept-encoding
) header
- circuitBreaker CircuitBreakerConfig? - Configurations associated with the behaviour of the Circuit Breaker
- retryConfig RetryConfig? - Configurations associated with retrying
- responseLimits ResponseLimitConfigs? - Configurations associated with inbound response size limits
- secureSocket ClientSecureSocket? - SSL/TLS-related options
- proxy ProxyConfig? - Proxy server related options
- validation boolean(default true) - Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default
powertoolsdeveloper.text: DecodestringBody
Fields
- 'source string - Encoded string variable or text value
powertoolsdeveloper.text: InputCalculateMinMax
Fields
- input decimal[] - Colllection of values to calculate
- 'type string - Minimum or Maximum
powertoolsdeveloper.text: InputCalculateNumber
Fields
- input decimal - Numeric value to calculate
- decimals decimal - Round to number of decimal places
powertoolsdeveloper.text: InputCalculateNumbers
Fields
- input decimal - Numeric value
- value decimal - Addend, subtrahend, factor, divisor or radicand
- decimals decimal - Round to number of decimal places
powertoolsdeveloper.text: InputCalculatePower
Fields
- input decimal - Number to raise
- power decimal - Power
- decimals decimal - Round to number of decimal places
powertoolsdeveloper.text: InputCalculateSeries
Fields
- input decimal[] - Colllection of values to calculate
- decimals decimal - Round to number of decimal places
powertoolsdeveloper.text: InputCaseConversion
Fields
- input string - String containing the text to convert
- alphacase string - Case of conversion result
powertoolsdeveloper.text: InputCollectionConversion
Fields
- input string[] - Collection containing strings to convert
- name string - Collection name
powertoolsdeveloper.text: InputCollectionConversionXML
Fields
- input string[] - Collection containing strings to convert
- root string - Name of root XML node
- child string - Name of child XML node(s)
powertoolsdeveloper.text: InputCollectionCount
Fields
- input string[] - Collection of items to count
powertoolsdeveloper.text: InputCollectionFilter
Fields
- input string[] - Collection of strings to filter
- 'match string - Match type
- keywords string - Keywords (separate multiple values with commas)
powertoolsdeveloper.text: InputCollectionModify
Fields
- input string[] - Collection of values or objects to modify
- item string? - Item (for multiple items, leave blank and use Items)
- items string[]? - Items (Collection, for a single item leave blank and use Item)
- index string? - Index position for operation (leave blank to specify end of collection)
powertoolsdeveloper.text: InputCollectionReplace
Fields
- input string[] - Collection of strings
- 'match string - Match value
- replacement string - Replacement value
- ignoreCase string - Ignore case
powertoolsdeveloper.text: InputCollectionSearch
Fields
- input string[] - Collection of strings to search
- 'match string - Text to match
- trim string? - Trim white space from comparison string
- ignorecase string? - Ignore case when performing comparison
powertoolsdeveloper.text: InputCollectionSearchNumeric
Fields
- input decimal[] - Collection of strings to search
- 'match decimal - Number to match
- 'type string(default "Integer") - Type of number - integer or decimal
powertoolsdeveloper.text: InputCollectionSort
Fields
- input string[] - Collection of strings to sort
- 'order string - Sort order
powertoolsdeveloper.text: InputCollectionSplit
Fields
- input string[] - Collection of items to split
- 'match string? - String to match (explicit, case-insensitive, leave empty to use Index)
- index string? - Index location to split (leave empty to use Match value)
powertoolsdeveloper.text: InputConvertAngle
Fields
- input decimal -
- 'source string -
- target string -
powertoolsdeveloper.text: InputConvertArea
Fields
- input decimal -
- 'source string -
- target string -
powertoolsdeveloper.text: InputConvertDistance
Fields
- input decimal -
- 'source string -
- target string -
powertoolsdeveloper.text: InputConvertDuration
Fields
- input decimal -
- 'source string -
- target string -
powertoolsdeveloper.text: InputConvertEnergy
Fields
- input decimal -
- 'source string -
- target string -
powertoolsdeveloper.text: InputConvertPower
Fields
- input decimal -
- 'source string -
- target string -
powertoolsdeveloper.text: InputConvertSpeed
Fields
- input decimal -
- 'source string -
- target string -
powertoolsdeveloper.text: InputConvertTemperature
Fields
- input decimal -
- 'source string -
- target string -
powertoolsdeveloper.text: InputConvertVolume
Fields
- input decimal -
- 'source string -
- target string -
powertoolsdeveloper.text: InputConvertWeight
Fields
- input decimal -
- 'source string -
- target string -
powertoolsdeveloper.text: InputCsvConversionJSON
Fields
- input string - CSV string
- header boolean - Include header row
powertoolsdeveloper.text: InputCurrencyConversion
Fields
- input decimal - Amount to convert
- 'source string -
- target string -
powertoolsdeveloper.text: InputCurrencyFormat
Fields
- input decimal - Amount to format
- target string -
powertoolsdeveloper.text: InputDataQuery
Fields
- input string - XML or JSON string
- query string - XPath or JSONPath query
powertoolsdeveloper.text: InputDateTimeConversion
Fields
- input string - Source date and time
- 'source string -
- target string -
- format string? - Display format (defaults to 'yyyy-MM-dd HH:mm:ss')
powertoolsdeveloper.text: InputDateTimeDifference
Fields
- dateTime1 string - First date/time value
- dateTime2 string - Second date/time value
powertoolsdeveloper.text: InputDateTimeFormat
Fields
- input string - Source date and time
- culture string - Language culture
- format string - Output format
powertoolsdeveloper.text: InputDateTimeInfo
Fields
- input string - Source date and time
- culture string - Language culture
powertoolsdeveloper.text: InputGenerateHash
Fields
- input string - Hash source string
- algorithm string - Hash algorithm
powertoolsdeveloper.text: InputGenerateUniqueID
Fields
- uppercase string - All uppercase alpha characters
powertoolsdeveloper.text: InputJoinStrings
Fields
- input string[] - Collection of strings to be joined
- separator string - Separator character
- lower string - Convert strings in collection to lowercase
- trim string - Trim strings in collection
powertoolsdeveloper.text: InputJsonConversionCSV
Fields
- input string - JSON array object
- header boolean - Include header row
- omit string? - Columns to omit (comma separated)
- 'order string? - Column order (comma separated)
powertoolsdeveloper.text: InputJsonConversionHTML
Fields
- input string - JSON array object
- header boolean - Include header row
- alternate string? - Alternate header row markup
- attributes string? - Optional table attributes (single quoted values)
- omit string? - Columns to omit (comma separated)
- 'order string? - Column order (comma separated)
powertoolsdeveloper.text: InputJsonConversionXML
Fields
- input string - JSON array object
- root string - Name of root node
powertoolsdeveloper.text: InputMarketIndex
Fields
- symbol string - Market index
- date string? - Date (yyyy-MM-dd, leave empty for last trading day)
powertoolsdeveloper.text: InputNumberRange
Fields
- 'start decimal - Start of range
- end decimal - End of range
powertoolsdeveloper.text: InputQRCode
Fields
- input string - Text value(s) (vertical bar delimited by type)
- payload string - Payload type
powertoolsdeveloper.text: InputRedactString
Fields
- 'source string - String containing the complete text
- value string? - Individual string to redact
- values string[]? - Collection of strings to redact
- regex string? - Regular expression pattern for matching strings
powertoolsdeveloper.text: InputReplaceString
Fields
- 'source string - String containing the text to be replaced
- value string - Text to replace
- replacement string - Replacement text
powertoolsdeveloper.text: InputSplitString
Fields
- input string - Text to split
- characters string - One or more characters that will be used to split the text
powertoolsdeveloper.text: InputStockPrices
Fields
- symbols string - Stock ticker symbols (comma-separated, max 20)
- date string? - Date (yyyy-MM-dd, leave empty for latest)
- exchange string? - Stock exchange
powertoolsdeveloper.text: InputString
Fields
- 'source string - String variable or text value
powertoolsdeveloper.text: InputStringComparison
Fields
- input string - Original string
- compare string - Comparison string
- lower string - Convert strings to lowercase before comparison
- trim string - Trim strings before comparison
powertoolsdeveloper.text: InputStringContains
Fields
- find string - Text to match
- input string - Text to search
- lower string - Convert strings to lowercase
powertoolsdeveloper.text: InputStringToFile
Fields
- input string - Text string (body of file)
- extension string - File extension
- filename string - Name of file (without extension)
powertoolsdeveloper.text: InputTextToSpeech
Fields
- text string - Text to convert (10,000 characters max)
- 'type string - Text or file type
- voice string - Voice locale (must match language of input text)
powertoolsdeveloper.text: InputTranslateString
Fields
- input string - String containing the text to be translated
- language string - Translation language
powertoolsdeveloper.text: InputTrimString
Fields
- 'source string - String containing the text to be trimmed
- 'type string - Type of white space to remove
powertoolsdeveloper.text: InputVerifyHash
Fields
- input string - Original source string
- algorithm string - Hash algorithm
- hash string - Hashed result
powertoolsdeveloper.text: InputXmlConversionJSON
Fields
- input string - XML string
powertoolsdeveloper.text: OutputBoolean
Fields
- result boolean? - Result
powertoolsdeveloper.text: OutputCollectionNumber
Fields
- status boolean? - Success
- item decimal? - First Value
- items decimal[]? - All Values
powertoolsdeveloper.text: OutputCollectionResult
Fields
- result string[]? - Modified collection result
powertoolsdeveloper.text: OutputCollectionString
Fields
- status boolean? - Success
- item string? - First Value
- items string[]? - All Values
powertoolsdeveloper.text: OutputDateDifference
Fields
- years decimal? - Years
- months decimal? - Months
- days decimal? - Days
- hours decimal? - Hours
- minutes decimal? - Minutes
- milliseconds decimal? - Milliseconds
- totalYears decimal? - Total Years
- totalMonths decimal? - Total Months
- totalDays decimal? - Total Days
- totalHours decimal? - Total Hours
- totalMinutes decimal? - Total Minutes
- totalSeconds decimal? - Total Seconds
- totalMilliseconds decimal? - Total Milliseconds
- ticks decimal? - Ticks
powertoolsdeveloper.text: OutputDateInfo
Fields
- DayOfYear decimal? - DayOfYear
- DayOfWeek decimal? - DayOfWeek
- WeekOfYear decimal? - WeekOfYear
- SecondsInDay decimal? - SecondsInDay
- MinutesInDay decimal? - MinutesInDay
- Ticks decimal? - Ticks
powertoolsdeveloper.text: OutputFileByte
Fields
- result string? - Result
powertoolsdeveloper.text: OutputMarketIndex
Fields
- date string? - Date
- symbol string? - Index symbol
- exchange string? - Market exchange
- open decimal? - Open value
- high decimal? - High value
- low decimal? - Low value
- close decimal? - Close value
- volume decimal? - Trading volume
- adj_open decimal? - Adjusted open value
- adj_high decimal? - Adjusted high value
- adj_low decimal? - Adjusted low value
- adj_close decimal? - Adjusted close value
- adj_volume decimal? - Adjusted trading volume
powertoolsdeveloper.text: OutputMultiCollection
Fields
- result1 string[]? - First collection result
- result2 string[]? - Second collection result
powertoolsdeveloper.text: OutputNumber
Fields
- result decimal? - Result
powertoolsdeveloper.text: OutputStockPrice
Fields
- result OutputstockpriceResult[]? - Stock price information
powertoolsdeveloper.text: OutputstockpriceResult
Fields
- date string? - Date
- symbol string? - Ticker symbol
- exchange string? - Stock exchange
- open decimal? - Open
- high decimal? - High
- low decimal? - Low
- close decimal? - Close
- volume decimal? - Volume
powertoolsdeveloper.text: OutputString
Fields
- result string? - Result
powertoolsdeveloper.text: OutputStringArray
Fields
- data string[]? - data
powertoolsdeveloper.text: ProxyConfig
Proxy server configurations to be used with the HTTP client endpoint.
Fields
- host string(default "") - Host name of the proxy server
- port int(default 0) - Proxy server port
- userName string(default "") - Proxy server username
- password string(default "") - Proxy server password
powertoolsdeveloper.text: ShortenlinkBody
Fields
- 'source string - String variable or text value
powertoolsdeveloper.text: UrldecodeBody
Fields
- 'source string - Encoded string variable or text value
powertoolsdeveloper.text: ValidateemailBody
Fields
- 'source string - String variable or text value
Import
import ballerinax/powertoolsdeveloper.text;
Metadata
Released date: over 1 year ago
Version: 1.5.1
License: Apache-2.0
Compatibility
Platform: any
Ballerina version: 2201.4.1
GraalVM compatible: Yes
Pull count
Total: 1
Current verison: 1
Weekly downloads
Keywords
Website & App Building/App Builders
Cost/Freemium
Contributors
Dependencies