1
+ // Licensed to Elasticsearch B.V under one or more agreements.
2
+ // Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
3
+ // See the LICENSE file in the project root for more information.
4
+ //
5
+ // ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
6
+ // ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
7
+ // ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗
8
+ // ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝
9
+ // ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗
10
+ // ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝
11
+ // ------------------------------------------------
12
+ //
13
+ // This file is automatically generated.
14
+ // Please do not edit these files manually.
15
+ //
16
+ // ------------------------------------------------
17
+
18
+ #nullable restore
19
+
20
+ using Elastic . Clients . Elasticsearch . Serverless . Fluent ;
21
+ using Elastic . Clients . Elasticsearch . Serverless . Requests ;
22
+ using Elastic . Clients . Elasticsearch . Serverless . Serialization ;
23
+ using Elastic . Transport ;
24
+ using System ;
25
+ using System . Collections . Generic ;
26
+ using System . Linq . Expressions ;
27
+ using System . Text . Json ;
28
+ using System . Text . Json . Serialization ;
29
+
30
+ namespace Elastic . Clients . Elasticsearch . Serverless . Security ;
31
+
32
+ public sealed partial class ActivateUserProfileRequestParameters : RequestParameters
33
+ {
34
+ }
35
+
36
+ /// <summary>
37
+ /// <para>
38
+ /// Creates or updates a user profile on behalf of another user.
39
+ /// </para>
40
+ /// </summary>
41
+ public sealed partial class ActivateUserProfileRequest : PlainRequest < ActivateUserProfileRequestParameters >
42
+ {
43
+ internal override ApiUrls ApiUrls => ApiUrlLookup . SecurityActivateUserProfile ;
44
+
45
+ protected override HttpMethod StaticHttpMethod => HttpMethod . POST ;
46
+
47
+ internal override bool SupportsBody => true ;
48
+
49
+ internal override string OperationName => "security.activate_user_profile" ;
50
+
51
+ [ JsonInclude , JsonPropertyName ( "access_token" ) ]
52
+ public string ? AccessToken { get ; set ; }
53
+ [ JsonInclude , JsonPropertyName ( "grant_type" ) ]
54
+ public Elastic . Clients . Elasticsearch . Serverless . Security . GrantType GrantType { get ; set ; }
55
+ [ JsonInclude , JsonPropertyName ( "password" ) ]
56
+ public string ? Password { get ; set ; }
57
+ [ JsonInclude , JsonPropertyName ( "username" ) ]
58
+ public string ? Username { get ; set ; }
59
+ }
60
+
61
+ /// <summary>
62
+ /// <para>
63
+ /// Creates or updates a user profile on behalf of another user.
64
+ /// </para>
65
+ /// </summary>
66
+ public sealed partial class ActivateUserProfileRequestDescriptor : RequestDescriptor < ActivateUserProfileRequestDescriptor , ActivateUserProfileRequestParameters >
67
+ {
68
+ internal ActivateUserProfileRequestDescriptor ( Action < ActivateUserProfileRequestDescriptor > configure ) => configure . Invoke ( this ) ;
69
+
70
+ public ActivateUserProfileRequestDescriptor ( )
71
+ {
72
+ }
73
+
74
+ internal override ApiUrls ApiUrls => ApiUrlLookup . SecurityActivateUserProfile ;
75
+
76
+ protected override HttpMethod StaticHttpMethod => HttpMethod . POST ;
77
+
78
+ internal override bool SupportsBody => true ;
79
+
80
+ internal override string OperationName => "security.activate_user_profile" ;
81
+
82
+ private string ? AccessTokenValue { get ; set ; }
83
+ private Elastic . Clients . Elasticsearch . Serverless . Security . GrantType GrantTypeValue { get ; set ; }
84
+ private string ? PasswordValue { get ; set ; }
85
+ private string ? UsernameValue { get ; set ; }
86
+
87
+ public ActivateUserProfileRequestDescriptor AccessToken ( string ? accessToken )
88
+ {
89
+ AccessTokenValue = accessToken ;
90
+ return Self ;
91
+ }
92
+
93
+ public ActivateUserProfileRequestDescriptor GrantType ( Elastic . Clients . Elasticsearch . Serverless . Security . GrantType grantType )
94
+ {
95
+ GrantTypeValue = grantType ;
96
+ return Self ;
97
+ }
98
+
99
+ public ActivateUserProfileRequestDescriptor Password ( string ? password )
100
+ {
101
+ PasswordValue = password ;
102
+ return Self ;
103
+ }
104
+
105
+ public ActivateUserProfileRequestDescriptor Username ( string ? username )
106
+ {
107
+ UsernameValue = username ;
108
+ return Self ;
109
+ }
110
+
111
+ protected override void Serialize ( Utf8JsonWriter writer , JsonSerializerOptions options , IElasticsearchClientSettings settings )
112
+ {
113
+ writer . WriteStartObject ( ) ;
114
+ if ( ! string . IsNullOrEmpty ( AccessTokenValue ) )
115
+ {
116
+ writer . WritePropertyName ( "access_token" ) ;
117
+ writer . WriteStringValue ( AccessTokenValue ) ;
118
+ }
119
+
120
+ writer . WritePropertyName ( "grant_type" ) ;
121
+ JsonSerializer . Serialize ( writer , GrantTypeValue , options ) ;
122
+ if ( ! string . IsNullOrEmpty ( PasswordValue ) )
123
+ {
124
+ writer . WritePropertyName ( "password" ) ;
125
+ writer . WriteStringValue ( PasswordValue ) ;
126
+ }
127
+
128
+ if ( ! string . IsNullOrEmpty ( UsernameValue ) )
129
+ {
130
+ writer . WritePropertyName ( "username" ) ;
131
+ writer . WriteStringValue ( UsernameValue ) ;
132
+ }
133
+
134
+ writer . WriteEndObject ( ) ;
135
+ }
136
+ }
0 commit comments