-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathMindeeWorkflowApi.php
More file actions
41 lines (36 loc) · 1.05 KB
/
Copy pathMindeeWorkflowApi.php
File metadata and controls
41 lines (36 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
declare(strict_types=1);
/**
* Settings and variables linked to endpoint calling & API usage.
*/
namespace Mindee\V1\Http;
use Mindee\Error\ErrorCode;
use Mindee\Error\MindeeException;
/**
* Data class containing settings for workflows.
*/
class MindeeWorkflowApi extends BaseApi
{
/**
* @param string|null $apiKey API key.
* @param string $workflowId ID of the workflow.
* @throws MindeeException Throws if the API key specified is invalid.
*/
public function __construct(
?string $apiKey,
public string $workflowId
) {
parent::__construct($apiKey);
if (empty($this->apiKey)) {
throw new MindeeException(
"Missing API key. Please check your Client configuration.You can set this using the "
. API_KEY_ENV_NAME . ' environment variable.',
ErrorCode::USER_INPUT_ERROR
);
}
$this->urlRoot = rtrim(
$this->baseUrl,
"/"
) . "/v1/workflows/$this->workflowId/executions";
}
}