-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathWorkOS.php
More file actions
209 lines (175 loc) · 6.07 KB
/
WorkOS.php
File metadata and controls
209 lines (175 loc) · 6.07 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<?php
declare(strict_types=1);
// This file is auto-generated by oagen. Do not edit.
namespace WorkOS;
use WorkOS\Service\AdminPortal;
use WorkOS\Service\ApiKeys;
use WorkOS\Service\AuditLogs;
use WorkOS\Service\Authorization;
use WorkOS\Service\Connect;
use WorkOS\Service\DirectorySync;
use WorkOS\Service\Events;
use WorkOS\Service\FeatureFlags;
use WorkOS\Service\MultiFactorAuth;
use WorkOS\Service\OrganizationDomains;
use WorkOS\Service\Organizations;
use WorkOS\Service\Pipes;
use WorkOS\Service\Radar;
use WorkOS\Service\SSO;
use WorkOS\Service\UserManagement;
use WorkOS\Service\Webhooks;
use WorkOS\Service\Widgets;
class WorkOS
{
private static ?string $apiKey = null;
private static ?string $clientId = null;
private ?HttpClient $httpClient = null;
public static function getApiKey(): ?string
{
return self::$apiKey;
}
public static function setApiKey(?string $key): void
{
self::$apiKey = $key;
}
public static function getClientId(): ?string
{
return self::$clientId;
}
public static function setClientId(?string $id): void
{
self::$clientId = $id;
}
private ?Service\ApiKeys $apiKeys = null;
private ?Service\MultiFactorAuth $multiFactorAuth = null;
private ?Service\Connect $connect = null;
private ?Service\Authorization $authorization = null;
private ?Service\SSO $sso = null;
private ?Service\Pipes $pipes = null;
private ?Service\DirectorySync $directorySync = null;
private ?Service\Events $events = null;
private ?Service\FeatureFlags $featureFlags = null;
private ?Service\OrganizationDomains $organizationDomains = null;
private ?Service\Organizations $organizations = null;
private ?Service\AdminPortal $adminPortal = null;
private ?Service\Radar $radar = null;
private ?Service\UserManagement $userManagement = null;
private ?Service\Webhooks $webhooks = null;
private ?Service\Widgets $widgets = null;
private ?Service\AuditLogs $auditLogs = null;
// @oagen-ignore-start — non-spec service properties (hand-maintained)
private ?Passwordless $passwordless = null;
private ?Vault $vault = null;
private ?WebhookVerification $webhookVerification = null;
private ?Actions $actions = null;
private ?SessionManager $sessionManager = null;
private ?PKCEHelper $pkce = null;
// @oagen-ignore-end
public function __construct(
?string $apiKey = null,
?string $clientId = null,
string $baseUrl = 'https://api.workos.com',
int $timeout = 60,
int $maxRetries = 3,
?\GuzzleHttp\HandlerStack $handler = null,
?string $userAgent = null,
) {
$apiKey ??= getenv('WORKOS_API_KEY') ?: self::$apiKey ?? '';
$clientId ??= getenv('WORKOS_CLIENT_ID') ?: self::$clientId;
$this->httpClient = new HttpClient($apiKey, $clientId, $baseUrl, $timeout, $maxRetries, $handler, $userAgent);
}
public function apiKeys(): ApiKeys
{
return $this->apiKeys ??= new Service\ApiKeys($this->httpClient);
}
public function multiFactorAuth(): MultiFactorAuth
{
return $this->multiFactorAuth ??= new Service\MultiFactorAuth($this->httpClient);
}
public function connect(): Connect
{
return $this->connect ??= new Service\Connect($this->httpClient);
}
public function authorization(): Authorization
{
return $this->authorization ??= new Service\Authorization($this->httpClient);
}
public function sso(): SSO
{
return $this->sso ??= new Service\SSO($this->httpClient);
}
public function pipes(): Pipes
{
return $this->pipes ??= new Service\Pipes($this->httpClient);
}
public function directorySync(): DirectorySync
{
return $this->directorySync ??= new Service\DirectorySync($this->httpClient);
}
public function events(): Events
{
return $this->events ??= new Service\Events($this->httpClient);
}
public function featureFlags(): FeatureFlags
{
return $this->featureFlags ??= new Service\FeatureFlags($this->httpClient);
}
public function organizationDomains(): OrganizationDomains
{
return $this->organizationDomains ??= new Service\OrganizationDomains($this->httpClient);
}
public function organizations(): Organizations
{
return $this->organizations ??= new Service\Organizations($this->httpClient);
}
public function adminPortal(): AdminPortal
{
return $this->adminPortal ??= new Service\AdminPortal($this->httpClient);
}
public function radar(): Radar
{
return $this->radar ??= new Service\Radar($this->httpClient);
}
public function userManagement(): UserManagement
{
return $this->userManagement ??= new Service\UserManagement($this->httpClient);
}
public function webhooks(): Webhooks
{
return $this->webhooks ??= new Service\Webhooks($this->httpClient);
}
public function widgets(): Widgets
{
return $this->widgets ??= new Service\Widgets($this->httpClient);
}
public function auditLogs(): AuditLogs
{
return $this->auditLogs ??= new Service\AuditLogs($this->httpClient);
}
// @oagen-ignore-start — non-spec service accessors (hand-maintained)
public function passwordless(): Passwordless
{
return $this->passwordless ??= new Passwordless($this->httpClient);
}
public function vault(): Vault
{
return $this->vault ??= new Vault($this->httpClient);
}
public function webhookVerification(): WebhookVerification
{
return $this->webhookVerification ??= new WebhookVerification($this->httpClient);
}
public function actions(): Actions
{
return $this->actions ??= new Actions($this->httpClient);
}
public function sessionManager(): SessionManager
{
return $this->sessionManager ??= new SessionManager($this->httpClient);
}
public function pkce(): PKCEHelper
{
return $this->pkce ??= new PKCEHelper($this->httpClient);
}
// @oagen-ignore-end
}