Skip to content

Latest commit

 

History

History
906 lines (619 loc) · 38 KB

File metadata and controls

906 lines (619 loc) · 38 KB

SDKOrchestrationV1

Overview

Available Operations

cancelEvent

Cancel a running workflow

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use formance\stack;
use formance\stack\Models\Operations;
use formance\stack\Models\Shared;

$security = new Shared\Security(
    authorization: "<YOUR_AUTHORIZATION_HERE>",
);

$sdk = stack\SDK::builder()->setSecurity($security)->build();

try {
    $request = new Operations\CancelEventRequest(
        instanceID: 'xxx',
    );
    $response = $sdk->orchestrationV1->cancelEvent($request);

    if ($response->statusCode === 200) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

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

Response

?Operations\CancelEventResponse

Errors

Error Object Status Code Content Type
Errors\Error default application/json
formance\stack\Models\Errors.SDKException 4xx-5xx /

createTrigger

Create trigger

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use formance\stack;
use formance\stack\Models\Shared;

$security = new Shared\Security(
    authorization: "<YOUR_AUTHORIZATION_HERE>",
);

$sdk = stack\SDK::builder()->setSecurity($security)->build();

try {
    $request = new Shared\TriggerData(
        event: '<value>',
        workflowID: '<value>',
    );
    $response = $sdk->orchestrationV1->createTrigger($request);

    if ($response->createTriggerResponse !== null) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

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

Response

?Operations\CreateTriggerResponse

Errors

Error Object Status Code Content Type
Errors\Error default application/json
formance\stack\Models\Errors.SDKException 4xx-5xx /

createWorkflow

Create a workflow

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use formance\stack;
use formance\stack\Models\Shared;

$security = new Shared\Security(
    authorization: "<YOUR_AUTHORIZATION_HERE>",
);

$sdk = stack\SDK::builder()->setSecurity($security)->build();

try {
    $request = new Shared\CreateWorkflowRequest(
        stages: [
            [
                'key' => '<value>',
            ],
        ],
    );
    $response = $sdk->orchestrationV1->createWorkflow($request);

    if ($response->createWorkflowResponse !== null) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

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

Response

?Operations\CreateWorkflowResponse

Errors

Error Object Status Code Content Type
Errors\Error default application/json
formance\stack\Models\Errors.SDKException 4xx-5xx /

deleteTrigger

Read trigger

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use formance\stack;
use formance\stack\Models\Operations;
use formance\stack\Models\Shared;

$security = new Shared\Security(
    authorization: "<YOUR_AUTHORIZATION_HERE>",
);

$sdk = stack\SDK::builder()->setSecurity($security)->build();

try {
    $request = new Operations\DeleteTriggerRequest(
        triggerID: '<value>',
    );
    $response = $sdk->orchestrationV1->deleteTrigger($request);

    if ($response->statusCode === 200) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

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

Response

?Operations\DeleteTriggerResponse

Errors

Error Object Status Code Content Type
Errors\Error default application/json
formance\stack\Models\Errors.SDKException 4xx-5xx /

deleteWorkflow

Delete a flow by id

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use formance\stack;
use formance\stack\Models\Operations;
use formance\stack\Models\Shared;

$security = new Shared\Security(
    authorization: "<YOUR_AUTHORIZATION_HERE>",
);

$sdk = stack\SDK::builder()->setSecurity($security)->build();

try {
    $request = new Operations\DeleteWorkflowRequest(
        flowId: 'xxx',
    );
    $response = $sdk->orchestrationV1->deleteWorkflow($request);

    if ($response->statusCode === 200) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

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

Response

?Operations\DeleteWorkflowResponse

Errors

Error Object Status Code Content Type
Errors\Error default application/json
formance\stack\Models\Errors.SDKException 4xx-5xx /

getInstance

Get a workflow instance by id

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use formance\stack;
use formance\stack\Models\Operations;
use formance\stack\Models\Shared;

$security = new Shared\Security(
    authorization: "<YOUR_AUTHORIZATION_HERE>",
);

$sdk = stack\SDK::builder()->setSecurity($security)->build();

try {
    $request = new Operations\GetInstanceRequest(
        instanceID: 'xxx',
    );
    $response = $sdk->orchestrationV1->getInstance($request);

    if ($response->getWorkflowInstanceResponse !== null) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

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

Response

?Operations\GetInstanceResponse

Errors

Error Object Status Code Content Type
Errors\Error default application/json
formance\stack\Models\Errors.SDKException 4xx-5xx /

getInstanceHistory

Get a workflow instance history by id

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use formance\stack;
use formance\stack\Models\Operations;
use formance\stack\Models\Shared;

$security = new Shared\Security(
    authorization: "<YOUR_AUTHORIZATION_HERE>",
);

$sdk = stack\SDK::builder()->setSecurity($security)->build();

try {
    $request = new Operations\GetInstanceHistoryRequest(
        instanceID: 'xxx',
    );
    $response = $sdk->orchestrationV1->getInstanceHistory($request);

    if ($response->getWorkflowInstanceHistoryResponse !== null) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

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

Response

?Operations\GetInstanceHistoryResponse

Errors

Error Object Status Code Content Type
Errors\Error default application/json
formance\stack\Models\Errors.SDKException 4xx-5xx /

getInstanceStageHistory

Get a workflow instance stage history

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use formance\stack;
use formance\stack\Models\Operations;
use formance\stack\Models\Shared;

$security = new Shared\Security(
    authorization: "<YOUR_AUTHORIZATION_HERE>",
);

$sdk = stack\SDK::builder()->setSecurity($security)->build();

try {
    $request = new Operations\GetInstanceStageHistoryRequest(
        instanceID: 'xxx',
        number: 0,
    );
    $response = $sdk->orchestrationV1->getInstanceStageHistory($request);

    if ($response->getWorkflowInstanceHistoryStageResponse !== null) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

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

Response

?Operations\GetInstanceStageHistoryResponse

Errors

Error Object Status Code Content Type
Errors\Error default application/json
formance\stack\Models\Errors.SDKException 4xx-5xx /

getWorkflow

Get a flow by id

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use formance\stack;
use formance\stack\Models\Operations;
use formance\stack\Models\Shared;

$security = new Shared\Security(
    authorization: "<YOUR_AUTHORIZATION_HERE>",
);

$sdk = stack\SDK::builder()->setSecurity($security)->build();

try {
    $request = new Operations\GetWorkflowRequest(
        flowId: 'xxx',
    );
    $response = $sdk->orchestrationV1->getWorkflow($request);

    if ($response->getWorkflowResponse !== null) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

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

Response

?Operations\GetWorkflowResponse

Errors

Error Object Status Code Content Type
Errors\Error default application/json
formance\stack\Models\Errors.SDKException 4xx-5xx /

listInstances

List instances of a workflow

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use formance\stack;
use formance\stack\Models\Operations;
use formance\stack\Models\Shared;

$security = new Shared\Security(
    authorization: "<YOUR_AUTHORIZATION_HERE>",
);

$sdk = stack\SDK::builder()->setSecurity($security)->build();

try {
    $request = new Operations\ListInstancesRequest(
        running: true,
        workflowID: 'xxx',
    );
    $response = $sdk->orchestrationV1->listInstances($request);

    if ($response->listRunsResponse !== null) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

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

Response

?Operations\ListInstancesResponse

Errors

Error Object Status Code Content Type
Errors\Error default application/json
formance\stack\Models\Errors.SDKException 4xx-5xx /

listTriggers

List triggers

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use formance\stack;
use formance\stack\Models\Operations;
use formance\stack\Models\Shared;

$security = new Shared\Security(
    authorization: "<YOUR_AUTHORIZATION_HERE>",
);

$sdk = stack\SDK::builder()->setSecurity($security)->build();

try {
    $request = new Operations\ListTriggersRequest();
    $response = $sdk->orchestrationV1->listTriggers($request);

    if ($response->listTriggersResponse !== null) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

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

Response

?Operations\ListTriggersResponse

Errors

Error Object Status Code Content Type
Errors\Error default application/json
formance\stack\Models\Errors.SDKException 4xx-5xx /

listTriggersOccurrences

List triggers occurrences

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use formance\stack;
use formance\stack\Models\Operations;
use formance\stack\Models\Shared;

$security = new Shared\Security(
    authorization: "<YOUR_AUTHORIZATION_HERE>",
);

$sdk = stack\SDK::builder()->setSecurity($security)->build();

try {
    $request = new Operations\ListTriggersOccurrencesRequest(
        triggerID: '<value>',
    );
    $response = $sdk->orchestrationV1->listTriggersOccurrences($request);

    if ($response->listTriggersOccurrencesResponse !== null) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

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

Response

?Operations\ListTriggersOccurrencesResponse

Errors

Error Object Status Code Content Type
Errors\Error default application/json
formance\stack\Models\Errors.SDKException 4xx-5xx /

listWorkflows

List registered workflows

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use formance\stack;
use formance\stack\Models\Shared;

$security = new Shared\Security(
    authorization: "<YOUR_AUTHORIZATION_HERE>",
);

$sdk = stack\SDK::builder()->setSecurity($security)->build();

try {
    $response = $sdk->orchestrationV1->listWorkflows();

    if ($response->listWorkflowsResponse !== null) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Response

?Operations\ListWorkflowsResponse

Errors

Error Object Status Code Content Type
Errors\Error default application/json
formance\stack\Models\Errors.SDKException 4xx-5xx /

orchestrationgetServerInfo

Get server info

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use formance\stack;
use formance\stack\Models\Shared;

$security = new Shared\Security(
    authorization: "<YOUR_AUTHORIZATION_HERE>",
);

$sdk = stack\SDK::builder()->setSecurity($security)->build();

try {
    $response = $sdk->orchestrationV1->orchestrationgetServerInfo();

    if ($response->serverInfo !== null) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Response

?Operations\OrchestrationgetServerInfoResponse

Errors

Error Object Status Code Content Type
Errors\Error default application/json
formance\stack\Models\Errors.SDKException 4xx-5xx /

readTrigger

Read trigger

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use formance\stack;
use formance\stack\Models\Operations;
use formance\stack\Models\Shared;

$security = new Shared\Security(
    authorization: "<YOUR_AUTHORIZATION_HERE>",
);

$sdk = stack\SDK::builder()->setSecurity($security)->build();

try {
    $request = new Operations\ReadTriggerRequest(
        triggerID: '<value>',
    );
    $response = $sdk->orchestrationV1->readTrigger($request);

    if ($response->readTriggerResponse !== null) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

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

Response

?Operations\ReadTriggerResponse

Errors

Error Object Status Code Content Type
Errors\Error default application/json
formance\stack\Models\Errors.SDKException 4xx-5xx /

runWorkflow

Run workflow

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use formance\stack;
use formance\stack\Models\Operations;
use formance\stack\Models\Shared;

$security = new Shared\Security(
    authorization: "<YOUR_AUTHORIZATION_HERE>",
);

$sdk = stack\SDK::builder()->setSecurity($security)->build();

try {
    $request = new Operations\RunWorkflowRequest(
        workflowID: 'xxx',
    );
    $response = $sdk->orchestrationV1->runWorkflow($request);

    if ($response->runWorkflowResponse !== null) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

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

Response

?Operations\RunWorkflowResponse

Errors

Error Object Status Code Content Type
Errors\Error default application/json
formance\stack\Models\Errors.SDKException 4xx-5xx /

sendEvent

Send an event to a running workflow

Example Usage

declare(strict_types=1);

require 'vendor/autoload.php';

use formance\stack;
use formance\stack\Models\Operations;
use formance\stack\Models\Shared;

$security = new Shared\Security(
    authorization: "<YOUR_AUTHORIZATION_HERE>",
);

$sdk = stack\SDK::builder()->setSecurity($security)->build();

try {
    $request = new Operations\SendEventRequest(
        instanceID: 'xxx',
    );
    $response = $sdk->orchestrationV1->sendEvent($request);

    if ($response->statusCode === 200) {
        // handle response
    }
} catch (Throwable $e) {
    // handle exception
}

Parameters

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

Response

?Operations\SendEventResponse

Errors

Error Object Status Code Content Type
Errors\Error default application/json
formance\stack\Models\Errors.SDKException 4xx-5xx /