-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathAuthenticationMFASucceededData.php
More file actions
51 lines (44 loc) · 1.33 KB
/
Copy pathAuthenticationMFASucceededData.php
File metadata and controls
51 lines (44 loc) · 1.33 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
<?php
declare(strict_types=1);
// This file is auto-generated by oagen. Do not edit.
namespace WorkOS\Resource;
/** The event payload. */
readonly class AuthenticationMFASucceededData implements \JsonSerializable
{
use JsonSerializableTrait;
public function __construct(
public string $type,
public string $status,
/** The IP address of the request. */
public ?string $ipAddress,
/** The user agent of the request. */
public ?string $userAgent,
/** The ID of the user. */
public string $userId,
/** The email address of the user. */
public string $email,
) {
}
public static function fromArray(array $data): self
{
return new self(
type: $data['type'] ?? 'mfa',
status: $data['status'] ?? 'succeeded',
ipAddress: $data['ip_address'] ?? null,
userAgent: $data['user_agent'] ?? null,
userId: $data['user_id'],
email: $data['email'],
);
}
public function toArray(): array
{
return [
'type' => $this->type,
'status' => $this->status,
'ip_address' => $this->ipAddress,
'user_agent' => $this->userAgent,
'user_id' => $this->userId,
'email' => $this->email,
];
}
}