-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathUser.php
More file actions
102 lines (90 loc) · 2 KB
/
User.php
File metadata and controls
102 lines (90 loc) · 2 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
<?php
declare(strict_types=1);
// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information
namespace Elastic\Types;
use JsonSerializable;
/**
* Serializes to ECS Trace
*
* @version v1.x
*
* @see https://www.elastic.co/guide/en/ecs/current/ecs-user.html
*
* @author Philip Krauss <philip.krauss@elastic.co>
*/
class User extends BaseType implements JsonSerializable
{
/**
* @var array
*/
private $data;
/**
* One or multiple unique identifiers of the user
*
* @internal core
*
* @param mixed: string | int
*/
final public function setId($id)
{
$this->data['id'] = $id;
}
/**
* Short name or login of the user
*
* @internal core
*
* @param string
*/
final public function setName(string $name)
{
$this->data['name'] = $name;
}
/**
* Name of the directory the user is a member of
*
* @param string
*/
final public function setDomain(string $domain)
{
$this->data['domain'] = $domain;
}
/**
* User's email address
*
* @param string
*/
final public function setEmail(string $email)
{
$this->data['email'] = $email;
}
/**
* User’s full name, if available
*
* @param string
*/
final public function setFullName(string $fullName)
{
$this->data['full_name'] = $fullName;
}
/**
* Unique user hash to correlate information for a user in anonymized form
*
* <em>Useful if user.id or user.name contain confidential information and cannot be used.</em>
*
* @param string
*/
final public function setHash(string $hash)
{
$this->data['hash'] = $hash;
}
/**
* @return array
*/
public function jsonSerialize()
{
return ['user' => $this->data];
}
}