-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for
Security
APIs (#8315)
- Loading branch information
Showing
336 changed files
with
45,513 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
136 changes: 136 additions & 0 deletions
136
....Clients.Elasticsearch.Serverless/_Generated/Api/Security/ActivateUserProfileRequest.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,136 @@ | ||
// 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. | ||
// | ||
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ | ||
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ | ||
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ | ||
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ | ||
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ | ||
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ | ||
// ------------------------------------------------ | ||
// | ||
// This file is automatically generated. | ||
// Please do not edit these files manually. | ||
// | ||
// ------------------------------------------------ | ||
|
||
#nullable restore | ||
|
||
using Elastic.Clients.Elasticsearch.Serverless.Fluent; | ||
using Elastic.Clients.Elasticsearch.Serverless.Requests; | ||
using Elastic.Clients.Elasticsearch.Serverless.Serialization; | ||
using Elastic.Transport; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq.Expressions; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Elastic.Clients.Elasticsearch.Serverless.Security; | ||
|
||
public sealed partial class ActivateUserProfileRequestParameters : RequestParameters | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// <para> | ||
/// Creates or updates a user profile on behalf of another user. | ||
/// </para> | ||
/// </summary> | ||
public sealed partial class ActivateUserProfileRequest : PlainRequest<ActivateUserProfileRequestParameters> | ||
{ | ||
internal override ApiUrls ApiUrls => ApiUrlLookup.SecurityActivateUserProfile; | ||
|
||
protected override HttpMethod StaticHttpMethod => HttpMethod.POST; | ||
|
||
internal override bool SupportsBody => true; | ||
|
||
internal override string OperationName => "security.activate_user_profile"; | ||
|
||
[JsonInclude, JsonPropertyName("access_token")] | ||
public string? AccessToken { get; set; } | ||
[JsonInclude, JsonPropertyName("grant_type")] | ||
public Elastic.Clients.Elasticsearch.Serverless.Security.GrantType GrantType { get; set; } | ||
[JsonInclude, JsonPropertyName("password")] | ||
public string? Password { get; set; } | ||
[JsonInclude, JsonPropertyName("username")] | ||
public string? Username { get; set; } | ||
} | ||
|
||
/// <summary> | ||
/// <para> | ||
/// Creates or updates a user profile on behalf of another user. | ||
/// </para> | ||
/// </summary> | ||
public sealed partial class ActivateUserProfileRequestDescriptor : RequestDescriptor<ActivateUserProfileRequestDescriptor, ActivateUserProfileRequestParameters> | ||
{ | ||
internal ActivateUserProfileRequestDescriptor(Action<ActivateUserProfileRequestDescriptor> configure) => configure.Invoke(this); | ||
|
||
public ActivateUserProfileRequestDescriptor() | ||
{ | ||
} | ||
|
||
internal override ApiUrls ApiUrls => ApiUrlLookup.SecurityActivateUserProfile; | ||
|
||
protected override HttpMethod StaticHttpMethod => HttpMethod.POST; | ||
|
||
internal override bool SupportsBody => true; | ||
|
||
internal override string OperationName => "security.activate_user_profile"; | ||
|
||
private string? AccessTokenValue { get; set; } | ||
private Elastic.Clients.Elasticsearch.Serverless.Security.GrantType GrantTypeValue { get; set; } | ||
private string? PasswordValue { get; set; } | ||
private string? UsernameValue { get; set; } | ||
|
||
public ActivateUserProfileRequestDescriptor AccessToken(string? accessToken) | ||
{ | ||
AccessTokenValue = accessToken; | ||
return Self; | ||
} | ||
|
||
public ActivateUserProfileRequestDescriptor GrantType(Elastic.Clients.Elasticsearch.Serverless.Security.GrantType grantType) | ||
{ | ||
GrantTypeValue = grantType; | ||
return Self; | ||
} | ||
|
||
public ActivateUserProfileRequestDescriptor Password(string? password) | ||
{ | ||
PasswordValue = password; | ||
return Self; | ||
} | ||
|
||
public ActivateUserProfileRequestDescriptor Username(string? username) | ||
{ | ||
UsernameValue = username; | ||
return Self; | ||
} | ||
|
||
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) | ||
{ | ||
writer.WriteStartObject(); | ||
if (!string.IsNullOrEmpty(AccessTokenValue)) | ||
{ | ||
writer.WritePropertyName("access_token"); | ||
writer.WriteStringValue(AccessTokenValue); | ||
} | ||
|
||
writer.WritePropertyName("grant_type"); | ||
JsonSerializer.Serialize(writer, GrantTypeValue, options); | ||
if (!string.IsNullOrEmpty(PasswordValue)) | ||
{ | ||
writer.WritePropertyName("password"); | ||
writer.WriteStringValue(PasswordValue); | ||
} | ||
|
||
if (!string.IsNullOrEmpty(UsernameValue)) | ||
{ | ||
writer.WritePropertyName("username"); | ||
writer.WriteStringValue(UsernameValue); | ||
} | ||
|
||
writer.WriteEndObject(); | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
...Clients.Elasticsearch.Serverless/_Generated/Api/Security/ActivateUserProfileResponse.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
// 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. | ||
// | ||
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ | ||
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ | ||
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ | ||
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ | ||
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ | ||
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ | ||
// ------------------------------------------------ | ||
// | ||
// This file is automatically generated. | ||
// Please do not edit these files manually. | ||
// | ||
// ------------------------------------------------ | ||
|
||
#nullable restore | ||
|
||
using Elastic.Clients.Elasticsearch.Serverless.Fluent; | ||
using Elastic.Clients.Elasticsearch.Serverless.Serialization; | ||
using Elastic.Transport.Products.Elasticsearch; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Elastic.Clients.Elasticsearch.Serverless.Security; | ||
|
||
public sealed partial class ActivateUserProfileResponse : ElasticsearchResponse | ||
{ | ||
[JsonInclude, JsonPropertyName("data")] | ||
public IReadOnlyDictionary<string, object> Data { get; init; } | ||
[JsonInclude, JsonPropertyName("_doc")] | ||
public Elastic.Clients.Elasticsearch.Serverless.Security.UserProfileHitMetadata Doc { get; init; } | ||
[JsonInclude, JsonPropertyName("enabled")] | ||
public bool? Enabled { get; init; } | ||
[JsonInclude, JsonPropertyName("labels")] | ||
public IReadOnlyDictionary<string, object> Labels { get; init; } | ||
[JsonInclude, JsonPropertyName("last_synchronized")] | ||
public long LastSynchronized { get; init; } | ||
[JsonInclude, JsonPropertyName("uid")] | ||
public string Uid { get; init; } | ||
[JsonInclude, JsonPropertyName("user")] | ||
public Elastic.Clients.Elasticsearch.Serverless.Security.UserProfileUser User { get; init; } | ||
} |
84 changes: 84 additions & 0 deletions
84
...Elastic.Clients.Elasticsearch.Serverless/_Generated/Api/Security/AuthenticateRequest.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
// 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. | ||
// | ||
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ | ||
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ | ||
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ | ||
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ | ||
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ | ||
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ | ||
// ------------------------------------------------ | ||
// | ||
// This file is automatically generated. | ||
// Please do not edit these files manually. | ||
// | ||
// ------------------------------------------------ | ||
|
||
#nullable restore | ||
|
||
using Elastic.Clients.Elasticsearch.Serverless.Fluent; | ||
using Elastic.Clients.Elasticsearch.Serverless.Requests; | ||
using Elastic.Clients.Elasticsearch.Serverless.Serialization; | ||
using Elastic.Transport; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq.Expressions; | ||
using System.Text.Json; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Elastic.Clients.Elasticsearch.Serverless.Security; | ||
|
||
public sealed partial class AuthenticateRequestParameters : RequestParameters | ||
{ | ||
} | ||
|
||
/// <summary> | ||
/// <para> | ||
/// Authenticate a user. | ||
/// Authenticates a user and returns information about the authenticated user. | ||
/// Include the user information in a <a href="https://en.wikipedia.org/wiki/Basic_access_authentication">basic auth header</a>. | ||
/// A successful call returns a JSON structure that shows user information such as their username, the roles that are assigned to the user, any assigned metadata, and information about the realms that authenticated and authorized the user. | ||
/// If the user cannot be authenticated, this API returns a 401 status code. | ||
/// </para> | ||
/// </summary> | ||
public sealed partial class AuthenticateRequest : PlainRequest<AuthenticateRequestParameters> | ||
{ | ||
internal override ApiUrls ApiUrls => ApiUrlLookup.SecurityAuthenticate; | ||
|
||
protected override HttpMethod StaticHttpMethod => HttpMethod.GET; | ||
|
||
internal override bool SupportsBody => false; | ||
|
||
internal override string OperationName => "security.authenticate"; | ||
} | ||
|
||
/// <summary> | ||
/// <para> | ||
/// Authenticate a user. | ||
/// Authenticates a user and returns information about the authenticated user. | ||
/// Include the user information in a <a href="https://en.wikipedia.org/wiki/Basic_access_authentication">basic auth header</a>. | ||
/// A successful call returns a JSON structure that shows user information such as their username, the roles that are assigned to the user, any assigned metadata, and information about the realms that authenticated and authorized the user. | ||
/// If the user cannot be authenticated, this API returns a 401 status code. | ||
/// </para> | ||
/// </summary> | ||
public sealed partial class AuthenticateRequestDescriptor : RequestDescriptor<AuthenticateRequestDescriptor, AuthenticateRequestParameters> | ||
{ | ||
internal AuthenticateRequestDescriptor(Action<AuthenticateRequestDescriptor> configure) => configure.Invoke(this); | ||
|
||
public AuthenticateRequestDescriptor() | ||
{ | ||
} | ||
|
||
internal override ApiUrls ApiUrls => ApiUrlLookup.SecurityAuthenticate; | ||
|
||
protected override HttpMethod StaticHttpMethod => HttpMethod.GET; | ||
|
||
internal override bool SupportsBody => false; | ||
|
||
internal override string OperationName => "security.authenticate"; | ||
|
||
protected override void Serialize(Utf8JsonWriter writer, JsonSerializerOptions options, IElasticsearchClientSettings settings) | ||
{ | ||
} | ||
} |
53 changes: 53 additions & 0 deletions
53
...lastic.Clients.Elasticsearch.Serverless/_Generated/Api/Security/AuthenticateResponse.g.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// 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. | ||
// | ||
// ███╗ ██╗ ██████╗ ████████╗██╗ ██████╗███████╗ | ||
// ████╗ ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝ | ||
// ██╔██╗ ██║██║ ██║ ██║ ██║██║ █████╗ | ||
// ██║╚██╗██║██║ ██║ ██║ ██║██║ ██╔══╝ | ||
// ██║ ╚████║╚██████╔╝ ██║ ██║╚██████╗███████╗ | ||
// ╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝╚══════╝ | ||
// ------------------------------------------------ | ||
// | ||
// This file is automatically generated. | ||
// Please do not edit these files manually. | ||
// | ||
// ------------------------------------------------ | ||
|
||
#nullable restore | ||
|
||
using Elastic.Clients.Elasticsearch.Serverless.Fluent; | ||
using Elastic.Clients.Elasticsearch.Serverless.Serialization; | ||
using Elastic.Transport.Products.Elasticsearch; | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Elastic.Clients.Elasticsearch.Serverless.Security; | ||
|
||
public sealed partial class AuthenticateResponse : ElasticsearchResponse | ||
{ | ||
[JsonInclude, JsonPropertyName("api_key")] | ||
public Elastic.Clients.Elasticsearch.Serverless.Security.ApiKey? ApiKey { get; init; } | ||
[JsonInclude, JsonPropertyName("authentication_realm")] | ||
public Elastic.Clients.Elasticsearch.Serverless.Security.RealmInfo AuthenticationRealm { get; init; } | ||
[JsonInclude, JsonPropertyName("authentication_type")] | ||
public string AuthenticationType { get; init; } | ||
[JsonInclude, JsonPropertyName("email")] | ||
public string? Email { get; init; } | ||
[JsonInclude, JsonPropertyName("enabled")] | ||
public bool Enabled { get; init; } | ||
[JsonInclude, JsonPropertyName("full_name")] | ||
public string? FullName { get; init; } | ||
[JsonInclude, JsonPropertyName("lookup_realm")] | ||
public Elastic.Clients.Elasticsearch.Serverless.Security.RealmInfo LookupRealm { get; init; } | ||
[JsonInclude, JsonPropertyName("metadata")] | ||
public IReadOnlyDictionary<string, object> Metadata { get; init; } | ||
[JsonInclude, JsonPropertyName("roles")] | ||
public IReadOnlyCollection<string> Roles { get; init; } | ||
[JsonInclude, JsonPropertyName("token")] | ||
public Elastic.Clients.Elasticsearch.Serverless.Security.AuthenticateToken? Token { get; init; } | ||
[JsonInclude, JsonPropertyName("username")] | ||
public string Username { get; init; } | ||
} |
Oops, something went wrong.