@@ -7,51 +7,116 @@ namespace Nest
77 [ MapsApi ( "security.put_user.json" ) ]
88 public partial interface IPutUserRequest
99 {
10- [ DataMember ( Name = "email" ) ]
10+ /// <summary>
11+ /// The email of the user.
12+ /// </summary>
13+ [ DataMember ( Name = "email" ) ]
1114 string Email { get ; set ; }
1215
13- [ DataMember ( Name = "full_name" ) ]
16+ /// <summary>
17+ /// The full name of the user.
18+ /// </summary>
19+ [ DataMember ( Name = "full_name" ) ]
1420 string FullName { get ; set ; }
1521
16- [ DataMember ( Name = "metadata" ) ]
22+ /// <summary>
23+ /// Arbitrary metadata that you want to associate with the user.
24+ /// </summary>
25+ [ DataMember ( Name = "metadata" ) ]
1726 IDictionary < string , object > Metadata { get ; set ; }
1827
19- [ DataMember ( Name = "password" ) ]
28+ /// <summary>
29+ /// The user’s password. Passwords must be at least 6 characters long.
30+ /// </summary>
31+ /// <remarks>
32+ /// When adding a user, one of <see cref="Password" /> or <see cref="PasswordHash" /> is required. When updating an
33+ /// existing user,
34+ /// the password is optional, so that other fields on the user (such as their roles) may be updated without modifying the
35+ /// user’s password.
36+ /// </remarks>
37+ [ DataMember ( Name = "password" ) ]
2038 string Password { get ; set ; }
2139
22- [ DataMember ( Name = "roles" ) ]
40+ /// <summary>
41+ /// A hash of the user’s password. This must be produced using the same hashing algorithm as has been configured for
42+ /// password storage.
43+ /// Using this parameter allows the client to pre-hash the password for performance and/or confidentiality reasons.
44+ /// The <see cref="Password" /> parameter and the <see cref="PasswordHash" /> parameter cannot be used in the same request.
45+ /// </summary>
46+ [ DataMember ( Name = "password_hash" ) ]
47+ string PasswordHash { get ; set ; }
48+
49+ /// <summary>
50+ /// A set of roles the user has. The roles determine the user’s access permissions. To create a user without any roles,
51+ /// specify an empty list.
52+ /// </summary>
53+ [ DataMember ( Name = "roles" ) ]
2354 IEnumerable < string > Roles { get ; set ; }
2455 }
2556
2657 public partial class PutUserRequest
2758 {
59+ /// <inheritdoc />
2860 public string Email { get ; set ; }
61+
62+ /// <inheritdoc />
2963 public string FullName { get ; set ; }
64+
65+ /// <inheritdoc />
3066 public IDictionary < string , object > Metadata { get ; set ; }
67+
68+ /// <inheritdoc />
3169 public string Password { get ; set ; }
70+
71+ /// <inheritdoc />
72+ public string PasswordHash { get ; set ; }
73+
74+ /// <inheritdoc />
3275 public IEnumerable < string > Roles { get ; set ; }
3376 }
3477
3578 public partial class PutUserDescriptor
3679 {
80+ /// <inheritdoc />
3781 string IPutUserRequest . Email { get ; set ; }
82+
83+ /// <inheritdoc />
3884 string IPutUserRequest . FullName { get ; set ; }
85+
86+ /// <inheritdoc />
3987 IDictionary < string , object > IPutUserRequest . Metadata { get ; set ; }
88+
89+ /// <inheritdoc />
4090 string IPutUserRequest . Password { get ; set ; }
91+
92+ /// <inheritdoc />
93+ string IPutUserRequest . PasswordHash { get ; set ; }
94+
95+ /// <inheritdoc />
4196 IEnumerable < string > IPutUserRequest . Roles { get ; set ; }
4297
98+ /// <inheritdoc cref="IPutUserRequest.Password" />
4399 public PutUserDescriptor Password ( string password ) => Assign ( password , ( a , v ) => a . Password = v ) ;
44100
101+ /// <inheritdoc cref="IPutUserRequest.PasswordHash" />
102+ public PutUserDescriptor PasswordHash ( string passwordHash ) => Assign ( passwordHash , ( a , v ) => a . PasswordHash = v ) ;
103+
104+ /// <inheritdoc cref="IPutUserRequest.Roles" />
45105 public PutUserDescriptor Roles ( IEnumerable < string > roles ) => Assign ( roles , ( a , v ) => a . Roles = v ) ;
46106
107+ /// <inheritdoc cref="IPutUserRequest.Roles" />
47108 public PutUserDescriptor Roles ( params string [ ] roles ) => Assign ( roles , ( a , v ) => a . Roles = v ) ;
48109
110+ /// <inheritdoc cref="IPutUserRequest.FullName" />
49111 public PutUserDescriptor FullName ( string fullName ) => Assign ( fullName , ( a , v ) => a . FullName = v ) ;
50112
113+ /// <inheritdoc cref="IPutUserRequest.Email" />
51114 public PutUserDescriptor Email ( string email ) => Assign ( email , ( a , v ) => a . Email = v ) ;
52115
116+ /// <inheritdoc cref="IPutUserRequest.Metadata" />
53117 public PutUserDescriptor Metadata ( IDictionary < string , object > metadata ) => Assign ( metadata , ( a , v ) => a . Metadata = v ) ;
54118
119+ /// <inheritdoc cref="IPutUserRequest.Metadata" />
55120 public PutUserDescriptor Metadata ( Func < FluentDictionary < string , object > , IDictionary < string , object > > selector ) =>
56121 Assign ( selector , ( a , v ) => a . Metadata = v ? . Invoke ( new FluentDictionary < string , object > ( ) ) ) ;
57122 }
0 commit comments