@@ -6,52 +6,113 @@ namespace Nest
6
6
{
7
7
public partial interface IPutUserRequest
8
8
{
9
+ /// <summary>
10
+ /// The email of the user.
11
+ /// </summary>
9
12
[ JsonProperty ( "email" ) ]
10
13
string Email { get ; set ; }
11
14
15
+ /// <summary>
16
+ /// The full name of the user.
17
+ /// </summary>
12
18
[ JsonProperty ( "full_name" ) ]
13
19
string FullName { get ; set ; }
14
20
21
+ /// <summary>
22
+ /// Arbitrary metadata that you want to associate with the user.
23
+ /// </summary>
15
24
[ JsonProperty ( "metadata" ) ]
16
25
IDictionary < string , object > Metadata { get ; set ; }
17
26
27
+ /// <summary>
28
+ /// The user’s password. Passwords must be at least 6 characters long.
29
+ /// </summary>
30
+ /// <remarks>
31
+ /// When adding a user, one of <see cref="Password" /> or <see cref="PasswordHash" /> is required. When updating an existing user,
32
+ /// the password is optional, so that other fields on the user (such as their roles) may be updated without modifying the user’s password.
33
+ /// </remarks>
18
34
[ JsonProperty ( "password" ) ]
19
35
string Password { get ; set ; }
20
36
37
+ /// <summary>
38
+ /// A hash of the user’s password. This must be produced using the same hashing algorithm as has been configured for password storage.
39
+ /// Using this parameter allows the client to pre-hash the password for performance and/or confidentiality reasons.
40
+ /// The <see cref="Password" /> parameter and the <see cref="PasswordHash" /> parameter cannot be used in the same request.
41
+ /// </summary>
42
+ [ JsonProperty ( "password_hash" ) ]
43
+ string PasswordHash { get ; set ; }
44
+
45
+ /// <summary>
46
+ /// A set of roles the user has. The roles determine the user’s access permissions. To create a user without any roles, specify an empty list.
47
+ /// </summary>
21
48
[ JsonProperty ( "roles" ) ]
22
49
IEnumerable < string > Roles { get ; set ; }
23
50
}
24
51
25
52
public partial class PutUserRequest
26
53
{
54
+ /// <inheritdoc />
27
55
public string Email { get ; set ; }
56
+
57
+ /// <inheritdoc />
28
58
public string FullName { get ; set ; }
59
+
60
+ /// <inheritdoc />
29
61
public IDictionary < string , object > Metadata { get ; set ; }
62
+
63
+ /// <inheritdoc />
30
64
public string Password { get ; set ; }
65
+
66
+ /// <inheritdoc />
67
+ public string PasswordHash { get ; set ; }
68
+
69
+ /// <inheritdoc />
31
70
public IEnumerable < string > Roles { get ; set ; }
32
71
}
33
72
34
73
[ DescriptorFor ( "XpackSecurityPutUser" ) ]
35
74
public partial class PutUserDescriptor
36
75
{
76
+ /// <inheritdoc />
37
77
string IPutUserRequest . Email { get ; set ; }
78
+
79
+ /// <inheritdoc />
38
80
string IPutUserRequest . FullName { get ; set ; }
81
+
82
+ /// <inheritdoc />
39
83
IDictionary < string , object > IPutUserRequest . Metadata { get ; set ; }
84
+
85
+ /// <inheritdoc />
40
86
string IPutUserRequest . Password { get ; set ; }
87
+
88
+ /// <inheritdoc />
89
+ string IPutUserRequest . PasswordHash { get ; set ; }
90
+
91
+ /// <inheritdoc />
41
92
IEnumerable < string > IPutUserRequest . Roles { get ; set ; }
42
93
94
+ /// <inheritdoc cref="IPutUserRequest.Password" />
43
95
public PutUserDescriptor Password ( string password ) => Assign ( password , ( a , v ) => a . Password = v ) ;
44
96
97
+ /// <inheritdoc cref="IPutUserRequest.PasswordHash" />
98
+ public PutUserDescriptor PasswordHash ( string passwordHash ) => Assign ( passwordHash , ( a , v ) => a . PasswordHash = v ) ;
99
+
100
+ /// <inheritdoc cref="IPutUserRequest.Roles" />
45
101
public PutUserDescriptor Roles ( IEnumerable < string > roles ) => Assign ( roles , ( a , v ) => a . Roles = v ) ;
46
102
103
+ /// <inheritdoc cref="IPutUserRequest.Roles" />
47
104
public PutUserDescriptor Roles ( params string [ ] roles ) => Assign ( roles , ( a , v ) => a . Roles = v ) ;
48
105
106
+ /// <inheritdoc cref="IPutUserRequest.FullName" />
49
107
public PutUserDescriptor FullName ( string fullName ) => Assign ( fullName , ( a , v ) => a . FullName = v ) ;
50
108
109
+ /// <inheritdoc cref="IPutUserRequest.Email" />
51
110
public PutUserDescriptor Email ( string email ) => Assign ( email , ( a , v ) => a . Email = v ) ;
52
111
112
+ /// <inheritdoc cref="IPutUserRequest.Metadata" />
53
113
public PutUserDescriptor Metadata ( IDictionary < string , object > metadata ) => Assign ( metadata , ( a , v ) => a . Metadata = v ) ;
54
114
115
+ /// <inheritdoc cref="IPutUserRequest.Metadata" />
55
116
public PutUserDescriptor Metadata ( Func < FluentDictionary < string , object > , IDictionary < string , object > > selector ) =>
56
117
Assign ( selector , ( a , v ) => a . Metadata = v ? . Invoke ( new FluentDictionary < string , object > ( ) ) ) ;
57
118
}
0 commit comments