Skip to content

Commit

Permalink
Update documentation structure
Browse files Browse the repository at this point in the history
  • Loading branch information
sachinira committed Aug 3, 2021
1 parent d5c137f commit bf9636b
Show file tree
Hide file tree
Showing 15 changed files with 323 additions and 269 deletions.
22 changes: 9 additions & 13 deletions openapi/cloudmersive.barcode/Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,21 @@ It allows scanning photos of barcodes to text, generate 1D barcodes and generate

This module supports Cloudmersive Barcode REST API `v1` version.

## Configuring the connector
### Prerequisites
- A Cloudmersive Account

### Obtaining tokens
Follow these steps to obtain the required token

1. Login to the Cloudmersive account
2. Visit `API Keys` tab on sidebar
3. Click `Create Key` button
* Create a Cloudmersive Account
* Obtaining tokens
1. [Login to the Cloudmersive account](https://account.cloudmersive.com/login)
2. [Obtain API keys](https://account.cloudmersive.com/keys)

## Quickstart
### Lookup EAN barcode value and obtain the product data
#### Step 1: Import cloudmersive.barcode module

To use the Cloudmersive Barcode connector in your Ballerina application, update the .bal file as follows:
### Step 1: Import cloudmersive.barcode module
First, import the ballerinax/cloudmersive.barcode module into the Ballerina project.
```ballerina
import ballerinax/cloudmersive.barcode;
```
#### Step 2: Configure the connection credentials.
### Step 2: Configure the connection credentials.
You can now make the connection configuration using the access token.
```ballerina
barcode:ApiKeysConfig config = {
Expand All @@ -36,7 +32,7 @@ barcode:ApiKeysConfig config = {
barcode:Client baseClient = check new Client(clientConfig);
```
#### Step 3: Lookup EAN barcode
### Step 3: Lookup EAN barcode

```ballerina
barcode:BarcodeLookupResponse|error bEvent = baseClient->barcodeEanLookup("4 605664 00005");
Expand Down
16 changes: 8 additions & 8 deletions openapi/cloudmersive.barcode/Package.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Connects to Cloudmersive Barcode API from Ballerina

### Package Overview
## Package overview

The `ballerinax/cloudmersive.barcode` is a [Ballerina](https://ballerina.io/) connector for connecting to Cloudmersive Barcode API.

#### Compatibility
| | Version |
|-------------------------------|-----------------------|
| Ballerina Language Version | **Swan Lake Alpha5** |
| Cloudmersive API Version | **v1** |
### Compatibility
| | Version |
|:------------------------:|:--------------------------:|
| Ballerina Language | Ballerina Swan Lake Beta2 |
| Cloudmersive API | v1 |

### Report Issues
## Report issues
To report bugs, request new features, start new discussions, view project boards, etc., go to the [Ballerina connector repository](https://github.com/ballerina-platform/ballerinax-openapi-connectors)
### Useful Links
## Useful links
- Discuss code changes of the Ballerina project in [[email protected]](mailto:[email protected]).
- Chat live with us via our [Slack channel](https://ballerina.io/community/slack/).
- Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag
33 changes: 20 additions & 13 deletions openapi/cloudmersive.barcode/client.bal
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,11 @@ public client class Client {
# + return - OK
remote isolated function barcodeEanLookup(string payload) returns BarcodeLookupResponse|error {
string path = string `/barcode/lookup/ean`;
map<string|string[]> accHeaders = {Apikey: self.apiKeys["Apikey"] ?: ""};
map<any> headerValues = {Apikey: self.apiKeys["Apikey"]};
map<string|string[]> accHeaders = getMapForHeaders(headerValues);
http:Request request = new;
json jsonBody = check payload.cloneWithType(json);
request.setJsonPayload(jsonBody);
request.setPayload(jsonBody);
BarcodeLookupResponse response = check self.clientEp->post(path, request, headers = accHeaders, targetType=BarcodeLookupResponse);
return response;
}
Expand All @@ -59,7 +60,8 @@ public client class Client {
# + return - OK
remote isolated function barcodeScanImage(Body payload) returns BarcodeScanResult|error {
string path = string `/barcode/scan/image`;
map<string|string[]> accHeaders = {Apikey: self.apiKeys["Apikey"] ?: ""};
map<any> headerValues = {Apikey: self.apiKeys["Apikey"]};
map<string|string[]> accHeaders = getMapForHeaders(headerValues);
http:Request request = new;
BarcodeScanResult response = check self.clientEp->post(path, request, headers = accHeaders, targetType=BarcodeScanResult);
return response;
Expand All @@ -70,10 +72,11 @@ public client class Client {
# + return - OK
remote isolated function generateBarcodeQrcode(string payload) returns string|error {
string path = string `/barcode/generate/qrcode`;
map<string|string[]> accHeaders = {Apikey: self.apiKeys["Apikey"] ?: ""};
map<any> headerValues = {Apikey: self.apiKeys["Apikey"]};
map<string|string[]> accHeaders = getMapForHeaders(headerValues);
http:Request request = new;
json jsonBody = check payload.cloneWithType(json);
request.setJsonPayload(jsonBody);
request.setPayload(jsonBody);
string response = check self.clientEp->post(path, request, headers = accHeaders, targetType=string);
return response;
}
Expand All @@ -83,10 +86,11 @@ public client class Client {
# + return - OK
remote isolated function generateBarcodeUpca(string payload) returns string|error {
string path = string `/barcode/generate/upc-a`;
map<string|string[]> accHeaders = {Apikey: self.apiKeys["Apikey"] ?: ""};
map<any> headerValues = {Apikey: self.apiKeys["Apikey"]};
map<string|string[]> accHeaders = getMapForHeaders(headerValues);
http:Request request = new;
json jsonBody = check payload.cloneWithType(json);
request.setJsonPayload(jsonBody);
request.setPayload(jsonBody);
string response = check self.clientEp->post(path, request, headers = accHeaders, targetType=string);
return response;
}
Expand All @@ -96,10 +100,11 @@ public client class Client {
# + return - OK
remote isolated function generateBarcodeUpce(string payload) returns string|error {
string path = string `/barcode/generate/upc-e`;
map<string|string[]> accHeaders = {Apikey: self.apiKeys["Apikey"] ?: ""};
map<any> headerValues = {Apikey: self.apiKeys["Apikey"]};
map<string|string[]> accHeaders = getMapForHeaders(headerValues);
http:Request request = new;
json jsonBody = check payload.cloneWithType(json);
request.setJsonPayload(jsonBody);
request.setPayload(jsonBody);
string response = check self.clientEp->post(path, request, headers = accHeaders, targetType=string);
return response;
}
Expand All @@ -109,10 +114,11 @@ public client class Client {
# + return - OK
remote isolated function generateBarcodeEan13(string payload) returns string|error {
string path = string `/barcode/generate/ean-13`;
map<string|string[]> accHeaders = {Apikey: self.apiKeys["Apikey"] ?: ""};
map<any> headerValues = {Apikey: self.apiKeys["Apikey"]};
map<string|string[]> accHeaders = getMapForHeaders(headerValues);
http:Request request = new;
json jsonBody = check payload.cloneWithType(json);
request.setJsonPayload(jsonBody);
request.setPayload(jsonBody);
string response = check self.clientEp->post(path, request, headers = accHeaders, targetType=string);
return response;
}
Expand All @@ -122,10 +128,11 @@ public client class Client {
# + return - OK
remote isolated function generateBarcodeEan8(string payload) returns string|error {
string path = string `/barcode/generate/ean-8`;
map<string|string[]> accHeaders = {Apikey: self.apiKeys["Apikey"] ?: ""};
map<any> headerValues = {Apikey: self.apiKeys["Apikey"]};
map<string|string[]> accHeaders = getMapForHeaders(headerValues);
http:Request request = new;
json jsonBody = check payload.cloneWithType(json);
request.setJsonPayload(jsonBody);
request.setPayload(jsonBody);
string response = check self.clientEp->post(path, request, headers = accHeaders, targetType=string);
return response;
}
Expand Down
24 changes: 11 additions & 13 deletions openapi/cloudmersive.currency/Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,23 @@ It allows obtaining real-time exchange Rate Data and allows converting prices be

This module supports Cloudmersive Currency REST API `v1` version.

## Configuring the connector
### Prerequisites
- A Cloudmersive Account
## Prerequisites
* Create a Cloudmersive Account
* Obtaining tokens
1. [Login to the Cloudmersive account](https://account.cloudmersive.com/login)
2. [Obtain API keys](https://account.cloudmersive.com/keys)

### Obtaining tokens
Follow these steps to obtain the required token

1. Login to the Cloudmersive account
2. Visit `API Keys` tab on sidebar
3. Click `Create Key` button

## Quickstart
### Get all the available currency types
#### Step 1: Import cloudmersive.currency module

To use the Cloudmersive Currency connector in your Ballerina application, update the .bal file as follows:

### Step 1: Import cloudmersive.currency module
First, import the ballerinax/cloudmersive.currency module into the Ballerina project.
```ballerina
import ballerinax/cloudmersive.currency;
```
#### Step 2: Configure the connection credentials.
### Step 2: Configure the connection credentials.
You can now make the connection configuration using the access token.
```ballerina
currency:ApiKeysConfig config = {
Expand All @@ -37,7 +35,7 @@ currency:ApiKeysConfig config = {
currency:Client baseClient = check new Client(clientConfig);
```
#### Step 3: Get all currency types
### Step 3: Get all currency types
```ballerina
currency:AvailableCurrencyResponse|error bEvent = baseClient->currencyExchangeGetAvailableCurrencies();
Expand Down
17 changes: 9 additions & 8 deletions openapi/cloudmersive.currency/Package.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
Connects to Cloudmersive Currency API from Ballerina

### Package Overview
## Package overview

The `ballerinax/cloudmersive.currency` is a [Ballerina](https://ballerina.io/) connector for connecting to Cloudmersive Currency API.

#### Compatibility
| | Version |
|-------------------------------|-----------------------|
| Ballerina Language Version | **Swan Lake Alpha5** |
| Cloudmersive REST API Version | **v1** |
### Compatibility
| | Version |
|:------------------------:|:--------------------------:|
| Ballerina Language | Ballerina Swan Lake Beta2 |
| Cloudmersive API | v1 |

### Report Issues

## Report issues
To report bugs, request new features, start new discussions, view project boards, etc., go to the [Ballerina connector repository](https://github.com/ballerina-platform/ballerinax-openapi-connectors)
### Useful Links
## Useful links
- Discuss code changes of the Ballerina project in [[email protected]](mailto:[email protected]).
- Chat live with us via our [Slack channel](https://ballerina.io/community/slack/).
- Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag
9 changes: 5 additions & 4 deletions openapi/cloudmersive.currency/client.bal
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@ public client class Client {
# + return - OK
remote isolated function currencyExchangeGetAvailableCurrencies() returns AvailableCurrencyResponse|error {
string path = string `/currency/exchange-rates/list-available`;
map<string|string[]> accHeaders = {Apikey: self.apiKeys["Apikey"] ?: ""};
map<any> headerValues = {Apikey: self.apiKeys["Apikey"]};
map<string|string[]> accHeaders = getMapForHeaders(headerValues);
http:Request request = new;
//TODO: Update the request as needed;
AvailableCurrencyResponse response = check self.clientEp-> post(path, request, headers = accHeaders, targetType = AvailableCurrencyResponse);
Expand All @@ -59,11 +60,11 @@ public client class Client {
# + return - OK
remote isolated function currencyExchangeConvertCurrency(string 'source, string destination, decimal payload) returns ConvertedCurrencyResult|error {
string path = string `/currency/exchange-rates/convert/${'source}/to/${destination}`;
map<any> headerValues = {Apikey: self.apiKeys["Apikey"] ?: ""};
map<any> headerValues = {Apikey: self.apiKeys["Apikey"]};
map<string|string[]> accHeaders = getMapForHeaders(headerValues);
http:Request request = new;
json jsonBody = check payload.cloneWithType(json);
request.setJsonPayload(jsonBody);
request.setPayload(jsonBody);
ConvertedCurrencyResult response = check self.clientEp->post(path, request, headers = accHeaders, targetType=ConvertedCurrencyResult);
return response;
}
Expand All @@ -74,7 +75,7 @@ public client class Client {
# + return - OK
remote isolated function currencyExchangeGetExchangeRate(string 'source, string destination) returns ExchangeRateResult|error {
string path = string `/currency/exchange-rates/get/${'source}/to/${destination}`;
map<any> headerValues = {Apikey: self.apiKeys["Apikey"] ?: ""};
map<any> headerValues = {Apikey: self.apiKeys["Apikey"]};
map<string|string[]> accHeaders = getMapForHeaders(headerValues);
http:Request request = new;
//TODO: Update the request as needed;
Expand Down
25 changes: 10 additions & 15 deletions openapi/cloudmersive.security/Module.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,21 @@ It allows advanced high-performance scanning capabilities on files for SQL Injec
XML External Entity attacks and threats, XSS attacks and threats, Server-Side Request Forgery (SSRF) threats and attacks, bots and other threats.

This module supports Cloudmersive Security REST API `v1` version.

## Configuring the connector
### Prerequisites
- A Cloudmersive Account

### Obtaining tokens
Follow these steps to obtain the required token

1. Login to the Cloudmersive account
2. Visit `API Keys` tab on side bar
3. Click `Create Key` button
## Prerequisites
* Create a Cloudmersive Account
* Obtaining tokens
1. [Login to the Cloudmersive account](https://account.cloudmersive.com/login)
2. [Obtain API keys](https://account.cloudmersive.com/keys)

## Quickstart
### Scan string for SQL Injection attacks
#### Step 1: Import cloudmersive.security module
To use the Cloudmersive Security connector in your Ballerina application, update the .bal file as follows:

### Step 1: Import cloudmersive.security module
First, import the ballerinax/cloudmersive.security module into the Ballerina project.
```ballerina
import ballerinax/cloudmersive.security;
```
#### Step 2: Configure the connection credentials.
### Step 2: Configure the connection credentials.
You can now make the connection configuration using the access token.
```ballerina
security:ApiKeysConfig config = {
Expand All @@ -37,7 +32,7 @@ security:ApiKeysConfig config = {
security:Client baseClient = check new Client(clientConfig);
```
#### Step 3: Scan the query for SQL Injection
### Step 3: Scan the query for SQL Injection
```ballerina
string query = "SELECT * FROM Users WHERE UserId = 105 OR 1=1;";
security:StringSqlInjectionDetectionResult|error bEvent = baseClient->contentThreatDetectionCheckSqlInjectionString(query);
Expand Down
16 changes: 8 additions & 8 deletions openapi/cloudmersive.security/Package.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
Connects to Cloudmersive Security API from Ballerina

### Package Overview
## Package overview

The `ballerinax/cloudmersive.security` is a [Ballerina](https://ballerina.io/) connector for connecting to Cloudmersive Security API.

#### Compatibility
| | Version |
|-------------------------------|-----------------------|
| Ballerina Language Version | **Swan Lake Alpha5** |
| Cloudmersive API Version | **v1** |
### Compatibility
| | Version |
|:------------------------:|:--------------------------:|
| Ballerina Language | Ballerina Swan Lake Beta2 |
| Cloudmersive API | v1 |

### Report Issues
## Report issues
To report bugs, request new features, start new discussions, view project boards, etc., go to the [Ballerina connector repository](https://github.com/ballerina-platform/ballerinax-openapi-connectors)
### Useful Links
## Useful links
- Discuss code changes of the Ballerina project in [[email protected]](mailto:[email protected]).
- Chat live with us via our [Slack channel](https://ballerina.io/community/slack/).
- Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag
Loading

0 comments on commit bf9636b

Please sign in to comment.