Flowlyze Client
This package contains an API client to interact with Flowlyze flows and destinations.
The package ID is Ipaas.ApiClient.
For installation, remember to specify the local source of NuGet packages as per documentation.
To download the package click here.
Installation
Install the NuGet package Ipaas.ApiClient in the project and add the client to DI using one of the following methods:
// Adds IpaasClient to DI. The configuration section in appsettings.json must be called "Ipaas"
services.AddIpaasClient(configuration) /* IConfiguration configuration */
// Adds IpaasClient to DI by specifying the name for the configuration section present in appsettings.json
services.AddIpaasClient(configuration, sectionName) /* IConfiguration configuration, string sectionName */
// Adds IpaasClient to DI by directly specifying the actions to perform on configuration options without using appsettings.json
services.AddIpaasClient((options) => {...})) /* Action<IpaasOptions> action */
// Adds IpaasClient to DI by directly specifying configuration options without using appsettings.json
services.AddIpaasClient(options) /* IpaasOptions options */
IpaasOptions
This class contains the following properties, all mandatory for correct client configuration:
ApiUrl: indicates the Flowlyze URLApiKey: indicates the authentication keyTenantId: indicates the tenant to act on
Usage
Once registered in DI, you can use the client in your service by simply requesting the IpaasClient class in the constructor.
Let's now go into detail on the methods available for interacting with Flowlyze.
Flow
GetAllFlowsAsync
This method is used to asynchronously retrieve all flows present in the tenant.
Among the optional parameters, you can specify a filter to retrieve only flows that satisfy certain conditions.
The structure of the object to use to retrieve all flows with a specific name is as follows:
{
"requestAll": true,
"filter": [
{
"name": "name", // id, name
"comparator": "equal", // equal, notEqual, contains, notContains
"value": "flowName", // the actual value to compare
"caseSensitive": false, // true, false
"operator": "and" // and, or
}
]
}
GetFlowByNameAsync
This method is used to asynchronously retrieve a specific flow based on its name (which is unique within the tenant). The only argument of this method is the flow name.
The return type is a list of type IpaasFlow.
CreateFlowAsync
This method is used to create a new flow.
The argument to pass is an object of type IpaasFlow that contains the entire flow definition, including the destination.
The return type is an object of type IpaasFlow.
UpdateFlowAsync
This method is used to update an existing flow.
The return type is an object of type IpaasFlow.
ReloadFlowAsync
This method is used to reload an existing flow.
This method has no return type.
Destination
GetAllDestinationsAsync
This method is used to asynchronously retrieve all destinations present in the tenant.
Among the optional parameters, you can specify a filter to retrieve only destinations that satisfy certain conditions.
The structure of the object to use to retrieve all destinations with a specific name is as follows:
{
"requestAll": true,
"filter": [
{
"name": "name", // id, name
"comparator": "equal", // equal, notEqual, contains, notContains
"value": "destinationName", // the actual value to compare
"caseSensitive": false, // true, false
"operator": "and" // and, or
}
]
}
The return type is a list of type IpaasDestination.
GetDestinationByNameAsync
This method is used to asynchronously retrieve a specific destination based on its name (which is unique within the tenant). The only argument of this method is the flow name.
The return type is an object of type IpaasFlow.
CreateDestinationAsync
This method is used to create a new destination.
The return type is an object of type IpaasDestination.
UpdateDestinationAsync
This method is used to update an existing destination.
The return type is an object of type IpaasDestination.