@@ -6,52 +6,113 @@ namespace Nest
66{
77 public partial interface IPutUserRequest
88 {
9+ /// <summary>
10+ /// The email of the user.
11+ /// </summary>
912 [ JsonProperty ( "email" ) ]
1013 string Email { get ; set ; }
1114
15+ /// <summary>
16+ /// The full name of the user.
17+ /// </summary>
1218 [ JsonProperty ( "full_name" ) ]
1319 string FullName { get ; set ; }
1420
21+ /// <summary>
22+ /// Arbitrary metadata that you want to associate with the user.
23+ /// </summary>
1524 [ JsonProperty ( "metadata" ) ]
1625 IDictionary < string , object > Metadata { get ; set ; }
1726
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>
1834 [ JsonProperty ( "password" ) ]
1935 string Password { get ; set ; }
2036
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>
2148 [ JsonProperty ( "roles" ) ]
2249 IEnumerable < string > Roles { get ; set ; }
2350 }
2451
2552 public partial class PutUserRequest
2653 {
54+ /// <inheritdoc />
2755 public string Email { get ; set ; }
56+
57+ /// <inheritdoc />
2858 public string FullName { get ; set ; }
59+
60+ /// <inheritdoc />
2961 public IDictionary < string , object > Metadata { get ; set ; }
62+
63+ /// <inheritdoc />
3064 public string Password { get ; set ; }
65+
66+ /// <inheritdoc />
67+ public string PasswordHash { get ; set ; }
68+
69+ /// <inheritdoc />
3170 public IEnumerable < string > Roles { get ; set ; }
3271 }
3372
3473 [ DescriptorFor ( "XpackSecurityPutUser" ) ]
3574 public partial class PutUserDescriptor
3675 {
76+ /// <inheritdoc />
3777 string IPutUserRequest . Email { get ; set ; }
78+
79+ /// <inheritdoc />
3880 string IPutUserRequest . FullName { get ; set ; }
81+
82+ /// <inheritdoc />
3983 IDictionary < string , object > IPutUserRequest . Metadata { get ; set ; }
84+
85+ /// <inheritdoc />
4086 string IPutUserRequest . Password { get ; set ; }
87+
88+ /// <inheritdoc />
89+ string IPutUserRequest . PasswordHash { get ; set ; }
90+
91+ /// <inheritdoc />
4192 IEnumerable < string > IPutUserRequest . Roles { get ; set ; }
4293
94+ /// <inheritdoc cref="IPutUserRequest.Password" />
4395 public PutUserDescriptor Password ( string password ) => Assign ( password , ( a , v ) => a . Password = v ) ;
4496
97+ /// <inheritdoc cref="IPutUserRequest.PasswordHash" />
98+ public PutUserDescriptor PasswordHash ( string passwordHash ) => Assign ( passwordHash , ( a , v ) => a . PasswordHash = v ) ;
99+
100+ /// <inheritdoc cref="IPutUserRequest.Roles" />
45101 public PutUserDescriptor Roles ( IEnumerable < string > roles ) => Assign ( roles , ( a , v ) => a . Roles = v ) ;
46102
103+ /// <inheritdoc cref="IPutUserRequest.Roles" />
47104 public PutUserDescriptor Roles ( params string [ ] roles ) => Assign ( roles , ( a , v ) => a . Roles = v ) ;
48105
106+ /// <inheritdoc cref="IPutUserRequest.FullName" />
49107 public PutUserDescriptor FullName ( string fullName ) => Assign ( fullName , ( a , v ) => a . FullName = v ) ;
50108
109+ /// <inheritdoc cref="IPutUserRequest.Email" />
51110 public PutUserDescriptor Email ( string email ) => Assign ( email , ( a , v ) => a . Email = v ) ;
52111
112+ /// <inheritdoc cref="IPutUserRequest.Metadata" />
53113 public PutUserDescriptor Metadata ( IDictionary < string , object > metadata ) => Assign ( metadata , ( a , v ) => a . Metadata = v ) ;
54114
115+ /// <inheritdoc cref="IPutUserRequest.Metadata" />
55116 public PutUserDescriptor Metadata ( Func < FluentDictionary < string , object > , IDictionary < string , object > > selector ) =>
56117 Assign ( selector , ( a , v ) => a . Metadata = v ? . Invoke ( new FluentDictionary < string , object > ( ) ) ) ;
57118 }
0 commit comments