Skip to content

Latest commit

 

History

History
1001 lines (715 loc) · 39.7 KB

File metadata and controls

1001 lines (715 loc) · 39.7 KB

SDKOrchestrationV1

(orchestration().v1())

Overview

Available Operations

cancelEvent

Cancel a running workflow

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.Error;
import com.formance.formance_sdk.models.operations.CancelEventRequest;
import com.formance.formance_sdk.models.operations.CancelEventResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Error, Exception {

        SDK sdk = SDK.builder()
                .security(Security.builder()
                    .clientID("<YOUR_CLIENT_ID_HERE>")
                    .clientSecret("<YOUR_CLIENT_SECRET_HERE>")
                    .build())
            .build();

        CancelEventRequest req = CancelEventRequest.builder()
                .instanceID("xxx")
                .build();

        CancelEventResponse res = sdk.orchestration().v1().cancelEvent()
                .request(req)
                .call();

        // handle response
    }
}

Parameters

Parameter Type Required Description
request CancelEventRequest ✔️ The request object to use for the request.

Response

CancelEventResponse

Errors

Error Type Status Code Content Type
models/errors/Error default application/json
models/errors/SDKError 4XX, 5XX */*

createTrigger

Create trigger

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.Error;
import com.formance.formance_sdk.models.operations.CreateTriggerResponse;
import com.formance.formance_sdk.models.shared.Security;
import com.formance.formance_sdk.models.shared.TriggerData;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Error, Exception {

        SDK sdk = SDK.builder()
                .security(Security.builder()
                    .clientID("<YOUR_CLIENT_ID_HERE>")
                    .clientSecret("<YOUR_CLIENT_SECRET_HERE>")
                    .build())
            .build();

        TriggerData req = TriggerData.builder()
                .event("<value>")
                .workflowID("<id>")
                .build();

        CreateTriggerResponse res = sdk.orchestration().v1().createTrigger()
                .request(req)
                .call();

        if (res.createTriggerResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
request TriggerData ✔️ The request object to use for the request.

Response

CreateTriggerResponse

Errors

Error Type Status Code Content Type
models/errors/Error default application/json
models/errors/SDKError 4XX, 5XX */*

createWorkflow

Create a workflow

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.Error;
import com.formance.formance_sdk.models.operations.CreateWorkflowResponse;
import com.formance.formance_sdk.models.shared.CreateWorkflowRequest;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;
import java.util.List;
import java.util.Map;

public class Application {

    public static void main(String[] args) throws Error, Exception {

        SDK sdk = SDK.builder()
                .security(Security.builder()
                    .clientID("<YOUR_CLIENT_ID_HERE>")
                    .clientSecret("<YOUR_CLIENT_SECRET_HERE>")
                    .build())
            .build();

        CreateWorkflowRequest req = CreateWorkflowRequest.builder()
                .stages(List.of(
                    Map.ofEntries(
                        Map.entry("key", "<value>"))))
                .build();

        CreateWorkflowResponse res = sdk.orchestration().v1().createWorkflow()
                .request(req)
                .call();

        if (res.createWorkflowResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
request CreateWorkflowRequest ✔️ The request object to use for the request.

Response

CreateWorkflowResponse

Errors

Error Type Status Code Content Type
models/errors/Error default application/json
models/errors/SDKError 4XX, 5XX */*

deleteTrigger

Read trigger

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.Error;
import com.formance.formance_sdk.models.operations.DeleteTriggerRequest;
import com.formance.formance_sdk.models.operations.DeleteTriggerResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Error, Exception {

        SDK sdk = SDK.builder()
                .security(Security.builder()
                    .clientID("<YOUR_CLIENT_ID_HERE>")
                    .clientSecret("<YOUR_CLIENT_SECRET_HERE>")
                    .build())
            .build();

        DeleteTriggerRequest req = DeleteTriggerRequest.builder()
                .triggerID("<id>")
                .build();

        DeleteTriggerResponse res = sdk.orchestration().v1().deleteTrigger()
                .request(req)
                .call();

        // handle response
    }
}

Parameters

Parameter Type Required Description
request DeleteTriggerRequest ✔️ The request object to use for the request.

Response

DeleteTriggerResponse

Errors

Error Type Status Code Content Type
models/errors/Error default application/json
models/errors/SDKError 4XX, 5XX */*

deleteWorkflow

Delete a flow by id

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.Error;
import com.formance.formance_sdk.models.operations.DeleteWorkflowRequest;
import com.formance.formance_sdk.models.operations.DeleteWorkflowResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Error, Exception {

        SDK sdk = SDK.builder()
                .security(Security.builder()
                    .clientID("<YOUR_CLIENT_ID_HERE>")
                    .clientSecret("<YOUR_CLIENT_SECRET_HERE>")
                    .build())
            .build();

        DeleteWorkflowRequest req = DeleteWorkflowRequest.builder()
                .flowId("xxx")
                .build();

        DeleteWorkflowResponse res = sdk.orchestration().v1().deleteWorkflow()
                .request(req)
                .call();

        // handle response
    }
}

Parameters

Parameter Type Required Description
request DeleteWorkflowRequest ✔️ The request object to use for the request.

Response

DeleteWorkflowResponse

Errors

Error Type Status Code Content Type
models/errors/Error default application/json
models/errors/SDKError 4XX, 5XX */*

getInstance

Get a workflow instance by id

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.Error;
import com.formance.formance_sdk.models.operations.GetInstanceRequest;
import com.formance.formance_sdk.models.operations.GetInstanceResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Error, Exception {

        SDK sdk = SDK.builder()
                .security(Security.builder()
                    .clientID("<YOUR_CLIENT_ID_HERE>")
                    .clientSecret("<YOUR_CLIENT_SECRET_HERE>")
                    .build())
            .build();

        GetInstanceRequest req = GetInstanceRequest.builder()
                .instanceID("xxx")
                .build();

        GetInstanceResponse res = sdk.orchestration().v1().getInstance()
                .request(req)
                .call();

        if (res.getWorkflowInstanceResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
request GetInstanceRequest ✔️ The request object to use for the request.

Response

GetInstanceResponse

Errors

Error Type Status Code Content Type
models/errors/Error default application/json
models/errors/SDKError 4XX, 5XX */*

getInstanceHistory

Get a workflow instance history by id

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.Error;
import com.formance.formance_sdk.models.operations.GetInstanceHistoryRequest;
import com.formance.formance_sdk.models.operations.GetInstanceHistoryResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Error, Exception {

        SDK sdk = SDK.builder()
                .security(Security.builder()
                    .clientID("<YOUR_CLIENT_ID_HERE>")
                    .clientSecret("<YOUR_CLIENT_SECRET_HERE>")
                    .build())
            .build();

        GetInstanceHistoryRequest req = GetInstanceHistoryRequest.builder()
                .instanceID("xxx")
                .build();

        GetInstanceHistoryResponse res = sdk.orchestration().v1().getInstanceHistory()
                .request(req)
                .call();

        if (res.getWorkflowInstanceHistoryResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
request GetInstanceHistoryRequest ✔️ The request object to use for the request.

Response

GetInstanceHistoryResponse

Errors

Error Type Status Code Content Type
models/errors/Error default application/json
models/errors/SDKError 4XX, 5XX */*

getInstanceStageHistory

Get a workflow instance stage history

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.Error;
import com.formance.formance_sdk.models.operations.GetInstanceStageHistoryRequest;
import com.formance.formance_sdk.models.operations.GetInstanceStageHistoryResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Error, Exception {

        SDK sdk = SDK.builder()
                .security(Security.builder()
                    .clientID("<YOUR_CLIENT_ID_HERE>")
                    .clientSecret("<YOUR_CLIENT_SECRET_HERE>")
                    .build())
            .build();

        GetInstanceStageHistoryRequest req = GetInstanceStageHistoryRequest.builder()
                .instanceID("xxx")
                .number(0L)
                .build();

        GetInstanceStageHistoryResponse res = sdk.orchestration().v1().getInstanceStageHistory()
                .request(req)
                .call();

        if (res.getWorkflowInstanceHistoryStageResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
request GetInstanceStageHistoryRequest ✔️ The request object to use for the request.

Response

GetInstanceStageHistoryResponse

Errors

Error Type Status Code Content Type
models/errors/Error default application/json
models/errors/SDKError 4XX, 5XX */*

getWorkflow

Get a flow by id

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.Error;
import com.formance.formance_sdk.models.operations.GetWorkflowRequest;
import com.formance.formance_sdk.models.operations.GetWorkflowResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Error, Exception {

        SDK sdk = SDK.builder()
                .security(Security.builder()
                    .clientID("<YOUR_CLIENT_ID_HERE>")
                    .clientSecret("<YOUR_CLIENT_SECRET_HERE>")
                    .build())
            .build();

        GetWorkflowRequest req = GetWorkflowRequest.builder()
                .flowId("xxx")
                .build();

        GetWorkflowResponse res = sdk.orchestration().v1().getWorkflow()
                .request(req)
                .call();

        if (res.getWorkflowResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
request GetWorkflowRequest ✔️ The request object to use for the request.

Response

GetWorkflowResponse

Errors

Error Type Status Code Content Type
models/errors/Error default application/json
models/errors/SDKError 4XX, 5XX */*

listInstances

List instances of a workflow

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.Error;
import com.formance.formance_sdk.models.operations.ListInstancesRequest;
import com.formance.formance_sdk.models.operations.ListInstancesResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Error, Exception {

        SDK sdk = SDK.builder()
                .security(Security.builder()
                    .clientID("<YOUR_CLIENT_ID_HERE>")
                    .clientSecret("<YOUR_CLIENT_SECRET_HERE>")
                    .build())
            .build();

        ListInstancesRequest req = ListInstancesRequest.builder()
                .running(true)
                .workflowID("xxx")
                .build();

        ListInstancesResponse res = sdk.orchestration().v1().listInstances()
                .request(req)
                .call();

        if (res.listRunsResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
request ListInstancesRequest ✔️ The request object to use for the request.

Response

ListInstancesResponse

Errors

Error Type Status Code Content Type
models/errors/Error default application/json
models/errors/SDKError 4XX, 5XX */*

listTriggers

List triggers

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.Error;
import com.formance.formance_sdk.models.operations.ListTriggersRequest;
import com.formance.formance_sdk.models.operations.ListTriggersResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Error, Exception {

        SDK sdk = SDK.builder()
                .security(Security.builder()
                    .clientID("<YOUR_CLIENT_ID_HERE>")
                    .clientSecret("<YOUR_CLIENT_SECRET_HERE>")
                    .build())
            .build();

        ListTriggersRequest req = ListTriggersRequest.builder()
                .build();

        ListTriggersResponse res = sdk.orchestration().v1().listTriggers()
                .request(req)
                .call();

        if (res.listTriggersResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
request ListTriggersRequest ✔️ The request object to use for the request.

Response

ListTriggersResponse

Errors

Error Type Status Code Content Type
models/errors/Error default application/json
models/errors/SDKError 4XX, 5XX */*

listTriggersOccurrences

List triggers occurrences

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.Error;
import com.formance.formance_sdk.models.operations.ListTriggersOccurrencesRequest;
import com.formance.formance_sdk.models.operations.ListTriggersOccurrencesResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Error, Exception {

        SDK sdk = SDK.builder()
                .security(Security.builder()
                    .clientID("<YOUR_CLIENT_ID_HERE>")
                    .clientSecret("<YOUR_CLIENT_SECRET_HERE>")
                    .build())
            .build();

        ListTriggersOccurrencesRequest req = ListTriggersOccurrencesRequest.builder()
                .triggerID("<id>")
                .build();

        ListTriggersOccurrencesResponse res = sdk.orchestration().v1().listTriggersOccurrences()
                .request(req)
                .call();

        if (res.listTriggersOccurrencesResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
request ListTriggersOccurrencesRequest ✔️ The request object to use for the request.

Response

ListTriggersOccurrencesResponse

Errors

Error Type Status Code Content Type
models/errors/Error default application/json
models/errors/SDKError 4XX, 5XX */*

listWorkflows

List registered workflows

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.Error;
import com.formance.formance_sdk.models.operations.ListWorkflowsResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Error, Exception {

        SDK sdk = SDK.builder()
                .security(Security.builder()
                    .clientID("<YOUR_CLIENT_ID_HERE>")
                    .clientSecret("<YOUR_CLIENT_SECRET_HERE>")
                    .build())
            .build();

        ListWorkflowsResponse res = sdk.orchestration().v1().listWorkflows()
                .call();

        if (res.listWorkflowsResponse().isPresent()) {
            // handle response
        }
    }
}

Response

ListWorkflowsResponse

Errors

Error Type Status Code Content Type
models/errors/Error default application/json
models/errors/SDKError 4XX, 5XX */*

orchestrationgetServerInfo

Get server info

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.Error;
import com.formance.formance_sdk.models.operations.OrchestrationgetServerInfoResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Error, Exception {

        SDK sdk = SDK.builder()
                .security(Security.builder()
                    .clientID("<YOUR_CLIENT_ID_HERE>")
                    .clientSecret("<YOUR_CLIENT_SECRET_HERE>")
                    .build())
            .build();

        OrchestrationgetServerInfoResponse res = sdk.orchestration().v1().orchestrationgetServerInfo()
                .call();

        if (res.serverInfo().isPresent()) {
            // handle response
        }
    }
}

Response

OrchestrationgetServerInfoResponse

Errors

Error Type Status Code Content Type
models/errors/Error default application/json
models/errors/SDKError 4XX, 5XX */*

readTrigger

Read trigger

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.Error;
import com.formance.formance_sdk.models.operations.ReadTriggerRequest;
import com.formance.formance_sdk.models.operations.ReadTriggerResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Error, Exception {

        SDK sdk = SDK.builder()
                .security(Security.builder()
                    .clientID("<YOUR_CLIENT_ID_HERE>")
                    .clientSecret("<YOUR_CLIENT_SECRET_HERE>")
                    .build())
            .build();

        ReadTriggerRequest req = ReadTriggerRequest.builder()
                .triggerID("<id>")
                .build();

        ReadTriggerResponse res = sdk.orchestration().v1().readTrigger()
                .request(req)
                .call();

        if (res.readTriggerResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
request ReadTriggerRequest ✔️ The request object to use for the request.

Response

ReadTriggerResponse

Errors

Error Type Status Code Content Type
models/errors/Error default application/json
models/errors/SDKError 4XX, 5XX */*

runWorkflow

Run workflow

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.Error;
import com.formance.formance_sdk.models.operations.RunWorkflowRequest;
import com.formance.formance_sdk.models.operations.RunWorkflowResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Error, Exception {

        SDK sdk = SDK.builder()
                .security(Security.builder()
                    .clientID("<YOUR_CLIENT_ID_HERE>")
                    .clientSecret("<YOUR_CLIENT_SECRET_HERE>")
                    .build())
            .build();

        RunWorkflowRequest req = RunWorkflowRequest.builder()
                .workflowID("xxx")
                .build();

        RunWorkflowResponse res = sdk.orchestration().v1().runWorkflow()
                .request(req)
                .call();

        if (res.runWorkflowResponse().isPresent()) {
            // handle response
        }
    }
}

Parameters

Parameter Type Required Description
request RunWorkflowRequest ✔️ The request object to use for the request.

Response

RunWorkflowResponse

Errors

Error Type Status Code Content Type
models/errors/Error default application/json
models/errors/SDKError 4XX, 5XX */*

sendEvent

Send an event to a running workflow

Example Usage

package hello.world;

import com.formance.formance_sdk.SDK;
import com.formance.formance_sdk.models.errors.Error;
import com.formance.formance_sdk.models.operations.SendEventRequest;
import com.formance.formance_sdk.models.operations.SendEventResponse;
import com.formance.formance_sdk.models.shared.Security;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws Error, Exception {

        SDK sdk = SDK.builder()
                .security(Security.builder()
                    .clientID("<YOUR_CLIENT_ID_HERE>")
                    .clientSecret("<YOUR_CLIENT_SECRET_HERE>")
                    .build())
            .build();

        SendEventRequest req = SendEventRequest.builder()
                .instanceID("xxx")
                .build();

        SendEventResponse res = sdk.orchestration().v1().sendEvent()
                .request(req)
                .call();

        // handle response
    }
}

Parameters

Parameter Type Required Description
request SendEventRequest ✔️ The request object to use for the request.

Response

SendEventResponse

Errors

Error Type Status Code Content Type
models/errors/Error default application/json
models/errors/SDKError 4XX, 5XX */*